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