import { execFile as execFileCallback } from "node:child_process"; import type { Readable, Writable } from "node:stream"; declare const execFile: typeof execFileCallback.__promisify__; export type CodexCliParticipantRole = "planning" | "watchdog" | "driver"; export interface CodexCliSubscriptionStatus { loggedIn: boolean; authMode?: "ChatGPT" | "API key" | "unknown"; } export interface CodexCliParticipantSession { /** Codex owns and interprets this value; Agent Native only persists it. */ resumeSessionId?: string; } export interface CodexCliParticipantEvent { [key: string]: unknown; } export interface CodexCliParticipantResult { exitCode: number; events: CodexCliParticipantEvent[]; stderr: string; stderrTruncated: boolean; resumeSessionId?: string; } export interface CodexCliParticipantChild { stdin: Writable; stdout: Readable; stderr: Readable; kill(signal?: NodeJS.Signals): boolean; once(event: "error", listener: (error: Error) => void): unknown; once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): unknown; } export interface CodexCliParticipantSpawnOptions { cwd: string; env: NodeJS.ProcessEnv; shell: false; stdio: ["pipe", "pipe", "pipe"]; } export type CodexCliParticipantSpawn = (command: string, args: string[], options: CodexCliParticipantSpawnOptions) => CodexCliParticipantChild; export interface RunCodexCliParticipantOptions { role: CodexCliParticipantRole; prompt: string; cwd: string; model?: string; session?: CodexCliParticipantSession; /** Drivers remain read-only unless this explicit capability is true. */ allowWorkspaceWrite?: boolean; /** Either the fixed CLI name or an absolute executable path for packaged apps. */ command?: string; signal?: AbortSignal; env?: NodeJS.ProcessEnv; maxEvents?: number; maxStreamBytes?: number; maxStderrBytes?: number; timeoutMs?: number; terminationGraceMs?: number; forceSettleMs?: number; onEvent?: (event: CodexCliParticipantEvent) => void; preflight?: (context: CodexCliParticipantPreflightContext) => Promise; spawnProcess?: CodexCliParticipantSpawn; } export interface CodexCliParticipantPreflightContext { command: string; env: NodeJS.ProcessEnv; } export declare class CodexCliSubscriptionRequiredError extends Error { constructor(); } export interface CodexCliSubscriptionStatusOptions { command?: string; env?: NodeJS.ProcessEnv; execute?: typeof execFile; } export declare function readCodexCliSubscriptionStatus(options?: CodexCliSubscriptionStatusOptions): Promise; export declare function runCodexCliParticipant(options: RunCodexCliParticipantOptions): Promise; export declare function buildCodexCliParticipantArgs(options: Pick): string[]; export declare const CODEX_CLI_PARTICIPANT_TESTED_VERSION = "0.144.3"; export {}; //# sourceMappingURL=codex-cli-participant.d.ts.map