@kmmao/happy-wire 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -11,9 +11,9 @@ declare const MessageMetaSchema: z.ZodObject<{
11
11
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
12
12
  displayText: z.ZodOptional<z.ZodString>;
13
13
  }, "strip", z.ZodTypeAny, {
14
+ model?: string | null | undefined;
14
15
  sentFrom?: string | undefined;
15
16
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
16
- model?: string | null | undefined;
17
17
  fallbackModel?: string | null | undefined;
18
18
  customSystemPrompt?: string | null | undefined;
19
19
  appendSystemPrompt?: string | null | undefined;
@@ -21,9 +21,9 @@ declare const MessageMetaSchema: z.ZodObject<{
21
21
  disallowedTools?: string[] | null | undefined;
22
22
  displayText?: string | undefined;
23
23
  }, {
24
+ model?: string | null | undefined;
24
25
  sentFrom?: string | undefined;
25
26
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
26
- model?: string | null | undefined;
27
27
  fallbackModel?: string | null | undefined;
28
28
  customSystemPrompt?: string | null | undefined;
29
29
  appendSystemPrompt?: string | null | undefined;
@@ -61,22 +61,22 @@ declare const SessionMessageSchema: z.ZodObject<{
61
61
  createdAt: z.ZodNumber;
62
62
  updatedAt: z.ZodNumber;
63
63
  }, "strip", z.ZodTypeAny, {
64
+ id: string;
65
+ seq: number;
64
66
  content: {
65
67
  c: string;
66
68
  t: "encrypted";
67
69
  };
68
- id: string;
69
- seq: number;
70
70
  createdAt: number;
71
71
  updatedAt: number;
72
72
  localId?: string | null | undefined;
73
73
  }, {
74
+ id: string;
75
+ seq: number;
74
76
  content: {
75
77
  c: string;
76
78
  t: "encrypted";
77
79
  };
78
- id: string;
79
- seq: number;
80
80
  createdAt: number;
81
81
  updatedAt: number;
82
82
  localId?: string | null | undefined;
@@ -96,22 +96,22 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
96
96
  text: z.ZodString;
97
97
  thinking: z.ZodOptional<z.ZodBoolean>;
98
98
  }, "strip", z.ZodTypeAny, {
99
- text: string;
100
99
  t: "text";
100
+ text: string;
101
101
  thinking?: boolean | undefined;
102
102
  }, {
103
- text: string;
104
103
  t: "text";
104
+ text: string;
105
105
  thinking?: boolean | undefined;
106
106
  }>, z.ZodObject<{
107
107
  t: z.ZodLiteral<"service">;
108
108
  text: z.ZodString;
109
109
  }, "strip", z.ZodTypeAny, {
110
- text: string;
111
110
  t: "service";
112
- }, {
113
111
  text: string;
112
+ }, {
114
113
  t: "service";
114
+ text: string;
115
115
  }>, z.ZodObject<{
116
116
  t: z.ZodLiteral<"tool-call-start">;
117
117
  call: z.ZodString;
@@ -217,8 +217,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
217
217
  }>>;
218
218
  durationMs: z.ZodOptional<z.ZodNumber>;
219
219
  }, "strip", z.ZodTypeAny, {
220
- status: "completed" | "failed" | "cancelled";
221
220
  t: "turn-end";
221
+ status: "completed" | "failed" | "cancelled";
222
222
  model?: string | undefined;
223
223
  usage?: {
224
224
  input_tokens: number;
@@ -228,8 +228,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
228
228
  } | undefined;
229
229
  durationMs?: number | undefined;
230
230
  }, {
231
- status: "completed" | "failed" | "cancelled";
232
231
  t: "turn-end";
232
+ status: "completed" | "failed" | "cancelled";
233
233
  model?: string | undefined;
234
234
  usage?: {
235
235
  input_tokens: number;
@@ -263,6 +263,7 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
263
263
  cache_creation_input_tokens?: number | undefined;
264
264
  cache_read_input_tokens?: number | undefined;
265
265
  }>;
266
+ durationMs: z.ZodOptional<z.ZodNumber>;
266
267
  }, "strip", z.ZodTypeAny, {
267
268
  t: "usage-update";
268
269
  usage: {
@@ -272,6 +273,7 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
272
273
  cache_read_input_tokens?: number | undefined;
273
274
  };
274
275
  model?: string | undefined;
276
+ durationMs?: number | undefined;
275
277
  }, {
276
278
  t: "usage-update";
277
279
  usage: {
@@ -281,18 +283,131 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
281
283
  cache_read_input_tokens?: number | undefined;
282
284
  };
283
285
  model?: string | undefined;
286
+ durationMs?: number | undefined;
287
+ }>, z.ZodObject<{
288
+ t: z.ZodLiteral<"task-start">;
289
+ taskId: z.ZodString;
290
+ toolUseId: z.ZodOptional<z.ZodString>;
291
+ description: z.ZodString;
292
+ taskType: z.ZodOptional<z.ZodString>;
293
+ }, "strip", z.ZodTypeAny, {
294
+ t: "task-start";
295
+ description: string;
296
+ taskId: string;
297
+ toolUseId?: string | undefined;
298
+ taskType?: string | undefined;
299
+ }, {
300
+ t: "task-start";
301
+ description: string;
302
+ taskId: string;
303
+ toolUseId?: string | undefined;
304
+ taskType?: string | undefined;
305
+ }>, z.ZodObject<{
306
+ t: z.ZodLiteral<"task-progress">;
307
+ taskId: z.ZodString;
308
+ description: z.ZodString;
309
+ usage: z.ZodObject<{
310
+ totalTokens: z.ZodNumber;
311
+ toolUses: z.ZodNumber;
312
+ durationMs: z.ZodNumber;
313
+ }, "strip", z.ZodTypeAny, {
314
+ durationMs: number;
315
+ totalTokens: number;
316
+ toolUses: number;
317
+ }, {
318
+ durationMs: number;
319
+ totalTokens: number;
320
+ toolUses: number;
321
+ }>;
322
+ lastToolName: z.ZodOptional<z.ZodString>;
323
+ }, "strip", z.ZodTypeAny, {
324
+ t: "task-progress";
325
+ description: string;
326
+ usage: {
327
+ durationMs: number;
328
+ totalTokens: number;
329
+ toolUses: number;
330
+ };
331
+ taskId: string;
332
+ lastToolName?: string | undefined;
333
+ }, {
334
+ t: "task-progress";
335
+ description: string;
336
+ usage: {
337
+ durationMs: number;
338
+ totalTokens: number;
339
+ toolUses: number;
340
+ };
341
+ taskId: string;
342
+ lastToolName?: string | undefined;
343
+ }>, z.ZodObject<{
344
+ t: z.ZodLiteral<"task-end">;
345
+ taskId: z.ZodString;
346
+ status: z.ZodEnum<["completed", "failed", "stopped"]>;
347
+ summary: z.ZodString;
348
+ usage: z.ZodOptional<z.ZodObject<{
349
+ totalTokens: z.ZodNumber;
350
+ toolUses: z.ZodNumber;
351
+ durationMs: z.ZodNumber;
352
+ }, "strip", z.ZodTypeAny, {
353
+ durationMs: number;
354
+ totalTokens: number;
355
+ toolUses: number;
356
+ }, {
357
+ durationMs: number;
358
+ totalTokens: number;
359
+ toolUses: number;
360
+ }>>;
361
+ }, "strip", z.ZodTypeAny, {
362
+ t: "task-end";
363
+ status: "completed" | "failed" | "stopped";
364
+ taskId: string;
365
+ summary: string;
366
+ usage?: {
367
+ durationMs: number;
368
+ totalTokens: number;
369
+ toolUses: number;
370
+ } | undefined;
371
+ }, {
372
+ t: "task-end";
373
+ status: "completed" | "failed" | "stopped";
374
+ taskId: string;
375
+ summary: string;
376
+ usage?: {
377
+ durationMs: number;
378
+ totalTokens: number;
379
+ toolUses: number;
380
+ } | undefined;
381
+ }>, z.ZodObject<{
382
+ t: z.ZodLiteral<"tool-progress">;
383
+ toolUseId: z.ZodString;
384
+ toolName: z.ZodString;
385
+ elapsedSeconds: z.ZodNumber;
386
+ taskId: z.ZodOptional<z.ZodString>;
387
+ }, "strip", z.ZodTypeAny, {
388
+ t: "tool-progress";
389
+ toolUseId: string;
390
+ toolName: string;
391
+ elapsedSeconds: number;
392
+ taskId?: string | undefined;
393
+ }, {
394
+ t: "tool-progress";
395
+ toolUseId: string;
396
+ toolName: string;
397
+ elapsedSeconds: number;
398
+ taskId?: string | undefined;
284
399
  }>]>;
285
400
  }, "strip", z.ZodTypeAny, {
286
- role: "user" | "agent";
287
401
  id: string;
402
+ role: "user" | "agent";
288
403
  time: number;
289
404
  ev: {
290
- text: string;
291
405
  t: "text";
406
+ text: string;
292
407
  thinking?: boolean | undefined;
293
408
  } | {
294
- text: string;
295
409
  t: "service";
410
+ text: string;
296
411
  } | {
297
412
  t: "tool-call-start";
298
413
  call: string;
@@ -319,8 +434,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
319
434
  t: "start";
320
435
  title?: string | undefined;
321
436
  } | {
322
- status: "completed" | "failed" | "cancelled";
323
437
  t: "turn-end";
438
+ status: "completed" | "failed" | "cancelled";
324
439
  model?: string | undefined;
325
440
  usage?: {
326
441
  input_tokens: number;
@@ -340,20 +455,53 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
340
455
  cache_read_input_tokens?: number | undefined;
341
456
  };
342
457
  model?: string | undefined;
458
+ durationMs?: number | undefined;
459
+ } | {
460
+ t: "task-start";
461
+ description: string;
462
+ taskId: string;
463
+ toolUseId?: string | undefined;
464
+ taskType?: string | undefined;
465
+ } | {
466
+ t: "task-progress";
467
+ description: string;
468
+ usage: {
469
+ durationMs: number;
470
+ totalTokens: number;
471
+ toolUses: number;
472
+ };
473
+ taskId: string;
474
+ lastToolName?: string | undefined;
475
+ } | {
476
+ t: "task-end";
477
+ status: "completed" | "failed" | "stopped";
478
+ taskId: string;
479
+ summary: string;
480
+ usage?: {
481
+ durationMs: number;
482
+ totalTokens: number;
483
+ toolUses: number;
484
+ } | undefined;
485
+ } | {
486
+ t: "tool-progress";
487
+ toolUseId: string;
488
+ toolName: string;
489
+ elapsedSeconds: number;
490
+ taskId?: string | undefined;
343
491
  };
344
492
  turn?: string | undefined;
345
493
  subagent?: string | undefined;
346
494
  }, {
347
- role: "user" | "agent";
348
495
  id: string;
496
+ role: "user" | "agent";
349
497
  time: number;
350
498
  ev: {
351
- text: string;
352
499
  t: "text";
500
+ text: string;
353
501
  thinking?: boolean | undefined;
354
502
  } | {
355
- text: string;
356
503
  t: "service";
504
+ text: string;
357
505
  } | {
358
506
  t: "tool-call-start";
359
507
  call: string;
@@ -380,8 +528,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
380
528
  t: "start";
381
529
  title?: string | undefined;
382
530
  } | {
383
- status: "completed" | "failed" | "cancelled";
384
531
  t: "turn-end";
532
+ status: "completed" | "failed" | "cancelled";
385
533
  model?: string | undefined;
386
534
  usage?: {
387
535
  input_tokens: number;
@@ -401,20 +549,53 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
401
549
  cache_read_input_tokens?: number | undefined;
402
550
  };
403
551
  model?: string | undefined;
552
+ durationMs?: number | undefined;
553
+ } | {
554
+ t: "task-start";
555
+ description: string;
556
+ taskId: string;
557
+ toolUseId?: string | undefined;
558
+ taskType?: string | undefined;
559
+ } | {
560
+ t: "task-progress";
561
+ description: string;
562
+ usage: {
563
+ durationMs: number;
564
+ totalTokens: number;
565
+ toolUses: number;
566
+ };
567
+ taskId: string;
568
+ lastToolName?: string | undefined;
569
+ } | {
570
+ t: "task-end";
571
+ status: "completed" | "failed" | "stopped";
572
+ taskId: string;
573
+ summary: string;
574
+ usage?: {
575
+ durationMs: number;
576
+ totalTokens: number;
577
+ toolUses: number;
578
+ } | undefined;
579
+ } | {
580
+ t: "tool-progress";
581
+ toolUseId: string;
582
+ toolName: string;
583
+ elapsedSeconds: number;
584
+ taskId?: string | undefined;
404
585
  };
405
586
  turn?: string | undefined;
406
587
  subagent?: string | undefined;
407
588
  }>, {
408
- role: "user" | "agent";
409
589
  id: string;
590
+ role: "user" | "agent";
410
591
  time: number;
411
592
  ev: {
412
- text: string;
413
593
  t: "text";
594
+ text: string;
414
595
  thinking?: boolean | undefined;
415
596
  } | {
416
- text: string;
417
597
  t: "service";
598
+ text: string;
418
599
  } | {
419
600
  t: "tool-call-start";
420
601
  call: string;
@@ -441,8 +622,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
441
622
  t: "start";
442
623
  title?: string | undefined;
443
624
  } | {
444
- status: "completed" | "failed" | "cancelled";
445
625
  t: "turn-end";
626
+ status: "completed" | "failed" | "cancelled";
446
627
  model?: string | undefined;
447
628
  usage?: {
448
629
  input_tokens: number;
@@ -462,20 +643,53 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
462
643
  cache_read_input_tokens?: number | undefined;
463
644
  };
464
645
  model?: string | undefined;
646
+ durationMs?: number | undefined;
647
+ } | {
648
+ t: "task-start";
649
+ description: string;
650
+ taskId: string;
651
+ toolUseId?: string | undefined;
652
+ taskType?: string | undefined;
653
+ } | {
654
+ t: "task-progress";
655
+ description: string;
656
+ usage: {
657
+ durationMs: number;
658
+ totalTokens: number;
659
+ toolUses: number;
660
+ };
661
+ taskId: string;
662
+ lastToolName?: string | undefined;
663
+ } | {
664
+ t: "task-end";
665
+ status: "completed" | "failed" | "stopped";
666
+ taskId: string;
667
+ summary: string;
668
+ usage?: {
669
+ durationMs: number;
670
+ totalTokens: number;
671
+ toolUses: number;
672
+ } | undefined;
673
+ } | {
674
+ t: "tool-progress";
675
+ toolUseId: string;
676
+ toolName: string;
677
+ elapsedSeconds: number;
678
+ taskId?: string | undefined;
465
679
  };
466
680
  turn?: string | undefined;
467
681
  subagent?: string | undefined;
468
682
  }, {
469
- role: "user" | "agent";
470
683
  id: string;
684
+ role: "user" | "agent";
471
685
  time: number;
472
686
  ev: {
473
- text: string;
474
687
  t: "text";
688
+ text: string;
475
689
  thinking?: boolean | undefined;
476
690
  } | {
477
- text: string;
478
691
  t: "service";
692
+ text: string;
479
693
  } | {
480
694
  t: "tool-call-start";
481
695
  call: string;
@@ -502,8 +716,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
502
716
  t: "start";
503
717
  title?: string | undefined;
504
718
  } | {
505
- status: "completed" | "failed" | "cancelled";
506
719
  t: "turn-end";
720
+ status: "completed" | "failed" | "cancelled";
507
721
  model?: string | undefined;
508
722
  usage?: {
509
723
  input_tokens: number;
@@ -523,6 +737,39 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
523
737
  cache_read_input_tokens?: number | undefined;
524
738
  };
525
739
  model?: string | undefined;
740
+ durationMs?: number | undefined;
741
+ } | {
742
+ t: "task-start";
743
+ description: string;
744
+ taskId: string;
745
+ toolUseId?: string | undefined;
746
+ taskType?: string | undefined;
747
+ } | {
748
+ t: "task-progress";
749
+ description: string;
750
+ usage: {
751
+ durationMs: number;
752
+ totalTokens: number;
753
+ toolUses: number;
754
+ };
755
+ taskId: string;
756
+ lastToolName?: string | undefined;
757
+ } | {
758
+ t: "task-end";
759
+ status: "completed" | "failed" | "stopped";
760
+ taskId: string;
761
+ summary: string;
762
+ usage?: {
763
+ durationMs: number;
764
+ totalTokens: number;
765
+ toolUses: number;
766
+ } | undefined;
767
+ } | {
768
+ t: "tool-progress";
769
+ toolUseId: string;
770
+ toolName: string;
771
+ elapsedSeconds: number;
772
+ taskId?: string | undefined;
526
773
  };
527
774
  turn?: string | undefined;
528
775
  subagent?: string | undefined;
@@ -538,9 +785,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
538
785
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
539
786
  displayText: z.ZodOptional<z.ZodString>;
540
787
  }, "strip", z.ZodTypeAny, {
788
+ model?: string | null | undefined;
541
789
  sentFrom?: string | undefined;
542
790
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
543
- model?: string | null | undefined;
544
791
  fallbackModel?: string | null | undefined;
545
792
  customSystemPrompt?: string | null | undefined;
546
793
  appendSystemPrompt?: string | null | undefined;
@@ -548,9 +795,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
548
795
  disallowedTools?: string[] | null | undefined;
549
796
  displayText?: string | undefined;
550
797
  }, {
798
+ model?: string | null | undefined;
551
799
  sentFrom?: string | undefined;
552
800
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
553
- model?: string | null | undefined;
554
801
  fallbackModel?: string | null | undefined;
555
802
  customSystemPrompt?: string | null | undefined;
556
803
  appendSystemPrompt?: string | null | undefined;
@@ -559,18 +806,17 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
559
806
  displayText?: string | undefined;
560
807
  }>>;
