import type { SearchResult, CodeChunk, FileRecord } from "../types/index.js"; import type { IndexFiles } from "../indexer/index-files.js"; import type { IndexGraph } from "../indexer/index-graph.js"; export interface BundleOptions { /** Token budget for the total extra context attached across all hits. */ tokenBudget: number; /** Max adjacent chunks per hit (default 2). */ maxAdjacentPerHit?: number; /** Max 1-hop neighbor chunks per hit (default 1). */ maxNeighborsPerHit?: number; } export interface BundledHit { result: SearchResult; adjacents: CodeChunk[]; neighbors: Array<{ chunk: CodeChunk; file: FileRecord; }>; } export interface BundleOutput { bundled: BundledHit[]; tokensUsed: number; tokensBudget: number; } /** * Given a list of search results, enrich each with adjacent + neighbor * chunks up to the token budget. Walks hits in rank order; once the * budget is exhausted, remaining hits keep their original (empty) bundle. */ export declare function bundleResults(indexer: IndexFiles & IndexGraph, results: SearchResult[], opts: BundleOptions): BundleOutput; /** * Render the bundle block for a single hit — formatted as sub-sections * under the main result header. Returns an empty string when there's * nothing to add. */ export declare function formatBundle(hit: BundledHit): string;