import type { RouteDecision } from "../autonomy/contracts.ts"; import { ROUTE_JUDGE_SYSTEM_PROMPT } from "../provider-prompt-contracts.ts"; export { ROUTE_JUDGE_SYSTEM_PROMPT }; /** * Routing-only judge: a bounded, tool-less completion (default: the medium model) that decides the * final cheap/medium/expensive tier for a user prompt, refining the regex classifier's baseline. * Core rule: planning is never cheap unless the judge explicitly deems the task trivial. The judge * proposes; the existing pipeline (model resolution, auth, escalation, gates) still decides. * Failure is honest: unparseable/timeout/unavailable falls back to the baseline with a visible * reasonCode, never silently. */ /** Static across calls — callers pass cacheRetention "short" so only the variable tail is billed. */ export declare const ROUTE_JUDGE_MAX_OUTPUT_TOKENS = 128; export declare const ROUTE_JUDGE_MAX_WALL_CLOCK_MS = 10000; export interface RouteJudgeVerdict { tier: "cheap" | "medium" | "expensive"; risk: RouteDecision["risk"]; trivial: boolean; reason: string; } export declare function buildRouteJudgeUserPrompt(args: { prompt: string; baseline: RouteDecision; }): string; export declare function parseRouteJudgeVerdict(text: string): RouteJudgeVerdict | undefined; /** Merge a judge verdict into the baseline decision (pure; never returns learning). */ export declare function applyRouteJudgeVerdict(baseline: RouteDecision, verdict: RouteJudgeVerdict): RouteDecision; export interface RouteJudgeRunResult { decision: RouteDecision; verdict?: RouteJudgeVerdict; /** Set when the judge could not decide and the baseline was kept. */ fallbackReason?: string; costUsd: number; } /** * Run the judge over a baseline decision. The completion executor is injected (production: * AgentSession.runIsolatedCompletion on the judge model). Never throws; every failure keeps the * baseline with a visible fallbackReason. */ export declare function runRouteJudge(args: { prompt: string; baseline: RouteDecision; complete: (input: { systemPrompt: string; userPrompt: string; signal?: AbortSignal; }) => Promise<{ text: string; costUsd: number; stopReason: string; }>; signal?: AbortSignal; maxWallClockMs?: number; }): Promise; //# sourceMappingURL=route-judge.d.ts.map