561
808
  }, "strip", z.ZodTypeAny, {
562
- role: "session";
563
809
  content: {
564
- role: "user" | "agent";
565
810
  id: string;
811
+ role: "user" | "agent";
566
812
  time: number;
567
813
  ev: {
568
- text: string;
569
814
  t: "text";
815
+ text: string;
570
816
  thinking?: boolean | undefined;
571
817
  } | {
572
- text: string;
573
818
  t: "service";
819
+ text: string;
574
820
  } | {
575
821
  t: "tool-call-start";
576
822
  call: string;
@@ -597,8 +843,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
597
843
  t: "start";
598
844
  title?: string | undefined;
599
845
  } | {
600
- status: "completed" | "failed" | "cancelled";
601
846
  t: "turn-end";
847
+ status: "completed" | "failed" | "cancelled";
602
848
  model?: string | undefined;
603
849
  usage?: {
604
850
  input_tokens: number;
@@ -618,14 +864,48 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
618
864
  cache_read_input_tokens?: number | undefined;
619
865
  };
620
866
  model?: string | undefined;
867
+ durationMs?: number | undefined;
868
+ } | {
869
+ t: "task-start";
870
+ description: string;
871
+ taskId: string;
872
+ toolUseId?: string | undefined;
873
+ taskType?: string | undefined;
874
+ } | {
875
+ t: "task-progress";
876
+ description: string;
877
+ usage: {
878
+ durationMs: number;
879
+ totalTokens: number;
880
+ toolUses: number;
881
+ };
882
+ taskId: string;
883
+ lastToolName?: string | undefined;
884
+ } | {
885
+ t: "task-end";
886
+ status: "completed" | "failed" | "stopped";
887
+ taskId: string;
888
+ summary: string;
889
+ usage?: {
890
+ durationMs: number;
891
+ totalTokens: number;
892
+ toolUses: number;
893
+ } | undefined;
894
+ } | {
895
+ t: "tool-progress";
896
+ toolUseId: string;
897
+ toolName: string;
898
+ elapsedSeconds: number;
899
+ taskId?: string | undefined;
621
900
  };
622
901
  turn?: string | undefined;
623
902
  subagent?: string | undefined;
624
903
  };
904
+ role: "session";
625
905
  meta?: {
906
+ model?: string | null | undefined;
626
907
  sentFrom?: string | undefined;
627
908
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
628
- model?: string | null | undefined;
629
909
  fallbackModel?: string | null | undefined;
630
910
  customSystemPrompt?: string | null | undefined;
631
911
  appendSystemPrompt?: string | null | undefined;
@@ -634,18 +914,17 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
634
914
  displayText?: string | undefined;
635
915
  } | undefined;
636
916
  }, {
637
- role: "session";
638
917
  content: {
639
- role: "user" | "agent";
640
918
  id: string;
919
+ role: "user" | "agent";
641
920
  time: number;
642
921
  ev: {
643
- text: string;
644
922
  t: "text";
923
+ text: string;
645
924
  thinking?: boolean | undefined;
646
925
  } | {
647
- text: string;
648
926
  t: "service";
927
+ text: string;
649
928
  } | {
650
929
  t: "tool-call-start";
651
930
  call: string;
@@ -672,8 +951,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
672
951
  t: "start";
673
952
  title?: string | undefined;
674
953
  } | {
675
- status: "completed" | "failed" | "cancelled";
676
954
  t: "turn-end";
955
+ status: "completed" | "failed" | "cancelled";
677
956
  model?: string | undefined;
678
957
  usage?: {
679
958
  input_tokens: number;
@@ -693,14 +972,48 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
693
972
  cache_read_input_tokens?: number | undefined;
694
973
  };
695
974
  model?: string | undefined;
975
+ durationMs?: number | undefined;
976
+ } | {
977
+ t: "task-start";
978
+ description: string;
979
+ taskId: string;
980
+ toolUseId?: string | undefined;
981
+ taskType?: string | undefined;
982
+ } | {
983
+ t: "task-progress";
984
+ description: string;
985
+ usage: {
986
+ durationMs: number;
987
+ totalTokens: number;
988
+ toolUses: number;
989
+ };
990
+ taskId: string;
991
+ lastToolName?: string | undefined;
992
+ } | {
993
+ t: "task-end";
994
+ status: "completed" | "failed" | "stopped";
995
+ taskId: string;
996
+ summary: string;
997
+ usage?: {
998
+ durationMs: number;
999
+ totalTokens: number;
1000
+ toolUses: number;
1001
+ } | undefined;
1002
+ } | {
1003
+ t: "tool-progress";
1004
+ toolUseId: string;
1005
+ toolName: string;
1006
+ elapsedSeconds: number;
1007
+ taskId?: string | undefined;
696
1008
  };
697
1009
  turn?: string | undefined;
698
1010
  subagent?: string | undefined;
699
1011
  };
1012
+ role: "session";
700
1013
  meta?: {
1014
+ model?: string | null | undefined;
701
1015
  sentFrom?: string | undefined;
702
1016
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
703
- model?: string | null | undefined;
704
1017
  fallbackModel?: string | null | undefined;
705
1018
  customSystemPrompt?: string | null | undefined;
706
1019
  appendSystemPrompt?: string | null | undefined;
@@ -734,9 +1047,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
734
1047
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
735
1048
  displayText: z.ZodOptional<z.ZodString>;
736
1049
  }, "strip", z.ZodTypeAny, {
1050
+ model?: string | null | undefined;
737
1051
  sentFrom?: string | undefined;
738
1052
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
739
- model?: string | null | undefined;
740
1053
  fallbackModel?: string | null | undefined;
741
1054
  customSystemPrompt?: string | null | undefined;
742
1055
  appendSystemPrompt?: string | null | undefined;
@@ -744,9 +1057,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
744
1057
  disallowedTools?: string[] | null | undefined;
745
1058
  displayText?: string | undefined;
746
1059
  }, {
1060
+ model?: string | null | undefined;
747
1061
  sentFrom?: string | undefined;
748
1062
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
749
- model?: string | null | undefined;
750
1063
  fallbackModel?: string | null | undefined;
751
1064
  customSystemPrompt?: string | null | undefined;
752
1065
  appendSystemPrompt?: string | null | undefined;
@@ -755,16 +1068,15 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
755
1068
  displayText?: string | undefined;
756
1069
  }>>;
757
1070
  }, "strip", z.ZodTypeAny, {
758
- role: "user";
759
1071
  content: {
760
1072
  type: "text";
761
1073
  text: string;
762
1074
  };
763
- localKey?: string | undefined;
1075
+ role: "user";
764
1076
  meta?: {
1077
+ model?: string | null | undefined;
765
1078
  sentFrom?: string | undefined;
766
1079
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
767
- model?: string | null | undefined;
768
1080
  fallbackModel?: string | null | undefined;
769
1081
  customSystemPrompt?: string | null | undefined;
770
1082
  appendSystemPrompt?: string | null | undefined;
@@ -772,17 +1084,17 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
772
1084
  disallowedTools?: string[] | null | undefined;
773
1085
  displayText?: string | undefined;
774
1086
  } | undefined;
1087
+ localKey?: string | undefined;
775
1088
  }, {
776
- role: "user";
777
1089
  content: {
778
1090
  type: "text";
779
1091
  text: string;
780
1092
  };
781
- localKey?: string | undefined;
1093
+ role: "user";
782
1094
  meta?: {
1095
+ model?: string | null | undefined;
783
1096
  sentFrom?: string | undefined;
784
1097
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
785
- model?: string | null | undefined;
786
1098
  fallbackModel?: string | null | undefined;
787
1099
  customSystemPrompt?: string | null | undefined;
788
1100
  appendSystemPrompt?: string | null | undefined;
@@ -790,6 +1102,7 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
790
1102
  disallowedTools?: string[] | null | undefined;
791
1103
  displayText?: string | undefined;
792
1104
  } | undefined;
1105
+ localKey?: string | undefined;
793
1106
  }>, z.ZodObject<{
794
1107
  role: z.ZodLiteral<"agent">;
795
1108
  content: z.ZodObject<{
@@ -810,9 +1123,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
810
1123
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
811
1124
  displayText: z.ZodOptional<z.ZodString>;
812
1125
  }, "strip", z.ZodTypeAny, {
1126
+ model?: string | null | undefined;
813
1127
  sentFrom?: string | undefined;
814
1128
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
815
- model?: string | null | undefined;
816
1129
  fallbackModel?: string | null | undefined;
817
1130
  customSystemPrompt?: string | null | undefined;
818
1131
  appendSystemPrompt?: string | null | undefined;
@@ -820,9 +1133,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
820
1133
  disallowedTools?: string[] | null | undefined;
821
1134
  displayText?: string | undefined;
822
1135
  }, {
1136
+ model?: string | null | undefined;
823
1137
  sentFrom?: string | undefined;
824
1138
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
825
- model?: string | null | undefined;
826
1139
  fallbackModel?: string | null | undefined;
827
1140
  customSystemPrompt?: string | null | undefined;
828
1141
  appendSystemPrompt?: string | null | undefined;
@@ -831,16 +1144,16 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
831
1144
  displayText?: string | undefined;
832
1145
  }>>;
833
1146
  }, "strip", z.ZodTypeAny, {
834
- role: "agent";
835
1147
  content: {
836
1148
  type: string;
837
1149
  } & {
838
1150
  [k: string]: unknown;
839
1151
  };
1152
+ role: "agent";
840
1153
  meta?: {
1154
+ model?: string | null | undefined;
841
1155
  sentFrom?: string | undefined;
842
1156
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
843
- model?: string | null | undefined;
844
1157
  fallbackModel?: string | null | undefined;
845
1158
  customSystemPrompt?: string | null | undefined;
846
1159
  appendSystemPrompt?: string | null | undefined;
@@ -849,16 +1162,16 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
849
1162
  displayText?: string | undefined;
850
1163
  } | undefined;
851
1164
  }, {
852
- role: "agent";
853
1165
  content: {
854
1166
  type: string;
855
1167
  } & {
856
1168
  [k: string]: unknown;
857
1169
  };
1170
+ role: "agent";
858
1171
  meta?: {
1172
+ model?: string | null | undefined;
859
1173
  sentFrom?: string | undefined;
860
1174
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
861
- model?: string | null | undefined;
862
1175
  fallbackModel?: string | null | undefined;
863
1176
  customSystemPrompt?: string | null | undefined;
864
1177
  appendSystemPrompt?: string | null | undefined;
@@ -879,22 +1192,22 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
879
1192
  text: z.ZodString;
880
1193
  thinking: z.ZodOptional<z.ZodBoolean>;
881
1194
  }, "strip", z.ZodTypeAny, {
882
- text: string;
883
1195
  t: "text";
1196
+ text: string;
884
1197
  thinking?: boolean | undefined;
885
1198
  }, {
886
- text: string;
887
1199
  t: "text";
1200
+ text: string;
888
1201
  thinking?: boolean | undefined;
889
1202
  }>, z.ZodObject<{
890
1203
  t: z.ZodLiteral<"service">;
891
1204
  text: z.ZodString;
892
1205
  }, "strip", z.ZodTypeAny, {
893
- text: string;
894
1206
  t: "service";
895
- }, {
896
1207
  text: string;
1208
+ }, {
897
1209
  t: "service";
1210
+ text: string;
898
1211
  }>, z.ZodObject<{
899
1212
  t: z.ZodLiteral<"tool-call-start">;
900
1213
  call: z.ZodString;
@@ -1000,8 +1313,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1000
1313
  }>>;
1001
1314
  durationMs: z.ZodOptional<z.ZodNumber>;
1002
1315
  }, "strip", z.ZodTypeAny, {
1003
- status: "completed" | "failed" | "cancelled";
1004
1316
  t: "turn-end";
1317
+ status: "completed" | "failed" | "cancelled";
1005
1318
  model?: string | undefined;
1006
1319
  usage?: {
1007
1320
  input_tokens: number;
@@ -1011,8 +1324,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1011
1324
  } | undefined;
1012
1325
  durationMs?: number | undefined;
1013
1326
  }, {
1014
- status: "completed" | "failed" | "cancelled";
1015
1327
  t: "turn-end";
1328
+ status: "completed" | "failed" | "cancelled";
1016
1329
  model?: string | undefined;
1017
1330
  usage?: {
1018
1331
  input_tokens: number;
@@ -1046,6 +1359,7 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1046
1359
  cache_creation_input_tokens?: number | undefined;
1047
1360
  cache_read_input_tokens?: number | undefined;
1048
1361
  }>;
1362
+ durationMs: z.ZodOptional<z.ZodNumber>;
1049
1363
  }, "strip", z.ZodTypeAny, {
1050
1364
  t: "usage-update";
1051
1365
  usage: {
@@ -1055,6 +1369,7 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1055
1369
  cache_read_input_tokens?: number | undefined;
1056
1370
  };
1057
1371
  model?: string | undefined;
1372
+ durationMs?: number | undefined;
1058
1373
  }, {
1059
1374
  t: "usage-update";
1060
1375
  usage: {
@@ -1064,30 +1379,143 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1064
1379
  cache_read_input_tokens?: number | undefined;
1065
1380
  };
1066
1381
  model?: string | undefined;
1067
- }>]>;
1068
- }, "strip", z.ZodTypeAny, {
1069
- role: "user" | "agent";
1070
- id: string;
1071
- time: number;
1072
- ev: {
1073
- text: string;
1074
- t: "text";
1075
- thinking?: boolean | undefined;
1076
- } | {
1077
- text: string;
1078
- t: "service";
1079
- } | {
1080
- t: "tool-call-start";
1081
- call: string;
1082
- name: string;
1083
- title: string;
1382
+ durationMs?: number | undefined;
1383
+ }>, z.ZodObject<{
1384
+ t: z.ZodLiteral<"task-start">;
1385
+ taskId: z.ZodString;
1386
+ toolUseId: z.ZodOptional<z.ZodString>;
1387
+ description: z.ZodString;
1388
+ taskType: z.ZodOptional<z.ZodString>;
1389
+ }, "strip", z.ZodTypeAny, {
1390
+ t: "task-start";
1084
1391
  description: string;
1085
- args: Record<string, unknown>;
1086
- } | {
1087
- t: "tool-call-end";
1088
- call: string;
1089
- } | {
1090
- t: "file";
1392
+ taskId: string;
1393
+ toolUseId?: string | undefined;
1394
+ taskType?: string | undefined;
1395
+ }, {
1396
+ t: "task-start";
1397
+ description: string;
1398
+ taskId: string;
1399
+ toolUseId?: string | undefined;
1400
+ taskType?: string | undefined;
1401
+ }>, z.ZodObject<{
1402
+ t: z.ZodLiteral<"task-progress">;
1403
+ taskId: z.ZodString;
1404
+ description: z.ZodString;
1405
+ usage: z.ZodObject<{
1406
+ totalTokens: z.ZodNumber;
1407
+ toolUses: z.ZodNumber;
1408
+ durationMs: z.ZodNumber;
1409
+ }, "strip", z.ZodTypeAny, {
1410
+ durationMs: number;
1411
+ totalTokens: number;
1412
+ toolUses: number;
1413
+ }, {
1414
+ durationMs: number;
1415
+ totalTokens: number;
1416
+ toolUses: number;
1417
+ }>;
1418
+ lastToolName: z.ZodOptional<z.ZodString>;
1419
+ }, "strip", z.ZodTypeAny, {
1420
+ t: "task-progress";
1421
+ description: string;
1422
+ usage: {
1423
+ durationMs: number;
1424
+ totalTokens: number;
1425
+ toolUses: number;
1426
+ };
1427
+ taskId: string;
1428
+ lastToolName?: string | undefined;
1429
+ }, {
1430
+ t: "task-progress";
1431
+ description: string;
1432
+ usage: {
1433
+ durationMs: number;
1434
+ totalTokens: number;
1435
+ toolUses: number;
1436
+ };
1437
+ taskId: string;
1438
+ lastToolName?: string | undefined;
1439
+ }>, z.ZodObject<{
1440
+ t: z.ZodLiteral<"task-end">;
1441
+ taskId: z.ZodString;
1442
+ status: z.ZodEnum<["completed", "failed", "stopped"]>;
1443
+ summary: z.ZodString;
1444
+ usage: z.ZodOptional<z.ZodObject<{
1445
+ totalTokens: z.ZodNumber;
1446
+ toolUses: z.ZodNumber;
1447
+ durationMs: z.ZodNumber;
1448
+ }, "strip", z.ZodTypeAny, {
1449
+ durationMs: number;
1450
+ totalTokens: number;
1451
+ toolUses: number;
1452
+ }, {
1453
+ durationMs: number;
1454
+ totalTokens: number;
1455
+ toolUses: number;
1456
+ }>>;
1457
+ }, "strip", z.ZodTypeAny, {
1458
+ t: "task-end";
1459
+ status: "completed" | "failed" | "stopped";
1460
+ taskId: string;
1461
+ summary: string;
1462
+ usage?: {
1463
+ durationMs: number;
1464
+ totalTokens: number;
1465
+ toolUses: number;
1466
+ } | undefined;
1467
+ }, {
1468
+ t: "task-end";
1469
+ status: "completed" | "failed" | "stopped";
1470
+ taskId: string;
1471
+ summary: string;
1472
+ usage?: {
1473
+ durationMs: number;
1474
+ totalTokens: number;
1475
+ toolUses: number;
1476
+ } | undefined;
1477
+ }>, z.ZodObject<{
1478
+ t: z.ZodLiteral<"tool-progress">;
1479
+ toolUseId: z.ZodString;
1480
+ toolName: z.ZodString;
1481
+ elapsedSeconds: z.ZodNumber;
1482
+ taskId: z.ZodOptional<z.ZodString>;
1483
+ }, "strip", z.ZodTypeAny, {
1484
+ t: "tool-progress";
1485
+ toolUseId: string;
1486
+ toolName: string;
1487
+ elapsedSeconds: number;
1488
+ taskId?: string | undefined;
1489
+ }, {
1490
+ t: "tool-progress";
1491
+ toolUseId: string;
1492
+ toolName: string;
1493
+ elapsedSeconds: number;
1494
+ taskId?: string | undefined;
1495
+ }>]>;
1496
+ }, "strip", z.ZodTypeAny, {
1497
+ id: string;
1498
+ role: "user" | "agent";
1499
+ time: number;
1500
+ ev: {
1501
+ t: "text";
1502
+ text: string;
1503
+ thinking?: boolean | undefined;
1504
+ } | {
1505
+ t: "service";
1506
+ text: string;
1507
+ } | {
1508
+ t: "tool-call-start";
1509
+ call: string;
1510
+ name: string;
1511
+ title: string;
1512
+ description: string;
1513
+ args: Record<string, unknown>;
1514
+ } | {
1515
+ t: "tool-call-end";
1516
+ call: string;
1517
+ } | {
1518
+ t: "file";
1091
1519
  name: string;
1092
1520
  ref: string;
1093
1521
  size: number;
@@ -1102,8 +1530,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1102
1530
  t: "start";
1103
1531
  title?: string | undefined;
1104
1532
  } | {
1105
- status: "completed" | "failed" | "cancelled";
1106
1533
  t: "turn-end";
1534
+ status: "completed" | "failed" | "cancelled";
1107
1535
  model?: string | undefined;
1108
1536
  usage?: {
1109
1537
  input_tokens: number;
@@ -1123,20 +1551,53 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1123
1551
  cache_read_input_tokens?: number | undefined;
1124
1552
  };
1125
1553
  model?: string | undefined;
1554
+ durationMs?: number | undefined;
1555
+ } | {
1556
+ t: "task-start";
1557
+ description: string;
1558
+ taskId: string;
1559
+ toolUseId?: string | undefined;
1560
+ taskType?: string | undefined;
1561
+ } | {
1562
+ t: "task-progress";
1563
+ description: string;
1564
+ usage: {
1565
+ durationMs: number;
1566
+ totalTokens: number;
1567
+ toolUses: number;
1568
+ };
1569
+ taskId: string;
1570
+ lastToolName?: string | undefined;
1571
+ } | {
1572
+ t: "task-end";
1573
+ status: "completed" | "failed" | "stopped";
1574
+ taskId: string;
1575
+ summary: string;
1576
+ usage?: {
1577
+ durationMs: number;
1578
+ totalTokens: number;
1579
+ toolUses: number;
1580
+ } | undefined;
1581
+ } | {
1582
+ t: "tool-progress";
1583
+ toolUseId: string;
1584
+ toolName: string;
1585
+ elapsedSeconds: number;
1586
+ taskId?: string | undefined;
1126
1587
  };
1127
1588
  turn?: string | undefined;
1128
1589
  subagent?: string | undefined;
1129
1590
  }, {
1130
- role: "user" | "agent";
1131
1591
  id: string;
1592
+ role: "user" | "agent";
1132
1593
  time: number;
1133
1594
  ev: {
1134
- text: string;
1135
1595
  t: "text";
1596
+ text: string;
1136
1597
  thinking?: boolean | undefined;
1137
1598
  } | {
1138
- text: string;
1139
1599
  t: "service";
1600
+ text: string;
1140
1601
  } | {
1141
1602
  t: "tool-call-start";
1142
1603
  call: string;
@@ -1163,8 +1624,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1163
1624
  t: "start";
1164
1625
  title?: string | undefined;
1165
1626
  } | {
1166
- status: "completed" | "failed" | "cancelled";
1167
1627
  t: "turn-end";
1628
+ status: "completed" | "failed" | "cancelled";
1168
1629
  model?: string | undefined;
1169
1630
  usage?: {
1170
1631
  input_tokens: number;
@@ -1184,20 +1645,53 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1184
1645
  cache_read_input_tokens?: number | undefined;
1185
1646
  };
1186
1647
  model?: string | undefined;
1648
+ durationMs?: number | undefined;
1649
+ } | {
1650
+ t: "task-start";
1651
+ description: string;
1652
+ taskId: string;
1653
+ toolUseId?: string | undefined;
1654
+ taskType?: string | undefined;
1655
+ } | {
1656
+ t: "task-progress";
1657
+ description: string;
1658
+ usage: {
1659
+ durationMs: number;
1660
+ totalTokens: number;
1661
+ toolUses: number;
1662
+ };
1663
+ taskId: string;
1664
+ lastToolName?: string | undefined;
1665
+ } | {
1666
+ t: "task-end";
1667
+ status: "completed" | "failed" | "stopped";
1668
+ taskId: string;
1669
+ summary: string;
1670
+ usage?: {
1671
+ durationMs: number;
1672
+ totalTokens: number;
1673
+ toolUses: number;
1674
+ } | undefined;
1675
+ } | {
1676
+ t: "tool-progress";
1677
+ toolUseId: string;
1678
+ toolName: string;
1679
+ elapsedSeconds: number;
1680
+ taskId?: string | undefined;
1187
1681
  };
1188
1682
  turn?: string | undefined;
1189
1683
  subagent?: string | undefined;
1190
1684
  }>, {
1191
- role: "user" | "agent";
1192
1685
  id: string;
1686
+ role: "user" | "agent";
1193
1687
  time: number;
1194
1688
  ev: {
1195
- text: string;
1196
1689
  t: "text";
1690
+ text: string;
1197
1691
  thinking?: boolean | undefined;
1198
1692
  } | {
1199
- text: string;
1200
1693
  t: "service";
1694
+ text: string;
1201
1695
  } | {
1202
1696
  t: "tool-call-start";
1203
1697
  call: string;
@@ -1224,8 +1718,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1224
1718
  t: "start";
1225
1719
  title?: string | undefined;
1226
1720
  } | {
1227
- status: "completed" | "failed" | "cancelled";
1228
1721
  t: "turn-end";
1722
+ status: "completed" | "failed" | "cancelled";
1229
1723
  model?: string | undefined;
1230
1724
  usage?: {
1231
1725
  input_tokens: number;
@@ -1245,20 +1739,53 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1245
1739
  cache_read_input_tokens?: number | undefined;
1246
1740
  };
1247
1741
  model?: string | undefined;
1742
+ durationMs?: number | undefined;
1743
+ } | {
1744
+ t: "task-start";
1745
+ description: string;
1746
+ taskId: string;
1747
+ toolUseId?: string | undefined;
1748
+ taskType?: string | undefined;
1749
+ } | {
1750
+ t: "task-progress";
1751
+ description: string;
1752
+ usage: {
1753
+ durationMs: number;
1754
+ totalTokens: number;
1755
+ toolUses: number;
1756
+ };
1757
+ taskId: string;
1758
+ lastToolName?: string | undefined;
1759
+ } | {
1760
+ t: "task-end";
1761
+ status: "completed" | "failed" | "stopped";
1762
+ taskId: string;
1763
+ summary: string;
1764
+ usage?: {
1765
+ durationMs: number;
1766
+ totalTokens: number;
1767
+ toolUses: number;
1768
+ } | undefined;
1769
+ } | {
1770
+ t: "tool-progress";
1771
+ toolUseId: string;
1772
+ toolName: string;
1773
+ elapsedSeconds: number;
1774
+ taskId?: string | undefined;
1248
1775
  };
1249
1776
  turn?: string | undefined;
1250
1777
  subagent?: string | undefined;
1251
1778
  }, {
1252
- role: "user" | "agent";
1253
1779
  id: string;
1780
+ role: "user" | "agent";
1254
1781
  time: number;
1255
1782
  ev: {
1256
- text: string;
1257
1783
  t: "text";
1784
+ text: string;
1258
1785
  thinking?: boolean | undefined;
1259
1786
  } | {
1260
- text: string;
1261
1787
  t: "service";
1788
+ text: string;
1262
1789
  } | {
1263
1790
  t: "tool-call-start";
1264
1791
  call: string;
@@ -1285,8 +1812,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1285
1812
  t: "start";
1286
1813
  title?: string | undefined;
1287
1814
  } | {
1288
- status: "completed" | "failed" | "cancelled";
1289
1815
  t: "turn-end";
1816
+ status: "completed" | "failed" | "cancelled";
1290
1817
  model?: string | undefined;
1291
1818
  usage?: {
1292
1819
  input_tokens: number;
@@ -1306,6 +1833,39 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1306
1833
  cache_read_input_tokens?: number | undefined;
1307
1834
  };
1308
1835
  model?: string | undefined;
1836
+ durationMs?: number | undefined;
1837
+ } | {
1838
+ t: "task-start";
1839
+ description: string;
1840
+ taskId: string;
1841
+ toolUseId?: string | undefined;
1842
+ taskType?: string | undefined;
1843
+ } | {
1844
+ t: "task-progress";
1845
+ description: string;
1846
+ usage: {
1847
+ durationMs: number;
1848
+ totalTokens: number;
1849
+ toolUses: number;
1850
+ };
1851
+ taskId: string;
1852
+ lastToolName?: string | undefined;
1853
+ } | {
1854
+ t: "task-end";
1855
+ status: "completed" | "failed" | "stopped";
1856
+ taskId: string;
1857
+ summary: string;
1858
+ usage?: {
1859
+ durationMs: number;
1860
+ totalTokens: number;
1861
+ toolUses: number;
1862
+ } | undefined;
1863
+ } | {
1864
+ t: "tool-progress";
1865
+ toolUseId: string;
1866
+ toolName: string;
1867
+ elapsedSeconds: number;
1868
+ taskId?: string | undefined;
1309
1869
  };
1310
1870
  turn?: string | undefined;
1311
1871
  subagent?: string | undefined;
@@ -1321,9 +1881,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1321
1881
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1322
1882
  displayText: z.ZodOptional<z.ZodString>;
1323
1883
  }, "strip", z.ZodTypeAny, {
1884
+ model?: string | null | undefined;
1324
1885
  sentFrom?: string | undefined;
1325
1886
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
1326
- model?: string | null | undefined;
1327
1887
  fallbackModel?: string | null | undefined;
1328
1888
  customSystemPrompt?: string | null | undefined;
1329
1889
  appendSystemPrompt?: string | null | undefined;
@@ -1331,9 +1891,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1331
1891
  disallowedTools?: string[] | null | undefined;
1332
1892
  displayText?: string | undefined;
1333
1893
  }, {
1894
+ model?: string | null | undefined;
1334
1895
  sentFrom?: string | undefined;
1335
1896
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
1336
- model?: string | null | undefined;
1337
1897
  fallbackModel?: string | null | undefined;
1338
1898
  customSystemPrompt?: string | null | undefined;
1339
1899
  appendSystemPrompt?: string | null | undefined;
@@ -1342,18 +1902,17 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1342
1902
  displayText?: string | undefined;
1343
1903
  }>>;
