/** * Shared recursive project-tree watcher. * * Several subsystems each used to open their own `fs.watch(projectRoot, * {recursive:true})` — the codebase indexer, the chronicle file observer, and * the WebUI indexing mirror. Every recursive watch makes the OS track the * whole tree independently, so a single runtime paid that cost 2–3×. This * registry keeps ONE watcher per resolved root per process and fans events * out to all subscribers; the watcher closes when the last subscriber leaves. * * The registry lives behind a `Symbol.for` global so it stays a singleton * even if core is loaded twice (Windows path-casing double-load). * * @module utils/project-watch */ export interface ProjectWatchEvent { eventType: 'rename' | 'change'; /** Path relative to the watched root as delivered by the OS, or null when omitted. */ filename: string | null; } export interface ProjectWatchSubscription { close(): void; } /** * Subscribe to recursive change events under `root`, sharing one OS watcher * per root per process. Throws when the platform cannot create the watcher * (no recursive support, permission) and no live shared watcher exists — * callers that can degrade should try/catch exactly as they would `fs.watch`. * * The watcher is non-persistent: it never keeps the process alive. */ export declare function watchProjectTree(root: string, listener: (event: ProjectWatchEvent) => void, opts?: { onError?: ((error: unknown) => void) | undefined; }): ProjectWatchSubscription; //# sourceMappingURL=project-watch.d.ts.map