/** * Shared low-level utilities (process kill/reap, id minting) used across the * supervisor stack — LongRunningSupervisor and the orphan sweep. * * Extracted so the kill/reap machinery is maintained in one place. */ import type { ChildProcess } from "../../utils/safe-spawn.js"; import type { Logger } from "../../utils/logger.js"; /** * Send SIGTERM to `child` (and its process group), then SIGKILL after the * grace period if still alive. Safe to call on an already-dead child. * * Returns once the child (and any stragglers found in the pre-kill descendant * snapshot) are all gone. */ export declare function killChild(child: ChildProcess, reason: string, graceMs: number, logger: Logger): Promise; /** * SIGKILL any pids from a pre-kill descendant snapshot that are still alive. */ export declare function reapSurvivors(pids: number[], sig: "SIGKILL", logger: Logger): void; /** * Signal the child's process group (negative pid) when detached, falling back * to the direct child. Returns false if the process is already gone. */ export declare function signalChild(child: ChildProcess, sig: "SIGTERM" | "SIGKILL"): boolean; /** * Collect every transitive descendant pid of `rootPid` by reading the full * process table once and walking the ppid graph. * * POSIX-only (uses `ps`). Returns empty list on Windows or if `ps` is * unavailable. `rootPid` itself is NOT included. */ export declare function collectDescendants(rootPid: number, logger: Logger): number[]; export declare function errorMessage(err: unknown): string; export declare function isErrno(err: unknown, code: string): boolean; export declare function makeId(prefix: string): string; //# sourceMappingURL=supervisor-utils.d.ts.map