@av-pi-studio/protocol 0.0.40 → 0.0.41

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.
@@ -33,14 +33,14 @@ export declare const helloSchema: z.ZodObject<{
33
33
  }, "strip", z.ZodTypeAny, {
34
34
  type: "hello";
35
35
  clientId: string;
36
- clientType: "mobile" | "browser" | "cli" | "mcp";
36
+ clientType: "browser" | "cli" | "mcp" | "mobile";
37
37
  protocolVersion: number;
38
38
  appVersion?: string | undefined;
39
39
  capabilities?: Record<string, boolean> | undefined;
40
40
  }, {
41
41
  type: "hello";
42
42
  clientId: string;
43
- clientType: "mobile" | "browser" | "cli" | "mcp";
43
+ clientType: "browser" | "cli" | "mcp" | "mobile";
44
44
  protocolVersion: number;
45
45
  appVersion?: string | undefined;
46
46
  capabilities?: Record<string, boolean> | undefined;
@@ -59,18 +59,18 @@ export declare const serverInfoPayloadSchema: z.ZodObject<{
59
59
  features: z.ZodRecord<z.ZodString, z.ZodUnknown>;
60
60
  }, "strip", z.ZodTypeAny, {
61
61
  status: "server_info";
62
- capabilities: Record<string, unknown>;
63
62
  serverId: string;
64
- features: Record<string, unknown>;
65
63
  hostname?: string | undefined;
66
64
  version?: string | undefined;
65
+ capabilities: Record<string, unknown>;
66
+ features: Record<string, unknown>;
67
67
  }, {
68
68
  status: "server_info";
69
- capabilities: Record<string, unknown>;
70
69
  serverId: string;
71
- features: Record<string, unknown>;
72
70
  hostname?: string | undefined;
73
71
  version?: string | undefined;
72
+ capabilities: Record<string, unknown>;
73
+ features: Record<string, unknown>;
74
74
  }>;
75
75
  export type ServerInfoPayload = z.infer<typeof serverInfoPayloadSchema>;
76
76
  /** Server → Client status envelope wrapping `server_info`. */
@@ -85,38 +85,38 @@ export declare const statusSchema: z.ZodObject<{
85
85
  features: z.ZodRecord<z.ZodString, z.ZodUnknown>;
86
86
  }, "strip", z.ZodTypeAny, {
87
87
  status: "server_info";
88
- capabilities: Record<string, unknown>;
89
88
  serverId: string;
90
- features: Record<string, unknown>;
91
89
  hostname?: string | undefined;
92
90
  version?: string | undefined;
91
+ capabilities: Record<string, unknown>;
92
+ features: Record<string, unknown>;
93
93
  }, {
94
94
  status: "server_info";
95
- capabilities: Record<string, unknown>;
96
95
  serverId: string;
97
- features: Record<string, unknown>;
98
96
  hostname?: string | undefined;
99
97
  version?: string | undefined;
98
+ capabilities: Record<string, unknown>;
99
+ features: Record<string, unknown>;
100
100
  }>;
101
101
  }, "strip", z.ZodTypeAny, {
102
102
  type: "status";
103
103
  payload: {
104
104
  status: "server_info";
105
- capabilities: Record<string, unknown>;
106
105
  serverId: string;
107
- features: Record<string, unknown>;
108
106
  hostname?: string | undefined;
109
107
  version?: string | undefined;
108
+ capabilities: Record<string, unknown>;
109
+ features: Record<string, unknown>;
110
110
  };
111
111
  }, {
112
112
  type: "status";
113
113
  payload: {
114
114
  status: "server_info";
115
- capabilities: Record<string, unknown>;
116
115
  serverId: string;
117
- features: Record<string, unknown>;
118
116
  hostname?: string | undefined;
119
117
  version?: string | undefined;
118
+ capabilities: Record<string, unknown>;
119
+ features: Record<string, unknown>;
120
120
  };
121
121
  }>;
122
122
  export type Status = z.infer<typeof statusSchema>;
@@ -143,15 +143,15 @@ export declare const pongSchema: z.ZodObject<{
143
143
  }, "strip", z.ZodTypeAny, {
144
144
  type: "pong";
145
145
  requestId: string;
146
+ clientSentAt?: string | number | undefined;
146
147
  serverReceivedAt: string | number;
147
148
  serverSentAt: string | number;
148
- clientSentAt?: string | number | undefined;
149
149
  }, {
150
150
  type: "pong";
151
151
  requestId: string;
152
+ clientSentAt?: string | number | undefined;
152
153
  serverReceivedAt: string | number;
153
154
  serverSentAt: string | number;
154
- clientSentAt?: string | number | undefined;
155
155
  }>;
156
156
  export type Pong = z.infer<typeof pongSchema>;
157
157
  export type RpcDirection = "request" | "response";
@@ -373,7 +373,6 @@ export declare const createAgentRequestSchema: z.ZodObject<{
373
373
  systemPrompt?: string | undefined;
374
374
  mcpServers?: Record<string, unknown> | undefined;
375
375
  };
376
- labels: Record<string, string>;
377
376
  env?: Record<string, string> | undefined;
378
377
  workspaceId?: string | undefined;
379
378
  worktreeName?: string | undefined;
@@ -391,6 +390,7 @@ export declare const createAgentRequestSchema: z.ZodObject<{
391
390
  git?: unknown;
392
391
  worktree?: unknown;
393
392
  autoArchive?: boolean | undefined;
393
+ labels: Record<string, string>;
394
394
  }, {
395
395
  type: "create_agent_request";
396
396
  requestId: string;
@@ -445,20 +445,20 @@ export declare const createAgentResponseSchema: z.ZodObject<{
445
445
  }, z.ZodTypeAny, "passthrough">>;
446
446
  }, "strip", z.ZodTypeAny, {
447
447
  type: "create_agent_response";
448
+ requestId: string;
448
449
  payload: {
449
450
  agentId: string;
450
451
  } & {
451
452
  [k: string]: unknown;
452
453
  };
453
- requestId: string;
454
454
  }, {
455
455
  type: "create_agent_response";
456
+ requestId: string;
456
457
  payload: {
457
458
  agentId: string;
458
459
  } & {
459
460
  [k: string]: unknown;
460
461
  };
461
- requestId: string;
462
462
  }>;
463
463
  export type CreateAgentResponse = z.infer<typeof createAgentResponseSchema>;
464
464
  export declare const agentUpdateSchema: z.ZodObject<{
@@ -470,13 +470,13 @@ export declare const agentUpdateSchema: z.ZodObject<{
470
470
  }, "strip", z.ZodTypeAny, {
471
471
  type: "agent_update";
472
472
  agentId: string;
473
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
473
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
474
474
  title?: string | null | undefined;
475
475
  labels?: Record<string, string> | undefined;
476
476
  }, {
477
477
  type: "agent_update";
478
478
  agentId: string;
479
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
479
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
480
480
  title?: string | null | undefined;
481
481
  labels?: Record<string, string> | undefined;
482
482
  }>;
@@ -486,12 +486,12 @@ export declare const agentStatusMessageSchema: z.ZodObject<{
486
486
  status: z.ZodEnum<["initializing", "idle", "running", "error", "closed"]>;
487
487
  }, "strip", z.ZodTypeAny, {
488
488
  type: "agent_status";
489
- status: "initializing" | "idle" | "running" | "error" | "closed";
490
489
  agentId: string;
490
+ status: "closed" | "error" | "idle" | "initializing" | "running";
491
491
  }, {
492
492
  type: "agent_status";
493
- status: "initializing" | "idle" | "running" | "error" | "closed";
494
493
  agentId: string;
494
+ status: "closed" | "error" | "idle" | "initializing" | "running";
495
495
  }>;
496
496
  export declare const agentListSchema: z.ZodObject<{
497
497
  type: z.ZodLiteral<"agent_list">;
@@ -569,13 +569,13 @@ export declare const toolCallDetailSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
569
569
  }, "strip", z.ZodTypeAny, {
570
570
  kind: "edit";
571
571
  path?: string | undefined;
572
- output?: string | undefined;
573
572
  diff?: string | undefined;
573
+ output?: string | undefined;
574
574
  }, {
575
575
  kind: "edit";
576
576
  path?: string | undefined;
577
- output?: string | undefined;
578
577
  diff?: string | undefined;
578
+ output?: string | undefined;
579
579
  }>, z.ZodObject<{
580
580
  kind: z.ZodLiteral<"write">;
581
581
  path: z.ZodOptional<z.ZodString>;
@@ -594,12 +594,12 @@ export declare const toolCallDetailSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
594
594
  output: z.ZodOptional<z.ZodString>;
595
595
  }, "strip", z.ZodTypeAny, {
596
596
  kind: "search";
597
- output?: string | undefined;
598
597
  query?: string | undefined;
598
+ output?: string | undefined;
599
599
  }, {
600
600
  kind: "search";
601
- output?: string | undefined;
602
601
  query?: string | undefined;
602
+ output?: string | undefined;
603
603
  }>, z.ZodObject<{
604
604
  kind: z.ZodLiteral<"fetch">;
605
605
  url: z.ZodOptional<z.ZodString>;
@@ -618,12 +618,12 @@ export declare const toolCallDetailSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
618
618
  output: z.ZodOptional<z.ZodString>;
619
619
  }, "strip", z.ZodTypeAny, {
620
620
  kind: "task";
621
- output?: string | undefined;
622
621
  description?: string | undefined;
622
+ output?: string | undefined;
623
623
  }, {
624
624
  kind: "task";
625
- output?: string | undefined;
626
625
  description?: string | undefined;
626
+ output?: string | undefined;
627
627
  }>]>;
628
628
  export type ToolCallDetail = z.infer<typeof toolCallDetailSchema>;
629
629
  /** `AgentStreamEvent` — discriminated on `kind`. */
@@ -643,20 +643,20 @@ export declare const agentStreamEventSchema: z.ZodDiscriminatedUnion<"kind", [z.
643
643
  }, z.ZodTypeAny, "passthrough">>, "many">>;
