@illalabs/interfaces 0.3.0-canary.2110efe9 → 0.3.0-canary.3f75ecce

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 (90) 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 +79 -648
  10. package/dist/schemas/chatContext.d.ts.map +1 -1
  11. package/dist/schemas/chatRequestBody.d.ts +256 -2172
  12. package/dist/schemas/chatRequestBody.d.ts.map +1 -1
  13. package/dist/schemas/chatRequestBody.js +5 -3
  14. package/dist/schemas/chatRequestBody.js.map +1 -1
  15. package/dist/schemas/executionCheckerQueryParams.d.ts +2 -2
  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 +2 -0
  21. package/dist/schemas/index.d.ts.map +1 -1
  22. package/dist/schemas/index.js +2 -0
  23. package/dist/schemas/index.js.map +1 -1
  24. package/dist/schemas/messages.d.ts +95 -1037
  25. package/dist/schemas/messages.d.ts.map +1 -1
  26. package/dist/schemas/messages.js +10 -121
  27. package/dist/schemas/messages.js.map +1 -1
  28. package/dist/schemas/telemetryEvents.d.ts +1159 -0
  29. package/dist/schemas/telemetryEvents.d.ts.map +1 -0
  30. package/dist/schemas/telemetryEvents.js +250 -0
  31. package/dist/schemas/telemetryEvents.js.map +1 -0
  32. package/dist/tools/IllaToolError.d.ts +113 -0
  33. package/dist/tools/IllaToolError.d.ts.map +1 -0
  34. package/dist/tools/IllaToolError.js +143 -0
  35. package/dist/tools/IllaToolError.js.map +1 -0
  36. package/dist/tools/IllaToolOutcome.d.ts +131 -0
  37. package/dist/tools/IllaToolOutcome.d.ts.map +1 -0
  38. package/dist/tools/IllaToolOutcome.js +191 -0
  39. package/dist/tools/IllaToolOutcome.js.map +1 -0
  40. package/dist/tools/index.d.ts +3 -0
  41. package/dist/tools/index.d.ts.map +1 -0
  42. package/dist/tools/index.js +3 -0
  43. package/dist/tools/index.js.map +1 -0
  44. package/dist/types/actions/tools/bridgeAction.d.ts +1 -1
  45. package/dist/types/actions/tools/bridgeAction.d.ts.map +1 -1
  46. package/dist/types/actions/tools/defiFetchListingsAction.d.ts +1 -2
  47. package/dist/types/actions/tools/defiFetchListingsAction.d.ts.map +1 -1
  48. package/dist/types/actions/tools/defiFetchListingsAction.js +1 -1
  49. package/dist/types/actions/tools/defiFetchListingsAction.js.map +1 -1
  50. package/dist/types/actions/tools/defiPositionsAction.d.ts +1 -2
  51. package/dist/types/actions/tools/defiPositionsAction.d.ts.map +1 -1
  52. package/dist/types/actions/tools/defiPositionsAction.js +1 -1
  53. package/dist/types/actions/tools/defiPositionsAction.js.map +1 -1
  54. package/dist/types/actions/tools/defiSupplyAction.d.ts +1 -2
  55. package/dist/types/actions/tools/defiSupplyAction.d.ts.map +1 -1
  56. package/dist/types/actions/tools/defiSupplyAction.js +1 -1
  57. package/dist/types/actions/tools/defiSupplyAction.js.map +1 -1
  58. package/dist/types/actions/tools/defiWithdrawAction.d.ts +1 -2
  59. package/dist/types/actions/tools/defiWithdrawAction.d.ts.map +1 -1
  60. package/dist/types/actions/tools/defiWithdrawAction.js +1 -1
  61. package/dist/types/actions/tools/defiWithdrawAction.js.map +1 -1
  62. package/dist/types/actions/tools/exchangeRateAction.d.ts +1 -2
  63. package/dist/types/actions/tools/exchangeRateAction.d.ts.map +1 -1
  64. package/dist/types/actions/tools/exchangeRateAction.js +1 -1
  65. package/dist/types/actions/tools/exchangeRateAction.js.map +1 -1
  66. package/dist/types/actions/tools/getWalletBalanceAction.d.ts +1 -2
  67. package/dist/types/actions/tools/getWalletBalanceAction.d.ts.map +1 -1
  68. package/dist/types/actions/tools/getWalletBalanceAction.js +1 -1
  69. package/dist/types/actions/tools/getWalletBalanceAction.js.map +1 -1
  70. package/dist/types/actions/tools/tokenTransferAction.d.ts +1 -2
  71. package/dist/types/actions/tools/tokenTransferAction.d.ts.map +1 -1
  72. package/dist/types/actions/tools/tokenTransferAction.js +1 -1
  73. package/dist/types/actions/tools/tokenTransferAction.js.map +1 -1
  74. package/dist/types/index.d.ts +2 -0
  75. package/dist/types/index.d.ts.map +1 -1
  76. package/dist/types/index.js +2 -0
  77. package/dist/types/index.js.map +1 -1
  78. package/dist/types/messages.d.ts +3 -6
  79. package/dist/types/messages.d.ts.map +1 -1
  80. package/dist/types/messages.js +1 -1
  81. package/dist/types/messages.js.map +1 -1
  82. package/dist/types/streaming.d.ts +81 -0
  83. package/dist/types/streaming.d.ts.map +1 -0
  84. package/dist/types/streaming.js +2 -0
  85. package/dist/types/streaming.js.map +1 -0
  86. package/dist/types/telemetry.d.ts +139 -0
  87. package/dist/types/telemetry.d.ts.map +1 -0
  88. package/dist/types/telemetry.js +7 -0
  89. package/dist/types/telemetry.js.map +1 -0
  90. package/package.json +4 -4
