/** * @file health.service.ts * @description Core health and readiness orchestrator. */ import type { HealthOptionsInterface, ServerInfoOptions } from '../common'; import type { HealthProbe, HealthzResponse, ReadyzResponse } from './health.types'; /** * Minimal scope interface for auto-discovery. * Avoids importing the full Scope class to prevent circular dependencies. */ export interface HealthScopeView { readonly transportService: { pingSessionStore(): Promise; }; readonly tools: { getTools(includeHidden?: boolean): Array<{ name: string; }>; }; readonly resources: { getResources(includeHidden?: boolean): unknown[]; }; readonly prompts: { getPrompts(includeHidden?: boolean): unknown[]; }; readonly skills: { getSkills(includeHidden?: boolean): unknown[]; }; readonly agents: { getAgents(): unknown[]; }; readonly apps: { getApps(): Array<{ readonly id: string; readonly isRemote: boolean; getMcpClient?(): { getHealthStatus(appId: string): unknown; }; }>; }; readonly haManager?: { isStarted(): boolean; isNodeAlive(nodeId: string): Promise; getNodeId(): string; }; } export declare class HealthService { private readonly probes; private readonly config; private readonly serverInfo; private scopeView?; constructor(config: HealthOptionsInterface, serverInfo: ServerInfoOptions); /** * Register a health probe. */ registerProbe(probe: HealthProbe): void; /** * Auto-discover and register probes from scope infrastructure. * * Walks the scope's stores and registries to create built-in probes: * - Session store (if transport persistence is configured) * - Remote MCP apps (via existing HealthCheckManager) * - User-defined probes from config */ autoDiscoverProbes(scope: HealthScopeView): void; /** * Get liveness response. Synchronous, no I/O. */ getHealthz(): HealthzResponse; /** * Get readiness response. Runs all probes in parallel with per-probe timeout. */ getReadyz(): Promise; /** * Get the number of registered probes. */ getProbeCount(): number; /** * Get all registered probes (used for aggregation across scopes). */ getProbes(): readonly HealthProbe[]; /** * Set the scope view for catalog computation (used for composite services). */ setScopeView(scope: HealthScopeView): void; private runProbeWithTimeout; private computeCatalogInfo; private resolveIncludeDetails; } //# sourceMappingURL=health.service.d.ts.map