/**
 * Crash Handler for Code Buddy
 *
 * Provides graceful crash recovery with:
 * - Session state preservation
 * - Error context logging
 * - Recovery file creation
 * - Clean terminal restoration
 */
export interface CrashContext {
    timestamp: Date;
    error: {
        name: string;
        message: string;
        stack?: string;
    };
    sessionId?: string;
    workingDirectory: string;
    nodeVersion: string;
    platform: string;
    lastMessages?: Array<{
        role: string;
        content: string;
    }>;
    pendingOperations?: string[];
}
export interface RecoveryInfo {
    sessionId: string;
    timestamp: Date;
    recoveryFilePath: string;
    reason: string;
    resumable: boolean;
}
/**
 * Crash Handler singleton
 */
declare class CrashHandler {
    private sessionId;
    private lastMessages;
    private pendingOperations;
    private isInitialized;
    /**
     * Initialize the crash handler
     */
    initialize(): void;
    /**
     * Set the current session ID for recovery
     */
    setSessionId(sessionId: string): void;
    /**
     * Track messages for crash recovery
     */
    trackMessage(role: string, content: string): void;
    /**
     * Track pending operations
     */
    trackOperation(operation: string): void;
    /**
     * Clear a completed operation
     */
    clearOperation(operation: string): void;
    /**
     * Save crash context to a recovery file
     */
    saveCrashContext(error: Error, reason: string): string | null;
    /**
     * Get the latest recovery info if available
     */
    getLatestRecovery(): RecoveryInfo | null;
    /**
     * Get crash context from a recovery file
     */
    getCrashContext(filePath: string): CrashContext | null;
    /**
     * Clear recovery files after successful session start
     */
    clearRecovery(): void;
    /**
     * Clean up old crash files (keep last 10)
     */
    cleanupOldCrashes(): void;
    /**
     * Restore terminal to normal state
     */
    restoreTerminal(): void;
    /**
     * Handle a crash - save context and restore terminal
     */
    handleCrash(error: Error, reason: string): string | null;
}
/**
 * Get the crash handler singleton
 */
export declare function getCrashHandler(): CrashHandler;
/**
 * Format crash info for display
 */
export declare function formatCrashInfo(recovery: RecoveryInfo): string;
export {};
