import type { CallbackActivity } from "../../core/callback-activity.ts"; export interface ActivityWatchdogThresholds { diagnosticMs: number; unresponsiveMs: number; pollMs: number; } export interface ActivityWatchdogDiagnostic { activity: CallbackActivity | undefined; elapsedMs: number; level: "blocking" | "unresponsive"; message: string; /** * Set when the diagnostic is operational rather than a concrete engine * failure: `"watchdog"` for heartbeat-gap reports, `"recovery"` for calm * engine replacement status, or `"stderr"` for child diagnostics. */ source?: "watchdog" | "recovery" | "stderr"; } /** * Chat-surface policy for engine diagnostics. Heartbeat-watchdog gaps and * engine-recovery status stay internal: the TUI remains responsive and both are * operational noise rather than a concrete engine failure. Concrete engine * failures (RPC errors, a restart that could not complete) always surface. */ export declare function shouldRenderEngineDiagnosticAsChatError(diagnostic: ActivityWatchdogDiagnostic): boolean; export interface ActivityWatchdogOptions { now?: () => number; onDiagnostic: (diagnostic: ActivityWatchdogDiagnostic) => void; thresholds?: Partial; } /** * How long the engine may go without a heartbeat before it counts as * unresponsive. Shared with EngineHealthController so the watchdog's verdict and * the explicit Ctrl+C escape hatch use one seconds-scale threshold, not two. */ export declare const ENGINE_UNRESPONSIVE_MS = 1000; export declare class ActivityWatchdog { private readonly now; private readonly onDiagnostic; private readonly thresholds; private lastHeartbeatAt; private readonly activities; private timer; private emittedBlocking; private emittedUnresponsive; constructor(options: ActivityWatchdogOptions); start(): void; stop(): void; heartbeat(): void; activityStarted(activity: CallbackActivity): void; activityFinished(activityId: string): void; private inspect; private emit; } //# sourceMappingURL=activity-watchdog.d.ts.map