@illalabs/interfaces 0.2.1 → 0.3.0-canary.1a04c18e

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.
Files changed (116) hide show
  1. package/dist/errors/endpoints/chat/ChatBaseError.d.ts +16 -5
  2. package/dist/errors/endpoints/chat/ChatBaseError.d.ts.map +1 -1
  3. package/dist/external.d.ts +1 -0
  4. package/dist/external.d.ts.map +1 -1
  5. package/dist/external.js +1 -0
  6. package/dist/external.js.map +1 -1
  7. package/dist/interfaces/chat/response.d.ts +5 -3
  8. package/dist/interfaces/chat/response.d.ts.map +1 -1
  9. package/dist/schemas/chatContext.d.ts +90 -590
  10. package/dist/schemas/chatContext.d.ts.map +1 -1
  11. package/dist/schemas/chatRequestBody.d.ts +278 -1960
  12. package/dist/schemas/chatRequestBody.d.ts.map +1 -1
  13. package/dist/schemas/chatRequestBody.js +6 -4
  14. package/dist/schemas/chatRequestBody.js.map +1 -1
  15. package/dist/schemas/executionCheckerQueryParams.d.ts +5 -5
  16. package/dist/schemas/illaTools.d.ts +266 -0
  17. package/dist/schemas/illaTools.d.ts.map +1 -0
  18. package/dist/schemas/illaTools.js +58 -0
  19. package/dist/schemas/illaTools.js.map +1 -0
  20. package/dist/schemas/index.d.ts +3 -0
  21. package/dist/schemas/index.d.ts.map +1 -1
  22. package/dist/schemas/index.js +3 -0
  23. package/dist/schemas/index.js.map +1 -1
  24. package/dist/schemas/messages.d.ts +95 -930
  25. package/dist/schemas/messages.d.ts.map +1 -1
  26. package/dist/schemas/messages.js +10 -113
  27. package/dist/schemas/messages.js.map +1 -1
  28. package/dist/schemas/modelContext.d.ts +23 -0
  29. package/dist/schemas/modelContext.d.ts.map +1 -0
  30. package/dist/schemas/modelContext.js +13 -0
  31. package/dist/schemas/modelContext.js.map +1 -0
  32. package/dist/schemas/telemetryEvents.d.ts +1645 -0
  33. package/dist/schemas/telemetryEvents.d.ts.map +1 -0
  34. package/dist/schemas/telemetryEvents.js +236 -0
  35. package/dist/schemas/telemetryEvents.js.map +1 -0
  36. package/dist/schemas/toolAutorouter.d.ts +6 -6
  37. package/dist/tools/IllaToolError.d.ts +117 -0
  38. package/dist/tools/IllaToolError.d.ts.map +1 -0
  39. package/dist/tools/IllaToolError.js +147 -0
  40. package/dist/tools/IllaToolError.js.map +1 -0
  41. package/dist/tools/IllaToolOutcome.d.ts +131 -0
  42. package/dist/tools/IllaToolOutcome.d.ts.map +1 -0
  43. package/dist/tools/IllaToolOutcome.js +191 -0
  44. package/dist/tools/IllaToolOutcome.js.map +1 -0
  45. package/dist/tools/index.d.ts +3 -0
  46. package/dist/tools/index.d.ts.map +1 -0
  47. package/dist/tools/index.js +3 -0
  48. package/dist/tools/index.js.map +1 -0
  49. package/dist/types/actions/inputs.d.ts +5 -3
  50. package/dist/types/actions/inputs.d.ts.map +1 -1
  51. package/dist/types/actions/tools/{swapBridgeAction.d.ts → bridgeAction.d.ts} +4 -4
  52. package/dist/types/actions/tools/bridgeAction.d.ts.map +1 -0
  53. package/dist/types/actions/tools/bridgeAction.js +2 -0
  54. package/dist/types/actions/tools/bridgeAction.js.map +1 -0
  55. package/dist/types/actions/tools/defiFetchListingsAction.d.ts +1 -2
  56. package/dist/types/actions/tools/defiFetchListingsAction.d.ts.map +1 -1
  57. package/dist/types/actions/tools/defiFetchListingsAction.js +1 -1
  58. package/dist/types/actions/tools/defiFetchListingsAction.js.map +1 -1
  59. package/dist/types/actions/tools/defiPositionsAction.d.ts +1 -2
  60. package/dist/types/actions/tools/defiPositionsAction.d.ts.map +1 -1
  61. package/dist/types/actions/tools/defiPositionsAction.js +1 -1
  62. package/dist/types/actions/tools/defiPositionsAction.js.map +1 -1
  63. package/dist/types/actions/tools/defiSupplyAction.d.ts +1 -2
  64. package/dist/types/actions/tools/defiSupplyAction.d.ts.map +1 -1
  65. package/dist/types/actions/tools/defiSupplyAction.js +1 -1
  66. package/dist/types/actions/tools/defiSupplyAction.js.map +1 -1
  67. package/dist/types/actions/tools/defiWithdrawAction.d.ts +1 -2
  68. package/dist/types/actions/tools/defiWithdrawAction.d.ts.map +1 -1
  69. package/dist/types/actions/tools/defiWithdrawAction.js +1 -1
  70. package/dist/types/actions/tools/defiWithdrawAction.js.map +1 -1
  71. package/dist/types/actions/tools/exchangeRateAction.d.ts +1 -2
  72. package/dist/types/actions/tools/exchangeRateAction.d.ts.map +1 -1
  73. package/dist/types/actions/tools/exchangeRateAction.js +1 -1
  74. package/dist/types/actions/tools/exchangeRateAction.js.map +1 -1
  75. package/dist/types/actions/tools/getWalletBalanceAction.d.ts +2 -2
  76. package/dist/types/actions/tools/getWalletBalanceAction.d.ts.map +1 -1
  77. package/dist/types/actions/tools/getWalletBalanceAction.js +1 -1
  78. package/dist/types/actions/tools/getWalletBalanceAction.js.map +1 -1
  79. package/dist/types/actions/tools/index.d.ts +9 -3
  80. package/dist/types/actions/tools/index.d.ts.map +1 -1
  81. package/dist/types/actions/tools/predictionMarketsFetchAction.d.ts +21 -0
  82. package/dist/types/actions/tools/predictionMarketsFetchAction.d.ts.map +1 -0
  83. package/dist/types/actions/tools/predictionMarketsFetchAction.js +2 -0
  84. package/dist/types/actions/tools/predictionMarketsFetchAction.js.map +1 -0
  85. package/dist/types/actions/tools/swapAction.d.ts +16 -0
  86. package/dist/types/actions/tools/swapAction.d.ts.map +1 -0
  87. package/dist/types/actions/tools/swapAction.js +2 -0
  88. package/dist/types/actions/tools/swapAction.js.map +1 -0
  89. package/dist/types/actions/tools/tokenTransferAction.d.ts +1 -2
  90. package/dist/types/actions/tools/tokenTransferAction.d.ts.map +1 -1
  91. package/dist/types/actions/tools/tokenTransferAction.js +1 -1
  92. package/dist/types/actions/tools/tokenTransferAction.js.map +1 -1
  93. package/dist/types/index.d.ts +2 -0
  94. package/dist/types/index.d.ts.map +1 -1
  95. package/dist/types/index.js +2 -0
  96. package/dist/types/index.js.map +1 -1
  97. package/dist/types/messages.d.ts +3 -6
  98. package/dist/types/messages.d.ts.map +1 -1
  99. package/dist/types/messages.js +1 -1
  100. package/dist/types/messages.js.map +1 -1
  101. package/dist/types/streaming.d.ts +81 -0
  102. package/dist/types/streaming.d.ts.map +1 -0
  103. package/dist/types/streaming.js +2 -0
  104. package/dist/types/streaming.js.map +1 -0
  105. package/dist/types/telemetry.d.ts +139 -0
  106. package/dist/types/telemetry.d.ts.map +1 -0
  107. package/dist/types/telemetry.js +7 -0
  108. package/dist/types/telemetry.js.map +1 -0
  109. package/dist/utils/constants.d.ts +6 -4
  110. package/dist/utils/constants.d.ts.map +1 -1
  111. package/dist/utils/constants.js +18 -3
  112. package/dist/utils/constants.js.map +1 -1
  113. package/package.json +4 -4
  114. package/dist/types/actions/tools/swapBridgeAction.d.ts.map +0 -1
  115. package/dist/types/actions/tools/swapBridgeAction.js +0 -2
  116. package/dist/types/actions/tools/swapBridgeAction.js.map +0 -1
