import type { RequestBudgetSnapshot } from "@best-agent/protocol";
import type { ConversationMessage, ProviderCacheControl, ProviderDecisionOutput, ProviderTextStreamCallbacks, ProviderToolOption } from "../../provider/provider-core.js";
import type { ProviderDecisionResolutionControls, ProviderDecisionResolutionInput } from "./provider-decision-resolution.js";
import type { RequiredToolConstraint } from "./tool-constraint-types.js";
export type ProviderGenerateOnlyPreparedRequest = {
    request: {
        cacheControl?: ProviderCacheControl;
        messages: ConversationMessage[];
        systemPrompt?: string;
    };
    snapshot: RequestBudgetSnapshot;
};
export declare function runProviderGenerateOnlyTurn(input: {
    assertTurnAttemptWritable: () => Promise<void>;
    canRetryContextOverflow: (error: unknown, snapshot: RequestBudgetSnapshot) => boolean;
    emitReasoning: (reasoningText: string) => void;
    invokeGenerate: (preparedRequest: ProviderGenerateOnlyPreparedRequest) => Promise<{
        reasoningText?: string;
        text: string;
    }>;
    prepareRequest: (options?: {
        forceCompaction?: boolean;
    }) => Promise<ProviderGenerateOnlyPreparedRequest>;
    repairResponse: (preparedRequest: ProviderGenerateOnlyPreparedRequest, responseText: string) => Promise<{
        finalAnswerRepaired: boolean;
        responseText: string;
        terminalOutputRepaired: boolean;
    }>;
    sawReasoning: () => boolean;
}): Promise<{
    finalAnswerRepaired: boolean;
    responseText: string;
    terminalOutputRepaired: boolean;
}>;
export type ProviderDecisionPreparedRequest = {
    request: {
        cacheControl?: ProviderCacheControl;
        messages: ConversationMessage[];
        systemPrompt?: string;
        tools?: ProviderToolOption[];
    };
    snapshot: RequestBudgetSnapshot;
};
export type ProviderDecisionPreview = {
    callbacks: ProviderTextStreamCallbacks;
    finalize: () => Promise<void>;
    resolveToolCallId: (providerToolCallId?: string) => ProviderDecisionResolutionInput["resolvePreviewToolCallId"] extends ((providerToolCallId?: string) => infer R) | undefined ? R : never;
};
export declare function runProviderDecisionTurn(input: {
    approvalTurn?: ProviderDecisionResolutionInput["approvalTurn"];
    assertTurnAttemptWritable: () => Promise<void>;
    availableTools: ProviderToolOption[];
    buildDecideMemoryRequest: (options?: {
        forceCompaction?: boolean;
    }) => Promise<ProviderDecisionPreparedRequest>;
    canRetryContextOverflow: (error: unknown, snapshot: RequestBudgetSnapshot) => boolean;
    controls: ProviderDecisionResolutionControls;
    createDecisionPreview: (visibleTools: ProviderToolOption[], noActionTimeoutMs?: number) => ProviderDecisionPreview;
    invokeDecide: (preparedRequest: ProviderDecisionPreparedRequest, input: {
        decisionMessages: ConversationMessage[];
        decisionPreview: ProviderDecisionPreview;
        decisionSystemPrompt?: string;
        requiredToolConstraint?: RequiredToolConstraint;
        visibleTools: ProviderToolOption[];
    }) => Promise<ProviderDecisionOutput>;
    noActionTimeoutMs: () => number;
    providerTurnBudgeted: boolean;
    resolveDecision: (input: {
        decision: ProviderDecisionOutput;
        decisionMessages: ConversationMessage[];
        decisionPreview: ProviderDecisionPreview;
        decisionSystemPrompt?: string;
        preparedRequest: ProviderDecisionPreparedRequest;
        requiredToolConstraint?: RequiredToolConstraint;
        visibleTools: ProviderToolOption[];
    }) => Promise<string>;
    resolveRequiredToolConstraint: (messages: ConversationMessage[], availableTools: ProviderToolOption[]) => RequiredToolConstraint | undefined;
    resolveVisibleTools: (availableTools: ProviderToolOption[], requiredToolConstraint: RequiredToolConstraint | undefined, messages: ConversationMessage[]) => ProviderToolOption[];
}): Promise<{
    completionGuardRepaired: boolean;
    responseText: string;
    terminalOutputRepaired: boolean;
}>;
//# sourceMappingURL=provider-turn-runner.d.ts.map