/** * Codex app-server child process supervisor. * * Heavily simplified from claudemux's * `plugins/claudemux/core/src/engines/codex/supervisor.ts`. Differences: * - one process per Dispatcher, owned in-memory (no /tmp registry) * - no IPC bridge subprocess (the server holds the WS itself) * - no spawn lock / borrow lock (Dispatcher is the single owner) * - lifecycle bound to CodexRuntime, not a CLI invocation * * Issue #2 "implementation pitfalls": codex CLI is a node wrapper that spawns * the rust binary as a child; both land in the same process group. Reap must * SIGKILL the whole group, not just the leader, or the rust process leaks. */ export interface CodexProcessOptions { /** Unix socket path the daemon should listen on. */ socketPath: string; /** Working directory for the daemon. */ cwd: string; /** Where to log stdout. */ stdoutLogPath: string; /** Where to log stderr. */ stderrLogPath: string; /** Codex binary path, already resolved by `bin.ts`'s `resolveCodexBinPath`. */ binPath: string; /** Extra args after `app-server --listen unix://`. */ extraArgs?: string[]; /** Environment for the daemon. */ env?: NodeJS.ProcessEnv; /** Ready-probe timeout in ms (how long to wait for the socket to appear). */ readyTimeoutMs?: number; } export interface CodexProcessExit { code: number | null; signal: NodeJS.Signals | null; } export type CodexProcessExitHandler = (exit: CodexProcessExit) => void; /** A handle to one running codex app-server child process. */ export declare class CodexProcess { private readonly opts; readonly socketPath: string; readonly cwd: string; private supervisor; private _pid; private startTask; private reapTask; private reapRequested; private reaped; private readonly exitHandlers; constructor(opts: CodexProcessOptions); get pid(): number | null; onExit(handler: CodexProcessExitHandler): void; /** Spawn the daemon and resolve once its listen socket is bound. */ start(): Promise; private startProcess; /** SIGTERM → 1s wait → SIGKILL group. Idempotent. */ reap(): Promise; private reapProcess; private terminateSpawnedProcess; private assertStartAllowed; } //# sourceMappingURL=supervisor.d.ts.map