import { AgentHealthStore } from './agent-health.store.js'; import type { AgentRestartCommand } from './agent-restart-command.store.js'; import type { AgentHealthReason, AgentHealthState, AgentRestartOutcome, AgentRestartStatusSummary, AgentRuntimeHandleSnapshot, AgentRuntimeHealthSummary } from '../../shared/snapshot.js'; export declare const PROVIDER_RATE_LIMIT_GRACE_MS = 60000; export declare const PROVIDER_RATE_LIMIT_RED_STALE_MS: number; export declare const STARTING_TIMEOUT_MS = 30000; export declare const RUNTIME_CHILD_HEALTH_DEBOUNCE_MS = 10000; export declare const FRESH_RUNNING_STALE_GRACE_MS = 10000; export interface HealthWriteInput { agentId: string; clearProviderFailure?: boolean; reason?: AgentHealthReason; restart?: AgentRestartStatusSummary; runtime?: AgentRuntimeHandleSnapshot; state: AgentHealthState; updatedAt: string; } export interface ProviderFailureInput { agentId: string; reason: AgentHealthReason; runtime?: AgentRuntimeHandleSnapshot; updatedAt: string; } export declare class AgentHealthService { private readonly store; constructor(store?: AgentHealthStore); ensureDirectory(): Promise; get(agentId: string): Promise; clear(agentId: string): Promise; writeHealth(input: HealthWriteInput): Promise; writeProviderFailure(input: ProviderFailureInput): Promise; } export declare const defaultAgentHealthService: AgentHealthService; export declare function applyHealthWrite(previous: AgentRuntimeHealthSummary | undefined, input: Omit): AgentRuntimeHealthSummary; export declare function applyProviderFailure(previous: AgentRuntimeHealthSummary | undefined, input: Omit): AgentRuntimeHealthSummary; export declare function runtimeHandleHealth(runtime: AgentRuntimeHandleSnapshot | undefined, previous: AgentRuntimeHealthSummary | undefined, nowIso: string): { reason?: AgentHealthReason; state: 'degraded' | 'healthy' | 'unhealthy'; updatedAt: string; }; export declare function startingTimeoutHealth(snapshot: AgentRuntimeHealthSummary, nowIso: string): AgentRuntimeHealthSummary | undefined; export declare function isStaleRunningItem(input: { active?: { startedAt?: string; workerId: string; }; activeItemMismatchGraceMs: number; includeProviderChildCheck: boolean; nowMs: number; runningItemId: string; runtime: AgentRuntimeHandleSnapshot | undefined; }): boolean; export declare function deriveApiHealth(snapshot: AgentRuntimeHealthSummary | undefined, queue: { active?: { startedAt?: string; workerId: string; }; runningItemId?: string; }, nowIso: string): AgentRuntimeHealthSummary; export declare function restartStatus(command: AgentRestartCommand, outcome: AgentRestartOutcome, nowIso: string, runtime?: AgentRuntimeHandleSnapshot, reason?: AgentHealthReason): AgentRestartStatusSummary; export declare function isProviderFailureReason(reason: AgentHealthReason | undefined): boolean; //# sourceMappingURL=agent-health.service.d.ts.map