/** * Driving the user's own harness one turn at a time (aidlc-console/AC-20, * aidlc-console/AC-21, aidlc-console/AC-22, aidlc-console/AC-23, * aidlc-console/AC-24, aidlc-console/AC-26, aidlc-console/AC-30). * * Pure. Each turn is one process: Claude Code's `-p` with stream-json output, * or `codex exec --json`, resumed by the id the previous turn reported (design * D3). The message always travels on stdin, so a message starting with `-` is * never read as an option and long command output never meets argv limits. * * @module */ export type Harness = 'claude-code' | 'codex'; export declare const HARNESSES: readonly Harness[]; /** The harness as people call it. */ export declare const AGENT_LABEL: Readonly>; /** The program each harness runs, for the "not installed" message (aidlc-console/AC-28). */ export declare const PROGRAM: Readonly>; /** * The argv for one turn. `session` null starts a new session; `allowed` holds the * tool rules the user approved (aidlc-console/AC-23). Codex runs in its * workspace-write sandbox and takes no tool rules (aidlc-console/AC-24). */ export declare function turnArgv(harness: Harness, session: string | null, allowed?: readonly string[]): string[]; /** A tool Claude Code refused to run in a turn. */ export interface Denial { tool: string; input: Record; } export interface TurnEnd { session: string | null; /** What this turn cost, when the harness says. */ costUsd: number | null; /** Tokens this turn used, when the harness reports usage but no cost. */ tokens: number | null; denials: Denial[]; error: string | null; } /** One line for a tool call: the command for a shell, the path for a file tool, else the name. */ export declare function toolLine(name: string, input: unknown): string; /** * Folds a turn's stdout, line by line, into what to show and how it ended. * Unknown events and non-JSON lines are ignored, so a new harness event changes * nothing here (design: harness output drift). */ export declare class TurnParser { private readonly harness; private session; private costUsd; private tokens; private denials; private error; private codex; private sawResult; constructor(harness: Harness, session: string | null); /** The lines to show for one stdout line. */ push(line: string): string[]; private claudeEvent; private codexEvent; /** How the turn ended. `exitCode` is the process's, for a turn that wrote no result. */ end(exitCode: number | null): TurnEnd; } /** * The `--allowedTools` rule that allows exactly what was refused: the command for * Bash, else the tool by name (design D4). */ export declare function allowSpec(d: Denial): string; /** The question asked about a refused tool (aidlc-console/AC-23). */ export declare function denialQuestion(d: Denial): string; /** Output kept per command for the agent: the end matters most (exit status, errors). */ export declare const OUTPUT_KEEP = 4000; export interface PendingOutput { line: string; output: string; } /** * The message for a turn, with the console's command output since the last turn * in front of it (aidlc-console/AC-22). Each output is cut to its last * `OUTPUT_KEEP` characters. */ export declare function withPendingOutput(text: string, pending: readonly PendingOutput[]): string; /** The default harness from autopilot setup's saved agent command (aidlc-console/AC-26). */ export declare function defaultHarness(agentCommand: readonly string[] | undefined): Harness; /** The running-cost line after a turn (aidlc-console/AC-30). */ export declare function costLine(costUsd: number, tokens: number): string | null; //# sourceMappingURL=harness.d.ts.map