export type TurnCheckpointFileStatus = 'added' | 'modified' | 'deleted' | 'renamed'; export type TurnCheckpointDiff = { files: Array<{ path: string; status: TurnCheckpointFileStatus; }>; added: number; removed: number; diff: string; diffTruncated: boolean; beforeRef?: string; afterRef?: string; }; export declare function checkpointRefName(conversationId: string, turnId: string, stage: 'before' | 'after'): string; /** * Capture a non-invasive Git snapshot of the workspace into `refs/xopc/checkpoints///`. * Returns the stored ref name and tree SHA, or `null` if `cwd` is not a Git repository. */ export declare function captureTurnCheckpoint(input: { cwd: string; conversationId: string; turnId: string; stage: 'before' | 'after'; }): Promise<{ ref: string; treeSha: string; commitSha: string; } | null>; /** * Compute exact file statuses, +/- line stats, and unified diff between a turn's `before` and `after` checkpoints. */ export declare function computeTurnCheckpointDiff(input: { cwd: string; conversationId: string; turnId: string; maxDiffChars?: number; }): Promise; type RestoreCheckpointInput = { cwd: string; conversationId: string; turnId: string; stage?: 'before' | 'after'; }; /** Apply only the turn's change, keeping unrelated working tree and index changes. */ export declare function restoreTurnCheckpoint(input: RestoreCheckpointInput, options?: { checkOnly?: boolean; optional?: boolean; }): Promise<{ restored: boolean; filesChanged: number; stage: 'before' | 'after'; }>; /** Check whether a turn has stored `before` / `after` checkpoint refs. */ export declare function hasTurnCheckpoint(input: { cwd: string; conversationId: string; turnId: string; }): Promise<{ hasBefore: boolean; hasAfter: boolean; }>; export {};