@get-bb/plugin-sdk 0.6.33 → 0.6.39

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.
@@ -1030,7 +1030,7 @@ function withoutBridgeRuntimeEnv(env) {
1030
1030
  }
1031
1031
 
1032
1032
  // ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
1033
- import { z as z22 } from "zod";
1033
+ import { z as z23 } from "zod";
1034
1034
 
1035
1035
  // ../domain/src/context-snapshot.ts
1036
1036
  import { z as z3 } from "zod";
@@ -1114,7 +1114,10 @@ var reasoningLevelValues = [
1114
1114
  "max",
1115
1115
  "ultra"
1116
1116
  ];
1117
- var reasoningLevelSchema = z5.enum(reasoningLevelValues);
1117
+ var reasoningLevelSchema = z5.string().min(1);
1118
+ function isStandardReasoningLevel(level) {
1119
+ return reasoningLevelValues.includes(level);
1120
+ }
1118
1121
  var serviceTierSchema = z5.string().min(1);
1119
1122
  var instructionModeValues = ["append", "replace"];
1120
1123
  var instructionModeSchema = z5.enum(instructionModeValues);
@@ -1199,6 +1202,11 @@ var canonicalPromptMentionResourceSchema = z5.discriminatedUnion("kind", [
1199
1202
  icon: z5.string().nullable().optional(),
1200
1203
  itemId: z5.string(),
1201
1204
  label: z5.string()
1205
+ }),
1206
+ z5.object({
1207
+ kind: z5.literal("attachment"),
1208
+ path: z5.string(),
1209
+ label: z5.string()
1202
1210
  })
1203
1211
  ]);
1204
1212
  function normalizeLegacyPromptMentionResource(value) {
@@ -1381,11 +1389,17 @@ var runtimePermissionPolicySchema = z5.discriminatedUnion(
1381
1389
  ]
1382
1390
  );
1383
1391
  var promptModeSchema = z5.literal("plan");
1392
+ var sessionOptionValueSchema = z5.union([z5.string(), z5.boolean()]);
1393
+ var sessionOptionSelectionsSchema = z5.record(
1394
+ z5.string().min(1),
1395
+ sessionOptionValueSchema
1396
+ );
1384
1397
  var runtimeThreadExecutionBaseOptionsSchema = z5.object({
1385
1398
  model: z5.string().min(1),
1386
1399
  serviceTier: serviceTierSchema,
1387
1400
  reasoningLevel: reasoningLevelSchema,
1388
1401
  promptMode: promptModeSchema.optional(),
1402
+ sessionOptions: sessionOptionSelectionsSchema.optional(),
1389
1403
  providerOptions: jsonObjectSchema
1390
1404
  });
1391
1405
  var runtimeThreadExecutionOptionsSchema = runtimeThreadExecutionBaseOptionsSchema.and(runtimePermissionPolicySchema);
@@ -1414,7 +1428,7 @@ var providerNativeSkillRootsSchema = z6.object({
1414
1428
  user: uniqueProviderSkillRootPathsSchema.default([]),
1415
1429
  project: uniqueProviderSkillRootPathsSchema.default([])
1416
1430
  }).strict();
