/** * File Watcher Service - Monitor skills and photons directories for changes * * Watches ~/.ncp/skills/ and ~/.ncp/photons/ directories and triggers * incremental index updates when files are added, modified, or deleted. * Uses PhotonWatcher from photon-core for cross-platform support (Windows, macOS, Linux). */ export interface FileWatchEvent { type: 'add' | 'change' | 'unlink'; filePath: string; fileName: string; directory: 'skills' | 'photons'; } export interface FileWatcherCallbacks { onSkillAdded?: (fileName: string, filePath: string) => Promise; onSkillModified?: (fileName: string, filePath: string) => Promise; onSkillRemoved?: (fileName: string) => Promise; onPhotonAdded?: (fileName: string, filePath: string) => Promise; onPhotonModified?: (fileName: string, filePath: string) => Promise; onPhotonRemoved?: (fileName: string) => Promise; onError?: (error: Error) => void; } export declare class FileWatcher { private photonWatcher; private callbacks; private isInitialized; private debounceTimers; private debounceMs; private batchOperations; private batchStartTime; private batchCompletionTimer; private readonly BATCH_COMPLETION_WINDOW_MS; private readonly BATCH_SIZE_THRESHOLD; private metrics; private static IGNORE_PATTERNS; constructor(callbacks?: FileWatcherCallbacks, debounceMs?: number); /** * Check if a file should be ignored */ private shouldIgnoreFile; /** * Debounce file event processing */ private debounceEvent; /** * Track file operation for batch detection */ private trackBatchOperation; /** * Complete batch and log metrics */ private completeBatch; /** * Get FileWatcher metrics */ getMetrics(): typeof this.metrics; /** * Start watching for file changes in skills and photons directories */ start(): Promise; /** * Stop watching for file changes */ stop(): Promise; /** * Handle skill directory events */ private handleSkillEvent; /** * Handle photon directory events */ private handlePhotonEvent; /** * Check if watcher is initialized */ isRunning(): boolean; } export declare function getFileWatcher(callbacks?: FileWatcherCallbacks): FileWatcher; //# sourceMappingURL=file-watcher.d.ts.map