import { Accumulator } from "./codec.mjs"; import { Schema } from "effect"; declare namespace streamEvents_d_exports { export { KnownProviderEvent, ProviderEvent, applyEvent, isErrorEvent, isInputJsonDeltaEvent, isMessageStop, isTextDeltaEvent, isThinkingDeltaEvent, isToolUseStartEvent }; } /** * Internal: union of variants we actually know how to decode from the wire. * Used as the decode target; failures are caught and re-emitted as `Unknown`. */ declare const KnownProviderEvent: Schema.Union; readonly message: Schema.Struct<{ readonly id: Schema.optional; readonly usage: Schema.optional; readonly output_tokens: Schema.optional; readonly cache_creation_input_tokens: Schema.optional>; readonly cache_read_input_tokens: Schema.optional>; }>>; }>; }>, Schema.Struct<{ readonly type: Schema.Literal<"content_block_start">; readonly index: Schema.Number; readonly content_block: Schema.Union; readonly text: Schema.String; }>, Schema.Struct<{ readonly type: Schema.Literal<"tool_use">; readonly id: Schema.String; readonly name: Schema.String; readonly input: Schema.Unknown; }>, Schema.Struct<{ readonly type: Schema.Literal<"thinking">; readonly thinking: Schema.String; readonly signature: Schema.optional; }>, Schema.Struct<{ readonly type: Schema.Literal<"redacted_thinking">; readonly data: Schema.String; }>]>; }>, Schema.Struct<{ readonly type: Schema.Literal<"content_block_delta">; readonly index: Schema.Number; readonly delta: Schema.Union; readonly text: Schema.String; }>, Schema.Struct<{ readonly type: Schema.Literal<"input_json_delta">; readonly partial_json: Schema.String; }>, Schema.Struct<{ readonly type: Schema.Literal<"thinking_delta">; readonly thinking: Schema.String; }>, Schema.Struct<{ readonly type: Schema.Literal<"signature_delta">; readonly signature: Schema.String; }>]>; }>, Schema.Struct<{ readonly type: Schema.Literal<"content_block_stop">; readonly index: Schema.Number; }>, Schema.Struct<{ readonly type: Schema.Literal<"message_delta">; readonly delta: Schema.Struct<{ readonly stop_reason: Schema.optional>; readonly stop_sequence: Schema.optional>; }>; readonly usage: Schema.optional; readonly output_tokens: Schema.optional; readonly cache_creation_input_tokens: Schema.optional>; readonly cache_read_input_tokens: Schema.optional>; }>>; }>, Schema.Struct<{ readonly type: Schema.Literal<"message_stop">; }>, Schema.Struct<{ readonly type: Schema.Literal<"ping">; }>, Schema.Struct<{ readonly type: Schema.Literal<"error">; readonly error: Schema.optional; readonly message: Schema.optional; }>>; }>]>; /** * Public: every event the native stream can emit. Discriminated on `type`. * The `_unknown` branch closes the cardinality so downstream `Match.exhaustive` * cannot silently miss a wire event we didn't model. */ declare const ProviderEvent: Schema.Union; readonly message: Schema.Struct<{ readonly id: Schema.optional; readonly usage: Schema.optional; readonly output_tokens: Schema.optional; readonly cache_creation_input_tokens: Schema.optional>; readonly cache_read_input_tokens: Schema.optional>; }>>; }>; }>, Schema.Struct<{ readonly type: Schema.Literal<"content_block_start">; readonly index: Schema.Number; readonly content_block: Schema.Union; readonly text: Schema.String; }>, Schema.Struct<{ readonly type: Schema.Literal<"tool_use">; readonly id: Schema.String; readonly name: Schema.String; readonly input: Schema.Unknown; }>, Schema.Struct<{ readonly type: Schema.Literal<"thinking">; readonly thinking: Schema.String; readonly signature: Schema.optional; }>, Schema.Struct<{ readonly type: Schema.Literal<"redacted_thinking">; readonly data: Schema.String; }>]>; }>, Schema.Struct<{ readonly type: Schema.Literal<"content_block_delta">; readonly index: Schema.Number; readonly delta: Schema.Union; readonly text: Schema.String; }>, Schema.Struct<{ readonly type: Schema.Literal<"input_json_delta">; readonly partial_json: Schema.String; }>, Schema.Struct<{ readonly type: Schema.Literal<"thinking_delta">; readonly thinking: Schema.String; }>, Schema.Struct<{ readonly type: Schema.Literal<"signature_delta">; readonly signature: Schema.String; }>]>; }>, Schema.Struct<{ readonly type: Schema.Literal<"content_block_stop">; readonly index: Schema.Number; }>, Schema.Struct<{ readonly type: Schema.Literal<"message_delta">; readonly delta: Schema.Struct<{ readonly stop_reason: Schema.optional>; readonly stop_sequence: Schema.optional>; }>; readonly usage: Schema.optional; readonly output_tokens: Schema.optional; readonly cache_creation_input_tokens: Schema.optional>; readonly cache_read_input_tokens: Schema.optional>; }>>; }>, Schema.Struct<{ readonly type: Schema.Literal<"message_stop">; }>, Schema.Struct<{ readonly type: Schema.Literal<"ping">; }>, Schema.Struct<{ readonly type: Schema.Literal<"error">; readonly error: Schema.optional; readonly message: Schema.optional; }>>; }>, Schema.Struct<{ readonly type: Schema.Literal<"_unknown">; readonly raw: Schema.Unknown; }>]>; type ProviderEvent = typeof ProviderEvent.Type; declare const applyEvent: (acc: Accumulator, event: ProviderEvent) => Accumulator; declare const isTextDeltaEvent: (event: ProviderEvent) => event is Extract; declare const isThinkingDeltaEvent: (event: ProviderEvent) => event is Extract; declare const isInputJsonDeltaEvent: (event: ProviderEvent) => event is Extract; declare const isToolUseStartEvent: (event: ProviderEvent) => event is Extract; declare const isMessageStop: (event: ProviderEvent) => boolean; declare const isErrorEvent: (event: ProviderEvent) => event is Extract; //#endregion export { KnownProviderEvent, ProviderEvent, applyEvent, isErrorEvent, isInputJsonDeltaEvent, isMessageStop, isTextDeltaEvent, isThinkingDeltaEvent, isToolUseStartEvent, streamEvents_d_exports as t }; //# sourceMappingURL=streamEvents.d.mts.map