644
644
  }, "strip", z.ZodTypeAny, {
645
645
  kind: "user_message";
646
+ messageId?: string | undefined;
647
+ text?: string | undefined;
646
648
  images?: z.objectOutputType<{
647
649
  mimeType: z.ZodOptional<z.ZodString>;
648
650
  data: z.ZodOptional<z.ZodString>;
649
651
  }, z.ZodTypeAny, "passthrough">[] | undefined;
650
- messageId?: string | undefined;
651
- text?: string | undefined;
652
652
  }, {
653
653
  kind: "user_message";
654
+ messageId?: string | undefined;
655
+ text?: string | undefined;
654
656
  images?: z.objectInputType<{
655
657
  mimeType: z.ZodOptional<z.ZodString>;
656
658
  data: z.ZodOptional<z.ZodString>;
657
659
  }, z.ZodTypeAny, "passthrough">[] | undefined;
658
- messageId?: string | undefined;
659
- text?: string | undefined;
660
660
  }>, z.ZodObject<{
661
661
  kind: z.ZodLiteral<"assistant_message">;
662
662
  messageId: z.ZodOptional<z.ZodString>;
@@ -713,13 +713,13 @@ export declare const agentStreamEventSchema: z.ZodDiscriminatedUnion<"kind", [z.
713
713
  }, "strip", z.ZodTypeAny, {
714
714
  kind: "edit";
715
715
  path?: string | undefined;
716
- output?: string | undefined;
717
716
  diff?: string | undefined;
717
+ output?: string | undefined;
718
718
  }, {
719
719
  kind: "edit";
720
720
  path?: string | undefined;
721
- output?: string | undefined;
722
721
  diff?: string | undefined;
722
+ output?: string | undefined;
723
723
  }>, z.ZodObject<{
724
724
  kind: z.ZodLiteral<"write">;
725
725
  path: z.ZodOptional<z.ZodString>;
@@ -738,12 +738,12 @@ export declare const agentStreamEventSchema: z.ZodDiscriminatedUnion<"kind", [z.
738
738
  output: z.ZodOptional<z.ZodString>;
739
739
  }, "strip", z.ZodTypeAny, {
740
740
  kind: "search";
741
- output?: string | undefined;
742
741
  query?: string | undefined;
742
+ output?: string | undefined;
743
743
  }, {
744
744
  kind: "search";
745
- output?: string | undefined;
746
745
  query?: string | undefined;
746
+ output?: string | undefined;
747
747
  }>, z.ZodObject<{
748
748
  kind: z.ZodLiteral<"fetch">;
749
749
  url: z.ZodOptional<z.ZodString>;
@@ -762,16 +762,17 @@ export declare const agentStreamEventSchema: z.ZodDiscriminatedUnion<"kind", [z.
762
762
  output: z.ZodOptional<z.ZodString>;
763
763
  }, "strip", z.ZodTypeAny, {
764
764
  kind: "task";
765
- output?: string | undefined;
766
765
  description?: string | undefined;
766
+ output?: string | undefined;
767
767
  }, {
768
768
  kind: "task";
769
- output?: string | undefined;
770
769
  description?: string | undefined;
770
+ output?: string | undefined;
771
771
  }>]>;
772
772
  status: z.ZodOptional<z.ZodString>;
773
773
  }, "strip", z.ZodTypeAny, {
774
774
  kind: "tool_call";
775
+ callId?: string | undefined;
775
776
  tool: {
776
777
  kind: "shell";
777
778
  command?: string | undefined;
@@ -783,29 +784,29 @@ export declare const agentStreamEventSchema: z.ZodDiscriminatedUnion<"kind", [z.
783
784
  } | {
784
785
  kind: "edit";
785
786
  path?: string | undefined;
786
- output?: string | undefined;
787
787
  diff?: string | undefined;
788
+ output?: string | undefined;
788
789
  } | {
789
790
  kind: "write";
790
791
  path?: string | undefined;
791
792
  output?: string | undefined;
792
793
  } | {
793
794
  kind: "search";
794
- output?: string | undefined;
795
795
  query?: string | undefined;
796
+ output?: string | undefined;
796
797
  } | {
797
798
  kind: "fetch";
798
799
  url?: string | undefined;
799
800
  output?: string | undefined;
800
801
  } | {
801
802
  kind: "task";
802
- output?: string | undefined;
803
803
  description?: string | undefined;
804
+ output?: string | undefined;
804
805
  };
805
806
  status?: string | undefined;
806
- callId?: string | undefined;
807
807
  }, {
808
808
  kind: "tool_call";
809
+ callId?: string | undefined;
809
810
  tool: {
810
811
  kind: "shell";
811
812
  command?: string | undefined;
@@ -817,27 +818,26 @@ export declare const agentStreamEventSchema: z.ZodDiscriminatedUnion<"kind", [z.
817
818
  } | {
818
819
  kind: "edit";
819
820
  path?: string | undefined;
820
- output?: string | undefined;
821
821
  diff?: string | undefined;
822
+ output?: string | undefined;
822
823
  } | {
823
824
  kind: "write";
824
825
  path?: string | undefined;
825
826
  output?: string | undefined;
826
827
  } | {
827
828
  kind: "search";
828
- output?: string | undefined;
829
829
  query?: string | undefined;
830
+ output?: string | undefined;
830
831
  } | {
831
832
  kind: "fetch";
832
833
  url?: string | undefined;
833
834
  output?: string | undefined;
834
835
  } | {
835
836
  kind: "task";
836
- output?: string | undefined;
837
837
  description?: string | undefined;
838
+ output?: string | undefined;
838
839
  };
839
840
  status?: string | undefined;
840
- callId?: string | undefined;
841
841
  }>, z.ZodObject<{
842
842
  kind: z.ZodLiteral<"turn_started">;
843
843
  turnId: z.ZodOptional<z.ZodString>;
@@ -862,12 +862,12 @@ export declare const agentStreamEventSchema: z.ZodDiscriminatedUnion<"kind", [z.
862
862
  error: z.ZodOptional<z.ZodString>;
863
863
  }, "strip", z.ZodTypeAny, {
864
864
  kind: "turn_failed";
865
- error?: string | undefined;
866
865
  turnId?: string | undefined;
866
+ error?: string | undefined;
867
867
  }, {
868
868
  kind: "turn_failed";
869
- error?: string | undefined;
870
869
  turnId?: string | undefined;
870
+ error?: string | undefined;
871
871
  }>, z.ZodObject<{
872
872
  kind: z.ZodLiteral<"turn_canceled">;
873
873
  turnId: z.ZodOptional<z.ZodString>;
@@ -921,20 +921,20 @@ export declare const agentStreamSchema: z.ZodObject<{
921
921
  }, z.ZodTypeAny, "passthrough">>, "many">>;
922
922
  }, "strip", z.ZodTypeAny, {
923
923
  kind: "user_message";
924
+ messageId?: string | undefined;
925
+ text?: string | undefined;
924
926
  images?: z.objectOutputType<{
925
927
  mimeType: z.ZodOptional<z.ZodString>;
926
928
  data: z.ZodOptional<z.ZodString>;
927
929
  }, z.ZodTypeAny, "passthrough">[] | undefined;
928
- messageId?: string | undefined;
929
- text?: string | undefined;
930
930
  }, {
931
931
  kind: "user_message";
932
+ messageId?: string | undefined;
933
+ text?: string | undefined;
932
934
  images?: z.objectInputType<{
933
935
  mimeType: z.ZodOptional<z.ZodString>;
934
936
  data: z.ZodOptional<z.ZodString>;
935
937
  }, z.ZodTypeAny, "passthrough">[] | undefined;
936
- messageId?: string | undefined;
937
- text?: string | undefined;
938
938
  }>, z.ZodObject<{
939
939
  kind: z.ZodLiteral<"assistant_message">;
940
940
  messageId: z.ZodOptional<z.ZodString>;
@@ -991,13 +991,13 @@ export declare const agentStreamSchema: z.ZodObject<{
991
991
  }, "strip", z.ZodTypeAny, {
992
992
  kind: "edit";
993
993
  path?: string | undefined;
994
- output?: string | undefined;
995
994
  diff?: string | undefined;
995
+ output?: string | undefined;
996
996
  }, {
997
997
  kind: "edit";
998
998
  path?: string | undefined;
999
- output?: string | undefined;
1000
999
  diff?: string | undefined;
1000
+ output?: string | undefined;
1001
1001
  }>, z.ZodObject<{
1002
1002
  kind: z.ZodLiteral<"write">;
1003
1003
  path: z.ZodOptional<z.ZodString>;
@@ -1016,12 +1016,12 @@ export declare const agentStreamSchema: z.ZodObject<{
1016
1016
  output: z.ZodOptional<z.ZodString>;
1017
1017
  }, "strip", z.ZodTypeAny, {
1018
1018
  kind: "search";
1019
- output?: string | undefined;
1020
1019
  query?: string | undefined;
1020
+ output?: string | undefined;
1021
1021
  }, {
1022
1022
  kind: "search";
1023
- output?: string | undefined;
1024
1023
  query?: string | undefined;
1024
+ output?: string | undefined;
1025
1025
  }>, z.ZodObject<{
1026
1026
  kind: z.ZodLiteral<"fetch">;
1027
1027
  url: z.ZodOptional<z.ZodString>;
@@ -1040,16 +1040,17 @@ export declare const agentStreamSchema: z.ZodObject<{
1040
1040
  output: z.ZodOptional<z.ZodString>;
1041
1041
  }, "strip", z.ZodTypeAny, {
1042
1042
  kind: "task";
1043
- output?: string | undefined;
1044
1043
  description?: string | undefined;
1044
+ output?: string | undefined;
1045
1045
  }, {
1046
1046
  kind: "task";
1047
- output?: string | undefined;
1048
1047
  description?: string | undefined;
1048
+ output?: string | undefined;
1049
1049
  }>]>;
1050
1050
  status: z.ZodOptional<z.ZodString>;
1051
1051
  }, "strip", z.ZodTypeAny, {
1052
1052
  kind: "tool_call";
1053
+ callId?: string | undefined;
1053
1054
  tool: {
1054
1055
  kind: "shell";
1055
1056
  command?: string | undefined;
@@ -1061,29 +1062,29 @@ export declare const agentStreamSchema: z.ZodObject<{
1061
1062
  } | {
1062
1063
  kind: "edit";
1063
1064
  path?: string | undefined;
1064
- output?: string | undefined;
1065
1065
  diff?: string | undefined;
1066
+ output?: string | undefined;
1066
1067
  } | {
1067
1068
  kind: "write";
1068
1069
  path?: string | undefined;
1069
1070
  output?: string | undefined;
1070
1071
  } | {
1071
1072
  kind: "search";
1072
- output?: string | undefined;
1073
1073
  query?: string | undefined;
1074
+ output?: string | undefined;
1074
1075
  } | {
1075
1076
  kind: "fetch";
1076
1077
  url?: string | undefined;
1077
1078
  output?: string | undefined;
1078
1079
  } | {
1079
1080
  kind: "task";
1080
- output?: string | undefined;
1081
1081
  description?: string | undefined;
1082
+ output?: string | undefined;
1082
1083
  };
1083
1084
  status?: string | undefined;
1084
- callId?: string | undefined;
1085
1085
  }, {
1086
1086
  kind: "tool_call";
1087
+ callId?: string | undefined;
1087
1088
  tool: {
1088
1089
  kind: "shell";
1089
1090
  command?: string | undefined;
@@ -1095,27 +1096,26 @@ export declare const agentStreamSchema: z.ZodObject<{
1095
1096
  } | {
1096
1097
  kind: "edit";
1097
1098
  path?: string | undefined;
1098
- output?: string | undefined;
1099
1099
  diff?: string | undefined;
1100
+ output?: string | undefined;
1100
1101
  } | {
1101
1102
  kind: "write";
1102
1103
  path?: string | undefined;
1103
1104
  output?: string | undefined;
1104
1105
  } | {
1105
1106
  kind: "search";
1106
- output?: string | undefined;
1107
1107
  query?: string | undefined;
1108
+ output?: string | undefined;
1108
1109
  } | {
1109
1110
  kind: "fetch";
1110
1111
  url?: string | undefined;
1111
1112
  output?: string | undefined;
1112
1113
  } | {
1113
1114
  kind: "task";
1114
- output?: string | undefined;
1115
1115
  description?: string | undefined;
1116
+ output?: string | undefined;
1116
1117
  };
1117
1118
  status?: string | undefined;
1118
- callId?: string | undefined;
1119
1119
  }>, z.ZodObject<{
1120
1120
  kind: z.ZodLiteral<"turn_started">;
1121
1121
  turnId: z.ZodOptional<z.ZodString>;
@@ -1140,12 +1140,12 @@ export declare const agentStreamSchema: z.ZodObject<{
1140
1140
  error: z.ZodOptional<z.ZodString>;
1141
1141
  }, "strip", z.ZodTypeAny, {
1142
1142
  kind: "turn_failed";
1143
- error?: string | undefined;
1144
1143
  turnId?: string | undefined;
1144
+ error?: string | undefined;
1145
1145
  }, {
1146
1146
  kind: "turn_failed";
1147
- error?: string | undefined;
1148
1147
  turnId?: string | undefined;
1148
+ error?: string | undefined;
1149
1149
  }>, z.ZodObject<{
1150
1150
  kind: z.ZodLiteral<"turn_canceled">;
1151
1151
  turnId: z.ZodOptional<z.ZodString>;
@@ -1180,14 +1180,16 @@ export declare const agentStreamSchema: z.ZodObject<{
1180
1180
  }, "strip", z.ZodTypeAny, {
1181
1181
  type: "agent_stream";
1182
1182
  agentId: string;
1183
+ seq?: number | undefined;
1184
+ timestamp?: string | number | undefined;
1183
1185
  event: {
1184
1186
  kind: "user_message";
1187
+ messageId?: string | undefined;
1188
+ text?: string | undefined;
1185
1189
  images?: z.objectOutputType<{
1186
1190
  mimeType: z.ZodOptional<z.ZodString>;
1187
1191
  data: z.ZodOptional<z.ZodString>;
1188
1192
  }, z.ZodTypeAny, "passthrough">[] | undefined;
1189
- messageId?: string | undefined;
1190
- text?: string | undefined;
1191
1193
  } | {
1192
1194
  kind: "assistant_message";
1193
1195
  messageId?: string | undefined;
@@ -1197,6 +1199,7 @@ export declare const agentStreamSchema: z.ZodObject<{
1197
1199
  text?: string | undefined;
1198
1200
  } | {
1199
1201
  kind: "tool_call";
1202
+ callId?: string | undefined;
1200
1203
  tool: {
1201
1204
  kind: "shell";
1202
1205
  command?: string | undefined;
@@ -1208,27 +1211,26 @@ export declare const agentStreamSchema: z.ZodObject<{
1208
1211
  } | {
1209
1212
  kind: "edit";
1210
1213
  path?: string | undefined;
1211
- output?: string | undefined;
1212
1214
  diff?: string | undefined;
1215
+ output?: string | undefined;
1213
1216
  } | {
1214
1217
  kind: "write";
1215
1218
  path?: string | undefined;
1216
1219
  output?: string | undefined;
1217
1220
  } | {
1218
1221
  kind: "search";
1219
- output?: string | undefined;
1220
1222
  query?: string | undefined;
1223
+ output?: string | undefined;
1221
1224
  } | {
1222
1225
  kind: "fetch";
1223
1226
  url?: string | undefined;
1224
1227
  output?: string | undefined;
1225
1228
  } | {
1226
1229
  kind: "task";
1227
- output?: string | undefined;
1228
1230
  description?: string | undefined;
1231
+ output?: string | undefined;
1229
1232
  };
1230
1233
  status?: string | undefined;
1231
- callId?: string | undefined;
1232
1234
  } | {
1233
1235
  kind: "turn_started";
1234
1236
  turnId?: string | undefined;
@@ -1237,8 +1239,8 @@ export declare const agentStreamSchema: z.ZodObject<{
1237
1239
  turnId?: string | undefined;
1238
1240
  } | {
1239
1241
  kind: "turn_failed";
1240
- error?: string | undefined;
1241
1242
  turnId?: string | undefined;
1243
+ error?: string | undefined;
1242
1244
  } | {
1243
1245
  kind: "turn_canceled";
1244
1246
  turnId?: string | undefined;
@@ -1250,19 +1252,19 @@ export declare const agentStreamSchema: z.ZodObject<{
1250
1252
  steering?: string[] | undefined;
1251
1253
  followUp?: string[] | undefined;
1252
1254
  };
1253
- seq?: number | undefined;
1254
- timestamp?: string | number | undefined;
1255
1255
  }, {
1256
1256
  type: "agent_stream";
1257
1257
  agentId: string;
1258
+ seq?: number | undefined;
1259
+ timestamp?: string | number | undefined;
1258
1260
  event: {
1259
1261
  kind: "user_message";
1262
+ messageId?: string | undefined;
1263
+ text?: string | undefined;
1260
1264
  images?: z.objectInputType<{
1261
1265
  mimeType: z.ZodOptional<z.ZodString>;
1262
1266
  data: z.ZodOptional<z.ZodString>;
1263
1267
  }, z.ZodTypeAny, "passthrough">[] | undefined;
1264
- messageId?: string | undefined;
1265
- text?: string | undefined;
1266
1268
  } | {
1267
1269
  kind: "assistant_message";
1268
1270
  messageId?: string | undefined;
@@ -1272,6 +1274,7 @@ export declare const agentStreamSchema: z.ZodObject<{
1272
1274
  text?: string | undefined;
1273
1275
  } | {
1274
1276
  kind: "tool_call";
1277
+ callId?: string | undefined;
1275
1278
  tool: {
1276
1279
  kind: "shell";
1277
1280
  command?: string | undefined;
@@ -1283,27 +1286,26 @@ export declare const agentStreamSchema: z.ZodObject<{
1283
1286
  } | {
1284
1287
  kind: "edit";
1285
1288
  path?: string | undefined;
1286
- output?: string | undefined;
1287
1289
  diff?: string | undefined;
1290
+ output?: string | undefined;
1288
1291
  } | {
1289
1292
  kind: "write";
1290
1293
  path?: string | undefined;
1291
1294
  output?: string | undefined;
1292
1295
  } | {
1293
1296
  kind: "search";
1294
- output?: string | undefined;
1295
1297
  query?: string | undefined;
1298
+ output?: string | undefined;
1296
1299
  } | {
1297
1300
  kind: "fetch";
1298
1301
  url?: string | undefined;
1299
1302
  output?: string | undefined;
1300
1303
  } | {
1301
1304
  kind: "task";
1302
- output?: string | undefined;
1303
1305
  description?: string | undefined;
1306
+ output?: string | undefined;
1304
1307
  };
1305
1308
  status?: string | undefined;
1306
- callId?: string | undefined;
1307
1309
  } | {
1308
1310
  kind: "turn_started";
1309
1311
  turnId?: string | undefined;
@@ -1312,8 +1314,8 @@ export declare const agentStreamSchema: z.ZodObject<{
1312
1314
  turnId?: string | undefined;
1313
1315
  } | {
1314
1316
  kind: "turn_failed";
1315
- error?: string | undefined;
1316
1317
  turnId?: string | undefined;
1318
+ error?: string | undefined;
1317
1319
  } | {
1318
1320
  kind: "turn_canceled";
1319
1321
  turnId?: string | undefined;
@@ -1325,8 +1327,6 @@ export declare const agentStreamSchema: z.ZodObject<{
1325
1327
  steering?: string[] | undefined;
1326
1328
  followUp?: string[] | undefined;
1327
1329
  };
1328
- seq?: number | undefined;
1329
- timestamp?: string | number | undefined;
1330
1330
  }>;
1331
1331
  export declare const timelineDirectionEnum: z.ZodEnum<["before", "after"]>;
1332
1332
  export type TimelineDirection = z.infer<typeof timelineDirectionEnum>;
@@ -1352,15 +1352,15 @@ export declare const fetchAgentTimelineRequestSchema: z.ZodObject<{
1352
1352
  type: "fetch_agent_timeline_request";
1353
1353
  requestId: string;
1354
1354
  agentId: string;
1355
- direction: "before" | "after";
1356
1355
  cursor?: string | null | undefined;
1356
+ direction: "after" | "before";
1357
1357
  limit?: number | undefined;
1358
1358
  }, {
1359
1359
  type: "fetch_agent_timeline_request";
1360
1360
  requestId: string;
1361
1361
  agentId: string;
1362
- direction: "before" | "after";
1363
1362
  cursor?: string | null | undefined;
1363
+ direction: "after" | "before";
1364
1364
  limit?: number | undefined;
1365
1365
  }>;
1366
1366
  export type FetchAgentTimelineRequest = z.infer<typeof fetchAgentTimelineRequestSchema>;
@@ -1388,6 +1388,7 @@ export declare const fetchAgentTimelineResponseSchema: z.ZodObject<{
1388
1388
  }, "strip", z.ZodTypeAny, {
1389
1389
  type: "fetch_agent_timeline_response";
1390
1390
  requestId: string;
1391
+ agentId?: string | undefined;
1391
1392
  items: unknown[];
1392
1393
  seqStart: number;
1393
1394
  seqEnd: number;
@@ -1397,12 +1398,12 @@ export declare const fetchAgentTimelineResponseSchema: z.ZodObject<{
1397
1398
  }[];
1398
1399
  collapsed: boolean;
1399
1400
  hasNewer: boolean;
1400
- agentId?: string | undefined;
1401
1401
  startCursor?: string | null | undefined;
1402
1402
  endCursor?: string | null | undefined;
1403
1403
  }, {
1404
1404
  type: "fetch_agent_timeline_response";
1405
1405
  requestId: string;
1406
+ agentId?: string | undefined;
1406
1407
  items: unknown[];
1407
1408
  seqStart: number;
1408
1409
  seqEnd: number;
@@ -1412,7 +1413,6 @@ export declare const fetchAgentTimelineResponseSchema: z.ZodObject<{
1412
1413
  }[];
1413
1414
  collapsed: boolean;
1414
1415
  hasNewer: boolean;
1415
- agentId?: string | undefined;
1416
1416
  startCursor?: string | null | undefined;
1417
1417
  endCursor?: string | null | undefined;
1418
1418
  }>;
@@ -1454,13 +1454,13 @@ export declare const agentPermissionRequestSchema: z.ZodObject<{
1454
1454
  }, "strip", z.ZodTypeAny, {
1455
1455
  kind: "edit";
1456
1456
  path?: string | undefined;
1457
- output?: string | undefined;
1458
1457
  diff?: string | undefined;
1458
+ output?: string | undefined;
1459
1459
  }, {
1460
1460
  kind: "edit";
1461
1461
  path?: string | undefined;
1462
- output?: string | undefined;
1463
1462
  diff?: string | undefined;
1463
+ output?: string | undefined;
1464
1464
  }>, z.ZodObject<{
1465
1465
  kind: z.ZodLiteral<"write">;
1466
1466
  path: z.ZodOptional<z.ZodString>;
@@ -1479,12 +1479,12 @@ export declare const agentPermissionRequestSchema: z.ZodObject<{
1479
1479
  output: z.ZodOptional<z.ZodString>;
1480
1480
  }, "strip", z.ZodTypeAny, {
1481
1481
  kind: "search";
1482
- output?: string | undefined;
1483
1482
  query?: string | undefined;
1483
+ output?: string | undefined;
1484
1484
  }, {
1485
1485
  kind: "search";
1486
- output?: string | undefined;
1487
1486
  query?: string | undefined;
1487
+ output?: string | undefined;
1488
1488
  }>, z.ZodObject<{
1489
1489
  kind: z.ZodLiteral<"fetch">;
1490
1490
  url: z.ZodOptional<z.ZodString>;
@@ -1503,12 +1503,12 @@ export declare const agentPermissionRequestSchema: z.ZodObject<{
1503
1503
  output: z.ZodOptional<z.ZodString>;
1504
1504
  }, "strip", z.ZodTypeAny, {
1505
1505
  kind: "task";
1506
- output?: string | undefined;
1507
1506
  description?: string | undefined;
1507
+ output?: string | undefined;
1508
1508
  }, {
1509
1509
  kind: "task";
1510
- output?: string | undefined;
1511
1510
  description?: string | undefined;
1511
+ output?: string | undefined;
1512
1512
  }>]>>;
1513
1513
  action: z.ZodOptional<z.ZodUnknown>;
1514
1514
  responses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1516,6 +1516,7 @@ export declare const agentPermissionRequestSchema: z.ZodObject<{
1516
1516
  type: "agent_permission_request";
1517
1517
  requestId: string;
1518
1518
  agentId: string;
1519
+ toolName?: string | undefined;
1519
1520
  tool?: {
1520
1521
  kind: "shell";
1521
1522
  command?: string | undefined;
@@ -1527,32 +1528,32 @@ export declare const agentPermissionRequestSchema: z.ZodObject<{
1527
1528
  } | {
1528
1529
  kind: "edit";
1529
1530
  path?: string | undefined;
1530
- output?: string | undefined;
1531
1531
  diff?: string | undefined;
1532
+ output?: string | undefined;
1532
1533
  } | {
1533
1534
  kind: "write";
1534
1535
  path?: string | undefined;
1535
1536
  output?: string | undefined;
1536
1537
  } | {
1537
1538
  kind: "search";
1538
- output?: string | undefined;
1539
1539
  query?: string | undefined;
1540
+ output?: string | undefined;
1540
1541
  } | {
1541
1542
  kind: "fetch";
1542
1543
  url?: string | undefined;
1543
1544
  output?: string | undefined;
1544
1545
  } | {
1545
1546
  kind: "task";
1546
- output?: string | undefined;
1547
1547
  description?: string | undefined;
1548
+ output?: string | undefined;
1548
1549
  } | undefined;
1549
- toolName?: string | undefined;
1550
1550
  action?: unknown;
1551
1551
  responses?: string[] | undefined;
1552
1552
  }, {
1553
1553
  type: "agent_permission_request";
1554
1554
  requestId: string;
1555
1555
  agentId: string;
1556
+ toolName?: string | undefined;
1556
1557
  tool?: {
1557
1558
  kind: "shell";
1558
1559
  command?: string | undefined;
@@ -1564,26 +1565,25 @@ export declare const agentPermissionRequestSchema: z.ZodObject<{
1564
1565
  } | {
1565
1566
  kind: "edit";
1566
1567
  path?: string | undefined;
1567
- output?: string | undefined;
1568
1568
  diff?: string | undefined;
1569
+ output?: string | undefined;
1569
1570
  } | {
1570
1571
  kind: "write";
1571
1572
  path?: string | undefined;
1572
1573
  output?: string | undefined;
1573
1574
  } | {
1574
1575
  kind: "search";
1575
- output?: string | undefined;
1576
1576
  query?: string | undefined;
1577
+ output?: string | undefined;
1577
1578
  } | {
1578
1579
  kind: "fetch";
1579
1580
  url?: string | undefined;
1580
1581
  output?: string | undefined;
1581
1582
  } | {
1582
1583
  kind: "task";
1583
- output?: string | undefined;
1584
1584
  description?: string | undefined;
1585
+ output?: string | undefined;
1585
1586
  } | undefined;
1586
- toolName?: string | undefined;
1587
1587
  action?: unknown;
1588
1588
  responses?: string[] | undefined;
1589
1589
  }>;
@@ -1632,20 +1632,20 @@ export declare const respondToPermissionResponseSchema: z.ZodObject<{
1632
1632
  }, z.ZodTypeAny, "passthrough">>;
1633
1633
  }, "strip", z.ZodTypeAny, {
1634
1634
  type: "agent.permission.respond.response";
1635
+ requestId: string;
1635
1636
  payload: {
1636
1637
  resolved: boolean;
1637
1638
  } & {
1638
1639
  [k: string]: unknown;
1639
1640
  };
1640
- requestId: string;
1641
1641
  }, {
1642
1642
  type: "agent.permission.respond.response";
1643
+ requestId: string;
1643
1644
  payload: {
1644
1645
  resolved: boolean;
1645
1646
  } & {
1646
1647
  [k: string]: unknown;
1647
1648
  };
1648
- requestId: string;
1649
1649
  }>;
1650
1650
  /** Legacy flat name for the same operation — still accepted (parsed), never generated. */
1651
1651
  export declare const legacyRespondToPermissionSchema: z.ZodObject<{
@@ -3117,7 +3117,6 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3117
3117
  systemPrompt?: string | undefined;
3118
3118
  mcpServers?: Record<string, unknown> | undefined;
3119
3119
  };
3120
- labels: Record<string, string>;
3121
3120
  env?: Record<string, string> | undefined;
3122
3121
  workspaceId?: string | undefined;
3123
3122
  worktreeName?: string | undefined;
@@ -3135,6 +3134,7 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3135
3134
  git?: unknown;
3136
3135
  worktree?: unknown;
3137
3136
  autoArchive?: boolean | undefined;
3137
+ labels: Record<string, string>;
3138
3138
  }, {
3139
3139
  type: "create_agent_request";
3140
3140
  requestId: string;
@@ -3187,20 +3187,20 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3187
3187
  }, z.ZodTypeAny, "passthrough">>;
3188
3188
  }, "strip", z.ZodTypeAny, {
3189
3189
  type: "create_agent_response";
3190
+ requestId: string;
3190
3191
  payload: {
3191
3192
  agentId: string;
3192
3193
  } & {
3193
3194
  [k: string]: unknown;
3194
3195
  };
3195
- requestId: string;
3196
3196
  }, {
3197
3197
  type: "create_agent_response";
3198
+ requestId: string;
3198
3199
  payload: {
3199
3200
  agentId: string;
3200
3201
  } & {
3201
3202
  [k: string]: unknown;
3202
3203
  };
3203
- requestId: string;
3204
3204
  }>, z.ZodObject<{
3205
3205
  type: z.ZodLiteral<"agent_update">;
3206
3206
  agentId: z.ZodString;
@@ -3210,13 +3210,13 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3210
3210
  }, "strip", z.ZodTypeAny, {
3211
3211
  type: "agent_update";
3212
3212
  agentId: string;
3213
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
3213
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
3214
3214
  title?: string | null | undefined;
3215
3215
  labels?: Record<string, string> | undefined;
3216
3216
  }, {
3217
3217
  type: "agent_update";
3218
3218
  agentId: string;
3219
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
3219
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
3220
3220
  title?: string | null | undefined;
3221
3221
  labels?: Record<string, string> | undefined;
3222
3222
  }>, z.ZodObject<{
@@ -3225,12 +3225,12 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3225
3225
  status: z.ZodEnum<["initializing", "idle", "running", "error", "closed"]>;
3226
3226
  }, "strip", z.ZodTypeAny, {
3227
3227
  type: "agent_status";
3228
- status: "initializing" | "idle" | "running" | "error" | "closed";
3229
3228
  agentId: string;
3229
+ status: "closed" | "error" | "idle" | "initializing" | "running";
3230
3230
  }, {
3231
3231
  type: "agent_status";
3232
- status: "initializing" | "idle" | "running" | "error" | "closed";
3233
3232
  agentId: string;
3233
+ status: "closed" | "error" | "idle" | "initializing" | "running";
3234
3234
  }>, z.ZodObject<{
3235
3235
  type: z.ZodLiteral<"agent_list">;
3236
3236
  agents: z.ZodArray<z.ZodObject<{
@@ -3292,20 +3292,20 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3292
3292
  }, z.ZodTypeAny, "passthrough">>, "many">>;
3293
3293
  }, "strip", z.ZodTypeAny, {
3294
3294
  kind: "user_message";
3295
+ messageId?: string | undefined;
3296
+ text?: string | undefined;
3295
3297
  images?: z.objectOutputType<{
3296
3298
  mimeType: z.ZodOptional<z.ZodString>;
3297
3299
  data: z.ZodOptional<z.ZodString>;
3298
3300
  }, z.ZodTypeAny, "passthrough">[] | undefined;
3299
- messageId?: string | undefined;
3300
- text?: string | undefined;
3301
3301
  }, {
3302
3302
  kind: "user_message";
3303
+ messageId?: string | undefined;
3304
+ text?: string | undefined;
3303
3305
  images?: z.objectInputType<{
3304
3306
  mimeType: z.ZodOptional<z.ZodString>;
3305
3307
  data: z.ZodOptional<z.ZodString>;
3306
3308
  }, z.ZodTypeAny, "passthrough">[] | undefined;
3307
- messageId?: string | undefined;
3308
- text?: string | undefined;
3309
3309
  }>, z.ZodObject<{
3310
3310
  kind: z.ZodLiteral<"assistant_message">;
3311
3311
  messageId: z.ZodOptional<z.ZodString>;
@@ -3362,13 +3362,13 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3362
3362
  }, "strip", z.ZodTypeAny, {
3363
3363
  kind: "edit";
3364
3364
  path?: string | undefined;
3365
- output?: string | undefined;
3366
3365
  diff?: string | undefined;
3366
+ output?: string | undefined;
3367
3367
  }, {
3368
3368
  kind: "edit";
3369
3369
  path?: string | undefined;
3370
- output?: string | undefined;
3371
3370
  diff?: string | undefined;
3371
+ output?: string | undefined;
3372
3372
  }>, z.ZodObject<{
3373
3373
  kind: z.ZodLiteral<"write">;
3374
3374
  path: z.ZodOptional<z.ZodString>;
@@ -3387,12 +3387,12 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3387
3387
  output: z.ZodOptional<z.ZodString>;
3388
3388
  }, "strip", z.ZodTypeAny, {
3389
3389
  kind: "search";
3390
- output?: string | undefined;
3391
3390
  query?: string | undefined;
3391
+ output?: string | undefined;
3392
3392
  }, {
3393
3393
  kind: "search";
3394
- output?: string | undefined;
3395
3394
  query?: string | undefined;
3395
+ output?: string | undefined;
3396
3396
  }>, z.ZodObject<{
3397
3397
  kind: z.ZodLiteral<"fetch">;
3398
3398
  url: z.ZodOptional<z.ZodString>;
@@ -3411,16 +3411,17 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3411
3411
  output: z.ZodOptional<z.ZodString>;
3412
3412
  }, "strip", z.ZodTypeAny, {
3413
3413
  kind: "task";
3414
- output?: string | undefined;
3415
3414
  description?: string | undefined;
3415
+ output?: string | undefined;
3416
3416
  }, {
3417
3417
  kind: "task";
3418
- output?: string | undefined;
3419
3418
  description?: string | undefined;
3419
+ output?: string | undefined;
3420
3420
  }>]>;
3421
3421
  status: z.ZodOptional<z.ZodString>;
3422
3422
  }, "strip", z.ZodTypeAny, {
3423
3423
  kind: "tool_call";
3424
+ callId?: string | undefined;
3424
3425
  tool: {
3425
3426
  kind: "shell";
3426
3427
  command?: string | undefined;
@@ -3432,29 +3433,29 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3432
3433
  } | {
3433
3434
  kind: "edit";
3434
3435
  path?: string | undefined;
3435
- output?: string | undefined;
3436
3436
  diff?: string | undefined;
3437
+ output?: string | undefined;
3437
3438
  } | {
3438
3439
  kind: "write";
3439
3440
  path?: string | undefined;
3440
3441
  output?: string | undefined;
3441
3442
  } | {
3442
3443
  kind: "search";
3443
- output?: string | undefined;
3444
3444
  query?: string | undefined;
3445
+ output?: string | undefined;
3445
3446
  } | {
3446
3447
  kind: "fetch";
3447
3448
  url?: string | undefined;
3448
3449
  output?: string | undefined;
3449
3450
  } | {
3450
3451
  kind: "task";
3451
- output?: string | undefined;
3452
3452
  description?: string | undefined;
3453
+ output?: string | undefined;
3453
3454
  };
3454
3455
  status?: string | undefined;
3455
- callId?: string | undefined;
3456
3456
  }, {
3457
3457
  kind: "tool_call";
3458
+ callId?: string | undefined;
3458
3459
  tool: {
3459
3460
  kind: "shell";
3460
3461
  command?: string | undefined;
@@ -3466,27 +3467,26 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3466
3467
  } | {
3467
3468
  kind: "edit";
3468
3469
  path?: string | undefined;
3469
- output?: string | undefined;
3470
3470
  diff?: string | undefined;
3471
+ output?: string | undefined;
3471
3472
  } | {
3472
3473
  kind: "write";
3473
3474
  path?: string | undefined;
3474
3475
  output?: string | undefined;
3475
3476
  } | {
3476
3477
  kind: "search";
3477
- output?: string | undefined;
3478
3478
  query?: string | undefined;
3479
+ output?: string | undefined;
3479
3480
  } | {
3480
3481
  kind: "fetch";
3481
3482
  url?: string | undefined;
3482
3483
  output?: string | undefined;
3483
3484
  } | {
3484
3485
  kind: "task";
3485
- output?: string | undefined;
3486
3486
  description?: string | undefined;
3487
+ output?: string | undefined;
3487
3488
  };
3488
3489
  status?: string | undefined;
3489
- callId?: string | undefined;
3490
3490
  }>, z.ZodObject<{
3491
3491
  kind: z.ZodLiteral<"turn_started">;
3492
3492
  turnId: z.ZodOptional<z.ZodString>;
@@ -3511,12 +3511,12 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3511
3511
  error: z.ZodOptional<z.ZodString>;
3512
3512
  }, "strip", z.ZodTypeAny, {
3513
3513
  kind: "turn_failed";
3514
- error?: string | undefined;
3515
3514
  turnId?: string | undefined;
3515
+ error?: string | undefined;
3516
3516
  }, {
3517
3517
  kind: "turn_failed";
3518
- error?: string | undefined;
3519
3518
  turnId?: string | undefined;
3519
+ error?: string | undefined;
3520
3520
  }>, z.ZodObject<{
3521
3521
  kind: z.ZodLiteral<"turn_canceled">;
3522
3522
  turnId: z.ZodOptional<z.ZodString>;
@@ -3551,14 +3551,16 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3551
3551
  }, "strip", z.ZodTypeAny, {
3552
3552
  type: "agent_stream";
3553
3553
  agentId: string;
3554
+ seq?: number | undefined;
3555
+ timestamp?: string | number | undefined;
3554
3556
  event: {
3555
3557
  kind: "user_message";
3558
+ messageId?: string | undefined;
3559
+ text?: string | undefined;
3556
3560
  images?: z.objectOutputType<{
3557
3561
  mimeType: z.ZodOptional<z.ZodString>;
3558
3562
  data: z.ZodOptional<z.ZodString>;
3559
3563
  }, z.ZodTypeAny, "passthrough">[] | undefined;
3560
- messageId?: string | undefined;
3561
- text?: string | undefined;
3562
3564
  } | {
3563
3565
  kind: "assistant_message";
3564
3566
  messageId?: string | undefined;
@@ -3568,6 +3570,7 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3568
3570
  text?: string | undefined;
3569
3571
  } | {
3570
3572
  kind: "tool_call";
3573
+ callId?: string | undefined;
3571
3574
  tool: {
3572
3575
  kind: "shell";
3573
3576
  command?: string | undefined;
@@ -3579,27 +3582,26 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3579
3582
  } | {
3580
3583
  kind: "edit";
3581
3584
  path?: string | undefined;
3582
- output?: string | undefined;
3583
3585
  diff?: string | undefined;
3586
+ output?: string | undefined;
3584
3587
  } | {
3585
3588
  kind: "write";
3586
3589
  path?: string | undefined;
3587
3590
  output?: string | undefined;
3588
3591
  } | {
3589
3592
  kind: "search";
3590
- output?: string | undefined;
3591
3593
  query?: string | undefined;
3594
+ output?: string | undefined;
3592
3595
  } | {
3593
3596
  kind: "fetch";
3594
3597
  url?: string | undefined;
3595
3598
  output?: string | undefined;
3596
3599
  } | {
3597
3600
  kind: "task";
3598
- output?: string | undefined;
3599
3601
  description?: string | undefined;
3602
+ output?: string | undefined;
3600
3603
  };
3601
3604
  status?: string | undefined;
3602
- callId?: string | undefined;
3603
3605
  } | {
3604
3606
  kind: "turn_started";
3605
3607
  turnId?: string | undefined;
@@ -3608,8 +3610,8 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3608
3610
  turnId?: string | undefined;
3609
3611
  } | {
3610
3612
  kind: "turn_failed";
3611
- error?: string | undefined;
3612
3613
  turnId?: string | undefined;
3614
+ error?: string | undefined;
3613
3615
  } | {
3614
3616
  kind: "turn_canceled";
3615
3617
  turnId?: string | undefined;
@@ -3621,19 +3623,19 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3621
3623
  steering?: string[] | undefined;
3622
3624
  followUp?: string[] | undefined;
3623
3625
  };
3624
- seq?: number | undefined;
3625
- timestamp?: string | number | undefined;
3626
3626
  }, {
3627
3627
  type: "agent_stream";
3628
3628
  agentId: string;
3629
+ seq?: number | undefined;
3630
+ timestamp?: string | number | undefined;
3629
3631
  event: {
3630
3632
  kind: "user_message";
3633
+ messageId?: string | undefined;
3634
+ text?: string | undefined;
3631
3635
  images?: z.objectInputType<{
3632
3636
  mimeType: z.ZodOptional<z.ZodString>;
3633
3637
  data: z.ZodOptional<z.ZodString>;
3634
3638
  }, z.ZodTypeAny, "passthrough">[] | undefined;
3635
- messageId?: string | undefined;
3636
- text?: string | undefined;
3637
3639
  } | {
3638
3640
  kind: "assistant_message";
3639
3641
  messageId?: string | undefined;
@@ -3643,6 +3645,7 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3643
3645
  text?: string | undefined;
3644
3646
  } | {
3645
3647
  kind: "tool_call";
3648
+ callId?: string | undefined;
3646
3649
  tool: {
3647
3650
  kind: "shell";
3648
3651
  command?: string | undefined;
@@ -3654,27 +3657,26 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3654
3657
  } | {
3655
3658
  kind: "edit";
3656
3659
  path?: string | undefined;
3657
- output?: string | undefined;
3658
3660
  diff?: string | undefined;
3661
+ output?: string | undefined;
3659
3662
  } | {
3660
3663
  kind: "write";
3661
3664
  path?: string | undefined;
3662
3665
  output?: string | undefined;
3663
3666
  } | {
3664
3667
  kind: "search";
3665
- output?: string | undefined;
3666
3668
  query?: string | undefined;
3669
+ output?: string | undefined;
3667
3670
  } | {
3668
3671
  kind: "fetch";
3669
3672
  url?: string | undefined;
3670
3673
  output?: string | undefined;
3671
3674
  } | {
3672
3675
  kind: "task";
3673
- output?: string | undefined;
3674
3676
  description?: string | undefined;
3677
+ output?: string | undefined;
3675
3678
  };
3676
3679
  status?: string | undefined;
3677
- callId?: string | undefined;
3678
3680
  } | {
3679
3681
  kind: "turn_started";
3680
3682
  turnId?: string | undefined;
@@ -3683,8 +3685,8 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3683
3685
  turnId?: string | undefined;
3684
3686
  } | {
3685
3687
  kind: "turn_failed";
3686
- error?: string | undefined;
3687
3688
  turnId?: string | undefined;
3689
+ error?: string | undefined;
3688
3690
  } | {
3689
3691
  kind: "turn_canceled";
3690
3692
  turnId?: string | undefined;
@@ -3696,8 +3698,6 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3696
3698
  steering?: string[] | undefined;
3697
3699
  followUp?: string[] | undefined;
3698
3700
  };
3699
- seq?: number | undefined;
3700
- timestamp?: string | number | undefined;
3701
3701
  }>, z.ZodObject<{
3702
3702
  type: z.ZodLiteral<"fetch_agent_timeline_request">;
3703
3703
  requestId: z.ZodString;
@@ -3709,15 +3709,15 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3709
3709
  type: "fetch_agent_timeline_request";
3710
3710
  requestId: string;
3711
3711
  agentId: string;
3712
- direction: "before" | "after";
3713
3712
  cursor?: string | null | undefined;
3713
+ direction: "after" | "before";
3714
3714
  limit?: number | undefined;
3715
3715
  }, {
3716
3716
  type: "fetch_agent_timeline_request";
3717
3717
  requestId: string;
3718
3718
  agentId: string;
3719
- direction: "before" | "after";
3720
3719
  cursor?: string | null | undefined;
3720
+ direction: "after" | "before";
3721
3721
  limit?: number | undefined;
3722
3722
  }>, z.ZodObject<{
3723
3723
  type: z.ZodLiteral<"fetch_agent_timeline_response">;
@@ -3743,6 +3743,7 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3743
3743
  }, "strip", z.ZodTypeAny, {
3744
3744
  type: "fetch_agent_timeline_response";
3745
3745
  requestId: string;
3746
+ agentId?: string | undefined;
3746
3747
  items: unknown[];
3747
3748
  seqStart: number;
3748
3749
  seqEnd: number;
@@ -3752,12 +3753,12 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3752
3753
  }[];
3753
3754
  collapsed: boolean;
3754
3755
  hasNewer: boolean;
3755
- agentId?: string | undefined;
3756
3756
  startCursor?: string | null | undefined;
3757
3757
  endCursor?: string | null | undefined;
3758
3758
  }, {
3759
3759
  type: "fetch_agent_timeline_response";
3760
3760
  requestId: string;
3761
+ agentId?: string | undefined;
3761
3762
  items: unknown[];
3762
3763
  seqStart: number;
3763
3764
  seqEnd: number;
@@ -3767,7 +3768,6 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3767
3768
  }[];
3768
3769
  collapsed: boolean;
3769
3770
  hasNewer: boolean;
3770
- agentId?: string | undefined;
3771
3771
  startCursor?: string | null | undefined;
3772
3772
  endCursor?: string | null | undefined;
3773
3773
  }>, z.ZodObject<{
@@ -3807,13 +3807,13 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3807
3807
  }, "strip", z.ZodTypeAny, {
3808
3808
  kind: "edit";
3809
3809
  path?: string | undefined;
3810
- output?: string | undefined;
3811
3810
  diff?: string | undefined;
3811
+ output?: string | undefined;
3812
3812
  }, {
3813
3813
  kind: "edit";
3814
3814
  path?: string | undefined;
3815
- output?: string | undefined;
3816
3815
  diff?: string | undefined;
3816
+ output?: string | undefined;
3817
3817
  }>, z.ZodObject<{
3818
3818
  kind: z.ZodLiteral<"write">;
3819
3819
  path: z.ZodOptional<z.ZodString>;
@@ -3832,12 +3832,12 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3832
3832
  output: z.ZodOptional<z.ZodString>;
3833
3833
  }, "strip", z.ZodTypeAny, {
3834
3834
  kind: "search";
3835
- output?: string | undefined;
3836
3835
  query?: string | undefined;
3836
+ output?: string | undefined;
3837
3837
  }, {
3838
3838
  kind: "search";
3839
- output?: string | undefined;
3840
3839
  query?: string | undefined;
3840
+ output?: string | undefined;
3841
3841
  }>, z.ZodObject<{
3842
3842
  kind: z.ZodLiteral<"fetch">;
3843
3843
  url: z.ZodOptional<z.ZodString>;
@@ -3856,12 +3856,12 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3856
3856
  output: z.ZodOptional<z.ZodString>;
3857
3857
  }, "strip", z.ZodTypeAny, {
3858
3858
  kind: "task";
3859
- output?: string | undefined;
3860
3859
  description?: string | undefined;
3860
+ output?: string | undefined;
3861
3861
  }, {
3862
3862
  kind: "task";
3863
- output?: string | undefined;
3864
3863
  description?: string | undefined;
3864
+ output?: string | undefined;
3865
3865
  }>]>>;
3866
3866
  action: z.ZodOptional<z.ZodUnknown>;
3867
3867
  responses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -3869,6 +3869,7 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3869
3869
  type: "agent_permission_request";
3870
3870
  requestId: string;
3871
3871
  agentId: string;
3872
+ toolName?: string | undefined;
3872
3873
  tool?: {
3873
3874
  kind: "shell";
3874
3875
  command?: string | undefined;
@@ -3880,32 +3881,32 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3880
3881
  } | {
3881
3882
  kind: "edit";
3882
3883
  path?: string | undefined;
3883
- output?: string | undefined;
3884
3884
  diff?: string | undefined;
3885
+ output?: string | undefined;
3885
3886
  } | {
3886
3887
  kind: "write";
3887
3888
  path?: string | undefined;
3888
3889
  output?: string | undefined;
3889
3890
  } | {
3890
3891
  kind: "search";
3891
- output?: string | undefined;
3892
3892
  query?: string | undefined;
3893
+ output?: string | undefined;
3893
3894
  } | {
3894
3895
  kind: "fetch";
3895
3896
  url?: string | undefined;
3896
3897
  output?: string | undefined;
3897
3898
  } | {
3898
3899
  kind: "task";
3899
- output?: string | undefined;
3900
3900
  description?: string | undefined;
3901
+ output?: string | undefined;
3901
3902
  } | undefined;
3902
- toolName?: string | undefined;
3903
3903
  action?: unknown;
3904
3904
  responses?: string[] | undefined;
3905
3905
  }, {
3906
3906
  type: "agent_permission_request";
3907
3907
  requestId: string;
3908
3908
  agentId: string;
3909
+ toolName?: string | undefined;
3909
3910
  tool?: {
3910
3911
  kind: "shell";
3911
3912
  command?: string | undefined;
@@ -3917,26 +3918,25 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3917
3918
  } | {
3918
3919
  kind: "edit";
3919
3920
  path?: string | undefined;
3920
- output?: string | undefined;
3921
3921
  diff?: string | undefined;
3922
+ output?: string | undefined;
3922
3923
  } | {
3923
3924
  kind: "write";
3924
3925
  path?: string | undefined;
3925
3926
  output?: string | undefined;
3926
3927
  } | {
3927
3928
  kind: "search";
3928
- output?: string | undefined;
3929
3929
  query?: string | undefined;
3930
+ output?: string | undefined;
3930
3931
  } | {
3931
3932
  kind: "fetch";
3932
3933
  url?: string | undefined;
3933
3934
  output?: string | undefined;
3934
3935
  } | {
3935
3936
  kind: "task";
3936
- output?: string | undefined;
3937
3937
  description?: string | undefined;
3938
+ output?: string | undefined;
3938
3939
  } | undefined;
3939
- toolName?: string | undefined;
3940
3940
  action?: unknown;
3941
3941
  responses?: string[] | undefined;
3942
3942
  }>, z.ZodObject<{
@@ -3981,20 +3981,20 @@ export declare const sessionMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
3981
3981
  }, z.ZodTypeAny, "passthrough">>;
3982
3982
  }, "strip", z.ZodTypeAny, {
3983
3983
  type: "agent.permission.respond.response";
3984
+ requestId: string;
3984
3985
  payload: {
3985
3986
  resolved: boolean;
3986
3987
  } & {
3987
3988
  [k: string]: unknown;
3988
3989
  };
3989
- requestId: string;
3990
3990
  }, {
3991
3991
  type: "agent.permission.respond.response";
3992
+ requestId: string;
3992
3993
  payload: {
3993
3994
  resolved: boolean;
3994
3995
  } & {
3995
3996
  [k: string]: unknown;
3996
3997
  };
3997
- requestId: string;
3998
3998
  }>, z.ZodObject<{
3999
3999
  type: z.ZodLiteral<"respond_to_permission">;
4000
4000
  requestId: z.ZodString;
@@ -5371,7 +5371,6 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5371
5371
  systemPrompt?: string | undefined;
5372
5372
  mcpServers?: Record<string, unknown> | undefined;
5373
5373
  };
5374
- labels: Record<string, string>;
5375
5374
  env?: Record<string, string> | undefined;
5376
5375
  workspaceId?: string | undefined;
5377
5376
  worktreeName?: string | undefined;
@@ -5389,6 +5388,7 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5389
5388
  git?: unknown;
5390
5389
  worktree?: unknown;
5391
5390
  autoArchive?: boolean | undefined;
5391
+ labels: Record<string, string>;
5392
5392
  }, {
5393
5393
  type: "create_agent_request";
5394
5394
  requestId: string;
@@ -5441,20 +5441,20 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5441
5441
  }, z.ZodTypeAny, "passthrough">>;
5442
5442
  }, "strip", z.ZodTypeAny, {
5443
5443
  type: "create_agent_response";
5444
+ requestId: string;
5444
5445
  payload: {
5445
5446
  agentId: string;
5446
5447
  } & {
5447
5448
  [k: string]: unknown;
5448
5449
  };
5449
- requestId: string;
5450
5450
  }, {
5451
5451
  type: "create_agent_response";
5452
+ requestId: string;
5452
5453
  payload: {
5453
5454
  agentId: string;
5454
5455
  } & {
5455
5456
  [k: string]: unknown;
5456
5457
  };
5457
- requestId: string;
5458
5458
  }>, z.ZodObject<{
5459
5459
  type: z.ZodLiteral<"agent_update">;
5460
5460
  agentId: z.ZodString;
@@ -5464,13 +5464,13 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5464
5464
  }, "strip", z.ZodTypeAny, {
5465
5465
  type: "agent_update";
5466
5466
  agentId: string;
5467
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
5467
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
5468
5468
  title?: string | null | undefined;
5469
5469
  labels?: Record<string, string> | undefined;
5470
5470
  }, {
5471
5471
  type: "agent_update";
5472
5472
  agentId: string;
5473
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
5473
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
5474
5474
  title?: string | null | undefined;
5475
5475
  labels?: Record<string, string> | undefined;
5476
5476
  }>, z.ZodObject<{
@@ -5479,12 +5479,12 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5479
5479
  status: z.ZodEnum<["initializing", "idle", "running", "error", "closed"]>;
5480
5480
  }, "strip", z.ZodTypeAny, {
5481
5481
  type: "agent_status";
5482
- status: "initializing" | "idle" | "running" | "error" | "closed";
5483
5482
  agentId: string;
5483
+ status: "closed" | "error" | "idle" | "initializing" | "running";
5484
5484
  }, {
5485
5485
  type: "agent_status";
5486
- status: "initializing" | "idle" | "running" | "error" | "closed";
5487
5486
  agentId: string;
5487
+ status: "closed" | "error" | "idle" | "initializing" | "running";
5488
5488
  }>, z.ZodObject<{
5489
5489
  type: z.ZodLiteral<"agent_list">;
5490
5490
  agents: z.ZodArray<z.ZodObject<{
@@ -5546,20 +5546,20 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5546
5546
  }, z.ZodTypeAny, "passthrough">>, "many">>;
5547
5547
  }, "strip", z.ZodTypeAny, {
5548
5548
  kind: "user_message";
5549
+ messageId?: string | undefined;
5550
+ text?: string | undefined;
5549
5551
  images?: z.objectOutputType<{
5550
5552
  mimeType: z.ZodOptional<z.ZodString>;
5551
5553
  data: z.ZodOptional<z.ZodString>;
5552
5554
  }, z.ZodTypeAny, "passthrough">[] | undefined;
5553
- messageId?: string | undefined;
5554
- text?: string | undefined;
5555
5555
  }, {
5556
5556
  kind: "user_message";
5557
+ messageId?: string | undefined;
5558
+ text?: string | undefined;
5557
5559
  images?: z.objectInputType<{
5558
5560
  mimeType: z.ZodOptional<z.ZodString>;
5559
5561
  data: z.ZodOptional<z.ZodString>;
5560
5562
  }, z.ZodTypeAny, "passthrough">[] | undefined;
5561
- messageId?: string | undefined;
5562
- text?: string | undefined;
5563
5563
  }>, z.ZodObject<{
5564
5564
  kind: z.ZodLiteral<"assistant_message">;
5565
5565
  messageId: z.ZodOptional<z.ZodString>;
@@ -5616,13 +5616,13 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5616
5616
  }, "strip", z.ZodTypeAny, {
5617
5617
  kind: "edit";
5618
5618
  path?: string | undefined;
5619
- output?: string | undefined;
5620
5619
  diff?: string | undefined;
5620
+ output?: string | undefined;
5621
5621
  }, {
5622
5622
  kind: "edit";
5623
5623
  path?: string | undefined;
5624
- output?: string | undefined;
5625
5624
  diff?: string | undefined;
5625
+ output?: string | undefined;
5626
5626
  }>, z.ZodObject<{
5627
5627
  kind: z.ZodLiteral<"write">;
5628
5628
  path: z.ZodOptional<z.ZodString>;
@@ -5641,12 +5641,12 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5641
5641
  output: z.ZodOptional<z.ZodString>;
5642
5642
  }, "strip", z.ZodTypeAny, {
5643
5643
  kind: "search";
5644
- output?: string | undefined;
5645
5644
  query?: string | undefined;
5645
+ output?: string | undefined;
5646
5646
  }, {
5647
5647
  kind: "search";
5648
- output?: string | undefined;
5649
5648
  query?: string | undefined;
5649
+ output?: string | undefined;
5650
5650
  }>, z.ZodObject<{
5651
5651
  kind: z.ZodLiteral<"fetch">;
5652
5652
  url: z.ZodOptional<z.ZodString>;
@@ -5665,16 +5665,17 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5665
5665
  output: z.ZodOptional<z.ZodString>;
5666
5666
  }, "strip", z.ZodTypeAny, {
5667
5667
  kind: "task";
5668
- output?: string | undefined;
5669
5668
  description?: string | undefined;
5669
+ output?: string | undefined;
5670
5670
  }, {
5671
5671
  kind: "task";
5672
- output?: string | undefined;
5673
5672
  description?: string | undefined;
5673
+ output?: string | undefined;
5674
5674
  }>]>;
5675
5675
  status: z.ZodOptional<z.ZodString>;
5676
5676
  }, "strip", z.ZodTypeAny, {
5677
5677
  kind: "tool_call";
5678
+ callId?: string | undefined;
5678
5679
  tool: {
5679
5680
  kind: "shell";
5680
5681
  command?: string | undefined;
@@ -5686,29 +5687,29 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5686
5687
  } | {
5687
5688
  kind: "edit";
5688
5689
  path?: string | undefined;
5689
- output?: string | undefined;
5690
5690
  diff?: string | undefined;
5691
+ output?: string | undefined;
5691
5692
  } | {
5692
5693
  kind: "write";
5693
5694
  path?: string | undefined;
5694
5695
  output?: string | undefined;
5695
5696
  } | {
5696
5697
  kind: "search";
5697
- output?: string | undefined;
5698
5698
  query?: string | undefined;
5699
+ output?: string | undefined;
5699
5700
  } | {
5700
5701
  kind: "fetch";
5701
5702
  url?: string | undefined;
5702
5703
  output?: string | undefined;
5703
5704
  } | {
5704
5705
  kind: "task";
5705
- output?: string | undefined;
5706
5706
  description?: string | undefined;
5707
+ output?: string | undefined;
5707
5708
  };
5708
5709
  status?: string | undefined;
5709
- callId?: string | undefined;
5710
5710
  }, {
5711
5711
  kind: "tool_call";
5712
+ callId?: string | undefined;
5712
5713
  tool: {
5713
5714
  kind: "shell";
5714
5715
  command?: string | undefined;
@@ -5720,27 +5721,26 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5720
5721
  } | {
5721
5722
  kind: "edit";
5722
5723
  path?: string | undefined;
5723
- output?: string | undefined;
5724
5724
  diff?: string | undefined;
5725
+ output?: string | undefined;
5725
5726
  } | {
5726
5727
  kind: "write";
5727
5728
  path?: string | undefined;
5728
5729
  output?: string | undefined;
5729
5730
  } | {
5730
5731
  kind: "search";
5731
- output?: string | undefined;
5732
5732
  query?: string | undefined;
5733
+ output?: string | undefined;
5733
5734
  } | {
5734
5735
  kind: "fetch";
5735
5736
  url?: string | undefined;
5736
5737
  output?: string | undefined;
5737
5738
  } | {
5738
5739
  kind: "task";
5739
- output?: string | undefined;
5740
5740
  description?: string | undefined;
5741
+ output?: string | undefined;
5741
5742
  };
5742
5743
  status?: string | undefined;
5743
- callId?: string | undefined;
5744
5744
  }>, z.ZodObject<{
5745
5745
  kind: z.ZodLiteral<"turn_started">;
5746
5746
  turnId: z.ZodOptional<z.ZodString>;
@@ -5765,12 +5765,12 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5765
5765
  error: z.ZodOptional<z.ZodString>;
5766
5766
  }, "strip", z.ZodTypeAny, {
5767
5767
  kind: "turn_failed";
5768
- error?: string | undefined;
5769
5768
  turnId?: string | undefined;
5769
+ error?: string | undefined;
5770
5770
  }, {
5771
5771
  kind: "turn_failed";
5772
- error?: string | undefined;
5773
5772
  turnId?: string | undefined;
5773
+ error?: string | undefined;
5774
5774
  }>, z.ZodObject<{
5775
5775
  kind: z.ZodLiteral<"turn_canceled">;
5776
5776
  turnId: z.ZodOptional<z.ZodString>;
@@ -5805,14 +5805,16 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5805
5805
  }, "strip", z.ZodTypeAny, {
5806
5806
  type: "agent_stream";
5807
5807
  agentId: string;
5808
+ seq?: number | undefined;
5809
+ timestamp?: string | number | undefined;
5808
5810
  event: {
5809
5811
  kind: "user_message";
5812
+ messageId?: string | undefined;
5813
+ text?: string | undefined;
5810
5814
  images?: z.objectOutputType<{
5811
5815
  mimeType: z.ZodOptional<z.ZodString>;
5812
5816
  data: z.ZodOptional<z.ZodString>;
5813
5817
  }, z.ZodTypeAny, "passthrough">[] | undefined;
5814
- messageId?: string | undefined;
5815
- text?: string | undefined;
5816
5818
  } | {
5817
5819
  kind: "assistant_message";
5818
5820
  messageId?: string | undefined;
@@ -5822,6 +5824,7 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5822
5824
  text?: string | undefined;
5823
5825
  } | {
5824
5826
  kind: "tool_call";
5827
+ callId?: string | undefined;
5825
5828
  tool: {
5826
5829
  kind: "shell";
5827
5830
  command?: string | undefined;
@@ -5833,27 +5836,26 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5833
5836
  } | {
5834
5837
  kind: "edit";
5835
5838
  path?: string | undefined;
5836
- output?: string | undefined;
5837
5839
  diff?: string | undefined;
5840
+ output?: string | undefined;
5838
5841
  } | {
5839
5842
  kind: "write";
5840
5843
  path?: string | undefined;
5841
5844
  output?: string | undefined;
5842
5845
  } | {
5843
5846
  kind: "search";
5844
- output?: string | undefined;
5845
5847
  query?: string | undefined;
5848
+ output?: string | undefined;
5846
5849
  } | {
5847
5850
  kind: "fetch";
5848
5851
  url?: string | undefined;
5849
5852
  output?: string | undefined;
5850
5853
  } | {
5851
5854
  kind: "task";
5852
- output?: string | undefined;
5853
5855
  description?: string | undefined;
5856
+ output?: string | undefined;
5854
5857
  };
5855
5858
  status?: string | undefined;
5856
- callId?: string | undefined;
5857
5859
  } | {
5858
5860
  kind: "turn_started";
5859
5861
  turnId?: string | undefined;
@@ -5862,8 +5864,8 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5862
5864
  turnId?: string | undefined;
5863
5865
  } | {
5864
5866
  kind: "turn_failed";
5865
- error?: string | undefined;
5866
5867
  turnId?: string | undefined;
5868
+ error?: string | undefined;
5867
5869
  } | {
5868
5870
  kind: "turn_canceled";
5869
5871
  turnId?: string | undefined;
@@ -5875,19 +5877,19 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5875
5877
  steering?: string[] | undefined;
5876
5878
  followUp?: string[] | undefined;
5877
5879
  };
5878
- seq?: number | undefined;
5879
- timestamp?: string | number | undefined;
5880
5880
  }, {
5881
5881
  type: "agent_stream";
5882
5882
  agentId: string;
5883
+ seq?: number | undefined;
5884
+ timestamp?: string | number | undefined;
5883
5885
  event: {
5884
5886
  kind: "user_message";
5887
+ messageId?: string | undefined;
5888
+ text?: string | undefined;
5885
5889
  images?: z.objectInputType<{
5886
5890
  mimeType: z.ZodOptional<z.ZodString>;
5887
5891
  data: z.ZodOptional<z.ZodString>;
5888
5892
  }, z.ZodTypeAny, "passthrough">[] | undefined;
5889
- messageId?: string | undefined;
5890
- text?: string | undefined;
5891
5893
  } | {
5892
5894
  kind: "assistant_message";
5893
5895
  messageId?: string | undefined;
@@ -5897,6 +5899,7 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5897
5899
  text?: string | undefined;
5898
5900
  } | {
5899
5901
  kind: "tool_call";
5902
+ callId?: string | undefined;
5900
5903
  tool: {
5901
5904
  kind: "shell";
5902
5905
  command?: string | undefined;
@@ -5908,27 +5911,26 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5908
5911
  } | {
5909
5912
  kind: "edit";
5910
5913
  path?: string | undefined;
5911
- output?: string | undefined;
5912
5914
  diff?: string | undefined;
5915
+ output?: string | undefined;
5913
5916
  } | {
5914
5917
  kind: "write";
5915
5918
  path?: string | undefined;
5916
5919
  output?: string | undefined;
5917
5920
  } | {
5918
5921
  kind: "search";
5919
- output?: string | undefined;
5920
5922
  query?: string | undefined;
5923
+ output?: string | undefined;
5921
5924
  } | {
5922
5925
  kind: "fetch";
5923
5926
  url?: string | undefined;
5924
5927
  output?: string | undefined;
5925
5928
  } | {
5926
5929
  kind: "task";
5927
- output?: string | undefined;
5928
5930
  description?: string | undefined;
5931
+ output?: string | undefined;
5929
5932
  };
5930
5933
  status?: string | undefined;
5931
- callId?: string | undefined;
5932
5934
  } | {
5933
5935
  kind: "turn_started";
5934
5936
  turnId?: string | undefined;
@@ -5937,8 +5939,8 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5937
5939
  turnId?: string | undefined;
5938
5940
  } | {
5939
5941
  kind: "turn_failed";
5940
- error?: string | undefined;
5941
5942
  turnId?: string | undefined;
5943
+ error?: string | undefined;
5942
5944
  } | {
5943
5945
  kind: "turn_canceled";
5944
5946
  turnId?: string | undefined;
@@ -5950,8 +5952,6 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5950
5952
  steering?: string[] | undefined;
5951
5953
  followUp?: string[] | undefined;
5952
5954
  };
5953
- seq?: number | undefined;
5954
- timestamp?: string | number | undefined;
5955
5955
  }>, z.ZodObject<{
5956
5956
  type: z.ZodLiteral<"fetch_agent_timeline_request">;
5957
5957
  requestId: z.ZodString;
@@ -5963,15 +5963,15 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5963
5963
  type: "fetch_agent_timeline_request";
5964
5964
  requestId: string;
5965
5965
  agentId: string;
5966
- direction: "before" | "after";
5967
5966
  cursor?: string | null | undefined;
5967
+ direction: "after" | "before";
5968
5968
  limit?: number | undefined;
5969
5969
  }, {
5970
5970
  type: "fetch_agent_timeline_request";
5971
5971
  requestId: string;
5972
5972
  agentId: string;
5973
- direction: "before" | "after";
5974
5973
  cursor?: string | null | undefined;
5974
+ direction: "after" | "before";
5975
5975
  limit?: number | undefined;
5976
5976
  }>, z.ZodObject<{
5977
5977
  type: z.ZodLiteral<"fetch_agent_timeline_response">;
@@ -5997,6 +5997,7 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
5997
5997
  }, "strip", z.ZodTypeAny, {
5998
5998
  type: "fetch_agent_timeline_response";
5999
5999
  requestId: string;
6000
+ agentId?: string | undefined;
6000
6001
  items: unknown[];
6001
6002
  seqStart: number;
6002
6003
  seqEnd: number;
@@ -6006,12 +6007,12 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
6006
6007
  }[];
6007
6008
  collapsed: boolean;
6008
6009
  hasNewer: boolean;
6009
- agentId?: string | undefined;
6010
6010
  startCursor?: string | null | undefined;
6011
6011
  endCursor?: string | null | undefined;
6012
6012
  }, {
6013
6013
  type: "fetch_agent_timeline_response";
6014
6014
  requestId: string;
6015
+ agentId?: string | undefined;
6015
6016
  items: unknown[];
6016
6017
  seqStart: number;
6017
6018
  seqEnd: number;
@@ -6021,7 +6022,6 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
6021
6022
  }[];
6022
6023
  collapsed: boolean;
6023
6024
  hasNewer: boolean;
6024
- agentId?: string | undefined;
6025
6025
  startCursor?: string | null | undefined;
6026
6026
  endCursor?: string | null | undefined;
6027
6027
  }>, z.ZodObject<{
@@ -6061,13 +6061,13 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
6061
6061
  }, "strip", z.ZodTypeAny, {
6062
6062
  kind: "edit";
6063
6063
  path?: string | undefined;
6064
- output?: string | undefined;
6065
6064
  diff?: string | undefined;
6065
+ output?: string | undefined;
6066
6066
  }, {
6067
6067
  kind: "edit";
6068
6068
  path?: string | undefined;
6069
- output?: string | undefined;
6070
6069
  diff?: string | undefined;
6070
+ output?: string | undefined;
6071
6071
  }>, z.ZodObject<{
6072
6072
  kind: z.ZodLiteral<"write">;
6073
6073
  path: z.ZodOptional<z.ZodString>;
@@ -6086,12 +6086,12 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
6086
6086
  output: z.ZodOptional<z.ZodString>;
6087
6087
  }, "strip", z.ZodTypeAny, {
6088
6088
  kind: "search";
6089
- output?: string | undefined;
6090
6089
  query?: string | undefined;
6090
+ output?: string | undefined;
6091
6091
  }, {
6092
6092
  kind: "search";
6093
- output?: string | undefined;
6094
6093
  query?: string | undefined;
6094
+ output?: string | undefined;
6095
6095
  }>, z.ZodObject<{
6096
6096
  kind: z.ZodLiteral<"fetch">;
6097
6097
  url: z.ZodOptional<z.ZodString>;
@@ -6110,12 +6110,12 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
6110
6110
  output: z.ZodOptional<z.ZodString>;
6111
6111
  }, "strip", z.ZodTypeAny, {
6112
6112
  kind: "task";
6113
- output?: string | undefined;
6114
6113
  description?: string | undefined;
6114
+ output?: string | undefined;
6115
6115
  }, {
6116
6116
  kind: "task";
6117
- output?: string | undefined;
6118
6117
  description?: string | undefined;
6118
+ output?: string | undefined;
6119
6119
  }>]>>;
6120
6120
  action: z.ZodOptional<z.ZodUnknown>;
6121
6121
  responses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -6123,6 +6123,7 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
6123
6123
  type: "agent_permission_request";
6124
6124
  requestId: string;
6125
6125
  agentId: string;
6126
+ toolName?: string | undefined;
6126
6127
  tool?: {
6127
6128
  kind: "shell";
6128
6129
  command?: string | undefined;
@@ -6134,32 +6135,32 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
6134
6135
  } | {
6135
6136
  kind: "edit";
6136
6137
  path?: string | undefined;
6137
- output?: string | undefined;
6138
6138
  diff?: string | undefined;
6139
+ output?: string | undefined;
6139
6140
  } | {
6140
6141
  kind: "write";
6141
6142
  path?: string | undefined;
6142
6143
  output?: string | undefined;
6143
6144
  } | {
6144
6145
  kind: "search";
6145
- output?: string | undefined;
6146
6146
  query?: string | undefined;
6147
+ output?: string | undefined;
6147
6148
  } | {
6148
6149
  kind: "fetch";
6149
6150
  url?: string | undefined;
6150
6151
  output?: string | undefined;
6151
6152
  } | {
6152
6153
  kind: "task";
6153
- output?: string | undefined;
6154
6154
  description?: string | undefined;
6155
+ output?: string | undefined;
6155
6156
  } | undefined;
6156
- toolName?: string | undefined;
6157
6157
  action?: unknown;
6158
6158
  responses?: string[] | undefined;
6159
6159
  }, {
6160
6160
  type: "agent_permission_request";
6161
6161
  requestId: string;
6162
6162
  agentId: string;
6163
+ toolName?: string | undefined;
6163
6164
  tool?: {
6164
6165
  kind: "shell";
6165
6166
  command?: string | undefined;
@@ -6171,26 +6172,25 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
6171
6172
  } | {
6172
6173
  kind: "edit";
6173
6174
  path?: string | undefined;
6174
- output?: string | undefined;
6175
6175
  diff?: string | undefined;
6176
+ output?: string | undefined;
6176
6177
  } | {
6177
6178
  kind: "write";
6178
6179
  path?: string | undefined;
6179
6180
  output?: string | undefined;
6180
6181
  } | {
6181
6182
  kind: "search";
6182
- output?: string | undefined;
6183
6183
  query?: string | undefined;
6184
+ output?: string | undefined;
6184
6185
  } | {
6185
6186
  kind: "fetch";
6186
6187
  url?: string | undefined;
6187
6188
  output?: string | undefined;
6188
6189
  } | {
6189
6190
  kind: "task";
6190
- output?: string | undefined;
6191
6191
  description?: string | undefined;
6192
+ output?: string | undefined;
6192
6193
  } | undefined;
6193
- toolName?: string | undefined;
6194
6194
  action?: unknown;
6195
6195
  responses?: string[] | undefined;
6196
6196
  }>, z.ZodObject<{
@@ -6235,20 +6235,20 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
6235
6235
  }, z.ZodTypeAny, "passthrough">>;
6236
6236
  }, "strip", z.ZodTypeAny, {
6237
6237
  type: "agent.permission.respond.response";
6238
+ requestId: string;
6238
6239
  payload: {
6239
6240
  resolved: boolean;
6240
6241
  } & {
6241
6242
  [k: string]: unknown;
6242
6243
  };
6243
- requestId: string;
6244
6244
  }, {
6245
6245
  type: "agent.permission.respond.response";
6246
+ requestId: string;
6246
6247
  payload: {
6247
6248
  resolved: boolean;
6248
6249
  } & {
6249
6250
  [k: string]: unknown;
6250
6251
  };
6251
- requestId: string;
6252
6252
  }>, z.ZodObject<{
6253
6253
  type: z.ZodLiteral<"respond_to_permission">;
6254
6254
  requestId: z.ZodString;
@@ -7493,6 +7493,7 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
7493
7493
  type: z.ZodString;
7494
7494
  }, z.ZodTypeAny, "passthrough">>]>;
