import type { HaltReason, RepoOutcome } from '../types.js'; import { type BuildDispatcher } from './dispatchers.js'; export interface RunLoopOptions { readonly workspaceRoot: string; readonly stackRepos: ReadonlyArray<{ readonly name: string; readonly path: string; }>; readonly maxIterations: number; readonly maxConsecutiveFailures?: number; readonly maxFailuresPerSlug?: number; readonly buildIterations?: number; readonly mergeWaitTimeoutMs?: number; readonly mainGreenTimeoutMs?: number; readonly maxDiffLines?: number; readonly maxDiffFiles?: number; readonly githubLabel?: string; readonly includeProposed?: boolean; readonly aiPropose?: boolean; /** Cost cap in USD for this run. Halts on overshoot. Default: no cap. */ readonly maxCostUsd?: number; /** Webhook URL for halt + ship notifications. */ readonly webhookUrl?: string; readonly webhookAuthHeader?: string; /** * Per-scope Claude model overrides. Any scope left unset falls back to * the factory's built-in default (`claude-sonnet-4-6`) or the `claude` * CLI's default for `build` / `mergeResolver`. */ readonly models?: { readonly grill?: string; readonly propose?: string; readonly build?: string; readonly mergeResolver?: string; }; /** * Run a Claude-driven self-grill pass after writing the minimal PRD, * filling out per-repo blocks, cross-repo deps, open questions, and * acceptance criteria. Default true when an inference backend is * available; the grill module itself skips if not. */ readonly selfGrill?: boolean; /** * When the `claude` CLI is not on PATH, allow falling back to direct * Anthropic API calls using `ANTHROPIC_API_KEY`. Without this flag, the * runner prompts on TTY or skips AI features in non-interactive mode. */ readonly allowApiKeyFallback?: boolean; /** * When the self-grill phase errors (e.g., schema validation, network), * the default is to halt the iteration as failed so the slug counts * toward `failuresBySlug` (engaging the quarantine guardrail) and we * don't burn implementer budget on a stub PRD. Set to `true` to instead * continue with the minimal PRD — accepting that the implementer runs * on a stub. */ readonly continueOnGrillError?: boolean; /** Resume the most recent in-progress slug instead of picking a fresh backlog item. */ readonly resume?: boolean; readonly buildDispatcher?: BuildDispatcher; readonly dryRun?: boolean; readonly logger?: (message: string) => void; } export interface IterationReport { readonly slug: string; readonly title: string; readonly source: string; readonly outcome: 'shipped' | 'partial-shipped' | 'failed' | 'skipped'; readonly haltReason?: HaltReason; readonly repoOutcomes: readonly RepoOutcome[]; readonly costDelta?: { readonly inputTokens: number; readonly outputTokens: number; readonly cacheReadTokens: number; readonly cacheWriteTokens: number; readonly estimatedUsd: number; }; } export interface RunLoopReport { readonly iterations: readonly IterationReport[]; readonly halted: boolean; readonly haltReason?: HaltReason; readonly haltDetail?: string; } export declare function runLoop(options: RunLoopOptions): Promise; //# sourceMappingURL=runner.d.ts.map