/** * Safe-edit module: copy → modify → validate → swap pattern. * Prevents bricking by never leaving core files in a broken state. */ export interface SafeEditInput { /** Workspace-relative path to edit. */ path: string; /** New file content. */ content: string; /** Shell command to validate the change (e.g., "npx tsc --noEmit"). */ validation_command?: string; /** Shell command to run tests (e.g., "npm test"). */ test_command?: string; /** Whether to keep a .ace-backup copy (default: true). */ backup?: boolean; } export interface SafeEditResult { ok: boolean; original_path: string; staging_path: string; backup_path?: string; original_hash: string; new_hash: string; validation_passed?: boolean; validation_output?: string; test_passed?: boolean; test_output?: string; error?: string; restored?: boolean; } export interface TestSuiteResult { ok: boolean; exit_code: number; output: string; command: string; duration_ms: number; } export interface DiffResult { has_diff: boolean; original_lines: number; new_lines: number; added: number; removed: number; diff_summary: string; } export declare function safeEditFile(input: SafeEditInput): SafeEditResult; export declare function runTestSuite(command?: string): TestSuiteResult; export declare function diffContents(original: string, updated: string): DiffResult; export declare function diffFiles(pathA: string, pathB: string): DiffResult & { error?: string; }; //# sourceMappingURL=safe-edit.d.ts.map