import type { FreshnessClass } from "../freshness.js"; export type CacheEntry = { id: string; namespace: string; exact_key: string; user_text: string; response_json: string; model: string; prompt_tokens: number; completion_tokens: number; est_cost_usd: number; created_at: number; expires_at: number; freshness_class: FreshnessClass; as_of: number | null; }; /** * File-backed SQLite via Node's built-in `node:sqlite` (no native addon compile). * Requires Node >= 22.5 with `--experimental-sqlite` (bin wrapper enables it). */ export declare class CacheStore { private db; constructor(dataDir: string); private migrate; private rowToEntry; getByExactKey(exactKey: string, now?: number): CacheEntry | null; getById(id: string, now?: number): CacheEntry | null; recentInNamespace(namespace: string, limit: number, excludeExactKey?: string, now?: number, maxAgeMs?: number): CacheEntry[]; upsert(entry: Omit & { id?: string; freshness_class?: FreshnessClass; as_of?: number | null; }, maxEntries: number): CacheEntry; sweepExpired(now?: number): number; delete(id: string): boolean; flush(): number; count(): number; private enforceMax; close(): void; }