/** * Pure function to build the diagnostics object for the Internals endpoint. * Extracted from ServerStatsProvider to reduce complexity. */ /** Minimal collector shape for diagnostics. */ interface CollectorRef { name: string; } /** Input data for building diagnostics. */ export interface DiagnosticsInput { intervalId: ReturnType | null; dashboardBroadcastTimer: ReturnType | null; debugBroadcastTimer: ReturnType | null; flushTimer: ReturnType | null; dashboardStoreReady: boolean; transmitAvailable: boolean; transmitChannels: string[]; prometheusActive: boolean; pinoHookActive: boolean; edgePluginActive: boolean; emailBridgeActive: boolean; hasCacheCollector?: boolean; hasQueueCollector?: boolean; resolvedCollectors?: CollectorRef[]; config: DiagnosticsConfig | null; /** Lucid connections that have debug: true (empty = no query events emitted). */ lucidDebugConnections?: string[]; } interface DiagnosticsConfig { intervalMs: number; transport: string; channelName: string; endpoint: string | false; skipInTest: boolean; onStats?: unknown; shouldShow?: unknown; devToolbar?: DiagnosticsToolbar; } interface DiagnosticsToolbar { enabled: boolean; maxQueries?: number; maxEvents?: number; maxEmails?: number; maxTraces?: number; slowQueryThresholdMs?: number; tracing?: boolean; dashboard?: boolean; dashboardPath?: string; retentionDays?: number; maxDbSizeMb?: number; dbPath?: string; persistDebugData?: boolean | string; debugEndpoint?: string; renderer?: string; excludeFromTracing?: string[]; panes?: unknown[]; } /** * Build the full diagnostics object from provider state. */ export declare function buildDiagnostics(input: DiagnosticsInput): { timers: { collectionInterval: { active: boolean; intervalMs: number; }; dashboardBroadcast: { active: boolean; intervalMs: number; }; debugBroadcast: { active: boolean; debounceMs: number; }; persistFlush: { active: boolean; intervalMs: number; }; retentionCleanup: { active: boolean; intervalMs: number; }; }; transmit: { available: boolean; channels: string[]; }; integrations: { prometheus: { active: boolean; }; pinoHook: { active: boolean; mode: string; }; edgePlugin: { active: boolean; }; emailBridge: { active: boolean; }; cacheInspector: { available: boolean; }; queueInspector: { available: boolean; }; }; config: { intervalMs: number; transport: string; channelName: string; endpoint: string | false; skipInTest: boolean; hasOnStatsCallback: boolean; hasShouldShowCallback: boolean; }; devToolbar: { tracing: boolean; dashboard: boolean; retentionDays: number; maxDbSizeMb: number; persistDebugData: string | boolean; renderer: string; excludeFromTracing: string[]; customPaneCount: number; dashboardPath: string; debugEndpoint: string; dbPath: string; maxQueries: number; maxEvents: number; maxEmails: number; maxTraces: number; slowQueryThresholdMs: number; enabled: boolean; }; lucidDebugConnections: string[]; }; export {};