7495
7495
  }, "strip", z.ZodTypeAny, {
7496
+ type: "session";
7496
7497
  message: {
7497
7498
  type: "create_agent_request";
7498
7499
  requestId: string;
@@ -7515,7 +7516,6 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
7515
7516
  systemPrompt?: string | undefined;
7516
7517
  mcpServers?: Record<string, unknown> | undefined;
7517
7518
  };
7518
- labels: Record<string, string>;
7519
7519
  env?: Record<string, string> | undefined;
7520
7520
  workspaceId?: string | undefined;
7521
7521
  worktreeName?: string | undefined;
@@ -7533,24 +7533,25 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
7533
7533
  git?: unknown;
7534
7534
  worktree?: unknown;
7535
7535
  autoArchive?: boolean | undefined;
7536
+ labels: Record<string, string>;
7536
7537
  } | {
7537
7538
  type: "create_agent_response";
7539
+ requestId: string;
7538
7540
  payload: {
7539
7541
  agentId: string;
7540
7542
  } & {
7541
7543
  [k: string]: unknown;
7542
7544
  };
7543
- requestId: string;
7544
7545
  } | {
7545
7546
  type: "agent_update";
7546
7547
  agentId: string;
7547
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
7548
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
7548
7549
  title?: string | null | undefined;
7549
7550
  labels?: Record<string, string> | undefined;
7550
7551
  } | {
7551
7552
  type: "agent_status";
7552
- status: "initializing" | "idle" | "running" | "error" | "closed";
7553
7553
  agentId: string;
7554
+ status: "closed" | "error" | "idle" | "initializing" | "running";
7554
7555
  } | {
7555
7556
  type: "agent_list";
7556
7557
  agents: z.objectOutputType<{
@@ -7566,14 +7567,16 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
7566
7567
  } | {
7567
7568
  type: "agent_stream";
7568
7569
  agentId: string;
7570
+ seq?: number | undefined;
7571
+ timestamp?: string | number | undefined;
7569
7572
  event: {
7570
7573
  kind: "user_message";
7574
+ messageId?: string | undefined;
7575
+ text?: string | undefined;
7571
7576
  images?: z.objectOutputType<{
7572
7577
  mimeType: z.ZodOptional<z.ZodString>;
7573
7578
  data: z.ZodOptional<z.ZodString>;
7574
7579
  }, z.ZodTypeAny, "passthrough">[] | undefined;
7575
- messageId?: string | undefined;
7576
- text?: string | undefined;
7577
7580
  } | {
7578
7581
  kind: "assistant_message";
7579
7582
  messageId?: string | undefined;
@@ -7583,6 +7586,7 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
7583
7586
  text?: string | undefined;
7584
7587
  } | {
7585
7588
  kind: "tool_call";
7589
+ callId?: string | undefined;
7586
7590
  tool: {
7587
7591
  kind: "shell";
7588
7592
  command?: string | undefined;
@@ -7594,27 +7598,26 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
7594
7598
  } | {
7595
7599
  kind: "edit";
7596
7600
  path?: string | undefined;
7597
- output?: string | undefined;
7598
7601
  diff?: string | undefined;
7602
+ output?: string | undefined;
7599
7603
  } | {
7600
7604
  kind: "write";
7601
7605
  path?: string | undefined;
7602
7606
  output?: string | undefined;
7603
7607
  } | {
7604
7608
  kind: "search";
7605
- output?: string | undefined;
7606
7609
  query?: string | undefined;
7610
+ output?: string | undefined;
7607
7611
  } | {
7608
7612
  kind: "fetch";
7609
7613
  url?: string | undefined;
7610
7614
  output?: string | undefined;
7611
7615
  } | {
7612
7616
  kind: "task";
7613
- output?: string | undefined;
7614
7617
  description?: string | undefined;
7618
+ output?: string | undefined;
7615
7619
  };
7616
7620
  status?: string | undefined;
7617
- callId?: string | undefined;
7618
7621
  } | {
7619
7622
  kind: "turn_started";
7620
7623
  turnId?: string | undefined;
@@ -7623,8 +7626,8 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
7623
7626
  turnId?: string | undefined;
7624
7627
  } | {
7625
7628
  kind: "turn_failed";
7626
- error?: string | undefined;
7627
7629
  turnId?: string | undefined;
7630
+ error?: string | undefined;
7628
7631
  } | {
7629
7632
  kind: "turn_canceled";
7630
7633
  turnId?: string | undefined;
@@ -7636,18 +7639,17 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
7636
7639
  steering?: string[] | undefined;
7637
7640
  followUp?: string[] | undefined;
7638
7641
  };
7639
- seq?: number | undefined;
7640
- timestamp?: string | number | undefined;
7641
7642
  } | {
7642
7643
  type: "fetch_agent_timeline_request";
7643
7644
  requestId: string;
7644
7645
  agentId: string;
7645
- direction: "before" | "after";
7646
7646
  cursor?: string | null | undefined;
7647
+ direction: "after" | "before";
7647
7648
  limit?: number | undefined;
7648
7649
  } | {
7649
7650
  type: "fetch_agent_timeline_response";
7650
7651
  requestId: string;
7652
+ agentId?: string | undefined;
7651
7653
  items: unknown[];
7652
7654
  seqStart: number;
7653
7655
  seqEnd: number;
@@ -7657,13 +7659,13 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
7657
7659
  }[];
7658
7660
  collapsed: boolean;
7659
7661
  hasNewer: boolean;
7660
- agentId?: string | undefined;
7661
7662
  startCursor?: string | null | undefined;
7662
7663
  endCursor?: string | null | undefined;
7663
7664
  } | {
7664
7665
  type: "agent_permission_request";
7665
7666
  requestId: string;
7666
7667
  agentId: string;
7668
+ toolName?: string | undefined;
7667
7669
  tool?: {
7668
7670
  kind: "shell";
7669
7671
  command?: string | undefined;
@@ -7675,26 +7677,25 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
7675
7677
  } | {
7676
7678
  kind: "edit";
7677
7679
  path?: string | undefined;
7678
- output?: string | undefined;
7679
7680
  diff?: string | undefined;
7681
+ output?: string | undefined;
7680
7682
  } | {
7681
7683
  kind: "write";
7682
7684
  path?: string | undefined;
7683
7685
  output?: string | undefined;
7684
7686
  } | {
7685
7687
  kind: "search";
7686
- output?: string | undefined;
7687
7688
  query?: string | undefined;
7689
+ output?: string | undefined;
7688
7690
  } | {
7689
7691
  kind: "fetch";
7690
7692
  url?: string | undefined;
7691
7693
  output?: string | undefined;
7692
7694
  } | {
7693
7695
  kind: "task";
7694
- output?: string | undefined;
7695
7696
  description?: string | undefined;
7697
+ output?: string | undefined;
7696
7698
  } | undefined;
7697
- toolName?: string | undefined;
7698
7699
  action?: unknown;
7699
7700
  responses?: string[] | undefined;
7700
7701
  } | {
@@ -7709,17 +7710,23 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
7709
7710
  response?: unknown;
7710
7711
  } | {
7711
7712
  type: "agent.permission.respond.response";
7713
+ requestId: string;
7712
7714
  payload: {
7713
7715
  resolved: boolean;
7714
7716
  } & {
7715
7717
  [k: string]: unknown;
7716
7718
  };
7717
- requestId: string;
7718
7719
  } | {
7719
7720
  type: "respond_to_permission";
7720
7721
  requestId: string;
7721
7722
  permissionRequestId: string;
7722
7723
  response?: unknown;
7724
+ } | {
7725
+ type: "rpc_error";
7726
+ requestId: string;
7727
+ code?: string | undefined;
7728
+ message?: string | undefined;
7729
+ error?: string | undefined;
7723
7730
  } | z.objectOutputType<{
7724
7731
  type: z.ZodLiteral<"agent.rewind.request">;
7725
7732
  requestId: z.ZodString;
@@ -8121,17 +8128,11 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
8121
8128
  requestId: z.ZodString;
8122
8129
  agentId: z.ZodString;
8123
8130
  ok: z.ZodBoolean;
8124
- }, z.ZodTypeAny, "passthrough"> | {
8125
- type: "rpc_error";
8126
- requestId: string;
8127
- code?: string | undefined;
8128
- message?: string | undefined;
8129
- error?: string | undefined;
8130
- } | z.objectOutputType<{
8131
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
8131
8132
  type: z.ZodString;
8132
8133
  }, z.ZodTypeAny, "passthrough">;
