@get-bb/plugin-sdk 0.4.94 → 0.4.97

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