/** * Goal-engine role runners: planner, adversarial verifier panel, * strategist, summarizer. Role calls are ordinary model completions (all * recorded via recordUsage so /cost and --max-spend see them); verifiers * additionally run a bounded read-only tool loop so they can AUDIT the * implementer's evidence rather than take its word. */ import { ModelClient } from '../agent/llm.js'; import type { CapabilityHandler } from '../agent/types.js'; import type { GoalKind, GoalState, VerifierVerdict } from './types.js'; export interface GoalEngineContext { client: ModelClient; model: string; capabilities: CapabilityHandler[]; workingDir: string; signal: AbortSignal; onProgress?: (text: string) => void; } /** Lightweight kind detection — the plan template diverges per kind. */ export declare function detectGoalKind(objective: string): GoalKind; export declare function runPlanner(ctx: GoalEngineContext, objective: string): Promise<{ kind: GoalKind; planMd: string; }>; export declare function parseVerdict(text: string): VerifierVerdict | null; export interface PanelOutcome { refuted: boolean; gaps: string[]; blocking: 'none' | 'contradiction' | 'unverifiable'; verdicts: VerifierVerdict[]; } export declare function runVerifierPanel(ctx: GoalEngineContext, goal: GoalState, planMd: string, claimMessage: string): Promise; /** Whack-a-mole detector: the last three rounds all refuted with materially * different gap sets (no shared gap between consecutive rounds). */ export declare function needsStrategist(goal: GoalState): boolean; export declare function runStrategist(ctx: GoalEngineContext, goal: GoalState, planMd: string): Promise; export declare function runSummarizer(ctx: GoalEngineContext, goal: GoalState, planMd: string): Promise; /** First unchecked checklist item — the per-turn nudge. */ export declare function mineNextStep(planMd: string): string | undefined;