@kmmao/happy-wire 0.2.1 → 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.mts 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;
@@ -284,18 +284,130 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
284
284
  };
285
285
  model?: string | undefined;
286
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;
287
399
  }>]>;
288
400
  }, "strip", z.ZodTypeAny, {
289
- role: "user" | "agent";
290
401
  id: string;
402
+ role: "user" | "agent";
291
403
  time: number;
292
404
  ev: {
293
- text: string;
294
405
  t: "text";
406
+ text: string;
295
407
  thinking?: boolean | undefined;
296
408
  } | {
297
- text: string;
298
409
  t: "service";
410
+ text: string;
299
411
  } | {
300
412
  t: "tool-call-start";
301
413
  call: string;
@@ -322,8 +434,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
322
434
  t: "start";
323
435
  title?: string | undefined;
324
436
  } | {
325
- status: "completed" | "failed" | "cancelled";
326
437
  t: "turn-end";
438
+ status: "completed" | "failed" | "cancelled";
327
439
  model?: string | undefined;
328
440
  usage?: {
329
441
  input_tokens: number;
@@ -344,20 +456,52 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
344
456
  };
345
457
  model?: string | undefined;
346
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;
347
491
  };
348
492
  turn?: string | undefined;
349
493
  subagent?: string | undefined;
350
494
  }, {
351
- role: "user" | "agent";
352
495
  id: string;
496
+ role: "user" | "agent";
353
497
  time: number;
354
498
  ev: {
355
- text: string;
356
499
  t: "text";
500
+ text: string;
357
501
  thinking?: boolean | undefined;
358
502
  } | {
359
- text: string;
360
503
  t: "service";
504
+ text: string;
361
505
  } | {
362
506
  t: "tool-call-start";
363
507
  call: string;
@@ -384,8 +528,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
384
528
  t: "start";
385
529
  title?: string | undefined;
386
530
  } | {
387
- status: "completed" | "failed" | "cancelled";
388
531
  t: "turn-end";
532
+ status: "completed" | "failed" | "cancelled";
389
533
  model?: string | undefined;
390
534
  usage?: {
391
535
  input_tokens: number;
@@ -406,20 +550,52 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
406
550
  };
407
551
  model?: string | undefined;
408
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;
409
585
  };
410
586
  turn?: string | undefined;
411
587
  subagent?: string | undefined;
412
588
  }>, {
413
- role: "user" | "agent";
414
589
  id: string;
590
+ role: "user" | "agent";
415
591
  time: number;
416
592
  ev: {
417
- text: string;
418
593
  t: "text";
594
+ text: string;
419
595
  thinking?: boolean | undefined;
420
596
  } | {
421
- text: string;
422
597
  t: "service";
598
+ text: string;
423
599
  } | {
424
600
  t: "tool-call-start";
425
601
  call: string;
@@ -446,8 +622,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
446
622
  t: "start";
447
623
  title?: string | undefined;
448
624
  } | {
449
- status: "completed" | "failed" | "cancelled";
450
625
  t: "turn-end";
626
+ status: "completed" | "failed" | "cancelled";
451
627
  model?: string | undefined;
452
628
  usage?: {
453
629
  input_tokens: number;
@@ -468,20 +644,52 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
468
644
  };
469
645
  model?: string | undefined;
470
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;
471
679
  };
472
680
  turn?: string | undefined;
473
681
  subagent?: string | undefined;
474
682
  }, {
475
- role: "user" | "agent";
476
683
  id: string;
684
+ role: "user" | "agent";
477
685
  time: number;
478
686
  ev: {
479
- text: string;
480
687
  t: "text";
688
+ text: string;
481
689
  thinking?: boolean | undefined;
482
690
  } | {
483
- text: string;
484
691
  t: "service";
692
+ text: string;
485
693
  } | {
486
694
  t: "tool-call-start";
487
695
  call: string;
@@ -508,8 +716,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
508
716
  t: "start";
509
717
  title?: string | undefined;
510
718
  } | {
511
- status: "completed" | "failed" | "cancelled";
512
719
  t: "turn-end";
720
+ status: "completed" | "failed" | "cancelled";
513
721
  model?: string | undefined;
514
722
  usage?: {
515
723
  input_tokens: number;
@@ -530,6 +738,38 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
530
738
  };
531
739
  model?: string | undefined;
532
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;
533
773
  };
534
774
  turn?: string | undefined;
535
775
  subagent?: string | undefined;
@@ -545,9 +785,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
545
785
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
546
786
  displayText: z.ZodOptional<z.ZodString>;
547
787
  }, "strip", z.ZodTypeAny, {
788
+ model?: string | null | undefined;
548
789
  sentFrom?: string | undefined;
549
790
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
550
- model?: string | null | undefined;
551
791
  fallbackModel?: string | null | undefined;
552
792
  customSystemPrompt?: string | null | undefined;
553
793
  appendSystemPrompt?: string | null | undefined;
@@ -555,9 +795,9 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
555
795
  disallowedTools?: string[] | null | undefined;
556
796
  displayText?: string | undefined;
557
797
  }, {
798
+ model?: string | null | undefined;
558
799
  sentFrom?: string | undefined;
559
800
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
560
- model?: string | null | undefined;
561
801
  fallbackModel?: string | null | undefined;
562
802
  customSystemPrompt?: string | null | undefined;
563
803
  appendSystemPrompt?: string | null | undefined;
@@ -566,18 +806,17 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
566
806
  displayText?: string | undefined;
567
807
  }>>;
