export interface RerankCandidate { id: string; text: string; } export interface RerankResult { id: string; score: number; } export interface RerankProvider { rerank(query: string, candidates: RerankCandidate[], topK?: number): Promise; /** Model identifier (for cache invalidation / provenance). */ readonly modelId: string; } /** * True when an error looks like a transient network/fetch blip a retry can * recover — the field reranker "fetch failed" during model download, plus common * socket/DNS/gateway cousins. Deterministic errors (bad model, bad shape) must * NOT match, so they fail fast instead of retrying pointlessly. */ export declare function isTransientFetchError(err: unknown): boolean; export interface FetchRetryOptions { attempts?: number; delayMs?: number; sleep?: (ms: number) => Promise; } /** * Run an async op, retrying ONLY transient fetch failures with a linear backoff. * A deterministic error, or exhausting the attempt budget, throws immediately. * `sleep` is injectable so the retry is tested without real delays. */ export declare function withFetchRetry(op: () => Promise, opts?: FetchRetryOptions): Promise; export declare function getRerankProvider(): Promise; export declare function _resetRerankProviderForTest(): void; export declare function disposeRerankProvider(): Promise; //# sourceMappingURL=rerank-provider.d.ts.map