/** SPDX-License-Identifier: MIT */ import type { CacheStore } from "./store/sqlite.js"; export type RankedCandidate = { id: string; text: string; entryId: string; createdAt: number; }; export type ProposeStrategy = "hybrid" | "recency"; /** Token Jaccard — propose-only; never used as an admit decision. */ export declare function tokenJaccard(a: string, b: string): number; /** * Shortlist cache entries for the adjudicator. * Similarity may propose; only IntentAdjudicator admits. */ export declare function proposeCandidates(opts: { store: CacheStore; namespace: string; newText: string; k: number; poolN: number; excludeExactKey: string; strategy: ProposeStrategy; maxAgeMs?: number; now?: number; }): RankedCandidate[]; /** Compat: legacy newest-K shortlist. */ export declare function recentCandidates(store: CacheStore, namespace: string, k: number, excludeExactKey: string, opts?: { maxAgeMs?: number; now?: number; }): RankedCandidate[]; export declare function entryIdForChoice(candidates: RankedCandidate[], choice: string): string | null; /** Oldest candidate age among the set (for decide whether to ask reuse_fresh). */ export declare function maxCandidateAgeMs(candidates: RankedCandidate[], now?: number): number;