568
808
  }, "strip", z.ZodTypeAny, {
569
- role: "session";
570
809
  content: {
571
- role: "user" | "agent";
572
810
  id: string;
811
+ role: "user" | "agent";
573
812
  time: number;
574
813
  ev: {
575
- text: string;
576
814
  t: "text";
815
+ text: string;
577
816
  thinking?: boolean | undefined;
578
817
  } | {
579
- text: string;
580
818
  t: "service";
819
+ text: string;
581
820
  } | {
582
821
  t: "tool-call-start";
583
822
  call: string;
@@ -604,8 +843,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
604
843
  t: "start";
605
844
  title?: string | undefined;
606
845
  } | {
607
- status: "completed" | "failed" | "cancelled";
608
846
  t: "turn-end";
847
+ status: "completed" | "failed" | "cancelled";
609
848
  model?: string | undefined;
610
849
  usage?: {
611
850
  input_tokens: number;
@@ -626,14 +865,47 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
626
865
  };
627
866
  model?: string | undefined;
628
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;
629
900
  };
630
901
  turn?: string | undefined;
631
902
  subagent?: string | undefined;
632
903
  };
904
+ role: "session";
633
905
  meta?: {
906
+ model?: string | null | undefined;
634
907
  sentFrom?: string | undefined;
635
908
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
636
- model?: string | null | undefined;
637
909
  fallbackModel?: string | null | undefined;
638
910
  customSystemPrompt?: string | null | undefined;
639
911
  appendSystemPrompt?: string | null | undefined;
@@ -642,18 +914,17 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
642
914
  displayText?: string | undefined;
643
915
  } | undefined;
644
916
  }, {
645
- role: "session";
646
917
  content: {
647
- role: "user" | "agent";
648
918
  id: string;
919
+ role: "user" | "agent";
649
920
  time: number;
650
921
  ev: {
651
- text: string;
652
922
  t: "text";
923
+ text: string;
653
924
  thinking?: boolean | undefined;
654
925
  } | {
655
- text: string;
656
926
  t: "service";
927
+ text: string;
657
928
  } | {
658
929
  t: "tool-call-start";
659
930
  call: string;
@@ -680,8 +951,8 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
680
951
  t: "start";
681
952
  title?: string | undefined;
682
953
  } | {
683
- status: "completed" | "failed" | "cancelled";
684
954
  t: "turn-end";
955
+ status: "completed" | "failed" | "cancelled";
685
956
  model?: string | undefined;
686
957
  usage?: {
687
958
  input_tokens: number;
@@ -702,14 +973,47 @@ declare const SessionProtocolMessageSchema: z.ZodObject<{
702
973
  };
703
974
  model?: string | undefined;
704
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;
705
1008
  };
706
1009
  turn?: string | undefined;
707
1010
  subagent?: string | undefined;
708
1011
  };
1012
+ role: "session";
709
1013
  meta?: {
1014
+ model?: string | null | undefined;
710
1015
  sentFrom?: string | undefined;
711
1016
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
712
- model?: string | null | undefined;
713
1017
  fallbackModel?: string | null | undefined;
714
1018
  customSystemPrompt?: string | null | undefined;
715
1019
  appendSystemPrompt?: string | null | undefined;
@@ -743,9 +1047,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
743
1047
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
744
1048
  displayText: z.ZodOptional<z.ZodString>;
745
1049
  }, "strip", z.ZodTypeAny, {
1050
+ model?: string | null | undefined;
746
1051
  sentFrom?: string | undefined;
747
1052
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
748
- model?: string | null | undefined;
749
1053
  fallbackModel?: string | null | undefined;
750
1054
  customSystemPrompt?: string | null | undefined;
751
1055
  appendSystemPrompt?: string | null | undefined;
@@ -753,9 +1057,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
753
1057
  disallowedTools?: string[] | null | undefined;
754
1058
  displayText?: string | undefined;
755
1059
  }, {
1060
+ model?: string | null | undefined;
756
1061
  sentFrom?: string | undefined;
757
1062
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
758
- model?: string | null | undefined;
759
1063
  fallbackModel?: string | null | undefined;
760
1064
  customSystemPrompt?: string | null | undefined;
761
1065
  appendSystemPrompt?: string | null | undefined;
@@ -764,16 +1068,15 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
764
1068
  displayText?: string | undefined;
765
1069
  }>>;
766
1070
  }, "strip", z.ZodTypeAny, {
767
- role: "user";
768
1071
  content: {
769
1072
  type: "text";
770
1073
  text: string;
771
1074
  };
772
- localKey?: string | undefined;
1075
+ role: "user";
773
1076
  meta?: {
1077
+ model?: string | null | undefined;
774
1078
  sentFrom?: string | undefined;
775
1079
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
776
- model?: string | null | undefined;
777
1080
  fallbackModel?: string | null | undefined;
778
1081
  customSystemPrompt?: string | null | undefined;
779
1082
  appendSystemPrompt?: string | null | undefined;
@@ -781,17 +1084,17 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
781
1084
  disallowedTools?: string[] | null | undefined;
782
1085
  displayText?: string | undefined;
783
1086
  } | undefined;
1087
+ localKey?: string | undefined;
784
1088
  }, {
785
- role: "user";
786
1089
  content: {
787
1090
  type: "text";
788
1091
  text: string;
789
1092
  };
790
- localKey?: string | undefined;
1093
+ role: "user";
791
1094
  meta?: {
1095
+ model?: string | null | undefined;
792
1096
  sentFrom?: string | undefined;
793
1097
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
794
- model?: string | null | undefined;
795
1098
  fallbackModel?: string | null | undefined;
796
1099
  customSystemPrompt?: string | null | undefined;
797
1100
  appendSystemPrompt?: string | null | undefined;
@@ -799,6 +1102,7 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
799
1102
  disallowedTools?: string[] | null | undefined;
800
1103
  displayText?: string | undefined;
801
1104
  } | undefined;
1105
+ localKey?: string | undefined;
802
1106
  }>, z.ZodObject<{
803
1107
  role: z.ZodLiteral<"agent">;
804
1108
  content: z.ZodObject<{
@@ -819,9 +1123,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
819
1123
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
820
1124
  displayText: z.ZodOptional<z.ZodString>;
821
1125
  }, "strip", z.ZodTypeAny, {
1126
+ model?: string | null | undefined;
822
1127
  sentFrom?: string | undefined;
823
1128
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
824
- model?: string | null | undefined;
825
1129
  fallbackModel?: string | null | undefined;
826
1130
  customSystemPrompt?: string | null | undefined;
827
1131
  appendSystemPrompt?: string | null | undefined;
@@ -829,9 +1133,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
829
1133
  disallowedTools?: string[] | null | undefined;
830
1134
  displayText?: string | undefined;
831
1135
  }, {
1136
+ model?: string | null | undefined;
832
1137
  sentFrom?: string | undefined;
833
1138
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
834
- model?: string | null | undefined;
835
1139
  fallbackModel?: string | null | undefined;
836
1140
  customSystemPrompt?: string | null | undefined;
837
1141
  appendSystemPrompt?: string | null | undefined;
@@ -840,16 +1144,16 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
840
1144
  displayText?: string | undefined;
841
1145
  }>>;
842
1146
  }, "strip", z.ZodTypeAny, {
843
- role: "agent";
844
1147
  content: {
845
1148
  type: string;
846
1149
  } & {
847
1150
  [k: string]: unknown;
848
1151
  };
1152
+ role: "agent";
849
1153
  meta?: {
1154
+ model?: string | null | undefined;
850
1155
  sentFrom?: string | undefined;
851
1156
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
852
- model?: string | null | undefined;
853
1157
  fallbackModel?: string | null | undefined;
854
1158
  customSystemPrompt?: string | null | undefined;
855
1159
  appendSystemPrompt?: string | null | undefined;
@@ -858,16 +1162,16 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
858
1162
  displayText?: string | undefined;
859
1163
  } | undefined;
860
1164
  }, {
861
- role: "agent";
862
1165
  content: {
863
1166
  type: string;
864
1167
  } & {
865
1168
  [k: string]: unknown;
866
1169
  };
1170
+ role: "agent";
867
1171
  meta?: {
1172
+ model?: string | null | undefined;
868
1173
  sentFrom?: string | undefined;
869
1174
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
870
- model?: string | null | undefined;
871
1175
  fallbackModel?: string | null | undefined;
872
1176
  customSystemPrompt?: string | null | undefined;
873
1177
  appendSystemPrompt?: string | null | undefined;
@@ -888,22 +1192,22 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
888
1192
  text: z.ZodString;
889
1193
  thinking: z.ZodOptional<z.ZodBoolean>;
890
1194
  }, "strip", z.ZodTypeAny, {
891
- text: string;
892
1195
  t: "text";
1196
+ text: string;
893
1197
  thinking?: boolean | undefined;
894
1198
  }, {
895
- text: string;
896
1199
  t: "text";
1200
+ text: string;
897
1201
  thinking?: boolean | undefined;
898
1202
  }>, z.ZodObject<{
899
1203
  t: z.ZodLiteral<"service">;
900
1204
  text: z.ZodString;
901
1205
  }, "strip", z.ZodTypeAny, {
902
- text: string;
903
1206
  t: "service";
904
- }, {
905
1207
  text: string;
1208
+ }, {
906
1209
  t: "service";
1210
+ text: string;
907
1211
  }>, z.ZodObject<{
908
1212
  t: z.ZodLiteral<"tool-call-start">;
909
1213
  call: z.ZodString;
@@ -1009,8 +1313,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1009
1313
  }>>;
1010
1314
  durationMs: z.ZodOptional<z.ZodNumber>;
1011
1315
  }, "strip", z.ZodTypeAny, {
1012
- status: "completed" | "failed" | "cancelled";
1013
1316
  t: "turn-end";
1317
+ status: "completed" | "failed" | "cancelled";
1014
1318
  model?: string | undefined;
1015
1319
  usage?: {
1016
1320
  input_tokens: number;
@@ -1020,8 +1324,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1020
1324
  } | undefined;
1021
1325
  durationMs?: number | undefined;
1022
1326
  }, {
1023
- status: "completed" | "failed" | "cancelled";
1024
1327
  t: "turn-end";
1328
+ status: "completed" | "failed" | "cancelled";
1025
1329
  model?: string | undefined;
1026
1330
  usage?: {
1027
1331
  input_tokens: number;
@@ -1076,18 +1380,130 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1076
1380
  };
1077
1381
  model?: string | undefined;
1078
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";
1391
+ description: string;
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;
1079
1495
  }>]>;