1417
- var acpReasoningCliLevelValueOverridesSchema = z6.partialRecord(
1431
+ var acpReasoningCliLevelValueOverridesSchema = z6.record(
1418
1432
  reasoningLevelSchema,
1419
1433
  z6.string().min(1)
1420
1434
  );
@@ -2840,11 +2854,16 @@ var threadEventTokenUsageBreakdownSchema = z18.object({
2840
2854
  outputTokens: z18.number(),
2841
2855
  reasoningOutputTokens: z18.number()
2842
2856
  });
2857
+ var threadUsageCostSchema = z18.object({
2858
+ amount: z18.number().nonnegative(),
2859
+ currency: z18.string().min(1)
2860
+ });
2843
2861
  var threadEventContextWindowUsageSchema = z18.object({
2844
2862
  snapshot: contextSnapshotSchema.optional(),
2845
2863
  usedTokens: z18.number().nullable(),
2846
2864
  modelContextWindow: z18.number().nullable(),
2847
- estimated: z18.boolean()
2865
+ estimated: z18.boolean(),
2866
+ cost: threadUsageCostSchema.optional()
2848
2867
  });
2849
2868
  var threadEventTokenUsageSchema = z18.object({
2850
2869
  total: threadEventTokenUsageBreakdownSchema,
@@ -3027,7 +3046,8 @@ var unscopedProviderEventSchema = z18.discriminatedUnion("type", [
3027
3046
  type: z18.literal("thread/name/updated"),
3028
3047
  threadId: z18.string(),
3029
3048
  providerThreadId: z18.string(),
3030
- threadName: z18.string()
3049
+ threadName: z18.string(),
3050
+ source: z18.literal("agent").optional()
3031
3051
  }),
3032
3052
  z18.object({
3033
3053
  type: z18.literal("thread/compacted"),
@@ -3298,103 +3318,154 @@ function toPositiveNumber(value) {
3298
3318
  return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
3299
3319
  }
3300
3320
 
3301
- // ../domain/src/provider-fork.ts
3321
+ // ../domain/src/thread-provider-state.ts
3302
3322
  import { z as z19 } from "zod";
3323
+ var THREAD_PROVIDER_COMMANDS_STATE_KIND = "bb/provider-commands";
3324
+ var THREAD_SESSION_OPTIONS_STATE_KIND = "bb/session-options";
3325
+ var threadProviderCommandSchema = z19.object({
3326
+ name: z19.string().min(1),
3327
+ description: z19.string(),
3328
+ inputHint: z19.string().min(1).optional()
3329
+ });
3330
+ var threadProviderCommandsStateSchema = z19.object({
3331
+ commands: z19.array(threadProviderCommandSchema).max(500)
3332
+ });
3333
+ var threadSessionOptionValueSchema = z19.object({
3334
+ id: z19.string().min(1),
3335
+ label: z19.string().min(1),
3336
+ description: z19.string().min(1).optional(),
3337
+ group: z19.string().min(1).optional()
3338
+ });
3339
+ var threadSessionOptionBaseShape = {
3340
+ id: z19.string().min(1),
3341
+ label: z19.string().min(1),
3342
+ description: z19.string().min(1).optional(),
3343
+ category: z19.string().min(1).optional()
3344
+ };
3345
+ var threadSessionOptionSchema = z19.discriminatedUnion("type", [
3346
+ z19.object({
3347
+ ...threadSessionOptionBaseShape,
3348
+ type: z19.literal("select"),
3349
+ value: z19.string(),
3350
+ values: z19.array(threadSessionOptionValueSchema).max(1e3)
3351
+ }),
3352
+ z19.object({
3353
+ ...threadSessionOptionBaseShape,
3354
+ type: z19.literal("boolean"),
3355
+ value: z19.boolean(),
3356
+ fixed: z19.boolean().optional()
3357
+ })
3358
+ ]);
3359
+ var threadSessionOptionsStateSchema = z19.object({
3360
+ options: z19.array(threadSessionOptionSchema).max(64)
3361
+ });
3362
+ var threadSessionOptionSelectionsStateSchema = z19.object({
3363
+ selections: sessionOptionSelectionsSchema
3364
+ });
3365
+ var CORE_THREAD_STATE_SCHEMAS = {
3366
+ [THREAD_PROVIDER_COMMANDS_STATE_KIND]: threadProviderCommandsStateSchema,
3367
+ [THREAD_SESSION_OPTIONS_STATE_KIND]: threadSessionOptionsStateSchema
3368
+ };
3369
+
3370
+ // ../domain/src/provider-fork.ts
3371
+ import { z as z20 } from "zod";
3303
3372
  var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
3304
- var providerForkSchema = z19.enum(PROVIDER_FORK_VALUES);
3373
+ var providerForkSchema = z20.enum(PROVIDER_FORK_VALUES);
3305
3374
 
3306
3375
  // ../domain/src/provider-types.ts
3307
- import { z as z20 } from "zod";
3308
- var modelReasoningEffortSchema = z20.object({
3376
+ import { z as z21 } from "zod";
3377
+ var modelReasoningEffortSchema = z21.object({
3309
3378
  reasoningEffort: reasoningLevelSchema,
3310
- description: z20.string()
3379
+ label: z21.string().min(1).optional(),
3380
+ description: z21.string()
3311
3381
  });
3312
- var modelServiceTierSchema = z20.object({
3382
+ var modelServiceTierSchema = z21.object({
3313
3383
  id: serviceTierSchema,
3314
- label: z20.string().min(1).optional(),
3315
- description: z20.string().min(1).optional()
3316
- });
3317
- var availableModelSchema = z20.object({
3318
- id: z20.string(),
3319
- model: z20.string(),
3320
- displayName: z20.string(),
3321
- routeProviderId: z20.string().min(1).optional(),
3322
- description: z20.string(),
3323
- supportedReasoningEfforts: z20.array(modelReasoningEffortSchema),
3384
+ label: z21.string().min(1).optional(),
3385
+ description: z21.string().min(1).optional()
3386
+ });
3387
+ var availableModelSchema = z21.object({
3388
+ id: z21.string(),
3389
+ model: z21.string(),
3390
+ displayName: z21.string(),
3391
+ routeProviderId: z21.string().min(1).optional(),
3392
+ description: z21.string(),
3393
+ supportedReasoningEfforts: z21.array(modelReasoningEffortSchema),
3324
3394
  defaultReasoningEffort: reasoningLevelSchema,
3325
- supportedServiceTiers: z20.array(modelServiceTierSchema).optional(),
3326
- isDefault: z20.boolean()
3327
- });
3328
- var providerModelCatalogScopeSchema = z20.enum(["host", "workspace"]);
3329
- var providerCapabilitiesSchema = z20.object({
3330
- supportsThreadArchive: z20.boolean(),
3331
- supportsThreadRename: z20.boolean(),
3332
- supportsServiceTier: z20.boolean(),
3333
- supportsNativeUserQuestion: z20.boolean(),
3334
- supportsFork: z20.boolean(),
3335
- supportsSessionRewind: z20.boolean(),
3336
- permissionModes: z20.array(permissionModeSchema).min(1),
3395
+ supportedServiceTiers: z21.array(modelServiceTierSchema).optional(),
3396
+ sessionOptions: z21.array(threadSessionOptionSchema).max(64).optional(),
3397
+ isDefault: z21.boolean()
3398
+ });
3399
+ var providerModelCatalogScopeSchema = z21.enum(["host", "workspace"]);
3400
+ var providerCapabilitiesSchema = z21.object({
3401
+ supportsThreadArchive: z21.boolean(),
3402
+ supportsThreadRename: z21.boolean(),
3403
+ supportsServiceTier: z21.boolean(),
3404
+ supportsNativeUserQuestion: z21.boolean(),
3405
+ supportsFork: z21.boolean(),
3406
+ supportsSessionRewind: z21.boolean(),
3407
+ permissionModes: z21.array(permissionModeSchema).min(1),
3337
3408
  modelCatalogScope: providerModelCatalogScopeSchema
3338
3409
  });
3339
- var providerComposerCommandSchema = z20.object({
3410
+ var providerComposerCommandSchema = z21.object({
3340
3411
  trigger: promptMentionCommandTriggerSchema,
3341
- name: z20.string().min(1).regex(/^[^\s/$]+$/u),
3342
- trailingText: z20.string().regex(/^\s*$/u)
3412
+ name: z21.string().min(1).regex(/^[^\s/$]+$/u),
3413
+ trailingText: z21.string().regex(/^\s*$/u)
3343
3414
  });
3344
- var providerComposerActionSchema = z20.discriminatedUnion("kind", [
3345
- z20.object({
3346
- kind: z20.literal("skills"),
3415
+ var providerComposerActionSchema = z21.discriminatedUnion("kind", [
3416
+ z21.object({
3417
+ kind: z21.literal("skills"),
3347
3418
  trigger: promptMentionCommandTriggerSchema
3348
3419
  }),
3349
- z20.object({
3350
- kind: z20.literal("plan"),
3420
+ z21.object({
3421
+ kind: z21.literal("plan"),
3351
3422
  command: providerComposerCommandSchema
3352
3423
  }),
3353
- z20.object({
3354
- kind: z20.literal("goal"),
3424
+ z21.object({
3425
+ kind: z21.literal("goal"),
3355
3426
  command: providerComposerCommandSchema
3356
3427
  })
3357
3428
  ]);
3358
- var providerStringsSchema = z20.object({
3359
- signInHint: z20.string().min(1),
3360
- expiredHint: z20.string().min(1),
3361
- installUrl: z20.string().min(1),
3362
- brandPrefix: z20.string().min(1).optional(),
3363
- planModeCopy: z20.string().min(1).optional(),
3364
- iconTint: z20.object({ light: z20.string().min(1), dark: z20.string().min(1) }).optional()
3365
- });
3366
- var providerOptionDescriptorSchema = z20.object({
3367
- id: z20.string().min(1),
3368
- label: z20.string().min(1),
3369
- description: z20.string().min(1).optional()
3370
- });
3371
- var providerExtensionKindInfoSchema = z20.object({
3372
- item: z20.boolean(),
3373
- state: z20.boolean()
3374
- });
3375
- var providerExtensionKindsSchema = z20.record(
3429
+ var providerStringsSchema = z21.object({
3430
+ signInHint: z21.string().min(1),
3431
+ expiredHint: z21.string().min(1),
3432
+ installUrl: z21.string().min(1),
3433
+ brandPrefix: z21.string().min(1).optional(),
3434
+ planModeCopy: z21.string().min(1).optional(),
3435
+ iconTint: z21.object({ light: z21.string().min(1), dark: z21.string().min(1) }).optional()
3436
+ });
3437
+ var providerOptionDescriptorSchema = z21.object({
3438
+ id: z21.string().min(1),
3439
+ label: z21.string().min(1),
3440
+ description: z21.string().min(1).optional()
3441
+ });
3442
+ var providerExtensionKindInfoSchema = z21.object({
3443
+ item: z21.boolean(),
3444
+ state: z21.boolean()
3445
+ });
3446
+ var providerExtensionKindsSchema = z21.record(
3376
3447
  extensionKindSchema,
3377
3448
  providerExtensionKindInfoSchema
3378
3449
  );
3379
- var providerInfoSchema = z20.object({
3380
- id: z20.string(),
3381
- pluginId: z20.string().min(1),
3382
- displayName: z20.string(),
3383
- family: z20.string().min(1).optional(),
3384
- icon: z20.object({ glyph: z20.string().min(1) }).optional(),
3385
- logoUrl: z20.string().min(1).nullable(),
3386
- maintenance: z20.object({
3387
- health: z20.boolean(),
3388
- usage: z20.boolean(),
3389
- installation: z20.boolean()
3450
+ var providerInfoSchema = z21.object({
3451
+ id: z21.string(),
3452
+ pluginId: z21.string().min(1),
3453
+ displayName: z21.string(),
3454
+ family: z21.string().min(1).optional(),
3455
+ icon: z21.object({ glyph: z21.string().min(1) }).optional(),
3456
+ logoUrl: z21.string().min(1).nullable(),
3457
+ maintenance: z21.object({
3458
+ health: z21.boolean(),
3459
+ usage: z21.boolean(),
3460
+ installation: z21.boolean()
3390
3461
  }),
3391
3462
  capabilities: providerCapabilitiesSchema,
3392
- composerActions: z20.array(providerComposerActionSchema),
3463
+ composerActions: z21.array(providerComposerActionSchema),
3393
3464
  completedTurnDisplay: completedTurnDisplaySchema,
3394
- available: z20.boolean(),
3465
+ available: z21.boolean(),
3395
3466
  strings: providerStringsSchema.optional(),
3396
- serviceTiers: z20.array(providerOptionDescriptorSchema).optional(),
3397
- reasoningLevels: z20.array(providerOptionDescriptorSchema).optional(),
3467
+ serviceTiers: z21.array(providerOptionDescriptorSchema).optional(),
3468
+ reasoningLevels: z21.array(providerOptionDescriptorSchema).optional(),
3398
3469
  extensionKinds: providerExtensionKindsSchema.optional()
3399
3470
  });
3400
3471
  var providerRecoveryKindValues = [
@@ -3404,34 +3475,34 @@ var providerRecoveryKindValues = [
3404
3475
  "staleTurn",
3405
3476
  "rateLimited"
3406
3477
  ];
3407
- var providerRecoveryKindSchema = z20.enum(providerRecoveryKindValues);
3408
- var toolCallOutputItemSchema = z20.discriminatedUnion("type", [
3409
- z20.object({
3410
- type: z20.literal("inputText"),
3411
- text: z20.string()
3478
+ var providerRecoveryKindSchema = z21.enum(providerRecoveryKindValues);
3479
+ var toolCallOutputItemSchema = z21.discriminatedUnion("type", [
3480
+ z21.object({
3481
+ type: z21.literal("inputText"),
3482
+ text: z21.string()
3412
3483
  }),
3413
- z20.object({
3414
- type: z20.literal("inputImage"),
3415
- imageUrl: z20.string()
3484
+ z21.object({
3485
+ type: z21.literal("inputImage"),
3486
+ imageUrl: z21.string()
3416
3487
  })
3417
3488
  ]);
3418
- var toolCallRequestSchema = z20.object({
3419
- requestId: z20.union([z20.string().min(1), z20.number()]),
3420
- threadId: z20.string().min(1),
3421
- providerThreadId: z20.string().min(1),
3422
- turnId: z20.string().min(1),
3423
- callId: z20.string().min(1),
3424
- tool: z20.string().min(1),
3425
- arguments: z20.unknown().optional()
3426
- });
3427
- var toolCallResponseSchema = z20.object({
3428
- contentItems: z20.array(toolCallOutputItemSchema),
3429
- success: z20.boolean()
3430
- });
3431
- var dynamicToolSchema = z20.object({
3432
- name: z20.string(),
3433
- description: z20.string(),
3434
- inputSchema: z20.unknown(),
3489
+ var toolCallRequestSchema = z21.object({
3490
+ requestId: z21.union([z21.string().min(1), z21.number()]),
3491
+ threadId: z21.string().min(1),
3492
+ providerThreadId: z21.string().min(1),
3493
+ turnId: z21.string().min(1),
3494
+ callId: z21.string().min(1),
3495
+ tool: z21.string().min(1),
3496
+ arguments: z21.unknown().optional()
3497
+ });
3498
+ var toolCallResponseSchema = z21.object({
3499
+ contentItems: z21.array(toolCallOutputItemSchema),
3500
+ success: z21.boolean()
3501
+ });
3502
+ var dynamicToolSchema = z21.object({
3503
+ name: z21.string(),
3504
+ description: z21.string(),
3505
+ inputSchema: z21.unknown(),
3435
3506
  presentation: threadEventItemPresentationSchema.optional()
3436
3507
  });
3437
3508
 
@@ -3479,64 +3550,66 @@ var REASONING_EFFORT_BY_LEVEL = {
3479
3550
  ultra: ULTRA_REASONING_EFFORT
3480
3551
  };
3481
3552
  function reasoningEffortsForLevels(levels) {
3482
- return levels.map((level) => ({ ...REASONING_EFFORT_BY_LEVEL[level] }));
3553
+ return levels.map(
3554
+ (level) => isStandardReasoningLevel(level) ? { ...REASONING_EFFORT_BY_LEVEL[level] } : { reasoningEffort: level, description: level }
3555
+ );
3483
3556
  }
3484
3557
 
3485
3558
  // ../provider-bridge-protocol/src/bridge-requests.ts
3486
- import { z as z21 } from "zod";
3559
+ import { z as z22 } from "zod";
3487
3560
  var BRIDGE_INBOUND_REQUEST_METHODS = {
3488
3561
  toolCall: "item/tool/call",
3489
3562
  interactionRequest: "interaction/request"
3490
3563
  };
3491
- var toolCallRequestParamsSchema = z21.object({
3492
- providerThreadId: z21.string().min(1),
3493
- threadId: z21.string().min(1).optional(),
3494
- turnId: z21.union([z21.string().min(1), z21.null()]),
3495
- callId: z21.string().min(1),
3496
- tool: z21.string().min(1),
3497
- arguments: z21.unknown(),
3498
- providerNativeIds: z21.boolean().optional()
3564
+ var toolCallRequestParamsSchema = z22.object({
3565
+ providerThreadId: z22.string().min(1),
3566
+ threadId: z22.string().min(1).optional(),
3567
+ turnId: z22.union([z22.string().min(1), z22.null()]),
3568
+ callId: z22.string().min(1),
3569
+ tool: z22.string().min(1),
3570
+ arguments: z22.unknown(),
3571
+ providerNativeIds: z22.boolean().optional()
3499
3572
  }).passthrough();
3500
- var toolCallResultSchema = z21.object({
3501
- success: z21.boolean(),
3502
- contentItems: z21.array(
3503
- z21.discriminatedUnion("type", [
3504
- z21.object({ type: z21.literal("inputText"), text: z21.string() }),
3505
- z21.object({
3506
- type: z21.literal("inputImage"),
3507
- imageUrl: z21.string().min(1)
3573
+ var toolCallResultSchema = z22.object({
3574
+ success: z22.boolean(),
3575
+ contentItems: z22.array(
3576
+ z22.discriminatedUnion("type", [
3577
+ z22.object({ type: z22.literal("inputText"), text: z22.string() }),
3578
+ z22.object({
3579
+ type: z22.literal("inputImage"),
3580
+ imageUrl: z22.string().min(1)
3508
3581
  })
3509
3582
  ])
3510
3583
  )
3511
3584
  }).passthrough();
3512
- var interactionRequestParamsSchema = z21.object({
3513
- providerThreadId: z21.string().min(1),
3514
- threadId: z21.string().min(1).optional(),
3515
- turnId: z21.union([z21.string().min(1), z21.null()]),
3585
+ var interactionRequestParamsSchema = z22.object({
3586
+ providerThreadId: z22.string().min(1),
3587
+ threadId: z22.string().min(1).optional(),
3588
+ turnId: z22.union([z22.string().min(1), z22.null()]),
3516
3589
  payload: pendingInteractionPayloadSchema,
3517
- providerNativeIds: z21.boolean().optional()
3590
+ providerNativeIds: z22.boolean().optional()
3518
3591
  }).passthrough();
3519
3592
 
3520
3593
  // ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
3521
- var bridgeRequestEnvelopeSchema = z22.object({
3522
- jsonrpc: z22.literal("2.0"),
3523
- id: z22.union([z22.string(), z22.number()]),
3524
- method: z22.string(),
3525
- params: z22.record(z22.string(), z22.unknown()).optional()
3526
- });
3527
- var jsonRpcErrorSchema = z22.object({
3528
- code: z22.number(),
3529
- message: z22.string().optional(),
3530
- data: z22.unknown().optional()
3531
- });
3532
- var jsonRpcSuccessResponseSchema = z22.object({
3533
- jsonrpc: z22.literal("2.0"),
3534
- id: z22.union([z22.string(), z22.number()]),
3535
- result: z22.unknown()
3536
- });
3537
- var jsonRpcErrorResponseSchema = z22.object({
3538
- jsonrpc: z22.literal("2.0"),
3539
- id: z22.union([z22.string(), z22.number()]),
3594
+ var bridgeRequestEnvelopeSchema = z23.object({
3595
+ jsonrpc: z23.literal("2.0"),
3596
+ id: z23.union([z23.string(), z23.number()]),
3597
+ method: z23.string(),
3598
+ params: z23.record(z23.string(), z23.unknown()).optional()
3599
+ });
3600
+ var jsonRpcErrorSchema = z23.object({
3601
+ code: z23.number(),
3602
+ message: z23.string().optional(),
3603
+ data: z23.unknown().optional()
3604
+ });
3605
+ var jsonRpcSuccessResponseSchema = z23.object({
3606
+ jsonrpc: z23.literal("2.0"),
3607
+ id: z23.union([z23.string(), z23.number()]),
3608
+ result: z23.unknown()
3609
+ });
3610
+ var jsonRpcErrorResponseSchema = z23.object({
3611
+ jsonrpc: z23.literal("2.0"),
3612
+ id: z23.union([z23.string(), z23.number()]),
3540
3613
  error: jsonRpcErrorSchema
3541
3614
  });
3542
3615
  function isJsonRpcRequest(input) {
@@ -3624,47 +3697,47 @@ function buildBridgeToolCallContent(result) {
3624
3697
  }
3625
3698
 
3626
3699
  // ../provider-bridge-protocol/src/bridge-kit/json-rpc-envelope.ts
3627
- import { z as z23 } from "zod";
3628
- var recordSchema = z23.record(z23.string(), z23.unknown());
3629
- var jsonRpcEnvelopeSchema = z23.object({
3630
- jsonrpc: z23.literal("2.0"),
3631
- method: z23.string(),
3700
+ import { z as z24 } from "zod";
3701
+ var recordSchema = z24.record(z24.string(), z24.unknown());
3702
+ var jsonRpcEnvelopeSchema = z24.object({
3703
+ jsonrpc: z24.literal("2.0"),
3704
+ method: z24.string(),
3632
3705
  params: recordSchema.optional()
3633
3706
  }).passthrough();
3634
- var sdkMessageEnvelopeSchema = z23.object({
3635
- jsonrpc: z23.literal("2.0"),
3636
- method: z23.literal("sdk/message"),
3637
- params: z23.object({
3638
- message: z23.unknown(),
3639
- threadId: z23.string().optional(),
3640
- parent_tool_use_id: z23.string().optional()
3707
+ var sdkMessageEnvelopeSchema = z24.object({
3708
+ jsonrpc: z24.literal("2.0"),
3709
+ method: z24.literal("sdk/message"),
3710
+ params: z24.object({
3711
+ message: z24.unknown(),
3712
+ threadId: z24.string().optional(),
3713
+ parent_tool_use_id: z24.string().optional()
3641
3714
  }).passthrough()
3642
3715
  }).passthrough();
3643
- var threadIdentityEnvelopeSchema = z23.object({
3644
- jsonrpc: z23.literal("2.0"),
3645
- method: z23.literal("thread/identity"),
3646
- params: z23.object({
3647
- threadId: z23.string().optional(),
3648
- providerThreadId: z23.string().optional()
3716
+ var threadIdentityEnvelopeSchema = z24.object({
3717
+ jsonrpc: z24.literal("2.0"),
3718
+ method: z24.literal("thread/identity"),
3719
+ params: z24.object({
3720
+ threadId: z24.string().optional(),
3721
+ providerThreadId: z24.string().optional()
3649
3722
  }).passthrough()
3650
3723
  }).passthrough();
3651
- var threadContextWindowUsageEnvelopeSchema = z23.object({
3652
- jsonrpc: z23.literal("2.0"),
3653
- method: z23.literal("thread/contextWindowUsage/updated"),
3654
- params: z23.object({
3655
- threadId: z23.string().optional(),
3656
- contextWindowUsage: z23.object({
3657
- usedTokens: z23.number().nullable(),
3658
- modelContextWindow: z23.number().nullable(),
3659
- estimated: z23.boolean()
3724
+ var threadContextWindowUsageEnvelopeSchema = z24.object({
3725
+ jsonrpc: z24.literal("2.0"),
3726
+ method: z24.literal("thread/contextWindowUsage/updated"),
3727
+ params: z24.object({
3728
+ threadId: z24.string().optional(),
3729
+ contextWindowUsage: z24.object({
3730
+ usedTokens: z24.number().nullable(),
3731
+ modelContextWindow: z24.number().nullable(),
3732
+ estimated: z24.boolean()
3660
3733
  })
3661
3734
  }).passthrough()
3662
3735
  }).passthrough();
3663
- var errorEnvelopeSchema = z23.object({
3664
- jsonrpc: z23.literal("2.0"),
3665
- method: z23.literal("error"),
3666
- params: z23.object({
3667
- message: z23.string().optional()
3736
+ var errorEnvelopeSchema = z24.object({
3737
+ jsonrpc: z24.literal("2.0"),
3738
+ method: z24.literal("error"),
3739
+ params: z24.object({
3740
+ message: z24.string().optional()
3668
3741
  }).passthrough().optional()
3669
3742
  }).passthrough();
3670
3743
 
@@ -11084,7 +11157,7 @@ import { constants as fsConstants } from "node:fs";
11084
11157
  import { access } from "node:fs/promises";
11085
11158
  import path8 from "node:path";
11086
11159
  import { promisify as promisify4 } from "node:util";
11087
- import { z as z24 } from "zod";
11160
+ import { z as z25 } from "zod";
11088
11161
  var execFileAsync2 = promisify4(execFile3);
11089
11162
  var CLI_PROBE_TIMEOUT_MS = 5e3;
11090
11163
  var INSTALLATION_CHECK_TIMEOUT_MS = 15e3;
@@ -11193,8 +11266,8 @@ function firstLine(value) {
11193
11266
  function npmGlobalPackageVersion(value, npmPackage) {
11194
11267
  if (value === null) return null;
11195
11268
  try {
11196
- const parsed = z24.object({
11197
- dependencies: z24.record(z24.string(), z24.object({ version: z24.string().min(1) })).default({})
11269
+ const parsed = z25.object({
11270
+ dependencies: z25.record(z25.string(), z25.object({ version: z25.string().min(1) })).default({})
11198
11271
  }).safeParse(JSON.parse(value));
11199
11272
  return parsed.success ? parsed.data.dependencies[npmPackage]?.version ?? null : null;
11200
11273
  } catch {
@@ -11245,9 +11318,9 @@ function clampPercent(value) {
11245
11318
  }
11246
11319
 
11247
11320
  // ../provider-bridge-protocol/src/bridge-kit/provider-tool-call-contract.ts
11248
- import { z as z25 } from "zod";
11249
- var providerToolCallCancellationSchema = z25.object({
11250
- requestId: z25.union([z25.string(), z25.number().int()])
11321
+ import { z as z26 } from "zod";
11322
+ var providerToolCallCancellationSchema = z26.object({
11323
+ requestId: z26.union([z26.string(), z26.number().int()])
11251
11324
  });
11252
11325
 
11253
11326
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility.ts
@@ -11262,10 +11335,10 @@ function createProviderVisibilityMetadata(args) {
11262
11335
  }
11263
11336
 
11264
11337
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
11265
- import { z as z27 } from "zod";
11338
+ import { z as z28 } from "zod";
11266
11339
 
11267
11340
  // ../provider-bridge-protocol/src/errors.ts
11268
- import { z as z26 } from "zod";
11341
+ import { z as z27 } from "zod";
11269
11342
  var BRIDGE_JSON_RPC_ERRORS = {
11270
11343
  INVALID_PARAMS: -32602,
11271
11344
  METHOD_NOT_FOUND: -32601,
@@ -11275,12 +11348,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
11275
11348
  FORK_CHECKPOINT_UNSUPPORTED: -32003,
11276
11349
  MISSING_EXECUTABLE: -32004
11277
11350
  };
11278
- var providerRecoveryHintSchema = z26.object({
11351
+ var providerRecoveryHintSchema = z27.object({
11279
11352
  kind: providerRecoveryKindSchema,
11280
- message: z26.string().min(1),
11281
- retryable: z26.boolean()
11353
+ message: z27.string().min(1),
11354
+ retryable: z27.boolean()
11282
11355
  });
11283
- var bridgeErrorDataSchema = z26.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
11356
+ var bridgeErrorDataSchema = z27.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
11284
11357
 
11285
11358
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
11286
11359
  var JSON_RPC_INVALID_PARAMS_CODE = -32602;
@@ -11298,7 +11371,7 @@ var ProviderResponseEncodeError = class extends Error {
11298
11371
  this.name = "ProviderResponseEncodeError";
11299
11372
  }
11300
11373
  };
11301
- var ignoredJsonRpcResultSchema = z27.unknown();
11374
+ var ignoredJsonRpcResultSchema = z28.unknown();
11302
11375
 
11303
11376
  // ../provider-bridge-protocol/src/version.ts
11304
11377
  var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
@@ -11306,67 +11379,68 @@ var THREAD_DELTA_GRAMMAR_V2 = PROVIDER_BRIDGE_PROTOCOL_VERSION;
11306
11379
  var THREAD_DELTA_GRAMMAR_V3 = 3;
11307
11380
 
11308
11381
  // ../provider-bridge-protocol/src/handshake.ts
11309
- import { z as z28 } from "zod";
11310
- var bridgeGrammarVersionsSchema = z28.tuple([z28.number().int().positive(), z28.number().int().positive()]).refine(([min, max]) => min <= max, {
11382
+ import { z as z29 } from "zod";
11383
+ var bridgeGrammarVersionsSchema = z29.tuple([z29.number().int().positive(), z29.number().int().positive()]).refine(([min, max]) => min <= max, {
11311
11384
  message: "grammarVersions must be an ascending [min, max] range"
11312
11385
  });
11313
- var bridgeSteerModeSchema = z28.enum(["inject", "queue"]);
11314
- var bridgeCapabilitiesSchema = z28.object({
11315
- sessionRestore: z28.boolean().default(false),
11316
- threadArchive: z28.boolean().default(false),
11317
- threadRename: z28.boolean().default(false),
11318
- threadGoalClear: z28.boolean().default(false),
11386
+ var bridgeSteerModeSchema = z29.enum(["inject", "queue"]);
11387
+ var bridgeCapabilitiesSchema = z29.object({
11388
+ sessionRestore: z29.boolean().default(false),
11389
+ threadArchive: z29.boolean().default(false),
11390
+ threadRename: z29.boolean().default(false),
11391
+ threadGoalClear: z29.boolean().default(false),
11319
11392
  fork: providerForkSchema.default("none"),
11320
- approvalEnforcedBy: z28.enum(["runtime", "provider"]).default("runtime"),
11393
+ approvalEnforcedBy: z29.enum(["runtime", "provider"]).default("runtime"),
11321
11394
  grammarVersions: bridgeGrammarVersionsSchema.default([
11322
11395
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
11323
11396
  PROVIDER_BRIDGE_PROTOCOL_VERSION
11324
11397
  ]),
11325
11398
  steerMode: bridgeSteerModeSchema.default("queue"),
11326
- skills: z28.object({ configure: z28.boolean().default(false) }).default({ configure: false })
11399
+ skills: z29.object({ configure: z29.boolean().default(false) }).default({ configure: false })
11327
11400
  }).passthrough();
11328
- var initializeParamsSchema = z28.object({
11329
- protocolVersion: z28.number().int().positive(),
11330
- client: z28.object({ name: z28.string().min(1), version: z28.string().min(1) }),
11401
+ var initializeParamsSchema = z29.object({
11402
+ protocolVersion: z29.number().int().positive(),
11403
+ client: z29.object({ name: z29.string().min(1), version: z29.string().min(1) }),
11331
11404
  grammarVersions: bridgeGrammarVersionsSchema.default([
11332
11405
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
11333
11406
  PROVIDER_BRIDGE_PROTOCOL_VERSION
11334
11407
  ])
11335
11408
  }).passthrough();
11336
- var initializeResultSchema = z28.object({
11337
- protocolVersion: z28.number().int().positive(),
11338
- capabilities: z28.preprocess(
11409
+ var initializeResultSchema = z29.object({
11410
+ protocolVersion: z29.number().int().positive(),
11411
+ capabilities: z29.preprocess(
11339
11412
  (value) => value ?? {},
11340
11413
  bridgeCapabilitiesSchema
11341
11414
  )
11342
11415
  }).passthrough();
11343
11416
 
11344
11417
  // ../provider-bridge-protocol/src/execution-options.ts
11345
- import { z as z29 } from "zod";
11346
- var bridgeExecutionOptionsSchema = z29.object({
11347
- model: z29.string().min(1).optional(),
11418
+ import { z as z30 } from "zod";
11419
+ var bridgeExecutionOptionsSchema = z30.object({
11420
+ model: z30.string().min(1).optional(),
11348
11421
  serviceTier: serviceTierSchema.optional(),
11349
11422
  reasoningLevel: reasoningLevelSchema.optional(),
11350
11423
  promptMode: promptModeSchema.optional(),
11351
- instructions: z29.string().optional(),
11352
- envVars: z29.record(z29.string(), z29.string()).optional(),
11353
- providerOptions: z29.record(z29.string(), z29.unknown()).optional()
11424
+ sessionOptions: sessionOptionSelectionsSchema.optional(),
11425
+ instructions: z30.string().optional(),
11426
+ envVars: z30.record(z30.string(), z30.string()).optional(),
11427
+ providerOptions: z30.record(z30.string(), z30.unknown()).optional()
11354
11428
  }).and(runtimePermissionPolicySchema);
11355
11429
 
11356
11430
  // ../provider-bridge-protocol/src/provider-maintenance.ts
11357
- import { z as z30 } from "zod";
11358
- var providerMaintenanceParamsSchema = z30.object({
11359
- providerId: z30.string().min(1),
11360
- cwd: z30.string().min(1).optional(),
11361
- providerOptions: z30.record(z30.string(), z30.unknown()).optional()
11431
+ import { z as z31 } from "zod";
11432
+ var providerMaintenanceParamsSchema = z31.object({
11433
+ providerId: z31.string().min(1),
11434
+ cwd: z31.string().min(1).optional(),
11435
+ providerOptions: z31.record(z31.string(), z31.unknown()).optional()
11362
11436
  }).passthrough();
11363
- var providerInstallationRequirementSchema = z30.enum(["thread_rewind"]);
11437
+ var providerInstallationRequirementSchema = z31.enum(["thread_rewind"]);
11364
11438
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
11365
11439
  requirement: providerInstallationRequirementSchema.optional(),
11366
- checkUpdates: z30.boolean().default(true)
11440
+ checkUpdates: z31.boolean().default(true)
11367
11441
  });
11368
- var providerHealthSchema = z30.object({
11369
- status: z30.enum([
11442
+ var providerHealthSchema = z31.object({
11443
+ status: z31.enum([
11370
11444
  "ready",
11371
11445
  "not_installed",
11372
11446
  "unauthenticated",
@@ -11374,115 +11448,115 @@ var providerHealthSchema = z30.object({
11374
11448
  "unsupported_version",
11375
11449
  "unknown"
11376
11450
  ]),
11377
- statusMessage: z30.string().min(1).nullable(),
11378
- accountEmail: z30.string().nullable(),
11379
- planLabel: z30.string().min(1).nullable(),
11380
- installedVersion: z30.string().min(1).nullable(),
11381
- minimumSupportedVersion: z30.string().min(1).nullable(),
11382
- canInstall: z30.boolean(),
11383
- canUpdate: z30.boolean(),
11384
- loginCommand: z30.string().min(1).nullable(),
11385
- localLoginCommand: z30.string().min(1).nullable().optional()
11451
+ statusMessage: z31.string().min(1).nullable(),
11452
+ accountEmail: z31.string().nullable(),
11453
+ planLabel: z31.string().min(1).nullable(),
11454
+ installedVersion: z31.string().min(1).nullable(),
11455
+ minimumSupportedVersion: z31.string().min(1).nullable(),
11456
+ canInstall: z31.boolean(),
11457
+ canUpdate: z31.boolean(),
11458
+ loginCommand: z31.string().min(1).nullable(),
11459
+ localLoginCommand: z31.string().min(1).nullable().optional()
11386
11460
  }).passthrough();
11387
- var providerUsageWindowSchema = z30.object({
11388
- label: z30.string().min(1),
11389
- usedPercent: z30.number().min(0).max(100),
11390
- resetsAt: z30.string().min(1).nullable(),
11391
- cost: z30.object({
11392
- usedUsdCents: z30.number().int().nonnegative(),
11393
- limitUsdCents: z30.number().int().positive()
11461
+ var providerUsageWindowSchema = z31.object({
11462
+ label: z31.string().min(1),
11463
+ usedPercent: z31.number().min(0).max(100),
11464
+ resetsAt: z31.string().min(1).nullable(),
11465
+ cost: z31.object({
11466
+ usedUsdCents: z31.number().int().nonnegative(),
11467
+ limitUsdCents: z31.number().int().positive()
11394
11468
  }).optional()
11395
11469
  }).passthrough();
11396
- var providerUsageSchema = z30.discriminatedUnion("status", [
11397
- z30.object({
11398
- status: z30.literal("ok"),
11399
- accountEmail: z30.string().email().nullable(),
11400
- planLabel: z30.string().min(1).nullable(),
11401
- windows: z30.array(providerUsageWindowSchema)
11470
+ var providerUsageSchema = z31.discriminatedUnion("status", [
11471
+ z31.object({
11472
+ status: z31.literal("ok"),
11473
+ accountEmail: z31.string().email().nullable(),
11474
+ planLabel: z31.string().min(1).nullable(),
11475
+ windows: z31.array(providerUsageWindowSchema)
11402
11476
  }).passthrough(),
11403
- z30.object({ status: z30.literal("not_installed") }).passthrough(),
11404
- z30.object({ status: z30.literal("unauthenticated") }).passthrough(),
11405
- z30.object({ status: z30.literal("expired") }).passthrough(),
11406
- z30.object({
11407
- status: z30.literal("error"),
11408
- message: z30.string().min(1),
11409
- planLabel: z30.string().min(1).nullable().default(null),
11410
- accountEmail: z30.string().nullable().default(null)
11477
+ z31.object({ status: z31.literal("not_installed") }).passthrough(),
11478
+ z31.object({ status: z31.literal("unauthenticated") }).passthrough(),
11479
+ z31.object({ status: z31.literal("expired") }).passthrough(),
11480
+ z31.object({
11481
+ status: z31.literal("error"),
11482
+ message: z31.string().min(1),
11483
+ planLabel: z31.string().min(1).nullable().default(null),
11484
+ accountEmail: z31.string().nullable().default(null)
11411
11485
  }).passthrough()
11412
11486
  ]);
11413
- var providerHealthResultSchema = z30.discriminatedUnion("supported", [
11414
- z30.object({ supported: z30.literal(false) }).passthrough(),
11415
- z30.object({
11416
- supported: z30.literal(true),
11487
+ var providerHealthResultSchema = z31.discriminatedUnion("supported", [
11488
+ z31.object({ supported: z31.literal(false) }).passthrough(),
11489
+ z31.object({
11490
+ supported: z31.literal(true),
11417
11491
  health: providerHealthSchema
11418
11492
  }).passthrough()
11419
11493
  ]);
11420
- var providerUsageResultSchema = z30.discriminatedUnion("supported", [
11421
- z30.object({ supported: z30.literal(false) }).passthrough(),
11422
- z30.object({
11423
- supported: z30.literal(true),
11494
+ var providerUsageResultSchema = z31.discriminatedUnion("supported", [
11495
+ z31.object({ supported: z31.literal(false) }).passthrough(),
11496
+ z31.object({
11497
+ supported: z31.literal(true),
11424
11498
  usage: providerUsageSchema
11425
11499
  }).passthrough()
11426
11500
  ]);
11427
- var providerInstallationActionKindSchema = z30.enum([
11501
+ var providerInstallationActionKindSchema = z31.enum([
11428
11502
  "install",
11429
11503
  "update"
11430
11504
  ]);
11431
- var providerInstallationActionSchema = z30.object({
11505
+ var providerInstallationActionSchema = z31.object({
11432
11506
  kind: providerInstallationActionKindSchema,
11433
- label: z30.enum(["Install", "Update"]),
11434
- command: z30.string().min(1)
11507
+ label: z31.enum(["Install", "Update"]),
11508
+ command: z31.string().min(1)
11435
11509
  }).passthrough();
11436
- var providerInstallationSourceSchema = z30.enum([
11510
+ var providerInstallationSourceSchema = z31.enum([
11437
11511
  "notInstalled",
11438
11512
  "npmGlobal",
11439
11513
  "external"
11440
11514
  ]);
11441
- var providerInstallationStatusSchema = z30.object({
11442
- executableName: z30.string().min(1),
11443
- executablePath: z30.string().min(1).nullable(),
11444
- installed: z30.boolean(),
11515
+ var providerInstallationStatusSchema = z31.object({
11516
+ executableName: z31.string().min(1),
11517
+ executablePath: z31.string().min(1).nullable(),
11518
+ installed: z31.boolean(),
11445
11519
  installSource: providerInstallationSourceSchema,
11446
- currentVersion: z30.string().min(1).nullable(),
11447
- latestVersion: z30.string().min(1).nullable(),
11448
- minimumSupportedVersion: z30.string().min(1).nullable(),
11449
- npmPackageName: z30.string().min(1).nullable(),
11450
- npmGlobalPackageVersion: z30.string().min(1).nullable(),
11520
+ currentVersion: z31.string().min(1).nullable(),
11521
+ latestVersion: z31.string().min(1).nullable(),
11522
+ minimumSupportedVersion: z31.string().min(1).nullable(),
11523
+ npmPackageName: z31.string().min(1).nullable(),
11524
+ npmGlobalPackageVersion: z31.string().min(1).nullable(),
11451
11525
  installAction: providerInstallationActionSchema.nullable(),
11452
- needsUpdate: z30.boolean(),
11453
- versionUnsupported: z30.boolean()
11526
+ needsUpdate: z31.boolean(),
11527
+ versionUnsupported: z31.boolean()
11454
11528
  }).passthrough();
11455
11529
  var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
11456
11530
  action: providerInstallationActionKindSchema
11457
11531
  });
11458
- var providerInstallationCommandSchema = z30.object({
11459
- command: z30.string().min(1),
11460
- args: z30.array(z30.string()).max(64),
11461
- displayCommand: z30.string().min(1)
11532
+ var providerInstallationCommandSchema = z31.object({
11533
+ command: z31.string().min(1),
11534
+ args: z31.array(z31.string()).max(64),
11535
+ displayCommand: z31.string().min(1)
11462
11536
  }).passthrough();
11463
- var providerInstallationVerificationSchema = z30.discriminatedUnion(
11537
+ var providerInstallationVerificationSchema = z31.discriminatedUnion(
11464
11538
  "kind",
11465
11539
  [
11466
- z30.object({ kind: z30.literal("installed") }).passthrough(),
11467
- z30.object({
11468
- kind: z30.literal("version_changed"),
11469
- previousVersion: z30.string().min(1)
11540
+ z31.object({ kind: z31.literal("installed") }).passthrough(),
11541
+ z31.object({
11542
+ kind: z31.literal("version_changed"),
11543
+ previousVersion: z31.string().min(1)
11470
11544
  }).passthrough(),
11471
- z30.object({
11472
- kind: z30.literal("version_at_least"),
11473
- version: z30.string().min(1)
11545
+ z31.object({
11546
+ kind: z31.literal("version_at_least"),
11547
+ version: z31.string().min(1)
11474
11548
  }).passthrough()
11475
11549
  ]
11476
11550
  );
11477
- var providerInstallationRunResultSchema = z30.discriminatedUnion(
11551
+ var providerInstallationRunResultSchema = z31.discriminatedUnion(
11478
11552
  "available",
11479
11553
  [
11480
- z30.object({
11481
- available: z30.literal(false),
11482
- message: z30.string().min(1)
11554
+ z31.object({
11555
+ available: z31.literal(false),
11556
+ message: z31.string().min(1)
11483
11557
  }).passthrough(),
11484
- z30.object({
11485
- available: z30.literal(true),
11558
+ z31.object({
11559
+ available: z31.literal(true),
11486
11560
  command: providerInstallationCommandSchema,
11487
11561
  verification: providerInstallationVerificationSchema
11488
11562
  }).passthrough()
@@ -11490,7 +11564,7 @@ var providerInstallationRunResultSchema = z30.discriminatedUnion(
11490
11564
  );
11491
11565
 
11492
11566
  // ../provider-bridge-protocol/src/requests.ts
11493
- import { z as z31 } from "zod";
11567
+ import { z as z32 } from "zod";
11494
11568
  var BRIDGE_REQUEST_METHODS = {
11495
11569
  initialize: "initialize",
11496
11570
  modelList: "model/list",
@@ -11512,78 +11586,78 @@ var BRIDGE_REQUEST_METHODS = {
11512
11586
  skillsConfigure: "skills/configure"
11513
11587
  };
11514
11588
  var sessionConstructionFields = {
11515
- threadId: z31.string().min(1),
11516
- cwd: z31.string().min(1),
11589
+ threadId: z32.string().min(1),
11590
+ cwd: z32.string().min(1),
11517
11591
  options: bridgeExecutionOptionsSchema,
11518
- dynamicTools: z31.array(dynamicToolSchema).optional(),
11519
- disallowedTools: z31.array(z31.string().min(1)).optional(),
11592
+ dynamicTools: z32.array(dynamicToolSchema).optional(),
11593
+ disallowedTools: z32.array(z32.string().min(1)).optional(),
11520
11594
  instructionMode: instructionModeSchema
11521
11595
  };
11522
- var modelListParamsSchema = z31.object({ cwd: z31.string().min(1).optional() }).passthrough();
11523
- var threadStartParamsSchema = z31.object({
11596
+ var modelListParamsSchema = z32.object({ cwd: z32.string().min(1).optional() }).passthrough();
11597
+ var threadStartParamsSchema = z32.object({
11524
11598
  ...sessionConstructionFields,
11525
- input: z31.array(promptInputSchema).optional()
11599
+ input: z32.array(promptInputSchema).optional()
11526
11600
  }).passthrough();
11527
- var threadResumeParamsSchema = z31.object({
11601
+ var threadResumeParamsSchema = z32.object({
11528
11602
  ...sessionConstructionFields,
11529
- providerThreadId: z31.string().min(1)
11603
+ providerThreadId: z32.string().min(1)
11530
11604
  }).passthrough();
11531
- var threadForkParamsSchema = z31.object({
11605
+ var threadForkParamsSchema = z32.object({
11532
11606
  ...sessionConstructionFields,
11533
- sourceProviderThreadId: z31.string().min(1),
11534
- sourceProviderCheckpointId: z31.string().min(1).optional()
11607
+ sourceProviderThreadId: z32.string().min(1),
11608
+ sourceProviderCheckpointId: z32.string().min(1).optional()
11535
11609
  }).passthrough();
11536
- var threadStopParamsSchema = z31.object({
11537
- threadId: z31.string().min(1),
11538
- providerThreadId: z31.string().min(1),
11539
- intent: z31.enum(["interrupt", "release"]),
11540
- activeTurnId: z31.string().min(1).nullable()
11610
+ var threadStopParamsSchema = z32.object({
11611
+ threadId: z32.string().min(1),
11612
+ providerThreadId: z32.string().min(1),
11613
+ intent: z32.enum(["interrupt", "release"]),
11614
+ activeTurnId: z32.string().min(1).nullable()
11541
11615
  }).passthrough();
11542
- var threadRefParams = z31.object({
11543
- threadId: z31.string().min(1),
11544
- providerThreadId: z31.string().min(1)
11616
+ var threadRefParams = z32.object({
11617
+ threadId: z32.string().min(1),
11618
+ providerThreadId: z32.string().min(1)
11545
11619
  }).passthrough();
11546
11620
  var threadDiscardParamsSchema = threadRefParams;
11547
11621
  var threadArchiveParamsSchema = threadRefParams;
11548
11622
  var threadUnarchiveParamsSchema = threadRefParams;
11549
11623
  var threadGoalClearParamsSchema = threadRefParams;
11550
- var threadNameSetParamsSchema = z31.object({
11551
- threadId: z31.string().min(1),
11552
- providerThreadId: z31.string().min(1),
11553
- title: z31.string().min(1)
11624
+ var threadNameSetParamsSchema = z32.object({
11625
+ threadId: z32.string().min(1),
11626
+ providerThreadId: z32.string().min(1),
11627
+ title: z32.string().min(1)
11554
11628
  }).passthrough();
11555
11629
  var turnInputFields = {
11556
- threadId: z31.string().min(1),
11557
- providerThreadId: z31.string().min(1),
11558
- input: z31.array(promptInputSchema),
11630
+ threadId: z32.string().min(1),
11631
+ providerThreadId: z32.string().min(1),
11632
+ input: z32.array(promptInputSchema),
11559
11633
  clientRequestId: clientTurnRequestIdSchema,
11560
11634
  options: bridgeExecutionOptionsSchema
11561
11635
  };
11562
- var turnStartParamsSchema = z31.object(turnInputFields).passthrough();
11563
- var turnSteerParamsSchema = z31.object({
11636
+ var turnStartParamsSchema = z32.object(turnInputFields).passthrough();
11637
+ var turnSteerParamsSchema = z32.object({
11564
11638
  ...turnInputFields,
11565
- expectedTurnId: z31.string().min(1)
11639
+ expectedTurnId: z32.string().min(1)
11566
11640
  }).passthrough();
11567
- var skillsConfigureRootSchema = z31.object({
11568
- id: z31.string().min(1),
11569
- path: z31.string().min(1),
11570
- skills: z31.array(
11571
- z31.object({
11572
- name: z31.string().min(1),
11573
- description: z31.string()
11641
+ var skillsConfigureRootSchema = z32.object({
11642
+ id: z32.string().min(1),
11643
+ path: z32.string().min(1),
11644
+ skills: z32.array(
11645
+ z32.object({
11646
+ name: z32.string().min(1),
11647
+ description: z32.string()
11574
11648
  }).passthrough()
11575
11649
  )
11576
11650
  }).passthrough();
11577
- var skillsConfigureParamsSchema = z31.object({
11578
- roots: z31.array(skillsConfigureRootSchema)
11651
+ var skillsConfigureParamsSchema = z32.object({
11652
+ roots: z32.array(skillsConfigureRootSchema)
11579
11653
  }).passthrough();
11580
- var threadIdentityResultSchema = z31.object({
11581
- providerThreadId: z31.string().min(1),
11582
- sessionRestorable: z31.boolean().optional()
11654
+ var threadIdentityResultSchema = z32.object({
11655
+ providerThreadId: z32.string().min(1),
11656
+ sessionRestorable: z32.boolean().optional()
11583
11657
  }).passthrough();
11584
11658
 
11585
11659
  // ../provider-bridge-protocol/src/notifications.ts
11586
- import { z as z32 } from "zod";
11660
+ import { z as z33 } from "zod";
11587
11661
  var BRIDGE_NOTIFICATION_METHODS = {
11588
11662
  threadIdentity: "thread/identity",
11589
11663
  sessionReplaced: "session/replaced",
@@ -11591,142 +11665,142 @@ var BRIDGE_NOTIFICATION_METHODS = {
11591
11665
  providerRecovery: "provider/recovery",
11592
11666
  error: "error"
11593
11667
  };
11594
- var threadIdentityNotificationSchema = z32.object({
11595
- threadId: z32.string().min(1),
11596
- providerThreadId: z32.string().min(1),
11597
- sessionRestorable: z32.boolean().optional()
11668
+ var threadIdentityNotificationSchema = z33.object({
11669
+ threadId: z33.string().min(1),
11670
+ providerThreadId: z33.string().min(1),
11671
+ sessionRestorable: z33.boolean().optional()
11598
11672
  }).passthrough();
11599
- var sessionReplacedNotificationSchema = z32.object({
11600
- threadId: z32.string().min(1),
11601
- providerThreadId: z32.string().min(1).nullable(),
11602
- reason: z32.string().min(1),
11603
- contextLost: z32.boolean().default(false),
11604
- showRuntimeNote: z32.boolean().default(false)
11673
+ var sessionReplacedNotificationSchema = z33.object({
11674
+ threadId: z33.string().min(1),
11675
+ providerThreadId: z33.string().min(1).nullable(),
11676
+ reason: z33.string().min(1),
11677
+ contextLost: z33.boolean().default(false),
11678
+ showRuntimeNote: z33.boolean().default(false)
11605
11679
  }).passthrough();
11606
- var providerRecoveryNotificationSchema = z32.object({
11607
- threadId: z32.string().min(1).optional(),
11680
+ var providerRecoveryNotificationSchema = z33.object({
11681
+ threadId: z33.string().min(1).optional(),
11608
11682
  ...providerRecoveryHintSchema.shape
11609
11683
  }).passthrough();
11610
- var errorNotificationSchema = z32.object({
11611
- threadId: z32.string().min(1).optional(),
11612
- providerThreadId: z32.string().min(1).optional(),
11613
- message: z32.string().min(1)
11684
+ var errorNotificationSchema = z33.object({
11685
+ threadId: z33.string().min(1).optional(),
11686
+ providerThreadId: z33.string().min(1).optional(),
11687
+ message: z33.string().min(1)
11614
11688
  }).passthrough();
11615
11689
 
11616
11690
  // ../provider-bridge-protocol/src/thread-delta.ts
11617
- import { z as z33 } from "zod";
11691
+ import { z as z34 } from "zod";
11618
11692
  var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
11619
11693
  var deltaPresentationSchema = threadEventItemPresentationSchema;
11620
11694
  var THREAD_DELTA_KEY_SEPARATOR = "";
11621
- var deltaKeyPartSchema = z33.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
11695
+ var deltaKeyPartSchema = z34.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
11622
11696
  message: "provider keys must not contain the internal key separator (\\u001f)"
11623
11697
  });
11624
- var deltaItemKeySchema = z33.object({
11698
+ var deltaItemKeySchema = z34.object({
11625
11699
  providerItemId: deltaKeyPartSchema.optional(),
11626
11700
  channel: deltaKeyPartSchema.optional(),
11627
11701
  parentRef: deltaKeyPartSchema.optional()
11628
11702
  });
11629
11703
  var providerTurnIdSchema = deltaKeyPartSchema;
11630
- var deltaFileChangeSchema = z33.object({
11631
- path: z33.string(),
11632
- kind: z33.enum(["add", "update", "delete"]),
11633
- movePath: z33.string().optional(),
11634
- diff: z33.string().optional(),
11635
- oldText: z33.string().optional(),
11636
- newText: z33.string().optional()
11637
- });
11638
- var deltaBackgroundTaskShapeSchema = z33.object({
11639
- type: z33.literal("backgroundTask"),
11640
- familyId: z33.string().min(1),
11641
- taskType: z33.string(),
11642
- description: z33.string(),
11704
+ var deltaFileChangeSchema = z34.object({
11705
+ path: z34.string(),
11706
+ kind: z34.enum(["add", "update", "delete"]),
11707
+ movePath: z34.string().optional(),
11708
+ diff: z34.string().optional(),
11709
+ oldText: z34.string().optional(),
11710
+ newText: z34.string().optional()
11711
+ });
11712
+ var deltaBackgroundTaskShapeSchema = z34.object({
11713
+ type: z34.literal("backgroundTask"),
11714
+ familyId: z34.string().min(1),
11715
+ taskType: z34.string(),
11716
+ description: z34.string(),
11643
11717
  status: threadEventItemStatusSchema,
11644
11718
  taskStatus: backgroundTaskStatusSchema,
11645
- skipTranscript: z33.boolean(),
11646
- workflowName: z33.string().optional(),
11719
+ skipTranscript: z34.boolean(),
11720
+ workflowName: z34.string().optional(),
11647
11721
  workflow: workflowProgressSnapshotSchema.optional(),
11648
11722
  usage: backgroundTaskUsageSchema.optional(),
11649
- summary: z33.string().optional(),
11650
- error: z33.string().optional(),
11651
- outputFile: z33.string().optional()
11723
+ summary: z34.string().optional(),
11724
+ error: z34.string().optional(),
11725
+ outputFile: z34.string().optional()
11652
11726
  });
11653
- var deltaFileReadShapeSchema = z33.object({
11654
- type: z33.literal("fileRead"),
11655
- path: z33.string(),
11656
- cmd: z33.string().optional()
11727
+ var deltaFileReadShapeSchema = z34.object({
11728
+ type: z34.literal("fileRead"),
11729
+ path: z34.string(),
11730
+ cmd: z34.string().optional()
11657
11731
  });
11658
- var deltaSearchShapeSchema = z33.object({
11659
- type: z33.literal("search"),
11732
+ var deltaSearchShapeSchema = z34.object({
11733
+ type: z34.literal("search"),
11660
11734
  mode: threadEventSearchModeSchema,
11661
- query: z33.string(),
11662
- path: z33.string().optional(),
11663
- cmd: z33.string().optional()
11735
+ query: z34.string(),
11736
+ path: z34.string().optional(),
11737
+ cmd: z34.string().optional()
11664
11738
  });
11665
- var deltaDelegationShapeSchema = z33.object({
11666
- type: z33.literal("delegation"),
11739
+ var deltaDelegationShapeSchema = z34.object({
11740
+ type: z34.literal("delegation"),
11667
11741
  childRef: deltaKeyPartSchema,
11668
- label: z33.string(),
11669
- background: z33.boolean(),
11670
- summary: z33.string().optional()
11742
+ label: z34.string(),
11743
+ background: z34.boolean(),
11744
+ summary: z34.string().optional()
11671
11745
  });
11672
- var deltaPlanStepsShapeSchema = z33.object({
11673
- type: z33.literal("planSteps"),
11674
- steps: z33.array(threadEventPlanStepSchema),
11675
- explanation: z33.string().optional()
11746
+ var deltaPlanStepsShapeSchema = z34.object({
11747
+ type: z34.literal("planSteps"),
11748
+ steps: z34.array(threadEventPlanStepSchema),
11749
+ explanation: z34.string().optional()
11676
11750
  });
11677
- var deltaExtensionShapeSchema = z33.object({
11678
- type: z33.literal("extension"),
11751
+ var deltaExtensionShapeSchema = z34.object({
11752
+ type: z34.literal("extension"),
11679
11753
  kind: extensionKindSchema,
11680
11754
  payload: jsonValueSchema
11681
11755
  });
11682
- var deltaItemShapeSchema = z33.discriminatedUnion("type", [
11683
- z33.object({
11684
- type: z33.literal("command"),
11685
- command: z33.string(),
11686
- cwd: z33.string(),
11687
- aggregatedOutput: z33.string().optional(),
11688
- exitCode: z33.number().optional(),
11689
- durationMs: z33.number().optional()
11756
+ var deltaItemShapeSchema = z34.discriminatedUnion("type", [
11757
+ z34.object({
11758
+ type: z34.literal("command"),
11759
+ command: z34.string(),
11760
+ cwd: z34.string(),
11761
+ aggregatedOutput: z34.string().optional(),
11762
+ exitCode: z34.number().optional(),
11763
+ durationMs: z34.number().optional()
11690
11764
  }),
11691
- z33.object({
11692
- type: z33.literal("fileChange"),
11693
- changes: z33.array(deltaFileChangeSchema)
11765
+ z34.object({
11766
+ type: z34.literal("fileChange"),
11767
+ changes: z34.array(deltaFileChangeSchema)
11694
11768
  }),
11695
- z33.object({
11696
- type: z33.literal("tool"),
11697
- tool: z33.string(),
11698
- server: z33.string().optional(),
11699
- args: z33.unknown().optional(),
11700
- result: z33.unknown().optional(),
11701
- error: z33.string().optional(),
11702
- durationMs: z33.number().optional()
11769
+ z34.object({
11770
+ type: z34.literal("tool"),
11771
+ tool: z34.string(),
11772
+ server: z34.string().optional(),
11773
+ args: z34.unknown().optional(),
11774
+ result: z34.unknown().optional(),
11775
+ error: z34.string().optional(),
11776
+ durationMs: z34.number().optional()
11703
11777
  }),
11704
- z33.object({ type: z33.literal("compaction") }),
11705
- z33.object({ type: z33.literal("agentMessage"), text: z33.string() }),
11706
- z33.object({
11707
- type: z33.literal("reasoning"),
11708
- summary: z33.array(z33.string()),
11709
- content: z33.array(z33.string())
11778
+ z34.object({ type: z34.literal("compaction") }),
11779
+ z34.object({ type: z34.literal("agentMessage"), text: z34.string() }),
11780
+ z34.object({
11781
+ type: z34.literal("reasoning"),
11782
+ summary: z34.array(z34.string()),
11783
+ content: z34.array(z34.string())
11710
11784
  }),
11711
- z33.object({ type: z33.literal("plan"), text: z33.string() }),
11712
- z33.object({
11713
- type: z33.literal("webSearch"),
11714
- queries: z33.array(z33.string()).min(1)
11785
+ z34.object({ type: z34.literal("plan"), text: z34.string() }),
11786
+ z34.object({
11787
+ type: z34.literal("webSearch"),
11788
+ queries: z34.array(z34.string()).min(1)
11715
11789
  }),
11716
- z33.object({
11717
- type: z33.literal("webFetch"),
11718
- url: z33.string(),
11719
- prompt: z33.string().nullable().optional(),
11720
- pattern: z33.string().nullable()
11790
+ z34.object({
11791
+ type: z34.literal("webFetch"),
11792
+ url: z34.string(),
11793
+ prompt: z34.string().nullable().optional(),
11794
+ pattern: z34.string().nullable()
11721
11795
  }),
11722
- z33.object({ type: z33.literal("imageView"), path: z33.string() }),
11723
- z33.object({
11724
- type: z33.literal("imageGeneration"),
11725
- prompt: z33.string().nullable(),
11726
- path: z33.string().nullable(),
11727
- result: z33.string().optional(),
11728
- error: z33.string().nullable(),
11729
- transparentBackground: z33.boolean()
11796
+ z34.object({ type: z34.literal("imageView"), path: z34.string() }),
11797
+ z34.object({
11798
+ type: z34.literal("imageGeneration"),
11799
+ prompt: z34.string().nullable(),
11800
+ path: z34.string().nullable(),
11801
+ result: z34.string().optional(),
11802
+ error: z34.string().nullable(),
11803
+ transparentBackground: z34.boolean()
11730
11804
  }),
11731
11805
  deltaBackgroundTaskShapeSchema,
11732
11806
  deltaFileReadShapeSchema,
@@ -11735,22 +11809,22 @@ var deltaItemShapeSchema = z33.discriminatedUnion("type", [
11735
11809
  deltaPlanStepsShapeSchema,
11736
11810
  deltaExtensionShapeSchema
11737
11811
  ]);
11738
- var deltaProgressSnapshotSchema = z33.discriminatedUnion("type", [
11812
+ var deltaProgressSnapshotSchema = z34.discriminatedUnion("type", [
11739
11813
  deltaBackgroundTaskShapeSchema,
11740
11814
  deltaDelegationShapeSchema
11741
11815
  ]);
11742
- var deltaTextChannelSchema = z33.enum([
11816
+ var deltaTextChannelSchema = z34.enum([
11743
11817
  "agentMessage",
11744
11818
  "reasoningSummary",
11745
11819
  "reasoningText",
11746
11820
  "plan"
11747
11821
  ]);
11748
- var deltaOutputChannelSchema = z33.enum(["command", "fileChange"]);
11749
- var deltaErrorSchema = z33.object({ message: z33.string() });
11750
- var deltaAttachSchema = z33.enum(["open", "currentOrLast"]);
11751
- var deltaNoTurnFallbackSchema = z33.object({
11822
+ var deltaOutputChannelSchema = z34.enum(["command", "fileChange"]);
11823
+ var deltaErrorSchema = z34.object({ message: z34.string() });
11824
+ var deltaAttachSchema = z34.enum(["open", "currentOrLast"]);
11825
+ var deltaNoTurnFallbackSchema = z34.object({
11752
11826
  raw: providerRawEventSchema,
11753
- rawType: z33.string()
11827
+ rawType: z34.string()
11754
11828
  });
11755
11829
  function requireExtensionPresentation(delta, ctx) {
11756
11830
  if (delta.item.type === "extension" && delta.presentation === void 0) {
@@ -11761,32 +11835,32 @@ function requireExtensionPresentation(delta, ctx) {
11761
11835
  });
11762
11836
  }
11763
11837
  }
11764
- var threadDeltaSchema = z33.discriminatedUnion("kind", [
11765
- z33.object({
11766
- kind: z33.literal("input.accepted"),
11838
+ var threadDeltaSchema = z34.discriminatedUnion("kind", [
11839
+ z34.object({
11840
+ kind: z34.literal("input.accepted"),
11767
11841
  clientRequestId: clientTurnRequestIdSchema,
11768
11842
  providerTurnId: providerTurnIdSchema.optional()
11769
11843
  }),
11770
- z33.object({
11771
- kind: z33.literal("input.provider"),
11772
- text: z33.string().min(1),
11844
+ z34.object({
11845
+ kind: z34.literal("input.provider"),
11846
+ text: z34.string().min(1),
11773
11847
  parentRef: deltaKeyPartSchema.optional()
11774
11848
  }),
11775
- z33.object({
11776
- kind: z33.literal("turn.open"),
11849
+ z34.object({
11850
+ kind: z34.literal("turn.open"),
11777
11851
  providerTurnId: providerTurnIdSchema.optional(),
11778
11852
  parentRef: deltaKeyPartSchema.optional()
11779
11853
  }),
11780
- z33.object({
11781
- kind: z33.literal("turn.boundary"),
11854
+ z34.object({
11855
+ kind: z34.literal("turn.boundary"),
11782
11856
  status: threadEventTurnStatusSchema,
11783
11857
  error: deltaErrorSchema.optional(),
11784
- providerCheckpointId: z33.string().min(1).optional(),
11785
- claimIfIdle: z33.boolean().optional(),
11858
+ providerCheckpointId: z34.string().min(1).optional(),
11859
+ claimIfIdle: z34.boolean().optional(),
11786
11860
  providerTurnId: providerTurnIdSchema.optional()
11787
11861
  }),
11788
- z33.object({
11789
- kind: z33.literal("item.open"),
11862
+ z34.object({
11863
+ kind: z34.literal("item.open"),
11790
11864
  key: deltaItemKeySchema,
11791
11865
  item: deltaItemShapeSchema,
11792
11866
  presentation: deltaPresentationSchema.optional(),
@@ -11794,147 +11868,152 @@ var threadDeltaSchema = z33.discriminatedUnion("kind", [
11794
11868
  providerTurnId: providerTurnIdSchema.optional(),
11795
11869
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
11796
11870
  }).superRefine(requireExtensionPresentation),
11797
- z33.object({
11798
- kind: z33.literal("item.close"),
11871
+ z34.object({
11872
+ kind: z34.literal("item.close"),
11799
11873
  key: deltaItemKeySchema,
11800
11874
  status: threadEventItemStatusSchema,
11801
- resultText: z33.string().optional(),
11802
- exitCode: z33.number().optional(),
11803
- aggregatedOutput: z33.string().optional(),
11804
- approvalStatus: z33.literal("denied").optional(),
11875
+ resultText: z34.string().optional(),
11876
+ exitCode: z34.number().optional(),
11877
+ aggregatedOutput: z34.string().optional(),
11878
+ approvalStatus: z34.literal("denied").optional(),
11805
11879
  item: deltaItemShapeSchema,
11806
11880
  presentation: deltaPresentationSchema.optional(),
11807
11881
  providerTurnId: providerTurnIdSchema.optional(),
11808
11882
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
11809
11883
  }).superRefine(requireExtensionPresentation),
11810
- z33.object({
11811
- kind: z33.literal("item.progress"),
11884
+ z34.object({
11885
+ kind: z34.literal("item.progress"),
11812
11886
  key: deltaItemKeySchema,
11813
- message: z33.string().optional(),
11887
+ message: z34.string().optional(),
11814
11888
  snapshot: deltaProgressSnapshotSchema.optional(),
11815
- flush: z33.boolean().optional(),
11889
+ flush: z34.boolean().optional(),
11816
11890
  providerTurnId: providerTurnIdSchema.optional(),
11817
11891
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
11818
11892
  }),
11819
- z33.object({
11820
- kind: z33.literal("item.textDelta"),
11893
+ z34.object({
11894
+ kind: z34.literal("item.textDelta"),
11821
11895
  key: deltaItemKeySchema,
11822
11896
  channel: deltaTextChannelSchema,
11823
- text: z33.string(),
11897
+ text: z34.string(),
11824
11898
  providerTurnId: providerTurnIdSchema.optional(),
11825
11899
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
11826
11900
  }),
11827
- z33.object({
11828
- kind: z33.literal("item.textClose"),
11901
+ z34.object({
11902
+ kind: z34.literal("item.textClose"),
11829
11903
  key: deltaItemKeySchema,
11830
11904
  channel: deltaTextChannelSchema,
11831
- text: z33.string().optional(),
11905
+ text: z34.string().optional(),
11832
11906
  providerTurnId: providerTurnIdSchema.optional(),
11833
11907
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
11834
11908
  }),
11835
- z33.object({
11836
- kind: z33.literal("item.outputDelta"),
11909
+ z34.object({
11910
+ kind: z34.literal("item.outputDelta"),
11837
11911
  key: deltaItemKeySchema,
11838
11912
  channel: deltaOutputChannelSchema,
11839
- text: z33.string(),
11913
+ text: z34.string(),
11840
11914
  providerTurnId: providerTurnIdSchema.optional(),
11841
11915
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
11842
11916
  }),
11843
- z33.object({
11844
- kind: z33.literal("command.outputSnapshot"),
11917
+ z34.object({
11918
+ kind: z34.literal("command.outputSnapshot"),
11845
11919
  key: deltaItemKeySchema,
11846
- text: z33.string(),
11920
+ text: z34.string(),
11847
11921
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
11848
11922
  }),
11849
- z33.object({
11850
- kind: z33.literal("usage"),
11923
+ z34.object({
11924
+ kind: z34.literal("usage"),
11851
11925
  total: threadEventTokenUsageBreakdownSchema,
11852
11926
  last: threadEventTokenUsageBreakdownSchema,
11853
- modelContextWindow: z33.number().nullable(),
11927
+ modelContextWindow: z34.number().nullable(),
11854
11928
  providerTurnId: providerTurnIdSchema.optional()
11855
11929
  }),
11856
- z33.object({
11857
- kind: z33.literal("contextWindow"),
11930
+ z34.object({
11931
+ kind: z34.literal("contextWindow"),
11858
11932
  snapshot: contextSnapshotSchema.optional(),
11859
- used: z33.number().nullable(),
11860
- size: z33.number().nullable().optional(),
11861
- estimated: z33.boolean(),
11933
+ used: z34.number().nullable(),
11934
+ size: z34.number().nullable().optional(),
11935
+ estimated: z34.boolean(),
11936
+ cost: threadUsageCostSchema.optional(),
11862
11937
  attach: deltaAttachSchema,
11863
11938
  providerTurnId: providerTurnIdSchema.optional()
11864
11939
  }),
11865
- z33.object({
11866
- kind: z33.literal("context.compacted"),
11940
+ z34.object({
11941
+ kind: z34.literal("context.compacted"),
11867
11942
  providerTurnId: providerTurnIdSchema.optional(),
11868
11943
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
11869
11944
  }),
11870
- z33.object({ kind: z33.literal("context.cleared") }),
11871
- z33.object({
11872
- kind: z33.literal("turn.diff"),
11873
- diff: z33.string(),
11945
+ z34.object({ kind: z34.literal("context.cleared") }),
11946
+ z34.object({
11947
+ kind: z34.literal("turn.diff"),
11948
+ diff: z34.string(),
11874
11949
  providerTurnId: providerTurnIdSchema.optional()
11875
11950
  }),
11876
- z33.object({ kind: z33.literal("thread.started") }),
11877
- z33.object({
11878
- kind: z33.literal("thread.identity"),
11879
- providerThreadId: z33.string().min(1)
11951
+ z34.object({ kind: z34.literal("thread.started") }),
11952
+ z34.object({
11953
+ kind: z34.literal("thread.identity"),
11954
+ providerThreadId: z34.string().min(1)
11955
+ }),
11956
+ z34.object({
11957
+ kind: z34.literal("thread.name"),
11958
+ name: z34.string().min(1),
11959
+ source: z34.literal("agent").optional()
11880
11960
  }),
11881
- z33.object({ kind: z33.literal("thread.name"), name: z33.string().min(1) }),
11882
- z33.object({
11883
- kind: z33.literal("extension.state"),
11961
+ z34.object({
11962
+ kind: z34.literal("extension.state"),
11884
11963
  extensionKind: extensionKindSchema,
11885
11964
  payload: jsonValueSchema
11886
11965
  }),
11887
- z33.object({
11888
- kind: z33.literal("provider.rateLimits"),
11966
+ z34.object({
11967
+ kind: z34.literal("provider.rateLimits"),
11889
11968
  rateLimits: providerRateLimitStateSchema
11890
11969
  }),
11891
- z33.object({
11892
- kind: z33.literal("provider.error"),
11893
- message: z33.string(),
11894
- detail: z33.string().optional(),
11895
- willRetry: z33.boolean().optional(),
11970
+ z34.object({
11971
+ kind: z34.literal("provider.error"),
11972
+ message: z34.string(),
11973
+ detail: z34.string().optional(),
11974
+ willRetry: z34.boolean().optional(),
11896
11975
  category: providerErrorCategorySchema.optional(),
11897
11976
  errorInfo: providerErrorInfoSchema.optional(),
11898
- settlesTurn: z33.boolean().optional(),
11977
+ settlesTurn: z34.boolean().optional(),
11899
11978
  providerTurnId: providerTurnIdSchema.optional(),
11900
- threadScoped: z33.boolean().optional()
11979
+ threadScoped: z34.boolean().optional()
11901
11980
  }),
11902
- z33.object({
11903
- kind: z33.literal("provider.modelFallback"),
11904
- originalModel: z33.string().min(1),
11905
- fallbackModel: z33.string().min(1),
11906
- reason: z33.enum(["refusal", "provider"]),
11907
- message: z33.string()
11981
+ z34.object({
11982
+ kind: z34.literal("provider.modelFallback"),
11983
+ originalModel: z34.string().min(1),
11984
+ fallbackModel: z34.string().min(1),
11985
+ reason: z34.enum(["refusal", "provider"]),
11986
+ message: z34.string()
11908
11987
  }),
11909
- z33.object({
11910
- kind: z33.literal("provider.warning"),
11911
- summary: z33.string().optional(),
11912
- details: z33.string().optional(),
11988
+ z34.object({
11989
+ kind: z34.literal("provider.warning"),
11990
+ summary: z34.string().optional(),
11991
+ details: z34.string().optional(),
11913
11992
  category: threadEventWarningCategorySchema.optional(),
11914
- vouchedTurn: z33.boolean().optional()
11993
+ vouchedTurn: z34.boolean().optional()
11915
11994
  }),
11916
- z33.object({
11917
- kind: z33.literal("unhandled"),
11995
+ z34.object({
11996
+ kind: z34.literal("unhandled"),
11918
11997
  raw: providerRawEventSchema,
11919
- rawType: z33.string(),
11920
- vouchedTurn: z33.boolean(),
11921
- onlyIfNoTurn: z33.boolean().optional(),
11998
+ rawType: z34.string(),
11999
+ vouchedTurn: z34.boolean(),
12000
+ onlyIfNoTurn: z34.boolean().optional(),
11922
12001
  parentRef: deltaKeyPartSchema.optional(),
11923
12002
  providerTurnId: providerTurnIdSchema.optional()
11924
12003
  }),
11925
- z33.object({ kind: z33.literal("session.ended") }),
11926
- z33.object({ kind: z33.literal("session.reset") })
12004
+ z34.object({ kind: z34.literal("session.ended") }),
12005
+ z34.object({ kind: z34.literal("session.reset") })
11927
12006
  ]);
11928
- var threadDeltaNotificationParamsSchema = z33.object({
11929
- threadId: z33.string().min(1),
11930
- deltas: z33.array(threadDeltaSchema)
12007
+ var threadDeltaNotificationParamsSchema = z34.object({
12008
+ threadId: z34.string().min(1),
12009
+ deltas: z34.array(threadDeltaSchema)
11931
12010
  }).passthrough();
11932
12011
 
11933
12012
  // ../provider-bridge-acp/src/launch-spec.ts
11934
- import { z as z34 } from "zod";
11935
- var acpNativeSkillRootsSchema = z34.object({
11936
- user: z34.array(providerNativeRootInputSchema).default([]),
11937
- project: z34.array(providerNativeRootInputSchema).default([])
12013
+ import { z as z35 } from "zod";
12014
+ var acpNativeSkillRootsSchema = z35.object({
12015
+ user: z35.array(providerNativeRootInputSchema).default([]),
12016
+ project: z35.array(providerNativeRootInputSchema).default([])
11938
12017
  }).strict().superRefine((roots, context) => {
11939
12018
  const normalized = providerNativeRootsSchema.safeParse(
11940
12019
  normalizeProviderNativeRoots(roots)
@@ -11950,16 +12029,16 @@ var acpNativeSkillRootsSchema = z34.object({
11950
12029
  });
11951
12030
  }
11952
12031
  });
11953
- var acpLaunchSpecSchema = z34.object({
11954
- displayName: z34.string().min(1),
11955
- command: z34.string().min(1),
11956
- args: z34.array(z34.string()),
11957
- env: z34.record(z34.string().min(1), z34.string()),
11958
- cwd: z34.string().min(1).optional(),
11959
- modelCli: z34.object({
11960
- listArgs: z34.array(z34.string()),
11961
- selectFlag: z34.string().min(1).optional(),
11962
- primaryModels: z34.array(z34.string())
12032
+ var acpLaunchSpecSchema = z35.object({
12033
+ displayName: z35.string().min(1),
12034
+ command: z35.string().min(1),
12035
+ args: z35.array(z35.string()),
12036
+ env: z35.record(z35.string().min(1), z35.string()),
12037
+ cwd: z35.string().min(1).optional(),
12038
+ modelCli: z35.object({
12039
+ listArgs: z35.array(z35.string()),
12040
+ selectFlag: z35.string().min(1).optional(),
12041
+ primaryModels: z35.array(z35.string())
11963
12042
  }).strict().transform(
11964
12043
  (modelCli) => modelCli.listArgs.length > 0 ? modelCli : void 0
11965
12044
  ).optional(),
@@ -11997,35 +12076,35 @@ function normalizeAcpLaunchSpec(spec) {
11997
12076
  }
11998
12077
 
11999
12078
  // src/claude-task-tools.ts
12000
- import { z as z35 } from "zod";
12001
- var claudeTaskToolNameSchema = z35.enum([
12079
+ import { z as z36 } from "zod";
12080
+ var claudeTaskToolNameSchema = z36.enum([
12002
12081
  "TaskCreate",
12003
12082
  "TaskGet",
12004
12083
  "TaskList",
12005
12084
  "TaskUpdate"
12006
12085
  ]);
12007
- var claudeTaskStatusSchema = z35.enum(["pending", "in_progress", "completed"]);
12008
- var claudeTaskCreateOutputSchema = z35.object({
12009
- task: z35.object({
12010
- id: z35.string(),
12011
- subject: z35.string()
12086
+ var claudeTaskStatusSchema = z36.enum(["pending", "in_progress", "completed"]);
12087
+ var claudeTaskCreateOutputSchema = z36.object({
12088
+ task: z36.object({
12089
+ id: z36.string(),
12090
+ subject: z36.string()
12012
12091
  }).passthrough()
12013
12092
  }).passthrough();
12014
- var claudeTaskGetOutputSchema = z35.object({
12015
- task: z35.object({
12016
- id: z35.string(),
12093
+ var claudeTaskGetOutputSchema = z36.object({
12094
+ task: z36.object({
12095
+ id: z36.string(),
12017
12096
  status: claudeTaskStatusSchema,
12018
- subject: z35.string()
12097
+ subject: z36.string()
12019
12098
  }).passthrough().nullable()
12020
12099
  }).passthrough();
12021
- var claudeTaskUpdateOutputSchema = z35.object({
12022
- success: z35.boolean(),
12023
- taskId: z35.string()
12100
+ var claudeTaskUpdateOutputSchema = z36.object({
12101
+ success: z36.boolean(),
12102
+ taskId: z36.string()
12024
12103
  }).passthrough();
12025
- var claudeTaskListOutputSchema = z35.object({
12026
- tasks: z35.array(z35.unknown())
12104
+ var claudeTaskListOutputSchema = z36.object({
12105
+ tasks: z36.array(z36.unknown())
12027
12106
  }).passthrough();
12028
- var claudeTaskToolOutputSchema = z35.union([
12107
+ var claudeTaskToolOutputSchema = z36.union([
12029
12108
  claudeTaskCreateOutputSchema,
12030
12109
  claudeTaskGetOutputSchema,
12031
12110
  claudeTaskListOutputSchema,