import type { GoalOptions, PhaseExecutionContext, PhaseGraph, PhaseNode, PhaseProgress, PhaseTemplate } from './types.js'; export interface GoalRunnerOptions extends GoalOptions { /** Project title. */ title: string; description?: string | undefined; /** Phase templates. */ phases: PhaseTemplate[]; /** Function that executes a task. */ executeTask: PhaseExecutionContext['executeTask']; /** Optional verification gate. */ verifyPhase?: PhaseExecutionContext['verifyPhase'] | undefined; /** Optional repair pass after verification failure. */ repairPhase?: PhaseExecutionContext['repairPhase'] | undefined; /** Optional resolver for worktree merge conflicts. */ resolveConflict?: PhaseExecutionContext['resolveConflict'] | undefined; /** Optional Brain arbiter. */ brain?: PhaseExecutionContext['brain'] | undefined; /** Called when a phase completes. */ onPhaseComplete?: ((phase: PhaseNode) => void) | undefined; /** Called when a phase fails. */ onPhaseFail?: (phase: PhaseNode, error: Error) => void; /** Called on every orchestrator tick. */ onTick?: (ctx: { activePhases: PhaseNode[]; readyPhases: PhaseNode[]; }) => void; /** Called when progress changes. */ onProgress?: ((progress: PhaseProgress) => void) | undefined; /** Safety net that stops a phase graph if cleanup is bypassed. Default: 24h. */ maxRunDurationMs?: number | undefined; /** Called when the graph completes. */ onComplete?: ((graph: PhaseGraph) => void) | undefined; /** Called when the graph fails. */ onFail?: (graph: PhaseGraph, failedPhase: PhaseNode, error: Error) => void; } /** * GoalRunner - high-level API for managing the whole autonomous phase flow from one entry point. * * Usage: * const runner = new GoalRunner({ * title: 'Auth Refactor', * phases: [...], * executeTask: async (task, phaseId) => { ... }, * onProgress: (p) => console.log(`${p.percentComplete}% done`), * }); * await runner.start(); */ export declare class GoalRunner { private graph; private orchestrator; private opts; private progressInterval; private maxRunTimer; private readonly graphCompletedHandler; private readonly graphFailedHandler; /** Stores the unsubscribe function returned by EventBus.on() */ private unsubscribeCompleted; private unsubscribeFailed; constructor(opts: GoalRunnerOptions); start(): Promise; pause(): void; resume(): void; stop(): void; getProgress(): PhaseProgress | null; getGraph(): PhaseGraph | null; isRunning(): boolean; isPaused(): boolean; assignAgent(phaseId: string, agentId: string): void; releaseAgent(phaseId: string, agentId: string): void; private cleanup; } /** * Quick-start helper: create an GoalRunner from an existing TaskGraph. */ export declare function createGoalRunnerFromTaskGraph(taskGraph: import('../types/task-graph.js').TaskGraph, options: Omit & { title?: string | undefined; tasksPerPhase?: number | undefined; }): Promise; //# sourceMappingURL=goal-runner.d.ts.map