/** * Filesystem snapshot tracking for the forge harness. * * Records a `.bak` copy of every file touched by mutating tools * (`write` / `edit` / `multi_patch`) in `tool.execute.before` and exposes a * lookup used by the `fs_undo` tool to roll back. * * Storage layout (user preference: under the plugin data dir): * /snapshots//-.bak * * `fileTag` is the workspace-relative path with non-alphanumerics replaced by * underscores, matching the legacy forgecode layout so existing snapshots * remain restorable after the path move. */ export declare const SNAPSHOTS_SUBDIR = "snapshots"; export interface SnapshotLocation { dataDir: string; sessionId: string; workingDir: string; } export interface SnapshotEntry { sessionDir: string; entry: string; ts: number; } export declare function fileTag(relPath: string): string; export declare function snapshotsRoot(dataDir: string): string; export declare function sessionSnapshotsDir(dataDir: string, sessionId: string): string; /** * Capture the current content of `absPath` into a snapshot file. No-op when * the file does not exist (e.g. a new `write` creating a file for the first * time — nothing to roll back to). */ export declare function captureSnapshot(absPath: string, loc: SnapshotLocation): Promise; /** * List all snapshots for a specific workspace-relative file across every * session under `dataDir`, newest first. */ export declare function findSnapshots(dataDir: string, workingDir: string, file: string): Promise; /** * Restore the content stored at the given snapshot entry back onto `absPath`. * Returns the timestamp recorded on the snapshot. */ export declare function restoreSnapshot(absPath: string, snap: SnapshotEntry): Promise; //# sourceMappingURL=snapshot.d.ts.map