1344
1904
  }, "strip", z.ZodTypeAny, {
1345
- role: "session";
1346
1905
  content: {
1347
- role: "user" | "agent";
1348
1906
  id: string;
1907
+ role: "user" | "agent";
1349
1908
  time: number;
1350
1909
  ev: {
1351
- text: string;
1352
1910
  t: "text";
1911
+ text: string;
1353
1912
  thinking?: boolean | undefined;
1354
1913
  } | {
1355
- text: string;
1356
1914
  t: "service";
1915
+ text: string;
1357
1916
  } | {
1358
1917
  t: "tool-call-start";
1359
1918
  call: string;
@@ -1380,8 +1939,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1380
1939
  t: "start";
1381
1940
  title?: string | undefined;
1382
1941
  } | {
1383
- status: "completed" | "failed" | "cancelled";
1384
1942
  t: "turn-end";
1943
+ status: "completed" | "failed" | "cancelled";
1385
1944
  model?: string | undefined;
1386
1945
  usage?: {
1387
1946
  input_tokens: number;
@@ -1401,14 +1960,48 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1401
1960
  cache_read_input_tokens?: number | undefined;
1402
1961
  };
1403
1962
  model?: string | undefined;
1963
+ durationMs?: number | undefined;
1964
+ } | {
1965
+ t: "task-start";
1966
+ description: string;
1967
+ taskId: string;
1968
+ toolUseId?: string | undefined;
1969
+ taskType?: string | undefined;
1970
+ } | {
1971
+ t: "task-progress";
1972
+ description: string;
1973
+ usage: {
1974
+ durationMs: number;
1975
+ totalTokens: number;
1976
+ toolUses: number;
1977
+ };
1978
+ taskId: string;
1979
+ lastToolName?: string | undefined;
1980
+ } | {
1981
+ t: "task-end";
1982
+ status: "completed" | "failed" | "stopped";
1983
+ taskId: string;
1984
+ summary: string;
1985
+ usage?: {
1986
+ durationMs: number;
1987
+ totalTokens: number;
1988
+ toolUses: number;
1989
+ } | undefined;
1990
+ } | {
1991
+ t: "tool-progress";
1992
+ toolUseId: string;
1993
+ toolName: string;
1994
+ elapsedSeconds: number;
1995
+ taskId?: string | undefined;
1404
1996
  };
1405
1997
  turn?: string | undefined;
1406
1998
  subagent?: string | undefined;
1407
1999
  };
2000
+ role: "session";
1408
2001
  meta?: {
2002
+ model?: string | null | undefined;
1409
2003
  sentFrom?: string | undefined;
1410
2004
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
1411
- model?: string | null | undefined;
1412
2005
  fallbackModel?: string | null | undefined;
1413
2006
  customSystemPrompt?: string | null | undefined;
1414
2007
  appendSystemPrompt?: string | null | undefined;
@@ -1417,18 +2010,17 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1417
2010
  displayText?: string | undefined;
1418
2011
  } | undefined;
1419
2012
  }, {
1420
- role: "session";
1421
2013
  content: {
1422
- role: "user" | "agent";
1423
2014
  id: string;
2015
+ role: "user" | "agent";
1424
2016
  time: number;
1425
2017
  ev: {
1426
- text: string;
1427
2018
  t: "text";
2019
+ text: string;
1428
2020
  thinking?: boolean | undefined;
1429
2021
  } | {
1430
- text: string;
1431
2022
  t: "service";
2023
+ text: string;
1432
2024
  } | {
1433
2025
  t: "tool-call-start";
1434
2026
  call: string;
@@ -1455,8 +2047,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1455
2047
  t: "start";
1456
2048
  title?: string | undefined;
1457
2049
  } | {
1458
- status: "completed" | "failed" | "cancelled";
1459
2050
  t: "turn-end";
2051
+ status: "completed" | "failed" | "cancelled";
1460
2052
  model?: string | undefined;
1461
2053
  usage?: {
1462
2054
  input_tokens: number;
@@ -1476,14 +2068,48 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1476
2068
  cache_read_input_tokens?: number | undefined;
1477
2069
  };
1478
2070
  model?: string | undefined;
2071
+ durationMs?: number | undefined;
2072
+ } | {
2073
+ t: "task-start";
2074
+ description: string;
2075
+ taskId: string;
2076
+ toolUseId?: string | undefined;
2077
+ taskType?: string | undefined;
2078
+ } | {
2079
+ t: "task-progress";
2080
+ description: string;
2081
+ usage: {
2082
+ durationMs: number;
2083
+ totalTokens: number;
2084
+ toolUses: number;
2085
+ };
2086
+ taskId: string;
2087
+ lastToolName?: string | undefined;
2088
+ } | {
2089
+ t: "task-end";
2090
+ status: "completed" | "failed" | "stopped";
2091
+ taskId: string;
2092
+ summary: string;
2093
+ usage?: {
2094
+ durationMs: number;
2095
+ totalTokens: number;
2096
+ toolUses: number;
2097
+ } | undefined;
2098
+ } | {
2099
+ t: "tool-progress";
2100
+ toolUseId: string;
2101
+ toolName: string;
2102
+ elapsedSeconds: number;
2103
+ taskId?: string | undefined;
1479
2104
  };
1480
2105
  turn?: string | undefined;
1481
2106
  subagent?: string | undefined;
1482
2107
  };
2108
+ role: "session";
1483
2109
  meta?: {
2110
+ model?: string | null | undefined;
1484
2111
  sentFrom?: string | undefined;
1485
2112
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
1486
- model?: string | null | undefined;
1487
2113
  fallbackModel?: string | null | undefined;
1488
2114
  customSystemPrompt?: string | null | undefined;
1489
2115
  appendSystemPrompt?: string | null | undefined;
@@ -1535,53 +2161,53 @@ declare const UpdateNewMessageBodySchema: z.ZodObject<{
1535
2161
  createdAt: z.ZodNumber;
1536
2162
  updatedAt: z.ZodNumber;
1537
2163
  }, "strip", z.ZodTypeAny, {
2164
+ id: string;
2165
+ seq: number;
1538
2166
  content: {
1539
2167
  c: string;
1540
2168
  t: "encrypted";
1541
2169
  };
1542
- id: string;
1543
- seq: number;
1544
2170
  createdAt: number;
1545
2171
  updatedAt: number;
1546
2172
  localId?: string | null | undefined;
1547
2173
  }, {
2174
+ id: string;
2175
+ seq: number;
1548
2176
  content: {
1549
2177
  c: string;
1550
2178
  t: "encrypted";
1551
2179
  };
1552
- id: string;
1553
- seq: number;
1554
2180
  createdAt: number;
1555
2181
  updatedAt: number;
1556
2182
  localId?: string | null | undefined;
1557
2183
  }>;
1558
2184
  }, "strip", z.ZodTypeAny, {
2185
+ t: "new-message";
1559
2186
  message: {
2187
+ id: string;
2188
+ seq: number;
1560
2189
  content: {
1561
2190
  c: string;
1562
2191
  t: "encrypted";
1563
2192
  };
1564
- id: string;
1565
- seq: number;
1566
2193
  createdAt: number;
1567
2194
  updatedAt: number;
1568
2195
  localId?: string | null | undefined;
1569
2196
  };
1570
- t: "new-message";
1571
2197
  sid: string;
1572
2198
  }, {
2199
+ t: "new-message";
1573
2200
  message: {
2201
+ id: string;
2202
+ seq: number;
1574
2203
  content: {
1575
2204
  c: string;
1576
2205
  t: "encrypted";
1577
2206
  };
1578
- id: string;
1579
- seq: number;
1580
2207
  createdAt: number;
1581
2208
  updatedAt: number;
1582
2209
  localId?: string | null | undefined;
1583
2210
  };
1584
- t: "new-message";
1585
2211
  sid: string;
1586
2212
  }>;
1587
2213
  type UpdateNewMessageBody = z.infer<typeof UpdateNewMessageBodySchema>;
@@ -1716,53 +2342,53 @@ declare const CoreUpdateBodySchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
1716
2342
  createdAt: z.ZodNumber;
1717
2343
  updatedAt: z.ZodNumber;
1718
2344
  }, "strip", z.ZodTypeAny, {
2345
+ id: string;
2346
+ seq: number;
1719
2347
  content: {
1720
2348
  c: string;
1721
2349
  t: "encrypted";
1722
2350
  };
1723
- id: string;
1724
- seq: number;
1725
2351
  createdAt: number;
1726
2352
  updatedAt: number;
1727
2353
  localId?: string | null | undefined;
1728
2354
  }, {
2355
+ id: string;
2356
+ seq: number;
1729
2357
  content: {
1730
2358
  c: string;
1731
2359
  t: "encrypted";
1732
2360
  };
1733
- id: string;
1734
- seq: number;
1735
2361
  createdAt: number;
1736
2362
  updatedAt: number;
1737
2363
  localId?: string | null | undefined;
1738
2364
  }>;
