/**
 * Automated Program Repair Engine
 *
 * Main repair orchestration that combines multiple repair strategies:
 * - Template-based repair
 * - Search-based repair
 * - LLM-guided repair
 *
 * Based on research:
 * - RepairAgent (ICSE 2024) - LLM-guided repair
 * - AgentCoder (Huang et al., 2023) - Test-driven repair
 * - ITER (arXiv 2403.00418) - Iterative template repair
 */
import { EventEmitter } from "events";
import { RepairConfig, RepairResult, RepairSession, RepairStats, TestExecutor, CommandExecutor, FileReader, FileWriter } from "./types.js";
/**
 * Automated Program Repair Engine
 */
export declare class RepairEngine extends EventEmitter {
    private config;
    private client;
    private faultLocalizer;
    private templateEngine;
    private sessions;
    private learningData;
    private testExecutor?;
    private commandExecutor?;
    private fileReader?;
    private fileWriter?;
    constructor(config?: Partial<RepairConfig>, apiKey?: string, baseURL?: string);
    /**
     * Set external executors
     */
    setExecutors(executors: {
        testExecutor?: TestExecutor;
        commandExecutor?: CommandExecutor;
        fileReader?: FileReader;
        fileWriter?: FileWriter;
    }): void;
    /**
     * Main repair entry point
     */
    repair(errorOutput: string, contextHint?: string): Promise<RepairResult[]>;
    /**
     * Repair a single fault
     */
    private repairFault;
    /**
     * Generate patches using LLM
     */
    private generateLLMPatches;
    /**
     * Parse LLM response to extract patch
     */
    private parseLLMPatch;
    /**
     * Refine patches based on failed attempts
     */
    private refinePatchesWithLLM;
    /**
     * Validate a patch by running tests
     */
    private validatePatch;
    /**
     * Apply a patch to the file system
     */
    private applyPatch;
    /**
     * Get code context around a fault location
     */
    private getCodeContext;
    /**
     * Create a generic fault from error output
     */
    private createGenericFault;
    /**
     * Detect programming language from file extension
     */
    private detectLanguage;
    /**
     * Initialize stats object
     */
    private initializeStats;
    /**
     * Update stats with a repair result
     */
    private updateStats;
    /**
     * Record learning data from successful repair
     */
    private recordLearning;
    /**
     * Get repair statistics
     */
    getStatistics(): RepairStats;
    /**
     * Get repair history
     */
    getHistory(): RepairSession[];
    /**
     * Clear repair history
     */
    clearHistory(): void;
    /**
     * Format repair result for display
     */
    formatResult(result: RepairResult): string;
    /**
     * Get configuration
     */
    getConfig(): RepairConfig;
    /**
     * Update configuration
     */
    updateConfig(config: Partial<RepairConfig>): void;
    /**
     * Dispose and cleanup
     */
    dispose(): void;
}
/**
 * Create a repair engine instance
 */
export declare function createRepairEngine(config?: Partial<RepairConfig>, apiKey?: string, baseURL?: string): RepairEngine;
export declare function getRepairEngine(apiKey?: string, baseURL?: string): RepairEngine;
export declare function resetRepairEngine(): void;
