import type Anthropic from '@anthropic-ai/sdk'; import type { MessageStream } from '@anthropic-ai/sdk/lib/MessageStream'; import type { AnthropicParsedMessage } from './response'; /** * Edge-safe wrapper around the Anthropic SDK's raw `MessageStream`. * * The raw stream's async iterator rejects with the SDK's own error types when * the underlying connection fails mid-stream (distinct from a `finalMessage()` * rejection, which the provider bundle already normalizes separately). This * wrapper catches those iteration failures and rethrows a normalized * {@link CruxAdapterError} so `textStream` consumers never see raw provider * exceptions. It forwards only the two members the provider bundle needs — * async iteration and `finalMessage()` — mirroring the OpenAI stream capture. */ export declare class AnthropicChatStream implements AsyncIterable { #private; constructor(raw: MessageStream); [Symbol.asyncIterator](): AsyncIterator; /** Forward to the raw stream's `finalMessage()`; rejection normalization stays with the caller. */ finalMessage(): Promise; } /** Wrap a raw Anthropic `MessageStream` so mid-stream iteration errors are normalized. */ export declare function createAnthropicStreamCapture(raw: MessageStream): AnthropicChatStream;