@get-bb/plugin-sdk 0.4.88 → 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,260 +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
- outputTokens: z13.number(),
1394
- reasoningOutputTokens: z13.number()
1395
- });
1396
- 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({
1397
1404
  snapshot: contextSnapshotSchema.optional(),
1398
- usedTokens: z13.number().nullable(),
1399
- modelContextWindow: z13.number().nullable(),
1400
- estimated: z13.boolean()
1405
+ usedTokens: z14.number().nullable(),
1406
+ modelContextWindow: z14.number().nullable(),
1407
+ estimated: z14.boolean()
1401
1408
  });
1402
- var threadEventTokenUsageSchema = z13.object({
1409
+ var threadEventTokenUsageSchema = z14.object({
1403
1410
  total: threadEventTokenUsageBreakdownSchema,
1404
1411
  last: threadEventTokenUsageBreakdownSchema,
1405
- modelContextWindow: z13.number().nullable()
1412
+ modelContextWindow: z14.number().nullable()
1406
1413
  });
1407
- var threadEventWarningCategorySchema = z13.enum([
1414
+ var threadEventWarningCategorySchema = z14.enum([
1408
1415
  "deprecation",
1409
1416
  "config",
1410
1417
  "general",
1411
1418
  "compaction-skipped"
1412
1419
  ]);
1413
- var providerRawEventSchema = z13.object({
1414
- jsonrpc: z13.literal("2.0"),
1415
- id: z13.union([z13.string(), z13.number()]).optional(),
1416
- 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(),
1417
1424
  params: jsonValueSchema.optional()
1418
1425
  });
1419
- var providerUnhandledEventSchema = z13.object({
1420
- type: z13.literal("provider/unhandled"),
1421
- threadId: z13.string(),
1422
- providerThreadId: z13.string(),
1423
- providerId: z13.string(),
1424
- 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(),
1425
1432
  rawEvent: providerRawEventSchema,
1426
- parentToolCallId: z13.string().optional()
1427
- });
1428
- var toolCallProgressEventSchema = z13.object({
1429
- type: z13.literal("item/toolCall/progress"),
1430
- threadId: z13.string(),
1431
- providerThreadId: z13.string(),
1432
- itemId: z13.string(),
1433
- message: z13.string().optional(),
1434
- parentToolCallId: z13.string().optional()
1435
- });
1436
- var threadEventBackgroundTaskItemSchema = z13.object({
1437
- type: z13.literal("backgroundTask"),
1438
- id: z13.string(),
1439
- familyId: z13.string().optional(),
1440
- taskType: z13.string(),
1441
- 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(),
1442
1449
  status: threadEventItemStatusSchema,
1443
1450
  taskStatus: backgroundTaskStatusSchema,
1444
- skipTranscript: z13.boolean(),
1445
- workflowName: z13.string().optional(),
1451
+ skipTranscript: z14.boolean(),
1452
+ workflowName: z14.string().optional(),
1446
1453
  workflow: workflowProgressSnapshotSchema.optional(),
1447
1454
  usage: backgroundTaskUsageSchema.optional(),
1448
- summary: z13.string().optional(),
1449
- error: z13.string().optional(),
1450
- outputFile: z13.string().optional(),
1455
+ summary: z14.string().optional(),
1456
+ error: z14.string().optional(),
1457
+ outputFile: z14.string().optional(),
1451
1458
  ...itemPresentationField,
1452
- parentToolCallId: z13.string().optional()
1459
+ parentToolCallId: z14.string().optional()
1453
1460
  });
1454
- var threadEventItemSchema = z13.discriminatedUnion("type", [
1455
- z13.object({
1456
- type: z13.literal("userMessage"),
1457
- id: z13.string(),
1458
- 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),
1459
1466
  clientRequestId: clientTurnRequestIdSchema.optional(),
1460
- parentToolCallId: z13.string().optional()
1467
+ parentToolCallId: z14.string().optional()
1461
1468
  }).strict(),
1462
- z13.object({
1463
- type: z13.literal("agentMessage"),
1464
- id: z13.string(),
1465
- text: z13.string(),
1469
+ z14.object({
1470
+ type: z14.literal("agentMessage"),
1471
+ id: z14.string(),
1472
+ text: z14.string(),
1466
1473
  ...itemPresentationField,
1467
- parentToolCallId: z13.string().optional()
1474
+ parentToolCallId: z14.string().optional()
1468
1475
  }),
1469
- z13.object({
1470
- type: z13.literal("commandExecution"),
1471
- id: z13.string(),
1472
- command: z13.string(),
1473
- cwd: z13.string(),
1476
+ z14.object({
1477
+ type: z14.literal("commandExecution"),
1478
+ id: z14.string(),
1479
+ command: z14.string(),
1480
+ cwd: z14.string(),
1474
1481
  status: threadEventItemStatusSchema,
1475
1482
  approvalStatus: threadEventItemApprovalStatusSchema,
1476
- aggregatedOutput: z13.string().optional(),
1477
- exitCode: z13.number().optional(),
1478
- durationMs: z13.number().optional(),
1483
+ aggregatedOutput: z14.string().optional(),
1484
+ exitCode: z14.number().optional(),
1485
+ durationMs: z14.number().optional(),
1479
1486
  truncation: threadEventItemTruncationSchema.optional(),
1480
1487
  ...itemPresentationField,
1481
- parentToolCallId: z13.string().optional()
1488
+ parentToolCallId: z14.string().optional()
1482
1489
  }),
1483
- z13.object({
1484
- type: z13.literal("fileChange"),
1485
- id: z13.string(),
1486
- changes: z13.array(threadEventFileChangeSchema),
1490
+ z14.object({
1491
+ type: z14.literal("fileChange"),
1492
+ id: z14.string(),
1493
+ changes: z14.array(threadEventFileChangeSchema),
1487
1494
  status: threadEventItemStatusSchema,
1488
1495
  approvalStatus: threadEventItemApprovalStatusSchema,
1489
1496
  ...itemPresentationField,
1490
- parentToolCallId: z13.string().optional()
1497
+ parentToolCallId: z14.string().optional()
1491
1498
  }),
1492
1499
  threadEventWebSearchItemSchema,
1493
1500
  threadEventWebFetchItemSchema,
@@ -1495,264 +1502,264 @@ var threadEventItemSchema = z13.discriminatedUnion("type", [
1495
1502
  threadEventImageGenerationItemSchema,
1496
1503
  threadEventFileReadItemSchema,
1497
1504
  threadEventSearchItemSchema,
1498
- z13.object({
1499
- type: z13.literal("toolCall"),
1500
- id: z13.string(),
1501
- server: z13.string().optional(),
1502
- tool: z13.string(),
1503
- 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(),
1504
1511
  status: threadEventItemStatusSchema,
1505
- result: z13.unknown().optional(),
1506
- error: z13.string().optional(),
1507
- durationMs: z13.number().optional(),
1512
+ result: z14.unknown().optional(),
1513
+ error: z14.string().optional(),
1514
+ durationMs: z14.number().optional(),
1508
1515
  truncation: threadEventItemTruncationSchema.optional(),
1509
1516
  ...itemPresentationField,
1510
- parentToolCallId: z13.string().optional()
1517
+ parentToolCallId: z14.string().optional()
1511
1518
  }),
1512
- z13.object({
1513
- type: z13.literal("reasoning"),
1514
- id: z13.string(),
1515
- summary: z13.array(z13.string()),
1516
- 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()),
1517
1524
  ...itemPresentationField,
1518
- parentToolCallId: z13.string().optional()
1525
+ parentToolCallId: z14.string().optional()
1519
1526
  }),
1520
- z13.object({
1521
- type: z13.literal("plan"),
1522
- id: z13.string(),
1523
- text: z13.string(),
1527
+ z14.object({
1528
+ type: z14.literal("plan"),
1529
+ id: z14.string(),
1530
+ text: z14.string(),
1524
1531
  ...itemPresentationField,
1525
- parentToolCallId: z13.string().optional()
1532
+ parentToolCallId: z14.string().optional()
1526
1533
  }),
1527
1534
  threadEventPlanStepsItemSchema,
1528
- z13.object({
1529
- type: z13.literal("contextCompaction"),
1530
- id: z13.string(),
1535
+ z14.object({
1536
+ type: z14.literal("contextCompaction"),
1537
+ id: z14.string(),
1531
1538
  ...itemPresentationField,
1532
- parentToolCallId: z13.string().optional()
1539
+ parentToolCallId: z14.string().optional()
1533
1540
  }),
1534
1541
  threadEventBackgroundTaskItemSchema,
1535
1542
  threadEventDelegationItemSchema,
1536
1543
  threadEventExtensionItemSchema
1537
1544
  ]);
1538
1545
  function itemTextDeltaEventSchema(type) {
1539
- return z13.object({
1540
- type: z13.literal(type),
1541
- threadId: z13.string(),
1542
- providerThreadId: z13.string(),
1543
- itemId: z13.string(),
1544
- delta: z13.string(),
1545
- 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()
1546
1553
  });
1547
1554
  }
1548
- var unscopedProviderEventSchema = z13.discriminatedUnion("type", [
1549
- z13.object({
1550
- type: z13.literal("thread/started"),
1551
- threadId: z13.string()
1555
+ var unscopedProviderEventSchema = z14.discriminatedUnion("type", [
1556
+ z14.object({
1557
+ type: z14.literal("thread/started"),
1558
+ threadId: z14.string()
1552
1559
  }),
1553
- z13.object({
1554
- type: z13.literal("thread/identity"),
1555
- threadId: z13.string(),
1556
- providerThreadId: z13.string()
1560
+ z14.object({
1561
+ type: z14.literal("thread/identity"),
1562
+ threadId: z14.string(),
1563
+ providerThreadId: z14.string()
1557
1564
  }),
1558
- z13.object({
1559
- type: z13.literal("turn/started"),
1560
- threadId: z13.string(),
1561
- providerThreadId: z13.string(),
1562
- 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()
1563
1570
  }),
1564
- z13.object({
1565
- type: z13.literal("turn/completed"),
1566
- threadId: z13.string(),
1567
- providerThreadId: z13.string().nullable(),
1571
+ z14.object({
1572
+ type: z14.literal("turn/completed"),
1573
+ threadId: z14.string(),
1574
+ providerThreadId: z14.string().nullable(),
1568
1575
  status: threadEventTurnStatusSchema,
1569
- error: z13.object({ message: z13.string() }).optional(),
1570
- providerCheckpointId: z13.string().min(1).optional()
1576
+ error: z14.object({ message: z14.string() }).optional(),
1577
+ providerCheckpointId: z14.string().min(1).optional()
1571
1578
  }),
1572
- z13.object({
1573
- type: z13.literal("turn/input/accepted"),
1574
- threadId: z13.string(),
1575
- providerThreadId: z13.string(),
1579
+ z14.object({
1580
+ type: z14.literal("turn/input/accepted"),
1581
+ threadId: z14.string(),
1582
+ providerThreadId: z14.string(),
1576
1583
  clientRequestId: clientTurnRequestIdSchema,
1577
1584
  scope: threadEventScopeSchema
1578
1585
  }).strict(),
1579
- z13.object({
1580
- type: z13.literal("thread/name/updated"),
1581
- threadId: z13.string(),
1582
- providerThreadId: z13.string(),
1583
- 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()
1584
1591
  }),
1585
- z13.object({
1586
- type: z13.literal("thread/compacted"),
1587
- threadId: z13.string(),
1588
- providerThreadId: z13.string()
1592
+ z14.object({
1593
+ type: z14.literal("thread/compacted"),
1594
+ threadId: z14.string(),
1595
+ providerThreadId: z14.string()
1589
1596
  }),
1590
- z13.object({
1591
- type: z13.literal("thread/context/cleared"),
1592
- threadId: z13.string(),
1593
- providerThreadId: z13.string()
1597
+ z14.object({
1598
+ type: z14.literal("thread/context/cleared"),
1599
+ threadId: z14.string(),
1600
+ providerThreadId: z14.string()
1594
1601
  }),
1595
- z13.object({
1596
- type: z13.literal("thread/goal/updated"),
1597
- threadId: z13.string(),
1598
- providerThreadId: z13.string(),
1599
- 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(),
1600
1607
  status: threadTimelineGoalStatusSchema,
1601
- tokenBudget: z13.number().nullable(),
1602
- tokensUsed: z13.number(),
1603
- timeUsedSeconds: z13.number()
1608
+ tokenBudget: z14.number().nullable(),
1609
+ tokensUsed: z14.number(),
1610
+ timeUsedSeconds: z14.number()
1604
1611
  }),
1605
- z13.object({
1606
- type: z13.literal("thread/goal/cleared"),
1607
- threadId: z13.string(),
1608
- providerThreadId: z13.string()
1612
+ z14.object({
1613
+ type: z14.literal("thread/goal/cleared"),
1614
+ threadId: z14.string(),
1615
+ providerThreadId: z14.string()
1609
1616
  }),
1610
- z13.object({
1611
- type: z13.literal("item/started"),
1612
- threadId: z13.string(),
1613
- providerThreadId: z13.string(),
1617
+ z14.object({
1618
+ type: z14.literal("item/started"),
1619
+ threadId: z14.string(),
1620
+ providerThreadId: z14.string(),
1614
1621
  item: threadEventItemSchema
1615
1622
  }),
1616
- z13.object({
1617
- type: z13.literal("item/completed"),
1618
- threadId: z13.string(),
1619
- providerThreadId: z13.string(),
1623
+ z14.object({
1624
+ type: z14.literal("item/completed"),
1625
+ threadId: z14.string(),
1626
+ providerThreadId: z14.string(),
1620
1627
  item: threadEventItemSchema
1621
1628
  }),
1622
1629
  itemTextDeltaEventSchema("item/agentMessage/delta"),
1623
- z13.object({
1624
- type: z13.literal("item/commandExecution/outputDelta"),
1625
- threadId: z13.string(),
1626
- providerThreadId: z13.string(),
1627
- itemId: z13.string(),
1628
- delta: z13.string(),
1629
- reset: z13.boolean().optional(),
1630
- 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()
1631
1638
  }),
1632
1639
  itemTextDeltaEventSchema("item/fileChange/outputDelta"),
1633
1640
  itemTextDeltaEventSchema("item/reasoning/summaryTextDelta"),
1634
1641
  itemTextDeltaEventSchema("item/reasoning/textDelta"),
1635
1642
  itemTextDeltaEventSchema("item/plan/delta"),
1636
- z13.object({
1637
- type: z13.literal("item/mcpToolCall/progress"),
1638
- threadId: z13.string(),
1639
- providerThreadId: z13.string(),
1640
- itemId: z13.string(),
1641
- message: z13.string().optional(),
1642
- 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()
1643
1650
  }),
1644
1651
  toolCallProgressEventSchema,
1645
- z13.object({
1646
- type: z13.literal("item/backgroundTask/progress"),
1647
- threadId: z13.string(),
1648
- providerThreadId: z13.string(),
1652
+ z14.object({
1653
+ type: z14.literal("item/backgroundTask/progress"),
1654
+ threadId: z14.string(),
1655
+ providerThreadId: z14.string(),
1649
1656
  item: threadEventBackgroundTaskItemSchema
1650
1657
  }),
1651
- z13.object({
1652
- type: z13.literal("item/backgroundTask/completed"),
1653
- threadId: z13.string(),
1654
- providerThreadId: z13.string(),
1658
+ z14.object({
1659
+ type: z14.literal("item/backgroundTask/completed"),
1660
+ threadId: z14.string(),
1661
+ providerThreadId: z14.string(),
1655
1662
  item: threadEventBackgroundTaskItemSchema
1656
1663
  }),
1657
- z13.object({
1658
- type: z13.literal("item/delegation/progress"),
1659
- threadId: z13.string(),
1660
- providerThreadId: z13.string(),
1664
+ z14.object({
1665
+ type: z14.literal("item/delegation/progress"),
1666
+ threadId: z14.string(),
1667
+ providerThreadId: z14.string(),
1661
1668
  item: threadEventDelegationItemSchema
1662
1669
  }),
1663
- z13.object({
1664
- type: z13.literal("item/delegation/completed"),
1665
- threadId: z13.string(),
1666
- providerThreadId: z13.string(),
1670
+ z14.object({
1671
+ type: z14.literal("item/delegation/completed"),
1672
+ threadId: z14.string(),
1673
+ providerThreadId: z14.string(),
1667
1674
  item: threadEventDelegationItemSchema
1668
1675
  }),
1669
- z13.object({
1670
- type: z13.literal("thread/tokenUsage/updated"),
1671
- threadId: z13.string(),
1672
- providerThreadId: z13.string(),
1676
+ z14.object({
1677
+ type: z14.literal("thread/tokenUsage/updated"),
1678
+ threadId: z14.string(),
1679
+ providerThreadId: z14.string(),
1673
1680
  tokenUsage: threadEventTokenUsageSchema
1674
1681
  }),
1675
- z13.object({
1676
- type: z13.literal("thread/contextWindowUsage/updated"),
1677
- threadId: z13.string(),
1678
- providerThreadId: z13.string(),
1682
+ z14.object({
1683
+ type: z14.literal("thread/contextWindowUsage/updated"),
1684
+ threadId: z14.string(),
1685
+ providerThreadId: z14.string(),
1679
1686
  contextWindowUsage: threadEventContextWindowUsageSchema
1680
1687
  }),
1681
- z13.object({
1682
- type: z13.literal("turn/plan/updated"),
1683
- threadId: z13.string(),
1684
- providerThreadId: z13.string(),
1685
- plan: z13.array(threadEventPlanStepSchema),
1686
- 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()
1687
1694
  }),
1688
- z13.object({
1689
- type: z13.literal("turn/diff/updated"),
1690
- threadId: z13.string(),
1691
- providerThreadId: z13.string(),
1692
- 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()
1693
1700
  }),
1694
- z13.object({
1695
- type: z13.literal("provider/error"),
1696
- threadId: z13.string(),
1697
- providerThreadId: z13.string(),
1698
- message: z13.string(),
1699
- detail: z13.string().optional(),
1700
- 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(),
1701
1708
  errorInfo: providerErrorInfoSchema.optional()
1702
1709
  }),
1703
- z13.object({
1704
- type: z13.literal("provider/rateLimits/updated"),
1705
- threadId: z13.string(),
1706
- providerThreadId: z13.string(),
1710
+ z14.object({
1711
+ type: z14.literal("provider/rateLimits/updated"),
1712
+ threadId: z14.string(),
1713
+ providerThreadId: z14.string(),
1707
1714
  rateLimits: providerRateLimitStateSchema
1708
1715
  }),
1709
- z13.object({
1710
- type: z13.literal("provider.env-resolved"),
1711
- threadId: z13.string(),
1712
- providerThreadId: z13.string(),
1713
- entries: z13.array(
1714
- z13.object({
1715
- name: z13.string(),
1716
- source: z13.union([
1717
- z13.literal("shell"),
1718
- z13.object({ plugin: z13.string() }).strict(),
1719
- 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()
1720
1727
  ]),
1721
- value: z13.union([
1722
- z13.string(),
1723
- z13.object({ masked: z13.literal(true) }).strict()
1728
+ value: z14.union([
1729
+ z14.string(),
1730
+ z14.object({ masked: z14.literal(true) }).strict()
1724
1731
  ]),
1725
- reason: z13.string().optional()
1732
+ reason: z14.string().optional()
1726
1733
  }).strict()
1727
1734
  )
1728
1735
  }),
1729
- z13.object({
1730
- type: z13.literal("thread/extensionState/updated"),
1731
- threadId: z13.string(),
1732
- providerThreadId: z13.string(),
1736
+ z14.object({
1737
+ type: z14.literal("thread/extensionState/updated"),
1738
+ threadId: z14.string(),
1739
+ providerThreadId: z14.string(),
1733
1740
  kind: extensionKindSchema,
1734
1741
  payload: jsonValueSchema
1735
1742
  }),
1736
- z13.object({
1737
- type: z13.literal("provider/warning"),
1738
- threadId: z13.string(),
1739
- providerThreadId: z13.string(),
1743
+ z14.object({
1744
+ type: z14.literal("provider/warning"),
1745
+ threadId: z14.string(),
1746
+ providerThreadId: z14.string(),
1740
1747
  category: threadEventWarningCategorySchema,
1741
- summary: z13.string().optional(),
1742
- details: z13.string().optional()
1748
+ summary: z14.string().optional(),
1749
+ details: z14.string().optional()
1743
1750
  }),
1744
- z13.object({
1745
- type: z13.literal("provider/modelFallback"),
1746
- threadId: z13.string(),
1747
- providerThreadId: z13.string(),
1748
- originalModel: z13.string().min(1),
1749
- fallbackModel: z13.string().min(1),
1750
- reason: z13.enum(["refusal", "provider"]),
1751
- 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()
1752
1759
  }),
1753
1760
  providerUnhandledEventSchema
1754
1761
  ]);
1755
- var scopedEventDataSchema = z13.object({
1762
+ var scopedEventDataSchema = z14.object({
1756
1763
  scope: threadEventScopeSchema
1757
1764
  });
1758
1765
  var providerEventSchema = unscopedProviderEventSchema.and(
@@ -1761,58 +1768,58 @@ var providerEventSchema = unscopedProviderEventSchema.and(
1761
1768
  var providerEventTypeValues = unscopedProviderEventSchema.options.map(
1762
1769
  (option) => option.shape.type.value
1763
1770
  );
1764
- var unscopedSystemEventSchema = z13.discriminatedUnion("type", [
1765
- z13.object({
1766
- type: z13.literal("client/thread/start"),
1767
- threadId: z13.string()
1771
+ var unscopedSystemEventSchema = z14.discriminatedUnion("type", [
1772
+ z14.object({
1773
+ type: z14.literal("client/thread/start"),
1774
+ threadId: z14.string()
1768
1775
  }).merge(clientTurnLifecycleEventDataSchema),
1769
- z13.object({
1770
- type: z13.literal("client/turn/requested"),
1771
- threadId: z13.string()
1776
+ z14.object({
1777
+ type: z14.literal("client/turn/requested"),
1778
+ threadId: z14.string()
1772
1779
  }).merge(turnRequestEventDataSchema),
1773
- z13.object({
1774
- type: z13.literal("client/turn/rejected"),
1775
- threadId: z13.string()
1780
+ z14.object({
1781
+ type: z14.literal("client/turn/rejected"),
1782
+ threadId: z14.string()
1776
1783
  }).merge(turnRequestRejectedEventDataSchema),
1777
- z13.object({
1778
- type: z13.literal("client/turn/start"),
1779
- threadId: z13.string()
1784
+ z14.object({
1785
+ type: z14.literal("client/turn/start"),
1786
+ threadId: z14.string()
1780
1787
  }).merge(clientTurnLifecycleEventDataSchema),
1781
- z13.object({
1782
- type: z13.literal("system/error"),
1783
- threadId: z13.string()
1788
+ z14.object({
1789
+ type: z14.literal("system/error"),
1790
+ threadId: z14.string()
1784
1791
  }).merge(systemErrorEventDataSchema),
1785
- z13.object({
1786
- type: z13.literal("system/manager/user_message"),
1787
- threadId: z13.string()
1792
+ z14.object({
1793
+ type: z14.literal("system/manager/user_message"),
1794
+ threadId: z14.string()
1788
1795
  }).merge(systemLegacyUserMessageEventDataSchema),
1789
- z13.object({
1790
- type: z13.literal("system/thread/interrupted"),
1791
- threadId: z13.string()
1796
+ z14.object({
1797
+ type: z14.literal("system/thread/interrupted"),
1798
+ threadId: z14.string()
1792
1799
  }).merge(systemThreadInterruptedEventDataSchema),
1793
- z13.object({
1794
- type: z13.literal("system/operation"),
1795
- threadId: z13.string()
1800
+ z14.object({
1801
+ type: z14.literal("system/operation"),
1802
+ threadId: z14.string()
1796
1803
  }).merge(systemOperationEventDataSchema),
1797
- z13.object({
1798
- type: z13.literal("system/interaction/lifecycle"),
1799
- threadId: z13.string()
1804
+ z14.object({
1805
+ type: z14.literal("system/interaction/lifecycle"),
1806
+ threadId: z14.string()
1800
1807
  }).merge(systemInteractionLifecycleEventDataSchema),
1801
- z13.object({
1802
- type: z13.literal("system/permissionGrant/lifecycle"),
1803
- threadId: z13.string()
1808
+ z14.object({
1809
+ type: z14.literal("system/permissionGrant/lifecycle"),
1810
+ threadId: z14.string()
1804
1811
  }).merge(systemPermissionGrantLifecycleEventDataSchema),
1805
- z13.object({
1806
- type: z13.literal("system/userQuestion/lifecycle"),
1807
- threadId: z13.string()
1812
+ z14.object({
1813
+ type: z14.literal("system/userQuestion/lifecycle"),
1814
+ threadId: z14.string()
1808
1815
  }).merge(systemUserQuestionLifecycleEventDataSchema),
1809
- z13.object({
1810
- type: z13.literal("system/thread-provisioning"),
1811
- threadId: z13.string()
1816
+ z14.object({
1817
+ type: z14.literal("system/thread-provisioning"),
1818
+ threadId: z14.string()
1812
1819
  }).merge(systemThreadProvisioningEventDataSchema),
1813
- z13.object({
1814
- type: z13.literal("system/provider-turn-watchdog"),
1815
- threadId: z13.string()
1820
+ z14.object({
1821
+ type: z14.literal("system/provider-turn-watchdog"),
1822
+ threadId: z14.string()
1816
1823
  }).merge(systemProviderTurnWatchdogEventDataSchema)
1817
1824
  ]);
1818
1825
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
@@ -1820,13 +1827,13 @@ var legacyClientRequestKey = ["clientRequest", "Sequence"].join("");
1820
1827
  function isEventPropertyBag(value) {
1821
1828
  return typeof value === "object" && value !== null && !Array.isArray(value);
1822
1829
  }
1823
- var rejectLegacyClientRequestSequenceSchema = z13.unknown().superRefine((value, ctx) => {
1830
+ var rejectLegacyClientRequestSequenceSchema = z14.unknown().superRefine((value, ctx) => {
1824
1831
  if (!isEventPropertyBag(value)) {
1825
1832
  return;
1826
1833
  }
1827
1834
  if (Object.hasOwn(value, legacyClientRequestKey)) {
1828
1835
  ctx.addIssue({
1829
- code: z13.ZodIssueCode.custom,
1836
+ code: z14.ZodIssueCode.custom,
1830
1837
  message: "legacy request sequence field is no longer accepted",
1831
1838
  path: [legacyClientRequestKey]
1832
1839
  });
@@ -1834,21 +1841,21 @@ var rejectLegacyClientRequestSequenceSchema = z13.unknown().superRefine((value,
1834
1841
  const item = value.item;
1835
1842
  if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
1836
1843
  ctx.addIssue({
1837
- code: z13.ZodIssueCode.custom,
1844
+ code: z14.ZodIssueCode.custom,
1838
1845
  message: "legacy user-message request sequence field is no longer accepted",
1839
1846
  path: ["item", legacyClientRequestKey]
1840
1847
  });
1841
1848
  }
1842
1849
  });
1843
1850
  var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
1844
- z13.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
1851
+ z14.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
1845
1852
  const result2 = validateThreadEventScope({
1846
1853
  type: event.type,
1847
1854
  scope: event.scope
1848
1855
  });
1849
1856
  if (!result2.valid) {
1850
1857
  ctx.addIssue({
1851
- code: z13.ZodIssueCode.custom,
1858
+ code: z14.ZodIssueCode.custom,
1852
1859
  message: result2.message ?? "Invalid thread event scope",
1853
1860
  path: ["scope"]
1854
1861
  });
@@ -1874,7 +1881,7 @@ var threadEventTypeValues = [
1874
1881
  ...systemEventTypeValues
1875
1882
  ];
1876
1883
  var threadEventTypeSet = new Set(threadEventTypeValues);
1877
- var threadEventTypeSchema = z13.string().refine(
1884
+ var threadEventTypeSchema = z14.string().refine(
1878
1885
  (value) => threadEventTypeSet.has(value),
1879
1886
  "Invalid thread event type"
1880
1887
  );
@@ -1897,95 +1904,96 @@ function parseNamespacedGlyph(glyph) {
1897
1904
  }
1898
1905
 
1899
1906
  // ../domain/src/provider-fork.ts
1900
- import { z as z14 } from "zod";
1907
+ import { z as z15 } from "zod";
1901
1908
  var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
1902
- var providerForkSchema = z14.enum(PROVIDER_FORK_VALUES);
1909
+ var providerForkSchema = z15.enum(PROVIDER_FORK_VALUES);
1903
1910
 
1904
1911
  // ../domain/src/provider-types.ts
1905
- import { z as z15 } from "zod";
1906
- var modelReasoningEffortSchema = z15.object({
1912
+ import { z as z16 } from "zod";
1913
+ var modelReasoningEffortSchema = z16.object({
1907
1914
  reasoningEffort: reasoningLevelSchema,
1908
- description: z15.string()
1909
- });
1910
- var availableModelSchema = z15.object({
1911
- id: z15.string(),
1912
- model: z15.string(),
1913
- displayName: z15.string(),
1914
- routeProviderId: z15.string().min(1).optional(),
1915
- description: z15.string(),
1916
- 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),
1917
1924
  defaultReasoningEffort: reasoningLevelSchema,
1918
- isDefault: z15.boolean()
1919
- });
1920
- var providerModelCatalogScopeSchema = z15.enum(["host", "workspace"]);
1921
- var providerCapabilitiesSchema = z15.object({
1922
- supportsThreadArchive: z15.boolean(),
1923
- supportsThreadRename: z15.boolean(),
1924
- supportsServiceTier: z15.boolean(),
1925
- supportsNativeUserQuestion: z15.boolean(),
1926
- supportsFork: z15.boolean(),
1927
- supportsSessionRewind: z15.boolean(),
1928
- 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),
1929
1936
  modelCatalogScope: providerModelCatalogScopeSchema
1930
1937
  });
1931
- var providerComposerCommandSchema = z15.object({
1938
+ var providerComposerCommandSchema = z16.object({
1932
1939
  trigger: promptMentionCommandTriggerSchema,
1933
- name: z15.string().min(1).regex(/^[^\s/$]+$/u),
1934
- trailingText: z15.string().regex(/^\s*$/u)
1940
+ name: z16.string().min(1).regex(/^[^\s/$]+$/u),
1941
+ trailingText: z16.string().regex(/^\s*$/u)
1935
1942
  });
1936
- var providerComposerActionSchema = z15.discriminatedUnion("kind", [
1937
- z15.object({
1938
- kind: z15.literal("skills"),
1943
+ var providerComposerActionSchema = z16.discriminatedUnion("kind", [
1944
+ z16.object({
1945
+ kind: z16.literal("skills"),
1939
1946
  trigger: promptMentionCommandTriggerSchema
1940
1947
  }),
1941
- z15.object({
1942
- kind: z15.literal("plan"),
1948
+ z16.object({
1949
+ kind: z16.literal("plan"),
1943
1950
  command: providerComposerCommandSchema
1944
1951
  }),
1945
- z15.object({
1946
- kind: z15.literal("goal"),
1952
+ z16.object({
1953
+ kind: z16.literal("goal"),
1947
1954
  command: providerComposerCommandSchema
1948
1955
  })
1949
1956
  ]);
1950
- var providerStringsSchema = z15.object({
1951
- signInHint: z15.string().min(1),
1952
- expiredHint: z15.string().min(1),
1953
- installUrl: z15.string().min(1),
1954
- brandPrefix: z15.string().min(1).optional(),
1955
- planModeCopy: z15.string().min(1).optional(),
1956
- iconTint: z15.object({ light: z15.string().min(1), dark: z15.string().min(1) }).optional()
1957
- });
1958
- var providerOptionDescriptorSchema = z15.object({
1959
- id: z15.string().min(1),
1960
- label: z15.string().min(1),
1961
- description: z15.string().min(1).optional()
1962
- });
1963
- var providerExtensionKindInfoSchema = z15.object({
1964
- item: z15.boolean(),
1965
- state: z15.boolean()
1966
- });
1967
- 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(
1968
1975
  extensionKindSchema,
1969
1976
  providerExtensionKindInfoSchema
1970
1977
  );
1971
- var providerInfoSchema = z15.object({
1972
- id: z15.string(),
1973
- pluginId: z15.string().min(1),
1974
- displayName: z15.string(),
1975
- family: z15.string().min(1).optional(),
1976
- icon: z15.object({ glyph: z15.string().min(1) }).optional(),
1977
- logoUrl: z15.string().min(1).nullable(),
1978
- maintenance: z15.object({
1979
- health: z15.boolean(),
1980
- usage: z15.boolean(),
1981
- 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()
1982
1989
  }),
1983
1990
  capabilities: providerCapabilitiesSchema,
1984
- composerActions: z15.array(providerComposerActionSchema),
1985
- available: z15.boolean(),
1991
+ composerActions: z16.array(providerComposerActionSchema),
1992
+ completedTurnDisplay: completedTurnDisplaySchema,
1993
+ available: z16.boolean(),
1986
1994
  strings: providerStringsSchema.optional(),
1987
- serviceTiers: z15.array(providerOptionDescriptorSchema).optional(),
1988
- reasoningLevels: z15.array(providerOptionDescriptorSchema).optional(),
1995
+ serviceTiers: z16.array(providerOptionDescriptorSchema).optional(),
1996
+ reasoningLevels: z16.array(providerOptionDescriptorSchema).optional(),
1989
1997
  extensionKinds: providerExtensionKindsSchema.optional()
1990
1998
  });
1991
1999
  var providerRecoveryKindValues = [
@@ -1995,151 +2003,151 @@ var providerRecoveryKindValues = [
1995
2003
  "staleTurn",
1996
2004
  "rateLimited"
1997
2005
  ];
1998
- var providerRecoveryKindSchema = z15.enum(providerRecoveryKindValues);
1999
- var toolCallOutputItemSchema = z15.discriminatedUnion("type", [
2000
- z15.object({
2001
- type: z15.literal("inputText"),
2002
- 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()
2003
2011
  }),
2004
- z15.object({
2005
- type: z15.literal("inputImage"),
2006
- imageUrl: z15.string()
2012
+ z16.object({
2013
+ type: z16.literal("inputImage"),
2014
+ imageUrl: z16.string()
2007
2015
  })
2008
2016
  ]);
2009
- var toolCallRequestSchema = z15.object({
2010
- requestId: z15.union([z15.string().min(1), z15.number()]),
2011
- threadId: z15.string().min(1),
2012
- providerThreadId: z15.string().min(1),
2013
- turnId: z15.string().min(1),
2014
- callId: z15.string().min(1),
2015
- tool: z15.string().min(1),
2016
- arguments: z15.unknown().optional()
2017
- });
2018
- var toolCallResponseSchema = z15.object({
2019
- contentItems: z15.array(toolCallOutputItemSchema),
2020
- success: z15.boolean()
2021
- });
2022
- var dynamicToolSchema = z15.object({
2023
- name: z15.string(),
2024
- description: z15.string(),
2025
- 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(),
2026
2034
  presentation: threadEventItemPresentationSchema.optional()
2027
2035
  });
2028
2036
 
2029
2037
  // ../provider-bridge-protocol/src/thread-delta.ts
2030
- import { z as z16 } from "zod";
2038
+ import { z as z17 } from "zod";
2031
2039
  var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
2032
2040
  var deltaPresentationSchema = threadEventItemPresentationSchema;
2033
2041
  var THREAD_DELTA_KEY_SEPARATOR = "";
2034
- 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), {
2035
2043
  message: "provider keys must not contain the internal key separator (\\u001f)"
2036
2044
  });
2037
- var deltaItemKeySchema = z16.object({
2045
+ var deltaItemKeySchema = z17.object({
2038
2046
  providerItemId: deltaKeyPartSchema.optional(),
2039
2047
  channel: deltaKeyPartSchema.optional(),
2040
2048
  parentRef: deltaKeyPartSchema.optional()
2041
2049
  });
2042
2050
  var providerTurnIdSchema = deltaKeyPartSchema;
2043
- var deltaFileChangeSchema = z16.object({
2044
- path: z16.string(),
2045
- kind: z16.enum(["add", "update", "delete"]),
2046
- movePath: z16.string().optional(),
2047
- diff: z16.string().optional(),
2048
- oldText: z16.string().optional(),
2049
- newText: z16.string().optional()
2050
- });
2051
- var deltaBackgroundTaskShapeSchema = z16.object({
2052
- type: z16.literal("backgroundTask"),
2053
- familyId: z16.string().min(1),
2054
- taskType: z16.string(),
2055
- 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(),
2056
2064
  status: threadEventItemStatusSchema,
2057
2065
  taskStatus: backgroundTaskStatusSchema,
2058
- skipTranscript: z16.boolean(),
2059
- workflowName: z16.string().optional(),
2066
+ skipTranscript: z17.boolean(),
2067
+ workflowName: z17.string().optional(),
2060
2068
  workflow: workflowProgressSnapshotSchema.optional(),
2061
2069
  usage: backgroundTaskUsageSchema.optional(),
2062
- summary: z16.string().optional(),
2063
- error: z16.string().optional(),
2064
- outputFile: z16.string().optional()
2070
+ summary: z17.string().optional(),
2071
+ error: z17.string().optional(),
2072
+ outputFile: z17.string().optional()
2065
2073
  });
2066
- var deltaFileReadShapeSchema = z16.object({
2067
- type: z16.literal("fileRead"),
2068
- path: z16.string(),
2069
- cmd: z16.string().optional()
2074
+ var deltaFileReadShapeSchema = z17.object({
2075
+ type: z17.literal("fileRead"),
2076
+ path: z17.string(),
2077
+ cmd: z17.string().optional()
2070
2078
  });
2071
- var deltaSearchShapeSchema = z16.object({
2072
- type: z16.literal("search"),
2079
+ var deltaSearchShapeSchema = z17.object({
2080
+ type: z17.literal("search"),
2073
2081
  mode: threadEventSearchModeSchema,
2074
- query: z16.string(),
2075
- path: z16.string().optional(),
2076
- cmd: z16.string().optional()
2082
+ query: z17.string(),
2083
+ path: z17.string().optional(),
2084
+ cmd: z17.string().optional()
2077
2085
  });
2078
- var deltaDelegationShapeSchema = z16.object({
2079
- type: z16.literal("delegation"),
2086
+ var deltaDelegationShapeSchema = z17.object({
2087
+ type: z17.literal("delegation"),
2080
2088
  childRef: deltaKeyPartSchema,
2081
- label: z16.string(),
2082
- background: z16.boolean(),
2083
- summary: z16.string().optional()
2089
+ label: z17.string(),
2090
+ background: z17.boolean(),
2091
+ summary: z17.string().optional()
2084
2092
  });
2085
- var deltaPlanStepsShapeSchema = z16.object({
2086
- type: z16.literal("planSteps"),
2087
- steps: z16.array(threadEventPlanStepSchema),
2088
- explanation: z16.string().optional()
2093
+ var deltaPlanStepsShapeSchema = z17.object({
2094
+ type: z17.literal("planSteps"),
2095
+ steps: z17.array(threadEventPlanStepSchema),
2096
+ explanation: z17.string().optional()
2089
2097
  });
2090
- var deltaExtensionShapeSchema = z16.object({
2091
- type: z16.literal("extension"),
2098
+ var deltaExtensionShapeSchema = z17.object({
2099
+ type: z17.literal("extension"),
2092
2100
  kind: extensionKindSchema,
2093
2101
  payload: jsonValueSchema
2094
2102
  });
2095
- var deltaItemShapeSchema = z16.discriminatedUnion("type", [
2096
- z16.object({
2097
- type: z16.literal("command"),
2098
- command: z16.string(),
2099
- cwd: z16.string(),
2100
- aggregatedOutput: z16.string().optional(),
2101
- exitCode: z16.number().optional(),
2102
- 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()
2103
2111
  }),
2104
- z16.object({
2105
- type: z16.literal("fileChange"),
2106
- changes: z16.array(deltaFileChangeSchema)
2112
+ z17.object({
2113
+ type: z17.literal("fileChange"),
2114
+ changes: z17.array(deltaFileChangeSchema)
2107
2115
  }),
2108
- z16.object({
2109
- type: z16.literal("tool"),
2110
- tool: z16.string(),
2111
- server: z16.string().optional(),
2112
- args: z16.unknown().optional(),
2113
- result: z16.unknown().optional(),
2114
- error: z16.string().optional(),
2115
- 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()
2116
2124
  }),
2117
- z16.object({ type: z16.literal("compaction") }),
2118
- z16.object({ type: z16.literal("agentMessage"), text: z16.string() }),
2119
- z16.object({
2120
- type: z16.literal("reasoning"),
2121
- summary: z16.array(z16.string()),
2122
- 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())
2123
2131
  }),
2124
- z16.object({ type: z16.literal("plan"), text: z16.string() }),
2125
- z16.object({
2126
- type: z16.literal("webSearch"),
2127
- 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)
2128
2136
  }),
2129
- z16.object({
2130
- type: z16.literal("webFetch"),
2131
- url: z16.string(),
2132
- prompt: z16.string().nullable().optional(),
2133
- 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()
2134
2142
  }),
2135
- z16.object({ type: z16.literal("imageView"), path: z16.string() }),
2136
- z16.object({
2137
- type: z16.literal("imageGeneration"),
2138
- prompt: z16.string().nullable(),
2139
- path: z16.string().nullable(),
2140
- result: z16.string().optional(),
2141
- error: z16.string().nullable(),
2142
- 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()
2143
2151
  }),
2144
2152
  deltaBackgroundTaskShapeSchema,
2145
2153
  deltaFileReadShapeSchema,
@@ -2148,22 +2156,22 @@ var deltaItemShapeSchema = z16.discriminatedUnion("type", [
2148
2156
  deltaPlanStepsShapeSchema,
2149
2157
  deltaExtensionShapeSchema
2150
2158
  ]);
2151
- var deltaProgressSnapshotSchema = z16.discriminatedUnion("type", [
2159
+ var deltaProgressSnapshotSchema = z17.discriminatedUnion("type", [
2152
2160
  deltaBackgroundTaskShapeSchema,
2153
2161
  deltaDelegationShapeSchema
2154
2162
  ]);
2155
- var deltaTextChannelSchema = z16.enum([
2163
+ var deltaTextChannelSchema = z17.enum([
2156
2164
  "agentMessage",
2157
2165
  "reasoningSummary",
2158
2166
  "reasoningText",
2159
2167
  "plan"
2160
2168
  ]);
2161
- var deltaOutputChannelSchema = z16.enum(["command", "fileChange"]);
2162
- var deltaErrorSchema = z16.object({ message: z16.string() });
2163
- var deltaAttachSchema = z16.enum(["open", "currentOrLast"]);
2164
- 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({
2165
2173
  raw: providerRawEventSchema,
2166
- rawType: z16.string()
2174
+ rawType: z17.string()
2167
2175
  });
2168
2176
  function requireExtensionPresentation(delta, ctx) {
2169
2177
  if (delta.item.type === "extension" && delta.presentation === void 0) {
@@ -2174,32 +2182,32 @@ function requireExtensionPresentation(delta, ctx) {
2174
2182
  });
2175
2183
  }
2176
2184
  }
2177
- var threadDeltaSchema = z16.discriminatedUnion("kind", [
2178
- z16.object({
2179
- kind: z16.literal("input.accepted"),
2185
+ var threadDeltaSchema = z17.discriminatedUnion("kind", [
2186
+ z17.object({
2187
+ kind: z17.literal("input.accepted"),
2180
2188
  clientRequestId: clientTurnRequestIdSchema,
2181
2189
  providerTurnId: providerTurnIdSchema.optional()
2182
2190
  }),
2183
- z16.object({
2184
- kind: z16.literal("input.provider"),
2185
- text: z16.string().min(1),
2191
+ z17.object({
2192
+ kind: z17.literal("input.provider"),
2193
+ text: z17.string().min(1),
2186
2194
  parentRef: deltaKeyPartSchema.optional()
2187
2195
  }),
2188
- z16.object({
2189
- kind: z16.literal("turn.open"),
2196
+ z17.object({
2197
+ kind: z17.literal("turn.open"),
2190
2198
  providerTurnId: providerTurnIdSchema.optional(),
2191
2199
  parentRef: deltaKeyPartSchema.optional()
2192
2200
  }),
2193
- z16.object({
2194
- kind: z16.literal("turn.boundary"),
2201
+ z17.object({
2202
+ kind: z17.literal("turn.boundary"),
2195
2203
  status: threadEventTurnStatusSchema,
2196
2204
  error: deltaErrorSchema.optional(),
2197
- providerCheckpointId: z16.string().min(1).optional(),
2198
- claimIfIdle: z16.boolean().optional(),
2205
+ providerCheckpointId: z17.string().min(1).optional(),
2206
+ claimIfIdle: z17.boolean().optional(),
2199
2207
  providerTurnId: providerTurnIdSchema.optional()
2200
2208
  }),
2201
- z16.object({
2202
- kind: z16.literal("item.open"),
2209
+ z17.object({
2210
+ kind: z17.literal("item.open"),
2203
2211
  key: deltaItemKeySchema,
2204
2212
  item: deltaItemShapeSchema,
2205
2213
  presentation: deltaPresentationSchema.optional(),
@@ -2207,140 +2215,140 @@ var threadDeltaSchema = z16.discriminatedUnion("kind", [
2207
2215
  providerTurnId: providerTurnIdSchema.optional(),
2208
2216
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2209
2217
  }).superRefine(requireExtensionPresentation),
2210
- z16.object({
2211
- kind: z16.literal("item.close"),
2218
+ z17.object({
2219
+ kind: z17.literal("item.close"),
2212
2220
  key: deltaItemKeySchema,
2213
2221
  status: threadEventItemStatusSchema,
2214
- resultText: z16.string().optional(),
2215
- exitCode: z16.number().optional(),
2216
- aggregatedOutput: z16.string().optional(),
2217
- 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(),
2218
2226
  item: deltaItemShapeSchema,
2219
2227
  presentation: deltaPresentationSchema.optional(),
2220
2228
  providerTurnId: providerTurnIdSchema.optional(),
2221
2229
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2222
2230
  }).superRefine(requireExtensionPresentation),
2223
- z16.object({
2224
- kind: z16.literal("item.progress"),
2231
+ z17.object({
2232
+ kind: z17.literal("item.progress"),
2225
2233
  key: deltaItemKeySchema,
2226
- message: z16.string().optional(),
2234
+ message: z17.string().optional(),
2227
2235
  snapshot: deltaProgressSnapshotSchema.optional(),
2228
- flush: z16.boolean().optional(),
2236
+ flush: z17.boolean().optional(),
2229
2237
  providerTurnId: providerTurnIdSchema.optional(),
2230
2238
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2231
2239
  }),
2232
- z16.object({
2233
- kind: z16.literal("item.textDelta"),
2240
+ z17.object({
2241
+ kind: z17.literal("item.textDelta"),
2234
2242
  key: deltaItemKeySchema,
2235
2243
  channel: deltaTextChannelSchema,
2236
- text: z16.string(),
2244
+ text: z17.string(),
2237
2245
  providerTurnId: providerTurnIdSchema.optional(),
2238
2246
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2239
2247
  }),
2240
- z16.object({
2241
- kind: z16.literal("item.textClose"),
2248
+ z17.object({
2249
+ kind: z17.literal("item.textClose"),
2242
2250
  key: deltaItemKeySchema,
2243
2251
  channel: deltaTextChannelSchema,
2244
- text: z16.string().optional(),
2252
+ text: z17.string().optional(),
2245
2253
  providerTurnId: providerTurnIdSchema.optional(),
2246
2254
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2247
2255
  }),
2248
- z16.object({
2249
- kind: z16.literal("item.outputDelta"),
2256
+ z17.object({
2257
+ kind: z17.literal("item.outputDelta"),
2250
2258
  key: deltaItemKeySchema,
2251
2259
  channel: deltaOutputChannelSchema,
2252
- text: z16.string(),
2260
+ text: z17.string(),
2253
2261
  providerTurnId: providerTurnIdSchema.optional(),
2254
2262
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2255
2263
  }),
2256
- z16.object({
2257
- kind: z16.literal("command.outputSnapshot"),
2264
+ z17.object({
2265
+ kind: z17.literal("command.outputSnapshot"),
2258
2266
  key: deltaItemKeySchema,
2259
- text: z16.string(),
2267
+ text: z17.string(),
2260
2268
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2261
2269
  }),
2262
- z16.object({
2263
- kind: z16.literal("usage"),
2270
+ z17.object({
2271
+ kind: z17.literal("usage"),
2264
2272
  total: threadEventTokenUsageBreakdownSchema,
2265
2273
  last: threadEventTokenUsageBreakdownSchema,
2266
- modelContextWindow: z16.number().nullable(),
2274
+ modelContextWindow: z17.number().nullable(),
2267
2275
  providerTurnId: providerTurnIdSchema.optional()
2268
2276
  }),
2269
- z16.object({
2270
- kind: z16.literal("contextWindow"),
2277
+ z17.object({
2278
+ kind: z17.literal("contextWindow"),
2271
2279
  snapshot: contextSnapshotSchema.optional(),
2272
- used: z16.number().nullable(),
2273
- size: z16.number().nullable().optional(),
2274
- estimated: z16.boolean(),
2280
+ used: z17.number().nullable(),
2281
+ size: z17.number().nullable().optional(),
2282
+ estimated: z17.boolean(),
2275
2283
  attach: deltaAttachSchema,
2276
2284
  providerTurnId: providerTurnIdSchema.optional()
2277
2285
  }),
2278
- z16.object({
2279
- kind: z16.literal("context.compacted"),
2286
+ z17.object({
2287
+ kind: z17.literal("context.compacted"),
2280
2288
  providerTurnId: providerTurnIdSchema.optional(),
2281
2289
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2282
2290
  }),
2283
- z16.object({ kind: z16.literal("context.cleared") }),
2284
- z16.object({
2285
- kind: z16.literal("turn.diff"),
2286
- diff: z16.string(),
2291
+ z17.object({ kind: z17.literal("context.cleared") }),
2292
+ z17.object({
2293
+ kind: z17.literal("turn.diff"),
2294
+ diff: z17.string(),
2287
2295
  providerTurnId: providerTurnIdSchema.optional()
2288
2296
  }),
2289
- z16.object({ kind: z16.literal("thread.started") }),
2290
- z16.object({
2291
- kind: z16.literal("thread.identity"),
2292
- 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)
2293
2301
  }),
2294
- z16.object({ kind: z16.literal("thread.name"), name: z16.string().min(1) }),
2295
- z16.object({
2296
- 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"),
2297
2305
  extensionKind: extensionKindSchema,
2298
2306
  payload: jsonValueSchema
2299
2307
  }),
2300
- z16.object({
2301
- kind: z16.literal("provider.rateLimits"),
2308
+ z17.object({
2309
+ kind: z17.literal("provider.rateLimits"),
2302
2310
  rateLimits: providerRateLimitStateSchema
2303
2311
  }),
2304
- z16.object({
2305
- kind: z16.literal("provider.error"),
2306
- message: z16.string(),
2307
- detail: z16.string().optional(),
2308
- 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(),
2309
2317
  category: providerErrorCategorySchema.optional(),
2310
2318
  errorInfo: providerErrorInfoSchema.optional(),
2311
- settlesTurn: z16.boolean().optional(),
2319
+ settlesTurn: z17.boolean().optional(),
2312
2320
  providerTurnId: providerTurnIdSchema.optional(),
2313
- threadScoped: z16.boolean().optional()
2321
+ threadScoped: z17.boolean().optional()
2314
2322
  }),
2315
- z16.object({
2316
- kind: z16.literal("provider.modelFallback"),
2317
- originalModel: z16.string().min(1),
2318
- fallbackModel: z16.string().min(1),
2319
- reason: z16.enum(["refusal", "provider"]),
2320
- 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()
2321
2329
  }),
2322
- z16.object({
2323
- kind: z16.literal("provider.warning"),
2324
- summary: z16.string().optional(),
2325
- details: z16.string().optional(),
2330
+ z17.object({
2331
+ kind: z17.literal("provider.warning"),
2332
+ summary: z17.string().optional(),
2333
+ details: z17.string().optional(),
2326
2334
  category: threadEventWarningCategorySchema.optional(),
2327
- vouchedTurn: z16.boolean().optional()
2335
+ vouchedTurn: z17.boolean().optional()
2328
2336
  }),
2329
- z16.object({
2330
- kind: z16.literal("unhandled"),
2337
+ z17.object({
2338
+ kind: z17.literal("unhandled"),
2331
2339
  raw: providerRawEventSchema,
2332
- rawType: z16.string(),
2333
- vouchedTurn: z16.boolean(),
2334
- onlyIfNoTurn: z16.boolean().optional(),
2340
+ rawType: z17.string(),
2341
+ vouchedTurn: z17.boolean(),
2342
+ onlyIfNoTurn: z17.boolean().optional(),
2335
2343
  parentRef: deltaKeyPartSchema.optional(),
2336
2344
  providerTurnId: providerTurnIdSchema.optional()
2337
2345
  }),
2338
- z16.object({ kind: z16.literal("session.ended") }),
2339
- z16.object({ kind: z16.literal("session.reset") })
2346
+ z17.object({ kind: z17.literal("session.ended") }),
2347
+ z17.object({ kind: z17.literal("session.reset") })
2340
2348
  ]);
2341
- var threadDeltaNotificationParamsSchema = z16.object({
2342
- threadId: z16.string().min(1),
2343
- deltas: z16.array(threadDeltaSchema)
2349
+ var threadDeltaNotificationParamsSchema = z17.object({
2350
+ threadId: z17.string().min(1),
2351
+ deltas: z17.array(threadDeltaSchema)
2344
2352
  }).passthrough();
2345
2353
 
2346
2354
  // ../provider-bridge-protocol/src/assembler/delta-assembler.ts
@@ -2351,17 +2359,17 @@ var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
2351
2359
  var THREAD_DELTA_GRAMMAR_V3 = 3;
2352
2360
 
2353
2361
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
2354
- import { z as z18 } from "zod";
2362
+ import { z as z19 } from "zod";
2355
2363
 
2356
2364
  // ../provider-bridge-protocol/src/bridge-kit/tool-arg-schemas.ts
2357
- import { z as z17 } from "zod";
2358
- var bashArgsSchema = z17.object({
2359
- command: z17.string().optional(),
2360
- 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()
2361
2369
  }).passthrough();
2362
- var textBlockSchema = z17.object({
2363
- type: z17.literal("text"),
2364
- text: z17.string()
2370
+ var textBlockSchema = z18.object({
2371
+ type: z18.literal("text"),
2372
+ text: z18.string()
2365
2373
  });
2366
2374
 
2367
2375
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility-helpers.ts
@@ -2370,10 +2378,10 @@ function isRecord(value) {
2370
2378
  }
2371
2379
 
2372
2380
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
2373
- var contentWrapperSchema = z18.object({
2374
- content: z18.array(z18.unknown())
2381
+ var contentWrapperSchema = z19.object({
2382
+ content: z19.array(z19.unknown())
2375
2383
  }).passthrough();
2376
- var shellEnvironmentVariableKeySchema = z18.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
2384
+ var shellEnvironmentVariableKeySchema = z19.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
2377
2385
  var MAX_EXACT_LINE_DIFF_CELLS = 1e6;
2378
2386
  function splitComparableLines(text) {
2379
2387
  const normalized = text.replace(/\r\n?/gu, "\n");
@@ -4220,11 +4228,11 @@ function toConformanceMessages() {
4220
4228
  }
4221
4229
 
4222
4230
  // ../provider-bridge-protocol/src/conformance/client.ts
4223
- import { z as z19 } from "zod";
4231
+ import { z as z20 } from "zod";
4224
4232
  function isWireMessage(value) {
4225
4233
  return typeof value === "object" && value !== null && !Array.isArray(value);
4226
4234
  }
4227
- var threadDeltaAddressSchema = z19.object({ threadId: z19.string() }).passthrough();
4235
+ var threadDeltaAddressSchema = z20.object({ threadId: z20.string() }).passthrough();
4228
4236
  var ConformanceClient = class {
4229
4237
  constructor(transport, timeoutMs, collector) {
4230
4238
  this.transport = transport;
@@ -4333,11 +4341,11 @@ function nextConformanceClientRequestId() {
4333
4341
  }
4334
4342
 
4335
4343
  // ../provider-bridge-protocol/src/conformance/scenarios.ts
4336
- import { z as z27 } from "zod";
4344
+ import { z as z28 } from "zod";
4337
4345
 
4338
4346
  // ../provider-bridge-protocol/src/handshake.ts
4339
- import { z as z20 } from "zod";
4340
- 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, {
4341
4349
  message: "grammarVersions must be an ascending [min, max] range"
4342
4350
  });
4343
4351
  function negotiateGrammarVersion(runtime, bridge) {
@@ -4345,62 +4353,62 @@ function negotiateGrammarVersion(runtime, bridge) {
4345
4353
  const max = Math.min(runtime[1], bridge[1]);
4346
4354
  return min <= max ? max : null;
4347
4355
  }
4348
- var bridgeSteerModeSchema = z20.enum(["inject", "queue"]);
4349
- var bridgeCapabilitiesSchema = z20.object({
4350
- sessionRestore: z20.boolean().default(false),
4351
- threadArchive: z20.boolean().default(false),
4352
- threadRename: z20.boolean().default(false),
4353
- 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),
4354
4362
  fork: providerForkSchema.default("none"),
4355
- approvalEnforcedBy: z20.enum(["runtime", "provider"]).default("runtime"),
4363
+ approvalEnforcedBy: z21.enum(["runtime", "provider"]).default("runtime"),
4356
4364
  grammarVersions: bridgeGrammarVersionsSchema.default([
4357
4365
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4358
4366
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4359
4367
  ]),
4360
4368
  steerMode: bridgeSteerModeSchema.default("queue"),
4361
- skills: z20.object({ configure: z20.boolean().default(false) }).default({ configure: false })
4369
+ skills: z21.object({ configure: z21.boolean().default(false) }).default({ configure: false })
4362
4370
  }).passthrough();
4363
- var initializeParamsSchema = z20.object({
4364
- protocolVersion: z20.number().int().positive(),
4365
- 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) }),
4366
4374
  grammarVersions: bridgeGrammarVersionsSchema.default([
4367
4375
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4368
4376
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4369
4377
  ])
4370
4378
  }).passthrough();
4371
- var initializeResultSchema = z20.object({
4372
- protocolVersion: z20.number().int().positive(),
4373
- capabilities: z20.preprocess(
4379
+ var initializeResultSchema = z21.object({
4380
+ protocolVersion: z21.number().int().positive(),
4381
+ capabilities: z21.preprocess(
4374
4382
  (value) => value ?? {},
4375
4383
  bridgeCapabilitiesSchema
4376
4384
  )
4377
4385
  }).passthrough();
4378
4386
 
4379
4387
  // ../provider-bridge-protocol/src/execution-options.ts
4380
- import { z as z21 } from "zod";
4381
- var bridgeExecutionOptionsSchema = z21.object({
4382
- 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(),
4383
4391
  serviceTier: serviceTierSchema.optional(),
4384
4392
  reasoningLevel: reasoningLevelSchema.optional(),
4385
4393
  promptMode: promptModeSchema.optional(),
4386
- instructions: z21.string().optional(),
4387
- envVars: z21.record(z21.string(), z21.string()).optional(),
4388
- 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()
4389
4397
  }).and(runtimePermissionPolicySchema);
4390
4398
 
4391
4399
  // ../provider-bridge-protocol/src/provider-maintenance.ts
4392
- import { z as z22 } from "zod";
4393
- var providerMaintenanceParamsSchema = z22.object({
4394
- providerId: z22.string().min(1),
4395
- cwd: z22.string().min(1).optional(),
4396
- 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()
4397
4405
  }).passthrough();
4398
- var providerInstallationRequirementSchema = z22.enum(["thread_rewind"]);
4406
+ var providerInstallationRequirementSchema = z23.enum(["thread_rewind"]);
4399
4407
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
4400
4408
  requirement: providerInstallationRequirementSchema.optional()
4401
4409
  });
4402
- var providerHealthSchema = z22.object({
4403
- status: z22.enum([
4410
+ var providerHealthSchema = z23.object({
4411
+ status: z23.enum([
4404
4412
  "ready",
4405
4413
  "not_installed",
4406
4414
  "unauthenticated",
@@ -4408,114 +4416,114 @@ var providerHealthSchema = z22.object({
4408
4416
  "unsupported_version",
4409
4417
  "unknown"
4410
4418
  ]),
4411
- statusMessage: z22.string().min(1).nullable(),
4412
- accountEmail: z22.string().nullable(),
4413
- planLabel: z22.string().min(1).nullable(),
4414
- installedVersion: z22.string().min(1).nullable(),
4415
- minimumSupportedVersion: z22.string().min(1).nullable(),
4416
- canInstall: z22.boolean(),
4417
- canUpdate: z22.boolean(),
4418
- 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()
4419
4427
  }).passthrough();
4420
- var providerUsageWindowSchema = z22.object({
4421
- label: z22.string().min(1),
4422
- usedPercent: z22.number().min(0).max(100),
4423
- resetsAt: z22.string().min(1).nullable(),
4424
- cost: z22.object({
4425
- usedUsdCents: z22.number().int().nonnegative(),
4426
- 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()
4427
4435
  }).optional()
4428
4436
  }).passthrough();
4429
- var providerUsageSchema = z22.discriminatedUnion("status", [
4430
- z22.object({
4431
- status: z22.literal("ok"),
4432
- accountEmail: z22.string().email().nullable(),
4433
- planLabel: z22.string().min(1).nullable(),
4434
- 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)
4435
4443
  }).passthrough(),
4436
- z22.object({ status: z22.literal("not_installed") }).passthrough(),
4437
- z22.object({ status: z22.literal("unauthenticated") }).passthrough(),
4438
- z22.object({ status: z22.literal("expired") }).passthrough(),
4439
- z22.object({
4440
- status: z22.literal("error"),
4441
- message: z22.string().min(1),
4442
- planLabel: z22.string().min(1).nullable().default(null),
4443
- 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)
4444
4452
  }).passthrough()
4445
4453
  ]);
4446
- var providerHealthResultSchema = z22.discriminatedUnion("supported", [
4447
- z22.object({ supported: z22.literal(false) }).passthrough(),
4448
- z22.object({
4449
- 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),
4450
4458
  health: providerHealthSchema
4451
4459
  }).passthrough()
4452
4460
  ]);
4453
- var providerUsageResultSchema = z22.discriminatedUnion("supported", [
4454
- z22.object({ supported: z22.literal(false) }).passthrough(),
4455
- z22.object({
4456
- 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),
4457
4465
  usage: providerUsageSchema
4458
4466
  }).passthrough()
4459
4467
  ]);
4460
- var providerInstallationActionKindSchema = z22.enum([
4468
+ var providerInstallationActionKindSchema = z23.enum([
4461
4469
  "install",
4462
4470
  "update"
4463
4471
  ]);
4464
- var providerInstallationActionSchema = z22.object({
4472
+ var providerInstallationActionSchema = z23.object({
4465
4473
  kind: providerInstallationActionKindSchema,
4466
- label: z22.enum(["Install", "Update"]),
4467
- command: z22.string().min(1)
4474
+ label: z23.enum(["Install", "Update"]),
4475
+ command: z23.string().min(1)
4468
4476
  }).passthrough();
4469
- var providerInstallationSourceSchema = z22.enum([
4477
+ var providerInstallationSourceSchema = z23.enum([
4470
4478
  "notInstalled",
4471
4479
  "npmGlobal",
4472
4480
  "external"
4473
4481
  ]);
4474
- var providerInstallationStatusSchema = z22.object({
4475
- executableName: z22.string().min(1),
4476
- executablePath: z22.string().min(1).nullable(),
4477
- 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(),
4478
4486
  installSource: providerInstallationSourceSchema,
4479
- currentVersion: z22.string().min(1).nullable(),
4480
- latestVersion: z22.string().min(1).nullable(),
4481
- minimumSupportedVersion: z22.string().min(1).nullable(),
4482
- npmPackageName: z22.string().min(1).nullable(),
4483
- 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(),
4484
4492
  installAction: providerInstallationActionSchema.nullable(),
4485
- needsUpdate: z22.boolean(),
4486
- versionUnsupported: z22.boolean()
4493
+ needsUpdate: z23.boolean(),
4494
+ versionUnsupported: z23.boolean()
4487
4495
  }).passthrough();
4488
4496
  var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
4489
4497
  action: providerInstallationActionKindSchema
4490
4498
  });
4491
- var providerInstallationCommandSchema = z22.object({
4492
- command: z22.string().min(1),
4493
- args: z22.array(z22.string()).max(64),
4494
- 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)
4495
4503
  }).passthrough();
4496
- var providerInstallationVerificationSchema = z22.discriminatedUnion(
4504
+ var providerInstallationVerificationSchema = z23.discriminatedUnion(
4497
4505
  "kind",
4498
4506
  [
4499
- z22.object({ kind: z22.literal("installed") }).passthrough(),
4500
- z22.object({
4501
- kind: z22.literal("version_changed"),
4502
- 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)
4503
4511
  }).passthrough(),
4504
- z22.object({
4505
- kind: z22.literal("version_at_least"),
4506
- version: z22.string().min(1)
4512
+ z23.object({
4513
+ kind: z23.literal("version_at_least"),
4514
+ version: z23.string().min(1)
4507
4515
  }).passthrough()
4508
4516
  ]
4509
4517
  );
4510
- var providerInstallationRunResultSchema = z22.discriminatedUnion(
4518
+ var providerInstallationRunResultSchema = z23.discriminatedUnion(
4511
4519
  "available",
4512
4520
  [
4513
- z22.object({
4514
- available: z22.literal(false),
4515
- message: z22.string().min(1)
4521
+ z23.object({
4522
+ available: z23.literal(false),
4523
+ message: z23.string().min(1)
4516
4524
  }).passthrough(),
4517
- z22.object({
4518
- available: z22.literal(true),
4525
+ z23.object({
4526
+ available: z23.literal(true),
4519
4527
  command: providerInstallationCommandSchema,
4520
4528
  verification: providerInstallationVerificationSchema
4521
4529
  }).passthrough()
@@ -4523,7 +4531,7 @@ var providerInstallationRunResultSchema = z22.discriminatedUnion(
4523
4531
  );
4524
4532
 
4525
4533
  // ../provider-bridge-protocol/src/requests.ts
4526
- import { z as z23 } from "zod";
4534
+ import { z as z24 } from "zod";
4527
4535
  var BRIDGE_REQUEST_METHODS = {
4528
4536
  initialize: "initialize",
4529
4537
  modelList: "model/list",
@@ -4545,77 +4553,77 @@ var BRIDGE_REQUEST_METHODS = {
4545
4553
  skillsConfigure: "skills/configure"
4546
4554
  };
4547
4555
  var sessionConstructionFields = {
4548
- threadId: z23.string().min(1),
4549
- cwd: z23.string().min(1),
4556
+ threadId: z24.string().min(1),
4557
+ cwd: z24.string().min(1),
4550
4558
  options: bridgeExecutionOptionsSchema,
4551
- dynamicTools: z23.array(dynamicToolSchema).optional(),
4552
- disallowedTools: z23.array(z23.string().min(1)).optional(),
4559
+ dynamicTools: z24.array(dynamicToolSchema).optional(),
4560
+ disallowedTools: z24.array(z24.string().min(1)).optional(),
4553
4561
  instructionMode: instructionModeSchema
4554
4562
  };
4555
- var modelListParamsSchema = z23.object({ cwd: z23.string().min(1).optional() }).passthrough();
4556
- var threadStartParamsSchema = z23.object({
4563
+ var modelListParamsSchema = z24.object({ cwd: z24.string().min(1).optional() }).passthrough();
4564
+ var threadStartParamsSchema = z24.object({
4557
4565
  ...sessionConstructionFields,
4558
- input: z23.array(promptInputSchema).optional()
4566
+ input: z24.array(promptInputSchema).optional()
4559
4567
  }).passthrough();
4560
- var threadResumeParamsSchema = z23.object({
4568
+ var threadResumeParamsSchema = z24.object({
4561
4569
  ...sessionConstructionFields,
4562
- providerThreadId: z23.string().min(1)
4570
+ providerThreadId: z24.string().min(1)
4563
4571
  }).passthrough();
4564
- var threadForkParamsSchema = z23.object({
4572
+ var threadForkParamsSchema = z24.object({
4565
4573
  ...sessionConstructionFields,
4566
- sourceProviderThreadId: z23.string().min(1),
4567
- sourceProviderCheckpointId: z23.string().min(1).optional()
4574
+ sourceProviderThreadId: z24.string().min(1),
4575
+ sourceProviderCheckpointId: z24.string().min(1).optional()
4568
4576
  }).passthrough();
4569
- var threadStopParamsSchema = z23.object({
4570
- threadId: z23.string().min(1),
4571
- providerThreadId: z23.string().min(1),
4572
- intent: z23.enum(["interrupt", "release"]),
4573
- 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()
4574
4582
  }).passthrough();
4575
- var threadRefParams = z23.object({
4576
- threadId: z23.string().min(1),
4577
- providerThreadId: z23.string().min(1)
4583
+ var threadRefParams = z24.object({
4584
+ threadId: z24.string().min(1),
4585
+ providerThreadId: z24.string().min(1)
4578
4586
  }).passthrough();
4579
- var threadNameSetParamsSchema = z23.object({
4580
- threadId: z23.string().min(1),
4581
- providerThreadId: z23.string().min(1),
4582
- 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)
4583
4591
  }).passthrough();
4584
4592
  var turnInputFields = {
4585
- threadId: z23.string().min(1),
4586
- providerThreadId: z23.string().min(1),
4587
- input: z23.array(promptInputSchema),
4593
+ threadId: z24.string().min(1),
4594
+ providerThreadId: z24.string().min(1),
4595
+ input: z24.array(promptInputSchema),
4588
4596
  clientRequestId: clientTurnRequestIdSchema,
4589
4597
  options: bridgeExecutionOptionsSchema
4590
4598
  };
4591
- var turnStartParamsSchema = z23.object(turnInputFields).passthrough();
4592
- var turnSteerParamsSchema = z23.object({
4599
+ var turnStartParamsSchema = z24.object(turnInputFields).passthrough();
4600
+ var turnSteerParamsSchema = z24.object({
4593
4601
  ...turnInputFields,
4594
- expectedTurnId: z23.string().min(1)
4602
+ expectedTurnId: z24.string().min(1)
4595
4603
  }).passthrough();
4596
- var skillsConfigureRootSchema = z23.object({
4597
- id: z23.string().min(1),
4598
- path: z23.string().min(1),
4599
- skills: z23.array(
4600
- z23.object({
4601
- name: z23.string().min(1),
4602
- 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()
4603
4611
  }).passthrough()
4604
4612
  )
4605
4613
  }).passthrough();
4606
- var skillsConfigureParamsSchema = z23.object({
4607
- roots: z23.array(skillsConfigureRootSchema)
4614
+ var skillsConfigureParamsSchema = z24.object({
4615
+ roots: z24.array(skillsConfigureRootSchema)
4608
4616
  }).passthrough();
4609
- var threadIdentityResultSchema = z23.object({
4610
- providerThreadId: z23.string().min(1),
4611
- sessionRestorable: z23.boolean().optional()
4617
+ var threadIdentityResultSchema = z24.object({
4618
+ providerThreadId: z24.string().min(1),
4619
+ sessionRestorable: z24.boolean().optional()
4612
4620
  }).passthrough();
4613
4621
 
4614
4622
  // ../provider-bridge-protocol/src/notifications.ts
4615
- import { z as z25 } from "zod";
4623
+ import { z as z26 } from "zod";
4616
4624
 
4617
4625
  // ../provider-bridge-protocol/src/errors.ts
4618
- import { z as z24 } from "zod";
4626
+ import { z as z25 } from "zod";
4619
4627
  var BRIDGE_JSON_RPC_ERRORS = {
4620
4628
  INVALID_PARAMS: -32602,
4621
4629
  METHOD_NOT_FOUND: -32601,
@@ -4624,65 +4632,65 @@ var BRIDGE_JSON_RPC_ERRORS = {
4624
4632
  SESSION_NOT_RESTORABLE: -32002,
4625
4633
  FORK_CHECKPOINT_UNSUPPORTED: -32003
4626
4634
  };
4627
- var providerRecoveryHintSchema = z24.object({
4635
+ var providerRecoveryHintSchema = z25.object({
4628
4636
  kind: providerRecoveryKindSchema,
4629
- message: z24.string().min(1),
4630
- retryable: z24.boolean()
4637
+ message: z25.string().min(1),
4638
+ retryable: z25.boolean()
4631
4639
  });
4632
- var bridgeErrorDataSchema = z24.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4640
+ var bridgeErrorDataSchema = z25.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4633
4641
 
4634
4642
  // ../provider-bridge-protocol/src/notifications.ts
4635
- var threadIdentityNotificationSchema = z25.object({
4636
- threadId: z25.string().min(1),
4637
- providerThreadId: z25.string().min(1),
4638
- 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()
4639
4647
  }).passthrough();
4640
- var sessionReplacedNotificationSchema = z25.object({
4641
- threadId: z25.string().min(1),
4642
- providerThreadId: z25.string().min(1).nullable(),
4643
- reason: z25.string().min(1),
4644
- contextLost: z25.boolean().default(false),
4645
- 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)
4646
4654
  }).passthrough();
4647
- var providerRecoveryNotificationSchema = z25.object({
4648
- threadId: z25.string().min(1).optional(),
4655
+ var providerRecoveryNotificationSchema = z26.object({
4656
+ threadId: z26.string().min(1).optional(),
4649
4657
  ...providerRecoveryHintSchema.shape
4650
4658
  }).passthrough();
4651
- var errorNotificationSchema = z25.object({
4652
- threadId: z25.string().min(1).optional(),
4653
- providerThreadId: z25.string().min(1).optional(),
4654
- 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)
4655
4663
  }).passthrough();
4656
4664
 
4657
4665
  // ../provider-bridge-protocol/src/bridge-requests.ts
4658
- import { z as z26 } from "zod";
4659
- var toolCallRequestParamsSchema = z26.object({
4660
- providerThreadId: z26.string().min(1),
4661
- threadId: z26.string().min(1).optional(),
4662
- turnId: z26.union([z26.string().min(1), z26.null()]),
4663
- callId: z26.string().min(1),
4664
- tool: z26.string().min(1),
4665
- arguments: z26.unknown(),
4666
- 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()
4667
4675
  }).passthrough();
4668
- var toolCallResultSchema = z26.object({
4669
- success: z26.boolean(),
4670
- contentItems: z26.array(
4671
- z26.discriminatedUnion("type", [
4672
- z26.object({ type: z26.literal("inputText"), text: z26.string() }),
4673
- z26.object({
4674
- type: z26.literal("inputImage"),
4675
- 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)
4676
4684
  })
4677
4685
  ])
4678
4686
  )
4679
4687
  }).passthrough();
4680
- var interactionRequestParamsSchema = z26.object({
4681
- providerThreadId: z26.string().min(1),
4682
- threadId: z26.string().min(1).optional(),
4683
- 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()]),
4684
4692
  payload: pendingInteractionPayloadSchema,
4685
- providerNativeIds: z26.boolean().optional()
4693
+ providerNativeIds: z27.boolean().optional()
4686
4694
  }).passthrough();
4687
4695
 
4688
4696
  // ../provider-bridge-protocol/src/thread-event-grammar.ts
@@ -4859,7 +4867,7 @@ function threadEvents(context, threadId) {
4859
4867
  context.client.drainIntoLog();
4860
4868
  return context.client.events.filter((entry) => entry.threadId === threadId).map((entry) => entry.event);
4861
4869
  }
4862
- var persistedEventSchema = z27.preprocess(
4870
+ var persistedEventSchema = z28.preprocess(
4863
4871
  (event) => JSON.parse(JSON.stringify(event)),
4864
4872
  threadEventSchema
4865
4873
  );
@@ -5954,26 +5962,26 @@ function formatConformanceReport(report) {
5954
5962
  }
5955
5963
 
5956
5964
  // ../provider-bridge-protocol/src/testing/bridge-json-rpc-test-helpers.ts
5957
- import { z as z28 } from "zod";
5958
- var bridgeJsonRpcValueSchema = z28.lazy(
5959
- () => z28.union([
5960
- z28.string(),
5961
- z28.number(),
5962
- z28.boolean(),
5963
- z28.null(),
5964
- z28.array(bridgeJsonRpcValueSchema),
5965
- 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)
5966
5974
  ])
5967
5975
  );
5968
- var bridgeJsonRpcOutputSchema = z28.object({
5969
- jsonrpc: z28.literal("2.0"),
5970
- id: z28.union([z28.string(), z28.number()]).optional(),
5971
- 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(),
5972
5980
  params: bridgeJsonRpcValueSchema.optional(),
5973
5981
  result: bridgeJsonRpcValueSchema.optional(),
5974
- error: z28.object({
5975
- code: z28.number(),
5976
- message: z28.string(),
5982
+ error: z29.object({
5983
+ code: z29.number(),
5984
+ message: z29.string(),
5977
5985
  data: bridgeJsonRpcValueSchema.optional()
5978
5986
  }).optional()
5979
5987
  });