interface CacheEntry { value: T; computed_at: number; version: string; } export interface CacheIdentity { kind: string; capture_id?: number | null; query?: string; budget_pct?: number; model?: string; include_drift?: boolean; } export declare function makeCacheKey(identity: CacheIdentity): string; /** * Bounded LRU cache keyed by a version tag. * * Each entry is invalidated when: * 1. Its TTL expires (default 30 seconds), OR * 2. Its version tag differs from the current capture version. * * SECURITY: The cache is process-local but queries flow through it on every * MCP `cf_query` call. A client that can issue many distinct queries could * otherwise grow the cache without bound. The LRU cap below fixes that: * inserting a new key when `store.size >= max_entries` evicts the least * recently used entry so memory use is O(1) in attacker-controlled input. */ export declare class ResultCache { readonly store: Map>; private readonly ttl_ms; private readonly max_entries; constructor(ttl_ms?: number, max_entries?: number); /** * Get a cached value, or compute it if stale/missing. * Cache key includes git SHA — automatically invalidates after a commit. */ getOrCompute(key: string, version: string, compute: () => T | null): Promise; invalidate(key: string): void; invalidateAll(): void; private set; } export declare const cache: ResultCache; export {}; //# sourceMappingURL=result-cache.d.ts.map