import { type ChildProcess } from "node:child_process"; import { type JobScopeLauncher } from "./job-scope.js"; import type { JobMeta, StartAbortReason } from "./job-types.js"; type ProcessVerdict = "ours" | "gone" | "unverifiable"; export interface SpawnJobOptions { jobsRoot: string; meta: JobMeta; callerEnv: Record | undefined; resolveOperator?: () => Promise; scopeLauncher: () => JobScopeLauncher | null; abortedStart: () => StartAbortReason | null; onExit: (code: number | null, signal: NodeJS.Signals | null) => void; } export declare function spawnJob(opts: SpawnJobOptions): Promise<{ child: ChildProcess; pid: number; scope?: string; }>; /** Retry once because a transient identity miss otherwise rejects the whole start. */ export declare function captureProcIdentity(pid: number): string | null; /** * Distinguishes proof of ownership, proof of absence, and an inconclusive hold. * A null pid is gone because failed or unrecorded starts leave nothing to probe; * ESRCH also proves absence. EPERM still permits an identity probe, while a * missing, legacy, or unparseable identity remains unverifiable. */ export declare function verifyJobProcess(meta: JobMeta): ProcessVerdict; export declare function signalSpawned(child: ChildProcess, pid: number, signal: "SIGTERM" | "SIGKILL"): void; export declare function signalProcessTree(pid: number, signal: "SIGTERM" | "SIGKILL"): void; export {};