import { S as ScoredChunk } from '../types-BP5OmxBy.js'; interface CitationDocumentBlock { type: "document"; source: { type: "content"; content: Array<{ type: "text"; text: string; }>; } | { type: "text"; media_type: "text/plain"; data: string; }; title?: string | null; context?: string | null; citations: { enabled: true; }; } interface ChunkMapping { /** Position in the content array of the document block. */ blockIndex: number; startLine: number; endLine: number; language: string; symbolName?: string; score: number; } interface DocumentMapping { /** Index of this document in the documents array sent to Anthropic. */ documentIndex: number; filePath: string; sourceType: "code" | "plaintext"; chunks: ChunkMapping[]; } interface ResolvedCitation { /** 1-indexed display number. */ index: number; citedText: string; documentTitle: string | null; filePath: string; sourceType: "code" | "plaintext"; startLine?: number; endLine?: number; language?: string; symbolName?: string; /** Character position in the response text where this citation appears. */ textOffset: number; } interface CitationDocumentOptions { /** Extra plain-text documents to include (e.g. spec content, commit history). */ additionalDocuments?: Array<{ title: string; content: string; }>; } interface RawCitation { type: "content_block_location" | "char_location"; cited_text: string; document_index: number; document_title: string | null; start_block_index?: number; end_block_index?: number; start_char_index?: number; end_char_index?: number; } interface BuildResult { documents: CitationDocumentBlock[]; documentMap: DocumentMapping[]; } /** * Converts deduplicated ScoredChunk[] into Anthropic-compatible citation * document blocks with a mapping table for resolving raw citations back * to source file/line metadata. * * Pipeline position: after deduplicateChunks() → before Anthropic API call. */ declare function buildCitationDocuments(chunks: ScoredChunk[], options?: CitationDocumentOptions): BuildResult; /** * Resolves a single raw Anthropic citation against the document map, * producing a fully enriched ResolvedCitation with file/line metadata. */ declare function resolveCitation(raw: RawCitation, documentMap: DocumentMapping[], citationIndex: number, textOffset: number): ResolvedCitation; /** * Batch-resolves an array of raw citations. Auto-increments citation index * starting from 1. */ declare function resolveCitations(raws: RawCitation[], documentMap: DocumentMapping[], textOffsets: number[]): ResolvedCitation[]; export { type ChunkMapping, type CitationDocumentBlock, type CitationDocumentOptions, type DocumentMapping, type RawCitation, type ResolvedCitation, buildCitationDocuments, resolveCitation, resolveCitations };