1739
2365
  }, "strip", z.ZodTypeAny, {
2366
+ t: "new-message";
1740
2367
  message: {
2368
+ id: string;
2369
+ seq: number;
1741
2370
  content: {
1742
2371
  c: string;
1743
2372
  t: "encrypted";
1744
2373
  };
1745
- id: string;
1746
- seq: number;
1747
2374
  createdAt: number;
1748
2375
  updatedAt: number;
1749
2376
  localId?: string | null | undefined;
1750
2377
  };
1751
- t: "new-message";
1752
2378
  sid: string;
1753
2379
  }, {
2380
+ t: "new-message";
1754
2381
  message: {
2382
+ id: string;
2383
+ seq: number;
1755
2384
  content: {
1756
2385
  c: string;
1757
2386
  t: "encrypted";
1758
2387
  };
1759
- id: string;
1760
- seq: number;
1761
2388
  createdAt: number;
1762
2389
  updatedAt: number;
1763
2390
  localId?: string | null | undefined;
1764
2391
  };
1765
- t: "new-message";
1766
2392
  sid: string;
1767
2393
  }>, z.ZodObject<{
1768
2394
  t: z.ZodLiteral<"update-session">;
@@ -1885,53 +2511,53 @@ declare const CoreUpdateContainerSchema: z.ZodObject<{
1885
2511
  createdAt: z.ZodNumber;
1886
2512
  updatedAt: z.ZodNumber;
1887
2513
  }, "strip", z.ZodTypeAny, {
2514
+ id: string;
2515
+ seq: number;
1888
2516
  content: {
1889
2517
  c: string;
1890
2518
  t: "encrypted";
1891
2519
  };
1892
- id: string;
1893
- seq: number;
1894
2520
  createdAt: number;
1895
2521
  updatedAt: number;
1896
2522
  localId?: string | null | undefined;
1897
2523
  }, {
2524
+ id: string;
2525
+ seq: number;
1898
2526
  content: {
1899
2527
  c: string;
1900
2528
  t: "encrypted";
1901
2529
  };
1902
- id: string;
1903
- seq: number;
1904
2530
  createdAt: number;
1905
2531
  updatedAt: number;
1906
2532
  localId?: string | null | undefined;
1907
2533
  }>;
1908
2534
  }, "strip", z.ZodTypeAny, {
2535
+ t: "new-message";
1909
2536
  message: {
2537
+ id: string;
2538
+ seq: number;
1910
2539
  content: {
1911
2540
  c: string;
1912
2541
  t: "encrypted";
1913
2542
  };
1914
- id: string;
1915
- seq: number;
1916
2543
  createdAt: number;
1917
2544
  updatedAt: number;
1918
2545
  localId?: string | null | undefined;
1919
2546
  };
1920
- t: "new-message";
1921
2547
  sid: string;
1922
2548
  }, {
2549
+ t: "new-message";
1923
2550
  message: {
2551
+ id: string;
2552
+ seq: number;
1924
2553
  content: {
1925
2554
  c: string;
1926
2555
  t: "encrypted";
1927
2556
  };
1928
- id: string;
1929
- seq: number;
1930
2557
  createdAt: number;
1931
2558
  updatedAt: number;
1932
2559
  localId?: string | null | undefined;
1933
2560
  };
1934
- t: "new-message";
1935
2561
  sid: string;
1936
2562
  }>, z.ZodObject<{
1937
2563
  t: z.ZodLiteral<"update-session">;
@@ -2036,18 +2662,18 @@ declare const CoreUpdateContainerSchema: z.ZodObject<{
2036
2662
  seq: number;
2037
2663
  createdAt: number;
2038
2664
  body: {
2665
+ t: "new-message";
2039
2666
  message: {
2667
+ id: string;
2668
+ seq: number;
2040
2669
  content: {
2041
2670
  c: string;
2042
2671
  t: "encrypted";
2043
2672
  };
2044
- id: string;
2045
- seq: number;
2046
2673
  createdAt: number;
2047
2674
  updatedAt: number;
2048
2675
  localId?: string | null | undefined;
2049
2676
  };
2050
- t: "new-message";
2051
2677
  sid: string;
2052
2678
  } | {
2053
2679
  t: "update-session";
@@ -2079,18 +2705,18 @@ declare const CoreUpdateContainerSchema: z.ZodObject<{
2079
2705
  seq: number;
2080
2706
  createdAt: number;
2081
2707
  body: {
2708
+ t: "new-message";
2082
2709
  message: {
2710
+ id: string;
2711
+ seq: number;
2083
2712
  content: {
2084
2713
  c: string;
2085
2714
  t: "encrypted";
2086
2715
  };
2087
- id: string;
2088
- seq: number;
2089
2716
  createdAt: number;
2090
2717
  updatedAt: number;
2091
2718
  localId?: string | null | undefined;
2092
2719
  };
2093
- t: "new-message";
2094
2720
  sid: string;
2095
2721
  } | {
2096
2722
  t: "update-session";
@@ -2136,22 +2762,22 @@ declare const ApiMessageSchema: z.ZodObject<{
2136
2762
  createdAt: z.ZodNumber;
2137
2763
  updatedAt: z.ZodNumber;
2138
2764
  }, "strip", z.ZodTypeAny, {
2765
+ id: string;
2766
+ seq: number;
2139
2767
  content: {
2140
2768
  c: string;
2141
2769
  t: "encrypted";
2142
2770
  };
2143
- id: string;
2144
- seq: number;
2145
2771
  createdAt: number;
2146
2772
  updatedAt: number;
2147
2773
  localId?: string | null | undefined;
2148
2774
  }, {
2775
+ id: string;
2776
+ seq: number;
2149
2777
  content: {
2150
2778
  c: string;
2151
2779
  t: "encrypted";
2152
2780
  };
2153
- id: string;
2154
- seq: number;
2155
2781
  createdAt: number;
2156
2782
  updatedAt: number;
2157
2783
  localId?: string | null | undefined;
@@ -2177,53 +2803,53 @@ declare const ApiUpdateNewMessageSchema: z.ZodObject<{
2177
2803
  createdAt: z.ZodNumber;
2178
2804
  updatedAt: z.ZodNumber;
2179
2805
  }, "strip", z.ZodTypeAny, {
2806
+ id: string;
2807
+ seq: number;
2180
2808
  content: {
2181
2809
  c: string;
2182
2810
  t: "encrypted";
2183
2811
  };
2184
- id: string;
2185
- seq: number;
2186
2812
  createdAt: number;
2187
2813
  updatedAt: number;
2188
2814
  localId?: string | null | undefined;
2189
2815
  }, {
2816
+ id: string;
2817
+ seq: number;
2190
2818
  content: {
2191
2819
  c: string;
2192
2820
  t: "encrypted";
2193
2821
  };
2194
- id: string;
2195
- seq: number;
2196
2822
  createdAt: number;
2197
2823
  updatedAt: number;
2198
2824
  localId?: string | null | undefined;
2199
2825
  }>;
2200
2826
  }, "strip", z.ZodTypeAny, {
2827
+ t: "new-message";
2201
2828
  message: {
2829
+ id: string;
2830
+ seq: number;
2202
2831
  content: {
2203
2832
  c: string;
2204
2833
  t: "encrypted";
2205
2834
  };
2206
- id: string;
2207
- seq: number;
2208
2835
  createdAt: number;
2209
2836
  updatedAt: number;
2210
2837
  localId?: string | null | undefined;
2211
2838
  };
2212
- t: "new-message";
2213
2839
  sid: string;
2214
2840
  }, {
2841
+ t: "new-message";
2215
2842
  message: {
2843
+ id: string;
2844
+ seq: number;
2216
2845
  content: {
2217
2846
  c: string;
2218
2847
  t: "encrypted";
2219
2848
  };
2220
- id: string;
2221
- seq: number;
2222
2849
  createdAt: number;
2223
2850
  updatedAt: number;
2224
2851
  localId?: string | null | undefined;
2225
2852
  };
2226
- t: "new-message";
2227
2853
  sid: string;
2228
2854
  }>;
2229
2855
  type ApiUpdateNewMessage = UpdateNewMessageBody;
@@ -2347,53 +2973,53 @@ declare const UpdateBodySchema: z.ZodObject<{
2347
2973
  createdAt: z.ZodNumber;
2348
2974
  updatedAt: z.ZodNumber;
2349
2975
  }, "strip", z.ZodTypeAny, {
2976
+ id: string;
2977
+ seq: number;
2350
2978
  content: {
2351
2979
  c: string;
2352
2980
  t: "encrypted";
2353
2981
  };
2354
- id: string;
2355
- seq: number;
2356
2982
  createdAt: number;
2357
2983
  updatedAt: number;
2358
2984
  localId?: string | null | undefined;
2359
2985
  }, {
2986
+ id: string;
2987
+ seq: number;
2360
2988
  content: {
2361
2989
  c: string;
2362
2990
  t: "encrypted";
2363
2991
  };
2364
- id: string;
2365
- seq: number;
2366
2992
  createdAt: number;
2367
2993
  updatedAt: number;
2368
2994
  localId?: string | null | undefined;
2369
2995
  }>;
2370
2996
  }, "strip", z.ZodTypeAny, {
2997
+ t: "new-message";
2371
2998
  message: {
2999
+ id: string;
3000
+ seq: number;
2372
3001
  content: {
2373
3002
  c: string;
2374
3003
  t: "encrypted";
2375
3004
  };
2376
- id: string;
2377
- seq: number;
2378
3005
  createdAt: number;
2379
3006
  updatedAt: number;
2380
3007
  localId?: string | null | undefined;
2381
3008
  };
2382
- t: "new-message";
2383
3009
  sid: string;
2384
3010
  }, {
3011
+ t: "new-message";
2385
3012
  message: {
3013
+ id: string;
3014
+ seq: number;
2386
3015
  content: {
2387
3016
  c: string;
2388
3017
  t: "encrypted";
2389
3018
  };
2390
- id: string;
2391
- seq: number;
2392
3019
  createdAt: number;
2393
3020
  updatedAt: number;
2394
3021
  localId?: string | null | undefined;
2395
3022
  };
2396
- t: "new-message";
2397
3023
  sid: string;
2398
3024
  }>;
2399
3025
  type UpdateBody = UpdateNewMessageBody;
@@ -2420,53 +3046,53 @@ declare const UpdateSchema: z.ZodObject<{
2420
3046
  createdAt: z.ZodNumber;
2421
3047
  updatedAt: z.ZodNumber;
2422
3048
  }, "strip", z.ZodTypeAny, {
3049
+ id: string;
3050
+ seq: number;
2423
3051
  content: {
2424
3052
  c: string;
2425
3053
  t: "encrypted";
2426
3054
  };
2427
- id: string;
2428
- seq: number;
2429
3055
  createdAt: number;
2430
3056
  updatedAt: number;
2431
3057
  localId?: string | null | undefined;
2432
3058
  }, {
3059
+ id: string;
3060
+ seq: number;
2433
3061
  content: {
2434
3062
  c: string;
2435
3063
  t: "encrypted";
2436
3064
  };
2437
- id: string;
2438
- seq: number;
2439
3065
  createdAt: number;
2440
3066
  updatedAt: number;
2441
3067
  localId?: string | null | undefined;
2442
3068
  }>;
2443
3069
  }, "strip", z.ZodTypeAny, {
3070
+ t: "new-message";
2444
3071
  message: {
3072
+ id: string;
3073
+ seq: number;
2445
3074
  content: {
2446
3075
  c: string;
2447
3076
  t: "encrypted";
2448
3077
  };
2449
- id: string;
2450
- seq: number;
2451
3078
  createdAt: number;
2452
3079
  updatedAt: number;
2453
3080
  localId?: string | null | undefined;
2454
3081
  };
2455
- t: "new-message";
2456
3082
  sid: string;
2457
3083
  }, {
3084
+ t: "new-message";
2458
3085
  message: {
3086
+ id: string;
3087
+ seq: number;
2459
3088
  content: {
2460
3089
  c: string;
2461
3090
  t: "encrypted";
2462
3091
  };
2463
- id: string;
2464
- seq: number;
2465
3092
  createdAt: number;
2466
3093
  updatedAt: number;
2467
3094
  localId?: string | null | undefined;
2468
3095
  };
2469
- t: "new-message";
2470
3096
  sid: string;
2471
3097
  }>, z.ZodObject<{
2472
3098
  t: z.ZodLiteral<"update-session">;
@@ -2571,18 +3197,18 @@ declare const UpdateSchema: z.ZodObject<{
2571
3197
  seq: number;
2572
3198
  createdAt: number;
2573
3199
  body: {
3200
+ t: "new-message";
2574
3201
  message: {
3202
+ id: string;
3203
+ seq: number;
2575
3204
  content: {
2576
3205
  c: string;
2577
3206
  t: "encrypted";
2578
3207
  };
2579
- id: string;
2580
- seq: number;
2581
3208
  createdAt: number;
2582
3209
  updatedAt: number;
2583
3210
  localId?: string | null | undefined;
2584
3211
  };
2585
- t: "new-message";
2586
3212
  sid: string;
2587
3213
  } | {
2588
3214
  t: "update-session";
@@ -2614,18 +3240,18 @@ declare const UpdateSchema: z.ZodObject<{
2614
3240
  seq: number;
2615
3241
  createdAt: number;
2616
3242
  body: {
3243
+ t: "new-message";
2617
3244
  message: {
3245
+ id: string;
3246
+ seq: number;
2618
3247
  content: {
2619
3248
  c: string;
2620
3249
  t: "encrypted";
2621
3250
  };
2622
- id: string;
2623
- seq: number;
2624
3251
  createdAt: number;
2625
3252
  updatedAt: number;
2626
3253
  localId?: string | null | undefined;
2627
3254
  };
2628
- t: "new-message";
2629
3255
  sid: string;
2630
3256
  } | {
2631
3257
  t: "update-session";
@@ -2679,9 +3305,9 @@ declare const UserMessageSchema: z.ZodObject<{
2679
3305
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2680
3306
  displayText: z.ZodOptional<z.ZodString>;
2681
3307
  }, "strip", z.ZodTypeAny, {
3308
+ model?: string | null | undefined;
2682
3309
  sentFrom?: string | undefined;
2683
3310
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2684
- model?: string | null | undefined;
2685
3311
  fallbackModel?: string | null | undefined;
2686
3312
  customSystemPrompt?: string | null | undefined;
2687
3313
  appendSystemPrompt?: string | null | undefined;
@@ -2689,9 +3315,9 @@ declare const UserMessageSchema: z.ZodObject<{
2689
3315
  disallowedTools?: string[] | null | undefined;
2690
3316
  displayText?: string | undefined;
2691
3317
  }, {
3318
+ model?: string | null | undefined;
2692
3319
  sentFrom?: string | undefined;
2693
3320
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2694
- model?: string | null | undefined;
2695
3321
  fallbackModel?: string | null | undefined;
2696
3322
  customSystemPrompt?: string | null | undefined;
2697
3323
  appendSystemPrompt?: string | null | undefined;
@@ -2700,16 +3326,15 @@ declare const UserMessageSchema: z.ZodObject<{
2700
3326
  displayText?: string | undefined;
2701
3327
  }>>;
2702
3328
  }, "strip", z.ZodTypeAny, {
2703
- role: "user";
2704
3329
  content: {
2705
3330
  type: "text";
2706
3331
  text: string;
2707
3332
  };
2708
- localKey?: string | undefined;
3333
+ role: "user";
2709
3334
  meta?: {
3335
+ model?: string | null | undefined;
2710
3336
  sentFrom?: string | undefined;
2711
3337
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2712
- model?: string | null | undefined;
2713
3338
  fallbackModel?: string | null | undefined;
2714
3339
  customSystemPrompt?: string | null | undefined;
2715
3340
  appendSystemPrompt?: string | null | undefined;
@@ -2717,17 +3342,17 @@ declare const UserMessageSchema: z.ZodObject<{
2717
3342
  disallowedTools?: string[] | null | undefined;
2718
3343
  displayText?: string | undefined;
2719
3344
  } | undefined;
3345
+ localKey?: string | undefined;
2720
3346
  }, {
2721
- role: "user";
2722
3347
  content: {
2723
3348
  type: "text";
2724
3349
  text: string;
2725
3350
  };
2726
- localKey?: string | undefined;
3351
+ role: "user";
2727
3352
  meta?: {
3353
+ model?: string | null | undefined;
2728
3354
  sentFrom?: string | undefined;
2729
3355
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2730
- model?: string | null | undefined;
2731
3356
  fallbackModel?: string | null | undefined;
2732
3357
  customSystemPrompt?: string | null | undefined;
2733
3358
  appendSystemPrompt?: string | null | undefined;
@@ -2735,6 +3360,7 @@ declare const UserMessageSchema: z.ZodObject<{
2735
3360
  disallowedTools?: string[] | null | undefined;
2736
3361
  displayText?: string | undefined;
2737
3362
  } | undefined;
3363
+ localKey?: string | undefined;
2738
3364
  }>;
2739
3365
  type UserMessage = z.infer<typeof UserMessageSchema>;
2740
3366
  declare const AgentMessageSchema: z.ZodObject<{
@@ -2757,9 +3383,9 @@ declare const AgentMessageSchema: z.ZodObject<{
2757
3383
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2758
3384
  displayText: z.ZodOptional<z.ZodString>;
2759
3385
  }, "strip", z.ZodTypeAny, {
3386
+ model?: string | null | undefined;
2760
3387
  sentFrom?: string | undefined;
2761
3388
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2762
- model?: string | null | undefined;
2763
3389
  fallbackModel?: string | null | undefined;
2764
3390
  customSystemPrompt?: string | null | undefined;
2765
3391
  appendSystemPrompt?: string | null | undefined;
@@ -2767,9 +3393,9 @@ declare const AgentMessageSchema: z.ZodObject<{
2767
3393
  disallowedTools?: string[] | null | undefined;
2768
3394
  displayText?: string | undefined;
2769
3395
  }, {
3396
+ model?: string | null | undefined;
2770
3397
  sentFrom?: string | undefined;
2771
3398
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2772
- model?: string | null | undefined;
2773
3399
  fallbackModel?: string | null | undefined;
2774
3400
  customSystemPrompt?: string | null | undefined;
2775
3401
  appendSystemPrompt?: string | null | undefined;
@@ -2778,16 +3404,16 @@ declare const AgentMessageSchema: z.ZodObject<{
2778
3404
  displayText?: string | undefined;
2779
3405
  }>>;
2780
3406
  }, "strip", z.ZodTypeAny, {
2781
- role: "agent";
2782
3407
  content: {
2783
3408
  type: string;
2784
3409
  } & {
2785
3410
  [k: string]: unknown;
2786
3411
  };
3412
+ role: "agent";
2787
3413
  meta?: {
3414
+ model?: string | null | undefined;
2788
3415
  sentFrom?: string | undefined;
2789
3416
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2790
- model?: string | null | undefined;
2791
3417
  fallbackModel?: string | null | undefined;
2792
3418
  customSystemPrompt?: string | null | undefined;
2793
3419
  appendSystemPrompt?: string | null | undefined;
@@ -2796,16 +3422,16 @@ declare const AgentMessageSchema: z.ZodObject<{
2796
3422
  displayText?: string | undefined;
2797
3423
  } | undefined;
2798
3424
  }, {
2799
- role: "agent";
2800
3425
  content: {
2801
3426
  type: string;
2802
3427
  } & {
2803
3428
  [k: string]: unknown;
2804
3429
  };
3430
+ role: "agent";
2805
3431
  meta?: {
3432
+ model?: string | null | undefined;
2806
3433
  sentFrom?: string | undefined;
2807
3434
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2808
- model?: string | null | undefined;
2809
3435
  fallbackModel?: string | null | undefined;
2810
3436
  customSystemPrompt?: string | null | undefined;
2811
3437
  appendSystemPrompt?: string | null | undefined;
@@ -2839,9 +3465,9 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2839
3465
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2840
3466
  displayText: z.ZodOptional<z.ZodString>;
2841
3467
  }, "strip", z.ZodTypeAny, {
3468
+ model?: string | null | undefined;
2842
3469
  sentFrom?: string | undefined;
2843
3470
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2844
- model?: string | null | undefined;
2845
3471
  fallbackModel?: string | null | undefined;
2846
3472
  customSystemPrompt?: string | null | undefined;
2847
3473
  appendSystemPrompt?: string | null | undefined;
@@ -2849,9 +3475,9 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2849
3475
  disallowedTools?: string[] | null | undefined;
2850
3476
  displayText?: string | undefined;
2851
3477
  }, {
3478
+ model?: string | null | undefined;
2852
3479
  sentFrom?: string | undefined;
2853
3480
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2854
- model?: string | null | undefined;
2855
3481
  fallbackModel?: string | null | undefined;
2856
3482
  customSystemPrompt?: string | null | undefined;
2857
3483
  appendSystemPrompt?: string | null | undefined;
@@ -2860,16 +3486,15 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2860
3486
  displayText?: string | undefined;
2861
3487
  }>>;
2862
3488
  }, "strip", z.ZodTypeAny, {
2863
- role: "user";
2864
3489
  content: {
2865
3490
  type: "text";
2866
3491
  text: string;
2867
3492
  };
2868
- localKey?: string | undefined;
3493
+ role: "user";
2869
3494
  meta?: {
3495
+ model?: string | null | undefined;
2870
3496
  sentFrom?: string | undefined;
2871
3497
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2872
- model?: string | null | undefined;
2873
3498
  fallbackModel?: string | null | undefined;
2874
3499
  customSystemPrompt?: string | null | undefined;
2875
3500
  appendSystemPrompt?: string | null | undefined;
@@ -2877,17 +3502,17 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2877
3502
  disallowedTools?: string[] | null | undefined;
2878
3503
  displayText?: string | undefined;
2879
3504
  } | undefined;
3505
+ localKey?: string | undefined;
2880
3506
  }, {
2881
- role: "user";
2882
3507
  content: {
2883
3508
  type: "text";
2884
3509
  text: string;
2885
3510
  };
2886
- localKey?: string | undefined;
3511
+ role: "user";
2887
3512
  meta?: {
3513
+ model?: string | null | undefined;
2888
3514
  sentFrom?: string | undefined;
2889
3515
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2890
- model?: string | null | undefined;
2891
3516
  fallbackModel?: string | null | undefined;
2892
3517
  customSystemPrompt?: string | null | undefined;
2893
3518
  appendSystemPrompt?: string | null | undefined;
@@ -2895,6 +3520,7 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2895
3520
  disallowedTools?: string[] | null | undefined;
2896
3521
  displayText?: string | undefined;
2897
3522
  } | undefined;
3523
+ localKey?: string | undefined;
2898
3524
  }>, z.ZodObject<{
2899
3525
  role: z.ZodLiteral<"agent">;
2900
3526
  content: z.ZodObject<{
@@ -2915,9 +3541,9 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2915
3541
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2916
3542
  displayText: z.ZodOptional<z.ZodString>;
2917
3543
  }, "strip", z.ZodTypeAny, {
3544
+ model?: string | null | undefined;
2918
3545
  sentFrom?: string | undefined;
2919
3546
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2920
- model?: string | null | undefined;
2921
3547
  fallbackModel?: string | null | undefined;
2922
3548
  customSystemPrompt?: string | null | undefined;
2923
3549
  appendSystemPrompt?: string | null | undefined;
@@ -2925,9 +3551,9 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2925
3551
  disallowedTools?: string[] | null | undefined;
2926
3552
  displayText?: string | undefined;
2927
3553
  }, {
3554
+ model?: string | null | undefined;
2928
3555
  sentFrom?: string | undefined;
2929
3556
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2930
- model?: string | null | undefined;
2931
3557
  fallbackModel?: string | null | undefined;
2932
3558
  customSystemPrompt?: string | null | undefined;
2933
3559
  appendSystemPrompt?: string | null | undefined;
@@ -2936,16 +3562,16 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2936
3562
  displayText?: string | undefined;
2937
3563
  }>>;
2938
3564
  }, "strip", z.ZodTypeAny, {
2939
- role: "agent";
2940
3565
  content: {
2941
3566
  type: string;
2942
3567
  } & {
2943
3568
  [k: string]: unknown;
2944
3569
  };
3570
+ role: "agent";
2945
3571
  meta?: {
3572
+ model?: string | null | undefined;
2946
3573
  sentFrom?: string | undefined;
2947
3574
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2948
- model?: string | null | undefined;
2949
3575
  fallbackModel?: string | null | undefined;
2950
3576
  customSystemPrompt?: string | null | undefined;
2951
3577
  appendSystemPrompt?: string | null | undefined;
@@ -2954,16 +3580,16 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2954
3580
  displayText?: string | undefined;
2955
3581
  } | undefined;
2956
3582
  }, {
2957
- role: "agent";
2958
3583
  content: {
2959
3584
  type: string;
2960
3585
  } & {
2961
3586
  [k: string]: unknown;
2962
3587
  };
3588
+ role: "agent";
2963
3589
  meta?: {
3590
+ model?: string | null | undefined;
2964
3591
  sentFrom?: string | undefined;
2965
3592
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2966
- model?: string | null | undefined;
2967
3593
  fallbackModel?: string | null | undefined;
2968
3594
  customSystemPrompt?: string | null | undefined;
2969
3595
  appendSystemPrompt?: string | null | undefined;
@@ -2981,23 +3607,23 @@ declare const sessionTextEventSchema: z.ZodObject<{
2981
3607
  text: z.ZodString;
2982
3608
  thinking: z.ZodOptional<z.ZodBoolean>;
2983
3609
  }, "strip", z.ZodTypeAny, {
2984
- text: string;
2985
3610
  t: "text";
3611
+ text: string;
2986
3612
  thinking?: boolean | undefined;
2987
3613
  }, {
2988
- text: string;
2989
3614
  t: "text";
3615
+ text: string;
2990
3616
  thinking?: boolean | undefined;
2991
3617
  }>;
2992
3618
  declare const sessionServiceMessageEventSchema: z.ZodObject<{
2993
3619
  t: z.ZodLiteral<"service">;
2994
3620
  text: z.ZodString;
2995
3621
  }, "strip", z.ZodTypeAny, {
2996
- text: string;
2997
3622
  t: "service";
2998
- }, {
2999
3623
  text: string;
3624
+ }, {
3000
3625
  t: "service";
3626
+ text: string;
3001
3627
  }>;
3002
3628
  declare const sessionToolCallStartEventSchema: z.ZodObject<{
3003
3629
  t: z.ZodLiteral<"tool-call-start">;
@@ -3111,8 +3737,8 @@ declare const sessionTurnEndEventSchema: z.ZodObject<{
3111
3737
  }>>;
3112
3738
  durationMs: z.ZodOptional<z.ZodNumber>;
3113
3739
  }, "strip", z.ZodTypeAny, {
3114
- status: "completed" | "failed" | "cancelled";
3115
3740
  t: "turn-end";
3741
+ status: "completed" | "failed" | "cancelled";
3116
3742
  model?: string | undefined;
3117
3743
  usage?: {
3118
3744
  input_tokens: number;
@@ -3122,8 +3748,8 @@ declare const sessionTurnEndEventSchema: z.ZodObject<{
3122
3748
  } | undefined;
3123
3749
  durationMs?: number | undefined;
3124
3750
  }, {
3125
- status: "completed" | "failed" | "cancelled";
3126
3751
  t: "turn-end";
3752
+ status: "completed" | "failed" | "cancelled";
3127
3753
  model?: string | undefined;
3128
3754
  usage?: {
3129
3755
  input_tokens: number;
@@ -3159,6 +3785,7 @@ declare const sessionUsageUpdateEventSchema: z.ZodObject<{
3159
3785
  cache_creation_input_tokens?: number | undefined;
3160
3786
  cache_read_input_tokens?: number | undefined;
3161
3787
  }>;
3788
+ durationMs: z.ZodOptional<z.ZodNumber>;
3162
3789
  }, "strip", z.ZodTypeAny, {
3163
3790
  t: "usage-update";
3164
3791
  usage: {
@@ -3168,6 +3795,7 @@ declare const sessionUsageUpdateEventSchema: z.ZodObject<{
3168
3795
  cache_read_input_tokens?: number | undefined;
3169
3796
  };
3170
3797
  model?: string | undefined;
3798
+ durationMs?: number | undefined;
3171
3799
  }, {
3172
3800
  t: "usage-update";
3173
3801
  usage: {
@@ -3177,28 +3805,145 @@ declare const sessionUsageUpdateEventSchema: z.ZodObject<{
3177
3805
  cache_read_input_tokens?: number | undefined;
3178
3806
  };
3179
3807
  model?: string | undefined;
3808
+ durationMs?: number | undefined;
3809
+ }>;
3810
+ declare const sessionTaskStartEventSchema: z.ZodObject<{
3811
+ t: z.ZodLiteral<"task-start">;
3812
+ taskId: z.ZodString;
3813
+ toolUseId: z.ZodOptional<z.ZodString>;
3814
+ description: z.ZodString;
3815
+ taskType: z.ZodOptional<z.ZodString>;
3816
+ }, "strip", z.ZodTypeAny, {
3817
+ t: "task-start";
3818
+ description: string;
3819
+ taskId: string;
3820
+ toolUseId?: string | undefined;
3821
+ taskType?: string | undefined;
3822
+ }, {
3823
+ t: "task-start";
3824
+ description: string;
3825
+ taskId: string;
3826
+ toolUseId?: string | undefined;
3827
+ taskType?: string | undefined;
3828
+ }>;
3829
+ declare const sessionTaskProgressEventSchema: z.ZodObject<{
3830
+ t: z.ZodLiteral<"task-progress">;
3831
+ taskId: z.ZodString;
3832
+ description: z.ZodString;
3833
+ usage: z.ZodObject<{
3834
+ totalTokens: z.ZodNumber;
3835
+ toolUses: z.ZodNumber;
3836
+ durationMs: z.ZodNumber;
3837
+ }, "strip", z.ZodTypeAny, {
3838
+ durationMs: number;
3839
+ totalTokens: number;
3840
+ toolUses: number;
3841
+ }, {
3842
+ durationMs: number;
3843
+ totalTokens: number;
3844
+ toolUses: number;
3845
+ }>;
3846
+ lastToolName: z.ZodOptional<z.ZodString>;
3847
+ }, "strip", z.ZodTypeAny, {
3848
+ t: "task-progress";
3849
+ description: string;
3850
+ usage: {
3851
+ durationMs: number;
3852
+ totalTokens: number;
3853
+ toolUses: number;
3854
+ };
3855
+ taskId: string;
3856
+ lastToolName?: string | undefined;
3857
+ }, {
3858
+ t: "task-progress";
3859
+ description: string;
3860
+ usage: {
3861
+ durationMs: number;
3862
+ totalTokens: number;
3863
+ toolUses: number;
3864
+ };
3865
+ taskId: string;
3866
+ lastToolName?: string | undefined;
3867
+ }>;
3868
+ declare const sessionTaskEndEventSchema: z.ZodObject<{
3869
+ t: z.ZodLiteral<"task-end">;
3870
+ taskId: z.ZodString;
3871
+ status: z.ZodEnum<["completed", "failed", "stopped"]>;
3872
+ summary: z.ZodString;
3873
+ usage: z.ZodOptional<z.ZodObject<{
3874
+ totalTokens: z.ZodNumber;
3875
+ toolUses: z.ZodNumber;
3876
+ durationMs: z.ZodNumber;
3877
+ }, "strip", z.ZodTypeAny, {
3878
+ durationMs: number;
3879
+ totalTokens: number;
3880
+ toolUses: number;
3881
+ }, {
3882
+ durationMs: number;
3883
+ totalTokens: number;
3884
+ toolUses: number;
3885
+ }>>;
3886
+ }, "strip", z.ZodTypeAny, {
3887
+ t: "task-end";
3888
+ status: "completed" | "failed" | "stopped";
3889
+ taskId: string;
3890
+ summary: string;
3891
+ usage?: {
3892
+ durationMs: number;
3893
+ totalTokens: number;
3894
+ toolUses: number;
3895
+ } | undefined;
3896
+ }, {
3897
+ t: "task-end";
3898
+ status: "completed" | "failed" | "stopped";
3899
+ taskId: string;
3900
+ summary: string;
3901
+ usage?: {
3902
+ durationMs: number;
3903
+ totalTokens: number;
3904
+ toolUses: number;
3905
+ } | undefined;
3906
+ }>;
3907
+ declare const sessionToolProgressEventSchema: z.ZodObject<{
3908
+ t: z.ZodLiteral<"tool-progress">;
3909
+ toolUseId: z.ZodString;
3910
+ toolName: z.ZodString;
3911
+ elapsedSeconds: z.ZodNumber;
3912
+ taskId: z.ZodOptional<z.ZodString>;
3913
+ }, "strip", z.ZodTypeAny, {
3914
+ t: "tool-progress";
3915
+ toolUseId: string;
3916
+ toolName: string;
3917
+ elapsedSeconds: number;
3918
+ taskId?: string | undefined;
3919
+ }, {
3920
+ t: "tool-progress";
3921
+ toolUseId: string;
3922
+ toolName: string;
3923
+ elapsedSeconds: number;
3924
+ taskId?: string | undefined;
3180
3925
  }>;
3181
3926
  declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
3182
3927
  t: z.ZodLiteral<"text">;
3183
3928
  text: z.ZodString;
3184
3929
  thinking: z.ZodOptional<z.ZodBoolean>;
3185
3930
  }, "strip", z.ZodTypeAny, {
3186
- text: string;
3187
3931
  t: "text";
3932
+ text: string;
3188
3933
  thinking?: boolean | undefined;
3189
3934
  }, {
3190
- text: string;
3191
3935
  t: "text";
3936
+ text: string;
3192
3937
  thinking?: boolean | undefined;
3193
3938
  }>, z.ZodObject<{
3194
3939
  t: z.ZodLiteral<"service">;
3195
3940
  text: z.ZodString;
3196
3941
  }, "strip", z.ZodTypeAny, {
3197
- text: string;
3198
3942
  t: "service";
3199
- }, {
3200
3943
  text: string;
3944
+ }, {
3201
3945
  t: "service";
3946
+ text: string;
3202
3947
  }>, z.ZodObject<{
3203
3948
  t: z.ZodLiteral<"tool-call-start">;
3204
3949
  call: z.ZodString;
@@ -3304,8 +4049,8 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
3304
4049
  }>>;
3305
4050
  durationMs: z.ZodOptional<z.ZodNumber>;
3306
4051
  }, "strip", z.ZodTypeAny, {
3307
- status: "completed" | "failed" | "cancelled";
3308
4052
  t: "turn-end";
4053
+ status: "completed" | "failed" | "cancelled";
3309
4054
  model?: string | undefined;
3310
4055
  usage?: {
3311
4056
  input_tokens: number;
@@ -3315,8 +4060,8 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
3315
4060
  } | undefined;
3316
4061
  durationMs?: number | undefined;
3317
4062
  }, {
3318
- status: "completed" | "failed" | "cancelled";
3319
4063
  t: "turn-end";
4064
+ status: "completed" | "failed" | "cancelled";
3320
4065
  model?: string | undefined;
3321
4066
  usage?: {
3322
4067
  input_tokens: number;
@@ -3350,6 +4095,7 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
3350
4095
  cache_creation_input_tokens?: number | undefined;
3351
4096
  cache_read_input_tokens?: number | undefined;
3352
4097
  }>;
4098
+ durationMs: z.ZodOptional<z.ZodNumber>;
3353
4099
  }, "strip", z.ZodTypeAny, {
3354
4100
  t: "usage-update";
3355
4101
  usage: {
@@ -3359,6 +4105,7 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
3359
4105
  cache_read_input_tokens?: number | undefined;
3360
4106
  };
3361
4107
  model?: string | undefined;
4108
+ durationMs?: number | undefined;
3362
4109
  }, {
3363
4110
  t: "usage-update";
3364
4111
  usage: {
@@ -3368,6 +4115,119 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
3368
4115
  cache_read_input_tokens?: number | undefined;
3369
4116
  };
3370
4117
  model?: string | undefined;
4118
+ durationMs?: number | undefined;
4119
+ }>, z.ZodObject<{
4120
+ t: z.ZodLiteral<"task-start">;
4121
+ taskId: z.ZodString;
4122
+ toolUseId: z.ZodOptional<z.ZodString>;
4123
+ description: z.ZodString;
4124
+ taskType: z.ZodOptional<z.ZodString>;
4125
+ }, "strip", z.ZodTypeAny, {
4126
+ t: "task-start";
4127
+ description: string;
4128
+ taskId: string;
4129
+ toolUseId?: string | undefined;
4130
+ taskType?: string | undefined;
4131
+ }, {
4132
+ t: "task-start";
4133
+ description: string;
4134
+ taskId: string;
4135
+ toolUseId?: string | undefined;
4136
+ taskType?: string | undefined;
4137
+ }>, z.ZodObject<{
4138
+ t: z.ZodLiteral<"task-progress">;
4139
+ taskId: z.ZodString;
4140
+ description: z.ZodString;
4141
+ usage: z.ZodObject<{
4142
+ totalTokens: z.ZodNumber;
4143
+ toolUses: z.ZodNumber;
4144
+ durationMs: z.ZodNumber;
4145
+ }, "strip", z.ZodTypeAny, {
4146
+ durationMs: number;
4147
+ totalTokens: number;
4148
+ toolUses: number;
4149
+ }, {
4150
+ durationMs: number;
4151
+ totalTokens: number;
4152
+ toolUses: number;
4153
+ }>;
4154
+ lastToolName: z.ZodOptional<z.ZodString>;
4155
+ }, "strip", z.ZodTypeAny, {
4156
+ t: "task-progress";
4157
+ description: string;
4158
+ usage: {
4159
+ durationMs: number;
4160
+ totalTokens: number;
4161
+ toolUses: number;
4162
+ };
4163
+ taskId: string;
4164
+ lastToolName?: string | undefined;
4165
+ }, {
4166
+ t: "task-progress";
4167
+ description: string;
4168
+ usage: {
4169
+ durationMs: number;
4170
+ totalTokens: number;
4171
+ toolUses: number;
4172
+ };
4173
+ taskId: string;
4174
+ lastToolName?: string | undefined;
4175
+ }>, z.ZodObject<{
4176
+ t: z.ZodLiteral<"task-end">;
4177
+ taskId: z.ZodString;
4178
+ status: z.ZodEnum<["completed", "failed", "stopped"]>;
4179
+ summary: z.ZodString;
4180
+ usage: z.ZodOptional<z.ZodObject<{
4181
+ totalTokens: z.ZodNumber;
4182
+ toolUses: z.ZodNumber;
4183
+ durationMs: z.ZodNumber;
4184
+ }, "strip", z.ZodTypeAny, {
4185
+ durationMs: number;
4186
+ totalTokens: number;
4187
+ toolUses: number;
4188
+ }, {
4189
+ durationMs: number;
4190
+ totalTokens: number;
4191
+ toolUses: number;
4192
+ }>>;
4193
+ }, "strip", z.ZodTypeAny, {
4194
+ t: "task-end";
4195
+ status: "completed" | "failed" | "stopped";
4196
+ taskId: string;
4197
+ summary: string;
4198
+ usage?: {
4199
+ durationMs: number;
4200
+ totalTokens: number;
4201
+ toolUses: number;
4202
+ } | undefined;
4203
+ }, {
4204
+ t: "task-end";
4205
+ status: "completed" | "failed" | "stopped";
4206
+ taskId: string;
4207
+ summary: string;
4208
+ usage?: {
4209
+ durationMs: number;
4210
+ totalTokens: number;
4211
+ toolUses: number;
4212
+ } | undefined;
4213
+ }>, z.ZodObject<{
4214
+ t: z.ZodLiteral<"tool-progress">;
4215
+ toolUseId: z.ZodString;
4216
+ toolName: z.ZodString;
4217
+ elapsedSeconds: z.ZodNumber;
4218
+ taskId: z.ZodOptional<z.ZodString>;
4219
+ }, "strip", z.ZodTypeAny, {
4220
+ t: "tool-progress";
4221
+ toolUseId: string;
4222
+ toolName: string;
4223
+ elapsedSeconds: number;
4224
+ taskId?: string | undefined;
4225
+ }, {
4226
+ t: "tool-progress";
4227
+ toolUseId: string;
4228
+ toolName: string;
4229
+ elapsedSeconds: number;
4230
+ taskId?: string | undefined;
3371
4231
  }>]>;
3372
4232
  type SessionEvent = z.infer<typeof sessionEventSchema>;
3373
4233
  declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
@@ -3381,22 +4241,22 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3381
4241
  text: z.ZodString;
3382
4242
  thinking: z.ZodOptional<z.ZodBoolean>;
3383
4243
  }, "strip", z.ZodTypeAny, {
3384
- text: string;
3385
4244
  t: "text";
4245
+ text: string;
3386
4246
  thinking?: boolean | undefined;
3387
4247
  }, {
3388
- text: string;
3389
4248
  t: "text";
4249
+ text: string;
3390
4250
  thinking?: boolean | undefined;
3391
4251
  }>, z.ZodObject<{
3392
4252
  t: z.ZodLiteral<"service">;
3393
4253
  text: z.ZodString;
3394
4254
  }, "strip", z.ZodTypeAny, {
3395
- text: string;
3396
4255
  t: "service";
3397
- }, {
3398
4256
  text: string;
4257
+ }, {
3399
4258
  t: "service";
4259
+ text: string;
3400
4260
  }>, z.ZodObject<{
3401
4261
  t: z.ZodLiteral<"tool-call-start">;
3402
4262
  call: z.ZodString;
@@ -3502,8 +4362,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3502
4362
  }>>;
3503
4363
  durationMs: z.ZodOptional<z.ZodNumber>;
3504
4364
  }, "strip", z.ZodTypeAny, {
3505
- status: "completed" | "failed" | "cancelled";
3506
4365
  t: "turn-end";
4366
+ status: "completed" | "failed" | "cancelled";
3507
4367
  model?: string | undefined;
3508
4368
  usage?: {
3509
4369
  input_tokens: number;
@@ -3513,8 +4373,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3513
4373
  } | undefined;
3514
4374
  durationMs?: number | undefined;
3515
4375
  }, {
3516
- status: "completed" | "failed" | "cancelled";
3517
4376
  t: "turn-end";
4377
+ status: "completed" | "failed" | "cancelled";
3518
4378
  model?: string | undefined;
3519
4379
  usage?: {
3520
4380
  input_tokens: number;
@@ -3548,6 +4408,7 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3548
4408
  cache_creation_input_tokens?: number | undefined;
3549
4409
  cache_read_input_tokens?: number | undefined;
3550
4410
  }>;
4411
+ durationMs: z.ZodOptional<z.ZodNumber>;
3551
4412
  }, "strip", z.ZodTypeAny, {
3552
4413
  t: "usage-update";
3553
4414
  usage: {
@@ -3557,6 +4418,7 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3557
4418
  cache_read_input_tokens?: number | undefined;
3558
4419
  };
3559
4420
  model?: string | undefined;
4421
+ durationMs?: number | undefined;
3560
4422
  }, {
3561
4423
  t: "usage-update";
3562
4424
  usage: {
@@ -3566,18 +4428,131 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3566
4428
  cache_read_input_tokens?: number | undefined;
3567
4429
  };
3568
4430
  model?: string | undefined;
4431
+ durationMs?: number | undefined;
4432
+ }>, z.ZodObject<{
4433
+ t: z.ZodLiteral<"task-start">;
4434
+ taskId: z.ZodString;
4435
+ toolUseId: z.ZodOptional<z.ZodString>;
4436
+ description: z.ZodString;
4437
+ taskType: z.ZodOptional<z.ZodString>;
4438
+ }, "strip", z.ZodTypeAny, {
4439
+ t: "task-start";
4440
+ description: string;
4441
+ taskId: string;
4442
+ toolUseId?: string | undefined;
4443
+ taskType?: string | undefined;
4444
+ }, {
4445
+ t: "task-start";
4446
+ description: string;
4447
+ taskId: string;
4448
+ toolUseId?: string | undefined;
4449
+ taskType?: string | undefined;
4450
+ }>, z.ZodObject<{
4451
+ t: z.ZodLiteral<"task-progress">;
4452
+ taskId: z.ZodString;
4453
+ description: z.ZodString;
4454
+ usage: z.ZodObject<{
4455
+ totalTokens: z.ZodNumber;
4456
+ toolUses: z.ZodNumber;
4457
+ durationMs: z.ZodNumber;
4458
+ }, "strip", z.ZodTypeAny, {
4459
+ durationMs: number;
4460
+ totalTokens: number;
4461
+ toolUses: number;
4462
+ }, {
4463
+ durationMs: number;
4464
+ totalTokens: number;
4465
+ toolUses: number;
4466
+ }>;
4467
+ lastToolName: z.ZodOptional<z.ZodString>;
4468
+ }, "strip", z.ZodTypeAny, {
4469
+ t: "task-progress";
4470
+ description: string;
4471
+ usage: {
4472
+ durationMs: number;
4473
+ totalTokens: number;
4474
+ toolUses: number;
4475
+ };
4476
+ taskId: string;
4477
+ lastToolName?: string | undefined;
4478
+ }, {
4479
+ t: "task-progress";
4480
+ description: string;
4481
+ usage: {
4482
+ durationMs: number;
4483
+ totalTokens: number;
4484
+ toolUses: number;
4485
+ };
4486
+ taskId: string;
4487
+ lastToolName?: string | undefined;
4488
+ }>, z.ZodObject<{
4489
+ t: z.ZodLiteral<"task-end">;
4490
+ taskId: z.ZodString;
4491
+ status: z.ZodEnum<["completed", "failed", "stopped"]>;
4492
+ summary: z.ZodString;
4493
+ usage: z.ZodOptional<z.ZodObject<{
4494
+ totalTokens: z.ZodNumber;
4495
+ toolUses: z.ZodNumber;
4496
+ durationMs: z.ZodNumber;
4497
+ }, "strip", z.ZodTypeAny, {
4498
+ durationMs: number;
4499
+ totalTokens: number;
4500
+ toolUses: number;
4501
+ }, {
4502
+ durationMs: number;
4503
+ totalTokens: number;
4504
+ toolUses: number;
4505
+ }>>;
4506
+ }, "strip", z.ZodTypeAny, {
4507
+ t: "task-end";
4508
+ status: "completed" | "failed" | "stopped";
4509
+ taskId: string;
4510
+ summary: string;
4511
+ usage?: {
4512
+ durationMs: number;
4513
+ totalTokens: number;
4514
+ toolUses: number;
4515
+ } | undefined;
4516
+ }, {
4517
+ t: "task-end";
4518
+ status: "completed" | "failed" | "stopped";
4519
+ taskId: string;
4520
+ summary: string;
4521
+ usage?: {
4522
+ durationMs: number;
4523
+ totalTokens: number;
4524
+ toolUses: number;
4525
+ } | undefined;
4526
+ }>, z.ZodObject<{
4527
+ t: z.ZodLiteral<"tool-progress">;
4528
+ toolUseId: z.ZodString;
4529
+ toolName: z.ZodString;
4530
+ elapsedSeconds: z.ZodNumber;
4531
+ taskId: z.ZodOptional<z.ZodString>;
4532
+ }, "strip", z.ZodTypeAny, {
4533
+ t: "tool-progress";
4534
+ toolUseId: string;
4535
+ toolName: string;
4536
+ elapsedSeconds: number;
4537
+ taskId?: string | undefined;
4538
+ }, {
4539
+ t: "tool-progress";
4540
+ toolUseId: string;
4541
+ toolName: string;
4542
+ elapsedSeconds: number;
4543
+ taskId?: string | undefined;
3569
4544
  }>]>;
3570
4545
  }, "strip", z.ZodTypeAny, {
3571
- role: "user" | "agent";
3572
4546
  id: string;
4547
+ role: "user" | "agent";
3573
4548
  time: number;
3574
4549
  ev: {
3575
- text: string;
3576
4550
  t: "text";
4551
+ text: string;
3577
4552
  thinking?: boolean | undefined;
3578
4553
  } | {
3579
- text: string;
3580
4554
  t: "service";
4555
+ text: string;
3581
4556
  } | {
3582
4557
  t: "tool-call-start";
3583
4558
  call: string;
@@ -3604,8 +4579,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3604
4579
  t: "start";
3605
4580
  title?: string | undefined;
3606
4581
  } | {
3607
- status: "completed" | "failed" | "cancelled";
3608
4582
  t: "turn-end";
4583
+ status: "completed" | "failed" | "cancelled";
3609
4584
  model?: string | undefined;
3610
4585
  usage?: {
3611
4586
  input_tokens: number;
@@ -3625,20 +4600,53 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3625
4600
  cache_read_input_tokens?: number | undefined;
3626
4601
  };
3627
4602
  model?: string | undefined;
4603
+ durationMs?: number | undefined;
4604
+ } | {
4605
+ t: "task-start";
4606
+ description: string;
4607
+ taskId: string;
4608
+ toolUseId?: string | undefined;
4609
+ taskType?: string | undefined;
4610
+ } | {
4611
+ t: "task-progress";
4612
+ description: string;
4613
+ usage: {
4614
+ durationMs: number;
4615
+ totalTokens: number;
4616
+ toolUses: number;
4617
+ };
4618
+ taskId: string;
4619
+ lastToolName?: string | undefined;
4620
+ } | {
4621
+ t: "task-end";
4622
+ status: "completed" | "failed" | "stopped";
4623
+ taskId: string;
4624
+ summary: string;
4625
+ usage?: {
4626
+ durationMs: number;
4627
+ totalTokens: number;
4628
+ toolUses: number;
4629
+ } | undefined;
4630
+ } | {
4631
+ t: "tool-progress";
4632
+ toolUseId: string;
4633
+ toolName: string;
4634
+ elapsedSeconds: number;
4635
+ taskId?: string | undefined;
3628
4636
  };
3629
4637
  turn?: string | undefined;
3630
4638
  subagent?: string | undefined;
3631
4639
  }, {
3632
- role: "user" | "agent";
3633
4640
  id: string;
4641
+ role: "user" | "agent";
3634
4642
  time: number;
3635
4643
  ev: {
3636
- text: string;
3637
4644
  t: "text";
4645
+ text: string;
3638
4646
  thinking?: boolean | undefined;
3639
4647
  } | {
3640
- text: string;
3641
4648
  t: "service";
4649
+ text: string;
3642
4650
  } | {
3643
4651
  t: "tool-call-start";
3644
4652
  call: string;
@@ -3665,8 +4673,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3665
4673
  t: "start";
3666
4674
  title?: string | undefined;
3667
4675
  } | {
3668
- status: "completed" | "failed" | "cancelled";
3669
4676
  t: "turn-end";
4677
+ status: "completed" | "failed" | "cancelled";
3670
4678
  model?: string | undefined;
3671
4679
  usage?: {
3672
4680
  input_tokens: number;
@@ -3686,20 +4694,53 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3686
4694
  cache_read_input_tokens?: number | undefined;
3687
4695
  };
3688
4696
  model?: string | undefined;
4697
+ durationMs?: number | undefined;
4698
+ } | {
4699
+ t: "task-start";
4700
+ description: string;
4701
+ taskId: string;
4702
+ toolUseId?: string | undefined;
4703
+ taskType?: string | undefined;
4704
+ } | {
4705
+ t: "task-progress";
4706
+ description: string;
4707
+ usage: {
4708
+ durationMs: number;
4709
+ totalTokens: number;
4710
+ toolUses: number;
4711
+ };
4712
+ taskId: string;
4713
+ lastToolName?: string | undefined;
4714
+ } | {
4715
+ t: "task-end";
4716
+ status: "completed" | "failed" | "stopped";
4717
+ taskId: string;
4718
+ summary: string;
4719
+ usage?: {
4720
+ durationMs: number;
4721
+ totalTokens: number;
4722
+ toolUses: number;
4723
+ } | undefined;
4724
+ } | {
4725
+ t: "tool-progress";
4726
+ toolUseId: string;
4727
+ toolName: string;
4728
+ elapsedSeconds: number;
4729
+ taskId?: string | undefined;
3689
4730
  };
3690
4731
  turn?: string | undefined;
3691
4732
  subagent?: string | undefined;
3692
4733
  }>, {
3693
- role: "user" | "agent";
3694
4734
  id: string;
4735
+ role: "user" | "agent";
3695
4736
  time: number;
3696
4737
  ev: {
3697
- text: string;
3698
4738
  t: "text";
4739
+ text: string;
3699
4740
  thinking?: boolean | undefined;
3700
4741
  } | {
3701
- text: string;
3702
4742
  t: "service";
4743
+ text: string;
3703
4744
  } | {
3704
4745
  t: "tool-call-start";
3705
4746
  call: string;
@@ -3726,8 +4767,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3726
4767
  t: "start";
3727
4768
  title?: string | undefined;
3728
4769
  } | {
3729
- status: "completed" | "failed" | "cancelled";
3730
4770
  t: "turn-end";
4771
+ status: "completed" | "failed" | "cancelled";
3731
4772
  model?: string | undefined;
3732
4773
  usage?: {
3733
4774
  input_tokens: number;
@@ -3747,20 +4788,53 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3747
4788
  cache_read_input_tokens?: number | undefined;
3748
4789
  };
3749
4790
  model?: string | undefined;
4791
+ durationMs?: number | undefined;
4792
+ } | {
4793
+ t: "task-start";
4794
+ description: string;
4795
+ taskId: string;
4796
+ toolUseId?: string | undefined;
4797
+ taskType?: string | undefined;
4798
+ } | {
4799
+ t: "task-progress";
4800
+ description: string;
4801
+ usage: {
4802
+ durationMs: number;
4803
+ totalTokens: number;
4804
+ toolUses: number;
4805
+ };
4806
+ taskId: string;
4807
+ lastToolName?: string | undefined;
4808
+ } | {
4809
+ t: "task-end";
4810
+ status: "completed" | "failed" | "stopped";
4811
+ taskId: string;
4812
+ summary: string;
4813
+ usage?: {
4814
+ durationMs: number;
4815
+ totalTokens: number;
4816
+ toolUses: number;
4817
+ } | undefined;
4818
+ } | {
4819
+ t: "tool-progress";
4820
+ toolUseId: string;
4821
+ toolName: string;
4822
+ elapsedSeconds: number;
4823
+ taskId?: string | undefined;
3750
4824
  };
3751
4825
  turn?: string | undefined;
3752
4826
  subagent?: string | undefined;
3753
4827
  }, {
3754
- role: "user" | "agent";
3755
4828
  id: string;
4829
+ role: "user" | "agent";
3756
4830
  time: number;
3757
4831
  ev: {
3758
- text: string;
3759
4832
  t: "text";
4833
+ text: string;
3760
4834
  thinking?: boolean | undefined;
3761
4835
  } | {
3762
- text: string;
3763
4836
  t: "service";
4837
+ text: string;
3764
4838
  } | {
3765
4839
  t: "tool-call-start";
3766
4840
  call: string;
@@ -3787,8 +4861,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3787
4861
  t: "start";
3788
4862
  title?: string | undefined;
3789
4863
  } | {
3790
- status: "completed" | "failed" | "cancelled";
3791
4864
  t: "turn-end";
4865
+ status: "completed" | "failed" | "cancelled";
3792
4866
  model?: string | undefined;
3793
4867
  usage?: {
3794
4868
  input_tokens: number;
@@ -3808,6 +4882,39 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3808
4882
  cache_read_input_tokens?: number | undefined;
3809
4883
  };
3810
4884
  model?: string | undefined;
4885
+ durationMs?: number | undefined;
4886
+ } | {
4887
+ t: "task-start";
4888
+ description: string;
4889
+ taskId: string;
4890
+ toolUseId?: string | undefined;
4891
+ taskType?: string | undefined;
4892
+ } | {
4893
+ t: "task-progress";
4894
+ description: string;
4895
+ usage: {
4896
+ durationMs: number;
4897
+ totalTokens: number;
4898
+ toolUses: number;
4899
+ };
4900
+ taskId: string;
4901
+ lastToolName?: string | undefined;
4902
+ } | {
4903
+ t: "task-end";
4904
+ status: "completed" | "failed" | "stopped";
4905
+ taskId: string;
4906
+ summary: string;
4907
+ usage?: {
4908
+ durationMs: number;
4909
+ totalTokens: number;
4910
+ toolUses: number;
4911
+ } | undefined;
4912
+ } | {
4913
+ t: "tool-progress";
4914
+ toolUseId: string;
4915
+ toolName: string;
4916
+ elapsedSeconds: number;
4917
+ taskId?: string | undefined;
3811
4918
  };
3812
4919
  turn?: string | undefined;
3813
4920
  subagent?: string | undefined;
@@ -3821,5 +4928,5 @@ type CreateEnvelopeOptions = {
3821
4928
  };
3822
4929
  declare function createEnvelope(role: SessionRole, ev: SessionEvent, opts?: CreateEnvelopeOptions): SessionEnvelope;
3823
4930
 
3824
- export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, LegacyMessageContentSchema, MessageContentSchema, MessageMetaSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, UpdateBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, createEnvelope, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
4931
+ export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, LegacyMessageContentSchema, MessageContentSchema, MessageMetaSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, UpdateBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, createEnvelope, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTaskEndEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema };
3825
4932
  export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, LegacyMessageContent, MessageContent, MessageMeta, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, Update, UpdateBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue };