@get-bb/plugin-sdk 0.4.29 → 0.4.34

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.
@@ -293,10 +293,10 @@ var backgroundTaskUsageSchema = z3.object({
293
293
  });
294
294
 
295
295
  // ../domain/src/provider-event.ts
296
- import { z as z11 } from "zod";
296
+ import { z as z12 } from "zod";
297
297
 
298
298
  // ../domain/src/thread-events.ts
299
- import { z as z8 } from "zod";
299
+ import { z as z9 } from "zod";
300
300
 
301
301
  // ../domain/src/pending-interactions.ts
302
302
  import { z as z6 } from "zod";
@@ -742,24 +742,8 @@ var interactionLifecycleSchema = z6.union([
742
742
  import { z as z7 } from "zod";
743
743
  var clientTurnRequestIdSchema = z7.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
744
744
 
745
- // ../domain/src/thread-events.ts
746
- var systemEventTypeValues = [
747
- "client/thread/start",
748
- "client/turn/requested",
749
- "client/turn/rejected",
750
- "client/turn/start",
751
- "system/error",
752
- "system/manager/user_message",
753
- "system/thread/interrupted",
754
- "system/operation",
755
- "system/interaction/lifecycle",
756
- "system/permissionGrant/lifecycle",
757
- "system/userQuestion/lifecycle",
758
- "system/thread-provisioning",
759
- "system/provider-turn-watchdog"
760
- ];
761
- var threadTurnInitiatorValues = ["user", "agent", "system"];
762
- var threadTurnInitiatorSchema = z8.enum(threadTurnInitiatorValues);
745
+ // ../domain/src/system-message.ts
746
+ import { z as z8 } from "zod";
763
747
  var systemMessageKindValues = [
764
748
  "ownership-assigned",
765
749
  "ownership-removed",
@@ -782,70 +766,99 @@ var systemMessageSubjectSchema = z8.discriminatedUnion("kind", [
782
766
  count: z8.number()
783
767
  })
784
768
  ]);
769
+
770
+ // ../domain/src/thread-events.ts
771
+ var systemEventTypeValues = [
772
+ "client/thread/start",
773
+ "client/turn/requested",
774
+ "client/turn/rejected",
775
+ "client/turn/start",
776
+ "system/error",
777
+ "system/manager/user_message",
778
+ "system/thread/interrupted",
779
+ "system/operation",
780
+ "system/interaction/lifecycle",
781
+ "system/permissionGrant/lifecycle",
782
+ "system/userQuestion/lifecycle",
783
+ "system/thread-provisioning",
784
+ // Legacy persisted watchdog diagnostic; retained for read/decode/render
785
+ // only, with no current producer.
786
+ "system/provider-turn-watchdog"
787
+ ];
788
+ var threadTurnInitiatorValues = ["user", "agent", "system"];
789
+ var threadTurnInitiatorSchema = z9.enum(threadTurnInitiatorValues);
785
790
  var turnRequestOptionsSchema = recordedThreadExecutionOptionsSchema;
786
- var turnRequestTargetSchema = z8.discriminatedUnion("kind", [
787
- z8.object({ kind: z8.literal("thread-start") }),
788
- z8.object({ kind: z8.literal("new-turn") }),
789
- z8.object({
790
- kind: z8.literal("auto"),
791
- expectedTurnId: z8.string().nullable()
791
+ var turnRequestTargetSchema = z9.discriminatedUnion("kind", [
792
+ z9.object({ kind: z9.literal("thread-start") }),
793
+ z9.object({ kind: z9.literal("new-turn") }),
794
+ z9.object({
795
+ kind: z9.literal("auto"),
796
+ expectedTurnId: z9.string().nullable()
792
797
  }),
793
- z8.object({
794
- kind: z8.literal("steer"),
795
- expectedTurnId: z8.string().nullable()
798
+ z9.object({
799
+ kind: z9.literal("steer"),
800
+ expectedTurnId: z9.string().nullable()
796
801
  })
797
802
  ]);
798
- var clientTurnLifecycleEventDataSchema = z8.object({
799
- direction: z8.literal("outbound"),
800
- source: z8.enum(["spawn", "tell"]),
803
+ var clientTurnLifecycleEventDataSchema = z9.object({
804
+ direction: z9.literal("outbound"),
805
+ source: z9.enum(["spawn", "tell"]),
801
806
  initiator: threadTurnInitiatorSchema,
802
- request: z8.object({
803
- method: z8.enum(["thread/start", "turn/start"]),
804
- params: z8.record(z8.string(), z8.unknown())
807
+ request: z9.object({
808
+ method: z9.enum(["thread/start", "turn/start"]),
809
+ params: z9.record(z9.string(), z9.unknown())
805
810
  })
806
811
  });
807
- var turnRequestEventDataSchema = z8.object({
808
- direction: z8.literal("outbound"),
812
+ var turnRequestEventDataSchema = z9.object({
813
+ direction: z9.literal("outbound"),
809
814
  requestId: clientTurnRequestIdSchema,
810
- continuationOfRequestId: clientTurnRequestIdSchema.optional(),
811
- source: z8.enum(["spawn", "tell"]),
815
+ // Retry provenance, written only when a `turn.failed` gate's retry row
816
+ // dispatches. Both fields are present together or not at all: absence means
817
+ // "this is an original dispatch", which is the overwhelmingly common case.
818
+ // (Supersedes the pre-plugin `continuationOfRequestId` key, which the removed
819
+ // core rate-limit recovery wrote and nothing ever read.)
820
+ /** The original request this attempt re-submits, unchanged across attempts. */
821
+ retryOfRequestId: clientTurnRequestIdSchema.optional(),
822
+ /** Which attempt this is: 2 is the first retry of the original request. */
823
+ retryAttempt: z9.number().int().min(2).optional(),
824
+ source: z9.enum(["spawn", "tell"]),
812
825
  initiator: threadTurnInitiatorSchema,
813
- senderThreadId: z8.string().nullable(),
826
+ senderThreadId: z9.string().nullable(),
814
827
  systemMessageKind: systemMessageKindSchema.optional(),
815
828
  systemMessageSubject: systemMessageSubjectSchema.nullable().optional(),
816
- input: z8.array(promptInputSchema),
817
- inputGroups: z8.array(z8.array(promptInputSchema).min(1)).min(1).optional(),
829
+ input: z9.array(promptInputSchema),
830
+ inputGroups: z9.array(z9.array(promptInputSchema).min(1)).min(1).optional(),
818
831
  target: turnRequestTargetSchema,
819
- request: z8.object({
820
- method: z8.enum(["thread/start", "turn/start"]),
821
- params: z8.record(z8.string(), z8.unknown())
832
+ request: z9.object({
833
+ method: z9.enum(["thread/start", "turn/start"]),
834
+ params: z9.record(z9.string(), z9.unknown())
822
835
  }),
823
836
  execution: turnRequestOptionsSchema
824
837
  });
825
- var turnRequestRejectedEventDataSchema = z8.object({
838
+ var turnRequestRejectedEventDataSchema = z9.object({
826
839
  requestId: clientTurnRequestIdSchema,
827
- reason: z8.string().min(1),
828
- message: z8.string().min(1)
840
+ reason: z9.string().min(1),
841
+ message: z9.string().min(1)
829
842
  });
830
- var systemErrorEventDataSchema = z8.object({
831
- code: z8.string().optional(),
832
- message: z8.string(),
833
- detail: z8.string().optional(),
834
- reconnectAttempt: z8.number().int().positive().optional(),
835
- reconnectTotal: z8.number().int().positive().optional()
843
+ var systemErrorEventDataSchema = z9.object({
844
+ code: z9.string().optional(),
845
+ message: z9.string(),
846
+ detail: z9.string().optional(),
847
+ reconnectAttempt: z9.number().int().positive().optional(),
848
+ reconnectTotal: z9.number().int().positive().optional()
836
849
  }).superRefine((value, ctx) => {
837
850
  const hasReconnectAttempt = value.reconnectAttempt !== void 0;
838
851
  const hasReconnectTotal = value.reconnectTotal !== void 0;
839
852
  if (hasReconnectAttempt !== hasReconnectTotal) {
840
853
  ctx.addIssue({
841
- code: z8.ZodIssueCode.custom,
854
+ code: z9.ZodIssueCode.custom,
842
855
  message: "system/error reconnectAttempt and reconnectTotal must be provided together"
843
856
  });
844
857
  return;
845
858
  }
846
859
  if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
847
860
  ctx.addIssue({
848
- code: z8.ZodIssueCode.custom,
861
+ code: z9.ZodIssueCode.custom,
849
862
  message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
850
863
  });
851
864
  }
@@ -855,42 +868,42 @@ var ownershipChangeOperationActionValues = [
855
868
  "release",
856
869
  "transfer"
857
870
  ];
858
- var ownershipChangeOperationActionSchema = z8.enum(
871
+ var ownershipChangeOperationActionSchema = z9.enum(
859
872
  ownershipChangeOperationActionValues
860
873
  );
861
- var ownershipChangeOperationMetadataSchema = z8.object({
874
+ var ownershipChangeOperationMetadataSchema = z9.object({
862
875
  action: ownershipChangeOperationActionSchema,
863
- nextParentThreadId: z8.string().nullable(),
864
- nextParentThreadTitle: z8.string().nullable(),
865
- previousParentThreadId: z8.string().nullable(),
866
- previousParentThreadTitle: z8.string().nullable()
876
+ nextParentThreadId: z9.string().nullable(),
877
+ nextParentThreadTitle: z9.string().nullable(),
878
+ previousParentThreadId: z9.string().nullable(),
879
+ previousParentThreadTitle: z9.string().nullable()
867
880
  });
868
- var systemOperationEventDataSchema = z8.object({
869
- operation: z8.string(),
870
- status: z8.string(),
871
- message: z8.string(),
872
- operationId: z8.string(),
873
- metadata: z8.record(z8.string(), jsonValueSchema).optional()
881
+ var systemOperationEventDataSchema = z9.object({
882
+ operation: z9.string(),
883
+ status: z9.string(),
884
+ message: z9.string(),
885
+ operationId: z9.string(),
886
+ metadata: z9.record(z9.string(), jsonValueSchema).optional()
874
887
  });
875
- var systemInteractionLifecycleEventDataSchema = z8.object({
888
+ var systemInteractionLifecycleEventDataSchema = z9.object({
876
889
  interaction: interactionLifecycleSchema
877
890
  });
878
- var systemPermissionGrantLifecycleEventDataSchema = z8.object({
879
- interactionId: z8.string(),
880
- providerId: z8.string(),
881
- providerRequestId: z8.string(),
891
+ var systemPermissionGrantLifecycleEventDataSchema = z9.object({
892
+ interactionId: z9.string(),
893
+ providerId: z9.string(),
894
+ providerRequestId: z9.string(),
882
895
  status: pendingInteractionStatusSchema,
883
896
  resolution: approvalPendingInteractionResolutionSchema.nullable().default(null),
884
- statusReason: z8.string().nullable().default(null),
897
+ statusReason: z9.string().nullable().default(null),
885
898
  subject: pendingInteractionPermissionGrantApprovalSubjectSchema
886
899
  });
887
- var systemUserQuestionLifecycleEventDataSchema = z8.object({
888
- interactionId: z8.string(),
889
- providerId: z8.string(),
890
- providerRequestId: z8.string(),
900
+ var systemUserQuestionLifecycleEventDataSchema = z9.object({
901
+ interactionId: z9.string(),
902
+ providerId: z9.string(),
903
+ providerRequestId: z9.string(),
891
904
  status: pendingInteractionStatusSchema,
892
905
  resolution: userQuestionPendingInteractionResolutionSchema.nullable().default(null),
893
- statusReason: z8.string().nullable().default(null),
906
+ statusReason: z9.string().nullable().default(null),
894
907
  payload: userQuestionPendingInteractionPayloadSchema
895
908
  });
896
909
  var systemThreadInterruptedReasonValues = [
@@ -898,20 +911,20 @@ var systemThreadInterruptedReasonValues = [
898
911
  "host-daemon-restarted",
899
912
  "provider-turn-idle"
900
913
  ];
901
- var systemThreadInterruptedReasonSchema = z8.enum(
914
+ var systemThreadInterruptedReasonSchema = z9.enum(
902
915
  systemThreadInterruptedReasonValues
903
916
  );
904
- var systemThreadInterruptedEventDataSchema = z8.object({
917
+ var systemThreadInterruptedEventDataSchema = z9.object({
905
918
  reason: systemThreadInterruptedReasonSchema,
906
- cause: z8.literal("host-connection-lost").optional()
919
+ cause: z9.literal("host-connection-lost").optional()
907
920
  });
908
- var provisioningTranscriptEntrySchema = z8.object({
909
- type: z8.enum(["step", "output"]),
910
- key: z8.string(),
911
- text: z8.string(),
912
- startedAt: z8.number().optional(),
913
- status: z8.enum(["started", "completed", "failed"]).optional(),
914
- metadata: z8.record(z8.string(), z8.unknown()).optional()
921
+ var provisioningTranscriptEntrySchema = z9.object({
922
+ type: z9.enum(["step", "output"]),
923
+ key: z9.string(),
924
+ text: z9.string(),
925
+ startedAt: z9.number().optional(),
926
+ status: z9.enum(["started", "completed", "failed"]).optional(),
927
+ metadata: z9.record(z9.string(), z9.unknown()).optional()
915
928
  });
916
929
  var systemThreadProvisioningStatusValues = [
917
930
  "active",
@@ -919,48 +932,48 @@ var systemThreadProvisioningStatusValues = [
919
932
  "failed",
920
933
  "cancelled"
921
934
  ];
922
- var systemThreadProvisioningStatusSchema = z8.enum(
935
+ var systemThreadProvisioningStatusSchema = z9.enum(
923
936
  systemThreadProvisioningStatusValues
924
937
  );
925
- var systemThreadProvisioningEventDataSchema = z8.object({
926
- provisioningId: z8.string(),
938
+ var systemThreadProvisioningEventDataSchema = z9.object({
939
+ provisioningId: z9.string(),
927
940
  status: systemThreadProvisioningStatusSchema,
928
- environmentId: z8.string(),
929
- entries: z8.array(provisioningTranscriptEntrySchema)
941
+ environmentId: z9.string(),
942
+ entries: z9.array(provisioningTranscriptEntrySchema)
930
943
  });
931
- var systemLegacyUserMessageEventDataSchema = z8.object({
932
- text: z8.string(),
933
- toolCallId: z8.string().optional(),
934
- turnId: z8.string().optional()
944
+ var systemLegacyUserMessageEventDataSchema = z9.object({
945
+ text: z9.string(),
946
+ toolCallId: z9.string().optional(),
947
+ turnId: z9.string().optional()
935
948
  });
936
- var systemProviderTurnWatchdogEventDataSchema = z8.object({
937
- reason: z8.literal("provider-turn-idle"),
938
- thresholdMs: z8.number().int().positive(),
939
- elapsedMs: z8.number().int().nonnegative(),
940
- activeTurnId: z8.string().min(1),
941
- activeTurnStartedAt: z8.number().int().nonnegative(),
942
- lastActivityEventSequence: z8.number().int().positive(),
943
- lastActivityEventType: z8.string().min(1),
944
- lastActivityEventAt: z8.number().int().nonnegative(),
945
- providerId: z8.string().min(1),
946
- providerThreadId: z8.string().min(1).nullable(),
947
- firedAt: z8.number().int().nonnegative()
949
+ var systemProviderTurnWatchdogEventDataSchema = z9.object({
950
+ reason: z9.literal("provider-turn-idle"),
951
+ thresholdMs: z9.number().int().positive(),
952
+ elapsedMs: z9.number().int().nonnegative(),
953
+ activeTurnId: z9.string().min(1),
954
+ activeTurnStartedAt: z9.number().int().nonnegative(),
955
+ lastActivityEventSequence: z9.number().int().positive(),
956
+ lastActivityEventType: z9.string().min(1),
957
+ lastActivityEventAt: z9.number().int().nonnegative(),
958
+ providerId: z9.string().min(1),
959
+ providerThreadId: z9.string().min(1).nullable(),
960
+ firedAt: z9.number().int().nonnegative()
948
961
  });
949
962
 
950
963
  // ../domain/src/thread-event-scope.ts
951
- import { z as z9 } from "zod";
964
+ import { z as z10 } from "zod";
952
965
  var threadEventScopeKindValues = ["thread", "turn"];
953
- var threadEventScopeKindSchema = z9.enum(threadEventScopeKindValues);
954
- var threadEventScopeSchema = z9.discriminatedUnion("kind", [
955
- z9.object({ kind: z9.literal("thread") }),
956
- z9.object({ kind: z9.literal("turn"), turnId: z9.string().min(1) })
966
+ var threadEventScopeKindSchema = z10.enum(threadEventScopeKindValues);
967
+ var threadEventScopeSchema = z10.discriminatedUnion("kind", [
968
+ z10.object({ kind: z10.literal("thread") }),
969
+ z10.object({ kind: z10.literal("turn"), turnId: z10.string().min(1) })
957
970
  ]);
958
971
  var threadEventScopePolicyValues = [
959
972
  "thread",
960
973
  "turn",
961
974
  "thread-or-turn"
962
975
  ];
963
- var threadEventScopePolicySchema = z9.enum(threadEventScopePolicyValues);
976
+ var threadEventScopePolicySchema = z10.enum(threadEventScopePolicyValues);
964
977
  var threadEventScopeDefinitionByType = {
965
978
  "thread/started": {
966
979
  policy: "thread",
@@ -1147,32 +1160,32 @@ function validateThreadEventScope(args) {
1147
1160
  }
1148
1161
 
1149
1162
  // ../domain/src/thread-timeline-goal.ts
1150
- import { z as z10 } from "zod";
1151
- var threadTimelineGoalStatusSchema = z10.enum([
1163
+ import { z as z11 } from "zod";
1164
+ var threadTimelineGoalStatusSchema = z11.enum([
1152
1165
  "active",
1153
1166
  "paused",
1154
1167
  "budgetLimited",
1155
1168
  "complete"
1156
1169
  ]);
1157
- var threadTimelineGoalSchema = z10.object({
1158
- sourceSeq: z10.number().int().nonnegative(),
1159
- updatedAt: z10.number(),
1160
- objective: z10.string(),
1170
+ var threadTimelineGoalSchema = z11.object({
1171
+ sourceSeq: z11.number().int().nonnegative(),
1172
+ updatedAt: z11.number(),
1173
+ objective: z11.string(),
1161
1174
  status: threadTimelineGoalStatusSchema,
1162
- tokenBudget: z10.number().nullable(),
1163
- tokensUsed: z10.number(),
1164
- timeUsedSeconds: z10.number()
1175
+ tokenBudget: z11.number().nullable(),
1176
+ tokensUsed: z11.number(),
1177
+ timeUsedSeconds: z11.number()
1165
1178
  });
1166
1179
 
1167
1180
  // ../domain/src/provider-event.ts
1168
- var threadEventItemStatusSchema = z11.enum([
1181
+ var threadEventItemStatusSchema = z12.enum([
1169
1182
  "pending",
1170
1183
  "completed",
1171
1184
  "failed",
1172
1185
  "interrupted"
1173
1186
  ]);
1174
- var threadEventItemApprovalStatusSchema = z11.enum(["waiting_for_approval", "denied"]).nullable();
1175
- var threadEventTurnStatusSchema = z11.enum([
1187
+ var threadEventItemApprovalStatusSchema = z12.enum(["waiting_for_approval", "denied"]).nullable();
1188
+ var threadEventTurnStatusSchema = z12.enum([
1176
1189
  "completed",
1177
1190
  "failed",
1178
1191
  "interrupted"
@@ -1198,515 +1211,515 @@ var providerErrorCategoryValues = [
1198
1211
  "unauthorized",
1199
1212
  "unknown"
1200
1213
  ];
1201
- var providerErrorCategorySchema = z11.enum(providerErrorCategoryValues);
1202
- var providerErrorInfoSchema = z11.object({
1214
+ var providerErrorCategorySchema = z12.enum(providerErrorCategoryValues);
1215
+ var providerErrorInfoSchema = z12.object({
1203
1216
  category: providerErrorCategorySchema,
1204
- providerCode: z11.string().nullable(),
1205
- httpStatusCode: z11.number().nullable()
1217
+ providerCode: z12.string().nullable(),
1218
+ httpStatusCode: z12.number().nullable()
1206
1219
  });
1207
- var providerRateLimitStatusSchema = z11.enum([
1220
+ var providerRateLimitStatusSchema = z12.enum([
1208
1221
  "allowed",
1209
1222
  "warning",
1210
1223
  "blocked",
1211
1224
  "unknown"
1212
1225
  ]);
1213
- var providerRateLimitWindowSchema = z11.object({
1214
- providerKey: z11.string().min(1).nullable(),
1215
- label: z11.string().min(1).nullable(),
1226
+ var providerRateLimitWindowSchema = z12.object({
1227
+ providerKey: z12.string().min(1).nullable(),
1228
+ label: z12.string().min(1).nullable(),
1216
1229
  status: providerRateLimitStatusSchema,
1217
- resetsAtMs: z11.number().int().nonnegative().nullable()
1230
+ resetsAtMs: z12.number().int().nonnegative().nullable()
1218
1231
  });
1219
- var providerRateLimitStateSchema = z11.object({
1220
- providerId: z11.string().min(1),
1232
+ var providerRateLimitStateSchema = z12.object({
1233
+ providerId: z12.string().min(1),
1221
1234
  status: providerRateLimitStatusSchema,
1222
- kind: z11.enum(["subscription-window", "credits", "spend-control", "unknown"]),
1223
- windows: z11.array(providerRateLimitWindowSchema),
1224
- reachedReason: z11.string().min(1).nullable(),
1225
- overageStatus: z11.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
1226
- overageReason: z11.string().min(1).nullable()
1235
+ kind: z12.enum(["subscription-window", "credits", "spend-control", "unknown"]),
1236
+ windows: z12.array(providerRateLimitWindowSchema),
1237
+ reachedReason: z12.string().min(1).nullable(),
1238
+ overageStatus: z12.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
1239
+ overageReason: z12.string().min(1).nullable()
1227
1240
  });
1228
- var threadEventFileChangeKindSchema = z11.enum(["add", "delete", "update"]);
1229
- var threadEventFileChangeSchema = z11.object({
1230
- path: z11.string(),
1241
+ var threadEventFileChangeKindSchema = z12.enum(["add", "delete", "update"]);
1242
+ var threadEventFileChangeSchema = z12.object({
1243
+ path: z12.string(),
1231
1244
  kind: threadEventFileChangeKindSchema,
1232
- movePath: z11.string().optional(),
1233
- diff: z11.string().optional()
1245
+ movePath: z12.string().optional(),
1246
+ diff: z12.string().optional()
1234
1247
  });
1235
- var threadEventPlanStepStatusSchema = z11.enum([
1248
+ var threadEventPlanStepStatusSchema = z12.enum([
1236
1249
  "pending",
1237
1250
  "active",
1238
1251
  "completed",
1239
1252
  "failed"
1240
1253
  ]);
1241
- var threadEventPlanStepSchema = z11.object({
1242
- step: z11.string(),
1254
+ var threadEventPlanStepSchema = z12.object({
1255
+ step: z12.string(),
1243
1256
  status: threadEventPlanStepStatusSchema.optional()
1244
1257
  });
1245
1258
  var itemPresentationField = {
1246
1259
  presentation: threadEventItemPresentationSchema.optional()
1247
1260
  };
1248
- var threadEventWebSearchItemSchema = z11.object({
1249
- type: z11.literal("webSearch"),
1250
- id: z11.string(),
1251
- queries: z11.array(z11.string()).min(1),
1252
- resultText: z11.string().nullable(),
1261
+ var threadEventWebSearchItemSchema = z12.object({
1262
+ type: z12.literal("webSearch"),
1263
+ id: z12.string(),
1264
+ queries: z12.array(z12.string()).min(1),
1265
+ resultText: z12.string().nullable(),
1253
1266
  ...itemPresentationField,
1254
- parentToolCallId: z11.string().optional()
1267
+ parentToolCallId: z12.string().optional()
1255
1268
  });
1256
- var threadEventWebFetchItemSchema = z11.object({
1257
- type: z11.literal("webFetch"),
1258
- id: z11.string(),
1259
- url: z11.string(),
1260
- prompt: z11.string().nullable(),
1261
- pattern: z11.string().nullable(),
1262
- resultText: z11.string().nullable(),
1269
+ var threadEventWebFetchItemSchema = z12.object({
1270
+ type: z12.literal("webFetch"),
1271
+ id: z12.string(),
1272
+ url: z12.string(),
1273
+ prompt: z12.string().nullable(),
1274
+ pattern: z12.string().nullable(),
1275
+ resultText: z12.string().nullable(),
1263
1276
  ...itemPresentationField,
1264
- parentToolCallId: z11.string().optional()
1277
+ parentToolCallId: z12.string().optional()
1265
1278
  });
1266
- var threadEventImageViewItemSchema = z11.object({
1267
- type: z11.literal("imageView"),
1268
- id: z11.string(),
1269
- path: z11.string(),
1279
+ var threadEventImageViewItemSchema = z12.object({
1280
+ type: z12.literal("imageView"),
1281
+ id: z12.string(),
1282
+ path: z12.string(),
1270
1283
  ...itemPresentationField,
1271
- parentToolCallId: z11.string().optional()
1284
+ parentToolCallId: z12.string().optional()
1272
1285
  });
1273
- var threadEventFileReadItemSchema = z11.object({
1274
- type: z11.literal("fileRead"),
1275
- id: z11.string(),
1276
- path: z11.string(),
1277
- cmd: z11.string().optional(),
1286
+ var threadEventFileReadItemSchema = z12.object({
1287
+ type: z12.literal("fileRead"),
1288
+ id: z12.string(),
1289
+ path: z12.string(),
1290
+ cmd: z12.string().optional(),
1278
1291
  status: threadEventItemStatusSchema,
1279
1292
  ...itemPresentationField,
1280
- parentToolCallId: z11.string().optional()
1293
+ parentToolCallId: z12.string().optional()
1281
1294
  });
1282
- var threadEventSearchModeSchema = z11.enum(["content", "path", "list"]);
1283
- var threadEventSearchItemSchema = z11.object({
1284
- type: z11.literal("search"),
1285
- id: z11.string(),
1295
+ var threadEventSearchModeSchema = z12.enum(["content", "path", "list"]);
1296
+ var threadEventSearchItemSchema = z12.object({
1297
+ type: z12.literal("search"),
1298
+ id: z12.string(),
1286
1299
  mode: threadEventSearchModeSchema,
1287
- query: z11.string(),
1288
- path: z11.string().optional(),
1289
- cmd: z11.string().optional(),
1300
+ query: z12.string(),
1301
+ path: z12.string().optional(),
1302
+ cmd: z12.string().optional(),
1290
1303
  status: threadEventItemStatusSchema,
1291
1304
  ...itemPresentationField,
1292
- parentToolCallId: z11.string().optional()
1305
+ parentToolCallId: z12.string().optional()
1293
1306
  });
1294
- var threadEventDelegationItemSchema = z11.object({
1295
- type: z11.literal("delegation"),
1296
- id: z11.string(),
1297
- childRef: z11.string().min(1),
1298
- label: z11.string(),
1307
+ var threadEventDelegationItemSchema = z12.object({
1308
+ type: z12.literal("delegation"),
1309
+ id: z12.string(),
1310
+ childRef: z12.string().min(1),
1311
+ label: z12.string(),
1299
1312
  status: threadEventItemStatusSchema,
1300
- background: z11.boolean(),
1301
- summary: z11.string().optional(),
1313
+ background: z12.boolean(),
1314
+ summary: z12.string().optional(),
1302
1315
  ...itemPresentationField,
1303
- parentToolCallId: z11.string().optional()
1316
+ parentToolCallId: z12.string().optional()
1304
1317
  });
1305
- var threadEventPlanStepsItemSchema = z11.object({
1306
- type: z11.literal("planSteps"),
1307
- id: z11.string(),
1308
- steps: z11.array(threadEventPlanStepSchema),
1309
- explanation: z11.string().optional(),
1318
+ var threadEventPlanStepsItemSchema = z12.object({
1319
+ type: z12.literal("planSteps"),
1320
+ id: z12.string(),
1321
+ steps: z12.array(threadEventPlanStepSchema),
1322
+ explanation: z12.string().optional(),
1310
1323
  status: threadEventItemStatusSchema,
1311
1324
  ...itemPresentationField,
1312
- parentToolCallId: z11.string().optional()
1325
+ parentToolCallId: z12.string().optional()
1313
1326
  });
1314
- var threadEventExtensionItemSchema = z11.object({
1315
- type: z11.literal("extension"),
1316
- id: z11.string(),
1327
+ var threadEventExtensionItemSchema = z12.object({
1328
+ type: z12.literal("extension"),
1329
+ id: z12.string(),
1317
1330
  kind: extensionKindSchema,
1318
1331
  payload: jsonValueSchema,
1319
1332
  status: threadEventItemStatusSchema,
1320
1333
  presentation: threadEventItemPresentationSchema,
1321
- parentToolCallId: z11.string().optional()
1334
+ parentToolCallId: z12.string().optional()
1322
1335
  });
1323
- var threadEventTextTruncationSchema = z11.object({
1324
- originalLength: z11.number(),
1325
- retainedHeadLength: z11.number(),
1326
- retainedTailLength: z11.number(),
1327
- truncatedAt: z11.number()
1336
+ var threadEventTextTruncationSchema = z12.object({
1337
+ originalLength: z12.number(),
1338
+ retainedHeadLength: z12.number(),
1339
+ retainedTailLength: z12.number(),
1340
+ truncatedAt: z12.number()
1328
1341
  });
1329
- var threadEventItemTruncationSchema = z11.object({
1342
+ var threadEventItemTruncationSchema = z12.object({
1330
1343
  aggregatedOutput: threadEventTextTruncationSchema.optional(),
1331
1344
  result: threadEventTextTruncationSchema.optional(),
1332
1345
  resultText: threadEventTextTruncationSchema.optional()
1333
1346
  });
1334
- var threadEventUserContentSchema = z11.discriminatedUnion("type", [
1335
- z11.object({ type: z11.literal("text"), text: z11.string() }),
1336
- z11.object({ type: z11.literal("image"), url: z11.string() }),
1337
- z11.object({ type: z11.literal("localImage"), path: z11.string() }),
1338
- z11.object({ type: z11.literal("localFile"), path: z11.string() })
1347
+ var threadEventUserContentSchema = z12.discriminatedUnion("type", [
1348
+ z12.object({ type: z12.literal("text"), text: z12.string() }),
1349
+ z12.object({ type: z12.literal("image"), url: z12.string() }),
1350
+ z12.object({ type: z12.literal("localImage"), path: z12.string() }),
1351
+ z12.object({ type: z12.literal("localFile"), path: z12.string() })
1339
1352
  ]);
1340
- var threadEventTokenUsageBreakdownSchema = z11.object({
1341
- totalTokens: z11.number(),
1342
- inputTokens: z11.number(),
1343
- cachedInputTokens: z11.number(),
1344
- outputTokens: z11.number(),
1345
- reasoningOutputTokens: z11.number()
1353
+ var threadEventTokenUsageBreakdownSchema = z12.object({
1354
+ totalTokens: z12.number(),
1355
+ inputTokens: z12.number(),
1356
+ cachedInputTokens: z12.number(),
1357
+ outputTokens: z12.number(),
1358
+ reasoningOutputTokens: z12.number()
1346
1359
  });
1347
- var threadEventContextWindowUsageSchema = z11.object({
1348
- usedTokens: z11.number().nullable(),
1349
- modelContextWindow: z11.number().nullable(),
1350
- estimated: z11.boolean()
1360
+ var threadEventContextWindowUsageSchema = z12.object({
1361
+ usedTokens: z12.number().nullable(),
1362
+ modelContextWindow: z12.number().nullable(),
1363
+ estimated: z12.boolean()
1351
1364
  });
1352
- var threadEventTokenUsageSchema = z11.object({
1365
+ var threadEventTokenUsageSchema = z12.object({
1353
1366
  total: threadEventTokenUsageBreakdownSchema,
1354
1367
  last: threadEventTokenUsageBreakdownSchema,
1355
- modelContextWindow: z11.number().nullable()
1368
+ modelContextWindow: z12.number().nullable()
1356
1369
  });
1357
- var threadEventWarningCategorySchema = z11.enum([
1370
+ var threadEventWarningCategorySchema = z12.enum([
1358
1371
  "deprecation",
1359
1372
  "config",
1360
1373
  "general",
1361
1374
  "compaction-skipped"
1362
1375
  ]);
1363
- var providerRawEventSchema = z11.object({
1364
- jsonrpc: z11.literal("2.0"),
1365
- id: z11.union([z11.string(), z11.number()]).optional(),
1366
- method: z11.string(),
1376
+ var providerRawEventSchema = z12.object({
1377
+ jsonrpc: z12.literal("2.0"),
1378
+ id: z12.union([z12.string(), z12.number()]).optional(),
1379
+ method: z12.string(),
1367
1380
  params: jsonValueSchema.optional()
1368
1381
  });
1369
- var providerUnhandledEventSchema = z11.object({
1370
- type: z11.literal("provider/unhandled"),
1371
- threadId: z11.string(),
1372
- providerThreadId: z11.string(),
1373
- providerId: z11.string(),
1374
- rawType: z11.string(),
1382
+ var providerUnhandledEventSchema = z12.object({
1383
+ type: z12.literal("provider/unhandled"),
1384
+ threadId: z12.string(),
1385
+ providerThreadId: z12.string(),
1386
+ providerId: z12.string(),
1387
+ rawType: z12.string(),
1375
1388
  rawEvent: providerRawEventSchema,
1376
- parentToolCallId: z11.string().optional()
1389
+ parentToolCallId: z12.string().optional()
1377
1390
  });
1378
- var toolCallProgressEventSchema = z11.object({
1379
- type: z11.literal("item/toolCall/progress"),
1380
- threadId: z11.string(),
1381
- providerThreadId: z11.string(),
1382
- itemId: z11.string(),
1383
- message: z11.string().optional(),
1384
- parentToolCallId: z11.string().optional()
1391
+ var toolCallProgressEventSchema = z12.object({
1392
+ type: z12.literal("item/toolCall/progress"),
1393
+ threadId: z12.string(),
1394
+ providerThreadId: z12.string(),
1395
+ itemId: z12.string(),
1396
+ message: z12.string().optional(),
1397
+ parentToolCallId: z12.string().optional()
1385
1398
  });
1386
- var threadEventBackgroundTaskItemSchema = z11.object({
1387
- type: z11.literal("backgroundTask"),
1388
- id: z11.string(),
1389
- familyId: z11.string().optional(),
1390
- taskType: z11.string(),
1391
- description: z11.string(),
1399
+ var threadEventBackgroundTaskItemSchema = z12.object({
1400
+ type: z12.literal("backgroundTask"),
1401
+ id: z12.string(),
1402
+ familyId: z12.string().optional(),
1403
+ taskType: z12.string(),
1404
+ description: z12.string(),
1392
1405
  status: threadEventItemStatusSchema,
1393
1406
  taskStatus: backgroundTaskStatusSchema,
1394
- skipTranscript: z11.boolean(),
1395
- workflowName: z11.string().optional(),
1407
+ skipTranscript: z12.boolean(),
1408
+ workflowName: z12.string().optional(),
1396
1409
  workflow: workflowProgressSnapshotSchema.optional(),
1397
1410
  usage: backgroundTaskUsageSchema.optional(),
1398
- summary: z11.string().optional(),
1399
- error: z11.string().optional(),
1400
- outputFile: z11.string().optional(),
1411
+ summary: z12.string().optional(),
1412
+ error: z12.string().optional(),
1413
+ outputFile: z12.string().optional(),
1401
1414
  ...itemPresentationField,
1402
- parentToolCallId: z11.string().optional()
1415
+ parentToolCallId: z12.string().optional()
1403
1416
  });
1404
- var threadEventItemSchema = z11.discriminatedUnion("type", [
1405
- z11.object({
1406
- type: z11.literal("userMessage"),
1407
- id: z11.string(),
1408
- content: z11.array(threadEventUserContentSchema),
1417
+ var threadEventItemSchema = z12.discriminatedUnion("type", [
1418
+ z12.object({
1419
+ type: z12.literal("userMessage"),
1420
+ id: z12.string(),
1421
+ content: z12.array(threadEventUserContentSchema),
1409
1422
  clientRequestId: clientTurnRequestIdSchema.optional(),
1410
- parentToolCallId: z11.string().optional()
1423
+ parentToolCallId: z12.string().optional()
1411
1424
  }).strict(),
1412
- z11.object({
1413
- type: z11.literal("agentMessage"),
1414
- id: z11.string(),
1415
- text: z11.string(),
1425
+ z12.object({
1426
+ type: z12.literal("agentMessage"),
1427
+ id: z12.string(),
1428
+ text: z12.string(),
1416
1429
  ...itemPresentationField,
1417
- parentToolCallId: z11.string().optional()
1430
+ parentToolCallId: z12.string().optional()
1418
1431
  }),
1419
- z11.object({
1420
- type: z11.literal("commandExecution"),
1421
- id: z11.string(),
1422
- command: z11.string(),
1423
- cwd: z11.string(),
1432
+ z12.object({
1433
+ type: z12.literal("commandExecution"),
1434
+ id: z12.string(),
1435
+ command: z12.string(),
1436
+ cwd: z12.string(),
1424
1437
  status: threadEventItemStatusSchema,
1425
1438
  approvalStatus: threadEventItemApprovalStatusSchema,
1426
- aggregatedOutput: z11.string().optional(),
1427
- exitCode: z11.number().optional(),
1428
- durationMs: z11.number().optional(),
1439
+ aggregatedOutput: z12.string().optional(),
1440
+ exitCode: z12.number().optional(),
1441
+ durationMs: z12.number().optional(),
1429
1442
  truncation: threadEventItemTruncationSchema.optional(),
1430
1443
  ...itemPresentationField,
1431
- parentToolCallId: z11.string().optional()
1444
+ parentToolCallId: z12.string().optional()
1432
1445
  }),
1433
- z11.object({
1434
- type: z11.literal("fileChange"),
1435
- id: z11.string(),
1436
- changes: z11.array(threadEventFileChangeSchema),
1446
+ z12.object({
1447
+ type: z12.literal("fileChange"),
1448
+ id: z12.string(),
1449
+ changes: z12.array(threadEventFileChangeSchema),
1437
1450
  status: threadEventItemStatusSchema,
1438
1451
  approvalStatus: threadEventItemApprovalStatusSchema,
1439
1452
  ...itemPresentationField,
1440
- parentToolCallId: z11.string().optional()
1453
+ parentToolCallId: z12.string().optional()
1441
1454
  }),
1442
1455
  threadEventWebSearchItemSchema,
1443
1456
  threadEventWebFetchItemSchema,
1444
1457
  threadEventImageViewItemSchema,
1445
1458
  threadEventFileReadItemSchema,
1446
1459
  threadEventSearchItemSchema,
1447
- z11.object({
1448
- type: z11.literal("toolCall"),
1449
- id: z11.string(),
1450
- server: z11.string().optional(),
1451
- tool: z11.string(),
1452
- arguments: z11.record(z11.string(), z11.unknown()).optional(),
1460
+ z12.object({
1461
+ type: z12.literal("toolCall"),
1462
+ id: z12.string(),
1463
+ server: z12.string().optional(),
1464
+ tool: z12.string(),
1465
+ arguments: z12.record(z12.string(), z12.unknown()).optional(),
1453
1466
  status: threadEventItemStatusSchema,
1454
- result: z11.unknown().optional(),
1455
- error: z11.string().optional(),
1456
- durationMs: z11.number().optional(),
1467
+ result: z12.unknown().optional(),
1468
+ error: z12.string().optional(),
1469
+ durationMs: z12.number().optional(),
1457
1470
  truncation: threadEventItemTruncationSchema.optional(),
1458
1471
  ...itemPresentationField,
1459
- parentToolCallId: z11.string().optional()
1472
+ parentToolCallId: z12.string().optional()
1460
1473
  }),
1461
- z11.object({
1462
- type: z11.literal("reasoning"),
1463
- id: z11.string(),
1464
- summary: z11.array(z11.string()),
1465
- content: z11.array(z11.string()),
1474
+ z12.object({
1475
+ type: z12.literal("reasoning"),
1476
+ id: z12.string(),
1477
+ summary: z12.array(z12.string()),
1478
+ content: z12.array(z12.string()),
1466
1479
  ...itemPresentationField,
1467
- parentToolCallId: z11.string().optional()
1480
+ parentToolCallId: z12.string().optional()
1468
1481
  }),
1469
- z11.object({
1470
- type: z11.literal("plan"),
1471
- id: z11.string(),
1472
- text: z11.string(),
1482
+ z12.object({
1483
+ type: z12.literal("plan"),
1484
+ id: z12.string(),
1485
+ text: z12.string(),
1473
1486
  ...itemPresentationField,
1474
- parentToolCallId: z11.string().optional()
1487
+ parentToolCallId: z12.string().optional()
1475
1488
  }),
1476
1489
  threadEventPlanStepsItemSchema,
1477
- z11.object({
1478
- type: z11.literal("contextCompaction"),
1479
- id: z11.string(),
1490
+ z12.object({
1491
+ type: z12.literal("contextCompaction"),
1492
+ id: z12.string(),
1480
1493
  ...itemPresentationField,
1481
- parentToolCallId: z11.string().optional()
1494
+ parentToolCallId: z12.string().optional()
1482
1495
  }),
1483
1496
  threadEventBackgroundTaskItemSchema,
1484
1497
  threadEventDelegationItemSchema,
1485
1498
  threadEventExtensionItemSchema
1486
1499
  ]);
1487
- var unscopedProviderEventSchema = z11.discriminatedUnion("type", [
1488
- z11.object({
1489
- type: z11.literal("thread/started"),
1490
- threadId: z11.string()
1500
+ var unscopedProviderEventSchema = z12.discriminatedUnion("type", [
1501
+ z12.object({
1502
+ type: z12.literal("thread/started"),
1503
+ threadId: z12.string()
1491
1504
  }),
1492
- z11.object({
1493
- type: z11.literal("thread/identity"),
1494
- threadId: z11.string(),
1495
- providerThreadId: z11.string()
1505
+ z12.object({
1506
+ type: z12.literal("thread/identity"),
1507
+ threadId: z12.string(),
1508
+ providerThreadId: z12.string()
1496
1509
  }),
1497
- z11.object({
1498
- type: z11.literal("turn/started"),
1499
- threadId: z11.string(),
1500
- providerThreadId: z11.string(),
1501
- parentToolCallId: z11.string().optional()
1510
+ z12.object({
1511
+ type: z12.literal("turn/started"),
1512
+ threadId: z12.string(),
1513
+ providerThreadId: z12.string(),
1514
+ parentToolCallId: z12.string().optional()
1502
1515
  }),
1503
- z11.object({
1504
- type: z11.literal("turn/completed"),
1505
- threadId: z11.string(),
1506
- providerThreadId: z11.string().nullable(),
1516
+ z12.object({
1517
+ type: z12.literal("turn/completed"),
1518
+ threadId: z12.string(),
1519
+ providerThreadId: z12.string().nullable(),
1507
1520
  status: threadEventTurnStatusSchema,
1508
- error: z11.object({ message: z11.string() }).optional(),
1509
- providerCheckpointId: z11.string().min(1).optional()
1521
+ error: z12.object({ message: z12.string() }).optional(),
1522
+ providerCheckpointId: z12.string().min(1).optional()
1510
1523
  }),
1511
- z11.object({
1512
- type: z11.literal("turn/input/accepted"),
1513
- threadId: z11.string(),
1514
- providerThreadId: z11.string(),
1524
+ z12.object({
1525
+ type: z12.literal("turn/input/accepted"),
1526
+ threadId: z12.string(),
1527
+ providerThreadId: z12.string(),
1515
1528
  clientRequestId: clientTurnRequestIdSchema,
1516
1529
  scope: threadEventScopeSchema
1517
1530
  }).strict(),
1518
- z11.object({
1519
- type: z11.literal("thread/name/updated"),
1520
- threadId: z11.string(),
1521
- providerThreadId: z11.string(),
1522
- threadName: z11.string()
1531
+ z12.object({
1532
+ type: z12.literal("thread/name/updated"),
1533
+ threadId: z12.string(),
1534
+ providerThreadId: z12.string(),
1535
+ threadName: z12.string()
1523
1536
  }),
1524
- z11.object({
1525
- type: z11.literal("thread/compacted"),
1526
- threadId: z11.string(),
1527
- providerThreadId: z11.string()
1537
+ z12.object({
1538
+ type: z12.literal("thread/compacted"),
1539
+ threadId: z12.string(),
1540
+ providerThreadId: z12.string()
1528
1541
  }),
1529
- z11.object({
1530
- type: z11.literal("thread/context/cleared"),
1531
- threadId: z11.string(),
1532
- providerThreadId: z11.string()
1542
+ z12.object({
1543
+ type: z12.literal("thread/context/cleared"),
1544
+ threadId: z12.string(),
1545
+ providerThreadId: z12.string()
1533
1546
  }),
1534
- z11.object({
1535
- type: z11.literal("thread/goal/updated"),
1536
- threadId: z11.string(),
1537
- providerThreadId: z11.string(),
1538
- objective: z11.string(),
1547
+ z12.object({
1548
+ type: z12.literal("thread/goal/updated"),
1549
+ threadId: z12.string(),
1550
+ providerThreadId: z12.string(),
1551
+ objective: z12.string(),
1539
1552
  status: threadTimelineGoalStatusSchema,
1540
- tokenBudget: z11.number().nullable(),
1541
- tokensUsed: z11.number(),
1542
- timeUsedSeconds: z11.number()
1553
+ tokenBudget: z12.number().nullable(),
1554
+ tokensUsed: z12.number(),
1555
+ timeUsedSeconds: z12.number()
1543
1556
  }),
1544
- z11.object({
1545
- type: z11.literal("thread/goal/cleared"),
1546
- threadId: z11.string(),
1547
- providerThreadId: z11.string()
1557
+ z12.object({
1558
+ type: z12.literal("thread/goal/cleared"),
1559
+ threadId: z12.string(),
1560
+ providerThreadId: z12.string()
1548
1561
  }),
1549
- z11.object({
1550
- type: z11.literal("item/started"),
1551
- threadId: z11.string(),
1552
- providerThreadId: z11.string(),
1562
+ z12.object({
1563
+ type: z12.literal("item/started"),
1564
+ threadId: z12.string(),
1565
+ providerThreadId: z12.string(),
1553
1566
  item: threadEventItemSchema
1554
1567
  }),
1555
- z11.object({
1556
- type: z11.literal("item/completed"),
1557
- threadId: z11.string(),
1558
- providerThreadId: z11.string(),
1568
+ z12.object({
1569
+ type: z12.literal("item/completed"),
1570
+ threadId: z12.string(),
1571
+ providerThreadId: z12.string(),
1559
1572
  item: threadEventItemSchema
1560
1573
  }),
1561
- z11.object({
1562
- type: z11.literal("item/agentMessage/delta"),
1563
- threadId: z11.string(),
1564
- providerThreadId: z11.string(),
1565
- itemId: z11.string(),
1566
- delta: z11.string(),
1567
- parentToolCallId: z11.string().optional()
1574
+ z12.object({
1575
+ type: z12.literal("item/agentMessage/delta"),
1576
+ threadId: z12.string(),
1577
+ providerThreadId: z12.string(),
1578
+ itemId: z12.string(),
1579
+ delta: z12.string(),
1580
+ parentToolCallId: z12.string().optional()
1568
1581
  }),
1569
- z11.object({
1570
- type: z11.literal("item/commandExecution/outputDelta"),
1571
- threadId: z11.string(),
1572
- providerThreadId: z11.string(),
1573
- itemId: z11.string(),
1574
- delta: z11.string(),
1575
- reset: z11.boolean().optional(),
1576
- parentToolCallId: z11.string().optional()
1582
+ z12.object({
1583
+ type: z12.literal("item/commandExecution/outputDelta"),
1584
+ threadId: z12.string(),
1585
+ providerThreadId: z12.string(),
1586
+ itemId: z12.string(),
1587
+ delta: z12.string(),
1588
+ reset: z12.boolean().optional(),
1589
+ parentToolCallId: z12.string().optional()
1577
1590
  }),
1578
- z11.object({
1579
- type: z11.literal("item/fileChange/outputDelta"),
1580
- threadId: z11.string(),
1581
- providerThreadId: z11.string(),
1582
- itemId: z11.string(),
1583
- delta: z11.string(),
1584
- parentToolCallId: z11.string().optional()
1591
+ z12.object({
1592
+ type: z12.literal("item/fileChange/outputDelta"),
1593
+ threadId: z12.string(),
1594
+ providerThreadId: z12.string(),
1595
+ itemId: z12.string(),
1596
+ delta: z12.string(),
1597
+ parentToolCallId: z12.string().optional()
1585
1598
  }),
1586
- z11.object({
1587
- type: z11.literal("item/reasoning/summaryTextDelta"),
1588
- threadId: z11.string(),
1589
- providerThreadId: z11.string(),
1590
- itemId: z11.string(),
1591
- delta: z11.string(),
1592
- parentToolCallId: z11.string().optional()
1599
+ z12.object({
1600
+ type: z12.literal("item/reasoning/summaryTextDelta"),
1601
+ threadId: z12.string(),
1602
+ providerThreadId: z12.string(),
1603
+ itemId: z12.string(),
1604
+ delta: z12.string(),
1605
+ parentToolCallId: z12.string().optional()
1593
1606
  }),
1594
- z11.object({
1595
- type: z11.literal("item/reasoning/textDelta"),
1596
- threadId: z11.string(),
1597
- providerThreadId: z11.string(),
1598
- itemId: z11.string(),
1599
- delta: z11.string(),
1600
- parentToolCallId: z11.string().optional()
1607
+ z12.object({
1608
+ type: z12.literal("item/reasoning/textDelta"),
1609
+ threadId: z12.string(),
1610
+ providerThreadId: z12.string(),
1611
+ itemId: z12.string(),
1612
+ delta: z12.string(),
1613
+ parentToolCallId: z12.string().optional()
1601
1614
  }),
1602
- z11.object({
1603
- type: z11.literal("item/plan/delta"),
1604
- threadId: z11.string(),
1605
- providerThreadId: z11.string(),
1606
- itemId: z11.string(),
1607
- delta: z11.string(),
1608
- parentToolCallId: z11.string().optional()
1615
+ z12.object({
1616
+ type: z12.literal("item/plan/delta"),
1617
+ threadId: z12.string(),
1618
+ providerThreadId: z12.string(),
1619
+ itemId: z12.string(),
1620
+ delta: z12.string(),
1621
+ parentToolCallId: z12.string().optional()
1609
1622
  }),
1610
- z11.object({
1611
- type: z11.literal("item/mcpToolCall/progress"),
1612
- threadId: z11.string(),
1613
- providerThreadId: z11.string(),
1614
- itemId: z11.string(),
1615
- message: z11.string().optional(),
1616
- parentToolCallId: z11.string().optional()
1623
+ z12.object({
1624
+ type: z12.literal("item/mcpToolCall/progress"),
1625
+ threadId: z12.string(),
1626
+ providerThreadId: z12.string(),
1627
+ itemId: z12.string(),
1628
+ message: z12.string().optional(),
1629
+ parentToolCallId: z12.string().optional()
1617
1630
  }),
1618
1631
  toolCallProgressEventSchema,
1619
- z11.object({
1620
- type: z11.literal("item/backgroundTask/progress"),
1621
- threadId: z11.string(),
1622
- providerThreadId: z11.string(),
1632
+ z12.object({
1633
+ type: z12.literal("item/backgroundTask/progress"),
1634
+ threadId: z12.string(),
1635
+ providerThreadId: z12.string(),
1623
1636
  item: threadEventBackgroundTaskItemSchema
1624
1637
  }),
1625
- z11.object({
1626
- type: z11.literal("item/backgroundTask/completed"),
1627
- threadId: z11.string(),
1628
- providerThreadId: z11.string(),
1638
+ z12.object({
1639
+ type: z12.literal("item/backgroundTask/completed"),
1640
+ threadId: z12.string(),
1641
+ providerThreadId: z12.string(),
1629
1642
  item: threadEventBackgroundTaskItemSchema
1630
1643
  }),
1631
- z11.object({
1632
- type: z11.literal("item/delegation/progress"),
1633
- threadId: z11.string(),
1634
- providerThreadId: z11.string(),
1644
+ z12.object({
1645
+ type: z12.literal("item/delegation/progress"),
1646
+ threadId: z12.string(),
1647
+ providerThreadId: z12.string(),
1635
1648
  item: threadEventDelegationItemSchema
1636
1649
  }),
1637
- z11.object({
1638
- type: z11.literal("item/delegation/completed"),
1639
- threadId: z11.string(),
1640
- providerThreadId: z11.string(),
1650
+ z12.object({
1651
+ type: z12.literal("item/delegation/completed"),
1652
+ threadId: z12.string(),
1653
+ providerThreadId: z12.string(),
1641
1654
  item: threadEventDelegationItemSchema
1642
1655
  }),
1643
- z11.object({
1644
- type: z11.literal("thread/tokenUsage/updated"),
1645
- threadId: z11.string(),
1646
- providerThreadId: z11.string(),
1656
+ z12.object({
1657
+ type: z12.literal("thread/tokenUsage/updated"),
1658
+ threadId: z12.string(),
1659
+ providerThreadId: z12.string(),
1647
1660
  tokenUsage: threadEventTokenUsageSchema
1648
1661
  }),
1649
- z11.object({
1650
- type: z11.literal("thread/contextWindowUsage/updated"),
1651
- threadId: z11.string(),
1652
- providerThreadId: z11.string(),
1662
+ z12.object({
1663
+ type: z12.literal("thread/contextWindowUsage/updated"),
1664
+ threadId: z12.string(),
1665
+ providerThreadId: z12.string(),
1653
1666
  contextWindowUsage: threadEventContextWindowUsageSchema
1654
1667
  }),
1655
- z11.object({
1656
- type: z11.literal("turn/plan/updated"),
1657
- threadId: z11.string(),
1658
- providerThreadId: z11.string(),
1659
- plan: z11.array(threadEventPlanStepSchema),
1660
- explanation: z11.string().optional()
1668
+ z12.object({
1669
+ type: z12.literal("turn/plan/updated"),
1670
+ threadId: z12.string(),
1671
+ providerThreadId: z12.string(),
1672
+ plan: z12.array(threadEventPlanStepSchema),
1673
+ explanation: z12.string().optional()
1661
1674
  }),
1662
- z11.object({
1663
- type: z11.literal("turn/diff/updated"),
1664
- threadId: z11.string(),
1665
- providerThreadId: z11.string(),
1666
- diff: z11.string().optional()
1675
+ z12.object({
1676
+ type: z12.literal("turn/diff/updated"),
1677
+ threadId: z12.string(),
1678
+ providerThreadId: z12.string(),
1679
+ diff: z12.string().optional()
1667
1680
  }),
1668
- z11.object({
1669
- type: z11.literal("provider/error"),
1670
- threadId: z11.string(),
1671
- providerThreadId: z11.string(),
1672
- message: z11.string(),
1673
- detail: z11.string().optional(),
1674
- willRetry: z11.boolean().optional(),
1681
+ z12.object({
1682
+ type: z12.literal("provider/error"),
1683
+ threadId: z12.string(),
1684
+ providerThreadId: z12.string(),
1685
+ message: z12.string(),
1686
+ detail: z12.string().optional(),
1687
+ willRetry: z12.boolean().optional(),
1675
1688
  errorInfo: providerErrorInfoSchema.optional()
1676
1689
  }),
1677
- z11.object({
1678
- type: z11.literal("provider/rateLimits/updated"),
1679
- threadId: z11.string(),
1680
- providerThreadId: z11.string(),
1690
+ z12.object({
1691
+ type: z12.literal("provider/rateLimits/updated"),
1692
+ threadId: z12.string(),
1693
+ providerThreadId: z12.string(),
1681
1694
  rateLimits: providerRateLimitStateSchema
1682
1695
  }),
1683
- z11.object({
1684
- type: z11.literal("thread/extensionState/updated"),
1685
- threadId: z11.string(),
1686
- providerThreadId: z11.string(),
1696
+ z12.object({
1697
+ type: z12.literal("thread/extensionState/updated"),
1698
+ threadId: z12.string(),
1699
+ providerThreadId: z12.string(),
1687
1700
  kind: extensionKindSchema,
1688
1701
  payload: jsonValueSchema
1689
1702
  }),
1690
- z11.object({
1691
- type: z11.literal("provider/warning"),
1692
- threadId: z11.string(),
1693
- providerThreadId: z11.string(),
1703
+ z12.object({
1704
+ type: z12.literal("provider/warning"),
1705
+ threadId: z12.string(),
1706
+ providerThreadId: z12.string(),
1694
1707
  category: threadEventWarningCategorySchema,
1695
- summary: z11.string().optional(),
1696
- details: z11.string().optional()
1708
+ summary: z12.string().optional(),
1709
+ details: z12.string().optional()
1697
1710
  }),
1698
- z11.object({
1699
- type: z11.literal("provider/modelFallback"),
1700
- threadId: z11.string(),
1701
- providerThreadId: z11.string(),
1702
- originalModel: z11.string().min(1),
1703
- fallbackModel: z11.string().min(1),
1704
- reason: z11.enum(["refusal", "provider"]),
1705
- message: z11.string()
1711
+ z12.object({
1712
+ type: z12.literal("provider/modelFallback"),
1713
+ threadId: z12.string(),
1714
+ providerThreadId: z12.string(),
1715
+ originalModel: z12.string().min(1),
1716
+ fallbackModel: z12.string().min(1),
1717
+ reason: z12.enum(["refusal", "provider"]),
1718
+ message: z12.string()
1706
1719
  }),
1707
1720
  providerUnhandledEventSchema
1708
1721
  ]);
1709
- var scopedEventDataSchema = z11.object({
1722
+ var scopedEventDataSchema = z12.object({
1710
1723
  scope: threadEventScopeSchema
1711
1724
  });
1712
1725
  var providerEventSchema = unscopedProviderEventSchema.and(
@@ -1715,58 +1728,58 @@ var providerEventSchema = unscopedProviderEventSchema.and(
1715
1728
  var providerEventTypeValues = unscopedProviderEventSchema.options.map(
1716
1729
  (option) => option.shape.type.value
1717
1730
  );
1718
- var unscopedSystemEventSchema = z11.discriminatedUnion("type", [
1719
- z11.object({
1720
- type: z11.literal("client/thread/start"),
1721
- threadId: z11.string()
1731
+ var unscopedSystemEventSchema = z12.discriminatedUnion("type", [
1732
+ z12.object({
1733
+ type: z12.literal("client/thread/start"),
1734
+ threadId: z12.string()
1722
1735
  }).merge(clientTurnLifecycleEventDataSchema),
1723
- z11.object({
1724
- type: z11.literal("client/turn/requested"),
1725
- threadId: z11.string()
1736
+ z12.object({
1737
+ type: z12.literal("client/turn/requested"),
1738
+ threadId: z12.string()
1726
1739
  }).merge(turnRequestEventDataSchema),
1727
- z11.object({
1728
- type: z11.literal("client/turn/rejected"),
1729
- threadId: z11.string()
1740
+ z12.object({
1741
+ type: z12.literal("client/turn/rejected"),
1742
+ threadId: z12.string()
1730
1743
  }).merge(turnRequestRejectedEventDataSchema),
1731
- z11.object({
1732
- type: z11.literal("client/turn/start"),
1733
- threadId: z11.string()
1744
+ z12.object({
1745
+ type: z12.literal("client/turn/start"),
1746
+ threadId: z12.string()
1734
1747
  }).merge(clientTurnLifecycleEventDataSchema),
1735
- z11.object({
1736
- type: z11.literal("system/error"),
1737
- threadId: z11.string()
1748
+ z12.object({
1749
+ type: z12.literal("system/error"),
1750
+ threadId: z12.string()
1738
1751
  }).merge(systemErrorEventDataSchema),
1739
- z11.object({
1740
- type: z11.literal("system/manager/user_message"),
1741
- threadId: z11.string()
1752
+ z12.object({
1753
+ type: z12.literal("system/manager/user_message"),
1754
+ threadId: z12.string()
1742
1755
  }).merge(systemLegacyUserMessageEventDataSchema),
1743
- z11.object({
1744
- type: z11.literal("system/thread/interrupted"),
1745
- threadId: z11.string()
1756
+ z12.object({
1757
+ type: z12.literal("system/thread/interrupted"),
1758
+ threadId: z12.string()
1746
1759
  }).merge(systemThreadInterruptedEventDataSchema),
1747
- z11.object({
1748
- type: z11.literal("system/operation"),
1749
- threadId: z11.string()
1760
+ z12.object({
1761
+ type: z12.literal("system/operation"),
1762
+ threadId: z12.string()
1750
1763
  }).merge(systemOperationEventDataSchema),
1751
- z11.object({
1752
- type: z11.literal("system/interaction/lifecycle"),
1753
- threadId: z11.string()
1764
+ z12.object({
1765
+ type: z12.literal("system/interaction/lifecycle"),
1766
+ threadId: z12.string()
1754
1767
  }).merge(systemInteractionLifecycleEventDataSchema),
1755
- z11.object({
1756
- type: z11.literal("system/permissionGrant/lifecycle"),
1757
- threadId: z11.string()
1768
+ z12.object({
1769
+ type: z12.literal("system/permissionGrant/lifecycle"),
1770
+ threadId: z12.string()
1758
1771
  }).merge(systemPermissionGrantLifecycleEventDataSchema),
1759
- z11.object({
1760
- type: z11.literal("system/userQuestion/lifecycle"),
1761
- threadId: z11.string()
1772
+ z12.object({
1773
+ type: z12.literal("system/userQuestion/lifecycle"),
1774
+ threadId: z12.string()
1762
1775
  }).merge(systemUserQuestionLifecycleEventDataSchema),
1763
- z11.object({
1764
- type: z11.literal("system/thread-provisioning"),
1765
- threadId: z11.string()
1776
+ z12.object({
1777
+ type: z12.literal("system/thread-provisioning"),
1778
+ threadId: z12.string()
1766
1779
  }).merge(systemThreadProvisioningEventDataSchema),
1767
- z11.object({
1768
- type: z11.literal("system/provider-turn-watchdog"),
1769
- threadId: z11.string()
1780
+ z12.object({
1781
+ type: z12.literal("system/provider-turn-watchdog"),
1782
+ threadId: z12.string()
1770
1783
  }).merge(systemProviderTurnWatchdogEventDataSchema)
1771
1784
  ]);
1772
1785
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
@@ -1774,13 +1787,13 @@ var legacyClientRequestKey = ["clientRequest", "Sequence"].join("");
1774
1787
  function isEventPropertyBag(value) {
1775
1788
  return typeof value === "object" && value !== null && !Array.isArray(value);
1776
1789
  }
1777
- var rejectLegacyClientRequestSequenceSchema = z11.unknown().superRefine((value, ctx) => {
1790
+ var rejectLegacyClientRequestSequenceSchema = z12.unknown().superRefine((value, ctx) => {
1778
1791
  if (!isEventPropertyBag(value)) {
1779
1792
  return;
1780
1793
  }
1781
1794
  if (Object.hasOwn(value, legacyClientRequestKey)) {
1782
1795
  ctx.addIssue({
1783
- code: z11.ZodIssueCode.custom,
1796
+ code: z12.ZodIssueCode.custom,
1784
1797
  message: "legacy request sequence field is no longer accepted",
1785
1798
  path: [legacyClientRequestKey]
1786
1799
  });
@@ -1788,21 +1801,21 @@ var rejectLegacyClientRequestSequenceSchema = z11.unknown().superRefine((value,
1788
1801
  const item = value.item;
1789
1802
  if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
1790
1803
  ctx.addIssue({
1791
- code: z11.ZodIssueCode.custom,
1804
+ code: z12.ZodIssueCode.custom,
1792
1805
  message: "legacy user-message request sequence field is no longer accepted",
1793
1806
  path: ["item", legacyClientRequestKey]
1794
1807
  });
1795
1808
  }
1796
1809
  });
1797
1810
  var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
1798
- z11.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
1811
+ z12.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
1799
1812
  const result2 = validateThreadEventScope({
1800
1813
  type: event.type,
1801
1814
  scope: event.scope
1802
1815
  });
1803
1816
  if (!result2.valid) {
1804
1817
  ctx.addIssue({
1805
- code: z11.ZodIssueCode.custom,
1818
+ code: z12.ZodIssueCode.custom,
1806
1819
  message: result2.message ?? "Invalid thread event scope",
1807
1820
  path: ["scope"]
1808
1821
  });
@@ -1828,7 +1841,7 @@ var threadEventTypeValues = [
1828
1841
  ...systemEventTypeValues
1829
1842
  ];
1830
1843
  var threadEventTypeSet = new Set(threadEventTypeValues);
1831
- var threadEventTypeSchema = z11.string().refine(
1844
+ var threadEventTypeSchema = z12.string().refine(
1832
1845
  (value) => threadEventTypeSet.has(value),
1833
1846
  "Invalid thread event type"
1834
1847
  );
@@ -1851,95 +1864,95 @@ function parseNamespacedGlyph(glyph) {
1851
1864
  }
1852
1865
 
1853
1866
  // ../domain/src/provider-fork.ts
1854
- import { z as z12 } from "zod";
1867
+ import { z as z13 } from "zod";
1855
1868
  var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
1856
- var providerForkSchema = z12.enum(PROVIDER_FORK_VALUES);
1869
+ var providerForkSchema = z13.enum(PROVIDER_FORK_VALUES);
1857
1870
 
1858
1871
  // ../domain/src/provider-types.ts
1859
- import { z as z13 } from "zod";
1860
- var modelReasoningEffortSchema = z13.object({
1872
+ import { z as z14 } from "zod";
1873
+ var modelReasoningEffortSchema = z14.object({
1861
1874
  reasoningEffort: reasoningLevelSchema,
1862
- description: z13.string()
1875
+ description: z14.string()
1863
1876
  });
1864
- var availableModelSchema = z13.object({
1865
- id: z13.string(),
1866
- model: z13.string(),
1867
- displayName: z13.string(),
1868
- routeProviderId: z13.string().min(1).optional(),
1869
- description: z13.string(),
1870
- supportedReasoningEfforts: z13.array(modelReasoningEffortSchema),
1877
+ var availableModelSchema = z14.object({
1878
+ id: z14.string(),
1879
+ model: z14.string(),
1880
+ displayName: z14.string(),
1881
+ routeProviderId: z14.string().min(1).optional(),
1882
+ description: z14.string(),
1883
+ supportedReasoningEfforts: z14.array(modelReasoningEffortSchema),
1871
1884
  defaultReasoningEffort: reasoningLevelSchema,
1872
- isDefault: z13.boolean()
1885
+ isDefault: z14.boolean()
1873
1886
  });
1874
- var providerModelCatalogScopeSchema = z13.enum(["host", "workspace"]);
1875
- var providerCapabilitiesSchema = z13.object({
1876
- supportsThreadArchive: z13.boolean(),
1877
- supportsThreadRename: z13.boolean(),
1878
- supportsServiceTier: z13.boolean(),
1879
- supportsNativeUserQuestion: z13.boolean(),
1880
- supportsFork: z13.boolean(),
1881
- supportsSessionRewind: z13.boolean(),
1882
- permissionModes: z13.array(permissionModeSchema).min(1),
1887
+ var providerModelCatalogScopeSchema = z14.enum(["host", "workspace"]);
1888
+ var providerCapabilitiesSchema = z14.object({
1889
+ supportsThreadArchive: z14.boolean(),
1890
+ supportsThreadRename: z14.boolean(),
1891
+ supportsServiceTier: z14.boolean(),
1892
+ supportsNativeUserQuestion: z14.boolean(),
1893
+ supportsFork: z14.boolean(),
1894
+ supportsSessionRewind: z14.boolean(),
1895
+ permissionModes: z14.array(permissionModeSchema).min(1),
1883
1896
  modelCatalogScope: providerModelCatalogScopeSchema
1884
1897
  });
1885
- var providerComposerCommandSchema = z13.object({
1898
+ var providerComposerCommandSchema = z14.object({
1886
1899
  trigger: promptMentionCommandTriggerSchema,
1887
- name: z13.string().min(1).regex(/^[^\s/$]+$/u),
1888
- trailingText: z13.string().regex(/^\s*$/u)
1900
+ name: z14.string().min(1).regex(/^[^\s/$]+$/u),
1901
+ trailingText: z14.string().regex(/^\s*$/u)
1889
1902
  });
1890
- var providerComposerActionSchema = z13.discriminatedUnion("kind", [
1891
- z13.object({
1892
- kind: z13.literal("skills"),
1903
+ var providerComposerActionSchema = z14.discriminatedUnion("kind", [
1904
+ z14.object({
1905
+ kind: z14.literal("skills"),
1893
1906
  trigger: promptMentionCommandTriggerSchema
1894
1907
  }),
1895
- z13.object({
1896
- kind: z13.literal("plan"),
1908
+ z14.object({
1909
+ kind: z14.literal("plan"),
1897
1910
  command: providerComposerCommandSchema
1898
1911
  }),
1899
- z13.object({
1900
- kind: z13.literal("goal"),
1912
+ z14.object({
1913
+ kind: z14.literal("goal"),
1901
1914
  command: providerComposerCommandSchema
1902
1915
  })
1903
1916
  ]);
1904
- var providerStringsSchema = z13.object({
1905
- signInHint: z13.string().min(1),
1906
- expiredHint: z13.string().min(1),
1907
- installUrl: z13.string().min(1),
1908
- brandPrefix: z13.string().min(1).optional(),
1909
- planModeCopy: z13.string().min(1).optional(),
1910
- iconTint: z13.object({ light: z13.string().min(1), dark: z13.string().min(1) }).optional()
1917
+ var providerStringsSchema = z14.object({
1918
+ signInHint: z14.string().min(1),
1919
+ expiredHint: z14.string().min(1),
1920
+ installUrl: z14.string().min(1),
1921
+ brandPrefix: z14.string().min(1).optional(),
1922
+ planModeCopy: z14.string().min(1).optional(),
1923
+ iconTint: z14.object({ light: z14.string().min(1), dark: z14.string().min(1) }).optional()
1911
1924
  });
1912
- var providerOptionDescriptorSchema = z13.object({
1913
- id: z13.string().min(1),
1914
- label: z13.string().min(1),
1915
- description: z13.string().min(1).optional()
1925
+ var providerOptionDescriptorSchema = z14.object({
1926
+ id: z14.string().min(1),
1927
+ label: z14.string().min(1),
1928
+ description: z14.string().min(1).optional()
1916
1929
  });
1917
- var providerExtensionKindInfoSchema = z13.object({
1918
- item: z13.boolean(),
1919
- state: z13.boolean()
1930
+ var providerExtensionKindInfoSchema = z14.object({
1931
+ item: z14.boolean(),
1932
+ state: z14.boolean()
1920
1933
  });
1921
- var providerExtensionKindsSchema = z13.record(
1934
+ var providerExtensionKindsSchema = z14.record(
1922
1935
  extensionKindSchema,
1923
1936
  providerExtensionKindInfoSchema
1924
1937
  );
1925
- var providerInfoSchema = z13.object({
1926
- id: z13.string(),
1927
- pluginId: z13.string().min(1),
1928
- displayName: z13.string(),
1929
- family: z13.string().min(1).optional(),
1930
- icon: z13.object({ glyph: z13.string().min(1) }).optional(),
1931
- logoUrl: z13.string().min(1).nullable(),
1932
- maintenance: z13.object({
1933
- health: z13.boolean(),
1934
- usage: z13.boolean(),
1935
- installation: z13.boolean()
1938
+ var providerInfoSchema = z14.object({
1939
+ id: z14.string(),
1940
+ pluginId: z14.string().min(1),
1941
+ displayName: z14.string(),
1942
+ family: z14.string().min(1).optional(),
1943
+ icon: z14.object({ glyph: z14.string().min(1) }).optional(),
1944
+ logoUrl: z14.string().min(1).nullable(),
1945
+ maintenance: z14.object({
1946
+ health: z14.boolean(),
1947
+ usage: z14.boolean(),
1948
+ installation: z14.boolean()
1936
1949
  }),
1937
1950
  capabilities: providerCapabilitiesSchema,
1938
- composerActions: z13.array(providerComposerActionSchema),
1939
- available: z13.boolean(),
1951
+ composerActions: z14.array(providerComposerActionSchema),
1952
+ available: z14.boolean(),
1940
1953
  strings: providerStringsSchema.optional(),
1941
- serviceTiers: z13.array(providerOptionDescriptorSchema).optional(),
1942
- reasoningLevels: z13.array(providerOptionDescriptorSchema).optional(),
1954
+ serviceTiers: z14.array(providerOptionDescriptorSchema).optional(),
1955
+ reasoningLevels: z14.array(providerOptionDescriptorSchema).optional(),
1943
1956
  extensionKinds: providerExtensionKindsSchema.optional()
1944
1957
  });
1945
1958
  var providerRecoveryKindValues = [
@@ -1949,144 +1962,144 @@ var providerRecoveryKindValues = [
1949
1962
  "staleTurn",
1950
1963
  "rateLimited"
1951
1964
  ];
1952
- var providerRecoveryKindSchema = z13.enum(providerRecoveryKindValues);
1953
- var toolCallOutputItemSchema = z13.discriminatedUnion("type", [
1954
- z13.object({
1955
- type: z13.literal("inputText"),
1956
- text: z13.string()
1965
+ var providerRecoveryKindSchema = z14.enum(providerRecoveryKindValues);
1966
+ var toolCallOutputItemSchema = z14.discriminatedUnion("type", [
1967
+ z14.object({
1968
+ type: z14.literal("inputText"),
1969
+ text: z14.string()
1957
1970
  }),
1958
- z13.object({
1959
- type: z13.literal("inputImage"),
1960
- imageUrl: z13.string()
1971
+ z14.object({
1972
+ type: z14.literal("inputImage"),
1973
+ imageUrl: z14.string()
1961
1974
  })
1962
1975
  ]);
1963
- var toolCallRequestSchema = z13.object({
1964
- requestId: z13.union([z13.string().min(1), z13.number()]),
1965
- threadId: z13.string().min(1),
1966
- providerThreadId: z13.string().min(1),
1967
- turnId: z13.string().min(1),
1968
- callId: z13.string().min(1),
1969
- tool: z13.string().min(1),
1970
- arguments: z13.unknown().optional()
1976
+ var toolCallRequestSchema = z14.object({
1977
+ requestId: z14.union([z14.string().min(1), z14.number()]),
1978
+ threadId: z14.string().min(1),
1979
+ providerThreadId: z14.string().min(1),
1980
+ turnId: z14.string().min(1),
1981
+ callId: z14.string().min(1),
1982
+ tool: z14.string().min(1),
1983
+ arguments: z14.unknown().optional()
1971
1984
  });
1972
- var toolCallResponseSchema = z13.object({
1973
- contentItems: z13.array(toolCallOutputItemSchema),
1974
- success: z13.boolean()
1985
+ var toolCallResponseSchema = z14.object({
1986
+ contentItems: z14.array(toolCallOutputItemSchema),
1987
+ success: z14.boolean()
1975
1988
  });
1976
- var dynamicToolSchema = z13.object({
1977
- name: z13.string(),
1978
- description: z13.string(),
1979
- inputSchema: z13.unknown(),
1989
+ var dynamicToolSchema = z14.object({
1990
+ name: z14.string(),
1991
+ description: z14.string(),
1992
+ inputSchema: z14.unknown(),
1980
1993
  presentation: threadEventItemPresentationSchema.optional()
1981
1994
  });
1982
1995
 
1983
1996
  // ../provider-bridge-protocol/src/thread-delta.ts
1984
- import { z as z14 } from "zod";
1997
+ import { z as z15 } from "zod";
1985
1998
  var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
1986
1999
  var deltaPresentationSchema = threadEventItemPresentationSchema;
1987
2000
  var THREAD_DELTA_KEY_SEPARATOR = "";
1988
- var deltaKeyPartSchema = z14.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
2001
+ var deltaKeyPartSchema = z15.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
1989
2002
  message: "provider keys must not contain the internal key separator (\\u001f)"
1990
2003
  });
1991
- var deltaItemKeySchema = z14.object({
2004
+ var deltaItemKeySchema = z15.object({
1992
2005
  providerItemId: deltaKeyPartSchema.optional(),
1993
2006
  channel: deltaKeyPartSchema.optional(),
1994
2007
  parentRef: deltaKeyPartSchema.optional()
1995
2008
  });
1996
2009
  var providerTurnIdSchema = deltaKeyPartSchema;
1997
- var deltaFileChangeSchema = z14.object({
1998
- path: z14.string(),
1999
- kind: z14.enum(["add", "update", "delete"]),
2000
- movePath: z14.string().optional(),
2001
- diff: z14.string().optional(),
2002
- oldText: z14.string().optional(),
2003
- newText: z14.string().optional()
2010
+ var deltaFileChangeSchema = z15.object({
2011
+ path: z15.string(),
2012
+ kind: z15.enum(["add", "update", "delete"]),
2013
+ movePath: z15.string().optional(),
2014
+ diff: z15.string().optional(),
2015
+ oldText: z15.string().optional(),
2016
+ newText: z15.string().optional()
2004
2017
  });
2005
- var deltaBackgroundTaskShapeSchema = z14.object({
2006
- type: z14.literal("backgroundTask"),
2007
- familyId: z14.string().min(1),
2008
- taskType: z14.string(),
2009
- description: z14.string(),
2018
+ var deltaBackgroundTaskShapeSchema = z15.object({
2019
+ type: z15.literal("backgroundTask"),
2020
+ familyId: z15.string().min(1),
2021
+ taskType: z15.string(),
2022
+ description: z15.string(),
2010
2023
  status: threadEventItemStatusSchema,
2011
2024
  taskStatus: backgroundTaskStatusSchema,
2012
- skipTranscript: z14.boolean(),
2013
- workflowName: z14.string().optional(),
2025
+ skipTranscript: z15.boolean(),
2026
+ workflowName: z15.string().optional(),
2014
2027
  workflow: workflowProgressSnapshotSchema.optional(),
2015
2028
  usage: backgroundTaskUsageSchema.optional(),
2016
- summary: z14.string().optional(),
2017
- error: z14.string().optional(),
2018
- outputFile: z14.string().optional()
2029
+ summary: z15.string().optional(),
2030
+ error: z15.string().optional(),
2031
+ outputFile: z15.string().optional()
2019
2032
  });
2020
- var deltaFileReadShapeSchema = z14.object({
2021
- type: z14.literal("fileRead"),
2022
- path: z14.string(),
2023
- cmd: z14.string().optional()
2033
+ var deltaFileReadShapeSchema = z15.object({
2034
+ type: z15.literal("fileRead"),
2035
+ path: z15.string(),
2036
+ cmd: z15.string().optional()
2024
2037
  });
2025
- var deltaSearchShapeSchema = z14.object({
2026
- type: z14.literal("search"),
2038
+ var deltaSearchShapeSchema = z15.object({
2039
+ type: z15.literal("search"),
2027
2040
  mode: threadEventSearchModeSchema,
2028
- query: z14.string(),
2029
- path: z14.string().optional(),
2030
- cmd: z14.string().optional()
2041
+ query: z15.string(),
2042
+ path: z15.string().optional(),
2043
+ cmd: z15.string().optional()
2031
2044
  });
2032
- var deltaDelegationShapeSchema = z14.object({
2033
- type: z14.literal("delegation"),
2045
+ var deltaDelegationShapeSchema = z15.object({
2046
+ type: z15.literal("delegation"),
2034
2047
  childRef: deltaKeyPartSchema,
2035
- label: z14.string(),
2036
- background: z14.boolean(),
2037
- summary: z14.string().optional()
2048
+ label: z15.string(),
2049
+ background: z15.boolean(),
2050
+ summary: z15.string().optional()
2038
2051
  });
2039
- var deltaPlanStepsShapeSchema = z14.object({
2040
- type: z14.literal("planSteps"),
2041
- steps: z14.array(threadEventPlanStepSchema),
2042
- explanation: z14.string().optional()
2052
+ var deltaPlanStepsShapeSchema = z15.object({
2053
+ type: z15.literal("planSteps"),
2054
+ steps: z15.array(threadEventPlanStepSchema),
2055
+ explanation: z15.string().optional()
2043
2056
  });
2044
- var deltaExtensionShapeSchema = z14.object({
2045
- type: z14.literal("extension"),
2057
+ var deltaExtensionShapeSchema = z15.object({
2058
+ type: z15.literal("extension"),
2046
2059
  kind: extensionKindSchema,
2047
2060
  payload: jsonValueSchema
2048
2061
  });
2049
- var deltaItemShapeSchema = z14.discriminatedUnion("type", [
2050
- z14.object({
2051
- type: z14.literal("command"),
2052
- command: z14.string(),
2053
- cwd: z14.string(),
2054
- aggregatedOutput: z14.string().optional(),
2055
- exitCode: z14.number().optional(),
2056
- durationMs: z14.number().optional()
2062
+ var deltaItemShapeSchema = z15.discriminatedUnion("type", [
2063
+ z15.object({
2064
+ type: z15.literal("command"),
2065
+ command: z15.string(),
2066
+ cwd: z15.string(),
2067
+ aggregatedOutput: z15.string().optional(),
2068
+ exitCode: z15.number().optional(),
2069
+ durationMs: z15.number().optional()
2057
2070
  }),
2058
- z14.object({
2059
- type: z14.literal("fileChange"),
2060
- changes: z14.array(deltaFileChangeSchema)
2071
+ z15.object({
2072
+ type: z15.literal("fileChange"),
2073
+ changes: z15.array(deltaFileChangeSchema)
2061
2074
  }),
2062
- z14.object({
2063
- type: z14.literal("tool"),
2064
- tool: z14.string(),
2065
- server: z14.string().optional(),
2066
- args: z14.unknown().optional(),
2067
- result: z14.unknown().optional(),
2068
- error: z14.string().optional(),
2069
- durationMs: z14.number().optional()
2075
+ z15.object({
2076
+ type: z15.literal("tool"),
2077
+ tool: z15.string(),
2078
+ server: z15.string().optional(),
2079
+ args: z15.unknown().optional(),
2080
+ result: z15.unknown().optional(),
2081
+ error: z15.string().optional(),
2082
+ durationMs: z15.number().optional()
2070
2083
  }),
2071
- z14.object({ type: z14.literal("compaction") }),
2072
- z14.object({ type: z14.literal("agentMessage"), text: z14.string() }),
2073
- z14.object({
2074
- type: z14.literal("reasoning"),
2075
- summary: z14.array(z14.string()),
2076
- content: z14.array(z14.string())
2084
+ z15.object({ type: z15.literal("compaction") }),
2085
+ z15.object({ type: z15.literal("agentMessage"), text: z15.string() }),
2086
+ z15.object({
2087
+ type: z15.literal("reasoning"),
2088
+ summary: z15.array(z15.string()),
2089
+ content: z15.array(z15.string())
2077
2090
  }),
2078
- z14.object({ type: z14.literal("plan"), text: z14.string() }),
2079
- z14.object({
2080
- type: z14.literal("webSearch"),
2081
- queries: z14.array(z14.string()).min(1)
2091
+ z15.object({ type: z15.literal("plan"), text: z15.string() }),
2092
+ z15.object({
2093
+ type: z15.literal("webSearch"),
2094
+ queries: z15.array(z15.string()).min(1)
2082
2095
  }),
2083
- z14.object({
2084
- type: z14.literal("webFetch"),
2085
- url: z14.string(),
2086
- prompt: z14.string().nullable().optional(),
2087
- pattern: z14.string().nullable()
2096
+ z15.object({
2097
+ type: z15.literal("webFetch"),
2098
+ url: z15.string(),
2099
+ prompt: z15.string().nullable().optional(),
2100
+ pattern: z15.string().nullable()
2088
2101
  }),
2089
- z14.object({ type: z14.literal("imageView"), path: z14.string() }),
2102
+ z15.object({ type: z15.literal("imageView"), path: z15.string() }),
2090
2103
  deltaBackgroundTaskShapeSchema,
2091
2104
  deltaFileReadShapeSchema,
2092
2105
  deltaSearchShapeSchema,
@@ -2094,22 +2107,22 @@ var deltaItemShapeSchema = z14.discriminatedUnion("type", [
2094
2107
  deltaPlanStepsShapeSchema,
2095
2108
  deltaExtensionShapeSchema
2096
2109
  ]);
2097
- var deltaProgressSnapshotSchema = z14.discriminatedUnion("type", [
2110
+ var deltaProgressSnapshotSchema = z15.discriminatedUnion("type", [
2098
2111
  deltaBackgroundTaskShapeSchema,
2099
2112
  deltaDelegationShapeSchema
2100
2113
  ]);
2101
- var deltaTextChannelSchema = z14.enum([
2114
+ var deltaTextChannelSchema = z15.enum([
2102
2115
  "agentMessage",
2103
2116
  "reasoningSummary",
2104
2117
  "reasoningText",
2105
2118
  "plan"
2106
2119
  ]);
2107
- var deltaOutputChannelSchema = z14.enum(["command", "fileChange"]);
2108
- var deltaErrorSchema = z14.object({ message: z14.string() });
2109
- var deltaAttachSchema = z14.enum(["open", "currentOrLast"]);
2110
- var deltaNoTurnFallbackSchema = z14.object({
2120
+ var deltaOutputChannelSchema = z15.enum(["command", "fileChange"]);
2121
+ var deltaErrorSchema = z15.object({ message: z15.string() });
2122
+ var deltaAttachSchema = z15.enum(["open", "currentOrLast"]);
2123
+ var deltaNoTurnFallbackSchema = z15.object({
2111
2124
  raw: providerRawEventSchema,
2112
- rawType: z14.string()
2125
+ rawType: z15.string()
2113
2126
  });
2114
2127
  function requireExtensionPresentation(delta, ctx) {
2115
2128
  if (delta.item.type === "extension" && delta.presentation === void 0) {
@@ -2120,32 +2133,32 @@ function requireExtensionPresentation(delta, ctx) {
2120
2133
  });
2121
2134
  }
2122
2135
  }
2123
- var threadDeltaSchema = z14.discriminatedUnion("kind", [
2124
- z14.object({
2125
- kind: z14.literal("input.accepted"),
2136
+ var threadDeltaSchema = z15.discriminatedUnion("kind", [
2137
+ z15.object({
2138
+ kind: z15.literal("input.accepted"),
2126
2139
  clientRequestId: clientTurnRequestIdSchema,
2127
2140
  providerTurnId: providerTurnIdSchema.optional()
2128
2141
  }),
2129
- z14.object({
2130
- kind: z14.literal("input.provider"),
2131
- text: z14.string().min(1),
2142
+ z15.object({
2143
+ kind: z15.literal("input.provider"),
2144
+ text: z15.string().min(1),
2132
2145
  parentRef: deltaKeyPartSchema.optional()
2133
2146
  }),
2134
- z14.object({
2135
- kind: z14.literal("turn.open"),
2147
+ z15.object({
2148
+ kind: z15.literal("turn.open"),
2136
2149
  providerTurnId: providerTurnIdSchema.optional(),
2137
2150
  parentRef: deltaKeyPartSchema.optional()
2138
2151
  }),
2139
- z14.object({
2140
- kind: z14.literal("turn.boundary"),
2152
+ z15.object({
2153
+ kind: z15.literal("turn.boundary"),
2141
2154
  status: threadEventTurnStatusSchema,
2142
2155
  error: deltaErrorSchema.optional(),
2143
- providerCheckpointId: z14.string().min(1).optional(),
2144
- claimIfIdle: z14.boolean().optional(),
2156
+ providerCheckpointId: z15.string().min(1).optional(),
2157
+ claimIfIdle: z15.boolean().optional(),
2145
2158
  providerTurnId: providerTurnIdSchema.optional()
2146
2159
  }),
2147
- z14.object({
2148
- kind: z14.literal("item.open"),
2160
+ z15.object({
2161
+ kind: z15.literal("item.open"),
2149
2162
  key: deltaItemKeySchema,
2150
2163
  item: deltaItemShapeSchema,
2151
2164
  presentation: deltaPresentationSchema.optional(),
@@ -2153,139 +2166,139 @@ var threadDeltaSchema = z14.discriminatedUnion("kind", [
2153
2166
  providerTurnId: providerTurnIdSchema.optional(),
2154
2167
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2155
2168
  }).superRefine(requireExtensionPresentation),
2156
- z14.object({
2157
- kind: z14.literal("item.close"),
2169
+ z15.object({
2170
+ kind: z15.literal("item.close"),
2158
2171
  key: deltaItemKeySchema,
2159
2172
  status: threadEventItemStatusSchema,
2160
- resultText: z14.string().optional(),
2161
- exitCode: z14.number().optional(),
2162
- aggregatedOutput: z14.string().optional(),
2163
- approvalStatus: z14.literal("denied").optional(),
2173
+ resultText: z15.string().optional(),
2174
+ exitCode: z15.number().optional(),
2175
+ aggregatedOutput: z15.string().optional(),
2176
+ approvalStatus: z15.literal("denied").optional(),
2164
2177
  item: deltaItemShapeSchema,
2165
2178
  presentation: deltaPresentationSchema.optional(),
2166
2179
  providerTurnId: providerTurnIdSchema.optional(),
2167
2180
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2168
2181
  }).superRefine(requireExtensionPresentation),
2169
- z14.object({
2170
- kind: z14.literal("item.progress"),
2182
+ z15.object({
2183
+ kind: z15.literal("item.progress"),
2171
2184
  key: deltaItemKeySchema,
2172
- message: z14.string().optional(),
2185
+ message: z15.string().optional(),
2173
2186
  snapshot: deltaProgressSnapshotSchema.optional(),
2174
- flush: z14.boolean().optional(),
2187
+ flush: z15.boolean().optional(),
2175
2188
  providerTurnId: providerTurnIdSchema.optional(),
2176
2189
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2177
2190
  }),
2178
- z14.object({
2179
- kind: z14.literal("item.textDelta"),
2191
+ z15.object({
2192
+ kind: z15.literal("item.textDelta"),
2180
2193
  key: deltaItemKeySchema,
2181
2194
  channel: deltaTextChannelSchema,
2182
- text: z14.string(),
2195
+ text: z15.string(),
2183
2196
  providerTurnId: providerTurnIdSchema.optional(),
2184
2197
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2185
2198
  }),
2186
- z14.object({
2187
- kind: z14.literal("item.textClose"),
2199
+ z15.object({
2200
+ kind: z15.literal("item.textClose"),
2188
2201
  key: deltaItemKeySchema,
2189
2202
  channel: deltaTextChannelSchema,
2190
- text: z14.string().optional(),
2203
+ text: z15.string().optional(),
2191
2204
  providerTurnId: providerTurnIdSchema.optional(),
2192
2205
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2193
2206
  }),
2194
- z14.object({
2195
- kind: z14.literal("item.outputDelta"),
2207
+ z15.object({
2208
+ kind: z15.literal("item.outputDelta"),
2196
2209
  key: deltaItemKeySchema,
2197
2210
  channel: deltaOutputChannelSchema,
2198
- text: z14.string(),
2211
+ text: z15.string(),
2199
2212
  providerTurnId: providerTurnIdSchema.optional(),
2200
2213
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2201
2214
  }),
2202
- z14.object({
2203
- kind: z14.literal("command.outputSnapshot"),
2215
+ z15.object({
2216
+ kind: z15.literal("command.outputSnapshot"),
2204
2217
  key: deltaItemKeySchema,
2205
- text: z14.string(),
2218
+ text: z15.string(),
2206
2219
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2207
2220
  }),
2208
- z14.object({
2209
- kind: z14.literal("usage"),
2221
+ z15.object({
2222
+ kind: z15.literal("usage"),
2210
2223
  total: threadEventTokenUsageBreakdownSchema,
2211
2224
  last: threadEventTokenUsageBreakdownSchema,
2212
- modelContextWindow: z14.number().nullable(),
2225
+ modelContextWindow: z15.number().nullable(),
2213
2226
  providerTurnId: providerTurnIdSchema.optional()
2214
2227
  }),
2215
- z14.object({
2216
- kind: z14.literal("contextWindow"),
2217
- used: z14.number().nullable(),
2218
- size: z14.number().nullable().optional(),
2219
- estimated: z14.boolean(),
2228
+ z15.object({
2229
+ kind: z15.literal("contextWindow"),
2230
+ used: z15.number().nullable(),
2231
+ size: z15.number().nullable().optional(),
2232
+ estimated: z15.boolean(),
2220
2233
  attach: deltaAttachSchema,
2221
2234
  providerTurnId: providerTurnIdSchema.optional()
2222
2235
  }),
2223
- z14.object({
2224
- kind: z14.literal("context.compacted"),
2236
+ z15.object({
2237
+ kind: z15.literal("context.compacted"),
2225
2238
  providerTurnId: providerTurnIdSchema.optional(),
2226
2239
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2227
2240
  }),
2228
- z14.object({ kind: z14.literal("context.cleared") }),
2229
- z14.object({
2230
- kind: z14.literal("turn.diff"),
2231
- diff: z14.string(),
2241
+ z15.object({ kind: z15.literal("context.cleared") }),
2242
+ z15.object({
2243
+ kind: z15.literal("turn.diff"),
2244
+ diff: z15.string(),
2232
2245
  providerTurnId: providerTurnIdSchema.optional()
2233
2246
  }),
2234
- z14.object({ kind: z14.literal("thread.started") }),
2235
- z14.object({
2236
- kind: z14.literal("thread.identity"),
2237
- providerThreadId: z14.string().min(1)
2247
+ z15.object({ kind: z15.literal("thread.started") }),
2248
+ z15.object({
2249
+ kind: z15.literal("thread.identity"),
2250
+ providerThreadId: z15.string().min(1)
2238
2251
  }),
2239
- z14.object({ kind: z14.literal("thread.name"), name: z14.string().min(1) }),
2240
- z14.object({
2241
- kind: z14.literal("extension.state"),
2252
+ z15.object({ kind: z15.literal("thread.name"), name: z15.string().min(1) }),
2253
+ z15.object({
2254
+ kind: z15.literal("extension.state"),
2242
2255
  extensionKind: extensionKindSchema,
2243
2256
  payload: jsonValueSchema
2244
2257
  }),
2245
- z14.object({
2246
- kind: z14.literal("provider.rateLimits"),
2258
+ z15.object({
2259
+ kind: z15.literal("provider.rateLimits"),
2247
2260
  rateLimits: providerRateLimitStateSchema
2248
2261
  }),
2249
- z14.object({
2250
- kind: z14.literal("provider.error"),
2251
- message: z14.string(),
2252
- detail: z14.string().optional(),
2253
- willRetry: z14.boolean().optional(),
2262
+ z15.object({
2263
+ kind: z15.literal("provider.error"),
2264
+ message: z15.string(),
2265
+ detail: z15.string().optional(),
2266
+ willRetry: z15.boolean().optional(),
2254
2267
  category: providerErrorCategorySchema.optional(),
2255
2268
  errorInfo: providerErrorInfoSchema.optional(),
2256
- settlesTurn: z14.boolean().optional(),
2269
+ settlesTurn: z15.boolean().optional(),
2257
2270
  providerTurnId: providerTurnIdSchema.optional(),
2258
- threadScoped: z14.boolean().optional()
2271
+ threadScoped: z15.boolean().optional()
2259
2272
  }),
2260
- z14.object({
2261
- kind: z14.literal("provider.modelFallback"),
2262
- originalModel: z14.string().min(1),
2263
- fallbackModel: z14.string().min(1),
2264
- reason: z14.enum(["refusal", "provider"]),
2265
- message: z14.string()
2273
+ z15.object({
2274
+ kind: z15.literal("provider.modelFallback"),
2275
+ originalModel: z15.string().min(1),
2276
+ fallbackModel: z15.string().min(1),
2277
+ reason: z15.enum(["refusal", "provider"]),
2278
+ message: z15.string()
2266
2279
  }),
2267
- z14.object({
2268
- kind: z14.literal("provider.warning"),
2269
- summary: z14.string().optional(),
2270
- details: z14.string().optional(),
2280
+ z15.object({
2281
+ kind: z15.literal("provider.warning"),
2282
+ summary: z15.string().optional(),
2283
+ details: z15.string().optional(),
2271
2284
  category: threadEventWarningCategorySchema.optional(),
2272
- vouchedTurn: z14.boolean().optional()
2285
+ vouchedTurn: z15.boolean().optional()
2273
2286
  }),
2274
- z14.object({
2275
- kind: z14.literal("unhandled"),
2287
+ z15.object({
2288
+ kind: z15.literal("unhandled"),
2276
2289
  raw: providerRawEventSchema,
2277
- rawType: z14.string(),
2278
- vouchedTurn: z14.boolean(),
2279
- onlyIfNoTurn: z14.boolean().optional(),
2290
+ rawType: z15.string(),
2291
+ vouchedTurn: z15.boolean(),
2292
+ onlyIfNoTurn: z15.boolean().optional(),
2280
2293
  parentRef: deltaKeyPartSchema.optional(),
2281
2294
  providerTurnId: providerTurnIdSchema.optional()
2282
2295
  }),
2283
- z14.object({ kind: z14.literal("session.ended") }),
2284
- z14.object({ kind: z14.literal("session.reset") })
2296
+ z15.object({ kind: z15.literal("session.ended") }),
2297
+ z15.object({ kind: z15.literal("session.reset") })
2285
2298
  ]);
2286
- var threadDeltaNotificationParamsSchema = z14.object({
2287
- threadId: z14.string().min(1),
2288
- deltas: z14.array(threadDeltaSchema)
2299
+ var threadDeltaNotificationParamsSchema = z15.object({
2300
+ threadId: z15.string().min(1),
2301
+ deltas: z15.array(threadDeltaSchema)
2289
2302
  }).passthrough();
2290
2303
 
2291
2304
  // ../provider-bridge-protocol/src/assembler/delta-assembler.ts
@@ -2296,17 +2309,17 @@ var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
2296
2309
  var THREAD_DELTA_GRAMMAR_V3 = 3;
2297
2310
 
2298
2311
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
2299
- import { z as z16 } from "zod";
2312
+ import { z as z17 } from "zod";
2300
2313
 
2301
2314
  // ../provider-bridge-protocol/src/bridge-kit/tool-arg-schemas.ts
2302
- import { z as z15 } from "zod";
2303
- var bashArgsSchema = z15.object({
2304
- command: z15.string().optional(),
2305
- cwd: z15.string().optional()
2315
+ import { z as z16 } from "zod";
2316
+ var bashArgsSchema = z16.object({
2317
+ command: z16.string().optional(),
2318
+ cwd: z16.string().optional()
2306
2319
  }).passthrough();
2307
- var textBlockSchema = z15.object({
2308
- type: z15.literal("text"),
2309
- text: z15.string()
2320
+ var textBlockSchema = z16.object({
2321
+ type: z16.literal("text"),
2322
+ text: z16.string()
2310
2323
  });
2311
2324
 
2312
2325
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility-helpers.ts
@@ -2315,10 +2328,10 @@ function isRecord(value) {
2315
2328
  }
2316
2329
 
2317
2330
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
2318
- var contentWrapperSchema = z16.object({
2319
- content: z16.array(z16.unknown())
2331
+ var contentWrapperSchema = z17.object({
2332
+ content: z17.array(z17.unknown())
2320
2333
  }).passthrough();
2321
- var shellEnvironmentVariableKeySchema = z16.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
2334
+ var shellEnvironmentVariableKeySchema = z17.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
2322
2335
  var MAX_EXACT_LINE_DIFF_CELLS = 1e6;
2323
2336
  function splitComparableLines(text) {
2324
2337
  const normalized = text.replace(/\r\n?/gu, "\n");
@@ -4126,11 +4139,11 @@ function toConformanceMessages() {
4126
4139
  }
4127
4140
 
4128
4141
  // ../provider-bridge-protocol/src/conformance/client.ts
4129
- import { z as z17 } from "zod";
4142
+ import { z as z18 } from "zod";
4130
4143
  function isWireMessage(value) {
4131
4144
  return typeof value === "object" && value !== null && !Array.isArray(value);
4132
4145
  }
4133
- var threadDeltaAddressSchema = z17.object({ threadId: z17.string() }).passthrough();
4146
+ var threadDeltaAddressSchema = z18.object({ threadId: z18.string() }).passthrough();
4134
4147
  var ConformanceClient = class {
4135
4148
  constructor(transport, timeoutMs, collector) {
4136
4149
  this.transport = transport;
@@ -4239,11 +4252,11 @@ function nextConformanceClientRequestId() {
4239
4252
  }
4240
4253
 
4241
4254
  // ../provider-bridge-protocol/src/conformance/scenarios.ts
4242
- import { z as z25 } from "zod";
4255
+ import { z as z26 } from "zod";
4243
4256
 
4244
4257
  // ../provider-bridge-protocol/src/handshake.ts
4245
- import { z as z18 } from "zod";
4246
- var bridgeGrammarVersionsSchema = z18.tuple([z18.number().int().positive(), z18.number().int().positive()]).refine(([min, max]) => min <= max, {
4258
+ import { z as z19 } from "zod";
4259
+ var bridgeGrammarVersionsSchema = z19.tuple([z19.number().int().positive(), z19.number().int().positive()]).refine(([min, max]) => min <= max, {
4247
4260
  message: "grammarVersions must be an ascending [min, max] range"
4248
4261
  });
4249
4262
  function negotiateGrammarVersion(runtime, bridge) {
@@ -4251,62 +4264,62 @@ function negotiateGrammarVersion(runtime, bridge) {
4251
4264
  const max = Math.min(runtime[1], bridge[1]);
4252
4265
  return min <= max ? max : null;
4253
4266
  }
4254
- var bridgeSteerModeSchema = z18.enum(["inject", "queue"]);
4255
- var bridgeCapabilitiesSchema = z18.object({
4256
- sessionRestore: z18.boolean().default(false),
4257
- threadArchive: z18.boolean().default(false),
4258
- threadRename: z18.boolean().default(false),
4259
- threadGoalClear: z18.boolean().default(false),
4267
+ var bridgeSteerModeSchema = z19.enum(["inject", "queue"]);
4268
+ var bridgeCapabilitiesSchema = z19.object({
4269
+ sessionRestore: z19.boolean().default(false),
4270
+ threadArchive: z19.boolean().default(false),
4271
+ threadRename: z19.boolean().default(false),
4272
+ threadGoalClear: z19.boolean().default(false),
4260
4273
  fork: providerForkSchema.default("none"),
4261
- approvalEnforcedBy: z18.enum(["runtime", "provider"]).default("runtime"),
4274
+ approvalEnforcedBy: z19.enum(["runtime", "provider"]).default("runtime"),
4262
4275
  grammarVersions: bridgeGrammarVersionsSchema.default([
4263
4276
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4264
4277
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4265
4278
  ]),
4266
4279
  steerMode: bridgeSteerModeSchema.default("queue"),
4267
- skills: z18.object({ configure: z18.boolean().default(false) }).default({ configure: false })
4280
+ skills: z19.object({ configure: z19.boolean().default(false) }).default({ configure: false })
4268
4281
  }).passthrough();
4269
- var initializeParamsSchema = z18.object({
4270
- protocolVersion: z18.number().int().positive(),
4271
- client: z18.object({ name: z18.string().min(1), version: z18.string().min(1) }),
4282
+ var initializeParamsSchema = z19.object({
4283
+ protocolVersion: z19.number().int().positive(),
4284
+ client: z19.object({ name: z19.string().min(1), version: z19.string().min(1) }),
4272
4285
  grammarVersions: bridgeGrammarVersionsSchema.default([
4273
4286
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4274
4287
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4275
4288
  ])
4276
4289
  }).passthrough();
4277
- var initializeResultSchema = z18.object({
4278
- protocolVersion: z18.number().int().positive(),
4279
- capabilities: z18.preprocess(
4290
+ var initializeResultSchema = z19.object({
4291
+ protocolVersion: z19.number().int().positive(),
4292
+ capabilities: z19.preprocess(
4280
4293
  (value) => value ?? {},
4281
4294
  bridgeCapabilitiesSchema
4282
4295
  )
4283
4296
  }).passthrough();
4284
4297
 
4285
4298
  // ../provider-bridge-protocol/src/execution-options.ts
4286
- import { z as z19 } from "zod";
4287
- var bridgeExecutionOptionsSchema = z19.object({
4288
- model: z19.string().min(1).optional(),
4299
+ import { z as z20 } from "zod";
4300
+ var bridgeExecutionOptionsSchema = z20.object({
4301
+ model: z20.string().min(1).optional(),
4289
4302
  serviceTier: serviceTierSchema.optional(),
4290
4303
  reasoningLevel: reasoningLevelSchema.optional(),
4291
4304
  promptMode: promptModeSchema.optional(),
4292
- instructions: z19.string().optional(),
4293
- envVars: z19.record(z19.string(), z19.string()).optional(),
4294
- providerOptions: z19.record(z19.string(), z19.unknown()).optional()
4305
+ instructions: z20.string().optional(),
4306
+ envVars: z20.record(z20.string(), z20.string()).optional(),
4307
+ providerOptions: z20.record(z20.string(), z20.unknown()).optional()
4295
4308
  }).and(runtimePermissionPolicySchema);
4296
4309
 
4297
4310
  // ../provider-bridge-protocol/src/provider-maintenance.ts
4298
- import { z as z20 } from "zod";
4299
- var providerMaintenanceParamsSchema = z20.object({
4300
- providerId: z20.string().min(1),
4301
- cwd: z20.string().min(1).optional(),
4302
- providerOptions: z20.record(z20.string(), z20.unknown()).optional()
4311
+ import { z as z21 } from "zod";
4312
+ var providerMaintenanceParamsSchema = z21.object({
4313
+ providerId: z21.string().min(1),
4314
+ cwd: z21.string().min(1).optional(),
4315
+ providerOptions: z21.record(z21.string(), z21.unknown()).optional()
4303
4316
  }).passthrough();
4304
- var providerInstallationRequirementSchema = z20.enum(["thread_rewind"]);
4317
+ var providerInstallationRequirementSchema = z21.enum(["thread_rewind"]);
4305
4318
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
4306
4319
  requirement: providerInstallationRequirementSchema.optional()
4307
4320
  });
4308
- var providerHealthSchema = z20.object({
4309
- status: z20.enum([
4321
+ var providerHealthSchema = z21.object({
4322
+ status: z21.enum([
4310
4323
  "ready",
4311
4324
  "not_installed",
4312
4325
  "unauthenticated",
@@ -4314,114 +4327,114 @@ var providerHealthSchema = z20.object({
4314
4327
  "unsupported_version",
4315
4328
  "unknown"
4316
4329
  ]),
4317
- statusMessage: z20.string().min(1).nullable(),
4318
- accountEmail: z20.string().nullable(),
4319
- planLabel: z20.string().min(1).nullable(),
4320
- installedVersion: z20.string().min(1).nullable(),
4321
- minimumSupportedVersion: z20.string().min(1).nullable(),
4322
- canInstall: z20.boolean(),
4323
- canUpdate: z20.boolean(),
4324
- loginCommand: z20.string().min(1).nullable()
4330
+ statusMessage: z21.string().min(1).nullable(),
4331
+ accountEmail: z21.string().nullable(),
4332
+ planLabel: z21.string().min(1).nullable(),
4333
+ installedVersion: z21.string().min(1).nullable(),
4334
+ minimumSupportedVersion: z21.string().min(1).nullable(),
4335
+ canInstall: z21.boolean(),
4336
+ canUpdate: z21.boolean(),
4337
+ loginCommand: z21.string().min(1).nullable()
4325
4338
  }).passthrough();
4326
- var providerUsageWindowSchema = z20.object({
4327
- label: z20.string().min(1),
4328
- usedPercent: z20.number().min(0).max(100),
4329
- resetsAt: z20.string().min(1).nullable(),
4330
- cost: z20.object({
4331
- usedUsdCents: z20.number().int().nonnegative(),
4332
- limitUsdCents: z20.number().int().positive()
4339
+ var providerUsageWindowSchema = z21.object({
4340
+ label: z21.string().min(1),
4341
+ usedPercent: z21.number().min(0).max(100),
4342
+ resetsAt: z21.string().min(1).nullable(),
4343
+ cost: z21.object({
4344
+ usedUsdCents: z21.number().int().nonnegative(),
4345
+ limitUsdCents: z21.number().int().positive()
4333
4346
  }).optional()
4334
4347
  }).passthrough();
4335
- var providerUsageSchema = z20.discriminatedUnion("status", [
4336
- z20.object({
4337
- status: z20.literal("ok"),
4338
- accountEmail: z20.string().email().nullable(),
4339
- planLabel: z20.string().min(1).nullable(),
4340
- windows: z20.array(providerUsageWindowSchema)
4348
+ var providerUsageSchema = z21.discriminatedUnion("status", [
4349
+ z21.object({
4350
+ status: z21.literal("ok"),
4351
+ accountEmail: z21.string().email().nullable(),
4352
+ planLabel: z21.string().min(1).nullable(),
4353
+ windows: z21.array(providerUsageWindowSchema)
4341
4354
  }).passthrough(),
4342
- z20.object({ status: z20.literal("not_installed") }).passthrough(),
4343
- z20.object({ status: z20.literal("unauthenticated") }).passthrough(),
4344
- z20.object({ status: z20.literal("expired") }).passthrough(),
4345
- z20.object({
4346
- status: z20.literal("error"),
4347
- message: z20.string().min(1),
4348
- planLabel: z20.string().min(1).nullable().default(null),
4349
- accountEmail: z20.string().nullable().default(null)
4355
+ z21.object({ status: z21.literal("not_installed") }).passthrough(),
4356
+ z21.object({ status: z21.literal("unauthenticated") }).passthrough(),
4357
+ z21.object({ status: z21.literal("expired") }).passthrough(),
4358
+ z21.object({
4359
+ status: z21.literal("error"),
4360
+ message: z21.string().min(1),
4361
+ planLabel: z21.string().min(1).nullable().default(null),
4362
+ accountEmail: z21.string().nullable().default(null)
4350
4363
  }).passthrough()
4351
4364
  ]);
4352
- var providerHealthResultSchema = z20.discriminatedUnion("supported", [
4353
- z20.object({ supported: z20.literal(false) }).passthrough(),
4354
- z20.object({
4355
- supported: z20.literal(true),
4365
+ var providerHealthResultSchema = z21.discriminatedUnion("supported", [
4366
+ z21.object({ supported: z21.literal(false) }).passthrough(),
4367
+ z21.object({
4368
+ supported: z21.literal(true),
4356
4369
  health: providerHealthSchema
4357
4370
  }).passthrough()
4358
4371
  ]);
4359
- var providerUsageResultSchema = z20.discriminatedUnion("supported", [
4360
- z20.object({ supported: z20.literal(false) }).passthrough(),
4361
- z20.object({
4362
- supported: z20.literal(true),
4372
+ var providerUsageResultSchema = z21.discriminatedUnion("supported", [
4373
+ z21.object({ supported: z21.literal(false) }).passthrough(),
4374
+ z21.object({
4375
+ supported: z21.literal(true),
4363
4376
  usage: providerUsageSchema
4364
4377
  }).passthrough()
4365
4378
  ]);
4366
- var providerInstallationActionKindSchema = z20.enum([
4379
+ var providerInstallationActionKindSchema = z21.enum([
4367
4380
  "install",
4368
4381
  "update"
4369
4382
  ]);
4370
- var providerInstallationActionSchema = z20.object({
4383
+ var providerInstallationActionSchema = z21.object({
4371
4384
  kind: providerInstallationActionKindSchema,
4372
- label: z20.enum(["Install", "Update"]),
4373
- command: z20.string().min(1)
4385
+ label: z21.enum(["Install", "Update"]),
4386
+ command: z21.string().min(1)
4374
4387
  }).passthrough();
4375
- var providerInstallationSourceSchema = z20.enum([
4388
+ var providerInstallationSourceSchema = z21.enum([
4376
4389
  "notInstalled",
4377
4390
  "npmGlobal",
4378
4391
  "external"
4379
4392
  ]);
4380
- var providerInstallationStatusSchema = z20.object({
4381
- executableName: z20.string().min(1),
4382
- executablePath: z20.string().min(1).nullable(),
4383
- installed: z20.boolean(),
4393
+ var providerInstallationStatusSchema = z21.object({
4394
+ executableName: z21.string().min(1),
4395
+ executablePath: z21.string().min(1).nullable(),
4396
+ installed: z21.boolean(),
4384
4397
  installSource: providerInstallationSourceSchema,
4385
- currentVersion: z20.string().min(1).nullable(),
4386
- latestVersion: z20.string().min(1).nullable(),
4387
- minimumSupportedVersion: z20.string().min(1).nullable(),
4388
- npmPackageName: z20.string().min(1).nullable(),
4389
- npmGlobalPackageVersion: z20.string().min(1).nullable(),
4398
+ currentVersion: z21.string().min(1).nullable(),
4399
+ latestVersion: z21.string().min(1).nullable(),
4400
+ minimumSupportedVersion: z21.string().min(1).nullable(),
4401
+ npmPackageName: z21.string().min(1).nullable(),
4402
+ npmGlobalPackageVersion: z21.string().min(1).nullable(),
4390
4403
  installAction: providerInstallationActionSchema.nullable(),
4391
- needsUpdate: z20.boolean(),
4392
- versionUnsupported: z20.boolean()
4404
+ needsUpdate: z21.boolean(),
4405
+ versionUnsupported: z21.boolean()
4393
4406
  }).passthrough();
4394
4407
  var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
4395
4408
  action: providerInstallationActionKindSchema
4396
4409
  });
4397
- var providerInstallationCommandSchema = z20.object({
4398
- command: z20.string().min(1),
4399
- args: z20.array(z20.string()).max(64),
4400
- displayCommand: z20.string().min(1)
4410
+ var providerInstallationCommandSchema = z21.object({
4411
+ command: z21.string().min(1),
4412
+ args: z21.array(z21.string()).max(64),
4413
+ displayCommand: z21.string().min(1)
4401
4414
  }).passthrough();
4402
- var providerInstallationVerificationSchema = z20.discriminatedUnion(
4415
+ var providerInstallationVerificationSchema = z21.discriminatedUnion(
4403
4416
  "kind",
4404
4417
  [
4405
- z20.object({ kind: z20.literal("installed") }).passthrough(),
4406
- z20.object({
4407
- kind: z20.literal("version_changed"),
4408
- previousVersion: z20.string().min(1)
4418
+ z21.object({ kind: z21.literal("installed") }).passthrough(),
4419
+ z21.object({
4420
+ kind: z21.literal("version_changed"),
4421
+ previousVersion: z21.string().min(1)
4409
4422
  }).passthrough(),
4410
- z20.object({
4411
- kind: z20.literal("version_at_least"),
4412
- version: z20.string().min(1)
4423
+ z21.object({
4424
+ kind: z21.literal("version_at_least"),
4425
+ version: z21.string().min(1)
4413
4426
  }).passthrough()
4414
4427
  ]
4415
4428
  );
4416
- var providerInstallationRunResultSchema = z20.discriminatedUnion(
4429
+ var providerInstallationRunResultSchema = z21.discriminatedUnion(
4417
4430
  "available",
4418
4431
  [
4419
- z20.object({
4420
- available: z20.literal(false),
4421
- message: z20.string().min(1)
4432
+ z21.object({
4433
+ available: z21.literal(false),
4434
+ message: z21.string().min(1)
4422
4435
  }).passthrough(),
4423
- z20.object({
4424
- available: z20.literal(true),
4436
+ z21.object({
4437
+ available: z21.literal(true),
4425
4438
  command: providerInstallationCommandSchema,
4426
4439
  verification: providerInstallationVerificationSchema
4427
4440
  }).passthrough()
@@ -4429,7 +4442,7 @@ var providerInstallationRunResultSchema = z20.discriminatedUnion(
4429
4442
  );
4430
4443
 
4431
4444
  // ../provider-bridge-protocol/src/requests.ts
4432
- import { z as z21 } from "zod";
4445
+ import { z as z22 } from "zod";
4433
4446
  var BRIDGE_REQUEST_METHODS = {
4434
4447
  initialize: "initialize",
4435
4448
  modelList: "model/list",
@@ -4451,81 +4464,81 @@ var BRIDGE_REQUEST_METHODS = {
4451
4464
  skillsConfigure: "skills/configure"
4452
4465
  };
4453
4466
  var sessionConstructionFields = {
4454
- threadId: z21.string().min(1),
4455
- cwd: z21.string().min(1),
4467
+ threadId: z22.string().min(1),
4468
+ cwd: z22.string().min(1),
4456
4469
  options: bridgeExecutionOptionsSchema,
4457
- dynamicTools: z21.array(dynamicToolSchema).optional(),
4458
- disallowedTools: z21.array(z21.string().min(1)).optional(),
4470
+ dynamicTools: z22.array(dynamicToolSchema).optional(),
4471
+ disallowedTools: z22.array(z22.string().min(1)).optional(),
4459
4472
  instructionMode: instructionModeSchema
4460
4473
  };
4461
- var modelListParamsSchema = z21.object({ cwd: z21.string().min(1).optional() }).passthrough();
4462
- var threadStartParamsSchema = z21.object({
4474
+ var modelListParamsSchema = z22.object({ cwd: z22.string().min(1).optional() }).passthrough();
4475
+ var threadStartParamsSchema = z22.object({
4463
4476
  ...sessionConstructionFields,
4464
- input: z21.array(promptInputSchema).optional()
4477
+ input: z22.array(promptInputSchema).optional()
4465
4478
  }).passthrough();
4466
- var threadResumeParamsSchema = z21.object({
4479
+ var threadResumeParamsSchema = z22.object({
4467
4480
  ...sessionConstructionFields,
4468
- providerThreadId: z21.string().min(1)
4481
+ providerThreadId: z22.string().min(1)
4469
4482
  }).passthrough();
4470
- var threadForkParamsSchema = z21.object({
4483
+ var threadForkParamsSchema = z22.object({
4471
4484
  ...sessionConstructionFields,
4472
- sourceProviderThreadId: z21.string().min(1),
4473
- sourceProviderCheckpointId: z21.string().min(1).optional()
4485
+ sourceProviderThreadId: z22.string().min(1),
4486
+ sourceProviderCheckpointId: z22.string().min(1).optional()
4474
4487
  }).passthrough();
4475
- var threadStopParamsSchema = z21.object({
4476
- threadId: z21.string().min(1),
4477
- providerThreadId: z21.string().min(1),
4478
- intent: z21.enum(["interrupt", "release"]),
4479
- activeTurnId: z21.string().min(1).nullable()
4488
+ var threadStopParamsSchema = z22.object({
4489
+ threadId: z22.string().min(1),
4490
+ providerThreadId: z22.string().min(1),
4491
+ intent: z22.enum(["interrupt", "release"]),
4492
+ activeTurnId: z22.string().min(1).nullable()
4480
4493
  }).passthrough();
4481
- var threadRefParams = z21.object({
4482
- threadId: z21.string().min(1),
4483
- providerThreadId: z21.string().min(1)
4494
+ var threadRefParams = z22.object({
4495
+ threadId: z22.string().min(1),
4496
+ providerThreadId: z22.string().min(1)
4484
4497
  }).passthrough();
4485
- var threadNameSetParamsSchema = z21.object({
4486
- threadId: z21.string().min(1),
4487
- providerThreadId: z21.string().min(1),
4488
- title: z21.string().min(1)
4498
+ var threadNameSetParamsSchema = z22.object({
4499
+ threadId: z22.string().min(1),
4500
+ providerThreadId: z22.string().min(1),
4501
+ title: z22.string().min(1)
4489
4502
  }).passthrough();
4490
4503
  var turnInputFields = {
4491
- threadId: z21.string().min(1),
4492
- providerThreadId: z21.string().min(1),
4493
- input: z21.array(promptInputSchema),
4504
+ threadId: z22.string().min(1),
4505
+ providerThreadId: z22.string().min(1),
4506
+ input: z22.array(promptInputSchema),
4494
4507
  clientRequestId: clientTurnRequestIdSchema,
4495
4508
  options: bridgeExecutionOptionsSchema
4496
4509
  };
4497
- var turnStartParamsSchema = z21.object(turnInputFields).passthrough();
4498
- var turnSteerParamsSchema = z21.object({
4510
+ var turnStartParamsSchema = z22.object(turnInputFields).passthrough();
4511
+ var turnSteerParamsSchema = z22.object({
4499
4512
  ...turnInputFields,
4500
- expectedTurnId: z21.string().min(1)
4513
+ expectedTurnId: z22.string().min(1)
4501
4514
  }).passthrough();
4502
- var skillsConfigureRootSchema = z21.object({
4503
- id: z21.string().min(1),
4504
- path: z21.string().min(1),
4505
- skills: z21.array(
4506
- z21.object({
4507
- name: z21.string().min(1),
4508
- description: z21.string()
4515
+ var skillsConfigureRootSchema = z22.object({
4516
+ id: z22.string().min(1),
4517
+ path: z22.string().min(1),
4518
+ skills: z22.array(
4519
+ z22.object({
4520
+ name: z22.string().min(1),
4521
+ description: z22.string()
4509
4522
  }).passthrough()
4510
4523
  )
4511
4524
  }).passthrough();
4512
- var skillsConfigureParamsSchema = z21.object({
4513
- roots: z21.array(skillsConfigureRootSchema)
4525
+ var skillsConfigureParamsSchema = z22.object({
4526
+ roots: z22.array(skillsConfigureRootSchema)
4514
4527
  }).passthrough();
4515
- var threadIdentityResultSchema = z21.object({
4516
- providerThreadId: z21.string().min(1),
4517
- sessionRestorable: z21.boolean().optional()
4528
+ var threadIdentityResultSchema = z22.object({
4529
+ providerThreadId: z22.string().min(1),
4530
+ sessionRestorable: z22.boolean().optional()
4518
4531
  }).passthrough();
4519
- var modelListResultSchema = z21.object({
4520
- models: z21.array(availableModelSchema),
4521
- selectedOnlyModels: z21.array(availableModelSchema).default([])
4532
+ var modelListResultSchema = z22.object({
4533
+ models: z22.array(availableModelSchema),
4534
+ selectedOnlyModels: z22.array(availableModelSchema).default([])
4522
4535
  }).passthrough();
4523
4536
 
4524
4537
  // ../provider-bridge-protocol/src/notifications.ts
4525
- import { z as z23 } from "zod";
4538
+ import { z as z24 } from "zod";
4526
4539
 
4527
4540
  // ../provider-bridge-protocol/src/errors.ts
4528
- import { z as z22 } from "zod";
4541
+ import { z as z23 } from "zod";
4529
4542
  var BRIDGE_JSON_RPC_ERRORS = {
4530
4543
  INVALID_PARAMS: -32602,
4531
4544
  METHOD_NOT_FOUND: -32601,
@@ -4534,67 +4547,67 @@ var BRIDGE_JSON_RPC_ERRORS = {
4534
4547
  SESSION_NOT_RESTORABLE: -32002,
4535
4548
  FORK_CHECKPOINT_UNSUPPORTED: -32003
4536
4549
  };
4537
- var providerRecoveryHintSchema = z22.object({
4550
+ var providerRecoveryHintSchema = z23.object({
4538
4551
  kind: providerRecoveryKindSchema,
4539
- message: z22.string().min(1),
4540
- retryable: z22.boolean()
4552
+ message: z23.string().min(1),
4553
+ retryable: z23.boolean()
4541
4554
  });
4542
- var bridgeErrorDataSchema = z22.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4555
+ var bridgeErrorDataSchema = z23.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4543
4556
 
4544
4557
  // ../provider-bridge-protocol/src/notifications.ts
4545
- var threadIdentityNotificationSchema = z23.object({
4546
- threadId: z23.string().min(1),
4547
- providerThreadId: z23.string().min(1),
4548
- sessionRestorable: z23.boolean().optional()
4558
+ var threadIdentityNotificationSchema = z24.object({
4559
+ threadId: z24.string().min(1),
4560
+ providerThreadId: z24.string().min(1),
4561
+ sessionRestorable: z24.boolean().optional()
4549
4562
  }).passthrough();
4550
- var sessionReplacedNotificationSchema = z23.object({
4551
- threadId: z23.string().min(1),
4552
- providerThreadId: z23.string().min(1).nullable(),
4553
- reason: z23.string().min(1),
4554
- contextLost: z23.boolean().default(false)
4563
+ var sessionReplacedNotificationSchema = z24.object({
4564
+ threadId: z24.string().min(1),
4565
+ providerThreadId: z24.string().min(1).nullable(),
4566
+ reason: z24.string().min(1),
4567
+ contextLost: z24.boolean().default(false)
4555
4568
  }).passthrough();
4556
- var providerRawNotificationSchema = z23.object({
4557
- threadId: z23.string().min(1).optional(),
4558
- coverage: z23.enum(["noise", "unknown"]),
4559
- payload: z23.unknown()
4569
+ var providerRawNotificationSchema = z24.object({
4570
+ threadId: z24.string().min(1).optional(),
4571
+ coverage: z24.enum(["noise", "unknown"]),
4572
+ payload: z24.unknown()
4560
4573
  }).passthrough();
4561
- var providerRecoveryNotificationSchema = z23.object({
4562
- threadId: z23.string().min(1).optional(),
4574
+ var providerRecoveryNotificationSchema = z24.object({
4575
+ threadId: z24.string().min(1).optional(),
4563
4576
  ...providerRecoveryHintSchema.shape
4564
4577
  }).passthrough();
4565
- var errorNotificationSchema = z23.object({
4566
- threadId: z23.string().min(1).optional(),
4567
- message: z23.string().min(1)
4578
+ var errorNotificationSchema = z24.object({
4579
+ threadId: z24.string().min(1).optional(),
4580
+ message: z24.string().min(1)
4568
4581
  }).passthrough();
4569
4582
 
4570
4583
  // ../provider-bridge-protocol/src/bridge-requests.ts
4571
- import { z as z24 } from "zod";
4572
- var toolCallRequestParamsSchema = z24.object({
4573
- providerThreadId: z24.string().min(1),
4574
- threadId: z24.string().min(1).optional(),
4575
- turnId: z24.union([z24.string().min(1), z24.null()]),
4576
- callId: z24.string().min(1),
4577
- tool: z24.string().min(1),
4578
- arguments: z24.unknown()
4584
+ import { z as z25 } from "zod";
4585
+ var toolCallRequestParamsSchema = z25.object({
4586
+ providerThreadId: z25.string().min(1),
4587
+ threadId: z25.string().min(1).optional(),
4588
+ turnId: z25.union([z25.string().min(1), z25.null()]),
4589
+ callId: z25.string().min(1),
4590
+ tool: z25.string().min(1),
4591
+ arguments: z25.unknown()
4579
4592
  }).passthrough();
4580
- var toolCallResultSchema = z24.object({
4581
- success: z24.boolean(),
4582
- contentItems: z24.array(
4583
- z24.discriminatedUnion("type", [
4584
- z24.object({ type: z24.literal("inputText"), text: z24.string() }),
4585
- z24.object({
4586
- type: z24.literal("inputImage"),
4587
- imageUrl: z24.string().min(1)
4593
+ var toolCallResultSchema = z25.object({
4594
+ success: z25.boolean(),
4595
+ contentItems: z25.array(
4596
+ z25.discriminatedUnion("type", [
4597
+ z25.object({ type: z25.literal("inputText"), text: z25.string() }),
4598
+ z25.object({
4599
+ type: z25.literal("inputImage"),
4600
+ imageUrl: z25.string().min(1)
4588
4601
  })
4589
4602
  ])
4590
4603
  )
4591
4604
  }).passthrough();
4592
- var interactionRequestParamsSchema = z24.object({
4593
- providerThreadId: z24.string().min(1),
4594
- threadId: z24.string().min(1).optional(),
4595
- turnId: z24.union([z24.string().min(1), z24.null()]),
4605
+ var interactionRequestParamsSchema = z25.object({
4606
+ providerThreadId: z25.string().min(1),
4607
+ threadId: z25.string().min(1).optional(),
4608
+ turnId: z25.union([z25.string().min(1), z25.null()]),
4596
4609
  payload: pendingInteractionPayloadSchema,
4597
- providerNativeIds: z24.boolean().optional()
4610
+ providerNativeIds: z25.boolean().optional()
4598
4611
  }).passthrough();
4599
4612
 
4600
4613
  // ../provider-bridge-protocol/src/thread-event-grammar.ts
@@ -4771,7 +4784,7 @@ function threadEvents(context, threadId) {
4771
4784
  context.client.drainIntoLog();
4772
4785
  return context.client.events.filter((entry) => entry.threadId === threadId).map((entry) => entry.event);
4773
4786
  }
4774
- var persistedEventSchema = z25.preprocess(
4787
+ var persistedEventSchema = z26.preprocess(
4775
4788
  (event) => JSON.parse(JSON.stringify(event)),
4776
4789
  threadEventSchema
4777
4790
  );
@@ -5866,26 +5879,26 @@ function formatConformanceReport(report) {
5866
5879
  }
5867
5880
 
5868
5881
  // ../provider-bridge-protocol/src/testing/bridge-json-rpc-test-helpers.ts
5869
- import { z as z26 } from "zod";
5870
- var bridgeJsonRpcValueSchema = z26.lazy(
5871
- () => z26.union([
5872
- z26.string(),
5873
- z26.number(),
5874
- z26.boolean(),
5875
- z26.null(),
5876
- z26.array(bridgeJsonRpcValueSchema),
5877
- z26.record(z26.string(), bridgeJsonRpcValueSchema)
5882
+ import { z as z27 } from "zod";
5883
+ var bridgeJsonRpcValueSchema = z27.lazy(
5884
+ () => z27.union([
5885
+ z27.string(),
5886
+ z27.number(),
5887
+ z27.boolean(),
5888
+ z27.null(),
5889
+ z27.array(bridgeJsonRpcValueSchema),
5890
+ z27.record(z27.string(), bridgeJsonRpcValueSchema)
5878
5891
  ])
5879
5892
  );
5880
- var bridgeJsonRpcOutputSchema = z26.object({
5881
- jsonrpc: z26.literal("2.0"),
5882
- id: z26.union([z26.string(), z26.number()]).optional(),
5883
- method: z26.string().optional(),
5893
+ var bridgeJsonRpcOutputSchema = z27.object({
5894
+ jsonrpc: z27.literal("2.0"),
5895
+ id: z27.union([z27.string(), z27.number()]).optional(),
5896
+ method: z27.string().optional(),
5884
5897
  params: bridgeJsonRpcValueSchema.optional(),
5885
5898
  result: bridgeJsonRpcValueSchema.optional(),
5886
- error: z26.object({
5887
- code: z26.number(),
5888
- message: z26.string(),
5899
+ error: z27.object({
5900
+ code: z27.number(),
5901
+ message: z27.string(),
5889
5902
  data: bridgeJsonRpcValueSchema.optional()
5890
5903
  }).optional()
5891
5904
  });