import { spawn } from 'node:child_process'; import { startLivenessWatcher } from './daemon/supervisor-liveness.js'; declare function appendSupervisorLog(message: string): Promise; declare function supervisorWarn(message: string): void; interface SupervisorLivenessConfig { enabled: boolean; shutdownGraceMs: number; } interface SupervisorLivenessDependencies { readPort(): Promise; loadApiHost(): Promise; apiPortExists(): boolean; startWatcher: typeof startLivenessWatcher; wait(ms: number): Promise; warn(message: string): void; } /** * Wire up the supervisor-liveness watchdog for a spawned worker child. * * Returns a `stop()` function the supervisor must call when the child * exits (cleanly or via SIGKILL). Returns a no-op if: * - The env gate is disabled (`DKG_SUPERVISOR_LIVENESS_PROBE=off`). * * Wraps the apiPort-read in a polling loop because the worker writes the * port file midway through boot, AFTER spawn returns. The loop stays alive * until the supervisor stops it; slow boots must still get liveness * protection once their HTTP listener is ready. */ declare function maybeStartSupervisorLivenessWatcher(child: { kill(signal: 'SIGKILL'): boolean; }, config?: SupervisorLivenessConfig, dependencyOverrides?: Partial): Promise<() => void>; declare function runDaemonSupervisor(): Promise; interface ForegroundWorkerIterationDependencies { clearApiPort(): Promise; spawnWorker(childEnv: NodeJS.ProcessEnv): ReturnType; startWorkerLiveness: typeof maybeStartSupervisorLivenessWatcher; warn(message: string): void; } interface ForegroundWorkerIterationResult { rawExitCode: number | null; forced: boolean; originalExitCode: number | null; } declare function runForegroundWorkerIteration(input: { childEnv: NodeJS.ProcessEnv; livenessConfig?: SupervisorLivenessConfig; onChild?: (child: ReturnType | null) => void; dependencies?: Partial; }): Promise; declare function runForegroundSupervisor(childEnv?: NodeJS.ProcessEnv): Promise; export { appendSupervisorLog, supervisorWarn, maybeStartSupervisorLivenessWatcher, runForegroundWorkerIteration, runDaemonSupervisor, runForegroundSupervisor, }; //# sourceMappingURL=cli-supervisor.d.ts.map