import type { PluginInput } from '@opencode-ai/plugin'; import { ChangeQueue } from './state-manager.js'; import { ConfigManager } from './config.js'; import { BackupManager } from './backup-manager.js'; import { VSCodeDetector } from './vscode-detector.js'; import { StateSync } from './state-sync.js'; type BunShell = PluginInput['$']; interface InterceptorContext { $: BunShell; directory: string; sessionID: string; callID: string; changeQueue: ChangeQueue; configManager: ConfigManager; backupManager: BackupManager; vscodeDetector: VSCodeDetector; stateSync: StateSync; } export declare class ToolInterceptor { private context; constructor(context: InterceptorContext); before(tool: string, args: unknown): Promise; after(tool: string): Promise; private extractFilePath; private readOriginalContent; private computeNewContent; private resolvePath; private applyFileWrite; /** * Checks if content is binary * @param content - Content to check * @returns True if content appears to be binary */ private isBinaryContent; /** * Validates file path and checks for edge cases * @param filePath - Path to validate * @returns Validation result with error message if invalid */ private validateFilePath; /** * Maps error to user-friendly message * @param error - Error to map * @param filePath - File path for context * @returns User-friendly error message */ private getUserFriendlyError; /** * Checks if file was modified externally * @param filePath - Path to check * @param expectedContent - Expected content hash * @returns True if file was modified externally */ private hasFileBeenModifiedExternally; private showDiffUI; } export declare function createBeforeHandler($: BunShell, directory: string, configManager: ConfigManager, queue?: ChangeQueue): (input: { tool: string; sessionID: string; callID: string; }, output: { args: unknown; }) => Promise; export declare function createAfterHandler($: BunShell, directory: string, configManager: ConfigManager, queue?: ChangeQueue): (input: { tool: string; sessionID: string; callID: string; }) => Promise; export {}; //# sourceMappingURL=interceptor.d.ts.map