import type { TUIState } from './state.js'; export type GoalStatus = 'active' | 'paused' | 'done'; export interface GoalState { id: string; objective: string; status: GoalStatus; turnsUsed: number; maxTurns: number; judgeModelId: string; startedAt: string; activeStartedAt?: string; activeDurationMs?: number; /** Set when the goal was paused because the judge could not complete evaluation. */ lastPauseWasJudgeFailure?: boolean; } export interface GoalJudgeResult { decision: 'done' | 'continue' | 'waiting' | 'paused'; reason: string; } export interface GoalEvaluationResult { continuation: string | null; judgeResult: GoalJudgeResult | null; } export interface GoalEvaluationOptions { abortSignal?: AbortSignal; onActivity?: (line: string) => void; requireAssistantMessage?: boolean; } export declare const DEFAULT_MAX_TURNS = 50; export declare class GoalManager { private goal; private persistGoalOnNextThreadCreate; getGoal(): GoalState | null; isActive(): boolean; persistOnNextThreadCreate(): void; consumePersistOnNextThreadCreate(): boolean; /** * Set a new goal objective. Resets turn counter. */ setGoal(objective: string, judgeModelId: string, maxTurns?: number): GoalState; /** * Load goal state from thread metadata (called on thread switch). */ loadFromThreadMetadata(metadata: Record | undefined): void; /** * Persist goal state to thread metadata. */ saveToThread(state: TUIState): Promise; pause(): GoalState | null; resume(): GoalState | null; startActiveTimer(): void; stopActiveTimer(): void; updateJudgeDefaults(judgeModelId: string, maxTurns: number): GoalState | null; clear(): void; markDone(): void; /** * Called after each agent turn completes. Evaluates whether to continue. * Returns a GoalEvaluationResult with continuation prompt and judge result. */ evaluateAfterTurn(state: TUIState, options?: GoalEvaluationOptions): Promise; private getRecentConversationContext; private extractTextContent; private callJudge; private createJudgeTools; private consumeJudgeStream; private getJudgeMemory; private getJudgeThreadId; private createJudgeAgent; private buildContinuationPrompt; } //# sourceMappingURL=goal-manager.d.ts.map