8133
- type: "session";
8134
8134
  }, {
8135
+ type: "session";
8135
8136
  message: {
8136
8137
  type: "create_agent_request";
8137
8138
  requestId: string;
@@ -8174,22 +8175,22 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
8174
8175
  labels?: Record<string, string> | undefined;
8175
8176
  } | {
8176
8177
  type: "create_agent_response";
8178
+ requestId: string;
8177
8179
  payload: {
8178
8180
  agentId: string;
8179
8181
  } & {
8180
8182
  [k: string]: unknown;
8181
8183
  };
8182
- requestId: string;
8183
8184
  } | {
8184
8185
  type: "agent_update";
8185
8186
  agentId: string;
8186
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
8187
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
8187
8188
  title?: string | null | undefined;
8188
8189
  labels?: Record<string, string> | undefined;
8189
8190
  } | {
8190
8191
  type: "agent_status";
8191
- status: "initializing" | "idle" | "running" | "error" | "closed";
8192
8192
  agentId: string;
8193
+ status: "closed" | "error" | "idle" | "initializing" | "running";
8193
8194
  } | {
8194
8195
  type: "agent_list";
8195
8196
  agents: z.objectInputType<{
@@ -8205,14 +8206,16 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
8205
8206
  } | {
8206
8207
  type: "agent_stream";
8207
8208
  agentId: string;
8209
+ seq?: number | undefined;
8210
+ timestamp?: string | number | undefined;
8208
8211
  event: {
8209
8212
  kind: "user_message";
8213
+ messageId?: string | undefined;
8214
+ text?: string | undefined;
8210
8215
  images?: z.objectInputType<{
8211
8216
  mimeType: z.ZodOptional<z.ZodString>;
8212
8217
  data: z.ZodOptional<z.ZodString>;
8213
8218
  }, z.ZodTypeAny, "passthrough">[] | undefined;
8214
- messageId?: string | undefined;
8215
- text?: string | undefined;
8216
8219
  } | {
8217
8220
  kind: "assistant_message";
8218
8221
  messageId?: string | undefined;
@@ -8222,6 +8225,7 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
8222
8225
  text?: string | undefined;
8223
8226
  } | {
8224
8227
  kind: "tool_call";
8228
+ callId?: string | undefined;
8225
8229
  tool: {
8226
8230
  kind: "shell";
8227
8231
  command?: string | undefined;
@@ -8233,27 +8237,26 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
8233
8237
  } | {
8234
8238
  kind: "edit";
8235
8239
  path?: string | undefined;
8236
- output?: string | undefined;
8237
8240
  diff?: string | undefined;
8241
+ output?: string | undefined;
8238
8242
  } | {
8239
8243
  kind: "write";
8240
8244
  path?: string | undefined;
8241
8245
  output?: string | undefined;
8242
8246
  } | {
8243
8247
  kind: "search";
8244
- output?: string | undefined;
8245
8248
  query?: string | undefined;
8249
+ output?: string | undefined;
8246
8250
  } | {
8247
8251
  kind: "fetch";
8248
8252
  url?: string | undefined;
8249
8253
  output?: string | undefined;
8250
8254
  } | {
8251
8255
  kind: "task";
8252
- output?: string | undefined;
8253
8256
  description?: string | undefined;
8257
+ output?: string | undefined;
8254
8258
  };
8255
8259
  status?: string | undefined;
8256
- callId?: string | undefined;
8257
8260
  } | {
8258
8261
  kind: "turn_started";
8259
8262
  turnId?: string | undefined;
@@ -8262,8 +8265,8 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
8262
8265
  turnId?: string | undefined;
8263
8266
  } | {
8264
8267
  kind: "turn_failed";
8265
- error?: string | undefined;
8266
8268
  turnId?: string | undefined;
8269
+ error?: string | undefined;
8267
8270
  } | {
8268
8271
  kind: "turn_canceled";
8269
8272
  turnId?: string | undefined;
@@ -8275,18 +8278,17 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
8275
8278
  steering?: string[] | undefined;
8276
8279
  followUp?: string[] | undefined;
8277
8280
  };
8278
- seq?: number | undefined;
8279
- timestamp?: string | number | undefined;
8280
8281
  } | {
8281
8282
  type: "fetch_agent_timeline_request";
8282
8283
  requestId: string;
8283
8284
  agentId: string;
8284
- direction: "before" | "after";
8285
8285
  cursor?: string | null | undefined;
8286
+ direction: "after" | "before";
8286
8287
  limit?: number | undefined;
8287
8288
  } | {
8288
8289
  type: "fetch_agent_timeline_response";
8289
8290
  requestId: string;
8291
+ agentId?: string | undefined;
8290
8292
  items: unknown[];
8291
8293
  seqStart: number;
8292
8294
  seqEnd: number;
@@ -8296,13 +8298,13 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
8296
8298
  }[];
8297
8299
  collapsed: boolean;
8298
8300
  hasNewer: boolean;
8299
- agentId?: string | undefined;
8300
8301
  startCursor?: string | null | undefined;
8301
8302
  endCursor?: string | null | undefined;
8302
8303
  } | {
8303
8304
  type: "agent_permission_request";
8304
8305
  requestId: string;
8305
8306
  agentId: string;
8307
+ toolName?: string | undefined;
8306
8308
  tool?: {
8307
8309
  kind: "shell";
8308
8310
  command?: string | undefined;
@@ -8314,26 +8316,25 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
8314
8316
  } | {
8315
8317
  kind: "edit";
8316
8318
  path?: string | undefined;
8317
- output?: string | undefined;
8318
8319
  diff?: string | undefined;
8320
+ output?: string | undefined;
8319
8321
  } | {
8320
8322
  kind: "write";
8321
8323
  path?: string | undefined;
8322
8324
  output?: string | undefined;
8323
8325
  } | {
8324
8326
  kind: "search";
8325
- output?: string | undefined;
8326
8327
  query?: string | undefined;
8328
+ output?: string | undefined;
8327
8329
  } | {
8328
8330
  kind: "fetch";
8329
8331
  url?: string | undefined;
8330
8332
  output?: string | undefined;
8331
8333
  } | {
8332
8334
  kind: "task";
8333
- output?: string | undefined;
8334
8335
  description?: string | undefined;
8336
+ output?: string | undefined;
8335
8337
  } | undefined;
8336
- toolName?: string | undefined;
8337
8338
  action?: unknown;
8338
8339
  responses?: string[] | undefined;
8339
8340
  } | {
@@ -8348,17 +8349,23 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
8348
8349
  response?: unknown;
8349
8350
  } | {
8350
8351
  type: "agent.permission.respond.response";
8352
+ requestId: string;
8351
8353
  payload: {
8352
8354
  resolved: boolean;
8353
8355
  } & {
8354
8356
  [k: string]: unknown;
8355
8357
  };
8356
- requestId: string;
8357
8358
  } | {
8358
8359
  type: "respond_to_permission";
8359
8360
  requestId: string;
8360
8361
  permissionRequestId: string;
8361
8362
  response?: unknown;
8363
+ } | {
8364
+ type: "rpc_error";
8365
+ requestId: string;
8366
+ code?: string | undefined;
8367
+ message?: string | undefined;
8368
+ error?: string | undefined;
8362
8369
  } | z.objectInputType<{
8363
8370
  type: z.ZodLiteral<"agent.rewind.request">;
8364
8371
  requestId: z.ZodString;
@@ -8760,16 +8767,9 @@ export declare const sessionEnvelopeSchema: z.ZodObject<{
8760
8767
  requestId: z.ZodString;
8761
8768
  agentId: z.ZodString;
8762
8769
  ok: z.ZodBoolean;
8763
- }, z.ZodTypeAny, "passthrough"> | {
8764
- type: "rpc_error";
8765
- requestId: string;
8766
- code?: string | undefined;
8767
- message?: string | undefined;
8768
- error?: string | undefined;
8769
- } | z.objectInputType<{
8770
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
8770
8771
  type: z.ZodString;
8771
8772
  }, z.ZodTypeAny, "passthrough">;
8772
- type: "session";
8773
8773
  }>;
8774
8774
  export type SessionEnvelope = z.infer<typeof sessionEnvelopeSchema>;
8775
8775
  /** Discriminated union of all top-level envelopes, keyed by `type`. */
@@ -8783,14 +8783,14 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
8783
8783
  }, "strip", z.ZodTypeAny, {
8784
8784
  type: "hello";
8785
8785
  clientId: string;
8786
- clientType: "mobile" | "browser" | "cli" | "mcp";
8786
+ clientType: "browser" | "cli" | "mcp" | "mobile";
8787
8787
  protocolVersion: number;
8788
8788
  appVersion?: string | undefined;
8789
8789
  capabilities?: Record<string, boolean> | undefined;
8790
8790
  }, {
8791
8791
  type: "hello";
8792
8792
  clientId: string;
8793
- clientType: "mobile" | "browser" | "cli" | "mcp";
8793
+ clientType: "browser" | "cli" | "mcp" | "mobile";
8794
8794
  protocolVersion: number;
8795
8795
  appVersion?: string | undefined;
8796
8796
  capabilities?: Record<string, boolean> | undefined;
@@ -8805,38 +8805,38 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
8805
8805
  features: z.ZodRecord<z.ZodString, z.ZodUnknown>;
8806
8806
  }, "strip", z.ZodTypeAny, {
8807
8807
  status: "server_info";
8808
- capabilities: Record<string, unknown>;
8809
8808
  serverId: string;
8810
- features: Record<string, unknown>;
8811
8809
  hostname?: string | undefined;
8812
8810
  version?: string | undefined;
8811
+ capabilities: Record<string, unknown>;
8812
+ features: Record<string, unknown>;
8813
8813
  }, {
8814
8814
  status: "server_info";
8815
- capabilities: Record<string, unknown>;
8816
8815
  serverId: string;
8817
- features: Record<string, unknown>;
8818
8816
  hostname?: string | undefined;
8819
8817
  version?: string | undefined;
8818
+ capabilities: Record<string, unknown>;
8819
+ features: Record<string, unknown>;
8820
8820
  }>;
