import type { Logger } from "@onenomad/przm-cortex-core"; import { type LoadedTaxonomy } from "./taxonomy.js"; /** * Per-workspace taxonomy loader with an in-memory cache. * * Cortex's ToolContext carries a `taxonomy` that every tool reads * when resolving project slugs, people, etc. With session-scoped * workspaces, different Claude sessions need different taxonomies * in the SAME process — pre-session-scoping the whole cortex had * one global taxonomy loaded at boot. * * This cache loads taxonomy lazily per workspace slug on the first * tool call that needs it, and caches the result until a mutation * tool calls `invalidate(slug)`. Loads are cheap (two small YAML * files) but redundant loads on every tool call aren't free either * at Claude-Code tool-call frequency. * * Fallback: when no workspace is bound and no cache entry exists, * tools get an empty TaxonomyReader so they degrade gracefully — * project / people lookups just return undefined instead of throwing. */ export declare class TaxonomyCache { private readonly logger; private readonly cache; private readonly inflight; private readonly empty; constructor(logger: Logger); /** * Resolve the taxonomy for a given workspace slug. Loads on first * request, serves from cache after. Returns the empty reader when * the workspace doesn't exist on disk — tools keep running, the * logs surface the discrepancy. */ forWorkspace(slug: string): Promise; /** * Drop a cache entry so the next access re-reads from disk. Call * from add_person / add_project / update_user_identity after a * successful write, and from any tool that edits the taxonomy * YAML files directly. */ invalidate(slug: string): void; /** Useful for tests + a future /api/taxonomy-cache endpoint. */ invalidateAll(): void; size(): number; /** Fallback reader tools get when nothing else resolves. */ emptyReader(): LoadedTaxonomy; private loadOne; } //# sourceMappingURL=taxonomy-cache.d.ts.map