github-mcp-auto-git
Version:
GitHub MCP Auto Git v3.0 - メモリ効率化・統合MCP・モジュール化完了の完全自動Git操作システム
89 lines • 2.73 kB
TypeScript
/**
* File Watch Manager Module
* Handles file monitoring and change processing following Constitutional AI principles
*/
import { GitConfig } from '../types/index.js';
import { GitOperations } from './git-operations.js';
export interface FileChangeEvent {
path: string;
type: 'change' | 'add' | 'delete';
timestamp: number;
}
export interface WatchResult {
success: boolean;
message: string;
details?: any;
warnings?: string[];
}
export declare class FileWatchManager {
private watcher?;
private debounceTimer?;
private isProcessing;
private config;
private gitOps;
constructor(config: GitConfig, gitOps: GitOperations);
/**
* Start file watching with robust error handling
* Fail Fast: Immediate validation of watch patterns and permissions
* Be Lazy: Efficient file filtering and debounced processing
* TypeScript First: Complete type safety for file operations
*/
startWatching(): Promise<void>;
/**
* Stop file watching and cleanup resources
* Fail Fast: Immediate cleanup on errors
*/
stopWatching(): Promise<void>;
/**
* Process file changes with debouncing and error recovery
* Be Lazy: Debounced processing to avoid excessive operations
* Fail Fast: Early termination on processing conflicts
*/
processChanges(files?: string[]): Promise<WatchResult>;
/**
* Check if currently processing changes
* TypeScript First: Type-safe status checking
*/
isCurrentlyProcessing(): boolean;
/**
* Get current watch status
* Be Lazy: Efficient status reporting
*/
getWatchStatus(): {
watching: boolean;
processing: boolean;
patterns: string[];
ignored: string[];
};
/**
* Setup event handlers for file changes
* Fail Fast: Immediate error handling for file events
*/
private setupEventHandlers;
/**
* Handle individual file change events
* Be Lazy: Debounced processing to batch changes
*/
private handleFileChange;
/**
* Handle watch errors with recovery attempts
* Fail Fast: Immediate error detection and recovery
*/
private handleWatchError;
/**
* Get patterns to ignore during file watching
* Be Lazy: Comprehensive ignore patterns for efficiency
*/
private getIgnoredPatterns;
/**
* Check if a specific file should be ignored
* Fail Fast: Early filtering of irrelevant files
*/
private shouldIgnoreFile;
/**
* Display detailed processing results
* TypeScript First: Type-safe result display
*/
private displayDetailedResult;
}
//# sourceMappingURL=file-watch-manager.d.ts.map