@get-bb/plugin-sdk 0.4.30 → 0.4.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1951,10 +1951,10 @@ function isSettledBackgroundTaskStatus(taskStatus) {
1951
1951
  }
1952
1952
 
1953
1953
  // ../domain/src/provider-event.ts
1954
- import { z as z17 } from "zod";
1954
+ import { z as z18 } from "zod";
1955
1955
 
1956
1956
  // ../domain/src/thread-events.ts
1957
- import { z as z14 } from "zod";
1957
+ import { z as z15 } from "zod";
1958
1958
 
1959
1959
  // ../domain/src/pending-interactions.ts
1960
1960
  import { z as z12 } from "zod";
@@ -2415,24 +2415,8 @@ var interactionLifecycleSchema = z12.union([
2415
2415
  import { z as z13 } from "zod";
2416
2416
  var clientTurnRequestIdSchema = z13.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
2417
2417
 
2418
- // ../domain/src/thread-events.ts
2419
- var systemEventTypeValues = [
2420
- "client/thread/start",
2421
- "client/turn/requested",
2422
- "client/turn/rejected",
2423
- "client/turn/start",
2424
- "system/error",
2425
- "system/manager/user_message",
2426
- "system/thread/interrupted",
2427
- "system/operation",
2428
- "system/interaction/lifecycle",
2429
- "system/permissionGrant/lifecycle",
2430
- "system/userQuestion/lifecycle",
2431
- "system/thread-provisioning",
2432
- "system/provider-turn-watchdog"
2433
- ];
2434
- var threadTurnInitiatorValues = ["user", "agent", "system"];
2435
- var threadTurnInitiatorSchema = z14.enum(threadTurnInitiatorValues);
2418
+ // ../domain/src/system-message.ts
2419
+ import { z as z14 } from "zod";
2436
2420
  var systemMessageKindValues = [
2437
2421
  "ownership-assigned",
2438
2422
  "ownership-removed",
@@ -2455,70 +2439,99 @@ var systemMessageSubjectSchema = z14.discriminatedUnion("kind", [
2455
2439
  count: z14.number()
2456
2440
  })
2457
2441
  ]);
2442
+
2443
+ // ../domain/src/thread-events.ts
2444
+ var systemEventTypeValues = [
2445
+ "client/thread/start",
2446
+ "client/turn/requested",
2447
+ "client/turn/rejected",
2448
+ "client/turn/start",
2449
+ "system/error",
2450
+ "system/manager/user_message",
2451
+ "system/thread/interrupted",
2452
+ "system/operation",
2453
+ "system/interaction/lifecycle",
2454
+ "system/permissionGrant/lifecycle",
2455
+ "system/userQuestion/lifecycle",
2456
+ "system/thread-provisioning",
2457
+ // Legacy persisted watchdog diagnostic; retained for read/decode/render
2458
+ // only, with no current producer.
2459
+ "system/provider-turn-watchdog"
2460
+ ];
2461
+ var threadTurnInitiatorValues = ["user", "agent", "system"];
2462
+ var threadTurnInitiatorSchema = z15.enum(threadTurnInitiatorValues);
2458
2463
  var turnRequestOptionsSchema = recordedThreadExecutionOptionsSchema;
2459
- var turnRequestTargetSchema = z14.discriminatedUnion("kind", [
2460
- z14.object({ kind: z14.literal("thread-start") }),
2461
- z14.object({ kind: z14.literal("new-turn") }),
2462
- z14.object({
2463
- kind: z14.literal("auto"),
2464
- expectedTurnId: z14.string().nullable()
2464
+ var turnRequestTargetSchema = z15.discriminatedUnion("kind", [
2465
+ z15.object({ kind: z15.literal("thread-start") }),
2466
+ z15.object({ kind: z15.literal("new-turn") }),
2467
+ z15.object({
2468
+ kind: z15.literal("auto"),
2469
+ expectedTurnId: z15.string().nullable()
2465
2470
  }),
2466
- z14.object({
2467
- kind: z14.literal("steer"),
2468
- expectedTurnId: z14.string().nullable()
2471
+ z15.object({
2472
+ kind: z15.literal("steer"),
2473
+ expectedTurnId: z15.string().nullable()
2469
2474
  })
2470
2475
  ]);
2471
- var clientTurnLifecycleEventDataSchema = z14.object({
2472
- direction: z14.literal("outbound"),
2473
- source: z14.enum(["spawn", "tell"]),
2476
+ var clientTurnLifecycleEventDataSchema = z15.object({
2477
+ direction: z15.literal("outbound"),
2478
+ source: z15.enum(["spawn", "tell"]),
2474
2479
  initiator: threadTurnInitiatorSchema,
2475
- request: z14.object({
2476
- method: z14.enum(["thread/start", "turn/start"]),
2477
- params: z14.record(z14.string(), z14.unknown())
2480
+ request: z15.object({
2481
+ method: z15.enum(["thread/start", "turn/start"]),
2482
+ params: z15.record(z15.string(), z15.unknown())
2478
2483
  })
2479
2484
  });
2480
- var turnRequestEventDataSchema = z14.object({
2481
- direction: z14.literal("outbound"),
2485
+ var turnRequestEventDataSchema = z15.object({
2486
+ direction: z15.literal("outbound"),
2482
2487
  requestId: clientTurnRequestIdSchema,
2483
- continuationOfRequestId: clientTurnRequestIdSchema.optional(),
2484
- source: z14.enum(["spawn", "tell"]),
2488
+ // Retry provenance, written only when a `turn.failed` gate's retry row
2489
+ // dispatches. Both fields are present together or not at all: absence means
2490
+ // "this is an original dispatch", which is the overwhelmingly common case.
2491
+ // (Supersedes the pre-plugin `continuationOfRequestId` key, which the removed
2492
+ // core rate-limit recovery wrote and nothing ever read.)
2493
+ /** The original request this attempt re-submits, unchanged across attempts. */
2494
+ retryOfRequestId: clientTurnRequestIdSchema.optional(),
2495
+ /** Which attempt this is: 2 is the first retry of the original request. */
2496
+ retryAttempt: z15.number().int().min(2).optional(),
2497
+ source: z15.enum(["spawn", "tell"]),
2485
2498
  initiator: threadTurnInitiatorSchema,
2486
- senderThreadId: z14.string().nullable(),
2499
+ senderThreadId: z15.string().nullable(),
2487
2500
  systemMessageKind: systemMessageKindSchema.optional(),
2488
2501
  systemMessageSubject: systemMessageSubjectSchema.nullable().optional(),
2489
- input: z14.array(promptInputSchema),
2490
- inputGroups: z14.array(z14.array(promptInputSchema).min(1)).min(1).optional(),
2502
+ input: z15.array(promptInputSchema),
2503
+ inputGroups: z15.array(z15.array(promptInputSchema).min(1)).min(1).optional(),
2491
2504
  target: turnRequestTargetSchema,
2492
- request: z14.object({
2493
- method: z14.enum(["thread/start", "turn/start"]),
2494
- params: z14.record(z14.string(), z14.unknown())
2505
+ request: z15.object({
2506
+ method: z15.enum(["thread/start", "turn/start"]),
2507
+ params: z15.record(z15.string(), z15.unknown())
2495
2508
  }),
2496
2509
  execution: turnRequestOptionsSchema
2497
2510
  });
2498
- var turnRequestRejectedEventDataSchema = z14.object({
2511
+ var turnRequestRejectedEventDataSchema = z15.object({
2499
2512
  requestId: clientTurnRequestIdSchema,
2500
- reason: z14.string().min(1),
2501
- message: z14.string().min(1)
2502
- });
2503
- var systemErrorEventDataSchema = z14.object({
2504
- code: z14.string().optional(),
2505
- message: z14.string(),
2506
- detail: z14.string().optional(),
2507
- reconnectAttempt: z14.number().int().positive().optional(),
2508
- reconnectTotal: z14.number().int().positive().optional()
2513
+ reason: z15.string().min(1),
2514
+ message: z15.string().min(1)
2515
+ });
2516
+ var systemErrorEventDataSchema = z15.object({
2517
+ code: z15.string().optional(),
2518
+ message: z15.string(),
2519
+ detail: z15.string().optional(),
2520
+ reconnectAttempt: z15.number().int().positive().optional(),
2521
+ reconnectTotal: z15.number().int().positive().optional()
2509
2522
  }).superRefine((value, ctx) => {
2510
2523
  const hasReconnectAttempt = value.reconnectAttempt !== void 0;
2511
2524
  const hasReconnectTotal = value.reconnectTotal !== void 0;
2512
2525
  if (hasReconnectAttempt !== hasReconnectTotal) {
2513
2526
  ctx.addIssue({
2514
- code: z14.ZodIssueCode.custom,
2527
+ code: z15.ZodIssueCode.custom,
2515
2528
  message: "system/error reconnectAttempt and reconnectTotal must be provided together"
2516
2529
  });
2517
2530
  return;
2518
2531
  }
2519
2532
  if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
2520
2533
  ctx.addIssue({
2521
- code: z14.ZodIssueCode.custom,
2534
+ code: z15.ZodIssueCode.custom,
2522
2535
  message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
2523
2536
  });
2524
2537
  }
@@ -2528,42 +2541,42 @@ var ownershipChangeOperationActionValues = [
2528
2541
  "release",
2529
2542
  "transfer"
2530
2543
  ];
2531
- var ownershipChangeOperationActionSchema = z14.enum(
2544
+ var ownershipChangeOperationActionSchema = z15.enum(
2532
2545
  ownershipChangeOperationActionValues
2533
2546
  );
2534
- var ownershipChangeOperationMetadataSchema = z14.object({
2547
+ var ownershipChangeOperationMetadataSchema = z15.object({
2535
2548
  action: ownershipChangeOperationActionSchema,
2536
- nextParentThreadId: z14.string().nullable(),
2537
- nextParentThreadTitle: z14.string().nullable(),
2538
- previousParentThreadId: z14.string().nullable(),
2539
- previousParentThreadTitle: z14.string().nullable()
2540
- });
2541
- var systemOperationEventDataSchema = z14.object({
2542
- operation: z14.string(),
2543
- status: z14.string(),
2544
- message: z14.string(),
2545
- operationId: z14.string(),
2546
- metadata: z14.record(z14.string(), jsonValueSchema).optional()
2547
- });
2548
- var systemInteractionLifecycleEventDataSchema = z14.object({
2549
+ nextParentThreadId: z15.string().nullable(),
2550
+ nextParentThreadTitle: z15.string().nullable(),
2551
+ previousParentThreadId: z15.string().nullable(),
2552
+ previousParentThreadTitle: z15.string().nullable()
2553
+ });
2554
+ var systemOperationEventDataSchema = z15.object({
2555
+ operation: z15.string(),
2556
+ status: z15.string(),
2557
+ message: z15.string(),
2558
+ operationId: z15.string(),
2559
+ metadata: z15.record(z15.string(), jsonValueSchema).optional()
2560
+ });
2561
+ var systemInteractionLifecycleEventDataSchema = z15.object({
2549
2562
  interaction: interactionLifecycleSchema
2550
2563
  });
2551
- var systemPermissionGrantLifecycleEventDataSchema = z14.object({
2552
- interactionId: z14.string(),
2553
- providerId: z14.string(),
2554
- providerRequestId: z14.string(),
2564
+ var systemPermissionGrantLifecycleEventDataSchema = z15.object({
2565
+ interactionId: z15.string(),
2566
+ providerId: z15.string(),
2567
+ providerRequestId: z15.string(),
2555
2568
  status: pendingInteractionStatusSchema,
2556
2569
  resolution: approvalPendingInteractionResolutionSchema.nullable().default(null),
2557
- statusReason: z14.string().nullable().default(null),
2570
+ statusReason: z15.string().nullable().default(null),
2558
2571
  subject: pendingInteractionPermissionGrantApprovalSubjectSchema
2559
2572
  });
2560
- var systemUserQuestionLifecycleEventDataSchema = z14.object({
2561
- interactionId: z14.string(),
2562
- providerId: z14.string(),
2563
- providerRequestId: z14.string(),
2573
+ var systemUserQuestionLifecycleEventDataSchema = z15.object({
2574
+ interactionId: z15.string(),
2575
+ providerId: z15.string(),
2576
+ providerRequestId: z15.string(),
2564
2577
  status: pendingInteractionStatusSchema,
2565
2578
  resolution: userQuestionPendingInteractionResolutionSchema.nullable().default(null),
2566
- statusReason: z14.string().nullable().default(null),
2579
+ statusReason: z15.string().nullable().default(null),
2567
2580
  payload: userQuestionPendingInteractionPayloadSchema
2568
2581
  });
2569
2582
  var systemThreadInterruptedReasonValues = [
@@ -2571,20 +2584,20 @@ var systemThreadInterruptedReasonValues = [
2571
2584
  "host-daemon-restarted",
2572
2585
  "provider-turn-idle"
2573
2586
  ];
2574
- var systemThreadInterruptedReasonSchema = z14.enum(
2587
+ var systemThreadInterruptedReasonSchema = z15.enum(
2575
2588
  systemThreadInterruptedReasonValues
2576
2589
  );
2577
- var systemThreadInterruptedEventDataSchema = z14.object({
2590
+ var systemThreadInterruptedEventDataSchema = z15.object({
2578
2591
  reason: systemThreadInterruptedReasonSchema,
2579
- cause: z14.literal("host-connection-lost").optional()
2592
+ cause: z15.literal("host-connection-lost").optional()
2580
2593
  });
2581
- var provisioningTranscriptEntrySchema = z14.object({
2582
- type: z14.enum(["step", "output"]),
2583
- key: z14.string(),
2584
- text: z14.string(),
2585
- startedAt: z14.number().optional(),
2586
- status: z14.enum(["started", "completed", "failed"]).optional(),
2587
- metadata: z14.record(z14.string(), z14.unknown()).optional()
2594
+ var provisioningTranscriptEntrySchema = z15.object({
2595
+ type: z15.enum(["step", "output"]),
2596
+ key: z15.string(),
2597
+ text: z15.string(),
2598
+ startedAt: z15.number().optional(),
2599
+ status: z15.enum(["started", "completed", "failed"]).optional(),
2600
+ metadata: z15.record(z15.string(), z15.unknown()).optional()
2588
2601
  });
2589
2602
  var systemThreadProvisioningStatusValues = [
2590
2603
  "active",
@@ -2592,48 +2605,48 @@ var systemThreadProvisioningStatusValues = [
2592
2605
  "failed",
2593
2606
  "cancelled"
2594
2607
  ];
2595
- var systemThreadProvisioningStatusSchema = z14.enum(
2608
+ var systemThreadProvisioningStatusSchema = z15.enum(
2596
2609
  systemThreadProvisioningStatusValues
2597
2610
  );
2598
- var systemThreadProvisioningEventDataSchema = z14.object({
2599
- provisioningId: z14.string(),
2611
+ var systemThreadProvisioningEventDataSchema = z15.object({
2612
+ provisioningId: z15.string(),
2600
2613
  status: systemThreadProvisioningStatusSchema,
2601
- environmentId: z14.string(),
2602
- entries: z14.array(provisioningTranscriptEntrySchema)
2603
- });
2604
- var systemLegacyUserMessageEventDataSchema = z14.object({
2605
- text: z14.string(),
2606
- toolCallId: z14.string().optional(),
2607
- turnId: z14.string().optional()
2608
- });
2609
- var systemProviderTurnWatchdogEventDataSchema = z14.object({
2610
- reason: z14.literal("provider-turn-idle"),
2611
- thresholdMs: z14.number().int().positive(),
2612
- elapsedMs: z14.number().int().nonnegative(),
2613
- activeTurnId: z14.string().min(1),
2614
- activeTurnStartedAt: z14.number().int().nonnegative(),
2615
- lastActivityEventSequence: z14.number().int().positive(),
2616
- lastActivityEventType: z14.string().min(1),
2617
- lastActivityEventAt: z14.number().int().nonnegative(),
2618
- providerId: z14.string().min(1),
2619
- providerThreadId: z14.string().min(1).nullable(),
2620
- firedAt: z14.number().int().nonnegative()
2614
+ environmentId: z15.string(),
2615
+ entries: z15.array(provisioningTranscriptEntrySchema)
2616
+ });
2617
+ var systemLegacyUserMessageEventDataSchema = z15.object({
2618
+ text: z15.string(),
2619
+ toolCallId: z15.string().optional(),
2620
+ turnId: z15.string().optional()
2621
+ });
2622
+ var systemProviderTurnWatchdogEventDataSchema = z15.object({
2623
+ reason: z15.literal("provider-turn-idle"),
2624
+ thresholdMs: z15.number().int().positive(),
2625
+ elapsedMs: z15.number().int().nonnegative(),
2626
+ activeTurnId: z15.string().min(1),
2627
+ activeTurnStartedAt: z15.number().int().nonnegative(),
2628
+ lastActivityEventSequence: z15.number().int().positive(),
2629
+ lastActivityEventType: z15.string().min(1),
2630
+ lastActivityEventAt: z15.number().int().nonnegative(),
2631
+ providerId: z15.string().min(1),
2632
+ providerThreadId: z15.string().min(1).nullable(),
2633
+ firedAt: z15.number().int().nonnegative()
2621
2634
  });
2622
2635
 
2623
2636
  // ../domain/src/thread-event-scope.ts
2624
- import { z as z15 } from "zod";
2637
+ import { z as z16 } from "zod";
2625
2638
  var threadEventScopeKindValues = ["thread", "turn"];
2626
- var threadEventScopeKindSchema = z15.enum(threadEventScopeKindValues);
2627
- var threadEventScopeSchema = z15.discriminatedUnion("kind", [
2628
- z15.object({ kind: z15.literal("thread") }),
2629
- z15.object({ kind: z15.literal("turn"), turnId: z15.string().min(1) })
2639
+ var threadEventScopeKindSchema = z16.enum(threadEventScopeKindValues);
2640
+ var threadEventScopeSchema = z16.discriminatedUnion("kind", [
2641
+ z16.object({ kind: z16.literal("thread") }),
2642
+ z16.object({ kind: z16.literal("turn"), turnId: z16.string().min(1) })
2630
2643
  ]);
2631
2644
  var threadEventScopePolicyValues = [
2632
2645
  "thread",
2633
2646
  "turn",
2634
2647
  "thread-or-turn"
2635
2648
  ];
2636
- var threadEventScopePolicySchema = z15.enum(threadEventScopePolicyValues);
2649
+ var threadEventScopePolicySchema = z16.enum(threadEventScopePolicyValues);
2637
2650
  var threadEventScopeDefinitionByType = {
2638
2651
  "thread/started": {
2639
2652
  policy: "thread",
@@ -2811,32 +2824,32 @@ function validateThreadEventScope(args) {
2811
2824
  }
2812
2825
 
2813
2826
  // ../domain/src/thread-timeline-goal.ts
2814
- import { z as z16 } from "zod";
2815
- var threadTimelineGoalStatusSchema = z16.enum([
2827
+ import { z as z17 } from "zod";
2828
+ var threadTimelineGoalStatusSchema = z17.enum([
2816
2829
  "active",
2817
2830
  "paused",
2818
2831
  "budgetLimited",
2819
2832
  "complete"
2820
2833
  ]);
2821
- var threadTimelineGoalSchema = z16.object({
2822
- sourceSeq: z16.number().int().nonnegative(),
2823
- updatedAt: z16.number(),
2824
- objective: z16.string(),
2834
+ var threadTimelineGoalSchema = z17.object({
2835
+ sourceSeq: z17.number().int().nonnegative(),
2836
+ updatedAt: z17.number(),
2837
+ objective: z17.string(),
2825
2838
  status: threadTimelineGoalStatusSchema,
2826
- tokenBudget: z16.number().nullable(),
2827
- tokensUsed: z16.number(),
2828
- timeUsedSeconds: z16.number()
2839
+ tokenBudget: z17.number().nullable(),
2840
+ tokensUsed: z17.number(),
2841
+ timeUsedSeconds: z17.number()
2829
2842
  });
2830
2843
 
2831
2844
  // ../domain/src/provider-event.ts
2832
- var threadEventItemStatusSchema = z17.enum([
2845
+ var threadEventItemStatusSchema = z18.enum([
2833
2846
  "pending",
2834
2847
  "completed",
2835
2848
  "failed",
2836
2849
  "interrupted"
2837
2850
  ]);
2838
- var threadEventItemApprovalStatusSchema = z17.enum(["waiting_for_approval", "denied"]).nullable();
2839
- var threadEventTurnStatusSchema = z17.enum([
2851
+ var threadEventItemApprovalStatusSchema = z18.enum(["waiting_for_approval", "denied"]).nullable();
2852
+ var threadEventTurnStatusSchema = z18.enum([
2840
2853
  "completed",
2841
2854
  "failed",
2842
2855
  "interrupted"
@@ -2862,515 +2875,515 @@ var providerErrorCategoryValues = [
2862
2875
  "unauthorized",
2863
2876
  "unknown"
2864
2877
  ];
2865
- var providerErrorCategorySchema = z17.enum(providerErrorCategoryValues);
2866
- var providerErrorInfoSchema = z17.object({
2878
+ var providerErrorCategorySchema = z18.enum(providerErrorCategoryValues);
2879
+ var providerErrorInfoSchema = z18.object({
2867
2880
  category: providerErrorCategorySchema,
2868
- providerCode: z17.string().nullable(),
2869
- httpStatusCode: z17.number().nullable()
2881
+ providerCode: z18.string().nullable(),
2882
+ httpStatusCode: z18.number().nullable()
2870
2883
  });
2871
- var providerRateLimitStatusSchema = z17.enum([
2884
+ var providerRateLimitStatusSchema = z18.enum([
2872
2885
  "allowed",
2873
2886
  "warning",
2874
2887
  "blocked",
2875
2888
  "unknown"
2876
2889
  ]);
2877
- var providerRateLimitWindowSchema = z17.object({
2878
- providerKey: z17.string().min(1).nullable(),
2879
- label: z17.string().min(1).nullable(),
2890
+ var providerRateLimitWindowSchema = z18.object({
2891
+ providerKey: z18.string().min(1).nullable(),
2892
+ label: z18.string().min(1).nullable(),
2880
2893
  status: providerRateLimitStatusSchema,
2881
- resetsAtMs: z17.number().int().nonnegative().nullable()
2894
+ resetsAtMs: z18.number().int().nonnegative().nullable()
2882
2895
  });
2883
- var providerRateLimitStateSchema = z17.object({
2884
- providerId: z17.string().min(1),
2896
+ var providerRateLimitStateSchema = z18.object({
2897
+ providerId: z18.string().min(1),
2885
2898
  status: providerRateLimitStatusSchema,
2886
- kind: z17.enum(["subscription-window", "credits", "spend-control", "unknown"]),
2887
- windows: z17.array(providerRateLimitWindowSchema),
2888
- reachedReason: z17.string().min(1).nullable(),
2889
- overageStatus: z17.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
2890
- overageReason: z17.string().min(1).nullable()
2891
- });
2892
- var threadEventFileChangeKindSchema = z17.enum(["add", "delete", "update"]);
2893
- var threadEventFileChangeSchema = z17.object({
2894
- path: z17.string(),
2899
+ kind: z18.enum(["subscription-window", "credits", "spend-control", "unknown"]),
2900
+ windows: z18.array(providerRateLimitWindowSchema),
2901
+ reachedReason: z18.string().min(1).nullable(),
2902
+ overageStatus: z18.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
2903
+ overageReason: z18.string().min(1).nullable()
2904
+ });
2905
+ var threadEventFileChangeKindSchema = z18.enum(["add", "delete", "update"]);
2906
+ var threadEventFileChangeSchema = z18.object({
2907
+ path: z18.string(),
2895
2908
  kind: threadEventFileChangeKindSchema,
2896
- movePath: z17.string().optional(),
2897
- diff: z17.string().optional()
2909
+ movePath: z18.string().optional(),
2910
+ diff: z18.string().optional()
2898
2911
  });
2899
- var threadEventPlanStepStatusSchema = z17.enum([
2912
+ var threadEventPlanStepStatusSchema = z18.enum([
2900
2913
  "pending",
2901
2914
  "active",
2902
2915
  "completed",
2903
2916
  "failed"
2904
2917
  ]);
2905
- var threadEventPlanStepSchema = z17.object({
2906
- step: z17.string(),
2918
+ var threadEventPlanStepSchema = z18.object({
2919
+ step: z18.string(),
2907
2920
  status: threadEventPlanStepStatusSchema.optional()
2908
2921
  });
2909
2922
  var itemPresentationField = {
2910
2923
  presentation: threadEventItemPresentationSchema.optional()
2911
2924
  };
2912
- var threadEventWebSearchItemSchema = z17.object({
2913
- type: z17.literal("webSearch"),
2914
- id: z17.string(),
2915
- queries: z17.array(z17.string()).min(1),
2916
- resultText: z17.string().nullable(),
2925
+ var threadEventWebSearchItemSchema = z18.object({
2926
+ type: z18.literal("webSearch"),
2927
+ id: z18.string(),
2928
+ queries: z18.array(z18.string()).min(1),
2929
+ resultText: z18.string().nullable(),
2917
2930
  ...itemPresentationField,
2918
- parentToolCallId: z17.string().optional()
2919
- });
2920
- var threadEventWebFetchItemSchema = z17.object({
2921
- type: z17.literal("webFetch"),
2922
- id: z17.string(),
2923
- url: z17.string(),
2924
- prompt: z17.string().nullable(),
2925
- pattern: z17.string().nullable(),
2926
- resultText: z17.string().nullable(),
2931
+ parentToolCallId: z18.string().optional()
2932
+ });
2933
+ var threadEventWebFetchItemSchema = z18.object({
2934
+ type: z18.literal("webFetch"),
2935
+ id: z18.string(),
2936
+ url: z18.string(),
2937
+ prompt: z18.string().nullable(),
2938
+ pattern: z18.string().nullable(),
2939
+ resultText: z18.string().nullable(),
2927
2940
  ...itemPresentationField,
2928
- parentToolCallId: z17.string().optional()
2941
+ parentToolCallId: z18.string().optional()
2929
2942
  });
2930
- var threadEventImageViewItemSchema = z17.object({
2931
- type: z17.literal("imageView"),
2932
- id: z17.string(),
2933
- path: z17.string(),
2943
+ var threadEventImageViewItemSchema = z18.object({
2944
+ type: z18.literal("imageView"),
2945
+ id: z18.string(),
2946
+ path: z18.string(),
2934
2947
  ...itemPresentationField,
2935
- parentToolCallId: z17.string().optional()
2948
+ parentToolCallId: z18.string().optional()
2936
2949
  });
2937
- var threadEventFileReadItemSchema = z17.object({
2938
- type: z17.literal("fileRead"),
2939
- id: z17.string(),
2940
- path: z17.string(),
2941
- cmd: z17.string().optional(),
2950
+ var threadEventFileReadItemSchema = z18.object({
2951
+ type: z18.literal("fileRead"),
2952
+ id: z18.string(),
2953
+ path: z18.string(),
2954
+ cmd: z18.string().optional(),
2942
2955
  status: threadEventItemStatusSchema,
2943
2956
  ...itemPresentationField,
2944
- parentToolCallId: z17.string().optional()
2957
+ parentToolCallId: z18.string().optional()
2945
2958
  });
2946
- var threadEventSearchModeSchema = z17.enum(["content", "path", "list"]);
2947
- var threadEventSearchItemSchema = z17.object({
2948
- type: z17.literal("search"),
2949
- id: z17.string(),
2959
+ var threadEventSearchModeSchema = z18.enum(["content", "path", "list"]);
2960
+ var threadEventSearchItemSchema = z18.object({
2961
+ type: z18.literal("search"),
2962
+ id: z18.string(),
2950
2963
  mode: threadEventSearchModeSchema,
2951
- query: z17.string(),
2952
- path: z17.string().optional(),
2953
- cmd: z17.string().optional(),
2964
+ query: z18.string(),
2965
+ path: z18.string().optional(),
2966
+ cmd: z18.string().optional(),
2954
2967
  status: threadEventItemStatusSchema,
2955
2968
  ...itemPresentationField,
2956
- parentToolCallId: z17.string().optional()
2969
+ parentToolCallId: z18.string().optional()
2957
2970
  });
2958
- var threadEventDelegationItemSchema = z17.object({
2959
- type: z17.literal("delegation"),
2960
- id: z17.string(),
2961
- childRef: z17.string().min(1),
2962
- label: z17.string(),
2971
+ var threadEventDelegationItemSchema = z18.object({
2972
+ type: z18.literal("delegation"),
2973
+ id: z18.string(),
2974
+ childRef: z18.string().min(1),
2975
+ label: z18.string(),
2963
2976
  status: threadEventItemStatusSchema,
2964
- background: z17.boolean(),
2965
- summary: z17.string().optional(),
2977
+ background: z18.boolean(),
2978
+ summary: z18.string().optional(),
2966
2979
  ...itemPresentationField,
2967
- parentToolCallId: z17.string().optional()
2980
+ parentToolCallId: z18.string().optional()
2968
2981
  });
2969
- var threadEventPlanStepsItemSchema = z17.object({
2970
- type: z17.literal("planSteps"),
2971
- id: z17.string(),
2972
- steps: z17.array(threadEventPlanStepSchema),
2973
- explanation: z17.string().optional(),
2982
+ var threadEventPlanStepsItemSchema = z18.object({
2983
+ type: z18.literal("planSteps"),
2984
+ id: z18.string(),
2985
+ steps: z18.array(threadEventPlanStepSchema),
2986
+ explanation: z18.string().optional(),
2974
2987
  status: threadEventItemStatusSchema,
2975
2988
  ...itemPresentationField,
2976
- parentToolCallId: z17.string().optional()
2989
+ parentToolCallId: z18.string().optional()
2977
2990
  });
2978
- var threadEventExtensionItemSchema = z17.object({
2979
- type: z17.literal("extension"),
2980
- id: z17.string(),
2991
+ var threadEventExtensionItemSchema = z18.object({
2992
+ type: z18.literal("extension"),
2993
+ id: z18.string(),
2981
2994
  kind: extensionKindSchema,
2982
2995
  payload: jsonValueSchema,
2983
2996
  status: threadEventItemStatusSchema,
2984
2997
  presentation: threadEventItemPresentationSchema,
2985
- parentToolCallId: z17.string().optional()
2998
+ parentToolCallId: z18.string().optional()
2986
2999
  });
2987
- var threadEventTextTruncationSchema = z17.object({
2988
- originalLength: z17.number(),
2989
- retainedHeadLength: z17.number(),
2990
- retainedTailLength: z17.number(),
2991
- truncatedAt: z17.number()
3000
+ var threadEventTextTruncationSchema = z18.object({
3001
+ originalLength: z18.number(),
3002
+ retainedHeadLength: z18.number(),
3003
+ retainedTailLength: z18.number(),
3004
+ truncatedAt: z18.number()
2992
3005
  });
2993
- var threadEventItemTruncationSchema = z17.object({
3006
+ var threadEventItemTruncationSchema = z18.object({
2994
3007
  aggregatedOutput: threadEventTextTruncationSchema.optional(),
2995
3008
  result: threadEventTextTruncationSchema.optional(),
2996
3009
  resultText: threadEventTextTruncationSchema.optional()
2997
3010
  });
2998
- var threadEventUserContentSchema = z17.discriminatedUnion("type", [
2999
- z17.object({ type: z17.literal("text"), text: z17.string() }),
3000
- z17.object({ type: z17.literal("image"), url: z17.string() }),
3001
- z17.object({ type: z17.literal("localImage"), path: z17.string() }),
3002
- z17.object({ type: z17.literal("localFile"), path: z17.string() })
3011
+ var threadEventUserContentSchema = z18.discriminatedUnion("type", [
3012
+ z18.object({ type: z18.literal("text"), text: z18.string() }),
3013
+ z18.object({ type: z18.literal("image"), url: z18.string() }),
3014
+ z18.object({ type: z18.literal("localImage"), path: z18.string() }),
3015
+ z18.object({ type: z18.literal("localFile"), path: z18.string() })
3003
3016
  ]);
3004
- var threadEventTokenUsageBreakdownSchema = z17.object({
3005
- totalTokens: z17.number(),
3006
- inputTokens: z17.number(),
3007
- cachedInputTokens: z17.number(),
3008
- outputTokens: z17.number(),
3009
- reasoningOutputTokens: z17.number()
3010
- });
3011
- var threadEventContextWindowUsageSchema = z17.object({
3012
- usedTokens: z17.number().nullable(),
3013
- modelContextWindow: z17.number().nullable(),
3014
- estimated: z17.boolean()
3015
- });
3016
- var threadEventTokenUsageSchema = z17.object({
3017
+ var threadEventTokenUsageBreakdownSchema = z18.object({
3018
+ totalTokens: z18.number(),
3019
+ inputTokens: z18.number(),
3020
+ cachedInputTokens: z18.number(),
3021
+ outputTokens: z18.number(),
3022
+ reasoningOutputTokens: z18.number()
3023
+ });
3024
+ var threadEventContextWindowUsageSchema = z18.object({
3025
+ usedTokens: z18.number().nullable(),
3026
+ modelContextWindow: z18.number().nullable(),
3027
+ estimated: z18.boolean()
3028
+ });
3029
+ var threadEventTokenUsageSchema = z18.object({
3017
3030
  total: threadEventTokenUsageBreakdownSchema,
3018
3031
  last: threadEventTokenUsageBreakdownSchema,
3019
- modelContextWindow: z17.number().nullable()
3032
+ modelContextWindow: z18.number().nullable()
3020
3033
  });
3021
- var threadEventWarningCategorySchema = z17.enum([
3034
+ var threadEventWarningCategorySchema = z18.enum([
3022
3035
  "deprecation",
3023
3036
  "config",
3024
3037
  "general",
3025
3038
  "compaction-skipped"
3026
3039
  ]);
3027
- var providerRawEventSchema = z17.object({
3028
- jsonrpc: z17.literal("2.0"),
3029
- id: z17.union([z17.string(), z17.number()]).optional(),
3030
- method: z17.string(),
3040
+ var providerRawEventSchema = z18.object({
3041
+ jsonrpc: z18.literal("2.0"),
3042
+ id: z18.union([z18.string(), z18.number()]).optional(),
3043
+ method: z18.string(),
3031
3044
  params: jsonValueSchema.optional()
3032
3045
  });
3033
- var providerUnhandledEventSchema = z17.object({
3034
- type: z17.literal("provider/unhandled"),
3035
- threadId: z17.string(),
3036
- providerThreadId: z17.string(),
3037
- providerId: z17.string(),
3038
- rawType: z17.string(),
3046
+ var providerUnhandledEventSchema = z18.object({
3047
+ type: z18.literal("provider/unhandled"),
3048
+ threadId: z18.string(),
3049
+ providerThreadId: z18.string(),
3050
+ providerId: z18.string(),
3051
+ rawType: z18.string(),
3039
3052
  rawEvent: providerRawEventSchema,
3040
- parentToolCallId: z17.string().optional()
3041
- });
3042
- var toolCallProgressEventSchema = z17.object({
3043
- type: z17.literal("item/toolCall/progress"),
3044
- threadId: z17.string(),
3045
- providerThreadId: z17.string(),
3046
- itemId: z17.string(),
3047
- message: z17.string().optional(),
3048
- parentToolCallId: z17.string().optional()
3049
- });
3050
- var threadEventBackgroundTaskItemSchema = z17.object({
3051
- type: z17.literal("backgroundTask"),
3052
- id: z17.string(),
3053
- familyId: z17.string().optional(),
3054
- taskType: z17.string(),
3055
- description: z17.string(),
3053
+ parentToolCallId: z18.string().optional()
3054
+ });
3055
+ var toolCallProgressEventSchema = z18.object({
3056
+ type: z18.literal("item/toolCall/progress"),
3057
+ threadId: z18.string(),
3058
+ providerThreadId: z18.string(),
3059
+ itemId: z18.string(),
3060
+ message: z18.string().optional(),
3061
+ parentToolCallId: z18.string().optional()
3062
+ });
3063
+ var threadEventBackgroundTaskItemSchema = z18.object({
3064
+ type: z18.literal("backgroundTask"),
3065
+ id: z18.string(),
3066
+ familyId: z18.string().optional(),
3067
+ taskType: z18.string(),
3068
+ description: z18.string(),
3056
3069
  status: threadEventItemStatusSchema,
3057
3070
  taskStatus: backgroundTaskStatusSchema,
3058
- skipTranscript: z17.boolean(),
3059
- workflowName: z17.string().optional(),
3071
+ skipTranscript: z18.boolean(),
3072
+ workflowName: z18.string().optional(),
3060
3073
  workflow: workflowProgressSnapshotSchema.optional(),
3061
3074
  usage: backgroundTaskUsageSchema.optional(),
3062
- summary: z17.string().optional(),
3063
- error: z17.string().optional(),
3064
- outputFile: z17.string().optional(),
3075
+ summary: z18.string().optional(),
3076
+ error: z18.string().optional(),
3077
+ outputFile: z18.string().optional(),
3065
3078
  ...itemPresentationField,
3066
- parentToolCallId: z17.string().optional()
3079
+ parentToolCallId: z18.string().optional()
3067
3080
  });
3068
- var threadEventItemSchema = z17.discriminatedUnion("type", [
3069
- z17.object({
3070
- type: z17.literal("userMessage"),
3071
- id: z17.string(),
3072
- content: z17.array(threadEventUserContentSchema),
3081
+ var threadEventItemSchema = z18.discriminatedUnion("type", [
3082
+ z18.object({
3083
+ type: z18.literal("userMessage"),
3084
+ id: z18.string(),
3085
+ content: z18.array(threadEventUserContentSchema),
3073
3086
  clientRequestId: clientTurnRequestIdSchema.optional(),
3074
- parentToolCallId: z17.string().optional()
3087
+ parentToolCallId: z18.string().optional()
3075
3088
  }).strict(),
3076
- z17.object({
3077
- type: z17.literal("agentMessage"),
3078
- id: z17.string(),
3079
- text: z17.string(),
3089
+ z18.object({
3090
+ type: z18.literal("agentMessage"),
3091
+ id: z18.string(),
3092
+ text: z18.string(),
3080
3093
  ...itemPresentationField,
3081
- parentToolCallId: z17.string().optional()
3094
+ parentToolCallId: z18.string().optional()
3082
3095
  }),
3083
- z17.object({
3084
- type: z17.literal("commandExecution"),
3085
- id: z17.string(),
3086
- command: z17.string(),
3087
- cwd: z17.string(),
3096
+ z18.object({
3097
+ type: z18.literal("commandExecution"),
3098
+ id: z18.string(),
3099
+ command: z18.string(),
3100
+ cwd: z18.string(),
3088
3101
  status: threadEventItemStatusSchema,
3089
3102
  approvalStatus: threadEventItemApprovalStatusSchema,
3090
- aggregatedOutput: z17.string().optional(),
3091
- exitCode: z17.number().optional(),
3092
- durationMs: z17.number().optional(),
3103
+ aggregatedOutput: z18.string().optional(),
3104
+ exitCode: z18.number().optional(),
3105
+ durationMs: z18.number().optional(),
3093
3106
  truncation: threadEventItemTruncationSchema.optional(),
3094
3107
  ...itemPresentationField,
3095
- parentToolCallId: z17.string().optional()
3108
+ parentToolCallId: z18.string().optional()
3096
3109
  }),
3097
- z17.object({
3098
- type: z17.literal("fileChange"),
3099
- id: z17.string(),
3100
- changes: z17.array(threadEventFileChangeSchema),
3110
+ z18.object({
3111
+ type: z18.literal("fileChange"),
3112
+ id: z18.string(),
3113
+ changes: z18.array(threadEventFileChangeSchema),
3101
3114
  status: threadEventItemStatusSchema,
3102
3115
  approvalStatus: threadEventItemApprovalStatusSchema,
3103
3116
  ...itemPresentationField,
3104
- parentToolCallId: z17.string().optional()
3117
+ parentToolCallId: z18.string().optional()
3105
3118
  }),
3106
3119
  threadEventWebSearchItemSchema,
3107
3120
  threadEventWebFetchItemSchema,
3108
3121
  threadEventImageViewItemSchema,
3109
3122
  threadEventFileReadItemSchema,
3110
3123
  threadEventSearchItemSchema,
3111
- z17.object({
3112
- type: z17.literal("toolCall"),
3113
- id: z17.string(),
3114
- server: z17.string().optional(),
3115
- tool: z17.string(),
3116
- arguments: z17.record(z17.string(), z17.unknown()).optional(),
3124
+ z18.object({
3125
+ type: z18.literal("toolCall"),
3126
+ id: z18.string(),
3127
+ server: z18.string().optional(),
3128
+ tool: z18.string(),
3129
+ arguments: z18.record(z18.string(), z18.unknown()).optional(),
3117
3130
  status: threadEventItemStatusSchema,
3118
- result: z17.unknown().optional(),
3119
- error: z17.string().optional(),
3120
- durationMs: z17.number().optional(),
3131
+ result: z18.unknown().optional(),
3132
+ error: z18.string().optional(),
3133
+ durationMs: z18.number().optional(),
3121
3134
  truncation: threadEventItemTruncationSchema.optional(),
3122
3135
  ...itemPresentationField,
3123
- parentToolCallId: z17.string().optional()
3136
+ parentToolCallId: z18.string().optional()
3124
3137
  }),
3125
- z17.object({
3126
- type: z17.literal("reasoning"),
3127
- id: z17.string(),
3128
- summary: z17.array(z17.string()),
3129
- content: z17.array(z17.string()),
3138
+ z18.object({
3139
+ type: z18.literal("reasoning"),
3140
+ id: z18.string(),
3141
+ summary: z18.array(z18.string()),
3142
+ content: z18.array(z18.string()),
3130
3143
  ...itemPresentationField,
3131
- parentToolCallId: z17.string().optional()
3144
+ parentToolCallId: z18.string().optional()
3132
3145
  }),
3133
- z17.object({
3134
- type: z17.literal("plan"),
3135
- id: z17.string(),
3136
- text: z17.string(),
3146
+ z18.object({
3147
+ type: z18.literal("plan"),
3148
+ id: z18.string(),
3149
+ text: z18.string(),
3137
3150
  ...itemPresentationField,
3138
- parentToolCallId: z17.string().optional()
3151
+ parentToolCallId: z18.string().optional()
3139
3152
  }),
3140
3153
  threadEventPlanStepsItemSchema,
3141
- z17.object({
3142
- type: z17.literal("contextCompaction"),
3143
- id: z17.string(),
3154
+ z18.object({
3155
+ type: z18.literal("contextCompaction"),
3156
+ id: z18.string(),
3144
3157
  ...itemPresentationField,
3145
- parentToolCallId: z17.string().optional()
3158
+ parentToolCallId: z18.string().optional()
3146
3159
  }),
3147
3160
  threadEventBackgroundTaskItemSchema,
3148
3161
  threadEventDelegationItemSchema,
3149
3162
  threadEventExtensionItemSchema
3150
3163
  ]);
3151
- var unscopedProviderEventSchema = z17.discriminatedUnion("type", [
3152
- z17.object({
3153
- type: z17.literal("thread/started"),
3154
- threadId: z17.string()
3164
+ var unscopedProviderEventSchema = z18.discriminatedUnion("type", [
3165
+ z18.object({
3166
+ type: z18.literal("thread/started"),
3167
+ threadId: z18.string()
3155
3168
  }),
3156
- z17.object({
3157
- type: z17.literal("thread/identity"),
3158
- threadId: z17.string(),
3159
- providerThreadId: z17.string()
3169
+ z18.object({
3170
+ type: z18.literal("thread/identity"),
3171
+ threadId: z18.string(),
3172
+ providerThreadId: z18.string()
3160
3173
  }),
3161
- z17.object({
3162
- type: z17.literal("turn/started"),
3163
- threadId: z17.string(),
3164
- providerThreadId: z17.string(),
3165
- parentToolCallId: z17.string().optional()
3174
+ z18.object({
3175
+ type: z18.literal("turn/started"),
3176
+ threadId: z18.string(),
3177
+ providerThreadId: z18.string(),
3178
+ parentToolCallId: z18.string().optional()
3166
3179
  }),
3167
- z17.object({
3168
- type: z17.literal("turn/completed"),
3169
- threadId: z17.string(),
3170
- providerThreadId: z17.string().nullable(),
3180
+ z18.object({
3181
+ type: z18.literal("turn/completed"),
3182
+ threadId: z18.string(),
3183
+ providerThreadId: z18.string().nullable(),
3171
3184
  status: threadEventTurnStatusSchema,
3172
- error: z17.object({ message: z17.string() }).optional(),
3173
- providerCheckpointId: z17.string().min(1).optional()
3185
+ error: z18.object({ message: z18.string() }).optional(),
3186
+ providerCheckpointId: z18.string().min(1).optional()
3174
3187
  }),
3175
- z17.object({
3176
- type: z17.literal("turn/input/accepted"),
3177
- threadId: z17.string(),
3178
- providerThreadId: z17.string(),
3188
+ z18.object({
3189
+ type: z18.literal("turn/input/accepted"),
3190
+ threadId: z18.string(),
3191
+ providerThreadId: z18.string(),
3179
3192
  clientRequestId: clientTurnRequestIdSchema,
3180
3193
  scope: threadEventScopeSchema
3181
3194
  }).strict(),
3182
- z17.object({
3183
- type: z17.literal("thread/name/updated"),
3184
- threadId: z17.string(),
3185
- providerThreadId: z17.string(),
3186
- threadName: z17.string()
3195
+ z18.object({
3196
+ type: z18.literal("thread/name/updated"),
3197
+ threadId: z18.string(),
3198
+ providerThreadId: z18.string(),
3199
+ threadName: z18.string()
3187
3200
  }),
3188
- z17.object({
3189
- type: z17.literal("thread/compacted"),
3190
- threadId: z17.string(),
3191
- providerThreadId: z17.string()
3201
+ z18.object({
3202
+ type: z18.literal("thread/compacted"),
3203
+ threadId: z18.string(),
3204
+ providerThreadId: z18.string()
3192
3205
  }),
3193
- z17.object({
3194
- type: z17.literal("thread/context/cleared"),
3195
- threadId: z17.string(),
3196
- providerThreadId: z17.string()
3206
+ z18.object({
3207
+ type: z18.literal("thread/context/cleared"),
3208
+ threadId: z18.string(),
3209
+ providerThreadId: z18.string()
3197
3210
  }),
3198
- z17.object({
3199
- type: z17.literal("thread/goal/updated"),
3200
- threadId: z17.string(),
3201
- providerThreadId: z17.string(),
3202
- objective: z17.string(),
3211
+ z18.object({
3212
+ type: z18.literal("thread/goal/updated"),
3213
+ threadId: z18.string(),
3214
+ providerThreadId: z18.string(),
3215
+ objective: z18.string(),
3203
3216
  status: threadTimelineGoalStatusSchema,
3204
- tokenBudget: z17.number().nullable(),
3205
- tokensUsed: z17.number(),
3206
- timeUsedSeconds: z17.number()
3217
+ tokenBudget: z18.number().nullable(),
3218
+ tokensUsed: z18.number(),
3219
+ timeUsedSeconds: z18.number()
3207
3220
  }),
3208
- z17.object({
3209
- type: z17.literal("thread/goal/cleared"),
3210
- threadId: z17.string(),
3211
- providerThreadId: z17.string()
3221
+ z18.object({
3222
+ type: z18.literal("thread/goal/cleared"),
3223
+ threadId: z18.string(),
3224
+ providerThreadId: z18.string()
3212
3225
  }),
3213
- z17.object({
3214
- type: z17.literal("item/started"),
3215
- threadId: z17.string(),
3216
- providerThreadId: z17.string(),
3226
+ z18.object({
3227
+ type: z18.literal("item/started"),
3228
+ threadId: z18.string(),
3229
+ providerThreadId: z18.string(),
3217
3230
  item: threadEventItemSchema
3218
3231
  }),
3219
- z17.object({
3220
- type: z17.literal("item/completed"),
3221
- threadId: z17.string(),
3222
- providerThreadId: z17.string(),
3232
+ z18.object({
3233
+ type: z18.literal("item/completed"),
3234
+ threadId: z18.string(),
3235
+ providerThreadId: z18.string(),
3223
3236
  item: threadEventItemSchema
3224
3237
  }),
3225
- z17.object({
3226
- type: z17.literal("item/agentMessage/delta"),
3227
- threadId: z17.string(),
3228
- providerThreadId: z17.string(),
3229
- itemId: z17.string(),
3230
- delta: z17.string(),
3231
- parentToolCallId: z17.string().optional()
3238
+ z18.object({
3239
+ type: z18.literal("item/agentMessage/delta"),
3240
+ threadId: z18.string(),
3241
+ providerThreadId: z18.string(),
3242
+ itemId: z18.string(),
3243
+ delta: z18.string(),
3244
+ parentToolCallId: z18.string().optional()
3232
3245
  }),
3233
- z17.object({
3234
- type: z17.literal("item/commandExecution/outputDelta"),
3235
- threadId: z17.string(),
3236
- providerThreadId: z17.string(),
3237
- itemId: z17.string(),
3238
- delta: z17.string(),
3239
- reset: z17.boolean().optional(),
3240
- parentToolCallId: z17.string().optional()
3246
+ z18.object({
3247
+ type: z18.literal("item/commandExecution/outputDelta"),
3248
+ threadId: z18.string(),
3249
+ providerThreadId: z18.string(),
3250
+ itemId: z18.string(),
3251
+ delta: z18.string(),
3252
+ reset: z18.boolean().optional(),
3253
+ parentToolCallId: z18.string().optional()
3241
3254
  }),
3242
- z17.object({
3243
- type: z17.literal("item/fileChange/outputDelta"),
3244
- threadId: z17.string(),
3245
- providerThreadId: z17.string(),
3246
- itemId: z17.string(),
3247
- delta: z17.string(),
3248
- parentToolCallId: z17.string().optional()
3255
+ z18.object({
3256
+ type: z18.literal("item/fileChange/outputDelta"),
3257
+ threadId: z18.string(),
3258
+ providerThreadId: z18.string(),
3259
+ itemId: z18.string(),
3260
+ delta: z18.string(),
3261
+ parentToolCallId: z18.string().optional()
3249
3262
  }),
3250
- z17.object({
3251
- type: z17.literal("item/reasoning/summaryTextDelta"),
3252
- threadId: z17.string(),
3253
- providerThreadId: z17.string(),
3254
- itemId: z17.string(),
3255
- delta: z17.string(),
3256
- parentToolCallId: z17.string().optional()
3263
+ z18.object({
3264
+ type: z18.literal("item/reasoning/summaryTextDelta"),
3265
+ threadId: z18.string(),
3266
+ providerThreadId: z18.string(),
3267
+ itemId: z18.string(),
3268
+ delta: z18.string(),
3269
+ parentToolCallId: z18.string().optional()
3257
3270
  }),
3258
- z17.object({
3259
- type: z17.literal("item/reasoning/textDelta"),
3260
- threadId: z17.string(),
3261
- providerThreadId: z17.string(),
3262
- itemId: z17.string(),
3263
- delta: z17.string(),
3264
- parentToolCallId: z17.string().optional()
3271
+ z18.object({
3272
+ type: z18.literal("item/reasoning/textDelta"),
3273
+ threadId: z18.string(),
3274
+ providerThreadId: z18.string(),
3275
+ itemId: z18.string(),
3276
+ delta: z18.string(),
3277
+ parentToolCallId: z18.string().optional()
3265
3278
  }),
3266
- z17.object({
3267
- type: z17.literal("item/plan/delta"),
3268
- threadId: z17.string(),
3269
- providerThreadId: z17.string(),
3270
- itemId: z17.string(),
3271
- delta: z17.string(),
3272
- parentToolCallId: z17.string().optional()
3279
+ z18.object({
3280
+ type: z18.literal("item/plan/delta"),
3281
+ threadId: z18.string(),
3282
+ providerThreadId: z18.string(),
3283
+ itemId: z18.string(),
3284
+ delta: z18.string(),
3285
+ parentToolCallId: z18.string().optional()
3273
3286
  }),
3274
- z17.object({
3275
- type: z17.literal("item/mcpToolCall/progress"),
3276
- threadId: z17.string(),
3277
- providerThreadId: z17.string(),
3278
- itemId: z17.string(),
3279
- message: z17.string().optional(),
3280
- parentToolCallId: z17.string().optional()
3287
+ z18.object({
3288
+ type: z18.literal("item/mcpToolCall/progress"),
3289
+ threadId: z18.string(),
3290
+ providerThreadId: z18.string(),
3291
+ itemId: z18.string(),
3292
+ message: z18.string().optional(),
3293
+ parentToolCallId: z18.string().optional()
3281
3294
  }),
3282
3295
  toolCallProgressEventSchema,
3283
- z17.object({
3284
- type: z17.literal("item/backgroundTask/progress"),
3285
- threadId: z17.string(),
3286
- providerThreadId: z17.string(),
3296
+ z18.object({
3297
+ type: z18.literal("item/backgroundTask/progress"),
3298
+ threadId: z18.string(),
3299
+ providerThreadId: z18.string(),
3287
3300
  item: threadEventBackgroundTaskItemSchema
3288
3301
  }),
3289
- z17.object({
3290
- type: z17.literal("item/backgroundTask/completed"),
3291
- threadId: z17.string(),
3292
- providerThreadId: z17.string(),
3302
+ z18.object({
3303
+ type: z18.literal("item/backgroundTask/completed"),
3304
+ threadId: z18.string(),
3305
+ providerThreadId: z18.string(),
3293
3306
  item: threadEventBackgroundTaskItemSchema
3294
3307
  }),
3295
- z17.object({
3296
- type: z17.literal("item/delegation/progress"),
3297
- threadId: z17.string(),
3298
- providerThreadId: z17.string(),
3308
+ z18.object({
3309
+ type: z18.literal("item/delegation/progress"),
3310
+ threadId: z18.string(),
3311
+ providerThreadId: z18.string(),
3299
3312
  item: threadEventDelegationItemSchema
3300
3313
  }),
3301
- z17.object({
3302
- type: z17.literal("item/delegation/completed"),
3303
- threadId: z17.string(),
3304
- providerThreadId: z17.string(),
3314
+ z18.object({
3315
+ type: z18.literal("item/delegation/completed"),
3316
+ threadId: z18.string(),
3317
+ providerThreadId: z18.string(),
3305
3318
  item: threadEventDelegationItemSchema
3306
3319
  }),
3307
- z17.object({
3308
- type: z17.literal("thread/tokenUsage/updated"),
3309
- threadId: z17.string(),
3310
- providerThreadId: z17.string(),
3320
+ z18.object({
3321
+ type: z18.literal("thread/tokenUsage/updated"),
3322
+ threadId: z18.string(),
3323
+ providerThreadId: z18.string(),
3311
3324
  tokenUsage: threadEventTokenUsageSchema
3312
3325
  }),
3313
- z17.object({
3314
- type: z17.literal("thread/contextWindowUsage/updated"),
3315
- threadId: z17.string(),
3316
- providerThreadId: z17.string(),
3326
+ z18.object({
3327
+ type: z18.literal("thread/contextWindowUsage/updated"),
3328
+ threadId: z18.string(),
3329
+ providerThreadId: z18.string(),
3317
3330
  contextWindowUsage: threadEventContextWindowUsageSchema
3318
3331
  }),
3319
- z17.object({
3320
- type: z17.literal("turn/plan/updated"),
3321
- threadId: z17.string(),
3322
- providerThreadId: z17.string(),
3323
- plan: z17.array(threadEventPlanStepSchema),
3324
- explanation: z17.string().optional()
3332
+ z18.object({
3333
+ type: z18.literal("turn/plan/updated"),
3334
+ threadId: z18.string(),
3335
+ providerThreadId: z18.string(),
3336
+ plan: z18.array(threadEventPlanStepSchema),
3337
+ explanation: z18.string().optional()
3325
3338
  }),
3326
- z17.object({
3327
- type: z17.literal("turn/diff/updated"),
3328
- threadId: z17.string(),
3329
- providerThreadId: z17.string(),
3330
- diff: z17.string().optional()
3339
+ z18.object({
3340
+ type: z18.literal("turn/diff/updated"),
3341
+ threadId: z18.string(),
3342
+ providerThreadId: z18.string(),
3343
+ diff: z18.string().optional()
3331
3344
  }),
3332
- z17.object({
3333
- type: z17.literal("provider/error"),
3334
- threadId: z17.string(),
3335
- providerThreadId: z17.string(),
3336
- message: z17.string(),
3337
- detail: z17.string().optional(),
3338
- willRetry: z17.boolean().optional(),
3345
+ z18.object({
3346
+ type: z18.literal("provider/error"),
3347
+ threadId: z18.string(),
3348
+ providerThreadId: z18.string(),
3349
+ message: z18.string(),
3350
+ detail: z18.string().optional(),
3351
+ willRetry: z18.boolean().optional(),
3339
3352
  errorInfo: providerErrorInfoSchema.optional()
3340
3353
  }),
3341
- z17.object({
3342
- type: z17.literal("provider/rateLimits/updated"),
3343
- threadId: z17.string(),
3344
- providerThreadId: z17.string(),
3354
+ z18.object({
3355
+ type: z18.literal("provider/rateLimits/updated"),
3356
+ threadId: z18.string(),
3357
+ providerThreadId: z18.string(),
3345
3358
  rateLimits: providerRateLimitStateSchema
3346
3359
  }),
3347
- z17.object({
3348
- type: z17.literal("thread/extensionState/updated"),
3349
- threadId: z17.string(),
3350
- providerThreadId: z17.string(),
3360
+ z18.object({
3361
+ type: z18.literal("thread/extensionState/updated"),
3362
+ threadId: z18.string(),
3363
+ providerThreadId: z18.string(),
3351
3364
  kind: extensionKindSchema,
3352
3365
  payload: jsonValueSchema
3353
3366
  }),
3354
- z17.object({
3355
- type: z17.literal("provider/warning"),
3356
- threadId: z17.string(),
3357
- providerThreadId: z17.string(),
3367
+ z18.object({
3368
+ type: z18.literal("provider/warning"),
3369
+ threadId: z18.string(),
3370
+ providerThreadId: z18.string(),
3358
3371
  category: threadEventWarningCategorySchema,
3359
- summary: z17.string().optional(),
3360
- details: z17.string().optional()
3372
+ summary: z18.string().optional(),
3373
+ details: z18.string().optional()
3361
3374
  }),
3362
- z17.object({
3363
- type: z17.literal("provider/modelFallback"),
3364
- threadId: z17.string(),
3365
- providerThreadId: z17.string(),
3366
- originalModel: z17.string().min(1),
3367
- fallbackModel: z17.string().min(1),
3368
- reason: z17.enum(["refusal", "provider"]),
3369
- message: z17.string()
3375
+ z18.object({
3376
+ type: z18.literal("provider/modelFallback"),
3377
+ threadId: z18.string(),
3378
+ providerThreadId: z18.string(),
3379
+ originalModel: z18.string().min(1),
3380
+ fallbackModel: z18.string().min(1),
3381
+ reason: z18.enum(["refusal", "provider"]),
3382
+ message: z18.string()
3370
3383
  }),
3371
3384
  providerUnhandledEventSchema
3372
3385
  ]);
3373
- var scopedEventDataSchema = z17.object({
3386
+ var scopedEventDataSchema = z18.object({
3374
3387
  scope: threadEventScopeSchema
3375
3388
  });
3376
3389
  var providerEventSchema = unscopedProviderEventSchema.and(
@@ -3379,58 +3392,58 @@ var providerEventSchema = unscopedProviderEventSchema.and(
3379
3392
  var providerEventTypeValues = unscopedProviderEventSchema.options.map(
3380
3393
  (option) => option.shape.type.value
3381
3394
  );
3382
- var unscopedSystemEventSchema = z17.discriminatedUnion("type", [
3383
- z17.object({
3384
- type: z17.literal("client/thread/start"),
3385
- threadId: z17.string()
3395
+ var unscopedSystemEventSchema = z18.discriminatedUnion("type", [
3396
+ z18.object({
3397
+ type: z18.literal("client/thread/start"),
3398
+ threadId: z18.string()
3386
3399
  }).merge(clientTurnLifecycleEventDataSchema),
3387
- z17.object({
3388
- type: z17.literal("client/turn/requested"),
3389
- threadId: z17.string()
3400
+ z18.object({
3401
+ type: z18.literal("client/turn/requested"),
3402
+ threadId: z18.string()
3390
3403
  }).merge(turnRequestEventDataSchema),
3391
- z17.object({
3392
- type: z17.literal("client/turn/rejected"),
3393
- threadId: z17.string()
3404
+ z18.object({
3405
+ type: z18.literal("client/turn/rejected"),
3406
+ threadId: z18.string()
3394
3407
  }).merge(turnRequestRejectedEventDataSchema),
3395
- z17.object({
3396
- type: z17.literal("client/turn/start"),
3397
- threadId: z17.string()
3408
+ z18.object({
3409
+ type: z18.literal("client/turn/start"),
3410
+ threadId: z18.string()
3398
3411
  }).merge(clientTurnLifecycleEventDataSchema),
3399
- z17.object({
3400
- type: z17.literal("system/error"),
3401
- threadId: z17.string()
3412
+ z18.object({
3413
+ type: z18.literal("system/error"),
3414
+ threadId: z18.string()
3402
3415
  }).merge(systemErrorEventDataSchema),
3403
- z17.object({
3404
- type: z17.literal("system/manager/user_message"),
3405
- threadId: z17.string()
3416
+ z18.object({
3417
+ type: z18.literal("system/manager/user_message"),
3418
+ threadId: z18.string()
3406
3419
  }).merge(systemLegacyUserMessageEventDataSchema),
3407
- z17.object({
3408
- type: z17.literal("system/thread/interrupted"),
3409
- threadId: z17.string()
3420
+ z18.object({
3421
+ type: z18.literal("system/thread/interrupted"),
3422
+ threadId: z18.string()
3410
3423
  }).merge(systemThreadInterruptedEventDataSchema),
3411
- z17.object({
3412
- type: z17.literal("system/operation"),
3413
- threadId: z17.string()
3424
+ z18.object({
3425
+ type: z18.literal("system/operation"),
3426
+ threadId: z18.string()
3414
3427
  }).merge(systemOperationEventDataSchema),
3415
- z17.object({
3416
- type: z17.literal("system/interaction/lifecycle"),
3417
- threadId: z17.string()
3428
+ z18.object({
3429
+ type: z18.literal("system/interaction/lifecycle"),
3430
+ threadId: z18.string()
3418
3431
  }).merge(systemInteractionLifecycleEventDataSchema),
3419
- z17.object({
3420
- type: z17.literal("system/permissionGrant/lifecycle"),
3421
- threadId: z17.string()
3432
+ z18.object({
3433
+ type: z18.literal("system/permissionGrant/lifecycle"),
3434
+ threadId: z18.string()
3422
3435
  }).merge(systemPermissionGrantLifecycleEventDataSchema),
3423
- z17.object({
3424
- type: z17.literal("system/userQuestion/lifecycle"),
3425
- threadId: z17.string()
3436
+ z18.object({
3437
+ type: z18.literal("system/userQuestion/lifecycle"),
3438
+ threadId: z18.string()
3426
3439
  }).merge(systemUserQuestionLifecycleEventDataSchema),
3427
- z17.object({
3428
- type: z17.literal("system/thread-provisioning"),
3429
- threadId: z17.string()
3440
+ z18.object({
3441
+ type: z18.literal("system/thread-provisioning"),
3442
+ threadId: z18.string()
3430
3443
  }).merge(systemThreadProvisioningEventDataSchema),
3431
- z17.object({
3432
- type: z17.literal("system/provider-turn-watchdog"),
3433
- threadId: z17.string()
3444
+ z18.object({
3445
+ type: z18.literal("system/provider-turn-watchdog"),
3446
+ threadId: z18.string()
3434
3447
  }).merge(systemProviderTurnWatchdogEventDataSchema)
3435
3448
  ]);
3436
3449
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
@@ -3438,13 +3451,13 @@ var legacyClientRequestKey = ["clientRequest", "Sequence"].join("");
3438
3451
  function isEventPropertyBag(value) {
3439
3452
  return typeof value === "object" && value !== null && !Array.isArray(value);
3440
3453
  }
3441
- var rejectLegacyClientRequestSequenceSchema = z17.unknown().superRefine((value, ctx) => {
3454
+ var rejectLegacyClientRequestSequenceSchema = z18.unknown().superRefine((value, ctx) => {
3442
3455
  if (!isEventPropertyBag(value)) {
3443
3456
  return;
3444
3457
  }
3445
3458
  if (Object.hasOwn(value, legacyClientRequestKey)) {
3446
3459
  ctx.addIssue({
3447
- code: z17.ZodIssueCode.custom,
3460
+ code: z18.ZodIssueCode.custom,
3448
3461
  message: "legacy request sequence field is no longer accepted",
3449
3462
  path: [legacyClientRequestKey]
3450
3463
  });
@@ -3452,21 +3465,21 @@ var rejectLegacyClientRequestSequenceSchema = z17.unknown().superRefine((value,
3452
3465
  const item = value.item;
3453
3466
  if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
3454
3467
  ctx.addIssue({
3455
- code: z17.ZodIssueCode.custom,
3468
+ code: z18.ZodIssueCode.custom,
3456
3469
  message: "legacy user-message request sequence field is no longer accepted",
3457
3470
  path: ["item", legacyClientRequestKey]
3458
3471
  });
3459
3472
  }
3460
3473
  });
3461
3474
  var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
3462
- z17.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
3475
+ z18.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
3463
3476
  const result = validateThreadEventScope({
3464
3477
  type: event.type,
3465
3478
  scope: event.scope
3466
3479
  });
3467
3480
  if (!result.valid) {
3468
3481
  ctx.addIssue({
3469
- code: z17.ZodIssueCode.custom,
3482
+ code: z18.ZodIssueCode.custom,
3470
3483
  message: result.message ?? "Invalid thread event scope",
3471
3484
  path: ["scope"]
3472
3485
  });
@@ -3479,7 +3492,7 @@ var threadEventTypeValues = [
3479
3492
  ...systemEventTypeValues
3480
3493
  ];
3481
3494
  var threadEventTypeSet = new Set(threadEventTypeValues);
3482
- var threadEventTypeSchema = z17.string().refine(
3495
+ var threadEventTypeSchema = z18.string().refine(
3483
3496
  (value) => threadEventTypeSet.has(value),
3484
3497
  "Invalid thread event type"
3485
3498
  );
@@ -3490,95 +3503,95 @@ function toPositiveNumber(value) {
3490
3503
  }
3491
3504
 
3492
3505
  // ../domain/src/provider-fork.ts
3493
- import { z as z18 } from "zod";
3506
+ import { z as z19 } from "zod";
3494
3507
  var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
3495
- var providerForkSchema = z18.enum(PROVIDER_FORK_VALUES);
3508
+ var providerForkSchema = z19.enum(PROVIDER_FORK_VALUES);
3496
3509
 
3497
3510
  // ../domain/src/provider-types.ts
3498
- import { z as z19 } from "zod";
3499
- var modelReasoningEffortSchema = z19.object({
3511
+ import { z as z20 } from "zod";
3512
+ var modelReasoningEffortSchema = z20.object({
3500
3513
  reasoningEffort: reasoningLevelSchema,
3501
- description: z19.string()
3502
- });
3503
- var availableModelSchema = z19.object({
3504
- id: z19.string(),
3505
- model: z19.string(),
3506
- displayName: z19.string(),
3507
- routeProviderId: z19.string().min(1).optional(),
3508
- description: z19.string(),
3509
- supportedReasoningEfforts: z19.array(modelReasoningEffortSchema),
3514
+ description: z20.string()
3515
+ });
3516
+ var availableModelSchema = z20.object({
3517
+ id: z20.string(),
3518
+ model: z20.string(),
3519
+ displayName: z20.string(),
3520
+ routeProviderId: z20.string().min(1).optional(),
3521
+ description: z20.string(),
3522
+ supportedReasoningEfforts: z20.array(modelReasoningEffortSchema),
3510
3523
  defaultReasoningEffort: reasoningLevelSchema,
3511
- isDefault: z19.boolean()
3512
- });
3513
- var providerModelCatalogScopeSchema = z19.enum(["host", "workspace"]);
3514
- var providerCapabilitiesSchema = z19.object({
3515
- supportsThreadArchive: z19.boolean(),
3516
- supportsThreadRename: z19.boolean(),
3517
- supportsServiceTier: z19.boolean(),
3518
- supportsNativeUserQuestion: z19.boolean(),
3519
- supportsFork: z19.boolean(),
3520
- supportsSessionRewind: z19.boolean(),
3521
- permissionModes: z19.array(permissionModeSchema).min(1),
3524
+ isDefault: z20.boolean()
3525
+ });
3526
+ var providerModelCatalogScopeSchema = z20.enum(["host", "workspace"]);
3527
+ var providerCapabilitiesSchema = z20.object({
3528
+ supportsThreadArchive: z20.boolean(),
3529
+ supportsThreadRename: z20.boolean(),
3530
+ supportsServiceTier: z20.boolean(),
3531
+ supportsNativeUserQuestion: z20.boolean(),
3532
+ supportsFork: z20.boolean(),
3533
+ supportsSessionRewind: z20.boolean(),
3534
+ permissionModes: z20.array(permissionModeSchema).min(1),
3522
3535
  modelCatalogScope: providerModelCatalogScopeSchema
3523
3536
  });
3524
- var providerComposerCommandSchema = z19.object({
3537
+ var providerComposerCommandSchema = z20.object({
3525
3538
  trigger: promptMentionCommandTriggerSchema,
3526
- name: z19.string().min(1).regex(/^[^\s/$]+$/u),
3527
- trailingText: z19.string().regex(/^\s*$/u)
3539
+ name: z20.string().min(1).regex(/^[^\s/$]+$/u),
3540
+ trailingText: z20.string().regex(/^\s*$/u)
3528
3541
  });
3529
- var providerComposerActionSchema = z19.discriminatedUnion("kind", [
3530
- z19.object({
3531
- kind: z19.literal("skills"),
3542
+ var providerComposerActionSchema = z20.discriminatedUnion("kind", [
3543
+ z20.object({
3544
+ kind: z20.literal("skills"),
3532
3545
  trigger: promptMentionCommandTriggerSchema
3533
3546
  }),
3534
- z19.object({
3535
- kind: z19.literal("plan"),
3547
+ z20.object({
3548
+ kind: z20.literal("plan"),
3536
3549
  command: providerComposerCommandSchema
3537
3550
  }),
3538
- z19.object({
3539
- kind: z19.literal("goal"),
3551
+ z20.object({
3552
+ kind: z20.literal("goal"),
3540
3553
  command: providerComposerCommandSchema
3541
3554
  })
3542
3555
  ]);
3543
- var providerStringsSchema = z19.object({
3544
- signInHint: z19.string().min(1),
3545
- expiredHint: z19.string().min(1),
3546
- installUrl: z19.string().min(1),
3547
- brandPrefix: z19.string().min(1).optional(),
3548
- planModeCopy: z19.string().min(1).optional(),
3549
- iconTint: z19.object({ light: z19.string().min(1), dark: z19.string().min(1) }).optional()
3550
- });
3551
- var providerOptionDescriptorSchema = z19.object({
3552
- id: z19.string().min(1),
3553
- label: z19.string().min(1),
3554
- description: z19.string().min(1).optional()
3555
- });
3556
- var providerExtensionKindInfoSchema = z19.object({
3557
- item: z19.boolean(),
3558
- state: z19.boolean()
3559
- });
3560
- var providerExtensionKindsSchema = z19.record(
3556
+ var providerStringsSchema = z20.object({
3557
+ signInHint: z20.string().min(1),
3558
+ expiredHint: z20.string().min(1),
3559
+ installUrl: z20.string().min(1),
3560
+ brandPrefix: z20.string().min(1).optional(),
3561
+ planModeCopy: z20.string().min(1).optional(),
3562
+ iconTint: z20.object({ light: z20.string().min(1), dark: z20.string().min(1) }).optional()
3563
+ });
3564
+ var providerOptionDescriptorSchema = z20.object({
3565
+ id: z20.string().min(1),
3566
+ label: z20.string().min(1),
3567
+ description: z20.string().min(1).optional()
3568
+ });
3569
+ var providerExtensionKindInfoSchema = z20.object({
3570
+ item: z20.boolean(),
3571
+ state: z20.boolean()
3572
+ });
3573
+ var providerExtensionKindsSchema = z20.record(
3561
3574
  extensionKindSchema,
3562
3575
  providerExtensionKindInfoSchema
3563
3576
  );
3564
- var providerInfoSchema = z19.object({
3565
- id: z19.string(),
3566
- pluginId: z19.string().min(1),
3567
- displayName: z19.string(),
3568
- family: z19.string().min(1).optional(),
3569
- icon: z19.object({ glyph: z19.string().min(1) }).optional(),
3570
- logoUrl: z19.string().min(1).nullable(),
3571
- maintenance: z19.object({
3572
- health: z19.boolean(),
3573
- usage: z19.boolean(),
3574
- installation: z19.boolean()
3577
+ var providerInfoSchema = z20.object({
3578
+ id: z20.string(),
3579
+ pluginId: z20.string().min(1),
3580
+ displayName: z20.string(),
3581
+ family: z20.string().min(1).optional(),
3582
+ icon: z20.object({ glyph: z20.string().min(1) }).optional(),
3583
+ logoUrl: z20.string().min(1).nullable(),
3584
+ maintenance: z20.object({
3585
+ health: z20.boolean(),
3586
+ usage: z20.boolean(),
3587
+ installation: z20.boolean()
3575
3588
  }),
3576
3589
  capabilities: providerCapabilitiesSchema,
3577
- composerActions: z19.array(providerComposerActionSchema),
3578
- available: z19.boolean(),
3590
+ composerActions: z20.array(providerComposerActionSchema),
3591
+ available: z20.boolean(),
3579
3592
  strings: providerStringsSchema.optional(),
3580
- serviceTiers: z19.array(providerOptionDescriptorSchema).optional(),
3581
- reasoningLevels: z19.array(providerOptionDescriptorSchema).optional(),
3593
+ serviceTiers: z20.array(providerOptionDescriptorSchema).optional(),
3594
+ reasoningLevels: z20.array(providerOptionDescriptorSchema).optional(),
3582
3595
  extensionKinds: providerExtensionKindsSchema.optional()
3583
3596
  });
3584
3597
  var providerRecoveryKindValues = [
@@ -3588,34 +3601,34 @@ var providerRecoveryKindValues = [
3588
3601
  "staleTurn",
3589
3602
  "rateLimited"
3590
3603
  ];
3591
- var providerRecoveryKindSchema = z19.enum(providerRecoveryKindValues);
3592
- var toolCallOutputItemSchema = z19.discriminatedUnion("type", [
3593
- z19.object({
3594
- type: z19.literal("inputText"),
3595
- text: z19.string()
3604
+ var providerRecoveryKindSchema = z20.enum(providerRecoveryKindValues);
3605
+ var toolCallOutputItemSchema = z20.discriminatedUnion("type", [
3606
+ z20.object({
3607
+ type: z20.literal("inputText"),
3608
+ text: z20.string()
3596
3609
  }),
3597
- z19.object({
3598
- type: z19.literal("inputImage"),
3599
- imageUrl: z19.string()
3610
+ z20.object({
3611
+ type: z20.literal("inputImage"),
3612
+ imageUrl: z20.string()
3600
3613
  })
3601
3614
  ]);
3602
- var toolCallRequestSchema = z19.object({
3603
- requestId: z19.union([z19.string().min(1), z19.number()]),
3604
- threadId: z19.string().min(1),
3605
- providerThreadId: z19.string().min(1),
3606
- turnId: z19.string().min(1),
3607
- callId: z19.string().min(1),
3608
- tool: z19.string().min(1),
3609
- arguments: z19.unknown().optional()
3610
- });
3611
- var toolCallResponseSchema = z19.object({
3612
- contentItems: z19.array(toolCallOutputItemSchema),
3613
- success: z19.boolean()
3614
- });
3615
- var dynamicToolSchema = z19.object({
3616
- name: z19.string(),
3617
- description: z19.string(),
3618
- inputSchema: z19.unknown(),
3615
+ var toolCallRequestSchema = z20.object({
3616
+ requestId: z20.union([z20.string().min(1), z20.number()]),
3617
+ threadId: z20.string().min(1),
3618
+ providerThreadId: z20.string().min(1),
3619
+ turnId: z20.string().min(1),
3620
+ callId: z20.string().min(1),
3621
+ tool: z20.string().min(1),
3622
+ arguments: z20.unknown().optional()
3623
+ });
3624
+ var toolCallResponseSchema = z20.object({
3625
+ contentItems: z20.array(toolCallOutputItemSchema),
3626
+ success: z20.boolean()
3627
+ });
3628
+ var dynamicToolSchema = z20.object({
3629
+ name: z20.string(),
3630
+ description: z20.string(),
3631
+ inputSchema: z20.unknown(),
3619
3632
  presentation: threadEventItemPresentationSchema.optional()
3620
3633
  });
3621
3634
 
@@ -3762,7 +3775,7 @@ import { constants as fsConstants } from "node:fs";
3762
3775
  import { access } from "node:fs/promises";
3763
3776
  import path from "node:path";
3764
3777
  import { promisify } from "node:util";
3765
- import { z as z20 } from "zod";
3778
+ import { z as z21 } from "zod";
3766
3779
  var execFileAsync = promisify(execFile);
3767
3780
  var CLI_PROBE_TIMEOUT_MS = 5e3;
3768
3781
  var INSTALLATION_CHECK_TIMEOUT_MS = 15e3;
@@ -3867,8 +3880,8 @@ function firstLine(value) {
3867
3880
  function npmGlobalPackageVersion(value, npmPackage) {
3868
3881
  if (value === null) return null;
3869
3882
  try {
3870
- const parsed = z20.object({
3871
- dependencies: z20.record(z20.string(), z20.object({ version: z20.string().min(1) })).default({})
3883
+ const parsed = z21.object({
3884
+ dependencies: z21.record(z21.string(), z21.object({ version: z21.string().min(1) })).default({})
3872
3885
  }).safeParse(JSON.parse(value));
3873
3886
  return parsed.success ? parsed.data.dependencies[npmPackage]?.version ?? null : null;
3874
3887
  } catch {
@@ -3905,15 +3918,15 @@ function clampPercent(value) {
3905
3918
  }
3906
3919
 
3907
3920
  // ../provider-bridge-protocol/src/bridge-kit/provider-tool-call-contract.ts
3908
- import { z as z21 } from "zod";
3909
- var normalizedToolCallRequestSchema = z21.object({
3910
- providerThreadId: z21.string().min(1),
3911
- threadId: z21.string().min(1).optional(),
3912
- turnId: z21.union([z21.string().min(1), z21.null()]),
3913
- callId: z21.string().min(1),
3914
- tool: z21.string().min(1),
3915
- arguments: z21.unknown(),
3916
- providerNativeIds: z21.boolean().optional()
3921
+ import { z as z22 } from "zod";
3922
+ var normalizedToolCallRequestSchema = z22.object({
3923
+ providerThreadId: z22.string().min(1),
3924
+ threadId: z22.string().min(1).optional(),
3925
+ turnId: z22.union([z22.string().min(1), z22.null()]),
3926
+ callId: z22.string().min(1),
3927
+ tool: z22.string().min(1),
3928
+ arguments: z22.unknown(),
3929
+ providerNativeIds: z22.boolean().optional()
3917
3930
  });
3918
3931
 
3919
3932
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility.ts
@@ -3928,10 +3941,10 @@ function createProviderVisibilityMetadata(args) {
3928
3941
  }
3929
3942
 
3930
3943
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
3931
- import { z as z23 } from "zod";
3944
+ import { z as z24 } from "zod";
3932
3945
 
3933
3946
  // ../provider-bridge-protocol/src/errors.ts
3934
- import { z as z22 } from "zod";
3947
+ import { z as z23 } from "zod";
3935
3948
  var BRIDGE_JSON_RPC_ERRORS = {
3936
3949
  INVALID_PARAMS: -32602,
3937
3950
  METHOD_NOT_FOUND: -32601,
@@ -3940,12 +3953,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
3940
3953
  SESSION_NOT_RESTORABLE: -32002,
3941
3954
  FORK_CHECKPOINT_UNSUPPORTED: -32003
3942
3955
  };
3943
- var providerRecoveryHintSchema = z22.object({
3956
+ var providerRecoveryHintSchema = z23.object({
3944
3957
  kind: providerRecoveryKindSchema,
3945
- message: z22.string().min(1),
3946
- retryable: z22.boolean()
3958
+ message: z23.string().min(1),
3959
+ retryable: z23.boolean()
3947
3960
  });
3948
- var bridgeErrorDataSchema = z22.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
3961
+ var bridgeErrorDataSchema = z23.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
3949
3962
 
3950
3963
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
3951
3964
  var JSON_RPC_INVALID_PARAMS_CODE = -32602;
@@ -3963,7 +3976,7 @@ var ProviderResponseEncodeError = class extends Error {
3963
3976
  this.name = "ProviderResponseEncodeError";
3964
3977
  }
3965
3978
  };
3966
- var ignoredJsonRpcResultSchema = z23.unknown();
3979
+ var ignoredJsonRpcResultSchema = z24.unknown();
3967
3980
 
3968
3981
  // ../provider-bridge-protocol/src/version.ts
3969
3982
  var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
@@ -3971,66 +3984,66 @@ var THREAD_DELTA_GRAMMAR_V2 = PROVIDER_BRIDGE_PROTOCOL_VERSION;
3971
3984
  var THREAD_DELTA_GRAMMAR_V3 = 3;
3972
3985
 
3973
3986
  // ../provider-bridge-protocol/src/handshake.ts
3974
- import { z as z24 } from "zod";
3975
- var bridgeGrammarVersionsSchema = z24.tuple([z24.number().int().positive(), z24.number().int().positive()]).refine(([min, max]) => min <= max, {
3987
+ import { z as z25 } from "zod";
3988
+ var bridgeGrammarVersionsSchema = z25.tuple([z25.number().int().positive(), z25.number().int().positive()]).refine(([min, max]) => min <= max, {
3976
3989
  message: "grammarVersions must be an ascending [min, max] range"
3977
3990
  });
3978
- var bridgeSteerModeSchema = z24.enum(["inject", "queue"]);
3979
- var bridgeCapabilitiesSchema = z24.object({
3980
- sessionRestore: z24.boolean().default(false),
3981
- threadArchive: z24.boolean().default(false),
3982
- threadRename: z24.boolean().default(false),
3983
- threadGoalClear: z24.boolean().default(false),
3991
+ var bridgeSteerModeSchema = z25.enum(["inject", "queue"]);
3992
+ var bridgeCapabilitiesSchema = z25.object({
3993
+ sessionRestore: z25.boolean().default(false),
3994
+ threadArchive: z25.boolean().default(false),
3995
+ threadRename: z25.boolean().default(false),
3996
+ threadGoalClear: z25.boolean().default(false),
3984
3997
  fork: providerForkSchema.default("none"),
3985
- approvalEnforcedBy: z24.enum(["runtime", "provider"]).default("runtime"),
3998
+ approvalEnforcedBy: z25.enum(["runtime", "provider"]).default("runtime"),
3986
3999
  grammarVersions: bridgeGrammarVersionsSchema.default([
3987
4000
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
3988
4001
  PROVIDER_BRIDGE_PROTOCOL_VERSION
3989
4002
  ]),
3990
4003
  steerMode: bridgeSteerModeSchema.default("queue"),
3991
- skills: z24.object({ configure: z24.boolean().default(false) }).default({ configure: false })
4004
+ skills: z25.object({ configure: z25.boolean().default(false) }).default({ configure: false })
3992
4005
  }).passthrough();
3993
- var initializeParamsSchema = z24.object({
3994
- protocolVersion: z24.number().int().positive(),
3995
- client: z24.object({ name: z24.string().min(1), version: z24.string().min(1) }),
4006
+ var initializeParamsSchema = z25.object({
4007
+ protocolVersion: z25.number().int().positive(),
4008
+ client: z25.object({ name: z25.string().min(1), version: z25.string().min(1) }),
3996
4009
  grammarVersions: bridgeGrammarVersionsSchema.default([
3997
4010
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
3998
4011
  PROVIDER_BRIDGE_PROTOCOL_VERSION
3999
4012
  ])
4000
4013
  }).passthrough();
4001
- var initializeResultSchema = z24.object({
4002
- protocolVersion: z24.number().int().positive(),
4003
- capabilities: z24.preprocess(
4014
+ var initializeResultSchema = z25.object({
4015
+ protocolVersion: z25.number().int().positive(),
4016
+ capabilities: z25.preprocess(
4004
4017
  (value) => value ?? {},
4005
4018
  bridgeCapabilitiesSchema
4006
4019
  )
4007
4020
  }).passthrough();
4008
4021
 
4009
4022
  // ../provider-bridge-protocol/src/execution-options.ts
4010
- import { z as z25 } from "zod";
4011
- var bridgeExecutionOptionsSchema = z25.object({
4012
- model: z25.string().min(1).optional(),
4023
+ import { z as z26 } from "zod";
4024
+ var bridgeExecutionOptionsSchema = z26.object({
4025
+ model: z26.string().min(1).optional(),
4013
4026
  serviceTier: serviceTierSchema.optional(),
4014
4027
  reasoningLevel: reasoningLevelSchema.optional(),
4015
4028
  promptMode: promptModeSchema.optional(),
4016
- instructions: z25.string().optional(),
4017
- envVars: z25.record(z25.string(), z25.string()).optional(),
4018
- providerOptions: z25.record(z25.string(), z25.unknown()).optional()
4029
+ instructions: z26.string().optional(),
4030
+ envVars: z26.record(z26.string(), z26.string()).optional(),
4031
+ providerOptions: z26.record(z26.string(), z26.unknown()).optional()
4019
4032
  }).and(runtimePermissionPolicySchema);
4020
4033
 
4021
4034
  // ../provider-bridge-protocol/src/provider-maintenance.ts
4022
- import { z as z26 } from "zod";
4023
- var providerMaintenanceParamsSchema = z26.object({
4024
- providerId: z26.string().min(1),
4025
- cwd: z26.string().min(1).optional(),
4026
- providerOptions: z26.record(z26.string(), z26.unknown()).optional()
4035
+ import { z as z27 } from "zod";
4036
+ var providerMaintenanceParamsSchema = z27.object({
4037
+ providerId: z27.string().min(1),
4038
+ cwd: z27.string().min(1).optional(),
4039
+ providerOptions: z27.record(z27.string(), z27.unknown()).optional()
4027
4040
  }).passthrough();
4028
- var providerInstallationRequirementSchema = z26.enum(["thread_rewind"]);
4041
+ var providerInstallationRequirementSchema = z27.enum(["thread_rewind"]);
4029
4042
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
4030
4043
  requirement: providerInstallationRequirementSchema.optional()
4031
4044
  });
4032
- var providerHealthSchema = z26.object({
4033
- status: z26.enum([
4045
+ var providerHealthSchema = z27.object({
4046
+ status: z27.enum([
4034
4047
  "ready",
4035
4048
  "not_installed",
4036
4049
  "unauthenticated",
@@ -4038,114 +4051,114 @@ var providerHealthSchema = z26.object({
4038
4051
  "unsupported_version",
4039
4052
  "unknown"
4040
4053
  ]),
4041
- statusMessage: z26.string().min(1).nullable(),
4042
- accountEmail: z26.string().nullable(),
4043
- planLabel: z26.string().min(1).nullable(),
4044
- installedVersion: z26.string().min(1).nullable(),
4045
- minimumSupportedVersion: z26.string().min(1).nullable(),
4046
- canInstall: z26.boolean(),
4047
- canUpdate: z26.boolean(),
4048
- loginCommand: z26.string().min(1).nullable()
4054
+ statusMessage: z27.string().min(1).nullable(),
4055
+ accountEmail: z27.string().nullable(),
4056
+ planLabel: z27.string().min(1).nullable(),
4057
+ installedVersion: z27.string().min(1).nullable(),
4058
+ minimumSupportedVersion: z27.string().min(1).nullable(),
4059
+ canInstall: z27.boolean(),
4060
+ canUpdate: z27.boolean(),
4061
+ loginCommand: z27.string().min(1).nullable()
4049
4062
  }).passthrough();
4050
- var providerUsageWindowSchema = z26.object({
4051
- label: z26.string().min(1),
4052
- usedPercent: z26.number().min(0).max(100),
4053
- resetsAt: z26.string().min(1).nullable(),
4054
- cost: z26.object({
4055
- usedUsdCents: z26.number().int().nonnegative(),
4056
- limitUsdCents: z26.number().int().positive()
4063
+ var providerUsageWindowSchema = z27.object({
4064
+ label: z27.string().min(1),
4065
+ usedPercent: z27.number().min(0).max(100),
4066
+ resetsAt: z27.string().min(1).nullable(),
4067
+ cost: z27.object({
4068
+ usedUsdCents: z27.number().int().nonnegative(),
4069
+ limitUsdCents: z27.number().int().positive()
4057
4070
  }).optional()
4058
4071
  }).passthrough();
4059
- var providerUsageSchema = z26.discriminatedUnion("status", [
4060
- z26.object({
4061
- status: z26.literal("ok"),
4062
- accountEmail: z26.string().email().nullable(),
4063
- planLabel: z26.string().min(1).nullable(),
4064
- windows: z26.array(providerUsageWindowSchema)
4072
+ var providerUsageSchema = z27.discriminatedUnion("status", [
4073
+ z27.object({
4074
+ status: z27.literal("ok"),
4075
+ accountEmail: z27.string().email().nullable(),
4076
+ planLabel: z27.string().min(1).nullable(),
4077
+ windows: z27.array(providerUsageWindowSchema)
4065
4078
  }).passthrough(),
4066
- z26.object({ status: z26.literal("not_installed") }).passthrough(),
4067
- z26.object({ status: z26.literal("unauthenticated") }).passthrough(),
4068
- z26.object({ status: z26.literal("expired") }).passthrough(),
4069
- z26.object({
4070
- status: z26.literal("error"),
4071
- message: z26.string().min(1),
4072
- planLabel: z26.string().min(1).nullable().default(null),
4073
- accountEmail: z26.string().nullable().default(null)
4079
+ z27.object({ status: z27.literal("not_installed") }).passthrough(),
4080
+ z27.object({ status: z27.literal("unauthenticated") }).passthrough(),
4081
+ z27.object({ status: z27.literal("expired") }).passthrough(),
4082
+ z27.object({
4083
+ status: z27.literal("error"),
4084
+ message: z27.string().min(1),
4085
+ planLabel: z27.string().min(1).nullable().default(null),
4086
+ accountEmail: z27.string().nullable().default(null)
4074
4087
  }).passthrough()
4075
4088
  ]);
4076
- var providerHealthResultSchema = z26.discriminatedUnion("supported", [
4077
- z26.object({ supported: z26.literal(false) }).passthrough(),
4078
- z26.object({
4079
- supported: z26.literal(true),
4089
+ var providerHealthResultSchema = z27.discriminatedUnion("supported", [
4090
+ z27.object({ supported: z27.literal(false) }).passthrough(),
4091
+ z27.object({
4092
+ supported: z27.literal(true),
4080
4093
  health: providerHealthSchema
4081
4094
  }).passthrough()
4082
4095
  ]);
4083
- var providerUsageResultSchema = z26.discriminatedUnion("supported", [
4084
- z26.object({ supported: z26.literal(false) }).passthrough(),
4085
- z26.object({
4086
- supported: z26.literal(true),
4096
+ var providerUsageResultSchema = z27.discriminatedUnion("supported", [
4097
+ z27.object({ supported: z27.literal(false) }).passthrough(),
4098
+ z27.object({
4099
+ supported: z27.literal(true),
4087
4100
  usage: providerUsageSchema
4088
4101
  }).passthrough()
4089
4102
  ]);
4090
- var providerInstallationActionKindSchema = z26.enum([
4103
+ var providerInstallationActionKindSchema = z27.enum([
4091
4104
  "install",
4092
4105
  "update"
4093
4106
  ]);
4094
- var providerInstallationActionSchema = z26.object({
4107
+ var providerInstallationActionSchema = z27.object({
4095
4108
  kind: providerInstallationActionKindSchema,
4096
- label: z26.enum(["Install", "Update"]),
4097
- command: z26.string().min(1)
4109
+ label: z27.enum(["Install", "Update"]),
4110
+ command: z27.string().min(1)
4098
4111
  }).passthrough();
4099
- var providerInstallationSourceSchema = z26.enum([
4112
+ var providerInstallationSourceSchema = z27.enum([
4100
4113
  "notInstalled",
4101
4114
  "npmGlobal",
4102
4115
  "external"
4103
4116
  ]);
4104
- var providerInstallationStatusSchema = z26.object({
4105
- executableName: z26.string().min(1),
4106
- executablePath: z26.string().min(1).nullable(),
4107
- installed: z26.boolean(),
4117
+ var providerInstallationStatusSchema = z27.object({
4118
+ executableName: z27.string().min(1),
4119
+ executablePath: z27.string().min(1).nullable(),
4120
+ installed: z27.boolean(),
4108
4121
  installSource: providerInstallationSourceSchema,
4109
- currentVersion: z26.string().min(1).nullable(),
4110
- latestVersion: z26.string().min(1).nullable(),
4111
- minimumSupportedVersion: z26.string().min(1).nullable(),
4112
- npmPackageName: z26.string().min(1).nullable(),
4113
- npmGlobalPackageVersion: z26.string().min(1).nullable(),
4122
+ currentVersion: z27.string().min(1).nullable(),
4123
+ latestVersion: z27.string().min(1).nullable(),
4124
+ minimumSupportedVersion: z27.string().min(1).nullable(),
4125
+ npmPackageName: z27.string().min(1).nullable(),
4126
+ npmGlobalPackageVersion: z27.string().min(1).nullable(),
4114
4127
  installAction: providerInstallationActionSchema.nullable(),
4115
- needsUpdate: z26.boolean(),
4116
- versionUnsupported: z26.boolean()
4128
+ needsUpdate: z27.boolean(),
4129
+ versionUnsupported: z27.boolean()
4117
4130
  }).passthrough();
4118
4131
  var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
4119
4132
  action: providerInstallationActionKindSchema
4120
4133
  });
4121
- var providerInstallationCommandSchema = z26.object({
4122
- command: z26.string().min(1),
4123
- args: z26.array(z26.string()).max(64),
4124
- displayCommand: z26.string().min(1)
4134
+ var providerInstallationCommandSchema = z27.object({
4135
+ command: z27.string().min(1),
4136
+ args: z27.array(z27.string()).max(64),
4137
+ displayCommand: z27.string().min(1)
4125
4138
  }).passthrough();
4126
- var providerInstallationVerificationSchema = z26.discriminatedUnion(
4139
+ var providerInstallationVerificationSchema = z27.discriminatedUnion(
4127
4140
  "kind",
4128
4141
  [
4129
- z26.object({ kind: z26.literal("installed") }).passthrough(),
4130
- z26.object({
4131
- kind: z26.literal("version_changed"),
4132
- previousVersion: z26.string().min(1)
4142
+ z27.object({ kind: z27.literal("installed") }).passthrough(),
4143
+ z27.object({
4144
+ kind: z27.literal("version_changed"),
4145
+ previousVersion: z27.string().min(1)
4133
4146
  }).passthrough(),
4134
- z26.object({
4135
- kind: z26.literal("version_at_least"),
4136
- version: z26.string().min(1)
4147
+ z27.object({
4148
+ kind: z27.literal("version_at_least"),
4149
+ version: z27.string().min(1)
4137
4150
  }).passthrough()
4138
4151
  ]
4139
4152
  );
4140
- var providerInstallationRunResultSchema = z26.discriminatedUnion(
4153
+ var providerInstallationRunResultSchema = z27.discriminatedUnion(
4141
4154
  "available",
4142
4155
  [
4143
- z26.object({
4144
- available: z26.literal(false),
4145
- message: z26.string().min(1)
4156
+ z27.object({
4157
+ available: z27.literal(false),
4158
+ message: z27.string().min(1)
4146
4159
  }).passthrough(),
4147
- z26.object({
4148
- available: z26.literal(true),
4160
+ z27.object({
4161
+ available: z27.literal(true),
4149
4162
  command: providerInstallationCommandSchema,
4150
4163
  verification: providerInstallationVerificationSchema
4151
4164
  }).passthrough()
@@ -4153,7 +4166,7 @@ var providerInstallationRunResultSchema = z26.discriminatedUnion(
4153
4166
  );
4154
4167
 
4155
4168
  // ../provider-bridge-protocol/src/requests.ts
4156
- import { z as z27 } from "zod";
4169
+ import { z as z28 } from "zod";
4157
4170
  var BRIDGE_REQUEST_METHODS = {
4158
4171
  initialize: "initialize",
4159
4172
  modelList: "model/list",
@@ -4175,82 +4188,82 @@ var BRIDGE_REQUEST_METHODS = {
4175
4188
  skillsConfigure: "skills/configure"
4176
4189
  };
4177
4190
  var sessionConstructionFields = {
4178
- threadId: z27.string().min(1),
4179
- cwd: z27.string().min(1),
4191
+ threadId: z28.string().min(1),
4192
+ cwd: z28.string().min(1),
4180
4193
  options: bridgeExecutionOptionsSchema,
4181
- dynamicTools: z27.array(dynamicToolSchema).optional(),
4182
- disallowedTools: z27.array(z27.string().min(1)).optional(),
4194
+ dynamicTools: z28.array(dynamicToolSchema).optional(),
4195
+ disallowedTools: z28.array(z28.string().min(1)).optional(),
4183
4196
  instructionMode: instructionModeSchema
4184
4197
  };
4185
- var modelListParamsSchema = z27.object({ cwd: z27.string().min(1).optional() }).passthrough();
4186
- var threadStartParamsSchema = z27.object({
4198
+ var modelListParamsSchema = z28.object({ cwd: z28.string().min(1).optional() }).passthrough();
4199
+ var threadStartParamsSchema = z28.object({
4187
4200
  ...sessionConstructionFields,
4188
- input: z27.array(promptInputSchema).optional()
4201
+ input: z28.array(promptInputSchema).optional()
4189
4202
  }).passthrough();
4190
- var threadResumeParamsSchema = z27.object({
4203
+ var threadResumeParamsSchema = z28.object({
4191
4204
  ...sessionConstructionFields,
4192
- providerThreadId: z27.string().min(1)
4205
+ providerThreadId: z28.string().min(1)
4193
4206
  }).passthrough();
4194
- var threadForkParamsSchema = z27.object({
4207
+ var threadForkParamsSchema = z28.object({
4195
4208
  ...sessionConstructionFields,
4196
- sourceProviderThreadId: z27.string().min(1),
4197
- sourceProviderCheckpointId: z27.string().min(1).optional()
4209
+ sourceProviderThreadId: z28.string().min(1),
4210
+ sourceProviderCheckpointId: z28.string().min(1).optional()
4198
4211
  }).passthrough();
4199
- var threadStopParamsSchema = z27.object({
4200
- threadId: z27.string().min(1),
4201
- providerThreadId: z27.string().min(1),
4202
- intent: z27.enum(["interrupt", "release"]),
4203
- activeTurnId: z27.string().min(1).nullable()
4212
+ var threadStopParamsSchema = z28.object({
4213
+ threadId: z28.string().min(1),
4214
+ providerThreadId: z28.string().min(1),
4215
+ intent: z28.enum(["interrupt", "release"]),
4216
+ activeTurnId: z28.string().min(1).nullable()
4204
4217
  }).passthrough();
4205
- var threadRefParams = z27.object({
4206
- threadId: z27.string().min(1),
4207
- providerThreadId: z27.string().min(1)
4218
+ var threadRefParams = z28.object({
4219
+ threadId: z28.string().min(1),
4220
+ providerThreadId: z28.string().min(1)
4208
4221
  }).passthrough();
4209
4222
  var threadDiscardParamsSchema = threadRefParams;
4210
4223
  var threadArchiveParamsSchema = threadRefParams;
4211
4224
  var threadUnarchiveParamsSchema = threadRefParams;
4212
4225
  var threadGoalClearParamsSchema = threadRefParams;
4213
- var threadNameSetParamsSchema = z27.object({
4214
- threadId: z27.string().min(1),
4215
- providerThreadId: z27.string().min(1),
4216
- title: z27.string().min(1)
4226
+ var threadNameSetParamsSchema = z28.object({
4227
+ threadId: z28.string().min(1),
4228
+ providerThreadId: z28.string().min(1),
4229
+ title: z28.string().min(1)
4217
4230
  }).passthrough();
4218
4231
  var turnInputFields = {
4219
- threadId: z27.string().min(1),
4220
- providerThreadId: z27.string().min(1),
4221
- input: z27.array(promptInputSchema),
4232
+ threadId: z28.string().min(1),
4233
+ providerThreadId: z28.string().min(1),
4234
+ input: z28.array(promptInputSchema),
4222
4235
  clientRequestId: clientTurnRequestIdSchema,
4223
4236
  options: bridgeExecutionOptionsSchema
4224
4237
  };
4225
- var turnStartParamsSchema = z27.object(turnInputFields).passthrough();
4226
- var turnSteerParamsSchema = z27.object({
4238
+ var turnStartParamsSchema = z28.object(turnInputFields).passthrough();
4239
+ var turnSteerParamsSchema = z28.object({
4227
4240
  ...turnInputFields,
4228
- expectedTurnId: z27.string().min(1)
4241
+ expectedTurnId: z28.string().min(1)
4229
4242
  }).passthrough();
4230
- var skillsConfigureRootSchema = z27.object({
4231
- id: z27.string().min(1),
4232
- path: z27.string().min(1),
4233
- skills: z27.array(
4234
- z27.object({
4235
- name: z27.string().min(1),
4236
- description: z27.string()
4243
+ var skillsConfigureRootSchema = z28.object({
4244
+ id: z28.string().min(1),
4245
+ path: z28.string().min(1),
4246
+ skills: z28.array(
4247
+ z28.object({
4248
+ name: z28.string().min(1),
4249
+ description: z28.string()
4237
4250
  }).passthrough()
4238
4251
  )
4239
4252
  }).passthrough();
4240
- var skillsConfigureParamsSchema = z27.object({
4241
- roots: z27.array(skillsConfigureRootSchema)
4253
+ var skillsConfigureParamsSchema = z28.object({
4254
+ roots: z28.array(skillsConfigureRootSchema)
4242
4255
  }).passthrough();
4243
- var threadIdentityResultSchema = z27.object({
4244
- providerThreadId: z27.string().min(1),
4245
- sessionRestorable: z27.boolean().optional()
4256
+ var threadIdentityResultSchema = z28.object({
4257
+ providerThreadId: z28.string().min(1),
4258
+ sessionRestorable: z28.boolean().optional()
4246
4259
  }).passthrough();
4247
- var modelListResultSchema = z27.object({
4248
- models: z27.array(availableModelSchema),
4249
- selectedOnlyModels: z27.array(availableModelSchema).default([])
4260
+ var modelListResultSchema = z28.object({
4261
+ models: z28.array(availableModelSchema),
4262
+ selectedOnlyModels: z28.array(availableModelSchema).default([])
4250
4263
  }).passthrough();
4251
4264
 
4252
4265
  // ../provider-bridge-protocol/src/notifications.ts
4253
- import { z as z28 } from "zod";
4266
+ import { z as z29 } from "zod";
4254
4267
  var BRIDGE_NOTIFICATION_METHODS = {
4255
4268
  threadIdentity: "thread/identity",
4256
4269
  sessionReplaced: "session/replaced",
@@ -4258,172 +4271,172 @@ var BRIDGE_NOTIFICATION_METHODS = {
4258
4271
  providerRecovery: "provider/recovery",
4259
4272
  error: "error"
4260
4273
  };
4261
- var threadIdentityNotificationSchema = z28.object({
4262
- threadId: z28.string().min(1),
4263
- providerThreadId: z28.string().min(1),
4264
- sessionRestorable: z28.boolean().optional()
4274
+ var threadIdentityNotificationSchema = z29.object({
4275
+ threadId: z29.string().min(1),
4276
+ providerThreadId: z29.string().min(1),
4277
+ sessionRestorable: z29.boolean().optional()
4265
4278
  }).passthrough();
4266
- var sessionReplacedNotificationSchema = z28.object({
4267
- threadId: z28.string().min(1),
4268
- providerThreadId: z28.string().min(1).nullable(),
4269
- reason: z28.string().min(1),
4270
- contextLost: z28.boolean().default(false)
4279
+ var sessionReplacedNotificationSchema = z29.object({
4280
+ threadId: z29.string().min(1),
4281
+ providerThreadId: z29.string().min(1).nullable(),
4282
+ reason: z29.string().min(1),
4283
+ contextLost: z29.boolean().default(false)
4271
4284
  }).passthrough();
4272
- var providerRawNotificationSchema = z28.object({
4273
- threadId: z28.string().min(1).optional(),
4274
- coverage: z28.enum(["noise", "unknown"]),
4275
- payload: z28.unknown()
4285
+ var providerRawNotificationSchema = z29.object({
4286
+ threadId: z29.string().min(1).optional(),
4287
+ coverage: z29.enum(["noise", "unknown"]),
4288
+ payload: z29.unknown()
4276
4289
  }).passthrough();
4277
- var providerRecoveryNotificationSchema = z28.object({
4278
- threadId: z28.string().min(1).optional(),
4290
+ var providerRecoveryNotificationSchema = z29.object({
4291
+ threadId: z29.string().min(1).optional(),
4279
4292
  ...providerRecoveryHintSchema.shape
4280
4293
  }).passthrough();
4281
- var errorNotificationSchema = z28.object({
4282
- threadId: z28.string().min(1).optional(),
4283
- message: z28.string().min(1)
4294
+ var errorNotificationSchema = z29.object({
4295
+ threadId: z29.string().min(1).optional(),
4296
+ message: z29.string().min(1)
4284
4297
  }).passthrough();
4285
4298
 
4286
4299
  // ../provider-bridge-protocol/src/bridge-requests.ts
4287
- import { z as z29 } from "zod";
4300
+ import { z as z30 } from "zod";
4288
4301
  var BRIDGE_INBOUND_REQUEST_METHODS = {
4289
4302
  toolCall: "item/tool/call",
4290
4303
  interactionRequest: "interaction/request"
4291
4304
  };
4292
- var toolCallRequestParamsSchema = z29.object({
4293
- providerThreadId: z29.string().min(1),
4294
- threadId: z29.string().min(1).optional(),
4295
- turnId: z29.union([z29.string().min(1), z29.null()]),
4296
- callId: z29.string().min(1),
4297
- tool: z29.string().min(1),
4298
- arguments: z29.unknown()
4305
+ var toolCallRequestParamsSchema = z30.object({
4306
+ providerThreadId: z30.string().min(1),
4307
+ threadId: z30.string().min(1).optional(),
4308
+ turnId: z30.union([z30.string().min(1), z30.null()]),
4309
+ callId: z30.string().min(1),
4310
+ tool: z30.string().min(1),
4311
+ arguments: z30.unknown()
4299
4312
  }).passthrough();
4300
- var toolCallResultSchema = z29.object({
4301
- success: z29.boolean(),
4302
- contentItems: z29.array(
4303
- z29.discriminatedUnion("type", [
4304
- z29.object({ type: z29.literal("inputText"), text: z29.string() }),
4305
- z29.object({
4306
- type: z29.literal("inputImage"),
4307
- imageUrl: z29.string().min(1)
4313
+ var toolCallResultSchema = z30.object({
4314
+ success: z30.boolean(),
4315
+ contentItems: z30.array(
4316
+ z30.discriminatedUnion("type", [
4317
+ z30.object({ type: z30.literal("inputText"), text: z30.string() }),
4318
+ z30.object({
4319
+ type: z30.literal("inputImage"),
4320
+ imageUrl: z30.string().min(1)
4308
4321
  })
4309
4322
  ])
4310
4323
  )
4311
4324
  }).passthrough();
4312
- var interactionRequestParamsSchema = z29.object({
4313
- providerThreadId: z29.string().min(1),
4314
- threadId: z29.string().min(1).optional(),
4315
- turnId: z29.union([z29.string().min(1), z29.null()]),
4325
+ var interactionRequestParamsSchema = z30.object({
4326
+ providerThreadId: z30.string().min(1),
4327
+ threadId: z30.string().min(1).optional(),
4328
+ turnId: z30.union([z30.string().min(1), z30.null()]),
4316
4329
  payload: pendingInteractionPayloadSchema,
4317
- providerNativeIds: z29.boolean().optional()
4330
+ providerNativeIds: z30.boolean().optional()
4318
4331
  }).passthrough();
4319
4332
 
4320
4333
  // ../provider-bridge-protocol/src/thread-delta.ts
4321
- import { z as z30 } from "zod";
4334
+ import { z as z31 } from "zod";
4322
4335
  var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
4323
4336
  var deltaPresentationSchema = threadEventItemPresentationSchema;
4324
4337
  var THREAD_DELTA_KEY_SEPARATOR = "";
4325
- var deltaKeyPartSchema = z30.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
4338
+ var deltaKeyPartSchema = z31.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
4326
4339
  message: "provider keys must not contain the internal key separator (\\u001f)"
4327
4340
  });
4328
- var deltaItemKeySchema = z30.object({
4341
+ var deltaItemKeySchema = z31.object({
4329
4342
  providerItemId: deltaKeyPartSchema.optional(),
4330
4343
  channel: deltaKeyPartSchema.optional(),
4331
4344
  parentRef: deltaKeyPartSchema.optional()
4332
4345
  });
4333
4346
  var providerTurnIdSchema = deltaKeyPartSchema;
4334
- var deltaFileChangeSchema = z30.object({
4335
- path: z30.string(),
4336
- kind: z30.enum(["add", "update", "delete"]),
4337
- movePath: z30.string().optional(),
4338
- diff: z30.string().optional(),
4339
- oldText: z30.string().optional(),
4340
- newText: z30.string().optional()
4341
- });
4342
- var deltaBackgroundTaskShapeSchema = z30.object({
4343
- type: z30.literal("backgroundTask"),
4344
- familyId: z30.string().min(1),
4345
- taskType: z30.string(),
4346
- description: z30.string(),
4347
+ var deltaFileChangeSchema = z31.object({
4348
+ path: z31.string(),
4349
+ kind: z31.enum(["add", "update", "delete"]),
4350
+ movePath: z31.string().optional(),
4351
+ diff: z31.string().optional(),
4352
+ oldText: z31.string().optional(),
4353
+ newText: z31.string().optional()
4354
+ });
4355
+ var deltaBackgroundTaskShapeSchema = z31.object({
4356
+ type: z31.literal("backgroundTask"),
4357
+ familyId: z31.string().min(1),
4358
+ taskType: z31.string(),
4359
+ description: z31.string(),
4347
4360
  status: threadEventItemStatusSchema,
4348
4361
  taskStatus: backgroundTaskStatusSchema,
4349
- skipTranscript: z30.boolean(),
4350
- workflowName: z30.string().optional(),
4362
+ skipTranscript: z31.boolean(),
4363
+ workflowName: z31.string().optional(),
4351
4364
  workflow: workflowProgressSnapshotSchema.optional(),
4352
4365
  usage: backgroundTaskUsageSchema.optional(),
4353
- summary: z30.string().optional(),
4354
- error: z30.string().optional(),
4355
- outputFile: z30.string().optional()
4366
+ summary: z31.string().optional(),
4367
+ error: z31.string().optional(),
4368
+ outputFile: z31.string().optional()
4356
4369
  });
4357
- var deltaFileReadShapeSchema = z30.object({
4358
- type: z30.literal("fileRead"),
4359
- path: z30.string(),
4360
- cmd: z30.string().optional()
4370
+ var deltaFileReadShapeSchema = z31.object({
4371
+ type: z31.literal("fileRead"),
4372
+ path: z31.string(),
4373
+ cmd: z31.string().optional()
4361
4374
  });
4362
- var deltaSearchShapeSchema = z30.object({
4363
- type: z30.literal("search"),
4375
+ var deltaSearchShapeSchema = z31.object({
4376
+ type: z31.literal("search"),
4364
4377
  mode: threadEventSearchModeSchema,
4365
- query: z30.string(),
4366
- path: z30.string().optional(),
4367
- cmd: z30.string().optional()
4378
+ query: z31.string(),
4379
+ path: z31.string().optional(),
4380
+ cmd: z31.string().optional()
4368
4381
  });
4369
- var deltaDelegationShapeSchema = z30.object({
4370
- type: z30.literal("delegation"),
4382
+ var deltaDelegationShapeSchema = z31.object({
4383
+ type: z31.literal("delegation"),
4371
4384
  childRef: deltaKeyPartSchema,
4372
- label: z30.string(),
4373
- background: z30.boolean(),
4374
- summary: z30.string().optional()
4385
+ label: z31.string(),
4386
+ background: z31.boolean(),
4387
+ summary: z31.string().optional()
4375
4388
  });
4376
- var deltaPlanStepsShapeSchema = z30.object({
4377
- type: z30.literal("planSteps"),
4378
- steps: z30.array(threadEventPlanStepSchema),
4379
- explanation: z30.string().optional()
4389
+ var deltaPlanStepsShapeSchema = z31.object({
4390
+ type: z31.literal("planSteps"),
4391
+ steps: z31.array(threadEventPlanStepSchema),
4392
+ explanation: z31.string().optional()
4380
4393
  });
4381
- var deltaExtensionShapeSchema = z30.object({
4382
- type: z30.literal("extension"),
4394
+ var deltaExtensionShapeSchema = z31.object({
4395
+ type: z31.literal("extension"),
4383
4396
  kind: extensionKindSchema,
4384
4397
  payload: jsonValueSchema
4385
4398
  });
4386
- var deltaItemShapeSchema = z30.discriminatedUnion("type", [
4387
- z30.object({
4388
- type: z30.literal("command"),
4389
- command: z30.string(),
4390
- cwd: z30.string(),
4391
- aggregatedOutput: z30.string().optional(),
4392
- exitCode: z30.number().optional(),
4393
- durationMs: z30.number().optional()
4399
+ var deltaItemShapeSchema = z31.discriminatedUnion("type", [
4400
+ z31.object({
4401
+ type: z31.literal("command"),
4402
+ command: z31.string(),
4403
+ cwd: z31.string(),
4404
+ aggregatedOutput: z31.string().optional(),
4405
+ exitCode: z31.number().optional(),
4406
+ durationMs: z31.number().optional()
4394
4407
  }),
4395
- z30.object({
4396
- type: z30.literal("fileChange"),
4397
- changes: z30.array(deltaFileChangeSchema)
4408
+ z31.object({
4409
+ type: z31.literal("fileChange"),
4410
+ changes: z31.array(deltaFileChangeSchema)
4398
4411
  }),
4399
- z30.object({
4400
- type: z30.literal("tool"),
4401
- tool: z30.string(),
4402
- server: z30.string().optional(),
4403
- args: z30.unknown().optional(),
4404
- result: z30.unknown().optional(),
4405
- error: z30.string().optional(),
4406
- durationMs: z30.number().optional()
4412
+ z31.object({
4413
+ type: z31.literal("tool"),
4414
+ tool: z31.string(),
4415
+ server: z31.string().optional(),
4416
+ args: z31.unknown().optional(),
4417
+ result: z31.unknown().optional(),
4418
+ error: z31.string().optional(),
4419
+ durationMs: z31.number().optional()
4407
4420
  }),
4408
- z30.object({ type: z30.literal("compaction") }),
4409
- z30.object({ type: z30.literal("agentMessage"), text: z30.string() }),
4410
- z30.object({
4411
- type: z30.literal("reasoning"),
4412
- summary: z30.array(z30.string()),
4413
- content: z30.array(z30.string())
4421
+ z31.object({ type: z31.literal("compaction") }),
4422
+ z31.object({ type: z31.literal("agentMessage"), text: z31.string() }),
4423
+ z31.object({
4424
+ type: z31.literal("reasoning"),
4425
+ summary: z31.array(z31.string()),
4426
+ content: z31.array(z31.string())
4414
4427
  }),
4415
- z30.object({ type: z30.literal("plan"), text: z30.string() }),
4416
- z30.object({
4417
- type: z30.literal("webSearch"),
4418
- queries: z30.array(z30.string()).min(1)
4428
+ z31.object({ type: z31.literal("plan"), text: z31.string() }),
4429
+ z31.object({
4430
+ type: z31.literal("webSearch"),
4431
+ queries: z31.array(z31.string()).min(1)
4419
4432
  }),
4420
- z30.object({
4421
- type: z30.literal("webFetch"),
4422
- url: z30.string(),
4423
- prompt: z30.string().nullable().optional(),
4424
- pattern: z30.string().nullable()
4433
+ z31.object({
4434
+ type: z31.literal("webFetch"),
4435
+ url: z31.string(),
4436
+ prompt: z31.string().nullable().optional(),
4437
+ pattern: z31.string().nullable()
4425
4438
  }),
4426
- z30.object({ type: z30.literal("imageView"), path: z30.string() }),
4439
+ z31.object({ type: z31.literal("imageView"), path: z31.string() }),
4427
4440
  deltaBackgroundTaskShapeSchema,
4428
4441
  deltaFileReadShapeSchema,
4429
4442
  deltaSearchShapeSchema,
@@ -4431,22 +4444,22 @@ var deltaItemShapeSchema = z30.discriminatedUnion("type", [
4431
4444
  deltaPlanStepsShapeSchema,
4432
4445
  deltaExtensionShapeSchema
4433
4446
  ]);
4434
- var deltaProgressSnapshotSchema = z30.discriminatedUnion("type", [
4447
+ var deltaProgressSnapshotSchema = z31.discriminatedUnion("type", [
4435
4448
  deltaBackgroundTaskShapeSchema,
4436
4449
  deltaDelegationShapeSchema
4437
4450
  ]);
4438
- var deltaTextChannelSchema = z30.enum([
4451
+ var deltaTextChannelSchema = z31.enum([
4439
4452
  "agentMessage",
4440
4453
  "reasoningSummary",
4441
4454
  "reasoningText",
4442
4455
  "plan"
4443
4456
  ]);
4444
- var deltaOutputChannelSchema = z30.enum(["command", "fileChange"]);
4445
- var deltaErrorSchema = z30.object({ message: z30.string() });
4446
- var deltaAttachSchema = z30.enum(["open", "currentOrLast"]);
4447
- var deltaNoTurnFallbackSchema = z30.object({
4457
+ var deltaOutputChannelSchema = z31.enum(["command", "fileChange"]);
4458
+ var deltaErrorSchema = z31.object({ message: z31.string() });
4459
+ var deltaAttachSchema = z31.enum(["open", "currentOrLast"]);
4460
+ var deltaNoTurnFallbackSchema = z31.object({
4448
4461
  raw: providerRawEventSchema,
4449
- rawType: z30.string()
4462
+ rawType: z31.string()
4450
4463
  });
4451
4464
  function requireExtensionPresentation(delta, ctx) {
4452
4465
  if (delta.item.type === "extension" && delta.presentation === void 0) {
@@ -4457,32 +4470,32 @@ function requireExtensionPresentation(delta, ctx) {
4457
4470
  });
4458
4471
  }
4459
4472
  }
4460
- var threadDeltaSchema = z30.discriminatedUnion("kind", [
4461
- z30.object({
4462
- kind: z30.literal("input.accepted"),
4473
+ var threadDeltaSchema = z31.discriminatedUnion("kind", [
4474
+ z31.object({
4475
+ kind: z31.literal("input.accepted"),
4463
4476
  clientRequestId: clientTurnRequestIdSchema,
4464
4477
  providerTurnId: providerTurnIdSchema.optional()
4465
4478
  }),
4466
- z30.object({
4467
- kind: z30.literal("input.provider"),
4468
- text: z30.string().min(1),
4479
+ z31.object({
4480
+ kind: z31.literal("input.provider"),
4481
+ text: z31.string().min(1),
4469
4482
  parentRef: deltaKeyPartSchema.optional()
4470
4483
  }),
4471
- z30.object({
4472
- kind: z30.literal("turn.open"),
4484
+ z31.object({
4485
+ kind: z31.literal("turn.open"),
4473
4486
  providerTurnId: providerTurnIdSchema.optional(),
4474
4487
  parentRef: deltaKeyPartSchema.optional()
4475
4488
  }),
4476
- z30.object({
4477
- kind: z30.literal("turn.boundary"),
4489
+ z31.object({
4490
+ kind: z31.literal("turn.boundary"),
4478
4491
  status: threadEventTurnStatusSchema,
4479
4492
  error: deltaErrorSchema.optional(),
4480
- providerCheckpointId: z30.string().min(1).optional(),
4481
- claimIfIdle: z30.boolean().optional(),
4493
+ providerCheckpointId: z31.string().min(1).optional(),
4494
+ claimIfIdle: z31.boolean().optional(),
4482
4495
  providerTurnId: providerTurnIdSchema.optional()
4483
4496
  }),
4484
- z30.object({
4485
- kind: z30.literal("item.open"),
4497
+ z31.object({
4498
+ kind: z31.literal("item.open"),
4486
4499
  key: deltaItemKeySchema,
4487
4500
  item: deltaItemShapeSchema,
4488
4501
  presentation: deltaPresentationSchema.optional(),
@@ -4490,139 +4503,139 @@ var threadDeltaSchema = z30.discriminatedUnion("kind", [
4490
4503
  providerTurnId: providerTurnIdSchema.optional(),
4491
4504
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4492
4505
  }).superRefine(requireExtensionPresentation),
4493
- z30.object({
4494
- kind: z30.literal("item.close"),
4506
+ z31.object({
4507
+ kind: z31.literal("item.close"),
4495
4508
  key: deltaItemKeySchema,
4496
4509
  status: threadEventItemStatusSchema,
4497
- resultText: z30.string().optional(),
4498
- exitCode: z30.number().optional(),
4499
- aggregatedOutput: z30.string().optional(),
4500
- approvalStatus: z30.literal("denied").optional(),
4510
+ resultText: z31.string().optional(),
4511
+ exitCode: z31.number().optional(),
4512
+ aggregatedOutput: z31.string().optional(),
4513
+ approvalStatus: z31.literal("denied").optional(),
4501
4514
  item: deltaItemShapeSchema,
4502
4515
  presentation: deltaPresentationSchema.optional(),
4503
4516
  providerTurnId: providerTurnIdSchema.optional(),
4504
4517
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4505
4518
  }).superRefine(requireExtensionPresentation),
4506
- z30.object({
4507
- kind: z30.literal("item.progress"),
4519
+ z31.object({
4520
+ kind: z31.literal("item.progress"),
4508
4521
  key: deltaItemKeySchema,
4509
- message: z30.string().optional(),
4522
+ message: z31.string().optional(),
4510
4523
  snapshot: deltaProgressSnapshotSchema.optional(),
4511
- flush: z30.boolean().optional(),
4524
+ flush: z31.boolean().optional(),
4512
4525
  providerTurnId: providerTurnIdSchema.optional(),
4513
4526
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4514
4527
  }),
4515
- z30.object({
4516
- kind: z30.literal("item.textDelta"),
4528
+ z31.object({
4529
+ kind: z31.literal("item.textDelta"),
4517
4530
  key: deltaItemKeySchema,
4518
4531
  channel: deltaTextChannelSchema,
4519
- text: z30.string(),
4532
+ text: z31.string(),
4520
4533
  providerTurnId: providerTurnIdSchema.optional(),
4521
4534
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4522
4535
  }),
4523
- z30.object({
4524
- kind: z30.literal("item.textClose"),
4536
+ z31.object({
4537
+ kind: z31.literal("item.textClose"),
4525
4538
  key: deltaItemKeySchema,
4526
4539
  channel: deltaTextChannelSchema,
4527
- text: z30.string().optional(),
4540
+ text: z31.string().optional(),
4528
4541
  providerTurnId: providerTurnIdSchema.optional(),
4529
4542
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4530
4543
  }),
4531
- z30.object({
4532
- kind: z30.literal("item.outputDelta"),
4544
+ z31.object({
4545
+ kind: z31.literal("item.outputDelta"),
4533
4546
  key: deltaItemKeySchema,
4534
4547
  channel: deltaOutputChannelSchema,
4535
- text: z30.string(),
4548
+ text: z31.string(),
4536
4549
  providerTurnId: providerTurnIdSchema.optional(),
4537
4550
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4538
4551
  }),
4539
- z30.object({
4540
- kind: z30.literal("command.outputSnapshot"),
4552
+ z31.object({
4553
+ kind: z31.literal("command.outputSnapshot"),
4541
4554
  key: deltaItemKeySchema,
4542
- text: z30.string(),
4555
+ text: z31.string(),
4543
4556
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4544
4557
  }),
4545
- z30.object({
4546
- kind: z30.literal("usage"),
4558
+ z31.object({
4559
+ kind: z31.literal("usage"),
4547
4560
  total: threadEventTokenUsageBreakdownSchema,
4548
4561
  last: threadEventTokenUsageBreakdownSchema,
4549
- modelContextWindow: z30.number().nullable(),
4562
+ modelContextWindow: z31.number().nullable(),
4550
4563
  providerTurnId: providerTurnIdSchema.optional()
4551
4564
  }),
4552
- z30.object({
4553
- kind: z30.literal("contextWindow"),
4554
- used: z30.number().nullable(),
4555
- size: z30.number().nullable().optional(),
4556
- estimated: z30.boolean(),
4565
+ z31.object({
4566
+ kind: z31.literal("contextWindow"),
4567
+ used: z31.number().nullable(),
4568
+ size: z31.number().nullable().optional(),
4569
+ estimated: z31.boolean(),
4557
4570
  attach: deltaAttachSchema,
4558
4571
  providerTurnId: providerTurnIdSchema.optional()
4559
4572
  }),
4560
- z30.object({
4561
- kind: z30.literal("context.compacted"),
4573
+ z31.object({
4574
+ kind: z31.literal("context.compacted"),
4562
4575
  providerTurnId: providerTurnIdSchema.optional(),
4563
4576
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4564
4577
  }),
4565
- z30.object({ kind: z30.literal("context.cleared") }),
4566
- z30.object({
4567
- kind: z30.literal("turn.diff"),
4568
- diff: z30.string(),
4578
+ z31.object({ kind: z31.literal("context.cleared") }),
4579
+ z31.object({
4580
+ kind: z31.literal("turn.diff"),
4581
+ diff: z31.string(),
4569
4582
  providerTurnId: providerTurnIdSchema.optional()
4570
4583
  }),
4571
- z30.object({ kind: z30.literal("thread.started") }),
4572
- z30.object({
4573
- kind: z30.literal("thread.identity"),
4574
- providerThreadId: z30.string().min(1)
4584
+ z31.object({ kind: z31.literal("thread.started") }),
4585
+ z31.object({
4586
+ kind: z31.literal("thread.identity"),
4587
+ providerThreadId: z31.string().min(1)
4575
4588
  }),
4576
- z30.object({ kind: z30.literal("thread.name"), name: z30.string().min(1) }),
4577
- z30.object({
4578
- kind: z30.literal("extension.state"),
4589
+ z31.object({ kind: z31.literal("thread.name"), name: z31.string().min(1) }),
4590
+ z31.object({
4591
+ kind: z31.literal("extension.state"),
4579
4592
  extensionKind: extensionKindSchema,
4580
4593
  payload: jsonValueSchema
4581
4594
  }),
4582
- z30.object({
4583
- kind: z30.literal("provider.rateLimits"),
4595
+ z31.object({
4596
+ kind: z31.literal("provider.rateLimits"),
4584
4597
  rateLimits: providerRateLimitStateSchema
4585
4598
  }),
4586
- z30.object({
4587
- kind: z30.literal("provider.error"),
4588
- message: z30.string(),
4589
- detail: z30.string().optional(),
4590
- willRetry: z30.boolean().optional(),
4599
+ z31.object({
4600
+ kind: z31.literal("provider.error"),
4601
+ message: z31.string(),
4602
+ detail: z31.string().optional(),
4603
+ willRetry: z31.boolean().optional(),
4591
4604
  category: providerErrorCategorySchema.optional(),
4592
4605
  errorInfo: providerErrorInfoSchema.optional(),
4593
- settlesTurn: z30.boolean().optional(),
4606
+ settlesTurn: z31.boolean().optional(),
4594
4607
  providerTurnId: providerTurnIdSchema.optional(),
4595
- threadScoped: z30.boolean().optional()
4608
+ threadScoped: z31.boolean().optional()
4596
4609
  }),
4597
- z30.object({
4598
- kind: z30.literal("provider.modelFallback"),
4599
- originalModel: z30.string().min(1),
4600
- fallbackModel: z30.string().min(1),
4601
- reason: z30.enum(["refusal", "provider"]),
4602
- message: z30.string()
4610
+ z31.object({
4611
+ kind: z31.literal("provider.modelFallback"),
4612
+ originalModel: z31.string().min(1),
4613
+ fallbackModel: z31.string().min(1),
4614
+ reason: z31.enum(["refusal", "provider"]),
4615
+ message: z31.string()
4603
4616
  }),
4604
- z30.object({
4605
- kind: z30.literal("provider.warning"),
4606
- summary: z30.string().optional(),
4607
- details: z30.string().optional(),
4617
+ z31.object({
4618
+ kind: z31.literal("provider.warning"),
4619
+ summary: z31.string().optional(),
4620
+ details: z31.string().optional(),
4608
4621
  category: threadEventWarningCategorySchema.optional(),
4609
- vouchedTurn: z30.boolean().optional()
4622
+ vouchedTurn: z31.boolean().optional()
4610
4623
  }),
4611
- z30.object({
4612
- kind: z30.literal("unhandled"),
4624
+ z31.object({
4625
+ kind: z31.literal("unhandled"),
4613
4626
  raw: providerRawEventSchema,
4614
- rawType: z30.string(),
4615
- vouchedTurn: z30.boolean(),
4616
- onlyIfNoTurn: z30.boolean().optional(),
4627
+ rawType: z31.string(),
4628
+ vouchedTurn: z31.boolean(),
4629
+ onlyIfNoTurn: z31.boolean().optional(),
4617
4630
  parentRef: deltaKeyPartSchema.optional(),
4618
4631
  providerTurnId: providerTurnIdSchema.optional()
4619
4632
  }),
4620
- z30.object({ kind: z30.literal("session.ended") }),
4621
- z30.object({ kind: z30.literal("session.reset") })
4633
+ z31.object({ kind: z31.literal("session.ended") }),
4634
+ z31.object({ kind: z31.literal("session.reset") })
4622
4635
  ]);
4623
- var threadDeltaNotificationParamsSchema = z30.object({
4624
- threadId: z30.string().min(1),
4625
- deltas: z30.array(threadDeltaSchema)
4636
+ var threadDeltaNotificationParamsSchema = z31.object({
4637
+ threadId: z31.string().min(1),
4638
+ deltas: z31.array(threadDeltaSchema)
4626
4639
  }).passthrough();
4627
4640
 
4628
4641
  // ../process-utils/src/index.ts
@@ -4645,10 +4658,10 @@ function sanitizeInheritedChildProcessEnv(args) {
4645
4658
  }
4646
4659
 
4647
4660
  // ../provider-bridge-acp/src/launch-spec.ts
4648
- import { z as z31 } from "zod";
4649
- var acpNativeSkillRootsSchema = z31.object({
4650
- user: z31.array(providerNativeRootInputSchema).default([]),
4651
- project: z31.array(providerNativeRootInputSchema).default([])
4661
+ import { z as z32 } from "zod";
4662
+ var acpNativeSkillRootsSchema = z32.object({
4663
+ user: z32.array(providerNativeRootInputSchema).default([]),
4664
+ project: z32.array(providerNativeRootInputSchema).default([])
4652
4665
  }).strict().superRefine((roots, context) => {
4653
4666
  const normalized = providerNativeRootsSchema.safeParse(
4654
4667
  normalizeProviderNativeRoots(roots)
@@ -4664,16 +4677,16 @@ var acpNativeSkillRootsSchema = z31.object({
4664
4677
  });
4665
4678
  }
4666
4679
  });
4667
- var acpLaunchSpecSchema = z31.object({
4668
- displayName: z31.string().min(1),
4669
- command: z31.string().min(1),
4670
- args: z31.array(z31.string()),
4671
- env: z31.record(z31.string().min(1), z31.string()),
4672
- cwd: z31.string().min(1).optional(),
4673
- modelCli: z31.object({
4674
- listArgs: z31.array(z31.string()),
4675
- selectFlag: z31.string().min(1).optional(),
4676
- primaryModels: z31.array(z31.string())
4680
+ var acpLaunchSpecSchema = z32.object({
4681
+ displayName: z32.string().min(1),
4682
+ command: z32.string().min(1),
4683
+ args: z32.array(z32.string()),
4684
+ env: z32.record(z32.string().min(1), z32.string()),
4685
+ cwd: z32.string().min(1).optional(),
4686
+ modelCli: z32.object({
4687
+ listArgs: z32.array(z32.string()),
4688
+ selectFlag: z32.string().min(1).optional(),
4689
+ primaryModels: z32.array(z32.string())
4677
4690
  }).strict().transform(
4678
4691
  (modelCli) => modelCli.listArgs.length > 0 ? modelCli : void 0
4679
4692
  ).optional(),
@@ -4711,35 +4724,35 @@ function normalizeAcpLaunchSpec(spec) {
4711
4724
  }
4712
4725
 
4713
4726
  // src/claude-task-tools.ts
4714
- import { z as z32 } from "zod";
4715
- var claudeTaskToolNameSchema = z32.enum([
4727
+ import { z as z33 } from "zod";
4728
+ var claudeTaskToolNameSchema = z33.enum([
4716
4729
  "TaskCreate",
4717
4730
  "TaskGet",
4718
4731
  "TaskList",
4719
4732
  "TaskUpdate"
4720
4733
  ]);
4721
- var claudeTaskStatusSchema = z32.enum(["pending", "in_progress", "completed"]);
4722
- var claudeTaskCreateOutputSchema = z32.object({
4723
- task: z32.object({
4724
- id: z32.string(),
4725
- subject: z32.string()
4734
+ var claudeTaskStatusSchema = z33.enum(["pending", "in_progress", "completed"]);
4735
+ var claudeTaskCreateOutputSchema = z33.object({
4736
+ task: z33.object({
4737
+ id: z33.string(),
4738
+ subject: z33.string()
4726
4739
  }).passthrough()
4727
4740
  }).passthrough();
4728
- var claudeTaskGetOutputSchema = z32.object({
4729
- task: z32.object({
4730
- id: z32.string(),
4741
+ var claudeTaskGetOutputSchema = z33.object({
4742
+ task: z33.object({
4743
+ id: z33.string(),
4731
4744
  status: claudeTaskStatusSchema,
4732
- subject: z32.string()
4745
+ subject: z33.string()
4733
4746
  }).passthrough().nullable()
4734
4747
  }).passthrough();
4735
- var claudeTaskUpdateOutputSchema = z32.object({
4736
- success: z32.boolean(),
4737
- taskId: z32.string()
4748
+ var claudeTaskUpdateOutputSchema = z33.object({
4749
+ success: z33.boolean(),
4750
+ taskId: z33.string()
4738
4751
  }).passthrough();
4739
- var claudeTaskListOutputSchema = z32.object({
4740
- tasks: z32.array(z32.unknown())
4752
+ var claudeTaskListOutputSchema = z33.object({
4753
+ tasks: z33.array(z33.unknown())
4741
4754
  }).passthrough();
4742
- var claudeTaskToolOutputSchema = z32.union([
4755
+ var claudeTaskToolOutputSchema = z33.union([
4743
4756
  claudeTaskCreateOutputSchema,
4744
4757
  claudeTaskGetOutputSchema,
4745
4758
  claudeTaskListOutputSchema,