/**
 * Checkpoint Rollback
 *
 * Automatic checkpointing before risky operations with rollback support.
 */
import { EventEmitter } from 'events';
export interface AutoCheckpoint {
    id: string;
    operation: string;
    createdAt: Date;
    files: {
        path: string;
        content: string;
        existed: boolean;
    }[];
    expiresAt: Date;
}
export interface RollbackResult {
    success: boolean;
    checkpointId: string;
    filesRestored: number;
    error?: string;
}
export declare class CheckpointRollback extends EventEmitter {
    private checkpoints;
    private maxCheckpoints;
    private expirationDays;
    /**
     * Determine if an operation is risky
     */
    isRiskyOperation(toolName: string, args?: Record<string, unknown>): boolean;
    /**
     * Create a checkpoint before a risky operation
     */
    autoCheckpoint(operation: string, files: {
        path: string;
        content: string;
        existed: boolean;
    }[]): AutoCheckpoint;
    /**
     * Rollback to a checkpoint
     */
    rollbackTo(checkpointId: string, fileWriter: (path: string, content: string) => Promise<void>, fileDeleter: (path: string) => Promise<void>): Promise<RollbackResult>;
    /**
     * Get a checkpoint
     */
    getCheckpoint(id: string): AutoCheckpoint | undefined;
    /**
     * List checkpoints
     */
    listCheckpoints(): AutoCheckpoint[];
    /**
     * Remove expired checkpoints
     */
    private prune;
    /**
     * Clear all checkpoints
     */
    clear(): void;
}
export declare function getCheckpointRollback(): CheckpointRollback;
export declare function resetCheckpointRollback(): void;
