import { spawn, type ChildProcess } from 'node:child_process'; import { type CgroupOomSnapshot } from './oxigraph-memory.js'; export declare const OXIGRAPH_WATCHDOG_OOM_MARKER = "[oxigraph-watchdog] scoped child OOM-killed by cgroup memory cap (or host OOM)"; export interface OxigraphParentWatchdogOptions { parentPid: number; command: string; args: readonly string[]; pollIntervalMs?: number; spawnChild?: typeof spawn; isProcessAlive?: (pid: number) => boolean; readOomSnapshot?: (pid: number) => CgroupOomSnapshot | null; readOomKill?: (dir: string) => number | null; } export interface OxigraphParentWatchdogResult { code: number | null; signal: NodeJS.Signals | null; parentLost: boolean; oomKilled: boolean; } export interface OxigraphParentWatchdogHandle { child: ChildProcess; result: Promise; stop(signal?: NodeJS.Signals): void; } /** * Keep Oxigraph tied to the DKG daemon even though systemd places it in a * sibling cgroup. The typed watchdog forwards shutdown signals and terminates * Oxigraph within one poll interval if the original daemon PID disappears. */ export declare function startOxigraphParentWatchdog(opts: OxigraphParentWatchdogOptions): OxigraphParentWatchdogHandle; export declare function parseOxigraphParentWatchdogArgs(argv: readonly string[]): { parentPid: number; command: string; args: string[]; }; export declare function conventionalSignalExitCode(signal: NodeJS.Signals): number; //# sourceMappingURL=oxigraph-parent-watchdog.d.ts.map