import * as child_process from "node:child_process"; import type { SessionRecord } from "./types.js"; export interface RunResult { exitCode: number | null; conversationId?: string; resumeUnsupported?: boolean; fallbackToCli?: boolean; } export interface RunningProcess { child?: child_process.ChildProcess; pid?: number; kill: (signal?: NodeJS.Signals) => void; } /** * Spawn a CLI process for a session turn. * Captures stdout/stderr line-by-line to output.jsonl. * Monitors output for conversation ID extraction. * Calls `onFinished` when the process exits. */ export declare function spawnTurn(session: SessionRecord, prompt: string, turnOpts: { mode?: string; model?: string; }, onOutputDelta: (lines: number, bytes: number) => void, onFinished: (result: RunResult) => void): RunningProcess; /** * Codex `exec` sessions are stored with source=exec, which hides them from the * interactive `codex resume` picker (it only lists source=cli). Patch the session * file's first line so the session appears in the picker alongside native sessions. */ export declare function patchCodexSessionSource(threadId: string): void;