/**
 * Multi-Turn Agent Loop
 *
 * Generic multi-turn execution loop with verification and error recovery.
 * Unlike multi-turn-agent.ts (which is tightly coupled to droid CLI and
 * Terminal-Bench verification), this module provides a reusable loop that
 * accepts any executor and optional verifier functions.
 */
export interface TurnResult {
    turn: number;
    output: string;
    durationMs: number;
    error?: string;
}
export interface MultiTurnResult {
    turns: TurnResult[];
    finalOutput: string;
    success: boolean;
    totalDurationMs: number;
}
export interface MultiTurnLoopConfig {
    maxTurns: number;
    verifyAfterEach: boolean;
    errorRecoveryEnabled: boolean;
}
export declare class MultiTurnAgentLoop {
    private readonly config;
    private readonly stats;
    constructor(config: MultiTurnLoopConfig);
    /**
     * Execute a single turn: build a prompt from instruction + context, call the executor.
     */
    executeTurn(instruction: string, context: string, executor: (prompt: string) => Promise<string>): Promise<TurnResult>;
    /**
     * Execute the full multi-turn loop with optional verification and retry.
     *
     * Flow:
     * 1. Execute turn 1 with the original instruction
     * 2. If verifier provided and verifyAfterEach is true, verify output
     * 3. If verification fails and errorRecoveryEnabled, build error feedback prompt and retry
     * 4. Continue until success or maxTurns reached
     * 5. Return all turns, final output, and success status
     */
    executeWithRetry(instruction: string, executor: (prompt: string) => Promise<string>, verifier?: (output: string) => Promise<{
        passed: boolean;
        feedback: string;
    }>): Promise<MultiTurnResult>;
    /**
     * Get aggregate statistics across all executeWithRetry calls on this instance.
     */
    getStats(): {
        totalTurns: number;
        successRate: number;
        avgTurnsToSuccess: number;
    };
}
//# sourceMappingURL=multi-turn-loop.d.ts.map