@illalabs/interfaces 0.10.5 → 0.10.6-canary-beta-59a26530

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.
@@ -0,0 +1,4376 @@
1
+ import { z } from "zod";
2
+ export declare const chatStreamVersionSchema: z.ZodLiteral<"v2">;
3
+ export declare const chatStreamRunIdSchema: z.ZodString;
4
+ export declare const chatStreamTurnIdSchema: z.ZodString;
5
+ export declare const chatStreamActionIdSchema: z.ZodString;
6
+ export declare const chatStreamToolCallIdSchema: z.ZodString;
7
+ export declare const chatStreamSimulationIdSchema: z.ZodString;
8
+ export declare const chatStreamSignatureRequestGroupIdSchema: z.ZodString;
9
+ export declare const chatStreamSequenceSchema: z.ZodNumber;
10
+ export declare const chatStreamTimestampSchema: z.ZodNumber;
11
+ export declare const chatStreamTurnKindSchema: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
12
+ export declare const chatToolLifecycleStateSchema: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
13
+ export declare const chatStreamTextVisiblePartSchema: z.ZodObject<{
14
+ type: z.ZodLiteral<"text">;
15
+ id: z.ZodString;
16
+ text: z.ZodString;
17
+ }, "strict", z.ZodTypeAny, {
18
+ text: string;
19
+ type: "text";
20
+ id: string;
21
+ }, {
22
+ text: string;
23
+ type: "text";
24
+ id: string;
25
+ }>;
26
+ export declare const chatStreamPendingApprovalCardVisiblePartSchema: z.ZodObject<{
27
+ type: z.ZodLiteral<"pending-approval-card">;
28
+ id: z.ZodString;
29
+ actionId: z.ZodString;
30
+ toolCallId: z.ZodString;
31
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
32
+ signatureRequestGroupId: z.ZodString;
33
+ label: z.ZodOptional<z.ZodString>;
34
+ description: z.ZodOptional<z.ZodString>;
35
+ }, "strict", z.ZodTypeAny, {
36
+ type: "pending-approval-card";
37
+ toolCallId: string;
38
+ id: string;
39
+ actionId: string;
40
+ state: "pending_user" | "pending_chain";
41
+ signatureRequestGroupId: string;
42
+ description?: string | undefined;
43
+ label?: string | undefined;
44
+ }, {
45
+ type: "pending-approval-card";
46
+ toolCallId: string;
47
+ id: string;
48
+ actionId: string;
49
+ state: "pending_user" | "pending_chain";
50
+ signatureRequestGroupId: string;
51
+ description?: string | undefined;
52
+ label?: string | undefined;
53
+ }>;
54
+ export declare const chatStreamToolStateCardVisiblePartSchema: z.ZodUnion<[z.ZodObject<{
55
+ type: z.ZodLiteral<"tool-state-card">;
56
+ id: z.ZodString;
57
+ actionId: z.ZodString;
58
+ toolCallId: z.ZodString;
59
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
60
+ signatureRequestGroupId: z.ZodString;
61
+ label: z.ZodOptional<z.ZodString>;
62
+ description: z.ZodOptional<z.ZodString>;
63
+ }, "strict", z.ZodTypeAny, {
64
+ type: "tool-state-card";
65
+ toolCallId: string;
66
+ id: string;
67
+ actionId: string;
68
+ state: "pending_user" | "pending_chain";
69
+ signatureRequestGroupId: string;
70
+ description?: string | undefined;
71
+ label?: string | undefined;
72
+ }, {
73
+ type: "tool-state-card";
74
+ toolCallId: string;
75
+ id: string;
76
+ actionId: string;
77
+ state: "pending_user" | "pending_chain";
78
+ signatureRequestGroupId: string;
79
+ description?: string | undefined;
80
+ label?: string | undefined;
81
+ }>, z.ZodObject<{
82
+ type: z.ZodLiteral<"tool-state-card">;
83
+ id: z.ZodString;
84
+ actionId: z.ZodString;
85
+ toolCallId: z.ZodString;
86
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
87
+ simulationId: z.ZodOptional<z.ZodString>;
88
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
89
+ label: z.ZodOptional<z.ZodString>;
90
+ description: z.ZodOptional<z.ZodString>;
91
+ }, "strict", z.ZodTypeAny, {
92
+ type: "tool-state-card";
93
+ toolCallId: string;
94
+ id: string;
95
+ actionId: string;
96
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
97
+ description?: string | undefined;
98
+ simulationId?: string | undefined;
99
+ signatureRequestGroupId?: string | undefined;
100
+ label?: string | undefined;
101
+ }, {
102
+ type: "tool-state-card";
103
+ toolCallId: string;
104
+ id: string;
105
+ actionId: string;
106
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
107
+ description?: string | undefined;
108
+ simulationId?: string | undefined;
109
+ signatureRequestGroupId?: string | undefined;
110
+ label?: string | undefined;
111
+ }>]>;
112
+ export declare const chatStreamVisiblePartSchema: z.ZodUnion<[z.ZodObject<{
113
+ type: z.ZodLiteral<"text">;
114
+ id: z.ZodString;
115
+ text: z.ZodString;
116
+ }, "strict", z.ZodTypeAny, {
117
+ text: string;
118
+ type: "text";
119
+ id: string;
120
+ }, {
121
+ text: string;
122
+ type: "text";
123
+ id: string;
124
+ }>, z.ZodObject<{
125
+ type: z.ZodLiteral<"pending-approval-card">;
126
+ id: z.ZodString;
127
+ actionId: z.ZodString;
128
+ toolCallId: z.ZodString;
129
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
130
+ signatureRequestGroupId: z.ZodString;
131
+ label: z.ZodOptional<z.ZodString>;
132
+ description: z.ZodOptional<z.ZodString>;
133
+ }, "strict", z.ZodTypeAny, {
134
+ type: "pending-approval-card";
135
+ toolCallId: string;
136
+ id: string;
137
+ actionId: string;
138
+ state: "pending_user" | "pending_chain";
139
+ signatureRequestGroupId: string;
140
+ description?: string | undefined;
141
+ label?: string | undefined;
142
+ }, {
143
+ type: "pending-approval-card";
144
+ toolCallId: string;
145
+ id: string;
146
+ actionId: string;
147
+ state: "pending_user" | "pending_chain";
148
+ signatureRequestGroupId: string;
149
+ description?: string | undefined;
150
+ label?: string | undefined;
151
+ }>, z.ZodUnion<[z.ZodObject<{
152
+ type: z.ZodLiteral<"tool-state-card">;
153
+ id: z.ZodString;
154
+ actionId: z.ZodString;
155
+ toolCallId: z.ZodString;
156
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
157
+ signatureRequestGroupId: z.ZodString;
158
+ label: z.ZodOptional<z.ZodString>;
159
+ description: z.ZodOptional<z.ZodString>;
160
+ }, "strict", z.ZodTypeAny, {
161
+ type: "tool-state-card";
162
+ toolCallId: string;
163
+ id: string;
164
+ actionId: string;
165
+ state: "pending_user" | "pending_chain";
166
+ signatureRequestGroupId: string;
167
+ description?: string | undefined;
168
+ label?: string | undefined;
169
+ }, {
170
+ type: "tool-state-card";
171
+ toolCallId: string;
172
+ id: string;
173
+ actionId: string;
174
+ state: "pending_user" | "pending_chain";
175
+ signatureRequestGroupId: string;
176
+ description?: string | undefined;
177
+ label?: string | undefined;
178
+ }>, z.ZodObject<{
179
+ type: z.ZodLiteral<"tool-state-card">;
180
+ id: z.ZodString;
181
+ actionId: z.ZodString;
182
+ toolCallId: z.ZodString;
183
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
184
+ simulationId: z.ZodOptional<z.ZodString>;
185
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
186
+ label: z.ZodOptional<z.ZodString>;
187
+ description: z.ZodOptional<z.ZodString>;
188
+ }, "strict", z.ZodTypeAny, {
189
+ type: "tool-state-card";
190
+ toolCallId: string;
191
+ id: string;
192
+ actionId: string;
193
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
194
+ description?: string | undefined;
195
+ simulationId?: string | undefined;
196
+ signatureRequestGroupId?: string | undefined;
197
+ label?: string | undefined;
198
+ }, {
199
+ type: "tool-state-card";
200
+ toolCallId: string;
201
+ id: string;
202
+ actionId: string;
203
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
204
+ description?: string | undefined;
205
+ simulationId?: string | undefined;
206
+ signatureRequestGroupId?: string | undefined;
207
+ label?: string | undefined;
208
+ }>]>]>;
209
+ export declare const chatStreamToolStateSchema: z.ZodUnion<[z.ZodObject<{
210
+ actionId: z.ZodString;
211
+ toolCallId: z.ZodString;
212
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
213
+ simulationId: z.ZodOptional<z.ZodString>;
214
+ signatureRequestGroupId: z.ZodString;
215
+ label: z.ZodOptional<z.ZodString>;
216
+ description: z.ZodOptional<z.ZodString>;
217
+ }, "strict", z.ZodTypeAny, {
218
+ toolCallId: string;
219
+ actionId: string;
220
+ state: "pending_user" | "pending_chain";
221
+ signatureRequestGroupId: string;
222
+ description?: string | undefined;
223
+ simulationId?: string | undefined;
224
+ label?: string | undefined;
225
+ }, {
226
+ toolCallId: string;
227
+ actionId: string;
228
+ state: "pending_user" | "pending_chain";
229
+ signatureRequestGroupId: string;
230
+ description?: string | undefined;
231
+ simulationId?: string | undefined;
232
+ label?: string | undefined;
233
+ }>, z.ZodObject<{
234
+ actionId: z.ZodString;
235
+ toolCallId: z.ZodString;
236
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
237
+ simulationId: z.ZodOptional<z.ZodString>;
238
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
239
+ label: z.ZodOptional<z.ZodString>;
240
+ description: z.ZodOptional<z.ZodString>;
241
+ }, "strict", z.ZodTypeAny, {
242
+ toolCallId: string;
243
+ actionId: string;
244
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
245
+ description?: string | undefined;
246
+ simulationId?: string | undefined;
247
+ signatureRequestGroupId?: string | undefined;
248
+ label?: string | undefined;
249
+ }, {
250
+ toolCallId: string;
251
+ actionId: string;
252
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
253
+ description?: string | undefined;
254
+ simulationId?: string | undefined;
255
+ signatureRequestGroupId?: string | undefined;
256
+ label?: string | undefined;
257
+ }>]>;
258
+ export declare const chatStreamTurnSnapshotSchema: z.ZodEffects<z.ZodObject<{
259
+ version: z.ZodLiteral<"v2">;
260
+ runId: z.ZodString;
261
+ turnId: z.ZodString;
262
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
263
+ summary: z.ZodOptional<z.ZodString>;
264
+ visibleParts: z.ZodArray<z.ZodUnion<[z.ZodObject<{
265
+ type: z.ZodLiteral<"text">;
266
+ id: z.ZodString;
267
+ text: z.ZodString;
268
+ }, "strict", z.ZodTypeAny, {
269
+ text: string;
270
+ type: "text";
271
+ id: string;
272
+ }, {
273
+ text: string;
274
+ type: "text";
275
+ id: string;
276
+ }>, z.ZodObject<{
277
+ type: z.ZodLiteral<"pending-approval-card">;
278
+ id: z.ZodString;
279
+ actionId: z.ZodString;
280
+ toolCallId: z.ZodString;
281
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
282
+ signatureRequestGroupId: z.ZodString;
283
+ label: z.ZodOptional<z.ZodString>;
284
+ description: z.ZodOptional<z.ZodString>;
285
+ }, "strict", z.ZodTypeAny, {
286
+ type: "pending-approval-card";
287
+ toolCallId: string;
288
+ id: string;
289
+ actionId: string;
290
+ state: "pending_user" | "pending_chain";
291
+ signatureRequestGroupId: string;
292
+ description?: string | undefined;
293
+ label?: string | undefined;
294
+ }, {
295
+ type: "pending-approval-card";
296
+ toolCallId: string;
297
+ id: string;
298
+ actionId: string;
299
+ state: "pending_user" | "pending_chain";
300
+ signatureRequestGroupId: string;
301
+ description?: string | undefined;
302
+ label?: string | undefined;
303
+ }>, z.ZodUnion<[z.ZodObject<{
304
+ type: z.ZodLiteral<"tool-state-card">;
305
+ id: z.ZodString;
306
+ actionId: z.ZodString;
307
+ toolCallId: z.ZodString;
308
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
309
+ signatureRequestGroupId: z.ZodString;
310
+ label: z.ZodOptional<z.ZodString>;
311
+ description: z.ZodOptional<z.ZodString>;
312
+ }, "strict", z.ZodTypeAny, {
313
+ type: "tool-state-card";
314
+ toolCallId: string;
315
+ id: string;
316
+ actionId: string;
317
+ state: "pending_user" | "pending_chain";
318
+ signatureRequestGroupId: string;
319
+ description?: string | undefined;
320
+ label?: string | undefined;
321
+ }, {
322
+ type: "tool-state-card";
323
+ toolCallId: string;
324
+ id: string;
325
+ actionId: string;
326
+ state: "pending_user" | "pending_chain";
327
+ signatureRequestGroupId: string;
328
+ description?: string | undefined;
329
+ label?: string | undefined;
330
+ }>, z.ZodObject<{
331
+ type: z.ZodLiteral<"tool-state-card">;
332
+ id: z.ZodString;
333
+ actionId: z.ZodString;
334
+ toolCallId: z.ZodString;
335
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
336
+ simulationId: z.ZodOptional<z.ZodString>;
337
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
338
+ label: z.ZodOptional<z.ZodString>;
339
+ description: z.ZodOptional<z.ZodString>;
340
+ }, "strict", z.ZodTypeAny, {
341
+ type: "tool-state-card";
342
+ toolCallId: string;
343
+ id: string;
344
+ actionId: string;
345
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
346
+ description?: string | undefined;
347
+ simulationId?: string | undefined;
348
+ signatureRequestGroupId?: string | undefined;
349
+ label?: string | undefined;
350
+ }, {
351
+ type: "tool-state-card";
352
+ toolCallId: string;
353
+ id: string;
354
+ actionId: string;
355
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
356
+ description?: string | undefined;
357
+ simulationId?: string | undefined;
358
+ signatureRequestGroupId?: string | undefined;
359
+ label?: string | undefined;
360
+ }>]>]>, "many">;
361
+ toolStates: z.ZodArray<z.ZodUnion<[z.ZodObject<{
362
+ actionId: z.ZodString;
363
+ toolCallId: z.ZodString;
364
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
365
+ simulationId: z.ZodOptional<z.ZodString>;
366
+ signatureRequestGroupId: z.ZodString;
367
+ label: z.ZodOptional<z.ZodString>;
368
+ description: z.ZodOptional<z.ZodString>;
369
+ }, "strict", z.ZodTypeAny, {
370
+ toolCallId: string;
371
+ actionId: string;
372
+ state: "pending_user" | "pending_chain";
373
+ signatureRequestGroupId: string;
374
+ description?: string | undefined;
375
+ simulationId?: string | undefined;
376
+ label?: string | undefined;
377
+ }, {
378
+ toolCallId: string;
379
+ actionId: string;
380
+ state: "pending_user" | "pending_chain";
381
+ signatureRequestGroupId: string;
382
+ description?: string | undefined;
383
+ simulationId?: string | undefined;
384
+ label?: string | undefined;
385
+ }>, z.ZodObject<{
386
+ actionId: z.ZodString;
387
+ toolCallId: z.ZodString;
388
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
389
+ simulationId: z.ZodOptional<z.ZodString>;
390
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
391
+ label: z.ZodOptional<z.ZodString>;
392
+ description: z.ZodOptional<z.ZodString>;
393
+ }, "strict", z.ZodTypeAny, {
394
+ toolCallId: string;
395
+ actionId: string;
396
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
397
+ description?: string | undefined;
398
+ simulationId?: string | undefined;
399
+ signatureRequestGroupId?: string | undefined;
400
+ label?: string | undefined;
401
+ }, {
402
+ toolCallId: string;
403
+ actionId: string;
404
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
405
+ description?: string | undefined;
406
+ simulationId?: string | undefined;
407
+ signatureRequestGroupId?: string | undefined;
408
+ label?: string | undefined;
409
+ }>]>, "many">;
410
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
411
+ }, "strict", z.ZodTypeAny, {
412
+ metadata: Record<string, unknown>;
413
+ version: "v2";
414
+ runId: string;
415
+ turnId: string;
416
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
417
+ visibleParts: ({
418
+ text: string;
419
+ type: "text";
420
+ id: string;
421
+ } | {
422
+ type: "pending-approval-card";
423
+ toolCallId: string;
424
+ id: string;
425
+ actionId: string;
426
+ state: "pending_user" | "pending_chain";
427
+ signatureRequestGroupId: string;
428
+ description?: string | undefined;
429
+ label?: string | undefined;
430
+ } | {
431
+ type: "tool-state-card";
432
+ toolCallId: string;
433
+ id: string;
434
+ actionId: string;
435
+ state: "pending_user" | "pending_chain";
436
+ signatureRequestGroupId: string;
437
+ description?: string | undefined;
438
+ label?: string | undefined;
439
+ } | {
440
+ type: "tool-state-card";
441
+ toolCallId: string;
442
+ id: string;
443
+ actionId: string;
444
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
445
+ description?: string | undefined;
446
+ simulationId?: string | undefined;
447
+ signatureRequestGroupId?: string | undefined;
448
+ label?: string | undefined;
449
+ })[];
450
+ toolStates: ({
451
+ toolCallId: string;
452
+ actionId: string;
453
+ state: "pending_user" | "pending_chain";
454
+ signatureRequestGroupId: string;
455
+ description?: string | undefined;
456
+ simulationId?: string | undefined;
457
+ label?: string | undefined;
458
+ } | {
459
+ toolCallId: string;
460
+ actionId: string;
461
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
462
+ description?: string | undefined;
463
+ simulationId?: string | undefined;
464
+ signatureRequestGroupId?: string | undefined;
465
+ label?: string | undefined;
466
+ })[];
467
+ summary?: string | undefined;
468
+ }, {
469
+ metadata: Record<string, unknown>;
470
+ version: "v2";
471
+ runId: string;
472
+ turnId: string;
473
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
474
+ visibleParts: ({
475
+ text: string;
476
+ type: "text";
477
+ id: string;
478
+ } | {
479
+ type: "pending-approval-card";
480
+ toolCallId: string;
481
+ id: string;
482
+ actionId: string;
483
+ state: "pending_user" | "pending_chain";
484
+ signatureRequestGroupId: string;
485
+ description?: string | undefined;
486
+ label?: string | undefined;
487
+ } | {
488
+ type: "tool-state-card";
489
+ toolCallId: string;
490
+ id: string;
491
+ actionId: string;
492
+ state: "pending_user" | "pending_chain";
493
+ signatureRequestGroupId: string;
494
+ description?: string | undefined;
495
+ label?: string | undefined;
496
+ } | {
497
+ type: "tool-state-card";
498
+ toolCallId: string;
499
+ id: string;
500
+ actionId: string;
501
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
502
+ description?: string | undefined;
503
+ simulationId?: string | undefined;
504
+ signatureRequestGroupId?: string | undefined;
505
+ label?: string | undefined;
506
+ })[];
507
+ toolStates: ({
508
+ toolCallId: string;
509
+ actionId: string;
510
+ state: "pending_user" | "pending_chain";
511
+ signatureRequestGroupId: string;
512
+ description?: string | undefined;
513
+ simulationId?: string | undefined;
514
+ label?: string | undefined;
515
+ } | {
516
+ toolCallId: string;
517
+ actionId: string;
518
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
519
+ description?: string | undefined;
520
+ simulationId?: string | undefined;
521
+ signatureRequestGroupId?: string | undefined;
522
+ label?: string | undefined;
523
+ })[];
524
+ summary?: string | undefined;
525
+ }>, {
526
+ metadata: Record<string, unknown>;
527
+ version: "v2";
528
+ runId: string;
529
+ turnId: string;
530
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
531
+ visibleParts: ({
532
+ text: string;
533
+ type: "text";
534
+ id: string;
535
+ } | {
536
+ type: "pending-approval-card";
537
+ toolCallId: string;
538
+ id: string;
539
+ actionId: string;
540
+ state: "pending_user" | "pending_chain";
541
+ signatureRequestGroupId: string;
542
+ description?: string | undefined;
543
+ label?: string | undefined;
544
+ } | {
545
+ type: "tool-state-card";
546
+ toolCallId: string;
547
+ id: string;
548
+ actionId: string;
549
+ state: "pending_user" | "pending_chain";
550
+ signatureRequestGroupId: string;
551
+ description?: string | undefined;
552
+ label?: string | undefined;
553
+ } | {
554
+ type: "tool-state-card";
555
+ toolCallId: string;
556
+ id: string;
557
+ actionId: string;
558
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
559
+ description?: string | undefined;
560
+ simulationId?: string | undefined;
561
+ signatureRequestGroupId?: string | undefined;
562
+ label?: string | undefined;
563
+ })[];
564
+ toolStates: ({
565
+ toolCallId: string;
566
+ actionId: string;
567
+ state: "pending_user" | "pending_chain";
568
+ signatureRequestGroupId: string;
569
+ description?: string | undefined;
570
+ simulationId?: string | undefined;
571
+ label?: string | undefined;
572
+ } | {
573
+ toolCallId: string;
574
+ actionId: string;
575
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
576
+ description?: string | undefined;
577
+ simulationId?: string | undefined;
578
+ signatureRequestGroupId?: string | undefined;
579
+ label?: string | undefined;
580
+ })[];
581
+ summary?: string | undefined;
582
+ }, {
583
+ metadata: Record<string, unknown>;
584
+ version: "v2";
585
+ runId: string;
586
+ turnId: string;
587
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
588
+ visibleParts: ({
589
+ text: string;
590
+ type: "text";
591
+ id: string;
592
+ } | {
593
+ type: "pending-approval-card";
594
+ toolCallId: string;
595
+ id: string;
596
+ actionId: string;
597
+ state: "pending_user" | "pending_chain";
598
+ signatureRequestGroupId: string;
599
+ description?: string | undefined;
600
+ label?: string | undefined;
601
+ } | {
602
+ type: "tool-state-card";
603
+ toolCallId: string;
604
+ id: string;
605
+ actionId: string;
606
+ state: "pending_user" | "pending_chain";
607
+ signatureRequestGroupId: string;
608
+ description?: string | undefined;
609
+ label?: string | undefined;
610
+ } | {
611
+ type: "tool-state-card";
612
+ toolCallId: string;
613
+ id: string;
614
+ actionId: string;
615
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
616
+ description?: string | undefined;
617
+ simulationId?: string | undefined;
618
+ signatureRequestGroupId?: string | undefined;
619
+ label?: string | undefined;
620
+ })[];
621
+ toolStates: ({
622
+ toolCallId: string;
623
+ actionId: string;
624
+ state: "pending_user" | "pending_chain";
625
+ signatureRequestGroupId: string;
626
+ description?: string | undefined;
627
+ simulationId?: string | undefined;
628
+ label?: string | undefined;
629
+ } | {
630
+ toolCallId: string;
631
+ actionId: string;
632
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
633
+ description?: string | undefined;
634
+ simulationId?: string | undefined;
635
+ signatureRequestGroupId?: string | undefined;
636
+ label?: string | undefined;
637
+ })[];
638
+ summary?: string | undefined;
639
+ }>;
640
+ export declare const chatStreamTurnStartEventSchema: z.ZodObject<{
641
+ version: z.ZodLiteral<"v2">;
642
+ runId: z.ZodString;
643
+ turnId: z.ZodString;
644
+ sequence: z.ZodNumber;
645
+ targetId: z.ZodString;
646
+ timestamp: z.ZodNumber;
647
+ } & {
648
+ eventType: z.ZodLiteral<"turn-start">;
649
+ durable: z.ZodLiteral<false>;
650
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
651
+ }, "strict", z.ZodTypeAny, {
652
+ version: "v2";
653
+ timestamp: number;
654
+ runId: string;
655
+ turnId: string;
656
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
657
+ sequence: number;
658
+ targetId: string;
659
+ durable: false;
660
+ eventType: "turn-start";
661
+ }, {
662
+ version: "v2";
663
+ timestamp: number;
664
+ runId: string;
665
+ turnId: string;
666
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
667
+ sequence: number;
668
+ targetId: string;
669
+ durable: false;
670
+ eventType: "turn-start";
671
+ }>;
672
+ export declare const chatStreamTranscriptTextStartEventSchema: z.ZodObject<{
673
+ version: z.ZodLiteral<"v2">;
674
+ runId: z.ZodString;
675
+ turnId: z.ZodString;
676
+ sequence: z.ZodNumber;
677
+ targetId: z.ZodString;
678
+ timestamp: z.ZodNumber;
679
+ } & {
680
+ eventType: z.ZodLiteral<"transcript-text-start">;
681
+ durable: z.ZodLiteral<false>;
682
+ }, "strict", z.ZodTypeAny, {
683
+ version: "v2";
684
+ timestamp: number;
685
+ runId: string;
686
+ turnId: string;
687
+ sequence: number;
688
+ targetId: string;
689
+ durable: false;
690
+ eventType: "transcript-text-start";
691
+ }, {
692
+ version: "v2";
693
+ timestamp: number;
694
+ runId: string;
695
+ turnId: string;
696
+ sequence: number;
697
+ targetId: string;
698
+ durable: false;
699
+ eventType: "transcript-text-start";
700
+ }>;
701
+ export declare const chatStreamTranscriptTextDeltaEventSchema: z.ZodObject<{
702
+ version: z.ZodLiteral<"v2">;
703
+ runId: z.ZodString;
704
+ turnId: z.ZodString;
705
+ sequence: z.ZodNumber;
706
+ targetId: z.ZodString;
707
+ timestamp: z.ZodNumber;
708
+ } & {
709
+ eventType: z.ZodLiteral<"transcript-text-delta">;
710
+ durable: z.ZodLiteral<false>;
711
+ delta: z.ZodString;
712
+ }, "strict", z.ZodTypeAny, {
713
+ version: "v2";
714
+ timestamp: number;
715
+ delta: string;
716
+ runId: string;
717
+ turnId: string;
718
+ sequence: number;
719
+ targetId: string;
720
+ durable: false;
721
+ eventType: "transcript-text-delta";
722
+ }, {
723
+ version: "v2";
724
+ timestamp: number;
725
+ delta: string;
726
+ runId: string;
727
+ turnId: string;
728
+ sequence: number;
729
+ targetId: string;
730
+ durable: false;
731
+ eventType: "transcript-text-delta";
732
+ }>;
733
+ export declare const chatStreamTranscriptTextEndEventSchema: z.ZodObject<{
734
+ version: z.ZodLiteral<"v2">;
735
+ runId: z.ZodString;
736
+ turnId: z.ZodString;
737
+ sequence: z.ZodNumber;
738
+ targetId: z.ZodString;
739
+ timestamp: z.ZodNumber;
740
+ } & {
741
+ eventType: z.ZodLiteral<"transcript-text-end">;
742
+ durable: z.ZodLiteral<false>;
743
+ }, "strict", z.ZodTypeAny, {
744
+ version: "v2";
745
+ timestamp: number;
746
+ runId: string;
747
+ turnId: string;
748
+ sequence: number;
749
+ targetId: string;
750
+ durable: false;
751
+ eventType: "transcript-text-end";
752
+ }, {
753
+ version: "v2";
754
+ timestamp: number;
755
+ runId: string;
756
+ turnId: string;
757
+ sequence: number;
758
+ targetId: string;
759
+ durable: false;
760
+ eventType: "transcript-text-end";
761
+ }>;
762
+ export declare const chatStreamProgressUpdateEventSchema: z.ZodObject<{
763
+ version: z.ZodLiteral<"v2">;
764
+ runId: z.ZodString;
765
+ turnId: z.ZodString;
766
+ sequence: z.ZodNumber;
767
+ targetId: z.ZodString;
768
+ timestamp: z.ZodNumber;
769
+ } & {
770
+ eventType: z.ZodLiteral<"progress-update">;
771
+ durable: z.ZodLiteral<false>;
772
+ message: z.ZodString;
773
+ label: z.ZodOptional<z.ZodString>;
774
+ }, "strict", z.ZodTypeAny, {
775
+ message: string;
776
+ version: "v2";
777
+ timestamp: number;
778
+ runId: string;
779
+ turnId: string;
780
+ sequence: number;
781
+ targetId: string;
782
+ durable: false;
783
+ eventType: "progress-update";
784
+ label?: string | undefined;
785
+ }, {
786
+ message: string;
787
+ version: "v2";
788
+ timestamp: number;
789
+ runId: string;
790
+ turnId: string;
791
+ sequence: number;
792
+ targetId: string;
793
+ durable: false;
794
+ eventType: "progress-update";
795
+ label?: string | undefined;
796
+ }>;
797
+ export declare const chatStreamToolStateEventSchema: z.ZodObject<{
798
+ version: z.ZodLiteral<"v2">;
799
+ runId: z.ZodString;
800
+ turnId: z.ZodString;
801
+ sequence: z.ZodNumber;
802
+ targetId: z.ZodString;
803
+ timestamp: z.ZodNumber;
804
+ } & {
805
+ eventType: z.ZodLiteral<"tool-state">;
806
+ durable: z.ZodLiteral<true>;
807
+ actionId: z.ZodString;
808
+ toolCallId: z.ZodString;
809
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
810
+ simulationId: z.ZodOptional<z.ZodString>;
811
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
812
+ label: z.ZodOptional<z.ZodString>;
813
+ description: z.ZodOptional<z.ZodString>;
814
+ }, "strict", z.ZodTypeAny, {
815
+ toolCallId: string;
816
+ version: "v2";
817
+ timestamp: number;
818
+ actionId: string;
819
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
820
+ runId: string;
821
+ turnId: string;
822
+ sequence: number;
823
+ targetId: string;
824
+ durable: true;
825
+ eventType: "tool-state";
826
+ description?: string | undefined;
827
+ simulationId?: string | undefined;
828
+ signatureRequestGroupId?: string | undefined;
829
+ label?: string | undefined;
830
+ }, {
831
+ toolCallId: string;
832
+ version: "v2";
833
+ timestamp: number;
834
+ actionId: string;
835
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
836
+ runId: string;
837
+ turnId: string;
838
+ sequence: number;
839
+ targetId: string;
840
+ durable: true;
841
+ eventType: "tool-state";
842
+ description?: string | undefined;
843
+ simulationId?: string | undefined;
844
+ signatureRequestGroupId?: string | undefined;
845
+ label?: string | undefined;
846
+ }>;
847
+ export declare const chatStreamSimulationStateSchema: z.ZodUnion<[z.ZodObject<{
848
+ version: z.ZodLiteral<"v2">;
849
+ runId: z.ZodString;
850
+ turnId: z.ZodString;
851
+ sequence: z.ZodNumber;
852
+ targetId: z.ZodString;
853
+ timestamp: z.ZodNumber;
854
+ } & {
855
+ eventType: z.ZodLiteral<"simulation-state">;
856
+ durable: z.ZodLiteral<false>;
857
+ actionId: z.ZodString;
858
+ simulationId: z.ZodString;
859
+ toolCallId: z.ZodOptional<z.ZodString>;
860
+ state: z.ZodEnum<["pending", "superseded"]>;
861
+ summary: z.ZodOptional<z.ZodString>;
862
+ error: z.ZodOptional<z.ZodString>;
863
+ }, "strict", z.ZodTypeAny, {
864
+ simulationId: string;
865
+ version: "v2";
866
+ timestamp: number;
867
+ actionId: string;
868
+ state: "pending" | "superseded";
869
+ runId: string;
870
+ turnId: string;
871
+ sequence: number;
872
+ targetId: string;
873
+ durable: false;
874
+ eventType: "simulation-state";
875
+ error?: string | undefined;
876
+ toolCallId?: string | undefined;
877
+ summary?: string | undefined;
878
+ }, {
879
+ simulationId: string;
880
+ version: "v2";
881
+ timestamp: number;
882
+ actionId: string;
883
+ state: "pending" | "superseded";
884
+ runId: string;
885
+ turnId: string;
886
+ sequence: number;
887
+ targetId: string;
888
+ durable: false;
889
+ eventType: "simulation-state";
890
+ error?: string | undefined;
891
+ toolCallId?: string | undefined;
892
+ summary?: string | undefined;
893
+ }>, z.ZodObject<{
894
+ version: z.ZodLiteral<"v2">;
895
+ runId: z.ZodString;
896
+ turnId: z.ZodString;
897
+ sequence: z.ZodNumber;
898
+ targetId: z.ZodString;
899
+ timestamp: z.ZodNumber;
900
+ } & {
901
+ eventType: z.ZodLiteral<"simulation-state">;
902
+ durable: z.ZodBoolean;
903
+ actionId: z.ZodString;
904
+ simulationId: z.ZodString;
905
+ toolCallId: z.ZodOptional<z.ZodString>;
906
+ state: z.ZodEnum<["complete", "failed"]>;
907
+ summary: z.ZodOptional<z.ZodString>;
908
+ error: z.ZodOptional<z.ZodString>;
909
+ }, "strict", z.ZodTypeAny, {
910
+ simulationId: string;
911
+ version: "v2";
912
+ timestamp: number;
913
+ actionId: string;
914
+ state: "failed" | "complete";
915
+ runId: string;
916
+ turnId: string;
917
+ sequence: number;
918
+ targetId: string;
919
+ durable: boolean;
920
+ eventType: "simulation-state";
921
+ error?: string | undefined;
922
+ toolCallId?: string | undefined;
923
+ summary?: string | undefined;
924
+ }, {
925
+ simulationId: string;
926
+ version: "v2";
927
+ timestamp: number;
928
+ actionId: string;
929
+ state: "failed" | "complete";
930
+ runId: string;
931
+ turnId: string;
932
+ sequence: number;
933
+ targetId: string;
934
+ durable: boolean;
935
+ eventType: "simulation-state";
936
+ error?: string | undefined;
937
+ toolCallId?: string | undefined;
938
+ summary?: string | undefined;
939
+ }>]>;
940
+ export declare const chatStreamSignatureStateSchema: z.ZodObject<{
941
+ version: z.ZodLiteral<"v2">;
942
+ runId: z.ZodString;
943
+ turnId: z.ZodString;
944
+ sequence: z.ZodNumber;
945
+ targetId: z.ZodString;
946
+ timestamp: z.ZodNumber;
947
+ } & {
948
+ eventType: z.ZodLiteral<"signature-state">;
949
+ durable: z.ZodLiteral<true>;
950
+ actionId: z.ZodString;
951
+ toolCallId: z.ZodString;
952
+ signatureRequestGroupId: z.ZodString;
953
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
954
+ label: z.ZodOptional<z.ZodString>;
955
+ description: z.ZodOptional<z.ZodString>;
956
+ }, "strict", z.ZodTypeAny, {
957
+ toolCallId: string;
958
+ version: "v2";
959
+ timestamp: number;
960
+ actionId: string;
961
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
962
+ signatureRequestGroupId: string;
963
+ runId: string;
964
+ turnId: string;
965
+ sequence: number;
966
+ targetId: string;
967
+ durable: true;
968
+ eventType: "signature-state";
969
+ description?: string | undefined;
970
+ label?: string | undefined;
971
+ }, {
972
+ toolCallId: string;
973
+ version: "v2";
974
+ timestamp: number;
975
+ actionId: string;
976
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
977
+ signatureRequestGroupId: string;
978
+ runId: string;
979
+ turnId: string;
980
+ sequence: number;
981
+ targetId: string;
982
+ durable: true;
983
+ eventType: "signature-state";
984
+ description?: string | undefined;
985
+ label?: string | undefined;
986
+ }>;
987
+ export declare const chatStreamTurnSummaryEventSchema: z.ZodObject<{
988
+ version: z.ZodLiteral<"v2">;
989
+ runId: z.ZodString;
990
+ turnId: z.ZodString;
991
+ sequence: z.ZodNumber;
992
+ targetId: z.ZodString;
993
+ timestamp: z.ZodNumber;
994
+ } & {
995
+ eventType: z.ZodLiteral<"turn-summary">;
996
+ durable: z.ZodLiteral<true>;
997
+ summary: z.ZodString;
998
+ }, "strict", z.ZodTypeAny, {
999
+ version: "v2";
1000
+ timestamp: number;
1001
+ runId: string;
1002
+ turnId: string;
1003
+ summary: string;
1004
+ sequence: number;
1005
+ targetId: string;
1006
+ durable: true;
1007
+ eventType: "turn-summary";
1008
+ }, {
1009
+ version: "v2";
1010
+ timestamp: number;
1011
+ runId: string;
1012
+ turnId: string;
1013
+ summary: string;
1014
+ sequence: number;
1015
+ targetId: string;
1016
+ durable: true;
1017
+ eventType: "turn-summary";
1018
+ }>;
1019
+ export declare const chatStreamTurnCompleteEventSchema: z.ZodEffects<z.ZodObject<{
1020
+ version: z.ZodLiteral<"v2">;
1021
+ runId: z.ZodString;
1022
+ turnId: z.ZodString;
1023
+ sequence: z.ZodNumber;
1024
+ targetId: z.ZodString;
1025
+ timestamp: z.ZodNumber;
1026
+ } & {
1027
+ eventType: z.ZodLiteral<"turn-complete">;
1028
+ durable: z.ZodLiteral<true>;
1029
+ snapshot: z.ZodEffects<z.ZodObject<{
1030
+ version: z.ZodLiteral<"v2">;
1031
+ runId: z.ZodString;
1032
+ turnId: z.ZodString;
1033
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
1034
+ summary: z.ZodOptional<z.ZodString>;
1035
+ visibleParts: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1036
+ type: z.ZodLiteral<"text">;
1037
+ id: z.ZodString;
1038
+ text: z.ZodString;
1039
+ }, "strict", z.ZodTypeAny, {
1040
+ text: string;
1041
+ type: "text";
1042
+ id: string;
1043
+ }, {
1044
+ text: string;
1045
+ type: "text";
1046
+ id: string;
1047
+ }>, z.ZodObject<{
1048
+ type: z.ZodLiteral<"pending-approval-card">;
1049
+ id: z.ZodString;
1050
+ actionId: z.ZodString;
1051
+ toolCallId: z.ZodString;
1052
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
1053
+ signatureRequestGroupId: z.ZodString;
1054
+ label: z.ZodOptional<z.ZodString>;
1055
+ description: z.ZodOptional<z.ZodString>;
1056
+ }, "strict", z.ZodTypeAny, {
1057
+ type: "pending-approval-card";
1058
+ toolCallId: string;
1059
+ id: string;
1060
+ actionId: string;
1061
+ state: "pending_user" | "pending_chain";
1062
+ signatureRequestGroupId: string;
1063
+ description?: string | undefined;
1064
+ label?: string | undefined;
1065
+ }, {
1066
+ type: "pending-approval-card";
1067
+ toolCallId: string;
1068
+ id: string;
1069
+ actionId: string;
1070
+ state: "pending_user" | "pending_chain";
1071
+ signatureRequestGroupId: string;
1072
+ description?: string | undefined;
1073
+ label?: string | undefined;
1074
+ }>, z.ZodUnion<[z.ZodObject<{
1075
+ type: z.ZodLiteral<"tool-state-card">;
1076
+ id: z.ZodString;
1077
+ actionId: z.ZodString;
1078
+ toolCallId: z.ZodString;
1079
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
1080
+ signatureRequestGroupId: z.ZodString;
1081
+ label: z.ZodOptional<z.ZodString>;
1082
+ description: z.ZodOptional<z.ZodString>;
1083
+ }, "strict", z.ZodTypeAny, {
1084
+ type: "tool-state-card";
1085
+ toolCallId: string;
1086
+ id: string;
1087
+ actionId: string;
1088
+ state: "pending_user" | "pending_chain";
1089
+ signatureRequestGroupId: string;
1090
+ description?: string | undefined;
1091
+ label?: string | undefined;
1092
+ }, {
1093
+ type: "tool-state-card";
1094
+ toolCallId: string;
1095
+ id: string;
1096
+ actionId: string;
1097
+ state: "pending_user" | "pending_chain";
1098
+ signatureRequestGroupId: string;
1099
+ description?: string | undefined;
1100
+ label?: string | undefined;
1101
+ }>, z.ZodObject<{
1102
+ type: z.ZodLiteral<"tool-state-card">;
1103
+ id: z.ZodString;
1104
+ actionId: z.ZodString;
1105
+ toolCallId: z.ZodString;
1106
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
1107
+ simulationId: z.ZodOptional<z.ZodString>;
1108
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
1109
+ label: z.ZodOptional<z.ZodString>;
1110
+ description: z.ZodOptional<z.ZodString>;
1111
+ }, "strict", z.ZodTypeAny, {
1112
+ type: "tool-state-card";
1113
+ toolCallId: string;
1114
+ id: string;
1115
+ actionId: string;
1116
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1117
+ description?: string | undefined;
1118
+ simulationId?: string | undefined;
1119
+ signatureRequestGroupId?: string | undefined;
1120
+ label?: string | undefined;
1121
+ }, {
1122
+ type: "tool-state-card";
1123
+ toolCallId: string;
1124
+ id: string;
1125
+ actionId: string;
1126
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1127
+ description?: string | undefined;
1128
+ simulationId?: string | undefined;
1129
+ signatureRequestGroupId?: string | undefined;
1130
+ label?: string | undefined;
1131
+ }>]>]>, "many">;
1132
+ toolStates: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1133
+ actionId: z.ZodString;
1134
+ toolCallId: z.ZodString;
1135
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
1136
+ simulationId: z.ZodOptional<z.ZodString>;
1137
+ signatureRequestGroupId: z.ZodString;
1138
+ label: z.ZodOptional<z.ZodString>;
1139
+ description: z.ZodOptional<z.ZodString>;
1140
+ }, "strict", z.ZodTypeAny, {
1141
+ toolCallId: string;
1142
+ actionId: string;
1143
+ state: "pending_user" | "pending_chain";
1144
+ signatureRequestGroupId: string;
1145
+ description?: string | undefined;
1146
+ simulationId?: string | undefined;
1147
+ label?: string | undefined;
1148
+ }, {
1149
+ toolCallId: string;
1150
+ actionId: string;
1151
+ state: "pending_user" | "pending_chain";
1152
+ signatureRequestGroupId: string;
1153
+ description?: string | undefined;
1154
+ simulationId?: string | undefined;
1155
+ label?: string | undefined;
1156
+ }>, z.ZodObject<{
1157
+ actionId: z.ZodString;
1158
+ toolCallId: z.ZodString;
1159
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
1160
+ simulationId: z.ZodOptional<z.ZodString>;
1161
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
1162
+ label: z.ZodOptional<z.ZodString>;
1163
+ description: z.ZodOptional<z.ZodString>;
1164
+ }, "strict", z.ZodTypeAny, {
1165
+ toolCallId: string;
1166
+ actionId: string;
1167
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1168
+ description?: string | undefined;
1169
+ simulationId?: string | undefined;
1170
+ signatureRequestGroupId?: string | undefined;
1171
+ label?: string | undefined;
1172
+ }, {
1173
+ toolCallId: string;
1174
+ actionId: string;
1175
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1176
+ description?: string | undefined;
1177
+ simulationId?: string | undefined;
1178
+ signatureRequestGroupId?: string | undefined;
1179
+ label?: string | undefined;
1180
+ }>]>, "many">;
1181
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1182
+ }, "strict", z.ZodTypeAny, {
1183
+ metadata: Record<string, unknown>;
1184
+ version: "v2";
1185
+ runId: string;
1186
+ turnId: string;
1187
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1188
+ visibleParts: ({
1189
+ text: string;
1190
+ type: "text";
1191
+ id: string;
1192
+ } | {
1193
+ type: "pending-approval-card";
1194
+ toolCallId: string;
1195
+ id: string;
1196
+ actionId: string;
1197
+ state: "pending_user" | "pending_chain";
1198
+ signatureRequestGroupId: string;
1199
+ description?: string | undefined;
1200
+ label?: string | undefined;
1201
+ } | {
1202
+ type: "tool-state-card";
1203
+ toolCallId: string;
1204
+ id: string;
1205
+ actionId: string;
1206
+ state: "pending_user" | "pending_chain";
1207
+ signatureRequestGroupId: string;
1208
+ description?: string | undefined;
1209
+ label?: string | undefined;
1210
+ } | {
1211
+ type: "tool-state-card";
1212
+ toolCallId: string;
1213
+ id: string;
1214
+ actionId: string;
1215
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1216
+ description?: string | undefined;
1217
+ simulationId?: string | undefined;
1218
+ signatureRequestGroupId?: string | undefined;
1219
+ label?: string | undefined;
1220
+ })[];
1221
+ toolStates: ({
1222
+ toolCallId: string;
1223
+ actionId: string;
1224
+ state: "pending_user" | "pending_chain";
1225
+ signatureRequestGroupId: string;
1226
+ description?: string | undefined;
1227
+ simulationId?: string | undefined;
1228
+ label?: string | undefined;
1229
+ } | {
1230
+ toolCallId: string;
1231
+ actionId: string;
1232
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1233
+ description?: string | undefined;
1234
+ simulationId?: string | undefined;
1235
+ signatureRequestGroupId?: string | undefined;
1236
+ label?: string | undefined;
1237
+ })[];
1238
+ summary?: string | undefined;
1239
+ }, {
1240
+ metadata: Record<string, unknown>;
1241
+ version: "v2";
1242
+ runId: string;
1243
+ turnId: string;
1244
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1245
+ visibleParts: ({
1246
+ text: string;
1247
+ type: "text";
1248
+ id: string;
1249
+ } | {
1250
+ type: "pending-approval-card";
1251
+ toolCallId: string;
1252
+ id: string;
1253
+ actionId: string;
1254
+ state: "pending_user" | "pending_chain";
1255
+ signatureRequestGroupId: string;
1256
+ description?: string | undefined;
1257
+ label?: string | undefined;
1258
+ } | {
1259
+ type: "tool-state-card";
1260
+ toolCallId: string;
1261
+ id: string;
1262
+ actionId: string;
1263
+ state: "pending_user" | "pending_chain";
1264
+ signatureRequestGroupId: string;
1265
+ description?: string | undefined;
1266
+ label?: string | undefined;
1267
+ } | {
1268
+ type: "tool-state-card";
1269
+ toolCallId: string;
1270
+ id: string;
1271
+ actionId: string;
1272
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1273
+ description?: string | undefined;
1274
+ simulationId?: string | undefined;
1275
+ signatureRequestGroupId?: string | undefined;
1276
+ label?: string | undefined;
1277
+ })[];
1278
+ toolStates: ({
1279
+ toolCallId: string;
1280
+ actionId: string;
1281
+ state: "pending_user" | "pending_chain";
1282
+ signatureRequestGroupId: string;
1283
+ description?: string | undefined;
1284
+ simulationId?: string | undefined;
1285
+ label?: string | undefined;
1286
+ } | {
1287
+ toolCallId: string;
1288
+ actionId: string;
1289
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1290
+ description?: string | undefined;
1291
+ simulationId?: string | undefined;
1292
+ signatureRequestGroupId?: string | undefined;
1293
+ label?: string | undefined;
1294
+ })[];
1295
+ summary?: string | undefined;
1296
+ }>, {
1297
+ metadata: Record<string, unknown>;
1298
+ version: "v2";
1299
+ runId: string;
1300
+ turnId: string;
1301
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1302
+ visibleParts: ({
1303
+ text: string;
1304
+ type: "text";
1305
+ id: string;
1306
+ } | {
1307
+ type: "pending-approval-card";
1308
+ toolCallId: string;
1309
+ id: string;
1310
+ actionId: string;
1311
+ state: "pending_user" | "pending_chain";
1312
+ signatureRequestGroupId: string;
1313
+ description?: string | undefined;
1314
+ label?: string | undefined;
1315
+ } | {
1316
+ type: "tool-state-card";
1317
+ toolCallId: string;
1318
+ id: string;
1319
+ actionId: string;
1320
+ state: "pending_user" | "pending_chain";
1321
+ signatureRequestGroupId: string;
1322
+ description?: string | undefined;
1323
+ label?: string | undefined;
1324
+ } | {
1325
+ type: "tool-state-card";
1326
+ toolCallId: string;
1327
+ id: string;
1328
+ actionId: string;
1329
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1330
+ description?: string | undefined;
1331
+ simulationId?: string | undefined;
1332
+ signatureRequestGroupId?: string | undefined;
1333
+ label?: string | undefined;
1334
+ })[];
1335
+ toolStates: ({
1336
+ toolCallId: string;
1337
+ actionId: string;
1338
+ state: "pending_user" | "pending_chain";
1339
+ signatureRequestGroupId: string;
1340
+ description?: string | undefined;
1341
+ simulationId?: string | undefined;
1342
+ label?: string | undefined;
1343
+ } | {
1344
+ toolCallId: string;
1345
+ actionId: string;
1346
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1347
+ description?: string | undefined;
1348
+ simulationId?: string | undefined;
1349
+ signatureRequestGroupId?: string | undefined;
1350
+ label?: string | undefined;
1351
+ })[];
1352
+ summary?: string | undefined;
1353
+ }, {
1354
+ metadata: Record<string, unknown>;
1355
+ version: "v2";
1356
+ runId: string;
1357
+ turnId: string;
1358
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1359
+ visibleParts: ({
1360
+ text: string;
1361
+ type: "text";
1362
+ id: string;
1363
+ } | {
1364
+ type: "pending-approval-card";
1365
+ toolCallId: string;
1366
+ id: string;
1367
+ actionId: string;
1368
+ state: "pending_user" | "pending_chain";
1369
+ signatureRequestGroupId: string;
1370
+ description?: string | undefined;
1371
+ label?: string | undefined;
1372
+ } | {
1373
+ type: "tool-state-card";
1374
+ toolCallId: string;
1375
+ id: string;
1376
+ actionId: string;
1377
+ state: "pending_user" | "pending_chain";
1378
+ signatureRequestGroupId: string;
1379
+ description?: string | undefined;
1380
+ label?: string | undefined;
1381
+ } | {
1382
+ type: "tool-state-card";
1383
+ toolCallId: string;
1384
+ id: string;
1385
+ actionId: string;
1386
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1387
+ description?: string | undefined;
1388
+ simulationId?: string | undefined;
1389
+ signatureRequestGroupId?: string | undefined;
1390
+ label?: string | undefined;
1391
+ })[];
1392
+ toolStates: ({
1393
+ toolCallId: string;
1394
+ actionId: string;
1395
+ state: "pending_user" | "pending_chain";
1396
+ signatureRequestGroupId: string;
1397
+ description?: string | undefined;
1398
+ simulationId?: string | undefined;
1399
+ label?: string | undefined;
1400
+ } | {
1401
+ toolCallId: string;
1402
+ actionId: string;
1403
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1404
+ description?: string | undefined;
1405
+ simulationId?: string | undefined;
1406
+ signatureRequestGroupId?: string | undefined;
1407
+ label?: string | undefined;
1408
+ })[];
1409
+ summary?: string | undefined;
1410
+ }>;
1411
+ }, "strict", z.ZodTypeAny, {
1412
+ version: "v2";
1413
+ timestamp: number;
1414
+ runId: string;
1415
+ turnId: string;
1416
+ sequence: number;
1417
+ targetId: string;
1418
+ durable: true;
1419
+ eventType: "turn-complete";
1420
+ snapshot: {
1421
+ metadata: Record<string, unknown>;
1422
+ version: "v2";
1423
+ runId: string;
1424
+ turnId: string;
1425
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1426
+ visibleParts: ({
1427
+ text: string;
1428
+ type: "text";
1429
+ id: string;
1430
+ } | {
1431
+ type: "pending-approval-card";
1432
+ toolCallId: string;
1433
+ id: string;
1434
+ actionId: string;
1435
+ state: "pending_user" | "pending_chain";
1436
+ signatureRequestGroupId: string;
1437
+ description?: string | undefined;
1438
+ label?: string | undefined;
1439
+ } | {
1440
+ type: "tool-state-card";
1441
+ toolCallId: string;
1442
+ id: string;
1443
+ actionId: string;
1444
+ state: "pending_user" | "pending_chain";
1445
+ signatureRequestGroupId: string;
1446
+ description?: string | undefined;
1447
+ label?: string | undefined;
1448
+ } | {
1449
+ type: "tool-state-card";
1450
+ toolCallId: string;
1451
+ id: string;
1452
+ actionId: string;
1453
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1454
+ description?: string | undefined;
1455
+ simulationId?: string | undefined;
1456
+ signatureRequestGroupId?: string | undefined;
1457
+ label?: string | undefined;
1458
+ })[];
1459
+ toolStates: ({
1460
+ toolCallId: string;
1461
+ actionId: string;
1462
+ state: "pending_user" | "pending_chain";
1463
+ signatureRequestGroupId: string;
1464
+ description?: string | undefined;
1465
+ simulationId?: string | undefined;
1466
+ label?: string | undefined;
1467
+ } | {
1468
+ toolCallId: string;
1469
+ actionId: string;
1470
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1471
+ description?: string | undefined;
1472
+ simulationId?: string | undefined;
1473
+ signatureRequestGroupId?: string | undefined;
1474
+ label?: string | undefined;
1475
+ })[];
1476
+ summary?: string | undefined;
1477
+ };
1478
+ }, {
1479
+ version: "v2";
1480
+ timestamp: number;
1481
+ runId: string;
1482
+ turnId: string;
1483
+ sequence: number;
1484
+ targetId: string;
1485
+ durable: true;
1486
+ eventType: "turn-complete";
1487
+ snapshot: {
1488
+ metadata: Record<string, unknown>;
1489
+ version: "v2";
1490
+ runId: string;
1491
+ turnId: string;
1492
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1493
+ visibleParts: ({
1494
+ text: string;
1495
+ type: "text";
1496
+ id: string;
1497
+ } | {
1498
+ type: "pending-approval-card";
1499
+ toolCallId: string;
1500
+ id: string;
1501
+ actionId: string;
1502
+ state: "pending_user" | "pending_chain";
1503
+ signatureRequestGroupId: string;
1504
+ description?: string | undefined;
1505
+ label?: string | undefined;
1506
+ } | {
1507
+ type: "tool-state-card";
1508
+ toolCallId: string;
1509
+ id: string;
1510
+ actionId: string;
1511
+ state: "pending_user" | "pending_chain";
1512
+ signatureRequestGroupId: string;
1513
+ description?: string | undefined;
1514
+ label?: string | undefined;
1515
+ } | {
1516
+ type: "tool-state-card";
1517
+ toolCallId: string;
1518
+ id: string;
1519
+ actionId: string;
1520
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1521
+ description?: string | undefined;
1522
+ simulationId?: string | undefined;
1523
+ signatureRequestGroupId?: string | undefined;
1524
+ label?: string | undefined;
1525
+ })[];
1526
+ toolStates: ({
1527
+ toolCallId: string;
1528
+ actionId: string;
1529
+ state: "pending_user" | "pending_chain";
1530
+ signatureRequestGroupId: string;
1531
+ description?: string | undefined;
1532
+ simulationId?: string | undefined;
1533
+ label?: string | undefined;
1534
+ } | {
1535
+ toolCallId: string;
1536
+ actionId: string;
1537
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1538
+ description?: string | undefined;
1539
+ simulationId?: string | undefined;
1540
+ signatureRequestGroupId?: string | undefined;
1541
+ label?: string | undefined;
1542
+ })[];
1543
+ summary?: string | undefined;
1544
+ };
1545
+ }>, {
1546
+ version: "v2";
1547
+ timestamp: number;
1548
+ runId: string;
1549
+ turnId: string;
1550
+ sequence: number;
1551
+ targetId: string;
1552
+ durable: true;
1553
+ eventType: "turn-complete";
1554
+ snapshot: {
1555
+ metadata: Record<string, unknown>;
1556
+ version: "v2";
1557
+ runId: string;
1558
+ turnId: string;
1559
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1560
+ visibleParts: ({
1561
+ text: string;
1562
+ type: "text";
1563
+ id: string;
1564
+ } | {
1565
+ type: "pending-approval-card";
1566
+ toolCallId: string;
1567
+ id: string;
1568
+ actionId: string;
1569
+ state: "pending_user" | "pending_chain";
1570
+ signatureRequestGroupId: string;
1571
+ description?: string | undefined;
1572
+ label?: string | undefined;
1573
+ } | {
1574
+ type: "tool-state-card";
1575
+ toolCallId: string;
1576
+ id: string;
1577
+ actionId: string;
1578
+ state: "pending_user" | "pending_chain";
1579
+ signatureRequestGroupId: string;
1580
+ description?: string | undefined;
1581
+ label?: string | undefined;
1582
+ } | {
1583
+ type: "tool-state-card";
1584
+ toolCallId: string;
1585
+ id: string;
1586
+ actionId: string;
1587
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1588
+ description?: string | undefined;
1589
+ simulationId?: string | undefined;
1590
+ signatureRequestGroupId?: string | undefined;
1591
+ label?: string | undefined;
1592
+ })[];
1593
+ toolStates: ({
1594
+ toolCallId: string;
1595
+ actionId: string;
1596
+ state: "pending_user" | "pending_chain";
1597
+ signatureRequestGroupId: string;
1598
+ description?: string | undefined;
1599
+ simulationId?: string | undefined;
1600
+ label?: string | undefined;
1601
+ } | {
1602
+ toolCallId: string;
1603
+ actionId: string;
1604
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1605
+ description?: string | undefined;
1606
+ simulationId?: string | undefined;
1607
+ signatureRequestGroupId?: string | undefined;
1608
+ label?: string | undefined;
1609
+ })[];
1610
+ summary?: string | undefined;
1611
+ };
1612
+ }, {
1613
+ version: "v2";
1614
+ timestamp: number;
1615
+ runId: string;
1616
+ turnId: string;
1617
+ sequence: number;
1618
+ targetId: string;
1619
+ durable: true;
1620
+ eventType: "turn-complete";
1621
+ snapshot: {
1622
+ metadata: Record<string, unknown>;
1623
+ version: "v2";
1624
+ runId: string;
1625
+ turnId: string;
1626
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1627
+ visibleParts: ({
1628
+ text: string;
1629
+ type: "text";
1630
+ id: string;
1631
+ } | {
1632
+ type: "pending-approval-card";
1633
+ toolCallId: string;
1634
+ id: string;
1635
+ actionId: string;
1636
+ state: "pending_user" | "pending_chain";
1637
+ signatureRequestGroupId: string;
1638
+ description?: string | undefined;
1639
+ label?: string | undefined;
1640
+ } | {
1641
+ type: "tool-state-card";
1642
+ toolCallId: string;
1643
+ id: string;
1644
+ actionId: string;
1645
+ state: "pending_user" | "pending_chain";
1646
+ signatureRequestGroupId: string;
1647
+ description?: string | undefined;
1648
+ label?: string | undefined;
1649
+ } | {
1650
+ type: "tool-state-card";
1651
+ toolCallId: string;
1652
+ id: string;
1653
+ actionId: string;
1654
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1655
+ description?: string | undefined;
1656
+ simulationId?: string | undefined;
1657
+ signatureRequestGroupId?: string | undefined;
1658
+ label?: string | undefined;
1659
+ })[];
1660
+ toolStates: ({
1661
+ toolCallId: string;
1662
+ actionId: string;
1663
+ state: "pending_user" | "pending_chain";
1664
+ signatureRequestGroupId: string;
1665
+ description?: string | undefined;
1666
+ simulationId?: string | undefined;
1667
+ label?: string | undefined;
1668
+ } | {
1669
+ toolCallId: string;
1670
+ actionId: string;
1671
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1672
+ description?: string | undefined;
1673
+ simulationId?: string | undefined;
1674
+ signatureRequestGroupId?: string | undefined;
1675
+ label?: string | undefined;
1676
+ })[];
1677
+ summary?: string | undefined;
1678
+ };
1679
+ }>;
1680
+ export declare const chatStreamRunCompleteEventSchema: z.ZodObject<{
1681
+ version: z.ZodLiteral<"v2">;
1682
+ runId: z.ZodString;
1683
+ turnId: z.ZodString;
1684
+ sequence: z.ZodNumber;
1685
+ targetId: z.ZodString;
1686
+ timestamp: z.ZodNumber;
1687
+ } & {
1688
+ eventType: z.ZodLiteral<"run-complete">;
1689
+ durable: z.ZodLiteral<true>;
1690
+ completedTurnIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1691
+ summary: z.ZodOptional<z.ZodString>;
1692
+ }, "strict", z.ZodTypeAny, {
1693
+ version: "v2";
1694
+ timestamp: number;
1695
+ runId: string;
1696
+ turnId: string;
1697
+ sequence: number;
1698
+ targetId: string;
1699
+ durable: true;
1700
+ eventType: "run-complete";
1701
+ summary?: string | undefined;
1702
+ completedTurnIds?: string[] | undefined;
1703
+ }, {
1704
+ version: "v2";
1705
+ timestamp: number;
1706
+ runId: string;
1707
+ turnId: string;
1708
+ sequence: number;
1709
+ targetId: string;
1710
+ durable: true;
1711
+ eventType: "run-complete";
1712
+ summary?: string | undefined;
1713
+ completedTurnIds?: string[] | undefined;
1714
+ }>;
1715
+ export declare const chatStreamErrorStateSchema: z.ZodObject<{
1716
+ version: z.ZodLiteral<"v2">;
1717
+ runId: z.ZodString;
1718
+ turnId: z.ZodString;
1719
+ sequence: z.ZodNumber;
1720
+ targetId: z.ZodString;
1721
+ timestamp: z.ZodNumber;
1722
+ } & {
1723
+ eventType: z.ZodLiteral<"error-state">;
1724
+ durable: z.ZodLiteral<false>;
1725
+ error: z.ZodString;
1726
+ code: z.ZodOptional<z.ZodString>;
1727
+ }, "strict", z.ZodTypeAny, {
1728
+ error: string;
1729
+ version: "v2";
1730
+ timestamp: number;
1731
+ runId: string;
1732
+ turnId: string;
1733
+ sequence: number;
1734
+ targetId: string;
1735
+ durable: false;
1736
+ eventType: "error-state";
1737
+ code?: string | undefined;
1738
+ }, {
1739
+ error: string;
1740
+ version: "v2";
1741
+ timestamp: number;
1742
+ runId: string;
1743
+ turnId: string;
1744
+ sequence: number;
1745
+ targetId: string;
1746
+ durable: false;
1747
+ eventType: "error-state";
1748
+ code?: string | undefined;
1749
+ }>;
1750
+ export declare const chatStreamLiveEventSchema: z.ZodUnion<[z.ZodObject<{
1751
+ version: z.ZodLiteral<"v2">;
1752
+ runId: z.ZodString;
1753
+ turnId: z.ZodString;
1754
+ sequence: z.ZodNumber;
1755
+ targetId: z.ZodString;
1756
+ timestamp: z.ZodNumber;
1757
+ } & {
1758
+ eventType: z.ZodLiteral<"turn-start">;
1759
+ durable: z.ZodLiteral<false>;
1760
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
1761
+ }, "strict", z.ZodTypeAny, {
1762
+ version: "v2";
1763
+ timestamp: number;
1764
+ runId: string;
1765
+ turnId: string;
1766
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1767
+ sequence: number;
1768
+ targetId: string;
1769
+ durable: false;
1770
+ eventType: "turn-start";
1771
+ }, {
1772
+ version: "v2";
1773
+ timestamp: number;
1774
+ runId: string;
1775
+ turnId: string;
1776
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1777
+ sequence: number;
1778
+ targetId: string;
1779
+ durable: false;
1780
+ eventType: "turn-start";
1781
+ }>, z.ZodObject<{
1782
+ version: z.ZodLiteral<"v2">;
1783
+ runId: z.ZodString;
1784
+ turnId: z.ZodString;
1785
+ sequence: z.ZodNumber;
1786
+ targetId: z.ZodString;
1787
+ timestamp: z.ZodNumber;
1788
+ } & {
1789
+ eventType: z.ZodLiteral<"transcript-text-start">;
1790
+ durable: z.ZodLiteral<false>;
1791
+ }, "strict", z.ZodTypeAny, {
1792
+ version: "v2";
1793
+ timestamp: number;
1794
+ runId: string;
1795
+ turnId: string;
1796
+ sequence: number;
1797
+ targetId: string;
1798
+ durable: false;
1799
+ eventType: "transcript-text-start";
1800
+ }, {
1801
+ version: "v2";
1802
+ timestamp: number;
1803
+ runId: string;
1804
+ turnId: string;
1805
+ sequence: number;
1806
+ targetId: string;
1807
+ durable: false;
1808
+ eventType: "transcript-text-start";
1809
+ }>, z.ZodObject<{
1810
+ version: z.ZodLiteral<"v2">;
1811
+ runId: z.ZodString;
1812
+ turnId: z.ZodString;
1813
+ sequence: z.ZodNumber;
1814
+ targetId: z.ZodString;
1815
+ timestamp: z.ZodNumber;
1816
+ } & {
1817
+ eventType: z.ZodLiteral<"transcript-text-delta">;
1818
+ durable: z.ZodLiteral<false>;
1819
+ delta: z.ZodString;
1820
+ }, "strict", z.ZodTypeAny, {
1821
+ version: "v2";
1822
+ timestamp: number;
1823
+ delta: string;
1824
+ runId: string;
1825
+ turnId: string;
1826
+ sequence: number;
1827
+ targetId: string;
1828
+ durable: false;
1829
+ eventType: "transcript-text-delta";
1830
+ }, {
1831
+ version: "v2";
1832
+ timestamp: number;
1833
+ delta: string;
1834
+ runId: string;
1835
+ turnId: string;
1836
+ sequence: number;
1837
+ targetId: string;
1838
+ durable: false;
1839
+ eventType: "transcript-text-delta";
1840
+ }>, z.ZodObject<{
1841
+ version: z.ZodLiteral<"v2">;
1842
+ runId: z.ZodString;
1843
+ turnId: z.ZodString;
1844
+ sequence: z.ZodNumber;
1845
+ targetId: z.ZodString;
1846
+ timestamp: z.ZodNumber;
1847
+ } & {
1848
+ eventType: z.ZodLiteral<"transcript-text-end">;
1849
+ durable: z.ZodLiteral<false>;
1850
+ }, "strict", z.ZodTypeAny, {
1851
+ version: "v2";
1852
+ timestamp: number;
1853
+ runId: string;
1854
+ turnId: string;
1855
+ sequence: number;
1856
+ targetId: string;
1857
+ durable: false;
1858
+ eventType: "transcript-text-end";
1859
+ }, {
1860
+ version: "v2";
1861
+ timestamp: number;
1862
+ runId: string;
1863
+ turnId: string;
1864
+ sequence: number;
1865
+ targetId: string;
1866
+ durable: false;
1867
+ eventType: "transcript-text-end";
1868
+ }>, z.ZodObject<{
1869
+ version: z.ZodLiteral<"v2">;
1870
+ runId: z.ZodString;
1871
+ turnId: z.ZodString;
1872
+ sequence: z.ZodNumber;
1873
+ targetId: z.ZodString;
1874
+ timestamp: z.ZodNumber;
1875
+ } & {
1876
+ eventType: z.ZodLiteral<"progress-update">;
1877
+ durable: z.ZodLiteral<false>;
1878
+ message: z.ZodString;
1879
+ label: z.ZodOptional<z.ZodString>;
1880
+ }, "strict", z.ZodTypeAny, {
1881
+ message: string;
1882
+ version: "v2";
1883
+ timestamp: number;
1884
+ runId: string;
1885
+ turnId: string;
1886
+ sequence: number;
1887
+ targetId: string;
1888
+ durable: false;
1889
+ eventType: "progress-update";
1890
+ label?: string | undefined;
1891
+ }, {
1892
+ message: string;
1893
+ version: "v2";
1894
+ timestamp: number;
1895
+ runId: string;
1896
+ turnId: string;
1897
+ sequence: number;
1898
+ targetId: string;
1899
+ durable: false;
1900
+ eventType: "progress-update";
1901
+ label?: string | undefined;
1902
+ }>, z.ZodObject<{
1903
+ version: z.ZodLiteral<"v2">;
1904
+ runId: z.ZodString;
1905
+ turnId: z.ZodString;
1906
+ sequence: z.ZodNumber;
1907
+ targetId: z.ZodString;
1908
+ timestamp: z.ZodNumber;
1909
+ } & {
1910
+ eventType: z.ZodLiteral<"tool-state">;
1911
+ durable: z.ZodLiteral<true>;
1912
+ actionId: z.ZodString;
1913
+ toolCallId: z.ZodString;
1914
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
1915
+ simulationId: z.ZodOptional<z.ZodString>;
1916
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
1917
+ label: z.ZodOptional<z.ZodString>;
1918
+ description: z.ZodOptional<z.ZodString>;
1919
+ }, "strict", z.ZodTypeAny, {
1920
+ toolCallId: string;
1921
+ version: "v2";
1922
+ timestamp: number;
1923
+ actionId: string;
1924
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1925
+ runId: string;
1926
+ turnId: string;
1927
+ sequence: number;
1928
+ targetId: string;
1929
+ durable: true;
1930
+ eventType: "tool-state";
1931
+ description?: string | undefined;
1932
+ simulationId?: string | undefined;
1933
+ signatureRequestGroupId?: string | undefined;
1934
+ label?: string | undefined;
1935
+ }, {
1936
+ toolCallId: string;
1937
+ version: "v2";
1938
+ timestamp: number;
1939
+ actionId: string;
1940
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1941
+ runId: string;
1942
+ turnId: string;
1943
+ sequence: number;
1944
+ targetId: string;
1945
+ durable: true;
1946
+ eventType: "tool-state";
1947
+ description?: string | undefined;
1948
+ simulationId?: string | undefined;
1949
+ signatureRequestGroupId?: string | undefined;
1950
+ label?: string | undefined;
1951
+ }>, z.ZodUnion<[z.ZodObject<{
1952
+ version: z.ZodLiteral<"v2">;
1953
+ runId: z.ZodString;
1954
+ turnId: z.ZodString;
1955
+ sequence: z.ZodNumber;
1956
+ targetId: z.ZodString;
1957
+ timestamp: z.ZodNumber;
1958
+ } & {
1959
+ eventType: z.ZodLiteral<"simulation-state">;
1960
+ durable: z.ZodLiteral<false>;
1961
+ actionId: z.ZodString;
1962
+ simulationId: z.ZodString;
1963
+ toolCallId: z.ZodOptional<z.ZodString>;
1964
+ state: z.ZodEnum<["pending", "superseded"]>;
1965
+ summary: z.ZodOptional<z.ZodString>;
1966
+ error: z.ZodOptional<z.ZodString>;
1967
+ }, "strict", z.ZodTypeAny, {
1968
+ simulationId: string;
1969
+ version: "v2";
1970
+ timestamp: number;
1971
+ actionId: string;
1972
+ state: "pending" | "superseded";
1973
+ runId: string;
1974
+ turnId: string;
1975
+ sequence: number;
1976
+ targetId: string;
1977
+ durable: false;
1978
+ eventType: "simulation-state";
1979
+ error?: string | undefined;
1980
+ toolCallId?: string | undefined;
1981
+ summary?: string | undefined;
1982
+ }, {
1983
+ simulationId: string;
1984
+ version: "v2";
1985
+ timestamp: number;
1986
+ actionId: string;
1987
+ state: "pending" | "superseded";
1988
+ runId: string;
1989
+ turnId: string;
1990
+ sequence: number;
1991
+ targetId: string;
1992
+ durable: false;
1993
+ eventType: "simulation-state";
1994
+ error?: string | undefined;
1995
+ toolCallId?: string | undefined;
1996
+ summary?: string | undefined;
1997
+ }>, z.ZodObject<{
1998
+ version: z.ZodLiteral<"v2">;
1999
+ runId: z.ZodString;
2000
+ turnId: z.ZodString;
2001
+ sequence: z.ZodNumber;
2002
+ targetId: z.ZodString;
2003
+ timestamp: z.ZodNumber;
2004
+ } & {
2005
+ eventType: z.ZodLiteral<"simulation-state">;
2006
+ durable: z.ZodBoolean;
2007
+ actionId: z.ZodString;
2008
+ simulationId: z.ZodString;
2009
+ toolCallId: z.ZodOptional<z.ZodString>;
2010
+ state: z.ZodEnum<["complete", "failed"]>;
2011
+ summary: z.ZodOptional<z.ZodString>;
2012
+ error: z.ZodOptional<z.ZodString>;
2013
+ }, "strict", z.ZodTypeAny, {
2014
+ simulationId: string;
2015
+ version: "v2";
2016
+ timestamp: number;
2017
+ actionId: string;
2018
+ state: "failed" | "complete";
2019
+ runId: string;
2020
+ turnId: string;
2021
+ sequence: number;
2022
+ targetId: string;
2023
+ durable: boolean;
2024
+ eventType: "simulation-state";
2025
+ error?: string | undefined;
2026
+ toolCallId?: string | undefined;
2027
+ summary?: string | undefined;
2028
+ }, {
2029
+ simulationId: string;
2030
+ version: "v2";
2031
+ timestamp: number;
2032
+ actionId: string;
2033
+ state: "failed" | "complete";
2034
+ runId: string;
2035
+ turnId: string;
2036
+ sequence: number;
2037
+ targetId: string;
2038
+ durable: boolean;
2039
+ eventType: "simulation-state";
2040
+ error?: string | undefined;
2041
+ toolCallId?: string | undefined;
2042
+ summary?: string | undefined;
2043
+ }>]>, z.ZodObject<{
2044
+ version: z.ZodLiteral<"v2">;
2045
+ runId: z.ZodString;
2046
+ turnId: z.ZodString;
2047
+ sequence: z.ZodNumber;
2048
+ targetId: z.ZodString;
2049
+ timestamp: z.ZodNumber;
2050
+ } & {
2051
+ eventType: z.ZodLiteral<"signature-state">;
2052
+ durable: z.ZodLiteral<true>;
2053
+ actionId: z.ZodString;
2054
+ toolCallId: z.ZodString;
2055
+ signatureRequestGroupId: z.ZodString;
2056
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
2057
+ label: z.ZodOptional<z.ZodString>;
2058
+ description: z.ZodOptional<z.ZodString>;
2059
+ }, "strict", z.ZodTypeAny, {
2060
+ toolCallId: string;
2061
+ version: "v2";
2062
+ timestamp: number;
2063
+ actionId: string;
2064
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2065
+ signatureRequestGroupId: string;
2066
+ runId: string;
2067
+ turnId: string;
2068
+ sequence: number;
2069
+ targetId: string;
2070
+ durable: true;
2071
+ eventType: "signature-state";
2072
+ description?: string | undefined;
2073
+ label?: string | undefined;
2074
+ }, {
2075
+ toolCallId: string;
2076
+ version: "v2";
2077
+ timestamp: number;
2078
+ actionId: string;
2079
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2080
+ signatureRequestGroupId: string;
2081
+ runId: string;
2082
+ turnId: string;
2083
+ sequence: number;
2084
+ targetId: string;
2085
+ durable: true;
2086
+ eventType: "signature-state";
2087
+ description?: string | undefined;
2088
+ label?: string | undefined;
2089
+ }>, z.ZodObject<{
2090
+ version: z.ZodLiteral<"v2">;
2091
+ runId: z.ZodString;
2092
+ turnId: z.ZodString;
2093
+ sequence: z.ZodNumber;
2094
+ targetId: z.ZodString;
2095
+ timestamp: z.ZodNumber;
2096
+ } & {
2097
+ eventType: z.ZodLiteral<"turn-summary">;
2098
+ durable: z.ZodLiteral<true>;
2099
+ summary: z.ZodString;
2100
+ }, "strict", z.ZodTypeAny, {
2101
+ version: "v2";
2102
+ timestamp: number;
2103
+ runId: string;
2104
+ turnId: string;
2105
+ summary: string;
2106
+ sequence: number;
2107
+ targetId: string;
2108
+ durable: true;
2109
+ eventType: "turn-summary";
2110
+ }, {
2111
+ version: "v2";
2112
+ timestamp: number;
2113
+ runId: string;
2114
+ turnId: string;
2115
+ summary: string;
2116
+ sequence: number;
2117
+ targetId: string;
2118
+ durable: true;
2119
+ eventType: "turn-summary";
2120
+ }>, z.ZodEffects<z.ZodObject<{
2121
+ version: z.ZodLiteral<"v2">;
2122
+ runId: z.ZodString;
2123
+ turnId: z.ZodString;
2124
+ sequence: z.ZodNumber;
2125
+ targetId: z.ZodString;
2126
+ timestamp: z.ZodNumber;
2127
+ } & {
2128
+ eventType: z.ZodLiteral<"turn-complete">;
2129
+ durable: z.ZodLiteral<true>;
2130
+ snapshot: z.ZodEffects<z.ZodObject<{
2131
+ version: z.ZodLiteral<"v2">;
2132
+ runId: z.ZodString;
2133
+ turnId: z.ZodString;
2134
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
2135
+ summary: z.ZodOptional<z.ZodString>;
2136
+ visibleParts: z.ZodArray<z.ZodUnion<[z.ZodObject<{
2137
+ type: z.ZodLiteral<"text">;
2138
+ id: z.ZodString;
2139
+ text: z.ZodString;
2140
+ }, "strict", z.ZodTypeAny, {
2141
+ text: string;
2142
+ type: "text";
2143
+ id: string;
2144
+ }, {
2145
+ text: string;
2146
+ type: "text";
2147
+ id: string;
2148
+ }>, z.ZodObject<{
2149
+ type: z.ZodLiteral<"pending-approval-card">;
2150
+ id: z.ZodString;
2151
+ actionId: z.ZodString;
2152
+ toolCallId: z.ZodString;
2153
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
2154
+ signatureRequestGroupId: z.ZodString;
2155
+ label: z.ZodOptional<z.ZodString>;
2156
+ description: z.ZodOptional<z.ZodString>;
2157
+ }, "strict", z.ZodTypeAny, {
2158
+ type: "pending-approval-card";
2159
+ toolCallId: string;
2160
+ id: string;
2161
+ actionId: string;
2162
+ state: "pending_user" | "pending_chain";
2163
+ signatureRequestGroupId: string;
2164
+ description?: string | undefined;
2165
+ label?: string | undefined;
2166
+ }, {
2167
+ type: "pending-approval-card";
2168
+ toolCallId: string;
2169
+ id: string;
2170
+ actionId: string;
2171
+ state: "pending_user" | "pending_chain";
2172
+ signatureRequestGroupId: string;
2173
+ description?: string | undefined;
2174
+ label?: string | undefined;
2175
+ }>, z.ZodUnion<[z.ZodObject<{
2176
+ type: z.ZodLiteral<"tool-state-card">;
2177
+ id: z.ZodString;
2178
+ actionId: z.ZodString;
2179
+ toolCallId: z.ZodString;
2180
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
2181
+ signatureRequestGroupId: z.ZodString;
2182
+ label: z.ZodOptional<z.ZodString>;
2183
+ description: z.ZodOptional<z.ZodString>;
2184
+ }, "strict", z.ZodTypeAny, {
2185
+ type: "tool-state-card";
2186
+ toolCallId: string;
2187
+ id: string;
2188
+ actionId: string;
2189
+ state: "pending_user" | "pending_chain";
2190
+ signatureRequestGroupId: string;
2191
+ description?: string | undefined;
2192
+ label?: string | undefined;
2193
+ }, {
2194
+ type: "tool-state-card";
2195
+ toolCallId: string;
2196
+ id: string;
2197
+ actionId: string;
2198
+ state: "pending_user" | "pending_chain";
2199
+ signatureRequestGroupId: string;
2200
+ description?: string | undefined;
2201
+ label?: string | undefined;
2202
+ }>, z.ZodObject<{
2203
+ type: z.ZodLiteral<"tool-state-card">;
2204
+ id: z.ZodString;
2205
+ actionId: z.ZodString;
2206
+ toolCallId: z.ZodString;
2207
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
2208
+ simulationId: z.ZodOptional<z.ZodString>;
2209
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
2210
+ label: z.ZodOptional<z.ZodString>;
2211
+ description: z.ZodOptional<z.ZodString>;
2212
+ }, "strict", z.ZodTypeAny, {
2213
+ type: "tool-state-card";
2214
+ toolCallId: string;
2215
+ id: string;
2216
+ actionId: string;
2217
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2218
+ description?: string | undefined;
2219
+ simulationId?: string | undefined;
2220
+ signatureRequestGroupId?: string | undefined;
2221
+ label?: string | undefined;
2222
+ }, {
2223
+ type: "tool-state-card";
2224
+ toolCallId: string;
2225
+ id: string;
2226
+ actionId: string;
2227
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2228
+ description?: string | undefined;
2229
+ simulationId?: string | undefined;
2230
+ signatureRequestGroupId?: string | undefined;
2231
+ label?: string | undefined;
2232
+ }>]>]>, "many">;
2233
+ toolStates: z.ZodArray<z.ZodUnion<[z.ZodObject<{
2234
+ actionId: z.ZodString;
2235
+ toolCallId: z.ZodString;
2236
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
2237
+ simulationId: z.ZodOptional<z.ZodString>;
2238
+ signatureRequestGroupId: z.ZodString;
2239
+ label: z.ZodOptional<z.ZodString>;
2240
+ description: z.ZodOptional<z.ZodString>;
2241
+ }, "strict", z.ZodTypeAny, {
2242
+ toolCallId: string;
2243
+ actionId: string;
2244
+ state: "pending_user" | "pending_chain";
2245
+ signatureRequestGroupId: string;
2246
+ description?: string | undefined;
2247
+ simulationId?: string | undefined;
2248
+ label?: string | undefined;
2249
+ }, {
2250
+ toolCallId: string;
2251
+ actionId: string;
2252
+ state: "pending_user" | "pending_chain";
2253
+ signatureRequestGroupId: string;
2254
+ description?: string | undefined;
2255
+ simulationId?: string | undefined;
2256
+ label?: string | undefined;
2257
+ }>, z.ZodObject<{
2258
+ actionId: z.ZodString;
2259
+ toolCallId: z.ZodString;
2260
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
2261
+ simulationId: z.ZodOptional<z.ZodString>;
2262
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
2263
+ label: z.ZodOptional<z.ZodString>;
2264
+ description: z.ZodOptional<z.ZodString>;
2265
+ }, "strict", z.ZodTypeAny, {
2266
+ toolCallId: string;
2267
+ actionId: string;
2268
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2269
+ description?: string | undefined;
2270
+ simulationId?: string | undefined;
2271
+ signatureRequestGroupId?: string | undefined;
2272
+ label?: string | undefined;
2273
+ }, {
2274
+ toolCallId: string;
2275
+ actionId: string;
2276
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2277
+ description?: string | undefined;
2278
+ simulationId?: string | undefined;
2279
+ signatureRequestGroupId?: string | undefined;
2280
+ label?: string | undefined;
2281
+ }>]>, "many">;
2282
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2283
+ }, "strict", z.ZodTypeAny, {
2284
+ metadata: Record<string, unknown>;
2285
+ version: "v2";
2286
+ runId: string;
2287
+ turnId: string;
2288
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2289
+ visibleParts: ({
2290
+ text: string;
2291
+ type: "text";
2292
+ id: string;
2293
+ } | {
2294
+ type: "pending-approval-card";
2295
+ toolCallId: string;
2296
+ id: string;
2297
+ actionId: string;
2298
+ state: "pending_user" | "pending_chain";
2299
+ signatureRequestGroupId: string;
2300
+ description?: string | undefined;
2301
+ label?: string | undefined;
2302
+ } | {
2303
+ type: "tool-state-card";
2304
+ toolCallId: string;
2305
+ id: string;
2306
+ actionId: string;
2307
+ state: "pending_user" | "pending_chain";
2308
+ signatureRequestGroupId: string;
2309
+ description?: string | undefined;
2310
+ label?: string | undefined;
2311
+ } | {
2312
+ type: "tool-state-card";
2313
+ toolCallId: string;
2314
+ id: string;
2315
+ actionId: string;
2316
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2317
+ description?: string | undefined;
2318
+ simulationId?: string | undefined;
2319
+ signatureRequestGroupId?: string | undefined;
2320
+ label?: string | undefined;
2321
+ })[];
2322
+ toolStates: ({
2323
+ toolCallId: string;
2324
+ actionId: string;
2325
+ state: "pending_user" | "pending_chain";
2326
+ signatureRequestGroupId: string;
2327
+ description?: string | undefined;
2328
+ simulationId?: string | undefined;
2329
+ label?: string | undefined;
2330
+ } | {
2331
+ toolCallId: string;
2332
+ actionId: string;
2333
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2334
+ description?: string | undefined;
2335
+ simulationId?: string | undefined;
2336
+ signatureRequestGroupId?: string | undefined;
2337
+ label?: string | undefined;
2338
+ })[];
2339
+ summary?: string | undefined;
2340
+ }, {
2341
+ metadata: Record<string, unknown>;
2342
+ version: "v2";
2343
+ runId: string;
2344
+ turnId: string;
2345
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2346
+ visibleParts: ({
2347
+ text: string;
2348
+ type: "text";
2349
+ id: string;
2350
+ } | {
2351
+ type: "pending-approval-card";
2352
+ toolCallId: string;
2353
+ id: string;
2354
+ actionId: string;
2355
+ state: "pending_user" | "pending_chain";
2356
+ signatureRequestGroupId: string;
2357
+ description?: string | undefined;
2358
+ label?: string | undefined;
2359
+ } | {
2360
+ type: "tool-state-card";
2361
+ toolCallId: string;
2362
+ id: string;
2363
+ actionId: string;
2364
+ state: "pending_user" | "pending_chain";
2365
+ signatureRequestGroupId: string;
2366
+ description?: string | undefined;
2367
+ label?: string | undefined;
2368
+ } | {
2369
+ type: "tool-state-card";
2370
+ toolCallId: string;
2371
+ id: string;
2372
+ actionId: string;
2373
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2374
+ description?: string | undefined;
2375
+ simulationId?: string | undefined;
2376
+ signatureRequestGroupId?: string | undefined;
2377
+ label?: string | undefined;
2378
+ })[];
2379
+ toolStates: ({
2380
+ toolCallId: string;
2381
+ actionId: string;
2382
+ state: "pending_user" | "pending_chain";
2383
+ signatureRequestGroupId: string;
2384
+ description?: string | undefined;
2385
+ simulationId?: string | undefined;
2386
+ label?: string | undefined;
2387
+ } | {
2388
+ toolCallId: string;
2389
+ actionId: string;
2390
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2391
+ description?: string | undefined;
2392
+ simulationId?: string | undefined;
2393
+ signatureRequestGroupId?: string | undefined;
2394
+ label?: string | undefined;
2395
+ })[];
2396
+ summary?: string | undefined;
2397
+ }>, {
2398
+ metadata: Record<string, unknown>;
2399
+ version: "v2";
2400
+ runId: string;
2401
+ turnId: string;
2402
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2403
+ visibleParts: ({
2404
+ text: string;
2405
+ type: "text";
2406
+ id: string;
2407
+ } | {
2408
+ type: "pending-approval-card";
2409
+ toolCallId: string;
2410
+ id: string;
2411
+ actionId: string;
2412
+ state: "pending_user" | "pending_chain";
2413
+ signatureRequestGroupId: string;
2414
+ description?: string | undefined;
2415
+ label?: string | undefined;
2416
+ } | {
2417
+ type: "tool-state-card";
2418
+ toolCallId: string;
2419
+ id: string;
2420
+ actionId: string;
2421
+ state: "pending_user" | "pending_chain";
2422
+ signatureRequestGroupId: string;
2423
+ description?: string | undefined;
2424
+ label?: string | undefined;
2425
+ } | {
2426
+ type: "tool-state-card";
2427
+ toolCallId: string;
2428
+ id: string;
2429
+ actionId: string;
2430
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2431
+ description?: string | undefined;
2432
+ simulationId?: string | undefined;
2433
+ signatureRequestGroupId?: string | undefined;
2434
+ label?: string | undefined;
2435
+ })[];
2436
+ toolStates: ({
2437
+ toolCallId: string;
2438
+ actionId: string;
2439
+ state: "pending_user" | "pending_chain";
2440
+ signatureRequestGroupId: string;
2441
+ description?: string | undefined;
2442
+ simulationId?: string | undefined;
2443
+ label?: string | undefined;
2444
+ } | {
2445
+ toolCallId: string;
2446
+ actionId: string;
2447
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2448
+ description?: string | undefined;
2449
+ simulationId?: string | undefined;
2450
+ signatureRequestGroupId?: string | undefined;
2451
+ label?: string | undefined;
2452
+ })[];
2453
+ summary?: string | undefined;
2454
+ }, {
2455
+ metadata: Record<string, unknown>;
2456
+ version: "v2";
2457
+ runId: string;
2458
+ turnId: string;
2459
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2460
+ visibleParts: ({
2461
+ text: string;
2462
+ type: "text";
2463
+ id: string;
2464
+ } | {
2465
+ type: "pending-approval-card";
2466
+ toolCallId: string;
2467
+ id: string;
2468
+ actionId: string;
2469
+ state: "pending_user" | "pending_chain";
2470
+ signatureRequestGroupId: string;
2471
+ description?: string | undefined;
2472
+ label?: string | undefined;
2473
+ } | {
2474
+ type: "tool-state-card";
2475
+ toolCallId: string;
2476
+ id: string;
2477
+ actionId: string;
2478
+ state: "pending_user" | "pending_chain";
2479
+ signatureRequestGroupId: string;
2480
+ description?: string | undefined;
2481
+ label?: string | undefined;
2482
+ } | {
2483
+ type: "tool-state-card";
2484
+ toolCallId: string;
2485
+ id: string;
2486
+ actionId: string;
2487
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2488
+ description?: string | undefined;
2489
+ simulationId?: string | undefined;
2490
+ signatureRequestGroupId?: string | undefined;
2491
+ label?: string | undefined;
2492
+ })[];
2493
+ toolStates: ({
2494
+ toolCallId: string;
2495
+ actionId: string;
2496
+ state: "pending_user" | "pending_chain";
2497
+ signatureRequestGroupId: string;
2498
+ description?: string | undefined;
2499
+ simulationId?: string | undefined;
2500
+ label?: string | undefined;
2501
+ } | {
2502
+ toolCallId: string;
2503
+ actionId: string;
2504
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2505
+ description?: string | undefined;
2506
+ simulationId?: string | undefined;
2507
+ signatureRequestGroupId?: string | undefined;
2508
+ label?: string | undefined;
2509
+ })[];
2510
+ summary?: string | undefined;
2511
+ }>;
2512
+ }, "strict", z.ZodTypeAny, {
2513
+ version: "v2";
2514
+ timestamp: number;
2515
+ runId: string;
2516
+ turnId: string;
2517
+ sequence: number;
2518
+ targetId: string;
2519
+ durable: true;
2520
+ eventType: "turn-complete";
2521
+ snapshot: {
2522
+ metadata: Record<string, unknown>;
2523
+ version: "v2";
2524
+ runId: string;
2525
+ turnId: string;
2526
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2527
+ visibleParts: ({
2528
+ text: string;
2529
+ type: "text";
2530
+ id: string;
2531
+ } | {
2532
+ type: "pending-approval-card";
2533
+ toolCallId: string;
2534
+ id: string;
2535
+ actionId: string;
2536
+ state: "pending_user" | "pending_chain";
2537
+ signatureRequestGroupId: string;
2538
+ description?: string | undefined;
2539
+ label?: string | undefined;
2540
+ } | {
2541
+ type: "tool-state-card";
2542
+ toolCallId: string;
2543
+ id: string;
2544
+ actionId: string;
2545
+ state: "pending_user" | "pending_chain";
2546
+ signatureRequestGroupId: string;
2547
+ description?: string | undefined;
2548
+ label?: string | undefined;
2549
+ } | {
2550
+ type: "tool-state-card";
2551
+ toolCallId: string;
2552
+ id: string;
2553
+ actionId: string;
2554
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2555
+ description?: string | undefined;
2556
+ simulationId?: string | undefined;
2557
+ signatureRequestGroupId?: string | undefined;
2558
+ label?: string | undefined;
2559
+ })[];
2560
+ toolStates: ({
2561
+ toolCallId: string;
2562
+ actionId: string;
2563
+ state: "pending_user" | "pending_chain";
2564
+ signatureRequestGroupId: string;
2565
+ description?: string | undefined;
2566
+ simulationId?: string | undefined;
2567
+ label?: string | undefined;
2568
+ } | {
2569
+ toolCallId: string;
2570
+ actionId: string;
2571
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2572
+ description?: string | undefined;
2573
+ simulationId?: string | undefined;
2574
+ signatureRequestGroupId?: string | undefined;
2575
+ label?: string | undefined;
2576
+ })[];
2577
+ summary?: string | undefined;
2578
+ };
2579
+ }, {
2580
+ version: "v2";
2581
+ timestamp: number;
2582
+ runId: string;
2583
+ turnId: string;
2584
+ sequence: number;
2585
+ targetId: string;
2586
+ durable: true;
2587
+ eventType: "turn-complete";
2588
+ snapshot: {
2589
+ metadata: Record<string, unknown>;
2590
+ version: "v2";
2591
+ runId: string;
2592
+ turnId: string;
2593
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2594
+ visibleParts: ({
2595
+ text: string;
2596
+ type: "text";
2597
+ id: string;
2598
+ } | {
2599
+ type: "pending-approval-card";
2600
+ toolCallId: string;
2601
+ id: string;
2602
+ actionId: string;
2603
+ state: "pending_user" | "pending_chain";
2604
+ signatureRequestGroupId: string;
2605
+ description?: string | undefined;
2606
+ label?: string | undefined;
2607
+ } | {
2608
+ type: "tool-state-card";
2609
+ toolCallId: string;
2610
+ id: string;
2611
+ actionId: string;
2612
+ state: "pending_user" | "pending_chain";
2613
+ signatureRequestGroupId: string;
2614
+ description?: string | undefined;
2615
+ label?: string | undefined;
2616
+ } | {
2617
+ type: "tool-state-card";
2618
+ toolCallId: string;
2619
+ id: string;
2620
+ actionId: string;
2621
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2622
+ description?: string | undefined;
2623
+ simulationId?: string | undefined;
2624
+ signatureRequestGroupId?: string | undefined;
2625
+ label?: string | undefined;
2626
+ })[];
2627
+ toolStates: ({
2628
+ toolCallId: string;
2629
+ actionId: string;
2630
+ state: "pending_user" | "pending_chain";
2631
+ signatureRequestGroupId: string;
2632
+ description?: string | undefined;
2633
+ simulationId?: string | undefined;
2634
+ label?: string | undefined;
2635
+ } | {
2636
+ toolCallId: string;
2637
+ actionId: string;
2638
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2639
+ description?: string | undefined;
2640
+ simulationId?: string | undefined;
2641
+ signatureRequestGroupId?: string | undefined;
2642
+ label?: string | undefined;
2643
+ })[];
2644
+ summary?: string | undefined;
2645
+ };
2646
+ }>, {
2647
+ version: "v2";
2648
+ timestamp: number;
2649
+ runId: string;
2650
+ turnId: string;
2651
+ sequence: number;
2652
+ targetId: string;
2653
+ durable: true;
2654
+ eventType: "turn-complete";
2655
+ snapshot: {
2656
+ metadata: Record<string, unknown>;
2657
+ version: "v2";
2658
+ runId: string;
2659
+ turnId: string;
2660
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2661
+ visibleParts: ({
2662
+ text: string;
2663
+ type: "text";
2664
+ id: string;
2665
+ } | {
2666
+ type: "pending-approval-card";
2667
+ toolCallId: string;
2668
+ id: string;
2669
+ actionId: string;
2670
+ state: "pending_user" | "pending_chain";
2671
+ signatureRequestGroupId: string;
2672
+ description?: string | undefined;
2673
+ label?: string | undefined;
2674
+ } | {
2675
+ type: "tool-state-card";
2676
+ toolCallId: string;
2677
+ id: string;
2678
+ actionId: string;
2679
+ state: "pending_user" | "pending_chain";
2680
+ signatureRequestGroupId: string;
2681
+ description?: string | undefined;
2682
+ label?: string | undefined;
2683
+ } | {
2684
+ type: "tool-state-card";
2685
+ toolCallId: string;
2686
+ id: string;
2687
+ actionId: string;
2688
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2689
+ description?: string | undefined;
2690
+ simulationId?: string | undefined;
2691
+ signatureRequestGroupId?: string | undefined;
2692
+ label?: string | undefined;
2693
+ })[];
2694
+ toolStates: ({
2695
+ toolCallId: string;
2696
+ actionId: string;
2697
+ state: "pending_user" | "pending_chain";
2698
+ signatureRequestGroupId: string;
2699
+ description?: string | undefined;
2700
+ simulationId?: string | undefined;
2701
+ label?: string | undefined;
2702
+ } | {
2703
+ toolCallId: string;
2704
+ actionId: string;
2705
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2706
+ description?: string | undefined;
2707
+ simulationId?: string | undefined;
2708
+ signatureRequestGroupId?: string | undefined;
2709
+ label?: string | undefined;
2710
+ })[];
2711
+ summary?: string | undefined;
2712
+ };
2713
+ }, {
2714
+ version: "v2";
2715
+ timestamp: number;
2716
+ runId: string;
2717
+ turnId: string;
2718
+ sequence: number;
2719
+ targetId: string;
2720
+ durable: true;
2721
+ eventType: "turn-complete";
2722
+ snapshot: {
2723
+ metadata: Record<string, unknown>;
2724
+ version: "v2";
2725
+ runId: string;
2726
+ turnId: string;
2727
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2728
+ visibleParts: ({
2729
+ text: string;
2730
+ type: "text";
2731
+ id: string;
2732
+ } | {
2733
+ type: "pending-approval-card";
2734
+ toolCallId: string;
2735
+ id: string;
2736
+ actionId: string;
2737
+ state: "pending_user" | "pending_chain";
2738
+ signatureRequestGroupId: string;
2739
+ description?: string | undefined;
2740
+ label?: string | undefined;
2741
+ } | {
2742
+ type: "tool-state-card";
2743
+ toolCallId: string;
2744
+ id: string;
2745
+ actionId: string;
2746
+ state: "pending_user" | "pending_chain";
2747
+ signatureRequestGroupId: string;
2748
+ description?: string | undefined;
2749
+ label?: string | undefined;
2750
+ } | {
2751
+ type: "tool-state-card";
2752
+ toolCallId: string;
2753
+ id: string;
2754
+ actionId: string;
2755
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2756
+ description?: string | undefined;
2757
+ simulationId?: string | undefined;
2758
+ signatureRequestGroupId?: string | undefined;
2759
+ label?: string | undefined;
2760
+ })[];
2761
+ toolStates: ({
2762
+ toolCallId: string;
2763
+ actionId: string;
2764
+ state: "pending_user" | "pending_chain";
2765
+ signatureRequestGroupId: string;
2766
+ description?: string | undefined;
2767
+ simulationId?: string | undefined;
2768
+ label?: string | undefined;
2769
+ } | {
2770
+ toolCallId: string;
2771
+ actionId: string;
2772
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2773
+ description?: string | undefined;
2774
+ simulationId?: string | undefined;
2775
+ signatureRequestGroupId?: string | undefined;
2776
+ label?: string | undefined;
2777
+ })[];
2778
+ summary?: string | undefined;
2779
+ };
2780
+ }>, z.ZodObject<{
2781
+ version: z.ZodLiteral<"v2">;
2782
+ runId: z.ZodString;
2783
+ turnId: z.ZodString;
2784
+ sequence: z.ZodNumber;
2785
+ targetId: z.ZodString;
2786
+ timestamp: z.ZodNumber;
2787
+ } & {
2788
+ eventType: z.ZodLiteral<"run-complete">;
2789
+ durable: z.ZodLiteral<true>;
2790
+ completedTurnIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2791
+ summary: z.ZodOptional<z.ZodString>;
2792
+ }, "strict", z.ZodTypeAny, {
2793
+ version: "v2";
2794
+ timestamp: number;
2795
+ runId: string;
2796
+ turnId: string;
2797
+ sequence: number;
2798
+ targetId: string;
2799
+ durable: true;
2800
+ eventType: "run-complete";
2801
+ summary?: string | undefined;
2802
+ completedTurnIds?: string[] | undefined;
2803
+ }, {
2804
+ version: "v2";
2805
+ timestamp: number;
2806
+ runId: string;
2807
+ turnId: string;
2808
+ sequence: number;
2809
+ targetId: string;
2810
+ durable: true;
2811
+ eventType: "run-complete";
2812
+ summary?: string | undefined;
2813
+ completedTurnIds?: string[] | undefined;
2814
+ }>, z.ZodObject<{
2815
+ version: z.ZodLiteral<"v2">;
2816
+ runId: z.ZodString;
2817
+ turnId: z.ZodString;
2818
+ sequence: z.ZodNumber;
2819
+ targetId: z.ZodString;
2820
+ timestamp: z.ZodNumber;
2821
+ } & {
2822
+ eventType: z.ZodLiteral<"error-state">;
2823
+ durable: z.ZodLiteral<false>;
2824
+ error: z.ZodString;
2825
+ code: z.ZodOptional<z.ZodString>;
2826
+ }, "strict", z.ZodTypeAny, {
2827
+ error: string;
2828
+ version: "v2";
2829
+ timestamp: number;
2830
+ runId: string;
2831
+ turnId: string;
2832
+ sequence: number;
2833
+ targetId: string;
2834
+ durable: false;
2835
+ eventType: "error-state";
2836
+ code?: string | undefined;
2837
+ }, {
2838
+ error: string;
2839
+ version: "v2";
2840
+ timestamp: number;
2841
+ runId: string;
2842
+ turnId: string;
2843
+ sequence: number;
2844
+ targetId: string;
2845
+ durable: false;
2846
+ eventType: "error-state";
2847
+ code?: string | undefined;
2848
+ }>]>;
2849
+ export declare const chatStreamDataPartSchema: z.ZodObject<{
2850
+ type: z.ZodLiteral<"data-chat-stream">;
2851
+ data: z.ZodUnion<[z.ZodObject<{
2852
+ version: z.ZodLiteral<"v2">;
2853
+ runId: z.ZodString;
2854
+ turnId: z.ZodString;
2855
+ sequence: z.ZodNumber;
2856
+ targetId: z.ZodString;
2857
+ timestamp: z.ZodNumber;
2858
+ } & {
2859
+ eventType: z.ZodLiteral<"turn-start">;
2860
+ durable: z.ZodLiteral<false>;
2861
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
2862
+ }, "strict", z.ZodTypeAny, {
2863
+ version: "v2";
2864
+ timestamp: number;
2865
+ runId: string;
2866
+ turnId: string;
2867
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2868
+ sequence: number;
2869
+ targetId: string;
2870
+ durable: false;
2871
+ eventType: "turn-start";
2872
+ }, {
2873
+ version: "v2";
2874
+ timestamp: number;
2875
+ runId: string;
2876
+ turnId: string;
2877
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2878
+ sequence: number;
2879
+ targetId: string;
2880
+ durable: false;
2881
+ eventType: "turn-start";
2882
+ }>, z.ZodObject<{
2883
+ version: z.ZodLiteral<"v2">;
2884
+ runId: z.ZodString;
2885
+ turnId: z.ZodString;
2886
+ sequence: z.ZodNumber;
2887
+ targetId: z.ZodString;
2888
+ timestamp: z.ZodNumber;
2889
+ } & {
2890
+ eventType: z.ZodLiteral<"transcript-text-start">;
2891
+ durable: z.ZodLiteral<false>;
2892
+ }, "strict", z.ZodTypeAny, {
2893
+ version: "v2";
2894
+ timestamp: number;
2895
+ runId: string;
2896
+ turnId: string;
2897
+ sequence: number;
2898
+ targetId: string;
2899
+ durable: false;
2900
+ eventType: "transcript-text-start";
2901
+ }, {
2902
+ version: "v2";
2903
+ timestamp: number;
2904
+ runId: string;
2905
+ turnId: string;
2906
+ sequence: number;
2907
+ targetId: string;
2908
+ durable: false;
2909
+ eventType: "transcript-text-start";
2910
+ }>, z.ZodObject<{
2911
+ version: z.ZodLiteral<"v2">;
2912
+ runId: z.ZodString;
2913
+ turnId: z.ZodString;
2914
+ sequence: z.ZodNumber;
2915
+ targetId: z.ZodString;
2916
+ timestamp: z.ZodNumber;
2917
+ } & {
2918
+ eventType: z.ZodLiteral<"transcript-text-delta">;
2919
+ durable: z.ZodLiteral<false>;
2920
+ delta: z.ZodString;
2921
+ }, "strict", z.ZodTypeAny, {
2922
+ version: "v2";
2923
+ timestamp: number;
2924
+ delta: string;
2925
+ runId: string;
2926
+ turnId: string;
2927
+ sequence: number;
2928
+ targetId: string;
2929
+ durable: false;
2930
+ eventType: "transcript-text-delta";
2931
+ }, {
2932
+ version: "v2";
2933
+ timestamp: number;
2934
+ delta: string;
2935
+ runId: string;
2936
+ turnId: string;
2937
+ sequence: number;
2938
+ targetId: string;
2939
+ durable: false;
2940
+ eventType: "transcript-text-delta";
2941
+ }>, z.ZodObject<{
2942
+ version: z.ZodLiteral<"v2">;
2943
+ runId: z.ZodString;
2944
+ turnId: z.ZodString;
2945
+ sequence: z.ZodNumber;
2946
+ targetId: z.ZodString;
2947
+ timestamp: z.ZodNumber;
2948
+ } & {
2949
+ eventType: z.ZodLiteral<"transcript-text-end">;
2950
+ durable: z.ZodLiteral<false>;
2951
+ }, "strict", z.ZodTypeAny, {
2952
+ version: "v2";
2953
+ timestamp: number;
2954
+ runId: string;
2955
+ turnId: string;
2956
+ sequence: number;
2957
+ targetId: string;
2958
+ durable: false;
2959
+ eventType: "transcript-text-end";
2960
+ }, {
2961
+ version: "v2";
2962
+ timestamp: number;
2963
+ runId: string;
2964
+ turnId: string;
2965
+ sequence: number;
2966
+ targetId: string;
2967
+ durable: false;
2968
+ eventType: "transcript-text-end";
2969
+ }>, z.ZodObject<{
2970
+ version: z.ZodLiteral<"v2">;
2971
+ runId: z.ZodString;
2972
+ turnId: z.ZodString;
2973
+ sequence: z.ZodNumber;
2974
+ targetId: z.ZodString;
2975
+ timestamp: z.ZodNumber;
2976
+ } & {
2977
+ eventType: z.ZodLiteral<"progress-update">;
2978
+ durable: z.ZodLiteral<false>;
2979
+ message: z.ZodString;
2980
+ label: z.ZodOptional<z.ZodString>;
2981
+ }, "strict", z.ZodTypeAny, {
2982
+ message: string;
2983
+ version: "v2";
2984
+ timestamp: number;
2985
+ runId: string;
2986
+ turnId: string;
2987
+ sequence: number;
2988
+ targetId: string;
2989
+ durable: false;
2990
+ eventType: "progress-update";
2991
+ label?: string | undefined;
2992
+ }, {
2993
+ message: string;
2994
+ version: "v2";
2995
+ timestamp: number;
2996
+ runId: string;
2997
+ turnId: string;
2998
+ sequence: number;
2999
+ targetId: string;
3000
+ durable: false;
3001
+ eventType: "progress-update";
3002
+ label?: string | undefined;
3003
+ }>, z.ZodObject<{
3004
+ version: z.ZodLiteral<"v2">;
3005
+ runId: z.ZodString;
3006
+ turnId: z.ZodString;
3007
+ sequence: z.ZodNumber;
3008
+ targetId: z.ZodString;
3009
+ timestamp: z.ZodNumber;
3010
+ } & {
3011
+ eventType: z.ZodLiteral<"tool-state">;
3012
+ durable: z.ZodLiteral<true>;
3013
+ actionId: z.ZodString;
3014
+ toolCallId: z.ZodString;
3015
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
3016
+ simulationId: z.ZodOptional<z.ZodString>;
3017
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
3018
+ label: z.ZodOptional<z.ZodString>;
3019
+ description: z.ZodOptional<z.ZodString>;
3020
+ }, "strict", z.ZodTypeAny, {
3021
+ toolCallId: string;
3022
+ version: "v2";
3023
+ timestamp: number;
3024
+ actionId: string;
3025
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3026
+ runId: string;
3027
+ turnId: string;
3028
+ sequence: number;
3029
+ targetId: string;
3030
+ durable: true;
3031
+ eventType: "tool-state";
3032
+ description?: string | undefined;
3033
+ simulationId?: string | undefined;
3034
+ signatureRequestGroupId?: string | undefined;
3035
+ label?: string | undefined;
3036
+ }, {
3037
+ toolCallId: string;
3038
+ version: "v2";
3039
+ timestamp: number;
3040
+ actionId: string;
3041
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3042
+ runId: string;
3043
+ turnId: string;
3044
+ sequence: number;
3045
+ targetId: string;
3046
+ durable: true;
3047
+ eventType: "tool-state";
3048
+ description?: string | undefined;
3049
+ simulationId?: string | undefined;
3050
+ signatureRequestGroupId?: string | undefined;
3051
+ label?: string | undefined;
3052
+ }>, z.ZodUnion<[z.ZodObject<{
3053
+ version: z.ZodLiteral<"v2">;
3054
+ runId: z.ZodString;
3055
+ turnId: z.ZodString;
3056
+ sequence: z.ZodNumber;
3057
+ targetId: z.ZodString;
3058
+ timestamp: z.ZodNumber;
3059
+ } & {
3060
+ eventType: z.ZodLiteral<"simulation-state">;
3061
+ durable: z.ZodLiteral<false>;
3062
+ actionId: z.ZodString;
3063
+ simulationId: z.ZodString;
3064
+ toolCallId: z.ZodOptional<z.ZodString>;
3065
+ state: z.ZodEnum<["pending", "superseded"]>;
3066
+ summary: z.ZodOptional<z.ZodString>;
3067
+ error: z.ZodOptional<z.ZodString>;
3068
+ }, "strict", z.ZodTypeAny, {
3069
+ simulationId: string;
3070
+ version: "v2";
3071
+ timestamp: number;
3072
+ actionId: string;
3073
+ state: "pending" | "superseded";
3074
+ runId: string;
3075
+ turnId: string;
3076
+ sequence: number;
3077
+ targetId: string;
3078
+ durable: false;
3079
+ eventType: "simulation-state";
3080
+ error?: string | undefined;
3081
+ toolCallId?: string | undefined;
3082
+ summary?: string | undefined;
3083
+ }, {
3084
+ simulationId: string;
3085
+ version: "v2";
3086
+ timestamp: number;
3087
+ actionId: string;
3088
+ state: "pending" | "superseded";
3089
+ runId: string;
3090
+ turnId: string;
3091
+ sequence: number;
3092
+ targetId: string;
3093
+ durable: false;
3094
+ eventType: "simulation-state";
3095
+ error?: string | undefined;
3096
+ toolCallId?: string | undefined;
3097
+ summary?: string | undefined;
3098
+ }>, z.ZodObject<{
3099
+ version: z.ZodLiteral<"v2">;
3100
+ runId: z.ZodString;
3101
+ turnId: z.ZodString;
3102
+ sequence: z.ZodNumber;
3103
+ targetId: z.ZodString;
3104
+ timestamp: z.ZodNumber;
3105
+ } & {
3106
+ eventType: z.ZodLiteral<"simulation-state">;
3107
+ durable: z.ZodBoolean;
3108
+ actionId: z.ZodString;
3109
+ simulationId: z.ZodString;
3110
+ toolCallId: z.ZodOptional<z.ZodString>;
3111
+ state: z.ZodEnum<["complete", "failed"]>;
3112
+ summary: z.ZodOptional<z.ZodString>;
3113
+ error: z.ZodOptional<z.ZodString>;
3114
+ }, "strict", z.ZodTypeAny, {
3115
+ simulationId: string;
3116
+ version: "v2";
3117
+ timestamp: number;
3118
+ actionId: string;
3119
+ state: "failed" | "complete";
3120
+ runId: string;
3121
+ turnId: string;
3122
+ sequence: number;
3123
+ targetId: string;
3124
+ durable: boolean;
3125
+ eventType: "simulation-state";
3126
+ error?: string | undefined;
3127
+ toolCallId?: string | undefined;
3128
+ summary?: string | undefined;
3129
+ }, {
3130
+ simulationId: string;
3131
+ version: "v2";
3132
+ timestamp: number;
3133
+ actionId: string;
3134
+ state: "failed" | "complete";
3135
+ runId: string;
3136
+ turnId: string;
3137
+ sequence: number;
3138
+ targetId: string;
3139
+ durable: boolean;
3140
+ eventType: "simulation-state";
3141
+ error?: string | undefined;
3142
+ toolCallId?: string | undefined;
3143
+ summary?: string | undefined;
3144
+ }>]>, z.ZodObject<{
3145
+ version: z.ZodLiteral<"v2">;
3146
+ runId: z.ZodString;
3147
+ turnId: z.ZodString;
3148
+ sequence: z.ZodNumber;
3149
+ targetId: z.ZodString;
3150
+ timestamp: z.ZodNumber;
3151
+ } & {
3152
+ eventType: z.ZodLiteral<"signature-state">;
3153
+ durable: z.ZodLiteral<true>;
3154
+ actionId: z.ZodString;
3155
+ toolCallId: z.ZodString;
3156
+ signatureRequestGroupId: z.ZodString;
3157
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
3158
+ label: z.ZodOptional<z.ZodString>;
3159
+ description: z.ZodOptional<z.ZodString>;
3160
+ }, "strict", z.ZodTypeAny, {
3161
+ toolCallId: string;
3162
+ version: "v2";
3163
+ timestamp: number;
3164
+ actionId: string;
3165
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3166
+ signatureRequestGroupId: string;
3167
+ runId: string;
3168
+ turnId: string;
3169
+ sequence: number;
3170
+ targetId: string;
3171
+ durable: true;
3172
+ eventType: "signature-state";
3173
+ description?: string | undefined;
3174
+ label?: string | undefined;
3175
+ }, {
3176
+ toolCallId: string;
3177
+ version: "v2";
3178
+ timestamp: number;
3179
+ actionId: string;
3180
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3181
+ signatureRequestGroupId: string;
3182
+ runId: string;
3183
+ turnId: string;
3184
+ sequence: number;
3185
+ targetId: string;
3186
+ durable: true;
3187
+ eventType: "signature-state";
3188
+ description?: string | undefined;
3189
+ label?: string | undefined;
3190
+ }>, z.ZodObject<{
3191
+ version: z.ZodLiteral<"v2">;
3192
+ runId: z.ZodString;
3193
+ turnId: z.ZodString;
3194
+ sequence: z.ZodNumber;
3195
+ targetId: z.ZodString;
3196
+ timestamp: z.ZodNumber;
3197
+ } & {
3198
+ eventType: z.ZodLiteral<"turn-summary">;
3199
+ durable: z.ZodLiteral<true>;
3200
+ summary: z.ZodString;
3201
+ }, "strict", z.ZodTypeAny, {
3202
+ version: "v2";
3203
+ timestamp: number;
3204
+ runId: string;
3205
+ turnId: string;
3206
+ summary: string;
3207
+ sequence: number;
3208
+ targetId: string;
3209
+ durable: true;
3210
+ eventType: "turn-summary";
3211
+ }, {
3212
+ version: "v2";
3213
+ timestamp: number;
3214
+ runId: string;
3215
+ turnId: string;
3216
+ summary: string;
3217
+ sequence: number;
3218
+ targetId: string;
3219
+ durable: true;
3220
+ eventType: "turn-summary";
3221
+ }>, z.ZodEffects<z.ZodObject<{
3222
+ version: z.ZodLiteral<"v2">;
3223
+ runId: z.ZodString;
3224
+ turnId: z.ZodString;
3225
+ sequence: z.ZodNumber;
3226
+ targetId: z.ZodString;
3227
+ timestamp: z.ZodNumber;
3228
+ } & {
3229
+ eventType: z.ZodLiteral<"turn-complete">;
3230
+ durable: z.ZodLiteral<true>;
3231
+ snapshot: z.ZodEffects<z.ZodObject<{
3232
+ version: z.ZodLiteral<"v2">;
3233
+ runId: z.ZodString;
3234
+ turnId: z.ZodString;
3235
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
3236
+ summary: z.ZodOptional<z.ZodString>;
3237
+ visibleParts: z.ZodArray<z.ZodUnion<[z.ZodObject<{
3238
+ type: z.ZodLiteral<"text">;
3239
+ id: z.ZodString;
3240
+ text: z.ZodString;
3241
+ }, "strict", z.ZodTypeAny, {
3242
+ text: string;
3243
+ type: "text";
3244
+ id: string;
3245
+ }, {
3246
+ text: string;
3247
+ type: "text";
3248
+ id: string;
3249
+ }>, z.ZodObject<{
3250
+ type: z.ZodLiteral<"pending-approval-card">;
3251
+ id: z.ZodString;
3252
+ actionId: z.ZodString;
3253
+ toolCallId: z.ZodString;
3254
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
3255
+ signatureRequestGroupId: z.ZodString;
3256
+ label: z.ZodOptional<z.ZodString>;
3257
+ description: z.ZodOptional<z.ZodString>;
3258
+ }, "strict", z.ZodTypeAny, {
3259
+ type: "pending-approval-card";
3260
+ toolCallId: string;
3261
+ id: string;
3262
+ actionId: string;
3263
+ state: "pending_user" | "pending_chain";
3264
+ signatureRequestGroupId: string;
3265
+ description?: string | undefined;
3266
+ label?: string | undefined;
3267
+ }, {
3268
+ type: "pending-approval-card";
3269
+ toolCallId: string;
3270
+ id: string;
3271
+ actionId: string;
3272
+ state: "pending_user" | "pending_chain";
3273
+ signatureRequestGroupId: string;
3274
+ description?: string | undefined;
3275
+ label?: string | undefined;
3276
+ }>, z.ZodUnion<[z.ZodObject<{
3277
+ type: z.ZodLiteral<"tool-state-card">;
3278
+ id: z.ZodString;
3279
+ actionId: z.ZodString;
3280
+ toolCallId: z.ZodString;
3281
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
3282
+ signatureRequestGroupId: z.ZodString;
3283
+ label: z.ZodOptional<z.ZodString>;
3284
+ description: z.ZodOptional<z.ZodString>;
3285
+ }, "strict", z.ZodTypeAny, {
3286
+ type: "tool-state-card";
3287
+ toolCallId: string;
3288
+ id: string;
3289
+ actionId: string;
3290
+ state: "pending_user" | "pending_chain";
3291
+ signatureRequestGroupId: string;
3292
+ description?: string | undefined;
3293
+ label?: string | undefined;
3294
+ }, {
3295
+ type: "tool-state-card";
3296
+ toolCallId: string;
3297
+ id: string;
3298
+ actionId: string;
3299
+ state: "pending_user" | "pending_chain";
3300
+ signatureRequestGroupId: string;
3301
+ description?: string | undefined;
3302
+ label?: string | undefined;
3303
+ }>, z.ZodObject<{
3304
+ type: z.ZodLiteral<"tool-state-card">;
3305
+ id: z.ZodString;
3306
+ actionId: z.ZodString;
3307
+ toolCallId: z.ZodString;
3308
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
3309
+ simulationId: z.ZodOptional<z.ZodString>;
3310
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
3311
+ label: z.ZodOptional<z.ZodString>;
3312
+ description: z.ZodOptional<z.ZodString>;
3313
+ }, "strict", z.ZodTypeAny, {
3314
+ type: "tool-state-card";
3315
+ toolCallId: string;
3316
+ id: string;
3317
+ actionId: string;
3318
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3319
+ description?: string | undefined;
3320
+ simulationId?: string | undefined;
3321
+ signatureRequestGroupId?: string | undefined;
3322
+ label?: string | undefined;
3323
+ }, {
3324
+ type: "tool-state-card";
3325
+ toolCallId: string;
3326
+ id: string;
3327
+ actionId: string;
3328
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3329
+ description?: string | undefined;
3330
+ simulationId?: string | undefined;
3331
+ signatureRequestGroupId?: string | undefined;
3332
+ label?: string | undefined;
3333
+ }>]>]>, "many">;
3334
+ toolStates: z.ZodArray<z.ZodUnion<[z.ZodObject<{
3335
+ actionId: z.ZodString;
3336
+ toolCallId: z.ZodString;
3337
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
3338
+ simulationId: z.ZodOptional<z.ZodString>;
3339
+ signatureRequestGroupId: z.ZodString;
3340
+ label: z.ZodOptional<z.ZodString>;
3341
+ description: z.ZodOptional<z.ZodString>;
3342
+ }, "strict", z.ZodTypeAny, {
3343
+ toolCallId: string;
3344
+ actionId: string;
3345
+ state: "pending_user" | "pending_chain";
3346
+ signatureRequestGroupId: string;
3347
+ description?: string | undefined;
3348
+ simulationId?: string | undefined;
3349
+ label?: string | undefined;
3350
+ }, {
3351
+ toolCallId: string;
3352
+ actionId: string;
3353
+ state: "pending_user" | "pending_chain";
3354
+ signatureRequestGroupId: string;
3355
+ description?: string | undefined;
3356
+ simulationId?: string | undefined;
3357
+ label?: string | undefined;
3358
+ }>, z.ZodObject<{
3359
+ actionId: z.ZodString;
3360
+ toolCallId: z.ZodString;
3361
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
3362
+ simulationId: z.ZodOptional<z.ZodString>;
3363
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
3364
+ label: z.ZodOptional<z.ZodString>;
3365
+ description: z.ZodOptional<z.ZodString>;
3366
+ }, "strict", z.ZodTypeAny, {
3367
+ toolCallId: string;
3368
+ actionId: string;
3369
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3370
+ description?: string | undefined;
3371
+ simulationId?: string | undefined;
3372
+ signatureRequestGroupId?: string | undefined;
3373
+ label?: string | undefined;
3374
+ }, {
3375
+ toolCallId: string;
3376
+ actionId: string;
3377
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3378
+ description?: string | undefined;
3379
+ simulationId?: string | undefined;
3380
+ signatureRequestGroupId?: string | undefined;
3381
+ label?: string | undefined;
3382
+ }>]>, "many">;
3383
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3384
+ }, "strict", z.ZodTypeAny, {
3385
+ metadata: Record<string, unknown>;
3386
+ version: "v2";
3387
+ runId: string;
3388
+ turnId: string;
3389
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3390
+ visibleParts: ({
3391
+ text: string;
3392
+ type: "text";
3393
+ id: string;
3394
+ } | {
3395
+ type: "pending-approval-card";
3396
+ toolCallId: string;
3397
+ id: string;
3398
+ actionId: string;
3399
+ state: "pending_user" | "pending_chain";
3400
+ signatureRequestGroupId: string;
3401
+ description?: string | undefined;
3402
+ label?: string | undefined;
3403
+ } | {
3404
+ type: "tool-state-card";
3405
+ toolCallId: string;
3406
+ id: string;
3407
+ actionId: string;
3408
+ state: "pending_user" | "pending_chain";
3409
+ signatureRequestGroupId: string;
3410
+ description?: string | undefined;
3411
+ label?: string | undefined;
3412
+ } | {
3413
+ type: "tool-state-card";
3414
+ toolCallId: string;
3415
+ id: string;
3416
+ actionId: string;
3417
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3418
+ description?: string | undefined;
3419
+ simulationId?: string | undefined;
3420
+ signatureRequestGroupId?: string | undefined;
3421
+ label?: string | undefined;
3422
+ })[];
3423
+ toolStates: ({
3424
+ toolCallId: string;
3425
+ actionId: string;
3426
+ state: "pending_user" | "pending_chain";
3427
+ signatureRequestGroupId: string;
3428
+ description?: string | undefined;
3429
+ simulationId?: string | undefined;
3430
+ label?: string | undefined;
3431
+ } | {
3432
+ toolCallId: string;
3433
+ actionId: string;
3434
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3435
+ description?: string | undefined;
3436
+ simulationId?: string | undefined;
3437
+ signatureRequestGroupId?: string | undefined;
3438
+ label?: string | undefined;
3439
+ })[];
3440
+ summary?: string | undefined;
3441
+ }, {
3442
+ metadata: Record<string, unknown>;
3443
+ version: "v2";
3444
+ runId: string;
3445
+ turnId: string;
3446
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3447
+ visibleParts: ({
3448
+ text: string;
3449
+ type: "text";
3450
+ id: string;
3451
+ } | {
3452
+ type: "pending-approval-card";
3453
+ toolCallId: string;
3454
+ id: string;
3455
+ actionId: string;
3456
+ state: "pending_user" | "pending_chain";
3457
+ signatureRequestGroupId: string;
3458
+ description?: string | undefined;
3459
+ label?: string | undefined;
3460
+ } | {
3461
+ type: "tool-state-card";
3462
+ toolCallId: string;
3463
+ id: string;
3464
+ actionId: string;
3465
+ state: "pending_user" | "pending_chain";
3466
+ signatureRequestGroupId: string;
3467
+ description?: string | undefined;
3468
+ label?: string | undefined;
3469
+ } | {
3470
+ type: "tool-state-card";
3471
+ toolCallId: string;
3472
+ id: string;
3473
+ actionId: string;
3474
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3475
+ description?: string | undefined;
3476
+ simulationId?: string | undefined;
3477
+ signatureRequestGroupId?: string | undefined;
3478
+ label?: string | undefined;
3479
+ })[];
3480
+ toolStates: ({
3481
+ toolCallId: string;
3482
+ actionId: string;
3483
+ state: "pending_user" | "pending_chain";
3484
+ signatureRequestGroupId: string;
3485
+ description?: string | undefined;
3486
+ simulationId?: string | undefined;
3487
+ label?: string | undefined;
3488
+ } | {
3489
+ toolCallId: string;
3490
+ actionId: string;
3491
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3492
+ description?: string | undefined;
3493
+ simulationId?: string | undefined;
3494
+ signatureRequestGroupId?: string | undefined;
3495
+ label?: string | undefined;
3496
+ })[];
3497
+ summary?: string | undefined;
3498
+ }>, {
3499
+ metadata: Record<string, unknown>;
3500
+ version: "v2";
3501
+ runId: string;
3502
+ turnId: string;
3503
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3504
+ visibleParts: ({
3505
+ text: string;
3506
+ type: "text";
3507
+ id: string;
3508
+ } | {
3509
+ type: "pending-approval-card";
3510
+ toolCallId: string;
3511
+ id: string;
3512
+ actionId: string;
3513
+ state: "pending_user" | "pending_chain";
3514
+ signatureRequestGroupId: string;
3515
+ description?: string | undefined;
3516
+ label?: string | undefined;
3517
+ } | {
3518
+ type: "tool-state-card";
3519
+ toolCallId: string;
3520
+ id: string;
3521
+ actionId: string;
3522
+ state: "pending_user" | "pending_chain";
3523
+ signatureRequestGroupId: string;
3524
+ description?: string | undefined;
3525
+ label?: string | undefined;
3526
+ } | {
3527
+ type: "tool-state-card";
3528
+ toolCallId: string;
3529
+ id: string;
3530
+ actionId: string;
3531
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3532
+ description?: string | undefined;
3533
+ simulationId?: string | undefined;
3534
+ signatureRequestGroupId?: string | undefined;
3535
+ label?: string | undefined;
3536
+ })[];
3537
+ toolStates: ({
3538
+ toolCallId: string;
3539
+ actionId: string;
3540
+ state: "pending_user" | "pending_chain";
3541
+ signatureRequestGroupId: string;
3542
+ description?: string | undefined;
3543
+ simulationId?: string | undefined;
3544
+ label?: string | undefined;
3545
+ } | {
3546
+ toolCallId: string;
3547
+ actionId: string;
3548
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3549
+ description?: string | undefined;
3550
+ simulationId?: string | undefined;
3551
+ signatureRequestGroupId?: string | undefined;
3552
+ label?: string | undefined;
3553
+ })[];
3554
+ summary?: string | undefined;
3555
+ }, {
3556
+ metadata: Record<string, unknown>;
3557
+ version: "v2";
3558
+ runId: string;
3559
+ turnId: string;
3560
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3561
+ visibleParts: ({
3562
+ text: string;
3563
+ type: "text";
3564
+ id: string;
3565
+ } | {
3566
+ type: "pending-approval-card";
3567
+ toolCallId: string;
3568
+ id: string;
3569
+ actionId: string;
3570
+ state: "pending_user" | "pending_chain";
3571
+ signatureRequestGroupId: string;
3572
+ description?: string | undefined;
3573
+ label?: string | undefined;
3574
+ } | {
3575
+ type: "tool-state-card";
3576
+ toolCallId: string;
3577
+ id: string;
3578
+ actionId: string;
3579
+ state: "pending_user" | "pending_chain";
3580
+ signatureRequestGroupId: string;
3581
+ description?: string | undefined;
3582
+ label?: string | undefined;
3583
+ } | {
3584
+ type: "tool-state-card";
3585
+ toolCallId: string;
3586
+ id: string;
3587
+ actionId: string;
3588
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3589
+ description?: string | undefined;
3590
+ simulationId?: string | undefined;
3591
+ signatureRequestGroupId?: string | undefined;
3592
+ label?: string | undefined;
3593
+ })[];
3594
+ toolStates: ({
3595
+ toolCallId: string;
3596
+ actionId: string;
3597
+ state: "pending_user" | "pending_chain";
3598
+ signatureRequestGroupId: string;
3599
+ description?: string | undefined;
3600
+ simulationId?: string | undefined;
3601
+ label?: string | undefined;
3602
+ } | {
3603
+ toolCallId: string;
3604
+ actionId: string;
3605
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3606
+ description?: string | undefined;
3607
+ simulationId?: string | undefined;
3608
+ signatureRequestGroupId?: string | undefined;
3609
+ label?: string | undefined;
3610
+ })[];
3611
+ summary?: string | undefined;
3612
+ }>;
3613
+ }, "strict", z.ZodTypeAny, {
3614
+ version: "v2";
3615
+ timestamp: number;
3616
+ runId: string;
3617
+ turnId: string;
3618
+ sequence: number;
3619
+ targetId: string;
3620
+ durable: true;
3621
+ eventType: "turn-complete";
3622
+ snapshot: {
3623
+ metadata: Record<string, unknown>;
3624
+ version: "v2";
3625
+ runId: string;
3626
+ turnId: string;
3627
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3628
+ visibleParts: ({
3629
+ text: string;
3630
+ type: "text";
3631
+ id: string;
3632
+ } | {
3633
+ type: "pending-approval-card";
3634
+ toolCallId: string;
3635
+ id: string;
3636
+ actionId: string;
3637
+ state: "pending_user" | "pending_chain";
3638
+ signatureRequestGroupId: string;
3639
+ description?: string | undefined;
3640
+ label?: string | undefined;
3641
+ } | {
3642
+ type: "tool-state-card";
3643
+ toolCallId: string;
3644
+ id: string;
3645
+ actionId: string;
3646
+ state: "pending_user" | "pending_chain";
3647
+ signatureRequestGroupId: string;
3648
+ description?: string | undefined;
3649
+ label?: string | undefined;
3650
+ } | {
3651
+ type: "tool-state-card";
3652
+ toolCallId: string;
3653
+ id: string;
3654
+ actionId: string;
3655
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3656
+ description?: string | undefined;
3657
+ simulationId?: string | undefined;
3658
+ signatureRequestGroupId?: string | undefined;
3659
+ label?: string | undefined;
3660
+ })[];
3661
+ toolStates: ({
3662
+ toolCallId: string;
3663
+ actionId: string;
3664
+ state: "pending_user" | "pending_chain";
3665
+ signatureRequestGroupId: string;
3666
+ description?: string | undefined;
3667
+ simulationId?: string | undefined;
3668
+ label?: string | undefined;
3669
+ } | {
3670
+ toolCallId: string;
3671
+ actionId: string;
3672
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3673
+ description?: string | undefined;
3674
+ simulationId?: string | undefined;
3675
+ signatureRequestGroupId?: string | undefined;
3676
+ label?: string | undefined;
3677
+ })[];
3678
+ summary?: string | undefined;
3679
+ };
3680
+ }, {
3681
+ version: "v2";
3682
+ timestamp: number;
3683
+ runId: string;
3684
+ turnId: string;
3685
+ sequence: number;
3686
+ targetId: string;
3687
+ durable: true;
3688
+ eventType: "turn-complete";
3689
+ snapshot: {
3690
+ metadata: Record<string, unknown>;
3691
+ version: "v2";
3692
+ runId: string;
3693
+ turnId: string;
3694
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3695
+ visibleParts: ({
3696
+ text: string;
3697
+ type: "text";
3698
+ id: string;
3699
+ } | {
3700
+ type: "pending-approval-card";
3701
+ toolCallId: string;
3702
+ id: string;
3703
+ actionId: string;
3704
+ state: "pending_user" | "pending_chain";
3705
+ signatureRequestGroupId: string;
3706
+ description?: string | undefined;
3707
+ label?: string | undefined;
3708
+ } | {
3709
+ type: "tool-state-card";
3710
+ toolCallId: string;
3711
+ id: string;
3712
+ actionId: string;
3713
+ state: "pending_user" | "pending_chain";
3714
+ signatureRequestGroupId: string;
3715
+ description?: string | undefined;
3716
+ label?: string | undefined;
3717
+ } | {
3718
+ type: "tool-state-card";
3719
+ toolCallId: string;
3720
+ id: string;
3721
+ actionId: string;
3722
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3723
+ description?: string | undefined;
3724
+ simulationId?: string | undefined;
3725
+ signatureRequestGroupId?: string | undefined;
3726
+ label?: string | undefined;
3727
+ })[];
3728
+ toolStates: ({
3729
+ toolCallId: string;
3730
+ actionId: string;
3731
+ state: "pending_user" | "pending_chain";
3732
+ signatureRequestGroupId: string;
3733
+ description?: string | undefined;
3734
+ simulationId?: string | undefined;
3735
+ label?: string | undefined;
3736
+ } | {
3737
+ toolCallId: string;
3738
+ actionId: string;
3739
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3740
+ description?: string | undefined;
3741
+ simulationId?: string | undefined;
3742
+ signatureRequestGroupId?: string | undefined;
3743
+ label?: string | undefined;
3744
+ })[];
3745
+ summary?: string | undefined;
3746
+ };
3747
+ }>, {
3748
+ version: "v2";
3749
+ timestamp: number;
3750
+ runId: string;
3751
+ turnId: string;
3752
+ sequence: number;
3753
+ targetId: string;
3754
+ durable: true;
3755
+ eventType: "turn-complete";
3756
+ snapshot: {
3757
+ metadata: Record<string, unknown>;
3758
+ version: "v2";
3759
+ runId: string;
3760
+ turnId: string;
3761
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3762
+ visibleParts: ({
3763
+ text: string;
3764
+ type: "text";
3765
+ id: string;
3766
+ } | {
3767
+ type: "pending-approval-card";
3768
+ toolCallId: string;
3769
+ id: string;
3770
+ actionId: string;
3771
+ state: "pending_user" | "pending_chain";
3772
+ signatureRequestGroupId: string;
3773
+ description?: string | undefined;
3774
+ label?: string | undefined;
3775
+ } | {
3776
+ type: "tool-state-card";
3777
+ toolCallId: string;
3778
+ id: string;
3779
+ actionId: string;
3780
+ state: "pending_user" | "pending_chain";
3781
+ signatureRequestGroupId: string;
3782
+ description?: string | undefined;
3783
+ label?: string | undefined;
3784
+ } | {
3785
+ type: "tool-state-card";
3786
+ toolCallId: string;
3787
+ id: string;
3788
+ actionId: string;
3789
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3790
+ description?: string | undefined;
3791
+ simulationId?: string | undefined;
3792
+ signatureRequestGroupId?: string | undefined;
3793
+ label?: string | undefined;
3794
+ })[];
3795
+ toolStates: ({
3796
+ toolCallId: string;
3797
+ actionId: string;
3798
+ state: "pending_user" | "pending_chain";
3799
+ signatureRequestGroupId: string;
3800
+ description?: string | undefined;
3801
+ simulationId?: string | undefined;
3802
+ label?: string | undefined;
3803
+ } | {
3804
+ toolCallId: string;
3805
+ actionId: string;
3806
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3807
+ description?: string | undefined;
3808
+ simulationId?: string | undefined;
3809
+ signatureRequestGroupId?: string | undefined;
3810
+ label?: string | undefined;
3811
+ })[];
3812
+ summary?: string | undefined;
3813
+ };
3814
+ }, {
3815
+ version: "v2";
3816
+ timestamp: number;
3817
+ runId: string;
3818
+ turnId: string;
3819
+ sequence: number;
3820
+ targetId: string;
3821
+ durable: true;
3822
+ eventType: "turn-complete";
3823
+ snapshot: {
3824
+ metadata: Record<string, unknown>;
3825
+ version: "v2";
3826
+ runId: string;
3827
+ turnId: string;
3828
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3829
+ visibleParts: ({
3830
+ text: string;
3831
+ type: "text";
3832
+ id: string;
3833
+ } | {
3834
+ type: "pending-approval-card";
3835
+ toolCallId: string;
3836
+ id: string;
3837
+ actionId: string;
3838
+ state: "pending_user" | "pending_chain";
3839
+ signatureRequestGroupId: string;
3840
+ description?: string | undefined;
3841
+ label?: string | undefined;
3842
+ } | {
3843
+ type: "tool-state-card";
3844
+ toolCallId: string;
3845
+ id: string;
3846
+ actionId: string;
3847
+ state: "pending_user" | "pending_chain";
3848
+ signatureRequestGroupId: string;
3849
+ description?: string | undefined;
3850
+ label?: string | undefined;
3851
+ } | {
3852
+ type: "tool-state-card";
3853
+ toolCallId: string;
3854
+ id: string;
3855
+ actionId: string;
3856
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3857
+ description?: string | undefined;
3858
+ simulationId?: string | undefined;
3859
+ signatureRequestGroupId?: string | undefined;
3860
+ label?: string | undefined;
3861
+ })[];
3862
+ toolStates: ({
3863
+ toolCallId: string;
3864
+ actionId: string;
3865
+ state: "pending_user" | "pending_chain";
3866
+ signatureRequestGroupId: string;
3867
+ description?: string | undefined;
3868
+ simulationId?: string | undefined;
3869
+ label?: string | undefined;
3870
+ } | {
3871
+ toolCallId: string;
3872
+ actionId: string;
3873
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3874
+ description?: string | undefined;
3875
+ simulationId?: string | undefined;
3876
+ signatureRequestGroupId?: string | undefined;
3877
+ label?: string | undefined;
3878
+ })[];
3879
+ summary?: string | undefined;
3880
+ };
3881
+ }>, z.ZodObject<{
3882
+ version: z.ZodLiteral<"v2">;
3883
+ runId: z.ZodString;
3884
+ turnId: z.ZodString;
3885
+ sequence: z.ZodNumber;
3886
+ targetId: z.ZodString;
3887
+ timestamp: z.ZodNumber;
3888
+ } & {
3889
+ eventType: z.ZodLiteral<"run-complete">;
3890
+ durable: z.ZodLiteral<true>;
3891
+ completedTurnIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3892
+ summary: z.ZodOptional<z.ZodString>;
3893
+ }, "strict", z.ZodTypeAny, {
3894
+ version: "v2";
3895
+ timestamp: number;
3896
+ runId: string;
3897
+ turnId: string;
3898
+ sequence: number;
3899
+ targetId: string;
3900
+ durable: true;
3901
+ eventType: "run-complete";
3902
+ summary?: string | undefined;
3903
+ completedTurnIds?: string[] | undefined;
3904
+ }, {
3905
+ version: "v2";
3906
+ timestamp: number;
3907
+ runId: string;
3908
+ turnId: string;
3909
+ sequence: number;
3910
+ targetId: string;
3911
+ durable: true;
3912
+ eventType: "run-complete";
3913
+ summary?: string | undefined;
3914
+ completedTurnIds?: string[] | undefined;
3915
+ }>, z.ZodObject<{
3916
+ version: z.ZodLiteral<"v2">;
3917
+ runId: z.ZodString;
3918
+ turnId: z.ZodString;
3919
+ sequence: z.ZodNumber;
3920
+ targetId: z.ZodString;
3921
+ timestamp: z.ZodNumber;
3922
+ } & {
3923
+ eventType: z.ZodLiteral<"error-state">;
3924
+ durable: z.ZodLiteral<false>;
3925
+ error: z.ZodString;
3926
+ code: z.ZodOptional<z.ZodString>;
3927
+ }, "strict", z.ZodTypeAny, {
3928
+ error: string;
3929
+ version: "v2";
3930
+ timestamp: number;
3931
+ runId: string;
3932
+ turnId: string;
3933
+ sequence: number;
3934
+ targetId: string;
3935
+ durable: false;
3936
+ eventType: "error-state";
3937
+ code?: string | undefined;
3938
+ }, {
3939
+ error: string;
3940
+ version: "v2";
3941
+ timestamp: number;
3942
+ runId: string;
3943
+ turnId: string;
3944
+ sequence: number;
3945
+ targetId: string;
3946
+ durable: false;
3947
+ eventType: "error-state";
3948
+ code?: string | undefined;
3949
+ }>]>;
3950
+ }, "strict", z.ZodTypeAny, {
3951
+ type: "data-chat-stream";
3952
+ data: {
3953
+ version: "v2";
3954
+ timestamp: number;
3955
+ runId: string;
3956
+ turnId: string;
3957
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3958
+ sequence: number;
3959
+ targetId: string;
3960
+ durable: false;
3961
+ eventType: "turn-start";
3962
+ } | {
3963
+ version: "v2";
3964
+ timestamp: number;
3965
+ runId: string;
3966
+ turnId: string;
3967
+ sequence: number;
3968
+ targetId: string;
3969
+ durable: false;
3970
+ eventType: "transcript-text-start";
3971
+ } | {
3972
+ version: "v2";
3973
+ timestamp: number;
3974
+ delta: string;
3975
+ runId: string;
3976
+ turnId: string;
3977
+ sequence: number;
3978
+ targetId: string;
3979
+ durable: false;
3980
+ eventType: "transcript-text-delta";
3981
+ } | {
3982
+ version: "v2";
3983
+ timestamp: number;
3984
+ runId: string;
3985
+ turnId: string;
3986
+ sequence: number;
3987
+ targetId: string;
3988
+ durable: false;
3989
+ eventType: "transcript-text-end";
3990
+ } | {
3991
+ message: string;
3992
+ version: "v2";
3993
+ timestamp: number;
3994
+ runId: string;
3995
+ turnId: string;
3996
+ sequence: number;
3997
+ targetId: string;
3998
+ durable: false;
3999
+ eventType: "progress-update";
4000
+ label?: string | undefined;
4001
+ } | {
4002
+ toolCallId: string;
4003
+ version: "v2";
4004
+ timestamp: number;
4005
+ actionId: string;
4006
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
4007
+ runId: string;
4008
+ turnId: string;
4009
+ sequence: number;
4010
+ targetId: string;
4011
+ durable: true;
4012
+ eventType: "tool-state";
4013
+ description?: string | undefined;
4014
+ simulationId?: string | undefined;
4015
+ signatureRequestGroupId?: string | undefined;
4016
+ label?: string | undefined;
4017
+ } | {
4018
+ simulationId: string;
4019
+ version: "v2";
4020
+ timestamp: number;
4021
+ actionId: string;
4022
+ state: "pending" | "superseded";
4023
+ runId: string;
4024
+ turnId: string;
4025
+ sequence: number;
4026
+ targetId: string;
4027
+ durable: false;
4028
+ eventType: "simulation-state";
4029
+ error?: string | undefined;
4030
+ toolCallId?: string | undefined;
4031
+ summary?: string | undefined;
4032
+ } | {
4033
+ simulationId: string;
4034
+ version: "v2";
4035
+ timestamp: number;
4036
+ actionId: string;
4037
+ state: "failed" | "complete";
4038
+ runId: string;
4039
+ turnId: string;
4040
+ sequence: number;
4041
+ targetId: string;
4042
+ durable: boolean;
4043
+ eventType: "simulation-state";
4044
+ error?: string | undefined;
4045
+ toolCallId?: string | undefined;
4046
+ summary?: string | undefined;
4047
+ } | {
4048
+ toolCallId: string;
4049
+ version: "v2";
4050
+ timestamp: number;
4051
+ actionId: string;
4052
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
4053
+ signatureRequestGroupId: string;
4054
+ runId: string;
4055
+ turnId: string;
4056
+ sequence: number;
4057
+ targetId: string;
4058
+ durable: true;
4059
+ eventType: "signature-state";
4060
+ description?: string | undefined;
4061
+ label?: string | undefined;
4062
+ } | {
4063
+ version: "v2";
4064
+ timestamp: number;
4065
+ runId: string;
4066
+ turnId: string;
4067
+ summary: string;
4068
+ sequence: number;
4069
+ targetId: string;
4070
+ durable: true;
4071
+ eventType: "turn-summary";
4072
+ } | {
4073
+ version: "v2";
4074
+ timestamp: number;
4075
+ runId: string;
4076
+ turnId: string;
4077
+ sequence: number;
4078
+ targetId: string;
4079
+ durable: true;
4080
+ eventType: "turn-complete";
4081
+ snapshot: {
4082
+ metadata: Record<string, unknown>;
4083
+ version: "v2";
4084
+ runId: string;
4085
+ turnId: string;
4086
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
4087
+ visibleParts: ({
4088
+ text: string;
4089
+ type: "text";
4090
+ id: string;
4091
+ } | {
4092
+ type: "pending-approval-card";
4093
+ toolCallId: string;
4094
+ id: string;
4095
+ actionId: string;
4096
+ state: "pending_user" | "pending_chain";
4097
+ signatureRequestGroupId: string;
4098
+ description?: string | undefined;
4099
+ label?: string | undefined;
4100
+ } | {
4101
+ type: "tool-state-card";
4102
+ toolCallId: string;
4103
+ id: string;
4104
+ actionId: string;
4105
+ state: "pending_user" | "pending_chain";
4106
+ signatureRequestGroupId: string;
4107
+ description?: string | undefined;
4108
+ label?: string | undefined;
4109
+ } | {
4110
+ type: "tool-state-card";
4111
+ toolCallId: string;
4112
+ id: string;
4113
+ actionId: string;
4114
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
4115
+ description?: string | undefined;
4116
+ simulationId?: string | undefined;
4117
+ signatureRequestGroupId?: string | undefined;
4118
+ label?: string | undefined;
4119
+ })[];
4120
+ toolStates: ({
4121
+ toolCallId: string;
4122
+ actionId: string;
4123
+ state: "pending_user" | "pending_chain";
4124
+ signatureRequestGroupId: string;
4125
+ description?: string | undefined;
4126
+ simulationId?: string | undefined;
4127
+ label?: string | undefined;
4128
+ } | {
4129
+ toolCallId: string;
4130
+ actionId: string;
4131
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
4132
+ description?: string | undefined;
4133
+ simulationId?: string | undefined;
4134
+ signatureRequestGroupId?: string | undefined;
4135
+ label?: string | undefined;
4136
+ })[];
4137
+ summary?: string | undefined;
4138
+ };
4139
+ } | {
4140
+ version: "v2";
4141
+ timestamp: number;
4142
+ runId: string;
4143
+ turnId: string;
4144
+ sequence: number;
4145
+ targetId: string;
4146
+ durable: true;
4147
+ eventType: "run-complete";
4148
+ summary?: string | undefined;
4149
+ completedTurnIds?: string[] | undefined;
4150
+ } | {
4151
+ error: string;
4152
+ version: "v2";
4153
+ timestamp: number;
4154
+ runId: string;
4155
+ turnId: string;
4156
+ sequence: number;
4157
+ targetId: string;
4158
+ durable: false;
4159
+ eventType: "error-state";
4160
+ code?: string | undefined;
4161
+ };
4162
+ }, {
4163
+ type: "data-chat-stream";
4164
+ data: {
4165
+ version: "v2";
4166
+ timestamp: number;
4167
+ runId: string;
4168
+ turnId: string;
4169
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
4170
+ sequence: number;
4171
+ targetId: string;
4172
+ durable: false;
4173
+ eventType: "turn-start";
4174
+ } | {
4175
+ version: "v2";
4176
+ timestamp: number;
4177
+ runId: string;
4178
+ turnId: string;
4179
+ sequence: number;
4180
+ targetId: string;
4181
+ durable: false;
4182
+ eventType: "transcript-text-start";
4183
+ } | {
4184
+ version: "v2";
4185
+ timestamp: number;
4186
+ delta: string;
4187
+ runId: string;
4188
+ turnId: string;
4189
+ sequence: number;
4190
+ targetId: string;
4191
+ durable: false;
4192
+ eventType: "transcript-text-delta";
4193
+ } | {
4194
+ version: "v2";
4195
+ timestamp: number;
4196
+ runId: string;
4197
+ turnId: string;
4198
+ sequence: number;
4199
+ targetId: string;
4200
+ durable: false;
4201
+ eventType: "transcript-text-end";
4202
+ } | {
4203
+ message: string;
4204
+ version: "v2";
4205
+ timestamp: number;
4206
+ runId: string;
4207
+ turnId: string;
4208
+ sequence: number;
4209
+ targetId: string;
4210
+ durable: false;
4211
+ eventType: "progress-update";
4212
+ label?: string | undefined;
4213
+ } | {
4214
+ toolCallId: string;
4215
+ version: "v2";
4216
+ timestamp: number;
4217
+ actionId: string;
4218
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
4219
+ runId: string;
4220
+ turnId: string;
4221
+ sequence: number;
4222
+ targetId: string;
4223
+ durable: true;
4224
+ eventType: "tool-state";
4225
+ description?: string | undefined;
4226
+ simulationId?: string | undefined;
4227
+ signatureRequestGroupId?: string | undefined;
4228
+ label?: string | undefined;
4229
+ } | {
4230
+ simulationId: string;
4231
+ version: "v2";
4232
+ timestamp: number;
4233
+ actionId: string;
4234
+ state: "pending" | "superseded";
4235
+ runId: string;
4236
+ turnId: string;
4237
+ sequence: number;
4238
+ targetId: string;
4239
+ durable: false;
4240
+ eventType: "simulation-state";
4241
+ error?: string | undefined;
4242
+ toolCallId?: string | undefined;
4243
+ summary?: string | undefined;
4244
+ } | {
4245
+ simulationId: string;
4246
+ version: "v2";
4247
+ timestamp: number;
4248
+ actionId: string;
4249
+ state: "failed" | "complete";
4250
+ runId: string;
4251
+ turnId: string;
4252
+ sequence: number;
4253
+ targetId: string;
4254
+ durable: boolean;
4255
+ eventType: "simulation-state";
4256
+ error?: string | undefined;
4257
+ toolCallId?: string | undefined;
4258
+ summary?: string | undefined;
4259
+ } | {
4260
+ toolCallId: string;
4261
+ version: "v2";
4262
+ timestamp: number;
4263
+ actionId: string;
4264
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
4265
+ signatureRequestGroupId: string;
4266
+ runId: string;
4267
+ turnId: string;
4268
+ sequence: number;
4269
+ targetId: string;
4270
+ durable: true;
4271
+ eventType: "signature-state";
4272
+ description?: string | undefined;
4273
+ label?: string | undefined;
4274
+ } | {
4275
+ version: "v2";
4276
+ timestamp: number;
4277
+ runId: string;
4278
+ turnId: string;
4279
+ summary: string;
4280
+ sequence: number;
4281
+ targetId: string;
4282
+ durable: true;
4283
+ eventType: "turn-summary";
4284
+ } | {
4285
+ version: "v2";
4286
+ timestamp: number;
4287
+ runId: string;
4288
+ turnId: string;
4289
+ sequence: number;
4290
+ targetId: string;
4291
+ durable: true;
4292
+ eventType: "turn-complete";
4293
+ snapshot: {
4294
+ metadata: Record<string, unknown>;
4295
+ version: "v2";
4296
+ runId: string;
4297
+ turnId: string;
4298
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
4299
+ visibleParts: ({
4300
+ text: string;
4301
+ type: "text";
4302
+ id: string;
4303
+ } | {
4304
+ type: "pending-approval-card";
4305
+ toolCallId: string;
4306
+ id: string;
4307
+ actionId: string;
4308
+ state: "pending_user" | "pending_chain";
4309
+ signatureRequestGroupId: string;
4310
+ description?: string | undefined;
4311
+ label?: string | undefined;
4312
+ } | {
4313
+ type: "tool-state-card";
4314
+ toolCallId: string;
4315
+ id: string;
4316
+ actionId: string;
4317
+ state: "pending_user" | "pending_chain";
4318
+ signatureRequestGroupId: string;
4319
+ description?: string | undefined;
4320
+ label?: string | undefined;
4321
+ } | {
4322
+ type: "tool-state-card";
4323
+ toolCallId: string;
4324
+ id: string;
4325
+ actionId: string;
4326
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
4327
+ description?: string | undefined;
4328
+ simulationId?: string | undefined;
4329
+ signatureRequestGroupId?: string | undefined;
4330
+ label?: string | undefined;
4331
+ })[];
4332
+ toolStates: ({
4333
+ toolCallId: string;
4334
+ actionId: string;
4335
+ state: "pending_user" | "pending_chain";
4336
+ signatureRequestGroupId: string;
4337
+ description?: string | undefined;
4338
+ simulationId?: string | undefined;
4339
+ label?: string | undefined;
4340
+ } | {
4341
+ toolCallId: string;
4342
+ actionId: string;
4343
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
4344
+ description?: string | undefined;
4345
+ simulationId?: string | undefined;
4346
+ signatureRequestGroupId?: string | undefined;
4347
+ label?: string | undefined;
4348
+ })[];
4349
+ summary?: string | undefined;
4350
+ };
4351
+ } | {
4352
+ version: "v2";
4353
+ timestamp: number;
4354
+ runId: string;
4355
+ turnId: string;
4356
+ sequence: number;
4357
+ targetId: string;
4358
+ durable: true;
4359
+ eventType: "run-complete";
4360
+ summary?: string | undefined;
4361
+ completedTurnIds?: string[] | undefined;
4362
+ } | {
4363
+ error: string;
4364
+ version: "v2";
4365
+ timestamp: number;
4366
+ runId: string;
4367
+ turnId: string;
4368
+ sequence: number;
4369
+ targetId: string;
4370
+ durable: false;
4371
+ eventType: "error-state";
4372
+ code?: string | undefined;
4373
+ };
4374
+ }>;
4375
+ export declare function isChatStreamDataPart(value: unknown): value is z.infer<typeof chatStreamDataPartSchema>;
4376
+ //# sourceMappingURL=chatStreamContract.d.ts.map