import type { StreamChunk } from '../types.js'; /** * Cross-event state for Anthropic streaming. The protocol splits prompt and * completion token counts across two distinct events; we track the prompt * count from `message_start` so the later `message_delta` → `finish` chunk can * emit a complete usage object. */ export interface AnthropicStreamState { lastPromptTokens: number; } export declare function newAnthropicStreamState(): AnthropicStreamState; /** * Map a single decoded Anthropic stream event to zero-or-more `StreamChunk`s. * Shared by the native Anthropic adapter and Bedrock, which wraps Anthropic's * events 1:1 in `chunk.bytes`. * * `state` is mutated across calls: `message_start` captures `lastPromptTokens`, * the subsequent `message_delta` reads it back. Without this, the `finish` * chunk reports `promptTokens: 0`, the agent loop's last-wins aggregation * overwrites the correct earlier value, and consumers (billing, withBudget) * silently undercharge for streamed calls. */ export declare function mapAnthropicStreamEvent(event: Record, state: AnthropicStreamState): Generator; //# sourceMappingURL=anthropic-stream.d.ts.map