1080
1496
  }, "strip", z.ZodTypeAny, {
1081
- role: "user" | "agent";
1082
1497
  id: string;
1498
+ role: "user" | "agent";
1083
1499
  time: number;
1084
1500
  ev: {
1085
- text: string;
1086
1501
  t: "text";
1502
+ text: string;
1087
1503
  thinking?: boolean | undefined;
1088
1504
  } | {
1089
- text: string;
1090
1505
  t: "service";
1506
+ text: string;
1091
1507
  } | {
1092
1508
  t: "tool-call-start";
1093
1509
  call: string;
@@ -1114,8 +1530,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1114
1530
  t: "start";
1115
1531
  title?: string | undefined;
1116
1532
  } | {
1117
- status: "completed" | "failed" | "cancelled";
1118
1533
  t: "turn-end";
1534
+ status: "completed" | "failed" | "cancelled";
1119
1535
  model?: string | undefined;
1120
1536
  usage?: {
1121
1537
  input_tokens: number;
@@ -1136,20 +1552,52 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1136
1552
  };
1137
1553
  model?: string | undefined;
1138
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;
1139
1587
  };
1140
1588
  turn?: string | undefined;
1141
1589
  subagent?: string | undefined;
1142
1590
  }, {
1143
- role: "user" | "agent";
1144
1591
  id: string;
1592
+ role: "user" | "agent";
1145
1593
  time: number;
1146
1594
  ev: {
1147
- text: string;
1148
1595
  t: "text";
1596
+ text: string;
1149
1597
  thinking?: boolean | undefined;
1150
1598
  } | {
1151
- text: string;
1152
1599
  t: "service";
1600
+ text: string;
1153
1601
  } | {
1154
1602
  t: "tool-call-start";
1155
1603
  call: string;
@@ -1176,8 +1624,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1176
1624
  t: "start";
1177
1625
  title?: string | undefined;
1178
1626
  } | {
1179
- status: "completed" | "failed" | "cancelled";
1180
1627
  t: "turn-end";
1628
+ status: "completed" | "failed" | "cancelled";
1181
1629
  model?: string | undefined;
1182
1630
  usage?: {
1183
1631
  input_tokens: number;
@@ -1198,20 +1646,52 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1198
1646
  };
1199
1647
  model?: string | undefined;
1200
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;
1201
1681
  };
1202
1682
  turn?: string | undefined;
1203
1683
  subagent?: string | undefined;
1204
1684
  }>, {
1205
- role: "user" | "agent";
1206
1685
  id: string;
1686
+ role: "user" | "agent";
1207
1687
  time: number;
1208
1688
  ev: {
1209
- text: string;
1210
1689
  t: "text";
1690
+ text: string;
1211
1691
  thinking?: boolean | undefined;
1212
1692
  } | {
1213
- text: string;
1214
1693
  t: "service";
1694
+ text: string;
1215
1695
  } | {
1216
1696
  t: "tool-call-start";
1217
1697
  call: string;
@@ -1238,8 +1718,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1238
1718
  t: "start";
1239
1719
  title?: string | undefined;
1240
1720
  } | {
1241
- status: "completed" | "failed" | "cancelled";
1242
1721
  t: "turn-end";
1722
+ status: "completed" | "failed" | "cancelled";
1243
1723
  model?: string | undefined;
1244
1724
  usage?: {
1245
1725
  input_tokens: number;
@@ -1260,20 +1740,52 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1260
1740
  };
1261
1741
  model?: string | undefined;
1262
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;
1263
1775
  };
1264
1776
  turn?: string | undefined;
1265
1777
  subagent?: string | undefined;
1266
1778
  }, {
1267
- role: "user" | "agent";
1268
1779
  id: string;
1780
+ role: "user" | "agent";
1269
1781
  time: number;
1270
1782
  ev: {
1271
- text: string;
1272
1783
  t: "text";
1784
+ text: string;
1273
1785
  thinking?: boolean | undefined;
1274
1786
  } | {
1275
- text: string;
1276
1787
  t: "service";
1788
+ text: string;
1277
1789
  } | {
1278
1790
  t: "tool-call-start";
1279
1791
  call: string;
@@ -1300,8 +1812,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1300
1812
  t: "start";
1301
1813
  title?: string | undefined;
1302
1814
  } | {
1303
- status: "completed" | "failed" | "cancelled";
1304
1815
  t: "turn-end";
1816
+ status: "completed" | "failed" | "cancelled";
1305
1817
  model?: string | undefined;
1306
1818
  usage?: {
1307
1819
  input_tokens: number;
@@ -1322,6 +1834,38 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1322
1834
  };
1323
1835
  model?: string | undefined;
1324
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;
1325
1869
  };
1326
1870
  turn?: string | undefined;
1327
1871
  subagent?: string | undefined;
@@ -1337,9 +1881,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1337
1881
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1338
1882
  displayText: z.ZodOptional<z.ZodString>;
1339
1883
  }, "strip", z.ZodTypeAny, {
1884
+ model?: string | null | undefined;
1340
1885
  sentFrom?: string | undefined;
1341
1886
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
1342
- model?: string | null | undefined;
1343
1887
  fallbackModel?: string | null | undefined;
1344
1888
  customSystemPrompt?: string | null | undefined;
1345
1889
  appendSystemPrompt?: string | null | undefined;
@@ -1347,9 +1891,9 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1347
1891
  disallowedTools?: string[] | null | undefined;
1348
1892
  displayText?: string | undefined;
1349
1893
  }, {
1894
+ model?: string | null | undefined;
1350
1895
  sentFrom?: string | undefined;
1351
1896
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
1352
- model?: string | null | undefined;
1353
1897
  fallbackModel?: string | null | undefined;
1354
1898
  customSystemPrompt?: string | null | undefined;
1355
1899
  appendSystemPrompt?: string | null | undefined;
@@ -1358,18 +1902,17 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1358
1902
  displayText?: string | undefined;
1359
1903
  }>>;
