@voltro/ai 0.84.0 → 0.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/events.d.ts CHANGED
@@ -1,63 +1,64 @@
1
1
  import { Schema } from 'effect';
2
+ import { YieldableError } from 'effect/Cause';
2
3
 
3
4
  /** Error taxonomy. `retryable` on the event drives client/agent retry. */
4
- export declare const AgentErrorCode: Schema.Literal<["provider", "tool", "timeout", "cancelled", "decode", "internal"]>;
5
+ export declare const AgentErrorCode: Schema.Literals<readonly ["provider", "tool", "timeout", "cancelled", "decode", "internal"]>;
5
6
 
6
7
  export declare type AgentErrorCode = typeof AgentErrorCode.Type;
7
8
 
8
- export declare const AgentEvent: Schema.Union<[Schema.Struct<{
9
- _tag: Schema.Literal<["token"]>;
10
- text: typeof Schema.String;
9
+ export declare const AgentEvent: Schema.Union<readonly [Schema.Struct<{
10
+ readonly _tag: Schema.Literal<"token">;
11
+ readonly text: Schema.String;
11
12
  }>, Schema.Struct<{
12
- _tag: Schema.Literal<["reasoning"]>;
13
- text: typeof Schema.String;
13
+ readonly _tag: Schema.Literal<"reasoning">;
14
+ readonly text: Schema.String;
14
15
  }>, Schema.Struct<{
15
- _tag: Schema.Literal<["toolCall"]>;
16
- id: typeof Schema.String;
17
- name: typeof Schema.String;
18
- input: typeof Schema.Unknown;
16
+ readonly _tag: Schema.Literal<"toolCall">;
17
+ readonly id: Schema.String;
18
+ readonly name: Schema.String;
19
+ readonly input: Schema.Unknown;
19
20
  }>, Schema.Struct<{
20
- _tag: Schema.Literal<["toolResult"]>;
21
- id: typeof Schema.String;
22
- name: typeof Schema.String;
23
- output: Schema.optional<typeof Schema.Unknown>;
24
- error: Schema.optional<typeof Schema.String>;
21
+ readonly _tag: Schema.Literal<"toolResult">;
22
+ readonly id: Schema.String;
23
+ readonly name: Schema.String;
24
+ readonly output: Schema.optional<Schema.Unknown>;
25
+ readonly error: Schema.optional<Schema.String>;
25
26
  }>, Schema.Struct<{
26
- _tag: Schema.Literal<["source"]>;
27
- sourceType: Schema.Literal<["url", "document"]>;
28
- id: typeof Schema.String;
29
- url: Schema.optional<typeof Schema.String>;
30
- title: Schema.optional<typeof Schema.String>;
31
- mediaType: Schema.optional<typeof Schema.String>;
32
- filename: Schema.optional<typeof Schema.String>;
27
+ readonly _tag: Schema.Literal<"source">;
28
+ readonly sourceType: Schema.Literals<readonly ["url", "document"]>;
29
+ readonly id: Schema.String;
30
+ readonly url: Schema.optional<Schema.String>;
31
+ readonly title: Schema.optional<Schema.String>;
32
+ readonly mediaType: Schema.optional<Schema.String>;
33
+ readonly filename: Schema.optional<Schema.String>;
33
34
  /** Provider-owned citation attribution; not normalized or interpreted. */
34
- providerMetadata: Schema.optional<typeof Schema.Unknown>;
35
+ readonly providerMetadata: Schema.optional<Schema.Unknown>;
35
36
  }>, Schema.Struct<{
36
- _tag: Schema.Literal<["file"]>;
37
- mediaType: typeof Schema.String;
38
- data: typeof Schema.String;
37
+ readonly _tag: Schema.Literal<"file">;
38
+ readonly mediaType: Schema.String;
39
+ readonly data: Schema.String;
39
40
  /** Metadata for this file, not the whole model step. */
40
- providerMetadata: Schema.optional<typeof Schema.Unknown>;
41
+ readonly providerMetadata: Schema.optional<Schema.Unknown>;
41
42
  }>, Schema.Struct<{
42
- _tag: Schema.Literal<["stepMetadata"]>;
43
- step: Schema.filter<typeof Schema.Int>;
44
- providerMetadata: typeof Schema.Unknown;
43
+ readonly _tag: Schema.Literal<"stepMetadata">;
44
+ readonly step: Schema.Int;
45
+ readonly providerMetadata: Schema.Unknown;
45
46
  }>, Schema.Struct<{
46
- _tag: Schema.Literal<["message"]>;
47
- role: typeof Schema.String;
48
- content: typeof Schema.String;
47
+ readonly _tag: Schema.Literal<"message">;
48
+ readonly role: Schema.String;
49
+ readonly content: Schema.String;
49
50
  }>, Schema.Struct<{
50
- _tag: Schema.Literal<["error"]>;
51
- code: Schema.Literal<["provider", "tool", "timeout", "cancelled", "decode", "internal"]>;
52
- message: typeof Schema.String;
53
- retryable: typeof Schema.Boolean;
51
+ readonly _tag: Schema.Literal<"error">;
52
+ readonly code: Schema.Literals<readonly ["provider", "tool", "timeout", "cancelled", "decode", "internal"]>;
53
+ readonly message: Schema.String;
54
+ readonly retryable: Schema.Boolean;
54
55
  }>, Schema.Struct<{
55
- _tag: Schema.Literal<["done"]>;
56
- finishReason: typeof Schema.String;
57
- usage: Schema.Struct<{
58
- inputTokens: Schema.optional<typeof Schema.Number>;
59
- outputTokens: Schema.optional<typeof Schema.Number>;
60
- totalTokens: Schema.optional<typeof Schema.Number>;
56
+ readonly _tag: Schema.Literal<"done">;
57
+ readonly finishReason: Schema.String;
58
+ readonly usage: Schema.Struct<{
59
+ readonly inputTokens: Schema.optional<Schema.Number>;
60
+ readonly outputTokens: Schema.optional<Schema.Number>;
61
+ readonly totalTokens: Schema.optional<Schema.Number>;
61
62
  }>;
62
63
  }>]>;
63
64
 
@@ -65,81 +66,81 @@ export declare type AgentEvent = typeof AgentEvent.Type;
65
66
 
66
67
  /** Browser-safe input allowlist. Session configuration and provider credentials
67
68
  * belong to the server, never to events received from the browser. */
68
- export declare const RealtimeClientEvent: Schema.Union<[Schema.Struct<{
69
- type: Schema.Literal<["input-audio-append"]>;
70
- audio: Schema.filter<typeof Schema.String>;
69
+ export declare const RealtimeClientEvent: Schema.Union<readonly [Schema.Struct<{
70
+ readonly type: Schema.Literal<"input-audio-append">;
71
+ readonly audio: Schema.String;
71
72
  }>, Schema.Struct<{
72
- type: Schema.Literal<["input-audio-commit", "input-audio-clear", "response-create", "response-cancel"]>;
73
+ readonly type: Schema.Literals<readonly ["input-audio-commit", "input-audio-clear", "response-create", "response-cancel"]>;
73
74
  }>, Schema.Struct<{
74
- type: Schema.Literal<["conversation-item-create"]>;
75
- item: Schema.Struct<{
76
- type: Schema.Literal<["text-message"]>;
77
- role: Schema.Literal<["user"]>;
78
- text: typeof Schema.String;
75
+ readonly type: Schema.Literal<"conversation-item-create">;
76
+ readonly item: Schema.Struct<{
77
+ readonly type: Schema.Literal<"text-message">;
78
+ readonly role: Schema.Literal<"user">;
79
+ readonly text: Schema.String;
79
80
  }>;
80
81
  }>, Schema.Struct<{
81
- type: Schema.Literal<["conversation-item-truncate"]>;
82
- itemId: typeof Schema.String;
83
- contentIndex: Schema.filter<Schema.filter<Schema.filter<typeof Schema.Number>>>;
84
- audioEndMs: Schema.filter<Schema.filter<typeof Schema.Number>>;
82
+ readonly type: Schema.Literal<"conversation-item-truncate">;
83
+ readonly itemId: Schema.String;
84
+ readonly contentIndex: Schema.Number;
85
+ readonly audioEndMs: Schema.Number;
85
86
  }>]>;
86
87
 
87
88
  export declare type RealtimeClientEvent = typeof RealtimeClientEvent.Type;
88
89
 
89
90
  /** Safe, normalized server events. No raw provider payload, client secret,
90
91
  * arbitrary conversation item or provider error message crosses this surface. */
91
- export declare const RealtimeServerEvent: Schema.Union<[Schema.Struct<{
92
- type: Schema.Literal<["ready"]>;
92
+ export declare const RealtimeServerEvent: Schema.Union<readonly [Schema.Struct<{
93
+ readonly type: Schema.Literal<"ready">;
93
94
  }>, Schema.Struct<{
94
- type: Schema.Literal<["session-created"]>;
95
- sessionId: Schema.optional<typeof Schema.String>;
95
+ readonly type: Schema.Literal<"session-created">;
96
+ readonly sessionId: Schema.optional<Schema.String>;
96
97
  }>, Schema.Struct<{
97
- type: Schema.Literal<["session-updated"]>;
98
+ readonly type: Schema.Literal<"session-updated">;
98
99
  }>, Schema.Struct<{
99
- type: Schema.Literal<["speech-started", "speech-stopped"]>;
100
- itemId: Schema.optional<typeof Schema.String>;
100
+ readonly type: Schema.Literals<readonly ["speech-started", "speech-stopped"]>;
101
+ readonly itemId: Schema.optional<Schema.String>;
101
102
  }>, Schema.Struct<{
102
- type: Schema.Literal<["audio-committed"]>;
103
- itemId: Schema.optional<typeof Schema.String>;
104
- previousItemId: Schema.optional<typeof Schema.String>;
103
+ readonly type: Schema.Literal<"audio-committed">;
104
+ readonly itemId: Schema.optional<Schema.String>;
105
+ readonly previousItemId: Schema.optional<Schema.String>;
105
106
  }>, Schema.Struct<{
106
- itemId: typeof Schema.String;
107
- type: Schema.Literal<["conversation-item-added"]>;
107
+ readonly itemId: Schema.String;
108
+ readonly type: Schema.Literal<"conversation-item-added">;
108
109
  }>, Schema.Struct<{
109
- transcript: typeof Schema.String;
110
- itemId: typeof Schema.String;
111
- type: Schema.Literal<["input-transcription-completed"]>;
110
+ readonly transcript: Schema.String;
111
+ readonly itemId: Schema.String;
112
+ readonly type: Schema.Literal<"input-transcription-completed">;
112
113
  }>, Schema.Struct<{
113
- type: Schema.Literal<["response-created"]>;
114
- responseId: typeof Schema.String;
114
+ readonly type: Schema.Literal<"response-created">;
115
+ readonly responseId: Schema.String;
115
116
  }>, Schema.Struct<{
116
- type: Schema.Literal<["response-done"]>;
117
- responseId: typeof Schema.String;
118
- status: typeof Schema.String;
117
+ readonly type: Schema.Literal<"response-done">;
118
+ readonly responseId: Schema.String;
119
+ readonly status: Schema.String;
119
120
  }>, Schema.Struct<{
120
- itemId: typeof Schema.String;
121
- responseId: typeof Schema.String;
122
- type: Schema.Literal<["output-item-added", "output-item-done", "content-part-added", "content-part-done", "audio-done"]>;
121
+ readonly itemId: Schema.String;
122
+ readonly responseId: Schema.String;
123
+ readonly type: Schema.Literals<readonly ["output-item-added", "output-item-done", "content-part-added", "content-part-done", "audio-done"]>;
123
124
  }>, Schema.Struct<{
124
- delta: Schema.filter<typeof Schema.String>;
125
- itemId: typeof Schema.String;
126
- responseId: typeof Schema.String;
127
- type: Schema.Literal<["audio-delta"]>;
125
+ readonly delta: Schema.String;
126
+ readonly itemId: Schema.String;
127
+ readonly responseId: Schema.String;
128
+ readonly type: Schema.Literal<"audio-delta">;
128
129
  }>, Schema.Struct<{
129
- delta: typeof Schema.String;
130
- itemId: typeof Schema.String;
131
- responseId: typeof Schema.String;
132
- type: Schema.Literal<["text-delta", "audio-transcript-delta"]>;
130
+ readonly delta: Schema.String;
131
+ readonly itemId: Schema.String;
132
+ readonly responseId: Schema.String;
133
+ readonly type: Schema.Literals<readonly ["text-delta", "audio-transcript-delta"]>;
133
134
  }>, Schema.Struct<{
134
- text: Schema.optional<typeof Schema.String>;
135
- itemId: typeof Schema.String;
136
- responseId: typeof Schema.String;
137
- type: Schema.Literal<["text-done"]>;
135
+ readonly text: Schema.optional<Schema.String>;
136
+ readonly itemId: Schema.String;
137
+ readonly responseId: Schema.String;
138
+ readonly type: Schema.Literal<"text-done">;
138
139
  }>, Schema.Struct<{
139
- transcript: Schema.optional<typeof Schema.String>;
140
- itemId: typeof Schema.String;
141
- responseId: typeof Schema.String;
142
- type: Schema.Literal<["audio-transcript-done"]>;
140
+ readonly transcript: Schema.optional<Schema.String>;
141
+ readonly itemId: Schema.String;
142
+ readonly responseId: Schema.String;
143
+ readonly type: Schema.Literal<"audio-transcript-done">;
143
144
  }>]>;
144
145
 
145
146
  export declare type RealtimeServerEvent = typeof RealtimeServerEvent.Type;
@@ -156,60 +157,60 @@ export declare type RealtimeServerEvent = typeof RealtimeServerEvent.Type;
156
157
  * client bundle.
157
158
  */
158
159
  export declare const SeqEvent: Schema.Struct<{
159
- seq: typeof Schema.Number;
160
- event: Schema.Union<[Schema.Struct<{
161
- _tag: Schema.Literal<["token"]>;
162
- text: typeof Schema.String;
160
+ readonly seq: Schema.Number;
161
+ readonly event: Schema.Union<readonly [Schema.Struct<{
162
+ readonly _tag: Schema.Literal<"token">;
163
+ readonly text: Schema.String;
163
164
  }>, Schema.Struct<{
164
- _tag: Schema.Literal<["reasoning"]>;
165
- text: typeof Schema.String;
165
+ readonly _tag: Schema.Literal<"reasoning">;
166
+ readonly text: Schema.String;
166
167
  }>, Schema.Struct<{
167
- _tag: Schema.Literal<["toolCall"]>;
168
- id: typeof Schema.String;
169
- name: typeof Schema.String;
170
- input: typeof Schema.Unknown;
168
+ readonly _tag: Schema.Literal<"toolCall">;
169
+ readonly id: Schema.String;
170
+ readonly name: Schema.String;
171
+ readonly input: Schema.Unknown;
171
172
  }>, Schema.Struct<{
172
- _tag: Schema.Literal<["toolResult"]>;
173
- id: typeof Schema.String;
174
- name: typeof Schema.String;
175
- output: Schema.optional<typeof Schema.Unknown>;
176
- error: Schema.optional<typeof Schema.String>;
173
+ readonly _tag: Schema.Literal<"toolResult">;
174
+ readonly id: Schema.String;
175
+ readonly name: Schema.String;
176
+ readonly output: Schema.optional<Schema.Unknown>;
177
+ readonly error: Schema.optional<Schema.String>;
177
178
  }>, Schema.Struct<{
178
- _tag: Schema.Literal<["source"]>;
179
- sourceType: Schema.Literal<["url", "document"]>;
180
- id: typeof Schema.String;
181
- url: Schema.optional<typeof Schema.String>;
182
- title: Schema.optional<typeof Schema.String>;
183
- mediaType: Schema.optional<typeof Schema.String>;
184
- filename: Schema.optional<typeof Schema.String>;
179
+ readonly _tag: Schema.Literal<"source">;
180
+ readonly sourceType: Schema.Literals<readonly ["url", "document"]>;
181
+ readonly id: Schema.String;
182
+ readonly url: Schema.optional<Schema.String>;
183
+ readonly title: Schema.optional<Schema.String>;
184
+ readonly mediaType: Schema.optional<Schema.String>;
185
+ readonly filename: Schema.optional<Schema.String>;
185
186
  /** Provider-owned citation attribution; not normalized or interpreted. */
186
- providerMetadata: Schema.optional<typeof Schema.Unknown>;
187
+ readonly providerMetadata: Schema.optional<Schema.Unknown>;
187
188
  }>, Schema.Struct<{
188
- _tag: Schema.Literal<["file"]>;
189
- mediaType: typeof Schema.String;
190
- data: typeof Schema.String;
189
+ readonly _tag: Schema.Literal<"file">;
190
+ readonly mediaType: Schema.String;
191
+ readonly data: Schema.String;
191
192
  /** Metadata for this file, not the whole model step. */
192
- providerMetadata: Schema.optional<typeof Schema.Unknown>;
193
+ readonly providerMetadata: Schema.optional<Schema.Unknown>;
193
194
  }>, Schema.Struct<{
194
- _tag: Schema.Literal<["stepMetadata"]>;
195
- step: Schema.filter<typeof Schema.Int>;
196
- providerMetadata: typeof Schema.Unknown;
195
+ readonly _tag: Schema.Literal<"stepMetadata">;
196
+ readonly step: Schema.Int;
197
+ readonly providerMetadata: Schema.Unknown;
197
198
  }>, Schema.Struct<{
198
- _tag: Schema.Literal<["message"]>;
199
- role: typeof Schema.String;
200
- content: typeof Schema.String;
199
+ readonly _tag: Schema.Literal<"message">;
200
+ readonly role: Schema.String;
201
+ readonly content: Schema.String;
201
202
  }>, Schema.Struct<{
202
- _tag: Schema.Literal<["error"]>;
203
- code: Schema.Literal<["provider", "tool", "timeout", "cancelled", "decode", "internal"]>;
204
- message: typeof Schema.String;
205
- retryable: typeof Schema.Boolean;
203
+ readonly _tag: Schema.Literal<"error">;
204
+ readonly code: Schema.Literals<readonly ["provider", "tool", "timeout", "cancelled", "decode", "internal"]>;
205
+ readonly message: Schema.String;
206
+ readonly retryable: Schema.Boolean;
206
207
  }>, Schema.Struct<{
207
- _tag: Schema.Literal<["done"]>;
208
- finishReason: typeof Schema.String;
209
- usage: Schema.Struct<{
210
- inputTokens: Schema.optional<typeof Schema.Number>;
211
- outputTokens: Schema.optional<typeof Schema.Number>;
212
- totalTokens: Schema.optional<typeof Schema.Number>;
208
+ readonly _tag: Schema.Literal<"done">;
209
+ readonly finishReason: Schema.String;
210
+ readonly usage: Schema.Struct<{
211
+ readonly inputTokens: Schema.optional<Schema.Number>;
212
+ readonly outputTokens: Schema.optional<Schema.Number>;
213
+ readonly totalTokens: Schema.optional<Schema.Number>;
213
214
  }>;
214
215
  }>]>;
215
216
  }>;
@@ -220,42 +221,40 @@ export declare type SeqEvent = typeof SeqEvent.Type;
220
221
  export declare class TranscriptionStreamError extends TranscriptionStreamError_base {
221
222
  }
222
223
 
223
- declare const TranscriptionStreamError_base: Schema.TaggedErrorClass<TranscriptionStreamError, "TranscriptionStreamError", {
224
- readonly _tag: Schema.tag<"TranscriptionStreamError">;
225
- } & {
226
- reason: Schema.Literal<["input", "unsupported", "provider", "cancelled"]>;
227
- message: typeof Schema.String;
228
- }>;
224
+ declare const TranscriptionStreamError_base: Schema.Class<TranscriptionStreamError, Schema.TaggedStruct<"TranscriptionStreamError", {
225
+ readonly reason: Schema.Literals<readonly ["input", "unsupported", "provider", "cancelled"]>;
226
+ readonly message: Schema.String;
227
+ }>, YieldableError>;
229
228
 
230
229
  /** Partial text is replaceable, delta text is append-only, and final text seals a segment. */
231
- export declare const TranscriptionStreamEvent: Schema.Union<[Schema.Struct<{
232
- delta: typeof Schema.String;
233
- id: Schema.optional<typeof Schema.String>;
234
- type: Schema.Literal<["transcript-delta"]>;
230
+ export declare const TranscriptionStreamEvent: Schema.Union<readonly [Schema.Struct<{
231
+ readonly delta: Schema.String;
232
+ readonly id: Schema.optional<Schema.String>;
233
+ readonly type: Schema.Literal<"transcript-delta">;
235
234
  }>, Schema.Struct<{
236
- text: typeof Schema.String;
237
- startSecond: Schema.optional<typeof Schema.Number>;
238
- durationInSeconds: Schema.optional<typeof Schema.Number>;
239
- channelIndex: Schema.optional<typeof Schema.Number>;
240
- id: Schema.optional<typeof Schema.String>;
241
- type: Schema.Literal<["transcript-partial"]>;
235
+ readonly text: Schema.String;
236
+ readonly startSecond: Schema.optional<Schema.Number>;
237
+ readonly durationInSeconds: Schema.optional<Schema.Number>;
238
+ readonly channelIndex: Schema.optional<Schema.Number>;
239
+ readonly id: Schema.optional<Schema.String>;
240
+ readonly type: Schema.Literal<"transcript-partial">;
242
241
  }>, Schema.Struct<{
243
- text: typeof Schema.String;
244
- startSecond: Schema.optional<typeof Schema.Number>;
245
- endSecond: Schema.optional<typeof Schema.Number>;
246
- channelIndex: Schema.optional<typeof Schema.Number>;
247
- id: Schema.optional<typeof Schema.String>;
248
- type: Schema.Literal<["transcript-final"]>;
242
+ readonly text: Schema.String;
243
+ readonly startSecond: Schema.optional<Schema.Number>;
244
+ readonly endSecond: Schema.optional<Schema.Number>;
245
+ readonly channelIndex: Schema.optional<Schema.Number>;
246
+ readonly id: Schema.optional<Schema.String>;
247
+ readonly type: Schema.Literal<"transcript-final">;
249
248
  }>, Schema.Struct<{
250
- type: Schema.Literal<["finish"]>;
251
- text: typeof Schema.String;
252
- segments: Schema.Array$<Schema.Struct<{
253
- text: typeof Schema.String;
254
- start: typeof Schema.Number;
255
- end: typeof Schema.Number;
249
+ readonly type: Schema.Literal<"finish">;
250
+ readonly text: Schema.String;
251
+ readonly segments: Schema.$Array<Schema.Struct<{
252
+ readonly text: Schema.String;
253
+ readonly start: Schema.Number;
254
+ readonly end: Schema.Number;
256
255
  }>>;
257
- language: Schema.optional<typeof Schema.String>;
258
- durationSec: Schema.optional<typeof Schema.Number>;
256
+ readonly language: Schema.optional<Schema.String>;
257
+ readonly durationSec: Schema.optional<Schema.Number>;
259
258
  }>]>;
260
259
 
261
260
  export declare type TranscriptionStreamEvent = typeof TranscriptionStreamEvent.Type;
package/dist/events.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./agentEvent-BuXA7sRt.js";
1
+ import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./agentEvent-Bl4egdM5.js";
2
2
  export { o as AgentErrorCode, n as AgentEvent, t as RealtimeClientEvent, e as RealtimeServerEvent, i as SeqEvent, r as TranscriptionStreamError, a as TranscriptionStreamEvent };