UNPKG

ailock

Version:

AI-Proof File Guard - Protect sensitive files from accidental AI modifications

74 lines 2.08 kB
/** * Information about Claude Code installation */ export interface ClaudeCodeInfo { detected: boolean; projectDir?: string; settingsPath?: string; isProjectLevel?: boolean; } /** * Hook installation status */ export interface HookStatus { installed: boolean; location?: string; hookCount?: number; error?: string; } /** * Service for managing AI tool hooks * Follows Single Responsibility Principle - only manages hook operations */ export declare class HooksService { private readonly SUPPORTED_TOOLS; private readonly HOOK_TIMEOUT; private readonly commandExecutor; constructor(); /** * Detect Claude Code installation * Open/Closed Principle - can be extended for other AI tools */ detectClaudeCode(): ClaudeCodeInfo; /** * Find ailock installation path * DRY - reused by both init and hooks commands */ findAilockInstallation(): Promise<string>; /** * Get the path to the hook script * Dependency Inversion - returns path, doesn't depend on file existence */ private getHookScriptPath; /** * Create hook configuration * Interface Segregation - returns only what's needed for hooks */ private createHookConfig; /** * Install Claude Code hooks * Main installation logic, follows SRP */ installClaudeHooks(claudeInfo: ClaudeCodeInfo): Promise<void>; /** * Merge hook configuration with existing settings * DRY - extracted from install logic for reuse */ private mergeSettings; /** * Uninstall Claude Code hooks * Liskov Substitution - can be called independently */ uninstallClaudeHooks(claudeInfo: ClaudeCodeInfo): Promise<void>; /** * Get hook installation status * Open for extension - can add more AI tools */ getHookStatus(tool: string): Promise<HookStatus>; /** * List all available AI tools * For future extensibility */ getSupportedTools(): readonly string[]; } //# sourceMappingURL=HooksService.d.ts.map