import { type PreparedOutputDirectory } from "./selected-output-paths.js"; export declare const CODEX_APP_SERVER_TRACE_SCHEMA = "humanish.codex-app-server-trace.v1"; type JsonObject = Record; type JsonRpcId = number | string; export type CodexAppServerStatus = "passed" | "failed" | "blocked" | "timed_out"; export interface CodexAppServerRunOptions { cwd: string; prompt: string; runRoot: string; timeoutMs: number; actorCommand?: string[]; approvalPolicy?: "never" | "on-failure" | "on-request" | "untrusted"; experimentalApi?: boolean; model?: string; sandbox?: "read-only" | "workspace-write" | "danger-full-access"; serviceName?: string; } export interface CodexAppServerRunResult { status: CodexAppServerStatus; reason: string; durationMs: number; exitCode?: number; signal?: NodeJS.Signals; threadId?: string; turnId?: string; sessionId?: string; model?: string; codexCliVersion?: string; experimentalApi: boolean; counts: CodexAppServerTrace["counts"]; tail: string; trace: CodexAppServerTrace; transcriptPath: string; tracePath: string; eventsPath: string; } export interface CodexAppServerTrace { schema: typeof CODEX_APP_SERVER_TRACE_SCHEMA; provider: "codex-app-server"; protocolVersion: "v2"; redaction: { status: "passed"; notes: string; }; client: { name: "humanish_cli"; title: "Humanish CLI"; experimentalApi: boolean; }; server: { commandName: string; codexCliVersion?: string; transport: "stdio"; }; cwd: string; promptDigest: string; startedAt: string; completedAt: string; durationMs: number; status: CodexAppServerStatus; reason: string; threadId?: string; turnId?: string; sessionId?: string; model?: string; counts: { approvals: number; commandOutputs: number; envelopes: number; errors: number; fileChanges: number; itemCompletions: number; itemStarts: number; messages: number; reasoning: number; requests: number; responses: number; tools: number; warnings: number; }; methods: Record; items: CodexTraceItem[]; messages: CodexTraceText[]; reasoning: CodexTraceText[]; plans: CodexTracePlan[]; commands: CodexTraceCommand[]; fileChanges: CodexTraceFileChange[]; tools: CodexTraceToolCall[]; approvals: CodexTraceApproval[]; warnings: CodexTraceNotice[]; errors: CodexTraceNotice[]; tokenUsage?: JsonObject; } export interface CodexTraceItem { id: string; type: string; status?: string; lifecycle: "started" | "completed"; title: string; } export interface CodexTraceText { itemId: string; text: string; } export interface CodexTracePlan { explanation?: string; steps: string[]; } export interface CodexTraceCommand { itemId: string; command?: string; cwd?: string; status?: string; exitCode?: number; outputTail?: string; } export interface CodexTraceFileChange { itemId: string; status?: string; changeCount?: number; outputTail?: string; } export interface CodexTraceToolCall { itemId: string; kind: "mcp" | "dynamic" | "unknown"; server?: string; tool?: string; status?: string; } export interface CodexTraceApproval { id: JsonRpcId; method: string; itemId?: string; decision: "decline" | "denied" | "empty"; reason: string; } export interface CodexTraceNotice { method: string; message: string; } export declare function runCodexAppServerSession(options: CodexAppServerRunOptions): Promise; /** Internal UI seam: the selected root was already prepared and must not be re-authorized. */ export declare function runCodexAppServerSessionInPreparedRoot(options: CodexAppServerRunOptions, runRoot: PreparedOutputDirectory): Promise; export {};