import { CodeBuddyClient } from '../codebuddy/client.js';
import { ToolResult } from '../types/index.js';
export interface SelfHealingOptions {
    maxRetries: number;
    enabled: boolean;
    autoFix: boolean;
    verbose: boolean;
}
export interface FixAttempt {
    attemptNumber: number;
    originalError: string;
    fixApplied: string;
    result: 'success' | 'failure' | 'partial';
    newError?: string;
}
export interface SelfHealingResult {
    success: boolean;
    originalError: string;
    attempts: FixAttempt[];
    finalResult?: ToolResult;
    fixedCommand?: string;
}
/**
 * Self-Healing Engine - Automatically analyzes and fixes errors
 */
export declare class SelfHealingEngine {
    private options;
    private codebuddyClient;
    private history;
    constructor(options?: Partial<SelfHealingOptions>);
    /**
     * Set the Grok client for AI-powered fixes
     */
    setCodeBuddyClient(client: CodeBuddyClient): void;
    /**
     * Analyze an error and categorize it
     */
    analyzeError(error: string): {
        category: string;
        fixHint: string;
        matches: RegExpMatchArray | null;
    } | null;
    /**
     * Generate a fix command based on error analysis
     */
    generateFix(originalCommand: string, error: string, context?: string): Promise<string | null>;
    /**
     * Generate a simple fix without AI
     */
    private generateSimpleFix;
    /**
     * Attempt to heal a failed command execution
     */
    attemptHealing(originalCommand: string, error: string, executeCommand: (cmd: string) => Promise<ToolResult>, context?: string): Promise<SelfHealingResult>;
    /**
     * Get healing history
     */
    getHistory(): SelfHealingResult[];
    /**
     * Clear healing history
     */
    clearHistory(): void;
    /**
     * Format healing result for display
     */
    formatResult(result: SelfHealingResult): string;
    /**
     * Get statistics
     */
    getStats(): {
        totalAttempts: number;
        successfulHeals: number;
        failedHeals: number;
        successRate: string;
    };
    /**
     * Update options
     */
    updateOptions(options: Partial<SelfHealingOptions>): void;
    /**
     * Get current options
     */
    getOptions(): SelfHealingOptions;
}
export declare function getSelfHealingEngine(): SelfHealingEngine;
export declare function resetSelfHealingEngine(): void;
