import type { CodaliContextPack, CodaliGatewayRequest } from "./CodaliGatewayTypes.js"; import type { CodaliGatewayStoredArtifact } from "./CodaliGatewayStore.js"; import type { CodaliArtifactRef } from "./CodaliGatewayTypes.js"; /** * The finishing step every run passes through. * * Skipping the large synthesizer for a simple factual lookup is sensible; * skipping *normalization* is not. Without one consistent finisher each tool * shapes its own output, citations quietly disappear, units go unlabelled, and * raw tool error strings leak to end users. So there is no path from a tool * result to a caller that does not come through here. * * Three modes: * * - `deterministic` — one clean, well-attributed result. Formatted in code, * no model call. This is what makes a simple lookup cheap. * - `synthesizer` — multiple, conflicting, or unstructured sources. Needs * the large model to reconcile them. * - `artifact` — media. The artifact is the answer; prose only frames it. */ export type FinalizerMode = "deterministic" | "synthesizer" | "artifact"; export interface FinalizerDecision { mode: FinalizerMode; reason: string; } export interface FinalizerDecisionInput { request: CodaliGatewayRequest; contextPack: CodaliContextPack; artifacts: readonly CodaliArtifactRef[]; /** * Set when the router judged this a direct lookup — a question whose answer * *is* the retrieved fact, rather than something that must be reasoned from * it. Required for the deterministic path. */ directLookup?: boolean; } export declare const decideFinalizerMode: (input: FinalizerDecisionInput) => FinalizerDecision; /** * Formats a single fact without a model call. Deliberately conservative: it * restates the claim and attributes it. It never paraphrases, because * paraphrasing without a model is how meaning gets lost. */ export declare const formatDeterministicAnswer: (contextPack: CodaliContextPack) => string; /** * Frames artifacts as the answer. The artifact reference carries the payload; * this is only the surrounding text. */ export declare const formatArtifactAnswer: (artifacts: readonly CodaliArtifactRef[], existingAnswer?: string) => string; export declare const artifactRefsFromStored: (artifacts: readonly CodaliGatewayStoredArtifact[]) => CodaliArtifactRef[]; //# sourceMappingURL=Finalizer.d.ts.map