import { type IssueRef, type SemanticPrType } from '../automation/git.js'; import { type Agent } from './agents.js'; import { type CircuitBreakerConfig } from './circuit-breaker.js'; import { type CostTrackerStats, type IterationCost, type PlanBudget } from './cost-tracker.js'; import { type ValidationResult } from './validation.js'; export type IterationUpdate = { iteration: number; totalIterations: number; success: boolean; output?: string; cost?: IterationCost; validationResults?: ValidationResult[]; }; export type LoopOptions = { task: string; cwd: string; agent: Agent; maxIterations?: number; auto?: boolean; commit?: boolean; push?: boolean; pr?: boolean; prTitle?: string; prLabels?: string[]; prIssueRef?: IssueRef; prType?: SemanticPrType; validate?: boolean; sourceType?: string; completionPromise?: string; requireExitSignal?: boolean; minCompletionIndicators?: number; circuitBreaker?: Partial; rateLimit?: number; trackProgress?: boolean; checkFileCompletion?: boolean; trackCost?: boolean; model?: string; contextBudget?: number; validationWarmup?: number; maxCost?: number; planBudget?: PlanBudget; agentTimeout?: number; initialValidationFeedback?: string; maxSkills?: number; enableSkills?: boolean; skipPlanInstructions?: boolean; fixMode?: 'design' | 'scan' | 'custom'; taskTitle?: string; figmaImagesDownloaded?: boolean; figmaFontSubstitutions?: Array<{ original: string; substitute: string; }>; designImagePath?: string; visualValidation?: boolean; figmaScreenshotPaths?: string[]; headless?: boolean; onIterationComplete?: (update: IterationUpdate) => void; env?: Record; /** Linear issue ID to sync status to (e.g., "ENG-42"). Requires LINEAR_API_KEY. */ linearSync?: string; /** Amp agent mode: smart, rush, deep */ ampMode?: import('./agents.js').AmpMode; /** Run LLM-powered diff review after validation passes (before commit) */ review?: boolean; /** Product name shown in logs/UI (default: 'Ralph-Starter'). Set to white-label when embedding. */ productName?: string; /** Dot-directory for memory/iteration-log/activity (default: '.ralph'). */ dotDir?: string; /** API key for SDK-based agents */ apiKey?: string; /** Allow the anthropic-sdk agent to execute shell commands. Disabled by default for safety. */ allowShellExecution?: boolean; }; export type LoopResult = { success: boolean; iterations: number; commits: string[]; output?: string; error?: string; exitReason?: 'completed' | 'blocked' | 'max_iterations' | 'circuit_breaker' | 'rate_limit' | 'file_signal' | 'cost_ceiling'; stats?: { totalDuration: number; avgIterationDuration: number; validationFailures: number; circuitBreakerStats?: { consecutiveFailures: number; totalFailures: number; uniqueErrors: number; }; costStats?: CostTrackerStats; }; }; /** * Read the last N iteration summaries from .ralph/iteration-log.md. * Used by context-builder to give the agent memory of previous iterations. */ export declare function readIterationLog(cwd: string, maxEntries?: number, dotDir?: string): string | undefined; export declare function runLoop(options: LoopOptions): Promise; //# sourceMappingURL=executor.d.ts.map