8821
8821
  }, "strip", z.ZodTypeAny, {
8822
8822
  type: "status";
8823
8823
  payload: {
8824
8824
  status: "server_info";
8825
- capabilities: Record<string, unknown>;
8826
8825
  serverId: string;
8827
- features: Record<string, unknown>;
8828
8826
  hostname?: string | undefined;
8829
8827
  version?: string | undefined;
8828
+ capabilities: Record<string, unknown>;
8829
+ features: Record<string, unknown>;
8830
8830
  };
8831
8831
  }, {
8832
8832
  type: "status";
8833
8833
  payload: {
8834
8834
  status: "server_info";
8835
- capabilities: Record<string, unknown>;
8836
8835
  serverId: string;
8837
- features: Record<string, unknown>;
8838
8836
  hostname?: string | undefined;
8839
8837
  version?: string | undefined;
8838
+ capabilities: Record<string, unknown>;
8839
+ features: Record<string, unknown>;
8840
8840
  };
8841
8841
  }>, z.ZodObject<{
8842
8842
  type: z.ZodLiteral<"ping">;
@@ -8859,15 +8859,15 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
8859
8859
  }, "strip", z.ZodTypeAny, {
8860
8860
  type: "pong";
8861
8861
  requestId: string;
8862
+ clientSentAt?: string | number | undefined;
8862
8863
  serverReceivedAt: string | number;
8863
8864
  serverSentAt: string | number;
8864
- clientSentAt?: string | number | undefined;
8865
8865
  }, {
8866
8866
  type: "pong";
8867
8867
  requestId: string;
8868
+ clientSentAt?: string | number | undefined;
8868
8869
  serverReceivedAt: string | number;
8869
8870
  serverSentAt: string | number;
8870
- clientSentAt?: string | number | undefined;
8871
8871
  }>, z.ZodObject<{
8872
8872
  type: z.ZodLiteral<"session">;
8873
8873
  message: z.ZodUnion<[z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -8988,7 +8988,6 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
8988
8988
  systemPrompt?: string | undefined;
8989
8989
  mcpServers?: Record<string, unknown> | undefined;
8990
8990
  };
8991
- labels: Record<string, string>;
8992
8991
  env?: Record<string, string> | undefined;
8993
8992
  workspaceId?: string | undefined;
8994
8993
  worktreeName?: string | undefined;
@@ -9006,6 +9005,7 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9006
9005
  git?: unknown;
9007
9006
  worktree?: unknown;
9008
9007
  autoArchive?: boolean | undefined;
9008
+ labels: Record<string, string>;
9009
9009
  }, {
9010
9010
  type: "create_agent_request";
9011
9011
  requestId: string;
@@ -9058,20 +9058,20 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9058
9058
  }, z.ZodTypeAny, "passthrough">>;
