@get-bb/plugin-sdk 0.4.30 → 0.4.35

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.
@@ -655,10 +655,10 @@ var backgroundTaskUsageSchema = z5.object({
655
655
  });
656
656
 
657
657
  // ../domain/src/provider-event.ts
658
- import { z as z13 } from "zod";
658
+ import { z as z14 } from "zod";
659
659
 
660
660
  // ../domain/src/thread-events.ts
661
- import { z as z10 } from "zod";
661
+ import { z as z11 } from "zod";
662
662
 
663
663
  // ../domain/src/pending-interactions.ts
664
664
  import { z as z8 } from "zod";
@@ -1110,24 +1110,8 @@ var interactionLifecycleSchema = z8.union([
1110
1110
  import { z as z9 } from "zod";
1111
1111
  var clientTurnRequestIdSchema = z9.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
1112
1112
 
1113
- // ../domain/src/thread-events.ts
1114
- var systemEventTypeValues = [
1115
- "client/thread/start",
1116
- "client/turn/requested",
1117
- "client/turn/rejected",
1118
- "client/turn/start",
1119
- "system/error",
1120
- "system/manager/user_message",
1121
- "system/thread/interrupted",
1122
- "system/operation",
1123
- "system/interaction/lifecycle",
1124
- "system/permissionGrant/lifecycle",
1125
- "system/userQuestion/lifecycle",
1126
- "system/thread-provisioning",
1127
- "system/provider-turn-watchdog"
1128
- ];
1129
- var threadTurnInitiatorValues = ["user", "agent", "system"];
1130
- var threadTurnInitiatorSchema = z10.enum(threadTurnInitiatorValues);
1113
+ // ../domain/src/system-message.ts
1114
+ import { z as z10 } from "zod";
1131
1115
  var systemMessageKindValues = [
1132
1116
  "ownership-assigned",
1133
1117
  "ownership-removed",
@@ -1150,70 +1134,99 @@ var systemMessageSubjectSchema = z10.discriminatedUnion("kind", [
1150
1134
  count: z10.number()
1151
1135
  })
1152
1136
  ]);
1137
+
1138
+ // ../domain/src/thread-events.ts
1139
+ var systemEventTypeValues = [
1140
+ "client/thread/start",
1141
+ "client/turn/requested",
1142
+ "client/turn/rejected",
1143
+ "client/turn/start",
1144
+ "system/error",
1145
+ "system/manager/user_message",
1146
+ "system/thread/interrupted",
1147
+ "system/operation",
1148
+ "system/interaction/lifecycle",
1149
+ "system/permissionGrant/lifecycle",
1150
+ "system/userQuestion/lifecycle",
1151
+ "system/thread-provisioning",
1152
+ // Legacy persisted watchdog diagnostic; retained for read/decode/render
1153
+ // only, with no current producer.
1154
+ "system/provider-turn-watchdog"
1155
+ ];
1156
+ var threadTurnInitiatorValues = ["user", "agent", "system"];
1157
+ var threadTurnInitiatorSchema = z11.enum(threadTurnInitiatorValues);
1153
1158
  var turnRequestOptionsSchema = recordedThreadExecutionOptionsSchema;
1154
- var turnRequestTargetSchema = z10.discriminatedUnion("kind", [
1155
- z10.object({ kind: z10.literal("thread-start") }),
1156
- z10.object({ kind: z10.literal("new-turn") }),
1157
- z10.object({
1158
- kind: z10.literal("auto"),
1159
- expectedTurnId: z10.string().nullable()
1159
+ var turnRequestTargetSchema = z11.discriminatedUnion("kind", [
1160
+ z11.object({ kind: z11.literal("thread-start") }),
1161
+ z11.object({ kind: z11.literal("new-turn") }),
1162
+ z11.object({
1163
+ kind: z11.literal("auto"),
1164
+ expectedTurnId: z11.string().nullable()
1160
1165
  }),
1161
- z10.object({
1162
- kind: z10.literal("steer"),
1163
- expectedTurnId: z10.string().nullable()
1166
+ z11.object({
1167
+ kind: z11.literal("steer"),
1168
+ expectedTurnId: z11.string().nullable()
1164
1169
  })
1165
1170
  ]);
1166
- var clientTurnLifecycleEventDataSchema = z10.object({
1167
- direction: z10.literal("outbound"),
1168
- source: z10.enum(["spawn", "tell"]),
1171
+ var clientTurnLifecycleEventDataSchema = z11.object({
1172
+ direction: z11.literal("outbound"),
1173
+ source: z11.enum(["spawn", "tell"]),
1169
1174
  initiator: threadTurnInitiatorSchema,
1170
- request: z10.object({
1171
- method: z10.enum(["thread/start", "turn/start"]),
1172
- params: z10.record(z10.string(), z10.unknown())
1175
+ request: z11.object({
1176
+ method: z11.enum(["thread/start", "turn/start"]),
1177
+ params: z11.record(z11.string(), z11.unknown())
1173
1178
  })
1174
1179
  });
1175
- var turnRequestEventDataSchema = z10.object({
1176
- direction: z10.literal("outbound"),
1180
+ var turnRequestEventDataSchema = z11.object({
1181
+ direction: z11.literal("outbound"),
1177
1182
  requestId: clientTurnRequestIdSchema,
1178
- continuationOfRequestId: clientTurnRequestIdSchema.optional(),
1179
- source: z10.enum(["spawn", "tell"]),
1183
+ // Retry provenance, written only when a `turn.failed` gate's retry row
1184
+ // dispatches. Both fields are present together or not at all: absence means
1185
+ // "this is an original dispatch", which is the overwhelmingly common case.
1186
+ // (Supersedes the pre-plugin `continuationOfRequestId` key, which the removed
1187
+ // core rate-limit recovery wrote and nothing ever read.)
1188
+ /** The original request this attempt re-submits, unchanged across attempts. */
1189
+ retryOfRequestId: clientTurnRequestIdSchema.optional(),
1190
+ /** Which attempt this is: 2 is the first retry of the original request. */
1191
+ retryAttempt: z11.number().int().min(2).optional(),
1192
+ source: z11.enum(["spawn", "tell"]),
1180
1193
  initiator: threadTurnInitiatorSchema,
1181
- senderThreadId: z10.string().nullable(),
1194
+ senderThreadId: z11.string().nullable(),
1182
1195
  systemMessageKind: systemMessageKindSchema.optional(),
1183
1196
  systemMessageSubject: systemMessageSubjectSchema.nullable().optional(),
1184
- input: z10.array(promptInputSchema),
1185
- inputGroups: z10.array(z10.array(promptInputSchema).min(1)).min(1).optional(),
1197
+ input: z11.array(promptInputSchema),
1198
+ inputGroups: z11.array(z11.array(promptInputSchema).min(1)).min(1).optional(),
1186
1199
  target: turnRequestTargetSchema,
1187
- request: z10.object({
1188
- method: z10.enum(["thread/start", "turn/start"]),
1189
- params: z10.record(z10.string(), z10.unknown())
1200
+ request: z11.object({
1201
+ method: z11.enum(["thread/start", "turn/start"]),
1202
+ params: z11.record(z11.string(), z11.unknown())
1190
1203
  }),
1191
1204
  execution: turnRequestOptionsSchema
1192
1205
  });
1193
- var turnRequestRejectedEventDataSchema = z10.object({
1206
+ var turnRequestRejectedEventDataSchema = z11.object({
1194
1207
  requestId: clientTurnRequestIdSchema,
1195
- reason: z10.string().min(1),
1196
- message: z10.string().min(1)
1197
- });
1198
- var systemErrorEventDataSchema = z10.object({
1199
- code: z10.string().optional(),
1200
- message: z10.string(),
1201
- detail: z10.string().optional(),
1202
- reconnectAttempt: z10.number().int().positive().optional(),
1203
- reconnectTotal: z10.number().int().positive().optional()
1208
+ reason: z11.string().min(1),
1209
+ message: z11.string().min(1)
1210
+ });
1211
+ var systemErrorEventDataSchema = z11.object({
1212
+ code: z11.string().optional(),
1213
+ message: z11.string(),
1214
+ detail: z11.string().optional(),
1215
+ reconnectAttempt: z11.number().int().positive().optional(),
1216
+ reconnectTotal: z11.number().int().positive().optional()
1204
1217
  }).superRefine((value, ctx) => {
1205
1218
  const hasReconnectAttempt = value.reconnectAttempt !== void 0;
1206
1219
  const hasReconnectTotal = value.reconnectTotal !== void 0;
1207
1220
  if (hasReconnectAttempt !== hasReconnectTotal) {
1208
1221
  ctx.addIssue({
1209
- code: z10.ZodIssueCode.custom,
1222
+ code: z11.ZodIssueCode.custom,
1210
1223
  message: "system/error reconnectAttempt and reconnectTotal must be provided together"
1211
1224
  });
1212
1225
  return;
1213
1226
  }
1214
1227
  if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
1215
1228
  ctx.addIssue({
1216
- code: z10.ZodIssueCode.custom,
1229
+ code: z11.ZodIssueCode.custom,
1217
1230
  message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
1218
1231
  });
1219
1232
  }
@@ -1223,42 +1236,42 @@ var ownershipChangeOperationActionValues = [
1223
1236
  "release",
1224
1237
  "transfer"
1225
1238
  ];
1226
- var ownershipChangeOperationActionSchema = z10.enum(
1239
+ var ownershipChangeOperationActionSchema = z11.enum(
1227
1240
  ownershipChangeOperationActionValues
1228
1241
  );
1229
- var ownershipChangeOperationMetadataSchema = z10.object({
1242
+ var ownershipChangeOperationMetadataSchema = z11.object({
1230
1243
  action: ownershipChangeOperationActionSchema,
1231
- nextParentThreadId: z10.string().nullable(),
1232
- nextParentThreadTitle: z10.string().nullable(),
1233
- previousParentThreadId: z10.string().nullable(),
1234
- previousParentThreadTitle: z10.string().nullable()
1235
- });
1236
- var systemOperationEventDataSchema = z10.object({
1237
- operation: z10.string(),
1238
- status: z10.string(),
1239
- message: z10.string(),
1240
- operationId: z10.string(),
1241
- metadata: z10.record(z10.string(), jsonValueSchema).optional()
1242
- });
1243
- var systemInteractionLifecycleEventDataSchema = z10.object({
1244
+ nextParentThreadId: z11.string().nullable(),
1245
+ nextParentThreadTitle: z11.string().nullable(),
1246
+ previousParentThreadId: z11.string().nullable(),
1247
+ previousParentThreadTitle: z11.string().nullable()
1248
+ });
1249
+ var systemOperationEventDataSchema = z11.object({
1250
+ operation: z11.string(),
1251
+ status: z11.string(),
1252
+ message: z11.string(),
1253
+ operationId: z11.string(),
1254
+ metadata: z11.record(z11.string(), jsonValueSchema).optional()
1255
+ });
1256
+ var systemInteractionLifecycleEventDataSchema = z11.object({
1244
1257
  interaction: interactionLifecycleSchema
1245
1258
  });
1246
- var systemPermissionGrantLifecycleEventDataSchema = z10.object({
1247
- interactionId: z10.string(),
1248
- providerId: z10.string(),
1249
- providerRequestId: z10.string(),
1259
+ var systemPermissionGrantLifecycleEventDataSchema = z11.object({
1260
+ interactionId: z11.string(),
1261
+ providerId: z11.string(),
1262
+ providerRequestId: z11.string(),
1250
1263
  status: pendingInteractionStatusSchema,
1251
1264
  resolution: approvalPendingInteractionResolutionSchema.nullable().default(null),
1252
- statusReason: z10.string().nullable().default(null),
1265
+ statusReason: z11.string().nullable().default(null),
1253
1266
  subject: pendingInteractionPermissionGrantApprovalSubjectSchema
1254
1267
  });
1255
- var systemUserQuestionLifecycleEventDataSchema = z10.object({
1256
- interactionId: z10.string(),
1257
- providerId: z10.string(),
1258
- providerRequestId: z10.string(),
1268
+ var systemUserQuestionLifecycleEventDataSchema = z11.object({
1269
+ interactionId: z11.string(),
1270
+ providerId: z11.string(),
1271
+ providerRequestId: z11.string(),
1259
1272
  status: pendingInteractionStatusSchema,
1260
1273
  resolution: userQuestionPendingInteractionResolutionSchema.nullable().default(null),
1261
- statusReason: z10.string().nullable().default(null),
1274
+ statusReason: z11.string().nullable().default(null),
1262
1275
  payload: userQuestionPendingInteractionPayloadSchema
1263
1276
  });
1264
1277
  var systemThreadInterruptedReasonValues = [
@@ -1266,20 +1279,20 @@ var systemThreadInterruptedReasonValues = [
1266
1279
  "host-daemon-restarted",
1267
1280
  "provider-turn-idle"
1268
1281
  ];
1269
- var systemThreadInterruptedReasonSchema = z10.enum(
1282
+ var systemThreadInterruptedReasonSchema = z11.enum(
1270
1283
  systemThreadInterruptedReasonValues
1271
1284
  );
1272
- var systemThreadInterruptedEventDataSchema = z10.object({
1285
+ var systemThreadInterruptedEventDataSchema = z11.object({
1273
1286
  reason: systemThreadInterruptedReasonSchema,
1274
- cause: z10.literal("host-connection-lost").optional()
1287
+ cause: z11.literal("host-connection-lost").optional()
1275
1288
  });
1276
- var provisioningTranscriptEntrySchema = z10.object({
1277
- type: z10.enum(["step", "output"]),
1278
- key: z10.string(),
1279
- text: z10.string(),
1280
- startedAt: z10.number().optional(),
1281
- status: z10.enum(["started", "completed", "failed"]).optional(),
1282
- metadata: z10.record(z10.string(), z10.unknown()).optional()
1289
+ var provisioningTranscriptEntrySchema = z11.object({
1290
+ type: z11.enum(["step", "output"]),
1291
+ key: z11.string(),
1292
+ text: z11.string(),
1293
+ startedAt: z11.number().optional(),
1294
+ status: z11.enum(["started", "completed", "failed"]).optional(),
1295
+ metadata: z11.record(z11.string(), z11.unknown()).optional()
1283
1296
  });
1284
1297
  var systemThreadProvisioningStatusValues = [
1285
1298
  "active",
@@ -1287,48 +1300,48 @@ var systemThreadProvisioningStatusValues = [
1287
1300
  "failed",
1288
1301
  "cancelled"
1289
1302
  ];
1290
- var systemThreadProvisioningStatusSchema = z10.enum(
1303
+ var systemThreadProvisioningStatusSchema = z11.enum(
1291
1304
  systemThreadProvisioningStatusValues
1292
1305
  );
1293
- var systemThreadProvisioningEventDataSchema = z10.object({
1294
- provisioningId: z10.string(),
1306
+ var systemThreadProvisioningEventDataSchema = z11.object({
1307
+ provisioningId: z11.string(),
1295
1308
  status: systemThreadProvisioningStatusSchema,
1296
- environmentId: z10.string(),
1297
- entries: z10.array(provisioningTranscriptEntrySchema)
1298
- });
1299
- var systemLegacyUserMessageEventDataSchema = z10.object({
1300
- text: z10.string(),
1301
- toolCallId: z10.string().optional(),
1302
- turnId: z10.string().optional()
1303
- });
1304
- var systemProviderTurnWatchdogEventDataSchema = z10.object({
1305
- reason: z10.literal("provider-turn-idle"),
1306
- thresholdMs: z10.number().int().positive(),
1307
- elapsedMs: z10.number().int().nonnegative(),
1308
- activeTurnId: z10.string().min(1),
1309
- activeTurnStartedAt: z10.number().int().nonnegative(),
1310
- lastActivityEventSequence: z10.number().int().positive(),
1311
- lastActivityEventType: z10.string().min(1),
1312
- lastActivityEventAt: z10.number().int().nonnegative(),
1313
- providerId: z10.string().min(1),
1314
- providerThreadId: z10.string().min(1).nullable(),
1315
- firedAt: z10.number().int().nonnegative()
1309
+ environmentId: z11.string(),
1310
+ entries: z11.array(provisioningTranscriptEntrySchema)
1311
+ });
1312
+ var systemLegacyUserMessageEventDataSchema = z11.object({
1313
+ text: z11.string(),
1314
+ toolCallId: z11.string().optional(),
1315
+ turnId: z11.string().optional()
1316
+ });
1317
+ var systemProviderTurnWatchdogEventDataSchema = z11.object({
1318
+ reason: z11.literal("provider-turn-idle"),
1319
+ thresholdMs: z11.number().int().positive(),
1320
+ elapsedMs: z11.number().int().nonnegative(),
1321
+ activeTurnId: z11.string().min(1),
1322
+ activeTurnStartedAt: z11.number().int().nonnegative(),
1323
+ lastActivityEventSequence: z11.number().int().positive(),
1324
+ lastActivityEventType: z11.string().min(1),
1325
+ lastActivityEventAt: z11.number().int().nonnegative(),
1326
+ providerId: z11.string().min(1),
1327
+ providerThreadId: z11.string().min(1).nullable(),
1328
+ firedAt: z11.number().int().nonnegative()
1316
1329
  });
1317
1330
 
1318
1331
  // ../domain/src/thread-event-scope.ts
1319
- import { z as z11 } from "zod";
1332
+ import { z as z12 } from "zod";
1320
1333
  var threadEventScopeKindValues = ["thread", "turn"];
1321
- var threadEventScopeKindSchema = z11.enum(threadEventScopeKindValues);
1322
- var threadEventScopeSchema = z11.discriminatedUnion("kind", [
1323
- z11.object({ kind: z11.literal("thread") }),
1324
- z11.object({ kind: z11.literal("turn"), turnId: z11.string().min(1) })
1334
+ var threadEventScopeKindSchema = z12.enum(threadEventScopeKindValues);
1335
+ var threadEventScopeSchema = z12.discriminatedUnion("kind", [
1336
+ z12.object({ kind: z12.literal("thread") }),
1337
+ z12.object({ kind: z12.literal("turn"), turnId: z12.string().min(1) })
1325
1338
  ]);
1326
1339
  var threadEventScopePolicyValues = [
1327
1340
  "thread",
1328
1341
  "turn",
1329
1342
  "thread-or-turn"
1330
1343
  ];
1331
- var threadEventScopePolicySchema = z11.enum(threadEventScopePolicyValues);
1344
+ var threadEventScopePolicySchema = z12.enum(threadEventScopePolicyValues);
1332
1345
  var threadEventScopeDefinitionByType = {
1333
1346
  "thread/started": {
1334
1347
  policy: "thread",
@@ -1506,32 +1519,32 @@ function validateThreadEventScope(args) {
1506
1519
  }
1507
1520
 
1508
1521
  // ../domain/src/thread-timeline-goal.ts
1509
- import { z as z12 } from "zod";
1510
- var threadTimelineGoalStatusSchema = z12.enum([
1522
+ import { z as z13 } from "zod";
1523
+ var threadTimelineGoalStatusSchema = z13.enum([
1511
1524
  "active",
1512
1525
  "paused",
1513
1526
  "budgetLimited",
1514
1527
  "complete"
1515
1528
  ]);
1516
- var threadTimelineGoalSchema = z12.object({
1517
- sourceSeq: z12.number().int().nonnegative(),
1518
- updatedAt: z12.number(),
1519
- objective: z12.string(),
1529
+ var threadTimelineGoalSchema = z13.object({
1530
+ sourceSeq: z13.number().int().nonnegative(),
1531
+ updatedAt: z13.number(),
1532
+ objective: z13.string(),
1520
1533
  status: threadTimelineGoalStatusSchema,
1521
- tokenBudget: z12.number().nullable(),
1522
- tokensUsed: z12.number(),
1523
- timeUsedSeconds: z12.number()
1534
+ tokenBudget: z13.number().nullable(),
1535
+ tokensUsed: z13.number(),
1536
+ timeUsedSeconds: z13.number()
1524
1537
  });
1525
1538
 
1526
1539
  // ../domain/src/provider-event.ts
1527
- var threadEventItemStatusSchema = z13.enum([
1540
+ var threadEventItemStatusSchema = z14.enum([
1528
1541
  "pending",
1529
1542
  "completed",
1530
1543
  "failed",
1531
1544
  "interrupted"
1532
1545
  ]);
1533
- var threadEventItemApprovalStatusSchema = z13.enum(["waiting_for_approval", "denied"]).nullable();
1534
- var threadEventTurnStatusSchema = z13.enum([
1546
+ var threadEventItemApprovalStatusSchema = z14.enum(["waiting_for_approval", "denied"]).nullable();
1547
+ var threadEventTurnStatusSchema = z14.enum([
1535
1548
  "completed",
1536
1549
  "failed",
1537
1550
  "interrupted"
@@ -1557,515 +1570,515 @@ var providerErrorCategoryValues = [
1557
1570
  "unauthorized",
1558
1571
  "unknown"
1559
1572
  ];
1560
- var providerErrorCategorySchema = z13.enum(providerErrorCategoryValues);
1561
- var providerErrorInfoSchema = z13.object({
1573
+ var providerErrorCategorySchema = z14.enum(providerErrorCategoryValues);
1574
+ var providerErrorInfoSchema = z14.object({
1562
1575
  category: providerErrorCategorySchema,
1563
- providerCode: z13.string().nullable(),
1564
- httpStatusCode: z13.number().nullable()
1576
+ providerCode: z14.string().nullable(),
1577
+ httpStatusCode: z14.number().nullable()
1565
1578
  });
1566
- var providerRateLimitStatusSchema = z13.enum([
1579
+ var providerRateLimitStatusSchema = z14.enum([
1567
1580
  "allowed",
1568
1581
  "warning",
1569
1582
  "blocked",
1570
1583
  "unknown"
1571
1584
  ]);
1572
- var providerRateLimitWindowSchema = z13.object({
1573
- providerKey: z13.string().min(1).nullable(),
1574
- label: z13.string().min(1).nullable(),
1585
+ var providerRateLimitWindowSchema = z14.object({
1586
+ providerKey: z14.string().min(1).nullable(),
1587
+ label: z14.string().min(1).nullable(),
1575
1588
  status: providerRateLimitStatusSchema,
1576
- resetsAtMs: z13.number().int().nonnegative().nullable()
1589
+ resetsAtMs: z14.number().int().nonnegative().nullable()
1577
1590
  });
1578
- var providerRateLimitStateSchema = z13.object({
1579
- providerId: z13.string().min(1),
1591
+ var providerRateLimitStateSchema = z14.object({
1592
+ providerId: z14.string().min(1),
1580
1593
  status: providerRateLimitStatusSchema,
1581
- kind: z13.enum(["subscription-window", "credits", "spend-control", "unknown"]),
1582
- windows: z13.array(providerRateLimitWindowSchema),
1583
- reachedReason: z13.string().min(1).nullable(),
1584
- overageStatus: z13.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
1585
- overageReason: z13.string().min(1).nullable()
1586
- });
1587
- var threadEventFileChangeKindSchema = z13.enum(["add", "delete", "update"]);
1588
- var threadEventFileChangeSchema = z13.object({
1589
- path: z13.string(),
1594
+ kind: z14.enum(["subscription-window", "credits", "spend-control", "unknown"]),
1595
+ windows: z14.array(providerRateLimitWindowSchema),
1596
+ reachedReason: z14.string().min(1).nullable(),
1597
+ overageStatus: z14.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
1598
+ overageReason: z14.string().min(1).nullable()
1599
+ });
1600
+ var threadEventFileChangeKindSchema = z14.enum(["add", "delete", "update"]);
1601
+ var threadEventFileChangeSchema = z14.object({
1602
+ path: z14.string(),
1590
1603
  kind: threadEventFileChangeKindSchema,
1591
- movePath: z13.string().optional(),
1592
- diff: z13.string().optional()
1604
+ movePath: z14.string().optional(),
1605
+ diff: z14.string().optional()
1593
1606
  });
1594
- var threadEventPlanStepStatusSchema = z13.enum([
1607
+ var threadEventPlanStepStatusSchema = z14.enum([
1595
1608
  "pending",
1596
1609
  "active",
1597
1610
  "completed",
1598
1611
  "failed"
1599
1612
  ]);
1600
- var threadEventPlanStepSchema = z13.object({
1601
- step: z13.string(),
1613
+ var threadEventPlanStepSchema = z14.object({
1614
+ step: z14.string(),
1602
1615
  status: threadEventPlanStepStatusSchema.optional()
1603
1616
  });
1604
1617
  var itemPresentationField = {
1605
1618
  presentation: threadEventItemPresentationSchema.optional()
1606
1619
  };
1607
- var threadEventWebSearchItemSchema = z13.object({
1608
- type: z13.literal("webSearch"),
1609
- id: z13.string(),
1610
- queries: z13.array(z13.string()).min(1),
1611
- resultText: z13.string().nullable(),
1620
+ var threadEventWebSearchItemSchema = z14.object({
1621
+ type: z14.literal("webSearch"),
1622
+ id: z14.string(),
1623
+ queries: z14.array(z14.string()).min(1),
1624
+ resultText: z14.string().nullable(),
1612
1625
  ...itemPresentationField,
1613
- parentToolCallId: z13.string().optional()
1614
- });
1615
- var threadEventWebFetchItemSchema = z13.object({
1616
- type: z13.literal("webFetch"),
1617
- id: z13.string(),
1618
- url: z13.string(),
1619
- prompt: z13.string().nullable(),
1620
- pattern: z13.string().nullable(),
1621
- resultText: z13.string().nullable(),
1626
+ parentToolCallId: z14.string().optional()
1627
+ });
1628
+ var threadEventWebFetchItemSchema = z14.object({
1629
+ type: z14.literal("webFetch"),
1630
+ id: z14.string(),
1631
+ url: z14.string(),
1632
+ prompt: z14.string().nullable(),
1633
+ pattern: z14.string().nullable(),
1634
+ resultText: z14.string().nullable(),
1622
1635
  ...itemPresentationField,
1623
- parentToolCallId: z13.string().optional()
1636
+ parentToolCallId: z14.string().optional()
1624
1637
  });
1625
- var threadEventImageViewItemSchema = z13.object({
1626
- type: z13.literal("imageView"),
1627
- id: z13.string(),
1628
- path: z13.string(),
1638
+ var threadEventImageViewItemSchema = z14.object({
1639
+ type: z14.literal("imageView"),
1640
+ id: z14.string(),
1641
+ path: z14.string(),
1629
1642
  ...itemPresentationField,
1630
- parentToolCallId: z13.string().optional()
1643
+ parentToolCallId: z14.string().optional()
1631
1644
  });
1632
- var threadEventFileReadItemSchema = z13.object({
1633
- type: z13.literal("fileRead"),
1634
- id: z13.string(),
1635
- path: z13.string(),
1636
- cmd: z13.string().optional(),
1645
+ var threadEventFileReadItemSchema = z14.object({
1646
+ type: z14.literal("fileRead"),
1647
+ id: z14.string(),
1648
+ path: z14.string(),
1649
+ cmd: z14.string().optional(),
1637
1650
  status: threadEventItemStatusSchema,
1638
1651
  ...itemPresentationField,
1639
- parentToolCallId: z13.string().optional()
1652
+ parentToolCallId: z14.string().optional()
1640
1653
  });
1641
- var threadEventSearchModeSchema = z13.enum(["content", "path", "list"]);
1642
- var threadEventSearchItemSchema = z13.object({
1643
- type: z13.literal("search"),
1644
- id: z13.string(),
1654
+ var threadEventSearchModeSchema = z14.enum(["content", "path", "list"]);
1655
+ var threadEventSearchItemSchema = z14.object({
1656
+ type: z14.literal("search"),
1657
+ id: z14.string(),
1645
1658
  mode: threadEventSearchModeSchema,
1646
- query: z13.string(),
1647
- path: z13.string().optional(),
1648
- cmd: z13.string().optional(),
1659
+ query: z14.string(),
1660
+ path: z14.string().optional(),
1661
+ cmd: z14.string().optional(),
1649
1662
  status: threadEventItemStatusSchema,
1650
1663
  ...itemPresentationField,
1651
- parentToolCallId: z13.string().optional()
1664
+ parentToolCallId: z14.string().optional()
1652
1665
  });
1653
- var threadEventDelegationItemSchema = z13.object({
1654
- type: z13.literal("delegation"),
1655
- id: z13.string(),
1656
- childRef: z13.string().min(1),
1657
- label: z13.string(),
1666
+ var threadEventDelegationItemSchema = z14.object({
1667
+ type: z14.literal("delegation"),
1668
+ id: z14.string(),
1669
+ childRef: z14.string().min(1),
1670
+ label: z14.string(),
1658
1671
  status: threadEventItemStatusSchema,
1659
- background: z13.boolean(),
1660
- summary: z13.string().optional(),
1672
+ background: z14.boolean(),
1673
+ summary: z14.string().optional(),
1661
1674
  ...itemPresentationField,
1662
- parentToolCallId: z13.string().optional()
1675
+ parentToolCallId: z14.string().optional()
1663
1676
  });
1664
- var threadEventPlanStepsItemSchema = z13.object({
1665
- type: z13.literal("planSteps"),
1666
- id: z13.string(),
1667
- steps: z13.array(threadEventPlanStepSchema),
1668
- explanation: z13.string().optional(),
1677
+ var threadEventPlanStepsItemSchema = z14.object({
1678
+ type: z14.literal("planSteps"),
1679
+ id: z14.string(),
1680
+ steps: z14.array(threadEventPlanStepSchema),
1681
+ explanation: z14.string().optional(),
1669
1682
  status: threadEventItemStatusSchema,
1670
1683
  ...itemPresentationField,
1671
- parentToolCallId: z13.string().optional()
1684
+ parentToolCallId: z14.string().optional()
1672
1685
  });
1673
- var threadEventExtensionItemSchema = z13.object({
1674
- type: z13.literal("extension"),
1675
- id: z13.string(),
1686
+ var threadEventExtensionItemSchema = z14.object({
1687
+ type: z14.literal("extension"),
1688
+ id: z14.string(),
1676
1689
  kind: extensionKindSchema,
1677
1690
  payload: jsonValueSchema,
1678
1691
  status: threadEventItemStatusSchema,
1679
1692
  presentation: threadEventItemPresentationSchema,
1680
- parentToolCallId: z13.string().optional()
1693
+ parentToolCallId: z14.string().optional()
1681
1694
  });
1682
- var threadEventTextTruncationSchema = z13.object({
1683
- originalLength: z13.number(),
1684
- retainedHeadLength: z13.number(),
1685
- retainedTailLength: z13.number(),
1686
- truncatedAt: z13.number()
1695
+ var threadEventTextTruncationSchema = z14.object({
1696
+ originalLength: z14.number(),
1697
+ retainedHeadLength: z14.number(),
1698
+ retainedTailLength: z14.number(),
1699
+ truncatedAt: z14.number()
1687
1700
  });
1688
- var threadEventItemTruncationSchema = z13.object({
1701
+ var threadEventItemTruncationSchema = z14.object({
1689
1702
  aggregatedOutput: threadEventTextTruncationSchema.optional(),
1690
1703
  result: threadEventTextTruncationSchema.optional(),
1691
1704
  resultText: threadEventTextTruncationSchema.optional()
1692
1705
  });
1693
- var threadEventUserContentSchema = z13.discriminatedUnion("type", [
1694
- z13.object({ type: z13.literal("text"), text: z13.string() }),
1695
- z13.object({ type: z13.literal("image"), url: z13.string() }),
1696
- z13.object({ type: z13.literal("localImage"), path: z13.string() }),
1697
- z13.object({ type: z13.literal("localFile"), path: z13.string() })
1706
+ var threadEventUserContentSchema = z14.discriminatedUnion("type", [
1707
+ z14.object({ type: z14.literal("text"), text: z14.string() }),
1708
+ z14.object({ type: z14.literal("image"), url: z14.string() }),
1709
+ z14.object({ type: z14.literal("localImage"), path: z14.string() }),
1710
+ z14.object({ type: z14.literal("localFile"), path: z14.string() })
1698
1711
  ]);
1699
- var threadEventTokenUsageBreakdownSchema = z13.object({
1700
- totalTokens: z13.number(),
1701
- inputTokens: z13.number(),
1702
- cachedInputTokens: z13.number(),
1703
- outputTokens: z13.number(),
1704
- reasoningOutputTokens: z13.number()
1705
- });
1706
- var threadEventContextWindowUsageSchema = z13.object({
1707
- usedTokens: z13.number().nullable(),
1708
- modelContextWindow: z13.number().nullable(),
1709
- estimated: z13.boolean()
1710
- });
1711
- var threadEventTokenUsageSchema = z13.object({
1712
+ var threadEventTokenUsageBreakdownSchema = z14.object({
1713
+ totalTokens: z14.number(),
1714
+ inputTokens: z14.number(),
1715
+ cachedInputTokens: z14.number(),
1716
+ outputTokens: z14.number(),
1717
+ reasoningOutputTokens: z14.number()
1718
+ });
1719
+ var threadEventContextWindowUsageSchema = z14.object({
1720
+ usedTokens: z14.number().nullable(),
1721
+ modelContextWindow: z14.number().nullable(),
1722
+ estimated: z14.boolean()
1723
+ });
1724
+ var threadEventTokenUsageSchema = z14.object({
1712
1725
  total: threadEventTokenUsageBreakdownSchema,
1713
1726
  last: threadEventTokenUsageBreakdownSchema,
1714
- modelContextWindow: z13.number().nullable()
1727
+ modelContextWindow: z14.number().nullable()
1715
1728
  });
1716
- var threadEventWarningCategorySchema = z13.enum([
1729
+ var threadEventWarningCategorySchema = z14.enum([
1717
1730
  "deprecation",
1718
1731
  "config",
1719
1732
  "general",
1720
1733
  "compaction-skipped"
1721
1734
  ]);
1722
- var providerRawEventSchema = z13.object({
1723
- jsonrpc: z13.literal("2.0"),
1724
- id: z13.union([z13.string(), z13.number()]).optional(),
1725
- method: z13.string(),
1735
+ var providerRawEventSchema = z14.object({
1736
+ jsonrpc: z14.literal("2.0"),
1737
+ id: z14.union([z14.string(), z14.number()]).optional(),
1738
+ method: z14.string(),
1726
1739
  params: jsonValueSchema.optional()
1727
1740
  });
1728
- var providerUnhandledEventSchema = z13.object({
1729
- type: z13.literal("provider/unhandled"),
1730
- threadId: z13.string(),
1731
- providerThreadId: z13.string(),
1732
- providerId: z13.string(),
1733
- rawType: z13.string(),
1741
+ var providerUnhandledEventSchema = z14.object({
1742
+ type: z14.literal("provider/unhandled"),
1743
+ threadId: z14.string(),
1744
+ providerThreadId: z14.string(),
1745
+ providerId: z14.string(),
1746
+ rawType: z14.string(),
1734
1747
  rawEvent: providerRawEventSchema,
1735
- parentToolCallId: z13.string().optional()
1736
- });
1737
- var toolCallProgressEventSchema = z13.object({
1738
- type: z13.literal("item/toolCall/progress"),
1739
- threadId: z13.string(),
1740
- providerThreadId: z13.string(),
1741
- itemId: z13.string(),
1742
- message: z13.string().optional(),
1743
- parentToolCallId: z13.string().optional()
1744
- });
1745
- var threadEventBackgroundTaskItemSchema = z13.object({
1746
- type: z13.literal("backgroundTask"),
1747
- id: z13.string(),
1748
- familyId: z13.string().optional(),
1749
- taskType: z13.string(),
1750
- description: z13.string(),
1748
+ parentToolCallId: z14.string().optional()
1749
+ });
1750
+ var toolCallProgressEventSchema = z14.object({
1751
+ type: z14.literal("item/toolCall/progress"),
1752
+ threadId: z14.string(),
1753
+ providerThreadId: z14.string(),
1754
+ itemId: z14.string(),
1755
+ message: z14.string().optional(),
1756
+ parentToolCallId: z14.string().optional()
1757
+ });
1758
+ var threadEventBackgroundTaskItemSchema = z14.object({
1759
+ type: z14.literal("backgroundTask"),
1760
+ id: z14.string(),
1761
+ familyId: z14.string().optional(),
1762
+ taskType: z14.string(),
1763
+ description: z14.string(),
1751
1764
  status: threadEventItemStatusSchema,
1752
1765
  taskStatus: backgroundTaskStatusSchema,
1753
- skipTranscript: z13.boolean(),
1754
- workflowName: z13.string().optional(),
1766
+ skipTranscript: z14.boolean(),
1767
+ workflowName: z14.string().optional(),
1755
1768
  workflow: workflowProgressSnapshotSchema.optional(),
1756
1769
  usage: backgroundTaskUsageSchema.optional(),
1757
- summary: z13.string().optional(),
1758
- error: z13.string().optional(),
1759
- outputFile: z13.string().optional(),
1770
+ summary: z14.string().optional(),
1771
+ error: z14.string().optional(),
1772
+ outputFile: z14.string().optional(),
1760
1773
  ...itemPresentationField,
1761
- parentToolCallId: z13.string().optional()
1774
+ parentToolCallId: z14.string().optional()
1762
1775
  });
1763
- var threadEventItemSchema = z13.discriminatedUnion("type", [
1764
- z13.object({
1765
- type: z13.literal("userMessage"),
1766
- id: z13.string(),
1767
- content: z13.array(threadEventUserContentSchema),
1776
+ var threadEventItemSchema = z14.discriminatedUnion("type", [
1777
+ z14.object({
1778
+ type: z14.literal("userMessage"),
1779
+ id: z14.string(),
1780
+ content: z14.array(threadEventUserContentSchema),
1768
1781
  clientRequestId: clientTurnRequestIdSchema.optional(),
1769
- parentToolCallId: z13.string().optional()
1782
+ parentToolCallId: z14.string().optional()
1770
1783
  }).strict(),
1771
- z13.object({
1772
- type: z13.literal("agentMessage"),
1773
- id: z13.string(),
1774
- text: z13.string(),
1784
+ z14.object({
1785
+ type: z14.literal("agentMessage"),
1786
+ id: z14.string(),
1787
+ text: z14.string(),
1775
1788
  ...itemPresentationField,
1776
- parentToolCallId: z13.string().optional()
1789
+ parentToolCallId: z14.string().optional()
1777
1790
  }),
1778
- z13.object({
1779
- type: z13.literal("commandExecution"),
1780
- id: z13.string(),
1781
- command: z13.string(),
1782
- cwd: z13.string(),
1791
+ z14.object({
1792
+ type: z14.literal("commandExecution"),
1793
+ id: z14.string(),
1794
+ command: z14.string(),
1795
+ cwd: z14.string(),
1783
1796
  status: threadEventItemStatusSchema,
1784
1797
  approvalStatus: threadEventItemApprovalStatusSchema,
1785
- aggregatedOutput: z13.string().optional(),
1786
- exitCode: z13.number().optional(),
1787
- durationMs: z13.number().optional(),
1798
+ aggregatedOutput: z14.string().optional(),
1799
+ exitCode: z14.number().optional(),
1800
+ durationMs: z14.number().optional(),
1788
1801
  truncation: threadEventItemTruncationSchema.optional(),
1789
1802
  ...itemPresentationField,
1790
- parentToolCallId: z13.string().optional()
1803
+ parentToolCallId: z14.string().optional()
1791
1804
  }),
1792
- z13.object({
1793
- type: z13.literal("fileChange"),
1794
- id: z13.string(),
1795
- changes: z13.array(threadEventFileChangeSchema),
1805
+ z14.object({
1806
+ type: z14.literal("fileChange"),
1807
+ id: z14.string(),
1808
+ changes: z14.array(threadEventFileChangeSchema),
1796
1809
  status: threadEventItemStatusSchema,
1797
1810
  approvalStatus: threadEventItemApprovalStatusSchema,
1798
1811
  ...itemPresentationField,
1799
- parentToolCallId: z13.string().optional()
1812
+ parentToolCallId: z14.string().optional()
1800
1813
  }),
1801
1814
  threadEventWebSearchItemSchema,
1802
1815
  threadEventWebFetchItemSchema,
1803
1816
  threadEventImageViewItemSchema,
1804
1817
  threadEventFileReadItemSchema,
1805
1818
  threadEventSearchItemSchema,
1806
- z13.object({
1807
- type: z13.literal("toolCall"),
1808
- id: z13.string(),
1809
- server: z13.string().optional(),
1810
- tool: z13.string(),
1811
- arguments: z13.record(z13.string(), z13.unknown()).optional(),
1819
+ z14.object({
1820
+ type: z14.literal("toolCall"),
1821
+ id: z14.string(),
1822
+ server: z14.string().optional(),
1823
+ tool: z14.string(),
1824
+ arguments: z14.record(z14.string(), z14.unknown()).optional(),
1812
1825
  status: threadEventItemStatusSchema,
1813
- result: z13.unknown().optional(),
1814
- error: z13.string().optional(),
1815
- durationMs: z13.number().optional(),
1826
+ result: z14.unknown().optional(),
1827
+ error: z14.string().optional(),
1828
+ durationMs: z14.number().optional(),
1816
1829
  truncation: threadEventItemTruncationSchema.optional(),
1817
1830
  ...itemPresentationField,
1818
- parentToolCallId: z13.string().optional()
1831
+ parentToolCallId: z14.string().optional()
1819
1832
  }),
1820
- z13.object({
1821
- type: z13.literal("reasoning"),
1822
- id: z13.string(),
1823
- summary: z13.array(z13.string()),
1824
- content: z13.array(z13.string()),
1833
+ z14.object({
1834
+ type: z14.literal("reasoning"),
1835
+ id: z14.string(),
1836
+ summary: z14.array(z14.string()),
1837
+ content: z14.array(z14.string()),
1825
1838
  ...itemPresentationField,
1826
- parentToolCallId: z13.string().optional()
1839
+ parentToolCallId: z14.string().optional()
1827
1840
  }),
1828
- z13.object({
1829
- type: z13.literal("plan"),
1830
- id: z13.string(),
1831
- text: z13.string(),
1841
+ z14.object({
1842
+ type: z14.literal("plan"),
1843
+ id: z14.string(),
1844
+ text: z14.string(),
1832
1845
  ...itemPresentationField,
1833
- parentToolCallId: z13.string().optional()
1846
+ parentToolCallId: z14.string().optional()
1834
1847
  }),
1835
1848
  threadEventPlanStepsItemSchema,
1836
- z13.object({
1837
- type: z13.literal("contextCompaction"),
1838
- id: z13.string(),
1849
+ z14.object({
1850
+ type: z14.literal("contextCompaction"),
1851
+ id: z14.string(),
1839
1852
  ...itemPresentationField,
1840
- parentToolCallId: z13.string().optional()
1853
+ parentToolCallId: z14.string().optional()
1841
1854
  }),
1842
1855
  threadEventBackgroundTaskItemSchema,
1843
1856
  threadEventDelegationItemSchema,
1844
1857
  threadEventExtensionItemSchema
1845
1858
  ]);
1846
- var unscopedProviderEventSchema = z13.discriminatedUnion("type", [
1847
- z13.object({
1848
- type: z13.literal("thread/started"),
1849
- threadId: z13.string()
1859
+ var unscopedProviderEventSchema = z14.discriminatedUnion("type", [
1860
+ z14.object({
1861
+ type: z14.literal("thread/started"),
1862
+ threadId: z14.string()
1850
1863
  }),
1851
- z13.object({
1852
- type: z13.literal("thread/identity"),
1853
- threadId: z13.string(),
1854
- providerThreadId: z13.string()
1864
+ z14.object({
1865
+ type: z14.literal("thread/identity"),
1866
+ threadId: z14.string(),
1867
+ providerThreadId: z14.string()
1855
1868
  }),
1856
- z13.object({
1857
- type: z13.literal("turn/started"),
1858
- threadId: z13.string(),
1859
- providerThreadId: z13.string(),
1860
- parentToolCallId: z13.string().optional()
1869
+ z14.object({
1870
+ type: z14.literal("turn/started"),
1871
+ threadId: z14.string(),
1872
+ providerThreadId: z14.string(),
1873
+ parentToolCallId: z14.string().optional()
1861
1874
  }),
1862
- z13.object({
1863
- type: z13.literal("turn/completed"),
1864
- threadId: z13.string(),
1865
- providerThreadId: z13.string().nullable(),
1875
+ z14.object({
1876
+ type: z14.literal("turn/completed"),
1877
+ threadId: z14.string(),
1878
+ providerThreadId: z14.string().nullable(),
1866
1879
  status: threadEventTurnStatusSchema,
1867
- error: z13.object({ message: z13.string() }).optional(),
1868
- providerCheckpointId: z13.string().min(1).optional()
1880
+ error: z14.object({ message: z14.string() }).optional(),
1881
+ providerCheckpointId: z14.string().min(1).optional()
1869
1882
  }),
1870
- z13.object({
1871
- type: z13.literal("turn/input/accepted"),
1872
- threadId: z13.string(),
1873
- providerThreadId: z13.string(),
1883
+ z14.object({
1884
+ type: z14.literal("turn/input/accepted"),
1885
+ threadId: z14.string(),
1886
+ providerThreadId: z14.string(),
1874
1887
  clientRequestId: clientTurnRequestIdSchema,
1875
1888
  scope: threadEventScopeSchema
1876
1889
  }).strict(),
1877
- z13.object({
1878
- type: z13.literal("thread/name/updated"),
1879
- threadId: z13.string(),
1880
- providerThreadId: z13.string(),
1881
- threadName: z13.string()
1890
+ z14.object({
1891
+ type: z14.literal("thread/name/updated"),
1892
+ threadId: z14.string(),
1893
+ providerThreadId: z14.string(),
1894
+ threadName: z14.string()
1882
1895
  }),
1883
- z13.object({
1884
- type: z13.literal("thread/compacted"),
1885
- threadId: z13.string(),
1886
- providerThreadId: z13.string()
1896
+ z14.object({
1897
+ type: z14.literal("thread/compacted"),
1898
+ threadId: z14.string(),
1899
+ providerThreadId: z14.string()
1887
1900
  }),
1888
- z13.object({
1889
- type: z13.literal("thread/context/cleared"),
1890
- threadId: z13.string(),
1891
- providerThreadId: z13.string()
1901
+ z14.object({
1902
+ type: z14.literal("thread/context/cleared"),
1903
+ threadId: z14.string(),
1904
+ providerThreadId: z14.string()
1892
1905
  }),
1893
- z13.object({
1894
- type: z13.literal("thread/goal/updated"),
1895
- threadId: z13.string(),
1896
- providerThreadId: z13.string(),
1897
- objective: z13.string(),
1906
+ z14.object({
1907
+ type: z14.literal("thread/goal/updated"),
1908
+ threadId: z14.string(),
1909
+ providerThreadId: z14.string(),
1910
+ objective: z14.string(),
1898
1911
  status: threadTimelineGoalStatusSchema,
1899
- tokenBudget: z13.number().nullable(),
1900
- tokensUsed: z13.number(),
1901
- timeUsedSeconds: z13.number()
1912
+ tokenBudget: z14.number().nullable(),
1913
+ tokensUsed: z14.number(),
1914
+ timeUsedSeconds: z14.number()
1902
1915
  }),
1903
- z13.object({
1904
- type: z13.literal("thread/goal/cleared"),
1905
- threadId: z13.string(),
1906
- providerThreadId: z13.string()
1916
+ z14.object({
1917
+ type: z14.literal("thread/goal/cleared"),
1918
+ threadId: z14.string(),
1919
+ providerThreadId: z14.string()
1907
1920
  }),
1908
- z13.object({
1909
- type: z13.literal("item/started"),
1910
- threadId: z13.string(),
1911
- providerThreadId: z13.string(),
1921
+ z14.object({
1922
+ type: z14.literal("item/started"),
1923
+ threadId: z14.string(),
1924
+ providerThreadId: z14.string(),
1912
1925
  item: threadEventItemSchema
1913
1926
  }),
1914
- z13.object({
1915
- type: z13.literal("item/completed"),
1916
- threadId: z13.string(),
1917
- providerThreadId: z13.string(),
1927
+ z14.object({
1928
+ type: z14.literal("item/completed"),
1929
+ threadId: z14.string(),
1930
+ providerThreadId: z14.string(),
1918
1931
  item: threadEventItemSchema
1919
1932
  }),
1920
- z13.object({
1921
- type: z13.literal("item/agentMessage/delta"),
1922
- threadId: z13.string(),
1923
- providerThreadId: z13.string(),
1924
- itemId: z13.string(),
1925
- delta: z13.string(),
1926
- parentToolCallId: z13.string().optional()
1933
+ z14.object({
1934
+ type: z14.literal("item/agentMessage/delta"),
1935
+ threadId: z14.string(),
1936
+ providerThreadId: z14.string(),
1937
+ itemId: z14.string(),
1938
+ delta: z14.string(),
1939
+ parentToolCallId: z14.string().optional()
1927
1940
  }),
1928
- z13.object({
1929
- type: z13.literal("item/commandExecution/outputDelta"),
1930
- threadId: z13.string(),
1931
- providerThreadId: z13.string(),
1932
- itemId: z13.string(),
1933
- delta: z13.string(),
1934
- reset: z13.boolean().optional(),
1935
- parentToolCallId: z13.string().optional()
1941
+ z14.object({
1942
+ type: z14.literal("item/commandExecution/outputDelta"),
1943
+ threadId: z14.string(),
1944
+ providerThreadId: z14.string(),
1945
+ itemId: z14.string(),
1946
+ delta: z14.string(),
1947
+ reset: z14.boolean().optional(),
1948
+ parentToolCallId: z14.string().optional()
1936
1949
  }),
1937
- z13.object({
1938
- type: z13.literal("item/fileChange/outputDelta"),
1939
- threadId: z13.string(),
1940
- providerThreadId: z13.string(),
1941
- itemId: z13.string(),
1942
- delta: z13.string(),
1943
- parentToolCallId: z13.string().optional()
1950
+ z14.object({
1951
+ type: z14.literal("item/fileChange/outputDelta"),
1952
+ threadId: z14.string(),
1953
+ providerThreadId: z14.string(),
1954
+ itemId: z14.string(),
1955
+ delta: z14.string(),
1956
+ parentToolCallId: z14.string().optional()
1944
1957
  }),
1945
- z13.object({
1946
- type: z13.literal("item/reasoning/summaryTextDelta"),
1947
- threadId: z13.string(),
1948
- providerThreadId: z13.string(),
1949
- itemId: z13.string(),
1950
- delta: z13.string(),
1951
- parentToolCallId: z13.string().optional()
1958
+ z14.object({
1959
+ type: z14.literal("item/reasoning/summaryTextDelta"),
1960
+ threadId: z14.string(),
1961
+ providerThreadId: z14.string(),
1962
+ itemId: z14.string(),
1963
+ delta: z14.string(),
1964
+ parentToolCallId: z14.string().optional()
1952
1965
  }),
1953
- z13.object({
1954
- type: z13.literal("item/reasoning/textDelta"),
1955
- threadId: z13.string(),
1956
- providerThreadId: z13.string(),
1957
- itemId: z13.string(),
1958
- delta: z13.string(),
1959
- parentToolCallId: z13.string().optional()
1966
+ z14.object({
1967
+ type: z14.literal("item/reasoning/textDelta"),
1968
+ threadId: z14.string(),
1969
+ providerThreadId: z14.string(),
1970
+ itemId: z14.string(),
1971
+ delta: z14.string(),
1972
+ parentToolCallId: z14.string().optional()
1960
1973
  }),
1961
- z13.object({
1962
- type: z13.literal("item/plan/delta"),
1963
- threadId: z13.string(),
1964
- providerThreadId: z13.string(),
1965
- itemId: z13.string(),
1966
- delta: z13.string(),
1967
- parentToolCallId: z13.string().optional()
1974
+ z14.object({
1975
+ type: z14.literal("item/plan/delta"),
1976
+ threadId: z14.string(),
1977
+ providerThreadId: z14.string(),
1978
+ itemId: z14.string(),
1979
+ delta: z14.string(),
1980
+ parentToolCallId: z14.string().optional()
1968
1981
  }),
1969
- z13.object({
1970
- type: z13.literal("item/mcpToolCall/progress"),
1971
- threadId: z13.string(),
1972
- providerThreadId: z13.string(),
1973
- itemId: z13.string(),
1974
- message: z13.string().optional(),
1975
- parentToolCallId: z13.string().optional()
1982
+ z14.object({
1983
+ type: z14.literal("item/mcpToolCall/progress"),
1984
+ threadId: z14.string(),
1985
+ providerThreadId: z14.string(),
1986
+ itemId: z14.string(),
1987
+ message: z14.string().optional(),
1988
+ parentToolCallId: z14.string().optional()
1976
1989
  }),
1977
1990
  toolCallProgressEventSchema,
1978
- z13.object({
1979
- type: z13.literal("item/backgroundTask/progress"),
1980
- threadId: z13.string(),
1981
- providerThreadId: z13.string(),
1991
+ z14.object({
1992
+ type: z14.literal("item/backgroundTask/progress"),
1993
+ threadId: z14.string(),
1994
+ providerThreadId: z14.string(),
1982
1995
  item: threadEventBackgroundTaskItemSchema
1983
1996
  }),
1984
- z13.object({
1985
- type: z13.literal("item/backgroundTask/completed"),
1986
- threadId: z13.string(),
1987
- providerThreadId: z13.string(),
1997
+ z14.object({
1998
+ type: z14.literal("item/backgroundTask/completed"),
1999
+ threadId: z14.string(),
2000
+ providerThreadId: z14.string(),
1988
2001
  item: threadEventBackgroundTaskItemSchema
1989
2002
  }),
1990
- z13.object({
1991
- type: z13.literal("item/delegation/progress"),
1992
- threadId: z13.string(),
1993
- providerThreadId: z13.string(),
2003
+ z14.object({
2004
+ type: z14.literal("item/delegation/progress"),
2005
+ threadId: z14.string(),
2006
+ providerThreadId: z14.string(),
1994
2007
  item: threadEventDelegationItemSchema
1995
2008
  }),
1996
- z13.object({
1997
- type: z13.literal("item/delegation/completed"),
1998
- threadId: z13.string(),
1999
- providerThreadId: z13.string(),
2009
+ z14.object({
2010
+ type: z14.literal("item/delegation/completed"),
2011
+ threadId: z14.string(),
2012
+ providerThreadId: z14.string(),
2000
2013
  item: threadEventDelegationItemSchema
2001
2014
  }),
2002
- z13.object({
2003
- type: z13.literal("thread/tokenUsage/updated"),
2004
- threadId: z13.string(),
2005
- providerThreadId: z13.string(),
2015
+ z14.object({
2016
+ type: z14.literal("thread/tokenUsage/updated"),
2017
+ threadId: z14.string(),
2018
+ providerThreadId: z14.string(),
2006
2019
  tokenUsage: threadEventTokenUsageSchema
2007
2020
  }),
2008
- z13.object({
2009
- type: z13.literal("thread/contextWindowUsage/updated"),
2010
- threadId: z13.string(),
2011
- providerThreadId: z13.string(),
2021
+ z14.object({
2022
+ type: z14.literal("thread/contextWindowUsage/updated"),
2023
+ threadId: z14.string(),
2024
+ providerThreadId: z14.string(),
2012
2025
  contextWindowUsage: threadEventContextWindowUsageSchema
2013
2026
  }),
2014
- z13.object({
2015
- type: z13.literal("turn/plan/updated"),
2016
- threadId: z13.string(),
2017
- providerThreadId: z13.string(),
2018
- plan: z13.array(threadEventPlanStepSchema),
2019
- explanation: z13.string().optional()
2027
+ z14.object({
2028
+ type: z14.literal("turn/plan/updated"),
2029
+ threadId: z14.string(),
2030
+ providerThreadId: z14.string(),
2031
+ plan: z14.array(threadEventPlanStepSchema),
2032
+ explanation: z14.string().optional()
2020
2033
  }),
2021
- z13.object({
2022
- type: z13.literal("turn/diff/updated"),
2023
- threadId: z13.string(),
2024
- providerThreadId: z13.string(),
2025
- diff: z13.string().optional()
2034
+ z14.object({
2035
+ type: z14.literal("turn/diff/updated"),
2036
+ threadId: z14.string(),
2037
+ providerThreadId: z14.string(),
2038
+ diff: z14.string().optional()
2026
2039
  }),
2027
- z13.object({
2028
- type: z13.literal("provider/error"),
2029
- threadId: z13.string(),
2030
- providerThreadId: z13.string(),
2031
- message: z13.string(),
2032
- detail: z13.string().optional(),
2033
- willRetry: z13.boolean().optional(),
2040
+ z14.object({
2041
+ type: z14.literal("provider/error"),
2042
+ threadId: z14.string(),
2043
+ providerThreadId: z14.string(),
2044
+ message: z14.string(),
2045
+ detail: z14.string().optional(),
2046
+ willRetry: z14.boolean().optional(),
2034
2047
  errorInfo: providerErrorInfoSchema.optional()
2035
2048
  }),
2036
- z13.object({
2037
- type: z13.literal("provider/rateLimits/updated"),
2038
- threadId: z13.string(),
2039
- providerThreadId: z13.string(),
2049
+ z14.object({
2050
+ type: z14.literal("provider/rateLimits/updated"),
2051
+ threadId: z14.string(),
2052
+ providerThreadId: z14.string(),
2040
2053
  rateLimits: providerRateLimitStateSchema
2041
2054
  }),
2042
- z13.object({
2043
- type: z13.literal("thread/extensionState/updated"),
2044
- threadId: z13.string(),
2045
- providerThreadId: z13.string(),
2055
+ z14.object({
2056
+ type: z14.literal("thread/extensionState/updated"),
2057
+ threadId: z14.string(),
2058
+ providerThreadId: z14.string(),
2046
2059
  kind: extensionKindSchema,
2047
2060
  payload: jsonValueSchema
2048
2061
  }),
2049
- z13.object({
2050
- type: z13.literal("provider/warning"),
2051
- threadId: z13.string(),
2052
- providerThreadId: z13.string(),
2062
+ z14.object({
2063
+ type: z14.literal("provider/warning"),
2064
+ threadId: z14.string(),
2065
+ providerThreadId: z14.string(),
2053
2066
  category: threadEventWarningCategorySchema,
2054
- summary: z13.string().optional(),
2055
- details: z13.string().optional()
2067
+ summary: z14.string().optional(),
2068
+ details: z14.string().optional()
2056
2069
  }),
2057
- z13.object({
2058
- type: z13.literal("provider/modelFallback"),
2059
- threadId: z13.string(),
2060
- providerThreadId: z13.string(),
2061
- originalModel: z13.string().min(1),
2062
- fallbackModel: z13.string().min(1),
2063
- reason: z13.enum(["refusal", "provider"]),
2064
- message: z13.string()
2070
+ z14.object({
2071
+ type: z14.literal("provider/modelFallback"),
2072
+ threadId: z14.string(),
2073
+ providerThreadId: z14.string(),
2074
+ originalModel: z14.string().min(1),
2075
+ fallbackModel: z14.string().min(1),
2076
+ reason: z14.enum(["refusal", "provider"]),
2077
+ message: z14.string()
2065
2078
  }),
2066
2079
  providerUnhandledEventSchema
2067
2080
  ]);
2068
- var scopedEventDataSchema = z13.object({
2081
+ var scopedEventDataSchema = z14.object({
2069
2082
  scope: threadEventScopeSchema
2070
2083
  });
2071
2084
  var providerEventSchema = unscopedProviderEventSchema.and(
@@ -2074,58 +2087,58 @@ var providerEventSchema = unscopedProviderEventSchema.and(
2074
2087
  var providerEventTypeValues = unscopedProviderEventSchema.options.map(
2075
2088
  (option) => option.shape.type.value
2076
2089
  );
2077
- var unscopedSystemEventSchema = z13.discriminatedUnion("type", [
2078
- z13.object({
2079
- type: z13.literal("client/thread/start"),
2080
- threadId: z13.string()
2090
+ var unscopedSystemEventSchema = z14.discriminatedUnion("type", [
2091
+ z14.object({
2092
+ type: z14.literal("client/thread/start"),
2093
+ threadId: z14.string()
2081
2094
  }).merge(clientTurnLifecycleEventDataSchema),
2082
- z13.object({
2083
- type: z13.literal("client/turn/requested"),
2084
- threadId: z13.string()
2095
+ z14.object({
2096
+ type: z14.literal("client/turn/requested"),
2097
+ threadId: z14.string()
2085
2098
  }).merge(turnRequestEventDataSchema),
2086
- z13.object({
2087
- type: z13.literal("client/turn/rejected"),
2088
- threadId: z13.string()
2099
+ z14.object({
2100
+ type: z14.literal("client/turn/rejected"),
2101
+ threadId: z14.string()
2089
2102
  }).merge(turnRequestRejectedEventDataSchema),
2090
- z13.object({
2091
- type: z13.literal("client/turn/start"),
2092
- threadId: z13.string()
2103
+ z14.object({
2104
+ type: z14.literal("client/turn/start"),
2105
+ threadId: z14.string()
2093
2106
  }).merge(clientTurnLifecycleEventDataSchema),
2094
- z13.object({
2095
- type: z13.literal("system/error"),
2096
- threadId: z13.string()
2107
+ z14.object({
2108
+ type: z14.literal("system/error"),
2109
+ threadId: z14.string()
2097
2110
  }).merge(systemErrorEventDataSchema),
2098
- z13.object({
2099
- type: z13.literal("system/manager/user_message"),
2100
- threadId: z13.string()
2111
+ z14.object({
2112
+ type: z14.literal("system/manager/user_message"),
2113
+ threadId: z14.string()
2101
2114
  }).merge(systemLegacyUserMessageEventDataSchema),
2102
- z13.object({
2103
- type: z13.literal("system/thread/interrupted"),
2104
- threadId: z13.string()
2115
+ z14.object({
2116
+ type: z14.literal("system/thread/interrupted"),
2117
+ threadId: z14.string()
2105
2118
  }).merge(systemThreadInterruptedEventDataSchema),
2106
- z13.object({
2107
- type: z13.literal("system/operation"),
2108
- threadId: z13.string()
2119
+ z14.object({
2120
+ type: z14.literal("system/operation"),
2121
+ threadId: z14.string()
2109
2122
  }).merge(systemOperationEventDataSchema),
2110
- z13.object({
2111
- type: z13.literal("system/interaction/lifecycle"),
2112
- threadId: z13.string()
2123
+ z14.object({
2124
+ type: z14.literal("system/interaction/lifecycle"),
2125
+ threadId: z14.string()
2113
2126
  }).merge(systemInteractionLifecycleEventDataSchema),
2114
- z13.object({
2115
- type: z13.literal("system/permissionGrant/lifecycle"),
2116
- threadId: z13.string()
2127
+ z14.object({
2128
+ type: z14.literal("system/permissionGrant/lifecycle"),
2129
+ threadId: z14.string()
2117
2130
  }).merge(systemPermissionGrantLifecycleEventDataSchema),
2118
- z13.object({
2119
- type: z13.literal("system/userQuestion/lifecycle"),
2120
- threadId: z13.string()
2131
+ z14.object({
2132
+ type: z14.literal("system/userQuestion/lifecycle"),
2133
+ threadId: z14.string()
2121
2134
  }).merge(systemUserQuestionLifecycleEventDataSchema),
2122
- z13.object({
2123
- type: z13.literal("system/thread-provisioning"),
2124
- threadId: z13.string()
2135
+ z14.object({
2136
+ type: z14.literal("system/thread-provisioning"),
2137
+ threadId: z14.string()
2125
2138
  }).merge(systemThreadProvisioningEventDataSchema),
2126
- z13.object({
2127
- type: z13.literal("system/provider-turn-watchdog"),
2128
- threadId: z13.string()
2139
+ z14.object({
2140
+ type: z14.literal("system/provider-turn-watchdog"),
2141
+ threadId: z14.string()
2129
2142
  }).merge(systemProviderTurnWatchdogEventDataSchema)
2130
2143
  ]);
2131
2144
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
@@ -2133,13 +2146,13 @@ var legacyClientRequestKey = ["clientRequest", "Sequence"].join("");
2133
2146
  function isEventPropertyBag(value) {
2134
2147
  return typeof value === "object" && value !== null && !Array.isArray(value);
2135
2148
  }
2136
- var rejectLegacyClientRequestSequenceSchema = z13.unknown().superRefine((value, ctx) => {
2149
+ var rejectLegacyClientRequestSequenceSchema = z14.unknown().superRefine((value, ctx) => {
2137
2150
  if (!isEventPropertyBag(value)) {
2138
2151
  return;
2139
2152
  }
2140
2153
  if (Object.hasOwn(value, legacyClientRequestKey)) {
2141
2154
  ctx.addIssue({
2142
- code: z13.ZodIssueCode.custom,
2155
+ code: z14.ZodIssueCode.custom,
2143
2156
  message: "legacy request sequence field is no longer accepted",
2144
2157
  path: [legacyClientRequestKey]
2145
2158
  });
@@ -2147,21 +2160,21 @@ var rejectLegacyClientRequestSequenceSchema = z13.unknown().superRefine((value,
2147
2160
  const item = value.item;
2148
2161
  if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
2149
2162
  ctx.addIssue({
2150
- code: z13.ZodIssueCode.custom,
2163
+ code: z14.ZodIssueCode.custom,
2151
2164
  message: "legacy user-message request sequence field is no longer accepted",
2152
2165
  path: ["item", legacyClientRequestKey]
2153
2166
  });
2154
2167
  }
2155
2168
  });
2156
2169
  var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
2157
- z13.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
2170
+ z14.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
2158
2171
  const result = validateThreadEventScope({
2159
2172
  type: event.type,
2160
2173
  scope: event.scope
2161
2174
  });
2162
2175
  if (!result.valid) {
2163
2176
  ctx.addIssue({
2164
- code: z13.ZodIssueCode.custom,
2177
+ code: z14.ZodIssueCode.custom,
2165
2178
  message: result.message ?? "Invalid thread event scope",
2166
2179
  path: ["scope"]
2167
2180
  });
@@ -2174,101 +2187,101 @@ var threadEventTypeValues = [
2174
2187
  ...systemEventTypeValues
2175
2188
  ];
2176
2189
  var threadEventTypeSet = new Set(threadEventTypeValues);
2177
- var threadEventTypeSchema = z13.string().refine(
2190
+ var threadEventTypeSchema = z14.string().refine(
2178
2191
  (value) => threadEventTypeSet.has(value),
2179
2192
  "Invalid thread event type"
2180
2193
  );
2181
2194
 
2182
2195
  // ../domain/src/provider-fork.ts
2183
- import { z as z14 } from "zod";
2196
+ import { z as z15 } from "zod";
2184
2197
  var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
2185
- var providerForkSchema = z14.enum(PROVIDER_FORK_VALUES);
2198
+ var providerForkSchema = z15.enum(PROVIDER_FORK_VALUES);
2186
2199
 
2187
2200
  // ../domain/src/provider-types.ts
2188
- import { z as z15 } from "zod";
2189
- var modelReasoningEffortSchema = z15.object({
2201
+ import { z as z16 } from "zod";
2202
+ var modelReasoningEffortSchema = z16.object({
2190
2203
  reasoningEffort: reasoningLevelSchema,
2191
- description: z15.string()
2192
- });
2193
- var availableModelSchema = z15.object({
2194
- id: z15.string(),
2195
- model: z15.string(),
2196
- displayName: z15.string(),
2197
- routeProviderId: z15.string().min(1).optional(),
2198
- description: z15.string(),
2199
- supportedReasoningEfforts: z15.array(modelReasoningEffortSchema),
2204
+ description: z16.string()
2205
+ });
2206
+ var availableModelSchema = z16.object({
2207
+ id: z16.string(),
2208
+ model: z16.string(),
2209
+ displayName: z16.string(),
2210
+ routeProviderId: z16.string().min(1).optional(),
2211
+ description: z16.string(),
2212
+ supportedReasoningEfforts: z16.array(modelReasoningEffortSchema),
2200
2213
  defaultReasoningEffort: reasoningLevelSchema,
2201
- isDefault: z15.boolean()
2202
- });
2203
- var providerModelCatalogScopeSchema = z15.enum(["host", "workspace"]);
2204
- var providerCapabilitiesSchema = z15.object({
2205
- supportsThreadArchive: z15.boolean(),
2206
- supportsThreadRename: z15.boolean(),
2207
- supportsServiceTier: z15.boolean(),
2208
- supportsNativeUserQuestion: z15.boolean(),
2209
- supportsFork: z15.boolean(),
2210
- supportsSessionRewind: z15.boolean(),
2211
- permissionModes: z15.array(permissionModeSchema).min(1),
2214
+ isDefault: z16.boolean()
2215
+ });
2216
+ var providerModelCatalogScopeSchema = z16.enum(["host", "workspace"]);
2217
+ var providerCapabilitiesSchema = z16.object({
2218
+ supportsThreadArchive: z16.boolean(),
2219
+ supportsThreadRename: z16.boolean(),
2220
+ supportsServiceTier: z16.boolean(),
2221
+ supportsNativeUserQuestion: z16.boolean(),
2222
+ supportsFork: z16.boolean(),
2223
+ supportsSessionRewind: z16.boolean(),
2224
+ permissionModes: z16.array(permissionModeSchema).min(1),
2212
2225
  modelCatalogScope: providerModelCatalogScopeSchema
2213
2226
  });
2214
- var providerComposerCommandSchema = z15.object({
2227
+ var providerComposerCommandSchema = z16.object({
2215
2228
  trigger: promptMentionCommandTriggerSchema,
2216
- name: z15.string().min(1).regex(/^[^\s/$]+$/u),
2217
- trailingText: z15.string().regex(/^\s*$/u)
2229
+ name: z16.string().min(1).regex(/^[^\s/$]+$/u),
2230
+ trailingText: z16.string().regex(/^\s*$/u)
2218
2231
  });
2219
- var providerComposerActionSchema = z15.discriminatedUnion("kind", [
2220
- z15.object({
2221
- kind: z15.literal("skills"),
2232
+ var providerComposerActionSchema = z16.discriminatedUnion("kind", [
2233
+ z16.object({
2234
+ kind: z16.literal("skills"),
2222
2235
  trigger: promptMentionCommandTriggerSchema
2223
2236
  }),
2224
- z15.object({
2225
- kind: z15.literal("plan"),
2237
+ z16.object({
2238
+ kind: z16.literal("plan"),
2226
2239
  command: providerComposerCommandSchema
2227
2240
  }),
2228
- z15.object({
2229
- kind: z15.literal("goal"),
2241
+ z16.object({
2242
+ kind: z16.literal("goal"),
2230
2243
  command: providerComposerCommandSchema
2231
2244
  })
2232
2245
  ]);
2233
- var providerStringsSchema = z15.object({
2234
- signInHint: z15.string().min(1),
2235
- expiredHint: z15.string().min(1),
2236
- installUrl: z15.string().min(1),
2237
- brandPrefix: z15.string().min(1).optional(),
2238
- planModeCopy: z15.string().min(1).optional(),
2239
- iconTint: z15.object({ light: z15.string().min(1), dark: z15.string().min(1) }).optional()
2240
- });
2241
- var providerOptionDescriptorSchema = z15.object({
2242
- id: z15.string().min(1),
2243
- label: z15.string().min(1),
2244
- description: z15.string().min(1).optional()
2245
- });
2246
- var providerExtensionKindInfoSchema = z15.object({
2247
- item: z15.boolean(),
2248
- state: z15.boolean()
2249
- });
2250
- var providerExtensionKindsSchema = z15.record(
2246
+ var providerStringsSchema = z16.object({
2247
+ signInHint: z16.string().min(1),
2248
+ expiredHint: z16.string().min(1),
2249
+ installUrl: z16.string().min(1),
2250
+ brandPrefix: z16.string().min(1).optional(),
2251
+ planModeCopy: z16.string().min(1).optional(),
2252
+ iconTint: z16.object({ light: z16.string().min(1), dark: z16.string().min(1) }).optional()
2253
+ });
2254
+ var providerOptionDescriptorSchema = z16.object({
2255
+ id: z16.string().min(1),
2256
+ label: z16.string().min(1),
2257
+ description: z16.string().min(1).optional()
2258
+ });
2259
+ var providerExtensionKindInfoSchema = z16.object({
2260
+ item: z16.boolean(),
2261
+ state: z16.boolean()
2262
+ });
2263
+ var providerExtensionKindsSchema = z16.record(
2251
2264
  extensionKindSchema,
2252
2265
  providerExtensionKindInfoSchema
2253
2266
  );
2254
- var providerInfoSchema = z15.object({
2255
- id: z15.string(),
2256
- pluginId: z15.string().min(1),
2257
- displayName: z15.string(),
2258
- family: z15.string().min(1).optional(),
2259
- icon: z15.object({ glyph: z15.string().min(1) }).optional(),
2260
- logoUrl: z15.string().min(1).nullable(),
2261
- maintenance: z15.object({
2262
- health: z15.boolean(),
2263
- usage: z15.boolean(),
2264
- installation: z15.boolean()
2267
+ var providerInfoSchema = z16.object({
2268
+ id: z16.string(),
2269
+ pluginId: z16.string().min(1),
2270
+ displayName: z16.string(),
2271
+ family: z16.string().min(1).optional(),
2272
+ icon: z16.object({ glyph: z16.string().min(1) }).optional(),
2273
+ logoUrl: z16.string().min(1).nullable(),
2274
+ maintenance: z16.object({
2275
+ health: z16.boolean(),
2276
+ usage: z16.boolean(),
2277
+ installation: z16.boolean()
2265
2278
  }),
2266
2279
  capabilities: providerCapabilitiesSchema,
2267
- composerActions: z15.array(providerComposerActionSchema),
2268
- available: z15.boolean(),
2280
+ composerActions: z16.array(providerComposerActionSchema),
2281
+ available: z16.boolean(),
2269
2282
  strings: providerStringsSchema.optional(),
2270
- serviceTiers: z15.array(providerOptionDescriptorSchema).optional(),
2271
- reasoningLevels: z15.array(providerOptionDescriptorSchema).optional(),
2283
+ serviceTiers: z16.array(providerOptionDescriptorSchema).optional(),
2284
+ reasoningLevels: z16.array(providerOptionDescriptorSchema).optional(),
2272
2285
  extensionKinds: providerExtensionKindsSchema.optional()
2273
2286
  });
2274
2287
  var providerRecoveryKindValues = [
@@ -2278,34 +2291,34 @@ var providerRecoveryKindValues = [
2278
2291
  "staleTurn",
2279
2292
  "rateLimited"
2280
2293
  ];
2281
- var providerRecoveryKindSchema = z15.enum(providerRecoveryKindValues);
2282
- var toolCallOutputItemSchema = z15.discriminatedUnion("type", [
2283
- z15.object({
2284
- type: z15.literal("inputText"),
2285
- text: z15.string()
2294
+ var providerRecoveryKindSchema = z16.enum(providerRecoveryKindValues);
2295
+ var toolCallOutputItemSchema = z16.discriminatedUnion("type", [
2296
+ z16.object({
2297
+ type: z16.literal("inputText"),
2298
+ text: z16.string()
2286
2299
  }),
2287
- z15.object({
2288
- type: z15.literal("inputImage"),
2289
- imageUrl: z15.string()
2300
+ z16.object({
2301
+ type: z16.literal("inputImage"),
2302
+ imageUrl: z16.string()
2290
2303
  })
2291
2304
  ]);
2292
- var toolCallRequestSchema = z15.object({
2293
- requestId: z15.union([z15.string().min(1), z15.number()]),
2294
- threadId: z15.string().min(1),
2295
- providerThreadId: z15.string().min(1),
2296
- turnId: z15.string().min(1),
2297
- callId: z15.string().min(1),
2298
- tool: z15.string().min(1),
2299
- arguments: z15.unknown().optional()
2300
- });
2301
- var toolCallResponseSchema = z15.object({
2302
- contentItems: z15.array(toolCallOutputItemSchema),
2303
- success: z15.boolean()
2304
- });
2305
- var dynamicToolSchema = z15.object({
2306
- name: z15.string(),
2307
- description: z15.string(),
2308
- inputSchema: z15.unknown(),
2305
+ var toolCallRequestSchema = z16.object({
2306
+ requestId: z16.union([z16.string().min(1), z16.number()]),
2307
+ threadId: z16.string().min(1),
2308
+ providerThreadId: z16.string().min(1),
2309
+ turnId: z16.string().min(1),
2310
+ callId: z16.string().min(1),
2311
+ tool: z16.string().min(1),
2312
+ arguments: z16.unknown().optional()
2313
+ });
2314
+ var toolCallResponseSchema = z16.object({
2315
+ contentItems: z16.array(toolCallOutputItemSchema),
2316
+ success: z16.boolean()
2317
+ });
2318
+ var dynamicToolSchema = z16.object({
2319
+ name: z16.string(),
2320
+ description: z16.string(),
2321
+ inputSchema: z16.unknown(),
2309
2322
  presentation: threadEventItemPresentationSchema.optional()
2310
2323
  });
2311
2324
 
@@ -2357,10 +2370,10 @@ function reasoningEffortsForLevels(levels) {
2357
2370
  }
2358
2371
 
2359
2372
  // ../provider-bridge-acp/src/launch-spec.ts
2360
- import { z as z16 } from "zod";
2361
- var acpNativeSkillRootsSchema = z16.object({
2362
- user: z16.array(providerNativeRootInputSchema).default([]),
2363
- project: z16.array(providerNativeRootInputSchema).default([])
2373
+ import { z as z17 } from "zod";
2374
+ var acpNativeSkillRootsSchema = z17.object({
2375
+ user: z17.array(providerNativeRootInputSchema).default([]),
2376
+ project: z17.array(providerNativeRootInputSchema).default([])
2364
2377
  }).strict().superRefine((roots, context) => {
2365
2378
  const normalized = providerNativeRootsSchema.safeParse(
2366
2379
  normalizeProviderNativeRoots(roots)
@@ -2376,16 +2389,16 @@ var acpNativeSkillRootsSchema = z16.object({
2376
2389
  });
2377
2390
  }
2378
2391
  });
2379
- var acpLaunchSpecSchema = z16.object({
2380
- displayName: z16.string().min(1),
2381
- command: z16.string().min(1),
2382
- args: z16.array(z16.string()),
2383
- env: z16.record(z16.string().min(1), z16.string()),
2384
- cwd: z16.string().min(1).optional(),
2385
- modelCli: z16.object({
2386
- listArgs: z16.array(z16.string()),
2387
- selectFlag: z16.string().min(1).optional(),
2388
- primaryModels: z16.array(z16.string())
2392
+ var acpLaunchSpecSchema = z17.object({
2393
+ displayName: z17.string().min(1),
2394
+ command: z17.string().min(1),
2395
+ args: z17.array(z17.string()),
2396
+ env: z17.record(z17.string().min(1), z17.string()),
2397
+ cwd: z17.string().min(1).optional(),
2398
+ modelCli: z17.object({
2399
+ listArgs: z17.array(z17.string()),
2400
+ selectFlag: z17.string().min(1).optional(),
2401
+ primaryModels: z17.array(z17.string())
2389
2402
  }).strict().transform(
2390
2403
  (modelCli) => modelCli.listArgs.length > 0 ? modelCli : void 0
2391
2404
  ).optional(),
@@ -2400,66 +2413,66 @@ var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
2400
2413
  var THREAD_DELTA_GRAMMAR_V3 = 3;
2401
2414
 
2402
2415
  // ../provider-bridge-protocol/src/handshake.ts
2403
- import { z as z17 } from "zod";
2404
- var bridgeGrammarVersionsSchema = z17.tuple([z17.number().int().positive(), z17.number().int().positive()]).refine(([min, max]) => min <= max, {
2416
+ import { z as z18 } from "zod";
2417
+ var bridgeGrammarVersionsSchema = z18.tuple([z18.number().int().positive(), z18.number().int().positive()]).refine(([min, max]) => min <= max, {
2405
2418
  message: "grammarVersions must be an ascending [min, max] range"
2406
2419
  });
2407
- var bridgeSteerModeSchema = z17.enum(["inject", "queue"]);
2408
- var bridgeCapabilitiesSchema = z17.object({
2409
- sessionRestore: z17.boolean().default(false),
2410
- threadArchive: z17.boolean().default(false),
2411
- threadRename: z17.boolean().default(false),
2412
- threadGoalClear: z17.boolean().default(false),
2420
+ var bridgeSteerModeSchema = z18.enum(["inject", "queue"]);
2421
+ var bridgeCapabilitiesSchema = z18.object({
2422
+ sessionRestore: z18.boolean().default(false),
2423
+ threadArchive: z18.boolean().default(false),
2424
+ threadRename: z18.boolean().default(false),
2425
+ threadGoalClear: z18.boolean().default(false),
2413
2426
  fork: providerForkSchema.default("none"),
2414
- approvalEnforcedBy: z17.enum(["runtime", "provider"]).default("runtime"),
2427
+ approvalEnforcedBy: z18.enum(["runtime", "provider"]).default("runtime"),
2415
2428
  grammarVersions: bridgeGrammarVersionsSchema.default([
2416
2429
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
2417
2430
  PROVIDER_BRIDGE_PROTOCOL_VERSION
2418
2431
  ]),
2419
2432
  steerMode: bridgeSteerModeSchema.default("queue"),
2420
- skills: z17.object({ configure: z17.boolean().default(false) }).default({ configure: false })
2433
+ skills: z18.object({ configure: z18.boolean().default(false) }).default({ configure: false })
2421
2434
  }).passthrough();
2422
- var initializeParamsSchema = z17.object({
2423
- protocolVersion: z17.number().int().positive(),
2424
- client: z17.object({ name: z17.string().min(1), version: z17.string().min(1) }),
2435
+ var initializeParamsSchema = z18.object({
2436
+ protocolVersion: z18.number().int().positive(),
2437
+ client: z18.object({ name: z18.string().min(1), version: z18.string().min(1) }),
2425
2438
  grammarVersions: bridgeGrammarVersionsSchema.default([
2426
2439
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
2427
2440
  PROVIDER_BRIDGE_PROTOCOL_VERSION
2428
2441
  ])
2429
2442
  }).passthrough();
2430
- var initializeResultSchema = z17.object({
2431
- protocolVersion: z17.number().int().positive(),
2432
- capabilities: z17.preprocess(
2443
+ var initializeResultSchema = z18.object({
2444
+ protocolVersion: z18.number().int().positive(),
2445
+ capabilities: z18.preprocess(
2433
2446
  (value) => value ?? {},
2434
2447
  bridgeCapabilitiesSchema
2435
2448
  )
2436
2449
  }).passthrough();
2437
2450
 
2438
2451
  // ../provider-bridge-protocol/src/execution-options.ts
2439
- import { z as z18 } from "zod";
2440
- var bridgeExecutionOptionsSchema = z18.object({
2441
- model: z18.string().min(1).optional(),
2452
+ import { z as z19 } from "zod";
2453
+ var bridgeExecutionOptionsSchema = z19.object({
2454
+ model: z19.string().min(1).optional(),
2442
2455
  serviceTier: serviceTierSchema.optional(),
2443
2456
  reasoningLevel: reasoningLevelSchema.optional(),
2444
2457
  promptMode: promptModeSchema.optional(),
2445
- instructions: z18.string().optional(),
2446
- envVars: z18.record(z18.string(), z18.string()).optional(),
2447
- providerOptions: z18.record(z18.string(), z18.unknown()).optional()
2458
+ instructions: z19.string().optional(),
2459
+ envVars: z19.record(z19.string(), z19.string()).optional(),
2460
+ providerOptions: z19.record(z19.string(), z19.unknown()).optional()
2448
2461
  }).and(runtimePermissionPolicySchema);
2449
2462
 
2450
2463
  // ../provider-bridge-protocol/src/provider-maintenance.ts
2451
- import { z as z19 } from "zod";
2452
- var providerMaintenanceParamsSchema = z19.object({
2453
- providerId: z19.string().min(1),
2454
- cwd: z19.string().min(1).optional(),
2455
- providerOptions: z19.record(z19.string(), z19.unknown()).optional()
2464
+ import { z as z20 } from "zod";
2465
+ var providerMaintenanceParamsSchema = z20.object({
2466
+ providerId: z20.string().min(1),
2467
+ cwd: z20.string().min(1).optional(),
2468
+ providerOptions: z20.record(z20.string(), z20.unknown()).optional()
2456
2469
  }).passthrough();
2457
- var providerInstallationRequirementSchema = z19.enum(["thread_rewind"]);
2470
+ var providerInstallationRequirementSchema = z20.enum(["thread_rewind"]);
2458
2471
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
2459
2472
  requirement: providerInstallationRequirementSchema.optional()
2460
2473
  });
2461
- var providerHealthSchema = z19.object({
2462
- status: z19.enum([
2474
+ var providerHealthSchema = z20.object({
2475
+ status: z20.enum([
2463
2476
  "ready",
2464
2477
  "not_installed",
2465
2478
  "unauthenticated",
@@ -2467,114 +2480,114 @@ var providerHealthSchema = z19.object({
2467
2480
  "unsupported_version",
2468
2481
  "unknown"
2469
2482
  ]),
2470
- statusMessage: z19.string().min(1).nullable(),
2471
- accountEmail: z19.string().nullable(),
2472
- planLabel: z19.string().min(1).nullable(),
2473
- installedVersion: z19.string().min(1).nullable(),
2474
- minimumSupportedVersion: z19.string().min(1).nullable(),
2475
- canInstall: z19.boolean(),
2476
- canUpdate: z19.boolean(),
2477
- loginCommand: z19.string().min(1).nullable()
2483
+ statusMessage: z20.string().min(1).nullable(),
2484
+ accountEmail: z20.string().nullable(),
2485
+ planLabel: z20.string().min(1).nullable(),
2486
+ installedVersion: z20.string().min(1).nullable(),
2487
+ minimumSupportedVersion: z20.string().min(1).nullable(),
2488
+ canInstall: z20.boolean(),
2489
+ canUpdate: z20.boolean(),
2490
+ loginCommand: z20.string().min(1).nullable()
2478
2491
  }).passthrough();
2479
- var providerUsageWindowSchema = z19.object({
2480
- label: z19.string().min(1),
2481
- usedPercent: z19.number().min(0).max(100),
2482
- resetsAt: z19.string().min(1).nullable(),
2483
- cost: z19.object({
2484
- usedUsdCents: z19.number().int().nonnegative(),
2485
- limitUsdCents: z19.number().int().positive()
2492
+ var providerUsageWindowSchema = z20.object({
2493
+ label: z20.string().min(1),
2494
+ usedPercent: z20.number().min(0).max(100),
2495
+ resetsAt: z20.string().min(1).nullable(),
2496
+ cost: z20.object({
2497
+ usedUsdCents: z20.number().int().nonnegative(),
2498
+ limitUsdCents: z20.number().int().positive()
2486
2499
  }).optional()
2487
2500
  }).passthrough();
2488
- var providerUsageSchema = z19.discriminatedUnion("status", [
2489
- z19.object({
2490
- status: z19.literal("ok"),
2491
- accountEmail: z19.string().email().nullable(),
2492
- planLabel: z19.string().min(1).nullable(),
2493
- windows: z19.array(providerUsageWindowSchema)
2501
+ var providerUsageSchema = z20.discriminatedUnion("status", [
2502
+ z20.object({
2503
+ status: z20.literal("ok"),
2504
+ accountEmail: z20.string().email().nullable(),
2505
+ planLabel: z20.string().min(1).nullable(),
2506
+ windows: z20.array(providerUsageWindowSchema)
2494
2507
  }).passthrough(),
2495
- z19.object({ status: z19.literal("not_installed") }).passthrough(),
2496
- z19.object({ status: z19.literal("unauthenticated") }).passthrough(),
2497
- z19.object({ status: z19.literal("expired") }).passthrough(),
2498
- z19.object({
2499
- status: z19.literal("error"),
2500
- message: z19.string().min(1),
2501
- planLabel: z19.string().min(1).nullable().default(null),
2502
- accountEmail: z19.string().nullable().default(null)
2508
+ z20.object({ status: z20.literal("not_installed") }).passthrough(),
2509
+ z20.object({ status: z20.literal("unauthenticated") }).passthrough(),
2510
+ z20.object({ status: z20.literal("expired") }).passthrough(),
2511
+ z20.object({
2512
+ status: z20.literal("error"),
2513
+ message: z20.string().min(1),
2514
+ planLabel: z20.string().min(1).nullable().default(null),
2515
+ accountEmail: z20.string().nullable().default(null)
2503
2516
  }).passthrough()
2504
2517
  ]);
2505
- var providerHealthResultSchema = z19.discriminatedUnion("supported", [
2506
- z19.object({ supported: z19.literal(false) }).passthrough(),
2507
- z19.object({
2508
- supported: z19.literal(true),
2518
+ var providerHealthResultSchema = z20.discriminatedUnion("supported", [
2519
+ z20.object({ supported: z20.literal(false) }).passthrough(),
2520
+ z20.object({
2521
+ supported: z20.literal(true),
2509
2522
  health: providerHealthSchema
2510
2523
  }).passthrough()
2511
2524
  ]);
2512
- var providerUsageResultSchema = z19.discriminatedUnion("supported", [
2513
- z19.object({ supported: z19.literal(false) }).passthrough(),
2514
- z19.object({
2515
- supported: z19.literal(true),
2525
+ var providerUsageResultSchema = z20.discriminatedUnion("supported", [
2526
+ z20.object({ supported: z20.literal(false) }).passthrough(),
2527
+ z20.object({
2528
+ supported: z20.literal(true),
2516
2529
  usage: providerUsageSchema
2517
2530
  }).passthrough()
2518
2531
  ]);
2519
- var providerInstallationActionKindSchema = z19.enum([
2532
+ var providerInstallationActionKindSchema = z20.enum([
2520
2533
  "install",
2521
2534
  "update"
2522
2535
  ]);
2523
- var providerInstallationActionSchema = z19.object({
2536
+ var providerInstallationActionSchema = z20.object({
2524
2537
  kind: providerInstallationActionKindSchema,
2525
- label: z19.enum(["Install", "Update"]),
2526
- command: z19.string().min(1)
2538
+ label: z20.enum(["Install", "Update"]),
2539
+ command: z20.string().min(1)
2527
2540
  }).passthrough();
2528
- var providerInstallationSourceSchema = z19.enum([
2541
+ var providerInstallationSourceSchema = z20.enum([
2529
2542
  "notInstalled",
2530
2543
  "npmGlobal",
2531
2544
  "external"
2532
2545
  ]);
2533
- var providerInstallationStatusSchema = z19.object({
2534
- executableName: z19.string().min(1),
2535
- executablePath: z19.string().min(1).nullable(),
2536
- installed: z19.boolean(),
2546
+ var providerInstallationStatusSchema = z20.object({
2547
+ executableName: z20.string().min(1),
2548
+ executablePath: z20.string().min(1).nullable(),
2549
+ installed: z20.boolean(),
2537
2550
  installSource: providerInstallationSourceSchema,
2538
- currentVersion: z19.string().min(1).nullable(),
2539
- latestVersion: z19.string().min(1).nullable(),
2540
- minimumSupportedVersion: z19.string().min(1).nullable(),
2541
- npmPackageName: z19.string().min(1).nullable(),
2542
- npmGlobalPackageVersion: z19.string().min(1).nullable(),
2551
+ currentVersion: z20.string().min(1).nullable(),
2552
+ latestVersion: z20.string().min(1).nullable(),
2553
+ minimumSupportedVersion: z20.string().min(1).nullable(),
2554
+ npmPackageName: z20.string().min(1).nullable(),
2555
+ npmGlobalPackageVersion: z20.string().min(1).nullable(),
2543
2556
  installAction: providerInstallationActionSchema.nullable(),
2544
- needsUpdate: z19.boolean(),
2545
- versionUnsupported: z19.boolean()
2557
+ needsUpdate: z20.boolean(),
2558
+ versionUnsupported: z20.boolean()
2546
2559
  }).passthrough();
2547
2560
  var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
2548
2561
  action: providerInstallationActionKindSchema
2549
2562
  });
2550
- var providerInstallationCommandSchema = z19.object({
2551
- command: z19.string().min(1),
2552
- args: z19.array(z19.string()).max(64),
2553
- displayCommand: z19.string().min(1)
2563
+ var providerInstallationCommandSchema = z20.object({
2564
+ command: z20.string().min(1),
2565
+ args: z20.array(z20.string()).max(64),
2566
+ displayCommand: z20.string().min(1)
2554
2567
  }).passthrough();
2555
- var providerInstallationVerificationSchema = z19.discriminatedUnion(
2568
+ var providerInstallationVerificationSchema = z20.discriminatedUnion(
2556
2569
  "kind",
2557
2570
  [
2558
- z19.object({ kind: z19.literal("installed") }).passthrough(),
2559
- z19.object({
2560
- kind: z19.literal("version_changed"),
2561
- previousVersion: z19.string().min(1)
2571
+ z20.object({ kind: z20.literal("installed") }).passthrough(),
2572
+ z20.object({
2573
+ kind: z20.literal("version_changed"),
2574
+ previousVersion: z20.string().min(1)
2562
2575
  }).passthrough(),
2563
- z19.object({
2564
- kind: z19.literal("version_at_least"),
2565
- version: z19.string().min(1)
2576
+ z20.object({
2577
+ kind: z20.literal("version_at_least"),
2578
+ version: z20.string().min(1)
2566
2579
  }).passthrough()
2567
2580
  ]
2568
2581
  );
2569
- var providerInstallationRunResultSchema = z19.discriminatedUnion(
2582
+ var providerInstallationRunResultSchema = z20.discriminatedUnion(
2570
2583
  "available",
2571
2584
  [
2572
- z19.object({
2573
- available: z19.literal(false),
2574
- message: z19.string().min(1)
2585
+ z20.object({
2586
+ available: z20.literal(false),
2587
+ message: z20.string().min(1)
2575
2588
  }).passthrough(),
2576
- z19.object({
2577
- available: z19.literal(true),
2589
+ z20.object({
2590
+ available: z20.literal(true),
2578
2591
  command: providerInstallationCommandSchema,
2579
2592
  verification: providerInstallationVerificationSchema
2580
2593
  }).passthrough()
@@ -2582,84 +2595,84 @@ var providerInstallationRunResultSchema = z19.discriminatedUnion(
2582
2595
  );
2583
2596
 
2584
2597
  // ../provider-bridge-protocol/src/requests.ts
2585
- import { z as z20 } from "zod";
2598
+ import { z as z21 } from "zod";
2586
2599
  var sessionConstructionFields = {
2587
- threadId: z20.string().min(1),
2588
- cwd: z20.string().min(1),
2600
+ threadId: z21.string().min(1),
2601
+ cwd: z21.string().min(1),
2589
2602
  options: bridgeExecutionOptionsSchema,
2590
- dynamicTools: z20.array(dynamicToolSchema).optional(),
2591
- disallowedTools: z20.array(z20.string().min(1)).optional(),
2603
+ dynamicTools: z21.array(dynamicToolSchema).optional(),
2604
+ disallowedTools: z21.array(z21.string().min(1)).optional(),
2592
2605
  instructionMode: instructionModeSchema
2593
2606
  };
2594
- var modelListParamsSchema = z20.object({ cwd: z20.string().min(1).optional() }).passthrough();
2595
- var threadStartParamsSchema = z20.object({
2607
+ var modelListParamsSchema = z21.object({ cwd: z21.string().min(1).optional() }).passthrough();
2608
+ var threadStartParamsSchema = z21.object({
2596
2609
  ...sessionConstructionFields,
2597
- input: z20.array(promptInputSchema).optional()
2610
+ input: z21.array(promptInputSchema).optional()
2598
2611
  }).passthrough();
2599
- var threadResumeParamsSchema = z20.object({
2612
+ var threadResumeParamsSchema = z21.object({
2600
2613
  ...sessionConstructionFields,
2601
- providerThreadId: z20.string().min(1)
2614
+ providerThreadId: z21.string().min(1)
2602
2615
  }).passthrough();
2603
- var threadForkParamsSchema = z20.object({
2616
+ var threadForkParamsSchema = z21.object({
2604
2617
  ...sessionConstructionFields,
2605
- sourceProviderThreadId: z20.string().min(1),
2606
- sourceProviderCheckpointId: z20.string().min(1).optional()
2618
+ sourceProviderThreadId: z21.string().min(1),
2619
+ sourceProviderCheckpointId: z21.string().min(1).optional()
2607
2620
  }).passthrough();
2608
- var threadStopParamsSchema = z20.object({
2609
- threadId: z20.string().min(1),
2610
- providerThreadId: z20.string().min(1),
2611
- intent: z20.enum(["interrupt", "release"]),
2612
- activeTurnId: z20.string().min(1).nullable()
2621
+ var threadStopParamsSchema = z21.object({
2622
+ threadId: z21.string().min(1),
2623
+ providerThreadId: z21.string().min(1),
2624
+ intent: z21.enum(["interrupt", "release"]),
2625
+ activeTurnId: z21.string().min(1).nullable()
2613
2626
  }).passthrough();
2614
- var threadRefParams = z20.object({
2615
- threadId: z20.string().min(1),
2616
- providerThreadId: z20.string().min(1)
2627
+ var threadRefParams = z21.object({
2628
+ threadId: z21.string().min(1),
2629
+ providerThreadId: z21.string().min(1)
2617
2630
  }).passthrough();
2618
2631
  var threadDiscardParamsSchema = threadRefParams;
2619
- var threadNameSetParamsSchema = z20.object({
2620
- threadId: z20.string().min(1),
2621
- providerThreadId: z20.string().min(1),
2622
- title: z20.string().min(1)
2632
+ var threadNameSetParamsSchema = z21.object({
2633
+ threadId: z21.string().min(1),
2634
+ providerThreadId: z21.string().min(1),
2635
+ title: z21.string().min(1)
2623
2636
  }).passthrough();
2624
2637
  var turnInputFields = {
2625
- threadId: z20.string().min(1),
2626
- providerThreadId: z20.string().min(1),
2627
- input: z20.array(promptInputSchema),
2638
+ threadId: z21.string().min(1),
2639
+ providerThreadId: z21.string().min(1),
2640
+ input: z21.array(promptInputSchema),
2628
2641
  clientRequestId: clientTurnRequestIdSchema,
2629
2642
  options: bridgeExecutionOptionsSchema
2630
2643
  };
2631
- var turnStartParamsSchema = z20.object(turnInputFields).passthrough();
2632
- var turnSteerParamsSchema = z20.object({
2644
+ var turnStartParamsSchema = z21.object(turnInputFields).passthrough();
2645
+ var turnSteerParamsSchema = z21.object({
2633
2646
  ...turnInputFields,
2634
- expectedTurnId: z20.string().min(1)
2647
+ expectedTurnId: z21.string().min(1)
2635
2648
  }).passthrough();
2636
- var skillsConfigureRootSchema = z20.object({
2637
- id: z20.string().min(1),
2638
- path: z20.string().min(1),
2639
- skills: z20.array(
2640
- z20.object({
2641
- name: z20.string().min(1),
2642
- description: z20.string()
2649
+ var skillsConfigureRootSchema = z21.object({
2650
+ id: z21.string().min(1),
2651
+ path: z21.string().min(1),
2652
+ skills: z21.array(
2653
+ z21.object({
2654
+ name: z21.string().min(1),
2655
+ description: z21.string()
2643
2656
  }).passthrough()
2644
2657
  )
2645
2658
  }).passthrough();
2646
- var skillsConfigureParamsSchema = z20.object({
2647
- roots: z20.array(skillsConfigureRootSchema)
2659
+ var skillsConfigureParamsSchema = z21.object({
2660
+ roots: z21.array(skillsConfigureRootSchema)
2648
2661
  }).passthrough();
2649
- var threadIdentityResultSchema = z20.object({
2650
- providerThreadId: z20.string().min(1),
2651
- sessionRestorable: z20.boolean().optional()
2662
+ var threadIdentityResultSchema = z21.object({
2663
+ providerThreadId: z21.string().min(1),
2664
+ sessionRestorable: z21.boolean().optional()
2652
2665
  }).passthrough();
2653
- var modelListResultSchema = z20.object({
2654
- models: z20.array(availableModelSchema),
2655
- selectedOnlyModels: z20.array(availableModelSchema).default([])
2666
+ var modelListResultSchema = z21.object({
2667
+ models: z21.array(availableModelSchema),
2668
+ selectedOnlyModels: z21.array(availableModelSchema).default([])
2656
2669
  }).passthrough();
2657
2670
 
2658
2671
  // ../provider-bridge-protocol/src/notifications.ts
2659
- import { z as z22 } from "zod";
2672
+ import { z as z23 } from "zod";
2660
2673
 
2661
2674
  // ../provider-bridge-protocol/src/errors.ts
2662
- import { z as z21 } from "zod";
2675
+ import { z as z22 } from "zod";
2663
2676
  var BRIDGE_JSON_RPC_ERRORS = {
2664
2677
  INVALID_PARAMS: -32602,
2665
2678
  METHOD_NOT_FOUND: -32601,
@@ -2668,12 +2681,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
2668
2681
  SESSION_NOT_RESTORABLE: -32002,
2669
2682
  FORK_CHECKPOINT_UNSUPPORTED: -32003
2670
2683
  };
2671
- var providerRecoveryHintSchema = z21.object({
2684
+ var providerRecoveryHintSchema = z22.object({
2672
2685
  kind: providerRecoveryKindSchema,
2673
- message: z21.string().min(1),
2674
- retryable: z21.boolean()
2686
+ message: z22.string().min(1),
2687
+ retryable: z22.boolean()
2675
2688
  });
2676
- var bridgeErrorDataSchema = z21.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
2689
+ var bridgeErrorDataSchema = z22.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
2677
2690
 
2678
2691
  // ../provider-bridge-protocol/src/notifications.ts
2679
2692
  var BRIDGE_NOTIFICATION_METHODS = {
@@ -2683,172 +2696,172 @@ var BRIDGE_NOTIFICATION_METHODS = {
2683
2696
  providerRecovery: "provider/recovery",
2684
2697
  error: "error"
2685
2698
  };
2686
- var threadIdentityNotificationSchema = z22.object({
2687
- threadId: z22.string().min(1),
2688
- providerThreadId: z22.string().min(1),
2689
- sessionRestorable: z22.boolean().optional()
2699
+ var threadIdentityNotificationSchema = z23.object({
2700
+ threadId: z23.string().min(1),
2701
+ providerThreadId: z23.string().min(1),
2702
+ sessionRestorable: z23.boolean().optional()
2690
2703
  }).passthrough();
2691
- var sessionReplacedNotificationSchema = z22.object({
2692
- threadId: z22.string().min(1),
2693
- providerThreadId: z22.string().min(1).nullable(),
2694
- reason: z22.string().min(1),
2695
- contextLost: z22.boolean().default(false)
2704
+ var sessionReplacedNotificationSchema = z23.object({
2705
+ threadId: z23.string().min(1),
2706
+ providerThreadId: z23.string().min(1).nullable(),
2707
+ reason: z23.string().min(1),
2708
+ contextLost: z23.boolean().default(false)
2696
2709
  }).passthrough();
2697
- var providerRawNotificationSchema = z22.object({
2698
- threadId: z22.string().min(1).optional(),
2699
- coverage: z22.enum(["noise", "unknown"]),
2700
- payload: z22.unknown()
2710
+ var providerRawNotificationSchema = z23.object({
2711
+ threadId: z23.string().min(1).optional(),
2712
+ coverage: z23.enum(["noise", "unknown"]),
2713
+ payload: z23.unknown()
2701
2714
  }).passthrough();
2702
- var providerRecoveryNotificationSchema = z22.object({
2703
- threadId: z22.string().min(1).optional(),
2715
+ var providerRecoveryNotificationSchema = z23.object({
2716
+ threadId: z23.string().min(1).optional(),
2704
2717
  ...providerRecoveryHintSchema.shape
2705
2718
  }).passthrough();
2706
- var errorNotificationSchema = z22.object({
2707
- threadId: z22.string().min(1).optional(),
2708
- message: z22.string().min(1)
2719
+ var errorNotificationSchema = z23.object({
2720
+ threadId: z23.string().min(1).optional(),
2721
+ message: z23.string().min(1)
2709
2722
  }).passthrough();
2710
2723
 
2711
2724
  // ../provider-bridge-protocol/src/bridge-requests.ts
2712
- import { z as z23 } from "zod";
2725
+ import { z as z24 } from "zod";
2713
2726
  var BRIDGE_INBOUND_REQUEST_METHODS = {
2714
2727
  toolCall: "item/tool/call",
2715
2728
  interactionRequest: "interaction/request"
2716
2729
  };
2717
- var toolCallRequestParamsSchema = z23.object({
2718
- providerThreadId: z23.string().min(1),
2719
- threadId: z23.string().min(1).optional(),
2720
- turnId: z23.union([z23.string().min(1), z23.null()]),
2721
- callId: z23.string().min(1),
2722
- tool: z23.string().min(1),
2723
- arguments: z23.unknown()
2730
+ var toolCallRequestParamsSchema = z24.object({
2731
+ providerThreadId: z24.string().min(1),
2732
+ threadId: z24.string().min(1).optional(),
2733
+ turnId: z24.union([z24.string().min(1), z24.null()]),
2734
+ callId: z24.string().min(1),
2735
+ tool: z24.string().min(1),
2736
+ arguments: z24.unknown()
2724
2737
  }).passthrough();
2725
- var toolCallResultSchema = z23.object({
2726
- success: z23.boolean(),
2727
- contentItems: z23.array(
2728
- z23.discriminatedUnion("type", [
2729
- z23.object({ type: z23.literal("inputText"), text: z23.string() }),
2730
- z23.object({
2731
- type: z23.literal("inputImage"),
2732
- imageUrl: z23.string().min(1)
2738
+ var toolCallResultSchema = z24.object({
2739
+ success: z24.boolean(),
2740
+ contentItems: z24.array(
2741
+ z24.discriminatedUnion("type", [
2742
+ z24.object({ type: z24.literal("inputText"), text: z24.string() }),
2743
+ z24.object({
2744
+ type: z24.literal("inputImage"),
2745
+ imageUrl: z24.string().min(1)
2733
2746
  })
2734
2747
  ])
2735
2748
  )
2736
2749
  }).passthrough();
2737
- var interactionRequestParamsSchema = z23.object({
2738
- providerThreadId: z23.string().min(1),
2739
- threadId: z23.string().min(1).optional(),
2740
- turnId: z23.union([z23.string().min(1), z23.null()]),
2750
+ var interactionRequestParamsSchema = z24.object({
2751
+ providerThreadId: z24.string().min(1),
2752
+ threadId: z24.string().min(1).optional(),
2753
+ turnId: z24.union([z24.string().min(1), z24.null()]),
2741
2754
  payload: pendingInteractionPayloadSchema,
2742
- providerNativeIds: z23.boolean().optional()
2755
+ providerNativeIds: z24.boolean().optional()
2743
2756
  }).passthrough();
2744
2757
 
2745
2758
  // ../provider-bridge-protocol/src/thread-delta.ts
2746
- import { z as z24 } from "zod";
2759
+ import { z as z25 } from "zod";
2747
2760
  var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
2748
2761
  var deltaPresentationSchema = threadEventItemPresentationSchema;
2749
2762
  var THREAD_DELTA_KEY_SEPARATOR = "";
2750
- var deltaKeyPartSchema = z24.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
2763
+ var deltaKeyPartSchema = z25.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
2751
2764
  message: "provider keys must not contain the internal key separator (\\u001f)"
2752
2765
  });
2753
- var deltaItemKeySchema = z24.object({
2766
+ var deltaItemKeySchema = z25.object({
2754
2767
  providerItemId: deltaKeyPartSchema.optional(),
2755
2768
  channel: deltaKeyPartSchema.optional(),
2756
2769
  parentRef: deltaKeyPartSchema.optional()
2757
2770
  });
2758
2771
  var providerTurnIdSchema = deltaKeyPartSchema;
2759
- var deltaFileChangeSchema = z24.object({
2760
- path: z24.string(),
2761
- kind: z24.enum(["add", "update", "delete"]),
2762
- movePath: z24.string().optional(),
2763
- diff: z24.string().optional(),
2764
- oldText: z24.string().optional(),
2765
- newText: z24.string().optional()
2766
- });
2767
- var deltaBackgroundTaskShapeSchema = z24.object({
2768
- type: z24.literal("backgroundTask"),
2769
- familyId: z24.string().min(1),
2770
- taskType: z24.string(),
2771
- description: z24.string(),
2772
+ var deltaFileChangeSchema = z25.object({
2773
+ path: z25.string(),
2774
+ kind: z25.enum(["add", "update", "delete"]),
2775
+ movePath: z25.string().optional(),
2776
+ diff: z25.string().optional(),
2777
+ oldText: z25.string().optional(),
2778
+ newText: z25.string().optional()
2779
+ });
2780
+ var deltaBackgroundTaskShapeSchema = z25.object({
2781
+ type: z25.literal("backgroundTask"),
2782
+ familyId: z25.string().min(1),
2783
+ taskType: z25.string(),
2784
+ description: z25.string(),
2772
2785
  status: threadEventItemStatusSchema,
2773
2786
  taskStatus: backgroundTaskStatusSchema,
2774
- skipTranscript: z24.boolean(),
2775
- workflowName: z24.string().optional(),
2787
+ skipTranscript: z25.boolean(),
2788
+ workflowName: z25.string().optional(),
2776
2789
  workflow: workflowProgressSnapshotSchema.optional(),
2777
2790
  usage: backgroundTaskUsageSchema.optional(),
2778
- summary: z24.string().optional(),
2779
- error: z24.string().optional(),
2780
- outputFile: z24.string().optional()
2791
+ summary: z25.string().optional(),
2792
+ error: z25.string().optional(),
2793
+ outputFile: z25.string().optional()
2781
2794
  });
2782
- var deltaFileReadShapeSchema = z24.object({
2783
- type: z24.literal("fileRead"),
2784
- path: z24.string(),
2785
- cmd: z24.string().optional()
2795
+ var deltaFileReadShapeSchema = z25.object({
2796
+ type: z25.literal("fileRead"),
2797
+ path: z25.string(),
2798
+ cmd: z25.string().optional()
2786
2799
  });
2787
- var deltaSearchShapeSchema = z24.object({
2788
- type: z24.literal("search"),
2800
+ var deltaSearchShapeSchema = z25.object({
2801
+ type: z25.literal("search"),
2789
2802
  mode: threadEventSearchModeSchema,
2790
- query: z24.string(),
2791
- path: z24.string().optional(),
2792
- cmd: z24.string().optional()
2803
+ query: z25.string(),
2804
+ path: z25.string().optional(),
2805
+ cmd: z25.string().optional()
2793
2806
  });
2794
- var deltaDelegationShapeSchema = z24.object({
2795
- type: z24.literal("delegation"),
2807
+ var deltaDelegationShapeSchema = z25.object({
2808
+ type: z25.literal("delegation"),
2796
2809
  childRef: deltaKeyPartSchema,
2797
- label: z24.string(),
2798
- background: z24.boolean(),
2799
- summary: z24.string().optional()
2810
+ label: z25.string(),
2811
+ background: z25.boolean(),
2812
+ summary: z25.string().optional()
2800
2813
  });
2801
- var deltaPlanStepsShapeSchema = z24.object({
2802
- type: z24.literal("planSteps"),
2803
- steps: z24.array(threadEventPlanStepSchema),
2804
- explanation: z24.string().optional()
2814
+ var deltaPlanStepsShapeSchema = z25.object({
2815
+ type: z25.literal("planSteps"),
2816
+ steps: z25.array(threadEventPlanStepSchema),
2817
+ explanation: z25.string().optional()
2805
2818
  });
2806
- var deltaExtensionShapeSchema = z24.object({
2807
- type: z24.literal("extension"),
2819
+ var deltaExtensionShapeSchema = z25.object({
2820
+ type: z25.literal("extension"),
2808
2821
  kind: extensionKindSchema,
2809
2822
  payload: jsonValueSchema
2810
2823
  });
2811
- var deltaItemShapeSchema = z24.discriminatedUnion("type", [
2812
- z24.object({
2813
- type: z24.literal("command"),
2814
- command: z24.string(),
2815
- cwd: z24.string(),
2816
- aggregatedOutput: z24.string().optional(),
2817
- exitCode: z24.number().optional(),
2818
- durationMs: z24.number().optional()
2824
+ var deltaItemShapeSchema = z25.discriminatedUnion("type", [
2825
+ z25.object({
2826
+ type: z25.literal("command"),
2827
+ command: z25.string(),
2828
+ cwd: z25.string(),
2829
+ aggregatedOutput: z25.string().optional(),
2830
+ exitCode: z25.number().optional(),
2831
+ durationMs: z25.number().optional()
2819
2832
  }),
2820
- z24.object({
2821
- type: z24.literal("fileChange"),
2822
- changes: z24.array(deltaFileChangeSchema)
2833
+ z25.object({
2834
+ type: z25.literal("fileChange"),
2835
+ changes: z25.array(deltaFileChangeSchema)
2823
2836
  }),
2824
- z24.object({
2825
- type: z24.literal("tool"),
2826
- tool: z24.string(),
2827
- server: z24.string().optional(),
2828
- args: z24.unknown().optional(),
2829
- result: z24.unknown().optional(),
2830
- error: z24.string().optional(),
2831
- durationMs: z24.number().optional()
2837
+ z25.object({
2838
+ type: z25.literal("tool"),
2839
+ tool: z25.string(),
2840
+ server: z25.string().optional(),
2841
+ args: z25.unknown().optional(),
2842
+ result: z25.unknown().optional(),
2843
+ error: z25.string().optional(),
2844
+ durationMs: z25.number().optional()
2832
2845
  }),
2833
- z24.object({ type: z24.literal("compaction") }),
2834
- z24.object({ type: z24.literal("agentMessage"), text: z24.string() }),
2835
- z24.object({
2836
- type: z24.literal("reasoning"),
2837
- summary: z24.array(z24.string()),
2838
- content: z24.array(z24.string())
2846
+ z25.object({ type: z25.literal("compaction") }),
2847
+ z25.object({ type: z25.literal("agentMessage"), text: z25.string() }),
2848
+ z25.object({
2849
+ type: z25.literal("reasoning"),
2850
+ summary: z25.array(z25.string()),
2851
+ content: z25.array(z25.string())
2839
2852
  }),
2840
- z24.object({ type: z24.literal("plan"), text: z24.string() }),
2841
- z24.object({
2842
- type: z24.literal("webSearch"),
2843
- queries: z24.array(z24.string()).min(1)
2853
+ z25.object({ type: z25.literal("plan"), text: z25.string() }),
2854
+ z25.object({
2855
+ type: z25.literal("webSearch"),
2856
+ queries: z25.array(z25.string()).min(1)
2844
2857
  }),
2845
- z24.object({
2846
- type: z24.literal("webFetch"),
2847
- url: z24.string(),
2848
- prompt: z24.string().nullable().optional(),
2849
- pattern: z24.string().nullable()
2858
+ z25.object({
2859
+ type: z25.literal("webFetch"),
2860
+ url: z25.string(),
2861
+ prompt: z25.string().nullable().optional(),
2862
+ pattern: z25.string().nullable()
2850
2863
  }),
2851
- z24.object({ type: z24.literal("imageView"), path: z24.string() }),
2864
+ z25.object({ type: z25.literal("imageView"), path: z25.string() }),
2852
2865
  deltaBackgroundTaskShapeSchema,
2853
2866
  deltaFileReadShapeSchema,
2854
2867
  deltaSearchShapeSchema,
@@ -2856,22 +2869,22 @@ var deltaItemShapeSchema = z24.discriminatedUnion("type", [
2856
2869
  deltaPlanStepsShapeSchema,
2857
2870
  deltaExtensionShapeSchema
2858
2871
  ]);
2859
- var deltaProgressSnapshotSchema = z24.discriminatedUnion("type", [
2872
+ var deltaProgressSnapshotSchema = z25.discriminatedUnion("type", [
2860
2873
  deltaBackgroundTaskShapeSchema,
2861
2874
  deltaDelegationShapeSchema
2862
2875
  ]);
2863
- var deltaTextChannelSchema = z24.enum([
2876
+ var deltaTextChannelSchema = z25.enum([
2864
2877
  "agentMessage",
2865
2878
  "reasoningSummary",
2866
2879
  "reasoningText",
2867
2880
  "plan"
2868
2881
  ]);
2869
- var deltaOutputChannelSchema = z24.enum(["command", "fileChange"]);
2870
- var deltaErrorSchema = z24.object({ message: z24.string() });
2871
- var deltaAttachSchema = z24.enum(["open", "currentOrLast"]);
2872
- var deltaNoTurnFallbackSchema = z24.object({
2882
+ var deltaOutputChannelSchema = z25.enum(["command", "fileChange"]);
2883
+ var deltaErrorSchema = z25.object({ message: z25.string() });
2884
+ var deltaAttachSchema = z25.enum(["open", "currentOrLast"]);
2885
+ var deltaNoTurnFallbackSchema = z25.object({
2873
2886
  raw: providerRawEventSchema,
2874
- rawType: z24.string()
2887
+ rawType: z25.string()
2875
2888
  });
2876
2889
  function requireExtensionPresentation(delta, ctx) {
2877
2890
  if (delta.item.type === "extension" && delta.presentation === void 0) {
@@ -2882,32 +2895,32 @@ function requireExtensionPresentation(delta, ctx) {
2882
2895
  });
2883
2896
  }
2884
2897
  }
2885
- var threadDeltaSchema = z24.discriminatedUnion("kind", [
2886
- z24.object({
2887
- kind: z24.literal("input.accepted"),
2898
+ var threadDeltaSchema = z25.discriminatedUnion("kind", [
2899
+ z25.object({
2900
+ kind: z25.literal("input.accepted"),
2888
2901
  clientRequestId: clientTurnRequestIdSchema,
2889
2902
  providerTurnId: providerTurnIdSchema.optional()
2890
2903
  }),
2891
- z24.object({
2892
- kind: z24.literal("input.provider"),
2893
- text: z24.string().min(1),
2904
+ z25.object({
2905
+ kind: z25.literal("input.provider"),
2906
+ text: z25.string().min(1),
2894
2907
  parentRef: deltaKeyPartSchema.optional()
2895
2908
  }),
2896
- z24.object({
2897
- kind: z24.literal("turn.open"),
2909
+ z25.object({
2910
+ kind: z25.literal("turn.open"),
2898
2911
  providerTurnId: providerTurnIdSchema.optional(),
2899
2912
  parentRef: deltaKeyPartSchema.optional()
2900
2913
  }),
2901
- z24.object({
2902
- kind: z24.literal("turn.boundary"),
2914
+ z25.object({
2915
+ kind: z25.literal("turn.boundary"),
2903
2916
  status: threadEventTurnStatusSchema,
2904
2917
  error: deltaErrorSchema.optional(),
2905
- providerCheckpointId: z24.string().min(1).optional(),
2906
- claimIfIdle: z24.boolean().optional(),
2918
+ providerCheckpointId: z25.string().min(1).optional(),
2919
+ claimIfIdle: z25.boolean().optional(),
2907
2920
  providerTurnId: providerTurnIdSchema.optional()
2908
2921
  }),
2909
- z24.object({
2910
- kind: z24.literal("item.open"),
2922
+ z25.object({
2923
+ kind: z25.literal("item.open"),
2911
2924
  key: deltaItemKeySchema,
2912
2925
  item: deltaItemShapeSchema,
2913
2926
  presentation: deltaPresentationSchema.optional(),
@@ -2915,153 +2928,153 @@ var threadDeltaSchema = z24.discriminatedUnion("kind", [
2915
2928
  providerTurnId: providerTurnIdSchema.optional(),
2916
2929
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2917
2930
  }).superRefine(requireExtensionPresentation),
2918
- z24.object({
2919
- kind: z24.literal("item.close"),
2931
+ z25.object({
2932
+ kind: z25.literal("item.close"),
2920
2933
  key: deltaItemKeySchema,
2921
2934
  status: threadEventItemStatusSchema,
2922
- resultText: z24.string().optional(),
2923
- exitCode: z24.number().optional(),
2924
- aggregatedOutput: z24.string().optional(),
2925
- approvalStatus: z24.literal("denied").optional(),
2935
+ resultText: z25.string().optional(),
2936
+ exitCode: z25.number().optional(),
2937
+ aggregatedOutput: z25.string().optional(),
2938
+ approvalStatus: z25.literal("denied").optional(),
2926
2939
  item: deltaItemShapeSchema,
2927
2940
  presentation: deltaPresentationSchema.optional(),
2928
2941
  providerTurnId: providerTurnIdSchema.optional(),
2929
2942
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2930
2943
  }).superRefine(requireExtensionPresentation),
2931
- z24.object({
2932
- kind: z24.literal("item.progress"),
2944
+ z25.object({
2945
+ kind: z25.literal("item.progress"),
2933
2946
  key: deltaItemKeySchema,
2934
- message: z24.string().optional(),
2947
+ message: z25.string().optional(),
2935
2948
  snapshot: deltaProgressSnapshotSchema.optional(),
2936
- flush: z24.boolean().optional(),
2949
+ flush: z25.boolean().optional(),
2937
2950
  providerTurnId: providerTurnIdSchema.optional(),
2938
2951
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2939
2952
  }),
2940
- z24.object({
2941
- kind: z24.literal("item.textDelta"),
2953
+ z25.object({
2954
+ kind: z25.literal("item.textDelta"),
2942
2955
  key: deltaItemKeySchema,
2943
2956
  channel: deltaTextChannelSchema,
2944
- text: z24.string(),
2957
+ text: z25.string(),
2945
2958
  providerTurnId: providerTurnIdSchema.optional(),
2946
2959
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2947
2960
  }),
2948
- z24.object({
2949
- kind: z24.literal("item.textClose"),
2961
+ z25.object({
2962
+ kind: z25.literal("item.textClose"),
2950
2963
  key: deltaItemKeySchema,
2951
2964
  channel: deltaTextChannelSchema,
2952
- text: z24.string().optional(),
2965
+ text: z25.string().optional(),
2953
2966
  providerTurnId: providerTurnIdSchema.optional(),
2954
2967
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2955
2968
  }),
2956
- z24.object({
2957
- kind: z24.literal("item.outputDelta"),
2969
+ z25.object({
2970
+ kind: z25.literal("item.outputDelta"),
2958
2971
  key: deltaItemKeySchema,
2959
2972
  channel: deltaOutputChannelSchema,
2960
- text: z24.string(),
2973
+ text: z25.string(),
2961
2974
  providerTurnId: providerTurnIdSchema.optional(),
2962
2975
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2963
2976
  }),
2964
- z24.object({
2965
- kind: z24.literal("command.outputSnapshot"),
2977
+ z25.object({
2978
+ kind: z25.literal("command.outputSnapshot"),
2966
2979
  key: deltaItemKeySchema,
2967
- text: z24.string(),
2980
+ text: z25.string(),
2968
2981
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2969
2982
  }),
2970
- z24.object({
2971
- kind: z24.literal("usage"),
2983
+ z25.object({
2984
+ kind: z25.literal("usage"),
2972
2985
  total: threadEventTokenUsageBreakdownSchema,
2973
2986
  last: threadEventTokenUsageBreakdownSchema,
2974
- modelContextWindow: z24.number().nullable(),
2987
+ modelContextWindow: z25.number().nullable(),
2975
2988
  providerTurnId: providerTurnIdSchema.optional()
2976
2989
  }),
2977
- z24.object({
2978
- kind: z24.literal("contextWindow"),
2979
- used: z24.number().nullable(),
2980
- size: z24.number().nullable().optional(),
2981
- estimated: z24.boolean(),
2990
+ z25.object({
2991
+ kind: z25.literal("contextWindow"),
2992
+ used: z25.number().nullable(),
2993
+ size: z25.number().nullable().optional(),
2994
+ estimated: z25.boolean(),
2982
2995
  attach: deltaAttachSchema,
2983
2996
  providerTurnId: providerTurnIdSchema.optional()
2984
2997
  }),
2985
- z24.object({
2986
- kind: z24.literal("context.compacted"),
2998
+ z25.object({
2999
+ kind: z25.literal("context.compacted"),
2987
3000
  providerTurnId: providerTurnIdSchema.optional(),
2988
3001
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2989
3002
  }),
2990
- z24.object({ kind: z24.literal("context.cleared") }),
2991
- z24.object({
2992
- kind: z24.literal("turn.diff"),
2993
- diff: z24.string(),
3003
+ z25.object({ kind: z25.literal("context.cleared") }),
3004
+ z25.object({
3005
+ kind: z25.literal("turn.diff"),
3006
+ diff: z25.string(),
2994
3007
  providerTurnId: providerTurnIdSchema.optional()
2995
3008
  }),
2996
- z24.object({ kind: z24.literal("thread.started") }),
2997
- z24.object({
2998
- kind: z24.literal("thread.identity"),
2999
- providerThreadId: z24.string().min(1)
3009
+ z25.object({ kind: z25.literal("thread.started") }),
3010
+ z25.object({
3011
+ kind: z25.literal("thread.identity"),
3012
+ providerThreadId: z25.string().min(1)
3000
3013
  }),
3001
- z24.object({ kind: z24.literal("thread.name"), name: z24.string().min(1) }),
3002
- z24.object({
3003
- kind: z24.literal("extension.state"),
3014
+ z25.object({ kind: z25.literal("thread.name"), name: z25.string().min(1) }),
3015
+ z25.object({
3016
+ kind: z25.literal("extension.state"),
3004
3017
  extensionKind: extensionKindSchema,
3005
3018
  payload: jsonValueSchema
3006
3019
  }),
3007
- z24.object({
3008
- kind: z24.literal("provider.rateLimits"),
3020
+ z25.object({
3021
+ kind: z25.literal("provider.rateLimits"),
3009
3022
  rateLimits: providerRateLimitStateSchema
3010
3023
  }),
3011
- z24.object({
3012
- kind: z24.literal("provider.error"),
3013
- message: z24.string(),
3014
- detail: z24.string().optional(),
3015
- willRetry: z24.boolean().optional(),
3024
+ z25.object({
3025
+ kind: z25.literal("provider.error"),
3026
+ message: z25.string(),
3027
+ detail: z25.string().optional(),
3028
+ willRetry: z25.boolean().optional(),
3016
3029
  category: providerErrorCategorySchema.optional(),
3017
3030
  errorInfo: providerErrorInfoSchema.optional(),
3018
- settlesTurn: z24.boolean().optional(),
3031
+ settlesTurn: z25.boolean().optional(),
3019
3032
  providerTurnId: providerTurnIdSchema.optional(),
3020
- threadScoped: z24.boolean().optional()
3033
+ threadScoped: z25.boolean().optional()
3021
3034
  }),
3022
- z24.object({
3023
- kind: z24.literal("provider.modelFallback"),
3024
- originalModel: z24.string().min(1),
3025
- fallbackModel: z24.string().min(1),
3026
- reason: z24.enum(["refusal", "provider"]),
3027
- message: z24.string()
3035
+ z25.object({
3036
+ kind: z25.literal("provider.modelFallback"),
3037
+ originalModel: z25.string().min(1),
3038
+ fallbackModel: z25.string().min(1),
3039
+ reason: z25.enum(["refusal", "provider"]),
3040
+ message: z25.string()
3028
3041
  }),
3029
- z24.object({
3030
- kind: z24.literal("provider.warning"),
3031
- summary: z24.string().optional(),
3032
- details: z24.string().optional(),
3042
+ z25.object({
3043
+ kind: z25.literal("provider.warning"),
3044
+ summary: z25.string().optional(),
3045
+ details: z25.string().optional(),
3033
3046
  category: threadEventWarningCategorySchema.optional(),
3034
- vouchedTurn: z24.boolean().optional()
3047
+ vouchedTurn: z25.boolean().optional()
3035
3048
  }),
3036
- z24.object({
3037
- kind: z24.literal("unhandled"),
3049
+ z25.object({
3050
+ kind: z25.literal("unhandled"),
3038
3051
  raw: providerRawEventSchema,
3039
- rawType: z24.string(),
3040
- vouchedTurn: z24.boolean(),
3041
- onlyIfNoTurn: z24.boolean().optional(),
3052
+ rawType: z25.string(),
3053
+ vouchedTurn: z25.boolean(),
3054
+ onlyIfNoTurn: z25.boolean().optional(),
3042
3055
  parentRef: deltaKeyPartSchema.optional(),
3043
3056
  providerTurnId: providerTurnIdSchema.optional()
3044
3057
  }),
3045
- z24.object({ kind: z24.literal("session.ended") }),
3046
- z24.object({ kind: z24.literal("session.reset") })
3058
+ z25.object({ kind: z25.literal("session.ended") }),
3059
+ z25.object({ kind: z25.literal("session.reset") })
3047
3060
  ]);
3048
- var threadDeltaNotificationParamsSchema = z24.object({
3049
- threadId: z24.string().min(1),
3050
- deltas: z24.array(threadDeltaSchema)
3061
+ var threadDeltaNotificationParamsSchema = z25.object({
3062
+ threadId: z25.string().min(1),
3063
+ deltas: z25.array(threadDeltaSchema)
3051
3064
  }).passthrough();
3052
3065
 
3053
3066
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
3054
- import { z as z26 } from "zod";
3067
+ import { z as z27 } from "zod";
3055
3068
 
3056
3069
  // ../provider-bridge-protocol/src/bridge-kit/tool-arg-schemas.ts
3057
- import { z as z25 } from "zod";
3058
- var bashArgsSchema = z25.object({
3059
- command: z25.string().optional(),
3060
- cwd: z25.string().optional()
3070
+ import { z as z26 } from "zod";
3071
+ var bashArgsSchema = z26.object({
3072
+ command: z26.string().optional(),
3073
+ cwd: z26.string().optional()
3061
3074
  }).passthrough();
3062
- var textBlockSchema = z25.object({
3063
- type: z25.literal("text"),
3064
- text: z25.string()
3075
+ var textBlockSchema = z26.object({
3076
+ type: z26.literal("text"),
3077
+ text: z26.string()
3065
3078
  });
3066
3079
 
3067
3080
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility-helpers.ts
@@ -3074,10 +3087,10 @@ function getStringProperty(value, key) {
3074
3087
  }
3075
3088
 
3076
3089
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
3077
- var contentWrapperSchema = z26.object({
3078
- content: z26.array(z26.unknown())
3090
+ var contentWrapperSchema = z27.object({
3091
+ content: z27.array(z27.unknown())
3079
3092
  }).passthrough();
3080
- var shellEnvironmentVariableKeySchema = z26.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
3093
+ var shellEnvironmentVariableKeySchema = z27.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
3081
3094
  function toOptionalString(value) {
3082
3095
  return typeof value === "string" ? value : void 0;
3083
3096
  }
@@ -3432,41 +3445,41 @@ function withoutBridgeRuntimeEnv(env) {
3432
3445
  }
3433
3446
 
3434
3447
  // ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
3435
- import { z as z27 } from "zod";
3436
- var providerToolCallResponseSchema = z27.object({
3437
- success: z27.boolean(),
3438
- contentItems: z27.array(
3439
- z27.discriminatedUnion("type", [
3440
- z27.object({
3441
- type: z27.literal("inputText"),
3442
- text: z27.string()
3448
+ import { z as z28 } from "zod";
3449
+ var providerToolCallResponseSchema = z28.object({
3450
+ success: z28.boolean(),
3451
+ contentItems: z28.array(
3452
+ z28.discriminatedUnion("type", [
3453
+ z28.object({
3454
+ type: z28.literal("inputText"),
3455
+ text: z28.string()
3443
3456
  }),
3444
- z27.object({
3445
- type: z27.literal("inputImage"),
3446
- imageUrl: z27.string().min(1)
3457
+ z28.object({
3458
+ type: z28.literal("inputImage"),
3459
+ imageUrl: z28.string().min(1)
3447
3460
  })
3448
3461
  ])
3449
3462
  )
3450
3463
  });
3451
- var bridgeRequestEnvelopeSchema = z27.object({
3452
- jsonrpc: z27.literal("2.0"),
3453
- id: z27.union([z27.string(), z27.number()]),
3454
- method: z27.string(),
3455
- params: z27.record(z27.string(), z27.unknown()).optional()
3456
- });
3457
- var jsonRpcErrorSchema = z27.object({
3458
- code: z27.number(),
3459
- message: z27.string().optional(),
3460
- data: z27.unknown().optional()
3461
- });
3462
- var jsonRpcSuccessResponseSchema = z27.object({
3463
- jsonrpc: z27.literal("2.0"),
3464
- id: z27.union([z27.string(), z27.number()]),
3465
- result: z27.unknown()
3466
- });
3467
- var jsonRpcErrorResponseSchema = z27.object({
3468
- jsonrpc: z27.literal("2.0"),
3469
- id: z27.union([z27.string(), z27.number()]),
3464
+ var bridgeRequestEnvelopeSchema = z28.object({
3465
+ jsonrpc: z28.literal("2.0"),
3466
+ id: z28.union([z28.string(), z28.number()]),
3467
+ method: z28.string(),
3468
+ params: z28.record(z28.string(), z28.unknown()).optional()
3469
+ });
3470
+ var jsonRpcErrorSchema = z28.object({
3471
+ code: z28.number(),
3472
+ message: z28.string().optional(),
3473
+ data: z28.unknown().optional()
3474
+ });
3475
+ var jsonRpcSuccessResponseSchema = z28.object({
3476
+ jsonrpc: z28.literal("2.0"),
3477
+ id: z28.union([z28.string(), z28.number()]),
3478
+ result: z28.unknown()
3479
+ });
3480
+ var jsonRpcErrorResponseSchema = z28.object({
3481
+ jsonrpc: z28.literal("2.0"),
3482
+ id: z28.union([z28.string(), z28.number()]),
3470
3483
  error: jsonRpcErrorSchema
3471
3484
  });
3472
3485
  function isJsonRpcRequest(input) {
@@ -3554,47 +3567,47 @@ function buildBridgeToolCallContent(result) {
3554
3567
  }
3555
3568
 
3556
3569
  // ../provider-bridge-protocol/src/bridge-kit/json-rpc-envelope.ts
3557
- import { z as z28 } from "zod";
3558
- var recordSchema = z28.record(z28.string(), z28.unknown());
3559
- var jsonRpcEnvelopeSchema = z28.object({
3560
- jsonrpc: z28.literal("2.0"),
3561
- method: z28.string(),
3570
+ import { z as z29 } from "zod";
3571
+ var recordSchema = z29.record(z29.string(), z29.unknown());
3572
+ var jsonRpcEnvelopeSchema = z29.object({
3573
+ jsonrpc: z29.literal("2.0"),
3574
+ method: z29.string(),
3562
3575
  params: recordSchema.optional()
3563
3576
  }).passthrough();
3564
- var sdkMessageEnvelopeSchema = z28.object({
3565
- jsonrpc: z28.literal("2.0"),
3566
- method: z28.literal("sdk/message"),
3567
- params: z28.object({
3568
- message: z28.unknown(),
3569
- threadId: z28.string().optional(),
3570
- parent_tool_use_id: z28.string().optional()
3577
+ var sdkMessageEnvelopeSchema = z29.object({
3578
+ jsonrpc: z29.literal("2.0"),
3579
+ method: z29.literal("sdk/message"),
3580
+ params: z29.object({
3581
+ message: z29.unknown(),
3582
+ threadId: z29.string().optional(),
3583
+ parent_tool_use_id: z29.string().optional()
3571
3584
  }).passthrough()
3572
3585
  }).passthrough();
3573
- var threadIdentityEnvelopeSchema = z28.object({
3574
- jsonrpc: z28.literal("2.0"),
3575
- method: z28.literal("thread/identity"),
3576
- params: z28.object({
3577
- threadId: z28.string().optional(),
3578
- providerThreadId: z28.string().optional()
3586
+ var threadIdentityEnvelopeSchema = z29.object({
3587
+ jsonrpc: z29.literal("2.0"),
3588
+ method: z29.literal("thread/identity"),
3589
+ params: z29.object({
3590
+ threadId: z29.string().optional(),
3591
+ providerThreadId: z29.string().optional()
3579
3592
  }).passthrough()
3580
3593
  }).passthrough();
3581
- var threadContextWindowUsageEnvelopeSchema = z28.object({
3582
- jsonrpc: z28.literal("2.0"),
3583
- method: z28.literal("thread/contextWindowUsage/updated"),
3584
- params: z28.object({
3585
- threadId: z28.string().optional(),
3586
- contextWindowUsage: z28.object({
3587
- usedTokens: z28.number().nullable(),
3588
- modelContextWindow: z28.number().nullable(),
3589
- estimated: z28.boolean()
3594
+ var threadContextWindowUsageEnvelopeSchema = z29.object({
3595
+ jsonrpc: z29.literal("2.0"),
3596
+ method: z29.literal("thread/contextWindowUsage/updated"),
3597
+ params: z29.object({
3598
+ threadId: z29.string().optional(),
3599
+ contextWindowUsage: z29.object({
3600
+ usedTokens: z29.number().nullable(),
3601
+ modelContextWindow: z29.number().nullable(),
3602
+ estimated: z29.boolean()
3590
3603
  })
3591
3604
  }).passthrough()
3592
3605
  }).passthrough();
3593
- var errorEnvelopeSchema = z28.object({
3594
- jsonrpc: z28.literal("2.0"),
3595
- method: z28.literal("error"),
3596
- params: z28.object({
3597
- message: z28.string().optional()
3606
+ var errorEnvelopeSchema = z29.object({
3607
+ jsonrpc: z29.literal("2.0"),
3608
+ method: z29.literal("error"),
3609
+ params: z29.object({
3610
+ message: z29.string().optional()
3598
3611
  }).passthrough().optional()
3599
3612
  }).passthrough();
3600
3613
 
@@ -3701,7 +3714,7 @@ import { constants as fsConstants } from "node:fs";
3701
3714
  import { access } from "node:fs/promises";
3702
3715
  import path from "node:path";
3703
3716
  import { promisify } from "node:util";
3704
- import { z as z29 } from "zod";
3717
+ import { z as z30 } from "zod";
3705
3718
  var execFileAsync = promisify(execFile);
3706
3719
  var CLI_PROBE_TIMEOUT_MS = 5e3;
3707
3720
  async function resolveExecutablePath(command) {
@@ -3751,15 +3764,15 @@ function clampPercent(value) {
3751
3764
  }
3752
3765
 
3753
3766
  // ../provider-bridge-protocol/src/bridge-kit/provider-tool-call-contract.ts
3754
- import { z as z30 } from "zod";
3755
- var normalizedToolCallRequestSchema = z30.object({
3756
- providerThreadId: z30.string().min(1),
3757
- threadId: z30.string().min(1).optional(),
3758
- turnId: z30.union([z30.string().min(1), z30.null()]),
3759
- callId: z30.string().min(1),
3760
- tool: z30.string().min(1),
3761
- arguments: z30.unknown(),
3762
- providerNativeIds: z30.boolean().optional()
3767
+ import { z as z31 } from "zod";
3768
+ var normalizedToolCallRequestSchema = z31.object({
3769
+ providerThreadId: z31.string().min(1),
3770
+ threadId: z31.string().min(1).optional(),
3771
+ turnId: z31.union([z31.string().min(1), z31.null()]),
3772
+ callId: z31.string().min(1),
3773
+ tool: z31.string().min(1),
3774
+ arguments: z31.unknown(),
3775
+ providerNativeIds: z31.boolean().optional()
3763
3776
  });
3764
3777
 
3765
3778
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility.ts
@@ -3774,8 +3787,8 @@ function createProviderVisibilityMetadata(args) {
3774
3787
  }
3775
3788
 
3776
3789
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
3777
- import { z as z31 } from "zod";
3778
- var ignoredJsonRpcResultSchema = z31.unknown();
3790
+ import { z as z32 } from "zod";
3791
+ var ignoredJsonRpcResultSchema = z32.unknown();
3779
3792
 
3780
3793
  // ../provider-bridge-acp/src/bridge/bridge.ts
3781
3794
  import { execFile as execFile4 } from "node:child_process";
@@ -3784,21 +3797,21 @@ import { promises as fs2, readFileSync } from "node:fs";
3784
3797
  import { createServer } from "node:net";
3785
3798
  import { dirname as dirname2, isAbsolute, basename as basename3, relative, resolve as resolve3 } from "node:path";
3786
3799
  import { fileURLToPath } from "node:url";
3787
- import { z as z39 } from "zod";
3800
+ import { z as z40 } from "zod";
3788
3801
 
3789
3802
  // ../provider-bridge-acp/src/bridge-protocol.ts
3790
- import { z as z33 } from "zod";
3803
+ import { z as z34 } from "zod";
3791
3804
 
3792
3805
  // ../provider-bridge-acp/src/wire.ts
3793
- import { z as z32 } from "zod";
3794
- var acpTextContentBlockSchema = z32.object({
3795
- type: z32.literal("text"),
3796
- text: z32.string()
3806
+ import { z as z33 } from "zod";
3807
+ var acpTextContentBlockSchema = z33.object({
3808
+ type: z33.literal("text"),
3809
+ text: z33.string()
3797
3810
  }).passthrough();
3798
- var acpOtherContentBlockSchema = z32.object({
3799
- type: z32.string()
3811
+ var acpOtherContentBlockSchema = z33.object({
3812
+ type: z33.string()
3800
3813
  }).passthrough();
3801
- var acpContentBlockSchema = z32.union([
3814
+ var acpContentBlockSchema = z33.union([
3802
3815
  acpTextContentBlockSchema,
3803
3816
  acpOtherContentBlockSchema
3804
3817
  ]);
@@ -3821,7 +3834,7 @@ var ACP_TOOL_KINDS = [
3821
3834
  "switch_mode",
3822
3835
  "other"
3823
3836
  ];
3824
- var acpToolKindSchema = z32.enum(ACP_TOOL_KINDS);
3837
+ var acpToolKindSchema = z33.enum(ACP_TOOL_KINDS);
3825
3838
  var ACP_TOOL_KIND_SET = new Set(ACP_TOOL_KINDS);
3826
3839
  var ACP_TOOL_CALL_STATUSES = [
3827
3840
  "pending",
@@ -3830,48 +3843,48 @@ var ACP_TOOL_CALL_STATUSES = [
3830
3843
  "failed",
3831
3844
  "cancelled"
3832
3845
  ];
3833
- var acpToolCallStatusSchema = z32.enum(ACP_TOOL_CALL_STATUSES);
3846
+ var acpToolCallStatusSchema = z33.enum(ACP_TOOL_CALL_STATUSES);
3834
3847
  var ACP_TOOL_CALL_STATUS_SET = new Set(
3835
3848
  ACP_TOOL_CALL_STATUSES
3836
3849
  );
3837
- var acpToolCallContentSchema = z32.union([
3838
- z32.object({
3839
- type: z32.literal("content"),
3850
+ var acpToolCallContentSchema = z33.union([
3851
+ z33.object({
3852
+ type: z33.literal("content"),
3840
3853
  content: acpContentBlockSchema
3841
3854
  }).passthrough(),
3842
- z32.object({
3843
- type: z32.literal("diff"),
3844
- path: z32.string(),
3845
- oldText: z32.string().nullable().optional(),
3846
- newText: z32.string()
3855
+ z33.object({
3856
+ type: z33.literal("diff"),
3857
+ path: z33.string(),
3858
+ oldText: z33.string().nullable().optional(),
3859
+ newText: z33.string()
3847
3860
  }).passthrough(),
3848
- z32.object({
3849
- type: z32.literal("terminal"),
3850
- terminalId: z32.string()
3861
+ z33.object({
3862
+ type: z33.literal("terminal"),
3863
+ terminalId: z33.string()
3851
3864
  }).passthrough()
3852
3865
  ]);
3853
- var acpToolCallContentListSchema = z32.array(z32.unknown()).transform(
3866
+ var acpToolCallContentListSchema = z33.array(z33.unknown()).transform(
3854
3867
  (entries) => entries.flatMap((entry) => {
3855
3868
  const parsed = acpToolCallContentSchema.safeParse(entry);
3856
3869
  return parsed.success ? [parsed.data] : [];
3857
3870
  })
3858
3871
  );
3859
- var acpToolCallLocationSchema = z32.object({
3860
- path: z32.string(),
3861
- line: z32.number().optional().nullable()
3872
+ var acpToolCallLocationSchema = z33.object({
3873
+ path: z33.string(),
3874
+ line: z33.number().optional().nullable()
3862
3875
  }).passthrough();
3863
- var acpToolCallNameSchema = z32.union([z32.string(), z32.null()]).transform((value) => value ?? void 0).optional();
3864
- var acpToolCallFieldsSchema = z32.object({
3865
- toolCallId: z32.string(),
3866
- title: z32.string().optional(),
3876
+ var acpToolCallNameSchema = z33.union([z33.string(), z33.null()]).transform((value) => value ?? void 0).optional();
3877
+ var acpToolCallFieldsSchema = z33.object({
3878
+ toolCallId: z33.string(),
3879
+ title: z33.string().optional(),
3867
3880
  name: acpToolCallNameSchema,
3868
3881
  kind: acpToolKindSchema.optional(),
3869
- rawKind: z32.string().optional(),
3882
+ rawKind: z33.string().optional(),
3870
3883
  status: acpToolCallStatusSchema.optional(),
3871
3884
  content: acpToolCallContentListSchema.optional(),
3872
- locations: z32.array(acpToolCallLocationSchema).optional(),
3873
- rawInput: z32.unknown().optional(),
3874
- rawOutput: z32.unknown().optional()
3885
+ locations: z33.array(acpToolCallLocationSchema).optional(),
3886
+ rawInput: z33.unknown().optional(),
3887
+ rawOutput: z33.unknown().optional()
3875
3888
  });
3876
3889
  function openAcpToolCallEnums(value) {
3877
3890
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
@@ -3897,43 +3910,43 @@ function openAcpToolCallEnums(value) {
3897
3910
  }
3898
3911
  return next;
3899
3912
  }
3900
- var acpAgentMessageChunkUpdateSchema = z32.object({
3901
- sessionUpdate: z32.literal("agent_message_chunk"),
3913
+ var acpAgentMessageChunkUpdateSchema = z33.object({
3914
+ sessionUpdate: z33.literal("agent_message_chunk"),
3902
3915
  content: acpContentBlockSchema
3903
3916
  }).passthrough();
3904
- var acpAgentThoughtChunkUpdateSchema = z32.object({
3905
- sessionUpdate: z32.literal("agent_thought_chunk"),
3917
+ var acpAgentThoughtChunkUpdateSchema = z33.object({
3918
+ sessionUpdate: z33.literal("agent_thought_chunk"),
3906
3919
  content: acpContentBlockSchema
3907
3920
  }).passthrough();
3908
- var acpToolCallUpdateEventSchema = z32.preprocess(
3921
+ var acpToolCallUpdateEventSchema = z33.preprocess(
3909
3922
  openAcpToolCallEnums,
3910
3923
  acpToolCallFieldsSchema.extend({
3911
- sessionUpdate: z32.enum(["tool_call", "tool_call_update"])
3924
+ sessionUpdate: z33.enum(["tool_call", "tool_call_update"])
3912
3925
  }).passthrough()
3913
3926
  );
3914
- var acpPlanEntryStatusSchema = z32.enum([
3927
+ var acpPlanEntryStatusSchema = z33.enum([
3915
3928
  "pending",
3916
3929
  "in_progress",
3917
3930
  "completed"
3918
3931
  ]);
3919
- var acpPlanUpdateSchema = z32.object({
3920
- sessionUpdate: z32.literal("plan"),
3921
- entries: z32.array(
3922
- z32.object({
3923
- content: z32.string(),
3932
+ var acpPlanUpdateSchema = z33.object({
3933
+ sessionUpdate: z33.literal("plan"),
3934
+ entries: z33.array(
3935
+ z33.object({
3936
+ content: z33.string(),
3924
3937
  status: acpPlanEntryStatusSchema.optional()
3925
3938
  }).passthrough()
3926
3939
  )
3927
3940
  }).passthrough();
3928
- var acpUsageUpdateSchema = z32.object({
3929
- sessionUpdate: z32.literal("usage_update"),
3930
- used: z32.number().int().nonnegative(),
3931
- size: z32.number().int().nonnegative()
3941
+ var acpUsageUpdateSchema = z33.object({
3942
+ sessionUpdate: z33.literal("usage_update"),
3943
+ used: z33.number().int().nonnegative(),
3944
+ size: z33.number().int().nonnegative()
3932
3945
  }).passthrough();
3933
- var acpOtherSessionUpdateSchema = z32.object({
3934
- sessionUpdate: z32.string()
3946
+ var acpOtherSessionUpdateSchema = z33.object({
3947
+ sessionUpdate: z33.string()
3935
3948
  }).passthrough();
3936
- var acpSessionUpdateSchema = z32.union([
3949
+ var acpSessionUpdateSchema = z33.union([
3937
3950
  acpAgentMessageChunkUpdateSchema,
3938
3951
  acpAgentThoughtChunkUpdateSchema,
3939
3952
  acpToolCallUpdateEventSchema,
@@ -3941,55 +3954,55 @@ var acpSessionUpdateSchema = z32.union([
3941
3954
  acpUsageUpdateSchema,
3942
3955
  acpOtherSessionUpdateSchema
3943
3956
  ]);
3944
- var acpSessionNotificationParamsSchema = z32.object({
3945
- sessionId: z32.string(),
3957
+ var acpSessionNotificationParamsSchema = z33.object({
3958
+ sessionId: z33.string(),
3946
3959
  update: acpSessionUpdateSchema
3947
3960
  }).passthrough();
3948
3961
  var ACP_PROTOCOL_VERSION = 1;
3949
- var acpInitializeResultSchema = z32.object({
3950
- protocolVersion: z32.number(),
3951
- agentCapabilities: z32.object({
3952
- loadSession: z32.boolean().optional(),
3953
- sessionCapabilities: z32.object({
3954
- fork: z32.object({}).passthrough().nullable().optional()
3962
+ var acpInitializeResultSchema = z33.object({
3963
+ protocolVersion: z33.number(),
3964
+ agentCapabilities: z33.object({
3965
+ loadSession: z33.boolean().optional(),
3966
+ sessionCapabilities: z33.object({
3967
+ fork: z33.object({}).passthrough().nullable().optional()
3955
3968
  }).passthrough().optional(),
3956
- promptCapabilities: z32.object({
3957
- image: z32.boolean().optional(),
3958
- audio: z32.boolean().optional(),
3959
- embeddedContext: z32.boolean().optional()
3969
+ promptCapabilities: z33.object({
3970
+ image: z33.boolean().optional(),
3971
+ audio: z33.boolean().optional(),
3972
+ embeddedContext: z33.boolean().optional()
3960
3973
  }).passthrough().optional()
3961
3974
  }).passthrough().optional(),
3962
- authMethods: z32.array(z32.object({ id: z32.string() }).passthrough()).optional()
3975
+ authMethods: z33.array(z33.object({ id: z33.string() }).passthrough()).optional()
3963
3976
  }).passthrough();
3964
- var acpOptionalString = z32.union([z32.string(), z32.null()]).transform((value) => value ?? void 0).optional();
3965
- var acpConfigOptionSelectOptionSchema = z32.object({
3966
- value: z32.string(),
3977
+ var acpOptionalString = z33.union([z33.string(), z33.null()]).transform((value) => value ?? void 0).optional();
3978
+ var acpConfigOptionSelectOptionSchema = z33.object({
3979
+ value: z33.string(),
3967
3980
  name: acpOptionalString
3968
3981
  }).passthrough();
3969
- var acpConfigOptionSchema = z32.object({
3970
- id: z32.string(),
3982
+ var acpConfigOptionSchema = z33.object({
3983
+ id: z33.string(),
3971
3984
  name: acpOptionalString,
3972
3985
  category: acpOptionalString,
3973
- type: z32.string(),
3986
+ type: z33.string(),
3974
3987
  currentValue: acpOptionalString,
3975
- options: z32.array(acpConfigOptionSelectOptionSchema).optional()
3988
+ options: z33.array(acpConfigOptionSelectOptionSchema).optional()
3976
3989
  }).passthrough();
3977
- var acpSessionModelSchema = z32.object({
3978
- modelId: z32.string(),
3990
+ var acpSessionModelSchema = z33.object({
3991
+ modelId: z33.string(),
3979
3992
  name: acpOptionalString,
3980
3993
  description: acpOptionalString
3981
3994
  }).passthrough();
3982
- var acpSessionModelsSchema = z32.object({
3995
+ var acpSessionModelsSchema = z33.object({
3983
3996
  currentModelId: acpOptionalString,
3984
- availableModels: z32.array(acpSessionModelSchema).optional()
3997
+ availableModels: z33.array(acpSessionModelSchema).optional()
3985
3998
  }).passthrough();
3986
- var acpLooseConfigOptionSchema = z32.object({
3987
- id: z32.string().optional(),
3988
- name: z32.unknown().optional(),
3999
+ var acpLooseConfigOptionSchema = z33.object({
4000
+ id: z33.string().optional(),
4001
+ name: z33.unknown().optional(),
3989
4002
  category: acpOptionalString,
3990
- type: z32.unknown().optional(),
3991
- currentValue: z32.unknown().optional(),
3992
- options: z32.unknown().optional()
4003
+ type: z33.unknown().optional(),
4004
+ currentValue: z33.unknown().optional(),
4005
+ options: z33.unknown().optional()
3993
4006
  }).passthrough();
3994
4007
  function parseAcpConfigOptions(options, ctx) {
3995
4008
  if (options == null) {
@@ -4033,119 +4046,119 @@ function parseAcpConfigOptions(options, ctx) {
4033
4046
  }
4034
4047
  return parsedOptions;
4035
4048
  }
4036
- var acpSessionNewResultSchema = z32.object({
4037
- sessionId: z32.string(),
4049
+ var acpSessionNewResultSchema = z33.object({
4050
+ sessionId: z33.string(),
4038
4051
  models: acpSessionModelsSchema.optional(),
4039
- configOptions: z32.array(z32.unknown()).nullable().optional().transform((options, ctx) => parseAcpConfigOptions(options, ctx))
4052
+ configOptions: z33.array(z33.unknown()).nullable().optional().transform((options, ctx) => parseAcpConfigOptions(options, ctx))
4040
4053
  }).passthrough();
4041
- var acpConfigStateResultSchema = z32.object({
4054
+ var acpConfigStateResultSchema = z33.object({
4042
4055
  models: acpSessionModelsSchema.optional(),
4043
- configOptions: z32.array(z32.unknown()).nullable().optional().transform((options, ctx) => parseAcpConfigOptions(options, ctx))
4056
+ configOptions: z33.array(z33.unknown()).nullable().optional().transform((options, ctx) => parseAcpConfigOptions(options, ctx))
4044
4057
  }).passthrough();
4045
4058
  var acpSessionForkResultSchema = acpConfigStateResultSchema.extend({
4046
- sessionId: z32.string()
4059
+ sessionId: z33.string()
4047
4060
  });
4048
- var acpStopReasonSchema = z32.enum([
4061
+ var acpStopReasonSchema = z33.enum([
4049
4062
  "end_turn",
4050
4063
  "max_tokens",
4051
4064
  "max_turn_requests",
4052
4065
  "refusal",
4053
4066
  "cancelled"
4054
4067
  ]);
4055
- var acpPromptResultSchema = z32.object({
4068
+ var acpPromptResultSchema = z33.object({
4056
4069
  stopReason: acpStopReasonSchema
4057
4070
  }).passthrough();
4058
- var acpPermissionOptionKindSchema = z32.enum([
4071
+ var acpPermissionOptionKindSchema = z33.enum([
4059
4072
  "allow_once",
4060
4073
  "allow_always",
4061
4074
  "reject_once",
4062
4075
  "reject_always"
4063
4076
  ]);
4064
- var acpPermissionOptionSchema = z32.object({
4065
- optionId: z32.string(),
4066
- name: z32.string(),
4077
+ var acpPermissionOptionSchema = z33.object({
4078
+ optionId: z33.string(),
4079
+ name: z33.string(),
4067
4080
  kind: acpPermissionOptionKindSchema
4068
4081
  }).passthrough();
4069
- var acpRequestPermissionParamsSchema = z32.object({
4070
- sessionId: z32.string(),
4071
- toolCall: z32.preprocess(
4082
+ var acpRequestPermissionParamsSchema = z33.object({
4083
+ sessionId: z33.string(),
4084
+ toolCall: z33.preprocess(
4072
4085
  openAcpToolCallEnums,
4073
4086
  acpToolCallFieldsSchema.partial().passthrough()
4074
4087
  ).optional(),
4075
- options: z32.array(acpPermissionOptionSchema).min(1)
4088
+ options: z33.array(acpPermissionOptionSchema).min(1)
4076
4089
  }).passthrough();
4077
- var acpReadTextFileParamsSchema = z32.object({
4078
- sessionId: z32.string(),
4079
- path: z32.string(),
4080
- line: z32.number().nullable().optional(),
4081
- limit: z32.number().nullable().optional()
4090
+ var acpReadTextFileParamsSchema = z33.object({
4091
+ sessionId: z33.string(),
4092
+ path: z33.string(),
4093
+ line: z33.number().nullable().optional(),
4094
+ limit: z33.number().nullable().optional()
4082
4095
  }).passthrough();
4083
- var acpWriteTextFileParamsSchema = z32.object({
4084
- sessionId: z32.string(),
4085
- path: z32.string(),
4086
- content: z32.string()
4096
+ var acpWriteTextFileParamsSchema = z33.object({
4097
+ sessionId: z33.string(),
4098
+ path: z33.string(),
4099
+ content: z33.string()
4087
4100
  }).passthrough();
4088
4101
 
4089
4102
  // ../provider-bridge-acp/src/bridge-protocol.ts
4090
4103
  var ACP_DEFAULT_MODEL_ID = "acp-default";
4091
4104
  var acpModelListParamsSchema = modelListParamsSchema.extend({
4092
- providerOptions: z33.record(z33.string(), z33.unknown()).optional()
4105
+ providerOptions: z34.record(z34.string(), z34.unknown()).optional()
4093
4106
  });
4094
- var acpBridgeCommandSchema = z33.discriminatedUnion("method", [
4095
- z33.object({
4096
- method: z33.literal("initialize"),
4107
+ var acpBridgeCommandSchema = z34.discriminatedUnion("method", [
4108
+ z34.object({
4109
+ method: z34.literal("initialize"),
4097
4110
  params: initializeParamsSchema
4098
4111
  }),
4099
- z33.object({
4100
- method: z33.literal("model/list"),
4112
+ z34.object({
4113
+ method: z34.literal("model/list"),
4101
4114
  params: acpModelListParamsSchema
4102
4115
  }),
4103
- z33.object({
4104
- method: z33.literal("provider/health"),
4116
+ z34.object({
4117
+ method: z34.literal("provider/health"),
4105
4118
  params: providerMaintenanceParamsSchema
4106
4119
  }),
4107
- z33.object({
4108
- method: z33.literal("provider/usage"),
4120
+ z34.object({
4121
+ method: z34.literal("provider/usage"),
4109
4122
  params: providerMaintenanceParamsSchema
4110
4123
  }),
4111
- z33.object({
4112
- method: z33.literal("provider/installation/status"),
4124
+ z34.object({
4125
+ method: z34.literal("provider/installation/status"),
4113
4126
  params: providerInstallationStatusParamsSchema
4114
4127
  }),
4115
- z33.object({
4116
- method: z33.literal("provider/installation/run"),
4128
+ z34.object({
4129
+ method: z34.literal("provider/installation/run"),
4117
4130
  params: providerInstallationRunParamsSchema
4118
4131
  }),
4119
- z33.object({
4120
- method: z33.literal("thread/start"),
4132
+ z34.object({
4133
+ method: z34.literal("thread/start"),
4121
4134
  params: threadStartParamsSchema
4122
4135
  }),
4123
- z33.object({
4124
- method: z33.literal("thread/resume"),
4136
+ z34.object({
4137
+ method: z34.literal("thread/resume"),
4125
4138
  params: threadResumeParamsSchema
4126
4139
  }),
4127
- z33.object({
4128
- method: z33.literal("thread/fork"),
4140
+ z34.object({
4141
+ method: z34.literal("thread/fork"),
4129
4142
  params: threadForkParamsSchema
4130
4143
  }),
4131
- z33.object({
4132
- method: z33.literal("turn/start"),
4144
+ z34.object({
4145
+ method: z34.literal("turn/start"),
4133
4146
  params: turnStartParamsSchema
4134
4147
  }),
4135
- z33.object({
4136
- method: z33.literal("turn/steer"),
4148
+ z34.object({
4149
+ method: z34.literal("turn/steer"),
4137
4150
  params: turnSteerParamsSchema
4138
4151
  }),
4139
- z33.object({
4140
- method: z33.literal("thread/stop"),
4152
+ z34.object({
4153
+ method: z34.literal("thread/stop"),
4141
4154
  params: threadStopParamsSchema
4142
4155
  }),
4143
- z33.object({
4144
- method: z33.literal("thread/discard"),
4156
+ z34.object({
4157
+ method: z34.literal("thread/discard"),
4145
4158
  params: threadDiscardParamsSchema
4146
4159
  }),
4147
- z33.object({
4148
- method: z33.literal("skills/configure"),
4160
+ z34.object({
4161
+ method: z34.literal("skills/configure"),
4149
4162
  params: skillsConfigureParamsSchema
4150
4163
  })
4151
4164
  ]);
@@ -4160,48 +4173,48 @@ var ACP_UPDATE_METHOD = "acp/update";
4160
4173
  var ACP_FS_WRITE_METHOD = "acp/fs/write";
4161
4174
  var ACP_WARNING_METHOD = "acp/warning";
4162
4175
  var ACP_BRIDGE_NO_ACTIVE_TURN_ERROR_CODE = -32001;
4163
- var acpTurnStartedNotificationParamsSchema = z33.object({
4164
- threadId: z33.string().min(1)
4176
+ var acpTurnStartedNotificationParamsSchema = z34.object({
4177
+ threadId: z34.string().min(1)
4165
4178
  }).passthrough();
4166
- var acpTurnCompletedNotificationParamsSchema = z33.object({
4167
- threadId: z33.string().min(1),
4179
+ var acpTurnCompletedNotificationParamsSchema = z34.object({
4180
+ threadId: z34.string().min(1),
4168
4181
  stopReason: acpStopReasonSchema
4169
4182
  }).passthrough();
4170
- var acpCompactionCompletedNotificationParamsSchema = z33.discriminatedUnion("status", [
4171
- z33.object({
4172
- threadId: z33.string().min(1),
4173
- status: z33.literal("completed")
4183
+ var acpCompactionCompletedNotificationParamsSchema = z34.discriminatedUnion("status", [
4184
+ z34.object({
4185
+ threadId: z34.string().min(1),
4186
+ status: z34.literal("completed")
4174
4187
  }).passthrough(),
4175
- z33.object({
4176
- threadId: z33.string().min(1),
4177
- status: z33.literal("interrupted")
4188
+ z34.object({
4189
+ threadId: z34.string().min(1),
4190
+ status: z34.literal("interrupted")
4178
4191
  }).passthrough(),
4179
- z33.object({
4180
- threadId: z33.string().min(1),
4181
- status: z33.literal("failed"),
4182
- error: z33.string().min(1)
4192
+ z34.object({
4193
+ threadId: z34.string().min(1),
4194
+ status: z34.literal("failed"),
4195
+ error: z34.string().min(1)
4183
4196
  }).passthrough()
4184
4197
  ]);
4185
- var acpUpdateNotificationParamsSchema = z33.object({
4186
- threadId: z33.string().min(1),
4198
+ var acpUpdateNotificationParamsSchema = z34.object({
4199
+ threadId: z34.string().min(1),
4187
4200
  update: acpSessionUpdateSchema
4188
4201
  }).passthrough();
4189
- var acpFsWriteNotificationParamsSchema = z33.object({
4190
- threadId: z33.string().min(1),
4191
- path: z33.string().min(1),
4192
- kind: z33.enum(["add", "update"]),
4193
- oldText: z33.string().optional(),
4194
- content: z33.string()
4202
+ var acpFsWriteNotificationParamsSchema = z34.object({
4203
+ threadId: z34.string().min(1),
4204
+ path: z34.string().min(1),
4205
+ kind: z34.enum(["add", "update"]),
4206
+ oldText: z34.string().optional(),
4207
+ content: z34.string()
4195
4208
  }).passthrough();
4196
- var acpWarningNotificationParamsSchema = z33.object({
4197
- threadId: z33.string().min(1),
4198
- summary: z33.string().min(1),
4199
- details: z33.string().optional()
4209
+ var acpWarningNotificationParamsSchema = z34.object({
4210
+ threadId: z34.string().min(1),
4211
+ summary: z34.string().min(1),
4212
+ details: z34.string().optional()
4200
4213
  }).passthrough();
4201
4214
 
4202
4215
  // ../provider-bridge-acp/src/dialect.ts
4203
4216
  import { basename } from "node:path";
4204
- import { z as z35 } from "zod";
4217
+ import { z as z36 } from "zod";
4205
4218
 
4206
4219
  // ../provider-bridge-acp/src/bridge/provider-maintenance.ts
4207
4220
  import { execFile as execFile2 } from "node:child_process";
@@ -4211,7 +4224,7 @@ import os from "node:os";
4211
4224
  import path2 from "node:path";
4212
4225
  import { DatabaseSync } from "node:sqlite";
4213
4226
  import { promisify as promisify2 } from "node:util";
4214
- import { z as z34 } from "zod";
4227
+ import { z as z35 } from "zod";
4215
4228
  var execFileAsync2 = promisify2(execFile2);
4216
4229
  var USAGE_FETCH_TIMEOUT_MS = 15e3;
4217
4230
  var CURSOR_DASHBOARD_URL = "https://api2.cursor.sh/aiserver.v1.DashboardService";
@@ -4249,8 +4262,8 @@ async function readKeychainAccessToken() {
4249
4262
  return null;
4250
4263
  }
4251
4264
  }
4252
- var cursorFileCredentialsSchema = z34.object({
4253
- accessToken: z34.string().min(1).nullish()
4265
+ var cursorFileCredentialsSchema = z35.object({
4266
+ accessToken: z35.string().min(1).nullish()
4254
4267
  });
4255
4268
  async function readAccessToken() {
4256
4269
  const keychain = await readKeychainAccessToken();
@@ -4297,7 +4310,7 @@ function readAccountEmail() {
4297
4310
  database = new DatabaseSync(databasePath);
4298
4311
  database.exec("PRAGMA query_only = true");
4299
4312
  const row = database.prepare("SELECT value FROM ItemTable WHERE key = ?").get("cursorAuth/cachedEmail");
4300
- const parsed = z34.object({ value: z34.string().email() }).safeParse(row);
4313
+ const parsed = z35.object({ value: z35.string().email() }).safeParse(row);
4301
4314
  return parsed.success ? parsed.data.value : null;
4302
4315
  } catch {
4303
4316
  return null;
@@ -4401,14 +4414,14 @@ function buildAcpProviderInstallationRun(status, args) {
4401
4414
  verification: { kind: "installed" }
4402
4415
  };
4403
4416
  }
4404
- var cursorNonNegativeIntegerSchema = z34.union([
4405
- z34.number().int().nonnegative(),
4406
- z34.string().regex(/^\d+$/u).transform(Number)
4417
+ var cursorNonNegativeIntegerSchema = z35.union([
4418
+ z35.number().int().nonnegative(),
4419
+ z35.string().regex(/^\d+$/u).transform(Number)
4407
4420
  ]).refine(Number.isSafeInteger);
4408
- var cursorUsageResponseSchema = z34.object({
4421
+ var cursorUsageResponseSchema = z35.object({
4409
4422
  billingCycleEnd: cursorNonNegativeIntegerSchema.nullish(),
4410
- planUsage: z34.object({ totalPercentUsed: z34.number().nonnegative().default(0) }).nullish(),
4411
- spendLimitUsage: z34.object({
4423
+ planUsage: z35.object({ totalPercentUsed: z35.number().nonnegative().default(0) }).nullish(),
4424
+ spendLimitUsage: z35.object({
4412
4425
  overallLimit: cursorNonNegativeIntegerSchema.nullish(),
4413
4426
  overallUsed: cursorNonNegativeIntegerSchema.nullish(),
4414
4427
  individualLimit: cursorNonNegativeIntegerSchema.nullish(),
@@ -4417,8 +4430,8 @@ var cursorUsageResponseSchema = z34.object({
4417
4430
  pooledUsed: cursorNonNegativeIntegerSchema.nullish()
4418
4431
  }).nullish()
4419
4432
  }).passthrough();
4420
- var cursorPlanResponseSchema = z34.object({
4421
- planInfo: z34.object({ planName: z34.string().min(1) }).nullish()
4433
+ var cursorPlanResponseSchema = z35.object({
4434
+ planInfo: z35.object({ planName: z35.string().min(1) }).nullish()
4422
4435
  }).passthrough();
4423
4436
  function normalizeUsage(rawUsage, rawPlan, accountEmail = null) {
4424
4437
  const usage = cursorUsageResponseSchema.safeParse(rawUsage);
@@ -4631,10 +4644,10 @@ function toolKindPresentation(args) {
4631
4644
 
4632
4645
  // ../provider-bridge-acp/src/dialect.ts
4633
4646
  var GENERIC_ACP_DIALECT = { id: "acp" };
4634
- var grokToolMetaSchema = z35.object({
4635
- "x.ai/tool": z35.object({
4636
- name: z35.string().optional(),
4637
- kind: z35.string().optional()
4647
+ var grokToolMetaSchema = z36.object({
4648
+ "x.ai/tool": z36.object({
4649
+ name: z36.string().optional(),
4650
+ kind: z36.string().optional()
4638
4651
  }).passthrough()
4639
4652
  }).passthrough();
4640
4653
  function grokToolIdentity(event) {
@@ -4650,10 +4663,10 @@ function grokToolIdentity(event) {
4650
4663
  };
4651
4664
  }
4652
4665
  var GROK_SPAWN_SUBAGENT_TOOL = "spawn_subagent";
4653
- var grokSpawnSubagentInputSchema = z35.object({
4654
- description: z35.string().optional(),
4655
- prompt: z35.string().optional(),
4656
- subagent_type: z35.string().optional()
4666
+ var grokSpawnSubagentInputSchema = z36.object({
4667
+ description: z36.string().optional(),
4668
+ prompt: z36.string().optional(),
4669
+ subagent_type: z36.string().optional()
4657
4670
  }).passthrough();
4658
4671
  function grokClassifyToolCall(event) {
4659
4672
  if (grokToolIdentity(event)?.name !== GROK_SPAWN_SUBAGENT_TOOL) {
@@ -4682,14 +4695,14 @@ var GROK_ACP_DIALECT = {
4682
4695
  classifyToolCall: grokClassifyToolCall
4683
4696
  };
4684
4697
  var CURSOR_TASK_TOOL = "task";
4685
- var cursorTaskRawInputSchema = z35.object({ _toolName: z35.string().optional() }).passthrough();
4698
+ var cursorTaskRawInputSchema = z36.object({ _toolName: z36.string().optional() }).passthrough();
4686
4699
  var CURSOR_TASK_METHOD = "cursor/task";
4687
- var cursorTaskParamsSchema = z35.object({
4688
- toolCallId: z35.string(),
4689
- description: z35.string().optional(),
4690
- prompt: z35.string().optional(),
4691
- agentId: z35.string().optional(),
4692
- model: z35.string().optional()
4700
+ var cursorTaskParamsSchema = z36.object({
4701
+ toolCallId: z36.string(),
4702
+ description: z36.string().optional(),
4703
+ prompt: z36.string().optional(),
4704
+ agentId: z36.string().optional(),
4705
+ model: z36.string().optional()
4693
4706
  }).passthrough();
4694
4707
  function cursorClassifyToolCall(event) {
4695
4708
  const parsed = cursorTaskRawInputSchema.safeParse(event.rawInput);
@@ -4737,31 +4750,31 @@ var CURSOR_ACP_DIALECT = {
4737
4750
  handleClientRequest: cursorHandleClientRequest,
4738
4751
  maintenance: CURSOR_ACP_MAINTENANCE
4739
4752
  };
4740
- var ompBashRawInputSchema = z35.object({
4741
- command: z35.string(),
4742
- async: z35.boolean().optional()
4753
+ var ompBashRawInputSchema = z36.object({
4754
+ command: z36.string(),
4755
+ async: z36.boolean().optional()
4743
4756
  }).passthrough();
4744
- var ompBashRawOutputSchema = z35.object({
4745
- content: z35.array(
4746
- z35.object({
4747
- type: z35.literal("text"),
4748
- text: z35.string()
4757
+ var ompBashRawOutputSchema = z36.object({
4758
+ content: z36.array(
4759
+ z36.object({
4760
+ type: z36.literal("text"),
4761
+ text: z36.string()
4749
4762
  }).passthrough()
4750
4763
  ),
4751
- details: z35.object({
4752
- exitCode: z35.number().int().optional(),
4753
- wallTimeMs: z35.number().nonnegative().optional(),
4754
- timedOut: z35.boolean().optional(),
4755
- signal: z35.unknown().optional(),
4756
- async: z35.unknown().optional()
4764
+ details: z36.object({
4765
+ exitCode: z36.number().int().optional(),
4766
+ wallTimeMs: z36.number().nonnegative().optional(),
4767
+ timedOut: z36.boolean().optional(),
4768
+ signal: z36.unknown().optional(),
4769
+ async: z36.unknown().optional()
4757
4770
  }).passthrough(),
4758
- exitCode: z35.number().int().nullable().optional(),
4759
- exit_code: z35.number().int().nullable().optional(),
4760
- stdout: z35.string().optional(),
4761
- stderr: z35.string().optional(),
4762
- output_for_prompt: z35.string().optional(),
4763
- signal: z35.string().nullable().optional(),
4764
- timed_out: z35.boolean().optional()
4771
+ exitCode: z36.number().int().nullable().optional(),
4772
+ exit_code: z36.number().int().nullable().optional(),
4773
+ stdout: z36.string().optional(),
4774
+ stderr: z36.string().optional(),
4775
+ output_for_prompt: z36.string().optional(),
4776
+ signal: z36.string().nullable().optional(),
4777
+ timed_out: z36.boolean().optional()
4765
4778
  }).passthrough();
4766
4779
  function stripOmpTrailingNotice(text, notice) {
4767
4780
  const suffix = `
@@ -4811,11 +4824,11 @@ var OMP_ACP_DIALECT = {
4811
4824
  id: "omp",
4812
4825
  commandResult: ompCommandResult
4813
4826
  };
4814
- var openCodeCommandRawOutputSchema = z35.object({
4815
- output: z35.unknown().optional(),
4816
- metadata: z35.object({
4817
- exit: z35.number().int().nullable().optional(),
4818
- output: z35.string().optional()
4827
+ var openCodeCommandRawOutputSchema = z36.object({
4828
+ output: z36.unknown().optional(),
4829
+ metadata: z36.object({
4830
+ exit: z36.number().int().nullable().optional(),
4831
+ output: z36.string().optional()
4819
4832
  }).passthrough().optional()
4820
4833
  }).passthrough();
4821
4834
  function normalizeOpenCodeCommandEvent(event) {
@@ -4865,17 +4878,17 @@ function resolveAcpDialect(launch) {
4865
4878
  }
4866
4879
 
4867
4880
  // ../provider-bridge-acp/src/tool-classification.ts
4868
- import { z as z37 } from "zod";
4881
+ import { z as z38 } from "zod";
4869
4882
 
4870
4883
  // ../provider-bridge-acp/src/tool-call-operation.ts
4871
4884
  import path3 from "node:path";
4872
- import { z as z36 } from "zod";
4873
- var acpRawInputCommandSchema = z36.object({ command: z36.string() }).passthrough();
4874
- var acpRawInputPathSchema = z36.object({
4875
- path: z36.string().optional(),
4876
- filePath: z36.string().optional(),
4877
- file_path: z36.string().optional(),
4878
- target_file: z36.string().optional()
4885
+ import { z as z37 } from "zod";
4886
+ var acpRawInputCommandSchema = z37.object({ command: z37.string() }).passthrough();
4887
+ var acpRawInputPathSchema = z37.object({
4888
+ path: z37.string().optional(),
4889
+ filePath: z37.string().optional(),
4890
+ file_path: z37.string().optional(),
4891
+ target_file: z37.string().optional()
4879
4892
  }).passthrough();
4880
4893
  function resolveAcpToolCallPath(value, options) {
4881
4894
  const cwd = options?.cwd;
@@ -5052,14 +5065,14 @@ function extractAcpToolCallOutputText(event) {
5052
5065
  ).trim();
5053
5066
  return rawOutputText.length > 0 ? rawOutputText : void 0;
5054
5067
  }
5055
- var commandRawOutputSchema = z37.object({
5056
- exitCode: z37.number().int().nullable().optional(),
5057
- exit_code: z37.number().int().nullable().optional(),
5058
- stdout: z37.string().optional(),
5059
- stderr: z37.string().optional(),
5060
- output_for_prompt: z37.string().optional(),
5061
- signal: z37.string().nullable().optional(),
5062
- timed_out: z37.boolean().optional()
5068
+ var commandRawOutputSchema = z38.object({
5069
+ exitCode: z38.number().int().nullable().optional(),
5070
+ exit_code: z38.number().int().nullable().optional(),
5071
+ stdout: z38.string().optional(),
5072
+ stderr: z38.string().optional(),
5073
+ output_for_prompt: z38.string().optional(),
5074
+ signal: z38.string().nullable().optional(),
5075
+ timed_out: z38.boolean().optional()
5063
5076
  }).passthrough();
5064
5077
  function emptyToUndefined(value) {
5065
5078
  return value === void 0 || value.length === 0 ? void 0 : value;
@@ -5128,10 +5141,10 @@ function extractAcpCommandResult(event) {
5128
5141
  ...output === void 0 ? {} : { output: scrubInlineImageDataUrls(output) }
5129
5142
  };
5130
5143
  }
5131
- var optionalNonBlank = z37.string().optional().transform(
5144
+ var optionalNonBlank = z38.string().optional().transform(
5132
5145
  (value) => value !== void 0 && value.trim().length > 0 ? value : void 0
5133
5146
  );
5134
- var searchRawInputSchema = z37.object({
5147
+ var searchRawInputSchema = z38.object({
5135
5148
  pattern: optionalNonBlank,
5136
5149
  query: optionalNonBlank,
5137
5150
  regex: optionalNonBlank,
@@ -5140,8 +5153,8 @@ var searchRawInputSchema = z37.object({
5140
5153
  path: optionalNonBlank,
5141
5154
  directory: optionalNonBlank
5142
5155
  }).passthrough();
5143
- var fetchRawInputSchema = z37.object({ url: optionalNonBlank, uri: optionalNonBlank }).passthrough();
5144
- var thinkRawInputSchema = z37.object({ thought: optionalNonBlank, thinking: optionalNonBlank }).passthrough();
5156
+ var fetchRawInputSchema = z38.object({ url: optionalNonBlank, uri: optionalNonBlank }).passthrough();
5157
+ var thinkRawInputSchema = z38.object({ thought: optionalNonBlank, thinking: optionalNonBlank }).passthrough();
5145
5158
  var SINGLE_TICKED_TOKEN_PATTERN = /^[^`]*`([^`\n]+)`[^`]*$/;
5146
5159
  var URL_PATTERN = /https?:\/\/[^\s`'"<>]+/g;
5147
5160
  function tickedTokenFromTitle(title) {
@@ -7100,7 +7113,7 @@ import { basename as basename2, dirname, join as join2, resolve as resolve2 } fr
7100
7113
  // ../provider-bridge-acp/src/bridge/tool-proxy-mcp.ts
7101
7114
  import { createConnection } from "node:net";
7102
7115
  import { createInterface as createInterface2 } from "node:readline";
7103
- import { z as z38 } from "zod";
7116
+ import { z as z39 } from "zod";
7104
7117
  var ACP_BRIDGE_MCP_SERVER_NAME = "bb-bridge";
7105
7118
  var ENV_HOST = "BB_ACP_DYNAMIC_TOOL_HOST";
7106
7119
  var ENV_PORT = "BB_ACP_DYNAMIC_TOOL_PORT";
@@ -7108,24 +7121,24 @@ var ENV_TOKEN = "BB_ACP_DYNAMIC_TOOL_TOKEN";
7108
7121
  var ENV_THREAD_ID = "BB_ACP_DYNAMIC_TOOL_THREAD_ID";
7109
7122
  var ENV_TOOLS = "BB_ACP_DYNAMIC_TOOLS";
7110
7123
  var ENV_PROGRESS_INTERVAL_MS = "BB_ACP_DYNAMIC_TOOL_PROGRESS_INTERVAL_MS";
7111
- var bridgeToolCallResponseSchema = z38.union([
7112
- z38.object({
7113
- ok: z38.literal(true),
7114
- content: z38.string(),
7115
- contentBlocks: z38.array(
7116
- z38.discriminatedUnion("type", [
7117
- z38.object({ type: z38.literal("text"), text: z38.string() }),
7118
- z38.object({
7119
- type: z38.literal("image"),
7120
- data: z38.string(),
7121
- mimeType: z38.string()
7124
+ var bridgeToolCallResponseSchema = z39.union([
7125
+ z39.object({
7126
+ ok: z39.literal(true),
7127
+ content: z39.string(),
7128
+ contentBlocks: z39.array(
7129
+ z39.discriminatedUnion("type", [
7130
+ z39.object({ type: z39.literal("text"), text: z39.string() }),
7131
+ z39.object({
7132
+ type: z39.literal("image"),
7133
+ data: z39.string(),
7134
+ mimeType: z39.string()
7122
7135
  })
7123
7136
  ])
7124
7137
  ).optional(),
7125
- images: z38.array(z38.object({ data: z38.string(), mimeType: z38.string() })).default([]),
7126
- isError: z38.boolean().optional()
7138
+ images: z39.array(z39.object({ data: z39.string(), mimeType: z39.string() })).default([]),
7139
+ isError: z39.boolean().optional()
7127
7140
  }),
7128
- z38.object({ ok: z38.literal(false), error: z38.string() })
7141
+ z39.object({ ok: z39.literal(false), error: z39.string() })
7129
7142
  ]);
7130
7143
  var nextMcpToolCallId = 0;
7131
7144
  var TOOL_CALL_PROGRESS_INTERVAL_MS = 15e3;
@@ -7812,20 +7825,20 @@ function applyPermissionCliArgs(agentArgs, permissionCli, permissionMode) {
7812
7825
  ...agentArgs.slice(insertAfterArgs)
7813
7826
  ];
7814
7827
  }
7815
- var dynamicToolBridgeRequestSchema = z39.discriminatedUnion("kind", [
7816
- z39.object({
7817
- kind: z39.literal("initialized"),
7818
- threadId: z39.string().min(1),
7819
- token: z39.string().min(1),
7820
- toolCount: z39.number().int().nonnegative()
7828
+ var dynamicToolBridgeRequestSchema = z40.discriminatedUnion("kind", [
7829
+ z40.object({
7830
+ kind: z40.literal("initialized"),
7831
+ threadId: z40.string().min(1),
7832
+ token: z40.string().min(1),
7833
+ toolCount: z40.number().int().nonnegative()
7821
7834
  }),
7822
- z39.object({
7823
- kind: z39.literal("toolCall"),
7824
- arguments: z39.record(z39.string(), z39.unknown()).default({}),
7825
- callId: z39.string().min(1),
7826
- threadId: z39.string().min(1),
7827
- token: z39.string().min(1),
7828
- tool: z39.string().min(1)
7835
+ z40.object({
7836
+ kind: z40.literal("toolCall"),
7837
+ arguments: z40.record(z40.string(), z40.unknown()).default({}),
7838
+ callId: z40.string().min(1),
7839
+ threadId: z40.string().min(1),
7840
+ token: z40.string().min(1),
7841
+ tool: z40.string().min(1)
7829
7842
  })
7830
7843
  ]);
7831
7844
  var cachedModelCatalog = null;
@@ -7856,7 +7869,7 @@ async function authenticateAcpAgent(args) {
7856
7869
  await args.connection.request({
7857
7870
  method: "authenticate",
7858
7871
  params: { methodId, _meta: { headless: true } },
7859
- resultSchema: z39.unknown()
7872
+ resultSchema: z40.unknown()
7860
7873
  });
7861
7874
  } catch (error) {
7862
7875
  throw new AcpAuthRequiredError(
@@ -8198,7 +8211,7 @@ async function selectAcpNativeModel(args) {
8198
8211
  configId: modelOption.id,
8199
8212
  value: selection.modelId
8200
8213
  },
8201
- resultSchema: z39.union([acpConfigStateResultSchema, z39.null()])
8214
+ resultSchema: z40.union([acpConfigStateResultSchema, z40.null()])
8202
8215
  });
8203
8216
  setModel = false;
8204
8217
  } catch {
@@ -8209,7 +8222,7 @@ async function selectAcpNativeModel(args) {
8209
8222
  configState = await args.connection.request({
8210
8223
  method: "session/set_model",
8211
8224
  params: { sessionId: args.sessionId, modelId: selection.modelId },
8212
- resultSchema: z39.union([acpConfigStateResultSchema, z39.null()])
8225
+ resultSchema: z40.union([acpConfigStateResultSchema, z40.null()])
8213
8226
  });
8214
8227
  }
8215
8228
  configOptions = configState?.configOptions ?? configOptions;
@@ -8712,7 +8725,7 @@ async function startAgentSession(request) {
8712
8725
  cwd: params.cwd,
8713
8726
  mcpServers
8714
8727
  },
8715
- resultSchema: z39.union([acpConfigStateResultSchema, z39.null()])
8728
+ resultSchema: z40.union([acpConfigStateResultSchema, z40.null()])
8716
8729
  });
8717
8730
  loadedConfigOptions = configState?.configOptions;
8718
8731
  loadedModels = configState?.models;
@@ -9149,12 +9162,12 @@ function decodeLaunchSpec(providerOptions) {
9149
9162
  );
9150
9163
  return launchSpec.success ? launchSpec.data : null;
9151
9164
  }
9152
- var acpProviderOptionsSchema = z39.object({
9153
- additionalWorkspaceWriteRoots: z39.array(z39.string()).optional(),
9154
- acpDialect: z39.string().min(1).optional(),
9155
- parameterizedModelPicker: z39.boolean().optional(),
9156
- primaryModels: z39.array(z39.string().min(1)).optional(),
9157
- reasoningProbePriorityModelIds: z39.array(z39.string().min(1)).optional()
9165
+ var acpProviderOptionsSchema = z40.object({
9166
+ additionalWorkspaceWriteRoots: z40.array(z40.string()).optional(),
9167
+ acpDialect: z40.string().min(1).optional(),
9168
+ parameterizedModelPicker: z40.boolean().optional(),
9169
+ primaryModels: z40.array(z40.string().min(1)).optional(),
9170
+ reasoningProbePriorityModelIds: z40.array(z40.string().min(1)).optional()
9158
9171
  }).passthrough();
9159
9172
  function decodeAcpModelPickerOptions(providerOptions) {
9160
9173
  const parsed = acpProviderOptionsSchema.parse(providerOptions ?? {});
@@ -9467,7 +9480,7 @@ var experimental_providerBridge = experimental_defineProviderBridge({
9467
9480
  });
9468
9481
 
9469
9482
  // ../provider-bridge-acp/src/probe.ts
9470
- import { z as z40 } from "zod";
9483
+ import { z as z41 } from "zod";
9471
9484
  var PROBE_TIMEOUT_MS = 1e4;
9472
9485
  function describe(error) {
9473
9486
  if (error instanceof AcpAgentExitedError) {
@@ -9533,9 +9546,9 @@ async function probeAcpAgent(request) {
9533
9546
  connected.kill();
9534
9547
  }
9535
9548
  }
9536
- var acpAgentProbeSchema = z40.union([
9537
- z40.object({ reachable: z40.literal(true), fork: z40.boolean() }),
9538
- z40.object({ reachable: z40.literal(false), reason: z40.string() })
9549
+ var acpAgentProbeSchema = z41.union([
9550
+ z41.object({ reachable: z41.literal(true), fork: z41.boolean() }),
9551
+ z41.object({ reachable: z41.literal(false), reason: z41.string() })
9539
9552
  ]);
9540
9553
  export {
9541
9554
  acpAgentProbeSchema as experimental_acpAgentProbeSchema,