@@ -0,0 +1,1645 @@
1
+ import type { ModelMessage } from "@ai-sdk/provider-utils";
2
+ import { z } from "zod";
3
+ /**
4
+ * Telemetry event type enum values.
5
+ * Used to infer TelemetryEventType in types/telemetry.ts
6
+ */
7
+ export declare const telemetryEventTypes: readonly ["iteration_start", "iteration_end", "tool_call_batch", "tool_result", "scratchpad_reset", "llm_start", "llm_end", "text_delta", "finish", "error", "connected", "stream_end"];
8
+ /**
9
+ * Base telemetry event schema with common fields
10
+ */
11
+ export declare const baseTelemetryEventSchema: z.ZodObject<{
12
+ requestId: z.ZodString;
13
+ type: z.ZodEnum<["iteration_start", "iteration_end", "tool_call_batch", "tool_result", "scratchpad_reset", "llm_start", "llm_end", "text_delta", "finish", "error", "connected", "stream_end"]>;
14
+ timestamp: z.ZodOptional<z.ZodNumber>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ type: "error" | "iteration_start" | "iteration_end" | "tool_call_batch" | "tool_result" | "scratchpad_reset" | "llm_start" | "llm_end" | "text_delta" | "finish" | "connected" | "stream_end";
17
+ requestId: string;
18
+ timestamp?: number | undefined;
19
+ }, {
20
+ type: "error" | "iteration_start" | "iteration_end" | "tool_call_batch" | "tool_result" | "scratchpad_reset" | "llm_start" | "llm_end" | "text_delta" | "finish" | "connected" | "stream_end";
21
+ requestId: string;
22
+ timestamp?: number | undefined;
23
+ }>;
24
+ /**
25
+ * Connected event schema - emitted when connected to telemetry stream
26
+ */
27
+ export declare const connectedEventSchema: z.ZodObject<{
28
+ requestId: z.ZodString;
29
+ timestamp: z.ZodOptional<z.ZodNumber>;
30
+ } & {
31
+ type: z.ZodLiteral<"connected">;
32
+ }, "strip", z.ZodTypeAny, {
33
+ type: "connected";
34
+ requestId: string;
35
+ timestamp?: number | undefined;
36
+ }, {
37
+ type: "connected";
38
+ requestId: string;
39
+ timestamp?: number | undefined;
40
+ }>;
41
+ /**
42
+ * Stream end telemetry event schema - emitted when stream ends
43
+ */
44
+ export declare const streamEndTelemetryEventSchema: z.ZodObject<{
45
+ requestId: z.ZodString;
46
+ timestamp: z.ZodOptional<z.ZodNumber>;
47
+ } & {
48
+ type: z.ZodLiteral<"stream_end">;
49
+ }, "strip", z.ZodTypeAny, {
50
+ type: "stream_end";
51
+ requestId: string;
52
+ timestamp?: number | undefined;
53
+ }, {
54
+ type: "stream_end";
55
+ requestId: string;
56
+ timestamp?: number | undefined;
57
+ }>;
58
+ /**
59
+ * Iteration start event schema - emitted when an iteration starts
60
+ */
61
+ export declare const iterationStartEventSchema: z.ZodObject<{
62
+ requestId: z.ZodString;
63
+ timestamp: z.ZodOptional<z.ZodNumber>;
64
+ } & {
65
+ type: z.ZodLiteral<"iteration_start">;
66
+ data: z.ZodObject<{
67
+ iteration: z.ZodNumber;
68
+ }, "strip", z.ZodTypeAny, {
69
+ iteration: number;
70
+ }, {
71
+ iteration: number;
72
+ }>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ type: "iteration_start";
75
+ data: {
76
+ iteration: number;
77
+ };
78
+ requestId: string;
79
+ timestamp?: number | undefined;
80
+ }, {
81
+ type: "iteration_start";
82
+ data: {
83
+ iteration: number;
84
+ };
85
+ requestId: string;
86
+ timestamp?: number | undefined;
87
+ }>;
88
+ /**
89
+ * Iteration end event schema - emitted when an iteration ends
90
+ */
91
+ export declare const iterationEndEventSchema: z.ZodObject<{
92
+ requestId: z.ZodString;
93
+ timestamp: z.ZodOptional<z.ZodNumber>;
94
+ } & {
95
+ type: z.ZodLiteral<"iteration_end">;
96
+ data: z.ZodObject<{
97
+ iteration: z.ZodNumber;
98
+ hasToolCalls: z.ZodBoolean;
99
+ shouldContinue: z.ZodBoolean;
100
+ }, "strip", z.ZodTypeAny, {
101
+ iteration: number;
102
+ hasToolCalls: boolean;
103
+ shouldContinue: boolean;
104
+ }, {
105
+ iteration: number;
106
+ hasToolCalls: boolean;
107
+ shouldContinue: boolean;
108
+ }>;
109
+ }, "strip", z.ZodTypeAny, {
110
+ type: "iteration_end";
111
+ data: {
112
+ iteration: number;
113
+ hasToolCalls: boolean;
114
+ shouldContinue: boolean;
115
+ };
116
+ requestId: string;
117
+ timestamp?: number | undefined;
118
+ }, {
119
+ type: "iteration_end";
120
+ data: {
121
+ iteration: number;
122
+ hasToolCalls: boolean;
123
+ shouldContinue: boolean;
124
+ };
125
+ requestId: string;
126
+ timestamp?: number | undefined;
127
+ }>;
128
+ /**
129
+ * Tool call batch event schema - emitted when tool calls are batched for execution
130
+ */
131
+ export declare const toolCallBatchEventSchema: z.ZodObject<{
132
+ requestId: z.ZodString;
133
+ timestamp: z.ZodOptional<z.ZodNumber>;
134
+ } & {
135
+ type: z.ZodLiteral<"tool_call_batch">;
136
+ data: z.ZodObject<{
137
+ iteration: z.ZodNumber;
138
+ tools: z.ZodArray<z.ZodObject<{
139
+ toolCallId: z.ZodString;
140
+ toolName: z.ZodString;
141
+ }, "strip", z.ZodTypeAny, {
142
+ toolCallId: string;
143
+ toolName: string;
144
+ }, {
145
+ toolCallId: string;
146
+ toolName: string;
147
+ }>, "many">;
148
+ }, "strip", z.ZodTypeAny, {
149
+ iteration: number;
150
+ tools: {
151
+ toolCallId: string;
152
+ toolName: string;
153
+ }[];
154
+ }, {
155
+ iteration: number;
156
+ tools: {
157
+ toolCallId: string;
158
+ toolName: string;
159
+ }[];
160
+ }>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ type: "tool_call_batch";
163
+ data: {
164
+ iteration: number;
165
+ tools: {
166
+ toolCallId: string;
167
+ toolName: string;
168
+ }[];
169
+ };
170
+ requestId: string;
171
+ timestamp?: number | undefined;
172
+ }, {
173
+ type: "tool_call_batch";
174
+ data: {
175
+ iteration: number;
176
+ tools: {
177
+ toolCallId: string;
178
+ toolName: string;
179
+ }[];
180
+ };
181
+ requestId: string;
182
+ timestamp?: number | undefined;
183
+ }>;
184
+ /**
185
+ * Tool result event schema - emitted when a tool execution completes
186
+ */
187
+ export declare const toolResultEventSchema: z.ZodObject<{
188
+ requestId: z.ZodString;
189
+ timestamp: z.ZodOptional<z.ZodNumber>;
190
+ } & {
191
+ type: z.ZodLiteral<"tool_result">;
192
+ data: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
193
+ toolCallId: z.ZodString;
194
+ toolName: z.ZodString;
195
+ status: z.ZodLiteral<"pending">;
196
+ }, "strip", z.ZodTypeAny, {
197
+ status: "pending";
198
+ toolCallId: string;
199
+ toolName: string;
200
+ }, {
201
+ status: "pending";
202
+ toolCallId: string;
203
+ toolName: string;
204
+ }>, z.ZodObject<{
205
+ toolCallId: z.ZodString;
206
+ toolName: z.ZodString;
207
+ status: z.ZodLiteral<"success">;
208
+ }, "strip", z.ZodTypeAny, {
209
+ status: "success";
210
+ toolCallId: string;
211
+ toolName: string;
212
+ }, {
213
+ status: "success";
214
+ toolCallId: string;
215
+ toolName: string;
216
+ }>, z.ZodObject<{
217
+ toolCallId: z.ZodString;
218
+ toolName: z.ZodString;
219
+ status: z.ZodLiteral<"failure">;
220
+ error: z.ZodString;
221
+ }, "strip", z.ZodTypeAny, {
222
+ status: "failure";
223
+ error: string;
224
+ toolCallId: string;
225
+ toolName: string;
226
+ }, {
227
+ status: "failure";
228
+ error: string;
229
+ toolCallId: string;
230
+ toolName: string;
231
+ }>]>;
232
+ }, "strip", z.ZodTypeAny, {
233
+ type: "tool_result";
234
+ data: {
235
+ status: "pending";
236
+ toolCallId: string;
237
+ toolName: string;
238
+ } | {
239
+ status: "success";
240
+ toolCallId: string;
241
+ toolName: string;
242
+ } | {
243
+ status: "failure";
244
+ error: string;
245
+ toolCallId: string;
246
+ toolName: string;
247
+ };
248
+ requestId: string;
249
+ timestamp?: number | undefined;
250
+ }, {
251
+ type: "tool_result";
252
+ data: {
253
+ status: "pending";
254
+ toolCallId: string;
255
+ toolName: string;
256
+ } | {
257
+ status: "success";
258
+ toolCallId: string;
259
+ toolName: string;
260
+ } | {
261
+ status: "failure";
262
+ error: string;
263
+ toolCallId: string;
264
+ toolName: string;
265
+ };
266
+ requestId: string;
267
+ timestamp?: number | undefined;
268
+ }>;
269
+ /**
270
+ * Scratchpad reset event schema - emitted when the scratchpad is reset
271
+ */
272
+ export declare const scratchpadResetEventSchema: z.ZodObject<{
273
+ requestId: z.ZodString;
274
+ timestamp: z.ZodOptional<z.ZodNumber>;
275
+ } & {
276
+ type: z.ZodLiteral<"scratchpad_reset">;
277
+ data: z.ZodObject<{
278
+ reason: z.ZodString;
279
+ }, "strip", z.ZodTypeAny, {
280
+ reason: string;
281
+ }, {
282
+ reason: string;
283
+ }>;
284
+ }, "strip", z.ZodTypeAny, {
285
+ type: "scratchpad_reset";
286
+ data: {
287
+ reason: string;
288
+ };
289
+ requestId: string;
290
+ timestamp?: number | undefined;
291
+ }, {
292
+ type: "scratchpad_reset";
293
+ data: {
294
+ reason: string;
295
+ };
296
+ requestId: string;
297
+ timestamp?: number | undefined;
298
+ }>;
299
+ /**
300
+ * LLM start event schema - emitted when LLM generation starts
301
+ */
302
+ export declare const llmStartEventSchema: z.ZodObject<{
303
+ requestId: z.ZodString;
304
+ timestamp: z.ZodOptional<z.ZodNumber>;
305
+ } & {
306
+ type: z.ZodLiteral<"llm_start">;
307
+ data: z.ZodObject<{
308
+ iteration: z.ZodNumber;
309
+ }, "strip", z.ZodTypeAny, {
310
+ iteration: number;
311
+ }, {
312
+ iteration: number;
313
+ }>;
314
+ }, "strip", z.ZodTypeAny, {
315
+ type: "llm_start";
316
+ data: {
317
+ iteration: number;
318
+ };
319
+ requestId: string;
320
+ timestamp?: number | undefined;
321
+ }, {
322
+ type: "llm_start";
323
+ data: {
324
+ iteration: number;
325
+ };
326
+ requestId: string;
327
+ timestamp?: number | undefined;
328
+ }>;
329
+ /**
330
+ * LLM end event schema - emitted when LLM generation ends
331
+ */
332
+ export declare const llmEndEventSchema: z.ZodObject<{
333
+ requestId: z.ZodString;
334
+ timestamp: z.ZodOptional<z.ZodNumber>;
335
+ } & {
336
+ type: z.ZodLiteral<"llm_end">;
337
+ data: z.ZodObject<{
338
+ iteration: z.ZodNumber;
339
+ hasText: z.ZodBoolean;
340
+ toolCallCount: z.ZodNumber;
341
+ }, "strip", z.ZodTypeAny, {
342
+ iteration: number;
343
+ hasText: boolean;
344
+ toolCallCount: number;
345
+ }, {
346
+ iteration: number;
347
+ hasText: boolean;
348
+ toolCallCount: number;
349
+ }>;
350
+ }, "strip", z.ZodTypeAny, {
351
+ type: "llm_end";
352
+ data: {
353
+ iteration: number;
354
+ hasText: boolean;
355
+ toolCallCount: number;
356
+ };
357
+ requestId: string;
358
+ timestamp?: number | undefined;
359
+ }, {
360
+ type: "llm_end";
361
+ data: {
362
+ iteration: number;
363
+ hasText: boolean;
364
+ toolCallCount: number;
365
+ };
366
+ requestId: string;
367
+ timestamp?: number | undefined;
368
+ }>;
369
+ /**
370
+ * Text delta event schema - emitted when a text chunk is received from LLM
371
+ */
372
+ export declare const textDeltaEventSchema: z.ZodObject<{
373
+ requestId: z.ZodString;
374
+ timestamp: z.ZodOptional<z.ZodNumber>;
375
+ } & {
376
+ type: z.ZodLiteral<"text_delta">;
377
+ data: z.ZodObject<{
378
+ delta: z.ZodString;
379
+ }, "strip", z.ZodTypeAny, {
380
+ delta: string;
381
+ }, {
382
+ delta: string;
383
+ }>;
384
+ }, "strip", z.ZodTypeAny, {
385
+ type: "text_delta";
386
+ data: {
387
+ delta: string;
388
+ };
389
+ requestId: string;
390
+ timestamp?: number | undefined;
391
+ }, {
392
+ type: "text_delta";
393
+ data: {
394
+ delta: string;
395
+ };
396
+ requestId: string;
397
+ timestamp?: number | undefined;
398
+ }>;
399
+ /**
400
+ * Finish event schema - emitted when orchestration finishes
401
+ */
402
+ export declare const finishEventSchema: z.ZodObject<{
403
+ requestId: z.ZodString;
404
+ timestamp: z.ZodOptional<z.ZodNumber>;
405
+ } & {
406
+ type: z.ZodLiteral<"finish">;
407
+ data: z.ZodObject<{
408
+ totalIterations: z.ZodNumber;
409
+ hasPendingTools: z.ZodBoolean;
410
+ hasToolErrors: z.ZodBoolean;
411
+ }, "strip", z.ZodTypeAny, {
412
+ totalIterations: number;
413
+ hasPendingTools: boolean;
414
+ hasToolErrors: boolean;
415
+ }, {
416
+ totalIterations: number;
417
+ hasPendingTools: boolean;
418
+ hasToolErrors: boolean;
419
+ }>;
420
+ }, "strip", z.ZodTypeAny, {
421
+ type: "finish";
422
+ data: {
423
+ totalIterations: number;
424
+ hasPendingTools: boolean;
425
+ hasToolErrors: boolean;
426
+ };
427
+ requestId: string;
428
+ timestamp?: number | undefined;
429
+ }, {
430
+ type: "finish";
431
+ data: {
432
+ totalIterations: number;
433
+ hasPendingTools: boolean;
434
+ hasToolErrors: boolean;
435
+ };
436
+ requestId: string;
437
+ timestamp?: number | undefined;
438
+ }>;
439
+ /**
440
+ * Error telemetry event schema - emitted when an error occurs.
441
+ * The data field is always present per the ErrorEvent type definition.
442
+ */
443
+ export declare const errorTelemetryEventSchema: z.ZodObject<{
444
+ requestId: z.ZodString;
445
+ timestamp: z.ZodOptional<z.ZodNumber>;
446
+ } & {
447
+ type: z.ZodLiteral<"error">;
448
+ data: z.ZodObject<{
449
+ message: z.ZodString;
450
+ code: z.ZodOptional<z.ZodString>;
451
+ }, "strip", z.ZodTypeAny, {
452
+ message: string;
453
+ code?: string | undefined;
454
+ }, {
455
+ message: string;
456
+ code?: string | undefined;
457
+ }>;
458
+ }, "strip", z.ZodTypeAny, {
459
+ type: "error";
460
+ data: {
461
+ message: string;
462
+ code?: string | undefined;
463
+ };
464
+ requestId: string;
465
+ timestamp?: number | undefined;
466
+ }, {
467
+ type: "error";
468
+ data: {
469
+ message: string;
470
+ code?: string | undefined;
471
+ };
472
+ requestId: string;
473
+ timestamp?: number | undefined;
474
+ }>;
475
+ /**
476
+ * Schema for validating telemetry events.
477
+ * Discriminated union using the "type" field.
478
+ */
479
+ export declare const telemetryEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
480
+ requestId: z.ZodString;
481
+ timestamp: z.ZodOptional<z.ZodNumber>;
482
+ } & {
483
+ type: z.ZodLiteral<"connected">;
484
+ }, "strip", z.ZodTypeAny, {
485
+ type: "connected";
486
+ requestId: string;
487
+ timestamp?: number | undefined;
488
+ }, {
489
+ type: "connected";
490
+ requestId: string;
491
+ timestamp?: number | undefined;
492
+ }>, z.ZodObject<{
493
+ requestId: z.ZodString;
494
+ timestamp: z.ZodOptional<z.ZodNumber>;
495
+ } & {
496
+ type: z.ZodLiteral<"stream_end">;
497
+ }, "strip", z.ZodTypeAny, {
498
+ type: "stream_end";
499
+ requestId: string;
500
+ timestamp?: number | undefined;
501
+ }, {
502
+ type: "stream_end";
503
+ requestId: string;
504
+ timestamp?: number | undefined;
505
+ }>, z.ZodObject<{
506
+ requestId: z.ZodString;
507
+ timestamp: z.ZodOptional<z.ZodNumber>;
508
+ } & {
509
+ type: z.ZodLiteral<"iteration_start">;
510
+ data: z.ZodObject<{
511
+ iteration: z.ZodNumber;
512
+ }, "strip", z.ZodTypeAny, {
513
+ iteration: number;
514
+ }, {
515
+ iteration: number;
516
+ }>;
517
+ }, "strip", z.ZodTypeAny, {
518
+ type: "iteration_start";
519
+ data: {
520
+ iteration: number;
521
+ };
522
+ requestId: string;
523
+ timestamp?: number | undefined;
524
+ }, {
525
+ type: "iteration_start";
526
+ data: {
527
+ iteration: number;
528
+ };
529
+ requestId: string;
530
+ timestamp?: number | undefined;
531
+ }>, z.ZodObject<{
532
+ requestId: z.ZodString;
533
+ timestamp: z.ZodOptional<z.ZodNumber>;
534
+ } & {
535
+ type: z.ZodLiteral<"iteration_end">;
536
+ data: z.ZodObject<{
537
+ iteration: z.ZodNumber;
538
+ hasToolCalls: z.ZodBoolean;
539
+ shouldContinue: z.ZodBoolean;
540
+ }, "strip", z.ZodTypeAny, {
541
+ iteration: number;
542
+ hasToolCalls: boolean;
543
+ shouldContinue: boolean;
544
+ }, {
545
+ iteration: number;
546
+ hasToolCalls: boolean;
547
+ shouldContinue: boolean;
548
+ }>;
549
+ }, "strip", z.ZodTypeAny, {
550
+ type: "iteration_end";
551
+ data: {
552
+ iteration: number;
553
+ hasToolCalls: boolean;
554
+ shouldContinue: boolean;
555
+ };
556
+ requestId: string;
557
+ timestamp?: number | undefined;
558
+ }, {
559
+ type: "iteration_end";
560
+ data: {
561
+ iteration: number;
562
+ hasToolCalls: boolean;
563
+ shouldContinue: boolean;
564
+ };
565
+ requestId: string;
566
+ timestamp?: number | undefined;
567
+ }>, z.ZodObject<{
568
+ requestId: z.ZodString;
569
+ timestamp: z.ZodOptional<z.ZodNumber>;
570
+ } & {
571
+ type: z.ZodLiteral<"tool_call_batch">;
572
+ data: z.ZodObject<{
573
+ iteration: z.ZodNumber;
574
+ tools: z.ZodArray<z.ZodObject<{
575
+ toolCallId: z.ZodString;
576
+ toolName: z.ZodString;
577
+ }, "strip", z.ZodTypeAny, {
578
+ toolCallId: string;
579
+ toolName: string;
580
+ }, {
581
+ toolCallId: string;
582
+ toolName: string;
583
+ }>, "many">;
584
+ }, "strip", z.ZodTypeAny, {
585
+ iteration: number;
586
+ tools: {
587
+ toolCallId: string;
588
+ toolName: string;
589
+ }[];
590
+ }, {
591
+ iteration: number;
592
+ tools: {
593
+ toolCallId: string;
594
+ toolName: string;
595
+ }[];
596
+ }>;
597
+ }, "strip", z.ZodTypeAny, {
598
+ type: "tool_call_batch";
599
+ data: {
600
+ iteration: number;
601
+ tools: {
602
+ toolCallId: string;
603
+ toolName: string;
604
+ }[];
605
+ };
606
+ requestId: string;
607
+ timestamp?: number | undefined;
608
+ }, {
609
+ type: "tool_call_batch";
610
+ data: {
611
+ iteration: number;
612
+ tools: {
613
+ toolCallId: string;
614
+ toolName: string;
615
+ }[];
616
+ };
617
+ requestId: string;
618
+ timestamp?: number | undefined;
619
+ }>, z.ZodObject<{
620
+ requestId: z.ZodString;
621
+ timestamp: z.ZodOptional<z.ZodNumber>;
622
+ } & {
623
+ type: z.ZodLiteral<"tool_result">;
624
+ data: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
625
+ toolCallId: z.ZodString;
626
+ toolName: z.ZodString;
627
+ status: z.ZodLiteral<"pending">;
628
+ }, "strip", z.ZodTypeAny, {
629
+ status: "pending";
630
+ toolCallId: string;
631
+ toolName: string;
632
+ }, {
633
+ status: "pending";
634
+ toolCallId: string;
635
+ toolName: string;
636
+ }>, z.ZodObject<{
637
+ toolCallId: z.ZodString;
638
+ toolName: z.ZodString;
639
+ status: z.ZodLiteral<"success">;
640
+ }, "strip", z.ZodTypeAny, {
641
+ status: "success";
642
+ toolCallId: string;
643
+ toolName: string;
644
+ }, {
645
+ status: "success";
646
+ toolCallId: string;
647
+ toolName: string;
648
+ }>, z.ZodObject<{
649
+ toolCallId: z.ZodString;
650
+ toolName: z.ZodString;
651
+ status: z.ZodLiteral<"failure">;
652
+ error: z.ZodString;
653
+ }, "strip", z.ZodTypeAny, {
654
+ status: "failure";
655
+ error: string;
656
+ toolCallId: string;
657
+ toolName: string;
658
+ }, {
659
+ status: "failure";
660
+ error: string;
661
+ toolCallId: string;
662
+ toolName: string;
663
+ }>]>;
664
+ }, "strip", z.ZodTypeAny, {
665
+ type: "tool_result";
666
+ data: {
667
+ status: "pending";
668
+ toolCallId: string;
669
+ toolName: string;
670
+ } | {
671
+ status: "success";
672
+ toolCallId: string;
673
+ toolName: string;
674
+ } | {
675
+ status: "failure";
676
+ error: string;
677
+ toolCallId: string;
678
+ toolName: string;
679
+ };
680
+ requestId: string;
681
+ timestamp?: number | undefined;
682
+ }, {
683
+ type: "tool_result";
684
+ data: {
685
+ status: "pending";
686
+ toolCallId: string;
687
+ toolName: string;
688
+ } | {
689
+ status: "success";
690
+ toolCallId: string;
691
+ toolName: string;
692
+ } | {
693
+ status: "failure";
694
+ error: string;
695
+ toolCallId: string;
696
+ toolName: string;
697
+ };
698
+ requestId: string;
699
+ timestamp?: number | undefined;
700
+ }>, z.ZodObject<{
701
+ requestId: z.ZodString;
702
+ timestamp: z.ZodOptional<z.ZodNumber>;
703
+ } & {
704
+ type: z.ZodLiteral<"scratchpad_reset">;
705
+ data: z.ZodObject<{
706
+ reason: z.ZodString;
707
+ }, "strip", z.ZodTypeAny, {
708
+ reason: string;
709
+ }, {
710
+ reason: string;
711
+ }>;
712
+ }, "strip", z.ZodTypeAny, {
713
+ type: "scratchpad_reset";
714
+ data: {
715
+ reason: string;
716
+ };
717
+ requestId: string;
718
+ timestamp?: number | undefined;
719
+ }, {
720
+ type: "scratchpad_reset";
721
+ data: {
722
+ reason: string;
723
+ };
724
+ requestId: string;
725
+ timestamp?: number | undefined;
726
+ }>, z.ZodObject<{
727
+ requestId: z.ZodString;
728
+ timestamp: z.ZodOptional<z.ZodNumber>;
729
+ } & {
730
+ type: z.ZodLiteral<"llm_start">;
731
+ data: z.ZodObject<{
732
+ iteration: z.ZodNumber;
733
+ }, "strip", z.ZodTypeAny, {
734
+ iteration: number;
735
+ }, {
736
+ iteration: number;
737
+ }>;
738
+ }, "strip", z.ZodTypeAny, {
739
+ type: "llm_start";
740
+ data: {
741
+ iteration: number;
742
+ };
743
+ requestId: string;
744
+ timestamp?: number | undefined;
745
+ }, {
746
+ type: "llm_start";
747
+ data: {
748
+ iteration: number;
749
+ };
750
+ requestId: string;
751
+ timestamp?: number | undefined;
752
+ }>, z.ZodObject<{
753
+ requestId: z.ZodString;
754
+ timestamp: z.ZodOptional<z.ZodNumber>;
755
+ } & {
756
+ type: z.ZodLiteral<"llm_end">;
757
+ data: z.ZodObject<{
758
+ iteration: z.ZodNumber;
759
+ hasText: z.ZodBoolean;
760
+ toolCallCount: z.ZodNumber;
761
+ }, "strip", z.ZodTypeAny, {
762
+ iteration: number;
763
+ hasText: boolean;
764
+ toolCallCount: number;
765
+ }, {
766
+ iteration: number;
767
+ hasText: boolean;
768
+ toolCallCount: number;
769
+ }>;
770
+ }, "strip", z.ZodTypeAny, {
771
+ type: "llm_end";
772
+ data: {
773
+ iteration: number;
774
+ hasText: boolean;
775
+ toolCallCount: number;
776
+ };
777
+ requestId: string;
778
+ timestamp?: number | undefined;
779
+ }, {
780
+ type: "llm_end";
781
+ data: {
782
+ iteration: number;
783
+ hasText: boolean;
784
+ toolCallCount: number;
785
+ };
786
+ requestId: string;
787
+ timestamp?: number | undefined;
788
+ }>, z.ZodObject<{
789
+ requestId: z.ZodString;
790
+ timestamp: z.ZodOptional<z.ZodNumber>;
791
+ } & {
792
+ type: z.ZodLiteral<"text_delta">;
793
+ data: z.ZodObject<{
794
+ delta: z.ZodString;
795
+ }, "strip", z.ZodTypeAny, {
796
+ delta: string;
797
+ }, {
798
+ delta: string;
799
+ }>;
800
+ }, "strip", z.ZodTypeAny, {
801
+ type: "text_delta";
802
+ data: {
803
+ delta: string;
804
+ };
805
+ requestId: string;
806
+ timestamp?: number | undefined;
807
+ }, {
808
+ type: "text_delta";
809
+ data: {
810
+ delta: string;
811
+ };
812
+ requestId: string;
813
+ timestamp?: number | undefined;
814
+ }>, z.ZodObject<{
815
+ requestId: z.ZodString;
816
+ timestamp: z.ZodOptional<z.ZodNumber>;
817
+ } & {
818
+ type: z.ZodLiteral<"finish">;
819
+ data: z.ZodObject<{
820
+ totalIterations: z.ZodNumber;
821
+ hasPendingTools: z.ZodBoolean;
822
+ hasToolErrors: z.ZodBoolean;
823
+ }, "strip", z.ZodTypeAny, {
824
+ totalIterations: number;
825
+ hasPendingTools: boolean;
826
+ hasToolErrors: boolean;
827
+ }, {
828
+ totalIterations: number;
829
+ hasPendingTools: boolean;
830
+ hasToolErrors: boolean;
831
+ }>;
832
+ }, "strip", z.ZodTypeAny, {
833
+ type: "finish";
834
+ data: {
835
+ totalIterations: number;
836
+ hasPendingTools: boolean;
837
+ hasToolErrors: boolean;
838
+ };
839
+ requestId: string;
840
+ timestamp?: number | undefined;
841
+ }, {
842
+ type: "finish";
843
+ data: {
844
+ totalIterations: number;
845
+ hasPendingTools: boolean;
846
+ hasToolErrors: boolean;
847
+ };
848
+ requestId: string;
849
+ timestamp?: number | undefined;
850
+ }>, z.ZodObject<{
851
+ requestId: z.ZodString;
852
+ timestamp: z.ZodOptional<z.ZodNumber>;
853
+ } & {
854
+ type: z.ZodLiteral<"error">;
855
+ data: z.ZodObject<{
856
+ message: z.ZodString;
857
+ code: z.ZodOptional<z.ZodString>;
858
+ }, "strip", z.ZodTypeAny, {
859
+ message: string;
860
+ code?: string | undefined;
861
+ }, {
862
+ message: string;
863
+ code?: string | undefined;
864
+ }>;
865
+ }, "strip", z.ZodTypeAny, {
866
+ type: "error";
867
+ data: {
868
+ message: string;
869
+ code?: string | undefined;
870
+ };
871
+ requestId: string;
872
+ timestamp?: number | undefined;
873
+ }, {
874
+ type: "error";
875
+ data: {
876
+ message: string;
877
+ code?: string | undefined;
878
+ };
879
+ requestId: string;
880
+ timestamp?: number | undefined;
881
+ }>]>;
882
+ /**
883
+ * Schema for validating result events from the streaming endpoint.
884
+ * Uses type: "result" as discriminator for consistency with other event schemas.
885
+ * Also includes status: 200 for backward compatibility with CoreApiChatSuccessResponse.
886
+ */
887
+ export declare const resultEventDataSchema: z.ZodObject<{
888
+ type: z.ZodLiteral<"result">;
889
+ status: z.ZodLiteral<200>;
890
+ messages: z.ZodArray<z.ZodType<ModelMessage, z.ZodTypeDef, ModelMessage>, "many">;
891
+ text: z.ZodString;
892
+ pendingTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
893
+ type: z.ZodLiteral<"tool-call">;
894
+ toolCallId: z.ZodString;
895
+ toolName: z.ZodString;
896
+ input: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
897
+ type: z.ZodLiteral<"BatchTransactions">;
898
+ value: z.ZodArray<z.ZodObject<{
899
+ transaction: z.ZodType<import("viem").PrepareTransactionRequestReturnType>;
900
+ metadata: z.ZodOptional<z.ZodObject<{
901
+ explorerUrl: z.ZodOptional<z.ZodString>;
902
+ usdValue: z.ZodOptional<z.ZodString>;
903
+ }, "strip", z.ZodTypeAny, {
904
+ explorerUrl?: string | undefined;
905
+ usdValue?: string | undefined;
906
+ }, {
907
+ explorerUrl?: string | undefined;
908
+ usdValue?: string | undefined;
909
+ }>>;
910
+ }, "strip", z.ZodTypeAny, {
911
+ transaction: import("viem").PrepareTransactionRequestReturnType;
912
+ metadata?: {
913
+ explorerUrl?: string | undefined;
914
+ usdValue?: string | undefined;
915
+ } | undefined;
916
+ }, {
917
+ transaction: import("viem").PrepareTransactionRequestReturnType;
918
+ metadata?: {
919
+ explorerUrl?: string | undefined;
920
+ usdValue?: string | undefined;
921
+ } | undefined;
922
+ }>, "many">;
923
+ }, "strip", z.ZodTypeAny, {
924
+ value: {
925
+ transaction: import("viem").PrepareTransactionRequestReturnType;
926
+ metadata?: {
927
+ explorerUrl?: string | undefined;
928
+ usdValue?: string | undefined;
929
+ } | undefined;
930
+ }[];
931
+ type: "BatchTransactions";
932
+ }, {
933
+ value: {
934
+ transaction: import("viem").PrepareTransactionRequestReturnType;
935
+ metadata?: {
936
+ explorerUrl?: string | undefined;
937
+ usdValue?: string | undefined;
938
+ } | undefined;
939
+ }[];
940
+ type: "BatchTransactions";
941
+ }>, z.ZodObject<{
942
+ type: z.ZodLiteral<"SingleTransaction">;
943
+ value: z.ZodObject<{
944
+ transaction: z.ZodType<import("viem").PrepareTransactionRequestReturnType>;
945
+ metadata: z.ZodOptional<z.ZodObject<{
946
+ explorerUrl: z.ZodOptional<z.ZodString>;
947
+ usdValue: z.ZodOptional<z.ZodString>;
948
+ }, "strip", z.ZodTypeAny, {
949
+ explorerUrl?: string | undefined;
950
+ usdValue?: string | undefined;
951
+ }, {
952
+ explorerUrl?: string | undefined;
953
+ usdValue?: string | undefined;
954
+ }>>;
955
+ }, "strip", z.ZodTypeAny, {
956
+ transaction: import("viem").PrepareTransactionRequestReturnType;
957
+ metadata?: {
958
+ explorerUrl?: string | undefined;
959
+ usdValue?: string | undefined;
960
+ } | undefined;
961
+ }, {
962
+ transaction: import("viem").PrepareTransactionRequestReturnType;
963
+ metadata?: {
964
+ explorerUrl?: string | undefined;
965
+ usdValue?: string | undefined;
966
+ } | undefined;
967
+ }>;
968
+ }, "strip", z.ZodTypeAny, {
969
+ value: {
970
+ transaction: import("viem").PrepareTransactionRequestReturnType;
971
+ metadata?: {
972
+ explorerUrl?: string | undefined;
973
+ usdValue?: string | undefined;
974
+ } | undefined;
975
+ };
976
+ type: "SingleTransaction";
977
+ }, {
978
+ value: {
979
+ transaction: import("viem").PrepareTransactionRequestReturnType;
980
+ metadata?: {
981
+ explorerUrl?: string | undefined;
982
+ usdValue?: string | undefined;
983
+ } | undefined;
984
+ };
985
+ type: "SingleTransaction";
986
+ }>]>;
987
+ }, "strict", z.ZodTypeAny, {
988
+ type: "tool-call";
989
+ input: {
990
+ value: {
991
+ transaction: import("viem").PrepareTransactionRequestReturnType;
992
+ metadata?: {
993
+ explorerUrl?: string | undefined;
994
+ usdValue?: string | undefined;
995
+ } | undefined;
996
+ }[];
997
+ type: "BatchTransactions";
998
+ } | {
999
+ value: {
1000
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1001
+ metadata?: {
1002
+ explorerUrl?: string | undefined;
1003
+ usdValue?: string | undefined;
1004
+ } | undefined;
1005
+ };
1006
+ type: "SingleTransaction";
1007
+ };
1008
+ toolCallId: string;
1009
+ toolName: string;
1010
+ }, {
1011
+ type: "tool-call";
1012
+ input: {
1013
+ value: {
1014
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1015
+ metadata?: {
1016
+ explorerUrl?: string | undefined;
1017
+ usdValue?: string | undefined;
1018
+ } | undefined;
1019
+ }[];
1020
+ type: "BatchTransactions";
1021
+ } | {
1022
+ value: {
1023
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1024
+ metadata?: {
1025
+ explorerUrl?: string | undefined;
1026
+ usdValue?: string | undefined;
1027
+ } | undefined;
1028
+ };
1029
+ type: "SingleTransaction";
1030
+ };
1031
+ toolCallId: string;
1032
+ toolName: string;
1033
+ }>, "many">>;
1034
+ incompleteTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1035
+ toolCallId: z.ZodString;
1036
+ toolName: z.ZodString;
1037
+ toolInput: z.ZodOptional<z.ZodUnknown>;
1038
+ }, "strip", z.ZodTypeAny, {
1039
+ toolCallId: string;
1040
+ toolName: string;
1041
+ toolInput?: unknown;
1042
+ }, {
1043
+ toolCallId: string;
1044
+ toolName: string;
1045
+ toolInput?: unknown;
1046
+ }>, "many">>;
1047
+ toolErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1048
+ id: z.ZodString;
1049
+ name: z.ZodString;
1050
+ data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1051
+ type: z.ZodLiteral<"input">;
1052
+ errors: z.ZodArray<z.ZodObject<{
1053
+ path: z.ZodString;
1054
+ message: z.ZodString;
1055
+ }, "strict", z.ZodTypeAny, {
1056
+ path: string;
1057
+ message: string;
1058
+ }, {
1059
+ path: string;
1060
+ message: string;
1061
+ }>, "many">;
1062
+ }, "strict", z.ZodTypeAny, {
1063
+ type: "input";
1064
+ errors: {
1065
+ path: string;
1066
+ message: string;
1067
+ }[];
1068
+ }, {
1069
+ type: "input";
1070
+ errors: {
1071
+ path: string;
1072
+ message: string;
1073
+ }[];
1074
+ }>, z.ZodObject<{
1075
+ type: z.ZodLiteral<"execution">;
1076
+ message: z.ZodString;
1077
+ details: z.ZodOptional<z.ZodUnknown>;
1078
+ }, "strict", z.ZodTypeAny, {
1079
+ message: string;
1080
+ type: "execution";
1081
+ details?: unknown;
1082
+ }, {
1083
+ message: string;
1084
+ type: "execution";
1085
+ details?: unknown;
1086
+ }>]>;
1087
+ }, "strict", z.ZodTypeAny, {
1088
+ id: string;
1089
+ name: string;
1090
+ data: {
1091
+ type: "input";
1092
+ errors: {
1093
+ path: string;
1094
+ message: string;
1095
+ }[];
1096
+ } | {
1097
+ message: string;
1098
+ type: "execution";
1099
+ details?: unknown;
1100
+ };
1101
+ }, {
1102
+ id: string;
1103
+ name: string;
1104
+ data: {
1105
+ type: "input";
1106
+ errors: {
1107
+ path: string;
1108
+ message: string;
1109
+ }[];
1110
+ } | {
1111
+ message: string;
1112
+ type: "execution";
1113
+ details?: unknown;
1114
+ };
1115
+ }>, "many">>;
1116
+ requestId: z.ZodString;
1117
+ }, "strip", z.ZodTypeAny, {
1118
+ type: "result";
1119
+ status: 200;
1120
+ text: string;
1121
+ messages: ModelMessage[];
1122
+ requestId: string;
1123
+ pendingTools?: {
1124
+ type: "tool-call";
1125
+ input: {
1126
+ value: {
1127
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1128
+ metadata?: {
1129
+ explorerUrl?: string | undefined;
1130
+ usdValue?: string | undefined;
1131
+ } | undefined;
1132
+ }[];
1133
+ type: "BatchTransactions";
1134
+ } | {
1135
+ value: {
1136
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1137
+ metadata?: {
1138
+ explorerUrl?: string | undefined;
1139
+ usdValue?: string | undefined;
1140
+ } | undefined;
1141
+ };
1142
+ type: "SingleTransaction";
1143
+ };
1144
+ toolCallId: string;
1145
+ toolName: string;
1146
+ }[] | undefined;
1147
+ incompleteTools?: {
1148
+ toolCallId: string;
1149
+ toolName: string;
1150
+ toolInput?: unknown;
1151
+ }[] | undefined;
1152
+ toolErrors?: {
1153
+ id: string;
1154
+ name: string;
1155
+ data: {
1156
+ type: "input";
1157
+ errors: {
1158
+ path: string;
1159
+ message: string;
1160
+ }[];
1161
+ } | {
1162
+ message: string;
1163
+ type: "execution";
1164
+ details?: unknown;
1165
+ };
1166
+ }[] | undefined;
1167
+ }, {
1168
+ type: "result";
1169
+ status: 200;
1170
+ text: string;
1171
+ messages: ModelMessage[];
1172
+ requestId: string;
1173
+ pendingTools?: {
1174
+ type: "tool-call";
1175
+ input: {
1176
+ value: {
1177
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1178
+ metadata?: {
1179
+ explorerUrl?: string | undefined;
1180
+ usdValue?: string | undefined;
1181
+ } | undefined;
1182
+ }[];
1183
+ type: "BatchTransactions";
1184
+ } | {
1185
+ value: {
1186
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1187
+ metadata?: {
1188
+ explorerUrl?: string | undefined;
1189
+ usdValue?: string | undefined;
1190
+ } | undefined;
1191
+ };
1192
+ type: "SingleTransaction";
1193
+ };
1194
+ toolCallId: string;
1195
+ toolName: string;
1196
+ }[] | undefined;
1197
+ incompleteTools?: {
1198
+ toolCallId: string;
1199
+ toolName: string;
1200
+ toolInput?: unknown;
1201
+ }[] | undefined;
1202
+ toolErrors?: {
1203
+ id: string;
1204
+ name: string;
1205
+ data: {
1206
+ type: "input";
1207
+ errors: {
1208
+ path: string;
1209
+ message: string;
1210
+ }[];
1211
+ } | {
1212
+ message: string;
1213
+ type: "execution";
1214
+ details?: unknown;
1215
+ };
1216
+ }[] | undefined;
1217
+ }>;
1218
+ /**
1219
+ * Schema for validating error events from the streaming endpoint
1220
+ */
1221
+ export declare const errorEventDataSchema: z.ZodObject<{
1222
+ type: z.ZodLiteral<"error">;
1223
+ requestId: z.ZodString;
1224
+ timestamp: z.ZodOptional<z.ZodNumber>;
1225
+ data: z.ZodObject<{
1226
+ message: z.ZodString;
1227
+ code: z.ZodOptional<z.ZodString>;
1228
+ }, "strip", z.ZodTypeAny, {
1229
+ message: string;
1230
+ code?: string | undefined;
1231
+ }, {
1232
+ message: string;
1233
+ code?: string | undefined;
1234
+ }>;
1235
+ }, "strip", z.ZodTypeAny, {
1236
+ type: "error";
1237
+ data: {
1238
+ message: string;
1239
+ code?: string | undefined;
1240
+ };
1241
+ requestId: string;
1242
+ timestamp?: number | undefined;
1243
+ }, {
1244
+ type: "error";
1245
+ data: {
1246
+ message: string;
1247
+ code?: string | undefined;
1248
+ };
1249
+ requestId: string;
1250
+ timestamp?: number | undefined;
1251
+ }>;
1252
+ /**
1253
+ * Schema for validating stream_end events from the streaming endpoint
1254
+ */
1255
+ export declare const streamEndEventDataSchema: z.ZodObject<{
1256
+ type: z.ZodLiteral<"stream_end">;
1257
+ requestId: z.ZodString;
1258
+ timestamp: z.ZodOptional<z.ZodNumber>;
1259
+ }, "strip", z.ZodTypeAny, {
1260
+ type: "stream_end";
1261
+ requestId: string;
1262
+ timestamp?: number | undefined;
1263
+ }, {
1264
+ type: "stream_end";
1265
+ requestId: string;
1266
+ timestamp?: number | undefined;
1267
+ }>;
1268
+ /**
1269
+ * Unified discriminated union for all stream event data types.
1270
+ * Uses "type" as the discriminator field for runtime validation.
1271
+ */
1272
+ export declare const streamEventDataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1273
+ type: z.ZodLiteral<"result">;
1274
+ status: z.ZodLiteral<200>;
1275
+ messages: z.ZodArray<z.ZodType<ModelMessage, z.ZodTypeDef, ModelMessage>, "many">;
1276
+ text: z.ZodString;
1277
+ pendingTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1278
+ type: z.ZodLiteral<"tool-call">;
1279
+ toolCallId: z.ZodString;
1280
+ toolName: z.ZodString;
1281
+ input: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1282
+ type: z.ZodLiteral<"BatchTransactions">;
1283
+ value: z.ZodArray<z.ZodObject<{
1284
+ transaction: z.ZodType<import("viem").PrepareTransactionRequestReturnType>;
1285
+ metadata: z.ZodOptional<z.ZodObject<{
1286
+ explorerUrl: z.ZodOptional<z.ZodString>;
1287
+ usdValue: z.ZodOptional<z.ZodString>;
1288
+ }, "strip", z.ZodTypeAny, {
1289
+ explorerUrl?: string | undefined;
1290
+ usdValue?: string | undefined;
1291
+ }, {
1292
+ explorerUrl?: string | undefined;
1293
+ usdValue?: string | undefined;
1294
+ }>>;
1295
+ }, "strip", z.ZodTypeAny, {
1296
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1297
+ metadata?: {
1298
+ explorerUrl?: string | undefined;
1299
+ usdValue?: string | undefined;
1300
+ } | undefined;
1301
+ }, {
1302
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1303
+ metadata?: {
1304
+ explorerUrl?: string | undefined;
1305
+ usdValue?: string | undefined;
1306
+ } | undefined;
1307
+ }>, "many">;
1308
+ }, "strip", z.ZodTypeAny, {
1309
+ value: {
1310
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1311
+ metadata?: {
1312
+ explorerUrl?: string | undefined;
1313
+ usdValue?: string | undefined;
1314
+ } | undefined;
1315
+ }[];
1316
+ type: "BatchTransactions";
1317
+ }, {
1318
+ value: {
1319
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1320
+ metadata?: {
1321
+ explorerUrl?: string | undefined;
1322
+ usdValue?: string | undefined;
1323
+ } | undefined;
1324
+ }[];
1325
+ type: "BatchTransactions";
1326
+ }>, z.ZodObject<{
1327
+ type: z.ZodLiteral<"SingleTransaction">;
1328
+ value: z.ZodObject<{
1329
+ transaction: z.ZodType<import("viem").PrepareTransactionRequestReturnType>;
1330
+ metadata: z.ZodOptional<z.ZodObject<{
1331
+ explorerUrl: z.ZodOptional<z.ZodString>;
1332
+ usdValue: z.ZodOptional<z.ZodString>;
1333
+ }, "strip", z.ZodTypeAny, {
1334
+ explorerUrl?: string | undefined;
1335
+ usdValue?: string | undefined;
1336
+ }, {
1337
+ explorerUrl?: string | undefined;
1338
+ usdValue?: string | undefined;
1339
+ }>>;
1340
+ }, "strip", z.ZodTypeAny, {
1341
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1342
+ metadata?: {
1343
+ explorerUrl?: string | undefined;
1344
+ usdValue?: string | undefined;
1345
+ } | undefined;
1346
+ }, {
1347
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1348
+ metadata?: {
1349
+ explorerUrl?: string | undefined;
1350
+ usdValue?: string | undefined;
1351
+ } | undefined;
1352
+ }>;
1353
+ }, "strip", z.ZodTypeAny, {
1354
+ value: {
1355
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1356
+ metadata?: {
1357
+ explorerUrl?: string | undefined;
1358
+ usdValue?: string | undefined;
1359
+ } | undefined;
1360
+ };
1361
+ type: "SingleTransaction";
1362
+ }, {
1363
+ value: {
1364
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1365
+ metadata?: {
1366
+ explorerUrl?: string | undefined;
1367
+ usdValue?: string | undefined;
1368
+ } | undefined;
1369
+ };
1370
+ type: "SingleTransaction";
1371
+ }>]>;
1372
+ }, "strict", z.ZodTypeAny, {
1373
+ type: "tool-call";
1374
+ input: {
1375
+ value: {
1376
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1377
+ metadata?: {
1378
+ explorerUrl?: string | undefined;
1379
+ usdValue?: string | undefined;
1380
+ } | undefined;
1381
+ }[];
1382
+ type: "BatchTransactions";
1383
+ } | {
1384
+ value: {
1385
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1386
+ metadata?: {
1387
+ explorerUrl?: string | undefined;
1388
+ usdValue?: string | undefined;
1389
+ } | undefined;
1390
+ };
1391
+ type: "SingleTransaction";
1392
+ };
1393
+ toolCallId: string;
1394
+ toolName: string;
1395
+ }, {
1396
+ type: "tool-call";
1397
+ input: {
1398
+ value: {
1399
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1400
+ metadata?: {
1401
+ explorerUrl?: string | undefined;
1402
+ usdValue?: string | undefined;
1403
+ } | undefined;
1404
+ }[];
1405
+ type: "BatchTransactions";
1406
+ } | {
1407
+ value: {
1408
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1409
+ metadata?: {
1410
+ explorerUrl?: string | undefined;
1411
+ usdValue?: string | undefined;
1412
+ } | undefined;
1413
+ };
1414
+ type: "SingleTransaction";
1415
+ };
1416
+ toolCallId: string;
1417
+ toolName: string;
1418
+ }>, "many">>;
1419
+ incompleteTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1420
+ toolCallId: z.ZodString;
1421
+ toolName: z.ZodString;
1422
+ toolInput: z.ZodOptional<z.ZodUnknown>;
1423
+ }, "strip", z.ZodTypeAny, {
1424
+ toolCallId: string;
1425
+ toolName: string;
1426
+ toolInput?: unknown;
1427
+ }, {
1428
+ toolCallId: string;
1429
+ toolName: string;
1430
+ toolInput?: unknown;
1431
+ }>, "many">>;
1432
+ toolErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1433
+ id: z.ZodString;
1434
+ name: z.ZodString;
1435
+ data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1436
+ type: z.ZodLiteral<"input">;
1437
+ errors: z.ZodArray<z.ZodObject<{
1438
+ path: z.ZodString;
1439
+ message: z.ZodString;
1440
+ }, "strict", z.ZodTypeAny, {
1441
+ path: string;
1442
+ message: string;
1443
+ }, {
1444
+ path: string;
1445
+ message: string;
1446
+ }>, "many">;
1447
+ }, "strict", z.ZodTypeAny, {
1448
+ type: "input";
1449
+ errors: {
1450
+ path: string;
1451
+ message: string;
1452
+ }[];
1453
+ }, {
1454
+ type: "input";
1455
+ errors: {
1456
+ path: string;
1457
+ message: string;
1458
+ }[];
1459
+ }>, z.ZodObject<{
1460
+ type: z.ZodLiteral<"execution">;
1461
+ message: z.ZodString;
1462
+ details: z.ZodOptional<z.ZodUnknown>;
1463
+ }, "strict", z.ZodTypeAny, {
1464
+ message: string;
1465
+ type: "execution";
1466
+ details?: unknown;
1467
+ }, {
1468
+ message: string;
1469
+ type: "execution";
1470
+ details?: unknown;
1471
+ }>]>;
1472
+ }, "strict", z.ZodTypeAny, {
1473
+ id: string;
1474
+ name: string;
1475
+ data: {
1476
+ type: "input";
1477
+ errors: {
1478
+ path: string;
1479
+ message: string;
1480
+ }[];
1481
+ } | {
1482
+ message: string;
1483
+ type: "execution";
1484
+ details?: unknown;
1485
+ };
1486
+ }, {
1487
+ id: string;
1488
+ name: string;
1489
+ data: {
1490
+ type: "input";
1491
+ errors: {
1492
+ path: string;
1493
+ message: string;
1494
+ }[];
1495
+ } | {
1496
+ message: string;
1497
+ type: "execution";
1498
+ details?: unknown;
1499
+ };
1500
+ }>, "many">>;
1501
+ requestId: z.ZodString;
1502
+ }, "strip", z.ZodTypeAny, {
1503
+ type: "result";
1504
+ status: 200;
1505
+ text: string;
1506
+ messages: ModelMessage[];
1507
+ requestId: string;
1508
+ pendingTools?: {
1509
+ type: "tool-call";
1510
+ input: {
1511
+ value: {
1512
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1513
+ metadata?: {
1514
+ explorerUrl?: string | undefined;
1515
+ usdValue?: string | undefined;
1516
+ } | undefined;
1517
+ }[];
1518
+ type: "BatchTransactions";
1519
+ } | {
1520
+ value: {
1521
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1522
+ metadata?: {
1523
+ explorerUrl?: string | undefined;
1524
+ usdValue?: string | undefined;
1525
+ } | undefined;
1526
+ };
1527
+ type: "SingleTransaction";
1528
+ };
1529
+ toolCallId: string;
1530
+ toolName: string;
1531
+ }[] | undefined;
1532
+ incompleteTools?: {
1533
+ toolCallId: string;
1534
+ toolName: string;
1535
+ toolInput?: unknown;
1536
+ }[] | undefined;
1537
+ toolErrors?: {
1538
+ id: string;
1539
+ name: string;
1540
+ data: {
1541
+ type: "input";
1542
+ errors: {
1543
+ path: string;
1544
+ message: string;
1545
+ }[];
1546
+ } | {
1547
+ message: string;
1548
+ type: "execution";
1549
+ details?: unknown;
1550
+ };
1551
+ }[] | undefined;
1552
+ }, {
1553
+ type: "result";
1554
+ status: 200;
1555
+ text: string;
1556
+ messages: ModelMessage[];
1557
+ requestId: string;
1558
+ pendingTools?: {
1559
+ type: "tool-call";
1560
+ input: {
1561
+ value: {
1562
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1563
+ metadata?: {
1564
+ explorerUrl?: string | undefined;
1565
+ usdValue?: string | undefined;
1566
+ } | undefined;
1567
+ }[];
1568
+ type: "BatchTransactions";
1569
+ } | {
1570
+ value: {
1571
+ transaction: import("viem").PrepareTransactionRequestReturnType;
1572
+ metadata?: {
1573
+ explorerUrl?: string | undefined;
1574
+ usdValue?: string | undefined;
1575
+ } | undefined;
1576
+ };
1577
+ type: "SingleTransaction";
1578
+ };
1579
+ toolCallId: string;
1580
+ toolName: string;
1581
+ }[] | undefined;
1582
+ incompleteTools?: {
1583
+ toolCallId: string;
1584
+ toolName: string;
1585
+ toolInput?: unknown;
1586
+ }[] | undefined;
1587
+ toolErrors?: {
1588
+ id: string;
1589
+ name: string;
1590
+ data: {
1591
+ type: "input";
1592
+ errors: {
1593
+ path: string;
1594
+ message: string;
1595
+ }[];
1596
+ } | {
1597
+ message: string;
1598
+ type: "execution";
1599
+ details?: unknown;
1600
+ };
1601
+ }[] | undefined;
1602
+ }>, z.ZodObject<{
1603
+ type: z.ZodLiteral<"error">;
1604
+ requestId: z.ZodString;
1605
+ timestamp: z.ZodOptional<z.ZodNumber>;
1606
+ data: z.ZodObject<{
1607
+ message: z.ZodString;
1608
+ code: z.ZodOptional<z.ZodString>;
1609
+ }, "strip", z.ZodTypeAny, {
1610
+ message: string;
1611
+ code?: string | undefined;
1612
+ }, {
1613
+ message: string;
1614
+ code?: string | undefined;
1615
+ }>;
1616
+ }, "strip", z.ZodTypeAny, {
1617
+ type: "error";
1618
+ data: {
1619
+ message: string;
1620
+ code?: string | undefined;
1621
+ };
1622
+ requestId: string;
1623
+ timestamp?: number | undefined;
1624
+ }, {
1625
+ type: "error";
1626
+ data: {
1627
+ message: string;
1628
+ code?: string | undefined;
1629
+ };
1630
+ requestId: string;
1631
+ timestamp?: number | undefined;
1632
+ }>, z.ZodObject<{
1633
+ type: z.ZodLiteral<"stream_end">;
1634
+ requestId: z.ZodString;
1635
+ timestamp: z.ZodOptional<z.ZodNumber>;
1636
+ }, "strip", z.ZodTypeAny, {
1637
+ type: "stream_end";
1638
+ requestId: string;
1639
+ timestamp?: number | undefined;
1640
+ }, {
1641
+ type: "stream_end";
1642
+ requestId: string;
1643
+ timestamp?: number | undefined;
1644
+ }>]>;
1645
+ //# sourceMappingURL=telemetryEvents.d.ts.map