1360
1904
  }, "strip", z.ZodTypeAny, {
1361
- role: "session";
1362
1905
  content: {
1363
- role: "user" | "agent";
1364
1906
  id: string;
1907
+ role: "user" | "agent";
1365
1908
  time: number;
1366
1909
  ev: {
1367
- text: string;
1368
1910
  t: "text";
1911
+ text: string;
1369
1912
  thinking?: boolean | undefined;
1370
1913
  } | {
1371
- text: string;
1372
1914
  t: "service";
1915
+ text: string;
1373
1916
  } | {
1374
1917
  t: "tool-call-start";
1375
1918
  call: string;
@@ -1396,8 +1939,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1396
1939
  t: "start";
1397
1940
  title?: string | undefined;
1398
1941
  } | {
1399
- status: "completed" | "failed" | "cancelled";
1400
1942
  t: "turn-end";
1943
+ status: "completed" | "failed" | "cancelled";
1401
1944
  model?: string | undefined;
1402
1945
  usage?: {
1403
1946
  input_tokens: number;
@@ -1418,14 +1961,47 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1418
1961
  };
1419
1962
  model?: string | undefined;
1420
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;
1421
1996
  };
1422
1997
  turn?: string | undefined;
1423
1998
  subagent?: string | undefined;
1424
1999
  };
2000
+ role: "session";
1425
2001
  meta?: {
2002
+ model?: string | null | undefined;
1426
2003
  sentFrom?: string | undefined;
1427
2004
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
1428
- model?: string | null | undefined;
1429
2005
  fallbackModel?: string | null | undefined;
1430
2006
  customSystemPrompt?: string | null | undefined;
1431
2007
  appendSystemPrompt?: string | null | undefined;
@@ -1434,18 +2010,17 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1434
2010
  displayText?: string | undefined;
1435
2011
  } | undefined;
1436
2012
  }, {
1437
- role: "session";
1438
2013
  content: {
1439
- role: "user" | "agent";
1440
2014
  id: string;
2015
+ role: "user" | "agent";
1441
2016
  time: number;
1442
2017
  ev: {
1443
- text: string;
1444
2018
  t: "text";
2019
+ text: string;
1445
2020
  thinking?: boolean | undefined;
1446
2021
  } | {
1447
- text: string;
1448
2022
  t: "service";
2023
+ text: string;
1449
2024
  } | {
1450
2025
  t: "tool-call-start";
1451
2026
  call: string;
@@ -1472,8 +2047,8 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1472
2047
  t: "start";
1473
2048
  title?: string | undefined;
1474
2049
  } | {
1475
- status: "completed" | "failed" | "cancelled";
1476
2050
  t: "turn-end";
2051
+ status: "completed" | "failed" | "cancelled";
1477
2052
  model?: string | undefined;
1478
2053
  usage?: {
1479
2054
  input_tokens: number;
@@ -1494,14 +2069,47 @@ declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject
1494
2069
  };
1495
2070
  model?: string | undefined;
1496
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;
1497
2104
  };
1498
2105
  turn?: string | undefined;
1499
2106
  subagent?: string | undefined;
1500
2107
  };
2108
+ role: "session";
1501
2109
  meta?: {
2110
+ model?: string | null | undefined;
1502
2111
  sentFrom?: string | undefined;
1503
2112
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
1504
- model?: string | null | undefined;
1505
2113
  fallbackModel?: string | null | undefined;
1506
2114
  customSystemPrompt?: string | null | undefined;
1507
2115
  appendSystemPrompt?: string | null | undefined;
@@ -1553,53 +2161,53 @@ declare const UpdateNewMessageBodySchema: z.ZodObject<{
1553
2161
  createdAt: z.ZodNumber;
1554
2162
  updatedAt: z.ZodNumber;
1555
2163
  }, "strip", z.ZodTypeAny, {
2164
+ id: string;
2165
+ seq: number;
1556
2166
  content: {
1557
2167
  c: string;
1558
2168
  t: "encrypted";
1559
2169
  };
1560
- id: string;
1561
- seq: number;
1562
2170
  createdAt: number;
1563
2171
  updatedAt: number;
1564
2172
  localId?: string | null | undefined;
1565
2173
  }, {
2174
+ id: string;
2175
+ seq: number;
1566
2176
  content: {
1567
2177
  c: string;
1568
2178
  t: "encrypted";
1569
2179
  };
1570
- id: string;
1571
- seq: number;
1572
2180
  createdAt: number;
1573
2181
  updatedAt: number;
1574
2182
  localId?: string | null | undefined;
1575
2183
  }>;
1576
2184
  }, "strip", z.ZodTypeAny, {
2185
+ t: "new-message";
1577
2186
  message: {
2187
+ id: string;
2188
+ seq: number;
1578
2189
  content: {
1579
2190
  c: string;
1580
2191
  t: "encrypted";
1581
2192
  };
1582
- id: string;
1583
- seq: number;
1584
2193
  createdAt: number;
1585
2194
  updatedAt: number;
1586
2195
  localId?: string | null | undefined;
1587
2196
  };
1588
- t: "new-message";
1589
2197
  sid: string;
1590
2198
  }, {
2199
+ t: "new-message";
1591
2200
  message: {
2201
+ id: string;
2202
+ seq: number;
1592
2203
  content: {
1593
2204
  c: string;
1594
2205
  t: "encrypted";
1595
2206
  };
1596
- id: string;
1597
- seq: number;
1598
2207
  createdAt: number;
1599
2208
  updatedAt: number;
1600
2209
  localId?: string | null | undefined;
1601
2210
  };
1602
- t: "new-message";
1603
2211
  sid: string;
1604
2212
  }>;
1605
2213
  type UpdateNewMessageBody = z.infer<typeof UpdateNewMessageBodySchema>;
@@ -1734,53 +2342,53 @@ declare const CoreUpdateBodySchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
1734
2342
  createdAt: z.ZodNumber;
1735
2343
  updatedAt: z.ZodNumber;
1736
2344
  }, "strip", z.ZodTypeAny, {
2345
+ id: string;
2346
+ seq: number;
1737
2347
  content: {
1738
2348
  c: string;
1739
2349
  t: "encrypted";
1740
2350
  };
1741
- id: string;
1742
- seq: number;
1743
2351
  createdAt: number;
1744
2352
  updatedAt: number;
1745
2353
  localId?: string | null | undefined;
1746
2354
  }, {
2355
+ id: string;
2356
+ seq: number;
1747
2357
  content: {
1748
2358
  c: string;
1749
2359
  t: "encrypted";
1750
2360
  };
1751
- id: string;
1752
- seq: number;
1753
2361
  createdAt: number;
1754
2362
  updatedAt: number;
1755
2363
  localId?: string | null | undefined;
1756
2364
  }>;
