import type { CompletionResult, ProviderId, TokenUsage } from "../../../types.js"; import { contextAttemptFromOperationUsage } from "../../../llm/context-snapshot.js"; export interface CompletionUsagePorts { readonly dispatchedRawRequestTokens: number; readonly dispatchedRequestRoute: { provider: ProviderId; model: string; } | undefined; readonly emitTokenUsage: (input: { usage: TokenUsage; provider: ProviderId; model: string; api?: string | undefined; attempt?: ReturnType | undefined; }) => void; readonly emitContextFallback: (estimatedTokens: number) => void; readonly audit: (event: string, payload: Readonly>) => Promise; } export declare const accountCompletionUsage: (ports: CompletionUsagePorts, completion: CompletionResult) => Promise; export interface AssistantTextParts { readonly visible: string; readonly hasThinking: boolean; readonly thinkContent: string; } export interface InterpretedCompletion { readonly assistantText: AssistantTextParts; readonly canonicalVisible: string; readonly thinkContent: string; readonly retryReasoning: Pick; } export declare const interpretCompletion: (input: { readonly completion: CompletionResult; readonly streamedReasoningText: string; readonly interruptedVisible: string; }) => InterpretedCompletion;