import { Schema } from 'effect'; /** Error taxonomy. `retryable` on the event drives client/agent retry. */ export declare const AgentErrorCode: Schema.Literal<["provider", "tool", "timeout", "cancelled", "decode", "internal"]>; export declare type AgentErrorCode = typeof AgentErrorCode.Type; export declare const AgentEvent: Schema.Union<[Schema.Struct<{ _tag: Schema.Literal<["token"]>; text: typeof Schema.String; }>, Schema.Struct<{ _tag: Schema.Literal<["reasoning"]>; text: typeof Schema.String; }>, Schema.Struct<{ _tag: Schema.Literal<["toolCall"]>; id: typeof Schema.String; name: typeof Schema.String; input: typeof Schema.Unknown; }>, Schema.Struct<{ _tag: Schema.Literal<["toolResult"]>; id: typeof Schema.String; name: typeof Schema.String; output: Schema.optional; error: Schema.optional; }>, Schema.Struct<{ _tag: Schema.Literal<["source"]>; sourceType: Schema.Literal<["url", "document"]>; id: typeof Schema.String; url: Schema.optional; title: Schema.optional; mediaType: Schema.optional; filename: Schema.optional; /** Provider-owned citation attribution; not normalized or interpreted. */ providerMetadata: Schema.optional; }>, Schema.Struct<{ _tag: Schema.Literal<["file"]>; mediaType: typeof Schema.String; data: typeof Schema.String; /** Metadata for this file, not the whole model step. */ providerMetadata: Schema.optional; }>, Schema.Struct<{ _tag: Schema.Literal<["stepMetadata"]>; step: Schema.filter; providerMetadata: typeof Schema.Unknown; }>, Schema.Struct<{ _tag: Schema.Literal<["message"]>; role: typeof Schema.String; content: typeof Schema.String; }>, Schema.Struct<{ _tag: Schema.Literal<["error"]>; code: Schema.Literal<["provider", "tool", "timeout", "cancelled", "decode", "internal"]>; message: typeof Schema.String; retryable: typeof Schema.Boolean; }>, Schema.Struct<{ _tag: Schema.Literal<["done"]>; finishReason: typeof Schema.String; usage: Schema.Struct<{ inputTokens: Schema.optional; outputTokens: Schema.optional; totalTokens: Schema.optional; }>; }>]>; export declare type AgentEvent = typeof AgentEvent.Type; /** Browser-safe input allowlist. Session configuration and provider credentials * belong to the server, never to events received from the browser. */ export declare const RealtimeClientEvent: Schema.Union<[Schema.Struct<{ type: Schema.Literal<["input-audio-append"]>; audio: Schema.filter; }>, Schema.Struct<{ type: Schema.Literal<["input-audio-commit", "input-audio-clear", "response-create", "response-cancel"]>; }>, Schema.Struct<{ type: Schema.Literal<["conversation-item-create"]>; item: Schema.Struct<{ type: Schema.Literal<["text-message"]>; role: Schema.Literal<["user"]>; text: typeof Schema.String; }>; }>, Schema.Struct<{ type: Schema.Literal<["conversation-item-truncate"]>; itemId: typeof Schema.String; contentIndex: Schema.filter>>; audioEndMs: Schema.filter>; }>]>; export declare type RealtimeClientEvent = typeof RealtimeClientEvent.Type; /** Safe, normalized server events. No raw provider payload, client secret, * arbitrary conversation item or provider error message crosses this surface. */ export declare const RealtimeServerEvent: Schema.Union<[Schema.Struct<{ type: Schema.Literal<["ready"]>; }>, Schema.Struct<{ type: Schema.Literal<["session-created"]>; sessionId: Schema.optional; }>, Schema.Struct<{ type: Schema.Literal<["session-updated"]>; }>, Schema.Struct<{ type: Schema.Literal<["speech-started", "speech-stopped"]>; itemId: Schema.optional; }>, Schema.Struct<{ type: Schema.Literal<["audio-committed"]>; itemId: Schema.optional; previousItemId: Schema.optional; }>, Schema.Struct<{ itemId: typeof Schema.String; type: Schema.Literal<["conversation-item-added"]>; }>, Schema.Struct<{ transcript: typeof Schema.String; itemId: typeof Schema.String; type: Schema.Literal<["input-transcription-completed"]>; }>, Schema.Struct<{ type: Schema.Literal<["response-created"]>; responseId: typeof Schema.String; }>, Schema.Struct<{ type: Schema.Literal<["response-done"]>; responseId: typeof Schema.String; status: typeof Schema.String; }>, Schema.Struct<{ itemId: typeof Schema.String; responseId: typeof Schema.String; type: Schema.Literal<["output-item-added", "output-item-done", "content-part-added", "content-part-done", "audio-done"]>; }>, Schema.Struct<{ delta: Schema.filter; itemId: typeof Schema.String; responseId: typeof Schema.String; type: Schema.Literal<["audio-delta"]>; }>, Schema.Struct<{ delta: typeof Schema.String; itemId: typeof Schema.String; responseId: typeof Schema.String; type: Schema.Literal<["text-delta", "audio-transcript-delta"]>; }>, Schema.Struct<{ text: Schema.optional; itemId: typeof Schema.String; responseId: typeof Schema.String; type: Schema.Literal<["text-done"]>; }>, Schema.Struct<{ transcript: Schema.optional; itemId: typeof Schema.String; responseId: typeof Schema.String; type: Schema.Literal<["audio-transcript-done"]>; }>]>; export declare type RealtimeServerEvent = typeof RealtimeServerEvent.Type; /** * One persisted event of a RESUMABLE stream: an `AgentEvent` plus its monotonic * 1-based position. `seq` is the resume cursor — a client that has rendered up * to `seq=N` reconnects with `fromSeq: N` and gets `N+1…` replayed, then live. * * This is the WIRE element for a resumable `defineStream` (`element: SeqEvent`). * It lives here — next to `AgentEvent`, with ZERO server imports — so a * browser-loaded stream descriptor can reference the Schema without dragging * the server-only resumable-stream store graph (`@voltro/database`) into the * client bundle. */ export declare const SeqEvent: Schema.Struct<{ seq: typeof Schema.Number; event: Schema.Union<[Schema.Struct<{ _tag: Schema.Literal<["token"]>; text: typeof Schema.String; }>, Schema.Struct<{ _tag: Schema.Literal<["reasoning"]>; text: typeof Schema.String; }>, Schema.Struct<{ _tag: Schema.Literal<["toolCall"]>; id: typeof Schema.String; name: typeof Schema.String; input: typeof Schema.Unknown; }>, Schema.Struct<{ _tag: Schema.Literal<["toolResult"]>; id: typeof Schema.String; name: typeof Schema.String; output: Schema.optional; error: Schema.optional; }>, Schema.Struct<{ _tag: Schema.Literal<["source"]>; sourceType: Schema.Literal<["url", "document"]>; id: typeof Schema.String; url: Schema.optional; title: Schema.optional; mediaType: Schema.optional; filename: Schema.optional; /** Provider-owned citation attribution; not normalized or interpreted. */ providerMetadata: Schema.optional; }>, Schema.Struct<{ _tag: Schema.Literal<["file"]>; mediaType: typeof Schema.String; data: typeof Schema.String; /** Metadata for this file, not the whole model step. */ providerMetadata: Schema.optional; }>, Schema.Struct<{ _tag: Schema.Literal<["stepMetadata"]>; step: Schema.filter; providerMetadata: typeof Schema.Unknown; }>, Schema.Struct<{ _tag: Schema.Literal<["message"]>; role: typeof Schema.String; content: typeof Schema.String; }>, Schema.Struct<{ _tag: Schema.Literal<["error"]>; code: Schema.Literal<["provider", "tool", "timeout", "cancelled", "decode", "internal"]>; message: typeof Schema.String; retryable: typeof Schema.Boolean; }>, Schema.Struct<{ _tag: Schema.Literal<["done"]>; finishReason: typeof Schema.String; usage: Schema.Struct<{ inputTokens: Schema.optional; outputTokens: Schema.optional; totalTokens: Schema.optional; }>; }>]>; }>; export declare type SeqEvent = typeof SeqEvent.Type; /** Browser-safe error contract for a declared transcription stream. */ export declare class TranscriptionStreamError extends TranscriptionStreamError_base { } declare const TranscriptionStreamError_base: Schema.TaggedErrorClass; } & { reason: Schema.Literal<["input", "unsupported", "provider", "cancelled"]>; message: typeof Schema.String; }>; /** Partial text is replaceable, delta text is append-only, and final text seals a segment. */ export declare const TranscriptionStreamEvent: Schema.Union<[Schema.Struct<{ delta: typeof Schema.String; id: Schema.optional; type: Schema.Literal<["transcript-delta"]>; }>, Schema.Struct<{ text: typeof Schema.String; startSecond: Schema.optional; durationInSeconds: Schema.optional; channelIndex: Schema.optional; id: Schema.optional; type: Schema.Literal<["transcript-partial"]>; }>, Schema.Struct<{ text: typeof Schema.String; startSecond: Schema.optional; endSecond: Schema.optional; channelIndex: Schema.optional; id: Schema.optional; type: Schema.Literal<["transcript-final"]>; }>, Schema.Struct<{ type: Schema.Literal<["finish"]>; text: typeof Schema.String; segments: Schema.Array$>; language: Schema.optional; durationSec: Schema.optional; }>]>; export declare type TranscriptionStreamEvent = typeof TranscriptionStreamEvent.Type; export { }