/** * StoreRegistry — persistent multi-store registry backed by stores.json * * Implements knowledge-graph-plans.md Phase 2: * - Persistent store registry file (`stores.json`) * - Store discovery, registration, and lookup by storeId * - Thread-safe read/write with atomic file operations * * The registry lives at `/stores.json` where config-dir * defaults to the server's CWD. Each entry maps a storeId to its * filesystem path and metadata. */ export interface StoreRegistryEntry { /** Stable identifier (e.g., "my-project", "default") */ storeId: string; /** Absolute path to the project root containing a memory-bank/ folder */ projectPath: string; /** Kind of store */ kind: 'local' | 'remote'; /** ISO timestamp of last access */ lastUsedAt: string; /** ISO timestamp of registration */ registeredAt: string; } export interface StoreRegistryFile { /** Schema version for forward compat */ version: 1; /** Currently selected storeId (null = use default) */ selectedStoreId: string | null; /** Registered stores */ stores: StoreRegistryEntry[]; } export declare class StoreRegistry { private readonly registryPath; private cache; /** * @param configDir Directory where stores.json will be stored (default: CWD) */ constructor(configDir?: string); /** Load the registry from disk (cached after first load within a session). */ load(): Promise; /** Get all registered stores. */ listStores(): Promise; /** Get a store by its storeId. Returns null if not found. */ getStore(storeId: string): Promise; /** Get the currently selected storeId. */ getSelectedStoreId(): Promise; /** Resolve a storeId to its project path. Returns null if not registered. */ resolveStorePath(storeId: string): Promise; /** * Register or update a store in the registry. * Upserts by storeId — if the storeId already exists, updates its fields. */ registerStore(entry: Omit): Promise; /** Remove a store from the registry by storeId. */ unregisterStore(storeId: string): Promise; /** Set the selected store. Pass null to clear selection (use default). */ selectStore(storeId: string | null): Promise; /** Touch a store's lastUsedAt timestamp. */ touchStore(storeId: string): Promise; /** Invalidate the in-memory cache (forces re-read on next access). */ invalidateCache(): void; /** Write the registry to disk and update cache. */ private save; } //# sourceMappingURL=StoreRegistry.d.ts.map