/** * codex-runner.ts — OpenAI Codex CLI process management * * Mirrors `claude-runner.ts`. Spawns the `codex` CLI binary with the user * prompt, streams output, captures token usage when reported by the CLI. * * Codex CLI: https://github.com/openai/codex * Default invocation pattern: `codex exec --json -m -- ` * - `exec`: run a one-shot prompt and exit (non-interactive) * - `--json`: emit JSON-line events on stdout for streaming integrations * - `-m, --model`: override the model * - `--`: separator before raw prompt (when not using --stdin) * * Auth: Codex CLI handles its own authentication via `codex login` (OAuth * with ChatGPT account) or environment variables it reads itself. We don't * inject anything into the spawn env — we just inherit the parent process env * so the user's local Codex login is used as-is. */ import type { ChainStep } from "./types.js"; import type { ClaudeResult, ProcessTracker } from "./claude-runner.js"; export declare function validateCodexBinary(): void; export declare function isCodexAvailable(): boolean; /** * Spawns `codex exec` with the given prompt and step config. Streams output * via `onChunk` and resolves with the full result + token counts. * * Authentication is handled by the Codex CLI itself (codex login / OAuth / * env vars). The spawn inherits the parent process env so the user's local * Codex authentication is used as-is. */ export declare function runCodex(prompt: string, step: ChainStep, onChunk: (chunk: string) => void, executionId?: string, timeoutMs?: number, processTracker?: ProcessTracker): Promise;