import { MutableChatRequestModel } from '@theia/ai-chat'; import { URI } from '@theia/core/lib/common/uri'; import { FileService } from '@theia/filesystem/lib/browser/file-service'; import { WorkspaceService } from '@theia/workspace/lib/browser'; import { ILogger } from '@theia/core'; export declare const FileEditBackupService: unique symbol; /** * Service for managing file backup operations during Claude Code edit sessions. * * This service handles the retrieval of original file content from backup files * created by the file backup hooks in ClaudeCodeServiceImpl. The backup hooks * run before file modification tools (Write, Edit, MultiEdit) and create backups * in the `.claude/.edit-baks/{session_id}/` directory structure. * * @see packages/ai-claude-code/src/node/claude-code-service-impl.ts#ensureFileBackupHook * The coupling with the backup hooks is intentional - this service reads from * the same backup location that the hooks write to. */ export interface FileEditBackupService { /** * Retrieves the original content of a file from its backup. * * This method reads from backup files created by the file backup hooks * that are installed by ClaudeCodeServiceImpl.ensureFileBackupHook(). * * @param workspaceUri The URI of the file to get backup content for * @param sessionId The Claude session ID used for backup organization * @returns The original file content, or undefined if no backup exists */ getOriginal(workspaceUri: URI, sessionId: string | undefined): Promise; /** * Cleans up backup files for a completed chat session. * * This method removes the backup directory structure for the given session * from all workspaces that have change set elements. * * @param request The chat request model containing session and change set information */ cleanUp(request: MutableChatRequestModel): Promise; /** * Gets the backup location for a workspace root. * * This must match the backup location used by the file backup hooks * in ClaudeCodeServiceImpl. * * @param workspaceRoot The workspace root URI * @returns The backup directory URI */ getLocation(workspaceRoot: URI): URI; } export declare class FileEditBackupServiceImpl implements FileEditBackupService { protected readonly fileService: FileService; protected readonly workspaceService: WorkspaceService; protected readonly logger: ILogger; getLocation(workspaceRoot: URI): URI; getOriginal(workspaceUri: URI, sessionId: string | undefined): Promise; cleanUp(request: MutableChatRequestModel): Promise; } //# sourceMappingURL=claude-code-file-edit-backup-service.d.ts.map