import { type FastifyInstance } from 'fastify'; import type { ChildProcessManager, ChildProcessState } from '../services/child-process-manager.js'; import type { PluginLoader } from '../plugins/loader.js'; import type { PluginHealthStatus } from '../plugins/types.js'; import type { PluginAutoUpdateService } from '../services/plugin-auto-update.js'; import type { NpmAutoUpdateService } from '../services/npm-auto-update.js'; export interface HealthStatus { status: 'healthy' | 'degraded' | 'unhealthy'; timestamp: string; uptime: number; version: string; websocket: { certificates: { connected: boolean; lastEvent?: string; }; secrets: { connected: boolean; lastEvent?: string; }; }; vault: { url: string; reachable: boolean; }; certificates: { total: number; synced: number; errors: number; }; secrets: { total: number; synced: number; errors: number; }; childProcess?: ChildProcessState; plugins?: PluginHealthStatus[]; } /** * Update WebSocket connection status for certificates */ export declare function setWebSocketStatus(connected: boolean, eventTime?: Date): void; /** * Update WebSocket connection status for secrets */ export declare function setSecretWebSocketStatus(connected: boolean, eventTime?: Date): void; /** * Update vault reachability status */ export declare function setVaultReachable(reachable: boolean): void; /** * Update certificate sync status */ export declare function updateCertStatus(synced: number, errors: number): void; /** * Update secret sync status */ export declare function updateSecretStatus(synced: number, errors: number): void; /** * Set child process manager for health status reporting */ export declare function setChildProcessManager(manager: ChildProcessManager | null): void; /** * Set plugin loader for health status aggregation and route registration */ export declare function setPluginLoader(loader: PluginLoader | null): void; /** * Set plugin auto-update service for version checking and updates via HTTP */ export declare function setPluginAutoUpdateService(service: PluginAutoUpdateService | null): void; /** * Set npm auto-update service for agent version checking and updates via HTTP */ export declare function setNpmAutoUpdateService(service: NpmAutoUpdateService | null): void; /** * Get current health status */ export declare function getHealthStatus(): Promise; /** * Start the health HTTP server */ export declare function startHealthServer(port?: number, loader?: PluginLoader, host?: string): Promise; /** * Start the HTTPS health server with TLS */ export declare function startHTTPSHealthServer(port: number | undefined, certPath: string, keyPath: string, loader?: PluginLoader, host?: string): Promise; /** * Hot-reload HTTPS server certificate (called by TLS certificate manager) */ export declare function reloadHTTPSCertificate(certPath: string, keyPath: string): Promise; /** * Stop the health HTTP server */ export declare function stopHealthServer(): Promise; /** * Stop the HTTPS health server */ export declare function stopHTTPSHealthServer(): Promise; /** * Check if health server is running */ export declare function isHealthServerRunning(): boolean; /** * Check if HTTPS health server is running */ export declare function isHTTPSHealthServerRunning(): boolean; /** * Get the Fastify instance (for testing or advanced use) */ export declare function getFastifyInstance(): FastifyInstance | null; /** * Get the HTTPS Fastify instance */ export declare function getHTTPSFastifyInstance(): FastifyInstance | null; //# sourceMappingURL=health.d.ts.map