@get-bb/plugin-sdk 0.4.94 → 0.4.99

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