import type { CodeChunk } from "../types.js";
/**
 * Estimate token count from a string. ~4 chars per token.
 */
export declare function estimateTokens(text: string): number;
/**
 * Filter embedding entries by file path substring and/or test file exclusion.
 * Uses a lookup map to resolve the file path for each embedding ID.
 */
export declare function filterEmbeddingsByFile(embeddings: Map<string, Float32Array>, fileLookup: Map<string, string | undefined>, fileFilter: string | undefined, excludeTests: boolean): Map<string, Float32Array>;
/**
 * Compute RRF scores from multiple embedding query vectors against filtered embeddings.
 * Each vector produces a ranked list; scores are accumulated via RRF formula.
 */
export declare function computeRRFScores(vecs: number[][], filteredEmbeddings: Map<string, Float32Array>, cosSim: (a: Float32Array, b: Float32Array) => number): Map<string, number>;
export type ChunkEntry = {
    startLine: number;
    endLine: number;
    text: string;
};
/**
 * Group top chunk IDs by file, merge overlapping/adjacent chunks, and format
 * as numbered plain text sections.
 */
export declare function formatChunksAsText(topIds: string[], chunks: Map<string, CodeChunk>, excludeTests: boolean): string;
/**
 * Split a long query into sub-queries at natural connectors for RRF merging.
 */
export declare function decomposeQuery(query: string): string[];
/**
 * Truncate symbol source to a character limit, preserving the rest of the symbol object.
 */
export declare function truncateSymbolSource<T extends {
    source?: string;
}>(sym: T, limit: number): T;
/**
 * Race a promise against a timeout. Rejects with a descriptive error on timeout.
 */
export declare function withTimeout<T>(promise: Promise<T>, ms: number, label: string): Promise<T>;
//# sourceMappingURL=retrieval-utils.d.ts.map