import { type ThinkLevel } from "../auto-reply/thinking.js"; import type { CliDeps } from "../cli/deps.js"; import type { RuntimeEnv } from "../runtime.js"; export type AntonProgressEvent = { phase: "codebase_analysis_start"; } | { phase: "codebase_analysis_complete"; contextFile: string; durationMs: number; } | { phase: "codebase_analysis_failed"; error: string; } | { phase: "start"; taskFile: string; totalTasks: number; } | { phase: "task_start"; index: number; total: number; task: string; } | { phase: "discovery_start"; index: number; total: number; task: string; } | { phase: "discovery_complete"; index: number; total: number; task: string; planFile: string; } | { phase: "discovery_failed"; index: number; total: number; task: string; error: string; } | { phase: "discovery_already_complete"; index: number; total: number; task: string; } | { phase: "review_start"; index: number; total: number; task: string; planFile: string; } | { phase: "review_complete"; index: number; total: number; task: string; planFile: string; } | { phase: "review_failed"; index: number; total: number; task: string; error: string; } | { phase: "implementation_start"; index: number; total: number; task: string; planFile?: string; } | { phase: "task_agent_spawned"; index: number; total: number; task: string; sessionId: string; } | { phase: "task_complete"; index: number; total: number; task: string; } | { phase: "task_failed"; index: number; total: number; task: string; error: string; } | { phase: "task_skipped"; index: number; total: number; task: string; reason: string; } | { phase: "stopped"; completedSoFar: number; total: number; } | { phase: "finish"; completed: number; skipped: number; total: number; durationMs: number; }; export type AntonProgressCallback = (event: AntonProgressEvent) => Promise; /** Configuration for Anton's execution mode. */ export type AntonConfig = { /** Execution mode: "direct" (single agent) or "preflight" (discovery → implementation). Default: "direct". */ mode?: "direct" | "preflight"; /** Nested preflight settings used by config wizard/new schema. */ preflight?: { /** When false, preflight mode is disabled and execution falls back to direct mode. */ enabled?: boolean; /** Enable requirements review stage between discovery and implementation. */ requirementsReview?: boolean; /** Discovery-stage timeout in seconds. Falls back to taskTimeoutSec. */ discoveryTimeoutSec?: number; /** Requirements-review-stage timeout in seconds. Falls back to taskTimeoutSec. */ reviewTimeoutSec?: number; /** Max retries for discovery/review before skipping. */ maxRetries?: number; /** Run codebase analysis before discovery to reduce redundant file reads. Default: true. */ codebaseSnapshot?: boolean; }; /** Optional Anton-specific thinking defaults by execution phase. */ thinking?: { /** Thinking level for direct mode. */ direct?: ThinkLevel; /** Thinking levels for preflight mode. */ preflight?: { /** Preflight phase 1 (discovery + review). */ phase1?: ThinkLevel; /** Preflight phase 2 (implementation). */ phase2?: ThinkLevel; }; }; /** Legacy top-level requirements review flag (backward compatibility). */ requirementsReview?: boolean; /** Per-task timeout in seconds. Default: 1200. */ taskTimeoutSec?: number; /** Legacy top-level discovery timeout in seconds. Falls back to taskTimeoutSec. */ discoveryTimeoutSec?: number; /** Legacy top-level requirements-review timeout in seconds. Falls back to taskTimeoutSec. */ reviewTimeoutSec?: number; /** Legacy top-level max retries for discovery/review before skipping. */ preflightMaxRetries?: number; /** Directory to store plan files. Default: .agents/tasks/ relative to workspace. */ planDir?: string; }; export declare function resolveAntonExecutionConfig(params: { config: AntonConfig; modeOverride?: "direct" | "preflight"; }): { mode: "direct" | "preflight"; requirementsReview: boolean; taskTimeoutSec: number; discoveryTimeoutSec: number; reviewTimeoutSec: number; preflightMaxRetries: number; directThinkLevel?: ThinkLevel; preflightPhase1ThinkLevel?: ThinkLevel; preflightPhase2ThinkLevel?: ThinkLevel; codebaseSnapshot: boolean; }; export declare function formatProgressMessage(event: AntonProgressEvent): string; export declare function antonStatus(runtime: RuntimeEnv): Promise; export declare function antonStop(runtime: RuntimeEnv): Promise; export declare function runAnton(args: { taskFile: string; runtime: RuntimeEnv; deps: CliDeps; /** Override thinking level for all Anton phases in this run. */ thinking?: string; agent?: string; to?: string; timeoutSec?: number; force?: boolean; dryRun?: boolean; onProgress?: AntonProgressCallback; /** Override config mode (takes precedence over config file). */ mode?: "direct" | "preflight"; /** Override workspace directory for spawned agents. */ workspaceDir?: string; }): Promise;