@illalabs/interfaces 0.10.4 → 0.10.6-canary-beta-00216af1

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,3920 @@
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.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
+ export declare const chatStreamTurnStartEventSchema: z.ZodObject<{
527
+ version: z.ZodLiteral<"v2">;
528
+ runId: z.ZodString;
529
+ turnId: z.ZodString;
530
+ sequence: z.ZodNumber;
531
+ targetId: z.ZodString;
532
+ timestamp: z.ZodNumber;
533
+ } & {
534
+ eventType: z.ZodLiteral<"turn-start">;
535
+ durable: z.ZodLiteral<false>;
536
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
537
+ }, "strict", z.ZodTypeAny, {
538
+ version: "v2";
539
+ timestamp: number;
540
+ runId: string;
541
+ turnId: string;
542
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
543
+ sequence: number;
544
+ targetId: string;
545
+ durable: false;
546
+ eventType: "turn-start";
547
+ }, {
548
+ version: "v2";
549
+ timestamp: number;
550
+ runId: string;
551
+ turnId: string;
552
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
553
+ sequence: number;
554
+ targetId: string;
555
+ durable: false;
556
+ eventType: "turn-start";
557
+ }>;
558
+ export declare const chatStreamTranscriptTextStartEventSchema: z.ZodObject<{
559
+ version: z.ZodLiteral<"v2">;
560
+ runId: z.ZodString;
561
+ turnId: z.ZodString;
562
+ sequence: z.ZodNumber;
563
+ targetId: z.ZodString;
564
+ timestamp: z.ZodNumber;
565
+ } & {
566
+ eventType: z.ZodLiteral<"transcript-text-start">;
567
+ durable: z.ZodLiteral<false>;
568
+ }, "strict", z.ZodTypeAny, {
569
+ version: "v2";
570
+ timestamp: number;
571
+ runId: string;
572
+ turnId: string;
573
+ sequence: number;
574
+ targetId: string;
575
+ durable: false;
576
+ eventType: "transcript-text-start";
577
+ }, {
578
+ version: "v2";
579
+ timestamp: number;
580
+ runId: string;
581
+ turnId: string;
582
+ sequence: number;
583
+ targetId: string;
584
+ durable: false;
585
+ eventType: "transcript-text-start";
586
+ }>;
587
+ export declare const chatStreamTranscriptTextDeltaEventSchema: z.ZodObject<{
588
+ version: z.ZodLiteral<"v2">;
589
+ runId: z.ZodString;
590
+ turnId: z.ZodString;
591
+ sequence: z.ZodNumber;
592
+ targetId: z.ZodString;
593
+ timestamp: z.ZodNumber;
594
+ } & {
595
+ eventType: z.ZodLiteral<"transcript-text-delta">;
596
+ durable: z.ZodLiteral<false>;
597
+ delta: z.ZodString;
598
+ }, "strict", z.ZodTypeAny, {
599
+ version: "v2";
600
+ timestamp: number;
601
+ delta: string;
602
+ runId: string;
603
+ turnId: string;
604
+ sequence: number;
605
+ targetId: string;
606
+ durable: false;
607
+ eventType: "transcript-text-delta";
608
+ }, {
609
+ version: "v2";
610
+ timestamp: number;
611
+ delta: string;
612
+ runId: string;
613
+ turnId: string;
614
+ sequence: number;
615
+ targetId: string;
616
+ durable: false;
617
+ eventType: "transcript-text-delta";
618
+ }>;
619
+ export declare const chatStreamTranscriptTextEndEventSchema: z.ZodObject<{
620
+ version: z.ZodLiteral<"v2">;
621
+ runId: z.ZodString;
622
+ turnId: z.ZodString;
623
+ sequence: z.ZodNumber;
624
+ targetId: z.ZodString;
625
+ timestamp: z.ZodNumber;
626
+ } & {
627
+ eventType: z.ZodLiteral<"transcript-text-end">;
628
+ durable: z.ZodLiteral<false>;
629
+ }, "strict", z.ZodTypeAny, {
630
+ version: "v2";
631
+ timestamp: number;
632
+ runId: string;
633
+ turnId: string;
634
+ sequence: number;
635
+ targetId: string;
636
+ durable: false;
637
+ eventType: "transcript-text-end";
638
+ }, {
639
+ version: "v2";
640
+ timestamp: number;
641
+ runId: string;
642
+ turnId: string;
643
+ sequence: number;
644
+ targetId: string;
645
+ durable: false;
646
+ eventType: "transcript-text-end";
647
+ }>;
648
+ export declare const chatStreamProgressUpdateEventSchema: z.ZodObject<{
649
+ version: z.ZodLiteral<"v2">;
650
+ runId: z.ZodString;
651
+ turnId: z.ZodString;
652
+ sequence: z.ZodNumber;
653
+ targetId: z.ZodString;
654
+ timestamp: z.ZodNumber;
655
+ } & {
656
+ eventType: z.ZodLiteral<"progress-update">;
657
+ durable: z.ZodLiteral<false>;
658
+ message: z.ZodString;
659
+ label: z.ZodOptional<z.ZodString>;
660
+ }, "strict", z.ZodTypeAny, {
661
+ message: string;
662
+ version: "v2";
663
+ timestamp: number;
664
+ runId: string;
665
+ turnId: string;
666
+ sequence: number;
667
+ targetId: string;
668
+ durable: false;
669
+ eventType: "progress-update";
670
+ label?: string | undefined;
671
+ }, {
672
+ message: string;
673
+ version: "v2";
674
+ timestamp: number;
675
+ runId: string;
676
+ turnId: string;
677
+ sequence: number;
678
+ targetId: string;
679
+ durable: false;
680
+ eventType: "progress-update";
681
+ label?: string | undefined;
682
+ }>;
683
+ export declare const chatStreamToolStateEventSchema: z.ZodObject<{
684
+ version: z.ZodLiteral<"v2">;
685
+ runId: z.ZodString;
686
+ turnId: z.ZodString;
687
+ sequence: z.ZodNumber;
688
+ targetId: z.ZodString;
689
+ timestamp: z.ZodNumber;
690
+ } & {
691
+ eventType: z.ZodLiteral<"tool-state">;
692
+ durable: z.ZodLiteral<true>;
693
+ actionId: z.ZodString;
694
+ toolCallId: z.ZodString;
695
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
696
+ simulationId: z.ZodOptional<z.ZodString>;
697
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
698
+ label: z.ZodOptional<z.ZodString>;
699
+ description: z.ZodOptional<z.ZodString>;
700
+ }, "strict", z.ZodTypeAny, {
701
+ toolCallId: string;
702
+ version: "v2";
703
+ timestamp: number;
704
+ actionId: string;
705
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
706
+ runId: string;
707
+ turnId: string;
708
+ sequence: number;
709
+ targetId: string;
710
+ durable: true;
711
+ eventType: "tool-state";
712
+ description?: string | undefined;
713
+ simulationId?: string | undefined;
714
+ signatureRequestGroupId?: string | undefined;
715
+ label?: string | undefined;
716
+ }, {
717
+ toolCallId: string;
718
+ version: "v2";
719
+ timestamp: number;
720
+ actionId: string;
721
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
722
+ runId: string;
723
+ turnId: string;
724
+ sequence: number;
725
+ targetId: string;
726
+ durable: true;
727
+ eventType: "tool-state";
728
+ description?: string | undefined;
729
+ simulationId?: string | undefined;
730
+ signatureRequestGroupId?: string | undefined;
731
+ label?: string | undefined;
732
+ }>;
733
+ export declare const chatStreamSimulationStateSchema: z.ZodUnion<[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<"simulation-state">;
742
+ durable: z.ZodLiteral<false>;
743
+ actionId: z.ZodString;
744
+ simulationId: z.ZodString;
745
+ toolCallId: z.ZodOptional<z.ZodString>;
746
+ state: z.ZodEnum<["pending", "superseded"]>;
747
+ summary: z.ZodOptional<z.ZodString>;
748
+ error: z.ZodOptional<z.ZodString>;
749
+ }, "strict", z.ZodTypeAny, {
750
+ simulationId: string;
751
+ version: "v2";
752
+ timestamp: number;
753
+ actionId: string;
754
+ state: "pending" | "superseded";
755
+ runId: string;
756
+ turnId: string;
757
+ sequence: number;
758
+ targetId: string;
759
+ durable: false;
760
+ eventType: "simulation-state";
761
+ error?: string | undefined;
762
+ toolCallId?: string | undefined;
763
+ summary?: string | undefined;
764
+ }, {
765
+ simulationId: string;
766
+ version: "v2";
767
+ timestamp: number;
768
+ actionId: string;
769
+ state: "pending" | "superseded";
770
+ runId: string;
771
+ turnId: string;
772
+ sequence: number;
773
+ targetId: string;
774
+ durable: false;
775
+ eventType: "simulation-state";
776
+ error?: string | undefined;
777
+ toolCallId?: string | undefined;
778
+ summary?: string | undefined;
779
+ }>, z.ZodObject<{
780
+ version: z.ZodLiteral<"v2">;
781
+ runId: z.ZodString;
782
+ turnId: z.ZodString;
783
+ sequence: z.ZodNumber;
784
+ targetId: z.ZodString;
785
+ timestamp: z.ZodNumber;
786
+ } & {
787
+ eventType: z.ZodLiteral<"simulation-state">;
788
+ durable: z.ZodBoolean;
789
+ actionId: z.ZodString;
790
+ simulationId: z.ZodString;
791
+ toolCallId: z.ZodOptional<z.ZodString>;
792
+ state: z.ZodEnum<["complete", "failed"]>;
793
+ summary: z.ZodOptional<z.ZodString>;
794
+ error: z.ZodOptional<z.ZodString>;
795
+ }, "strict", z.ZodTypeAny, {
796
+ simulationId: string;
797
+ version: "v2";
798
+ timestamp: number;
799
+ actionId: string;
800
+ state: "failed" | "complete";
801
+ runId: string;
802
+ turnId: string;
803
+ sequence: number;
804
+ targetId: string;
805
+ durable: boolean;
806
+ eventType: "simulation-state";
807
+ error?: string | undefined;
808
+ toolCallId?: string | undefined;
809
+ summary?: string | undefined;
810
+ }, {
811
+ simulationId: string;
812
+ version: "v2";
813
+ timestamp: number;
814
+ actionId: string;
815
+ state: "failed" | "complete";
816
+ runId: string;
817
+ turnId: string;
818
+ sequence: number;
819
+ targetId: string;
820
+ durable: boolean;
821
+ eventType: "simulation-state";
822
+ error?: string | undefined;
823
+ toolCallId?: string | undefined;
824
+ summary?: string | undefined;
825
+ }>]>;
826
+ export declare const chatStreamSignatureStateSchema: z.ZodObject<{
827
+ version: z.ZodLiteral<"v2">;
828
+ runId: z.ZodString;
829
+ turnId: z.ZodString;
830
+ sequence: z.ZodNumber;
831
+ targetId: z.ZodString;
832
+ timestamp: z.ZodNumber;
833
+ } & {
834
+ eventType: z.ZodLiteral<"signature-state">;
835
+ durable: z.ZodLiteral<true>;
836
+ actionId: z.ZodString;
837
+ toolCallId: z.ZodString;
838
+ signatureRequestGroupId: z.ZodString;
839
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
840
+ label: z.ZodOptional<z.ZodString>;
841
+ description: z.ZodOptional<z.ZodString>;
842
+ }, "strict", z.ZodTypeAny, {
843
+ toolCallId: string;
844
+ version: "v2";
845
+ timestamp: number;
846
+ actionId: string;
847
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
848
+ signatureRequestGroupId: string;
849
+ runId: string;
850
+ turnId: string;
851
+ sequence: number;
852
+ targetId: string;
853
+ durable: true;
854
+ eventType: "signature-state";
855
+ description?: string | undefined;
856
+ label?: string | undefined;
857
+ }, {
858
+ toolCallId: string;
859
+ version: "v2";
860
+ timestamp: number;
861
+ actionId: string;
862
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
863
+ signatureRequestGroupId: string;
864
+ runId: string;
865
+ turnId: string;
866
+ sequence: number;
867
+ targetId: string;
868
+ durable: true;
869
+ eventType: "signature-state";
870
+ description?: string | undefined;
871
+ label?: string | undefined;
872
+ }>;
873
+ export declare const chatStreamTurnSummaryEventSchema: z.ZodObject<{
874
+ version: z.ZodLiteral<"v2">;
875
+ runId: z.ZodString;
876
+ turnId: z.ZodString;
877
+ sequence: z.ZodNumber;
878
+ targetId: z.ZodString;
879
+ timestamp: z.ZodNumber;
880
+ } & {
881
+ eventType: z.ZodLiteral<"turn-summary">;
882
+ durable: z.ZodLiteral<true>;
883
+ summary: z.ZodString;
884
+ }, "strict", z.ZodTypeAny, {
885
+ version: "v2";
886
+ timestamp: number;
887
+ runId: string;
888
+ turnId: string;
889
+ summary: string;
890
+ sequence: number;
891
+ targetId: string;
892
+ durable: true;
893
+ eventType: "turn-summary";
894
+ }, {
895
+ version: "v2";
896
+ timestamp: number;
897
+ runId: string;
898
+ turnId: string;
899
+ summary: string;
900
+ sequence: number;
901
+ targetId: string;
902
+ durable: true;
903
+ eventType: "turn-summary";
904
+ }>;
905
+ export declare const chatStreamTurnCompleteEventSchema: z.ZodEffects<z.ZodObject<{
906
+ version: z.ZodLiteral<"v2">;
907
+ runId: z.ZodString;
908
+ turnId: z.ZodString;
909
+ sequence: z.ZodNumber;
910
+ targetId: z.ZodString;
911
+ timestamp: z.ZodNumber;
912
+ } & {
913
+ eventType: z.ZodLiteral<"turn-complete">;
914
+ durable: z.ZodLiteral<true>;
915
+ snapshot: z.ZodObject<{
916
+ version: z.ZodLiteral<"v2">;
917
+ runId: z.ZodString;
918
+ turnId: z.ZodString;
919
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
920
+ summary: z.ZodOptional<z.ZodString>;
921
+ visibleParts: z.ZodArray<z.ZodUnion<[z.ZodObject<{
922
+ type: z.ZodLiteral<"text">;
923
+ id: z.ZodString;
924
+ text: z.ZodString;
925
+ }, "strict", z.ZodTypeAny, {
926
+ text: string;
927
+ type: "text";
928
+ id: string;
929
+ }, {
930
+ text: string;
931
+ type: "text";
932
+ id: string;
933
+ }>, z.ZodObject<{
934
+ type: z.ZodLiteral<"pending-approval-card">;
935
+ id: z.ZodString;
936
+ actionId: z.ZodString;
937
+ toolCallId: z.ZodString;
938
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
939
+ signatureRequestGroupId: z.ZodString;
940
+ label: z.ZodOptional<z.ZodString>;
941
+ description: z.ZodOptional<z.ZodString>;
942
+ }, "strict", z.ZodTypeAny, {
943
+ type: "pending-approval-card";
944
+ toolCallId: string;
945
+ id: string;
946
+ actionId: string;
947
+ state: "pending_user" | "pending_chain";
948
+ signatureRequestGroupId: string;
949
+ description?: string | undefined;
950
+ label?: string | undefined;
951
+ }, {
952
+ type: "pending-approval-card";
953
+ toolCallId: string;
954
+ id: string;
955
+ actionId: string;
956
+ state: "pending_user" | "pending_chain";
957
+ signatureRequestGroupId: string;
958
+ description?: string | undefined;
959
+ label?: string | undefined;
960
+ }>, z.ZodUnion<[z.ZodObject<{
961
+ type: z.ZodLiteral<"tool-state-card">;
962
+ id: z.ZodString;
963
+ actionId: z.ZodString;
964
+ toolCallId: z.ZodString;
965
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
966
+ signatureRequestGroupId: z.ZodString;
967
+ label: z.ZodOptional<z.ZodString>;
968
+ description: z.ZodOptional<z.ZodString>;
969
+ }, "strict", z.ZodTypeAny, {
970
+ type: "tool-state-card";
971
+ toolCallId: string;
972
+ id: string;
973
+ actionId: string;
974
+ state: "pending_user" | "pending_chain";
975
+ signatureRequestGroupId: string;
976
+ description?: string | undefined;
977
+ label?: string | undefined;
978
+ }, {
979
+ type: "tool-state-card";
980
+ toolCallId: string;
981
+ id: string;
982
+ actionId: string;
983
+ state: "pending_user" | "pending_chain";
984
+ signatureRequestGroupId: string;
985
+ description?: string | undefined;
986
+ label?: string | undefined;
987
+ }>, z.ZodObject<{
988
+ type: z.ZodLiteral<"tool-state-card">;
989
+ id: z.ZodString;
990
+ actionId: z.ZodString;
991
+ toolCallId: z.ZodString;
992
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
993
+ simulationId: z.ZodOptional<z.ZodString>;
994
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
995
+ label: z.ZodOptional<z.ZodString>;
996
+ description: z.ZodOptional<z.ZodString>;
997
+ }, "strict", z.ZodTypeAny, {
998
+ type: "tool-state-card";
999
+ toolCallId: string;
1000
+ id: string;
1001
+ actionId: string;
1002
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1003
+ description?: string | undefined;
1004
+ simulationId?: string | undefined;
1005
+ signatureRequestGroupId?: string | undefined;
1006
+ label?: string | undefined;
1007
+ }, {
1008
+ type: "tool-state-card";
1009
+ toolCallId: string;
1010
+ id: string;
1011
+ actionId: string;
1012
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1013
+ description?: string | undefined;
1014
+ simulationId?: string | undefined;
1015
+ signatureRequestGroupId?: string | undefined;
1016
+ label?: string | undefined;
1017
+ }>]>]>, "many">;
1018
+ toolStates: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1019
+ actionId: z.ZodString;
1020
+ toolCallId: z.ZodString;
1021
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
1022
+ simulationId: z.ZodOptional<z.ZodString>;
1023
+ signatureRequestGroupId: z.ZodString;
1024
+ label: z.ZodOptional<z.ZodString>;
1025
+ description: z.ZodOptional<z.ZodString>;
1026
+ }, "strict", z.ZodTypeAny, {
1027
+ toolCallId: string;
1028
+ actionId: string;
1029
+ state: "pending_user" | "pending_chain";
1030
+ signatureRequestGroupId: string;
1031
+ description?: string | undefined;
1032
+ simulationId?: string | undefined;
1033
+ label?: string | undefined;
1034
+ }, {
1035
+ toolCallId: string;
1036
+ actionId: string;
1037
+ state: "pending_user" | "pending_chain";
1038
+ signatureRequestGroupId: string;
1039
+ description?: string | undefined;
1040
+ simulationId?: string | undefined;
1041
+ label?: string | undefined;
1042
+ }>, z.ZodObject<{
1043
+ actionId: z.ZodString;
1044
+ toolCallId: z.ZodString;
1045
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
1046
+ simulationId: z.ZodOptional<z.ZodString>;
1047
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
1048
+ label: z.ZodOptional<z.ZodString>;
1049
+ description: z.ZodOptional<z.ZodString>;
1050
+ }, "strict", z.ZodTypeAny, {
1051
+ toolCallId: string;
1052
+ actionId: string;
1053
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1054
+ description?: string | undefined;
1055
+ simulationId?: string | undefined;
1056
+ signatureRequestGroupId?: string | undefined;
1057
+ label?: string | undefined;
1058
+ }, {
1059
+ toolCallId: string;
1060
+ actionId: string;
1061
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1062
+ description?: string | undefined;
1063
+ simulationId?: string | undefined;
1064
+ signatureRequestGroupId?: string | undefined;
1065
+ label?: string | undefined;
1066
+ }>]>, "many">;
1067
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1068
+ }, "strict", z.ZodTypeAny, {
1069
+ metadata: Record<string, unknown>;
1070
+ version: "v2";
1071
+ runId: string;
1072
+ turnId: string;
1073
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1074
+ visibleParts: ({
1075
+ text: string;
1076
+ type: "text";
1077
+ id: string;
1078
+ } | {
1079
+ type: "pending-approval-card";
1080
+ toolCallId: string;
1081
+ id: string;
1082
+ actionId: string;
1083
+ state: "pending_user" | "pending_chain";
1084
+ signatureRequestGroupId: string;
1085
+ description?: string | undefined;
1086
+ label?: string | undefined;
1087
+ } | {
1088
+ type: "tool-state-card";
1089
+ toolCallId: string;
1090
+ id: string;
1091
+ actionId: string;
1092
+ state: "pending_user" | "pending_chain";
1093
+ signatureRequestGroupId: string;
1094
+ description?: string | undefined;
1095
+ label?: string | undefined;
1096
+ } | {
1097
+ type: "tool-state-card";
1098
+ toolCallId: string;
1099
+ id: string;
1100
+ actionId: string;
1101
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1102
+ description?: string | undefined;
1103
+ simulationId?: string | undefined;
1104
+ signatureRequestGroupId?: string | undefined;
1105
+ label?: string | undefined;
1106
+ })[];
1107
+ toolStates: ({
1108
+ toolCallId: string;
1109
+ actionId: string;
1110
+ state: "pending_user" | "pending_chain";
1111
+ signatureRequestGroupId: string;
1112
+ description?: string | undefined;
1113
+ simulationId?: string | undefined;
1114
+ label?: string | undefined;
1115
+ } | {
1116
+ toolCallId: string;
1117
+ actionId: string;
1118
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1119
+ description?: string | undefined;
1120
+ simulationId?: string | undefined;
1121
+ signatureRequestGroupId?: string | undefined;
1122
+ label?: string | undefined;
1123
+ })[];
1124
+ summary?: string | undefined;
1125
+ }, {
1126
+ metadata: Record<string, unknown>;
1127
+ version: "v2";
1128
+ runId: string;
1129
+ turnId: string;
1130
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1131
+ visibleParts: ({
1132
+ text: string;
1133
+ type: "text";
1134
+ id: string;
1135
+ } | {
1136
+ type: "pending-approval-card";
1137
+ toolCallId: string;
1138
+ id: string;
1139
+ actionId: string;
1140
+ state: "pending_user" | "pending_chain";
1141
+ signatureRequestGroupId: string;
1142
+ description?: string | undefined;
1143
+ label?: string | undefined;
1144
+ } | {
1145
+ type: "tool-state-card";
1146
+ toolCallId: string;
1147
+ id: string;
1148
+ actionId: string;
1149
+ state: "pending_user" | "pending_chain";
1150
+ signatureRequestGroupId: string;
1151
+ description?: string | undefined;
1152
+ label?: string | undefined;
1153
+ } | {
1154
+ type: "tool-state-card";
1155
+ toolCallId: string;
1156
+ id: string;
1157
+ actionId: string;
1158
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1159
+ description?: string | undefined;
1160
+ simulationId?: string | undefined;
1161
+ signatureRequestGroupId?: string | undefined;
1162
+ label?: string | undefined;
1163
+ })[];
1164
+ toolStates: ({
1165
+ toolCallId: string;
1166
+ actionId: string;
1167
+ state: "pending_user" | "pending_chain";
1168
+ signatureRequestGroupId: string;
1169
+ description?: string | undefined;
1170
+ simulationId?: 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
+ })[];
1181
+ summary?: string | undefined;
1182
+ }>;
1183
+ }, "strict", z.ZodTypeAny, {
1184
+ version: "v2";
1185
+ timestamp: number;
1186
+ runId: string;
1187
+ turnId: string;
1188
+ sequence: number;
1189
+ targetId: string;
1190
+ durable: true;
1191
+ eventType: "turn-complete";
1192
+ snapshot: {
1193
+ metadata: Record<string, unknown>;
1194
+ version: "v2";
1195
+ runId: string;
1196
+ turnId: string;
1197
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1198
+ visibleParts: ({
1199
+ text: string;
1200
+ type: "text";
1201
+ id: string;
1202
+ } | {
1203
+ type: "pending-approval-card";
1204
+ toolCallId: string;
1205
+ id: string;
1206
+ actionId: string;
1207
+ state: "pending_user" | "pending_chain";
1208
+ signatureRequestGroupId: string;
1209
+ description?: string | undefined;
1210
+ label?: string | undefined;
1211
+ } | {
1212
+ type: "tool-state-card";
1213
+ toolCallId: string;
1214
+ id: string;
1215
+ actionId: string;
1216
+ state: "pending_user" | "pending_chain";
1217
+ signatureRequestGroupId: string;
1218
+ description?: string | undefined;
1219
+ label?: string | undefined;
1220
+ } | {
1221
+ type: "tool-state-card";
1222
+ toolCallId: string;
1223
+ id: string;
1224
+ actionId: string;
1225
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1226
+ description?: string | undefined;
1227
+ simulationId?: string | undefined;
1228
+ signatureRequestGroupId?: string | undefined;
1229
+ label?: string | undefined;
1230
+ })[];
1231
+ toolStates: ({
1232
+ toolCallId: string;
1233
+ actionId: string;
1234
+ state: "pending_user" | "pending_chain";
1235
+ signatureRequestGroupId: string;
1236
+ description?: string | undefined;
1237
+ simulationId?: string | undefined;
1238
+ label?: string | undefined;
1239
+ } | {
1240
+ toolCallId: string;
1241
+ actionId: string;
1242
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1243
+ description?: string | undefined;
1244
+ simulationId?: string | undefined;
1245
+ signatureRequestGroupId?: string | undefined;
1246
+ label?: string | undefined;
1247
+ })[];
1248
+ summary?: string | undefined;
1249
+ };
1250
+ }, {
1251
+ version: "v2";
1252
+ timestamp: number;
1253
+ runId: string;
1254
+ turnId: string;
1255
+ sequence: number;
1256
+ targetId: string;
1257
+ durable: true;
1258
+ eventType: "turn-complete";
1259
+ snapshot: {
1260
+ metadata: Record<string, unknown>;
1261
+ version: "v2";
1262
+ runId: string;
1263
+ turnId: string;
1264
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1265
+ visibleParts: ({
1266
+ text: string;
1267
+ type: "text";
1268
+ id: string;
1269
+ } | {
1270
+ type: "pending-approval-card";
1271
+ toolCallId: string;
1272
+ id: string;
1273
+ actionId: string;
1274
+ state: "pending_user" | "pending_chain";
1275
+ signatureRequestGroupId: string;
1276
+ description?: string | undefined;
1277
+ label?: string | undefined;
1278
+ } | {
1279
+ type: "tool-state-card";
1280
+ toolCallId: string;
1281
+ id: string;
1282
+ actionId: string;
1283
+ state: "pending_user" | "pending_chain";
1284
+ signatureRequestGroupId: string;
1285
+ description?: string | undefined;
1286
+ label?: string | undefined;
1287
+ } | {
1288
+ type: "tool-state-card";
1289
+ toolCallId: string;
1290
+ id: string;
1291
+ actionId: string;
1292
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1293
+ description?: string | undefined;
1294
+ simulationId?: string | undefined;
1295
+ signatureRequestGroupId?: string | undefined;
1296
+ label?: string | undefined;
1297
+ })[];
1298
+ toolStates: ({
1299
+ toolCallId: string;
1300
+ actionId: string;
1301
+ state: "pending_user" | "pending_chain";
1302
+ signatureRequestGroupId: string;
1303
+ description?: string | undefined;
1304
+ simulationId?: string | undefined;
1305
+ label?: string | undefined;
1306
+ } | {
1307
+ toolCallId: string;
1308
+ actionId: string;
1309
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1310
+ description?: string | undefined;
1311
+ simulationId?: string | undefined;
1312
+ signatureRequestGroupId?: string | undefined;
1313
+ label?: string | undefined;
1314
+ })[];
1315
+ summary?: string | undefined;
1316
+ };
1317
+ }>, {
1318
+ version: "v2";
1319
+ timestamp: number;
1320
+ runId: string;
1321
+ turnId: string;
1322
+ sequence: number;
1323
+ targetId: string;
1324
+ durable: true;
1325
+ eventType: "turn-complete";
1326
+ snapshot: {
1327
+ metadata: Record<string, unknown>;
1328
+ version: "v2";
1329
+ runId: string;
1330
+ turnId: string;
1331
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1332
+ visibleParts: ({
1333
+ text: string;
1334
+ type: "text";
1335
+ id: string;
1336
+ } | {
1337
+ type: "pending-approval-card";
1338
+ toolCallId: string;
1339
+ id: string;
1340
+ actionId: string;
1341
+ state: "pending_user" | "pending_chain";
1342
+ signatureRequestGroupId: string;
1343
+ description?: string | undefined;
1344
+ label?: string | undefined;
1345
+ } | {
1346
+ type: "tool-state-card";
1347
+ toolCallId: string;
1348
+ id: string;
1349
+ actionId: string;
1350
+ state: "pending_user" | "pending_chain";
1351
+ signatureRequestGroupId: string;
1352
+ description?: string | undefined;
1353
+ label?: string | undefined;
1354
+ } | {
1355
+ type: "tool-state-card";
1356
+ toolCallId: string;
1357
+ id: string;
1358
+ actionId: string;
1359
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1360
+ description?: string | undefined;
1361
+ simulationId?: string | undefined;
1362
+ signatureRequestGroupId?: string | undefined;
1363
+ label?: string | undefined;
1364
+ })[];
1365
+ toolStates: ({
1366
+ toolCallId: string;
1367
+ actionId: string;
1368
+ state: "pending_user" | "pending_chain";
1369
+ signatureRequestGroupId: string;
1370
+ description?: string | undefined;
1371
+ simulationId?: string | undefined;
1372
+ label?: string | undefined;
1373
+ } | {
1374
+ toolCallId: string;
1375
+ actionId: string;
1376
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1377
+ description?: string | undefined;
1378
+ simulationId?: string | undefined;
1379
+ signatureRequestGroupId?: string | undefined;
1380
+ label?: string | undefined;
1381
+ })[];
1382
+ summary?: string | undefined;
1383
+ };
1384
+ }, {
1385
+ version: "v2";
1386
+ timestamp: number;
1387
+ runId: string;
1388
+ turnId: string;
1389
+ sequence: number;
1390
+ targetId: string;
1391
+ durable: true;
1392
+ eventType: "turn-complete";
1393
+ snapshot: {
1394
+ metadata: Record<string, unknown>;
1395
+ version: "v2";
1396
+ runId: string;
1397
+ turnId: string;
1398
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1399
+ visibleParts: ({
1400
+ text: string;
1401
+ type: "text";
1402
+ id: string;
1403
+ } | {
1404
+ type: "pending-approval-card";
1405
+ toolCallId: string;
1406
+ id: string;
1407
+ actionId: string;
1408
+ state: "pending_user" | "pending_chain";
1409
+ signatureRequestGroupId: string;
1410
+ description?: string | undefined;
1411
+ label?: string | undefined;
1412
+ } | {
1413
+ type: "tool-state-card";
1414
+ toolCallId: string;
1415
+ id: string;
1416
+ actionId: string;
1417
+ state: "pending_user" | "pending_chain";
1418
+ signatureRequestGroupId: string;
1419
+ description?: string | undefined;
1420
+ label?: string | undefined;
1421
+ } | {
1422
+ type: "tool-state-card";
1423
+ toolCallId: string;
1424
+ id: string;
1425
+ actionId: string;
1426
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1427
+ description?: string | undefined;
1428
+ simulationId?: string | undefined;
1429
+ signatureRequestGroupId?: string | undefined;
1430
+ label?: string | undefined;
1431
+ })[];
1432
+ toolStates: ({
1433
+ toolCallId: string;
1434
+ actionId: string;
1435
+ state: "pending_user" | "pending_chain";
1436
+ signatureRequestGroupId: string;
1437
+ description?: string | undefined;
1438
+ simulationId?: string | undefined;
1439
+ label?: string | undefined;
1440
+ } | {
1441
+ toolCallId: string;
1442
+ actionId: string;
1443
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1444
+ description?: string | undefined;
1445
+ simulationId?: string | undefined;
1446
+ signatureRequestGroupId?: string | undefined;
1447
+ label?: string | undefined;
1448
+ })[];
1449
+ summary?: string | undefined;
1450
+ };
1451
+ }>;
1452
+ export declare const chatStreamRunCompleteEventSchema: z.ZodObject<{
1453
+ version: z.ZodLiteral<"v2">;
1454
+ runId: z.ZodString;
1455
+ turnId: z.ZodString;
1456
+ sequence: z.ZodNumber;
1457
+ targetId: z.ZodString;
1458
+ timestamp: z.ZodNumber;
1459
+ } & {
1460
+ eventType: z.ZodLiteral<"run-complete">;
1461
+ durable: z.ZodLiteral<true>;
1462
+ completedTurnIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1463
+ summary: z.ZodOptional<z.ZodString>;
1464
+ }, "strict", z.ZodTypeAny, {
1465
+ version: "v2";
1466
+ timestamp: number;
1467
+ runId: string;
1468
+ turnId: string;
1469
+ sequence: number;
1470
+ targetId: string;
1471
+ durable: true;
1472
+ eventType: "run-complete";
1473
+ summary?: string | undefined;
1474
+ completedTurnIds?: string[] | undefined;
1475
+ }, {
1476
+ version: "v2";
1477
+ timestamp: number;
1478
+ runId: string;
1479
+ turnId: string;
1480
+ sequence: number;
1481
+ targetId: string;
1482
+ durable: true;
1483
+ eventType: "run-complete";
1484
+ summary?: string | undefined;
1485
+ completedTurnIds?: string[] | undefined;
1486
+ }>;
1487
+ export declare const chatStreamErrorStateSchema: z.ZodObject<{
1488
+ version: z.ZodLiteral<"v2">;
1489
+ runId: z.ZodString;
1490
+ turnId: z.ZodString;
1491
+ sequence: z.ZodNumber;
1492
+ targetId: z.ZodString;
1493
+ timestamp: z.ZodNumber;
1494
+ } & {
1495
+ eventType: z.ZodLiteral<"error-state">;
1496
+ durable: z.ZodLiteral<false>;
1497
+ error: z.ZodString;
1498
+ code: z.ZodOptional<z.ZodString>;
1499
+ }, "strict", z.ZodTypeAny, {
1500
+ error: string;
1501
+ version: "v2";
1502
+ timestamp: number;
1503
+ runId: string;
1504
+ turnId: string;
1505
+ sequence: number;
1506
+ targetId: string;
1507
+ durable: false;
1508
+ eventType: "error-state";
1509
+ code?: string | undefined;
1510
+ }, {
1511
+ error: string;
1512
+ version: "v2";
1513
+ timestamp: number;
1514
+ runId: string;
1515
+ turnId: string;
1516
+ sequence: number;
1517
+ targetId: string;
1518
+ durable: false;
1519
+ eventType: "error-state";
1520
+ code?: string | undefined;
1521
+ }>;
1522
+ export declare const chatStreamLiveEventSchema: z.ZodUnion<[z.ZodObject<{
1523
+ version: z.ZodLiteral<"v2">;
1524
+ runId: z.ZodString;
1525
+ turnId: z.ZodString;
1526
+ sequence: z.ZodNumber;
1527
+ targetId: z.ZodString;
1528
+ timestamp: z.ZodNumber;
1529
+ } & {
1530
+ eventType: z.ZodLiteral<"turn-start">;
1531
+ durable: z.ZodLiteral<false>;
1532
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
1533
+ }, "strict", z.ZodTypeAny, {
1534
+ version: "v2";
1535
+ timestamp: number;
1536
+ runId: string;
1537
+ turnId: string;
1538
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1539
+ sequence: number;
1540
+ targetId: string;
1541
+ durable: false;
1542
+ eventType: "turn-start";
1543
+ }, {
1544
+ version: "v2";
1545
+ timestamp: number;
1546
+ runId: string;
1547
+ turnId: string;
1548
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
1549
+ sequence: number;
1550
+ targetId: string;
1551
+ durable: false;
1552
+ eventType: "turn-start";
1553
+ }>, z.ZodObject<{
1554
+ version: z.ZodLiteral<"v2">;
1555
+ runId: z.ZodString;
1556
+ turnId: z.ZodString;
1557
+ sequence: z.ZodNumber;
1558
+ targetId: z.ZodString;
1559
+ timestamp: z.ZodNumber;
1560
+ } & {
1561
+ eventType: z.ZodLiteral<"transcript-text-start">;
1562
+ durable: z.ZodLiteral<false>;
1563
+ }, "strict", z.ZodTypeAny, {
1564
+ version: "v2";
1565
+ timestamp: number;
1566
+ runId: string;
1567
+ turnId: string;
1568
+ sequence: number;
1569
+ targetId: string;
1570
+ durable: false;
1571
+ eventType: "transcript-text-start";
1572
+ }, {
1573
+ version: "v2";
1574
+ timestamp: number;
1575
+ runId: string;
1576
+ turnId: string;
1577
+ sequence: number;
1578
+ targetId: string;
1579
+ durable: false;
1580
+ eventType: "transcript-text-start";
1581
+ }>, z.ZodObject<{
1582
+ version: z.ZodLiteral<"v2">;
1583
+ runId: z.ZodString;
1584
+ turnId: z.ZodString;
1585
+ sequence: z.ZodNumber;
1586
+ targetId: z.ZodString;
1587
+ timestamp: z.ZodNumber;
1588
+ } & {
1589
+ eventType: z.ZodLiteral<"transcript-text-delta">;
1590
+ durable: z.ZodLiteral<false>;
1591
+ delta: z.ZodString;
1592
+ }, "strict", z.ZodTypeAny, {
1593
+ version: "v2";
1594
+ timestamp: number;
1595
+ delta: string;
1596
+ runId: string;
1597
+ turnId: string;
1598
+ sequence: number;
1599
+ targetId: string;
1600
+ durable: false;
1601
+ eventType: "transcript-text-delta";
1602
+ }, {
1603
+ version: "v2";
1604
+ timestamp: number;
1605
+ delta: string;
1606
+ runId: string;
1607
+ turnId: string;
1608
+ sequence: number;
1609
+ targetId: string;
1610
+ durable: false;
1611
+ eventType: "transcript-text-delta";
1612
+ }>, z.ZodObject<{
1613
+ version: z.ZodLiteral<"v2">;
1614
+ runId: z.ZodString;
1615
+ turnId: z.ZodString;
1616
+ sequence: z.ZodNumber;
1617
+ targetId: z.ZodString;
1618
+ timestamp: z.ZodNumber;
1619
+ } & {
1620
+ eventType: z.ZodLiteral<"transcript-text-end">;
1621
+ durable: z.ZodLiteral<false>;
1622
+ }, "strict", z.ZodTypeAny, {
1623
+ version: "v2";
1624
+ timestamp: number;
1625
+ runId: string;
1626
+ turnId: string;
1627
+ sequence: number;
1628
+ targetId: string;
1629
+ durable: false;
1630
+ eventType: "transcript-text-end";
1631
+ }, {
1632
+ version: "v2";
1633
+ timestamp: number;
1634
+ runId: string;
1635
+ turnId: string;
1636
+ sequence: number;
1637
+ targetId: string;
1638
+ durable: false;
1639
+ eventType: "transcript-text-end";
1640
+ }>, z.ZodObject<{
1641
+ version: z.ZodLiteral<"v2">;
1642
+ runId: z.ZodString;
1643
+ turnId: z.ZodString;
1644
+ sequence: z.ZodNumber;
1645
+ targetId: z.ZodString;
1646
+ timestamp: z.ZodNumber;
1647
+ } & {
1648
+ eventType: z.ZodLiteral<"progress-update">;
1649
+ durable: z.ZodLiteral<false>;
1650
+ message: z.ZodString;
1651
+ label: z.ZodOptional<z.ZodString>;
1652
+ }, "strict", z.ZodTypeAny, {
1653
+ message: string;
1654
+ version: "v2";
1655
+ timestamp: number;
1656
+ runId: string;
1657
+ turnId: string;
1658
+ sequence: number;
1659
+ targetId: string;
1660
+ durable: false;
1661
+ eventType: "progress-update";
1662
+ label?: string | undefined;
1663
+ }, {
1664
+ message: string;
1665
+ version: "v2";
1666
+ timestamp: number;
1667
+ runId: string;
1668
+ turnId: string;
1669
+ sequence: number;
1670
+ targetId: string;
1671
+ durable: false;
1672
+ eventType: "progress-update";
1673
+ label?: string | undefined;
1674
+ }>, z.ZodObject<{
1675
+ version: z.ZodLiteral<"v2">;
1676
+ runId: z.ZodString;
1677
+ turnId: z.ZodString;
1678
+ sequence: z.ZodNumber;
1679
+ targetId: z.ZodString;
1680
+ timestamp: z.ZodNumber;
1681
+ } & {
1682
+ eventType: z.ZodLiteral<"tool-state">;
1683
+ durable: z.ZodLiteral<true>;
1684
+ actionId: z.ZodString;
1685
+ toolCallId: z.ZodString;
1686
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
1687
+ simulationId: z.ZodOptional<z.ZodString>;
1688
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
1689
+ label: z.ZodOptional<z.ZodString>;
1690
+ description: z.ZodOptional<z.ZodString>;
1691
+ }, "strict", z.ZodTypeAny, {
1692
+ toolCallId: string;
1693
+ version: "v2";
1694
+ timestamp: number;
1695
+ actionId: string;
1696
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1697
+ runId: string;
1698
+ turnId: string;
1699
+ sequence: number;
1700
+ targetId: string;
1701
+ durable: true;
1702
+ eventType: "tool-state";
1703
+ description?: string | undefined;
1704
+ simulationId?: string | undefined;
1705
+ signatureRequestGroupId?: string | undefined;
1706
+ label?: string | undefined;
1707
+ }, {
1708
+ toolCallId: string;
1709
+ version: "v2";
1710
+ timestamp: number;
1711
+ actionId: string;
1712
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1713
+ runId: string;
1714
+ turnId: string;
1715
+ sequence: number;
1716
+ targetId: string;
1717
+ durable: true;
1718
+ eventType: "tool-state";
1719
+ description?: string | undefined;
1720
+ simulationId?: string | undefined;
1721
+ signatureRequestGroupId?: string | undefined;
1722
+ label?: string | undefined;
1723
+ }>, z.ZodUnion<[z.ZodObject<{
1724
+ version: z.ZodLiteral<"v2">;
1725
+ runId: z.ZodString;
1726
+ turnId: z.ZodString;
1727
+ sequence: z.ZodNumber;
1728
+ targetId: z.ZodString;
1729
+ timestamp: z.ZodNumber;
1730
+ } & {
1731
+ eventType: z.ZodLiteral<"simulation-state">;
1732
+ durable: z.ZodLiteral<false>;
1733
+ actionId: z.ZodString;
1734
+ simulationId: z.ZodString;
1735
+ toolCallId: z.ZodOptional<z.ZodString>;
1736
+ state: z.ZodEnum<["pending", "superseded"]>;
1737
+ summary: z.ZodOptional<z.ZodString>;
1738
+ error: z.ZodOptional<z.ZodString>;
1739
+ }, "strict", z.ZodTypeAny, {
1740
+ simulationId: string;
1741
+ version: "v2";
1742
+ timestamp: number;
1743
+ actionId: string;
1744
+ state: "pending" | "superseded";
1745
+ runId: string;
1746
+ turnId: string;
1747
+ sequence: number;
1748
+ targetId: string;
1749
+ durable: false;
1750
+ eventType: "simulation-state";
1751
+ error?: string | undefined;
1752
+ toolCallId?: string | undefined;
1753
+ summary?: string | undefined;
1754
+ }, {
1755
+ simulationId: string;
1756
+ version: "v2";
1757
+ timestamp: number;
1758
+ actionId: string;
1759
+ state: "pending" | "superseded";
1760
+ runId: string;
1761
+ turnId: string;
1762
+ sequence: number;
1763
+ targetId: string;
1764
+ durable: false;
1765
+ eventType: "simulation-state";
1766
+ error?: string | undefined;
1767
+ toolCallId?: string | undefined;
1768
+ summary?: string | undefined;
1769
+ }>, z.ZodObject<{
1770
+ version: z.ZodLiteral<"v2">;
1771
+ runId: z.ZodString;
1772
+ turnId: z.ZodString;
1773
+ sequence: z.ZodNumber;
1774
+ targetId: z.ZodString;
1775
+ timestamp: z.ZodNumber;
1776
+ } & {
1777
+ eventType: z.ZodLiteral<"simulation-state">;
1778
+ durable: z.ZodBoolean;
1779
+ actionId: z.ZodString;
1780
+ simulationId: z.ZodString;
1781
+ toolCallId: z.ZodOptional<z.ZodString>;
1782
+ state: z.ZodEnum<["complete", "failed"]>;
1783
+ summary: z.ZodOptional<z.ZodString>;
1784
+ error: z.ZodOptional<z.ZodString>;
1785
+ }, "strict", z.ZodTypeAny, {
1786
+ simulationId: string;
1787
+ version: "v2";
1788
+ timestamp: number;
1789
+ actionId: string;
1790
+ state: "failed" | "complete";
1791
+ runId: string;
1792
+ turnId: string;
1793
+ sequence: number;
1794
+ targetId: string;
1795
+ durable: boolean;
1796
+ eventType: "simulation-state";
1797
+ error?: string | undefined;
1798
+ toolCallId?: string | undefined;
1799
+ summary?: string | undefined;
1800
+ }, {
1801
+ simulationId: string;
1802
+ version: "v2";
1803
+ timestamp: number;
1804
+ actionId: string;
1805
+ state: "failed" | "complete";
1806
+ runId: string;
1807
+ turnId: string;
1808
+ sequence: number;
1809
+ targetId: string;
1810
+ durable: boolean;
1811
+ eventType: "simulation-state";
1812
+ error?: string | undefined;
1813
+ toolCallId?: string | undefined;
1814
+ summary?: string | undefined;
1815
+ }>]>, z.ZodObject<{
1816
+ version: z.ZodLiteral<"v2">;
1817
+ runId: z.ZodString;
1818
+ turnId: z.ZodString;
1819
+ sequence: z.ZodNumber;
1820
+ targetId: z.ZodString;
1821
+ timestamp: z.ZodNumber;
1822
+ } & {
1823
+ eventType: z.ZodLiteral<"signature-state">;
1824
+ durable: z.ZodLiteral<true>;
1825
+ actionId: z.ZodString;
1826
+ toolCallId: z.ZodString;
1827
+ signatureRequestGroupId: z.ZodString;
1828
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
1829
+ label: z.ZodOptional<z.ZodString>;
1830
+ description: z.ZodOptional<z.ZodString>;
1831
+ }, "strict", z.ZodTypeAny, {
1832
+ toolCallId: string;
1833
+ version: "v2";
1834
+ timestamp: number;
1835
+ actionId: string;
1836
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1837
+ signatureRequestGroupId: string;
1838
+ runId: string;
1839
+ turnId: string;
1840
+ sequence: number;
1841
+ targetId: string;
1842
+ durable: true;
1843
+ eventType: "signature-state";
1844
+ description?: string | undefined;
1845
+ label?: string | undefined;
1846
+ }, {
1847
+ toolCallId: string;
1848
+ version: "v2";
1849
+ timestamp: number;
1850
+ actionId: string;
1851
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1852
+ signatureRequestGroupId: string;
1853
+ runId: string;
1854
+ turnId: string;
1855
+ sequence: number;
1856
+ targetId: string;
1857
+ durable: true;
1858
+ eventType: "signature-state";
1859
+ description?: string | undefined;
1860
+ label?: string | undefined;
1861
+ }>, z.ZodObject<{
1862
+ version: z.ZodLiteral<"v2">;
1863
+ runId: z.ZodString;
1864
+ turnId: z.ZodString;
1865
+ sequence: z.ZodNumber;
1866
+ targetId: z.ZodString;
1867
+ timestamp: z.ZodNumber;
1868
+ } & {
1869
+ eventType: z.ZodLiteral<"turn-summary">;
1870
+ durable: z.ZodLiteral<true>;
1871
+ summary: z.ZodString;
1872
+ }, "strict", z.ZodTypeAny, {
1873
+ version: "v2";
1874
+ timestamp: number;
1875
+ runId: string;
1876
+ turnId: string;
1877
+ summary: string;
1878
+ sequence: number;
1879
+ targetId: string;
1880
+ durable: true;
1881
+ eventType: "turn-summary";
1882
+ }, {
1883
+ version: "v2";
1884
+ timestamp: number;
1885
+ runId: string;
1886
+ turnId: string;
1887
+ summary: string;
1888
+ sequence: number;
1889
+ targetId: string;
1890
+ durable: true;
1891
+ eventType: "turn-summary";
1892
+ }>, z.ZodEffects<z.ZodObject<{
1893
+ version: z.ZodLiteral<"v2">;
1894
+ runId: z.ZodString;
1895
+ turnId: z.ZodString;
1896
+ sequence: z.ZodNumber;
1897
+ targetId: z.ZodString;
1898
+ timestamp: z.ZodNumber;
1899
+ } & {
1900
+ eventType: z.ZodLiteral<"turn-complete">;
1901
+ durable: z.ZodLiteral<true>;
1902
+ snapshot: z.ZodObject<{
1903
+ version: z.ZodLiteral<"v2">;
1904
+ runId: z.ZodString;
1905
+ turnId: z.ZodString;
1906
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
1907
+ summary: z.ZodOptional<z.ZodString>;
1908
+ visibleParts: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1909
+ type: z.ZodLiteral<"text">;
1910
+ id: z.ZodString;
1911
+ text: z.ZodString;
1912
+ }, "strict", z.ZodTypeAny, {
1913
+ text: string;
1914
+ type: "text";
1915
+ id: string;
1916
+ }, {
1917
+ text: string;
1918
+ type: "text";
1919
+ id: string;
1920
+ }>, z.ZodObject<{
1921
+ type: z.ZodLiteral<"pending-approval-card">;
1922
+ id: z.ZodString;
1923
+ actionId: z.ZodString;
1924
+ toolCallId: z.ZodString;
1925
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
1926
+ signatureRequestGroupId: z.ZodString;
1927
+ label: z.ZodOptional<z.ZodString>;
1928
+ description: z.ZodOptional<z.ZodString>;
1929
+ }, "strict", z.ZodTypeAny, {
1930
+ type: "pending-approval-card";
1931
+ toolCallId: string;
1932
+ id: string;
1933
+ actionId: string;
1934
+ state: "pending_user" | "pending_chain";
1935
+ signatureRequestGroupId: string;
1936
+ description?: string | undefined;
1937
+ label?: string | undefined;
1938
+ }, {
1939
+ type: "pending-approval-card";
1940
+ toolCallId: string;
1941
+ id: string;
1942
+ actionId: string;
1943
+ state: "pending_user" | "pending_chain";
1944
+ signatureRequestGroupId: string;
1945
+ description?: string | undefined;
1946
+ label?: string | undefined;
1947
+ }>, z.ZodUnion<[z.ZodObject<{
1948
+ type: z.ZodLiteral<"tool-state-card">;
1949
+ id: z.ZodString;
1950
+ actionId: z.ZodString;
1951
+ toolCallId: z.ZodString;
1952
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
1953
+ signatureRequestGroupId: z.ZodString;
1954
+ label: z.ZodOptional<z.ZodString>;
1955
+ description: z.ZodOptional<z.ZodString>;
1956
+ }, "strict", z.ZodTypeAny, {
1957
+ type: "tool-state-card";
1958
+ toolCallId: string;
1959
+ id: string;
1960
+ actionId: string;
1961
+ state: "pending_user" | "pending_chain";
1962
+ signatureRequestGroupId: string;
1963
+ description?: string | undefined;
1964
+ label?: string | undefined;
1965
+ }, {
1966
+ type: "tool-state-card";
1967
+ toolCallId: string;
1968
+ id: string;
1969
+ actionId: string;
1970
+ state: "pending_user" | "pending_chain";
1971
+ signatureRequestGroupId: string;
1972
+ description?: string | undefined;
1973
+ label?: string | undefined;
1974
+ }>, z.ZodObject<{
1975
+ type: z.ZodLiteral<"tool-state-card">;
1976
+ id: z.ZodString;
1977
+ actionId: z.ZodString;
1978
+ toolCallId: z.ZodString;
1979
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
1980
+ simulationId: z.ZodOptional<z.ZodString>;
1981
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
1982
+ label: z.ZodOptional<z.ZodString>;
1983
+ description: z.ZodOptional<z.ZodString>;
1984
+ }, "strict", z.ZodTypeAny, {
1985
+ type: "tool-state-card";
1986
+ toolCallId: string;
1987
+ id: string;
1988
+ actionId: string;
1989
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
1990
+ description?: string | undefined;
1991
+ simulationId?: string | undefined;
1992
+ signatureRequestGroupId?: string | undefined;
1993
+ label?: string | undefined;
1994
+ }, {
1995
+ type: "tool-state-card";
1996
+ toolCallId: string;
1997
+ id: string;
1998
+ actionId: string;
1999
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2000
+ description?: string | undefined;
2001
+ simulationId?: string | undefined;
2002
+ signatureRequestGroupId?: string | undefined;
2003
+ label?: string | undefined;
2004
+ }>]>]>, "many">;
2005
+ toolStates: z.ZodArray<z.ZodUnion<[z.ZodObject<{
2006
+ actionId: z.ZodString;
2007
+ toolCallId: z.ZodString;
2008
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
2009
+ simulationId: z.ZodOptional<z.ZodString>;
2010
+ signatureRequestGroupId: z.ZodString;
2011
+ label: z.ZodOptional<z.ZodString>;
2012
+ description: z.ZodOptional<z.ZodString>;
2013
+ }, "strict", z.ZodTypeAny, {
2014
+ toolCallId: string;
2015
+ actionId: string;
2016
+ state: "pending_user" | "pending_chain";
2017
+ signatureRequestGroupId: string;
2018
+ description?: string | undefined;
2019
+ simulationId?: string | undefined;
2020
+ label?: string | undefined;
2021
+ }, {
2022
+ toolCallId: string;
2023
+ actionId: string;
2024
+ state: "pending_user" | "pending_chain";
2025
+ signatureRequestGroupId: string;
2026
+ description?: string | undefined;
2027
+ simulationId?: string | undefined;
2028
+ label?: string | undefined;
2029
+ }>, z.ZodObject<{
2030
+ actionId: z.ZodString;
2031
+ toolCallId: z.ZodString;
2032
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
2033
+ simulationId: z.ZodOptional<z.ZodString>;
2034
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
2035
+ label: z.ZodOptional<z.ZodString>;
2036
+ description: z.ZodOptional<z.ZodString>;
2037
+ }, "strict", z.ZodTypeAny, {
2038
+ toolCallId: string;
2039
+ actionId: string;
2040
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2041
+ description?: string | undefined;
2042
+ simulationId?: string | undefined;
2043
+ signatureRequestGroupId?: string | undefined;
2044
+ label?: string | undefined;
2045
+ }, {
2046
+ toolCallId: string;
2047
+ actionId: string;
2048
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2049
+ description?: string | undefined;
2050
+ simulationId?: string | undefined;
2051
+ signatureRequestGroupId?: string | undefined;
2052
+ label?: string | undefined;
2053
+ }>]>, "many">;
2054
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2055
+ }, "strict", z.ZodTypeAny, {
2056
+ metadata: Record<string, unknown>;
2057
+ version: "v2";
2058
+ runId: string;
2059
+ turnId: string;
2060
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2061
+ visibleParts: ({
2062
+ text: string;
2063
+ type: "text";
2064
+ id: string;
2065
+ } | {
2066
+ type: "pending-approval-card";
2067
+ toolCallId: string;
2068
+ id: string;
2069
+ actionId: string;
2070
+ state: "pending_user" | "pending_chain";
2071
+ signatureRequestGroupId: string;
2072
+ description?: string | undefined;
2073
+ label?: string | undefined;
2074
+ } | {
2075
+ type: "tool-state-card";
2076
+ toolCallId: string;
2077
+ id: string;
2078
+ actionId: string;
2079
+ state: "pending_user" | "pending_chain";
2080
+ signatureRequestGroupId: string;
2081
+ description?: string | undefined;
2082
+ label?: string | undefined;
2083
+ } | {
2084
+ type: "tool-state-card";
2085
+ toolCallId: string;
2086
+ id: string;
2087
+ actionId: string;
2088
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2089
+ description?: string | undefined;
2090
+ simulationId?: string | undefined;
2091
+ signatureRequestGroupId?: string | undefined;
2092
+ label?: string | undefined;
2093
+ })[];
2094
+ toolStates: ({
2095
+ toolCallId: string;
2096
+ actionId: string;
2097
+ state: "pending_user" | "pending_chain";
2098
+ signatureRequestGroupId: string;
2099
+ description?: string | undefined;
2100
+ simulationId?: string | undefined;
2101
+ label?: string | undefined;
2102
+ } | {
2103
+ toolCallId: string;
2104
+ actionId: string;
2105
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2106
+ description?: string | undefined;
2107
+ simulationId?: string | undefined;
2108
+ signatureRequestGroupId?: string | undefined;
2109
+ label?: string | undefined;
2110
+ })[];
2111
+ summary?: string | undefined;
2112
+ }, {
2113
+ metadata: Record<string, unknown>;
2114
+ version: "v2";
2115
+ runId: string;
2116
+ turnId: string;
2117
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2118
+ visibleParts: ({
2119
+ text: string;
2120
+ type: "text";
2121
+ id: string;
2122
+ } | {
2123
+ type: "pending-approval-card";
2124
+ toolCallId: string;
2125
+ id: string;
2126
+ actionId: string;
2127
+ state: "pending_user" | "pending_chain";
2128
+ signatureRequestGroupId: string;
2129
+ description?: string | undefined;
2130
+ label?: string | undefined;
2131
+ } | {
2132
+ type: "tool-state-card";
2133
+ toolCallId: string;
2134
+ id: string;
2135
+ actionId: string;
2136
+ state: "pending_user" | "pending_chain";
2137
+ signatureRequestGroupId: string;
2138
+ description?: string | undefined;
2139
+ label?: string | undefined;
2140
+ } | {
2141
+ type: "tool-state-card";
2142
+ toolCallId: string;
2143
+ id: string;
2144
+ actionId: string;
2145
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2146
+ description?: string | undefined;
2147
+ simulationId?: string | undefined;
2148
+ signatureRequestGroupId?: string | undefined;
2149
+ label?: string | undefined;
2150
+ })[];
2151
+ toolStates: ({
2152
+ toolCallId: string;
2153
+ actionId: string;
2154
+ state: "pending_user" | "pending_chain";
2155
+ signatureRequestGroupId: string;
2156
+ description?: string | undefined;
2157
+ simulationId?: string | undefined;
2158
+ label?: string | undefined;
2159
+ } | {
2160
+ toolCallId: string;
2161
+ actionId: string;
2162
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2163
+ description?: string | undefined;
2164
+ simulationId?: string | undefined;
2165
+ signatureRequestGroupId?: string | undefined;
2166
+ label?: string | undefined;
2167
+ })[];
2168
+ summary?: string | undefined;
2169
+ }>;
2170
+ }, "strict", z.ZodTypeAny, {
2171
+ version: "v2";
2172
+ timestamp: number;
2173
+ runId: string;
2174
+ turnId: string;
2175
+ sequence: number;
2176
+ targetId: string;
2177
+ durable: true;
2178
+ eventType: "turn-complete";
2179
+ snapshot: {
2180
+ metadata: Record<string, unknown>;
2181
+ version: "v2";
2182
+ runId: string;
2183
+ turnId: string;
2184
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2185
+ visibleParts: ({
2186
+ text: string;
2187
+ type: "text";
2188
+ id: string;
2189
+ } | {
2190
+ type: "pending-approval-card";
2191
+ toolCallId: string;
2192
+ id: string;
2193
+ actionId: string;
2194
+ state: "pending_user" | "pending_chain";
2195
+ signatureRequestGroupId: string;
2196
+ description?: string | undefined;
2197
+ label?: string | undefined;
2198
+ } | {
2199
+ type: "tool-state-card";
2200
+ toolCallId: string;
2201
+ id: string;
2202
+ actionId: string;
2203
+ state: "pending_user" | "pending_chain";
2204
+ signatureRequestGroupId: string;
2205
+ description?: string | undefined;
2206
+ label?: string | undefined;
2207
+ } | {
2208
+ type: "tool-state-card";
2209
+ toolCallId: string;
2210
+ id: string;
2211
+ actionId: string;
2212
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2213
+ description?: string | undefined;
2214
+ simulationId?: string | undefined;
2215
+ signatureRequestGroupId?: string | undefined;
2216
+ label?: string | undefined;
2217
+ })[];
2218
+ toolStates: ({
2219
+ toolCallId: string;
2220
+ actionId: string;
2221
+ state: "pending_user" | "pending_chain";
2222
+ signatureRequestGroupId: string;
2223
+ description?: string | undefined;
2224
+ simulationId?: string | undefined;
2225
+ label?: string | undefined;
2226
+ } | {
2227
+ toolCallId: string;
2228
+ actionId: string;
2229
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2230
+ description?: string | undefined;
2231
+ simulationId?: string | undefined;
2232
+ signatureRequestGroupId?: string | undefined;
2233
+ label?: string | undefined;
2234
+ })[];
2235
+ summary?: string | undefined;
2236
+ };
2237
+ }, {
2238
+ version: "v2";
2239
+ timestamp: number;
2240
+ runId: string;
2241
+ turnId: string;
2242
+ sequence: number;
2243
+ targetId: string;
2244
+ durable: true;
2245
+ eventType: "turn-complete";
2246
+ snapshot: {
2247
+ metadata: Record<string, unknown>;
2248
+ version: "v2";
2249
+ runId: string;
2250
+ turnId: string;
2251
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2252
+ visibleParts: ({
2253
+ text: string;
2254
+ type: "text";
2255
+ id: string;
2256
+ } | {
2257
+ type: "pending-approval-card";
2258
+ toolCallId: string;
2259
+ id: string;
2260
+ actionId: string;
2261
+ state: "pending_user" | "pending_chain";
2262
+ signatureRequestGroupId: string;
2263
+ description?: string | undefined;
2264
+ label?: string | undefined;
2265
+ } | {
2266
+ type: "tool-state-card";
2267
+ toolCallId: string;
2268
+ id: string;
2269
+ actionId: string;
2270
+ state: "pending_user" | "pending_chain";
2271
+ signatureRequestGroupId: string;
2272
+ description?: string | undefined;
2273
+ label?: string | undefined;
2274
+ } | {
2275
+ type: "tool-state-card";
2276
+ toolCallId: string;
2277
+ id: string;
2278
+ actionId: string;
2279
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2280
+ description?: string | undefined;
2281
+ simulationId?: string | undefined;
2282
+ signatureRequestGroupId?: string | undefined;
2283
+ label?: string | undefined;
2284
+ })[];
2285
+ toolStates: ({
2286
+ toolCallId: string;
2287
+ actionId: string;
2288
+ state: "pending_user" | "pending_chain";
2289
+ signatureRequestGroupId: string;
2290
+ description?: string | undefined;
2291
+ simulationId?: string | undefined;
2292
+ label?: string | undefined;
2293
+ } | {
2294
+ toolCallId: string;
2295
+ actionId: string;
2296
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2297
+ description?: string | undefined;
2298
+ simulationId?: string | undefined;
2299
+ signatureRequestGroupId?: string | undefined;
2300
+ label?: string | undefined;
2301
+ })[];
2302
+ summary?: string | undefined;
2303
+ };
2304
+ }>, {
2305
+ version: "v2";
2306
+ timestamp: number;
2307
+ runId: string;
2308
+ turnId: string;
2309
+ sequence: number;
2310
+ targetId: string;
2311
+ durable: true;
2312
+ eventType: "turn-complete";
2313
+ snapshot: {
2314
+ metadata: Record<string, unknown>;
2315
+ version: "v2";
2316
+ runId: string;
2317
+ turnId: string;
2318
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2319
+ visibleParts: ({
2320
+ text: string;
2321
+ type: "text";
2322
+ id: string;
2323
+ } | {
2324
+ type: "pending-approval-card";
2325
+ toolCallId: string;
2326
+ id: string;
2327
+ actionId: string;
2328
+ state: "pending_user" | "pending_chain";
2329
+ signatureRequestGroupId: string;
2330
+ description?: string | undefined;
2331
+ label?: string | undefined;
2332
+ } | {
2333
+ type: "tool-state-card";
2334
+ toolCallId: string;
2335
+ id: string;
2336
+ actionId: string;
2337
+ state: "pending_user" | "pending_chain";
2338
+ signatureRequestGroupId: string;
2339
+ description?: string | undefined;
2340
+ label?: string | undefined;
2341
+ } | {
2342
+ type: "tool-state-card";
2343
+ toolCallId: string;
2344
+ id: string;
2345
+ actionId: string;
2346
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2347
+ description?: string | undefined;
2348
+ simulationId?: string | undefined;
2349
+ signatureRequestGroupId?: string | undefined;
2350
+ label?: string | undefined;
2351
+ })[];
2352
+ toolStates: ({
2353
+ toolCallId: string;
2354
+ actionId: string;
2355
+ state: "pending_user" | "pending_chain";
2356
+ signatureRequestGroupId: string;
2357
+ description?: string | undefined;
2358
+ simulationId?: string | undefined;
2359
+ label?: string | undefined;
2360
+ } | {
2361
+ toolCallId: string;
2362
+ actionId: string;
2363
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2364
+ description?: string | undefined;
2365
+ simulationId?: string | undefined;
2366
+ signatureRequestGroupId?: string | undefined;
2367
+ label?: string | undefined;
2368
+ })[];
2369
+ summary?: string | undefined;
2370
+ };
2371
+ }, {
2372
+ version: "v2";
2373
+ timestamp: number;
2374
+ runId: string;
2375
+ turnId: string;
2376
+ sequence: number;
2377
+ targetId: string;
2378
+ durable: true;
2379
+ eventType: "turn-complete";
2380
+ snapshot: {
2381
+ metadata: Record<string, unknown>;
2382
+ version: "v2";
2383
+ runId: string;
2384
+ turnId: string;
2385
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2386
+ visibleParts: ({
2387
+ text: string;
2388
+ type: "text";
2389
+ id: string;
2390
+ } | {
2391
+ type: "pending-approval-card";
2392
+ toolCallId: string;
2393
+ id: string;
2394
+ actionId: string;
2395
+ state: "pending_user" | "pending_chain";
2396
+ signatureRequestGroupId: string;
2397
+ description?: string | undefined;
2398
+ label?: string | undefined;
2399
+ } | {
2400
+ type: "tool-state-card";
2401
+ toolCallId: string;
2402
+ id: string;
2403
+ actionId: string;
2404
+ state: "pending_user" | "pending_chain";
2405
+ signatureRequestGroupId: string;
2406
+ description?: string | undefined;
2407
+ label?: string | undefined;
2408
+ } | {
2409
+ type: "tool-state-card";
2410
+ toolCallId: string;
2411
+ id: string;
2412
+ actionId: string;
2413
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2414
+ description?: string | undefined;
2415
+ simulationId?: string | undefined;
2416
+ signatureRequestGroupId?: string | undefined;
2417
+ label?: string | undefined;
2418
+ })[];
2419
+ toolStates: ({
2420
+ toolCallId: string;
2421
+ actionId: string;
2422
+ state: "pending_user" | "pending_chain";
2423
+ signatureRequestGroupId: string;
2424
+ description?: string | undefined;
2425
+ simulationId?: string | undefined;
2426
+ label?: string | undefined;
2427
+ } | {
2428
+ toolCallId: 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
+ summary?: string | undefined;
2437
+ };
2438
+ }>, z.ZodObject<{
2439
+ version: z.ZodLiteral<"v2">;
2440
+ runId: z.ZodString;
2441
+ turnId: z.ZodString;
2442
+ sequence: z.ZodNumber;
2443
+ targetId: z.ZodString;
2444
+ timestamp: z.ZodNumber;
2445
+ } & {
2446
+ eventType: z.ZodLiteral<"run-complete">;
2447
+ durable: z.ZodLiteral<true>;
2448
+ completedTurnIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2449
+ summary: z.ZodOptional<z.ZodString>;
2450
+ }, "strict", z.ZodTypeAny, {
2451
+ version: "v2";
2452
+ timestamp: number;
2453
+ runId: string;
2454
+ turnId: string;
2455
+ sequence: number;
2456
+ targetId: string;
2457
+ durable: true;
2458
+ eventType: "run-complete";
2459
+ summary?: string | undefined;
2460
+ completedTurnIds?: string[] | undefined;
2461
+ }, {
2462
+ version: "v2";
2463
+ timestamp: number;
2464
+ runId: string;
2465
+ turnId: string;
2466
+ sequence: number;
2467
+ targetId: string;
2468
+ durable: true;
2469
+ eventType: "run-complete";
2470
+ summary?: string | undefined;
2471
+ completedTurnIds?: string[] | undefined;
2472
+ }>, z.ZodObject<{
2473
+ version: z.ZodLiteral<"v2">;
2474
+ runId: z.ZodString;
2475
+ turnId: z.ZodString;
2476
+ sequence: z.ZodNumber;
2477
+ targetId: z.ZodString;
2478
+ timestamp: z.ZodNumber;
2479
+ } & {
2480
+ eventType: z.ZodLiteral<"error-state">;
2481
+ durable: z.ZodLiteral<false>;
2482
+ error: z.ZodString;
2483
+ code: z.ZodOptional<z.ZodString>;
2484
+ }, "strict", z.ZodTypeAny, {
2485
+ error: string;
2486
+ version: "v2";
2487
+ timestamp: number;
2488
+ runId: string;
2489
+ turnId: string;
2490
+ sequence: number;
2491
+ targetId: string;
2492
+ durable: false;
2493
+ eventType: "error-state";
2494
+ code?: string | undefined;
2495
+ }, {
2496
+ error: string;
2497
+ version: "v2";
2498
+ timestamp: number;
2499
+ runId: string;
2500
+ turnId: string;
2501
+ sequence: number;
2502
+ targetId: string;
2503
+ durable: false;
2504
+ eventType: "error-state";
2505
+ code?: string | undefined;
2506
+ }>]>;
2507
+ export declare const chatStreamDataPartSchema: z.ZodObject<{
2508
+ type: z.ZodLiteral<"data-chat-stream">;
2509
+ data: z.ZodUnion<[z.ZodObject<{
2510
+ version: z.ZodLiteral<"v2">;
2511
+ runId: z.ZodString;
2512
+ turnId: z.ZodString;
2513
+ sequence: z.ZodNumber;
2514
+ targetId: z.ZodString;
2515
+ timestamp: z.ZodNumber;
2516
+ } & {
2517
+ eventType: z.ZodLiteral<"turn-start">;
2518
+ durable: z.ZodLiteral<false>;
2519
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
2520
+ }, "strict", z.ZodTypeAny, {
2521
+ version: "v2";
2522
+ timestamp: number;
2523
+ runId: string;
2524
+ turnId: string;
2525
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2526
+ sequence: number;
2527
+ targetId: string;
2528
+ durable: false;
2529
+ eventType: "turn-start";
2530
+ }, {
2531
+ version: "v2";
2532
+ timestamp: number;
2533
+ runId: string;
2534
+ turnId: string;
2535
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
2536
+ sequence: number;
2537
+ targetId: string;
2538
+ durable: false;
2539
+ eventType: "turn-start";
2540
+ }>, z.ZodObject<{
2541
+ version: z.ZodLiteral<"v2">;
2542
+ runId: z.ZodString;
2543
+ turnId: z.ZodString;
2544
+ sequence: z.ZodNumber;
2545
+ targetId: z.ZodString;
2546
+ timestamp: z.ZodNumber;
2547
+ } & {
2548
+ eventType: z.ZodLiteral<"transcript-text-start">;
2549
+ durable: z.ZodLiteral<false>;
2550
+ }, "strict", z.ZodTypeAny, {
2551
+ version: "v2";
2552
+ timestamp: number;
2553
+ runId: string;
2554
+ turnId: string;
2555
+ sequence: number;
2556
+ targetId: string;
2557
+ durable: false;
2558
+ eventType: "transcript-text-start";
2559
+ }, {
2560
+ version: "v2";
2561
+ timestamp: number;
2562
+ runId: string;
2563
+ turnId: string;
2564
+ sequence: number;
2565
+ targetId: string;
2566
+ durable: false;
2567
+ eventType: "transcript-text-start";
2568
+ }>, z.ZodObject<{
2569
+ version: z.ZodLiteral<"v2">;
2570
+ runId: z.ZodString;
2571
+ turnId: z.ZodString;
2572
+ sequence: z.ZodNumber;
2573
+ targetId: z.ZodString;
2574
+ timestamp: z.ZodNumber;
2575
+ } & {
2576
+ eventType: z.ZodLiteral<"transcript-text-delta">;
2577
+ durable: z.ZodLiteral<false>;
2578
+ delta: z.ZodString;
2579
+ }, "strict", z.ZodTypeAny, {
2580
+ version: "v2";
2581
+ timestamp: number;
2582
+ delta: string;
2583
+ runId: string;
2584
+ turnId: string;
2585
+ sequence: number;
2586
+ targetId: string;
2587
+ durable: false;
2588
+ eventType: "transcript-text-delta";
2589
+ }, {
2590
+ version: "v2";
2591
+ timestamp: number;
2592
+ delta: string;
2593
+ runId: string;
2594
+ turnId: string;
2595
+ sequence: number;
2596
+ targetId: string;
2597
+ durable: false;
2598
+ eventType: "transcript-text-delta";
2599
+ }>, z.ZodObject<{
2600
+ version: z.ZodLiteral<"v2">;
2601
+ runId: z.ZodString;
2602
+ turnId: z.ZodString;
2603
+ sequence: z.ZodNumber;
2604
+ targetId: z.ZodString;
2605
+ timestamp: z.ZodNumber;
2606
+ } & {
2607
+ eventType: z.ZodLiteral<"transcript-text-end">;
2608
+ durable: z.ZodLiteral<false>;
2609
+ }, "strict", z.ZodTypeAny, {
2610
+ version: "v2";
2611
+ timestamp: number;
2612
+ runId: string;
2613
+ turnId: string;
2614
+ sequence: number;
2615
+ targetId: string;
2616
+ durable: false;
2617
+ eventType: "transcript-text-end";
2618
+ }, {
2619
+ version: "v2";
2620
+ timestamp: number;
2621
+ runId: string;
2622
+ turnId: string;
2623
+ sequence: number;
2624
+ targetId: string;
2625
+ durable: false;
2626
+ eventType: "transcript-text-end";
2627
+ }>, z.ZodObject<{
2628
+ version: z.ZodLiteral<"v2">;
2629
+ runId: z.ZodString;
2630
+ turnId: z.ZodString;
2631
+ sequence: z.ZodNumber;
2632
+ targetId: z.ZodString;
2633
+ timestamp: z.ZodNumber;
2634
+ } & {
2635
+ eventType: z.ZodLiteral<"progress-update">;
2636
+ durable: z.ZodLiteral<false>;
2637
+ message: z.ZodString;
2638
+ label: z.ZodOptional<z.ZodString>;
2639
+ }, "strict", z.ZodTypeAny, {
2640
+ message: string;
2641
+ version: "v2";
2642
+ timestamp: number;
2643
+ runId: string;
2644
+ turnId: string;
2645
+ sequence: number;
2646
+ targetId: string;
2647
+ durable: false;
2648
+ eventType: "progress-update";
2649
+ label?: string | undefined;
2650
+ }, {
2651
+ message: string;
2652
+ version: "v2";
2653
+ timestamp: number;
2654
+ runId: string;
2655
+ turnId: string;
2656
+ sequence: number;
2657
+ targetId: string;
2658
+ durable: false;
2659
+ eventType: "progress-update";
2660
+ label?: string | undefined;
2661
+ }>, z.ZodObject<{
2662
+ version: z.ZodLiteral<"v2">;
2663
+ runId: z.ZodString;
2664
+ turnId: z.ZodString;
2665
+ sequence: z.ZodNumber;
2666
+ targetId: z.ZodString;
2667
+ timestamp: z.ZodNumber;
2668
+ } & {
2669
+ eventType: z.ZodLiteral<"tool-state">;
2670
+ durable: z.ZodLiteral<true>;
2671
+ actionId: z.ZodString;
2672
+ toolCallId: z.ZodString;
2673
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
2674
+ simulationId: z.ZodOptional<z.ZodString>;
2675
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
2676
+ label: z.ZodOptional<z.ZodString>;
2677
+ description: z.ZodOptional<z.ZodString>;
2678
+ }, "strict", z.ZodTypeAny, {
2679
+ toolCallId: string;
2680
+ version: "v2";
2681
+ timestamp: number;
2682
+ actionId: string;
2683
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2684
+ runId: string;
2685
+ turnId: string;
2686
+ sequence: number;
2687
+ targetId: string;
2688
+ durable: true;
2689
+ eventType: "tool-state";
2690
+ description?: string | undefined;
2691
+ simulationId?: string | undefined;
2692
+ signatureRequestGroupId?: string | undefined;
2693
+ label?: string | undefined;
2694
+ }, {
2695
+ toolCallId: string;
2696
+ version: "v2";
2697
+ timestamp: number;
2698
+ actionId: string;
2699
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2700
+ runId: string;
2701
+ turnId: string;
2702
+ sequence: number;
2703
+ targetId: string;
2704
+ durable: true;
2705
+ eventType: "tool-state";
2706
+ description?: string | undefined;
2707
+ simulationId?: string | undefined;
2708
+ signatureRequestGroupId?: string | undefined;
2709
+ label?: string | undefined;
2710
+ }>, z.ZodUnion<[z.ZodObject<{
2711
+ version: z.ZodLiteral<"v2">;
2712
+ runId: z.ZodString;
2713
+ turnId: z.ZodString;
2714
+ sequence: z.ZodNumber;
2715
+ targetId: z.ZodString;
2716
+ timestamp: z.ZodNumber;
2717
+ } & {
2718
+ eventType: z.ZodLiteral<"simulation-state">;
2719
+ durable: z.ZodLiteral<false>;
2720
+ actionId: z.ZodString;
2721
+ simulationId: z.ZodString;
2722
+ toolCallId: z.ZodOptional<z.ZodString>;
2723
+ state: z.ZodEnum<["pending", "superseded"]>;
2724
+ summary: z.ZodOptional<z.ZodString>;
2725
+ error: z.ZodOptional<z.ZodString>;
2726
+ }, "strict", z.ZodTypeAny, {
2727
+ simulationId: string;
2728
+ version: "v2";
2729
+ timestamp: number;
2730
+ actionId: string;
2731
+ state: "pending" | "superseded";
2732
+ runId: string;
2733
+ turnId: string;
2734
+ sequence: number;
2735
+ targetId: string;
2736
+ durable: false;
2737
+ eventType: "simulation-state";
2738
+ error?: string | undefined;
2739
+ toolCallId?: string | undefined;
2740
+ summary?: string | undefined;
2741
+ }, {
2742
+ simulationId: string;
2743
+ version: "v2";
2744
+ timestamp: number;
2745
+ actionId: string;
2746
+ state: "pending" | "superseded";
2747
+ runId: string;
2748
+ turnId: string;
2749
+ sequence: number;
2750
+ targetId: string;
2751
+ durable: false;
2752
+ eventType: "simulation-state";
2753
+ error?: string | undefined;
2754
+ toolCallId?: string | undefined;
2755
+ summary?: string | undefined;
2756
+ }>, z.ZodObject<{
2757
+ version: z.ZodLiteral<"v2">;
2758
+ runId: z.ZodString;
2759
+ turnId: z.ZodString;
2760
+ sequence: z.ZodNumber;
2761
+ targetId: z.ZodString;
2762
+ timestamp: z.ZodNumber;
2763
+ } & {
2764
+ eventType: z.ZodLiteral<"simulation-state">;
2765
+ durable: z.ZodBoolean;
2766
+ actionId: z.ZodString;
2767
+ simulationId: z.ZodString;
2768
+ toolCallId: z.ZodOptional<z.ZodString>;
2769
+ state: z.ZodEnum<["complete", "failed"]>;
2770
+ summary: z.ZodOptional<z.ZodString>;
2771
+ error: z.ZodOptional<z.ZodString>;
2772
+ }, "strict", z.ZodTypeAny, {
2773
+ simulationId: string;
2774
+ version: "v2";
2775
+ timestamp: number;
2776
+ actionId: string;
2777
+ state: "failed" | "complete";
2778
+ runId: string;
2779
+ turnId: string;
2780
+ sequence: number;
2781
+ targetId: string;
2782
+ durable: boolean;
2783
+ eventType: "simulation-state";
2784
+ error?: string | undefined;
2785
+ toolCallId?: string | undefined;
2786
+ summary?: string | undefined;
2787
+ }, {
2788
+ simulationId: string;
2789
+ version: "v2";
2790
+ timestamp: number;
2791
+ actionId: string;
2792
+ state: "failed" | "complete";
2793
+ runId: string;
2794
+ turnId: string;
2795
+ sequence: number;
2796
+ targetId: string;
2797
+ durable: boolean;
2798
+ eventType: "simulation-state";
2799
+ error?: string | undefined;
2800
+ toolCallId?: string | undefined;
2801
+ summary?: string | undefined;
2802
+ }>]>, z.ZodObject<{
2803
+ version: z.ZodLiteral<"v2">;
2804
+ runId: z.ZodString;
2805
+ turnId: z.ZodString;
2806
+ sequence: z.ZodNumber;
2807
+ targetId: z.ZodString;
2808
+ timestamp: z.ZodNumber;
2809
+ } & {
2810
+ eventType: z.ZodLiteral<"signature-state">;
2811
+ durable: z.ZodLiteral<true>;
2812
+ actionId: z.ZodString;
2813
+ toolCallId: z.ZodString;
2814
+ signatureRequestGroupId: z.ZodString;
2815
+ state: z.ZodEnum<["pending_user", "pending_chain", "success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
2816
+ label: z.ZodOptional<z.ZodString>;
2817
+ description: z.ZodOptional<z.ZodString>;
2818
+ }, "strict", z.ZodTypeAny, {
2819
+ toolCallId: string;
2820
+ version: "v2";
2821
+ timestamp: number;
2822
+ actionId: string;
2823
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2824
+ signatureRequestGroupId: string;
2825
+ runId: string;
2826
+ turnId: string;
2827
+ sequence: number;
2828
+ targetId: string;
2829
+ durable: true;
2830
+ eventType: "signature-state";
2831
+ description?: string | undefined;
2832
+ label?: string | undefined;
2833
+ }, {
2834
+ toolCallId: string;
2835
+ version: "v2";
2836
+ timestamp: number;
2837
+ actionId: string;
2838
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2839
+ signatureRequestGroupId: string;
2840
+ runId: string;
2841
+ turnId: string;
2842
+ sequence: number;
2843
+ targetId: string;
2844
+ durable: true;
2845
+ eventType: "signature-state";
2846
+ description?: string | undefined;
2847
+ label?: string | undefined;
2848
+ }>, z.ZodObject<{
2849
+ version: z.ZodLiteral<"v2">;
2850
+ runId: z.ZodString;
2851
+ turnId: z.ZodString;
2852
+ sequence: z.ZodNumber;
2853
+ targetId: z.ZodString;
2854
+ timestamp: z.ZodNumber;
2855
+ } & {
2856
+ eventType: z.ZodLiteral<"turn-summary">;
2857
+ durable: z.ZodLiteral<true>;
2858
+ summary: z.ZodString;
2859
+ }, "strict", z.ZodTypeAny, {
2860
+ version: "v2";
2861
+ timestamp: number;
2862
+ runId: string;
2863
+ turnId: string;
2864
+ summary: string;
2865
+ sequence: number;
2866
+ targetId: string;
2867
+ durable: true;
2868
+ eventType: "turn-summary";
2869
+ }, {
2870
+ version: "v2";
2871
+ timestamp: number;
2872
+ runId: string;
2873
+ turnId: string;
2874
+ summary: string;
2875
+ sequence: number;
2876
+ targetId: string;
2877
+ durable: true;
2878
+ eventType: "turn-summary";
2879
+ }>, z.ZodEffects<z.ZodObject<{
2880
+ version: z.ZodLiteral<"v2">;
2881
+ runId: z.ZodString;
2882
+ turnId: z.ZodString;
2883
+ sequence: z.ZodNumber;
2884
+ targetId: z.ZodString;
2885
+ timestamp: z.ZodNumber;
2886
+ } & {
2887
+ eventType: z.ZodLiteral<"turn-complete">;
2888
+ durable: z.ZodLiteral<true>;
2889
+ snapshot: z.ZodObject<{
2890
+ version: z.ZodLiteral<"v2">;
2891
+ runId: z.ZodString;
2892
+ turnId: z.ZodString;
2893
+ turnKind: z.ZodEnum<["initial-response", "action-preparation", "pending-approval", "tool-continuation", "completion-summary", "clarification"]>;
2894
+ summary: z.ZodOptional<z.ZodString>;
2895
+ visibleParts: z.ZodArray<z.ZodUnion<[z.ZodObject<{
2896
+ type: z.ZodLiteral<"text">;
2897
+ id: z.ZodString;
2898
+ text: z.ZodString;
2899
+ }, "strict", z.ZodTypeAny, {
2900
+ text: string;
2901
+ type: "text";
2902
+ id: string;
2903
+ }, {
2904
+ text: string;
2905
+ type: "text";
2906
+ id: string;
2907
+ }>, z.ZodObject<{
2908
+ type: z.ZodLiteral<"pending-approval-card">;
2909
+ id: z.ZodString;
2910
+ actionId: z.ZodString;
2911
+ toolCallId: z.ZodString;
2912
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
2913
+ signatureRequestGroupId: z.ZodString;
2914
+ label: z.ZodOptional<z.ZodString>;
2915
+ description: z.ZodOptional<z.ZodString>;
2916
+ }, "strict", z.ZodTypeAny, {
2917
+ type: "pending-approval-card";
2918
+ toolCallId: string;
2919
+ id: string;
2920
+ actionId: string;
2921
+ state: "pending_user" | "pending_chain";
2922
+ signatureRequestGroupId: string;
2923
+ description?: string | undefined;
2924
+ label?: string | undefined;
2925
+ }, {
2926
+ type: "pending-approval-card";
2927
+ toolCallId: string;
2928
+ id: string;
2929
+ actionId: string;
2930
+ state: "pending_user" | "pending_chain";
2931
+ signatureRequestGroupId: string;
2932
+ description?: string | undefined;
2933
+ label?: string | undefined;
2934
+ }>, z.ZodUnion<[z.ZodObject<{
2935
+ type: z.ZodLiteral<"tool-state-card">;
2936
+ id: z.ZodString;
2937
+ actionId: z.ZodString;
2938
+ toolCallId: z.ZodString;
2939
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
2940
+ signatureRequestGroupId: z.ZodString;
2941
+ label: z.ZodOptional<z.ZodString>;
2942
+ description: z.ZodOptional<z.ZodString>;
2943
+ }, "strict", z.ZodTypeAny, {
2944
+ type: "tool-state-card";
2945
+ toolCallId: string;
2946
+ id: string;
2947
+ actionId: string;
2948
+ state: "pending_user" | "pending_chain";
2949
+ signatureRequestGroupId: string;
2950
+ description?: string | undefined;
2951
+ label?: string | undefined;
2952
+ }, {
2953
+ type: "tool-state-card";
2954
+ toolCallId: string;
2955
+ id: string;
2956
+ actionId: string;
2957
+ state: "pending_user" | "pending_chain";
2958
+ signatureRequestGroupId: string;
2959
+ description?: string | undefined;
2960
+ label?: string | undefined;
2961
+ }>, z.ZodObject<{
2962
+ type: z.ZodLiteral<"tool-state-card">;
2963
+ id: z.ZodString;
2964
+ actionId: z.ZodString;
2965
+ toolCallId: z.ZodString;
2966
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
2967
+ simulationId: z.ZodOptional<z.ZodString>;
2968
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
2969
+ label: z.ZodOptional<z.ZodString>;
2970
+ description: z.ZodOptional<z.ZodString>;
2971
+ }, "strict", z.ZodTypeAny, {
2972
+ type: "tool-state-card";
2973
+ toolCallId: string;
2974
+ id: string;
2975
+ actionId: string;
2976
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2977
+ description?: string | undefined;
2978
+ simulationId?: string | undefined;
2979
+ signatureRequestGroupId?: string | undefined;
2980
+ label?: string | undefined;
2981
+ }, {
2982
+ type: "tool-state-card";
2983
+ toolCallId: string;
2984
+ id: string;
2985
+ actionId: string;
2986
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
2987
+ description?: string | undefined;
2988
+ simulationId?: string | undefined;
2989
+ signatureRequestGroupId?: string | undefined;
2990
+ label?: string | undefined;
2991
+ }>]>]>, "many">;
2992
+ toolStates: z.ZodArray<z.ZodUnion<[z.ZodObject<{
2993
+ actionId: z.ZodString;
2994
+ toolCallId: z.ZodString;
2995
+ state: z.ZodEnum<["pending_user", "pending_chain"]>;
2996
+ simulationId: z.ZodOptional<z.ZodString>;
2997
+ signatureRequestGroupId: z.ZodString;
2998
+ label: z.ZodOptional<z.ZodString>;
2999
+ description: z.ZodOptional<z.ZodString>;
3000
+ }, "strict", z.ZodTypeAny, {
3001
+ toolCallId: string;
3002
+ actionId: string;
3003
+ state: "pending_user" | "pending_chain";
3004
+ signatureRequestGroupId: string;
3005
+ description?: string | undefined;
3006
+ simulationId?: string | undefined;
3007
+ label?: string | undefined;
3008
+ }, {
3009
+ toolCallId: string;
3010
+ actionId: string;
3011
+ state: "pending_user" | "pending_chain";
3012
+ signatureRequestGroupId: string;
3013
+ description?: string | undefined;
3014
+ simulationId?: string | undefined;
3015
+ label?: string | undefined;
3016
+ }>, z.ZodObject<{
3017
+ actionId: z.ZodString;
3018
+ toolCallId: z.ZodString;
3019
+ state: z.ZodEnum<["success_submitted", "success_confirmed", "cancelled_by_user", "failed_tool", "failed_wallet", "expired", "superseded"]>;
3020
+ simulationId: z.ZodOptional<z.ZodString>;
3021
+ signatureRequestGroupId: z.ZodOptional<z.ZodString>;
3022
+ label: z.ZodOptional<z.ZodString>;
3023
+ description: z.ZodOptional<z.ZodString>;
3024
+ }, "strict", z.ZodTypeAny, {
3025
+ toolCallId: string;
3026
+ actionId: string;
3027
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3028
+ description?: string | undefined;
3029
+ simulationId?: string | undefined;
3030
+ signatureRequestGroupId?: string | undefined;
3031
+ label?: string | undefined;
3032
+ }, {
3033
+ toolCallId: string;
3034
+ actionId: string;
3035
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3036
+ description?: string | undefined;
3037
+ simulationId?: string | undefined;
3038
+ signatureRequestGroupId?: string | undefined;
3039
+ label?: string | undefined;
3040
+ }>]>, "many">;
3041
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3042
+ }, "strict", z.ZodTypeAny, {
3043
+ metadata: Record<string, unknown>;
3044
+ version: "v2";
3045
+ runId: string;
3046
+ turnId: string;
3047
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3048
+ visibleParts: ({
3049
+ text: string;
3050
+ type: "text";
3051
+ id: string;
3052
+ } | {
3053
+ type: "pending-approval-card";
3054
+ toolCallId: string;
3055
+ id: string;
3056
+ actionId: string;
3057
+ state: "pending_user" | "pending_chain";
3058
+ signatureRequestGroupId: string;
3059
+ description?: string | undefined;
3060
+ label?: string | undefined;
3061
+ } | {
3062
+ type: "tool-state-card";
3063
+ toolCallId: string;
3064
+ id: string;
3065
+ actionId: string;
3066
+ state: "pending_user" | "pending_chain";
3067
+ signatureRequestGroupId: string;
3068
+ description?: string | undefined;
3069
+ label?: string | undefined;
3070
+ } | {
3071
+ type: "tool-state-card";
3072
+ toolCallId: string;
3073
+ id: string;
3074
+ actionId: string;
3075
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3076
+ description?: string | undefined;
3077
+ simulationId?: string | undefined;
3078
+ signatureRequestGroupId?: string | undefined;
3079
+ label?: string | undefined;
3080
+ })[];
3081
+ toolStates: ({
3082
+ toolCallId: string;
3083
+ actionId: string;
3084
+ state: "pending_user" | "pending_chain";
3085
+ signatureRequestGroupId: string;
3086
+ description?: string | undefined;
3087
+ simulationId?: string | undefined;
3088
+ label?: string | undefined;
3089
+ } | {
3090
+ toolCallId: string;
3091
+ actionId: string;
3092
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3093
+ description?: string | undefined;
3094
+ simulationId?: string | undefined;
3095
+ signatureRequestGroupId?: string | undefined;
3096
+ label?: string | undefined;
3097
+ })[];
3098
+ summary?: string | undefined;
3099
+ }, {
3100
+ metadata: Record<string, unknown>;
3101
+ version: "v2";
3102
+ runId: string;
3103
+ turnId: string;
3104
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3105
+ visibleParts: ({
3106
+ text: string;
3107
+ type: "text";
3108
+ id: string;
3109
+ } | {
3110
+ type: "pending-approval-card";
3111
+ toolCallId: string;
3112
+ id: string;
3113
+ actionId: string;
3114
+ state: "pending_user" | "pending_chain";
3115
+ signatureRequestGroupId: string;
3116
+ description?: string | undefined;
3117
+ label?: string | undefined;
3118
+ } | {
3119
+ type: "tool-state-card";
3120
+ toolCallId: string;
3121
+ id: string;
3122
+ actionId: string;
3123
+ state: "pending_user" | "pending_chain";
3124
+ signatureRequestGroupId: string;
3125
+ description?: string | undefined;
3126
+ label?: string | undefined;
3127
+ } | {
3128
+ type: "tool-state-card";
3129
+ toolCallId: string;
3130
+ id: string;
3131
+ actionId: string;
3132
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3133
+ description?: string | undefined;
3134
+ simulationId?: string | undefined;
3135
+ signatureRequestGroupId?: string | undefined;
3136
+ label?: string | undefined;
3137
+ })[];
3138
+ toolStates: ({
3139
+ toolCallId: string;
3140
+ actionId: string;
3141
+ state: "pending_user" | "pending_chain";
3142
+ signatureRequestGroupId: string;
3143
+ description?: string | undefined;
3144
+ simulationId?: string | undefined;
3145
+ label?: string | undefined;
3146
+ } | {
3147
+ toolCallId: string;
3148
+ actionId: string;
3149
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3150
+ description?: string | undefined;
3151
+ simulationId?: string | undefined;
3152
+ signatureRequestGroupId?: string | undefined;
3153
+ label?: string | undefined;
3154
+ })[];
3155
+ summary?: string | undefined;
3156
+ }>;
3157
+ }, "strict", z.ZodTypeAny, {
3158
+ version: "v2";
3159
+ timestamp: number;
3160
+ runId: string;
3161
+ turnId: string;
3162
+ sequence: number;
3163
+ targetId: string;
3164
+ durable: true;
3165
+ eventType: "turn-complete";
3166
+ snapshot: {
3167
+ metadata: Record<string, unknown>;
3168
+ version: "v2";
3169
+ runId: string;
3170
+ turnId: string;
3171
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3172
+ visibleParts: ({
3173
+ text: string;
3174
+ type: "text";
3175
+ id: string;
3176
+ } | {
3177
+ type: "pending-approval-card";
3178
+ toolCallId: string;
3179
+ id: string;
3180
+ actionId: string;
3181
+ state: "pending_user" | "pending_chain";
3182
+ signatureRequestGroupId: string;
3183
+ description?: string | undefined;
3184
+ label?: string | undefined;
3185
+ } | {
3186
+ type: "tool-state-card";
3187
+ toolCallId: string;
3188
+ id: string;
3189
+ actionId: string;
3190
+ state: "pending_user" | "pending_chain";
3191
+ signatureRequestGroupId: string;
3192
+ description?: string | undefined;
3193
+ label?: string | undefined;
3194
+ } | {
3195
+ type: "tool-state-card";
3196
+ toolCallId: string;
3197
+ id: string;
3198
+ actionId: string;
3199
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3200
+ description?: string | undefined;
3201
+ simulationId?: string | undefined;
3202
+ signatureRequestGroupId?: string | undefined;
3203
+ label?: string | undefined;
3204
+ })[];
3205
+ toolStates: ({
3206
+ toolCallId: string;
3207
+ actionId: string;
3208
+ state: "pending_user" | "pending_chain";
3209
+ signatureRequestGroupId: string;
3210
+ description?: string | undefined;
3211
+ simulationId?: string | undefined;
3212
+ label?: string | undefined;
3213
+ } | {
3214
+ toolCallId: string;
3215
+ actionId: string;
3216
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3217
+ description?: string | undefined;
3218
+ simulationId?: string | undefined;
3219
+ signatureRequestGroupId?: string | undefined;
3220
+ label?: string | undefined;
3221
+ })[];
3222
+ summary?: string | undefined;
3223
+ };
3224
+ }, {
3225
+ version: "v2";
3226
+ timestamp: number;
3227
+ runId: string;
3228
+ turnId: string;
3229
+ sequence: number;
3230
+ targetId: string;
3231
+ durable: true;
3232
+ eventType: "turn-complete";
3233
+ snapshot: {
3234
+ metadata: Record<string, unknown>;
3235
+ version: "v2";
3236
+ runId: string;
3237
+ turnId: string;
3238
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3239
+ visibleParts: ({
3240
+ text: string;
3241
+ type: "text";
3242
+ id: string;
3243
+ } | {
3244
+ type: "pending-approval-card";
3245
+ toolCallId: string;
3246
+ id: string;
3247
+ actionId: string;
3248
+ state: "pending_user" | "pending_chain";
3249
+ signatureRequestGroupId: string;
3250
+ description?: string | undefined;
3251
+ label?: string | undefined;
3252
+ } | {
3253
+ type: "tool-state-card";
3254
+ toolCallId: string;
3255
+ id: string;
3256
+ actionId: string;
3257
+ state: "pending_user" | "pending_chain";
3258
+ signatureRequestGroupId: string;
3259
+ description?: string | undefined;
3260
+ label?: string | undefined;
3261
+ } | {
3262
+ type: "tool-state-card";
3263
+ toolCallId: string;
3264
+ id: string;
3265
+ actionId: string;
3266
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3267
+ description?: string | undefined;
3268
+ simulationId?: string | undefined;
3269
+ signatureRequestGroupId?: string | undefined;
3270
+ label?: string | undefined;
3271
+ })[];
3272
+ toolStates: ({
3273
+ toolCallId: string;
3274
+ actionId: string;
3275
+ state: "pending_user" | "pending_chain";
3276
+ signatureRequestGroupId: string;
3277
+ description?: string | undefined;
3278
+ simulationId?: string | undefined;
3279
+ label?: string | undefined;
3280
+ } | {
3281
+ toolCallId: string;
3282
+ actionId: string;
3283
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3284
+ description?: string | undefined;
3285
+ simulationId?: string | undefined;
3286
+ signatureRequestGroupId?: string | undefined;
3287
+ label?: string | undefined;
3288
+ })[];
3289
+ summary?: string | undefined;
3290
+ };
3291
+ }>, {
3292
+ version: "v2";
3293
+ timestamp: number;
3294
+ runId: string;
3295
+ turnId: string;
3296
+ sequence: number;
3297
+ targetId: string;
3298
+ durable: true;
3299
+ eventType: "turn-complete";
3300
+ snapshot: {
3301
+ metadata: Record<string, unknown>;
3302
+ version: "v2";
3303
+ runId: string;
3304
+ turnId: string;
3305
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3306
+ visibleParts: ({
3307
+ text: string;
3308
+ type: "text";
3309
+ id: string;
3310
+ } | {
3311
+ type: "pending-approval-card";
3312
+ toolCallId: string;
3313
+ id: string;
3314
+ actionId: string;
3315
+ state: "pending_user" | "pending_chain";
3316
+ signatureRequestGroupId: string;
3317
+ description?: string | undefined;
3318
+ label?: string | undefined;
3319
+ } | {
3320
+ type: "tool-state-card";
3321
+ toolCallId: string;
3322
+ id: string;
3323
+ actionId: string;
3324
+ state: "pending_user" | "pending_chain";
3325
+ signatureRequestGroupId: string;
3326
+ description?: string | undefined;
3327
+ label?: string | undefined;
3328
+ } | {
3329
+ type: "tool-state-card";
3330
+ toolCallId: string;
3331
+ id: string;
3332
+ actionId: string;
3333
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3334
+ description?: string | undefined;
3335
+ simulationId?: string | undefined;
3336
+ signatureRequestGroupId?: string | undefined;
3337
+ label?: string | undefined;
3338
+ })[];
3339
+ toolStates: ({
3340
+ toolCallId: string;
3341
+ actionId: string;
3342
+ state: "pending_user" | "pending_chain";
3343
+ signatureRequestGroupId: string;
3344
+ description?: string | undefined;
3345
+ simulationId?: string | undefined;
3346
+ label?: string | undefined;
3347
+ } | {
3348
+ toolCallId: string;
3349
+ actionId: string;
3350
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3351
+ description?: string | undefined;
3352
+ simulationId?: string | undefined;
3353
+ signatureRequestGroupId?: string | undefined;
3354
+ label?: string | undefined;
3355
+ })[];
3356
+ summary?: string | undefined;
3357
+ };
3358
+ }, {
3359
+ version: "v2";
3360
+ timestamp: number;
3361
+ runId: string;
3362
+ turnId: string;
3363
+ sequence: number;
3364
+ targetId: string;
3365
+ durable: true;
3366
+ eventType: "turn-complete";
3367
+ snapshot: {
3368
+ metadata: Record<string, unknown>;
3369
+ version: "v2";
3370
+ runId: string;
3371
+ turnId: string;
3372
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3373
+ visibleParts: ({
3374
+ text: string;
3375
+ type: "text";
3376
+ id: string;
3377
+ } | {
3378
+ type: "pending-approval-card";
3379
+ toolCallId: string;
3380
+ id: string;
3381
+ actionId: string;
3382
+ state: "pending_user" | "pending_chain";
3383
+ signatureRequestGroupId: string;
3384
+ description?: string | undefined;
3385
+ label?: string | undefined;
3386
+ } | {
3387
+ type: "tool-state-card";
3388
+ toolCallId: string;
3389
+ id: string;
3390
+ actionId: string;
3391
+ state: "pending_user" | "pending_chain";
3392
+ signatureRequestGroupId: string;
3393
+ description?: string | undefined;
3394
+ label?: string | undefined;
3395
+ } | {
3396
+ type: "tool-state-card";
3397
+ toolCallId: string;
3398
+ id: string;
3399
+ actionId: string;
3400
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3401
+ description?: string | undefined;
3402
+ simulationId?: string | undefined;
3403
+ signatureRequestGroupId?: string | undefined;
3404
+ label?: string | undefined;
3405
+ })[];
3406
+ toolStates: ({
3407
+ toolCallId: string;
3408
+ actionId: string;
3409
+ state: "pending_user" | "pending_chain";
3410
+ signatureRequestGroupId: string;
3411
+ description?: string | undefined;
3412
+ simulationId?: string | undefined;
3413
+ label?: string | undefined;
3414
+ } | {
3415
+ toolCallId: 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
+ summary?: string | undefined;
3424
+ };
3425
+ }>, z.ZodObject<{
3426
+ version: z.ZodLiteral<"v2">;
3427
+ runId: z.ZodString;
3428
+ turnId: z.ZodString;
3429
+ sequence: z.ZodNumber;
3430
+ targetId: z.ZodString;
3431
+ timestamp: z.ZodNumber;
3432
+ } & {
3433
+ eventType: z.ZodLiteral<"run-complete">;
3434
+ durable: z.ZodLiteral<true>;
3435
+ completedTurnIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3436
+ summary: z.ZodOptional<z.ZodString>;
3437
+ }, "strict", z.ZodTypeAny, {
3438
+ version: "v2";
3439
+ timestamp: number;
3440
+ runId: string;
3441
+ turnId: string;
3442
+ sequence: number;
3443
+ targetId: string;
3444
+ durable: true;
3445
+ eventType: "run-complete";
3446
+ summary?: string | undefined;
3447
+ completedTurnIds?: string[] | undefined;
3448
+ }, {
3449
+ version: "v2";
3450
+ timestamp: number;
3451
+ runId: string;
3452
+ turnId: string;
3453
+ sequence: number;
3454
+ targetId: string;
3455
+ durable: true;
3456
+ eventType: "run-complete";
3457
+ summary?: string | undefined;
3458
+ completedTurnIds?: string[] | undefined;
3459
+ }>, z.ZodObject<{
3460
+ version: z.ZodLiteral<"v2">;
3461
+ runId: z.ZodString;
3462
+ turnId: z.ZodString;
3463
+ sequence: z.ZodNumber;
3464
+ targetId: z.ZodString;
3465
+ timestamp: z.ZodNumber;
3466
+ } & {
3467
+ eventType: z.ZodLiteral<"error-state">;
3468
+ durable: z.ZodLiteral<false>;
3469
+ error: z.ZodString;
3470
+ code: z.ZodOptional<z.ZodString>;
3471
+ }, "strict", z.ZodTypeAny, {
3472
+ error: string;
3473
+ version: "v2";
3474
+ timestamp: number;
3475
+ runId: string;
3476
+ turnId: string;
3477
+ sequence: number;
3478
+ targetId: string;
3479
+ durable: false;
3480
+ eventType: "error-state";
3481
+ code?: string | undefined;
3482
+ }, {
3483
+ error: string;
3484
+ version: "v2";
3485
+ timestamp: number;
3486
+ runId: string;
3487
+ turnId: string;
3488
+ sequence: number;
3489
+ targetId: string;
3490
+ durable: false;
3491
+ eventType: "error-state";
3492
+ code?: string | undefined;
3493
+ }>]>;
3494
+ }, "strict", z.ZodTypeAny, {
3495
+ type: "data-chat-stream";
3496
+ data: {
3497
+ version: "v2";
3498
+ timestamp: number;
3499
+ runId: string;
3500
+ turnId: string;
3501
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3502
+ sequence: number;
3503
+ targetId: string;
3504
+ durable: false;
3505
+ eventType: "turn-start";
3506
+ } | {
3507
+ version: "v2";
3508
+ timestamp: number;
3509
+ runId: string;
3510
+ turnId: string;
3511
+ sequence: number;
3512
+ targetId: string;
3513
+ durable: false;
3514
+ eventType: "transcript-text-start";
3515
+ } | {
3516
+ version: "v2";
3517
+ timestamp: number;
3518
+ delta: string;
3519
+ runId: string;
3520
+ turnId: string;
3521
+ sequence: number;
3522
+ targetId: string;
3523
+ durable: false;
3524
+ eventType: "transcript-text-delta";
3525
+ } | {
3526
+ version: "v2";
3527
+ timestamp: number;
3528
+ runId: string;
3529
+ turnId: string;
3530
+ sequence: number;
3531
+ targetId: string;
3532
+ durable: false;
3533
+ eventType: "transcript-text-end";
3534
+ } | {
3535
+ message: string;
3536
+ version: "v2";
3537
+ timestamp: number;
3538
+ runId: string;
3539
+ turnId: string;
3540
+ sequence: number;
3541
+ targetId: string;
3542
+ durable: false;
3543
+ eventType: "progress-update";
3544
+ label?: string | undefined;
3545
+ } | {
3546
+ toolCallId: string;
3547
+ version: "v2";
3548
+ timestamp: number;
3549
+ actionId: string;
3550
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3551
+ runId: string;
3552
+ turnId: string;
3553
+ sequence: number;
3554
+ targetId: string;
3555
+ durable: true;
3556
+ eventType: "tool-state";
3557
+ description?: string | undefined;
3558
+ simulationId?: string | undefined;
3559
+ signatureRequestGroupId?: string | undefined;
3560
+ label?: string | undefined;
3561
+ } | {
3562
+ simulationId: string;
3563
+ version: "v2";
3564
+ timestamp: number;
3565
+ actionId: string;
3566
+ state: "pending" | "superseded";
3567
+ runId: string;
3568
+ turnId: string;
3569
+ sequence: number;
3570
+ targetId: string;
3571
+ durable: false;
3572
+ eventType: "simulation-state";
3573
+ error?: string | undefined;
3574
+ toolCallId?: string | undefined;
3575
+ summary?: string | undefined;
3576
+ } | {
3577
+ simulationId: string;
3578
+ version: "v2";
3579
+ timestamp: number;
3580
+ actionId: string;
3581
+ state: "failed" | "complete";
3582
+ runId: string;
3583
+ turnId: string;
3584
+ sequence: number;
3585
+ targetId: string;
3586
+ durable: boolean;
3587
+ eventType: "simulation-state";
3588
+ error?: string | undefined;
3589
+ toolCallId?: string | undefined;
3590
+ summary?: string | undefined;
3591
+ } | {
3592
+ toolCallId: string;
3593
+ version: "v2";
3594
+ timestamp: number;
3595
+ actionId: string;
3596
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3597
+ signatureRequestGroupId: string;
3598
+ runId: string;
3599
+ turnId: string;
3600
+ sequence: number;
3601
+ targetId: string;
3602
+ durable: true;
3603
+ eventType: "signature-state";
3604
+ description?: string | undefined;
3605
+ label?: string | undefined;
3606
+ } | {
3607
+ version: "v2";
3608
+ timestamp: number;
3609
+ runId: string;
3610
+ turnId: string;
3611
+ summary: string;
3612
+ sequence: number;
3613
+ targetId: string;
3614
+ durable: true;
3615
+ eventType: "turn-summary";
3616
+ } | {
3617
+ version: "v2";
3618
+ timestamp: number;
3619
+ runId: string;
3620
+ turnId: string;
3621
+ sequence: number;
3622
+ targetId: string;
3623
+ durable: true;
3624
+ eventType: "turn-complete";
3625
+ snapshot: {
3626
+ metadata: Record<string, unknown>;
3627
+ version: "v2";
3628
+ runId: string;
3629
+ turnId: string;
3630
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3631
+ visibleParts: ({
3632
+ text: string;
3633
+ type: "text";
3634
+ id: string;
3635
+ } | {
3636
+ type: "pending-approval-card";
3637
+ toolCallId: string;
3638
+ id: string;
3639
+ actionId: string;
3640
+ state: "pending_user" | "pending_chain";
3641
+ signatureRequestGroupId: string;
3642
+ description?: string | undefined;
3643
+ label?: string | undefined;
3644
+ } | {
3645
+ type: "tool-state-card";
3646
+ toolCallId: string;
3647
+ id: string;
3648
+ actionId: string;
3649
+ state: "pending_user" | "pending_chain";
3650
+ signatureRequestGroupId: string;
3651
+ description?: string | undefined;
3652
+ label?: string | undefined;
3653
+ } | {
3654
+ type: "tool-state-card";
3655
+ toolCallId: string;
3656
+ id: string;
3657
+ actionId: string;
3658
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3659
+ description?: string | undefined;
3660
+ simulationId?: string | undefined;
3661
+ signatureRequestGroupId?: string | undefined;
3662
+ label?: string | undefined;
3663
+ })[];
3664
+ toolStates: ({
3665
+ toolCallId: string;
3666
+ actionId: string;
3667
+ state: "pending_user" | "pending_chain";
3668
+ signatureRequestGroupId: string;
3669
+ description?: string | undefined;
3670
+ simulationId?: string | undefined;
3671
+ label?: string | undefined;
3672
+ } | {
3673
+ toolCallId: string;
3674
+ actionId: string;
3675
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3676
+ description?: string | undefined;
3677
+ simulationId?: string | undefined;
3678
+ signatureRequestGroupId?: string | undefined;
3679
+ label?: string | undefined;
3680
+ })[];
3681
+ summary?: string | undefined;
3682
+ };
3683
+ } | {
3684
+ version: "v2";
3685
+ timestamp: number;
3686
+ runId: string;
3687
+ turnId: string;
3688
+ sequence: number;
3689
+ targetId: string;
3690
+ durable: true;
3691
+ eventType: "run-complete";
3692
+ summary?: string | undefined;
3693
+ completedTurnIds?: string[] | undefined;
3694
+ } | {
3695
+ error: string;
3696
+ version: "v2";
3697
+ timestamp: number;
3698
+ runId: string;
3699
+ turnId: string;
3700
+ sequence: number;
3701
+ targetId: string;
3702
+ durable: false;
3703
+ eventType: "error-state";
3704
+ code?: string | undefined;
3705
+ };
3706
+ }, {
3707
+ type: "data-chat-stream";
3708
+ data: {
3709
+ version: "v2";
3710
+ timestamp: number;
3711
+ runId: string;
3712
+ turnId: string;
3713
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3714
+ sequence: number;
3715
+ targetId: string;
3716
+ durable: false;
3717
+ eventType: "turn-start";
3718
+ } | {
3719
+ version: "v2";
3720
+ timestamp: number;
3721
+ runId: string;
3722
+ turnId: string;
3723
+ sequence: number;
3724
+ targetId: string;
3725
+ durable: false;
3726
+ eventType: "transcript-text-start";
3727
+ } | {
3728
+ version: "v2";
3729
+ timestamp: number;
3730
+ delta: string;
3731
+ runId: string;
3732
+ turnId: string;
3733
+ sequence: number;
3734
+ targetId: string;
3735
+ durable: false;
3736
+ eventType: "transcript-text-delta";
3737
+ } | {
3738
+ version: "v2";
3739
+ timestamp: number;
3740
+ runId: string;
3741
+ turnId: string;
3742
+ sequence: number;
3743
+ targetId: string;
3744
+ durable: false;
3745
+ eventType: "transcript-text-end";
3746
+ } | {
3747
+ message: string;
3748
+ version: "v2";
3749
+ timestamp: number;
3750
+ runId: string;
3751
+ turnId: string;
3752
+ sequence: number;
3753
+ targetId: string;
3754
+ durable: false;
3755
+ eventType: "progress-update";
3756
+ label?: string | undefined;
3757
+ } | {
3758
+ toolCallId: string;
3759
+ version: "v2";
3760
+ timestamp: number;
3761
+ actionId: string;
3762
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3763
+ runId: string;
3764
+ turnId: string;
3765
+ sequence: number;
3766
+ targetId: string;
3767
+ durable: true;
3768
+ eventType: "tool-state";
3769
+ description?: string | undefined;
3770
+ simulationId?: string | undefined;
3771
+ signatureRequestGroupId?: string | undefined;
3772
+ label?: string | undefined;
3773
+ } | {
3774
+ simulationId: string;
3775
+ version: "v2";
3776
+ timestamp: number;
3777
+ actionId: string;
3778
+ state: "pending" | "superseded";
3779
+ runId: string;
3780
+ turnId: string;
3781
+ sequence: number;
3782
+ targetId: string;
3783
+ durable: false;
3784
+ eventType: "simulation-state";
3785
+ error?: string | undefined;
3786
+ toolCallId?: string | undefined;
3787
+ summary?: string | undefined;
3788
+ } | {
3789
+ simulationId: string;
3790
+ version: "v2";
3791
+ timestamp: number;
3792
+ actionId: string;
3793
+ state: "failed" | "complete";
3794
+ runId: string;
3795
+ turnId: string;
3796
+ sequence: number;
3797
+ targetId: string;
3798
+ durable: boolean;
3799
+ eventType: "simulation-state";
3800
+ error?: string | undefined;
3801
+ toolCallId?: string | undefined;
3802
+ summary?: string | undefined;
3803
+ } | {
3804
+ toolCallId: string;
3805
+ version: "v2";
3806
+ timestamp: number;
3807
+ actionId: string;
3808
+ state: "expired" | "pending_user" | "pending_chain" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3809
+ signatureRequestGroupId: string;
3810
+ runId: string;
3811
+ turnId: string;
3812
+ sequence: number;
3813
+ targetId: string;
3814
+ durable: true;
3815
+ eventType: "signature-state";
3816
+ description?: string | undefined;
3817
+ label?: string | undefined;
3818
+ } | {
3819
+ version: "v2";
3820
+ timestamp: number;
3821
+ runId: string;
3822
+ turnId: string;
3823
+ summary: string;
3824
+ sequence: number;
3825
+ targetId: string;
3826
+ durable: true;
3827
+ eventType: "turn-summary";
3828
+ } | {
3829
+ version: "v2";
3830
+ timestamp: number;
3831
+ runId: string;
3832
+ turnId: string;
3833
+ sequence: number;
3834
+ targetId: string;
3835
+ durable: true;
3836
+ eventType: "turn-complete";
3837
+ snapshot: {
3838
+ metadata: Record<string, unknown>;
3839
+ version: "v2";
3840
+ runId: string;
3841
+ turnId: string;
3842
+ turnKind: "initial-response" | "action-preparation" | "pending-approval" | "tool-continuation" | "completion-summary" | "clarification";
3843
+ visibleParts: ({
3844
+ text: string;
3845
+ type: "text";
3846
+ id: string;
3847
+ } | {
3848
+ type: "pending-approval-card";
3849
+ toolCallId: string;
3850
+ id: string;
3851
+ actionId: string;
3852
+ state: "pending_user" | "pending_chain";
3853
+ signatureRequestGroupId: string;
3854
+ description?: string | undefined;
3855
+ label?: string | undefined;
3856
+ } | {
3857
+ type: "tool-state-card";
3858
+ toolCallId: string;
3859
+ id: string;
3860
+ actionId: string;
3861
+ state: "pending_user" | "pending_chain";
3862
+ signatureRequestGroupId: string;
3863
+ description?: string | undefined;
3864
+ label?: string | undefined;
3865
+ } | {
3866
+ type: "tool-state-card";
3867
+ toolCallId: string;
3868
+ id: string;
3869
+ actionId: string;
3870
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3871
+ description?: string | undefined;
3872
+ simulationId?: string | undefined;
3873
+ signatureRequestGroupId?: string | undefined;
3874
+ label?: string | undefined;
3875
+ })[];
3876
+ toolStates: ({
3877
+ toolCallId: string;
3878
+ actionId: string;
3879
+ state: "pending_user" | "pending_chain";
3880
+ signatureRequestGroupId: string;
3881
+ description?: string | undefined;
3882
+ simulationId?: string | undefined;
3883
+ label?: string | undefined;
3884
+ } | {
3885
+ toolCallId: string;
3886
+ actionId: string;
3887
+ state: "expired" | "success_submitted" | "success_confirmed" | "cancelled_by_user" | "failed_tool" | "failed_wallet" | "superseded";
3888
+ description?: string | undefined;
3889
+ simulationId?: string | undefined;
3890
+ signatureRequestGroupId?: string | undefined;
3891
+ label?: string | undefined;
3892
+ })[];
3893
+ summary?: string | undefined;
3894
+ };
3895
+ } | {
3896
+ version: "v2";
3897
+ timestamp: number;
3898
+ runId: string;
3899
+ turnId: string;
3900
+ sequence: number;
3901
+ targetId: string;
3902
+ durable: true;
3903
+ eventType: "run-complete";
3904
+ summary?: string | undefined;
3905
+ completedTurnIds?: string[] | undefined;
3906
+ } | {
3907
+ error: string;
3908
+ version: "v2";
3909
+ timestamp: number;
3910
+ runId: string;
3911
+ turnId: string;
3912
+ sequence: number;
3913
+ targetId: string;
3914
+ durable: false;
3915
+ eventType: "error-state";
3916
+ code?: string | undefined;
3917
+ };
3918
+ }>;
3919
+ export declare function isChatStreamDataPart(value: unknown): value is z.infer<typeof chatStreamDataPartSchema>;
3920
+ //# sourceMappingURL=chatStreamContract.d.ts.map