import type { ProviderTurnTraceEntry, RequestBudgetSnapshot, SessionUsageOperation, Turn } from "@best-agent/protocol";
import type { ConversationMessage, ProviderCacheControl, ProviderToolOption } from "../../provider/provider-core.js";
import type { ProviderCorrectionTrace } from "../checkpoint-codec.js";
import type { ProviderTurnInvokeContext } from "./provider-turn-budget.js";
export type GenerateFinalAnswerRepairRuntime = {
    assertValidTerminalAssistantText: (text: string) => string;
    buildCorrectionTrace: (input: {
        code: ProviderCorrectionTrace["code"];
        messages: ConversationMessage[];
        operation: SessionUsageOperation;
        systemPrompt?: string;
        tools?: ProviderToolOption[];
    }) => ProviderCorrectionTrace;
    buildProviderInvokeContext: (overrides?: Partial<ProviderTurnInvokeContext>) => ProviderTurnInvokeContext;
    provider: {
        generate: (threadId: Turn["threadId"], turnId: Turn["id"], request: {
            cacheControl?: ProviderCacheControl;
            messages: ConversationMessage[];
            systemPrompt?: string;
        }, operation: SessionUsageOperation, context: ProviderTurnInvokeContext) => Promise<{
            text: string;
        }>;
    };
};
type ProviderTurnTraceValidation = NonNullable<ProviderTurnTraceEntry["validation"]>;
export declare function repairDurableGenerateFinalAnswer(input: {
    availableTools: ProviderToolOption[];
    cacheControl?: ProviderCacheControl;
    finalAnswerRepairAttempted: boolean;
    messages: ConversationMessage[];
    objective?: string;
    operation: SessionUsageOperation;
    requestBudgetSnapshot?: RequestBudgetSnapshot;
    responseText: string;
    runtime: GenerateFinalAnswerRepairRuntime;
    systemPrompt?: string;
    turn: Turn;
}): Promise<{
    repairValidation?: ProviderTurnTraceValidation;
    repaired: boolean;
    responseText: string;
}>;
export {};
//# sourceMappingURL=provider-final-answer-repair-runner.d.ts.map