import type { RequestBudgetSnapshot, SessionUsageOperation, Turn, TurnSettlementRecord } from "@best-agent/protocol";
import type { ConversationMessage, ProviderCacheControl, ProviderToolOption } from "../../provider/provider-core.js";
import type { PromptDeliverableFailure } from "../../prompt/runtime-prompts.js";
import type { ProviderCorrectionTrace } from "../checkpoint-codec.js";
import type { ProviderTurnInvokeContext } from "./provider-turn-budget.js";
type GenerateTerminalRepairRuntime = {
    assertValidTerminalAssistantText: (text: string) => string;
    buildCorrectionTrace: (input: {
        code: ProviderCorrectionTrace["code"];
        messages: ConversationMessage[];
        operation: SessionUsageOperation;
        systemPrompt?: string;
        tools?: ProviderToolOption[];
    }) => ProviderCorrectionTrace;
    buildProviderInvokeContext: (overrides?: Partial<ProviderTurnInvokeContext>) => ProviderTurnInvokeContext;
    buildTurnSettlementRecord: (input: {
        rejectedReason?: TurnSettlementRecord["rejectedReason"];
        terminalKind: TurnSettlementRecord["terminalKind"];
        unresolvedFailures?: PromptDeliverableFailure[];
    }) => Promise<TurnSettlementRecord>;
    provider: {
        generate: (threadId: Turn["threadId"], turnId: Turn["id"], request: {
            cacheControl?: ProviderCacheControl;
            messages: ConversationMessage[];
            systemPrompt?: string;
        }, operation: SessionUsageOperation, context: ProviderTurnInvokeContext) => Promise<{
            text: string;
        }>;
    };
    recordTurnSettlement: (settlement: TurnSettlementRecord) => Promise<void>;
};
export declare function repairDurableGenerateTerminalOutput(input: {
    availableTools: ProviderToolOption[];
    cacheControl?: ProviderCacheControl;
    messages: ConversationMessage[];
    operation: SessionUsageOperation;
    repairAttempted: boolean;
    requestBudgetSnapshot?: RequestBudgetSnapshot;
    responseText: string;
    runtime: GenerateTerminalRepairRuntime;
    systemPrompt?: string;
    turn: Turn;
}): Promise<{
    repaired: boolean;
    responseText: string;
}>;
export {};
//# sourceMappingURL=provider-terminal-repair-runner.d.ts.map