1757
2365
  }, "strip", z.ZodTypeAny, {
2366
+ t: "new-message";
1758
2367
  message: {
2368
+ id: string;
2369
+ seq: number;
1759
2370
  content: {
1760
2371
  c: string;
1761
2372
  t: "encrypted";
1762
2373
  };
1763
- id: string;
1764
- seq: number;
1765
2374
  createdAt: number;
1766
2375
  updatedAt: number;
1767
2376
  localId?: string | null | undefined;
1768
2377
  };
1769
- t: "new-message";
1770
2378
  sid: string;
1771
2379
  }, {
2380
+ t: "new-message";
1772
2381
  message: {
2382
+ id: string;
2383
+ seq: number;
1773
2384
  content: {
1774
2385
  c: string;
1775
2386
  t: "encrypted";
1776
2387
  };
1777
- id: string;
1778
- seq: number;
1779
2388
  createdAt: number;
1780
2389
  updatedAt: number;
1781
2390
  localId?: string | null | undefined;
1782
2391
  };
1783
- t: "new-message";
1784
2392
  sid: string;
1785
2393
  }>, z.ZodObject<{
1786
2394
  t: z.ZodLiteral<"update-session">;
@@ -1903,53 +2511,53 @@ declare const CoreUpdateContainerSchema: z.ZodObject<{
1903
2511
  createdAt: z.ZodNumber;
1904
2512
  updatedAt: z.ZodNumber;
1905
2513
  }, "strip", z.ZodTypeAny, {
2514
+ id: string;
2515
+ seq: number;
1906
2516
  content: {
1907
2517
  c: string;
1908
2518
  t: "encrypted";
1909
2519
  };
1910
- id: string;
1911
- seq: number;
1912
2520
  createdAt: number;
1913
2521
  updatedAt: number;
1914
2522
  localId?: string | null | undefined;
1915
2523
  }, {
2524
+ id: string;
2525
+ seq: number;
1916
2526
  content: {
1917
2527
  c: string;
1918
2528
  t: "encrypted";
1919
2529
  };
1920
- id: string;
1921
- seq: number;
1922
2530
  createdAt: number;
1923
2531
  updatedAt: number;
1924
2532
  localId?: string | null | undefined;
1925
2533
  }>;
1926
2534
  }, "strip", z.ZodTypeAny, {
2535
+ t: "new-message";
1927
2536
  message: {
2537
+ id: string;
2538
+ seq: number;
1928
2539
  content: {
1929
2540
  c: string;
1930
2541
  t: "encrypted";
1931
2542
  };
1932
- id: string;
1933
- seq: number;
1934
2543
  createdAt: number;
1935
2544
  updatedAt: number;
1936
2545
  localId?: string | null | undefined;
1937
2546
  };
1938
- t: "new-message";
1939
2547
  sid: string;
1940
2548
  }, {
2549
+ t: "new-message";
1941
2550
  message: {
2551
+ id: string;
2552
+ seq: number;
1942
2553
  content: {
1943
2554
  c: string;
1944
2555
  t: "encrypted";
1945
2556
  };
1946
- id: string;
1947
- seq: number;
1948
2557
  createdAt: number;
1949
2558
  updatedAt: number;
1950
2559
  localId?: string | null | undefined;
1951
2560
  };
1952
- t: "new-message";
1953
2561
  sid: string;
1954
2562
  }>, z.ZodObject<{
1955
2563
  t: z.ZodLiteral<"update-session">;
@@ -2054,18 +2662,18 @@ declare const CoreUpdateContainerSchema: z.ZodObject<{
2054
2662
  seq: number;
2055
2663
  createdAt: number;
2056
2664
  body: {
2665
+ t: "new-message";
2057
2666
  message: {
2667
+ id: string;
2668
+ seq: number;
2058
2669
  content: {
2059
2670
  c: string;
2060
2671
  t: "encrypted";
2061
2672
  };
2062
- id: string;
2063
- seq: number;
2064
2673
  createdAt: number;
2065
2674
  updatedAt: number;
2066
2675
  localId?: string | null | undefined;
2067
2676
  };
2068
- t: "new-message";
2069
2677
  sid: string;
2070
2678
  } | {
2071
2679
  t: "update-session";
@@ -2097,18 +2705,18 @@ declare const CoreUpdateContainerSchema: z.ZodObject<{
2097
2705
  seq: number;
2098
2706
  createdAt: number;
2099
2707
  body: {
2708
+ t: "new-message";
2100
2709
  message: {
2710
+ id: string;
2711
+ seq: number;
2101
2712
  content: {
2102
2713
  c: string;
2103
2714
  t: "encrypted";
2104
2715
  };
2105
- id: string;
2106
- seq: number;
2107
2716
  createdAt: number;
2108
2717
  updatedAt: number;
2109
2718
  localId?: string | null | undefined;
2110
2719
  };
2111
- t: "new-message";
2112
2720
  sid: string;
2113
2721
  } | {
2114
2722
  t: "update-session";
@@ -2154,22 +2762,22 @@ declare const ApiMessageSchema: z.ZodObject<{
2154
2762
  createdAt: z.ZodNumber;
2155
2763
  updatedAt: z.ZodNumber;
2156
2764
  }, "strip", z.ZodTypeAny, {
2765
+ id: string;
2766
+ seq: number;
2157
2767
  content: {
2158
2768
  c: string;
2159
2769
  t: "encrypted";
2160
2770
  };
2161
- id: string;
2162
- seq: number;
2163
2771
  createdAt: number;
2164
2772
  updatedAt: number;
2165
2773
  localId?: string | null | undefined;
2166
2774
  }, {
2775
+ id: string;
2776
+ seq: number;
2167
2777
  content: {
2168
2778
  c: string;
2169
2779
  t: "encrypted";
2170
2780
  };
2171
- id: string;
2172
- seq: number;
2173
2781
  createdAt: number;
2174
2782
  updatedAt: number;
2175
2783
  localId?: string | null | undefined;
@@ -2195,53 +2803,53 @@ declare const ApiUpdateNewMessageSchema: z.ZodObject<{
2195
2803
  createdAt: z.ZodNumber;
2196
2804
  updatedAt: z.ZodNumber;
2197
2805
  }, "strip", z.ZodTypeAny, {
2806
+ id: string;
2807
+ seq: number;
2198
2808
  content: {
2199
2809
  c: string;
2200
2810
  t: "encrypted";
2201
2811
  };
2202
- id: string;
2203
- seq: number;
2204
2812
  createdAt: number;
2205
2813
  updatedAt: number;
2206
2814
  localId?: string | null | undefined;
2207
2815
  }, {
2816
+ id: string;
2817
+ seq: number;
2208
2818
  content: {
2209
2819
  c: string;
2210
2820
  t: "encrypted";
2211
2821
  };
2212
- id: string;
2213
- seq: number;
2214
2822
  createdAt: number;
2215
2823
  updatedAt: number;
2216
2824
  localId?: string | null | undefined;
2217
2825
  }>;
2218
2826
  }, "strip", z.ZodTypeAny, {
2827
+ t: "new-message";
2219
2828
  message: {
2829
+ id: string;
2830
+ seq: number;
2220
2831
  content: {
2221
2832
  c: string;
2222
2833
  t: "encrypted";
2223
2834
  };
2224
- id: string;
2225
- seq: number;
2226
2835
  createdAt: number;
2227
2836
  updatedAt: number;
2228
2837
  localId?: string | null | undefined;
2229
2838
  };
2230
- t: "new-message";
2231
2839
  sid: string;
2232
2840
  }, {
2841
+ t: "new-message";
2233
2842
  message: {
2843
+ id: string;
2844
+ seq: number;
2234
2845
  content: {
2235
2846
  c: string;
2236
2847
  t: "encrypted";
2237
2848
  };
2238
- id: string;
2239
- seq: number;
2240
2849
  createdAt: number;
2241
2850
  updatedAt: number;
2242
2851
  localId?: string | null | undefined;
2243
2852
  };
2244
- t: "new-message";
2245
2853
  sid: string;
2246
2854
  }>;
2247
2855
  type ApiUpdateNewMessage = UpdateNewMessageBody;
@@ -2365,53 +2973,53 @@ declare const UpdateBodySchema: z.ZodObject<{
2365
2973
  createdAt: z.ZodNumber;
2366
2974
  updatedAt: z.ZodNumber;
2367
2975
  }, "strip", z.ZodTypeAny, {
2976
+ id: string;
2977
+ seq: number;
2368
2978
  content: {
2369
2979
  c: string;
2370
2980
  t: "encrypted";
2371
2981
  };
2372
- id: string;
2373
- seq: number;
2374
2982
  createdAt: number;
2375
2983
  updatedAt: number;
2376
2984
  localId?: string | null | undefined;
2377
2985
  }, {
2986
+ id: string;
2987
+ seq: number;
2378
2988
  content: {
2379
2989
  c: string;
2380
2990
  t: "encrypted";
2381
2991
  };
2382
- id: string;
2383
- seq: number;
2384
2992
  createdAt: number;
2385
2993
  updatedAt: number;
2386
2994
  localId?: string | null | undefined;
2387
2995
  }>;
2388
2996
  }, "strip", z.ZodTypeAny, {
2997
+ t: "new-message";
2389
2998
  message: {
2999
+ id: string;
3000
+ seq: number;
2390
3001
  content: {
2391
3002
  c: string;
2392
3003
  t: "encrypted";
2393
3004
  };
2394
- id: string;
2395
- seq: number;
2396
3005
  createdAt: number;
2397
3006
  updatedAt: number;
2398
3007
  localId?: string | null | undefined;
2399
3008
  };
2400
- t: "new-message";
2401
3009
  sid: string;
2402
3010
  }, {
3011
+ t: "new-message";
2403
3012
  message: {
3013
+ id: string;
3014
+ seq: number;
2404
3015
  content: {
2405
3016
  c: string;
2406
3017
  t: "encrypted";
2407
3018
  };
2408
- id: string;
2409
- seq: number;
2410
3019
  createdAt: number;
2411
3020
  updatedAt: number;
2412
3021
  localId?: string | null | undefined;
2413
3022
  };
2414
- t: "new-message";
2415
3023
  sid: string;
2416
3024
  }>;
2417
3025
  type UpdateBody = UpdateNewMessageBody;
@@ -2438,53 +3046,53 @@ declare const UpdateSchema: z.ZodObject<{
2438
3046
  createdAt: z.ZodNumber;
2439
3047
  updatedAt: z.ZodNumber;
2440
3048
  }, "strip", z.ZodTypeAny, {
3049
+ id: string;
3050
+ seq: number;
2441
3051
  content: {
2442
3052
  c: string;
2443
3053
  t: "encrypted";
2444
3054
  };
2445
- id: string;
2446
- seq: number;
2447
3055
  createdAt: number;
2448
3056
  updatedAt: number;
2449
3057
  localId?: string | null | undefined;
2450
3058
  }, {
3059
+ id: string;
3060
+ seq: number;
2451
3061
  content: {
2452
3062
  c: string;
2453
3063
  t: "encrypted";
2454
3064
  };
2455
- id: string;
2456
- seq: number;
2457
3065
  createdAt: number;
2458
3066
  updatedAt: number;
2459
3067
  localId?: string | null | undefined;
2460
3068
  }>;
2461
3069
  }, "strip", z.ZodTypeAny, {
3070
+ t: "new-message";
2462
3071
  message: {
3072
+ id: string;
3073
+ seq: number;
2463
3074
  content: {
2464
3075
  c: string;
2465
3076
  t: "encrypted";
2466
3077
  };
2467
- id: string;
2468
- seq: number;
2469
3078
  createdAt: number;
2470
3079
  updatedAt: number;
2471
3080
  localId?: string | null | undefined;
2472
3081
  };
2473
- t: "new-message";
2474
3082
  sid: string;
2475
3083
  }, {
3084
+ t: "new-message";
2476
3085
  message: {
3086
+ id: string;
3087
+ seq: number;
2477
3088
  content: {
2478
3089
  c: string;
2479
3090
  t: "encrypted";
2480
3091
  };
2481
- id: string;
2482
- seq: number;
2483
3092
  createdAt: number;
2484
3093
  updatedAt: number;
2485
3094
  localId?: string | null | undefined;
2486
3095
  };
2487
- t: "new-message";
2488
3096
  sid: string;
2489
3097
  }>, z.ZodObject<{
2490
3098
  t: z.ZodLiteral<"update-session">;
@@ -2589,18 +3197,18 @@ declare const UpdateSchema: z.ZodObject<{
2589
3197
  seq: number;
2590
3198
  createdAt: number;
2591
3199
  body: {
3200
+ t: "new-message";
2592
3201
  message: {
3202
+ id: string;
3203
+ seq: number;
2593
3204
  content: {
2594
3205
  c: string;
2595
3206
  t: "encrypted";
2596
3207
  };
2597
- id: string;
2598
- seq: number;
2599
3208
  createdAt: number;
2600
3209
  updatedAt: number;
2601
3210
  localId?: string | null | undefined;
2602
3211
  };
2603
- t: "new-message";
2604
3212
  sid: string;
2605
3213
  } | {
2606
3214
  t: "update-session";
@@ -2632,18 +3240,18 @@ declare const UpdateSchema: z.ZodObject<{
2632
3240
  seq: number;
2633
3241
  createdAt: number;
2634
3242
  body: {
3243
+ t: "new-message";
2635
3244
  message: {
3245
+ id: string;
3246
+ seq: number;
2636
3247
  content: {
2637
3248
  c: string;
2638
3249
  t: "encrypted";
2639
3250
  };
2640
- id: string;
2641
- seq: number;
2642
3251
  createdAt: number;
2643
3252
  updatedAt: number;
2644
3253
  localId?: string | null | undefined;
2645
3254
  };
2646
- t: "new-message";
2647
3255
  sid: string;
2648
3256
  } | {
2649
3257
  t: "update-session";
@@ -2697,9 +3305,9 @@ declare const UserMessageSchema: z.ZodObject<{
2697
3305
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2698
3306
  displayText: z.ZodOptional<z.ZodString>;
2699
3307
  }, "strip", z.ZodTypeAny, {
3308
+ model?: string | null | undefined;
2700
3309
  sentFrom?: string | undefined;
2701
3310
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2702
- model?: string | null | undefined;
2703
3311
  fallbackModel?: string | null | undefined;
2704
3312
  customSystemPrompt?: string | null | undefined;
2705
3313
  appendSystemPrompt?: string | null | undefined;
@@ -2707,9 +3315,9 @@ declare const UserMessageSchema: z.ZodObject<{
2707
3315
  disallowedTools?: string[] | null | undefined;
2708
3316
  displayText?: string | undefined;
2709
3317
  }, {
3318
+ model?: string | null | undefined;
2710
3319
  sentFrom?: string | undefined;
2711
3320
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2712
- model?: string | null | undefined;
2713
3321
  fallbackModel?: string | null | undefined;
2714
3322
  customSystemPrompt?: string | null | undefined;
2715
3323
  appendSystemPrompt?: string | null | undefined;
@@ -2718,16 +3326,15 @@ declare const UserMessageSchema: z.ZodObject<{
2718
3326
  displayText?: string | undefined;
2719
3327
  }>>;
2720
3328
  }, "strip", z.ZodTypeAny, {
2721
- role: "user";
2722
3329
  content: {
2723
3330
  type: "text";
2724
3331
  text: string;
2725
3332
  };
2726
- localKey?: string | undefined;
3333
+ role: "user";
2727
3334
  meta?: {
3335
+ model?: string | null | undefined;
2728
3336
  sentFrom?: string | undefined;
2729
3337
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2730
- model?: string | null | undefined;
2731
3338
  fallbackModel?: string | null | undefined;
2732
3339
  customSystemPrompt?: string | null | undefined;
2733
3340
  appendSystemPrompt?: string | null | undefined;
@@ -2735,17 +3342,17 @@ declare const UserMessageSchema: z.ZodObject<{
2735
3342
  disallowedTools?: string[] | null | undefined;
2736
3343
  displayText?: string | undefined;
2737
3344
  } | undefined;
3345
+ localKey?: string | undefined;
2738
3346
  }, {
2739
- role: "user";
2740
3347
  content: {
2741
3348
  type: "text";
2742
3349
  text: string;
2743
3350
  };
2744
- localKey?: string | undefined;
3351
+ role: "user";
2745
3352
  meta?: {
3353
+ model?: string | null | undefined;
2746
3354
  sentFrom?: string | undefined;
2747
3355
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2748
- model?: string | null | undefined;
2749
3356
  fallbackModel?: string | null | undefined;
2750
3357
  customSystemPrompt?: string | null | undefined;
2751
3358
  appendSystemPrompt?: string | null | undefined;
@@ -2753,6 +3360,7 @@ declare const UserMessageSchema: z.ZodObject<{
2753
3360
  disallowedTools?: string[] | null | undefined;
2754
3361
  displayText?: string | undefined;
2755
3362
  } | undefined;
3363
+ localKey?: string | undefined;
2756
3364
  }>;
2757
3365
  type UserMessage = z.infer<typeof UserMessageSchema>;
2758
3366
  declare const AgentMessageSchema: z.ZodObject<{
@@ -2775,9 +3383,9 @@ declare const AgentMessageSchema: z.ZodObject<{
2775
3383
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2776
3384
  displayText: z.ZodOptional<z.ZodString>;
2777
3385
  }, "strip", z.ZodTypeAny, {
3386
+ model?: string | null | undefined;
2778
3387
  sentFrom?: string | undefined;
2779
3388
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2780
- model?: string | null | undefined;
2781
3389
  fallbackModel?: string | null | undefined;
2782
3390
  customSystemPrompt?: string | null | undefined;
2783
3391
  appendSystemPrompt?: string | null | undefined;
@@ -2785,9 +3393,9 @@ declare const AgentMessageSchema: z.ZodObject<{
2785
3393
  disallowedTools?: string[] | null | undefined;
2786
3394
  displayText?: string | undefined;
2787
3395
  }, {
3396
+ model?: string | null | undefined;
2788
3397
  sentFrom?: string | undefined;
2789
3398
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2790
- model?: string | null | undefined;
2791
3399
  fallbackModel?: string | null | undefined;
2792
3400
  customSystemPrompt?: string | null | undefined;
2793
3401
  appendSystemPrompt?: string | null | undefined;
@@ -2796,16 +3404,16 @@ declare const AgentMessageSchema: z.ZodObject<{
2796
3404
  displayText?: string | undefined;
2797
3405
  }>>;
2798
3406
  }, "strip", z.ZodTypeAny, {
2799
- role: "agent";
2800
3407
  content: {
2801
3408
  type: string;
2802
3409
  } & {
2803
3410
  [k: string]: unknown;
2804
3411
  };
3412
+ role: "agent";
2805
3413
  meta?: {
3414
+ model?: string | null | undefined;
2806
3415
  sentFrom?: string | undefined;
2807
3416
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2808
- model?: string | null | undefined;
2809
3417
  fallbackModel?: string | null | undefined;
2810
3418
  customSystemPrompt?: string | null | undefined;
2811
3419
  appendSystemPrompt?: string | null | undefined;
@@ -2814,16 +3422,16 @@ declare const AgentMessageSchema: z.ZodObject<{
2814
3422
  displayText?: string | undefined;
2815
3423
  } | undefined;
2816
3424
  }, {
2817
- role: "agent";
2818
3425
  content: {
2819
3426
  type: string;
2820
3427
  } & {
2821
3428
  [k: string]: unknown;
2822
3429
  };
3430
+ role: "agent";
2823
3431
  meta?: {
3432
+ model?: string | null | undefined;
2824
3433
  sentFrom?: string | undefined;
2825
3434
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2826
- model?: string | null | undefined;
2827
3435
  fallbackModel?: string | null | undefined;
2828
3436
  customSystemPrompt?: string | null | undefined;
2829
3437
  appendSystemPrompt?: string | null | undefined;
@@ -2857,9 +3465,9 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2857
3465
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2858
3466
  displayText: z.ZodOptional<z.ZodString>;
2859
3467
  }, "strip", z.ZodTypeAny, {
3468
+ model?: string | null | undefined;
2860
3469
  sentFrom?: string | undefined;
2861
3470
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2862
- model?: string | null | undefined;
2863
3471
  fallbackModel?: string | null | undefined;
2864
3472
  customSystemPrompt?: string | null | undefined;
2865
3473
  appendSystemPrompt?: string | null | undefined;
@@ -2867,9 +3475,9 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2867
3475
  disallowedTools?: string[] | null | undefined;
2868
3476
  displayText?: string | undefined;
2869
3477
  }, {
3478
+ model?: string | null | undefined;
2870
3479
  sentFrom?: string | undefined;
2871
3480
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2872
- model?: string | null | undefined;
2873
3481
  fallbackModel?: string | null | undefined;
2874
3482
  customSystemPrompt?: string | null | undefined;
2875
3483
  appendSystemPrompt?: string | null | undefined;
@@ -2878,16 +3486,15 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2878
3486
  displayText?: string | undefined;
2879
3487
  }>>;
2880
3488
  }, "strip", z.ZodTypeAny, {
2881
- role: "user";
2882
3489
  content: {
2883
3490
  type: "text";
2884
3491
  text: string;
2885
3492
  };
2886
- localKey?: string | undefined;
3493
+ role: "user";
2887
3494
  meta?: {
3495
+ model?: string | null | undefined;
2888
3496
  sentFrom?: string | undefined;
2889
3497
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2890
- model?: string | null | undefined;
2891
3498
  fallbackModel?: string | null | undefined;
2892
3499
  customSystemPrompt?: string | null | undefined;
2893
3500
  appendSystemPrompt?: string | null | undefined;
@@ -2895,17 +3502,17 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2895
3502
  disallowedTools?: string[] | null | undefined;
2896
3503
  displayText?: string | undefined;
2897
3504
  } | undefined;
3505
+ localKey?: string | undefined;
2898
3506
  }, {
2899
- role: "user";
2900
3507
  content: {
2901
3508
  type: "text";
2902
3509
  text: string;
2903
3510
  };
2904
- localKey?: string | undefined;
3511
+ role: "user";
2905
3512
  meta?: {
3513
+ model?: string | null | undefined;
2906
3514
  sentFrom?: string | undefined;
2907
3515
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2908
- model?: string | null | undefined;
2909
3516
  fallbackModel?: string | null | undefined;
2910
3517
  customSystemPrompt?: string | null | undefined;
2911
3518
  appendSystemPrompt?: string | null | undefined;
@@ -2913,6 +3520,7 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2913
3520
  disallowedTools?: string[] | null | undefined;
2914
3521
  displayText?: string | undefined;
2915
3522
  } | undefined;
3523
+ localKey?: string | undefined;
2916
3524
  }>, z.ZodObject<{
2917
3525
  role: z.ZodLiteral<"agent">;
2918
3526
  content: z.ZodObject<{
@@ -2933,9 +3541,9 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2933
3541
  disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
2934
3542
  displayText: z.ZodOptional<z.ZodString>;
2935
3543
  }, "strip", z.ZodTypeAny, {
3544
+ model?: string | null | undefined;
2936
3545
  sentFrom?: string | undefined;
2937
3546
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2938
- model?: string | null | undefined;
2939
3547
  fallbackModel?: string | null | undefined;
2940
3548
  customSystemPrompt?: string | null | undefined;
2941
3549
  appendSystemPrompt?: string | null | undefined;
@@ -2943,9 +3551,9 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2943
3551
  disallowedTools?: string[] | null | undefined;
2944
3552
  displayText?: string | undefined;
2945
3553
  }, {
3554
+ model?: string | null | undefined;
2946
3555
  sentFrom?: string | undefined;
2947
3556
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2948
- model?: string | null | undefined;
2949
3557
  fallbackModel?: string | null | undefined;
2950
3558
  customSystemPrompt?: string | null | undefined;
2951
3559
  appendSystemPrompt?: string | null | undefined;
@@ -2954,16 +3562,16 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2954
3562
  displayText?: string | undefined;
2955
3563
  }>>;
2956
3564
  }, "strip", z.ZodTypeAny, {
2957
- role: "agent";
2958
3565
  content: {
2959
3566
  type: string;
2960
3567
  } & {
2961
3568
  [k: string]: unknown;
2962
3569
  };
3570
+ role: "agent";
2963
3571
  meta?: {
3572
+ model?: string | null | undefined;
2964
3573
  sentFrom?: string | undefined;
2965
3574
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2966
- model?: string | null | undefined;
2967
3575
  fallbackModel?: string | null | undefined;
2968
3576
  customSystemPrompt?: string | null | undefined;
2969
3577
  appendSystemPrompt?: string | null | undefined;
@@ -2972,16 +3580,16 @@ declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zod
2972
3580
  displayText?: string | undefined;
2973
3581
  } | undefined;
2974
3582
  }, {
2975
- role: "agent";
2976
3583
  content: {
2977
3584
  type: string;
2978
3585
  } & {
2979
3586
  [k: string]: unknown;
2980
3587
  };
3588
+ role: "agent";
2981
3589
  meta?: {
3590
+ model?: string | null | undefined;
2982
3591
  sentFrom?: string | undefined;
2983
3592
  permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan" | "read-only" | "safe-yolo" | "yolo" | undefined;
2984
- model?: string | null | undefined;
2985
3593
  fallbackModel?: string | null | undefined;
2986
3594
  customSystemPrompt?: string | null | undefined;
2987
3595
  appendSystemPrompt?: string | null | undefined;
@@ -2999,23 +3607,23 @@ declare const sessionTextEventSchema: z.ZodObject<{
2999
3607
  text: z.ZodString;
3000
3608
  thinking: z.ZodOptional<z.ZodBoolean>;
3001
3609
  }, "strip", z.ZodTypeAny, {
3002
- text: string;
3003
3610
  t: "text";
3611
+ text: string;
3004
3612
  thinking?: boolean | undefined;
3005
3613
  }, {
3006
- text: string;
3007
3614
  t: "text";
3615
+ text: string;
3008
3616
  thinking?: boolean | undefined;
3009
3617
  }>;
3010
3618
  declare const sessionServiceMessageEventSchema: z.ZodObject<{
3011
3619
  t: z.ZodLiteral<"service">;
3012
3620
  text: z.ZodString;
3013
3621
  }, "strip", z.ZodTypeAny, {
3014
- text: string;
3015
3622
  t: "service";
3016
- }, {
3017
3623
  text: string;
3624
+ }, {
3018
3625
  t: "service";
3626
+ text: string;
3019
3627
  }>;
3020
3628
  declare const sessionToolCallStartEventSchema: z.ZodObject<{
3021
3629
  t: z.ZodLiteral<"tool-call-start">;
@@ -3129,8 +3737,8 @@ declare const sessionTurnEndEventSchema: z.ZodObject<{
3129
3737
  }>>;
3130
3738
  durationMs: z.ZodOptional<z.ZodNumber>;
3131
3739
  }, "strip", z.ZodTypeAny, {
3132
- status: "completed" | "failed" | "cancelled";
3133
3740
  t: "turn-end";
3741
+ status: "completed" | "failed" | "cancelled";
3134
3742
  model?: string | undefined;
3135
3743
  usage?: {
3136
3744
  input_tokens: number;
@@ -3140,8 +3748,8 @@ declare const sessionTurnEndEventSchema: z.ZodObject<{
3140
3748
  } | undefined;
3141
3749
  durationMs?: number | undefined;
3142
3750
  }, {
3143
- status: "completed" | "failed" | "cancelled";
3144
3751
  t: "turn-end";
3752
+ status: "completed" | "failed" | "cancelled";
3145
3753
  model?: string | undefined;
3146
3754
  usage?: {
3147
3755
  input_tokens: number;
@@ -3199,27 +3807,143 @@ declare const sessionUsageUpdateEventSchema: z.ZodObject<{
3199
3807
  model?: string | undefined;
3200
3808
  durationMs?: number | undefined;
3201
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;
3925
+ }>;
3202
3926
  declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
3203
3927
  t: z.ZodLiteral<"text">;
3204
3928
  text: z.ZodString;
3205
3929
  thinking: z.ZodOptional<z.ZodBoolean>;
3206
3930
  }, "strip", z.ZodTypeAny, {
3207
- text: string;
3208
3931
  t: "text";
3932
+ text: string;
3209
3933
  thinking?: boolean | undefined;
3210
3934
  }, {
3211
- text: string;
3212
3935
  t: "text";
3936
+ text: string;
3213
3937
  thinking?: boolean | undefined;
3214
3938
  }>, z.ZodObject<{
3215
3939
  t: z.ZodLiteral<"service">;
3216
3940
  text: z.ZodString;
3217
3941
  }, "strip", z.ZodTypeAny, {
3218
- text: string;
3219
3942
  t: "service";
3220
- }, {
3221
3943
  text: string;
3944
+ }, {
3222
3945
  t: "service";
3946
+ text: string;
3223
3947
  }>, z.ZodObject<{
3224
3948
  t: z.ZodLiteral<"tool-call-start">;
3225
3949
  call: z.ZodString;
@@ -3325,8 +4049,8 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
3325
4049
  }>>;
3326
4050
  durationMs: z.ZodOptional<z.ZodNumber>;
3327
4051
  }, "strip", z.ZodTypeAny, {
3328
- status: "completed" | "failed" | "cancelled";
3329
4052
  t: "turn-end";
4053
+ status: "completed" | "failed" | "cancelled";
3330
4054
  model?: string | undefined;
3331
4055
  usage?: {
3332
4056
  input_tokens: number;
@@ -3336,8 +4060,8 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
3336
4060
  } | undefined;
3337
4061
  durationMs?: number | undefined;
3338
4062
  }, {
3339
- status: "completed" | "failed" | "cancelled";
3340
4063
  t: "turn-end";
4064
+ status: "completed" | "failed" | "cancelled";
3341
4065
  model?: string | undefined;
3342
4066
  usage?: {
3343
4067
  input_tokens: number;
@@ -3392,6 +4116,118 @@ declare const sessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObject<{
3392
4116
  };
3393
4117
  model?: string | undefined;
3394
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;
3395
4231
  }>]>;
3396
4232
  type SessionEvent = z.infer<typeof sessionEventSchema>;
3397
4233
  declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
@@ -3405,22 +4241,22 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3405
4241
  text: z.ZodString;
3406
4242
  thinking: z.ZodOptional<z.ZodBoolean>;
3407
4243
  }, "strip", z.ZodTypeAny, {
3408
- text: string;
3409
4244
  t: "text";
4245
+ text: string;
3410
4246
  thinking?: boolean | undefined;
3411
4247
  }, {
3412
- text: string;
3413
4248
  t: "text";
4249
+ text: string;
3414
4250
  thinking?: boolean | undefined;
3415
4251
  }>, z.ZodObject<{
3416
4252
  t: z.ZodLiteral<"service">;
3417
4253
  text: z.ZodString;
3418
4254
  }, "strip", z.ZodTypeAny, {
3419
- text: string;
3420
4255
  t: "service";
3421
- }, {
3422
4256
  text: string;
4257
+ }, {
3423
4258
  t: "service";
4259
+ text: string;
3424
4260
  }>, z.ZodObject<{
3425
4261
  t: z.ZodLiteral<"tool-call-start">;
3426
4262
  call: z.ZodString;
@@ -3526,8 +4362,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3526
4362
  }>>;
3527
4363
  durationMs: z.ZodOptional<z.ZodNumber>;
3528
4364
  }, "strip", z.ZodTypeAny, {
3529
- status: "completed" | "failed" | "cancelled";
3530
4365
  t: "turn-end";
4366
+ status: "completed" | "failed" | "cancelled";
3531
4367
  model?: string | undefined;
3532
4368
  usage?: {
3533
4369
  input_tokens: number;
@@ -3537,8 +4373,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3537
4373
  } | undefined;
3538
4374
  durationMs?: number | undefined;
3539
4375
  }, {
3540
- status: "completed" | "failed" | "cancelled";
3541
4376
  t: "turn-end";
4377
+ status: "completed" | "failed" | "cancelled";
3542
4378
  model?: string | undefined;
3543
4379
  usage?: {
3544
4380
  input_tokens: number;
@@ -3593,18 +4429,130 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3593
4429
  };
3594
4430
  model?: string | undefined;
3595
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;
3596
4544
  }>]>;
3597
4545
  }, "strip", z.ZodTypeAny, {
3598
- role: "user" | "agent";
3599
4546
  id: string;
4547
+ role: "user" | "agent";
3600
4548
  time: number;
3601
4549
  ev: {
3602
- text: string;
3603
4550
  t: "text";
4551
+ text: string;
3604
4552
  thinking?: boolean | undefined;
3605
4553
  } | {
3606
- text: string;
3607
4554
  t: "service";
4555
+ text: string;
3608
4556
  } | {
3609
4557
  t: "tool-call-start";
3610
4558
  call: string;
@@ -3631,8 +4579,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3631
4579
  t: "start";
3632
4580
  title?: string | undefined;
3633
4581
  } | {
3634
- status: "completed" | "failed" | "cancelled";
3635
4582
  t: "turn-end";
4583
+ status: "completed" | "failed" | "cancelled";
3636
4584
  model?: string | undefined;
3637
4585
  usage?: {
3638
4586
  input_tokens: number;
@@ -3653,20 +4601,52 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3653
4601
  };
3654
4602
  model?: string | undefined;
3655
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;
3656
4636
  };
3657
4637
  turn?: string | undefined;
3658
4638
  subagent?: string | undefined;
3659
4639
  }, {
3660
- role: "user" | "agent";
3661
4640
  id: string;
4641
+ role: "user" | "agent";
3662
4642
  time: number;
3663
4643
  ev: {
3664
- text: string;
3665
4644
  t: "text";
4645
+ text: string;
3666
4646
  thinking?: boolean | undefined;
3667
4647
  } | {
3668
- text: string;
3669
4648
  t: "service";
4649
+ text: string;
3670
4650
  } | {
3671
4651
  t: "tool-call-start";
3672
4652
  call: string;
@@ -3693,8 +4673,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3693
4673
  t: "start";
3694
4674
  title?: string | undefined;
3695
4675
  } | {
3696
- status: "completed" | "failed" | "cancelled";
3697
4676
  t: "turn-end";
4677
+ status: "completed" | "failed" | "cancelled";
3698
4678
  model?: string | undefined;
3699
4679
  usage?: {
3700
4680
  input_tokens: number;
@@ -3715,20 +4695,52 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3715
4695
  };
3716
4696
  model?: string | undefined;
3717
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;
3718
4730
  };
3719
4731
  turn?: string | undefined;
3720
4732
  subagent?: string | undefined;
3721
4733
  }>, {
3722
- role: "user" | "agent";
3723
4734
  id: string;
4735
+ role: "user" | "agent";
3724
4736
  time: number;
3725
4737
  ev: {
3726
- text: string;
3727
4738
  t: "text";
4739
+ text: string;
3728
4740
  thinking?: boolean | undefined;
3729
4741
  } | {
3730
- text: string;
3731
4742
  t: "service";
4743
+ text: string;
3732
4744
  } | {
3733
4745
  t: "tool-call-start";
3734
4746
  call: string;
@@ -3755,8 +4767,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3755
4767
  t: "start";
3756
4768
  title?: string | undefined;
3757
4769
  } | {
3758
- status: "completed" | "failed" | "cancelled";
3759
4770
  t: "turn-end";
4771
+ status: "completed" | "failed" | "cancelled";
3760
4772
  model?: string | undefined;
3761
4773
  usage?: {
3762
4774
  input_tokens: number;
@@ -3777,20 +4789,52 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3777
4789
  };
3778
4790
  model?: string | undefined;
3779
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;
3780
4824
  };
3781
4825
  turn?: string | undefined;
3782
4826
  subagent?: string | undefined;
3783
4827
  }, {
3784
- role: "user" | "agent";
3785
4828
  id: string;
4829
+ role: "user" | "agent";
3786
4830
  time: number;
3787
4831
  ev: {
3788
- text: string;
3789
4832
  t: "text";
4833
+ text: string;
3790
4834
  thinking?: boolean | undefined;
3791
4835
  } | {
3792
- text: string;
3793
4836
  t: "service";
4837
+ text: string;
3794
4838
  } | {
3795
4839
  t: "tool-call-start";
3796
4840
  call: string;
@@ -3817,8 +4861,8 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3817
4861
  t: "start";
3818
4862
  title?: string | undefined;
3819
4863
  } | {
3820
- status: "completed" | "failed" | "cancelled";
3821
4864
  t: "turn-end";
4865
+ status: "completed" | "failed" | "cancelled";
3822
4866
  model?: string | undefined;
3823
4867
  usage?: {
3824
4868
  input_tokens: number;
@@ -3839,6 +4883,38 @@ declare const sessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
3839
4883
  };
3840
4884
  model?: string | undefined;
3841
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;
3842
4918
  };
3843
4919
  turn?: string | undefined;
3844
4920
  subagent?: string | undefined;
@@ -3852,5 +4928,5 @@ type CreateEnvelopeOptions = {
3852
4928
  };
3853
4929
  declare function createEnvelope(role: SessionRole, ev: SessionEvent, opts?: CreateEnvelopeOptions): SessionEnvelope;
3854
4930
 
3855
- 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 };
3856
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 };