9059
9059
  }, "strip", z.ZodTypeAny, {
9060
9060
  type: "create_agent_response";
9061
+ requestId: string;
9061
9062
  payload: {
9062
9063
  agentId: string;
9063
9064
  } & {
9064
9065
  [k: string]: unknown;
9065
9066
  };
9066
- requestId: string;
9067
9067
  }, {
9068
9068
  type: "create_agent_response";
9069
+ requestId: string;
9069
9070
  payload: {
9070
9071
  agentId: string;
9071
9072
  } & {
9072
9073
  [k: string]: unknown;
9073
9074
  };
9074
- requestId: string;
9075
9075
  }>, z.ZodObject<{
9076
9076
  type: z.ZodLiteral<"agent_update">;
9077
9077
  agentId: z.ZodString;
@@ -9081,13 +9081,13 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9081
9081
  }, "strip", z.ZodTypeAny, {
9082
9082
  type: "agent_update";
9083
9083
  agentId: string;
9084
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
9084
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
9085
9085
  title?: string | null | undefined;
9086
9086
  labels?: Record<string, string> | undefined;
9087
9087
  }, {
9088
9088
  type: "agent_update";
9089
9089
  agentId: string;
9090
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
9090
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
9091
9091
  title?: string | null | undefined;
9092
9092
  labels?: Record<string, string> | undefined;
9093
9093
  }>, z.ZodObject<{
@@ -9096,12 +9096,12 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9096
9096
  status: z.ZodEnum<["initializing", "idle", "running", "error", "closed"]>;
9097
9097
  }, "strip", z.ZodTypeAny, {
9098
9098
  type: "agent_status";
9099
- status: "initializing" | "idle" | "running" | "error" | "closed";
9100
9099
  agentId: string;
9100
+ status: "closed" | "error" | "idle" | "initializing" | "running";
9101
9101
  }, {
9102
9102
  type: "agent_status";
9103
- status: "initializing" | "idle" | "running" | "error" | "closed";
9104
9103
  agentId: string;
9104
+ status: "closed" | "error" | "idle" | "initializing" | "running";
9105
9105
  }>, z.ZodObject<{
9106
9106
  type: z.ZodLiteral<"agent_list">;
9107
9107
  agents: z.ZodArray<z.ZodObject<{
@@ -9163,20 +9163,20 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9163
9163
  }, z.ZodTypeAny, "passthrough">>, "many">>;
9164
9164
  }, "strip", z.ZodTypeAny, {
9165
9165
  kind: "user_message";
9166
+ messageId?: string | undefined;
9167
+ text?: string | undefined;
9166
9168
  images?: z.objectOutputType<{
9167
9169
  mimeType: z.ZodOptional<z.ZodString>;
9168
9170
  data: z.ZodOptional<z.ZodString>;
9169
9171
  }, z.ZodTypeAny, "passthrough">[] | undefined;
9170
- messageId?: string | undefined;
9171
- text?: string | undefined;
9172
9172
  }, {
9173
9173
  kind: "user_message";
9174
+ messageId?: string | undefined;
9175
+ text?: string | undefined;
9174
9176
  images?: z.objectInputType<{
9175
9177
  mimeType: z.ZodOptional<z.ZodString>;
9176
9178
  data: z.ZodOptional<z.ZodString>;
9177
9179
  }, z.ZodTypeAny, "passthrough">[] | undefined;
9178
- messageId?: string | undefined;
9179
- text?: string | undefined;
9180
9180
  }>, z.ZodObject<{
9181
9181
  kind: z.ZodLiteral<"assistant_message">;
9182
9182
  messageId: z.ZodOptional<z.ZodString>;
@@ -9233,13 +9233,13 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9233
9233
  }, "strip", z.ZodTypeAny, {
9234
9234
  kind: "edit";
9235
9235
  path?: string | undefined;
9236
- output?: string | undefined;
9237
9236
  diff?: string | undefined;
9237
+ output?: string | undefined;
9238
9238
  }, {
9239
9239
  kind: "edit";
9240
9240
  path?: string | undefined;
9241
- output?: string | undefined;
9242
9241
  diff?: string | undefined;
9242
+ output?: string | undefined;
9243
9243
  }>, z.ZodObject<{
9244
9244
  kind: z.ZodLiteral<"write">;
9245
9245
  path: z.ZodOptional<z.ZodString>;
@@ -9258,12 +9258,12 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9258
9258
  output: z.ZodOptional<z.ZodString>;
9259
9259
  }, "strip", z.ZodTypeAny, {
9260
9260
  kind: "search";
9261
- output?: string | undefined;
9262
9261
  query?: string | undefined;
9262
+ output?: string | undefined;
9263
9263
  }, {
9264
9264
  kind: "search";
9265
- output?: string | undefined;
9266
9265
  query?: string | undefined;
9266
+ output?: string | undefined;
9267
9267
  }>, z.ZodObject<{
9268
9268
  kind: z.ZodLiteral<"fetch">;
9269
9269
  url: z.ZodOptional<z.ZodString>;
@@ -9282,16 +9282,17 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9282
9282
  output: z.ZodOptional<z.ZodString>;
9283
9283
  }, "strip", z.ZodTypeAny, {
9284
9284
  kind: "task";
9285
- output?: string | undefined;
9286
9285
  description?: string | undefined;
9286
+ output?: string | undefined;
9287
9287
  }, {
9288
9288
  kind: "task";
9289
- output?: string | undefined;
9290
9289
  description?: string | undefined;
9290
+ output?: string | undefined;
9291
9291
  }>]>;
