import { type AgentRunner, type VerifyRunner } from "./agent-runner.js"; import { type ExecutionFitClassification } from "./execution-fit.js"; import type { Finding } from "./findings.js"; export { defaultAgentRunner, defaultVerifyRunner, sanitizedEnvironment, type AgentInvocation, type AgentRunner, type CommandResult, type VerifyRunner, } from "./agent-runner.js"; export interface BuildProgramOptions { cwd: string; programId: string; startFrom?: string; dryRun?: boolean; approve?: boolean; /** Overrides `build.commit`; the CLI passes false for `--no-commit`. */ commit?: boolean; agentRunner?: AgentRunner; verifyRunner?: VerifyRunner; now?: () => Date; /** Called with a human-readable line for each key build event. */ onProgress?: (line: string) => void; } export interface PlanEntry { id: string; name: string; taskFile: string; action: "run" | "skip"; reason?: string; } export interface WorkstreamOutcome { id: string; status: "complete" | "failed"; attempts: number; agentExitCodes: number[]; failedCommand?: string; /** Per-run log containing prompts, agent output, and verification failures. */ logPath: string; executionFit: { classification: ExecutionFitClassification; workingSetTokens: number; lowerBoundTokens: number; upperBoundTokens: number; }; /** Short SHA of the runner's commit for this workstream, when it committed. */ commit?: string; /** * The agent's own account of its last attempt, verbatim. Present whether * the workstream passed or failed — on a failure it is usually the most * informative line in the whole run. */ summary?: string; } export type BuildOutcome = "COMPLETE" | "FAILED" | "ABORTED" | "PLANNED" | "APPROVAL_REQUIRED"; /** * A validator agent's opinion of the tests a workstream agent wrote. Advisory * by design: it never blocks a commit that passed independent verification. */ export interface TestCritiqueRecord { id: string; findings: Finding[]; /** The validator's own account of the review, verbatim. */ summary?: string; } export interface BuildProgramResult { programId: string; result: BuildOutcome; reason?: string; /** The resolved agent invocation (command and args), when configured. */ agent?: string; /** Dedicated recovery invocation, when it differs from the build agent. */ recoveryAgent?: string; plan: PlanEntry[]; outcomes: WorkstreamOutcome[]; /** Populated when `build.critiqueTests` is enabled. */ testCritiques?: TestCritiqueRecord[]; eventsPath?: string; } interface AgentOutputSignal { kind: "unverified" | "terminal"; reason: string; } /** * Recognize provider-neutral failure statements printed by agent CLIs. Some * CLIs exit zero after recording an explicitly unverified submission; a zero * process status is not a successful implementation contract. */ export declare function classifyAgentOutput(output: string): AgentOutputSignal | undefined; export interface CommitResult { /** Short SHA of the commit the runner created. */ sha?: string; /** Set when there was nothing to commit. */ empty?: boolean; /** Set when git refused the commit (hooks, identity, index state). */ error?: string; } export declare function buildProgram(options: BuildProgramOptions): Promise; //# sourceMappingURL=build-program.d.ts.map