/** * Conversation Watcher * * Watches Claude conversation JSONL files for changes using chokidar. * Triggers incremental parsing and extraction when files are modified. */ import { EventEmitter } from "events"; import { IncrementalParser, type ParsedMessage } from "./IncrementalParser.js"; import { LiveExtractor, type ExtractionResult } from "./LiveExtractor.js"; import type { Database } from "better-sqlite3"; import type { RealtimeConfig } from "../memory/types.js"; /** * Events emitted by the watcher */ export interface WatcherEvents { message: (filePath: string, message: ParsedMessage) => void; extraction: (filePath: string, result: ExtractionResult) => void; error: (error: Error) => void; started: () => void; stopped: () => void; } /** * Watcher status */ export interface WatcherStatus { isRunning: boolean; watchedPaths: string[]; trackedFiles: number; extractionsPending: number; lastExtraction?: number; } export declare class ConversationWatcher extends EventEmitter { private watcher; private parser; private extractor; private config; private isRunning; private extractionQueue; private pendingExtractions; private lastExtractionTime?; constructor(db: Database, config?: Partial); /** * Get default watch paths for Claude conversations */ private getDefaultWatchPaths; /** * Start watching for conversation changes */ start(): void; /** * Stop watching */ stop(): Promise; /** * Handle file change event */ private handleFileChange; /** * Process file change after debounce */ private processFileChange; /** * Get current watcher status */ getStatus(): WatcherStatus; /** * Add a path to watch */ addPath(path: string): void; /** * Remove a path from watching */ removePath(path: string): void; /** * Force re-process a specific file */ reprocessFile(filePath: string): Promise; /** * Get parser for testing */ getParser(): IncrementalParser; /** * Get extractor for testing */ getExtractor(): LiveExtractor; } //# sourceMappingURL=ConversationWatcher.d.ts.map