@spencerboucher/switchyard 0.24.0 → 0.26.0

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.
Files changed (145) hide show
  1. package/README.md +1 -1
  2. package/dist/bridge/enroll.js +12 -3
  3. package/dist/bridge/switchyard-terminal.js +16 -0
  4. package/dist/catalog/worker.js +5937 -0
  5. package/dist/policies/worker.js +962 -953
  6. package/dist/switchyard.mjs +2536 -2494
  7. package/package.json +1 -1
  8. package/web-dist/assets/AutomationView-BdmWs08y.js +2 -0
  9. package/web-dist/assets/{AutomationView-BiSxKpgA.js.map → AutomationView-BdmWs08y.js.map} +1 -1
  10. package/web-dist/assets/{Checkbox-CneW7ZHn.js → Checkbox-9KyxtvcL.js} +2 -2
  11. package/web-dist/assets/{Checkbox-CneW7ZHn.js.map → Checkbox-9KyxtvcL.js.map} +1 -1
  12. package/web-dist/assets/{DangerZone-tpxj5S8V.js → DangerZone-CT2xbMEx.js} +2 -2
  13. package/web-dist/assets/{DangerZone-tpxj5S8V.js.map → DangerZone-CT2xbMEx.js.map} +1 -1
  14. package/web-dist/assets/{Field-0rAadZ7B.js → Field-D4UpWJFx.js} +2 -2
  15. package/web-dist/assets/{Field-0rAadZ7B.js.map → Field-D4UpWJFx.js.map} +1 -1
  16. package/web-dist/assets/{NavigationEditor-DE3vVnHw.js → NavigationEditor-CcxVgkiR.js} +2 -2
  17. package/web-dist/assets/{NavigationEditor-DE3vVnHw.js.map → NavigationEditor-CcxVgkiR.js.map} +1 -1
  18. package/web-dist/assets/{Overlay-kkZVSidv.js → Overlay-Cfm4AZk1.js} +2 -2
  19. package/web-dist/assets/{Overlay-kkZVSidv.js.map → Overlay-Cfm4AZk1.js.map} +1 -1
  20. package/web-dist/assets/{Priority-VTOBYjs9.js → Priority-DBLBg1FP.js} +2 -2
  21. package/web-dist/assets/{Priority-VTOBYjs9.js.map → Priority-DBLBg1FP.js.map} +1 -1
  22. package/web-dist/assets/{RadioCards-Oy23yrpF.js → RadioCards-DoHz_a-g.js} +2 -2
  23. package/web-dist/assets/{RadioCards-Oy23yrpF.js.map → RadioCards-DoHz_a-g.js.map} +1 -1
  24. package/web-dist/assets/{ScopeRepository-BU9I7Gs_.js → ScopeRepository-Cg1lXFrM.js} +3 -3
  25. package/web-dist/assets/{ScopeRepository-BU9I7Gs_.js.map → ScopeRepository-Cg1lXFrM.js.map} +1 -1
  26. package/web-dist/assets/{ScopeSelect-7ZYRzci5.js → ScopeSelect-DkEghnwv.js} +2 -2
  27. package/web-dist/assets/{ScopeSelect-7ZYRzci5.js.map → ScopeSelect-DkEghnwv.js.map} +1 -1
  28. package/web-dist/assets/{SegmentedControl-CCObjCnv.js → SegmentedControl-D6SGXg_K.js} +2 -2
  29. package/web-dist/assets/{SegmentedControl-CCObjCnv.js.map → SegmentedControl-D6SGXg_K.js.map} +1 -1
  30. package/web-dist/assets/{Select-CRC4mF4U.js → Select-D41sYIWt.js} +2 -2
  31. package/web-dist/assets/{Select-CRC4mF4U.js.map → Select-D41sYIWt.js.map} +1 -1
  32. package/web-dist/assets/StructuredValue-aIPp-NIc.js +5 -0
  33. package/web-dist/assets/StructuredValue-aIPp-NIc.js.map +1 -0
  34. package/web-dist/assets/{Switch-llihKH_2.js → Switch-D6hfPoPE.js} +2 -2
  35. package/web-dist/assets/{Switch-llihKH_2.js.map → Switch-D6hfPoPE.js.map} +1 -1
  36. package/web-dist/assets/{Tabs-CIolUgNo.js → Tabs-CRXYaXG7.js} +4 -4
  37. package/web-dist/assets/{Tabs-CIolUgNo.js.map → Tabs-CRXYaXG7.js.map} +1 -1
  38. package/web-dist/assets/TextLink-DWXZwPZa.js +2 -0
  39. package/web-dist/assets/{TextLink-BJlPjvKn.js.map → TextLink-DWXZwPZa.js.map} +1 -1
  40. package/web-dist/assets/{UINodeRenderer-DwZNt-8y.js → UINodeRenderer-BVjIBets.js} +3 -3
  41. package/web-dist/assets/UINodeRenderer-BVjIBets.js.map +1 -0
  42. package/web-dist/assets/{UnfilteredNote-B77oGOcW.js → UnfilteredNote-B7TY047m.js} +2 -2
  43. package/web-dist/assets/{UnfilteredNote-B77oGOcW.js.map → UnfilteredNote-B7TY047m.js.map} +1 -1
  44. package/web-dist/assets/{api-C7CMr6g-.js → api-C_h6nq6d.js} +2 -2
  45. package/web-dist/assets/{api-C7CMr6g-.js.map → api-C_h6nq6d.js.map} +1 -1
  46. package/web-dist/assets/{arrow-down-Bqx9CSB1.js → arrow-down-1LTpTi1H.js} +2 -2
  47. package/web-dist/assets/{arrow-down-Bqx9CSB1.js.map → arrow-down-1LTpTi1H.js.map} +1 -1
  48. package/web-dist/assets/{arrow-up-D0b2fv0Q.js → arrow-up-B4uK6ZGO.js} +2 -2
  49. package/web-dist/assets/{arrow-up-D0b2fv0Q.js.map → arrow-up-B4uK6ZGO.js.map} +1 -1
  50. package/web-dist/assets/attention--3lxyvUR.js +2 -0
  51. package/web-dist/assets/{attention-DMhF0I-p.js.map → attention--3lxyvUR.js.map} +1 -1
  52. package/web-dist/assets/{auth-vd8OFoQx.js → auth-BnOZcMwb.js} +2 -2
  53. package/web-dist/assets/{auth-vd8OFoQx.js.map → auth-BnOZcMwb.js.map} +1 -1
  54. package/web-dist/assets/{automations-Dz_JHvUj.js → automations-D-OXGU7s.js} +2 -2
  55. package/web-dist/assets/{automations-Dz_JHvUj.js.map → automations-D-OXGU7s.js.map} +1 -1
  56. package/web-dist/assets/board-B2hNZFQA.js +6 -0
  57. package/web-dist/assets/board-B2hNZFQA.js.map +1 -0
  58. package/web-dist/assets/{calendar-clock-C5cMYlld.js → calendar-clock-BPYJQFbH.js} +2 -2
  59. package/web-dist/assets/{calendar-clock-C5cMYlld.js.map → calendar-clock-BPYJQFbH.js.map} +1 -1
  60. package/web-dist/assets/chevron-right-CmbmRUFj.js +2 -0
  61. package/web-dist/assets/{chevron-right-5ip-ZfOW.js.map → chevron-right-CmbmRUFj.js.map} +1 -1
  62. package/web-dist/assets/{code-BpPDYwth.js → code-wpUFOdpF.js} +10 -10
  63. package/web-dist/assets/code-wpUFOdpF.js.map +1 -0
  64. package/web-dist/assets/{core.esm-C_QgTrGe.js → core.esm-kWS8EOvg.js} +2 -2
  65. package/web-dist/assets/{core.esm-C_QgTrGe.js.map → core.esm-kWS8EOvg.js.map} +1 -1
  66. package/web-dist/assets/{describe-Bd1JbydU.js → describe-C6HLxXjb.js} +3 -3
  67. package/web-dist/assets/{describe-Bd1JbydU.js.map → describe-C6HLxXjb.js.map} +1 -1
  68. package/web-dist/assets/{enroll-B_ZjVnEj.js → enroll-ErV_s7ej.js} +2 -2
  69. package/web-dist/assets/{enroll-B_ZjVnEj.js.map → enroll-ErV_s7ej.js.map} +1 -1
  70. package/web-dist/assets/{external-link-DeLk0jmb.js → external-link-fqMZHNsZ.js} +2 -2
  71. package/web-dist/assets/{external-link-DeLk0jmb.js.map → external-link-fqMZHNsZ.js.map} +1 -1
  72. package/web-dist/assets/{git-branch-DuApoZes.js → git-branch-Bss2qoIr.js} +2 -2
  73. package/web-dist/assets/{git-branch-DuApoZes.js.map → git-branch-Bss2qoIr.js.map} +1 -1
  74. package/web-dist/assets/{grip-vertical-DfKSP8jp.js → grip-vertical-DiopZ2MX.js} +2 -2
  75. package/web-dist/assets/{grip-vertical-DfKSP8jp.js.map → grip-vertical-DiopZ2MX.js.map} +1 -1
  76. package/web-dist/assets/{hand-ryhCgGbh.js → hand-fz9o4rRo.js} +2 -2
  77. package/web-dist/assets/{hand-ryhCgGbh.js.map → hand-fz9o4rRo.js.map} +1 -1
  78. package/web-dist/assets/index-BHIBqflQ.js +17 -0
  79. package/web-dist/assets/{index-BXoBPAUR.js.map → index-BHIBqflQ.js.map} +1 -1
  80. package/web-dist/assets/index-CJ9yttLk.css +2 -0
  81. package/web-dist/assets/{link-2-pHvZvxCs.js → link-2-CM14Jk-Z.js} +2 -2
  82. package/web-dist/assets/{link-2-pHvZvxCs.js.map → link-2-CM14Jk-Z.js.map} +1 -1
  83. package/web-dist/assets/{logic-3so3T0af.js → logic-C4E3wcuR.js} +3 -3
  84. package/web-dist/assets/{logic-3so3T0af.js.map → logic-C4E3wcuR.js.map} +1 -1
  85. package/web-dist/assets/{logic-uhnfzaYJ.js → logic-CxNUn_Si.js} +2 -2
  86. package/web-dist/assets/{logic-uhnfzaYJ.js.map → logic-CxNUn_Si.js.map} +1 -1
  87. package/web-dist/assets/{more-C41VHBVG.js → more-DPa20EIw.js} +2 -2
  88. package/web-dist/assets/{more-C41VHBVG.js.map → more-DPa20EIw.js.map} +1 -1
  89. package/web-dist/assets/{pencil-BoQa6LEV.js → pencil-C7o6vJgq.js} +2 -2
  90. package/web-dist/assets/{pencil-BoQa6LEV.js.map → pencil-C7o6vJgq.js.map} +1 -1
  91. package/web-dist/assets/{play-DjTVY8Ej.js → play-CFs0JI3B.js} +2 -2
  92. package/web-dist/assets/{play-DjTVY8Ej.js.map → play-CFs0JI3B.js.map} +1 -1
  93. package/web-dist/assets/{plus-BQPgQYui.js → plus-DEaNWSMA.js} +2 -2
  94. package/web-dist/assets/{plus-BQPgQYui.js.map → plus-DEaNWSMA.js.map} +1 -1
  95. package/web-dist/assets/{policyLogic-cyMrhCM6.js → policyLogic-1QWs7S1X.js} +2 -2
  96. package/web-dist/assets/{policyLogic-cyMrhCM6.js.map → policyLogic-1QWs7S1X.js.map} +1 -1
  97. package/web-dist/assets/{prefs-CkiUftvR.js → prefs-C0L6OJW2.js} +2 -2
  98. package/web-dist/assets/{prefs-CkiUftvR.js.map → prefs-C0L6OJW2.js.map} +1 -1
  99. package/web-dist/assets/preload-helper-B7-Z6Kuc.js +9 -0
  100. package/web-dist/assets/preload-helper-B7-Z6Kuc.js.map +1 -0
  101. package/web-dist/assets/queue-BGH7kGf3.js +2 -0
  102. package/web-dist/assets/{queue-CSCmR2Xf.js.map → queue-BGH7kGf3.js.map} +1 -1
  103. package/web-dist/assets/{rotate-ccw-C07CP9JG.js → rotate-ccw-7XsjGljp.js} +2 -2
  104. package/web-dist/assets/{rotate-ccw-C07CP9JG.js.map → rotate-ccw-7XsjGljp.js.map} +1 -1
  105. package/web-dist/assets/{search-bqDM8qB0.js → search-cJqErX2K.js} +2 -2
  106. package/web-dist/assets/{search-bqDM8qB0.js.map → search-cJqErX2K.js.map} +1 -1
  107. package/web-dist/assets/settings-BWvrxYxe.js +6 -0
  108. package/web-dist/assets/settings-BWvrxYxe.js.map +1 -0
  109. package/web-dist/assets/{states-goHGz_CJ.js → states-BtAXMBKP.js} +5 -5
  110. package/web-dist/assets/states-BtAXMBKP.js.map +1 -0
  111. package/web-dist/assets/{terminal-BFJK8pLS.js → terminal-CMO1fwr6.js} +2 -2
  112. package/web-dist/assets/{terminal-BFJK8pLS.js.map → terminal-CMO1fwr6.js.map} +1 -1
  113. package/web-dist/assets/{terminal-login-DwI8gUw-.js → terminal-login-B4ilxY0w.js} +2 -2
  114. package/web-dist/assets/{terminal-login-DwI8gUw-.js.map → terminal-login-B4ilxY0w.js.map} +1 -1
  115. package/web-dist/assets/{useBreakpoint-C7ONetzK.js → useBreakpoint-DQmHoUda.js} +2 -2
  116. package/web-dist/assets/{useBreakpoint-C7ONetzK.js.map → useBreakpoint-DQmHoUda.js.map} +1 -1
  117. package/web-dist/assets/{useNow-BFhACgmu.js → useNow-DAkRYkgZ.js} +2 -2
  118. package/web-dist/assets/{useNow-BFhACgmu.js.map → useNow-DAkRYkgZ.js.map} +1 -1
  119. package/web-dist/assets/{useResource-Br3v4Sui.js → useResource-BYljUzPs.js} +2 -2
  120. package/web-dist/assets/{useResource-Br3v4Sui.js.map → useResource-BYljUzPs.js.map} +1 -1
  121. package/web-dist/assets/{useSwipeTabs-_JvGirwa.js → useSwipeTabs-DEx87Ogc.js} +2 -2
  122. package/web-dist/assets/{useSwipeTabs-_JvGirwa.js.map → useSwipeTabs-DEx87Ogc.js.map} +1 -1
  123. package/web-dist/assets/workboard-6c73HyIJ.js +3 -0
  124. package/web-dist/assets/{workboard-IozvaLbf.js.map → workboard-6c73HyIJ.js.map} +1 -1
  125. package/web-dist/index.html +8 -8
  126. package/web-dist/sw.js +1 -1
  127. package/web-dist/assets/AutomationView-BiSxKpgA.js +0 -2
  128. package/web-dist/assets/StructuredValue-DdwqFsZd.js +0 -5
  129. package/web-dist/assets/StructuredValue-DdwqFsZd.js.map +0 -1
  130. package/web-dist/assets/TextLink-BJlPjvKn.js +0 -2
  131. package/web-dist/assets/UINodeRenderer-DwZNt-8y.js.map +0 -1
  132. package/web-dist/assets/attention-DMhF0I-p.js +0 -2
  133. package/web-dist/assets/board-CMfIsKrb.js +0 -6
  134. package/web-dist/assets/board-CMfIsKrb.js.map +0 -1
  135. package/web-dist/assets/chevron-right-5ip-ZfOW.js +0 -2
  136. package/web-dist/assets/code-BpPDYwth.js.map +0 -1
  137. package/web-dist/assets/index-BXoBPAUR.js +0 -17
  138. package/web-dist/assets/index-Bm6tklht.css +0 -2
  139. package/web-dist/assets/preload-helper-B_HW6k8N.js +0 -9
  140. package/web-dist/assets/preload-helper-B_HW6k8N.js.map +0 -1
  141. package/web-dist/assets/queue-CSCmR2Xf.js +0 -2
  142. package/web-dist/assets/settings-iTwK6CzQ.js +0 -6
  143. package/web-dist/assets/settings-iTwK6CzQ.js.map +0 -1
  144. package/web-dist/assets/states-goHGz_CJ.js.map +0 -1
  145. package/web-dist/assets/workboard-IozvaLbf.js +0 -3
