/** * What autopilot sends a preset agent so that it can read back how the session ended * (autopilot-reads-agent-result/AC-1..AC-5, AC-17, AC-18, AC-23, AC-33). * * The read side is `result.ts`. Both are pure; the driver sequences them. Nothing here * is saved to the machine config: the flags are added at launch, so a machine set up * before this change gets them without running setup again. * * @module */ export type Harness = 'claude' | 'codex'; export declare const OUTCOMES: readonly ["shipped", "paused", "parked", "blocked"]; export type Outcome = (typeof OUTCOMES)[number]; export interface AgentOutcome { outcome: Outcome; reason: string; instance: string; phase: string; } /** * The outcome the agent ends with: exactly these four keys, each a required string * (autopilot-reads-agent-result/AC-4). `additionalProperties: false` with every key * required is also what Codex's `--output-schema` insists on. */ export declare const OUTCOME_SCHEMA: { readonly type: "object"; readonly properties: { readonly outcome: { readonly type: "string"; readonly enum: readonly ["shipped", "paused", "parked", "blocked"]; }; readonly reason: { readonly type: "string"; }; readonly instance: { readonly type: "string"; }; readonly phase: { readonly type: "string"; }; }; readonly required: readonly ["outcome", "reason", "instance", "phase"]; readonly additionalProperties: false; }; /** * 8, 4, 4, 4 and 12 hexadecimal digits. The only session id that reaches an argv or a * park reason: the cost providers' `SESSION_ID_RE` accepts `--dangerously-skip-permissions`, * which `--resume` would read as a flag (autopilot-reads-agent-result/AC-33). */ export declare const UUID_RE: RegExp; /** * The harness whose preset this exact argv is, or null for a custom command, which is * launched as configured (autopilot-reads-agent-result/AC-1..AC-3). Exact, not "starts * with `claude`": a custom command may be a wrapper that rejects the flags. */ export declare function typedHarness(command: readonly string[]): Harness | null; export interface TypedArgs { harness: Harness; prompt: string; /** Codex only: both under `/aidlc/autopilot/` (autopilot-reads-agent-result/AC-2). */ schemaFile: string; outcomeFile: string; /** * Codex only: the one directory beyond the worktree its sandbox may write. A linked * worktree's index, objects and refs live there, so without it no commit and no `aidlc` * claim can succeed (codex-sandbox-blocks-commit/AC-1, AC-4). */ gitCommonDir: string; /** Claude only: `--max-budget-usd` in whole cents; null adds no flag (autopilot-reads-agent-result/AC-17). */ maxBudgetCents: number | null; /** The session to resume; null for a fresh launch (autopilot-reads-agent-result/AC-23). */ resume: string | null; } /** * The preset argv with `{prompt}` substituted and the typed flags added; null when * `resume` is not a UUID. Checked here, where the id enters the argv, and not only where * it was read: it reaches this call through `state.json`, which a person or a scoped * agent can edit (autopilot-reads-agent-result/AC-33). * * Codex's flags go before the prompt so that a resume is a splice — `resume ` where * the prompt was, after every option `codex exec` defines (design D4). Also null for a * Codex launch whose git common dir is not absolute: a relative one would grant whatever * directory Codex starts in (codex-sandbox-blocks-commit/AC-4). */ export declare function typedArgv(command: readonly string[], args: TypedArgs): string[] | null; export declare function withOutcomeContract(prompt: string): string; export type StopLabel = 'connection dropped' | 'session limit' | 'ended before the release boundary'; /** * Autopilot's own words for a resumed session, never text from the agent: the session * already holds its original instructions (autopilot-reads-agent-result/AC-23). A session * that ended early is told why it most likely did — it ended its turn to wait for a * command, which the end of the turn killed (unattended-agent-ends-turn-to-wait/AC-4). */ export declare function resumePrompt(item: { name: string; }, why: StopLabel): string; /** * Whole cents of budget left: the cap, less what the item spent, less 10% of the cap, * rounded down (autopilot-reads-agent-result/AC-17). In integer micro-dollars, as the * rate table prices: in dollars, 4.50 can come out as 449 cents. Negative when the item * is past the cap less the margin. */ export declare function budgetCents(capUsd: number, spentMicro: number): number; /** '13.50' for 1350. */ export declare function centsText(cents: number): string; //# sourceMappingURL=typed.d.ts.map