/** * In-memory store of clip references for the /clip endpoints and MCP tool. * * Each search result is assigned a small auto-increment numeric id when it * is returned to a caller. Agents can then fetch the file slice by * `GET /clip/:id` (or batch via `GET /clips?ids=…` / `POST /clips`) without * re-encoding the path + line range on every call. * * Properties: * - In-memory only — server restart clears the table. Acceptable trade-off * vs. encoded ids: short numeric handles save a lot of tokens in agent * context, and a mid-session server restart just means re-searching. * - FIFO eviction at `CLIP_STORE_MAX_ENTRIES` — once full, the oldest * inserted id is dropped to make room. A long-idle id may return 404 * ("id not found"). Documented in README + templates. * - Dedup on `(filePath, startLine, endLine)` — the same chunk always * returns the same id across searches. Stable within a server lifetime. * - Single-threaded by virtue of Node.js — no locks needed. */ export interface ClipRef { filePath: string; startLine: number; endLine: number; } export declare const CLIP_STORE_MAX_ENTRIES = 10000; /** * Register a clip reference and return its id. Idempotent — the same * (filePath, startLine, endLine) always returns the same id within the * lifetime of this server process. */ export declare function putClip(filePath: string, startLine: number, endLine: number): number; export declare function getClip(id: number): ClipRef | undefined; export declare function clipStoreSize(): number; /** Drop everything. Exposed mainly for tests. */ export declare function clearClipStore(): void;