/** * Flight-recorder heartbeat โ€” the "progress" liveness signal from the * 2026-07-26 process-lifecycle plan (ยง4.4). * * A dedicated worker thread (immune to main-loop stalls) writes a small * heartbeat file every ~5s containing `{ts, eventLoopLagMs}`. The main * thread pings the worker every second with its own measured timer drift; * the worker combines that with how overdue the last ping is (its own * monotonic clock). The result: when the main event loop freezes, the file * KEEPS updating with a rising lag number โ€” so the supervisor can tell * "alive but stalled" from "dead", and the lag at kill time is on record. * * Clocks are never compared across threads: the main thread measures its * lag with its own performance.now() delta, the worker measures beat * staleness with its own. Both are monotonic within their thread. */ /** Where the supervisor looks for the heartbeat (keep in sync with SupervisorWorker.cs). */ export declare const HEARTBEAT_FILE_PATH: string; export interface FlightRecorderOptions { filePath?: string; /** How often the main thread pings the worker (and measures its own lag). */ beatIntervalMs?: number; /** How often the worker writes the heartbeat file. */ writeIntervalMs?: number; } export interface FlightRecorderHandle { stop(): Promise; /** Test hook: crash the current worker thread to exercise the respawn path. */ crashWorkerForTest(): void; } /** * Start the flight recorder. Never throws โ€” a broken recorder must not take * down the server it instruments. Both the worker and the main-thread timer * are unref'd, so they never keep the process alive. */ export declare function startFlightRecorder(options?: FlightRecorderOptions): FlightRecorderHandle; //# sourceMappingURL=flight-recorder.service.d.ts.map