import { EventEmitter } from 'events';
export interface FileSnapshot {
    path: string;
    content: string;
    existed: boolean;
    hash: string;
}
export interface PersistentCheckpoint {
    id: string;
    timestamp: Date;
    description: string;
    files: FileSnapshot[];
    workingDirectory: string;
    projectHash: string;
}
export interface CheckpointIndex {
    projectHash: string;
    projectPath: string;
    checkpoints: string[];
    lastUpdated: Date;
}
export interface PersistentCheckpointManagerOptions {
    maxCheckpoints?: number;
    autoCheckpoint?: boolean;
    historyDir?: string;
}
/**
 * Persistent Checkpoint Manager - Inspired by Gemini CLI
 * Stores checkpoints in ~/.codebuddy/history/<project_hash>/ for cross-session persistence
 */
export declare class PersistentCheckpointManager extends EventEmitter {
    private maxCheckpoints;
    private autoCheckpoint;
    private workingDirectory;
    private historyDir;
    private projectHash;
    private projectHistoryDir;
    private indexPath;
    private checkpointCache;
    constructor(options?: PersistentCheckpointManagerOptions);
    /**
     * Generate a unique hash for the project based on its path
     */
    private generateProjectHash;
    /**
     * Ensure the history directory structure exists
     */
    private ensureHistoryDir;
    /**
     * Load checkpoint index
     */
    private loadIndex;
    /**
     * Save checkpoint index
     */
    private saveIndex;
    /**
     * Get checkpoint file path
     */
    private getCheckpointPath;
    /**
     * Generate file content hash
     */
    private hashContent;
    /**
     * Create a new persistent checkpoint
     */
    createCheckpoint(description: string, files?: string[]): PersistentCheckpoint;
    /**
     * Save checkpoint to disk
     */
    private saveCheckpoint;
    /**
     * Load checkpoint from disk
     */
    private loadCheckpoint;
    /**
     * Delete checkpoint file
     */
    private deleteCheckpointFile;
    /**
     * Create a checkpoint before modifying a file
     */
    checkpointBeforeEdit(filePath: string, description?: string): PersistentCheckpoint;
    /**
     * Create a checkpoint before creating a file
     */
    checkpointBeforeCreate(filePath: string, description?: string): PersistentCheckpoint;
    /**
     * Snapshot multiple files
     */
    private snapshotFiles;
    /**
     * Restore to a specific checkpoint (like Gemini CLI's /restore)
     */
    restore(checkpointId: string): {
        success: boolean;
        restored: string[];
        errors: string[];
        checkpoint?: PersistentCheckpoint;
    };
    /**
     * Restore to the last checkpoint
     */
    restoreLast(): {
        success: boolean;
        restored: string[];
        errors: string[];
        checkpoint?: PersistentCheckpoint;
    };
    /**
     * Get all checkpoints for this project
     */
    getCheckpoints(): PersistentCheckpoint[];
    /**
     * Get checkpoint by ID
     */
    getCheckpoint(id: string): PersistentCheckpoint | null;
    /**
     * Get recent checkpoints
     */
    getRecentCheckpoints(count?: number): PersistentCheckpoint[];
    /**
     * Clear all checkpoints for this project
     */
    clearCheckpoints(): void;
    /**
     * Delete a specific checkpoint
     */
    deleteCheckpoint(id: string): boolean;
    /**
     * Format checkpoint for display
     */
    formatCheckpoint(checkpoint: PersistentCheckpoint): string;
    /**
     * Format all checkpoints for display (interactive restore menu)
     */
    formatCheckpointList(): string;
    /**
     * Generate a unique checkpoint ID
     */
    private generateCheckpointId;
    /**
     * Get statistics about checkpoints
     */
    getStats(): {
        count: number;
        totalFiles: number;
        storageSize: number;
        oldestTimestamp?: Date;
        newestTimestamp?: Date;
        storagePath: string;
    };
    /**
     * Check if auto-checkpoint is enabled
     */
    isAutoCheckpointEnabled(): boolean;
    /**
     * Enable or disable auto-checkpoint
     */
    setAutoCheckpoint(enabled: boolean): void;
    /**
     * Get the history directory path
     */
    getHistoryDir(): string;
    /**
     * Dispose and cleanup resources
     */
    dispose(): void;
}
export declare function getPersistentCheckpointManager(options?: PersistentCheckpointManagerOptions): PersistentCheckpointManager;
export declare function resetPersistentCheckpointManager(): void;