9292
9292
  status: z.ZodOptional<z.ZodString>;
9293
9293
  }, "strip", z.ZodTypeAny, {
9294
9294
  kind: "tool_call";
9295
+ callId?: string | undefined;
9295
9296
  tool: {
9296
9297
  kind: "shell";
9297
9298
  command?: string | undefined;
@@ -9303,29 +9304,29 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9303
9304
  } | {
9304
9305
  kind: "edit";
9305
9306
  path?: string | undefined;
9306
- output?: string | undefined;
9307
9307
  diff?: string | undefined;
9308
+ output?: string | undefined;
9308
9309
  } | {
9309
9310
  kind: "write";
9310
9311
  path?: string | undefined;
9311
9312
  output?: string | undefined;
9312
9313
  } | {
9313
9314
  kind: "search";
9314
- output?: string | undefined;
9315
9315
  query?: string | undefined;
9316
+ output?: string | undefined;
9316
9317
  } | {
9317
9318
  kind: "fetch";
9318
9319
  url?: string | undefined;
9319
9320
  output?: string | undefined;
9320
9321
  } | {
9321
9322
  kind: "task";
9322
- output?: string | undefined;
9323
9323
  description?: string | undefined;
9324
+ output?: string | undefined;
9324
9325
  };
9325
9326
  status?: string | undefined;
9326
- callId?: string | undefined;
9327
9327
  }, {
9328
9328
  kind: "tool_call";
9329
+ callId?: string | undefined;
9329
9330
  tool: {
9330
9331
  kind: "shell";
9331
9332
  command?: string | undefined;
@@ -9337,27 +9338,26 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9337
9338
  } | {
9338
9339
  kind: "edit";
9339
9340
  path?: string | undefined;
9340
- output?: string | undefined;
9341
9341
  diff?: string | undefined;
9342
+ output?: string | undefined;
9342
9343
  } | {
9343
9344
  kind: "write";
9344
9345
  path?: string | undefined;
9345
9346
  output?: string | undefined;
9346
9347
  } | {
9347
9348
  kind: "search";
9348
- output?: string | undefined;
9349
9349
  query?: string | undefined;
9350
+ output?: string | undefined;
9350
9351
  } | {
9351
9352
  kind: "fetch";
9352
9353
  url?: string | undefined;
9353
9354
  output?: string | undefined;
9354
9355
  } | {
9355
9356
  kind: "task";
9356
- output?: string | undefined;
9357
9357
  description?: string | undefined;
9358
+ output?: string | undefined;
9358
9359
  };
9359
9360
  status?: string | undefined;
9360
- callId?: string | undefined;
9361
9361
  }>, z.ZodObject<{
9362
9362
  kind: z.ZodLiteral<"turn_started">;
9363
9363
  turnId: z.ZodOptional<z.ZodString>;
@@ -9382,12 +9382,12 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9382
9382
  error: z.ZodOptional<z.ZodString>;
9383
9383
  }, "strip", z.ZodTypeAny, {
9384
9384
  kind: "turn_failed";
9385
- error?: string | undefined;
9386
9385
  turnId?: string | undefined;
9386
+ error?: string | undefined;
9387
9387
  }, {
9388
9388
  kind: "turn_failed";
9389
- error?: string | undefined;
9390
9389
  turnId?: string | undefined;
9390
+ error?: string | undefined;
9391
9391
  }>, z.ZodObject<{
9392
9392
  kind: z.ZodLiteral<"turn_canceled">;
9393
9393
  turnId: z.ZodOptional<z.ZodString>;
@@ -9422,14 +9422,16 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9422
9422
  }, "strip", z.ZodTypeAny, {
9423
9423
  type: "agent_stream";
9424
9424
  agentId: string;
9425
+ seq?: number | undefined;
9426
+ timestamp?: string | number | undefined;
9425
9427
  event: {
9426
9428
  kind: "user_message";
9429
+ messageId?: string | undefined;
9430
+ text?: string | undefined;
9427
9431
  images?: z.objectOutputType<{
9428
9432
  mimeType: z.ZodOptional<z.ZodString>;
9429
9433
  data: z.ZodOptional<z.ZodString>;
9430
9434
  }, z.ZodTypeAny, "passthrough">[] | undefined;
9431
- messageId?: string | undefined;
9432
- text?: string | undefined;
9433
9435
  } | {
9434
9436
  kind: "assistant_message";
9435
9437
  messageId?: string | undefined;
@@ -9439,6 +9441,7 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9439
9441
  text?: string | undefined;
9440
9442
  } | {
9441
9443
  kind: "tool_call";
9444
+ callId?: string | undefined;
9442
9445
  tool: {
9443
9446
  kind: "shell";
9444
9447
  command?: string | undefined;
@@ -9450,27 +9453,26 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9450
9453
  } | {
9451
9454
  kind: "edit";
9452
9455
  path?: string | undefined;
9453
- output?: string | undefined;
9454
9456
  diff?: string | undefined;
9457
+ output?: string | undefined;
9455
9458
  } | {
9456
9459
  kind: "write";
9457
9460
  path?: string | undefined;
9458
9461
  output?: string | undefined;
9459
9462
  } | {
9460
9463
  kind: "search";
9461
- output?: string | undefined;
9462
9464
  query?: string | undefined;
9465
+ output?: string | undefined;
9463
9466
  } | {
9464
9467
  kind: "fetch";
9465
9468
  url?: string | undefined;
9466
9469
  output?: string | undefined;
9467
9470
  } | {
9468
9471
  kind: "task";
9469
- output?: string | undefined;
9470
9472
  description?: string | undefined;
9473
+ output?: string | undefined;
9471
9474
  };
9472
9475
  status?: string | undefined;
9473
- callId?: string | undefined;
9474
9476
  } | {
9475
9477
  kind: "turn_started";
9476
9478
  turnId?: string | undefined;
@@ -9479,8 +9481,8 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9479
9481
  turnId?: string | undefined;
9480
9482
  } | {
9481
9483
  kind: "turn_failed";
9482
- error?: string | undefined;
9483
9484
  turnId?: string | undefined;
9485
+ error?: string | undefined;
9484
9486
  } | {
9485
9487
  kind: "turn_canceled";
9486
9488
  turnId?: string | undefined;
@@ -9492,19 +9494,19 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9492
9494
  steering?: string[] | undefined;
9493
9495
  followUp?: string[] | undefined;
9494
9496
  };
9495
- seq?: number | undefined;
9496
- timestamp?: string | number | undefined;
9497
9497
  }, {
9498
9498
  type: "agent_stream";
9499
9499
  agentId: string;
9500
+ seq?: number | undefined;
9501
+ timestamp?: string | number | undefined;
9500
9502
  event: {
9501
9503
  kind: "user_message";
9504
+ messageId?: string | undefined;
9505
+ text?: string | undefined;
9502
9506
  images?: z.objectInputType<{
9503
9507
  mimeType: z.ZodOptional<z.ZodString>;
9504
9508
  data: z.ZodOptional<z.ZodString>;
9505
9509
  }, z.ZodTypeAny, "passthrough">[] | undefined;
9506
- messageId?: string | undefined;
9507
- text?: string | undefined;
9508
9510
  } | {
9509
9511
  kind: "assistant_message";
9510
9512
  messageId?: string | undefined;
@@ -9514,6 +9516,7 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9514
9516
  text?: string | undefined;
9515
9517
  } | {
9516
9518
  kind: "tool_call";
9519
+ callId?: string | undefined;
9517
9520
  tool: {
9518
9521
  kind: "shell";
9519
9522
  command?: string | undefined;
@@ -9525,27 +9528,26 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9525
9528
  } | {
9526
9529
  kind: "edit";
9527
9530
  path?: string | undefined;
9528
- output?: string | undefined;
9529
9531
  diff?: string | undefined;
9532
+ output?: string | undefined;
9530
9533
  } | {
9531
9534
  kind: "write";
9532
9535
  path?: string | undefined;
9533
9536
  output?: string | undefined;
9534
9537
  } | {
9535
9538
  kind: "search";
9536
- output?: string | undefined;
9537
9539
  query?: string | undefined;
9540
+ output?: string | undefined;
9538
9541
  } | {
9539
9542
  kind: "fetch";
9540
9543
  url?: string | undefined;
9541
9544
  output?: string | undefined;
9542
9545
  } | {
9543
9546
  kind: "task";
9544
- output?: string | undefined;
9545
9547
  description?: string | undefined;
9548
+ output?: string | undefined;
9546
9549
  };
9547
9550
  status?: string | undefined;
9548
- callId?: string | undefined;
9549
9551
  } | {
9550
9552
  kind: "turn_started";
9551
9553
  turnId?: string | undefined;
@@ -9554,8 +9556,8 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9554
9556
  turnId?: string | undefined;
9555
9557
  } | {
9556
9558
  kind: "turn_failed";
9557
- error?: string | undefined;
9558
9559
  turnId?: string | undefined;
9560
+ error?: string | undefined;
9559
9561
  } | {
9560
9562
  kind: "turn_canceled";
9561
9563
  turnId?: string | undefined;
@@ -9567,8 +9569,6 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9567
9569
  steering?: string[] | undefined;
9568
9570
  followUp?: string[] | undefined;
9569
9571
  };
9570
- seq?: number | undefined;
9571
- timestamp?: string | number | undefined;
9572
9572
  }>, z.ZodObject<{
9573
9573
  type: z.ZodLiteral<"fetch_agent_timeline_request">;
9574
9574
  requestId: z.ZodString;
@@ -9580,15 +9580,15 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9580
9580
  type: "fetch_agent_timeline_request";
9581
9581
  requestId: string;
9582
9582
  agentId: string;
9583
- direction: "before" | "after";
9584
9583
  cursor?: string | null | undefined;
9584
+ direction: "after" | "before";
9585
9585
  limit?: number | undefined;
9586
9586
  }, {
9587
9587
  type: "fetch_agent_timeline_request";
9588
9588
  requestId: string;
9589
9589
  agentId: string;
9590
- direction: "before" | "after";
9591
9590
  cursor?: string | null | undefined;
9591
+ direction: "after" | "before";
9592
9592
  limit?: number | undefined;
9593
9593
  }>, z.ZodObject<{
9594
9594
  type: z.ZodLiteral<"fetch_agent_timeline_response">;
@@ -9614,6 +9614,7 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9614
9614
  }, "strip", z.ZodTypeAny, {
9615
9615
  type: "fetch_agent_timeline_response";
9616
9616
  requestId: string;
9617
+ agentId?: string | undefined;
9617
9618
  items: unknown[];
9618
9619
  seqStart: number;
9619
9620
  seqEnd: number;
@@ -9623,12 +9624,12 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9623
9624
  }[];
9624
9625
  collapsed: boolean;
9625
9626
  hasNewer: boolean;
9626
- agentId?: string | undefined;
9627
9627
  startCursor?: string | null | undefined;
9628
9628
  endCursor?: string | null | undefined;
9629
9629
  }, {
9630
9630
  type: "fetch_agent_timeline_response";
9631
9631
  requestId: string;
9632
+ agentId?: string | undefined;
9632
9633
  items: unknown[];
9633
9634
  seqStart: number;
9634
9635
  seqEnd: number;
@@ -9638,7 +9639,6 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9638
9639
  }[];
9639
9640
  collapsed: boolean;
9640
9641
  hasNewer: boolean;
9641
- agentId?: string | undefined;
9642
9642
  startCursor?: string | null | undefined;
9643
9643
  endCursor?: string | null | undefined;
9644
9644
  }>, z.ZodObject<{
@@ -9678,13 +9678,13 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9678
9678
  }, "strip", z.ZodTypeAny, {
9679
9679
  kind: "edit";
9680
9680
  path?: string | undefined;
9681
- output?: string | undefined;
9682
9681
  diff?: string | undefined;
9682
+ output?: string | undefined;
9683
9683
  }, {
9684
9684
  kind: "edit";
9685
9685
  path?: string | undefined;
9686
- output?: string | undefined;
9687
9686
  diff?: string | undefined;
9687
+ output?: string | undefined;
9688
9688
  }>, z.ZodObject<{
9689
9689
  kind: z.ZodLiteral<"write">;
9690
9690
  path: z.ZodOptional<z.ZodString>;
@@ -9703,12 +9703,12 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9703
9703
  output: z.ZodOptional<z.ZodString>;
9704
9704
  }, "strip", z.ZodTypeAny, {
9705
9705
  kind: "search";
9706
- output?: string | undefined;
9707
9706
  query?: string | undefined;
9707
+ output?: string | undefined;
9708
9708
  }, {
9709
9709
  kind: "search";
9710
- output?: string | undefined;
9711
9710
  query?: string | undefined;
9711
+ output?: string | undefined;
9712
9712
  }>, z.ZodObject<{
9713
9713
  kind: z.ZodLiteral<"fetch">;
9714
9714
  url: z.ZodOptional<z.ZodString>;
@@ -9727,12 +9727,12 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9727
9727
  output: z.ZodOptional<z.ZodString>;
9728
9728
  }, "strip", z.ZodTypeAny, {
9729
9729
  kind: "task";
9730
- output?: string | undefined;
9731
9730
  description?: string | undefined;
9731
+ output?: string | undefined;
9732
9732
  }, {
9733
9733
  kind: "task";
9734
- output?: string | undefined;
9735
9734
  description?: string | undefined;
9735
+ output?: string | undefined;
9736
9736
  }>]>>;
9737
9737
  action: z.ZodOptional<z.ZodUnknown>;
9738
9738
  responses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -9740,6 +9740,7 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9740
9740
  type: "agent_permission_request";
9741
9741
  requestId: string;
9742
9742
  agentId: string;
9743
+ toolName?: string | undefined;
9743
9744
  tool?: {
9744
9745
  kind: "shell";
9745
9746
  command?: string | undefined;
@@ -9751,32 +9752,32 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9751
9752
  } | {
9752
9753
  kind: "edit";
9753
9754
  path?: string | undefined;
9754
- output?: string | undefined;
9755
9755
  diff?: string | undefined;
9756
+ output?: string | undefined;
9756
9757
  } | {
9757
9758
  kind: "write";
9758
9759
  path?: string | undefined;
9759
9760
  output?: string | undefined;
9760
9761
  } | {
9761
9762
  kind: "search";
9762
- output?: string | undefined;
9763
9763
  query?: string | undefined;
9764
+ output?: string | undefined;
9764
9765
  } | {
9765
9766
  kind: "fetch";
9766
9767
  url?: string | undefined;
9767
9768
  output?: string | undefined;
9768
9769
  } | {
9769
9770
  kind: "task";
9770
- output?: string | undefined;
9771
9771
  description?: string | undefined;
9772
+ output?: string | undefined;
9772
9773
  } | undefined;
9773
- toolName?: string | undefined;
9774
9774
  action?: unknown;
9775
9775
  responses?: string[] | undefined;
9776
9776
  }, {
9777
9777
  type: "agent_permission_request";
9778
9778
  requestId: string;
9779
9779
  agentId: string;
9780
+ toolName?: string | undefined;
9780
9781
  tool?: {
9781
9782
  kind: "shell";
9782
9783
  command?: string | undefined;
@@ -9788,26 +9789,25 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9788
9789
  } | {
9789
9790
  kind: "edit";
9790
9791
  path?: string | undefined;
9791
- output?: string | undefined;
9792
9792
  diff?: string | undefined;
9793
+ output?: string | undefined;
9793
9794
  } | {
9794
9795
  kind: "write";
9795
9796
  path?: string | undefined;
9796
9797
  output?: string | undefined;
9797
9798
  } | {
9798
9799
  kind: "search";
9799
- output?: string | undefined;
9800
9800
  query?: string | undefined;
9801
+ output?: string | undefined;
9801
9802
  } | {
9802
9803
  kind: "fetch";
9803
9804
  url?: string | undefined;
9804
9805
  output?: string | undefined;
9805
9806
  } | {
9806
9807
  kind: "task";
9807
- output?: string | undefined;
9808
9808
  description?: string | undefined;
9809
+ output?: string | undefined;
9809
9810
  } | undefined;
9810
- toolName?: string | undefined;
9811
9811
  action?: unknown;
9812
9812
  responses?: string[] | undefined;
9813
9813
  }>, z.ZodObject<{
@@ -9852,20 +9852,20 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
9852
9852
  }, z.ZodTypeAny, "passthrough">>;
