interface RerankCandidate {
    id: string;
    originalIndex: number;
}
interface RerankScore {
    id: string;
    score: number;
}
interface RerankCacheEntry {
    expiresAtMs: number;
    rankedIds: string[];
}
declare class RerankCache {
    private entries;
    get(key: string): string[] | null;
    set(key: string, rankedIds: string[], ttlMs: number): void;
}
/**
 * Parse a rerank response (JSON) and return candidates sorted by score.
 *
 * Rules:
 * - Unknown IDs in the response are ignored.
 * - Candidates missing from the response keep relative order after scored ones.
 * - Stable tie-breaker: originalIndex ascending.
 */
declare function parseRerankResponse(raw: string, candidates: RerankCandidate[]): Array<RerankCandidate & {
    score?: number;
}>;
declare function rerankLocalOrNoop(opts: {
    query: string;
    candidates: Array<{
        id: string;
        snippet: string;
    }>;
    local: {
        chatCompletion: (messages: Array<{
            role: string;
            content: string;
        }>, options?: {
            maxTokens?: number;
            temperature?: number;
            timeoutMs?: number;
            operation?: string;
            priority?: "recall-critical" | "background";
        }) => Promise<{
            content: string;
        } | null>;
    };
    enabled: boolean;
    timeoutMs: number;
    maxCandidates: number;
    cache?: RerankCache;
    cacheEnabled: boolean;
    cacheTtlMs: number;
}): Promise<string[] | null>;

export { RerankCache, type RerankCacheEntry, type RerankCandidate, type RerankScore, parseRerankResponse, rerankLocalOrNoop };
