import type { ChildProcess } from 'child_process'; export interface WatchdogOptions { /** * Maximum seconds of stdout/stderr silence from the child before it is * treated as hung. The timer resets on every chunk of output. */ noProgressTimeoutSecs: number; /** * Milliseconds to wait between SIGTERM and SIGKILL after the watchdog * fires. Defaults to 10000 (10s). */ signalEscalationMs?: number; /** * Called once when the watchdog fires, before signals are sent. Receives * the time at which the last output chunk was seen. */ onStall?: (lastSeenAt: Date) => void; /** * Log prefix used in the "no output for Ns" message. Defaults to * "Sauce runner watchdog". */ tag?: string; } export interface WatchdogResult { exitCode: number | null; signal: NodeJS.Signals | null; watchdogFired: boolean; } /** * Watch a spawned child process for stdout/stderr silence and terminate it * if no output is produced within `noProgressTimeoutSecs`. Each chunk of * output is echoed to the parent's stdout/stderr so existing logs are * preserved, and the silence timer is reset. * * The child MUST be spawned with piped stdout and stderr (i.e. not * `stdio: 'inherit'`) so the parent can observe its output. */ export declare function runWithStdoutWatchdog(child: ChildProcess, opts: WatchdogOptions): Promise; //# sourceMappingURL=watchdog.d.ts.map