@get-bb/plugin-sdk 0.6.105 → 0.6.112

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.
@@ -271,8 +271,12 @@ import { z as z4 } from "zod";
271
271
  var COMPLETED_TURN_DISPLAY_VALUES = ["collapse", "flat"];
272
272
  var completedTurnDisplaySchema = z4.enum(COMPLETED_TURN_DISPLAY_VALUES);
273
273
 
274
- // ../domain/src/background-task.ts
274
+ // ../domain/src/plugin-id.ts
275
275
  import { z as z5 } from "zod";
276
+ var pluginIdSchema = z5.string().regex(/^[a-z0-9][a-z0-9-]*$/u);
277
+
278
+ // ../domain/src/background-task.ts
279
+ import { z as z6 } from "zod";
276
280
  var backgroundTaskStatusValues = [
277
281
  "pending",
278
282
  "running",
@@ -282,7 +286,7 @@ var backgroundTaskStatusValues = [
282
286
  "killed",
283
287
  "stopped"
284
288
  ];
285
- var backgroundTaskStatusSchema = z5.enum(backgroundTaskStatusValues);
289
+ var backgroundTaskStatusSchema = z6.enum(backgroundTaskStatusValues);
286
290
  var workflowAgentStateValues = [
287
291
  "queued",
288
292
  "running",
@@ -290,51 +294,51 @@ var workflowAgentStateValues = [
290
294
  "failed",
291
295
  "skipped"
292
296
  ];
293
- var workflowAgentStateSchema = z5.enum(workflowAgentStateValues);
294
- var workflowAgentSnapshotSchema = z5.object({
295
- index: z5.number().int().positive(),
296
- label: z5.string(),
297
+ var workflowAgentStateSchema = z6.enum(workflowAgentStateValues);
298
+ var workflowAgentSnapshotSchema = z6.object({
299
+ index: z6.number().int().positive(),
300
+ label: z6.string(),
297
301
  state: workflowAgentStateSchema,
298
- model: z5.string(),
299
- attempt: z5.number().int().positive(),
300
- cached: z5.boolean(),
301
- lastProgressAt: z5.number(),
302
- phaseIndex: z5.number().int().positive().optional(),
303
- phaseTitle: z5.string().optional(),
304
- agentType: z5.string().optional(),
305
- isolation: z5.string().optional(),
306
- queuedAt: z5.number().optional(),
307
- startedAt: z5.number().optional(),
308
- lastToolName: z5.string().optional(),
309
- lastToolSummary: z5.string().optional(),
310
- promptPreview: z5.string().optional(),
311
- resultPreview: z5.string().optional(),
312
- error: z5.string().optional(),
313
- tokens: z5.number().optional(),
314
- toolCalls: z5.number().optional(),
315
- durationMs: z5.number().optional()
316
- });
317
- var workflowPhaseSnapshotSchema = z5.object({
318
- index: z5.number().int().positive(),
319
- title: z5.string(),
320
- kind: z5.string().optional()
321
- });
322
- var workflowProgressSnapshotSchema = z5.object({
323
- phases: z5.array(workflowPhaseSnapshotSchema),
324
- agents: z5.array(workflowAgentSnapshotSchema)
325
- });
326
- var backgroundTaskUsageSchema = z5.object({
327
- totalTokens: z5.number(),
328
- toolUses: z5.number(),
329
- durationMs: z5.number()
302
+ model: z6.string(),
303
+ attempt: z6.number().int().positive(),
304
+ cached: z6.boolean(),
305
+ lastProgressAt: z6.number(),
306
+ phaseIndex: z6.number().int().positive().optional(),
307
+ phaseTitle: z6.string().optional(),
308
+ agentType: z6.string().optional(),
309
+ isolation: z6.string().optional(),
310
+ queuedAt: z6.number().optional(),
311
+ startedAt: z6.number().optional(),
312
+ lastToolName: z6.string().optional(),
313
+ lastToolSummary: z6.string().optional(),
314
+ promptPreview: z6.string().optional(),
315
+ resultPreview: z6.string().optional(),
316
+ error: z6.string().optional(),
317
+ tokens: z6.number().optional(),
318
+ toolCalls: z6.number().optional(),
319
+ durationMs: z6.number().optional()
320
+ });
321
+ var workflowPhaseSnapshotSchema = z6.object({
322
+ index: z6.number().int().positive(),
323
+ title: z6.string(),
324
+ kind: z6.string().optional()
325
+ });
326
+ var workflowProgressSnapshotSchema = z6.object({
327
+ phases: z6.array(workflowPhaseSnapshotSchema),
328
+ agents: z6.array(workflowAgentSnapshotSchema)
329
+ });
330
+ var backgroundTaskUsageSchema = z6.object({
331
+ totalTokens: z6.number(),
332
+ toolUses: z6.number(),
333
+ durationMs: z6.number()
330
334
  });
331
335
 
332
336
  // ../domain/src/protocol-ids.ts
333
- import { z as z6 } from "zod";
334
- var clientTurnRequestIdSchema = z6.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
337
+ import { z as z7 } from "zod";
338
+ var clientTurnRequestIdSchema = z7.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
335
339
 
336
340
  // ../domain/src/system-message.ts
337
- import { z as z7 } from "zod";
341
+ import { z as z8 } from "zod";
338
342
  var systemMessageKindValues = [
339
343
  "ownership-assigned",
340
344
  "ownership-removed",
@@ -347,77 +351,77 @@ var systemMessageKindValues = [
347
351
  "environment-directory-updated",
348
352
  "unlabeled"
349
353
  ];
350
- var systemMessageKindSchema = z7.enum(systemMessageKindValues);
351
- var systemThreadInterruptedReasonSchema = z7.enum([
354
+ var systemMessageKindSchema = z8.enum(systemMessageKindValues);
355
+ var systemThreadInterruptedReasonSchema = z8.enum([
352
356
  "manual-stop",
353
357
  "host-daemon-restarted",
354
358
  "host-removed",
355
359
  "provider-turn-idle"
356
360
  ]);
357
- var childThreadOutcomeSchema = z7.object({
358
- threadId: z7.string(),
359
- status: z7.enum(["completed", "failed", "interrupted"]),
360
- interruption: z7.object({
361
+ var childThreadOutcomeSchema = z8.object({
362
+ threadId: z8.string(),
363
+ status: z8.enum(["completed", "failed", "interrupted"]),
364
+ interruption: z8.object({
361
365
  reason: systemThreadInterruptedReasonSchema,
362
- cause: z7.literal("host-connection-lost").optional()
366
+ cause: z8.literal("host-connection-lost").optional()
363
367
  }).optional()
364
368
  });
365
- var systemMessageSubjectSchema = z7.discriminatedUnion("kind", [
366
- z7.object({
367
- kind: z7.literal("thread"),
368
- threadId: z7.string(),
369
- threadName: z7.string(),
370
- outcomes: z7.array(childThreadOutcomeSchema).optional()
369
+ var systemMessageSubjectSchema = z8.discriminatedUnion("kind", [
370
+ z8.object({
371
+ kind: z8.literal("thread"),
372
+ threadId: z8.string(),
373
+ threadName: z8.string(),
374
+ outcomes: z8.array(childThreadOutcomeSchema).optional()
371
375
  }),
372
- z7.object({
373
- kind: z7.literal("thread-batch"),
374
- count: z7.number(),
375
- outcomes: z7.array(childThreadOutcomeSchema).optional()
376
+ z8.object({
377
+ kind: z8.literal("thread-batch"),
378
+ count: z8.number(),
379
+ outcomes: z8.array(childThreadOutcomeSchema).optional()
376
380
  }),
377
- z7.object({
378
- kind: z7.literal("tool-call"),
379
- toolName: z7.string(),
380
- suppress: z7.boolean()
381
+ z8.object({
382
+ kind: z8.literal("tool-call"),
383
+ toolName: z8.string(),
384
+ suppress: z8.boolean()
381
385
  }),
382
- z7.object({
383
- kind: z7.literal("directory"),
384
- path: z7.string()
386
+ z8.object({
387
+ kind: z8.literal("directory"),
388
+ path: z8.string()
385
389
  })
386
390
  ]);
387
391
 
388
392
  // ../domain/src/item-presentation.ts
389
- import { z as z8 } from "zod";
393
+ import { z as z9 } from "zod";
390
394
  var THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH = 280;
391
- var threadEventItemPresentationLabelSchema = z8.object({
392
- pending: z8.string().min(1),
393
- completed: z8.string().min(1)
395
+ var threadEventItemPresentationLabelSchema = z9.object({
396
+ pending: z9.string().min(1),
397
+ completed: z9.string().min(1)
394
398
  });
395
- var threadEventItemPresentationIconSchema = z8.object({
396
- glyph: z8.string().min(1)
399
+ var threadEventItemPresentationIconSchema = z9.object({
400
+ glyph: z9.string().min(1)
397
401
  });
398
- var threadEventItemPresentationTintSchema = z8.object({
399
- light: z8.string().min(1),
400
- dark: z8.string().min(1)
402
+ var threadEventItemPresentationTintSchema = z9.object({
403
+ light: z9.string().min(1),
404
+ dark: z9.string().min(1)
401
405
  });
402
406
  var THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH = 80;
403
- var threadEventItemPresentationBadgeSchema = z8.object({
404
- glyph: z8.string().min(1),
405
- label: z8.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
406
- hint: z8.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
407
- tone: z8.enum(["neutral", "destructive"])
407
+ var threadEventItemPresentationBadgeSchema = z9.object({
408
+ glyph: z9.string().min(1),
409
+ label: z9.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
410
+ hint: z9.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
411
+ tone: z9.enum(["neutral", "destructive"])
408
412
  });
409
- var threadEventItemPresentationSchema = z8.object({
413
+ var threadEventItemPresentationSchema = z9.object({
410
414
  label: threadEventItemPresentationLabelSchema,
411
415
  icon: threadEventItemPresentationIconSchema,
412
- title: z8.string().optional(),
413
- detail: z8.string().max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
414
- suppress: z8.boolean().optional(),
416
+ title: z9.string().optional(),
417
+ detail: z9.string().max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
418
+ suppress: z9.boolean().optional(),
415
419
  tint: threadEventItemPresentationTintSchema.optional(),
416
420
  badge: threadEventItemPresentationBadgeSchema.optional()
417
421
  });
418
422
 
419
423
  // ../domain/src/pending-interactions.ts
420
- import { z as z10 } from "zod";
424
+ import { z as z11 } from "zod";
421
425
 
422
426
  // ../domain/src/plugin-interaction-limits.ts
423
427
  var PLUGIN_INTERACTION_MAX_TITLE_LENGTH = 160;
@@ -428,193 +432,193 @@ function jsonByteLength(value) {
428
432
  }
429
433
 
430
434
  // ../domain/src/provider-extension-kind.ts
431
- import { z as z9 } from "zod";
435
+ import { z as z10 } from "zod";
432
436
  var EXTENSION_KIND_PATTERN = /^[a-z0-9-]+\/[a-z0-9-]+$/u;
433
437
  function isExtensionKind(value) {
434
438
  return EXTENSION_KIND_PATTERN.test(value);
435
439
  }
436
- var extensionKindSchema = z9.string().refine(isExtensionKind, {
440
+ var extensionKindSchema = z10.string().refine(isExtensionKind, {
437
441
  message: 'extension kinds are "<pluginId>/<name>" (lowercase letters, digits, and "-")'
438
442
  });
439
443
 
440
444
  // ../domain/src/pending-interactions.ts
441
- var pendingInteractionStatusSchema = z10.enum([
445
+ var pendingInteractionStatusSchema = z11.enum([
442
446
  "pending",
443
447
  "resolving",
444
448
  "resolved",
445
449
  "interrupted"
446
450
  ]);
447
- var pendingInteractionCommandActionSchema = z10.discriminatedUnion(
451
+ var pendingInteractionCommandActionSchema = z11.discriminatedUnion(
448
452
  "type",
449
453
  [
450
- z10.object({
451
- type: z10.literal("read"),
452
- command: z10.string(),
453
- name: z10.string(),
454
- path: z10.string()
454
+ z11.object({
455
+ type: z11.literal("read"),
456
+ command: z11.string(),
457
+ name: z11.string(),
458
+ path: z11.string()
455
459
  }),
456
- z10.object({
457
- type: z10.literal("listFiles"),
458
- command: z10.string(),
459
- path: z10.string().nullable()
460
+ z11.object({
461
+ type: z11.literal("listFiles"),
462
+ command: z11.string(),
463
+ path: z11.string().nullable()
460
464
  }),
461
- z10.object({
462
- type: z10.literal("search"),
463
- command: z10.string(),
464
- query: z10.string().nullable(),
465
- path: z10.string().nullable()
465
+ z11.object({
466
+ type: z11.literal("search"),
467
+ command: z11.string(),
468
+ query: z11.string().nullable(),
469
+ path: z11.string().nullable()
466
470
  }),
467
- z10.object({
468
- type: z10.literal("unknown"),
469
- command: z10.string()
471
+ z11.object({
472
+ type: z11.literal("unknown"),
473
+ command: z11.string()
470
474
  })
471
475
  ]
472
476
  );
473
- var pendingInteractionNetworkPermissionsSchema = z10.object({
474
- enabled: z10.boolean().nullable()
477
+ var pendingInteractionNetworkPermissionsSchema = z11.object({
478
+ enabled: z11.boolean().nullable()
475
479
  });
476
- var pendingInteractionFileSystemPermissionsSchema = z10.object({
477
- read: z10.array(z10.string()),
478
- write: z10.array(z10.string())
480
+ var pendingInteractionFileSystemPermissionsSchema = z11.object({
481
+ read: z11.array(z11.string()),
482
+ write: z11.array(z11.string())
479
483
  });
480
- var pendingInteractionMacOsPreferencesPermissionSchema = z10.enum([
484
+ var pendingInteractionMacOsPreferencesPermissionSchema = z11.enum([
481
485
  "none",
482
486
  "read_only",
483
487
  "read_write"
484
488
  ]);
485
- var pendingInteractionMacOsContactsPermissionSchema = z10.enum([
489
+ var pendingInteractionMacOsContactsPermissionSchema = z11.enum([
486
490
  "none",
487
491
  "read_only",
488
492
  "read_write"
489
493
  ]);
490
- var pendingInteractionMacOsAutomationPermissionSchema = z10.union([
491
- z10.literal("none"),
492
- z10.literal("all"),
493
- z10.object({
494
- kind: z10.literal("bundle_ids"),
495
- bundleIds: z10.array(z10.string())
494
+ var pendingInteractionMacOsAutomationPermissionSchema = z11.union([
495
+ z11.literal("none"),
496
+ z11.literal("all"),
497
+ z11.object({
498
+ kind: z11.literal("bundle_ids"),
499
+ bundleIds: z11.array(z11.string())
496
500
  })
497
501
  ]);
498
- var pendingInteractionMacOsPermissionsSchema = z10.object({
502
+ var pendingInteractionMacOsPermissionsSchema = z11.object({
499
503
  preferences: pendingInteractionMacOsPreferencesPermissionSchema,
500
504
  automations: pendingInteractionMacOsAutomationPermissionSchema,
501
- launchServices: z10.boolean(),
502
- accessibility: z10.boolean(),
503
- calendar: z10.boolean(),
504
- reminders: z10.boolean(),
505
+ launchServices: z11.boolean(),
506
+ accessibility: z11.boolean(),
507
+ calendar: z11.boolean(),
508
+ reminders: z11.boolean(),
505
509
  contacts: pendingInteractionMacOsContactsPermissionSchema
506
510
  });
507
- var pendingInteractionRequestedPermissionProfileSchema = z10.object({
511
+ var pendingInteractionRequestedPermissionProfileSchema = z11.object({
508
512
  network: pendingInteractionNetworkPermissionsSchema.nullable(),
509
513
  fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable(),
510
514
  macos: pendingInteractionMacOsPermissionsSchema.nullable()
511
515
  });
512
- var pendingInteractionGrantablePermissionProfileSchema = z10.object({
516
+ var pendingInteractionGrantablePermissionProfileSchema = z11.object({
513
517
  network: pendingInteractionNetworkPermissionsSchema.nullable(),
514
518
  fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable()
515
519
  }).strict();
516
520
  var pendingInteractionGrantedPermissionProfileSchema = pendingInteractionGrantablePermissionProfileSchema;
517
- var pendingInteractionApprovalDecisionSchema = z10.enum([
521
+ var pendingInteractionApprovalDecisionSchema = z11.enum([
518
522
  "allow_once",
519
523
  "allow_for_session",
520
524
  "deny"
521
525
  ]);
522
- var pendingInteractionFileChangeWriteScopeSchema = z10.string().min(1);
523
- var pendingInteractionCommandApprovalSubjectSchema = z10.object({
524
- kind: z10.literal("command"),
525
- itemId: z10.string().min(1),
526
- command: z10.string().min(1),
527
- cwd: z10.string().nullable(),
528
- actions: z10.array(pendingInteractionCommandActionSchema),
526
+ var pendingInteractionFileChangeWriteScopeSchema = z11.string().min(1);
527
+ var pendingInteractionCommandApprovalSubjectSchema = z11.object({
528
+ kind: z11.literal("command"),
529
+ itemId: z11.string().min(1),
530
+ command: z11.string().min(1),
531
+ cwd: z11.string().nullable(),
532
+ actions: z11.array(pendingInteractionCommandActionSchema),
529
533
  sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
530
534
  });
531
- var pendingInteractionFileChangeApprovalSubjectSchema = z10.object({
532
- kind: z10.literal("file_change"),
533
- itemId: z10.string().min(1),
535
+ var pendingInteractionFileChangeApprovalSubjectSchema = z11.object({
536
+ kind: z11.literal("file_change"),
537
+ itemId: z11.string().min(1),
534
538
  writeScope: pendingInteractionFileChangeWriteScopeSchema.nullable(),
535
539
  sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
536
540
  });
537
- var pendingInteractionPermissionGrantApprovalSubjectSchema = z10.object({
538
- kind: z10.literal("permission_grant"),
539
- itemId: z10.string().min(1),
540
- toolName: z10.string().nullable(),
541
+ var pendingInteractionPermissionGrantApprovalSubjectSchema = z11.object({
542
+ kind: z11.literal("permission_grant"),
543
+ itemId: z11.string().min(1),
544
+ toolName: z11.string().nullable(),
541
545
  permissions: pendingInteractionGrantablePermissionProfileSchema
542
546
  });
543
- var pendingInteractionPlanApprovalSubjectSchema = z10.object({
544
- kind: z10.literal("plan"),
545
- itemId: z10.string().min(1),
546
- plan: z10.string().min(1),
547
- planFilePath: z10.string().min(1).nullable()
547
+ var pendingInteractionPlanApprovalSubjectSchema = z11.object({
548
+ kind: z11.literal("plan"),
549
+ itemId: z11.string().min(1),
550
+ plan: z11.string().min(1),
551
+ planFilePath: z11.string().min(1).nullable()
548
552
  });
549
- var pendingInteractionToolUseApprovalSubjectSchema = z10.object({
550
- kind: z10.literal("tool_use"),
551
- itemId: z10.string().min(1),
552
- tool: z10.string().min(1),
553
+ var pendingInteractionToolUseApprovalSubjectSchema = z11.object({
554
+ kind: z11.literal("tool_use"),
555
+ itemId: z11.string().min(1),
556
+ tool: z11.string().min(1),
553
557
  presentation: threadEventItemPresentationSchema
554
558
  });
555
- var pendingInteractionApprovalSubjectSchema = z10.discriminatedUnion("kind", [
559
+ var pendingInteractionApprovalSubjectSchema = z11.discriminatedUnion("kind", [
556
560
  pendingInteractionCommandApprovalSubjectSchema,
557
561
  pendingInteractionFileChangeApprovalSubjectSchema,
558
562
  pendingInteractionPermissionGrantApprovalSubjectSchema,
559
563
  pendingInteractionPlanApprovalSubjectSchema,
560
564
  pendingInteractionToolUseApprovalSubjectSchema
561
565
  ]);
562
- var approvalPendingInteractionPayloadSchema = z10.object({
563
- kind: z10.literal("approval"),
566
+ var approvalPendingInteractionPayloadSchema = z11.object({
567
+ kind: z11.literal("approval"),
564
568
  subject: pendingInteractionApprovalSubjectSchema,
565
- reason: z10.string().nullable(),
566
- availableDecisions: z10.array(pendingInteractionApprovalDecisionSchema).min(1)
569
+ reason: z11.string().nullable(),
570
+ availableDecisions: z11.array(pendingInteractionApprovalDecisionSchema).min(1)
567
571
  });
568
572
  var USER_QUESTION_MAX_QUESTIONS = 10;
569
573
  var USER_QUESTION_MAX_OPTIONS = 4;
570
574
  var USER_QUESTION_MAX_SELECTED = 4;
571
575
  var USER_QUESTION_MAX_FREE_TEXT_LENGTH = 4096;
572
- var pendingInteractionUserQuestionIdSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
576
+ var pendingInteractionUserQuestionIdSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
573
577
  message: "User question ids cannot be blank"
574
578
  });
575
- var pendingInteractionUserQuestionPromptSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
579
+ var pendingInteractionUserQuestionPromptSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
576
580
  message: "User question prompts cannot be blank"
577
581
  });
578
- var pendingInteractionUserQuestionShortLabelSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
582
+ var pendingInteractionUserQuestionShortLabelSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
579
583
  message: "User question short labels cannot be blank"
580
584
  });
581
- var pendingInteractionUserQuestionOptionValueSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
585
+ var pendingInteractionUserQuestionOptionValueSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
582
586
  message: "User question option values cannot be blank"
583
587
  });
584
- var pendingInteractionUserQuestionOptionLabelSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
588
+ var pendingInteractionUserQuestionOptionLabelSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
585
589
  message: "User question option labels cannot be blank"
586
590
  });
587
- var pendingInteractionUserQuestionOptionDescriptionSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
591
+ var pendingInteractionUserQuestionOptionDescriptionSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
588
592
  message: "User question option descriptions cannot be blank"
589
593
  });
590
- var pendingInteractionUserQuestionFreeTextSchema = z10.string().min(1).max(
594
+ var pendingInteractionUserQuestionFreeTextSchema = z11.string().min(1).max(
591
595
  USER_QUESTION_MAX_FREE_TEXT_LENGTH,
592
596
  `User question free text cannot exceed ${USER_QUESTION_MAX_FREE_TEXT_LENGTH} characters`
593
597
  ).refine((value) => value.trim().length > 0, {
594
598
  message: "User question free text cannot be blank"
595
599
  });
596
- var pendingInteractionUserQuestionOptionSchema = z10.object({
600
+ var pendingInteractionUserQuestionOptionSchema = z11.object({
597
601
  value: pendingInteractionUserQuestionOptionValueSchema,
598
602
  label: pendingInteractionUserQuestionOptionLabelSchema,
599
603
  description: pendingInteractionUserQuestionOptionDescriptionSchema.optional()
600
604
  });
601
- var pendingInteractionUserQuestionQuestionSchema = z10.object({
605
+ var pendingInteractionUserQuestionQuestionSchema = z11.object({
602
606
  id: pendingInteractionUserQuestionIdSchema,
603
607
  prompt: pendingInteractionUserQuestionPromptSchema,
604
608
  shortLabel: pendingInteractionUserQuestionShortLabelSchema.optional(),
605
- multiSelect: z10.boolean(),
606
- options: z10.array(pendingInteractionUserQuestionOptionSchema).max(
609
+ multiSelect: z11.boolean(),
610
+ options: z11.array(pendingInteractionUserQuestionOptionSchema).max(
607
611
  USER_QUESTION_MAX_OPTIONS,
608
612
  `User questions cannot include more than ${USER_QUESTION_MAX_OPTIONS} options`
609
613
  ).optional(),
610
- allowFreeText: z10.boolean(),
611
- required: z10.boolean().default(true)
614
+ allowFreeText: z11.boolean(),
615
+ required: z11.boolean().default(true)
612
616
  }).superRefine((question, context) => {
613
617
  const optionValues = /* @__PURE__ */ new Set();
614
618
  question.options?.forEach((option, index) => {
615
619
  if (optionValues.has(option.value)) {
616
620
  context.addIssue({
617
- code: z10.ZodIssueCode.custom,
621
+ code: z11.ZodIssueCode.custom,
618
622
  message: "User question option values must be unique",
619
623
  path: ["options", index, "value"]
620
624
  });
@@ -629,9 +633,9 @@ var pendingInteractionUserQuestionQuestionSchema = z10.object({
629
633
  path: ["options"]
630
634
  }
631
635
  );
632
- var userQuestionPendingInteractionPayloadSchema = z10.object({
633
- kind: z10.literal("user_question"),
634
- questions: z10.array(pendingInteractionUserQuestionQuestionSchema).min(1).max(
636
+ var userQuestionPendingInteractionPayloadSchema = z11.object({
637
+ kind: z11.literal("user_question"),
638
+ questions: z11.array(pendingInteractionUserQuestionQuestionSchema).min(1).max(
635
639
  USER_QUESTION_MAX_QUESTIONS,
636
640
  `User questions cannot include more than ${USER_QUESTION_MAX_QUESTIONS} questions`
637
641
  )
@@ -640,7 +644,7 @@ var userQuestionPendingInteractionPayloadSchema = z10.object({
640
644
  payload.questions.forEach((question, index) => {
641
645
  if (questionIds.has(question.id)) {
642
646
  context.addIssue({
643
- code: z10.ZodIssueCode.custom,
647
+ code: z11.ZodIssueCode.custom,
644
648
  message: "User question ids must be unique",
645
649
  path: ["questions", index, "id"]
646
650
  });
@@ -649,75 +653,75 @@ var userQuestionPendingInteractionPayloadSchema = z10.object({
649
653
  questionIds.add(question.id);
650
654
  });
651
655
  });
652
- var pluginPendingInteractionPayloadSchema = z10.object({
653
- kind: z10.literal("plugin"),
654
- title: z10.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
656
+ var pluginPendingInteractionPayloadSchema = z11.object({
657
+ kind: z11.literal("plugin"),
658
+ title: z11.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
655
659
  data: jsonValueSchema,
656
660
  presentation: threadEventItemPresentationSchema.optional()
657
661
  });
658
- var pluginExtensionInteractionRequestPayloadSchema = z10.object({
662
+ var pluginExtensionInteractionRequestPayloadSchema = z11.object({
659
663
  kind: extensionKindSchema,
660
- title: z10.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
664
+ title: z11.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
661
665
  data: jsonValueSchema.refine(
662
666
  (value) => jsonByteLength(value) <= PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES,
663
667
  { message: "Plugin request data exceeds 64 KiB" }
664
668
  )
665
669
  });
666
- var interactionRequestPayloadSchema = z10.union([
670
+ var interactionRequestPayloadSchema = z11.union([
667
671
  userQuestionPendingInteractionPayloadSchema,
668
672
  pluginExtensionInteractionRequestPayloadSchema
669
673
  ]);
670
- var pendingInteractionPayloadSchema = z10.union([
674
+ var pendingInteractionPayloadSchema = z11.union([
671
675
  approvalPendingInteractionPayloadSchema,
672
676
  userQuestionPendingInteractionPayloadSchema,
673
677
  pluginExtensionInteractionRequestPayloadSchema
674
678
  ]);
675
679
  var approvalDecisionDiscriminatorError = "Invalid discriminator value. Expected 'allow_once' | 'allow_for_session' | 'deny'";
676
- var approvalPendingInteractionResolutionSchema = z10.discriminatedUnion(
680
+ var approvalPendingInteractionResolutionSchema = z11.discriminatedUnion(
677
681
  "decision",
678
682
  [
679
- z10.object({
680
- decision: z10.literal("allow_once"),
683
+ z11.object({
684
+ decision: z11.literal("allow_once"),
681
685
  grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
682
686
  }),
683
- z10.object({
684
- decision: z10.literal("allow_for_session"),
687
+ z11.object({
688
+ decision: z11.literal("allow_for_session"),
685
689
  grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
686
690
  }),
687
- z10.object({
688
- decision: z10.literal("deny")
691
+ z11.object({
692
+ decision: z11.literal("deny")
689
693
  })
690
694
  ],
691
695
  approvalDecisionDiscriminatorError
692
696
  );
693
- var pendingInteractionUserAnswerSchema = z10.object({
694
- selected: z10.array(z10.string().min(1)).max(
697
+ var pendingInteractionUserAnswerSchema = z11.object({
698
+ selected: z11.array(z11.string().min(1)).max(
695
699
  USER_QUESTION_MAX_SELECTED,
696
700
  `User question selected choices cannot exceed ${USER_QUESTION_MAX_SELECTED}`
697
701
  ),
698
702
  freeText: pendingInteractionUserQuestionFreeTextSchema.optional()
699
703
  });
700
- var userQuestionPendingInteractionResolutionSchema = z10.object({
701
- kind: z10.literal("user_answer"),
702
- answers: z10.record(z10.string().min(1), pendingInteractionUserAnswerSchema)
704
+ var userQuestionPendingInteractionResolutionSchema = z11.object({
705
+ kind: z11.literal("user_answer"),
706
+ answers: z11.record(z11.string().min(1), pendingInteractionUserAnswerSchema)
703
707
  });
704
- var pluginInteractionDescriptionSchema = z10.object({
705
- title: z10.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH).optional(),
706
- detail: z10.string().trim().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
708
+ var pluginInteractionDescriptionSchema = z11.object({
709
+ title: z11.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH).optional(),
710
+ detail: z11.string().trim().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
707
711
  payload: jsonValueSchema.refine(
708
712
  (value) => jsonByteLength(value) <= PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES,
709
713
  { message: "Plugin interaction description payload exceeds 64 KiB" }
710
714
  ).optional()
711
715
  });
712
- var pluginPendingInteractionResolutionSchema = z10.object({
713
- kind: z10.literal("plugin_submitted"),
716
+ var pluginPendingInteractionResolutionSchema = z11.object({
717
+ kind: z11.literal("plugin_submitted"),
714
718
  description: pluginInteractionDescriptionSchema.optional()
715
719
  });
716
- var pluginExtensionInteractionResolutionSchema = z10.object({
717
- kind: z10.literal("request_answer"),
720
+ var pluginExtensionInteractionResolutionSchema = z11.object({
721
+ kind: z11.literal("request_answer"),
718
722
  value: jsonValueSchema
719
723
  });
720
- var pendingInteractionResolutionSchema = z10.union(
724
+ var pendingInteractionResolutionSchema = z11.union(
721
725
  [
722
726
  approvalPendingInteractionResolutionSchema,
723
727
  userQuestionPendingInteractionResolutionSchema,
@@ -726,56 +730,56 @@ var pendingInteractionResolutionSchema = z10.union(
726
730
  ],
727
731
  approvalDecisionDiscriminatorError
728
732
  );
729
- var approvalInteractionOutcomeSchema = z10.object({
733
+ var approvalInteractionOutcomeSchema = z11.object({
730
734
  payload: approvalPendingInteractionPayloadSchema,
731
735
  resolution: approvalPendingInteractionResolutionSchema
732
736
  });
733
- var userQuestionInteractionOutcomeSchema = z10.object({
737
+ var userQuestionInteractionOutcomeSchema = z11.object({
734
738
  payload: userQuestionPendingInteractionPayloadSchema,
735
739
  resolution: userQuestionPendingInteractionResolutionSchema
736
740
  });
737
- var pluginExtensionInteractionOutcomeSchema = z10.object({
741
+ var pluginExtensionInteractionOutcomeSchema = z11.object({
738
742
  payload: pluginExtensionInteractionRequestPayloadSchema,
739
743
  resolution: pluginExtensionInteractionResolutionSchema
740
744
  });
741
- var providerInteractionOutcomeSchema = z10.union([
745
+ var providerInteractionOutcomeSchema = z11.union([
742
746
  approvalInteractionOutcomeSchema,
743
747
  userQuestionInteractionOutcomeSchema,
744
748
  pluginExtensionInteractionOutcomeSchema
745
749
  ]);
746
- var pendingInteractionProviderOriginSchema = z10.object({
747
- kind: z10.literal("provider"),
748
- providerId: z10.string().min(1),
749
- providerThreadId: z10.string().min(1),
750
- providerRequestId: z10.string().min(1)
751
- });
752
- var pendingInteractionPluginOriginSchema = z10.object({
753
- kind: z10.literal("plugin"),
754
- pluginId: z10.string().min(1),
755
- rendererId: z10.string().min(1)
756
- });
757
- var pendingInteractionCreateSchema = z10.object({
758
- threadId: z10.string().min(1),
759
- turnId: z10.string().min(1),
760
- providerId: z10.string().min(1),
761
- providerThreadId: z10.string().min(1),
762
- providerRequestId: z10.string().min(1),
750
+ var pendingInteractionProviderOriginSchema = z11.object({
751
+ kind: z11.literal("provider"),
752
+ providerId: z11.string().min(1),
753
+ providerThreadId: z11.string().min(1),
754
+ providerRequestId: z11.string().min(1)
755
+ });
756
+ var pendingInteractionPluginOriginSchema = z11.object({
757
+ kind: z11.literal("plugin"),
758
+ pluginId: z11.string().min(1),
759
+ rendererId: z11.string().min(1)
760
+ });
761
+ var pendingInteractionCreateSchema = z11.object({
762
+ threadId: z11.string().min(1),
763
+ turnId: z11.string().min(1),
764
+ providerId: z11.string().min(1),
765
+ providerThreadId: z11.string().min(1),
766
+ providerRequestId: z11.string().min(1),
763
767
  payload: pendingInteractionPayloadSchema
764
768
  });
765
- var pendingInteractionBaseSchema = z10.object({
766
- id: z10.string().min(1),
767
- threadId: z10.string().min(1),
769
+ var pendingInteractionBaseSchema = z11.object({
770
+ id: z11.string().min(1),
771
+ threadId: z11.string().min(1),
768
772
  status: pendingInteractionStatusSchema,
769
- statusReason: z10.string().nullable(),
770
- createdAt: z10.number().int().nonnegative(),
771
- expiresAt: z10.number().int().nonnegative().nullable().optional(),
772
- resolvedAt: z10.number().int().nonnegative().nullable()
773
+ statusReason: z11.string().nullable(),
774
+ createdAt: z11.number().int().nonnegative(),
775
+ expiresAt: z11.number().int().nonnegative().nullable().optional(),
776
+ resolvedAt: z11.number().int().nonnegative().nullable()
773
777
  });
774
778
  var providerPendingInteractionBaseSchema = pendingInteractionBaseSchema.extend({
775
- turnId: z10.string().min(1),
776
- providerId: z10.string().min(1),
777
- providerThreadId: z10.string().min(1),
778
- providerRequestId: z10.string().min(1),
779
+ turnId: z11.string().min(1),
780
+ providerId: z11.string().min(1),
781
+ providerThreadId: z11.string().min(1),
782
+ providerRequestId: z11.string().min(1),
779
783
  origin: pendingInteractionProviderOriginSchema.optional()
780
784
  });
781
785
  var approvalPendingInteractionSchema = providerPendingInteractionBaseSchema.extend({
@@ -790,30 +794,30 @@ var pluginExtensionPendingInteractionSchema = providerPendingInteractionBaseSche
790
794
  payload: pluginExtensionInteractionRequestPayloadSchema,
791
795
  resolution: pluginExtensionInteractionResolutionSchema.nullable()
792
796
  });
793
- var providerPendingInteractionSchema = z10.union([
797
+ var providerPendingInteractionSchema = z11.union([
794
798
  approvalPendingInteractionSchema,
795
799
  userQuestionPendingInteractionSchema,
796
800
  pluginExtensionPendingInteractionSchema
797
801
  ]);
798
802
  var pluginPendingInteractionSchema = pendingInteractionBaseSchema.extend({
799
- turnId: z10.string().min(1).nullable(),
803
+ turnId: z11.string().min(1).nullable(),
800
804
  origin: pendingInteractionPluginOriginSchema,
801
805
  payload: pluginPendingInteractionPayloadSchema,
802
806
  resolution: pluginPendingInteractionResolutionSchema.nullable()
803
807
  });
804
- var pendingInteractionSchema = z10.union([
808
+ var pendingInteractionSchema = z11.union([
805
809
  providerPendingInteractionSchema,
806
810
  pluginPendingInteractionSchema
807
811
  ]);
808
- var interactionLifecycleRecordBaseSchema = z10.object({
809
- id: z10.string().min(1),
812
+ var interactionLifecycleRecordBaseSchema = z11.object({
813
+ id: z11.string().min(1),
810
814
  status: pendingInteractionStatusSchema,
811
- statusReason: z10.string().nullable()
815
+ statusReason: z11.string().nullable()
812
816
  });
813
- var interactionLifecycleProviderOriginSchema = z10.object({
814
- kind: z10.literal("provider"),
815
- providerId: z10.string().min(1),
816
- providerRequestId: z10.string().min(1)
817
+ var interactionLifecycleProviderOriginSchema = z11.object({
818
+ kind: z11.literal("provider"),
819
+ providerId: z11.string().min(1),
820
+ providerRequestId: z11.string().min(1)
817
821
  });
818
822
  var approvalInteractionLifecycleRecordPayloadSchema = approvalPendingInteractionPayloadSchema.omit({ availableDecisions: true });
819
823
  var approvalInteractionLifecycleSchema = interactionLifecycleRecordBaseSchema.extend({
@@ -838,7 +842,7 @@ var pluginExtensionInteractionLifecycleSchema = interactionLifecycleRecordBaseSc
838
842
  }),
839
843
  resolution: pluginExtensionInteractionResolutionSchema.omit({ value: true }).nullable()
840
844
  });
841
- var interactionLifecycleSchema = z10.union([
845
+ var interactionLifecycleSchema = z11.union([
842
846
  approvalInteractionLifecycleSchema,
843
847
  userQuestionInteractionLifecycleSchema,
844
848
  pluginInteractionLifecycleSchema,
@@ -863,36 +867,36 @@ function parseNamespacedGlyph(glyph) {
863
867
  }
864
868
 
865
869
  // ../domain/src/provider-event.ts
866
- import { z as z15 } from "zod";
870
+ import { z as z16 } from "zod";
867
871
 
868
872
  // ../domain/src/thread-events.ts
869
- import { z as z11 } from "zod";
873
+ import { z as z12 } from "zod";
870
874
  var threadTurnInitiatorValues = ["user", "agent", "system"];
871
- var threadTurnInitiatorSchema = z11.enum(threadTurnInitiatorValues);
875
+ var threadTurnInitiatorSchema = z12.enum(threadTurnInitiatorValues);
872
876
  var turnRequestOptionsSchema = recordedThreadExecutionOptionsSchema;
873
- var turnRequestTargetSchema = z11.discriminatedUnion("kind", [
874
- z11.object({ kind: z11.literal("thread-start") }),
875
- z11.object({ kind: z11.literal("new-turn") }),
876
- z11.object({
877
- kind: z11.literal("auto"),
878
- expectedTurnId: z11.string().nullable()
877
+ var turnRequestTargetSchema = z12.discriminatedUnion("kind", [
878
+ z12.object({ kind: z12.literal("thread-start") }),
879
+ z12.object({ kind: z12.literal("new-turn") }),
880
+ z12.object({
881
+ kind: z12.literal("auto"),
882
+ expectedTurnId: z12.string().nullable()
879
883
  }),
880
- z11.object({
881
- kind: z11.literal("steer"),
882
- expectedTurnId: z11.string().nullable()
884
+ z12.object({
885
+ kind: z12.literal("steer"),
886
+ expectedTurnId: z12.string().nullable()
883
887
  })
884
888
  ]);
885
- var clientTurnLifecycleEventDataSchema = z11.object({
886
- direction: z11.literal("outbound"),
887
- source: z11.enum(["spawn", "tell"]),
889
+ var clientTurnLifecycleEventDataSchema = z12.object({
890
+ direction: z12.literal("outbound"),
891
+ source: z12.enum(["spawn", "tell"]),
888
892
  initiator: threadTurnInitiatorSchema,
889
- request: z11.object({
890
- method: z11.enum(["thread/start", "turn/start"]),
891
- params: z11.record(z11.string(), z11.unknown())
893
+ request: z12.object({
894
+ method: z12.enum(["thread/start", "turn/start"]),
895
+ params: z12.record(z12.string(), z12.unknown())
892
896
  })
893
897
  });
894
- var turnRequestEventDataSchema = z11.object({
895
- direction: z11.literal("outbound"),
898
+ var turnRequestEventDataSchema = z12.object({
899
+ direction: z12.literal("outbound"),
896
900
  requestId: clientTurnRequestIdSchema,
897
901
  // Retry provenance, written only when a `turn.failed` gate's retry row
898
902
  // dispatches. Both fields are present together or not at all: absence means
@@ -902,85 +906,86 @@ var turnRequestEventDataSchema = z11.object({
902
906
  /** The original request this attempt re-submits, unchanged across attempts. */
903
907
  retryOfRequestId: clientTurnRequestIdSchema.optional(),
904
908
  /** Which attempt this is: 2 is the first retry of the original request. */
905
- retryAttempt: z11.number().int().min(2).optional(),
906
- source: z11.enum(["spawn", "tell"]),
909
+ retryAttempt: z12.number().int().min(2).optional(),
910
+ source: z12.enum(["spawn", "tell"]),
907
911
  initiator: threadTurnInitiatorSchema,
908
- senderThreadId: z11.string().nullable(),
912
+ senderThreadId: z12.string().nullable(),
913
+ originPluginId: pluginIdSchema.optional(),
909
914
  systemMessageKind: systemMessageKindSchema.optional(),
910
915
  systemMessageSubject: systemMessageSubjectSchema.nullable().optional(),
911
- input: z11.array(promptInputSchema),
912
- inputGroups: z11.array(z11.array(promptInputSchema).min(1)).min(1).optional(),
916
+ input: z12.array(promptInputSchema),
917
+ inputGroups: z12.array(z12.array(promptInputSchema).min(1)).min(1).optional(),
913
918
  target: turnRequestTargetSchema,
914
- request: z11.object({
915
- method: z11.enum(["thread/start", "turn/start"]),
916
- params: z11.record(z11.string(), z11.unknown())
919
+ request: z12.object({
920
+ method: z12.enum(["thread/start", "turn/start"]),
921
+ params: z12.record(z12.string(), z12.unknown())
917
922
  }),
918
923
  execution: turnRequestOptionsSchema
919
924
  });
920
- var turnRequestRejectedEventDataSchema = z11.object({
925
+ var turnRequestRejectedEventDataSchema = z12.object({
921
926
  requestId: clientTurnRequestIdSchema,
922
- reason: z11.string().min(1),
923
- message: z11.string().min(1)
927
+ reason: z12.string().min(1),
928
+ message: z12.string().min(1)
924
929
  });
925
- var systemErrorEventDataSchema = z11.object({
926
- code: z11.string().optional(),
927
- message: z11.string(),
928
- detail: z11.string().optional()
930
+ var systemErrorEventDataSchema = z12.object({
931
+ code: z12.string().optional(),
932
+ message: z12.string(),
933
+ detail: z12.string().optional()
929
934
  });
930
935
  var ownershipChangeOperationActionValues = [
931
936
  "assign",
932
937
  "release",
933
938
  "transfer"
934
939
  ];
935
- var ownershipChangeOperationActionSchema = z11.enum(
940
+ var ownershipChangeOperationActionSchema = z12.enum(
936
941
  ownershipChangeOperationActionValues
937
942
  );
938
- var ownershipChangeOperationMetadataSchema = z11.object({
943
+ var ownershipChangeOperationMetadataSchema = z12.object({
939
944
  action: ownershipChangeOperationActionSchema,
940
- nextParentThreadId: z11.string().nullable(),
941
- nextParentThreadTitle: z11.string().nullable(),
942
- previousParentThreadId: z11.string().nullable(),
943
- previousParentThreadTitle: z11.string().nullable()
944
- });
945
- var systemOperationEventDataSchema = z11.object({
946
- operation: z11.string(),
947
- status: z11.string(),
948
- message: z11.string(),
949
- operationId: z11.string(),
950
- metadata: z11.record(z11.string(), jsonValueSchema).optional()
951
- });
952
- var systemInteractionLifecycleEventDataSchema = z11.object({
945
+ nextParentThreadId: z12.string().nullable(),
946
+ nextParentThreadTitle: z12.string().nullable(),
947
+ previousParentThreadId: z12.string().nullable(),
948
+ previousParentThreadTitle: z12.string().nullable()
949
+ });
950
+ var systemOperationEventDataSchema = z12.object({
951
+ operation: z12.string(),
952
+ status: z12.string(),
953
+ message: z12.string(),
954
+ operationId: z12.string(),
955
+ metadata: z12.record(z12.string(), jsonValueSchema).optional()
956
+ });
957
+ var systemInteractionLifecycleEventDataSchema = z12.object({
953
958
  interaction: interactionLifecycleSchema
954
959
  });
955
- var systemPermissionGrantLifecycleEventDataSchema = z11.object({
956
- interactionId: z11.string(),
957
- providerId: z11.string(),
958
- providerRequestId: z11.string(),
960
+ var systemPermissionGrantLifecycleEventDataSchema = z12.object({
961
+ interactionId: z12.string(),
962
+ providerId: z12.string(),
963
+ providerRequestId: z12.string(),
959
964
  status: pendingInteractionStatusSchema,
960
965
  resolution: approvalPendingInteractionResolutionSchema.nullable().default(null),
961
- statusReason: z11.string().nullable().default(null),
966
+ statusReason: z12.string().nullable().default(null),
962
967
  subject: pendingInteractionPermissionGrantApprovalSubjectSchema
963
968
  });
964
- var systemUserQuestionLifecycleEventDataSchema = z11.object({
965
- interactionId: z11.string(),
966
- providerId: z11.string(),
967
- providerRequestId: z11.string(),
969
+ var systemUserQuestionLifecycleEventDataSchema = z12.object({
970
+ interactionId: z12.string(),
971
+ providerId: z12.string(),
972
+ providerRequestId: z12.string(),
968
973
  status: pendingInteractionStatusSchema,
969
974
  resolution: userQuestionPendingInteractionResolutionSchema.nullable().default(null),
970
- statusReason: z11.string().nullable().default(null),
975
+ statusReason: z12.string().nullable().default(null),
971
976
  payload: userQuestionPendingInteractionPayloadSchema
972
977
  });
973
- var systemThreadInterruptedEventDataSchema = z11.object({
978
+ var systemThreadInterruptedEventDataSchema = z12.object({
974
979
  reason: systemThreadInterruptedReasonSchema,
975
- cause: z11.literal("host-connection-lost").optional()
980
+ cause: z12.literal("host-connection-lost").optional()
976
981
  });
977
- var provisioningTranscriptEntrySchema = z11.object({
978
- type: z11.enum(["step", "output"]),
979
- key: z11.string(),
980
- text: z11.string(),
981
- startedAt: z11.number().optional(),
982
- status: z11.enum(["started", "completed", "failed"]).optional(),
983
- metadata: z11.record(z11.string(), z11.unknown()).optional()
982
+ var provisioningTranscriptEntrySchema = z12.object({
983
+ type: z12.enum(["step", "output"]),
984
+ key: z12.string(),
985
+ text: z12.string(),
986
+ startedAt: z12.number().optional(),
987
+ status: z12.enum(["started", "completed", "failed"]).optional(),
988
+ metadata: z12.record(z12.string(), z12.unknown()).optional()
984
989
  });
985
990
  var systemThreadProvisioningStatusValues = [
986
991
  "active",
@@ -988,48 +993,48 @@ var systemThreadProvisioningStatusValues = [
988
993
  "failed",
989
994
  "cancelled"
990
995
  ];
991
- var systemThreadProvisioningStatusSchema = z11.enum(
996
+ var systemThreadProvisioningStatusSchema = z12.enum(
992
997
  systemThreadProvisioningStatusValues
993
998
  );
994
- var systemThreadProvisioningEventDataSchema = z11.object({
995
- provisioningId: z11.string(),
999
+ var systemThreadProvisioningEventDataSchema = z12.object({
1000
+ provisioningId: z12.string(),
996
1001
  status: systemThreadProvisioningStatusSchema,
997
- environmentId: z11.string().nullable(),
998
- entries: z11.array(provisioningTranscriptEntrySchema)
999
- });
1000
- var systemLegacyUserMessageEventDataSchema = z11.object({
1001
- text: z11.string(),
1002
- toolCallId: z11.string().optional(),
1003
- turnId: z11.string().optional()
1004
- });
1005
- var systemProviderTurnWatchdogEventDataSchema = z11.object({
1006
- reason: z11.literal("provider-turn-idle"),
1007
- thresholdMs: z11.number().int().positive(),
1008
- elapsedMs: z11.number().int().nonnegative(),
1009
- activeTurnId: z11.string().min(1),
1010
- activeTurnStartedAt: z11.number().int().nonnegative(),
1011
- lastActivityEventSequence: z11.number().int().positive(),
1012
- lastActivityEventType: z11.string().min(1),
1013
- lastActivityEventAt: z11.number().int().nonnegative(),
1014
- providerId: z11.string().min(1),
1015
- providerThreadId: z11.string().min(1).nullable(),
1016
- firedAt: z11.number().int().nonnegative()
1002
+ environmentId: z12.string().nullable(),
1003
+ entries: z12.array(provisioningTranscriptEntrySchema)
1004
+ });
1005
+ var systemLegacyUserMessageEventDataSchema = z12.object({
1006
+ text: z12.string(),
1007
+ toolCallId: z12.string().optional(),
1008
+ turnId: z12.string().optional()
1009
+ });
1010
+ var systemProviderTurnWatchdogEventDataSchema = z12.object({
1011
+ reason: z12.literal("provider-turn-idle"),
1012
+ thresholdMs: z12.number().int().positive(),
1013
+ elapsedMs: z12.number().int().nonnegative(),
1014
+ activeTurnId: z12.string().min(1),
1015
+ activeTurnStartedAt: z12.number().int().nonnegative(),
1016
+ lastActivityEventSequence: z12.number().int().positive(),
1017
+ lastActivityEventType: z12.string().min(1),
1018
+ lastActivityEventAt: z12.number().int().nonnegative(),
1019
+ providerId: z12.string().min(1),
1020
+ providerThreadId: z12.string().min(1).nullable(),
1021
+ firedAt: z12.number().int().nonnegative()
1017
1022
  });
1018
1023
 
1019
1024
  // ../domain/src/thread-event-scope.ts
1020
- import { z as z12 } from "zod";
1025
+ import { z as z13 } from "zod";
1021
1026
  var threadEventScopeKindValues = ["thread", "turn"];
1022
- var threadEventScopeKindSchema = z12.enum(threadEventScopeKindValues);
1023
- var threadEventScopeSchema = z12.discriminatedUnion("kind", [
1024
- z12.object({ kind: z12.literal("thread") }),
1025
- z12.object({ kind: z12.literal("turn"), turnId: z12.string().min(1) })
1027
+ var threadEventScopeKindSchema = z13.enum(threadEventScopeKindValues);
1028
+ var threadEventScopeSchema = z13.discriminatedUnion("kind", [
1029
+ z13.object({ kind: z13.literal("thread") }),
1030
+ z13.object({ kind: z13.literal("turn"), turnId: z13.string().min(1) })
1026
1031
  ]);
1027
1032
  var threadEventScopePolicyValues = [
1028
1033
  "thread",
1029
1034
  "turn",
1030
1035
  "thread-or-turn"
1031
1036
  ];
1032
- var threadEventScopePolicySchema = z12.enum(threadEventScopePolicyValues);
1037
+ var threadEventScopePolicySchema = z13.enum(threadEventScopePolicyValues);
1033
1038
  var threadEventScopeDefinitionByType = {
1034
1039
  "thread/started": {
1035
1040
  policy: "thread",
@@ -1205,8 +1210,8 @@ function validateThreadEventScope(args) {
1205
1210
  }
1206
1211
 
1207
1212
  // ../domain/src/thread-timeline-goal.ts
1208
- import { z as z13 } from "zod";
1209
- var threadTimelineGoalStatusSchema = z13.enum([
1213
+ import { z as z14 } from "zod";
1214
+ var threadTimelineGoalStatusSchema = z14.enum([
1210
1215
  "active",
1211
1216
  "paused",
1212
1217
  "blocked",
@@ -1214,32 +1219,32 @@ var threadTimelineGoalStatusSchema = z13.enum([
1214
1219
  "budgetLimited",
1215
1220
  "complete"
1216
1221
  ]);
1217
- var threadTimelineGoalSchema = z13.object({
1218
- sourceSeq: z13.number().int().nonnegative(),
1219
- updatedAt: z13.number(),
1220
- objective: z13.string(),
1222
+ var threadTimelineGoalSchema = z14.object({
1223
+ sourceSeq: z14.number().int().nonnegative(),
1224
+ updatedAt: z14.number(),
1225
+ objective: z14.string(),
1221
1226
  status: threadTimelineGoalStatusSchema,
1222
- tokenBudget: z13.number().nullable(),
1223
- tokensUsed: z13.number(),
1224
- timeUsedSeconds: z13.number()
1227
+ tokenBudget: z14.number().nullable(),
1228
+ tokensUsed: z14.number(),
1229
+ timeUsedSeconds: z14.number()
1225
1230
  });
1226
1231
 
1227
1232
  // ../domain/src/thread-usage-cost.ts
1228
- import { z as z14 } from "zod";
1229
- var threadUsageCostSchema = z14.object({
1230
- amount: z14.number().nonnegative(),
1231
- currency: z14.string().min(1)
1233
+ import { z as z15 } from "zod";
1234
+ var threadUsageCostSchema = z15.object({
1235
+ amount: z15.number().nonnegative(),
1236
+ currency: z15.string().min(1)
1232
1237
  });
1233
1238
 
1234
1239
  // ../domain/src/provider-event.ts
1235
- var threadEventItemStatusSchema = z15.enum([
1240
+ var threadEventItemStatusSchema = z16.enum([
1236
1241
  "pending",
1237
1242
  "completed",
1238
1243
  "failed",
1239
1244
  "interrupted"
1240
1245
  ]);
1241
- var threadEventItemApprovalStatusSchema = z15.enum(["waiting_for_approval", "denied"]).nullable();
1242
- var threadEventTurnStatusSchema = z15.enum([
1246
+ var threadEventItemApprovalStatusSchema = z16.enum(["waiting_for_approval", "denied"]).nullable();
1247
+ var threadEventTurnStatusSchema = z16.enum([
1243
1248
  "completed",
1244
1249
  "failed",
1245
1250
  "interrupted"
@@ -1265,267 +1270,267 @@ var providerErrorCategoryValues = [
1265
1270
  "unauthorized",
1266
1271
  "unknown"
1267
1272
  ];
1268
- var providerErrorCategorySchema = z15.enum(providerErrorCategoryValues);
1269
- var providerErrorInfoSchema = z15.object({
1273
+ var providerErrorCategorySchema = z16.enum(providerErrorCategoryValues);
1274
+ var providerErrorInfoSchema = z16.object({
1270
1275
  category: providerErrorCategorySchema,
1271
- providerCode: z15.string().nullable(),
1272
- httpStatusCode: z15.number().nullable()
1276
+ providerCode: z16.string().nullable(),
1277
+ httpStatusCode: z16.number().nullable()
1273
1278
  });
1274
- var providerRateLimitStatusSchema = z15.enum([
1279
+ var providerRateLimitStatusSchema = z16.enum([
1275
1280
  "allowed",
1276
1281
  "warning",
1277
1282
  "blocked",
1278
1283
  "unknown"
1279
1284
  ]);
1280
- var providerRateLimitWindowSchema = z15.object({
1281
- providerKey: z15.string().min(1).nullable(),
1282
- label: z15.string().min(1).nullable(),
1285
+ var providerRateLimitWindowSchema = z16.object({
1286
+ providerKey: z16.string().min(1).nullable(),
1287
+ label: z16.string().min(1).nullable(),
1283
1288
  status: providerRateLimitStatusSchema,
1284
- resetsAtMs: z15.number().int().nonnegative().nullable()
1289
+ resetsAtMs: z16.number().int().nonnegative().nullable()
1285
1290
  });
1286
- var providerRateLimitStateSchema = z15.object({
1287
- providerId: z15.string().min(1),
1291
+ var providerRateLimitStateSchema = z16.object({
1292
+ providerId: z16.string().min(1),
1288
1293
  status: providerRateLimitStatusSchema,
1289
- kind: z15.enum(["subscription-window", "credits", "spend-control", "unknown"]),
1290
- windows: z15.array(providerRateLimitWindowSchema),
1291
- reachedReason: z15.string().min(1).nullable(),
1292
- overageStatus: z15.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
1293
- overageReason: z15.string().min(1).nullable()
1294
- });
1295
- var threadEventFileChangeKindSchema = z15.enum(["add", "delete", "update"]);
1296
- var threadEventFileChangeSchema = z15.object({
1297
- path: z15.string(),
1294
+ kind: z16.enum(["subscription-window", "credits", "spend-control", "unknown"]),
1295
+ windows: z16.array(providerRateLimitWindowSchema),
1296
+ reachedReason: z16.string().min(1).nullable(),
1297
+ overageStatus: z16.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
1298
+ overageReason: z16.string().min(1).nullable()
1299
+ });
1300
+ var threadEventFileChangeKindSchema = z16.enum(["add", "delete", "update"]);
1301
+ var threadEventFileChangeSchema = z16.object({
1302
+ path: z16.string(),
1298
1303
  kind: threadEventFileChangeKindSchema,
1299
- movePath: z15.string().optional(),
1300
- diff: z15.string().optional()
1304
+ movePath: z16.string().optional(),
1305
+ diff: z16.string().optional()
1301
1306
  });
1302
- var threadEventPlanStepStatusSchema = z15.enum([
1307
+ var threadEventPlanStepStatusSchema = z16.enum([
1303
1308
  "pending",
1304
1309
  "active",
1305
1310
  "completed",
1306
1311
  "failed"
1307
1312
  ]);
1308
- var threadEventPlanStepSchema = z15.object({
1309
- step: z15.string(),
1313
+ var threadEventPlanStepSchema = z16.object({
1314
+ step: z16.string(),
1310
1315
  status: threadEventPlanStepStatusSchema.optional()
1311
1316
  });
1312
1317
  var itemPresentationField = {
1313
1318
  presentation: threadEventItemPresentationSchema.optional()
1314
1319
  };
1315
- var threadEventWebSearchItemSchema = z15.object({
1316
- type: z15.literal("webSearch"),
1317
- id: z15.string(),
1318
- queries: z15.array(z15.string()).min(1),
1319
- resultText: z15.string().nullable(),
1320
+ var threadEventWebSearchItemSchema = z16.object({
1321
+ type: z16.literal("webSearch"),
1322
+ id: z16.string(),
1323
+ queries: z16.array(z16.string()).min(1),
1324
+ resultText: z16.string().nullable(),
1320
1325
  ...itemPresentationField,
1321
- parentToolCallId: z15.string().optional()
1322
- });
1323
- var threadEventWebFetchItemSchema = z15.object({
1324
- type: z15.literal("webFetch"),
1325
- id: z15.string(),
1326
- url: z15.string(),
1327
- prompt: z15.string().nullable(),
1328
- pattern: z15.string().nullable(),
1329
- resultText: z15.string().nullable(),
1326
+ parentToolCallId: z16.string().optional()
1327
+ });
1328
+ var threadEventWebFetchItemSchema = z16.object({
1329
+ type: z16.literal("webFetch"),
1330
+ id: z16.string(),
1331
+ url: z16.string(),
1332
+ prompt: z16.string().nullable(),
1333
+ pattern: z16.string().nullable(),
1334
+ resultText: z16.string().nullable(),
1330
1335
  ...itemPresentationField,
1331
- parentToolCallId: z15.string().optional()
1336
+ parentToolCallId: z16.string().optional()
1332
1337
  });
1333
- var threadEventImageViewItemSchema = z15.object({
1334
- type: z15.literal("imageView"),
1335
- id: z15.string(),
1336
- path: z15.string(),
1338
+ var threadEventImageViewItemSchema = z16.object({
1339
+ type: z16.literal("imageView"),
1340
+ id: z16.string(),
1341
+ path: z16.string(),
1337
1342
  ...itemPresentationField,
1338
- parentToolCallId: z15.string().optional()
1343
+ parentToolCallId: z16.string().optional()
1339
1344
  });
1340
- var threadEventFileReadItemSchema = z15.object({
1341
- type: z15.literal("fileRead"),
1342
- id: z15.string(),
1343
- path: z15.string(),
1344
- cmd: z15.string().optional(),
1345
+ var threadEventFileReadItemSchema = z16.object({
1346
+ type: z16.literal("fileRead"),
1347
+ id: z16.string(),
1348
+ path: z16.string(),
1349
+ cmd: z16.string().optional(),
1345
1350
  status: threadEventItemStatusSchema,
1346
1351
  ...itemPresentationField,
1347
- parentToolCallId: z15.string().optional()
1352
+ parentToolCallId: z16.string().optional()
1348
1353
  });
1349
- var threadEventSearchModeSchema = z15.enum(["content", "path", "list"]);
1350
- var threadEventSearchItemSchema = z15.object({
1351
- type: z15.literal("search"),
1352
- id: z15.string(),
1354
+ var threadEventSearchModeSchema = z16.enum(["content", "path", "list"]);
1355
+ var threadEventSearchItemSchema = z16.object({
1356
+ type: z16.literal("search"),
1357
+ id: z16.string(),
1353
1358
  mode: threadEventSearchModeSchema,
1354
- query: z15.string(),
1355
- path: z15.string().optional(),
1356
- cmd: z15.string().optional(),
1359
+ query: z16.string(),
1360
+ path: z16.string().optional(),
1361
+ cmd: z16.string().optional(),
1357
1362
  status: threadEventItemStatusSchema,
1358
1363
  ...itemPresentationField,
1359
- parentToolCallId: z15.string().optional()
1364
+ parentToolCallId: z16.string().optional()
1360
1365
  });
1361
- var threadEventDelegationItemSchema = z15.object({
1362
- type: z15.literal("delegation"),
1363
- id: z15.string(),
1364
- childRef: z15.string().min(1),
1365
- label: z15.string(),
1366
+ var threadEventDelegationItemSchema = z16.object({
1367
+ type: z16.literal("delegation"),
1368
+ id: z16.string(),
1369
+ childRef: z16.string().min(1),
1370
+ label: z16.string(),
1366
1371
  status: threadEventItemStatusSchema,
1367
- background: z15.boolean(),
1368
- summary: z15.string().optional(),
1372
+ background: z16.boolean(),
1373
+ summary: z16.string().optional(),
1369
1374
  ...itemPresentationField,
1370
- parentToolCallId: z15.string().optional()
1375
+ parentToolCallId: z16.string().optional()
1371
1376
  });
1372
- var threadEventPlanStepsItemSchema = z15.object({
1373
- type: z15.literal("planSteps"),
1374
- id: z15.string(),
1375
- steps: z15.array(threadEventPlanStepSchema),
1376
- explanation: z15.string().optional(),
1377
+ var threadEventPlanStepsItemSchema = z16.object({
1378
+ type: z16.literal("planSteps"),
1379
+ id: z16.string(),
1380
+ steps: z16.array(threadEventPlanStepSchema),
1381
+ explanation: z16.string().optional(),
1377
1382
  status: threadEventItemStatusSchema,
1378
1383
  ...itemPresentationField,
1379
- parentToolCallId: z15.string().optional()
1384
+ parentToolCallId: z16.string().optional()
1380
1385
  });
1381
- var threadEventExtensionItemSchema = z15.object({
1382
- type: z15.literal("extension"),
1383
- id: z15.string(),
1386
+ var threadEventExtensionItemSchema = z16.object({
1387
+ type: z16.literal("extension"),
1388
+ id: z16.string(),
1384
1389
  kind: extensionKindSchema,
1385
1390
  payload: jsonValueSchema,
1386
1391
  status: threadEventItemStatusSchema,
1387
1392
  presentation: threadEventItemPresentationSchema,
1388
- parentToolCallId: z15.string().optional()
1393
+ parentToolCallId: z16.string().optional()
1389
1394
  });
1390
- var threadEventTextTruncationSchema = z15.object({
1391
- originalLength: z15.number(),
1392
- retainedHeadLength: z15.number(),
1393
- retainedTailLength: z15.number(),
1394
- truncatedAt: z15.number()
1395
+ var threadEventTextTruncationSchema = z16.object({
1396
+ originalLength: z16.number(),
1397
+ retainedHeadLength: z16.number(),
1398
+ retainedTailLength: z16.number(),
1399
+ truncatedAt: z16.number()
1395
1400
  });
1396
- var threadEventItemTruncationSchema = z15.object({
1401
+ var threadEventItemTruncationSchema = z16.object({
1397
1402
  aggregatedOutput: threadEventTextTruncationSchema.optional(),
1398
1403
  result: threadEventTextTruncationSchema.optional(),
1399
1404
  resultText: threadEventTextTruncationSchema.optional()
1400
1405
  });
1401
- var threadEventImageGenerationItemSchema = z15.object({
1402
- type: z15.literal("imageGeneration"),
1403
- id: z15.string(),
1406
+ var threadEventImageGenerationItemSchema = z16.object({
1407
+ type: z16.literal("imageGeneration"),
1408
+ id: z16.string(),
1404
1409
  status: threadEventItemStatusSchema,
1405
- prompt: z15.string().nullable(),
1406
- path: z15.string().nullable(),
1407
- result: z15.string().optional(),
1408
- error: z15.string().nullable(),
1409
- transparentBackground: z15.boolean(),
1410
+ prompt: z16.string().nullable(),
1411
+ path: z16.string().nullable(),
1412
+ result: z16.string().optional(),
1413
+ error: z16.string().nullable(),
1414
+ transparentBackground: z16.boolean(),
1410
1415
  truncation: threadEventItemTruncationSchema.optional(),
1411
1416
  ...itemPresentationField,
1412
- parentToolCallId: z15.string().optional()
1417
+ parentToolCallId: z16.string().optional()
1413
1418
  });
1414
- var threadEventUserContentSchema = z15.discriminatedUnion("type", [
1415
- z15.object({ type: z15.literal("text"), text: z15.string() }),
1416
- z15.object({ type: z15.literal("image"), url: z15.string() }),
1417
- z15.object({ type: z15.literal("localImage"), path: z15.string() }),
1418
- z15.object({ type: z15.literal("localFile"), path: z15.string() })
1419
+ var threadEventUserContentSchema = z16.discriminatedUnion("type", [
1420
+ z16.object({ type: z16.literal("text"), text: z16.string() }),
1421
+ z16.object({ type: z16.literal("image"), url: z16.string() }),
1422
+ z16.object({ type: z16.literal("localImage"), path: z16.string() }),
1423
+ z16.object({ type: z16.literal("localFile"), path: z16.string() })
1419
1424
  ]);
1420
- var threadEventTokenUsageBreakdownSchema = z15.object({
1421
- totalTokens: z15.number(),
1422
- inputTokens: z15.number(),
1423
- cachedInputTokens: z15.number(),
1424
- cacheReadInputTokens: z15.number().nonnegative().optional(),
1425
- cacheWriteInputTokens: z15.number().nonnegative().optional(),
1426
- outputTokens: z15.number(),
1427
- reasoningOutputTokens: z15.number()
1428
- });
1429
- var threadEventContextWindowUsageSchema = z15.object({
1425
+ var threadEventTokenUsageBreakdownSchema = z16.object({
1426
+ totalTokens: z16.number(),
1427
+ inputTokens: z16.number(),
1428
+ cachedInputTokens: z16.number(),
1429
+ cacheReadInputTokens: z16.number().nonnegative().optional(),
1430
+ cacheWriteInputTokens: z16.number().nonnegative().optional(),
1431
+ outputTokens: z16.number(),
1432
+ reasoningOutputTokens: z16.number()
1433
+ });
1434
+ var threadEventContextWindowUsageSchema = z16.object({
1430
1435
  snapshot: contextSnapshotSchema.optional(),
1431
- usedTokens: z15.number().nullable(),
1432
- modelContextWindow: z15.number().nullable(),
1433
- estimated: z15.boolean(),
1436
+ usedTokens: z16.number().nullable(),
1437
+ modelContextWindow: z16.number().nullable(),
1438
+ estimated: z16.boolean(),
1434
1439
  cost: threadUsageCostSchema.optional()
1435
1440
  });
1436
- var promptCacheTtlMsSchema = z15.number().int().positive();
1437
- var threadEventTokenUsageSchema = z15.object({
1441
+ var promptCacheTtlMsSchema = z16.number().int().positive();
1442
+ var threadEventTokenUsageSchema = z16.object({
1438
1443
  total: threadEventTokenUsageBreakdownSchema,
1439
1444
  last: threadEventTokenUsageBreakdownSchema,
1440
- modelContextWindow: z15.number().nullable(),
1445
+ modelContextWindow: z16.number().nullable(),
1441
1446
  promptCacheTtlMs: promptCacheTtlMsSchema.optional()
1442
1447
  });
1443
- var threadEventWarningCategorySchema = z15.enum([
1448
+ var threadEventWarningCategorySchema = z16.enum([
1444
1449
  "deprecation",
1445
1450
  "config",
1446
1451
  "general",
1447
1452
  "compaction-skipped"
1448
1453
  ]);
1449
- var providerRawEventSchema = z15.object({
1450
- jsonrpc: z15.literal("2.0"),
1451
- id: z15.union([z15.string(), z15.number()]).optional(),
1452
- method: z15.string(),
1454
+ var providerRawEventSchema = z16.object({
1455
+ jsonrpc: z16.literal("2.0"),
1456
+ id: z16.union([z16.string(), z16.number()]).optional(),
1457
+ method: z16.string(),
1453
1458
  params: jsonValueSchema.optional()
1454
1459
  });
1455
- var providerUnhandledEventSchema = z15.object({
1456
- type: z15.literal("provider/unhandled"),
1457
- threadId: z15.string(),
1458
- providerThreadId: z15.string(),
1459
- providerId: z15.string(),
1460
- rawType: z15.string(),
1460
+ var providerUnhandledEventSchema = z16.object({
1461
+ type: z16.literal("provider/unhandled"),
1462
+ threadId: z16.string(),
1463
+ providerThreadId: z16.string(),
1464
+ providerId: z16.string(),
1465
+ rawType: z16.string(),
1461
1466
  rawEvent: providerRawEventSchema,
1462
- parentToolCallId: z15.string().optional()
1463
- });
1464
- var toolCallProgressEventSchema = z15.object({
1465
- type: z15.literal("item/toolCall/progress"),
1466
- threadId: z15.string(),
1467
- providerThreadId: z15.string(),
1468
- itemId: z15.string(),
1469
- message: z15.string().optional(),
1470
- parentToolCallId: z15.string().optional()
1471
- });
1472
- var threadEventBackgroundTaskItemSchema = z15.object({
1473
- type: z15.literal("backgroundTask"),
1474
- id: z15.string(),
1475
- familyId: z15.string().optional(),
1476
- taskType: z15.string(),
1477
- description: z15.string(),
1467
+ parentToolCallId: z16.string().optional()
1468
+ });
1469
+ var toolCallProgressEventSchema = z16.object({
1470
+ type: z16.literal("item/toolCall/progress"),
1471
+ threadId: z16.string(),
1472
+ providerThreadId: z16.string(),
1473
+ itemId: z16.string(),
1474
+ message: z16.string().optional(),
1475
+ parentToolCallId: z16.string().optional()
1476
+ });
1477
+ var threadEventBackgroundTaskItemSchema = z16.object({
1478
+ type: z16.literal("backgroundTask"),
1479
+ id: z16.string(),
1480
+ familyId: z16.string().optional(),
1481
+ taskType: z16.string(),
1482
+ description: z16.string(),
1478
1483
  status: threadEventItemStatusSchema,
1479
1484
  taskStatus: backgroundTaskStatusSchema,
1480
- skipTranscript: z15.boolean(),
1481
- foreground: z15.boolean(),
1482
- workflowName: z15.string().optional(),
1485
+ skipTranscript: z16.boolean(),
1486
+ foreground: z16.boolean(),
1487
+ workflowName: z16.string().optional(),
1483
1488
  workflow: workflowProgressSnapshotSchema.optional(),
1484
1489
  usage: backgroundTaskUsageSchema.optional(),
1485
- summary: z15.string().optional(),
1486
- error: z15.string().optional(),
1487
- outputFile: z15.string().optional(),
1490
+ summary: z16.string().optional(),
1491
+ error: z16.string().optional(),
1492
+ outputFile: z16.string().optional(),
1488
1493
  ...itemPresentationField,
1489
- parentToolCallId: z15.string().optional()
1494
+ parentToolCallId: z16.string().optional()
1490
1495
  });
1491
- var threadEventItemSchema = z15.discriminatedUnion("type", [
1492
- z15.object({
1493
- type: z15.literal("userMessage"),
1494
- id: z15.string(),
1495
- content: z15.array(threadEventUserContentSchema),
1496
+ var threadEventItemSchema = z16.discriminatedUnion("type", [
1497
+ z16.object({
1498
+ type: z16.literal("userMessage"),
1499
+ id: z16.string(),
1500
+ content: z16.array(threadEventUserContentSchema),
1496
1501
  clientRequestId: clientTurnRequestIdSchema.optional(),
1497
- parentToolCallId: z15.string().optional()
1502
+ parentToolCallId: z16.string().optional()
1498
1503
  }).strict(),
1499
- z15.object({
1500
- type: z15.literal("agentMessage"),
1501
- id: z15.string(),
1502
- text: z15.string(),
1504
+ z16.object({
1505
+ type: z16.literal("agentMessage"),
1506
+ id: z16.string(),
1507
+ text: z16.string(),
1503
1508
  ...itemPresentationField,
1504
- parentToolCallId: z15.string().optional()
1509
+ parentToolCallId: z16.string().optional()
1505
1510
  }),
1506
- z15.object({
1507
- type: z15.literal("commandExecution"),
1508
- id: z15.string(),
1509
- command: z15.string(),
1510
- cwd: z15.string(),
1511
+ z16.object({
1512
+ type: z16.literal("commandExecution"),
1513
+ id: z16.string(),
1514
+ command: z16.string(),
1515
+ cwd: z16.string(),
1511
1516
  status: threadEventItemStatusSchema,
1512
1517
  approvalStatus: threadEventItemApprovalStatusSchema,
1513
- aggregatedOutput: z15.string().optional(),
1514
- exitCode: z15.number().optional(),
1515
- durationMs: z15.number().optional(),
1518
+ aggregatedOutput: z16.string().optional(),
1519
+ exitCode: z16.number().optional(),
1520
+ durationMs: z16.number().optional(),
1516
1521
  truncation: threadEventItemTruncationSchema.optional(),
1517
1522
  ...itemPresentationField,
1518
- parentToolCallId: z15.string().optional()
1523
+ parentToolCallId: z16.string().optional()
1519
1524
  }),
1520
- z15.object({
1521
- type: z15.literal("fileChange"),
1522
- id: z15.string(),
1523
- changes: z15.array(threadEventFileChangeSchema),
1525
+ z16.object({
1526
+ type: z16.literal("fileChange"),
1527
+ id: z16.string(),
1528
+ changes: z16.array(threadEventFileChangeSchema),
1524
1529
  status: threadEventItemStatusSchema,
1525
1530
  approvalStatus: threadEventItemApprovalStatusSchema,
1526
- error: z15.string().optional(),
1531
+ error: z16.string().optional(),
1527
1532
  ...itemPresentationField,
1528
- parentToolCallId: z15.string().optional()
1533
+ parentToolCallId: z16.string().optional()
1529
1534
  }),
1530
1535
  threadEventWebSearchItemSchema,
1531
1536
  threadEventWebFetchItemSchema,
@@ -1533,345 +1538,345 @@ var threadEventItemSchema = z15.discriminatedUnion("type", [
1533
1538
  threadEventImageGenerationItemSchema,
1534
1539
  threadEventFileReadItemSchema,
1535
1540
  threadEventSearchItemSchema,
1536
- z15.object({
1537
- type: z15.literal("toolCall"),
1538
- id: z15.string(),
1539
- server: z15.string().optional(),
1540
- tool: z15.string(),
1541
- arguments: z15.record(z15.string(), z15.unknown()).optional(),
1541
+ z16.object({
1542
+ type: z16.literal("toolCall"),
1543
+ id: z16.string(),
1544
+ server: z16.string().optional(),
1545
+ tool: z16.string(),
1546
+ arguments: z16.record(z16.string(), z16.unknown()).optional(),
1542
1547
  status: threadEventItemStatusSchema,
1543
- result: z15.unknown().optional(),
1544
- error: z15.string().optional(),
1545
- durationMs: z15.number().optional(),
1548
+ result: z16.unknown().optional(),
1549
+ error: z16.string().optional(),
1550
+ durationMs: z16.number().optional(),
1546
1551
  truncation: threadEventItemTruncationSchema.optional(),
1547
1552
  ...itemPresentationField,
1548
- parentToolCallId: z15.string().optional()
1553
+ parentToolCallId: z16.string().optional()
1549
1554
  }),
1550
- z15.object({
1551
- type: z15.literal("reasoning"),
1552
- id: z15.string(),
1553
- summary: z15.array(z15.string()),
1554
- content: z15.array(z15.string()),
1555
+ z16.object({
1556
+ type: z16.literal("reasoning"),
1557
+ id: z16.string(),
1558
+ summary: z16.array(z16.string()),
1559
+ content: z16.array(z16.string()),
1555
1560
  ...itemPresentationField,
1556
- parentToolCallId: z15.string().optional()
1561
+ parentToolCallId: z16.string().optional()
1557
1562
  }),
1558
- z15.object({
1559
- type: z15.literal("plan"),
1560
- id: z15.string(),
1561
- text: z15.string(),
1563
+ z16.object({
1564
+ type: z16.literal("plan"),
1565
+ id: z16.string(),
1566
+ text: z16.string(),
1562
1567
  ...itemPresentationField,
1563
- parentToolCallId: z15.string().optional()
1568
+ parentToolCallId: z16.string().optional()
1564
1569
  }),
1565
1570
  threadEventPlanStepsItemSchema,
1566
- z15.object({
1567
- type: z15.literal("contextCompaction"),
1568
- id: z15.string(),
1571
+ z16.object({
1572
+ type: z16.literal("contextCompaction"),
1573
+ id: z16.string(),
1569
1574
  ...itemPresentationField,
1570
- parentToolCallId: z15.string().optional()
1575
+ parentToolCallId: z16.string().optional()
1571
1576
  }),
1572
1577
  threadEventBackgroundTaskItemSchema,
1573
1578
  threadEventDelegationItemSchema,
1574
1579
  threadEventExtensionItemSchema
1575
1580
  ]);
1576
1581
  function itemTextDeltaEventSchema(type) {
1577
- return z15.object({
1578
- type: z15.literal(type),
1579
- threadId: z15.string(),
1580
- providerThreadId: z15.string(),
1581
- itemId: z15.string(),
1582
- delta: z15.string(),
1583
- parentToolCallId: z15.string().optional()
1582
+ return z16.object({
1583
+ type: z16.literal(type),
1584
+ threadId: z16.string(),
1585
+ providerThreadId: z16.string(),
1586
+ itemId: z16.string(),
1587
+ delta: z16.string(),
1588
+ parentToolCallId: z16.string().optional()
1584
1589
  });
1585
1590
  }
1586
- var unscopedProviderEventSchema = z15.discriminatedUnion("type", [
1587
- z15.object({
1588
- type: z15.literal("thread/started"),
1589
- threadId: z15.string()
1591
+ var unscopedProviderEventSchema = z16.discriminatedUnion("type", [
1592
+ z16.object({
1593
+ type: z16.literal("thread/started"),
1594
+ threadId: z16.string()
1590
1595
  }),
1591
- z15.object({
1592
- type: z15.literal("thread/identity"),
1593
- threadId: z15.string(),
1594
- providerThreadId: z15.string()
1596
+ z16.object({
1597
+ type: z16.literal("thread/identity"),
1598
+ threadId: z16.string(),
1599
+ providerThreadId: z16.string()
1595
1600
  }),
1596
- z15.object({
1597
- type: z15.literal("turn/started"),
1598
- threadId: z15.string(),
1599
- providerThreadId: z15.string(),
1600
- parentToolCallId: z15.string().optional()
1601
+ z16.object({
1602
+ type: z16.literal("turn/started"),
1603
+ threadId: z16.string(),
1604
+ providerThreadId: z16.string(),
1605
+ parentToolCallId: z16.string().optional()
1601
1606
  }),
1602
- z15.object({
1603
- type: z15.literal("turn/completed"),
1604
- threadId: z15.string(),
1605
- providerThreadId: z15.string().nullable(),
1607
+ z16.object({
1608
+ type: z16.literal("turn/completed"),
1609
+ threadId: z16.string(),
1610
+ providerThreadId: z16.string().nullable(),
1606
1611
  status: threadEventTurnStatusSchema,
1607
- error: z15.object({ message: z15.string() }).optional(),
1608
- providerCheckpointId: z15.string().min(1).optional()
1612
+ error: z16.object({ message: z16.string() }).optional(),
1613
+ providerCheckpointId: z16.string().min(1).optional()
1609
1614
  }),
1610
- z15.object({
1611
- type: z15.literal("turn/input/accepted"),
1612
- threadId: z15.string(),
1613
- providerThreadId: z15.string(),
1615
+ z16.object({
1616
+ type: z16.literal("turn/input/accepted"),
1617
+ threadId: z16.string(),
1618
+ providerThreadId: z16.string(),
1614
1619
  clientRequestId: clientTurnRequestIdSchema,
1615
1620
  scope: threadEventScopeSchema
1616
1621
  }).strict(),
1617
- z15.object({
1618
- type: z15.literal("thread/name/updated"),
1619
- threadId: z15.string(),
1620
- providerThreadId: z15.string(),
1621
- threadName: z15.string(),
1622
- source: z15.literal("agent").optional()
1622
+ z16.object({
1623
+ type: z16.literal("thread/name/updated"),
1624
+ threadId: z16.string(),
1625
+ providerThreadId: z16.string(),
1626
+ threadName: z16.string(),
1627
+ source: z16.literal("agent").optional()
1623
1628
  }),
1624
- z15.object({
1625
- type: z15.literal("thread/compacted"),
1626
- threadId: z15.string(),
1627
- providerThreadId: z15.string()
1629
+ z16.object({
1630
+ type: z16.literal("thread/compacted"),
1631
+ threadId: z16.string(),
1632
+ providerThreadId: z16.string()
1628
1633
  }),
1629
- z15.object({
1630
- type: z15.literal("thread/context/cleared"),
1631
- threadId: z15.string(),
1632
- providerThreadId: z15.string()
1634
+ z16.object({
1635
+ type: z16.literal("thread/context/cleared"),
1636
+ threadId: z16.string(),
1637
+ providerThreadId: z16.string()
1633
1638
  }),
1634
- z15.object({
1635
- type: z15.literal("thread/goal/updated"),
1636
- threadId: z15.string(),
1637
- providerThreadId: z15.string(),
1638
- objective: z15.string(),
1639
+ z16.object({
1640
+ type: z16.literal("thread/goal/updated"),
1641
+ threadId: z16.string(),
1642
+ providerThreadId: z16.string(),
1643
+ objective: z16.string(),
1639
1644
  status: threadTimelineGoalStatusSchema,
1640
- tokenBudget: z15.number().nullable(),
1641
- tokensUsed: z15.number(),
1642
- timeUsedSeconds: z15.number()
1645
+ tokenBudget: z16.number().nullable(),
1646
+ tokensUsed: z16.number(),
1647
+ timeUsedSeconds: z16.number()
1643
1648
  }),
1644
- z15.object({
1645
- type: z15.literal("thread/goal/cleared"),
1646
- threadId: z15.string(),
1647
- providerThreadId: z15.string()
1649
+ z16.object({
1650
+ type: z16.literal("thread/goal/cleared"),
1651
+ threadId: z16.string(),
1652
+ providerThreadId: z16.string()
1648
1653
  }),
1649
- z15.object({
1650
- type: z15.literal("item/started"),
1651
- threadId: z15.string(),
1652
- providerThreadId: z15.string(),
1654
+ z16.object({
1655
+ type: z16.literal("item/started"),
1656
+ threadId: z16.string(),
1657
+ providerThreadId: z16.string(),
1653
1658
  item: threadEventItemSchema
1654
1659
  }),
1655
- z15.object({
1656
- type: z15.literal("item/completed"),
1657
- threadId: z15.string(),
1658
- providerThreadId: z15.string(),
1660
+ z16.object({
1661
+ type: z16.literal("item/completed"),
1662
+ threadId: z16.string(),
1663
+ providerThreadId: z16.string(),
1659
1664
  item: threadEventItemSchema
1660
1665
  }),
1661
1666
  itemTextDeltaEventSchema("item/agentMessage/delta"),
1662
- z15.object({
1663
- type: z15.literal("item/commandExecution/outputDelta"),
1664
- threadId: z15.string(),
1665
- providerThreadId: z15.string(),
1666
- itemId: z15.string(),
1667
- delta: z15.string(),
1668
- reset: z15.boolean().optional(),
1669
- parentToolCallId: z15.string().optional()
1667
+ z16.object({
1668
+ type: z16.literal("item/commandExecution/outputDelta"),
1669
+ threadId: z16.string(),
1670
+ providerThreadId: z16.string(),
1671
+ itemId: z16.string(),
1672
+ delta: z16.string(),
1673
+ reset: z16.boolean().optional(),
1674
+ parentToolCallId: z16.string().optional()
1670
1675
  }),
1671
1676
  itemTextDeltaEventSchema("item/fileChange/outputDelta"),
1672
1677
  itemTextDeltaEventSchema("item/reasoning/summaryTextDelta"),
1673
1678
  itemTextDeltaEventSchema("item/reasoning/textDelta"),
1674
1679
  itemTextDeltaEventSchema("item/plan/delta"),
1675
- z15.object({
1676
- type: z15.literal("item/mcpToolCall/progress"),
1677
- threadId: z15.string(),
1678
- providerThreadId: z15.string(),
1679
- itemId: z15.string(),
1680
- message: z15.string().optional(),
1681
- parentToolCallId: z15.string().optional()
1680
+ z16.object({
1681
+ type: z16.literal("item/mcpToolCall/progress"),
1682
+ threadId: z16.string(),
1683
+ providerThreadId: z16.string(),
1684
+ itemId: z16.string(),
1685
+ message: z16.string().optional(),
1686
+ parentToolCallId: z16.string().optional()
1682
1687
  }),
1683
1688
  toolCallProgressEventSchema,
1684
- z15.object({
1685
- type: z15.literal("item/backgroundTask/progress"),
1686
- threadId: z15.string(),
1687
- providerThreadId: z15.string(),
1689
+ z16.object({
1690
+ type: z16.literal("item/backgroundTask/progress"),
1691
+ threadId: z16.string(),
1692
+ providerThreadId: z16.string(),
1688
1693
  item: threadEventBackgroundTaskItemSchema
1689
1694
  }),
1690
- z15.object({
1691
- type: z15.literal("item/backgroundTask/completed"),
1692
- threadId: z15.string(),
1693
- providerThreadId: z15.string(),
1695
+ z16.object({
1696
+ type: z16.literal("item/backgroundTask/completed"),
1697
+ threadId: z16.string(),
1698
+ providerThreadId: z16.string(),
1694
1699
  item: threadEventBackgroundTaskItemSchema
1695
1700
  }),
1696
- z15.object({
1697
- type: z15.literal("item/delegation/progress"),
1698
- threadId: z15.string(),
1699
- providerThreadId: z15.string(),
1701
+ z16.object({
1702
+ type: z16.literal("item/delegation/progress"),
1703
+ threadId: z16.string(),
1704
+ providerThreadId: z16.string(),
1700
1705
  item: threadEventDelegationItemSchema
1701
1706
  }),
1702
- z15.object({
1703
- type: z15.literal("item/delegation/completed"),
1704
- threadId: z15.string(),
1705
- providerThreadId: z15.string(),
1707
+ z16.object({
1708
+ type: z16.literal("item/delegation/completed"),
1709
+ threadId: z16.string(),
1710
+ providerThreadId: z16.string(),
1706
1711
  item: threadEventDelegationItemSchema
1707
1712
  }),
1708
- z15.object({
1709
- type: z15.literal("thread/tokenUsage/updated"),
1710
- threadId: z15.string(),
1711
- providerThreadId: z15.string(),
1713
+ z16.object({
1714
+ type: z16.literal("thread/tokenUsage/updated"),
1715
+ threadId: z16.string(),
1716
+ providerThreadId: z16.string(),
1712
1717
  tokenUsage: threadEventTokenUsageSchema
1713
1718
  }),
1714
- z15.object({
1715
- type: z15.literal("thread/contextWindowUsage/updated"),
1716
- threadId: z15.string(),
1717
- providerThreadId: z15.string(),
1719
+ z16.object({
1720
+ type: z16.literal("thread/contextWindowUsage/updated"),
1721
+ threadId: z16.string(),
1722
+ providerThreadId: z16.string(),
1718
1723
  contextWindowUsage: threadEventContextWindowUsageSchema
1719
1724
  }),
1720
- z15.object({
1721
- type: z15.literal("turn/plan/updated"),
1722
- threadId: z15.string(),
1723
- providerThreadId: z15.string(),
1724
- plan: z15.array(threadEventPlanStepSchema),
1725
- explanation: z15.string().optional()
1725
+ z16.object({
1726
+ type: z16.literal("turn/plan/updated"),
1727
+ threadId: z16.string(),
1728
+ providerThreadId: z16.string(),
1729
+ plan: z16.array(threadEventPlanStepSchema),
1730
+ explanation: z16.string().optional()
1726
1731
  }),
1727
- z15.object({
1728
- type: z15.literal("turn/mainRun/updated"),
1729
- threadId: z15.string(),
1730
- providerThreadId: z15.string(),
1731
- state: z15.enum(["idle", "running"])
1732
+ z16.object({
1733
+ type: z16.literal("turn/mainRun/updated"),
1734
+ threadId: z16.string(),
1735
+ providerThreadId: z16.string(),
1736
+ state: z16.enum(["idle", "running"])
1732
1737
  }),
1733
- z15.object({
1734
- type: z15.literal("turn/diff/updated"),
1735
- threadId: z15.string(),
1736
- providerThreadId: z15.string(),
1737
- diff: z15.string().optional()
1738
+ z16.object({
1739
+ type: z16.literal("turn/diff/updated"),
1740
+ threadId: z16.string(),
1741
+ providerThreadId: z16.string(),
1742
+ diff: z16.string().optional()
1738
1743
  }),
1739
- z15.object({
1740
- type: z15.literal("provider/error"),
1741
- threadId: z15.string(),
1742
- providerThreadId: z15.string(),
1743
- message: z15.string(),
1744
- detail: z15.string().optional(),
1745
- willRetry: z15.boolean().optional(),
1744
+ z16.object({
1745
+ type: z16.literal("provider/error"),
1746
+ threadId: z16.string(),
1747
+ providerThreadId: z16.string(),
1748
+ message: z16.string(),
1749
+ detail: z16.string().optional(),
1750
+ willRetry: z16.boolean().optional(),
1746
1751
  errorInfo: providerErrorInfoSchema.optional()
1747
1752
  }),
1748
- z15.object({
1749
- type: z15.literal("provider/rateLimits/updated"),
1750
- threadId: z15.string(),
1751
- providerThreadId: z15.string(),
1753
+ z16.object({
1754
+ type: z16.literal("provider/rateLimits/updated"),
1755
+ threadId: z16.string(),
1756
+ providerThreadId: z16.string(),
1752
1757
  rateLimits: providerRateLimitStateSchema
1753
1758
  }),
1754
- z15.object({
1755
- type: z15.literal("provider.env-resolved"),
1756
- threadId: z15.string(),
1757
- providerThreadId: z15.string(),
1758
- entries: z15.array(
1759
- z15.object({
1760
- name: z15.string(),
1761
- source: z15.union([
1762
- z15.literal("shell"),
1763
- z15.object({ plugin: z15.string() }).strict(),
1764
- z15.object({
1765
- core: z15.enum([
1759
+ z16.object({
1760
+ type: z16.literal("provider.env-resolved"),
1761
+ threadId: z16.string(),
1762
+ providerThreadId: z16.string(),
1763
+ entries: z16.array(
1764
+ z16.object({
1765
+ name: z16.string(),
1766
+ source: z16.union([
1767
+ z16.literal("shell"),
1768
+ z16.object({ plugin: z16.string() }).strict(),
1769
+ z16.object({
1770
+ core: z16.enum([
1766
1771
  "machine-git",
1767
1772
  "machine-environment",
1768
1773
  "project-environment"
1769
1774
  ])
1770
1775
  }).strict()
1771
1776
  ]),
1772
- value: z15.union([
1773
- z15.string(),
1774
- z15.object({ masked: z15.literal(true) }).strict()
1777
+ value: z16.union([
1778
+ z16.string(),
1779
+ z16.object({ masked: z16.literal(true) }).strict()
1775
1780
  ]),
1776
- reason: z15.string().optional()
1781
+ reason: z16.string().optional()
1777
1782
  }).strict()
1778
1783
  )
1779
1784
  }),
1780
- z15.object({
1781
- type: z15.literal("thread/extensionState/updated"),
1782
- threadId: z15.string(),
1783
- providerThreadId: z15.string(),
1785
+ z16.object({
1786
+ type: z16.literal("thread/extensionState/updated"),
1787
+ threadId: z16.string(),
1788
+ providerThreadId: z16.string(),
1784
1789
  kind: extensionKindSchema,
1785
1790
  payload: jsonValueSchema
1786
1791
  }),
1787
- z15.object({
1788
- type: z15.literal("provider/warning"),
1789
- threadId: z15.string(),
1790
- providerThreadId: z15.string(),
1792
+ z16.object({
1793
+ type: z16.literal("provider/warning"),
1794
+ threadId: z16.string(),
1795
+ providerThreadId: z16.string(),
1791
1796
  category: threadEventWarningCategorySchema,
1792
- summary: z15.string().optional(),
1793
- details: z15.string().optional()
1797
+ summary: z16.string().optional(),
1798
+ details: z16.string().optional()
1794
1799
  }),
1795
- z15.object({
1796
- type: z15.literal("provider/modelFallback"),
1797
- threadId: z15.string(),
1798
- providerThreadId: z15.string(),
1799
- originalModel: z15.string().min(1),
1800
- fallbackModel: z15.string().min(1),
1801
- reason: z15.enum(["refusal", "provider"]),
1802
- message: z15.string()
1800
+ z16.object({
1801
+ type: z16.literal("provider/modelFallback"),
1802
+ threadId: z16.string(),
1803
+ providerThreadId: z16.string(),
1804
+ originalModel: z16.string().min(1),
1805
+ fallbackModel: z16.string().min(1),
1806
+ reason: z16.enum(["refusal", "provider"]),
1807
+ message: z16.string()
1803
1808
  }),
1804
1809
  providerUnhandledEventSchema
1805
1810
  ]);
1806
- var scopedEventDataSchema = z15.object({
1811
+ var scopedEventDataSchema = z16.object({
1807
1812
  scope: threadEventScopeSchema
1808
1813
  });
1809
1814
  var providerEventSchema = unscopedProviderEventSchema.and(
1810
1815
  scopedEventDataSchema
1811
1816
  );
1812
- var unscopedSystemEventSchema = z15.discriminatedUnion("type", [
1813
- z15.object({
1814
- type: z15.literal("client/thread/start"),
1815
- threadId: z15.string()
1817
+ var unscopedSystemEventSchema = z16.discriminatedUnion("type", [
1818
+ z16.object({
1819
+ type: z16.literal("client/thread/start"),
1820
+ threadId: z16.string()
1816
1821
  }).merge(clientTurnLifecycleEventDataSchema),
1817
- z15.object({
1818
- type: z15.literal("client/turn/requested"),
1819
- threadId: z15.string()
1822
+ z16.object({
1823
+ type: z16.literal("client/turn/requested"),
1824
+ threadId: z16.string()
1820
1825
  }).merge(turnRequestEventDataSchema),
1821
- z15.object({
1822
- type: z15.literal("client/turn/rejected"),
1823
- threadId: z15.string()
1826
+ z16.object({
1827
+ type: z16.literal("client/turn/rejected"),
1828
+ threadId: z16.string()
1824
1829
  }).merge(turnRequestRejectedEventDataSchema),
1825
- z15.object({
1826
- type: z15.literal("client/turn/start"),
1827
- threadId: z15.string()
1830
+ z16.object({
1831
+ type: z16.literal("client/turn/start"),
1832
+ threadId: z16.string()
1828
1833
  }).merge(clientTurnLifecycleEventDataSchema),
1829
- z15.object({
1830
- type: z15.literal("system/error"),
1831
- threadId: z15.string()
1834
+ z16.object({
1835
+ type: z16.literal("system/error"),
1836
+ threadId: z16.string()
1832
1837
  }).merge(systemErrorEventDataSchema),
1833
- z15.object({
1834
- type: z15.literal("system/manager/user_message"),
1835
- threadId: z15.string()
1838
+ z16.object({
1839
+ type: z16.literal("system/manager/user_message"),
1840
+ threadId: z16.string()
1836
1841
  }).merge(systemLegacyUserMessageEventDataSchema),
1837
- z15.object({
1838
- type: z15.literal("system/thread/interrupted"),
1839
- threadId: z15.string()
1842
+ z16.object({
1843
+ type: z16.literal("system/thread/interrupted"),
1844
+ threadId: z16.string()
1840
1845
  }).merge(systemThreadInterruptedEventDataSchema),
1841
- z15.object({
1842
- type: z15.literal("system/operation"),
1843
- threadId: z15.string()
1846
+ z16.object({
1847
+ type: z16.literal("system/operation"),
1848
+ threadId: z16.string()
1844
1849
  }).merge(systemOperationEventDataSchema),
1845
- z15.object({
1846
- type: z15.literal("system/interaction/lifecycle"),
1847
- threadId: z15.string()
1850
+ z16.object({
1851
+ type: z16.literal("system/interaction/lifecycle"),
1852
+ threadId: z16.string()
1848
1853
  }).merge(systemInteractionLifecycleEventDataSchema),
1849
- z15.object({
1850
- type: z15.literal("system/permissionGrant/lifecycle"),
1851
- threadId: z15.string()
1854
+ z16.object({
1855
+ type: z16.literal("system/permissionGrant/lifecycle"),
1856
+ threadId: z16.string()
1852
1857
  }).merge(systemPermissionGrantLifecycleEventDataSchema),
1853
- z15.object({
1854
- type: z15.literal("system/userQuestion/lifecycle"),
1855
- threadId: z15.string()
1858
+ z16.object({
1859
+ type: z16.literal("system/userQuestion/lifecycle"),
1860
+ threadId: z16.string()
1856
1861
  }).merge(systemUserQuestionLifecycleEventDataSchema),
1857
- z15.object({
1858
- type: z15.literal("system/thread-provisioning"),
1859
- threadId: z15.string()
1862
+ z16.object({
1863
+ type: z16.literal("system/thread-provisioning"),
1864
+ threadId: z16.string()
1860
1865
  }).merge(systemThreadProvisioningEventDataSchema),
1861
- z15.object({
1862
- type: z15.literal("system/provider-turn-watchdog"),
1863
- threadId: z15.string()
1866
+ z16.object({
1867
+ type: z16.literal("system/provider-turn-watchdog"),
1868
+ threadId: z16.string()
1864
1869
  }).merge(systemProviderTurnWatchdogEventDataSchema)
1865
1870
  ]);
1866
1871
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
1867
- var threadEventSchema = z15.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
1872
+ var threadEventSchema = z16.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
1868
1873
  const result2 = validateThreadEventScope({
1869
1874
  type: event.type,
1870
1875
  scope: event.scope
1871
1876
  });
1872
1877
  if (!result2.valid) {
1873
1878
  ctx.addIssue({
1874
- code: z15.ZodIssueCode.custom,
1879
+ code: z16.ZodIssueCode.custom,
1875
1880
  message: result2.message ?? "Invalid thread event scope",
1876
1881
  path: ["scope"]
1877
1882
  });
@@ -1893,132 +1898,132 @@ function isThreadEventWithItem(event) {
1893
1898
  }
1894
1899
 
1895
1900
  // ../domain/src/provider-types.ts
1896
- import { z as z17 } from "zod";
1901
+ import { z as z18 } from "zod";
1897
1902
 
1898
1903
  // ../domain/src/thread-session-option.ts
1899
- import { z as z16 } from "zod";
1900
- var threadSessionOptionValueSchema = z16.object({
1901
- id: z16.string().min(1),
1902
- label: z16.string().min(1),
1903
- description: z16.string().min(1).optional(),
1904
- group: z16.string().min(1).optional()
1904
+ import { z as z17 } from "zod";
1905
+ var threadSessionOptionValueSchema = z17.object({
1906
+ id: z17.string().min(1),
1907
+ label: z17.string().min(1),
1908
+ description: z17.string().min(1).optional(),
1909
+ group: z17.string().min(1).optional()
1905
1910
  });
1906
1911
  var threadSessionOptionBaseShape = {
1907
- id: z16.string().min(1),
1908
- label: z16.string().min(1),
1909
- description: z16.string().min(1).optional(),
1910
- category: z16.string().min(1).optional()
1912
+ id: z17.string().min(1),
1913
+ label: z17.string().min(1),
1914
+ description: z17.string().min(1).optional(),
1915
+ category: z17.string().min(1).optional()
1911
1916
  };
1912
- var threadSessionOptionSchema = z16.discriminatedUnion("type", [
1913
- z16.object({
1917
+ var threadSessionOptionSchema = z17.discriminatedUnion("type", [
1918
+ z17.object({
1914
1919
  ...threadSessionOptionBaseShape,
1915
- type: z16.literal("select"),
1916
- value: z16.string(),
1917
- values: z16.array(threadSessionOptionValueSchema).max(1e3)
1920
+ type: z17.literal("select"),
1921
+ value: z17.string(),
1922
+ values: z17.array(threadSessionOptionValueSchema).max(1e3)
1918
1923
  }),
1919
- z16.object({
1924
+ z17.object({
1920
1925
  ...threadSessionOptionBaseShape,
1921
- type: z16.literal("boolean"),
1922
- value: z16.boolean(),
1923
- fixed: z16.boolean().optional()
1926
+ type: z17.literal("boolean"),
1927
+ value: z17.boolean(),
1928
+ fixed: z17.boolean().optional()
1924
1929
  })
1925
1930
  ]);
1926
1931
 
1927
1932
  // ../domain/src/provider-types.ts
1928
- var modelReasoningEffortSchema = z17.object({
1933
+ var modelReasoningEffortSchema = z18.object({
1929
1934
  reasoningEffort: reasoningLevelSchema,
1930
- label: z17.string().min(1).optional(),
1931
- description: z17.string()
1935
+ label: z18.string().min(1).optional(),
1936
+ description: z18.string()
1932
1937
  });
1933
- var modelServiceTierSchema = z17.object({
1938
+ var modelServiceTierSchema = z18.object({
1934
1939
  id: serviceTierSchema,
1935
- label: z17.string().min(1).optional(),
1936
- description: z17.string().min(1).optional()
1937
- });
1938
- var availableModelSchema = z17.object({
1939
- id: z17.string(),
1940
- model: z17.string(),
1941
- displayName: z17.string(),
1942
- routeProviderId: z17.string().min(1).optional(),
1943
- description: z17.string(),
1944
- reasoningDiscovery: z17.enum(["unknown", "known"]).default("known"),
1945
- supportedReasoningEfforts: z17.array(modelReasoningEffortSchema),
1940
+ label: z18.string().min(1).optional(),
1941
+ description: z18.string().min(1).optional()
1942
+ });
1943
+ var availableModelSchema = z18.object({
1944
+ id: z18.string(),
1945
+ model: z18.string(),
1946
+ displayName: z18.string(),
1947
+ routeProviderId: z18.string().min(1).optional(),
1948
+ description: z18.string(),
1949
+ reasoningDiscovery: z18.enum(["unknown", "known"]).default("known"),
1950
+ supportedReasoningEfforts: z18.array(modelReasoningEffortSchema),
1946
1951
  defaultReasoningEffort: reasoningLevelSchema,
1947
- supportedServiceTiers: z17.array(modelServiceTierSchema).optional(),
1948
- sessionOptions: z17.array(threadSessionOptionSchema).max(64).optional(),
1949
- isDefault: z17.boolean()
1950
- });
1951
- var providerModelCatalogScopeSchema = z17.enum(["host", "workspace"]);
1952
- var providerCapabilitiesSchema = z17.object({
1953
- supportsThreadArchive: z17.boolean(),
1954
- supportsThreadRename: z17.boolean(),
1955
- supportsServiceTier: z17.boolean(),
1956
- supportsNativeUserQuestion: z17.boolean(),
1957
- supportsFork: z17.boolean(),
1958
- supportsSessionRewind: z17.boolean(),
1959
- permissionModes: z17.array(permissionModeSchema).min(1),
1952
+ supportedServiceTiers: z18.array(modelServiceTierSchema).optional(),
1953
+ sessionOptions: z18.array(threadSessionOptionSchema).max(64).optional(),
1954
+ isDefault: z18.boolean()
1955
+ });
1956
+ var providerModelCatalogScopeSchema = z18.enum(["host", "workspace"]);
1957
+ var providerCapabilitiesSchema = z18.object({
1958
+ supportsThreadArchive: z18.boolean(),
1959
+ supportsThreadRename: z18.boolean(),
1960
+ supportsServiceTier: z18.boolean(),
1961
+ supportsNativeUserQuestion: z18.boolean(),
1962
+ supportsFork: z18.boolean(),
1963
+ supportsSessionRewind: z18.boolean(),
1964
+ permissionModes: z18.array(permissionModeSchema).min(1),
1960
1965
  modelCatalogScope: providerModelCatalogScopeSchema
1961
1966
  });
1962
- var providerComposerCommandSchema = z17.object({
1967
+ var providerComposerCommandSchema = z18.object({
1963
1968
  trigger: promptMentionCommandTriggerSchema,
1964
- name: z17.string().min(1).regex(/^[^\s/$]+$/u),
1965
- trailingText: z17.string().regex(/^\s*$/u)
1969
+ name: z18.string().min(1).regex(/^[^\s/$]+$/u),
1970
+ trailingText: z18.string().regex(/^\s*$/u)
1966
1971
  });
1967
- var providerComposerActionSchema = z17.discriminatedUnion("kind", [
1968
- z17.object({
1969
- kind: z17.literal("skills"),
1972
+ var providerComposerActionSchema = z18.discriminatedUnion("kind", [
1973
+ z18.object({
1974
+ kind: z18.literal("skills"),
1970
1975
  trigger: promptMentionCommandTriggerSchema
1971
1976
  }),
1972
- z17.object({
1973
- kind: z17.literal("plan"),
1977
+ z18.object({
1978
+ kind: z18.literal("plan"),
1974
1979
  command: providerComposerCommandSchema
1975
1980
  }),
1976
- z17.object({
1977
- kind: z17.literal("goal"),
1981
+ z18.object({
1982
+ kind: z18.literal("goal"),
1978
1983
  command: providerComposerCommandSchema
1979
1984
  })
1980
1985
  ]);
1981
- var providerStringsSchema = z17.object({
1982
- signInHint: z17.string().min(1),
1983
- expiredHint: z17.string().min(1),
1984
- installUrl: z17.string().min(1),
1985
- brandPrefix: z17.string().min(1).optional(),
1986
- planModeCopy: z17.string().min(1).optional(),
1987
- iconTint: z17.object({ light: z17.string().min(1), dark: z17.string().min(1) }).optional()
1988
- });
1989
- var providerOptionDescriptorSchema = z17.object({
1990
- id: z17.string().min(1),
1991
- label: z17.string().min(1),
1992
- description: z17.string().min(1).optional(),
1993
- icon: z17.string().min(1).optional()
1994
- });
1995
- var providerExtensionKindInfoSchema = z17.object({
1996
- item: z17.boolean(),
1997
- state: z17.boolean()
1998
- });
1999
- var providerExtensionKindsSchema = z17.record(
1986
+ var providerStringsSchema = z18.object({
1987
+ signInHint: z18.string().min(1),
1988
+ expiredHint: z18.string().min(1),
1989
+ installUrl: z18.string().min(1),
1990
+ brandPrefix: z18.string().min(1).optional(),
1991
+ planModeCopy: z18.string().min(1).optional(),
1992
+ iconTint: z18.object({ light: z18.string().min(1), dark: z18.string().min(1) }).optional()
1993
+ });
1994
+ var providerOptionDescriptorSchema = z18.object({
1995
+ id: z18.string().min(1),
1996
+ label: z18.string().min(1),
1997
+ description: z18.string().min(1).optional(),
1998
+ icon: z18.string().min(1).optional()
1999
+ });
2000
+ var providerExtensionKindInfoSchema = z18.object({
2001
+ item: z18.boolean(),
2002
+ state: z18.boolean()
2003
+ });
2004
+ var providerExtensionKindsSchema = z18.record(
2000
2005
  extensionKindSchema,
2001
2006
  providerExtensionKindInfoSchema
2002
2007
  );
2003
- var providerInfoSchema = z17.object({
2004
- id: z17.string(),
2005
- pluginId: z17.string().min(1),
2006
- displayName: z17.string(),
2007
- family: z17.string().min(1).optional(),
2008
- icon: z17.object({ glyph: z17.string().min(1) }).optional(),
2009
- logoUrl: z17.string().min(1).nullable(),
2010
- maintenance: z17.object({
2011
- health: z17.boolean(),
2012
- usage: z17.boolean(),
2013
- installation: z17.boolean()
2008
+ var providerInfoSchema = z18.object({
2009
+ id: z18.string(),
2010
+ pluginId: z18.string().min(1),
2011
+ displayName: z18.string(),
2012
+ family: z18.string().min(1).optional(),
2013
+ icon: z18.object({ glyph: z18.string().min(1) }).optional(),
2014
+ logoUrl: z18.string().min(1).nullable(),
2015
+ maintenance: z18.object({
2016
+ health: z18.boolean(),
2017
+ usage: z18.boolean(),
2018
+ installation: z18.boolean()
2014
2019
  }),
2015
2020
  capabilities: providerCapabilitiesSchema,
2016
- composerActions: z17.array(providerComposerActionSchema),
2021
+ composerActions: z18.array(providerComposerActionSchema),
2017
2022
  completedTurnDisplay: completedTurnDisplaySchema,
2018
- available: z17.boolean(),
2023
+ available: z18.boolean(),
2019
2024
  strings: providerStringsSchema.optional(),
2020
- serviceTiers: z17.array(providerOptionDescriptorSchema).optional(),
2021
- reasoningLevels: z17.array(providerOptionDescriptorSchema).optional(),
2025
+ serviceTiers: z18.array(providerOptionDescriptorSchema).optional(),
2026
+ reasoningLevels: z18.array(providerOptionDescriptorSchema).optional(),
2022
2027
  extensionKinds: providerExtensionKindsSchema.optional()
2023
2028
  });
2024
2029
  var providerRecoveryKindValues = [
@@ -2028,157 +2033,157 @@ var providerRecoveryKindValues = [
2028
2033
  "staleTurn",
2029
2034
  "rateLimited"
2030
2035
  ];
2031
- var providerRecoveryKindSchema = z17.enum(providerRecoveryKindValues);
2032
- var toolCallOutputItemSchema = z17.discriminatedUnion("type", [
2033
- z17.object({
2034
- type: z17.literal("inputText"),
2035
- text: z17.string()
2036
+ var providerRecoveryKindSchema = z18.enum(providerRecoveryKindValues);
2037
+ var toolCallOutputItemSchema = z18.discriminatedUnion("type", [
2038
+ z18.object({
2039
+ type: z18.literal("inputText"),
2040
+ text: z18.string()
2036
2041
  }),
2037
- z17.object({
2038
- type: z17.literal("inputImage"),
2039
- imageUrl: z17.string()
2042
+ z18.object({
2043
+ type: z18.literal("inputImage"),
2044
+ imageUrl: z18.string()
2040
2045
  })
2041
2046
  ]);
2042
- var toolCallRequestSchema = z17.object({
2043
- requestId: z17.union([z17.string().min(1), z17.number()]),
2044
- threadId: z17.string().min(1),
2045
- providerThreadId: z17.string().min(1),
2046
- turnId: z17.string().min(1),
2047
- callId: z17.string().min(1),
2048
- tool: z17.string().min(1),
2049
- arguments: z17.unknown().optional()
2050
- });
2051
- var toolCallResponseSchema = z17.object({
2052
- contentItems: z17.array(toolCallOutputItemSchema),
2053
- success: z17.boolean()
2054
- });
2055
- var dynamicToolSchema = z17.object({
2056
- name: z17.string(),
2057
- description: z17.string(),
2058
- inputSchema: z17.unknown(),
2047
+ var toolCallRequestSchema = z18.object({
2048
+ requestId: z18.union([z18.string().min(1), z18.number()]),
2049
+ threadId: z18.string().min(1),
2050
+ providerThreadId: z18.string().min(1),
2051
+ turnId: z18.string().min(1),
2052
+ callId: z18.string().min(1),
2053
+ tool: z18.string().min(1),
2054
+ arguments: z18.unknown().optional()
2055
+ });
2056
+ var toolCallResponseSchema = z18.object({
2057
+ contentItems: z18.array(toolCallOutputItemSchema),
2058
+ success: z18.boolean()
2059
+ });
2060
+ var dynamicToolSchema = z18.object({
2061
+ name: z18.string(),
2062
+ description: z18.string(),
2063
+ inputSchema: z18.unknown(),
2059
2064
  presentation: threadEventItemPresentationSchema.optional()
2060
2065
  });
2061
2066
 
2062
2067
  // ../domain/src/provider-fork.ts
2063
- import { z as z18 } from "zod";
2068
+ import { z as z19 } from "zod";
2064
2069
  var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
2065
- var providerForkSchema = z18.enum(PROVIDER_FORK_VALUES);
2070
+ var providerForkSchema = z19.enum(PROVIDER_FORK_VALUES);
2066
2071
 
2067
2072
  // ../provider-bridge-protocol/src/thread-delta.ts
2068
- import { z as z19 } from "zod";
2073
+ import { z as z20 } from "zod";
2069
2074
  var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
2070
2075
  var deltaPresentationSchema = threadEventItemPresentationSchema;
2071
2076
  var THREAD_DELTA_KEY_SEPARATOR = "";
2072
- var deltaKeyPartSchema = z19.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
2077
+ var deltaKeyPartSchema = z20.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
2073
2078
  message: "provider keys must not contain the internal key separator (\\u001f)"
2074
2079
  });
2075
- var deltaItemKeySchema = z19.object({
2080
+ var deltaItemKeySchema = z20.object({
2076
2081
  providerItemId: deltaKeyPartSchema.optional(),
2077
2082
  channel: deltaKeyPartSchema.optional(),
2078
2083
  parentRef: deltaKeyPartSchema.optional()
2079
2084
  });
2080
2085
  var providerTurnIdSchema = deltaKeyPartSchema;
2081
- var deltaFileChangeSchema = z19.object({
2082
- path: z19.string(),
2083
- kind: z19.enum(["add", "update", "delete"]),
2084
- movePath: z19.string().optional(),
2085
- diff: z19.string().optional(),
2086
- oldText: z19.string().optional(),
2087
- newText: z19.string().optional()
2088
- });
2089
- var deltaBackgroundTaskShapeSchema = z19.object({
2090
- type: z19.literal("backgroundTask"),
2091
- familyId: z19.string().min(1),
2092
- taskType: z19.string(),
2093
- description: z19.string(),
2086
+ var deltaFileChangeSchema = z20.object({
2087
+ path: z20.string(),
2088
+ kind: z20.enum(["add", "update", "delete"]),
2089
+ movePath: z20.string().optional(),
2090
+ diff: z20.string().optional(),
2091
+ oldText: z20.string().optional(),
2092
+ newText: z20.string().optional()
2093
+ });
2094
+ var deltaBackgroundTaskShapeSchema = z20.object({
2095
+ type: z20.literal("backgroundTask"),
2096
+ familyId: z20.string().min(1),
2097
+ taskType: z20.string(),
2098
+ description: z20.string(),
2094
2099
  status: threadEventItemStatusSchema,
2095
2100
  taskStatus: backgroundTaskStatusSchema,
2096
- skipTranscript: z19.boolean(),
2097
- foreground: z19.boolean().optional(),
2098
- workflowName: z19.string().optional(),
2101
+ skipTranscript: z20.boolean(),
2102
+ foreground: z20.boolean().optional(),
2103
+ workflowName: z20.string().optional(),
2099
2104
  workflow: workflowProgressSnapshotSchema.optional(),
2100
2105
  usage: backgroundTaskUsageSchema.optional(),
2101
- summary: z19.string().optional(),
2102
- error: z19.string().optional(),
2103
- outputFile: z19.string().optional()
2106
+ summary: z20.string().optional(),
2107
+ error: z20.string().optional(),
2108
+ outputFile: z20.string().optional()
2104
2109
  });
2105
- var deltaFileReadShapeSchema = z19.object({
2106
- type: z19.literal("fileRead"),
2107
- path: z19.string(),
2108
- cmd: z19.string().optional()
2110
+ var deltaFileReadShapeSchema = z20.object({
2111
+ type: z20.literal("fileRead"),
2112
+ path: z20.string(),
2113
+ cmd: z20.string().optional()
2109
2114
  });
2110
- var deltaSearchShapeSchema = z19.object({
2111
- type: z19.literal("search"),
2115
+ var deltaSearchShapeSchema = z20.object({
2116
+ type: z20.literal("search"),
2112
2117
  mode: threadEventSearchModeSchema,
2113
- query: z19.string(),
2114
- path: z19.string().optional(),
2115
- cmd: z19.string().optional()
2118
+ query: z20.string(),
2119
+ path: z20.string().optional(),
2120
+ cmd: z20.string().optional()
2116
2121
  });
2117
- var deltaDelegationShapeSchema = z19.object({
2118
- type: z19.literal("delegation"),
2122
+ var deltaDelegationShapeSchema = z20.object({
2123
+ type: z20.literal("delegation"),
2119
2124
  childRef: deltaKeyPartSchema,
2120
- label: z19.string(),
2121
- background: z19.boolean(),
2122
- summary: z19.string().optional()
2125
+ label: z20.string(),
2126
+ background: z20.boolean(),
2127
+ summary: z20.string().optional()
2123
2128
  });
2124
- var deltaPlanStepsShapeSchema = z19.object({
2125
- type: z19.literal("planSteps"),
2126
- steps: z19.array(threadEventPlanStepSchema),
2127
- explanation: z19.string().optional()
2129
+ var deltaPlanStepsShapeSchema = z20.object({
2130
+ type: z20.literal("planSteps"),
2131
+ steps: z20.array(threadEventPlanStepSchema),
2132
+ explanation: z20.string().optional()
2128
2133
  });
2129
- var deltaExtensionShapeSchema = z19.object({
2130
- type: z19.literal("extension"),
2134
+ var deltaExtensionShapeSchema = z20.object({
2135
+ type: z20.literal("extension"),
2131
2136
  kind: extensionKindSchema,
2132
2137
  payload: jsonValueSchema
2133
2138
  });
2134
- var deltaItemShapeSchema = z19.discriminatedUnion("type", [
2135
- z19.object({
2136
- type: z19.literal("command"),
2137
- command: z19.string(),
2138
- cwd: z19.string(),
2139
- aggregatedOutput: z19.string().optional(),
2140
- exitCode: z19.number().optional(),
2141
- durationMs: z19.number().optional()
2139
+ var deltaItemShapeSchema = z20.discriminatedUnion("type", [
2140
+ z20.object({
2141
+ type: z20.literal("command"),
2142
+ command: z20.string(),
2143
+ cwd: z20.string(),
2144
+ aggregatedOutput: z20.string().optional(),
2145
+ exitCode: z20.number().optional(),
2146
+ durationMs: z20.number().optional()
2142
2147
  }),
2143
- z19.object({
2144
- type: z19.literal("fileChange"),
2145
- changes: z19.array(deltaFileChangeSchema)
2148
+ z20.object({
2149
+ type: z20.literal("fileChange"),
2150
+ changes: z20.array(deltaFileChangeSchema)
2146
2151
  }),
2147
- z19.object({
2148
- type: z19.literal("tool"),
2149
- tool: z19.string(),
2150
- server: z19.string().optional(),
2151
- args: z19.unknown().optional(),
2152
- result: z19.unknown().optional(),
2153
- error: z19.string().optional(),
2154
- durationMs: z19.number().optional()
2152
+ z20.object({
2153
+ type: z20.literal("tool"),
2154
+ tool: z20.string(),
2155
+ server: z20.string().optional(),
2156
+ args: z20.unknown().optional(),
2157
+ result: z20.unknown().optional(),
2158
+ error: z20.string().optional(),
2159
+ durationMs: z20.number().optional()
2155
2160
  }),
2156
- z19.object({ type: z19.literal("compaction") }),
2157
- z19.object({ type: z19.literal("agentMessage"), text: z19.string() }),
2158
- z19.object({
2159
- type: z19.literal("reasoning"),
2160
- summary: z19.array(z19.string()),
2161
- content: z19.array(z19.string())
2161
+ z20.object({ type: z20.literal("compaction") }),
2162
+ z20.object({ type: z20.literal("agentMessage"), text: z20.string() }),
2163
+ z20.object({
2164
+ type: z20.literal("reasoning"),
2165
+ summary: z20.array(z20.string()),
2166
+ content: z20.array(z20.string())
2162
2167
  }),
2163
- z19.object({ type: z19.literal("plan"), text: z19.string() }),
2164
- z19.object({
2165
- type: z19.literal("webSearch"),
2166
- queries: z19.array(z19.string()).min(1)
2168
+ z20.object({ type: z20.literal("plan"), text: z20.string() }),
2169
+ z20.object({
2170
+ type: z20.literal("webSearch"),
2171
+ queries: z20.array(z20.string()).min(1)
2167
2172
  }),
2168
- z19.object({
2169
- type: z19.literal("webFetch"),
2170
- url: z19.string(),
2171
- prompt: z19.string().nullable().optional(),
2172
- pattern: z19.string().nullable()
2173
+ z20.object({
2174
+ type: z20.literal("webFetch"),
2175
+ url: z20.string(),
2176
+ prompt: z20.string().nullable().optional(),
2177
+ pattern: z20.string().nullable()
2173
2178
  }),
2174
- z19.object({ type: z19.literal("imageView"), path: z19.string() }),
2175
- z19.object({
2176
- type: z19.literal("imageGeneration"),
2177
- prompt: z19.string().nullable(),
2178
- path: z19.string().nullable(),
2179
- result: z19.string().optional(),
2180
- error: z19.string().nullable(),
2181
- transparentBackground: z19.boolean()
2179
+ z20.object({ type: z20.literal("imageView"), path: z20.string() }),
2180
+ z20.object({
2181
+ type: z20.literal("imageGeneration"),
2182
+ prompt: z20.string().nullable(),
2183
+ path: z20.string().nullable(),
2184
+ result: z20.string().optional(),
2185
+ error: z20.string().nullable(),
2186
+ transparentBackground: z20.boolean()
2182
2187
  }),
2183
2188
  deltaBackgroundTaskShapeSchema,
2184
2189
  deltaFileReadShapeSchema,
@@ -2187,22 +2192,22 @@ var deltaItemShapeSchema = z19.discriminatedUnion("type", [
2187
2192
  deltaPlanStepsShapeSchema,
2188
2193
  deltaExtensionShapeSchema
2189
2194
  ]);
2190
- var deltaProgressSnapshotSchema = z19.discriminatedUnion("type", [
2195
+ var deltaProgressSnapshotSchema = z20.discriminatedUnion("type", [
2191
2196
  deltaBackgroundTaskShapeSchema,
2192
2197
  deltaDelegationShapeSchema
2193
2198
  ]);
2194
- var deltaTextChannelSchema = z19.enum([
2199
+ var deltaTextChannelSchema = z20.enum([
2195
2200
  "agentMessage",
2196
2201
  "reasoningSummary",
2197
2202
  "reasoningText",
2198
2203
  "plan"
2199
2204
  ]);
2200
- var deltaOutputChannelSchema = z19.enum(["command", "fileChange"]);
2201
- var deltaErrorSchema = z19.object({ message: z19.string() });
2202
- var deltaAttachSchema = z19.enum(["open", "currentOrLast"]);
2203
- var deltaNoTurnFallbackSchema = z19.object({
2205
+ var deltaOutputChannelSchema = z20.enum(["command", "fileChange"]);
2206
+ var deltaErrorSchema = z20.object({ message: z20.string() });
2207
+ var deltaAttachSchema = z20.enum(["open", "currentOrLast"]);
2208
+ var deltaNoTurnFallbackSchema = z20.object({
2204
2209
  raw: providerRawEventSchema,
2205
- rawType: z19.string()
2210
+ rawType: z20.string()
2206
2211
  });
2207
2212
  function requireExtensionPresentation(delta, ctx) {
2208
2213
  if (delta.item.type === "extension" && delta.presentation === void 0) {
@@ -2213,36 +2218,36 @@ function requireExtensionPresentation(delta, ctx) {
2213
2218
  });
2214
2219
  }
2215
2220
  }
2216
- var threadDeltaSchema = z19.discriminatedUnion("kind", [
2217
- z19.object({
2218
- kind: z19.literal("input.accepted"),
2221
+ var threadDeltaSchema = z20.discriminatedUnion("kind", [
2222
+ z20.object({
2223
+ kind: z20.literal("input.accepted"),
2219
2224
  clientRequestId: clientTurnRequestIdSchema,
2220
2225
  providerTurnId: providerTurnIdSchema.optional()
2221
2226
  }),
2222
- z19.object({
2223
- kind: z19.literal("input.provider"),
2224
- text: z19.string().min(1),
2227
+ z20.object({
2228
+ kind: z20.literal("input.provider"),
2229
+ text: z20.string().min(1),
2225
2230
  parentRef: deltaKeyPartSchema.optional()
2226
2231
  }),
2227
- z19.object({
2228
- kind: z19.literal("turn.open"),
2232
+ z20.object({
2233
+ kind: z20.literal("turn.open"),
2229
2234
  providerTurnId: providerTurnIdSchema.optional(),
2230
2235
  parentRef: deltaKeyPartSchema.optional()
2231
2236
  }),
2232
- z19.object({
2233
- kind: z19.literal("turn.mainRun"),
2234
- state: z19.enum(["idle", "running"])
2237
+ z20.object({
2238
+ kind: z20.literal("turn.mainRun"),
2239
+ state: z20.enum(["idle", "running"])
2235
2240
  }),
2236
- z19.object({
2237
- kind: z19.literal("turn.boundary"),
2241
+ z20.object({
2242
+ kind: z20.literal("turn.boundary"),
2238
2243
  status: threadEventTurnStatusSchema,
2239
2244
  error: deltaErrorSchema.optional(),
2240
- providerCheckpointId: z19.string().min(1).optional(),
2241
- claimIfIdle: z19.boolean().optional(),
2245
+ providerCheckpointId: z20.string().min(1).optional(),
2246
+ claimIfIdle: z20.boolean().optional(),
2242
2247
  providerTurnId: providerTurnIdSchema.optional()
2243
2248
  }),
2244
- z19.object({
2245
- kind: z19.literal("item.open"),
2249
+ z20.object({
2250
+ kind: z20.literal("item.open"),
2246
2251
  key: deltaItemKeySchema,
2247
2252
  item: deltaItemShapeSchema,
2248
2253
  presentation: deltaPresentationSchema.optional(),
@@ -2250,146 +2255,146 @@ var threadDeltaSchema = z19.discriminatedUnion("kind", [
2250
2255
  providerTurnId: providerTurnIdSchema.optional(),
2251
2256
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2252
2257
  }).superRefine(requireExtensionPresentation),
2253
- z19.object({
2254
- kind: z19.literal("item.close"),
2258
+ z20.object({
2259
+ kind: z20.literal("item.close"),
2255
2260
  key: deltaItemKeySchema,
2256
2261
  status: threadEventItemStatusSchema,
2257
- resultText: z19.string().optional(),
2258
- exitCode: z19.number().optional(),
2259
- aggregatedOutput: z19.string().optional(),
2260
- approvalStatus: z19.literal("denied").optional(),
2262
+ resultText: z20.string().optional(),
2263
+ exitCode: z20.number().optional(),
2264
+ aggregatedOutput: z20.string().optional(),
2265
+ approvalStatus: z20.literal("denied").optional(),
2261
2266
  item: deltaItemShapeSchema,
2262
2267
  presentation: deltaPresentationSchema.optional(),
2263
2268
  providerTurnId: providerTurnIdSchema.optional(),
2264
2269
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2265
2270
  }).superRefine(requireExtensionPresentation),
2266
- z19.object({
2267
- kind: z19.literal("item.progress"),
2271
+ z20.object({
2272
+ kind: z20.literal("item.progress"),
2268
2273
  key: deltaItemKeySchema,
2269
- message: z19.string().optional(),
2274
+ message: z20.string().optional(),
2270
2275
  snapshot: deltaProgressSnapshotSchema.optional(),
2271
- flush: z19.boolean().optional(),
2276
+ flush: z20.boolean().optional(),
2272
2277
  providerTurnId: providerTurnIdSchema.optional(),
2273
2278
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2274
2279
  }),
2275
- z19.object({
2276
- kind: z19.literal("item.textDelta"),
2280
+ z20.object({
2281
+ kind: z20.literal("item.textDelta"),
2277
2282
  key: deltaItemKeySchema,
2278
2283
  channel: deltaTextChannelSchema,
2279
- text: z19.string(),
2284
+ text: z20.string(),
2280
2285
  providerTurnId: providerTurnIdSchema.optional(),
2281
2286
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2282
2287
  }),
2283
- z19.object({
2284
- kind: z19.literal("item.textClose"),
2288
+ z20.object({
2289
+ kind: z20.literal("item.textClose"),
2285
2290
  key: deltaItemKeySchema,
2286
2291
  channel: deltaTextChannelSchema,
2287
- text: z19.string().optional(),
2292
+ text: z20.string().optional(),
2288
2293
  providerTurnId: providerTurnIdSchema.optional(),
2289
2294
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2290
2295
  }),
2291
- z19.object({
2292
- kind: z19.literal("item.outputDelta"),
2296
+ z20.object({
2297
+ kind: z20.literal("item.outputDelta"),
2293
2298
  key: deltaItemKeySchema,
2294
2299
  channel: deltaOutputChannelSchema,
2295
- text: z19.string(),
2300
+ text: z20.string(),
2296
2301
  providerTurnId: providerTurnIdSchema.optional(),
2297
2302
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2298
2303
  }),
2299
- z19.object({
2300
- kind: z19.literal("command.outputSnapshot"),
2304
+ z20.object({
2305
+ kind: z20.literal("command.outputSnapshot"),
2301
2306
  key: deltaItemKeySchema,
2302
- text: z19.string(),
2307
+ text: z20.string(),
2303
2308
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2304
2309
  }),
2305
- z19.object({
2306
- kind: z19.literal("usage"),
2310
+ z20.object({
2311
+ kind: z20.literal("usage"),
2307
2312
  total: threadEventTokenUsageBreakdownSchema,
2308
2313
  last: threadEventTokenUsageBreakdownSchema,
2309
- modelContextWindow: z19.number().nullable(),
2314
+ modelContextWindow: z20.number().nullable(),
2310
2315
  promptCacheTtlMs: promptCacheTtlMsSchema.optional(),
2311
2316
  providerTurnId: providerTurnIdSchema.optional()
2312
2317
  }),
2313
- z19.object({
2314
- kind: z19.literal("contextWindow"),
2318
+ z20.object({
2319
+ kind: z20.literal("contextWindow"),
2315
2320
  snapshot: contextSnapshotSchema.optional(),
2316
- used: z19.number().nullable(),
2317
- size: z19.number().nullable().optional(),
2318
- estimated: z19.boolean(),
2321
+ used: z20.number().nullable(),
2322
+ size: z20.number().nullable().optional(),
2323
+ estimated: z20.boolean(),
2319
2324
  cost: threadUsageCostSchema.optional(),
2320
2325
  attach: deltaAttachSchema,
2321
2326
  providerTurnId: providerTurnIdSchema.optional()
2322
2327
  }),
2323
- z19.object({
2324
- kind: z19.literal("context.compacted"),
2328
+ z20.object({
2329
+ kind: z20.literal("context.compacted"),
2325
2330
  providerTurnId: providerTurnIdSchema.optional(),
2326
2331
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2327
2332
  }),
2328
- z19.object({ kind: z19.literal("context.cleared") }),
2329
- z19.object({
2330
- kind: z19.literal("turn.diff"),
2331
- diff: z19.string(),
2333
+ z20.object({ kind: z20.literal("context.cleared") }),
2334
+ z20.object({
2335
+ kind: z20.literal("turn.diff"),
2336
+ diff: z20.string(),
2332
2337
  providerTurnId: providerTurnIdSchema.optional()
2333
2338
  }),
2334
- z19.object({ kind: z19.literal("thread.started") }),
2335
- z19.object({
2336
- kind: z19.literal("thread.identity"),
2337
- providerThreadId: z19.string().min(1)
2339
+ z20.object({ kind: z20.literal("thread.started") }),
2340
+ z20.object({
2341
+ kind: z20.literal("thread.identity"),
2342
+ providerThreadId: z20.string().min(1)
2338
2343
  }),
2339
- z19.object({
2340
- kind: z19.literal("thread.name"),
2341
- name: z19.string().min(1),
2342
- source: z19.literal("agent").optional()
2344
+ z20.object({
2345
+ kind: z20.literal("thread.name"),
2346
+ name: z20.string().min(1),
2347
+ source: z20.literal("agent").optional()
2343
2348
  }),
2344
- z19.object({
2345
- kind: z19.literal("extension.state"),
2349
+ z20.object({
2350
+ kind: z20.literal("extension.state"),
2346
2351
  extensionKind: extensionKindSchema,
2347
2352
  payload: jsonValueSchema
2348
2353
  }),
2349
- z19.object({
2350
- kind: z19.literal("provider.rateLimits"),
2354
+ z20.object({
2355
+ kind: z20.literal("provider.rateLimits"),
2351
2356
  rateLimits: providerRateLimitStateSchema
2352
2357
  }),
2353
- z19.object({
2354
- kind: z19.literal("provider.error"),
2355
- message: z19.string(),
2356
- detail: z19.string().optional(),
2357
- willRetry: z19.boolean().optional(),
2358
+ z20.object({
2359
+ kind: z20.literal("provider.error"),
2360
+ message: z20.string(),
2361
+ detail: z20.string().optional(),
2362
+ willRetry: z20.boolean().optional(),
2358
2363
  category: providerErrorCategorySchema.optional(),
2359
2364
  errorInfo: providerErrorInfoSchema.optional(),
2360
- settlesTurn: z19.boolean().optional(),
2365
+ settlesTurn: z20.boolean().optional(),
2361
2366
  providerTurnId: providerTurnIdSchema.optional(),
2362
- threadScoped: z19.boolean().optional()
2367
+ threadScoped: z20.boolean().optional()
2363
2368
  }),
2364
- z19.object({
2365
- kind: z19.literal("provider.modelFallback"),
2366
- originalModel: z19.string().min(1),
2367
- fallbackModel: z19.string().min(1),
2368
- reason: z19.enum(["refusal", "provider"]),
2369
- message: z19.string()
2369
+ z20.object({
2370
+ kind: z20.literal("provider.modelFallback"),
2371
+ originalModel: z20.string().min(1),
2372
+ fallbackModel: z20.string().min(1),
2373
+ reason: z20.enum(["refusal", "provider"]),
2374
+ message: z20.string()
2370
2375
  }),
2371
- z19.object({
2372
- kind: z19.literal("provider.warning"),
2373
- summary: z19.string().optional(),
2374
- details: z19.string().optional(),
2376
+ z20.object({
2377
+ kind: z20.literal("provider.warning"),
2378
+ summary: z20.string().optional(),
2379
+ details: z20.string().optional(),
2375
2380
  category: threadEventWarningCategorySchema.optional(),
2376
- vouchedTurn: z19.boolean().optional()
2381
+ vouchedTurn: z20.boolean().optional()
2377
2382
  }),
2378
- z19.object({
2379
- kind: z19.literal("unhandled"),
2383
+ z20.object({
2384
+ kind: z20.literal("unhandled"),
2380
2385
  raw: providerRawEventSchema,
2381
- rawType: z19.string(),
2382
- vouchedTurn: z19.boolean(),
2383
- onlyIfNoTurn: z19.boolean().optional(),
2386
+ rawType: z20.string(),
2387
+ vouchedTurn: z20.boolean(),
2388
+ onlyIfNoTurn: z20.boolean().optional(),
2384
2389
  parentRef: deltaKeyPartSchema.optional(),
2385
2390
  providerTurnId: providerTurnIdSchema.optional()
2386
2391
  }),
2387
- z19.object({ kind: z19.literal("session.ended") }),
2388
- z19.object({ kind: z19.literal("session.reset") })
2392
+ z20.object({ kind: z20.literal("session.ended") }),
2393
+ z20.object({ kind: z20.literal("session.reset") })
2389
2394
  ]);
2390
- var threadDeltaNotificationParamsSchema = z19.object({
2391
- threadId: z19.string().min(1),
2392
- deltas: z19.array(threadDeltaSchema)
2395
+ var threadDeltaNotificationParamsSchema = z20.object({
2396
+ threadId: z20.string().min(1),
2397
+ deltas: z20.array(threadDeltaSchema)
2393
2398
  }).passthrough();
2394
2399
 
2395
2400
  // ../provider-bridge-protocol/src/assembler/delta-assembler.ts
@@ -2400,17 +2405,17 @@ var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
2400
2405
  var THREAD_DELTA_GRAMMAR_V3 = 3;
2401
2406
 
2402
2407
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
2403
- import { z as z21 } from "zod";
2408
+ import { z as z22 } from "zod";
2404
2409
 
2405
2410
  // ../provider-bridge-protocol/src/bridge-kit/tool-arg-schemas.ts
2406
- import { z as z20 } from "zod";
2407
- var bashArgsSchema = z20.object({
2408
- command: z20.string().optional(),
2409
- cwd: z20.string().optional()
2411
+ import { z as z21 } from "zod";
2412
+ var bashArgsSchema = z21.object({
2413
+ command: z21.string().optional(),
2414
+ cwd: z21.string().optional()
2410
2415
  }).passthrough();
2411
- var textBlockSchema = z20.object({
2412
- type: z20.literal("text"),
2413
- text: z20.string()
2416
+ var textBlockSchema = z21.object({
2417
+ type: z21.literal("text"),
2418
+ text: z21.string()
2414
2419
  });
2415
2420
 
2416
2421
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility-helpers.ts
@@ -2419,10 +2424,10 @@ function isRecord(value) {
2419
2424
  }
2420
2425
 
2421
2426
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
2422
- var contentWrapperSchema = z21.object({
2423
- content: z21.array(z21.unknown())
2427
+ var contentWrapperSchema = z22.object({
2428
+ content: z22.array(z22.unknown())
2424
2429
  }).passthrough();
2425
- var shellEnvironmentVariableKeySchema = z21.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
2430
+ var shellEnvironmentVariableKeySchema = z22.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
2426
2431
  var MAX_EXACT_LINE_DIFF_CELLS = 1e6;
2427
2432
  function splitComparableLines(text) {
2428
2433
  const normalized = text.replace(/\r\n?/gu, "\n");
@@ -4297,11 +4302,11 @@ function assembleCapturedThreadEvents(messages, providerId = "pi") {
4297
4302
  }
4298
4303
 
4299
4304
  // ../provider-bridge-protocol/src/conformance/client.ts
4300
- import { z as z22 } from "zod";
4305
+ import { z as z23 } from "zod";
4301
4306
  function isWireMessage(value) {
4302
4307
  return typeof value === "object" && value !== null && !Array.isArray(value);
4303
4308
  }
4304
- var threadDeltaAddressSchema = z22.object({ threadId: z22.string() }).passthrough();
4309
+ var threadDeltaAddressSchema = z23.object({ threadId: z23.string() }).passthrough();
4305
4310
  var ConformanceClient = class {
4306
4311
  constructor(transport, timeoutMs, collector) {
4307
4312
  this.transport = transport;
@@ -4410,11 +4415,11 @@ function nextConformanceClientRequestId() {
4410
4415
  }
4411
4416
 
4412
4417
  // ../provider-bridge-protocol/src/conformance/scenarios.ts
4413
- import { z as z30 } from "zod";
4418
+ import { z as z31 } from "zod";
4414
4419
 
4415
4420
  // ../provider-bridge-protocol/src/handshake.ts
4416
- import { z as z23 } from "zod";
4417
- var bridgeGrammarVersionsSchema = z23.tuple([z23.number().int().positive(), z23.number().int().positive()]).refine(([min, max]) => min <= max, {
4421
+ import { z as z24 } from "zod";
4422
+ var bridgeGrammarVersionsSchema = z24.tuple([z24.number().int().positive(), z24.number().int().positive()]).refine(([min, max]) => min <= max, {
4418
4423
  message: "grammarVersions must be an ascending [min, max] range"
4419
4424
  });
4420
4425
  function negotiateGrammarVersion(runtime, bridge) {
@@ -4422,65 +4427,65 @@ function negotiateGrammarVersion(runtime, bridge) {
4422
4427
  const max = Math.min(runtime[1], bridge[1]);
4423
4428
  return min <= max ? max : null;
4424
4429
  }
4425
- var bridgeSteerModeSchema = z23.enum(["inject", "queue"]);
4426
- var bridgeCapabilitiesSchema = z23.object({
4427
- sessionRestore: z23.boolean().default(false),
4428
- threadArchive: z23.boolean().default(false),
4429
- threadRename: z23.boolean().default(false),
4430
- threadGoalClear: z23.boolean().default(false),
4430
+ var bridgeSteerModeSchema = z24.enum(["inject", "queue"]);
4431
+ var bridgeCapabilitiesSchema = z24.object({
4432
+ sessionRestore: z24.boolean().default(false),
4433
+ threadArchive: z24.boolean().default(false),
4434
+ threadRename: z24.boolean().default(false),
4435
+ threadGoalClear: z24.boolean().default(false),
4431
4436
  fork: providerForkSchema.default("none"),
4432
- approvalEnforcedBy: z23.enum(["runtime", "provider"]).default("runtime"),
4437
+ approvalEnforcedBy: z24.enum(["runtime", "provider"]).default("runtime"),
4433
4438
  grammarVersions: bridgeGrammarVersionsSchema.default([
4434
4439
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4435
4440
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4436
4441
  ]),
4437
4442
  steerMode: bridgeSteerModeSchema.default("queue"),
4438
- skills: z23.object({ configure: z23.boolean().default(false) }).default({ configure: false }),
4439
- commands: z23.object({ list: z23.boolean().default(false) }).default({ list: false })
4443
+ skills: z24.object({ configure: z24.boolean().default(false) }).default({ configure: false }),
4444
+ commands: z24.object({ list: z24.boolean().default(false) }).default({ list: false })
4440
4445
  }).passthrough();
4441
- var initializeParamsSchema = z23.object({
4442
- protocolVersion: z23.number().int().positive(),
4443
- client: z23.object({ name: z23.string().min(1), version: z23.string().min(1) }),
4446
+ var initializeParamsSchema = z24.object({
4447
+ protocolVersion: z24.number().int().positive(),
4448
+ client: z24.object({ name: z24.string().min(1), version: z24.string().min(1) }),
4444
4449
  grammarVersions: bridgeGrammarVersionsSchema.default([
4445
4450
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4446
4451
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4447
4452
  ])
4448
4453
  }).passthrough();
4449
- var initializeResultSchema = z23.object({
4450
- protocolVersion: z23.number().int().positive(),
4451
- capabilities: z23.preprocess(
4454
+ var initializeResultSchema = z24.object({
4455
+ protocolVersion: z24.number().int().positive(),
4456
+ capabilities: z24.preprocess(
4452
4457
  (value) => value ?? {},
4453
4458
  bridgeCapabilitiesSchema
4454
4459
  )
4455
4460
  }).passthrough();
4456
4461
 
4457
4462
  // ../provider-bridge-protocol/src/execution-options.ts
4458
- import { z as z24 } from "zod";
4459
- var bridgeExecutionOptionsSchema = z24.object({
4460
- model: z24.string().min(1).optional(),
4463
+ import { z as z25 } from "zod";
4464
+ var bridgeExecutionOptionsSchema = z25.object({
4465
+ model: z25.string().min(1).optional(),
4461
4466
  serviceTier: serviceTierSchema.optional(),
4462
4467
  reasoningLevel: reasoningLevelSchema.optional(),
4463
4468
  promptMode: promptModeSchema.optional(),
4464
4469
  sessionOptions: sessionOptionSelectionsSchema.optional(),
4465
- instructions: z24.string().optional(),
4466
- envVars: z24.record(z24.string(), z24.string()).optional(),
4467
- providerOptions: z24.record(z24.string(), z24.unknown()).optional()
4470
+ instructions: z25.string().optional(),
4471
+ envVars: z25.record(z25.string(), z25.string()).optional(),
4472
+ providerOptions: z25.record(z25.string(), z25.unknown()).optional()
4468
4473
  }).and(runtimePermissionPolicySchema);
4469
4474
 
4470
4475
  // ../provider-bridge-protocol/src/provider-maintenance.ts
4471
- import { z as z25 } from "zod";
4472
- var providerMaintenanceParamsSchema = z25.object({
4473
- providerId: z25.string().min(1),
4474
- cwd: z25.string().min(1).optional(),
4475
- providerOptions: z25.record(z25.string(), z25.unknown()).optional()
4476
+ import { z as z26 } from "zod";
4477
+ var providerMaintenanceParamsSchema = z26.object({
4478
+ providerId: z26.string().min(1),
4479
+ cwd: z26.string().min(1).optional(),
4480
+ providerOptions: z26.record(z26.string(), z26.unknown()).optional()
4476
4481
  }).passthrough();
4477
- var providerInstallationRequirementSchema = z25.enum(["thread_rewind"]);
4482
+ var providerInstallationRequirementSchema = z26.enum(["thread_rewind"]);
4478
4483
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
4479
4484
  requirement: providerInstallationRequirementSchema.optional(),
4480
- checkUpdates: z25.boolean().default(true)
4485
+ checkUpdates: z26.boolean().default(true)
4481
4486
  });
4482
- var providerHealthSchema = z25.object({
4483
- status: z25.enum([
4487
+ var providerHealthSchema = z26.object({
4488
+ status: z26.enum([
4484
4489
  "ready",
4485
4490
  "not_installed",
4486
4491
  "unauthenticated",
@@ -4488,115 +4493,115 @@ var providerHealthSchema = z25.object({
4488
4493
  "unsupported_version",
4489
4494
  "unknown"
4490
4495
  ]),
4491
- statusMessage: z25.string().min(1).nullable(),
4492
- accountEmail: z25.string().nullable(),
4493
- planLabel: z25.string().min(1).nullable(),
4494
- installedVersion: z25.string().min(1).nullable(),
4495
- minimumSupportedVersion: z25.string().min(1).nullable(),
4496
- canInstall: z25.boolean(),
4497
- canUpdate: z25.boolean(),
4498
- loginCommand: z25.string().min(1).nullable(),
4499
- localLoginCommand: z25.string().min(1).nullable().optional()
4496
+ statusMessage: z26.string().min(1).nullable(),
4497
+ accountEmail: z26.string().nullable(),
4498
+ planLabel: z26.string().min(1).nullable(),
4499
+ installedVersion: z26.string().min(1).nullable(),
4500
+ minimumSupportedVersion: z26.string().min(1).nullable(),
4501
+ canInstall: z26.boolean(),
4502
+ canUpdate: z26.boolean(),
4503
+ loginCommand: z26.string().min(1).nullable(),
4504
+ localLoginCommand: z26.string().min(1).nullable().optional()
4500
4505
  }).passthrough();
4501
- var providerUsageWindowSchema = z25.object({
4502
- label: z25.string().min(1),
4503
- usedPercent: z25.number().min(0).max(100),
4504
- resetsAt: z25.string().min(1).nullable(),
4505
- cost: z25.object({
4506
- usedUsdCents: z25.number().int().nonnegative(),
4507
- limitUsdCents: z25.number().int().positive()
4506
+ var providerUsageWindowSchema = z26.object({
4507
+ label: z26.string().min(1),
4508
+ usedPercent: z26.number().min(0).max(100),
4509
+ resetsAt: z26.string().min(1).nullable(),
4510
+ cost: z26.object({
4511
+ usedUsdCents: z26.number().int().nonnegative(),
4512
+ limitUsdCents: z26.number().int().positive()
4508
4513
  }).optional()
4509
4514
  }).passthrough();
4510
- var providerUsageSchema = z25.discriminatedUnion("status", [
4511
- z25.object({
4512
- status: z25.literal("ok"),
4513
- accountEmail: z25.string().email().nullable(),
4514
- planLabel: z25.string().min(1).nullable(),
4515
- windows: z25.array(providerUsageWindowSchema)
4515
+ var providerUsageSchema = z26.discriminatedUnion("status", [
4516
+ z26.object({
4517
+ status: z26.literal("ok"),
4518
+ accountEmail: z26.string().email().nullable(),
4519
+ planLabel: z26.string().min(1).nullable(),
4520
+ windows: z26.array(providerUsageWindowSchema)
4516
4521
  }).passthrough(),
4517
- z25.object({ status: z25.literal("not_installed") }).passthrough(),
4518
- z25.object({ status: z25.literal("unauthenticated") }).passthrough(),
4519
- z25.object({ status: z25.literal("expired") }).passthrough(),
4520
- z25.object({
4521
- status: z25.literal("error"),
4522
- message: z25.string().min(1),
4523
- planLabel: z25.string().min(1).nullable().default(null),
4524
- accountEmail: z25.string().nullable().default(null)
4522
+ z26.object({ status: z26.literal("not_installed") }).passthrough(),
4523
+ z26.object({ status: z26.literal("unauthenticated") }).passthrough(),
4524
+ z26.object({ status: z26.literal("expired") }).passthrough(),
4525
+ z26.object({
4526
+ status: z26.literal("error"),
4527
+ message: z26.string().min(1),
4528
+ planLabel: z26.string().min(1).nullable().default(null),
4529
+ accountEmail: z26.string().nullable().default(null)
4525
4530
  }).passthrough()
4526
4531
  ]);
4527
- var providerHealthResultSchema = z25.discriminatedUnion("supported", [
4528
- z25.object({ supported: z25.literal(false) }).passthrough(),
4529
- z25.object({
4530
- supported: z25.literal(true),
4532
+ var providerHealthResultSchema = z26.discriminatedUnion("supported", [
4533
+ z26.object({ supported: z26.literal(false) }).passthrough(),
4534
+ z26.object({
4535
+ supported: z26.literal(true),
4531
4536
  health: providerHealthSchema
4532
4537
  }).passthrough()
4533
4538
  ]);
4534
- var providerUsageResultSchema = z25.discriminatedUnion("supported", [
4535
- z25.object({ supported: z25.literal(false) }).passthrough(),
4536
- z25.object({
4537
- supported: z25.literal(true),
4539
+ var providerUsageResultSchema = z26.discriminatedUnion("supported", [
4540
+ z26.object({ supported: z26.literal(false) }).passthrough(),
4541
+ z26.object({
4542
+ supported: z26.literal(true),
4538
4543
  usage: providerUsageSchema
4539
4544
  }).passthrough()
4540
4545
  ]);
4541
- var providerInstallationActionKindSchema = z25.enum([
4546
+ var providerInstallationActionKindSchema = z26.enum([
4542
4547
  "install",
4543
4548
  "update"
4544
4549
  ]);
4545
- var providerInstallationActionSchema = z25.object({
4550
+ var providerInstallationActionSchema = z26.object({
4546
4551
  kind: providerInstallationActionKindSchema,
4547
- label: z25.enum(["Install", "Update"]),
4548
- command: z25.string().min(1)
4552
+ label: z26.enum(["Install", "Update"]),
4553
+ command: z26.string().min(1)
4549
4554
  }).passthrough();
4550
- var providerInstallationSourceSchema = z25.enum([
4555
+ var providerInstallationSourceSchema = z26.enum([
4551
4556
  "notInstalled",
4552
4557
  "npmGlobal",
4553
4558
  "external"
4554
4559
  ]);
4555
- var providerInstallationStatusSchema = z25.object({
4556
- executableName: z25.string().min(1),
4557
- executablePath: z25.string().min(1).nullable(),
4558
- installed: z25.boolean(),
4560
+ var providerInstallationStatusSchema = z26.object({
4561
+ executableName: z26.string().min(1),
4562
+ executablePath: z26.string().min(1).nullable(),
4563
+ installed: z26.boolean(),
4559
4564
  installSource: providerInstallationSourceSchema,
4560
- currentVersion: z25.string().min(1).nullable(),
4561
- latestVersion: z25.string().min(1).nullable(),
4562
- minimumSupportedVersion: z25.string().min(1).nullable(),
4563
- npmPackageName: z25.string().min(1).nullable(),
4564
- npmGlobalPackageVersion: z25.string().min(1).nullable(),
4565
+ currentVersion: z26.string().min(1).nullable(),
4566
+ latestVersion: z26.string().min(1).nullable(),
4567
+ minimumSupportedVersion: z26.string().min(1).nullable(),
4568
+ npmPackageName: z26.string().min(1).nullable(),
4569
+ npmGlobalPackageVersion: z26.string().min(1).nullable(),
4565
4570
  installAction: providerInstallationActionSchema.nullable(),
4566
- needsUpdate: z25.boolean(),
4567
- versionUnsupported: z25.boolean()
4571
+ needsUpdate: z26.boolean(),
4572
+ versionUnsupported: z26.boolean()
4568
4573
  }).passthrough();
4569
4574
  var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
4570
4575
  action: providerInstallationActionKindSchema
4571
4576
  });
4572
- var providerInstallationCommandSchema = z25.object({
4573
- command: z25.string().min(1),
4574
- args: z25.array(z25.string()).max(64),
4575
- displayCommand: z25.string().min(1)
4577
+ var providerInstallationCommandSchema = z26.object({
4578
+ command: z26.string().min(1),
4579
+ args: z26.array(z26.string()).max(64),
4580
+ displayCommand: z26.string().min(1)
4576
4581
  }).passthrough();
4577
- var providerInstallationVerificationSchema = z25.discriminatedUnion(
4582
+ var providerInstallationVerificationSchema = z26.discriminatedUnion(
4578
4583
  "kind",
4579
4584
  [
4580
- z25.object({ kind: z25.literal("installed") }).passthrough(),
4581
- z25.object({
4582
- kind: z25.literal("version_changed"),
4583
- previousVersion: z25.string().min(1)
4585
+ z26.object({ kind: z26.literal("installed") }).passthrough(),
4586
+ z26.object({
4587
+ kind: z26.literal("version_changed"),
4588
+ previousVersion: z26.string().min(1)
4584
4589
  }).passthrough(),
4585
- z25.object({
4586
- kind: z25.literal("version_at_least"),
4587
- version: z25.string().min(1)
4590
+ z26.object({
4591
+ kind: z26.literal("version_at_least"),
4592
+ version: z26.string().min(1)
4588
4593
  }).passthrough()
4589
4594
  ]
4590
4595
  );
4591
- var providerInstallationRunResultSchema = z25.discriminatedUnion(
4596
+ var providerInstallationRunResultSchema = z26.discriminatedUnion(
4592
4597
  "available",
4593
4598
  [
4594
- z25.object({
4595
- available: z25.literal(false),
4596
- message: z25.string().min(1)
4599
+ z26.object({
4600
+ available: z26.literal(false),
4601
+ message: z26.string().min(1)
4597
4602
  }).passthrough(),
4598
- z25.object({
4599
- available: z25.literal(true),
4603
+ z26.object({
4604
+ available: z26.literal(true),
4600
4605
  command: providerInstallationCommandSchema,
4601
4606
  verification: providerInstallationVerificationSchema
4602
4607
  }).passthrough()
@@ -4604,7 +4609,7 @@ var providerInstallationRunResultSchema = z25.discriminatedUnion(
4604
4609
  );
4605
4610
 
4606
4611
  // ../provider-bridge-protocol/src/requests.ts
4607
- import { z as z26 } from "zod";
4612
+ import { z as z27 } from "zod";
4608
4613
  var BRIDGE_REQUEST_METHODS = {
4609
4614
  initialize: "initialize",
4610
4615
  modelList: "model/list",
@@ -4627,82 +4632,82 @@ var BRIDGE_REQUEST_METHODS = {
4627
4632
  skillsConfigure: "skills/configure"
4628
4633
  };
4629
4634
  var sessionConstructionFields = {
4630
- threadId: z26.string().min(1),
4631
- cwd: z26.string().min(1),
4635
+ threadId: z27.string().min(1),
4636
+ cwd: z27.string().min(1),
4632
4637
  options: bridgeExecutionOptionsSchema,
4633
- dynamicTools: z26.array(dynamicToolSchema).optional(),
4634
- disallowedTools: z26.array(z26.string().min(1)).optional(),
4638
+ dynamicTools: z27.array(dynamicToolSchema).optional(),
4639
+ disallowedTools: z27.array(z27.string().min(1)).optional(),
4635
4640
  instructionMode: instructionModeSchema
4636
4641
  };
4637
- var modelListParamsSchema = z26.object({
4638
- cwd: z26.string().min(1).optional(),
4639
- envVars: z26.record(z26.string(), z26.string()).optional(),
4640
- selectedModel: z26.string().min(1).optional()
4642
+ var modelListParamsSchema = z27.object({
4643
+ cwd: z27.string().min(1).optional(),
4644
+ envVars: z27.record(z27.string(), z27.string()).optional(),
4645
+ selectedModel: z27.string().min(1).optional()
4641
4646
  }).passthrough();
4642
- var commandListParamsSchema = z26.object({ cwd: z26.string().min(1) }).passthrough();
4643
- var threadStartParamsSchema = z26.object({
4647
+ var commandListParamsSchema = z27.object({ cwd: z27.string().min(1) }).passthrough();
4648
+ var threadStartParamsSchema = z27.object({
4644
4649
  ...sessionConstructionFields,
4645
- input: z26.array(promptInputSchema).optional()
4650
+ input: z27.array(promptInputSchema).optional()
4646
4651
  }).passthrough();
4647
- var threadResumeParamsSchema = z26.object({
4652
+ var threadResumeParamsSchema = z27.object({
4648
4653
  ...sessionConstructionFields,
4649
- providerThreadId: z26.string().min(1)
4654
+ providerThreadId: z27.string().min(1)
4650
4655
  }).passthrough();
4651
- var threadForkParamsSchema = z26.object({
4656
+ var threadForkParamsSchema = z27.object({
4652
4657
  ...sessionConstructionFields,
4653
- sourceProviderThreadId: z26.string().min(1),
4654
- sourceProviderCheckpointId: z26.string().min(1).optional()
4658
+ sourceProviderThreadId: z27.string().min(1),
4659
+ sourceProviderCheckpointId: z27.string().min(1).optional()
4655
4660
  }).passthrough();
4656
- var threadStopParamsSchema = z26.object({
4657
- threadId: z26.string().min(1),
4658
- providerThreadId: z26.string().min(1),
4659
- intent: z26.enum(["interrupt", "release"]),
4660
- activeTurnId: z26.string().min(1).nullable()
4661
+ var threadStopParamsSchema = z27.object({
4662
+ threadId: z27.string().min(1),
4663
+ providerThreadId: z27.string().min(1),
4664
+ intent: z27.enum(["interrupt", "release"]),
4665
+ activeTurnId: z27.string().min(1).nullable()
4661
4666
  }).passthrough();
4662
- var threadRefParams = z26.object({
4663
- threadId: z26.string().min(1),
4664
- providerThreadId: z26.string().min(1)
4667
+ var threadRefParams = z27.object({
4668
+ threadId: z27.string().min(1),
4669
+ providerThreadId: z27.string().min(1)
4665
4670
  }).passthrough();
4666
- var threadNameSetParamsSchema = z26.object({
4667
- threadId: z26.string().min(1),
4668
- providerThreadId: z26.string().min(1),
4669
- title: z26.string().min(1)
4671
+ var threadNameSetParamsSchema = z27.object({
4672
+ threadId: z27.string().min(1),
4673
+ providerThreadId: z27.string().min(1),
4674
+ title: z27.string().min(1)
4670
4675
  }).passthrough();
4671
4676
  var turnInputFields = {
4672
- threadId: z26.string().min(1),
4673
- providerThreadId: z26.string().min(1),
4674
- input: z26.array(promptInputSchema),
4677
+ threadId: z27.string().min(1),
4678
+ providerThreadId: z27.string().min(1),
4679
+ input: z27.array(promptInputSchema),
4675
4680
  clientRequestId: clientTurnRequestIdSchema,
4676
4681
  options: bridgeExecutionOptionsSchema
4677
4682
  };
4678
- var turnStartParamsSchema = z26.object(turnInputFields).passthrough();
4679
- var turnSteerParamsSchema = z26.object({
4683
+ var turnStartParamsSchema = z27.object(turnInputFields).passthrough();
4684
+ var turnSteerParamsSchema = z27.object({
4680
4685
  ...turnInputFields,
4681
- expectedTurnId: z26.string().min(1)
4686
+ expectedTurnId: z27.string().min(1)
4682
4687
  }).passthrough();
4683
- var skillsConfigureRootSchema = z26.object({
4684
- id: z26.string().min(1),
4685
- path: z26.string().min(1),
4686
- skills: z26.array(
4687
- z26.object({
4688
- name: z26.string().min(1),
4689
- description: z26.string()
4688
+ var skillsConfigureRootSchema = z27.object({
4689
+ id: z27.string().min(1),
4690
+ path: z27.string().min(1),
4691
+ skills: z27.array(
4692
+ z27.object({
4693
+ name: z27.string().min(1),
4694
+ description: z27.string()
4690
4695
  }).passthrough()
4691
4696
  )
4692
4697
  }).passthrough();
4693
- var skillsConfigureParamsSchema = z26.object({
4694
- roots: z26.array(skillsConfigureRootSchema)
4698
+ var skillsConfigureParamsSchema = z27.object({
4699
+ roots: z27.array(skillsConfigureRootSchema)
4695
4700
  }).passthrough();
4696
- var threadIdentityResultSchema = z26.object({
4697
- providerThreadId: z26.string().min(1),
4698
- sessionRestorable: z26.boolean().optional()
4701
+ var threadIdentityResultSchema = z27.object({
4702
+ providerThreadId: z27.string().min(1),
4703
+ sessionRestorable: z27.boolean().optional()
4699
4704
  }).passthrough();
4700
4705
 
4701
4706
  // ../provider-bridge-protocol/src/notifications.ts
4702
- import { z as z28 } from "zod";
4707
+ import { z as z29 } from "zod";
4703
4708
 
4704
4709
  // ../provider-bridge-protocol/src/errors.ts
4705
- import { z as z27 } from "zod";
4710
+ import { z as z28 } from "zod";
4706
4711
  var BRIDGE_JSON_RPC_ERRORS = {
4707
4712
  INVALID_PARAMS: -32602,
4708
4713
  METHOD_NOT_FOUND: -32601,
@@ -4712,12 +4717,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
4712
4717
  FORK_CHECKPOINT_UNSUPPORTED: -32003,
4713
4718
  MISSING_EXECUTABLE: -32004
4714
4719
  };
4715
- var providerRecoveryHintSchema = z27.object({
4720
+ var providerRecoveryHintSchema = z28.object({
4716
4721
  kind: providerRecoveryKindSchema,
4717
- message: z27.string().min(1),
4718
- retryable: z27.boolean()
4722
+ message: z28.string().min(1),
4723
+ retryable: z28.boolean()
4719
4724
  });
4720
- var bridgeErrorDataSchema = z27.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4725
+ var bridgeErrorDataSchema = z28.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4721
4726
 
4722
4727
  // ../provider-bridge-protocol/src/notifications.ts
4723
4728
  var BRIDGE_NOTIFICATION_METHODS = {
@@ -4727,54 +4732,54 @@ var BRIDGE_NOTIFICATION_METHODS = {
4727
4732
  providerRecovery: "provider/recovery",
4728
4733
  error: "error"
4729
4734
  };
4730
- var threadIdentityNotificationSchema = z28.object({
4731
- threadId: z28.string().min(1),
4732
- providerThreadId: z28.string().min(1),
4733
- sessionRestorable: z28.boolean().optional()
4735
+ var threadIdentityNotificationSchema = z29.object({
4736
+ threadId: z29.string().min(1),
4737
+ providerThreadId: z29.string().min(1),
4738
+ sessionRestorable: z29.boolean().optional()
4734
4739
  }).passthrough();
4735
- var sessionReplacedNotificationSchema = z28.object({
4736
- threadId: z28.string().min(1),
4737
- providerThreadId: z28.string().min(1).nullable(),
4738
- reason: z28.string().min(1),
4739
- contextLost: z28.boolean().default(false),
4740
- showRuntimeNote: z28.boolean().default(false)
4740
+ var sessionReplacedNotificationSchema = z29.object({
4741
+ threadId: z29.string().min(1),
4742
+ providerThreadId: z29.string().min(1).nullable(),
4743
+ reason: z29.string().min(1),
4744
+ contextLost: z29.boolean().default(false),
4745
+ showRuntimeNote: z29.boolean().default(false)
4741
4746
  }).passthrough();
4742
- var providerRecoveryNotificationSchema = z28.object({
4743
- threadId: z28.string().min(1).optional(),
4747
+ var providerRecoveryNotificationSchema = z29.object({
4748
+ threadId: z29.string().min(1).optional(),
4744
4749
  ...providerRecoveryHintSchema.shape
4745
4750
  }).passthrough();
4746
- var errorNotificationSchema = z28.object({
4747
- threadId: z28.string().min(1).optional(),
4748
- providerThreadId: z28.string().min(1).optional(),
4749
- message: z28.string().min(1)
4751
+ var errorNotificationSchema = z29.object({
4752
+ threadId: z29.string().min(1).optional(),
4753
+ providerThreadId: z29.string().min(1).optional(),
4754
+ message: z29.string().min(1)
4750
4755
  }).passthrough();
4751
4756
 
4752
4757
  // ../provider-bridge-protocol/src/bridge-requests.ts
4753
- import { z as z29 } from "zod";
4754
- var toolCallRequestParamsSchema = z29.object({
4755
- providerThreadId: z29.string().min(1),
4756
- threadId: z29.string().min(1).optional(),
4757
- turnId: z29.union([z29.string().min(1), z29.null()]),
4758
- callId: z29.string().min(1),
4759
- tool: z29.string().min(1),
4760
- arguments: z29.unknown()
4758
+ import { z as z30 } from "zod";
4759
+ var toolCallRequestParamsSchema = z30.object({
4760
+ providerThreadId: z30.string().min(1),
4761
+ threadId: z30.string().min(1).optional(),
4762
+ turnId: z30.union([z30.string().min(1), z30.null()]),
4763
+ callId: z30.string().min(1),
4764
+ tool: z30.string().min(1),
4765
+ arguments: z30.unknown()
4761
4766
  }).passthrough();
4762
- var toolCallResultSchema = z29.object({
4763
- success: z29.boolean(),
4764
- contentItems: z29.array(
4765
- z29.discriminatedUnion("type", [
4766
- z29.object({ type: z29.literal("inputText"), text: z29.string() }),
4767
- z29.object({
4768
- type: z29.literal("inputImage"),
4769
- imageUrl: z29.string().min(1)
4767
+ var toolCallResultSchema = z30.object({
4768
+ success: z30.boolean(),
4769
+ contentItems: z30.array(
4770
+ z30.discriminatedUnion("type", [
4771
+ z30.object({ type: z30.literal("inputText"), text: z30.string() }),
4772
+ z30.object({
4773
+ type: z30.literal("inputImage"),
4774
+ imageUrl: z30.string().min(1)
4770
4775
  })
4771
4776
  ])
4772
4777
  )
4773
4778
  }).passthrough();
4774
- var interactionRequestParamsSchema = z29.object({
4775
- providerThreadId: z29.string().min(1),
4776
- threadId: z29.string().min(1).optional(),
4777
- turnId: z29.union([z29.string().min(1), z29.null()]),
4779
+ var interactionRequestParamsSchema = z30.object({
4780
+ providerThreadId: z30.string().min(1),
4781
+ threadId: z30.string().min(1).optional(),
4782
+ turnId: z30.union([z30.string().min(1), z30.null()]),
4778
4783
  payload: pendingInteractionPayloadSchema
4779
4784
  }).passthrough();
4780
4785
 
@@ -4931,7 +4936,7 @@ var IDENTITY_RESULT_SHAPE = "{ providerThreadId, sessionRestorable? }";
4931
4936
  function identityProblem(parsed, result2) {
4932
4937
  return `the result must be ${IDENTITY_RESULT_SHAPE} \u2014 the runtime adopts no session without providerThreadId on the result (a thread/identity notification does not substitute for it); issues: ${parsed.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ")} (got ${JSON.stringify(result2)})`;
4933
4938
  }
4934
- var identityNotificationParamsSchema = z30.object({ threadId: z30.string(), providerThreadId: z30.string() }).passthrough();
4939
+ var identityNotificationParamsSchema = z31.object({ threadId: z31.string(), providerThreadId: z31.string() }).passthrough();
4935
4940
  async function checkIdentityAnnounced(context, args) {
4936
4941
  const { client } = context;
4937
4942
  const announced = await client.waitFor(() => {
@@ -4982,7 +4987,7 @@ function threadEvents(context, threadId) {
4982
4987
  context.client.drainIntoLog();
4983
4988
  return context.client.events.filter((entry) => entry.threadId === threadId).map((entry) => entry.event);
4984
4989
  }
4985
- var persistedEventSchema = z30.preprocess(
4990
+ var persistedEventSchema = z31.preprocess(
4986
4991
  (event) => JSON.parse(JSON.stringify(event)),
4987
4992
  threadEventSchema
4988
4993
  );
@@ -6102,26 +6107,26 @@ function formatConformanceReport(report) {
6102
6107
  }
6103
6108
 
6104
6109
  // ../provider-bridge-protocol/src/testing/bridge-json-rpc-test-helpers.ts
6105
- import { z as z31 } from "zod";
6106
- var bridgeJsonRpcValueSchema = z31.lazy(
6107
- () => z31.union([
6108
- z31.string(),
6109
- z31.number(),
6110
- z31.boolean(),
6111
- z31.null(),
6112
- z31.array(bridgeJsonRpcValueSchema),
6113
- z31.record(z31.string(), bridgeJsonRpcValueSchema)
6110
+ import { z as z32 } from "zod";
6111
+ var bridgeJsonRpcValueSchema = z32.lazy(
6112
+ () => z32.union([
6113
+ z32.string(),
6114
+ z32.number(),
6115
+ z32.boolean(),
6116
+ z32.null(),
6117
+ z32.array(bridgeJsonRpcValueSchema),
6118
+ z32.record(z32.string(), bridgeJsonRpcValueSchema)
6114
6119
  ])
6115
6120
  );
6116
- var bridgeJsonRpcOutputSchema = z31.object({
6117
- jsonrpc: z31.literal("2.0"),
6118
- id: z31.union([z31.string(), z31.number()]).optional(),
6119
- method: z31.string().optional(),
6121
+ var bridgeJsonRpcOutputSchema = z32.object({
6122
+ jsonrpc: z32.literal("2.0"),
6123
+ id: z32.union([z32.string(), z32.number()]).optional(),
6124
+ method: z32.string().optional(),
6120
6125
  params: bridgeJsonRpcValueSchema.optional(),
6121
6126
  result: bridgeJsonRpcValueSchema.optional(),
6122
- error: z31.object({
6123
- code: z31.number(),
6124
- message: z31.string(),
6127
+ error: z32.object({
6128
+ code: z32.number(),
6129
+ message: z32.string(),
6125
6130
  data: bridgeJsonRpcValueSchema.optional()
6126
6131
  }).optional()
6127
6132
  });