export type WorkspaceUndoIndex = { version: 1; entries: Record; }; export type WorkspaceMutation = WorkspacePatchMutation | WorkspaceWriteMutation; export type WorkspacePatchMutation = { type: "patch"; patch: string; toolName?: string; }; export type WorkspaceWriteMutation = { type: "write"; path: string; beforeContent?: string; afterContent: string; toolName?: string; }; export type WorkspaceMutationPreparation = { type: "write"; path: string; beforeContent?: string; }; export type WorkspaceMutationFromToolInput = { cwd: string; toolName: string; args: unknown; details: unknown; isError: boolean; preparation?: WorkspaceMutationPreparation | undefined; }; export type WorkspaceRevertResult = { ok: true; changedFiles: number; revertedChanges: number; } | { ok: false; error: string; }; export declare const WORKSPACE_MUTATION_ENTRY_TYPE = "pix-workspace-mutation"; export declare function workspaceUndoIndexKey(_sessionFile: string | undefined, _sessionId: string, entryId: string): string; export declare function loadWorkspaceUndoIndex(agentDir: string): WorkspaceUndoIndex; export declare function saveWorkspaceUndoIndex(agentDir: string, index: WorkspaceUndoIndex): void; export declare function prepareWorkspaceMutation(cwd: string, toolName: string, args: unknown): WorkspaceMutationPreparation | undefined; export declare function workspaceMutationFromToolExecution(input: WorkspaceMutationFromToolInput): WorkspaceMutation | undefined; export declare function revertWorkspaceMutations(cwd: string, mutations: readonly WorkspaceMutation[]): Promise;