export type CliRunResult = { stdout: string; stderr: string; exitCode: number | null; signal: NodeJS.Signals | null; }; export type ParsedCodingOutput = { text: string; structured?: unknown; }; export declare function parseClaudeJsonOutput(stdout: string): ParsedCodingOutput; /** * OpenCode may emit NDJSON or a single JSON blob depending on version and flags. * We take the last successfully parsed object and prefer common text fields. */ /** * Codex CLI (`codex exec --json`) emits NDJSON events. * We collect every `item.completed` event whose `item.type` is `"agent_message"`, * join their `text` fields, and surface the `turn.completed` payload as structured data. * Non-JSON lines (e.g. "Reading additional input from stdin...") are silently skipped. */ export declare function parseCodexJsonOutput(stdout: string): ParsedCodingOutput; export declare function parseOpenCodeJsonOutput(stdout: string): ParsedCodingOutput; export type ClaudeDriverInput = { cliPath: string; prompt: string; cwd: string; env: NodeJS.ProcessEnv; timeoutMs: number; useBare: boolean; allowedTools?: string; permissionMode?: string; maxTurns?: number; maxBudgetUsd?: number; extraArgs?: string[]; }; export declare function runClaudeCodeCli(input: ClaudeDriverInput): Promise<{ run: CliRunResult; parsed: ParsedCodingOutput; }>; export type CodexDriverInput = { cliPath: string; prompt: string; cwd: string; env: NodeJS.ProcessEnv; timeoutMs: number; model?: string; /** * Sandbox policy passed to `--sandbox`. * Defaults to `'read-only'` for safe scripted runs. * Use `'workspace-write'` to allow the agent to edit files in `cwd`. */ sandboxMode?: 'read-only' | 'workspace-write' | 'danger-full-access'; /** * When `true` (default) the session is not persisted to disk (`--ephemeral`). * Set to `false` if you need Codex to retain its session history. */ ephemeral?: boolean; /** Pass `--skip-git-repo-check` when `cwd` is not a git repository. */ skipGitRepoCheck?: boolean; extraArgs?: string[]; }; export declare function runCodexCli(input: CodexDriverInput): Promise<{ run: CliRunResult; parsed: ParsedCodingOutput; }>; export type OpenCodeDriverInput = { cliPath: string; prompt: string; cwd: string; env: NodeJS.ProcessEnv; timeoutMs: number; model?: string; agentName?: string; attachUrl?: string; extraArgs?: string[]; }; export declare function runOpenCodeCli(input: OpenCodeDriverInput): Promise<{ run: CliRunResult; parsed: ParsedCodingOutput; }>;