import type { RetrievalHit } from "../core/retrieval-index.js"; export type ContextIntent = "understand" | "implement" | "modify" | "debug" | "review" | "document"; export type EvidenceStaleReason = "drift_suspected" | "anchor_unresolvable"; export interface ContextSizeEstimate { characters: number; utf8Bytes: number; /** * Model-agnostic heuristic, intentionally conservative for common text. * This is NOT an exact tokenizer result and must never be used for hard * provider limits without replacing the estimator with a model tokenizer. */ heuristicTokens: number; estimator: "utf8-bytes-div-3-v1"; } export interface EvidenceRef { uri: string; pageUri: string; path: string; passageId?: string; title: string; type: string; heading?: string; score: number; reason: string; stale?: boolean; staleReason?: EvidenceStaleReason; driftClaimIds?: string[]; /** Existing wiki `sources` values are references/paths, not guaranteed URIs. */ sourceRefs: string[]; preview: string; size: ContextSizeEstimate; } export interface KnowledgeGap { kind: "missing_evidence" | "contradiction" | "stale_evidence" | "budget_limited"; description: string; reason?: EvidenceStaleReason; paths?: string[]; claimIds?: string[]; /** False for fixed expansion limits that a larger token budget cannot close. */ widenable?: boolean; } export interface ContextManifest { version: 1; intent: ContextIntent; objective: string; evidence: EvidenceRef[]; gaps: KnowledgeGap[]; size: ContextSizeEstimate; budget: { requestedHeuristicTokens?: number; withinHeuristicBudget: boolean; }; } export declare function estimateContextSize(text: string): ContextSizeEstimate; export declare function evidenceFromRetrievalHit(hit: RetrievalHit, reason?: string): EvidenceRef; export declare function buildRetrievalContextManifest(params: { intent: ContextIntent; objective: string; hits: readonly RetrievalHit[]; maxEvidence?: number; heuristicTokenBudget?: number; reason?: string; }): ContextManifest; //# sourceMappingURL=context-manifest.d.ts.map