import type { ChatMessage, CompletionResult, ProviderId } from "../../../types.js"; export declare const MAX_OUTPUT_BUDGET_CONTINUATIONS = 1; export interface OutputBudgetState { truncatedBudgetRounds: number; continuationBudgetFloor: number; retryWithoutThinking: boolean; interruptedVisible: string; interruptedReasoning: string; lowYieldResumptions: number; visibleCommitted: boolean; } export interface OutputBudgetPorts { readonly messages: ChatMessage[]; readonly provider: ProviderId; readonly model: string; readonly stepMaxTokens: number; readonly maxStepCompletionTokens: number; readonly notify: (level: "info" | "warn", message: string) => void; readonly recoveryUserMessage: (content: string) => ChatMessage; readonly pushAssistantHistory: (text: string) => void; readonly commitAssistantRetry: (text: string) => void; } export interface OutputBudgetInput { readonly completion: CompletionResult; readonly assistantVisible: string; readonly assistantThinkContent: string; readonly hasThinking: boolean; readonly canonicalVisible: string; } export type OutputBudgetDecision = "continue-round" | "stop-partial" | "proceed"; export declare const routeCompletionBudget: (input: { readonly provider: ProviderId; readonly model: string; readonly stepMaxTokens: number; }) => number; export declare const outputBudgetExhausted: (input: { readonly completion: CompletionResult; readonly completionBudget: number; }) => boolean; export declare const handleOutputBudgetExhaustion: (ports: OutputBudgetPorts, state: OutputBudgetState, input: OutputBudgetInput, completionBudget: number) => OutputBudgetDecision;