@@ -162,10 +162,14 @@ var UINodeSchema = z2.lazy(() => z2.discriminatedUnion("t", [
162
162
  }),
163
163
  z2.object({
164
164
  t: z2.literal("actions"),
165
+ label: z2.string().min(1).max(80).optional(),
166
+ layout: z2.enum(["row", "segmented"]).optional(),
165
167
  actions: z2.array(z2.object({
166
168
  id: z2.string(),
167
169
  label: z2.string(),
168
- tone: z2.enum(["default", "primary", "danger"]).optional()
170
+ tone: z2.enum(["default", "primary", "danger"]).optional(),
171
+ active: z2.boolean().optional(),
172
+ disabled: z2.boolean().optional()
169
173
  }))
170
174
  }),
171
175
  z2.object({
@@ -243,6 +247,8 @@ var ContributionPlacement = z3.enum([
243
247
  "composer.pill",
244
248
  /** `adapter.trackers.v1`: a live summary above the input that opens its detail. */
245
249
  "composer.tracker",
250
+ /** `composer.suggestions.v1`: an editable next-prompt or command suggestion in the composer. */
251
+ "composer.suggestion",
246
252
  /** `adapter.trackers.v1`: a short word on the session's navigator row. */
247
253
  "session.badge",
248
254
  "palette.item",
@@ -258,11 +264,18 @@ var TrackerSummary = z3.object({
258
264
  /** The step in progress, such as the current todo. */
259
265
  step: z3.string().min(1).max(120).optional()
260
266
  }).strict();
267
+ var ComposerSuggestion = z3.object({
268
+ /** Exact text inserted into the composer when accepted (never auto-sent). */
269
+ text: z3.string().min(1).max(4e3),
270
+ /** Presentation hint (default "prompt"). */
271
+ kind: z3.enum(["prompt", "command"]).optional()
272
+ }).strict();
261
273
  var Common = {
262
274
  placement: ContributionPlacement,
263
275
  order: z3.number().int().min(-1e3).max(1e3).optional(),
264
276
  actionId: ActionId.optional(),
265
- tracker: TrackerSummary.optional()
277
+ tracker: TrackerSummary.optional(),
278
+ suggestion: ComposerSuggestion.optional()
266
279
  };
267
280
  var ContributionDescriptor = z3.object({
268
281
  id: Id,
@@ -291,6 +304,12 @@ var ContributionDescriptor = z3.object({
291
304
  if (v.placement !== "composer.tracker" && v.tracker !== void 0) {
292
305
  ctx.addIssue({ code: "custom", message: "Only composer trackers have a tracker summary" });
293
306
  }
307
+ if (v.placement === "composer.suggestion" && !v.suggestion) {
308
+ ctx.addIssue({ code: "custom", message: "Composer suggestions require a suggestion" });
309
+ }
310
+ if (v.placement !== "composer.suggestion" && v.suggestion !== void 0) {
311
+ ctx.addIssue({ code: "custom", message: "Only composer suggestions have a suggestion" });
312
+ }
294
313
  });
295
314
  var ContributionInput = z3.object({
296
315
  ...Common,
@@ -378,6 +397,9 @@ function validateContribution(id, input) {
378
397
  if (descriptor.placement === "composer.pill" && node.t !== "text" && node.t !== "progress") {
379
398
  throw new Error("Composer pill content must be text or progress");
380
399
  }
400
+ if (descriptor.placement === "composer.suggestion" && node.t !== "text" && node.t !== "code") {
401
+ throw new Error("Composer suggestion content must be text or code");
402
+ }
381
403
  if (descriptor.placement === "session.badge") {
382
404
  if (node.t !== "text" && node.t !== "badge") {
383
405
  throw new Error("Session badge content must be text or a badge");
@@ -434,30 +456,42 @@ var displayUrl = z4.string().max(4096).refine((s) => {
434
456
  return false;
435
457
  }
436
458
  });
459
+ var AUTHORITY_RE = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/;
460
+ var GitAuthority = z4.string().trim().transform((s) => s.toLowerCase()).refine((s) => s.length <= 253 && AUTHORITY_RE.test(s) && !/^\d+(?:\.\d+)*$/.test(s), {
461
+ message: "Invalid Git authority hostname"
462
+ });
437
463
  var githubUrl = displayUrl.refine((s) => {
438
464
  try {
439
465
  const u = new URL(s);
440
- return u.protocol === "https:" && u.hostname === "github.com" && !u.port && /^https:\/\/github\.com(?:[/?#]|$)/i.test(s);
466
+ return u.protocol === "https:" && !u.port && /^https:\/\/[^/:?#]+(?:[/?#]|$)/i.test(s) && GitAuthority.safeParse(u.hostname).success;
441
467
  } catch {
442
468
  return false;
443
469
  }
444
470
  });
445
471
  var GitHubRepository = z4.string().regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?\/(?!\.{1,2}$)[A-Za-z0-9_.-]{1,100}$/);
446
- var issuePath = /^[hH][tT][tT][pP][sS]:\/\/[gG][iI][tT][hH][uU][bB]\.[cC][oO][mM]\/([^/]+)\/([^/]+)\/issues\/([1-9][0-9]*)$/;
472
+ var issuePath = /^[hH][tT][tT][pP][sS]:\/\/([^/:?#]+)\/([^/]+)\/([^/]+)\/issues\/([1-9][0-9]*)$/;
447
473
  var GitHubIssueUrl = z4.string().trim().transform((raw, ctx) => {
448
474
  const match = issuePath.exec(raw);
449
- const number = match ? Number(match[3]) : NaN;
450
- if (!match || !GitHubRepository.safeParse(`${match[1]}/${match[2]}`).success || !Number.isSafeInteger(number)) {
475
+ const authority = match ? GitAuthority.safeParse(match[1]) : null;
476
+ const number = match ? Number(match[4]) : NaN;
477
+ if (!match || !authority?.success || authority.data === "www.github.com" || !GitHubRepository.safeParse(`${match[2]}/${match[3]}`).success || !Number.isSafeInteger(number)) {
451
478
  ctx.addIssue({ code: "custom", message: "Invalid GitHub issue URL" });
452
479
  return z4.NEVER;
453
480
  }
454
- return `https://github.com/${match[1]}/${match[2]}/issues/${number}`;
481
+ return `https://${authority.data}/${match[2]}/${match[3]}/issues/${number}`;
455
482
  });
456
483
  function issueParts(url) {
457
484
  const match = issuePath.exec(url);
458
- return { repository: `${match[1]}/${match[2]}`, number: Number(match[3]) };
485
+ return {
486
+ authority: match[1].toLowerCase(),
487
+ repository: `${match[2]}/${match[3]}`,
488
+ number: Number(match[4])
489
+ };
459
490
  }
460
491
  function issuePrompt(url) {
492
+ return `Work on GitHub issue ${url}.`;
493
+ }
494
+ function legacyGhIssuePrompt(url) {
461
495
  return `${url}
462
496
 
463
497
  Read it with \`gh issue view ${url}\`.`;
@@ -477,11 +511,12 @@ var GitHubIssue = z4.object({
477
511
  launchPrompt: z4.string()
478
512
  }).strict().refine((v) => {
479
513
  const parts = issueParts(v.url);
480
- return v.repository === parts.repository && v.number === parts.number && v.launchPrompt === issuePrompt(v.url);
514
+ return v.repository === parts.repository && v.number === parts.number && (v.launchPrompt === issuePrompt(v.url) || v.launchPrompt === legacyGhIssuePrompt(v.url));
481
515
  });
482
516
  function githubIssueFromUrl(raw) {
483
517
  const url = GitHubIssueUrl.parse(raw);
484
- return { ...issueParts(url), url, launchPrompt: issuePrompt(url) };
518
+ const { repository, number } = issueParts(url);
519
+ return { repository, number, url, launchPrompt: issuePrompt(url) };
485
520
  }
486
521
  var GitHubSha = z4.string().regex(/^[0-9a-f]{40}$/);
487
522
  var prUrl = githubUrl.refine((s) => {
@@ -722,7 +757,7 @@ var GitHubSource = z5.object({
722
757
  /** Make a worktree for an issue branch that has none; absent means true. */
723
758
  worktrees: z5.boolean().optional(),
724
759
  enabled: z5.boolean(),
725
- /** The host's `gh` user, from the last sync. */
760
+ /** The connected GitHub account login, from the last sync. */
726
761
  login: z5.string().nullable(),
727
762
  lastSyncedAt: Iso.nullable(),
728
763
  lastError: z5.string().max(2e3).nullable()
@@ -2244,759 +2279,253 @@ var AgentResultFrame = z11.discriminatedUnion("ok", [
2244
2279
  ]);
2245
2280
 
2246
2281
  // packages/protocol/dist/api.js
2247
- import { z as z15 } from "zod";
2248
-
2249
- // packages/protocol/dist/host-wire.js
2250
- import { z as z14 } from "zod";
2251
-
2252
- // packages/protocol/dist/events.js
2253
2282
  import { z as z12 } from "zod";
2254
- var EventDataSchemas = {
2255
- "host.updated": Host,
2256
- "project.updated": Project,
2257
- "project.deleted": z12.object({ id: z12.string() }),
2258
- "checkout.updated": Checkout,
2259
- "workspace.updated": Workspace,
2260
- "workspace.deleted": z12.object({ id: z12.string() }),
2261
- "profile.updated": Profile,
2262
- "profile.deleted": z12.object({ id: z12.string() }),
2263
- "scope.updated": Scope,
2264
- "scope.deleted": z12.object({ id: z12.string() }),
2265
- "session.updated": Session,
2266
- "transcript.item": TranscriptItem,
2267
- "transcript.reset": z12.object({ sessionId: z12.string(), epoch: z12.number().int() }),
2268
- "interaction.updated": Interaction,
2269
- "panel.updated": Panel,
2270
- "adapters.updated": z12.object({ hostId: z12.string(), adapters: z12.array(AdapterInfo) }),
2271
- diagnostic: Diagnostic,
2272
- "task.updated": Task,
2273
- "task.deleted": z12.object({ id: z12.string() }),
2274
- "run.updated": Run,
2275
- "automation.updated": Automation,
2276
- "automation.deleted": z12.object({ id: z12.string() }),
2277
- "occurrence.created": Occurrence,
2278
- "occurrence.updated": Occurrence,
2279
- "attention.updated": AttentionItem,
2280
- "device.updated": Device,
2281
- "issue.updated": TrackedIssue,
2282
- "issue.deleted": z12.object({ id: z12.string() }),
2283
- "client.updated": Client,
2284
- "client.deleted": z12.object({ id: z12.string() }),
2285
- "settings.updated": z12.object({ dispatchPaused: z12.boolean() })
2286
- };
2287
- var EVENT_TYPES = Object.keys(EventDataSchemas);
2288
- var LEGACY_EVENT_TYPES = {
2289
- "workspace.removed": "workspace.deleted"
2290
- };
2291
- function canonicalEventType(type) {
2292
- return LEGACY_EVENT_TYPES[type] ?? type;
2293
- }
2294
- var canonical = (v) => typeof v === "string" ? canonicalEventType(v) : v;
2295
- var EventTypeSchema = z12.preprocess(canonical, z12.enum(EVENT_TYPES));
2296
- var EventScope = z12.object({
2297
- hostId: z12.string().optional(),
2298
- sessionId: z12.string().optional(),
2299
- taskId: z12.string().optional(),
2300
- projectId: z12.string().optional()
2301
- });
2302
- var EventEnvelope = EventScope.extend({
2303
- seq: z12.number().int(),
2304
- id: z12.string(),
2305
- type: EventTypeSchema,
2306
- at: z12.string(),
2307
- data: z12.unknown()
2308
- });
2309
- var HOST_EVENT_TYPES = [
2310
- "session.updated",
2311
- "transcript.item",
2312
- "interaction.updated",
2313
- "panel.updated",
2314
- "adapters.updated",
2315
- "diagnostic",
2316
- "workspace.updated",
2317
- "workspace.deleted"
2318
- ];
2319
- var HostEvent = EventScope.extend({
2320
- eventId: z12.string(),
2321
- type: z12.preprocess(canonical, z12.enum(HOST_EVENT_TYPES)),
2322
- at: z12.string(),
2323
- data: z12.unknown()
2324
- });
2325
- var StreamDelta = z12.object({
2326
- sessionId: z12.string(),
2327
- itemId: z12.string(),
2328
- kind: z12.enum(["text", "thinking", "tool_args", "tool_output"]),
2329
- delta: z12.string(),
2330
- order: z12.number().int().optional()
2331
- });
2332
-
2333
- // packages/protocol/dist/terminal-wire.js
2334
- import { z as z13 } from "zod";
2335
- var Cols = z13.number().int().min(10).max(1e3);
2336
- var Rows = z13.number().int().min(5).max(500);
2337
- var TermViewerToServer = z13.discriminatedUnion("t", [
2338
- z13.object({ t: z13.literal("in"), d: z13.string() }),
2339
- z13.object({ t: z13.literal("resize"), cols: Cols, rows: Rows }),
2340
- z13.object({ t: z13.literal("claim") })
2341
- ]);
2342
- var TermServerToViewer = z13.discriminatedUnion("t", [
2343
- z13.object({ t: z13.literal("out"), d: z13.string() }),
2344
- z13.object({ t: z13.literal("closed"), reason: z13.string() }),
2345
- z13.object({ t: z13.literal("size"), cols: Cols, rows: Rows, owner: z13.boolean() })
2346
- ]);
2347
- var TermCoordinatorMsg = z13.discriminatedUnion("t", [
2348
- z13.object({
2349
- t: z13.literal("open"),
2350
- sessionId: z13.string(),
2351
- cols: Cols,
2352
- rows: Rows,
2353
- passive: z13.boolean().optional()
2354
- }),
2355
- z13.object({ t: z13.literal("claim") }),
2356
- z13.object({ t: z13.literal("in"), d: z13.string() }),
2357
- z13.object({ t: z13.literal("resize"), cols: Cols, rows: Rows }),
2358
- z13.object({ t: z13.literal("close") })
2359
- ]);
2360
-
2361
- // packages/protocol/dist/host-wire.js
2362
- var Origin = z14.enum(["human", "automation"]);
2363
- var DiffRev = z14.string().regex(/^(uncommitted|[0-9a-f]{40})$/);
2364
- var HostCommand = z14.discriminatedUnion("type", [
2365
- z14.object({
2366
- type: z14.literal("session.start"),
2367
- sessionId: z14.string(),
2368
- title: z14.string(),
2369
- workspacePath: z14.string(),
2370
- projectId: z14.string().nullable(),
2371
- profile: Profile,
2372
- nativeHandle: NativeHandle.nullable(),
2373
- initialPrompt: z14.string().nullable(),
2374
- dispatchKey: z14.string().nullable(),
2375
- controlRevision: z14.number().int(),
2376
- controlMode: ControlMode,
2377
- origin: Origin,
2378
- readOnly: z14.boolean().default(false),
2379
- policyRequired: z14.boolean().optional()
2380
- }),
2381
- z14.object({
2382
- type: z14.literal("session.deliverMessage"),
2383
- sessionId: z14.string(),
2384
- messageId: z14.string(),
2385
- payload: z14.object({
2386
- deliveryId: z14.string(),
2387
- kind: z14.enum(["message", "completion"]),
2388
- text: z14.string()
2389
- }),
2390
- mode: z14.enum(["steer", "queue"]),
2391
- holdUntil: z14.string()
2392
- }),
2393
- HostPolicySampleRequest.extend({ type: z14.literal("session.classifyPolicySample") }),
2394
- z14.object({
2395
- type: z14.literal("session.messageStatus"),
2396
- sessionId: z14.string(),
2397
- messageIds: z14.array(z14.string().min(1)).min(1).max(100)
2398
- }),
2399
- z14.object({
2400
- type: z14.literal("session.prompt"),
2401
- sessionId: z14.string(),
2402
- text: z14.string(),
2403
- images: z14.array(z14.object({ mimeType: z14.string(), data: z14.string() })).default([]),
2404
- mode: z14.enum(["prompt", "steer", "followUp"]),
2405
- origin: Origin,
2406
- controlRevision: z14.number().int()
2407
- }),
2408
- z14.object({ type: z14.literal("session.abort"), sessionId: z14.string(), clearQueue: z14.boolean() }),
2409
- /** `queueClear.v1`: empty Pi's queue without aborting; the receipt's result has the messages. */
2410
- z14.object({ type: z14.literal("session.clearQueue"), sessionId: z14.string() }),
2411
- z14.object({ type: z14.literal("session.stop"), sessionId: z14.string() }),
2412
- z14.object({
2413
- type: z14.literal("session.answer"),
2414
- sessionId: z14.string(),
2415
- interactionId: z14.string(),
2416
- revision: z14.number().int(),
2417
- response: InteractionResponseSchema,
2418
- deviceId: z14.string()
2419
- }),
2420
- z14.object({
2421
- type: z14.literal("session.adapterAction"),
2422
- sessionId: z14.string(),
2423
- generation: z14.string().uuid().optional(),
2424
- adapterId: z14.string(),
2425
- actionId: z14.string(),
2426
- payload: z14.unknown()
2427
- }),
2428
- z14.object({
2429
- type: z14.literal("session.setControl"),
2430
- sessionId: z14.string(),
2431
- controlRevision: z14.number().int(),
2432
- mode: ControlMode
2433
- }),
2434
- z14.object({ type: z14.literal("session.rename"), sessionId: z14.string(), title: z14.string() }),
2435
- z14.object({ type: z14.literal("session.importable") }),
2436
- z14.object({ type: z14.literal("session.readNative"), sessionFile: z14.string() }),
2437
- z14.object({ type: z14.literal("session.snapshot"), sessionId: z14.string() }),
2438
- z14.object({ type: z14.literal("session.models"), sessionId: z14.string() }),
2439
- z14.object({ type: z14.literal("session.commands"), sessionId: z14.string() }),
2440
- z14.object({
2441
- type: z14.literal("session.complete"),
2442
- sessionId: z14.string(),
2443
- text: z14.string().max(500)
2444
- }),
2445
- z14.object({ type: z14.literal("session.tree"), sessionId: z14.string() }),
2446
- z14.object({
2447
- type: z14.literal("session.branch"),
2448
- sessionId: z14.string(),
2449
- entryId: z14.string().nullable(),
2450
- fork: z14.boolean()
2451
- }),
2452
- z14.object({
2453
- type: z14.literal("session.navigate"),
2454
- sessionId: z14.string(),
2455
- entryId: z14.string(),
2456
- summarize: z14.boolean(),
2457
- instructions: z14.string().max(2e3).nullable()
2458
- }),
2459
- z14.object({ type: z14.literal("session.reload"), sessionId: z14.string() }),
2460
- z14.object({ type: z14.literal("session.adapters"), sessionId: z14.string() }),
2461
- z14.object({ type: z14.literal("session.reloadAdapters"), sessionId: z14.string() }),
2462
- z14.object({ type: z14.literal("session.export"), sessionId: z14.string() }),
2463
- z14.object({
2464
- type: z14.literal("session.setModel"),
2465
- sessionId: z14.string(),
2466
- provider: z14.string().min(1),
2467
- modelId: z14.string().min(1)
2468
- }),
2469
- z14.object({ type: z14.literal("session.setThinking"), sessionId: z14.string(), level: ThinkingLevel }),
2470
- z14.object({
2471
- type: z14.literal("session.compact"),
2472
- sessionId: z14.string(),
2473
- instructions: z14.string().nullable()
2474
- }),
2475
- z14.object({ type: z14.literal("checkout.inspect"), path: z14.string() }),
2476
- z14.strictObject({
2477
- type: z14.literal("checkout.preview"),
2478
- root: z14.string().min(1).max(4096),
2479
- folderName: z14.string().min(1).max(128)
2480
- }),
2481
- z14.strictObject({
2482
- type: z14.literal("checkout.provision"),
2483
- root: z14.string().min(1).max(4096),
2484
- folderName: z14.string().min(1).max(128),
2485
- expectedPath: z14.string().min(1).max(4096),
2486
- cloneUrl: z14.string().min(1).max(4096),
2487
- /** Only carried by a confirmed live command. Never persist or replay this payload. */
2488
- grant: z14.strictObject({
2489
- token: z14.string().min(1).max(4096).refine((token) => !/[^!-~]/.test(token)),
2490
- expiresAt: z14.iso.datetime({ offset: true })
2491
- })
2492
- }),
2493
- z14.strictObject({ type: z14.literal("checkout.locate"), cwd: z14.string().min(1).max(4096) }),
2494
- z14.object({ type: z14.literal("projects.scan"), folder: z14.string().min(1) }),
2495
- z14.object({
2496
- type: z14.literal("projects.suggest"),
2497
- days: z14.number().int().min(1).max(365).default(30)
2498
- }),
2499
- z14.object({
2500
- type: z14.literal("workspace.discover"),
2501
- checkoutPath: z14.string(),
2502
- worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
2503
- }),
2504
- z14.object({
2505
- type: z14.literal("workspace.create"),
2506
- checkoutPath: z14.string(),
2507
- branch: z14.string(),
2508
- base: z14.string(),
2509
- setupCommand: z14.string().nullable(),
2510
- worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
2511
- }),
2512
- z14.object({ type: z14.literal("workspace.status"), path: z14.string(), base: z14.string().nullable() }),
2513
- z14.object({
2514
- type: z14.literal("workspace.remove"),
2515
- path: z14.string(),
2516
- checkoutPath: z14.string(),
2517
- base: z14.string().nullable(),
2518
- force: z14.object({ dirty: z14.boolean(), unmerged: z14.boolean() }),
2519
- /** Also delete the worktree's local branch (hosts before GitHub issue sync ignore it). */
2520
- deleteBranch: z14.boolean().optional()
2521
- }),
2522
- z14.object({
2523
- type: z14.literal("workspace.diff"),
2524
- path: z14.string(),
2525
- base: z14.string().nullable(),
2526
- file: z14.string().nullable(),
2527
- /** Hosts without gitLog.v1 never receive it. */
2528
- rev: DiffRev.optional()
2529
- }),
2530
- z14.object({
2531
- type: z14.literal("workspace.log"),
2532
- path: z14.string(),
2533
- base: z14.string().nullable(),
2534
- limit: z14.number().int().min(1).max(200)
2535
- }),
2536
- z14.object({ type: z14.literal("workspace.files"), path: z14.string(), dir: z14.string() }),
2537
- z14.object({ type: z14.literal("workspace.readFile"), path: z14.string(), file: z14.string() }),
2538
- IssueHostPrepareBranchRequest.extend({ type: z14.literal("tracker.prepareBranch") }),
2539
- z14.object({
2540
- type: z14.literal("dispatch.start"),
2541
- dispatchKey: z14.string(),
2542
- runId: z14.string(),
2543
- taskId: z14.string(),
2544
- sessionId: z14.string(),
2545
- projectId: z14.string(),
2546
- title: z14.string(),
2547
- workspace: z14.union([
2548
- z14.object({ path: z14.string() }),
2549
- z14.object({
2550
- createFrom: z14.object({
2551
- checkoutPath: z14.string(),
2552
- branch: z14.string(),
2553
- base: z14.string(),
2554
- setupCommand: z14.string().nullable(),
2555
- worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
2556
- })
2557
- })
2558
- ]),
2559
- nativeHandle: NativeHandle.nullable(),
2560
- profile: Profile,
2561
- prompt: z14.string(),
2562
- /** The launch's own revision; a takeover always carries a newer one. */
2563
- controlRevision: z14.number().int(),
2564
- controlMode: ControlMode.default("automation"),
2565
- policyRequired: z14.boolean().optional()
2566
- }),
2567
- z14.object({ type: z14.literal("dispatch.reconcile"), dispatchKey: z14.string() }),
2568
- z14.object({
2569
- type: z14.literal("checks.run"),
2570
- sessionId: z14.string(),
2571
- path: z14.string(),
2572
- commands: z14.array(z14.string())
2573
- })
2574
- ]);
2575
- var ImportableSession = z14.object({
2576
- sessionFile: z14.string(),
2577
- sessionId: z14.string(),
2578
- cwd: z14.string(),
2579
- name: z14.string().nullable(),
2580
- mtime: z14.string(),
2581
- inactive: z14.boolean()
2582
- });
2583
- var DiscoveredWorktree = z14.object({
2584
- path: z14.string(),
2585
- head: z14.string().nullable(),
2586
- branch: z14.string().nullable(),
2587
- bare: z14.boolean(),
2588
- detached: z14.boolean(),
2589
- locked: z14.boolean(),
2590
- prunable: z14.boolean(),
2591
- provenance: z14.enum(["managed", "discovered", "main"]),
2592
- git: GitState.nullable()
2593
- });
2594
- var CheckoutInfo = z14.object({
2595
- root: z14.string(),
2596
- commonDir: z14.string(),
2597
- repoIdentity: z14.string(),
2598
- defaultBranch: z14.string()
2599
- });
2600
- var CheckoutPreviewResult = z14.object({
2601
- path: z14.string(),
2602
- root: z14.string(),
2603
- state: z14.enum(["missing", "existing", "collision"]),
2604
- checkout: CheckoutInfo.optional()
2605
- });
2606
- var CheckoutLocateResult = z14.object({ checkout: CheckoutInfo, worktreePath: z14.string() }).nullable();
2607
- var ScannedRepository = CheckoutInfo.extend({ name: z14.string() });
2608
- var ProjectFolderScan = z14.object({
2609
- /** The folder, ~ expanded and realpath'd. */
2610
- folder: z14.string(),
2611
- repositories: z14.array(ScannedRepository)
2612
- });
2613
- var ProjectSuggestion = z14.object({
2614
- rootPath: z14.string(),
2615
- sessionCount: z14.number().int(),
2616
- lastActivityAt: z14.string()
2617
- });
2618
- var ProjectSuggestions = z14.object({ suggestions: z14.array(ProjectSuggestion) });
2619
- var GitCommit = z14.object({
2620
- sha: z14.string().regex(/^[0-9a-f]{40}$/),
2621
- subject: z14.string().max(300),
2622
- author: z14.string().max(200),
2623
- authoredAt: z14.string(),
2624
- pushed: z14.boolean()
2625
- });
2626
- var LogResult = z14.object({
2627
- /** The base branch the commits are counted from. */
2628
- base: z14.string(),
2629
- /** `branch`: commits since the merge base; `recent`: HEAD's latest commits (no commits of its own). */
2630
- scope: z14.enum(["branch", "recent"]),
2631
- commits: z14.array(GitCommit).max(200),
2632
- truncated: z14.boolean(),
2633
- /** Changed and untracked files not committed yet. */
2634
- uncommitted: z14.number().int().min(0)
2635
- });
2636
- var DiffFile = z14.object({
2637
- path: z14.string(),
2638
- oldPath: z14.string().nullable(),
2639
- added: z14.number().int(),
2640
- deleted: z14.number().int(),
2641
- status: z14.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
2642
- });
2643
- var DiffResult = z14.object({
2644
- base: z14.string(),
2645
- files: z14.array(DiffFile),
2646
- patch: z14.string().nullable()
2647
- });
2648
- var FileEntry = z14.object({
2649
- name: z14.string(),
2650
- path: z14.string(),
2651
- kind: z14.enum(["file", "dir", "symlink"]),
2652
- size: z14.number().int().nullable()
2653
- });
2654
- var ReconcileResult = z14.union([
2655
- z14.object({ known: z14.literal(false) }),
2656
- z14.object({
2657
- known: z14.literal(true),
2658
- sessionId: z14.string().nullable(),
2659
- state: z14.enum(["accepted", "workspace_ready", "started", "failed"]),
2660
- runtime: RuntimeState.nullable(),
2661
- workspacePath: z14.string().nullable(),
2662
- nativeHandle: NativeHandle.nullable(),
2663
- error: z14.string().nullable(),
2664
- /** `{started: "unknown"}` when the host restarted after Pi may have been spawned. */
2665
- errorDetails: z14.record(z14.string(), z14.unknown()).nullable().default(null)
2666
- })
2667
- ]);
2668
- var DispatchStartResult = z14.object({
2669
- sessionId: z14.string(),
2670
- workspacePath: z14.string(),
2671
- nativeHandle: NativeHandle.nullable(),
2672
- reused: z14.boolean(),
2673
- /** Why the launch prompt was not delivered to Pi (the session itself started), if it was not. */
2674
- promptError: z14.string().nullable().optional()
2675
- });
2676
- var AnswerResult = z14.object({
2677
- status: z14.enum(["answered", "already_answered"]),
2678
- interaction: Interaction
2679
- });
2680
- var SnapshotResult = z14.object({
2681
- partial: z14.array(TranscriptItem),
2682
- pendingInteractions: z14.array(Interaction)
2683
- });
2684
- var ChecksResult = z14.object({ results: z14.array(CheckResult) });
2685
- var Receipt = z14.union([
2686
- z14.object({ commandId: z14.string(), ok: z14.literal(true), result: z14.unknown() }),
2687
- z14.object({ commandId: z14.string(), ok: z14.literal(false), error: ErrorBody })
2688
- ]);
2689
- var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
2690
- policyContext: HostToolPolicyContext.optional()
2691
- }).strict().superRefine((frame, ctx) => {
2692
- if (frame.method === "policy.evaluate" ? frame.policyContext === void 0 : Object.hasOwn(frame, "policyContext")) {
2693
- ctx.addIssue({
2694
- code: "custom",
2695
- path: ["policyContext"],
2696
- message: "Host policy context is required only for policy.evaluate."
2697
- });
2698
- }
2699
- try {
2700
- if (new TextEncoder().encode(JSON.stringify(frame)).length <= AGENT_FRAME_MAX_BYTES)
2701
- return;
2702
- } catch {
2703
- }
2704
- ctx.addIssue({ code: "custom", message: "Host agent frame exceeds 128 KiB or is not JSON." });
2705
- });
2706
- var HostToCoordinator = z14.discriminatedUnion("type", [
2707
- z14.object({
2708
- type: z14.literal("hello"),
2709
- hostId: z14.string(),
2710
- credential: z14.string(),
2711
- name: z14.string(),
2712
- agentVersion: z14.string(),
2713
- piVersion: z14.string().nullable(),
2714
- piCompatible: z14.boolean(),
2715
- platform: Platform,
2716
- capabilities: RuntimeCapabilities.nullable(),
2717
- github: HostGitHub.optional(),
2718
- protocolVersion: z14.number().int(),
2719
- features: z14.array(z14.string()).optional()
2720
- }),
2721
- HostAgentRequestFrame,
2722
- z14.object({ type: z14.literal("event"), hostSeq: z14.number().int(), event: HostEvent }),
2723
- z14.object({ type: z14.literal("stream"), delta: StreamDelta }),
2724
- z14.object({ type: z14.literal("receipt"), receipt: Receipt }),
2725
- z14.object({ type: z14.literal("pong") }),
2726
- z14.object({ type: z14.literal("usage"), usage: z14.array(ProviderUsage) }),
2727
- z14.object({ type: z14.literal("term"), streamId: z14.string(), msg: TermServerToViewer })
2728
- ]);
2729
- var CoordinatorToHost = z14.discriminatedUnion("type", [
2730
- z14.object({
2731
- type: z14.literal("welcome"),
2732
- coordinatorVersion: z14.string(),
2733
- ackedHostSeq: z14.number().int(),
2734
- features: z14.array(z14.string()).optional()
2735
- }),
2736
- AgentResultFrame,
2737
- z14.object({ type: z14.literal("ack"), hostSeq: z14.number().int() }),
2738
- z14.object({ type: z14.literal("command"), commandId: z14.string(), command: HostCommand }),
2739
- z14.object({ type: z14.literal("ping") }),
2740
- z14.object({ type: z14.literal("reject"), error: ErrorBody }),
2741
- z14.object({ type: z14.literal("term"), streamId: z14.string(), msg: TermCoordinatorMsg })
2742
- ]);
2743
-
2744
- // packages/protocol/dist/api.js
2745
- var EnrollRequest = z15.object({
2746
- token: z15.string().min(1),
2747
- name: z15.string().min(1).max(80),
2283
+ var EnrollRequest = z12.object({
2284
+ token: z12.string().min(1),
2285
+ name: z12.string().min(1).max(80),
2748
2286
  kind: DeviceKind
2749
2287
  });
2750
- var EnrollResponse = z15.object({ deviceId: z15.string(), credential: z15.string() });
2751
- var CreateEnrollmentRequest = z15.object({ kind: z15.enum(["device", "host"]) });
2752
- var CreateEnrollmentResponse = z15.object({
2753
- token: z15.string(),
2754
- url: z15.string(),
2755
- expiresAt: z15.string(),
2756
- qrSvg: z15.string(),
2757
- command: z15.string().nullable()
2758
- });
2759
- var HostEnrollRequest = z15.union([
2760
- z15.object({
2761
- token: z15.string().min(1),
2762
- name: z15.string().min(1).max(80),
2288
+ var EnrollResponse = z12.object({ deviceId: z12.string(), credential: z12.string() });
2289
+ var CreateEnrollmentRequest = z12.object({ kind: z12.enum(["device", "host"]) });
2290
+ var CreateEnrollmentResponse = z12.object({
2291
+ token: z12.string(),
2292
+ url: z12.string(),
2293
+ expiresAt: z12.string(),
2294
+ qrSvg: z12.string(),
2295
+ command: z12.string().nullable()
2296
+ });
2297
+ var HostEnrollRequest = z12.union([
2298
+ z12.object({
2299
+ token: z12.string().min(1),
2300
+ name: z12.string().min(1).max(80),
2763
2301
  platform: Platform
2764
2302
  }),
2765
- z15.object({
2766
- secret: z15.string().min(1),
2767
- name: z15.string().min(1).max(80),
2303
+ z12.object({
2304
+ secret: z12.string().min(1),
2305
+ name: z12.string().min(1).max(80),
2768
2306
  platform: Platform
2769
2307
  })
2770
2308
  ]);
2771
- var HostEnrollResponse = z15.object({ hostId: z15.string(), credential: z15.string() });
2772
- var CreateProjectRequest = z15.object({
2773
- name: z15.string().min(1),
2774
- hostId: z15.string(),
2775
- path: z15.string().min(1),
2776
- defaultProfileId: z15.string().nullable().optional(),
2777
- setupCommand: z15.string().nullable().optional(),
2778
- checks: z15.array(z15.string()).optional(),
2779
- maxConcurrentRuns: z15.number().int().min(1).max(32).optional(),
2309
+ var HostEnrollResponse = z12.object({ hostId: z12.string(), credential: z12.string() });
2310
+ var CreateProjectRequest = z12.object({
2311
+ name: z12.string().min(1),
2312
+ hostId: z12.string(),
2313
+ path: z12.string().min(1),
2314
+ defaultProfileId: z12.string().nullable().optional(),
2315
+ setupCommand: z12.string().nullable().optional(),
2316
+ checks: z12.array(z12.string()).optional(),
2317
+ maxConcurrentRuns: z12.number().int().min(1).max(32).optional(),
2780
2318
  worktreeDir: WorktreeDir.optional()
2781
2319
  });
2782
- var UpdateProjectRequest = z15.object({
2783
- name: z15.string().min(1).optional(),
2784
- defaultProfileId: z15.string().nullable().optional(),
2785
- defaultHostId: z15.string().nullable().optional(),
2786
- maxConcurrentRuns: z15.number().int().min(1).max(32).optional(),
2787
- automationEnabled: z15.boolean().optional(),
2788
- setupCommand: z15.string().nullable().optional(),
2789
- checks: z15.array(z15.string()).optional(),
2790
- workspaceSharing: z15.enum(["single_writer", "shared"]).optional(),
2320
+ var UpdateProjectRequest = z12.object({
2321
+ name: z12.string().min(1).optional(),
2322
+ defaultProfileId: z12.string().nullable().optional(),
2323
+ defaultHostId: z12.string().nullable().optional(),
2324
+ maxConcurrentRuns: z12.number().int().min(1).max(32).optional(),
2325
+ automationEnabled: z12.boolean().optional(),
2326
+ setupCommand: z12.string().nullable().optional(),
2327
+ checks: z12.array(z12.string()).optional(),
2328
+ workspaceSharing: z12.enum(["single_writer", "shared"]).optional(),
2791
2329
  worktreeDir: WorktreeDir.optional(),
2792
- ensureSessions: z15.boolean().optional(),
2793
- removeLanded: z15.boolean().optional()
2330
+ ensureSessions: z12.boolean().optional(),
2331
+ removeLanded: z12.boolean().optional()
2794
2332
  });
2795
- var AddCheckoutRequest = z15.object({ hostId: z15.string(), path: z15.string().min(1) });
2333
+ var AddCheckoutRequest = z12.object({ hostId: z12.string(), path: z12.string().min(1) });
2796
2334
  function isProjectFolderPath(s) {
2797
2335
  if (s.includes("\0"))
2798
2336
  return false;
2799
2337
  return s === "~" || s.startsWith("~/") || s.startsWith("/");
2800
2338
  }
2801
- var ProjectFolder = z15.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
2802
- var UpdateHostRequest = z15.object({
2803
- projectFolders: z15.array(ProjectFolder).max(20).optional(),
2339
+ var ProjectFolder = z12.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
2340
+ var UpdateHostRequest = z12.object({
2804
2341
  checkoutRoot: ProjectFolder.nullable().optional()
2805
2342
  });
2806
- var ProjectScanResult = ProjectScan.extend({
2807
- added: z15.array(z15.object({
2808
- projectId: z15.string(),
2809
- name: z15.string(),
2810
- path: z15.string(),
2811
- newProject: z15.boolean()
2812
- }))
2813
- });
2814
- var ProfileInput = z15.object({
2815
- name: z15.string().min(1),
2816
- provider: z15.string().nullable().default(null),
2817
- model: z15.string().nullable().default(null),
2343
+ var ProfileInput = z12.object({
2344
+ name: z12.string().min(1),
2345
+ provider: z12.string().nullable().default(null),
2346
+ model: z12.string().nullable().default(null),
2818
2347
  thinking: ThinkingLevel.nullable().default(null),
2819
- projectTrust: z15.enum(["ask", "approve", "ignore"]).default("ask"),
2820
- extraArgs: z15.array(ExtraArg).default([]),
2821
- resources: z15.enum(["all", "vanilla"]).default("all")
2822
- });
2823
- var CreateWorkspaceRequest = z15.object({
2824
- checkoutId: z15.string(),
2825
- branch: z15.string().min(1),
2826
- base: z15.string().nullable().optional()
2827
- });
2828
- var RemoveWorkspaceRequest = z15.object({
2829
- force: z15.object({ dirty: z15.boolean(), unmerged: z15.boolean() }).default({ dirty: false, unmerged: false })
2830
- });
2831
- var CreateSessionRequest = z15.object({
2832
- projectId: z15.string(),
2833
- workspace: z15.union([
2834
- z15.object({ existingId: z15.string() }),
2835
- z15.object({
2836
- checkoutId: z15.string(),
2837
- newBranch: z15.string().min(1),
2838
- base: z15.string().nullable().optional()
2348
+ projectTrust: z12.enum(["ask", "approve", "ignore"]).default("ask"),
2349
+ extraArgs: z12.array(ExtraArg).default([]),
2350
+ resources: z12.enum(["all", "vanilla"]).default("all")
2351
+ });
2352
+ var CreateWorkspaceRequest = z12.object({
2353
+ checkoutId: z12.string(),
2354
+ branch: z12.string().min(1),
2355
+ base: z12.string().nullable().optional()
2356
+ });
2357
+ var RemoveWorkspaceRequest = z12.object({
2358
+ force: z12.object({ dirty: z12.boolean(), unmerged: z12.boolean() }).default({ dirty: false, unmerged: false })
2359
+ });
2360
+ var CreateSessionRequest = z12.object({
2361
+ projectId: z12.string(),
2362
+ workspace: z12.union([
2363
+ z12.object({ existingId: z12.string() }),
2364
+ z12.object({
2365
+ checkoutId: z12.string(),
2366
+ newBranch: z12.string().min(1),
2367
+ base: z12.string().nullable().optional()
2839
2368
  })
2840
2369
  ]),
2841
- profileId: z15.string().nullable().optional(),
2842
- prompt: z15.string().default(""),
2843
- title: z15.string().optional(),
2844
- scopeId: z15.string().optional(),
2370
+ profileId: z12.string().nullable().optional(),
2371
+ prompt: z12.string().default(""),
2372
+ title: z12.string().optional(),
2373
+ scopeId: z12.string().optional(),
2845
2374
  /** COMPAT(scopes-rename): remove after 2027-03-01. The old name of scopeId. */
2846
- viewId: z15.string().optional()
2847
- });
2848
- var OpenBranchRequest = z15.object({
2849
- projectId: z15.string(),
2850
- branch: z15.string().min(1),
2851
- hostId: z15.string().optional(),
2852
- base: z15.string().nullable().optional(),
2853
- prompt: z15.string().default(""),
2854
- profileId: z15.string().nullable().optional(),
2855
- title: z15.string().optional(),
2856
- scopeId: z15.string().optional(),
2375
+ viewId: z12.string().optional()
2376
+ });
2377
+ var OpenBranchRequest = z12.object({
2378
+ projectId: z12.string(),
2379
+ branch: z12.string().min(1),
2380
+ hostId: z12.string().optional(),
2381
+ base: z12.string().nullable().optional(),
2382
+ prompt: z12.string().default(""),
2383
+ profileId: z12.string().nullable().optional(),
2384
+ title: z12.string().optional(),
2385
+ scopeId: z12.string().optional(),
2857
2386
  /** COMPAT(scopes-rename): remove after 2027-03-01. The old name of scopeId. */
2858
- viewId: z15.string().optional(),
2387
+ viewId: z12.string().optional(),
2859
2388
  /** Start another session even when the branch has one. */
2860
- another: z15.boolean().default(false)
2861
- });
2862
- var OpenBranchResult = z15.object({ session: Session, created: z15.boolean() });
2863
- var SetPrimaryRequest = z15.object({ primary: z15.boolean() });
2864
- var PromptRequest = z15.object({
2865
- text: z15.string().min(1),
2866
- mode: z15.enum(["prompt", "steer", "followUp"]).default("prompt"),
2867
- images: z15.array(z15.object({ mimeType: z15.string(), data: z15.string() })).default([]),
2868
- clientMessageId: z15.string().optional()
2869
- });
2870
- var CacheAlertRequest = z15.object({
2871
- enabled: z15.boolean(),
2872
- ttlSec: z15.number().int().min(60).max(86400).nullable().default(null)
2873
- });
2874
- var RenameRequest = z15.object({ title: z15.string().min(1).max(200) });
2875
- var SetModelRequest = z15.object({
2876
- provider: z15.string().min(1),
2877
- modelId: z15.string().min(1)
2878
- });
2879
- var SetThinkingRequest = z15.object({ level: ThinkingLevel });
2880
- var CompactRequest = z15.object({ instructions: z15.string().max(4e3).optional() });
2881
- var SessionModelsResult = z15.object({ models: z15.array(SessionModel) });
2882
- var SessionCommandsResult = z15.object({ commands: z15.array(SlashCommand) });
2883
- var CompleteRequest = z15.object({ text: z15.string().min(1).max(500) });
2884
- var CompletionItem = z15.object({
2885
- value: z15.string(),
2886
- label: z15.string(),
2887
- description: z15.string().nullable()
2888
- });
2889
- var SessionCompleteResult = z15.object({
2890
- items: z15.array(CompletionItem).max(50),
2891
- prefix: z15.string()
2892
- });
2893
- var TreeRow = z15.object({
2894
- entryId: z15.string(),
2895
- parentId: z15.string().nullable(),
2896
- depth: z15.number().int(),
2897
- role: z15.enum(["user", "assistant"]),
2898
- text: z15.string(),
2899
- activeBranch: z15.boolean(),
2900
- leaf: z15.boolean(),
2901
- label: z15.string().nullable(),
2902
- at: z15.string().nullable()
2903
- });
2904
- var SessionTreeResult = z15.object({ rows: z15.array(TreeRow) });
2905
- var BranchRequest = z15.object({
2906
- entryId: z15.string().nullable(),
2907
- fork: z15.boolean().default(false)
2908
- });
2909
- var HostBranchResult = z15.object({
2910
- sessionFile: z15.string().nullable(),
2911
- prefill: z15.string().nullable()
2912
- });
2913
- var TranscriptPage = z15.object({
2914
- items: z15.array(TranscriptItem),
2915
- hasMore: z15.boolean(),
2916
- epoch: z15.number().int().optional(),
2917
- rev: z15.number().int().optional(),
2918
- delta: z15.boolean().optional(),
2919
- reset: z15.boolean().optional()
2920
- });
2921
- var NavigateRequest = z15.object({
2922
- entryId: z15.string().min(1),
2923
- summarize: z15.boolean().default(false),
2924
- instructions: z15.string().max(2e3).nullable().default(null)
2925
- });
2926
- var HostNavigateResult = z15.object({
2927
- items: z15.array(TranscriptItem),
2928
- prefill: z15.string().nullable()
2929
- });
2930
- var NavigateResult = z15.object({
2931
- prefill: z15.string().nullable(),
2932
- epoch: z15.number().int()
2933
- });
2934
- var BranchResult = z15.object({
2389
+ another: z12.boolean().default(false)
2390
+ });
2391
+ var OpenBranchResult = z12.object({ session: Session, created: z12.boolean() });
2392
+ var SetPrimaryRequest = z12.object({ primary: z12.boolean() });
2393
+ var PromptRequest = z12.object({
2394
+ text: z12.string().min(1),
2395
+ mode: z12.enum(["prompt", "steer", "followUp"]).default("prompt"),
2396
+ images: z12.array(z12.object({ mimeType: z12.string(), data: z12.string() })).default([]),
2397
+ clientMessageId: z12.string().optional()
2398
+ });
2399
+ var CacheAlertRequest = z12.object({
2400
+ enabled: z12.boolean(),
2401
+ ttlSec: z12.number().int().min(60).max(86400).nullable().default(null)
2402
+ });
2403
+ var RenameRequest = z12.object({ title: z12.string().min(1).max(200) });
2404
+ var SetModelRequest = z12.object({
2405
+ provider: z12.string().min(1),
2406
+ modelId: z12.string().min(1)
2407
+ });
2408
+ var SetThinkingRequest = z12.object({ level: ThinkingLevel });
2409
+ var CompactRequest = z12.object({ instructions: z12.string().max(4e3).optional() });
2410
+ var SessionModelsResult = z12.object({ models: z12.array(SessionModel) });
2411
+ var SessionCommandsResult = z12.object({ commands: z12.array(SlashCommand) });
2412
+ var CompleteRequest = z12.object({ text: z12.string().min(1).max(500) });
2413
+ var CompletionItem = z12.object({
2414
+ value: z12.string(),
2415
+ label: z12.string(),
2416
+ description: z12.string().nullable()
2417
+ });
2418
+ var SessionCompleteResult = z12.object({
2419
+ items: z12.array(CompletionItem).max(50),
2420
+ prefix: z12.string()
2421
+ });
2422
+ var TreeRow = z12.object({
2423
+ entryId: z12.string(),
2424
+ parentId: z12.string().nullable(),
2425
+ depth: z12.number().int(),
2426
+ role: z12.enum(["user", "assistant"]),
2427
+ text: z12.string(),
2428
+ activeBranch: z12.boolean(),
2429
+ leaf: z12.boolean(),
2430
+ label: z12.string().nullable(),
2431
+ at: z12.string().nullable()
2432
+ });
2433
+ var SessionTreeResult = z12.object({ rows: z12.array(TreeRow) });
2434
+ var BranchRequest = z12.object({
2435
+ entryId: z12.string().nullable(),
2436
+ fork: z12.boolean().default(false)
2437
+ });
2438
+ var HostBranchResult = z12.object({
2439
+ sessionFile: z12.string().nullable(),
2440
+ prefill: z12.string().nullable()
2441
+ });
2442
+ var TranscriptPage = z12.object({
2443
+ items: z12.array(TranscriptItem),
2444
+ hasMore: z12.boolean(),
2445
+ epoch: z12.number().int().optional(),
2446
+ rev: z12.number().int().optional(),
2447
+ delta: z12.boolean().optional(),
2448
+ reset: z12.boolean().optional()
2449
+ });
2450
+ var NavigateRequest = z12.object({
2451
+ entryId: z12.string().min(1),
2452
+ summarize: z12.boolean().default(false),
2453
+ instructions: z12.string().max(2e3).nullable().default(null)
2454
+ });
2455
+ var HostNavigateResult = z12.object({
2456
+ items: z12.array(TranscriptItem),
2457
+ prefill: z12.string().nullable()
2458
+ });
2459
+ var NavigateResult = z12.object({
2460
+ prefill: z12.string().nullable(),
2461
+ epoch: z12.number().int()
2462
+ });
2463
+ var BranchResult = z12.object({
2935
2464
  session: Session.nullable(),
2936
- prefill: z15.string().nullable()
2465
+ prefill: z12.string().nullable()
2937
2466
  });
2938
- var SessionExportResult = z15.object({ fileName: z15.string(), content: z15.string() });
2939
- var CommandViewAction = z15.object({
2940
- label: z15.string().min(1).max(80),
2941
- command: z15.string().startsWith("/").max(500),
2942
- tone: z15.enum(["default", "primary", "danger"]).optional()
2467
+ var SessionExportResult = z12.object({ fileName: z12.string(), content: z12.string() });
2468
+ var CommandViewAction = z12.object({
2469
+ label: z12.string().min(1).max(80),
2470
+ command: z12.string().startsWith("/").max(500),
2471
+ tone: z12.enum(["default", "primary", "danger"]).optional()
2943
2472
  });
2944
- var CommandView = z15.object({
2945
- title: z15.string().min(1).max(200),
2473
+ var CommandView = z12.object({
2474
+ title: z12.string().min(1).max(200),
2946
2475
  body: UINodeSchema,
2947
- actions: z15.array(CommandViewAction).max(30).default([])
2476
+ actions: z12.array(CommandViewAction).max(30).default([])
2948
2477
  });
2949
- var ModelStateResult = z15.object({
2478
+ var ModelStateResult = z12.object({
2950
2479
  model: SessionModel.nullable(),
2951
2480
  thinking: ThinkingLevel.nullable()
2952
2481
  });
2953
- var ImportSessionRequest = z15.object({
2954
- hostId: z15.string(),
2955
- sessionFile: z15.string(),
2956
- projectId: z15.string().nullable().optional()
2482
+ var ImportSessionRequest = z12.object({
2483
+ hostId: z12.string(),
2484
+ sessionFile: z12.string(),
2485
+ projectId: z12.string().nullable().optional()
2957
2486
  });
2958
- var AnswerRequest = z15.object({
2959
- revision: z15.number().int(),
2487
+ var AnswerRequest = z12.object({
2488
+ revision: z12.number().int(),
2960
2489
  response: InteractionResponseSchema
2961
2490
  });
2962
- var AdapterActionRequest = z15.object({
2963
- generation: z15.string().uuid().optional(),
2964
- adapterId: z15.string(),
2965
- actionId: z15.string(),
2966
- payload: z15.unknown().optional()
2967
- });
2968
- var TaskPolicyPatch = z15.object({
2969
- hostId: z15.string().nullable().optional(),
2970
- profileId: z15.string().nullable().optional(),
2971
- workspace: z15.object({
2972
- mode: z15.enum(["new_worktree", "existing"]).optional(),
2973
- branch: z15.string().nullable().optional(),
2974
- base: z15.string().nullable().optional(),
2975
- workspaceId: z15.string().optional()
2491
+ var AdapterActionRequest = z12.object({
2492
+ generation: z12.string().uuid().optional(),
2493
+ adapterId: z12.string(),
2494
+ actionId: z12.string(),
2495
+ payload: z12.unknown().optional()
2496
+ });
2497
+ var TaskPolicyPatch = z12.object({
2498
+ hostId: z12.string().nullable().optional(),
2499
+ profileId: z12.string().nullable().optional(),
2500
+ workspace: z12.object({
2501
+ mode: z12.enum(["new_worktree", "existing"]).optional(),
2502
+ branch: z12.string().nullable().optional(),
2503
+ base: z12.string().nullable().optional(),
2504
+ workspaceId: z12.string().optional()
2976
2505
  }).optional(),
2977
- continuation: z15.object({
2978
- enabled: z15.boolean().optional(),
2979
- objective: z15.string().min(1).optional(),
2980
- maxContinuations: z15.number().int().min(1).max(50).optional(),
2981
- maxElapsedMinutes: z15.number().int().min(1).max(1440).optional(),
2982
- maxTokens: z15.number().int().positive().nullable().optional(),
2983
- maxCostUsd: z15.number().positive().nullable().optional()
2506
+ continuation: z12.object({
2507
+ enabled: z12.boolean().optional(),
2508
+ objective: z12.string().min(1).optional(),
2509
+ maxContinuations: z12.number().int().min(1).max(50).optional(),
2510
+ maxElapsedMinutes: z12.number().int().min(1).max(1440).optional(),
2511
+ maxTokens: z12.number().int().positive().nullable().optional(),
2512
+ maxCostUsd: z12.number().positive().nullable().optional()
2984
2513
  }).optional(),
2985
2514
  completion: CompletionPolicy.partial().optional()
2986
2515
  });
2987
- var CreateTaskRequest = z15.object({
2988
- projectId: z15.string(),
2989
- title: z15.string().max(300).optional(),
2516
+ var CreateTaskRequest = z12.object({
2517
+ projectId: z12.string(),
2518
+ title: z12.string().max(300).optional(),
2990
2519
  githubIssueUrl: GitHubIssueUrl.optional(),
2991
- githubIssue: z15.never().optional(),
2992
- launchPrompt: z15.never().optional(),
2993
- objective: z15.string().default(""),
2994
- acceptanceCriteria: z15.array(z15.string()).default([]),
2995
- dependencies: z15.array(z15.string()).default([]),
2996
- parentTaskId: z15.string().nullable().optional(),
2520
+ githubIssue: z12.never().optional(),
2521
+ launchPrompt: z12.never().optional(),
2522
+ objective: z12.string().default(""),
2523
+ acceptanceCriteria: z12.array(z12.string()).default([]),
2524
+ dependencies: z12.array(z12.string()).default([]),
2525
+ parentTaskId: z12.string().nullable().optional(),
2997
2526
  priority: Priority.default(2),
2998
- state: z15.enum(["backlog", "ready"]).default("backlog"),
2999
- notBefore: z15.string().nullable().optional(),
2527
+ state: z12.enum(["backlog", "ready"]).default("backlog"),
2528
+ notBefore: z12.string().nullable().optional(),
3000
2529
  policy: TaskPolicyPatch.optional()
3001
2530
  }).superRefine((v, ctx) => {
3002
2531
  if (v.githubIssueUrl === void 0) {
@@ -3034,32 +2563,32 @@ var CreateTaskRequest = z15.object({
3034
2563
  const issue = githubIssueFromUrl(v.githubIssueUrl);
3035
2564
  return { ...v, title: v.title?.trim() || `${issue.repository} #${issue.number}` };
3036
2565
  });
3037
- var UpdateTaskRequest = z15.object({
3038
- githubIssueUrl: z15.never().optional(),
3039
- githubIssue: z15.never().optional(),
3040
- launchPrompt: z15.never().optional(),
3041
- title: z15.string().min(1).max(300).optional(),
3042
- objective: z15.string().optional(),
3043
- acceptanceCriteria: z15.array(z15.string()).optional(),
3044
- dependencies: z15.array(z15.string()).optional(),
3045
- parentTaskId: z15.string().nullable().optional(),
2566
+ var UpdateTaskRequest = z12.object({
2567
+ githubIssueUrl: z12.never().optional(),
2568
+ githubIssue: z12.never().optional(),
2569
+ launchPrompt: z12.never().optional(),
2570
+ title: z12.string().min(1).max(300).optional(),
2571
+ objective: z12.string().optional(),
2572
+ acceptanceCriteria: z12.array(z12.string()).optional(),
2573
+ dependencies: z12.array(z12.string()).optional(),
2574
+ parentTaskId: z12.string().nullable().optional(),
3046
2575
  priority: Priority.optional(),
3047
- position: z15.number().optional(),
3048
- notBefore: z15.string().nullable().optional(),
2576
+ position: z12.number().optional(),
2577
+ notBefore: z12.string().nullable().optional(),
3049
2578
  policy: TaskPolicyPatch.optional()
3050
2579
  });
3051
- var MoveTaskRequest = z15.object({
2580
+ var MoveTaskRequest = z12.object({
3052
2581
  to: TaskState,
3053
- confirm: z15.boolean().optional(),
3054
- onRunning: z15.enum(["pause", "stop"]).optional(),
3055
- position: z15.number().optional()
3056
- });
3057
- var RequestChangesRequest = z15.object({ feedback: z15.array(z15.string().min(1)).min(1) });
3058
- var Eligibility = z15.union([
3059
- z15.object({ eligible: z15.literal(true), hostId: z15.string(), hostName: z15.string() }),
3060
- z15.object({
3061
- eligible: z15.literal(false),
3062
- wait: z15.enum([
2582
+ confirm: z12.boolean().optional(),
2583
+ onRunning: z12.enum(["pause", "stop"]).optional(),
2584
+ position: z12.number().optional()
2585
+ });
2586
+ var RequestChangesRequest = z12.object({ feedback: z12.array(z12.string().min(1)).min(1) });
2587
+ var Eligibility = z12.union([
2588
+ z12.object({ eligible: z12.literal(true), hostId: z12.string(), hostName: z12.string() }),
2589
+ z12.object({
2590
+ eligible: z12.literal(false),
2591
+ wait: z12.enum([
3063
2592
  "dependency",
3064
2593
  "host_offline",
3065
2594
  "project_limit",
@@ -3072,157 +2601,157 @@ var Eligibility = z15.union([
3072
2601
  "already_dispatched",
3073
2602
  "retry_backoff"
3074
2603
  ]),
3075
- message: z15.string()
2604
+ message: z12.string()
3076
2605
  })
3077
2606
  ]);
3078
- var NowResponse = z15.object({
3079
- running: z15.array(z15.object({ taskId: z15.string(), runId: z15.string(), sessionId: z15.string().nullable() })),
3080
- queued: z15.array(z15.object({ taskId: z15.string(), eligibility: Eligibility })),
3081
- dispatchPaused: z15.boolean()
3082
- });
3083
- var AutomationInput = z15.object({
3084
- name: z15.string().min(1),
3085
- enabled: z15.boolean().default(true),
3086
- projectId: z15.string(),
2607
+ var NowResponse = z12.object({
2608
+ running: z12.array(z12.object({ taskId: z12.string(), runId: z12.string(), sessionId: z12.string().nullable() })),
2609
+ queued: z12.array(z12.object({ taskId: z12.string(), eligibility: Eligibility })),
2610
+ dispatchPaused: z12.boolean()
2611
+ });
2612
+ var AutomationInput = z12.object({
2613
+ name: z12.string().min(1),
2614
+ enabled: z12.boolean().default(true),
2615
+ projectId: z12.string(),
3087
2616
  trigger: Trigger,
3088
- filters: z15.array(z15.object({ path: z15.string(), equals: z15.string() })).default([]),
2617
+ filters: z12.array(z12.object({ path: z12.string(), equals: z12.string() })).default([]),
3089
2618
  template: TaskTemplate,
3090
- hostId: z15.string().nullable().default(null),
3091
- profileId: z15.string().nullable().default(null),
3092
- mode: z15.enum(["fresh", "continue", "watch"]).default("fresh"),
3093
- groupingKey: z15.string().nullable().default(null),
3094
- overlap: z15.enum(["skip", "queue_one", "append"]).default("skip"),
3095
- missed: z15.enum(["skip", "run_once"]).default("skip"),
2619
+ hostId: z12.string().nullable().default(null),
2620
+ profileId: z12.string().nullable().default(null),
2621
+ mode: z12.enum(["fresh", "continue", "watch"]).default("fresh"),
2622
+ groupingKey: z12.string().nullable().default(null),
2623
+ overlap: z12.enum(["skip", "queue_one", "append"]).default("skip"),
2624
+ missed: z12.enum(["skip", "run_once"]).default("skip"),
3096
2625
  continuation: ContinuationPolicy.default({ enabled: false }),
3097
2626
  completion: CompletionPolicy.default({ checks: null, requireHumanReview: true })
3098
2627
  });
3099
- var AutomationView = Automation.extend({ summary: z15.string() });
3100
- var AutomationPreview = z15.object({
3101
- summary: z15.string(),
2628
+ var AutomationView = Automation.extend({ summary: z12.string() });
2629
+ var AutomationPreview = z12.object({
2630
+ summary: z12.string(),
3102
2631
  task: TaskTemplate,
3103
- next: z15.array(z15.string())
3104
- });
3105
- var WebhookTokenResponse = z15.object({ token: z15.string(), url: z15.string() });
3106
- var PushSubscriptionRequest = z15.object({
3107
- endpoint: z15.string().url(),
3108
- keys: z15.object({ p256dh: z15.string(), auth: z15.string() }),
3109
- permission: z15.enum(["granted", "denied", "default", "unknown"]).default("granted")
3110
- });
3111
- var NotificationSettings = z15.object({
3112
- quietHours: z15.object({
3113
- start: z15.string().regex(/^\d{2}:\d{2}$/),
3114
- end: z15.string().regex(/^\d{2}:\d{2}$/),
3115
- timezone: z15.string()
2632
+ next: z12.array(z12.string())
2633
+ });
2634
+ var WebhookTokenResponse = z12.object({ token: z12.string(), url: z12.string() });
2635
+ var PushSubscriptionRequest = z12.object({
2636
+ endpoint: z12.string().url(),
2637
+ keys: z12.object({ p256dh: z12.string(), auth: z12.string() }),
2638
+ permission: z12.enum(["granted", "denied", "default", "unknown"]).default("granted")
2639
+ });
2640
+ var NotificationSettings = z12.object({
2641
+ quietHours: z12.object({
2642
+ start: z12.string().regex(/^\d{2}:\d{2}$/),
2643
+ end: z12.string().regex(/^\d{2}:\d{2}$/),
2644
+ timezone: z12.string()
3116
2645
  }).nullable(),
3117
- privatePreviews: z15.boolean(),
3118
- preferredDeviceId: z15.string().nullable()
3119
- });
3120
- var PushPayload = z15.union([
3121
- z15.object({
3122
- type: z15.literal("show"),
3123
- title: z15.string(),
3124
- body: z15.string(),
3125
- tag: z15.string(),
3126
- url: z15.string(),
3127
- renotify: z15.boolean()
2646
+ privatePreviews: z12.boolean(),
2647
+ preferredDeviceId: z12.string().nullable()
2648
+ });
2649
+ var PushPayload = z12.union([
2650
+ z12.object({
2651
+ type: z12.literal("show"),
2652
+ title: z12.string(),
2653
+ body: z12.string(),
2654
+ tag: z12.string(),
2655
+ url: z12.string(),
2656
+ renotify: z12.boolean()
3128
2657
  }),
3129
- z15.object({ type: z15.literal("clear"), tag: z15.string() })
2658
+ z12.object({ type: z12.literal("clear"), tag: z12.string() })
3130
2659
  ]);
3131
- var SetupState = z15.object({
3132
- passkey: z15.object({
3133
- available: z15.boolean(),
3134
- registered: z15.boolean(),
3135
- reason: z15.string().nullable()
2660
+ var SetupState = z12.object({
2661
+ passkey: z12.object({
2662
+ available: z12.boolean(),
2663
+ registered: z12.boolean(),
2664
+ reason: z12.string().nullable()
3136
2665
  }),
3137
- oidc: z15.object({ label: z15.string() }).nullable()
2666
+ oidc: z12.object({ label: z12.string() }).nullable()
3138
2667
  });
3139
- var PasskeyRegisterOptionsResponse = z15.object({
3140
- challengeId: z15.string(),
3141
- options: z15.unknown()
2668
+ var PasskeyRegisterOptionsResponse = z12.object({
2669
+ challengeId: z12.string(),
2670
+ options: z12.unknown()
3142
2671
  });
3143
- var PasskeyRegisterVerifyRequest = z15.object({
3144
- challengeId: z15.string(),
3145
- name: z15.string().min(1).max(80),
3146
- response: z15.unknown()
2672
+ var PasskeyRegisterVerifyRequest = z12.object({
2673
+ challengeId: z12.string(),
2674
+ name: z12.string().min(1).max(80),
2675
+ response: z12.unknown()
3147
2676
  });
3148
- var PasskeySignInOptionsResponse = z15.object({
3149
- challengeId: z15.string(),
3150
- options: z15.unknown()
2677
+ var PasskeySignInOptionsResponse = z12.object({
2678
+ challengeId: z12.string(),
2679
+ options: z12.unknown()
3151
2680
  });
3152
- var PasskeySignInVerifyRequest = z15.object({
3153
- challengeId: z15.string(),
3154
- response: z15.unknown(),
3155
- deviceName: z15.string().min(1).max(80),
2681
+ var PasskeySignInVerifyRequest = z12.object({
2682
+ challengeId: z12.string(),
2683
+ response: z12.unknown(),
2684
+ deviceName: z12.string().min(1).max(80),
3156
2685
  kind: DeviceKind.extract(["browser", "pwa"])
3157
2686
  });
3158
- var OidcBeginRequest = z15.object({
3159
- deviceName: z15.string().min(1).max(80),
2687
+ var OidcBeginRequest = z12.object({
2688
+ deviceName: z12.string().min(1).max(80),
3160
2689
  kind: DeviceKind.extract(["browser", "pwa"]),
3161
- next: z15.string().default("/"),
3162
- handoff: z15.boolean().default(false)
3163
- });
3164
- var OidcBeginResponse = z15.object({
3165
- authorizeUrl: z15.string(),
3166
- flowId: z15.string().nullable(),
3167
- pollToken: z15.string().nullable()
3168
- });
3169
- var OidcClaimRequest = z15.object({ flowId: z15.string(), pollToken: z15.string() });
3170
- var OidcClaimResponse = z15.union([
3171
- z15.object({ status: z15.literal("pending") }),
3172
- z15.object({ status: z15.literal("done"), deviceId: z15.string() })
2690
+ next: z12.string().default("/"),
2691
+ handoff: z12.boolean().default(false)
2692
+ });
2693
+ var OidcBeginResponse = z12.object({
2694
+ authorizeUrl: z12.string(),
2695
+ flowId: z12.string().nullable(),
2696
+ pollToken: z12.string().nullable()
2697
+ });
2698
+ var OidcClaimRequest = z12.object({ flowId: z12.string(), pollToken: z12.string() });
2699
+ var OidcClaimResponse = z12.union([
2700
+ z12.object({ status: z12.literal("pending") }),
2701
+ z12.object({ status: z12.literal("done"), deviceId: z12.string() })
3173
2702
  ]);
3174
- var TerminalLoginStartRequest = z15.object({ name: z15.string().min(1).max(80) });
3175
- var TerminalLoginStartResponse = z15.object({
3176
- userCode: z15.string(),
3177
- pollToken: z15.string(),
3178
- verifyUrl: z15.string(),
3179
- expiresAt: z15.string(),
3180
- intervalMs: z15.number().int()
3181
- });
3182
- var TerminalLoginClaimRequest = z15.object({
3183
- userCode: z15.string().min(1),
3184
- pollToken: z15.string().min(1)
3185
- });
3186
- var TerminalLoginClaimResponse = z15.union([
3187
- z15.object({ status: z15.literal("pending") }),
3188
- z15.object({ status: z15.literal("denied") }),
3189
- z15.object({ status: z15.literal("done"), deviceId: z15.string(), credential: z15.string() })
2703
+ var TerminalLoginStartRequest = z12.object({ name: z12.string().min(1).max(80) });
2704
+ var TerminalLoginStartResponse = z12.object({
2705
+ userCode: z12.string(),
2706
+ pollToken: z12.string(),
2707
+ verifyUrl: z12.string(),
2708
+ expiresAt: z12.string(),
2709
+ intervalMs: z12.number().int()
2710
+ });
2711
+ var TerminalLoginClaimRequest = z12.object({
2712
+ userCode: z12.string().min(1),
2713
+ pollToken: z12.string().min(1)
2714
+ });
2715
+ var TerminalLoginClaimResponse = z12.union([
2716
+ z12.object({ status: z12.literal("pending") }),
2717
+ z12.object({ status: z12.literal("denied") }),
2718
+ z12.object({ status: z12.literal("done"), deviceId: z12.string(), credential: z12.string() })
3190
2719
  ]);
3191
- var TerminalLoginRequest = z15.object({
3192
- userCode: z15.string(),
3193
- name: z15.string(),
3194
- requestedFrom: z15.string(),
3195
- createdAt: z15.string(),
3196
- expiresAt: z15.string(),
3197
- status: z15.enum(["pending", "approved", "denied"])
3198
- });
3199
- var AuthMethods = z15.object({
3200
- passkeys: z15.array(Passkey),
3201
- passkeyAvailability: z15.object({ available: z15.boolean(), reason: z15.string().nullable() }),
3202
- oidc: z15.object({
3203
- issuer: z15.string(),
3204
- label: z15.string(),
3205
- ownerMatch: z15.string(),
3206
- status: z15.enum(["ready", "error"]),
3207
- error: z15.string().nullable()
2720
+ var TerminalLoginRequest = z12.object({
2721
+ userCode: z12.string(),
2722
+ name: z12.string(),
2723
+ requestedFrom: z12.string(),
2724
+ createdAt: z12.string(),
2725
+ expiresAt: z12.string(),
2726
+ status: z12.enum(["pending", "approved", "denied"])
2727
+ });
2728
+ var AuthMethods = z12.object({
2729
+ passkeys: z12.array(Passkey),
2730
+ passkeyAvailability: z12.object({ available: z12.boolean(), reason: z12.string().nullable() }),
2731
+ oidc: z12.object({
2732
+ issuer: z12.string(),
2733
+ label: z12.string(),
2734
+ ownerMatch: z12.string(),
2735
+ status: z12.enum(["ready", "error"]),
2736
+ error: z12.string().nullable()
3208
2737
  }).nullable()
3209
2738
  });
3210
- var MeResponse = z15.object({
2739
+ var MeResponse = z12.object({
3211
2740
  device: Device,
3212
- admin: z15.boolean(),
3213
- publicUrl: z15.string()
2741
+ admin: z12.boolean(),
2742
+ publicUrl: z12.string()
3214
2743
  });
3215
- var ClientBindingInput = z15.object({ mirror: ClientMirror, scopeId: z15.string().min(1).nullable().optional() }).refine((b) => b.mirror === "scope" === !!b.scopeId, {
2744
+ var ClientBindingInput = z12.object({ mirror: ClientMirror, scopeId: z12.string().min(1).nullable().optional() }).refine((b) => b.mirror === "scope" === !!b.scopeId, {
3216
2745
  message: "scopeId is required for mirror=scope and only then"
3217
2746
  });
3218
2747
  var ClientReport = Client.pick({ kind: true, name: true, machine: true }).extend({
3219
- hostId: z15.string().nullable().optional(),
2748
+ hostId: z12.string().nullable().optional(),
3220
2749
  /** Sessions in its mirror tabs or windows; omitted when unchanged or unknown. */
3221
- shows: z15.array(z15.string()).max(1e3).optional(),
2750
+ shows: z12.array(z12.string()).max(1e3).optional(),
3222
2751
  /** The binding this client had before bindings were recorded (env file); applied only when none is recorded. */
3223
2752
  seed: ClientBindingInput.optional()
3224
2753
  });
3225
- var ScopeInput = z15.object({
2754
+ var ScopeInput = z12.object({
3226
2755
  name: Scope.shape.name,
3227
2756
  mode: Scope.shape.mode.optional(),
3228
2757
  projectIds: Scope.shape.projectIds.optional(),
@@ -3230,7 +2759,7 @@ var ScopeInput = z15.object({
3230
2759
  /** A GitHub source makes this a GitHub scope; its projects are then kept by GitHub. */
3231
2760
  source: GitHubSourceInput.nullable().optional()
3232
2761
  });
3233
- var ScopePatch = z15.object({
2762
+ var ScopePatch = z12.object({
3234
2763
  name: Scope.shape.name.optional(),
3235
2764
  mode: Scope.shape.mode.optional(),
3236
2765
  projectIds: Scope.shape.projectIds.optional(),
@@ -3238,100 +2767,181 @@ var ScopePatch = z15.object({
3238
2767
  /** null removes the source; an object changes it, or adds one (then hostId and owner are required). */
3239
2768
  source: GitHubSourcePatch.nullable().optional()
3240
2769
  });
3241
- var ProjectSuggestionsResponse = z15.object({
3242
- suggestions: z15.array(ProjectSuggestion.extend({ name: z15.string(), preselected: z15.boolean() }))
3243
- });
3244
2770
 
3245
2771
  // packages/protocol/dist/scopes.js
3246
2772
  var CLIENT_OPEN_MS = 10 * 6e4;
3247
2773
 
3248
2774
  // packages/protocol/dist/catalog.js
3249
- import { z as z16 } from "zod";
3250
- var CatalogRepository = z16.strictObject({
3251
- authority: z16.string().min(1),
3252
- externalId: z16.string().min(1),
3253
- owner: z16.string().min(1),
3254
- name: z16.string().min(1),
3255
- webUrl: z16.url({ protocol: /^https$/ }),
3256
- cloneUrl: z16.url({ protocol: /^https$/ }),
3257
- defaultBranch: z16.string().nullable()
3258
- });
3259
- var CatalogAccountType = z16.enum(["personal", "organization"]);
3260
- var CatalogConnectionKind = z16.enum(["github_app", "pat"]);
3261
- var CatalogSelection = z16.strictObject({
3262
- owners: z16.array(z16.string().min(1).max(39)).max(50),
3263
- repositories: z16.array(z16.string().min(1).max(140)).max(500)
3264
- });
3265
- var CatalogConnectionStatus = z16.object({
3266
- id: z16.string(),
2775
+ import { z as z13 } from "zod";
2776
+ var CatalogRepository = z13.strictObject({
2777
+ authority: z13.string().min(1),
2778
+ externalId: z13.string().min(1),
2779
+ owner: z13.string().min(1),
2780
+ name: z13.string().min(1),
2781
+ webUrl: z13.url({ protocol: /^https$/ }),
2782
+ cloneUrl: z13.url({ protocol: /^https$/ }),
2783
+ defaultBranch: z13.string().nullable()
2784
+ });
2785
+ var CatalogAccountType = z13.enum(["personal", "organization"]);
2786
+ var CatalogConnectionKind = z13.enum(["github_app", "pat"]);
2787
+ var CatalogSelection = z13.strictObject({
2788
+ owners: z13.array(z13.string().min(1).max(39)).max(50),
2789
+ repositories: z13.array(z13.string().min(1).max(140)).max(500)
2790
+ });
2791
+ var CatalogConnectionStatus = z13.object({
2792
+ id: z13.string(),
3267
2793
  kind: CatalogConnectionKind.default("github_app"),
3268
- account: z16.string(),
2794
+ authority: z13.string().min(1).default("github.com"),
2795
+ account: z13.string(),
3269
2796
  accountType: CatalogAccountType,
3270
- state: z16.enum(["pending", "ready", "stale", "suspended", "removed", "disconnected"]),
3271
- lastSyncedAt: z16.string().nullable(),
3272
- lastError: z16.string().nullable(),
3273
- installUrl: z16.string().nullable(),
3274
- manageUrl: z16.string().nullable(),
2797
+ state: z13.enum(["pending", "ready", "stale", "suspended", "removed", "disconnected"]),
2798
+ lastSyncedAt: z13.string().nullable(),
2799
+ lastError: z13.string().nullable(),
2800
+ installUrl: z13.string().nullable(),
2801
+ manageUrl: z13.string().nullable(),
3275
2802
  selection: CatalogSelection.nullable().optional()
3276
2803
  });
3277
- var CatalogAvailableOwner = z16.object({
3278
- login: z16.string(),
2804
+ var CatalogAvailableOwner = z13.object({
2805
+ login: z13.string(),
3279
2806
  type: CatalogAccountType
3280
2807
  });
3281
- var CatalogAvailableInventory = z16.object({
3282
- account: z16.string(),
3283
- owners: z16.array(CatalogAvailableOwner),
3284
- repositories: z16.array(CatalogRepository)
2808
+ var CatalogAvailableInventory = z13.object({
2809
+ account: z13.string(),
2810
+ owners: z13.array(CatalogAvailableOwner),
2811
+ repositories: z13.array(CatalogRepository)
3285
2812
  });
3286
- var ConnectPatRequest = z16.strictObject({
3287
- token: z16.string().trim().min(10).max(512),
2813
+ var ConnectPatRequest = z13.strictObject({
2814
+ token: z13.string().trim().min(10).max(512),
3288
2815
  selection: CatalogSelection.optional()
3289
2816
  });
3290
- var UpdateCatalogSelectionRequest = z16.strictObject({
2817
+ var UpdateCatalogSelectionRequest = z13.strictObject({
3291
2818
  selection: CatalogSelection
3292
2819
  });
3293
- var CheckoutPreviewRequest = z16.strictObject({
3294
- hostId: z16.string().min(1),
3295
- folderName: z16.string().min(1).max(128).optional()
2820
+ var CheckoutPreviewRequest = z13.strictObject({
2821
+ hostId: z13.string().min(1),
2822
+ folderName: z13.string().min(1).max(128).optional()
3296
2823
  });
3297
- var CheckoutProvisionRequest = z16.strictObject({ previewId: z16.string().min(1).max(128) });
2824
+ var CheckoutProvisionRequest = z13.strictObject({ previewId: z13.string().min(1).max(128) });
3298
2825
 
3299
2826
  // packages/protocol/dist/client-wire.js
3300
- import { z as z17 } from "zod";
3301
- var SyncState = z17.object({
3302
- hosts: z17.array(Host),
3303
- projects: z17.array(Project),
3304
- checkouts: z17.array(Checkout),
3305
- workspaces: z17.array(Workspace),
3306
- profiles: z17.array(Profile),
2827
+ import { z as z15 } from "zod";
2828
+
2829
+ // packages/protocol/dist/events.js
2830
+ import { z as z14 } from "zod";
2831
+ var EventDataSchemas = {
2832
+ "host.updated": Host,
2833
+ "project.updated": Project,
2834
+ "project.deleted": z14.object({ id: z14.string() }),
2835
+ "checkout.updated": Checkout,
2836
+ "workspace.updated": Workspace,
2837
+ "workspace.deleted": z14.object({ id: z14.string() }),
2838
+ "profile.updated": Profile,
2839
+ "profile.deleted": z14.object({ id: z14.string() }),
2840
+ "scope.updated": Scope,
2841
+ "scope.deleted": z14.object({ id: z14.string() }),
2842
+ "session.updated": Session,
2843
+ "transcript.item": TranscriptItem,
2844
+ "transcript.reset": z14.object({ sessionId: z14.string(), epoch: z14.number().int() }),
2845
+ "interaction.updated": Interaction,
2846
+ "panel.updated": Panel,
2847
+ "adapters.updated": z14.object({ hostId: z14.string(), adapters: z14.array(AdapterInfo) }),
2848
+ diagnostic: Diagnostic,
2849
+ "task.updated": Task,
2850
+ "task.deleted": z14.object({ id: z14.string() }),
2851
+ "run.updated": Run,
2852
+ "automation.updated": Automation,
2853
+ "automation.deleted": z14.object({ id: z14.string() }),
2854
+ "occurrence.created": Occurrence,
2855
+ "occurrence.updated": Occurrence,
2856
+ "attention.updated": AttentionItem,
2857
+ "device.updated": Device,
2858
+ "issue.updated": TrackedIssue,
2859
+ "issue.deleted": z14.object({ id: z14.string() }),
2860
+ "client.updated": Client,
2861
+ "client.deleted": z14.object({ id: z14.string() }),
2862
+ "settings.updated": z14.object({ dispatchPaused: z14.boolean() })
2863
+ };
2864
+ var EVENT_TYPES = Object.keys(EventDataSchemas);
2865
+ var LEGACY_EVENT_TYPES = {
2866
+ "workspace.removed": "workspace.deleted"
2867
+ };
2868
+ function canonicalEventType(type) {
2869
+ return LEGACY_EVENT_TYPES[type] ?? type;
2870
+ }
2871
+ var canonical = (v) => typeof v === "string" ? canonicalEventType(v) : v;
2872
+ var EventTypeSchema = z14.preprocess(canonical, z14.enum(EVENT_TYPES));
2873
+ var EventScope = z14.object({
2874
+ hostId: z14.string().optional(),
2875
+ sessionId: z14.string().optional(),
2876
+ taskId: z14.string().optional(),
2877
+ projectId: z14.string().optional()
2878
+ });
2879
+ var EventEnvelope = EventScope.extend({
2880
+ seq: z14.number().int(),
2881
+ id: z14.string(),
2882
+ type: EventTypeSchema,
2883
+ at: z14.string(),
2884
+ data: z14.unknown()
2885
+ });
2886
+ var HOST_EVENT_TYPES = [
2887
+ "session.updated",
2888
+ "transcript.item",
2889
+ "interaction.updated",
2890
+ "panel.updated",
2891
+ "adapters.updated",
2892
+ "diagnostic",
2893
+ "workspace.updated",
2894
+ "workspace.deleted"
2895
+ ];
2896
+ var HostEvent = EventScope.extend({
2897
+ eventId: z14.string(),
2898
+ type: z14.preprocess(canonical, z14.enum(HOST_EVENT_TYPES)),
2899
+ at: z14.string(),
2900
+ data: z14.unknown()
2901
+ });
2902
+ var StreamDelta = z14.object({
2903
+ sessionId: z14.string(),
2904
+ itemId: z14.string(),
2905
+ kind: z14.enum(["text", "thinking", "tool_args", "tool_output"]),
2906
+ delta: z14.string(),
2907
+ order: z14.number().int().optional()
2908
+ });
2909
+
2910
+ // packages/protocol/dist/client-wire.js
2911
+ var SyncState = z15.object({
2912
+ hosts: z15.array(Host),
2913
+ projects: z15.array(Project),
2914
+ checkouts: z15.array(Checkout),
2915
+ workspaces: z15.array(Workspace),
2916
+ profiles: z15.array(Profile),
3307
2917
  /** Scopes; absent from coordinators before 0.21. */
3308
- scopes: z17.array(Scope).default([]),
3309
- sessions: z17.array(Session),
3310
- tasks: z17.array(Task),
3311
- runs: z17.array(Run),
3312
- automations: z17.array(Automation),
3313
- attention: z17.array(AttentionItem),
3314
- interactions: z17.array(Interaction),
3315
- panels: z17.array(Panel),
3316
- devices: z17.array(Device),
2918
+ scopes: z15.array(Scope).default([]),
2919
+ sessions: z15.array(Session),
2920
+ tasks: z15.array(Task),
2921
+ runs: z15.array(Run),
2922
+ automations: z15.array(Automation),
2923
+ attention: z15.array(AttentionItem),
2924
+ interactions: z15.array(Interaction),
2925
+ panels: z15.array(Panel),
2926
+ devices: z15.array(Device),
3317
2927
  /** Tracked issues; absent from older coordinators. */
3318
- issues: z17.array(TrackedIssue).default([]),
2928
+ issues: z15.array(TrackedIssue).default([]),
3319
2929
  /** Clients (herdr and tmux sessions); absent from coordinators before 0.21. */
3320
- clients: z17.array(Client).default([]),
3321
- adapters: z17.record(z17.string(), z17.array(AdapterInfo)),
3322
- dispatchPaused: z17.boolean()
3323
- });
3324
- var Presence = z17.object({
3325
- foreground: z17.boolean(),
3326
- interactedAt: z17.string().nullable(),
3327
- viewing: z17.object({ sessionId: z17.string() }).nullable(),
2930
+ clients: z15.array(Client).default([]),
2931
+ adapters: z15.record(z15.string(), z15.array(AdapterInfo)),
2932
+ dispatchPaused: z15.boolean()
2933
+ });
2934
+ var Presence = z15.object({
2935
+ foreground: z15.boolean(),
2936
+ interactedAt: z15.string().nullable(),
2937
+ viewing: z15.object({ sessionId: z15.string() }).nullable(),
3328
2938
  /**
3329
2939
  * A herdr or tmux daemon reporting the session focused in its client (kept apart from the
3330
2940
  * device's own presence).
3331
2941
  */
3332
- clientId: z17.string().min(1).max(200).optional(),
2942
+ clientId: z15.string().min(1).max(200).optional(),
3333
2943
  /** COMPAT(scopes-rename): remove after 2027-03-01. The old name of clientId. */
3334
- terminalId: z17.string().min(1).max(200).optional()
2944
+ terminalId: z15.string().min(1).max(200).optional()
3335
2945
  });
3336
2946
  var CLIENT_CAPABILITIES = [
3337
2947
  "adapter.slots.v1",
@@ -3342,37 +2952,436 @@ var CLIENT_CAPABILITIES = [
3342
2952
  /** The client draws checklist, facts, rows and badge nodes, `section.open` and URL refs. */
3343
2953
  "ui.nodes.v2",
3344
2954
  /** The client draws `composer.tracker` and `session.badge` contributions. */
3345
- "adapter.trackers.v1"
2955
+ "adapter.trackers.v1",
2956
+ /** The client draws `composer.suggestion` contributions in the composer. */
2957
+ "composer.suggestions.v1"
3346
2958
  ];
3347
- var ClientToServer = z17.discriminatedUnion("type", [
3348
- z17.object({
3349
- type: z17.literal("hello"),
3350
- cursor: z17.number().int().nullable(),
3351
- capabilities: z17.array(z17.string().min(1).max(80)).max(32).optional(),
3352
- projectionId: z17.string().max(256).nullable().optional()
2959
+ var ClientToServer = z15.discriminatedUnion("type", [
2960
+ z15.object({
2961
+ type: z15.literal("hello"),
2962
+ cursor: z15.number().int().nullable(),
2963
+ capabilities: z15.array(z15.string().min(1).max(80)).max(32).optional(),
2964
+ projectionId: z15.string().max(256).nullable().optional()
2965
+ }),
2966
+ z15.object({ type: z15.literal("presence"), presence: Presence }),
2967
+ z15.object({ type: z15.literal("ping") })
2968
+ ]);
2969
+ var ServerToClient = z15.discriminatedUnion("type", [
2970
+ z15.object({
2971
+ type: z15.literal("replay"),
2972
+ seq: z15.number().int(),
2973
+ events: z15.array(EventEnvelope),
2974
+ capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
2975
+ projectionId: z15.string().optional()
2976
+ }),
2977
+ z15.object({
2978
+ type: z15.literal("snapshot"),
2979
+ seq: z15.number().int(),
2980
+ state: SyncState,
2981
+ capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
2982
+ projectionId: z15.string().optional()
2983
+ }),
2984
+ z15.object({ type: z15.literal("event"), event: EventEnvelope }),
2985
+ z15.object({ type: z15.literal("stream"), delta: StreamDelta }),
2986
+ z15.object({ type: z15.literal("pong") }),
2987
+ z15.object({ type: z15.literal("force_logout"), reason: z15.string() })
2988
+ ]);
2989
+
2990
+ // packages/protocol/dist/host-wire.js
2991
+ import { z as z17 } from "zod";
2992
+
2993
+ // packages/protocol/dist/terminal-wire.js
2994
+ import { z as z16 } from "zod";
2995
+ var Cols = z16.number().int().min(10).max(1e3);
2996
+ var Rows = z16.number().int().min(5).max(500);
2997
+ var TermViewerToServer = z16.discriminatedUnion("t", [
2998
+ z16.object({ t: z16.literal("in"), d: z16.string() }),
2999
+ z16.object({ t: z16.literal("resize"), cols: Cols, rows: Rows }),
3000
+ z16.object({ t: z16.literal("claim") })
3001
+ ]);
3002
+ var TermServerToViewer = z16.discriminatedUnion("t", [
3003
+ z16.object({ t: z16.literal("out"), d: z16.string() }),
3004
+ z16.object({ t: z16.literal("closed"), reason: z16.string() }),
3005
+ z16.object({ t: z16.literal("size"), cols: Cols, rows: Rows, owner: z16.boolean() })
3006
+ ]);
3007
+ var TermCoordinatorMsg = z16.discriminatedUnion("t", [
3008
+ z16.object({
3009
+ t: z16.literal("open"),
3010
+ sessionId: z16.string(),
3011
+ cols: Cols,
3012
+ rows: Rows,
3013
+ passive: z16.boolean().optional()
3353
3014
  }),
3354
- z17.object({ type: z17.literal("presence"), presence: Presence }),
3355
- z17.object({ type: z17.literal("ping") })
3015
+ z16.object({ t: z16.literal("claim") }),
3016
+ z16.object({ t: z16.literal("in"), d: z16.string() }),
3017
+ z16.object({ t: z16.literal("resize"), cols: Cols, rows: Rows }),
3018
+ z16.object({ t: z16.literal("close") })
3356
3019
  ]);
3357
- var ServerToClient = z17.discriminatedUnion("type", [
3020
+
3021
+ // packages/protocol/dist/host-wire.js
3022
+ var Origin = z17.enum(["human", "automation"]);
3023
+ var DiffRev = z17.string().regex(/^(uncommitted|[0-9a-f]{40})$/);
3024
+ var HostCommand = z17.discriminatedUnion("type", [
3358
3025
  z17.object({
3359
- type: z17.literal("replay"),
3360
- seq: z17.number().int(),
3361
- events: z17.array(EventEnvelope),
3362
- capabilities: z17.array(z17.enum(CLIENT_CAPABILITIES)).optional(),
3363
- projectionId: z17.string().optional()
3026
+ type: z17.literal("session.start"),
3027
+ sessionId: z17.string(),
3028
+ title: z17.string(),
3029
+ workspacePath: z17.string(),
3030
+ projectId: z17.string().nullable(),
3031
+ profile: Profile,
3032
+ nativeHandle: NativeHandle.nullable(),
3033
+ initialPrompt: z17.string().nullable(),
3034
+ dispatchKey: z17.string().nullable(),
3035
+ controlRevision: z17.number().int(),
3036
+ controlMode: ControlMode,
3037
+ origin: Origin,
3038
+ readOnly: z17.boolean().default(false),
3039
+ policyRequired: z17.boolean().optional()
3364
3040
  }),
3365
3041
  z17.object({
3366
- type: z17.literal("snapshot"),
3367
- seq: z17.number().int(),
3368
- state: SyncState,
3369
- capabilities: z17.array(z17.enum(CLIENT_CAPABILITIES)).optional(),
3370
- projectionId: z17.string().optional()
3042
+ type: z17.literal("session.deliverMessage"),
3043
+ sessionId: z17.string(),
3044
+ messageId: z17.string(),
3045
+ payload: z17.object({
3046
+ deliveryId: z17.string(),
3047
+ kind: z17.enum(["message", "completion"]),
3048
+ text: z17.string()
3049
+ }),
3050
+ mode: z17.enum(["steer", "queue"]),
3051
+ holdUntil: z17.string()
3052
+ }),
3053
+ HostPolicySampleRequest.extend({ type: z17.literal("session.classifyPolicySample") }),
3054
+ z17.object({
3055
+ type: z17.literal("session.messageStatus"),
3056
+ sessionId: z17.string(),
3057
+ messageIds: z17.array(z17.string().min(1)).min(1).max(100)
3058
+ }),
3059
+ z17.object({
3060
+ type: z17.literal("session.prompt"),
3061
+ sessionId: z17.string(),
3062
+ text: z17.string(),
3063
+ images: z17.array(z17.object({ mimeType: z17.string(), data: z17.string() })).default([]),
3064
+ mode: z17.enum(["prompt", "steer", "followUp"]),
3065
+ origin: Origin,
3066
+ controlRevision: z17.number().int()
3067
+ }),
3068
+ z17.object({ type: z17.literal("session.abort"), sessionId: z17.string(), clearQueue: z17.boolean() }),
3069
+ /** `queueClear.v1`: empty Pi's queue without aborting; the receipt's result has the messages. */
3070
+ z17.object({ type: z17.literal("session.clearQueue"), sessionId: z17.string() }),
3071
+ z17.object({ type: z17.literal("session.stop"), sessionId: z17.string() }),
3072
+ z17.object({
3073
+ type: z17.literal("session.answer"),
3074
+ sessionId: z17.string(),
3075
+ interactionId: z17.string(),
3076
+ revision: z17.number().int(),
3077
+ response: InteractionResponseSchema,
3078
+ deviceId: z17.string()
3079
+ }),
3080
+ z17.object({
3081
+ type: z17.literal("session.adapterAction"),
3082
+ sessionId: z17.string(),
3083
+ generation: z17.string().uuid().optional(),
3084
+ adapterId: z17.string(),
3085
+ actionId: z17.string(),
3086
+ payload: z17.unknown()
3371
3087
  }),
3372
- z17.object({ type: z17.literal("event"), event: EventEnvelope }),
3088
+ z17.object({
3089
+ type: z17.literal("session.setControl"),
3090
+ sessionId: z17.string(),
3091
+ controlRevision: z17.number().int(),
3092
+ mode: ControlMode
3093
+ }),
3094
+ z17.object({ type: z17.literal("session.rename"), sessionId: z17.string(), title: z17.string() }),
3095
+ z17.object({ type: z17.literal("session.importable") }),
3096
+ z17.object({ type: z17.literal("session.readNative"), sessionFile: z17.string() }),
3097
+ z17.object({ type: z17.literal("session.snapshot"), sessionId: z17.string() }),
3098
+ z17.object({ type: z17.literal("session.models"), sessionId: z17.string() }),
3099
+ z17.object({ type: z17.literal("session.commands"), sessionId: z17.string() }),
3100
+ z17.object({
3101
+ type: z17.literal("session.complete"),
3102
+ sessionId: z17.string(),
3103
+ text: z17.string().max(500)
3104
+ }),
3105
+ z17.object({ type: z17.literal("session.tree"), sessionId: z17.string() }),
3106
+ z17.object({
3107
+ type: z17.literal("session.branch"),
3108
+ sessionId: z17.string(),
3109
+ entryId: z17.string().nullable(),
3110
+ fork: z17.boolean()
3111
+ }),
3112
+ z17.object({
3113
+ type: z17.literal("session.navigate"),
3114
+ sessionId: z17.string(),
3115
+ entryId: z17.string(),
3116
+ summarize: z17.boolean(),
3117
+ instructions: z17.string().max(2e3).nullable()
3118
+ }),
3119
+ z17.object({ type: z17.literal("session.reload"), sessionId: z17.string() }),
3120
+ z17.object({ type: z17.literal("session.adapters"), sessionId: z17.string() }),
3121
+ z17.object({ type: z17.literal("session.reloadAdapters"), sessionId: z17.string() }),
3122
+ z17.object({ type: z17.literal("session.export"), sessionId: z17.string() }),
3123
+ z17.object({
3124
+ type: z17.literal("session.setModel"),
3125
+ sessionId: z17.string(),
3126
+ provider: z17.string().min(1),
3127
+ modelId: z17.string().min(1)
3128
+ }),
3129
+ z17.object({ type: z17.literal("session.setThinking"), sessionId: z17.string(), level: ThinkingLevel }),
3130
+ z17.object({
3131
+ type: z17.literal("session.compact"),
3132
+ sessionId: z17.string(),
3133
+ instructions: z17.string().nullable()
3134
+ }),
3135
+ z17.object({ type: z17.literal("checkout.inspect"), path: z17.string() }),
3136
+ z17.strictObject({
3137
+ type: z17.literal("checkout.preview"),
3138
+ root: z17.string().min(1).max(4096),
3139
+ folderName: z17.string().min(1).max(128)
3140
+ }),
3141
+ z17.strictObject({
3142
+ type: z17.literal("checkout.provision"),
3143
+ root: z17.string().min(1).max(4096),
3144
+ folderName: z17.string().min(1).max(128),
3145
+ expectedPath: z17.string().min(1).max(4096),
3146
+ cloneUrl: z17.string().min(1).max(4096),
3147
+ /** Only carried by a confirmed live command. Never persist or replay this payload. */
3148
+ grant: z17.strictObject({
3149
+ token: z17.string().min(1).max(4096).refine((token) => !/[^!-~]/.test(token)),
3150
+ expiresAt: z17.iso.datetime({ offset: true })
3151
+ })
3152
+ }),
3153
+ z17.strictObject({ type: z17.literal("checkout.locate"), cwd: z17.string().min(1).max(4096) }),
3154
+ z17.object({
3155
+ type: z17.literal("workspace.discover"),
3156
+ checkoutPath: z17.string(),
3157
+ worktreeDir: z17.string().default(DEFAULT_WORKTREE_DIR)
3158
+ }),
3159
+ z17.object({
3160
+ type: z17.literal("workspace.create"),
3161
+ checkoutPath: z17.string(),
3162
+ branch: z17.string(),
3163
+ base: z17.string(),
3164
+ setupCommand: z17.string().nullable(),
3165
+ worktreeDir: z17.string().default(DEFAULT_WORKTREE_DIR)
3166
+ }),
3167
+ z17.object({ type: z17.literal("workspace.status"), path: z17.string(), base: z17.string().nullable() }),
3168
+ z17.object({
3169
+ type: z17.literal("workspace.remove"),
3170
+ path: z17.string(),
3171
+ checkoutPath: z17.string(),
3172
+ base: z17.string().nullable(),
3173
+ force: z17.object({ dirty: z17.boolean(), unmerged: z17.boolean() }),
3174
+ /** Also delete the worktree's local branch (hosts before GitHub issue sync ignore it). */
3175
+ deleteBranch: z17.boolean().optional()
3176
+ }),
3177
+ z17.object({
3178
+ type: z17.literal("workspace.diff"),
3179
+ path: z17.string(),
3180
+ base: z17.string().nullable(),
3181
+ file: z17.string().nullable(),
3182
+ /** Hosts without gitLog.v1 never receive it. */
3183
+ rev: DiffRev.optional()
3184
+ }),
3185
+ z17.object({
3186
+ type: z17.literal("workspace.log"),
3187
+ path: z17.string(),
3188
+ base: z17.string().nullable(),
3189
+ limit: z17.number().int().min(1).max(200)
3190
+ }),
3191
+ z17.object({ type: z17.literal("workspace.files"), path: z17.string(), dir: z17.string() }),
3192
+ z17.object({ type: z17.literal("workspace.readFile"), path: z17.string(), file: z17.string() }),
3193
+ IssueHostPrepareBranchRequest.extend({ type: z17.literal("tracker.prepareBranch") }),
3194
+ z17.object({
3195
+ type: z17.literal("dispatch.start"),
3196
+ dispatchKey: z17.string(),
3197
+ runId: z17.string(),
3198
+ taskId: z17.string(),
3199
+ sessionId: z17.string(),
3200
+ projectId: z17.string(),
3201
+ title: z17.string(),
3202
+ workspace: z17.union([
3203
+ z17.object({ path: z17.string() }),
3204
+ z17.object({
3205
+ createFrom: z17.object({
3206
+ checkoutPath: z17.string(),
3207
+ branch: z17.string(),
3208
+ base: z17.string(),
3209
+ setupCommand: z17.string().nullable(),
3210
+ worktreeDir: z17.string().default(DEFAULT_WORKTREE_DIR)
3211
+ })
3212
+ })
3213
+ ]),
3214
+ nativeHandle: NativeHandle.nullable(),
3215
+ profile: Profile,
3216
+ prompt: z17.string(),
3217
+ /** The launch's own revision; a takeover always carries a newer one. */
3218
+ controlRevision: z17.number().int(),
3219
+ controlMode: ControlMode.default("automation"),
3220
+ policyRequired: z17.boolean().optional()
3221
+ }),
3222
+ z17.object({ type: z17.literal("dispatch.reconcile"), dispatchKey: z17.string() }),
3223
+ z17.object({
3224
+ type: z17.literal("checks.run"),
3225
+ sessionId: z17.string(),
3226
+ path: z17.string(),
3227
+ commands: z17.array(z17.string())
3228
+ })
3229
+ ]);
3230
+ var ImportableSession = z17.object({
3231
+ sessionFile: z17.string(),
3232
+ sessionId: z17.string(),
3233
+ cwd: z17.string(),
3234
+ name: z17.string().nullable(),
3235
+ mtime: z17.string(),
3236
+ inactive: z17.boolean()
3237
+ });
3238
+ var DiscoveredWorktree = z17.object({
3239
+ path: z17.string(),
3240
+ head: z17.string().nullable(),
3241
+ branch: z17.string().nullable(),
3242
+ bare: z17.boolean(),
3243
+ detached: z17.boolean(),
3244
+ locked: z17.boolean(),
3245
+ prunable: z17.boolean(),
3246
+ provenance: z17.enum(["managed", "discovered", "main"]),
3247
+ git: GitState.nullable()
3248
+ });
3249
+ var CheckoutInfo = z17.object({
3250
+ root: z17.string(),
3251
+ commonDir: z17.string(),
3252
+ repoIdentity: z17.string(),
3253
+ defaultBranch: z17.string()
3254
+ });
3255
+ var CheckoutPreviewResult = z17.object({
3256
+ path: z17.string(),
3257
+ root: z17.string(),
3258
+ state: z17.enum(["missing", "existing", "collision"]),
3259
+ checkout: CheckoutInfo.optional()
3260
+ });
3261
+ var CheckoutLocateResult = z17.object({ checkout: CheckoutInfo, worktreePath: z17.string() }).nullable();
3262
+ var GitCommit = z17.object({
3263
+ sha: z17.string().regex(/^[0-9a-f]{40}$/),
3264
+ subject: z17.string().max(300),
3265
+ author: z17.string().max(200),
3266
+ authoredAt: z17.string(),
3267
+ pushed: z17.boolean()
3268
+ });
3269
+ var LogResult = z17.object({
3270
+ /** The base branch the commits are counted from. */
3271
+ base: z17.string(),
3272
+ /** `branch`: commits since the merge base; `recent`: HEAD's latest commits (no commits of its own). */
3273
+ scope: z17.enum(["branch", "recent"]),
3274
+ commits: z17.array(GitCommit).max(200),
3275
+ truncated: z17.boolean(),
3276
+ /** Changed and untracked files not committed yet. */
3277
+ uncommitted: z17.number().int().min(0)
3278
+ });
3279
+ var DiffFile = z17.object({
3280
+ path: z17.string(),
3281
+ oldPath: z17.string().nullable(),
3282
+ added: z17.number().int(),
3283
+ deleted: z17.number().int(),
3284
+ status: z17.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
3285
+ });
3286
+ var DiffResult = z17.object({
3287
+ base: z17.string(),
3288
+ files: z17.array(DiffFile),
3289
+ patch: z17.string().nullable()
3290
+ });
3291
+ var FileEntry = z17.object({
3292
+ name: z17.string(),
3293
+ path: z17.string(),
3294
+ kind: z17.enum(["file", "dir", "symlink"]),
3295
+ size: z17.number().int().nullable()
3296
+ });
3297
+ var ReconcileResult = z17.union([
3298
+ z17.object({ known: z17.literal(false) }),
3299
+ z17.object({
3300
+ known: z17.literal(true),
3301
+ sessionId: z17.string().nullable(),
3302
+ state: z17.enum(["accepted", "workspace_ready", "started", "failed"]),
3303
+ runtime: RuntimeState.nullable(),
3304
+ workspacePath: z17.string().nullable(),
3305
+ nativeHandle: NativeHandle.nullable(),
3306
+ error: z17.string().nullable(),
3307
+ /** `{started: "unknown"}` when the host restarted after Pi may have been spawned. */
3308
+ errorDetails: z17.record(z17.string(), z17.unknown()).nullable().default(null)
3309
+ })
3310
+ ]);
3311
+ var DispatchStartResult = z17.object({
3312
+ sessionId: z17.string(),
3313
+ workspacePath: z17.string(),
3314
+ nativeHandle: NativeHandle.nullable(),
3315
+ reused: z17.boolean(),
3316
+ /** Why the launch prompt was not delivered to Pi (the session itself started), if it was not. */
3317
+ promptError: z17.string().nullable().optional()
3318
+ });
3319
+ var AnswerResult = z17.object({
3320
+ status: z17.enum(["answered", "already_answered"]),
3321
+ interaction: Interaction
3322
+ });
3323
+ var SnapshotResult = z17.object({
3324
+ partial: z17.array(TranscriptItem),
3325
+ pendingInteractions: z17.array(Interaction)
3326
+ });
3327
+ var ChecksResult = z17.object({ results: z17.array(CheckResult) });
3328
+ var Receipt = z17.union([
3329
+ z17.object({ commandId: z17.string(), ok: z17.literal(true), result: z17.unknown() }),
3330
+ z17.object({ commandId: z17.string(), ok: z17.literal(false), error: ErrorBody })
3331
+ ]);
3332
+ var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
3333
+ policyContext: HostToolPolicyContext.optional()
3334
+ }).strict().superRefine((frame, ctx) => {
3335
+ if (frame.method === "policy.evaluate" ? frame.policyContext === void 0 : Object.hasOwn(frame, "policyContext")) {
3336
+ ctx.addIssue({
3337
+ code: "custom",
3338
+ path: ["policyContext"],
3339
+ message: "Host policy context is required only for policy.evaluate."
3340
+ });
3341
+ }
3342
+ try {
3343
+ if (new TextEncoder().encode(JSON.stringify(frame)).length <= AGENT_FRAME_MAX_BYTES)
3344
+ return;
3345
+ } catch {
3346
+ }
3347
+ ctx.addIssue({ code: "custom", message: "Host agent frame exceeds 128 KiB or is not JSON." });
3348
+ });
3349
+ var HostToCoordinator = z17.discriminatedUnion("type", [
3350
+ z17.object({
3351
+ type: z17.literal("hello"),
3352
+ hostId: z17.string(),
3353
+ credential: z17.string(),
3354
+ name: z17.string(),
3355
+ agentVersion: z17.string(),
3356
+ piVersion: z17.string().nullable(),
3357
+ piCompatible: z17.boolean(),
3358
+ platform: Platform,
3359
+ capabilities: RuntimeCapabilities.nullable(),
3360
+ github: HostGitHub.optional(),
3361
+ protocolVersion: z17.number().int(),
3362
+ features: z17.array(z17.string()).optional()
3363
+ }),
3364
+ HostAgentRequestFrame,
3365
+ z17.object({ type: z17.literal("event"), hostSeq: z17.number().int(), event: HostEvent }),
3373
3366
  z17.object({ type: z17.literal("stream"), delta: StreamDelta }),
3367
+ z17.object({ type: z17.literal("receipt"), receipt: Receipt }),
3374
3368
  z17.object({ type: z17.literal("pong") }),
3375
- z17.object({ type: z17.literal("force_logout"), reason: z17.string() })
3369
+ z17.object({ type: z17.literal("usage"), usage: z17.array(ProviderUsage) }),
3370
+ z17.object({ type: z17.literal("term"), streamId: z17.string(), msg: TermServerToViewer })
3371
+ ]);
3372
+ var CoordinatorToHost = z17.discriminatedUnion("type", [
3373
+ z17.object({
3374
+ type: z17.literal("welcome"),
3375
+ coordinatorVersion: z17.string(),
3376
+ ackedHostSeq: z17.number().int(),
3377
+ features: z17.array(z17.string()).optional()
3378
+ }),
3379
+ AgentResultFrame,
3380
+ z17.object({ type: z17.literal("ack"), hostSeq: z17.number().int() }),
3381
+ z17.object({ type: z17.literal("command"), commandId: z17.string(), command: HostCommand }),
3382
+ z17.object({ type: z17.literal("ping") }),
3383
+ z17.object({ type: z17.literal("reject"), error: ErrorBody }),
3384
+ z17.object({ type: z17.literal("term"), streamId: z17.string(), msg: TermCoordinatorMsg })
3376
3385
  ]);
3377
3386
 
3378
3387
  // packages/protocol/dist/ids.js