/** * What an autopilot run waits on a person for, as one list (autopilot-watcher-asks-person). * * The run's unattended agents can ask nobody, so every decision only a person can make ends * up in a file: a paused item and its question files, the decision log, `hold/`, `inbox/`, a * retro marker, a halted queue. `aidlc autopilot pending` reads them all and lists each as an * entry with options, and the session that started the run asks the person about each one, * then applies the answer with `aidlc autopilot answer` (`answers.ts`). * * Read-only, and pure over its inputs. Every string from a file was written by an agent, so it * goes through `oneLine` before it is listed (AC-13). * * Design: design.md C1 * * @module */ import { type RunMode } from '../roadmap/next.js'; import { type TriageTarget } from '../roadmap/triage.js'; import type { AutopilotState, RunRecord } from './state.js'; export declare const PENDING_KINDS: readonly ["phase-question", "awaiting-review", "open-question", "interpretation", "parked", "triage", "retro-pending", "release-failed"]; export type PendingKind = (typeof PENDING_KINDS)[number]; export type PendingAction = { do: 'record'; } /** Run nothing: print `steps` for the person, from `cwd` (AC-20). */ | { do: 'handoff'; cwd: string; steps: string[]; } | { do: 'write-answer'; file: string; question: string; text: string; } | { do: 'triage'; item: string; to: TriageTarget; rank?: number; run?: RunMode; } | { do: 'retry'; instance: string; } /** Approve the phase the item paused after, as `aidlc autopilot approve` does (Q1: B). */ | { do: 'approve'; instance: string; } /** * Write `verdict` on each of `entries` in the log at `file`, as `aidlc autopilot review` does; * an entry is named by number and title, so a log rewritten since the list refuses (Q1: B). * `next` is printed after, for the person: what the verdict leaves them to do. */ | { do: 'verdict'; file: string; entries: { n: number; title: string; }[]; verdict: 'kept' | 'rejected'; next: string[]; }; export interface PendingOption { id: string; label: string; /** What choosing it does, in one line. */ consequence: string; recommended: boolean; /** For an open question: the option the agent already built. */ current: boolean; /** Only a person may apply it, in their own terminal; `answer` hands it to them. */ person: boolean; /** What the watching session runs: `aidlc autopilot answer `. */ command: string; /** The command it comes down to, for the message; null when it is `answer`'s own write or a record. */ applies: string | null; action: PendingAction; } export interface PendingEntry { fingerprint: string; kind: PendingKind; instance: string | null; /** The roadmap item's file name, for a roadmap entry. */ item: string | null; /** Blocks the run (holds it open or leaves it nothing to build), or only waits. */ blocks: boolean; /** When it started waiting, ISO date or time; null when unknown. */ since: string | null; question: string; /** At most two lines. */ summary: string[]; artifact: string | null; options: PendingOption[]; } export interface PendingInput { /** The primary checkout's project root. */ repo: string; state: AutopilotState; run: RunRecord | null; /** The file's text, or null when absent or unreadable (AC-14). */ read: (path: string) => string | null; /** The names in a directory; [] when absent or unreadable (AC-14). */ listDir: (dir: string) => string[]; /** A parked instance's worktree, from the registry; null when unknown. */ worktreeOf: (instance: string) => string | null; /** The retro-pending marker directory. */ retroDir: string; } /** The first 12 hex digits of the sha256 of `parts`: stable across sessions, new when a part changes (design D4). */ export declare function fingerprint(parts: readonly string[]): string; export declare const FINGERPRINT_RE: RegExp; /** The command that applies an option; the one place it is spelled. */ export declare const answerCommand: (fp: string, id: string) => string; /** Every entry, less those `answered` names, in asking order (AC-1..AC-14). */ export declare function collectPending(input: PendingInput, answered: ReadonlySet): PendingEntry[]; /** `pending --json`: the run, and every entry without its internal action (AC-1, AC-2). */ export declare function pendingJson(run: RunRecord | null, entries: readonly PendingEntry[]): string; /** `pending` without `--json` (AC-15). */ export declare function pendingText(entries: readonly PendingEntry[]): string[]; //# sourceMappingURL=pending.d.ts.map