export declare const SNAPSHOT_ENTRY_TYPE = "undo-snapshot"; export type ChangeKind = "content" | "diff"; export interface FileChange { path: string; existedBefore: boolean; kind: ChangeKind; before?: string; after?: string; diff?: string; beforeHash?: string; afterHash?: string; } export interface Snapshot { id: string; turn: number; leafEntryId: string; timestamp: string; changes: FileChange[]; } export type ApplyDirection = "forward" | "reverse"; export type FileAction = "modified" | "added" | "deleted"; export interface FileChangeOutcome { path: string; action: FileAction; /** Set when the current on-disk content differed from the expected state and was backed up before overwriting. */ backupPath?: string; /** For modified files: lines added/removed by the snapshot's edit. */ linesAdded?: number; linesRemoved?: number; } export interface ApplyReport { applied: number; files: FileChangeOutcome[]; } export interface TreeLike { getEntry(id: string): { id: string; parentId: string | null; } | undefined; } export interface FileOps { readText(path: string): Promise; writeText(path: string, content: string): Promise; deleteFile(path: string): Promise; writeBackup(path: string, content: string): Promise; }