9853
9853
  }, "strip", z.ZodTypeAny, {
9854
9854
  type: "agent.permission.respond.response";
9855
+ requestId: string;
9855
9856
  payload: {
9856
9857
  resolved: boolean;
9857
9858
  } & {
9858
9859
  [k: string]: unknown;
9859
9860
  };
9860
- requestId: string;
9861
9861
  }, {
9862
9862
  type: "agent.permission.respond.response";
9863
+ requestId: string;
9863
9864
  payload: {
9864
9865
  resolved: boolean;
9865
9866
  } & {
9866
9867
  [k: string]: unknown;
9867
9868
  };
9868
- requestId: string;
9869
9869
  }>, z.ZodObject<{
9870
9870
  type: z.ZodLiteral<"respond_to_permission">;
9871
9871
  requestId: z.ZodString;
@@ -11110,6 +11110,7 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11110
11110
  type: z.ZodString;
11111
11111
  }, z.ZodTypeAny, "passthrough">>]>;
11112
11112
  }, "strip", z.ZodTypeAny, {
11113
+ type: "session";
11113
11114
  message: {
11114
11115
  type: "create_agent_request";
11115
11116
  requestId: string;
@@ -11132,7 +11133,6 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11132
11133
  systemPrompt?: string | undefined;
11133
11134
  mcpServers?: Record<string, unknown> | undefined;
11134
11135
  };
11135
- labels: Record<string, string>;
11136
11136
  env?: Record<string, string> | undefined;
11137
11137
  workspaceId?: string | undefined;
11138
11138
  worktreeName?: string | undefined;
@@ -11150,24 +11150,25 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11150
11150
  git?: unknown;
11151
11151
  worktree?: unknown;
11152
11152
  autoArchive?: boolean | undefined;
11153
+ labels: Record<string, string>;
11153
11154
  } | {
11154
11155
  type: "create_agent_response";
11156
+ requestId: string;
11155
11157
  payload: {
11156
11158
  agentId: string;
11157
11159
  } & {
11158
11160
  [k: string]: unknown;
11159
11161
  };
11160
- requestId: string;
11161
11162
  } | {
11162
11163
  type: "agent_update";
11163
11164
  agentId: string;
11164
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
11165
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
11165
11166
  title?: string | null | undefined;
11166
11167
  labels?: Record<string, string> | undefined;
11167
11168
  } | {
11168
11169
  type: "agent_status";
11169
- status: "initializing" | "idle" | "running" | "error" | "closed";
11170
11170
  agentId: string;
11171
+ status: "closed" | "error" | "idle" | "initializing" | "running";
11171
11172
  } | {
11172
11173
  type: "agent_list";
11173
11174
  agents: z.objectOutputType<{
@@ -11183,14 +11184,16 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11183
11184
  } | {
11184
11185
  type: "agent_stream";
11185
11186
  agentId: string;
11187
+ seq?: number | undefined;
11188
+ timestamp?: string | number | undefined;
11186
11189
  event: {
11187
11190
  kind: "user_message";
11191
+ messageId?: string | undefined;
11192
+ text?: string | undefined;
11188
11193
  images?: z.objectOutputType<{
11189
11194
  mimeType: z.ZodOptional<z.ZodString>;
11190
11195
  data: z.ZodOptional<z.ZodString>;
11191
11196
  }, z.ZodTypeAny, "passthrough">[] | undefined;
11192
- messageId?: string | undefined;
11193
- text?: string | undefined;
11194
11197
  } | {
11195
11198
  kind: "assistant_message";
11196
11199
  messageId?: string | undefined;
@@ -11200,6 +11203,7 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11200
11203
  text?: string | undefined;
11201
11204
  } | {
11202
11205
  kind: "tool_call";
11206
+ callId?: string | undefined;
11203
11207
  tool: {
11204
11208
  kind: "shell";
11205
11209
  command?: string | undefined;
@@ -11211,27 +11215,26 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11211
11215
  } | {
11212
11216
  kind: "edit";
11213
11217
  path?: string | undefined;
11214
- output?: string | undefined;
11215
11218
  diff?: string | undefined;
11219
+ output?: string | undefined;
11216
11220
  } | {
11217
11221
  kind: "write";
11218
11222
  path?: string | undefined;
11219
11223
  output?: string | undefined;
11220
11224
  } | {
11221
11225
  kind: "search";
11222
- output?: string | undefined;
11223
11226
  query?: string | undefined;
11227
+ output?: string | undefined;
11224
11228
  } | {
11225
11229
  kind: "fetch";
11226
11230
  url?: string | undefined;
11227
11231
  output?: string | undefined;
11228
11232
  } | {
11229
11233
  kind: "task";
11230
- output?: string | undefined;
11231
11234
  description?: string | undefined;
11235
+ output?: string | undefined;
11232
11236
  };
11233
11237
  status?: string | undefined;
11234
- callId?: string | undefined;
11235
11238
  } | {
11236
11239
  kind: "turn_started";
11237
11240
  turnId?: string | undefined;
@@ -11240,8 +11243,8 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11240
11243
  turnId?: string | undefined;
11241
11244
  } | {
11242
11245
  kind: "turn_failed";
11243
- error?: string | undefined;
11244
11246
  turnId?: string | undefined;
11247
+ error?: string | undefined;
11245
11248
  } | {
11246
11249
  kind: "turn_canceled";
11247
11250
  turnId?: string | undefined;
@@ -11253,18 +11256,17 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11253
11256
  steering?: string[] | undefined;
11254
11257
  followUp?: string[] | undefined;
11255
11258
  };
11256
- seq?: number | undefined;
11257
- timestamp?: string | number | undefined;
11258
11259
  } | {
11259
11260
  type: "fetch_agent_timeline_request";
11260
11261
  requestId: string;
11261
11262
  agentId: string;
11262
- direction: "before" | "after";
11263
11263
  cursor?: string | null | undefined;
11264
+ direction: "after" | "before";
11264
11265
  limit?: number | undefined;
11265
11266
  } | {
11266
11267
  type: "fetch_agent_timeline_response";
11267
11268
  requestId: string;
11269
+ agentId?: string | undefined;
11268
11270
  items: unknown[];
11269
11271
  seqStart: number;
11270
11272
  seqEnd: number;
@@ -11274,13 +11276,13 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11274
11276
  }[];
11275
11277
  collapsed: boolean;
11276
11278
  hasNewer: boolean;
11277
- agentId?: string | undefined;
11278
11279
  startCursor?: string | null | undefined;
11279
11280
  endCursor?: string | null | undefined;
11280
11281
  } | {
11281
11282
  type: "agent_permission_request";
11282
11283
  requestId: string;
11283
11284
  agentId: string;
11285
+ toolName?: string | undefined;
11284
11286
  tool?: {
11285
11287
  kind: "shell";
11286
11288
  command?: string | undefined;
@@ -11292,26 +11294,25 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11292
11294
  } | {
11293
11295
  kind: "edit";
11294
11296
  path?: string | undefined;
11295
- output?: string | undefined;
11296
11297
  diff?: string | undefined;
11298
+ output?: string | undefined;
11297
11299
  } | {
11298
11300
  kind: "write";
11299
11301
  path?: string | undefined;
11300
11302
  output?: string | undefined;
11301
11303
  } | {
11302
11304
  kind: "search";
11303
- output?: string | undefined;
11304
11305
  query?: string | undefined;
11306
+ output?: string | undefined;
11305
11307
  } | {
11306
11308
  kind: "fetch";
11307
11309
  url?: string | undefined;
11308
11310
  output?: string | undefined;
11309
11311
  } | {
11310
11312
  kind: "task";
11311
- output?: string | undefined;
11312
11313
  description?: string | undefined;
11314
+ output?: string | undefined;
11313
11315
  } | undefined;
11314
- toolName?: string | undefined;
11315
11316
  action?: unknown;
11316
11317
  responses?: string[] | undefined;
11317
11318
  } | {
@@ -11326,17 +11327,23 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11326
11327
  response?: unknown;
11327
11328
  } | {
11328
11329
  type: "agent.permission.respond.response";
11330
+ requestId: string;
11329
11331
  payload: {
11330
11332
  resolved: boolean;
11331
11333
  } & {
11332
11334
  [k: string]: unknown;
11333
11335
  };
11334
- requestId: string;
11335
11336
  } | {
11336
11337
  type: "respond_to_permission";
11337
11338
  requestId: string;
11338
11339
  permissionRequestId: string;
11339
11340
  response?: unknown;
11341
+ } | {
11342
+ type: "rpc_error";
11343
+ requestId: string;
11344
+ code?: string | undefined;
11345
+ message?: string | undefined;
11346
+ error?: string | undefined;
11340
11347
  } | z.objectOutputType<{
11341
11348
  type: z.ZodLiteral<"agent.rewind.request">;
11342
11349
  requestId: z.ZodString;
@@ -11738,17 +11745,11 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11738
11745
  requestId: z.ZodString;
11739
11746
  agentId: z.ZodString;
11740
11747
  ok: z.ZodBoolean;
11741
- }, z.ZodTypeAny, "passthrough"> | {
11742
- type: "rpc_error";
11743
- requestId: string;
11744
- code?: string | undefined;
11745
- message?: string | undefined;
11746
- error?: string | undefined;
11747
- } | z.objectOutputType<{
11748
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
11748
11749
  type: z.ZodString;
11749
11750
  }, z.ZodTypeAny, "passthrough">;
11750
- type: "session";
11751
11751
  }, {
11752
+ type: "session";
11752
11753
  message: {
11753
11754
  type: "create_agent_request";
11754
11755
  requestId: string;
@@ -11791,22 +11792,22 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11791
11792
  labels?: Record<string, string> | undefined;
11792
11793
  } | {
11793
11794
  type: "create_agent_response";
11795
+ requestId: string;
11794
11796
  payload: {
11795
11797
  agentId: string;
11796
11798
  } & {
11797
11799
  [k: string]: unknown;
11798
11800
  };
11799
- requestId: string;
11800
11801
  } | {
11801
11802
  type: "agent_update";
11802
11803
  agentId: string;
11803
- status?: "initializing" | "idle" | "running" | "error" | "closed" | undefined;
11804
+ status?: "closed" | "error" | "idle" | "initializing" | "running" | undefined;
11804
11805
  title?: string | null | undefined;
11805
11806
  labels?: Record<string, string> | undefined;
11806
11807
  } | {
11807
11808
  type: "agent_status";
11808
- status: "initializing" | "idle" | "running" | "error" | "closed";
11809
11809
  agentId: string;
11810
+ status: "closed" | "error" | "idle" | "initializing" | "running";
11810
11811
  } | {
11811
11812
  type: "agent_list";
11812
11813
  agents: z.objectInputType<{
@@ -11822,14 +11823,16 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11822
11823
  } | {
11823
11824
  type: "agent_stream";
11824
11825
  agentId: string;
11826
+ seq?: number | undefined;
11827
+ timestamp?: string | number | undefined;
11825
11828
  event: {
11826
11829
  kind: "user_message";
11830
+ messageId?: string | undefined;
11831
+ text?: string | undefined;
11827
11832
  images?: z.objectInputType<{
11828
11833
  mimeType: z.ZodOptional<z.ZodString>;
11829
11834
  data: z.ZodOptional<z.ZodString>;
11830
11835
  }, z.ZodTypeAny, "passthrough">[] | undefined;
11831
- messageId?: string | undefined;
11832
- text?: string | undefined;
11833
11836
  } | {
11834
11837
  kind: "assistant_message";
11835
11838
  messageId?: string | undefined;
@@ -11839,6 +11842,7 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11839
11842
  text?: string | undefined;
11840
11843
  } | {
11841
11844
  kind: "tool_call";
11845
+ callId?: string | undefined;
11842
11846
  tool: {
11843
11847
  kind: "shell";
11844
11848
  command?: string | undefined;
@@ -11850,27 +11854,26 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11850
11854
  } | {
11851
11855
  kind: "edit";
11852
11856
  path?: string | undefined;
11853
- output?: string | undefined;
11854
11857
  diff?: string | undefined;
11858
+ output?: string | undefined;
11855
11859
  } | {
11856
11860
  kind: "write";
11857
11861
  path?: string | undefined;
11858
11862
  output?: string | undefined;
11859
11863
  } | {
11860
11864
  kind: "search";
11861
- output?: string | undefined;
11862
11865
  query?: string | undefined;
11866
+ output?: string | undefined;
11863
11867
  } | {
11864
11868
  kind: "fetch";
11865
11869
  url?: string | undefined;
11866
11870
  output?: string | undefined;
11867
11871
  } | {
11868
11872
  kind: "task";
11869
- output?: string | undefined;
11870
11873
  description?: string | undefined;
11874
+ output?: string | undefined;
11871
11875
  };
11872
11876
  status?: string | undefined;
11873
- callId?: string | undefined;
11874
11877
  } | {
11875
11878
  kind: "turn_started";
11876
11879
  turnId?: string | undefined;
@@ -11879,8 +11882,8 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11879
11882
  turnId?: string | undefined;
11880
11883
  } | {
11881
11884
  kind: "turn_failed";
11882
- error?: string | undefined;
11883
11885
  turnId?: string | undefined;
11886
+ error?: string | undefined;
11884
11887
  } | {
11885
11888
  kind: "turn_canceled";
11886
11889
  turnId?: string | undefined;
@@ -11892,18 +11895,17 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11892
11895
  steering?: string[] | undefined;
11893
11896
  followUp?: string[] | undefined;
11894
11897
  };
11895
- seq?: number | undefined;
11896
- timestamp?: string | number | undefined;
11897
11898
  } | {
11898
11899
  type: "fetch_agent_timeline_request";
11899
11900
  requestId: string;
11900
11901
  agentId: string;
11901
- direction: "before" | "after";
11902
11902
  cursor?: string | null | undefined;
11903
+ direction: "after" | "before";
11903
11904
  limit?: number | undefined;
11904
11905
  } | {
11905
11906
  type: "fetch_agent_timeline_response";
11906
11907
  requestId: string;
11908
+ agentId?: string | undefined;
11907
11909
  items: unknown[];
11908
11910
  seqStart: number;
11909
11911
  seqEnd: number;
@@ -11913,13 +11915,13 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11913
11915
  }[];
11914
11916
  collapsed: boolean;
11915
11917
  hasNewer: boolean;
11916
- agentId?: string | undefined;
11917
11918
  startCursor?: string | null | undefined;
11918
11919
  endCursor?: string | null | undefined;
11919
11920
  } | {
11920
11921
  type: "agent_permission_request";
11921
11922
  requestId: string;
11922
11923
  agentId: string;
11924
+ toolName?: string | undefined;
11923
11925
  tool?: {
11924
11926
  kind: "shell";
11925
11927
  command?: string | undefined;
@@ -11931,26 +11933,25 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11931
11933
  } | {
11932
11934
  kind: "edit";
11933
11935
  path?: string | undefined;
11934
- output?: string | undefined;
11935
11936
  diff?: string | undefined;
11937
+ output?: string | undefined;
11936
11938
  } | {
11937
11939
  kind: "write";
11938
11940
  path?: string | undefined;
11939
11941
  output?: string | undefined;
11940
11942
  } | {
11941
11943
  kind: "search";
11942
- output?: string | undefined;
11943
11944
  query?: string | undefined;
11945
+ output?: string | undefined;
11944
11946
  } | {
11945
11947
  kind: "fetch";
11946
11948
  url?: string | undefined;
11947
11949
  output?: string | undefined;
11948
11950
  } | {
11949
11951
  kind: "task";
11950
- output?: string | undefined;
11951
11952
  description?: string | undefined;
11953
+ output?: string | undefined;
11952
11954
  } | undefined;
11953
- toolName?: string | undefined;
11954
11955
  action?: unknown;
11955
11956
  responses?: string[] | undefined;
11956
11957
  } | {
@@ -11965,17 +11966,23 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
11965
11966
  response?: unknown;
11966
11967
  } | {
11967
11968
  type: "agent.permission.respond.response";
11969
+ requestId: string;
11968
11970
  payload: {
11969
11971
  resolved: boolean;
11970
11972
  } & {
11971
11973
  [k: string]: unknown;
11972
11974
  };
11973
- requestId: string;
11974
11975
  } | {
11975
11976
  type: "respond_to_permission";
11976
11977
  requestId: string;
11977
11978
  permissionRequestId: string;
11978
11979
  response?: unknown;
11980
+ } | {
11981
+ type: "rpc_error";
11982
+ requestId: string;
11983
+ code?: string | undefined;
11984
+ message?: string | undefined;
11985
+ error?: string | undefined;
11979
11986
  } | z.objectInputType<{
11980
11987
  type: z.ZodLiteral<"agent.rewind.request">;
11981
11988
  requestId: z.ZodString;
@@ -12377,16 +12384,9 @@ export declare const topLevelEnvelopeSchema: z.ZodDiscriminatedUnion<"type", [z.
12377
12384
  requestId: z.ZodString;
12378
12385
  agentId: z.ZodString;
12379
12386
  ok: z.ZodBoolean;
12380
- }, z.ZodTypeAny, "passthrough"> | {
12381
- type: "rpc_error";
12382
- requestId: string;
12383
- code?: string | undefined;
12384
- message?: string | undefined;
12385
- error?: string | undefined;
12386
- } | z.objectInputType<{
12387
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
12387
12388
  type: z.ZodString;
12388
12389
  }, z.ZodTypeAny, "passthrough">;
12389
- type: "session";
12390
12390
  }>]>;
12391
12391
  export type TopLevelEnvelope = z.infer<typeof topLevelEnvelopeSchema>;
12392
12392
  //# sourceMappingURL=messages.d.ts.map