/** * Config file watcher - debounced fs.watch wrapper for /*.json * (~/.phi/agent by default, or PHI_CODING_AGENT_DIR). * * Per Q5 + Q9: emits "_changed" events when models.json or routing.json * are modified on disk. Debounced 300ms to coalesce burst writes (atomic * tmp+rename produces multiple fs events). * * Cross-platform: fs.watch is available on Linux/macOS/Windows. On some * Windows file systems, fs.watch may fire repeated events; the debounce * absorbs them. * * Events emitted via EventEmitter: * - "models_json_changed" : ~/.phi/agent/models.json changed * - "routing_json_changed" : ~/.phi/agent/routing.json changed * - "watcher_error" : underlying fs.watch error * * The watcher silently skips files that don't exist when start() is called. * Re-call start() after the file is created to begin watching it. */ import { EventEmitter } from "node:events"; export declare class ConfigWatcher extends EventEmitter { private files; private debounceMs; constructor(options?: { debounceMs?: number; agentDir?: string; }); /** * Start watching all configured files (no-op for files that don't exist). */ start(): void; /** * Stop all watchers and clear pending debounces. */ stop(): void; /** * Tell the watcher to ignore the next change event for a file (used right * after programmatic write to avoid echoing it back to ourselves). * The ignore window is debounceMs * 2. */ muteForWrite(eventName: string): void; private startWatching; private scheduleEmit; } export declare function getConfigWatcher(options?: ConstructorParameters[0]): ConfigWatcher; export declare function _resetConfigWatcher(): void; //# sourceMappingURL=config-watcher.d.ts.map