@@ -0,0 +1,1159 @@
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
+ toolCallId: z.ZodString;
894
+ toolName: z.ZodString;
895
+ toolInput: z.ZodUnknown;
896
+ }, "strip", z.ZodTypeAny, {
897
+ toolCallId: string;
898
+ toolName: string;
899
+ toolInput?: unknown;
900
+ }, {
901
+ toolCallId: string;
902
+ toolName: string;
903
+ toolInput?: unknown;
904
+ }>, "many">>;
905
+ incompleteTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
906
+ toolCallId: z.ZodString;
907
+ toolName: z.ZodString;
908
+ toolInput: z.ZodOptional<z.ZodUnknown>;
909
+ }, "strip", z.ZodTypeAny, {
910
+ toolCallId: string;
911
+ toolName: string;
912
+ toolInput?: unknown;
913
+ }, {
914
+ toolCallId: string;
915
+ toolName: string;
916
+ toolInput?: unknown;
917
+ }>, "many">>;
918
+ toolErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
919
+ toolCallId: z.ZodString;
920
+ toolName: z.ZodString;
921
+ error: z.ZodString;
922
+ }, "strip", z.ZodTypeAny, {
923
+ error: string;
924
+ toolCallId: string;
925
+ toolName: string;
926
+ }, {
927
+ error: string;
928
+ toolCallId: string;
929
+ toolName: string;
930
+ }>, "many">>;
931
+ requestId: z.ZodString;
932
+ }, "strip", z.ZodTypeAny, {
933
+ type: "result";
934
+ status: 200;
935
+ text: string;
936
+ messages: ModelMessage[];
937
+ requestId: string;
938
+ pendingTools?: {
939
+ toolCallId: string;
940
+ toolName: string;
941
+ toolInput?: unknown;
942
+ }[] | undefined;
943
+ incompleteTools?: {
944
+ toolCallId: string;
945
+ toolName: string;
946
+ toolInput?: unknown;
947
+ }[] | undefined;
948
+ toolErrors?: {
949
+ error: string;
950
+ toolCallId: string;
951
+ toolName: string;
952
+ }[] | undefined;
953
+ }, {
954
+ type: "result";
955
+ status: 200;
956
+ text: string;
957
+ messages: ModelMessage[];
958
+ requestId: string;
959
+ pendingTools?: {
960
+ toolCallId: string;
961
+ toolName: string;
962
+ toolInput?: unknown;
963
+ }[] | undefined;
964
+ incompleteTools?: {
965
+ toolCallId: string;
966
+ toolName: string;
967
+ toolInput?: unknown;
968
+ }[] | undefined;
969
+ toolErrors?: {
970
+ error: string;
971
+ toolCallId: string;
972
+ toolName: string;
973
+ }[] | undefined;
974
+ }>;
975
+ /**
976
+ * Schema for validating error events from the streaming endpoint
977
+ */
978
+ export declare const errorEventDataSchema: z.ZodObject<{
979
+ type: z.ZodLiteral<"error">;
980
+ requestId: z.ZodString;
981
+ timestamp: z.ZodOptional<z.ZodNumber>;
982
+ data: z.ZodObject<{
983
+ message: z.ZodString;
984
+ code: z.ZodOptional<z.ZodString>;
985
+ }, "strip", z.ZodTypeAny, {
986
+ message: string;
987
+ code?: string | undefined;
988
+ }, {
989
+ message: string;
990
+ code?: string | undefined;
991
+ }>;
992
+ }, "strip", z.ZodTypeAny, {
993
+ type: "error";
994
+ data: {
995
+ message: string;
996
+ code?: string | undefined;
997
+ };
998
+ requestId: string;
999
+ timestamp?: number | undefined;
1000
+ }, {
1001
+ type: "error";
1002
+ data: {
1003
+ message: string;
1004
+ code?: string | undefined;
1005
+ };
1006
+ requestId: string;
1007
+ timestamp?: number | undefined;
1008
+ }>;
1009
+ /**
1010
+ * Schema for validating stream_end events from the streaming endpoint
1011
+ */
1012
+ export declare const streamEndEventDataSchema: z.ZodObject<{
1013
+ type: z.ZodLiteral<"stream_end">;
1014
+ requestId: z.ZodString;
1015
+ timestamp: z.ZodOptional<z.ZodNumber>;
1016
+ }, "strip", z.ZodTypeAny, {
1017
+ type: "stream_end";
1018
+ requestId: string;
1019
+ timestamp?: number | undefined;
1020
+ }, {
1021
+ type: "stream_end";
1022
+ requestId: string;
1023
+ timestamp?: number | undefined;
1024
+ }>;
1025
+ /**
1026
+ * Unified discriminated union for all stream event data types.
1027
+ * Uses "type" as the discriminator field for runtime validation.
1028
+ */
1029
+ export declare const streamEventDataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1030
+ type: z.ZodLiteral<"result">;
1031
+ status: z.ZodLiteral<200>;
1032
+ messages: z.ZodArray<z.ZodType<ModelMessage, z.ZodTypeDef, ModelMessage>, "many">;
1033
+ text: z.ZodString;
1034
+ pendingTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1035
+ toolCallId: z.ZodString;
1036
+ toolName: z.ZodString;
1037
+ toolInput: 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
+ incompleteTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1048
+ toolCallId: z.ZodString;
1049
+ toolName: z.ZodString;
1050
+ toolInput: z.ZodOptional<z.ZodUnknown>;
1051
+ }, "strip", z.ZodTypeAny, {
1052
+ toolCallId: string;
1053
+ toolName: string;
1054
+ toolInput?: unknown;
1055
+ }, {
1056
+ toolCallId: string;
1057
+ toolName: string;
1058
+ toolInput?: unknown;
1059
+ }>, "many">>;
1060
+ toolErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1061
+ toolCallId: z.ZodString;
1062
+ toolName: z.ZodString;
1063
+ error: z.ZodString;
1064
+ }, "strip", z.ZodTypeAny, {
1065
+ error: string;
1066
+ toolCallId: string;
1067
+ toolName: string;
1068
+ }, {
1069
+ error: string;
1070
+ toolCallId: string;
1071
+ toolName: string;
1072
+ }>, "many">>;
1073
+ requestId: z.ZodString;
1074
+ }, "strip", z.ZodTypeAny, {
1075
+ type: "result";
1076
+ status: 200;
1077
+ text: string;
1078
+ messages: ModelMessage[];
1079
+ requestId: string;
1080
+ pendingTools?: {
1081
+ toolCallId: string;
1082
+ toolName: string;
1083
+ toolInput?: unknown;
1084
+ }[] | undefined;
1085
+ incompleteTools?: {
1086
+ toolCallId: string;
1087
+ toolName: string;
1088
+ toolInput?: unknown;
1089
+ }[] | undefined;
1090
+ toolErrors?: {
1091
+ error: string;
1092
+ toolCallId: string;
1093
+ toolName: string;
1094
+ }[] | undefined;
1095
+ }, {
1096
+ type: "result";
1097
+ status: 200;
1098
+ text: string;
1099
+ messages: ModelMessage[];
1100
+ requestId: string;
1101
+ pendingTools?: {
1102
+ toolCallId: string;
1103
+ toolName: string;
1104
+ toolInput?: unknown;
1105
+ }[] | undefined;
1106
+ incompleteTools?: {
1107
+ toolCallId: string;
1108
+ toolName: string;
1109
+ toolInput?: unknown;
1110
+ }[] | undefined;
1111
+ toolErrors?: {
1112
+ error: string;
1113
+ toolCallId: string;
1114
+ toolName: string;
1115
+ }[] | undefined;
1116
+ }>, z.ZodObject<{
1117
+ type: z.ZodLiteral<"error">;
1118
+ requestId: z.ZodString;
1119
+ timestamp: z.ZodOptional<z.ZodNumber>;
1120
+ data: z.ZodObject<{
1121
+ message: z.ZodString;
1122
+ code: z.ZodOptional<z.ZodString>;
1123
+ }, "strip", z.ZodTypeAny, {
1124
+ message: string;
1125
+ code?: string | undefined;
1126
+ }, {
1127
+ message: string;
1128
+ code?: string | undefined;
1129
+ }>;
1130
+ }, "strip", z.ZodTypeAny, {
1131
+ type: "error";
1132
+ data: {
1133
+ message: string;
1134
+ code?: string | undefined;
1135
+ };
1136
+ requestId: string;
1137
+ timestamp?: number | undefined;
1138
+ }, {
1139
+ type: "error";
1140
+ data: {
1141
+ message: string;
1142
+ code?: string | undefined;
1143
+ };
1144
+ requestId: string;
1145
+ timestamp?: number | undefined;
1146
+ }>, z.ZodObject<{
1147
+ type: z.ZodLiteral<"stream_end">;
1148
+ requestId: z.ZodString;
1149
+ timestamp: z.ZodOptional<z.ZodNumber>;
1150
+ }, "strip", z.ZodTypeAny, {
1151
+ type: "stream_end";
1152
+ requestId: string;
1153
+ timestamp?: number | undefined;
1154
+ }, {
1155
+ type: "stream_end";
1156
+ requestId: string;
1157
+ timestamp?: number | undefined;
1158
+ }>]>;
1159
+ //# sourceMappingURL=telemetryEvents.d.ts.map