/** * Process-local cache of the wiring graph. * * Building the graph means pulling ~180k resolved refs, ~66k symbol→file * pairs, the homonym counts and the import-visibility map, then laying the * whole thing out as CSR — around half a second on this repo. That is fine * once per index generation and unacceptable once per query, and the * personalised retrieval walk is a per-query operation. * * The cache holds one graph. In the detached project server that is exactly * right: one daemon serves one project. A caller for a different project (or * a different index directory) simply replaces the entry rather than growing * a map that would keep tens of megabytes alive for a project nobody is * querying any more. * * Freshness is decided by the index's own `last_indexed` stamp plus the row * counts, read fresh on every request. That costs three trivial queries and * makes the cache self-invalidating from any path — daemon, worker, or * inline — without having to be wired into the server's generation plumbing. */ import { type WiringGraph } from './graph-rank.js'; import type { IndexStore } from './writer.js'; /** Everything the walk needs, built together and invalidated together. */ export interface WiringSnapshot { graph: WiringGraph; /** Declaring file per symbol id — the walk reports files, not just nodes. */ fileOf: ReadonlyMap; } /** * Return the wiring graph for this store, building it only when the index has * changed since the last call. */ export declare function getWiringSnapshot(store: IndexStore, projectRoot: string, indexDir: string | undefined): WiringSnapshot; /** Drop the cached graph. Tests and shutdown paths only. */ export declare function clearWiringSnapshot(): void; //# sourceMappingURL=graph-adjacency-cache.d.ts.map