@spencerboucher/switchyard 0.21.0 → 0.23.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 (195) hide show
  1. package/README.md +11 -1
  2. package/dist/bridge/switchyard-terminal.js +2 -0
  3. package/dist/policies/worker.js +1335 -1235
  4. package/dist/switchyard.mjs +2517 -1820
  5. package/package.json +1 -1
  6. package/web-dist/assets/AutomationView-BFZ5tGrI.js +2 -0
  7. package/web-dist/assets/AutomationView-BFZ5tGrI.js.map +1 -0
  8. package/web-dist/assets/Checkbox-Bh46F55q.js +2 -0
  9. package/web-dist/assets/{Checkbox-BnRsg6ki.js.map → Checkbox-Bh46F55q.js.map} +1 -1
  10. package/web-dist/assets/DangerZone-K_oXMpbq.js +2 -0
  11. package/web-dist/assets/{DangerZone-BicyqXv8.js.map → DangerZone-K_oXMpbq.js.map} +1 -1
  12. package/web-dist/assets/Field-DRcZixOF.js +2 -0
  13. package/web-dist/assets/{Field-DBm2uYcg.js.map → Field-DRcZixOF.js.map} +1 -1
  14. package/web-dist/assets/{Markdown-BijzTpiJ.js → Markdown-BaCvc-cI.js} +7 -7
  15. package/web-dist/assets/{Markdown-BijzTpiJ.js.map → Markdown-BaCvc-cI.js.map} +1 -1
  16. package/web-dist/assets/NavigationEditor-BfNZ411c.js +2 -0
  17. package/web-dist/assets/NavigationEditor-BfNZ411c.js.map +1 -0
  18. package/web-dist/assets/Overlay-wZFuaSA5.js +2 -0
  19. package/web-dist/assets/Overlay-wZFuaSA5.js.map +1 -0
  20. package/web-dist/assets/Priority-Ce4btFLm.js +2 -0
  21. package/web-dist/assets/{Priority-DAhFDJ7E.js.map → Priority-Ce4btFLm.js.map} +1 -1
  22. package/web-dist/assets/RadioCards-DR-fWNLB.js +2 -0
  23. package/web-dist/assets/RadioCards-DR-fWNLB.js.map +1 -0
  24. package/web-dist/assets/ScopeSelect-B1RxBDV7.js +2 -0
  25. package/web-dist/assets/ScopeSelect-B1RxBDV7.js.map +1 -0
  26. package/web-dist/assets/SegmentedControl-M7WpGnaN.js +2 -0
  27. package/web-dist/assets/SegmentedControl-M7WpGnaN.js.map +1 -0
  28. package/web-dist/assets/Select-CvbSg3M1.js +2 -0
  29. package/web-dist/assets/{Select-CDRJ35wi.js.map → Select-CvbSg3M1.js.map} +1 -1
  30. package/web-dist/assets/StructuredValue-By3sh_00.js +5 -0
  31. package/web-dist/assets/StructuredValue-By3sh_00.js.map +1 -0
  32. package/web-dist/assets/Switch-B89oAK_3.js +2 -0
  33. package/web-dist/assets/{Switch-D5pVfZgf.js.map → Switch-B89oAK_3.js.map} +1 -1
  34. package/web-dist/assets/Tabs-CzGFkSHO.js +2 -0
  35. package/web-dist/assets/Tabs-CzGFkSHO.js.map +1 -0
  36. package/web-dist/assets/TextLink-irMcg7Xz.js +2 -0
  37. package/web-dist/assets/{TextLink-BGtYWCW9.js.map → TextLink-irMcg7Xz.js.map} +1 -1
  38. package/web-dist/assets/UINodeRenderer-_99GFFDS.js +4 -0
  39. package/web-dist/assets/UINodeRenderer-_99GFFDS.js.map +1 -0
  40. package/web-dist/assets/UnfilteredNote-iQIfVXkA.js +2 -0
  41. package/web-dist/assets/{UnfilteredNote-ddFROo9x.js.map → UnfilteredNote-iQIfVXkA.js.map} +1 -1
  42. package/web-dist/assets/api-CzS9UH7Q.js +2 -0
  43. package/web-dist/assets/api-CzS9UH7Q.js.map +1 -0
  44. package/web-dist/assets/{arrow-down-Dn3KG_JI.js → arrow-down-BKhm3D2d.js} +2 -2
  45. package/web-dist/assets/{arrow-down-Dn3KG_JI.js.map → arrow-down-BKhm3D2d.js.map} +1 -1
  46. package/web-dist/assets/{arrow-up-BiPtOqqy.js → arrow-up-poMxdOwI.js} +2 -2
  47. package/web-dist/assets/{arrow-up-BiPtOqqy.js.map → arrow-up-poMxdOwI.js.map} +1 -1
  48. package/web-dist/assets/attention-UZIRcx_k.js +2 -0
  49. package/web-dist/assets/attention-UZIRcx_k.js.map +1 -0
  50. package/web-dist/assets/automations-DWz_Lxch.js +2 -0
  51. package/web-dist/assets/{automations-ClK2gYj8.js.map → automations-DWz_Lxch.js.map} +1 -1
  52. package/web-dist/assets/board-BqGDwbGB.js +6 -0
  53. package/web-dist/assets/board-BqGDwbGB.js.map +1 -0
  54. package/web-dist/assets/{calendar-clock-DVlat602.js → calendar-clock-U5kMaB5u.js} +2 -2
  55. package/web-dist/assets/{calendar-clock-DVlat602.js.map → calendar-clock-U5kMaB5u.js.map} +1 -1
  56. package/web-dist/assets/chevron-right-B-aa_CvO.js +2 -0
  57. package/web-dist/assets/{chevron-right-BM1IJI2z.js.map → chevron-right-B-aa_CvO.js.map} +1 -1
  58. package/web-dist/assets/code-Di_a0pVO.js +28 -0
  59. package/web-dist/assets/code-Di_a0pVO.js.map +1 -0
  60. package/web-dist/assets/{core.esm-B2OVQjr5.js → core.esm-CHa4oRMo.js} +2 -2
  61. package/web-dist/assets/{core.esm-B2OVQjr5.js.map → core.esm-CHa4oRMo.js.map} +1 -1
  62. package/web-dist/assets/describe-C5NtR2LE.js +5 -0
  63. package/web-dist/assets/{describe-DBhLxCUs.js.map → describe-C5NtR2LE.js.map} +1 -1
  64. package/web-dist/assets/enroll-DlZYKudD.js +2 -0
  65. package/web-dist/assets/{enroll-JhMxQuxw.js.map → enroll-DlZYKudD.js.map} +1 -1
  66. package/web-dist/assets/git-branch-CltFrgh4.js +2 -0
  67. package/web-dist/assets/git-branch-CltFrgh4.js.map +1 -0
  68. package/web-dist/assets/grip-vertical-QSdwyQ9C.js +2 -0
  69. package/web-dist/assets/grip-vertical-QSdwyQ9C.js.map +1 -0
  70. package/web-dist/assets/{hand-B6lvj014.js → hand-5eeZJSl_.js} +2 -2
  71. package/web-dist/assets/{hand-B6lvj014.js.map → hand-5eeZJSl_.js.map} +1 -1
  72. package/web-dist/assets/haptics-O69vKVoK.js +2 -0
  73. package/web-dist/assets/haptics-O69vKVoK.js.map +1 -0
  74. package/web-dist/assets/index-CbdB9RE5.js +17 -0
  75. package/web-dist/assets/index-CbdB9RE5.js.map +1 -0
  76. package/web-dist/assets/index-XQGPQuFK.css +2 -0
  77. package/web-dist/assets/{link-2-CCq9WzMy.js → link-2-DXaJEVgz.js} +2 -2
  78. package/web-dist/assets/{link-2-CCq9WzMy.js.map → link-2-DXaJEVgz.js.map} +1 -1
  79. package/web-dist/assets/logic-4hQwsm8w.js +4 -0
  80. package/web-dist/assets/logic-4hQwsm8w.js.map +1 -0
  81. package/web-dist/assets/logic-c8AsGwGr.js +2 -0
  82. package/web-dist/assets/{logic-BnSIy9_P.js.map → logic-c8AsGwGr.js.map} +1 -1
  83. package/web-dist/assets/more-RENHRep9.js +2 -0
  84. package/web-dist/assets/more-RENHRep9.js.map +1 -0
  85. package/web-dist/assets/pencil-DvO-Zlyh.js +2 -0
  86. package/web-dist/assets/pencil-DvO-Zlyh.js.map +1 -0
  87. package/web-dist/assets/{play-NHO6U6cY.js → play-CPNEXvVs.js} +2 -2
  88. package/web-dist/assets/{play-NHO6U6cY.js.map → play-CPNEXvVs.js.map} +1 -1
  89. package/web-dist/assets/{plus-C83uJhbf.js → plus-DC4JQpXX.js} +2 -2
  90. package/web-dist/assets/{plus-C83uJhbf.js.map → plus-DC4JQpXX.js.map} +1 -1
  91. package/web-dist/assets/policyLogic-CXFbVtEs.js +2 -0
  92. package/web-dist/assets/{policyLogic-Btk1SjgX.js.map → policyLogic-CXFbVtEs.js.map} +1 -1
  93. package/web-dist/assets/prefs-BTwRvULi.js +2 -0
  94. package/web-dist/assets/prefs-BTwRvULi.js.map +1 -0
  95. package/web-dist/assets/queue-C25GCl3M.js +2 -0
  96. package/web-dist/assets/{queue-gs6Ez_u3.js.map → queue-C25GCl3M.js.map} +1 -1
  97. package/web-dist/assets/{rotate-ccw-BRrlVEAQ.js → rotate-ccw-DuLdXOxM.js} +2 -2
  98. package/web-dist/assets/{rotate-ccw-BRrlVEAQ.js.map → rotate-ccw-DuLdXOxM.js.map} +1 -1
  99. package/web-dist/assets/{search-C5H14z0D.js → search-tZdcGLqS.js} +2 -2
  100. package/web-dist/assets/{search-C5H14z0D.js.map → search-tZdcGLqS.js.map} +1 -1
  101. package/web-dist/assets/selection-BVtvp1aZ.js +9 -0
  102. package/web-dist/assets/selection-BVtvp1aZ.js.map +1 -0
  103. package/web-dist/assets/settings-BApavmGp.js +7 -0
  104. package/web-dist/assets/settings-BApavmGp.js.map +1 -0
  105. package/web-dist/assets/states-CM1Zt9qO.js +60 -0
  106. package/web-dist/assets/states-CM1Zt9qO.js.map +1 -0
  107. package/web-dist/assets/{terminal-CATQN_17.js → terminal-CEttp_7_.js} +2 -2
  108. package/web-dist/assets/{terminal-CATQN_17.js.map → terminal-CEttp_7_.js.map} +1 -1
  109. package/web-dist/assets/terminal-login-BceUiMHs.js +2 -0
  110. package/web-dist/assets/{terminal-login-DNyAyWlB.js.map → terminal-login-BceUiMHs.js.map} +1 -1
  111. package/web-dist/assets/useBreakpoint-CdYPa6z0.js +2 -0
  112. package/web-dist/assets/useBreakpoint-CdYPa6z0.js.map +1 -0
  113. package/web-dist/assets/useNow-CyygPGnv.js +2 -0
  114. package/web-dist/assets/{useNow-wwKWj7oX.js.map → useNow-CyygPGnv.js.map} +1 -1
  115. package/web-dist/assets/useResource-DQOWQ7YZ.js +2 -0
  116. package/web-dist/assets/useResource-DQOWQ7YZ.js.map +1 -0
  117. package/web-dist/assets/useSwipeTabs-CJFQTmAs.js +2 -0
  118. package/web-dist/assets/useSwipeTabs-CJFQTmAs.js.map +1 -0
  119. package/web-dist/assets/workboard-D39MZMSb.js +3 -0
  120. package/web-dist/assets/workboard-D39MZMSb.js.map +1 -0
  121. package/web-dist/index.html +7 -8
  122. package/web-dist/sw.js +1 -1
  123. package/web-dist/sw.js.map +1 -1
  124. package/web-dist/assets/AutomationView-8yzlARUS.js +0 -2
  125. package/web-dist/assets/AutomationView-8yzlARUS.js.map +0 -1
  126. package/web-dist/assets/Button-C7TQGuSX.js +0 -2
  127. package/web-dist/assets/Button-C7TQGuSX.js.map +0 -1
  128. package/web-dist/assets/Card-DzHrwFrv.js +0 -2
  129. package/web-dist/assets/Card-DzHrwFrv.js.map +0 -1
  130. package/web-dist/assets/Checkbox-BnRsg6ki.js +0 -2
  131. package/web-dist/assets/DangerZone-BicyqXv8.js +0 -2
  132. package/web-dist/assets/Field-DBm2uYcg.js +0 -2
  133. package/web-dist/assets/Menu-BCTLk6pj.js +0 -2
  134. package/web-dist/assets/Menu-BCTLk6pj.js.map +0 -1
  135. package/web-dist/assets/Priority-DAhFDJ7E.js +0 -2
  136. package/web-dist/assets/ScopeSelect-CMmLEwNw.js +0 -2
  137. package/web-dist/assets/ScopeSelect-CMmLEwNw.js.map +0 -1
  138. package/web-dist/assets/SegmentedControl-Cvkz7C_A.js +0 -2
  139. package/web-dist/assets/SegmentedControl-Cvkz7C_A.js.map +0 -1
  140. package/web-dist/assets/Select-CDRJ35wi.js +0 -2
  141. package/web-dist/assets/Switch-D5pVfZgf.js +0 -2
  142. package/web-dist/assets/Tabs-D1t1tQzS.js +0 -2
  143. package/web-dist/assets/Tabs-D1t1tQzS.js.map +0 -1
  144. package/web-dist/assets/TextLink-BGtYWCW9.js +0 -2
  145. package/web-dist/assets/UINodeRenderer-CzoNfuWZ.js +0 -4
  146. package/web-dist/assets/UINodeRenderer-CzoNfuWZ.js.map +0 -1
  147. package/web-dist/assets/UnfilteredNote-ddFROo9x.js +0 -2
  148. package/web-dist/assets/api-hJ_Ikv1a.js +0 -2
  149. package/web-dist/assets/api-hJ_Ikv1a.js.map +0 -1
  150. package/web-dist/assets/attention-8UbWvCkj.js +0 -2
  151. package/web-dist/assets/attention-8UbWvCkj.js.map +0 -1
  152. package/web-dist/assets/automations-ClK2gYj8.js +0 -2
  153. package/web-dist/assets/board-4FKGJU8D.js +0 -6
  154. package/web-dist/assets/board-4FKGJU8D.js.map +0 -1
  155. package/web-dist/assets/check-CEnbWw4D.js +0 -2
  156. package/web-dist/assets/check-CEnbWw4D.js.map +0 -1
  157. package/web-dist/assets/chevron-right-BM1IJI2z.js +0 -2
  158. package/web-dist/assets/code-BD2TozC7.js +0 -25
  159. package/web-dist/assets/code-BD2TozC7.js.map +0 -1
  160. package/web-dist/assets/describe-DBhLxCUs.js +0 -5
  161. package/web-dist/assets/enroll-JhMxQuxw.js +0 -2
  162. package/web-dist/assets/external-link-B3hnazCa.js +0 -2
  163. package/web-dist/assets/external-link-B3hnazCa.js.map +0 -1
  164. package/web-dist/assets/index-Bc5JWkn9.js +0 -17
  165. package/web-dist/assets/index-Bc5JWkn9.js.map +0 -1
  166. package/web-dist/assets/index-C9iuCGwg.css +0 -2
  167. package/web-dist/assets/keyboardLayers-4IDHV-jq.js +0 -2
  168. package/web-dist/assets/keyboardLayers-4IDHV-jq.js.map +0 -1
  169. package/web-dist/assets/logic-BnSIy9_P.js +0 -2
  170. package/web-dist/assets/logic-DUKcqVPg.js +0 -4
  171. package/web-dist/assets/logic-DUKcqVPg.js.map +0 -1
  172. package/web-dist/assets/more-CUfPZ6AG.js +0 -2
  173. package/web-dist/assets/more-CUfPZ6AG.js.map +0 -1
  174. package/web-dist/assets/pencil-DeML-0z2.js +0 -2
  175. package/web-dist/assets/pencil-DeML-0z2.js.map +0 -1
  176. package/web-dist/assets/policyLogic-Btk1SjgX.js +0 -2
  177. package/web-dist/assets/queue-gs6Ez_u3.js +0 -2
  178. package/web-dist/assets/repo-T2dxdBnU.js +0 -2
  179. package/web-dist/assets/repo-T2dxdBnU.js.map +0 -1
  180. package/web-dist/assets/selection-DBzwvhnW.js +0 -7
  181. package/web-dist/assets/selection-DBzwvhnW.js.map +0 -1
  182. package/web-dist/assets/settings-DpK1_7vb.js +0 -12
  183. package/web-dist/assets/settings-DpK1_7vb.js.map +0 -1
  184. package/web-dist/assets/states-DL6w2pmK.js +0 -58
  185. package/web-dist/assets/states-DL6w2pmK.js.map +0 -1
  186. package/web-dist/assets/terminal-login-DNyAyWlB.js +0 -2
  187. package/web-dist/assets/timer-DFrvOKOy.js +0 -2
  188. package/web-dist/assets/timer-DFrvOKOy.js.map +0 -1
  189. package/web-dist/assets/useBreakpoint-BYCN9s8X.js +0 -2
  190. package/web-dist/assets/useBreakpoint-BYCN9s8X.js.map +0 -1
  191. package/web-dist/assets/useNow-wwKWj7oX.js +0 -2
  192. package/web-dist/assets/useResource-D_GOVIub.js +0 -2
  193. package/web-dist/assets/useResource-D_GOVIub.js.map +0 -1
  194. package/web-dist/assets/workboard-B89WFLVO.js +0 -3
  195. package/web-dist/assets/workboard-B89WFLVO.js.map +0 -1
@@ -3,7 +3,7 @@ import { parentPort } from "node:worker_threads";
3
3
  import { Environment } from "@marcbachmann/cel-js";
4
4
 
5
5
  // packages/protocol/dist/adapter-preview.js
6
- import { z as z8 } from "zod";
6
+ import { z as z9 } from "zod";
7
7
 
8
8
  // packages/protocol/dist/contributions.js
9
9
  import { z as z3 } from "zod";
@@ -107,7 +107,11 @@ var RefSchema = z2.discriminatedUnion("kind", [
107
107
  z2.object({ kind: z2.literal("file"), path: z2.string() }),
108
108
  z2.object({ kind: z2.literal("session"), sessionId: z2.string() }),
109
109
  z2.object({ kind: z2.literal("task"), taskId: z2.string() }),
110
- z2.object({ kind: z2.literal("native_session"), hostId: z2.string(), sessionFile: z2.string() })
110
+ z2.object({ kind: z2.literal("native_session"), hostId: z2.string(), sessionFile: z2.string() }),
111
+ z2.object({
112
+ kind: z2.literal("url"),
113
+ url: z2.string().max(2e3).regex(/^https?:\/\/[^\s]+$/i, "must be an http(s) URL")
114
+ })
111
115
  ]);
112
116
  var UINodeSchema = z2.lazy(() => z2.discriminatedUnion("t", [
113
117
  z2.object({ t: z2.literal("text"), text: z2.string(), tone: ToneSchema.optional() }),
@@ -128,6 +132,7 @@ var UINodeSchema = z2.lazy(() => z2.discriminatedUnion("t", [
128
132
  t: z2.literal("section"),
129
133
  title: z2.string().optional(),
130
134
  collapsible: z2.boolean().optional(),
135
+ open: z2.boolean().optional(),
131
136
  children: z2.array(UINodeSchema)
132
137
  }),
133
138
  z2.object({
@@ -162,7 +167,30 @@ var UINodeSchema = z2.lazy(() => z2.discriminatedUnion("t", [
162
167
  label: z2.string(),
163
168
  tone: z2.enum(["default", "primary", "danger"]).optional()
164
169
  }))
165
- })
170
+ }),
171
+ z2.object({
172
+ t: z2.literal("checklist"),
173
+ items: z2.array(z2.object({
174
+ text: z2.string(),
175
+ state: z2.enum(["todo", "doing", "done", "skipped"]),
176
+ note: z2.string().optional()
177
+ }))
178
+ }),
179
+ z2.object({
180
+ t: z2.literal("facts"),
181
+ items: z2.array(z2.object({ label: z2.string(), value: z2.string(), mono: z2.boolean().optional() }))
182
+ }),
183
+ z2.object({
184
+ t: z2.literal("rows"),
185
+ rows: z2.array(z2.object({
186
+ title: z2.string(),
187
+ status: z2.string().optional(),
188
+ tone: ToneSchema.optional(),
189
+ meta: z2.string().optional(),
190
+ ref: RefSchema.optional()
191
+ }))
192
+ }),
193
+ z2.object({ t: z2.literal("badge"), text: z2.string(), tone: ToneSchema.optional() })
166
194
  ]));
167
195
  var UI_MAX_DEPTH = 12;
168
196
  var UI_MAX_NODES = 2e3;
@@ -213,16 +241,28 @@ var ContributionPlacement = z3.enum([
213
241
  "sidebar.footer",
214
242
  "session.panel",
215
243
  "composer.pill",
244
+ /** `adapter.trackers.v1`: a live summary above the input that opens its detail. */
245
+ "composer.tracker",
246
+ /** `adapter.trackers.v1`: a short word on the session's navigator row. */
247
+ "session.badge",
216
248
  "palette.item",
217
249
  "slash.command"
218
250
  ]);
219
251
  var Id = z3.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$/);
220
252
  var ActionId = z3.string().min(1).max(200);
221
253
  var Keywords = z3.array(z3.string().min(1).max(80)).max(20);
254
+ var TrackerSummary = z3.object({
255
+ /** Progress or a count, such as "2/5" or "3". */
256
+ count: z3.string().min(1).max(24).optional(),
257
+ status: z3.enum(["idle", "running", "ok", "error", "attention"]).optional(),
258
+ /** The step in progress, such as the current todo. */
259
+ step: z3.string().min(1).max(120).optional()
260
+ }).strict();
222
261
  var Common = {
223
262
  placement: ContributionPlacement,
224
263
  order: z3.number().int().min(-1e3).max(1e3).optional(),
225
- actionId: ActionId.optional()
264
+ actionId: ActionId.optional(),
265
+ tracker: TrackerSummary.optional()
226
266
  };
227
267
  var ContributionDescriptor = z3.object({
228
268
  id: Id,
@@ -245,6 +285,12 @@ var ContributionDescriptor = z3.object({
245
285
  if (v.placement === "composer.pill" && v.actionId !== void 0) {
246
286
  ctx.addIssue({ code: "custom", message: "Composer pills are not interactive" });
247
287
  }
288
+ if (v.placement === "session.badge" && v.actionId !== void 0) {
289
+ ctx.addIssue({ code: "custom", message: "Session badges are not interactive" });
290
+ }
291
+ if (v.placement !== "composer.tracker" && v.tracker !== void 0) {
292
+ ctx.addIssue({ code: "custom", message: "Only composer trackers have a tracker summary" });
293
+ }
248
294
  });
249
295
  var ContributionInput = z3.object({
250
296
  ...Common,
@@ -255,6 +301,7 @@ var ContributionInput = z3.object({
255
301
  name: z3.string().regex(/^[a-z][a-z0-9-]{0,39}$/).optional(),
256
302
  keywords: Keywords.optional()
257
303
  }).strict();
304
+ var SESSION_BADGE_MAX = 24;
258
305
  function boundContributionJson(value, maxBytes = 256 * 1024) {
259
306
  const stack = [{ value, depth: 0 }];
260
307
  const ancestors = /* @__PURE__ */ new Set();
@@ -331,6 +378,14 @@ function validateContribution(id, input) {
331
378
  if (descriptor.placement === "composer.pill" && node.t !== "text" && node.t !== "progress") {
332
379
  throw new Error("Composer pill content must be text or progress");
333
380
  }
381
+ if (descriptor.placement === "session.badge") {
382
+ if (node.t !== "text" && node.t !== "badge") {
383
+ throw new Error("Session badge content must be text or a badge");
384
+ }
385
+ if (node.text.length === 0 || node.text.length > SESSION_BADGE_MAX) {
386
+ throw new Error(`Session badge text must be 1 to ${SESSION_BADGE_MAX} characters`);
387
+ }
388
+ }
334
389
  if (descriptor.placement !== "session.panel" && state !== void 0) {
335
390
  throw new Error("Only session panels accept renderer state");
336
391
  }
@@ -353,7 +408,7 @@ function contributionSlot(id) {
353
408
  }
354
409
 
355
410
  // packages/protocol/dist/entities.js
356
- import { z as z7 } from "zod";
411
+ import { z as z8 } from "zod";
357
412
 
358
413
  // packages/protocol/dist/github.js
359
414
  import { z as z4 } from "zod";
@@ -1090,204 +1145,227 @@ var PolicyTestRequest = z6.object({
1090
1145
  request: PolicyRequestContext.nullable()
1091
1146
  }).strict().refine((v) => v.phase === "tool_call" ? v.tool !== null && v.request === null : v.tool === null && v.request !== null);
1092
1147
 
1148
+ // packages/protocol/dist/tool-view.js
1149
+ import { z as z7 } from "zod";
1150
+ var TOOL_KINDS = ["read", "edit", "write", "command", "search", "other"];
1151
+ var ToolViewData = z7.object({
1152
+ kind: z7.enum(TOOL_KINDS).optional(),
1153
+ /** Finished: "Asked", "Updated todo". */
1154
+ verb: z7.string().min(1).max(40).optional(),
1155
+ /** Running: "Asking". Defaults to `verb`. */
1156
+ activeVerb: z7.string().min(1).max(40).optional(),
1157
+ /** What the call acted on, shown in mono. */
1158
+ target: z7.string().max(500).optional(),
1159
+ /** Short facts after the target ("3 items", "exit 1"). */
1160
+ meta: z7.array(z7.string().min(1).max(80)).max(6).optional(),
1161
+ /** Lines added and removed. */
1162
+ stat: z7.object({ added: z7.number().int().min(0), removed: z7.number().int().min(0) }).optional(),
1163
+ /** Shown when the row is opened, in place of the typed detail. No forms or confirms. */
1164
+ detail: UINodeSchema.optional(),
1165
+ /** Do not draw the row: a dock question or a tracker already stands for this call. */
1166
+ hide: z7.boolean().optional()
1167
+ });
1168
+
1093
1169
  // packages/protocol/dist/entities.js
1094
- var Iso2 = z7.string();
1095
- var Id5 = z7.string();
1096
- var Connectivity = z7.enum(["connected", "reconnecting", "unreachable"]);
1097
- var ControlMode = z7.enum(["automation", "human"]);
1098
- var Platform = z7.enum(["darwin", "linux"]);
1099
- var DeviceKind = z7.enum(["browser", "pwa", "terminal", "cli"]);
1100
- var DiagnosticLevel = z7.enum(["info", "warning", "error"]);
1170
+ var Iso2 = z8.string();
1171
+ var Id5 = z8.string();
1172
+ var Connectivity = z8.enum(["connected", "reconnecting", "unreachable"]);
1173
+ var ControlMode = z8.enum(["automation", "human"]);
1174
+ var Platform = z8.enum(["darwin", "linux"]);
1175
+ var DeviceKind = z8.enum(["browser", "pwa", "terminal", "cli"]);
1176
+ var DiagnosticLevel = z8.enum(["info", "warning", "error"]);
1101
1177
  var DEFAULT_WORKTREE_DIR = ".worktrees";
1102
- var CoreCapabilities = z7.object({
1103
- prompt: z7.boolean(),
1104
- steer: z7.boolean(),
1105
- followUp: z7.boolean(),
1106
- abort: z7.boolean(),
1107
- resume: z7.boolean(),
1108
- rename: z7.boolean(),
1109
- importInactive: z7.boolean(),
1110
- extensionDialogs: z7.boolean(),
1111
- customUi: z7.boolean(),
1112
- widgetsText: z7.boolean(),
1113
- widgetsComponent: z7.boolean(),
1114
- tokenAccounting: z7.boolean(),
1115
- costAccounting: z7.boolean()
1178
+ var CoreCapabilities = z8.object({
1179
+ prompt: z8.boolean(),
1180
+ steer: z8.boolean(),
1181
+ followUp: z8.boolean(),
1182
+ abort: z8.boolean(),
1183
+ resume: z8.boolean(),
1184
+ rename: z8.boolean(),
1185
+ importInactive: z8.boolean(),
1186
+ extensionDialogs: z8.boolean(),
1187
+ customUi: z8.boolean(),
1188
+ widgetsText: z8.boolean(),
1189
+ widgetsComponent: z8.boolean(),
1190
+ tokenAccounting: z8.boolean(),
1191
+ costAccounting: z8.boolean()
1116
1192
  });
1117
1193
  var CAPABILITY_KEYS = CoreCapabilities.keyof().options;
1118
1194
  var RuntimeCapabilities = CoreCapabilities.extend({
1119
1195
  /** The host runs sessions as interactive Pi in a terminal that clients can attach to. */
1120
- terminal: z7.boolean().optional(),
1196
+ terminal: z8.boolean().optional(),
1121
1197
  /** The host answers session.models, session.commands, session.setModel, session.setThinking and session.compact. */
1122
- sessionControls: z7.boolean().optional(),
1198
+ sessionControls: z8.boolean().optional(),
1123
1199
  /** The host answers session.navigate for terminal sessions. */
1124
- treeNavigation: z7.boolean().optional(),
1125
- agentRequests: z7.boolean().optional(),
1126
- messageDelivery: z7.boolean().optional(),
1127
- policies: z7.boolean().optional(),
1200
+ treeNavigation: z8.boolean().optional(),
1201
+ agentRequests: z8.boolean().optional(),
1202
+ messageDelivery: z8.boolean().optional(),
1203
+ policies: z8.boolean().optional(),
1128
1204
  /** Session-scoped adapter inspection and safe reload. */
1129
- adapterDevelopment: z7.boolean().optional(),
1130
- unsupported: z7.array(z7.object({ capability: z7.string(), reason: z7.string() }))
1205
+ adapterDevelopment: z8.boolean().optional(),
1206
+ /** The host answers session.clearQueue (Edit queue). */
1207
+ queueEdit: z8.boolean().optional(),
1208
+ unsupported: z8.array(z8.object({ capability: z8.string(), reason: z8.string() }))
1131
1209
  });
1132
- var ProjectScan = z7.object({
1133
- state: z7.enum(["running", "done", "failed"]),
1210
+ var ProjectScan = z8.object({
1211
+ state: z8.enum(["running", "done", "failed"]),
1134
1212
  startedAt: Iso2,
1135
1213
  finishedAt: Iso2.nullable(),
1136
1214
  /** Repositories found across all folders. */
1137
- repositories: z7.number().int(),
1215
+ repositories: z8.number().int(),
1138
1216
  /** New projects created by this scan. */
1139
- projectsCreated: z7.number().int(),
1217
+ projectsCreated: z8.number().int(),
1140
1218
  /** New checkouts (including the ones of new projects). */
1141
- checkoutsAdded: z7.number().int(),
1219
+ checkoutsAdded: z8.number().int(),
1142
1220
  /** "<folder>: <message>" per folder that failed; for state "failed", the reason last. */
1143
- errors: z7.array(z7.string())
1221
+ errors: z8.array(z8.string())
1144
1222
  });
1145
- var UsageWindow = z7.object({
1146
- id: z7.enum(["five_hour", "weekly"]),
1147
- usedPct: z7.number(),
1223
+ var UsageWindow = z8.object({
1224
+ id: z8.enum(["five_hour", "weekly"]),
1225
+ usedPct: z8.number(),
1148
1226
  resetsAt: Iso2.nullable()
1149
1227
  });
1150
- var ProviderUsage = z7.object({
1151
- provider: z7.enum(["anthropic", "openai-codex"]),
1152
- status: z7.enum(["available", "expired", "rejected", "error"]),
1153
- message: z7.string().nullable(),
1154
- windows: z7.array(UsageWindow),
1228
+ var ProviderUsage = z8.object({
1229
+ provider: z8.enum(["anthropic", "openai-codex"]),
1230
+ status: z8.enum(["available", "expired", "rejected", "error"]),
1231
+ message: z8.string().nullable(),
1232
+ windows: z8.array(UsageWindow),
1155
1233
  fetchedAt: Iso2
1156
1234
  });
1157
- var Host = z7.object({
1235
+ var Host = z8.object({
1158
1236
  id: Id5,
1159
- name: z7.string(),
1237
+ name: z8.string(),
1160
1238
  platform: Platform,
1161
- agentVersion: z7.string(),
1162
- piVersion: z7.string().nullable(),
1163
- piCompatible: z7.boolean(),
1239
+ agentVersion: z8.string(),
1240
+ piVersion: z8.string().nullable(),
1241
+ piCompatible: z8.boolean(),
1164
1242
  capabilities: RuntimeCapabilities.nullable(),
1165
1243
  connectivity: Connectivity,
1166
1244
  lastSeenAt: Iso2.nullable(),
1167
1245
  revokedAt: Iso2.nullable(),
1168
1246
  createdAt: Iso2,
1169
1247
  /** Folders on the host whose git repositories become projects (absolute or ~/...). */
1170
- projectFolders: z7.array(z7.string()).optional(),
1248
+ projectFolders: z8.array(z8.string()).optional(),
1171
1249
  projectScan: ProjectScan.nullable().optional(),
1172
1250
  /** Subscription limits (host-reported, refreshed every few minutes). */
1173
- usage: z7.array(ProviderUsage).optional(),
1251
+ usage: z8.array(ProviderUsage).optional(),
1174
1252
  github: HostGitHub.optional()
1175
1253
  });
1176
- var WorktreeDir = z7.string().min(1).refine((d) => !d.startsWith("/") && !d.includes("\\"), "must be a relative path").refine((d) => !d.split("/").includes(".."), "must stay inside the repository").refine((d) => d.split("/").every((s) => s.length > 0 && s !== "."), "must be a plain relative path");
1177
- var Project = z7.object({
1254
+ var WorktreeDir = z8.string().min(1).refine((d) => !d.startsWith("/") && !d.includes("\\"), "must be a relative path").refine((d) => !d.split("/").includes(".."), "must stay inside the repository").refine((d) => d.split("/").every((s) => s.length > 0 && s !== "."), "must be a plain relative path");
1255
+ var Project = z8.object({
1178
1256
  id: Id5,
1179
- name: z7.string().min(1),
1180
- repoIdentity: z7.string(),
1257
+ name: z8.string().min(1),
1258
+ repoIdentity: z8.string(),
1181
1259
  defaultProfileId: Id5.nullable(),
1182
1260
  defaultHostId: Id5.nullable(),
1183
- maxConcurrentRuns: z7.number().int().min(1).max(32),
1184
- automationEnabled: z7.boolean(),
1185
- setupCommand: z7.string().nullable(),
1186
- checks: z7.array(z7.string()),
1187
- workspaceSharing: z7.enum(["single_writer", "shared"]),
1261
+ maxConcurrentRuns: z8.number().int().min(1).max(32),
1262
+ automationEnabled: z8.boolean(),
1263
+ setupCommand: z8.string().nullable(),
1264
+ checks: z8.array(z8.string()),
1265
+ workspaceSharing: z8.enum(["single_writer", "shared"]),
1188
1266
  worktreeDir: WorktreeDir.default(DEFAULT_WORKTREE_DIR),
1189
1267
  /** Start one session in every non-main worktree the first time it appears without one. */
1190
- ensureSessions: z7.boolean().default(false),
1268
+ ensureSessions: z8.boolean().default(false),
1191
1269
  /** Archive sessions and remove a worktree (and its local branch) once its PR has merged. */
1192
- removeLanded: z7.boolean().default(false),
1270
+ removeLanded: z8.boolean().default(false),
1193
1271
  createdAt: Iso2,
1194
1272
  updatedAt: Iso2
1195
1273
  });
1196
- var Checkout = z7.object({
1274
+ var Checkout = z8.object({
1197
1275
  id: Id5,
1198
1276
  projectId: Id5,
1199
1277
  hostId: Id5,
1200
- path: z7.string(),
1201
- commonDir: z7.string(),
1202
- defaultBranch: z7.string(),
1278
+ path: z8.string(),
1279
+ commonDir: z8.string(),
1280
+ defaultBranch: z8.string(),
1203
1281
  createdAt: Iso2
1204
1282
  });
1205
- var GitState = z7.object({
1206
- dirty: z7.boolean(),
1207
- changedFiles: z7.number().int(),
1208
- ahead: z7.number().int(),
1209
- behind: z7.number().int(),
1210
- unmerged: z7.boolean(),
1283
+ var GitState = z8.object({
1284
+ dirty: z8.boolean(),
1285
+ changedFiles: z8.number().int(),
1286
+ ahead: z8.number().int(),
1287
+ behind: z8.number().int(),
1288
+ unmerged: z8.boolean(),
1211
1289
  /** HEAD commit; absent from older hosts. */
1212
- head: z7.string().regex(/^[0-9a-f]{40}$/).optional()
1290
+ head: z8.string().regex(/^[0-9a-f]{40}$/).optional()
1213
1291
  });
1214
- var Workspace = z7.object({
1292
+ var Workspace = z8.object({
1215
1293
  id: Id5,
1216
1294
  checkoutId: Id5,
1217
1295
  projectId: Id5,
1218
1296
  hostId: Id5,
1219
- path: z7.string(),
1220
- branch: z7.string().nullable(),
1221
- baseBranch: z7.string().nullable(),
1222
- provenance: z7.enum(["managed", "discovered", "main"]),
1297
+ path: z8.string(),
1298
+ branch: z8.string().nullable(),
1299
+ baseBranch: z8.string().nullable(),
1300
+ provenance: z8.enum(["managed", "discovered", "main"]),
1223
1301
  git: GitState,
1224
- setup: z7.object({
1225
- state: z7.enum(["none", "running", "succeeded", "failed"]),
1226
- log: z7.string()
1302
+ setup: z8.object({
1303
+ state: z8.enum(["none", "running", "succeeded", "failed"]),
1304
+ log: z8.string()
1227
1305
  }),
1228
1306
  archivedAt: Iso2.nullable(),
1229
1307
  updatedAt: Iso2,
1230
1308
  github: WorkspaceGitHub.optional()
1231
1309
  });
1232
- var ThinkingLevel = z7.enum(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
1233
- var SessionModel = z7.object({
1234
- provider: z7.string(),
1235
- id: z7.string(),
1236
- name: z7.string().nullable(),
1237
- contextWindow: z7.number().nullable(),
1238
- reasoning: z7.boolean(),
1310
+ var ThinkingLevel = z8.enum(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
1311
+ var SessionModel = z8.object({
1312
+ provider: z8.string(),
1313
+ id: z8.string(),
1314
+ name: z8.string().nullable(),
1315
+ contextWindow: z8.number().nullable(),
1316
+ reasoning: z8.boolean(),
1239
1317
  /** In Pi's scoped (favorite) model list; set only when Pi has one. */
1240
- scoped: z7.boolean().optional(),
1318
+ scoped: z8.boolean().optional(),
1241
1319
  /** Effort levels this model accepts, in Pi's order; ["off"] without reasoning. */
1242
- thinkingLevels: z7.array(ThinkingLevel),
1320
+ thinkingLevels: z8.array(ThinkingLevel),
1243
1321
  /** Prompt-cache lifetimes in seconds from Pi's model metadata. */
1244
- promptCache: z7.object({ short: z7.number().optional(), long: z7.number().optional() }).nullable().optional()
1322
+ promptCache: z8.object({ short: z8.number().optional(), long: z8.number().optional() }).nullable().optional()
1245
1323
  });
1246
- var SlashCommand = z7.object({
1247
- name: z7.string().min(1),
1248
- description: z7.string().nullable(),
1249
- source: z7.enum(["extension", "prompt", "skill"]),
1250
- argumentHint: z7.string().nullable().optional()
1324
+ var SlashCommand = z8.object({
1325
+ name: z8.string().min(1),
1326
+ description: z8.string().nullable(),
1327
+ source: z8.enum(["extension", "prompt", "skill"]),
1328
+ argumentHint: z8.string().nullable().optional()
1251
1329
  });
1252
- var ContextUsage = z7.object({
1330
+ var ContextUsage = z8.object({
1253
1331
  /** Estimated tokens in context; null right after compaction until the next reply. */
1254
- tokens: z7.number().nullable(),
1255
- window: z7.number(),
1256
- percent: z7.number().nullable()
1332
+ tokens: z8.number().nullable(),
1333
+ window: z8.number(),
1334
+ percent: z8.number().nullable()
1257
1335
  });
1258
1336
  var FORBIDDEN_EXTRA_ARGS = ["--mode", "--fork", "--no-session", "-e", "--extension"];
1259
- var ExtraArg = z7.string().refine((a) => a.startsWith("--") || !a.startsWith("-"), "extra args must be long flags").refine((a) => !FORBIDDEN_EXTRA_ARGS.includes(a.split("=")[0]) && !a.startsWith("--session"), "this flag is managed by Switchyard");
1260
- var Profile = z7.object({
1337
+ var ExtraArg = z8.string().refine((a) => a.startsWith("--") || !a.startsWith("-"), "extra args must be long flags").refine((a) => !FORBIDDEN_EXTRA_ARGS.includes(a.split("=")[0]) && !a.startsWith("--session"), "this flag is managed by Switchyard");
1338
+ var Profile = z8.object({
1261
1339
  id: Id5,
1262
- name: z7.string().min(1),
1263
- provider: z7.string().nullable(),
1264
- model: z7.string().nullable(),
1340
+ name: z8.string().min(1),
1341
+ provider: z8.string().nullable(),
1342
+ model: z8.string().nullable(),
1265
1343
  thinking: ThinkingLevel.nullable(),
1266
- projectTrust: z7.enum(["ask", "approve", "ignore"]),
1267
- extraArgs: z7.array(ExtraArg),
1344
+ projectTrust: z8.enum(["ask", "approve", "ignore"]),
1345
+ extraArgs: z8.array(ExtraArg),
1268
1346
  /** "vanilla": --no-extensions --no-skills --no-prompt-templates. Undefined means "all". */
1269
- resources: z7.enum(["all", "vanilla"]).optional()
1347
+ resources: z8.enum(["all", "vanilla"]).optional()
1270
1348
  });
1271
- var Scope = z7.object({
1349
+ var Scope = z8.object({
1272
1350
  id: Id5,
1273
- name: z7.string().min(1).max(60),
1274
- mode: z7.enum(["all", "pinned"]),
1275
- projectIds: z7.array(z7.string()).nullable(),
1276
- hostIds: z7.array(z7.string()).nullable(),
1277
- sessionIds: z7.array(z7.string()),
1351
+ name: z8.string().min(1).max(60),
1352
+ mode: z8.enum(["all", "pinned"]),
1353
+ projectIds: z8.array(z8.string()).nullable(),
1354
+ hostIds: z8.array(z8.string()).nullable(),
1355
+ sessionIds: z8.array(z8.string()),
1278
1356
  /** What feeds this scope its issues; null for a scope of projects you choose. */
1279
1357
  source: GitHubSource.nullable(),
1280
1358
  createdAt: Iso2,
1281
1359
  updatedAt: Iso2
1282
1360
  });
1283
- var ClientKind = z7.string().regex(/^[a-z][a-z0-9-]{0,31}$/);
1284
- var ClientMirror = z7.enum(["none", "all", "scope"]);
1285
- var Client = z7.object({
1361
+ var ClientKind = z8.string().regex(/^[a-z][a-z0-9-]{0,31}$/);
1362
+ var ClientMirror = z8.enum(["none", "all", "scope"]);
1363
+ var Client = z8.object({
1286
1364
  /** `${kind}:${name}@${machine}` */
1287
- id: z7.string().min(1).max(200),
1365
+ id: z8.string().min(1).max(200),
1288
1366
  kind: ClientKind,
1289
- name: z7.string().min(1),
1290
- machine: z7.string().min(1),
1367
+ name: z8.string().min(1),
1368
+ machine: z8.string().min(1),
1291
1369
  deviceId: Id5,
1292
1370
  hostId: Id5.nullable(),
1293
1371
  /** What it mirrors (coordinator-owned). */
@@ -1297,11 +1375,11 @@ var Client = z7.object({
1297
1375
  /** When the binding was recorded; null when it never was (a daemon may seed it once). */
1298
1376
  bindingSetAt: Iso2.nullable().optional(),
1299
1377
  /** Sessions it shows in mirror tabs or windows now (daemon-owned). */
1300
- shows: z7.array(Id5).max(1e3).optional(),
1378
+ shows: z8.array(Id5).max(1e3).optional(),
1301
1379
  lastSeenAt: Iso2,
1302
1380
  createdAt: Iso2
1303
1381
  });
1304
- var RuntimeState = z7.enum([
1382
+ var RuntimeState = z8.enum([
1305
1383
  "starting",
1306
1384
  "idle",
1307
1385
  "running",
@@ -1310,161 +1388,161 @@ var RuntimeState = z7.enum([
1310
1388
  "failed",
1311
1389
  "stopped"
1312
1390
  ]);
1313
- var NativeHandle = z7.object({ sessionId: z7.string(), sessionFile: z7.string() });
1314
- var SessionStats = z7.object({
1315
- tokens: z7.number().nullable(),
1316
- costUsd: z7.number().nullable(),
1391
+ var NativeHandle = z8.object({ sessionId: z8.string(), sessionFile: z8.string() });
1392
+ var SessionStats = z8.object({
1393
+ tokens: z8.number().nullable(),
1394
+ costUsd: z8.number().nullable(),
1317
1395
  /** Completed usage, refreshed for this exact settlement; absent on older hosts or failure. */
1318
1396
  watermark: CompletedUsageWatermark.optional(),
1319
1397
  context: ContextUsage.nullable().optional()
1320
1398
  });
1321
- var PromptCacheInfo = z7.object({
1399
+ var PromptCacheInfo = z8.object({
1322
1400
  at: Iso2,
1323
- provider: z7.string(),
1324
- model: z7.string(),
1325
- cacheRead: z7.number(),
1326
- cacheWrite: z7.number(),
1327
- cacheWrite1h: z7.number()
1401
+ provider: z8.string(),
1402
+ model: z8.string(),
1403
+ cacheRead: z8.number(),
1404
+ cacheWrite: z8.number(),
1405
+ cacheWrite1h: z8.number()
1328
1406
  });
1329
- var Session = z7.object({
1407
+ var Session = z8.object({
1330
1408
  id: Id5,
1331
- title: z7.string(),
1332
- subtitle: z7.string().nullable(),
1409
+ title: z8.string(),
1410
+ subtitle: z8.string().nullable(),
1333
1411
  hostId: Id5,
1334
1412
  workspaceId: Id5.nullable(),
1335
1413
  projectId: Id5.nullable(),
1336
- cwd: z7.string(),
1414
+ cwd: z8.string(),
1337
1415
  nativeHandle: NativeHandle.nullable(),
1338
1416
  profileSnapshot: Profile,
1339
1417
  runtime: RuntimeState,
1340
- runtimeDetail: z7.string().nullable(),
1418
+ runtimeDetail: z8.string().nullable(),
1341
1419
  connectivity: Connectivity,
1342
1420
  runId: Id5.nullable(),
1343
1421
  taskId: Id5.nullable(),
1344
- provenance: z7.enum(["created", "imported", "subagent"]),
1345
- readOnly: z7.boolean(),
1422
+ provenance: z8.enum(["created", "imported", "subagent"]),
1423
+ readOnly: z8.boolean(),
1346
1424
  lastActivityAt: Iso2,
1347
1425
  archivedAt: Iso2.nullable(),
1348
- queue: z7.object({ steering: z7.array(z7.string()), followUp: z7.array(z7.string()) }),
1426
+ queue: z8.object({ steering: z8.array(z8.string()), followUp: z8.array(z8.string()) }),
1349
1427
  stats: SessionStats.nullable(),
1350
1428
  /** The live model (host-owned; last known when stopped). */
1351
1429
  model: SessionModel.nullable().optional(),
1352
1430
  /** The live effort (Pi's thinking level). */
1353
1431
  thinking: ThinkingLevel.nullable().optional(),
1354
1432
  /** Pi is compacting the context. */
1355
- compacting: z7.boolean().optional(),
1356
- lastAssistantText: z7.string().nullable(),
1433
+ compacting: z8.boolean().optional(),
1434
+ lastAssistantText: z8.string().nullable(),
1357
1435
  createdAt: Iso2,
1358
1436
  /** A live terminal session: `switchyard tui` can attach to its Pi terminal. */
1359
- terminal: z7.boolean().optional(),
1437
+ terminal: z8.boolean().optional(),
1360
1438
  /**
1361
1439
  * A Pi the user started in their own terminal and enrolled (`client`: the id of the herdr or
1362
1440
  * tmux client it runs in, when known). Switchyard never shows or closes that terminal.
1363
1441
  */
1364
- external: z7.object({ client: z7.string().min(1).max(200).nullable() }).nullable().optional(),
1442
+ external: z8.object({ client: z8.string().min(1).max(200).nullable() }).nullable().optional(),
1365
1443
  /**
1366
1444
  * Where this Pi last ran by hand (host-owned): the client (`herdr:<s>@<m>`, `tmux:<s>@<m>`;
1367
1445
  * the wire field keeps the name `terminalId`) and pane. Kept after it stops; cleared once
1368
1446
  * Switchyard starts it. Older hosts omit it.
1369
1447
  */
1370
- place: z7.object({
1371
- terminalId: z7.string().min(1).max(200),
1372
- pane: z7.string().min(1).max(200).nullable()
1448
+ place: z8.object({
1449
+ terminalId: z8.string().min(1).max(200),
1450
+ pane: z8.string().min(1).max(200).nullable()
1373
1451
  }).nullable().optional(),
1374
1452
  /** The session this subagent was started by (coordinator-owned). */
1375
1453
  parentSessionId: Id5.nullable().optional(),
1376
1454
  /** Chosen as its branch's primary session (coordinator-owned); without one the primary is derived. */
1377
- primary: z7.boolean().optional(),
1455
+ primary: z8.boolean().optional(),
1378
1456
  /** Set when the session finished or failed with nobody viewing it; cleared when viewed (coordinator-owned). */
1379
1457
  unreadSince: Iso2.nullable().optional(),
1380
1458
  /** Identity of the adapter presentation currently installed on the host. */
1381
- adapterGeneration: z7.string().uuid().optional(),
1459
+ adapterGeneration: z8.string().uuid().optional(),
1382
1460
  /** Bumped when the transcript is rebuilt (rewind); clients drop cached copies (coordinator-owned). */
1383
- transcriptEpoch: z7.number().int().min(0).optional(),
1384
- bridge: z7.object({
1385
- version: z7.literal(1),
1461
+ transcriptEpoch: z8.number().int().min(0).optional(),
1462
+ bridge: z8.object({
1463
+ version: z8.literal(1),
1386
1464
  runtimeId: Id5,
1387
1465
  nativeSessionId: Id5,
1388
1466
  /** Host-generated local-controller identity, not Pi's private binding credential. */
1389
1467
  controllerEpoch: Id5.optional(),
1390
- agentTools: z7.boolean(),
1391
- messageDelivery: z7.boolean(),
1392
- policyState: z7.enum(["initializing", "active", "unsupported", "lost"]),
1393
- policyPhases: z7.array(PolicyPhase)
1468
+ agentTools: z8.boolean(),
1469
+ messageDelivery: z8.boolean(),
1470
+ policyState: z8.enum(["initializing", "active", "unsupported", "lost"]),
1471
+ policyPhases: z8.array(PolicyPhase)
1394
1472
  }).optional(),
1395
1473
  /** Last assistant message's cache usage (host-owned). */
1396
1474
  promptCache: PromptCacheInfo.nullable().optional(),
1397
1475
  /** Warn before the prompt cache expires; non-null means on (coordinator-owned). */
1398
- cacheAlert: z7.object({ ttlSec: z7.number().int().min(60).max(86400).nullable(), warnedFor: Iso2.nullable() }).nullable().optional()
1399
- });
1400
- var ContinuationPolicy = z7.discriminatedUnion("enabled", [
1401
- z7.object({ enabled: z7.literal(false) }),
1402
- z7.object({
1403
- enabled: z7.literal(true),
1404
- objective: z7.string().min(1),
1405
- maxContinuations: z7.number().int().min(1).max(50),
1406
- maxElapsedMinutes: z7.number().int().min(1).max(1440),
1407
- maxTokens: z7.number().int().positive().nullable(),
1408
- maxCostUsd: z7.number().positive().nullable()
1476
+ cacheAlert: z8.object({ ttlSec: z8.number().int().min(60).max(86400).nullable(), warnedFor: Iso2.nullable() }).nullable().optional()
1477
+ });
1478
+ var ContinuationPolicy = z8.discriminatedUnion("enabled", [
1479
+ z8.object({ enabled: z8.literal(false) }),
1480
+ z8.object({
1481
+ enabled: z8.literal(true),
1482
+ objective: z8.string().min(1),
1483
+ maxContinuations: z8.number().int().min(1).max(50),
1484
+ maxElapsedMinutes: z8.number().int().min(1).max(1440),
1485
+ maxTokens: z8.number().int().positive().nullable(),
1486
+ maxCostUsd: z8.number().positive().nullable()
1409
1487
  })
1410
1488
  ]);
1411
- var CompletionPolicy = z7.object({
1412
- checks: z7.array(z7.string()).nullable(),
1413
- requireHumanReview: z7.boolean()
1414
- });
1415
- var WorkspacePolicy = z7.discriminatedUnion("mode", [
1416
- z7.object({
1417
- mode: z7.literal("new_worktree"),
1418
- branch: z7.string().nullable(),
1419
- base: z7.string().nullable()
1489
+ var CompletionPolicy = z8.object({
1490
+ checks: z8.array(z8.string()).nullable(),
1491
+ requireHumanReview: z8.boolean()
1492
+ });
1493
+ var WorkspacePolicy = z8.discriminatedUnion("mode", [
1494
+ z8.object({
1495
+ mode: z8.literal("new_worktree"),
1496
+ branch: z8.string().nullable(),
1497
+ base: z8.string().nullable()
1420
1498
  }),
1421
- z7.object({ mode: z7.literal("existing"), workspaceId: Id5 })
1499
+ z8.object({ mode: z8.literal("existing"), workspaceId: Id5 })
1422
1500
  ]);
1423
- var TaskPolicy = z7.object({
1501
+ var TaskPolicy = z8.object({
1424
1502
  hostId: Id5.nullable(),
1425
1503
  profileId: Id5.nullable(),
1426
1504
  workspace: WorkspacePolicy,
1427
1505
  continuation: ContinuationPolicy,
1428
1506
  completion: CompletionPolicy
1429
1507
  });
1430
- var TaskState = z7.enum(["backlog", "ready", "in_progress", "review", "done", "canceled"]);
1431
- var Priority = z7.union([z7.literal(0), z7.literal(1), z7.literal(2), z7.literal(3)]);
1432
- var TaskOrigin = z7.discriminatedUnion("kind", [
1433
- z7.object({ kind: z7.literal("manual") }),
1434
- z7.object({
1435
- kind: z7.literal("automation"),
1508
+ var TaskState = z8.enum(["backlog", "ready", "in_progress", "review", "done", "canceled"]);
1509
+ var Priority = z8.union([z8.literal(0), z8.literal(1), z8.literal(2), z8.literal(3)]);
1510
+ var TaskOrigin = z8.discriminatedUnion("kind", [
1511
+ z8.object({ kind: z8.literal("manual") }),
1512
+ z8.object({
1513
+ kind: z8.literal("automation"),
1436
1514
  automationId: Id5,
1437
1515
  occurrenceId: Id5,
1438
- routine: z7.boolean()
1516
+ routine: z8.boolean()
1439
1517
  })
1440
1518
  ]);
1441
- var Task = z7.object({
1519
+ var Task = z8.object({
1442
1520
  id: Id5,
1443
1521
  projectId: Id5,
1444
- title: z7.string().min(1),
1445
- objective: z7.string(),
1446
- acceptanceCriteria: z7.array(z7.string()),
1447
- dependencies: z7.array(Id5),
1522
+ title: z8.string().min(1),
1523
+ objective: z8.string(),
1524
+ acceptanceCriteria: z8.array(z8.string()),
1525
+ dependencies: z8.array(Id5),
1448
1526
  priority: Priority,
1449
- position: z7.number(),
1527
+ position: z8.number(),
1450
1528
  state: TaskState,
1451
- blocked: z7.object({ reason: z7.string() }).nullable(),
1529
+ blocked: z8.object({ reason: z8.string() }).nullable(),
1452
1530
  notBefore: Iso2.nullable(),
1453
1531
  policy: TaskPolicy,
1454
1532
  origin: TaskOrigin,
1455
- groupingKey: z7.string().nullable(),
1533
+ groupingKey: z8.string().nullable(),
1456
1534
  parentTaskId: Id5.nullable().optional(),
1457
- agentOrigin: z7.object({ sessionId: Id5, toolCallId: Id5 }).optional(),
1535
+ agentOrigin: z8.object({ sessionId: Id5, toolCallId: Id5 }).optional(),
1458
1536
  githubIssue: GitHubIssue.optional(),
1459
1537
  currentRunId: Id5.nullable(),
1460
1538
  sessionId: Id5.nullable(),
1461
- review: z7.object({ feedback: z7.array(z7.string()), changesRequested: z7.boolean() }),
1462
- hiddenFromBoard: z7.boolean(),
1539
+ review: z8.object({ feedback: z8.array(z8.string()), changesRequested: z8.boolean() }),
1540
+ hiddenFromBoard: z8.boolean(),
1463
1541
  lastActivityAt: Iso2,
1464
1542
  createdAt: Iso2,
1465
1543
  updatedAt: Iso2
1466
1544
  });
1467
- var RunState = z7.enum([
1545
+ var RunState = z8.enum([
1468
1546
  "queued",
1469
1547
  "dispatching",
1470
1548
  "uncertain",
@@ -1476,79 +1554,79 @@ var RunState = z7.enum([
1476
1554
  "interrupted",
1477
1555
  "canceled"
1478
1556
  ]);
1479
- var CheckResult = z7.object({
1480
- command: z7.string(),
1481
- exitCode: z7.number().int().nullable(),
1482
- outputTail: z7.string()
1557
+ var CheckResult = z8.object({
1558
+ command: z8.string(),
1559
+ exitCode: z8.number().int().nullable(),
1560
+ outputTail: z8.string()
1483
1561
  });
1484
- var Run = z7.object({
1562
+ var Run = z8.object({
1485
1563
  id: Id5,
1486
1564
  taskId: Id5,
1487
1565
  sessionId: Id5.nullable(),
1488
1566
  hostId: Id5.nullable(),
1489
- dispatchKey: z7.string(),
1490
- attempt: z7.number().int().min(1),
1567
+ dispatchKey: z8.string(),
1568
+ attempt: z8.number().int().min(1),
1491
1569
  state: RunState,
1492
1570
  controlMode: ControlMode,
1493
- controlRevision: z7.number().int().min(1),
1494
- continuationsUsed: z7.number().int().min(0),
1495
- infraRetries: z7.number().int().min(0),
1571
+ controlRevision: z8.number().int().min(1),
1572
+ continuationsUsed: z8.number().int().min(0),
1573
+ infraRetries: z8.number().int().min(0),
1496
1574
  nextAttemptAt: Iso2.nullable(),
1497
1575
  startedAt: Iso2.nullable(),
1498
1576
  endedAt: Iso2.nullable(),
1499
- outcome: z7.object({
1500
- kind: z7.enum(["review", "failed", "blocked", "no_change", "canceled"]),
1501
- summary: z7.string()
1577
+ outcome: z8.object({
1578
+ kind: z8.enum(["review", "failed", "blocked", "no_change", "canceled"]),
1579
+ summary: z8.string()
1502
1580
  }).nullable(),
1503
1581
  limits: ContinuationPolicy,
1504
- usage: z7.object({
1505
- tokens: z7.number().nullable(),
1506
- costUsd: z7.number().nullable(),
1507
- accounting: z7.enum(["available", "unavailable"]),
1508
- note: z7.string().nullable()
1582
+ usage: z8.object({
1583
+ tokens: z8.number().nullable(),
1584
+ costUsd: z8.number().nullable(),
1585
+ accounting: z8.enum(["available", "unavailable"]),
1586
+ note: z8.string().nullable()
1509
1587
  }),
1510
- checks: z7.array(CheckResult),
1588
+ checks: z8.array(CheckResult),
1511
1589
  createdAt: Iso2,
1512
1590
  updatedAt: Iso2
1513
1591
  });
1514
- var Trigger = z7.discriminatedUnion("kind", [
1515
- z7.object({ kind: z7.literal("manual") }),
1516
- z7.object({ kind: z7.literal("once"), at: Iso2 }),
1517
- z7.object({ kind: z7.literal("cron"), expr: z7.string().min(1), timezone: z7.string().min(1) }),
1518
- z7.object({ kind: z7.literal("webhook") }),
1519
- z7.object({ kind: z7.literal("dependency"), taskId: Id5 })
1592
+ var Trigger = z8.discriminatedUnion("kind", [
1593
+ z8.object({ kind: z8.literal("manual") }),
1594
+ z8.object({ kind: z8.literal("once"), at: Iso2 }),
1595
+ z8.object({ kind: z8.literal("cron"), expr: z8.string().min(1), timezone: z8.string().min(1) }),
1596
+ z8.object({ kind: z8.literal("webhook") }),
1597
+ z8.object({ kind: z8.literal("dependency"), taskId: Id5 })
1520
1598
  ]);
1521
- var TaskTemplate = z7.object({
1522
- title: z7.string().min(1),
1523
- objective: z7.string(),
1524
- acceptanceCriteria: z7.array(z7.string()),
1599
+ var TaskTemplate = z8.object({
1600
+ title: z8.string().min(1),
1601
+ objective: z8.string(),
1602
+ acceptanceCriteria: z8.array(z8.string()),
1525
1603
  priority: Priority
1526
1604
  });
1527
- var Automation = z7.object({
1605
+ var Automation = z8.object({
1528
1606
  id: Id5,
1529
- name: z7.string().min(1),
1530
- enabled: z7.boolean(),
1607
+ name: z8.string().min(1),
1608
+ enabled: z8.boolean(),
1531
1609
  projectId: Id5,
1532
1610
  trigger: Trigger,
1533
- filters: z7.array(z7.object({ path: z7.string(), equals: z7.string() })),
1611
+ filters: z8.array(z8.object({ path: z8.string(), equals: z8.string() })),
1534
1612
  template: TaskTemplate,
1535
1613
  hostId: Id5.nullable(),
1536
1614
  profileId: Id5.nullable(),
1537
- mode: z7.enum(["fresh", "continue", "watch"]),
1538
- groupingKey: z7.string().nullable(),
1539
- overlap: z7.enum(["skip", "queue_one", "append"]),
1540
- missed: z7.enum(["skip", "run_once"]),
1615
+ mode: z8.enum(["fresh", "continue", "watch"]),
1616
+ groupingKey: z8.string().nullable(),
1617
+ overlap: z8.enum(["skip", "queue_one", "append"]),
1618
+ missed: z8.enum(["skip", "run_once"]),
1541
1619
  continuation: ContinuationPolicy,
1542
1620
  completion: CompletionPolicy,
1543
1621
  nextAt: Iso2.nullable(),
1544
1622
  lastEvaluatedAt: Iso2.nullable(),
1545
- lastOutcome: z7.string().nullable(),
1546
- failureCount: z7.number().int().min(0),
1547
- webhookTokenSet: z7.boolean(),
1623
+ lastOutcome: z8.string().nullable(),
1624
+ failureCount: z8.number().int().min(0),
1625
+ webhookTokenSet: z8.boolean(),
1548
1626
  createdAt: Iso2,
1549
1627
  updatedAt: Iso2
1550
1628
  });
1551
- var OccurrenceState = z7.enum([
1629
+ var OccurrenceState = z8.enum([
1552
1630
  "fired",
1553
1631
  "skipped_overlap",
1554
1632
  "skipped_missed",
@@ -1557,39 +1635,47 @@ var OccurrenceState = z7.enum([
1557
1635
  "failed",
1558
1636
  "filtered"
1559
1637
  ]);
1560
- var Occurrence = z7.object({
1638
+ var Occurrence = z8.object({
1561
1639
  id: Id5,
1562
1640
  automationId: Id5,
1563
- key: z7.string(),
1641
+ key: z8.string(),
1564
1642
  scheduledFor: Iso2.nullable(),
1565
1643
  state: OccurrenceState,
1566
1644
  taskId: Id5.nullable(),
1567
- reason: z7.string().nullable(),
1568
- outcome: z7.string().nullable(),
1645
+ reason: z8.string().nullable(),
1646
+ outcome: z8.string().nullable(),
1569
1647
  createdAt: Iso2
1570
1648
  });
1571
- var InteractionState = z7.preprocess((v) => v === "cancelled" ? "canceled" : v, z7.enum(["pending", "resolved", "expired", "canceled", "unsupported"]));
1572
- var Interaction = z7.object({
1649
+ var InteractionState = z8.preprocess((v) => v === "cancelled" ? "canceled" : v, z8.enum(["pending", "resolved", "expired", "canceled", "unsupported"]));
1650
+ var InteractionKind = z8.enum(["question", "approval", "plan"]);
1651
+ var Interaction = z8.object({
1573
1652
  id: Id5,
1574
1653
  sessionId: Id5,
1575
- revision: z7.number().int().min(1),
1576
- source: z7.discriminatedUnion("kind", [
1577
- z7.object({
1578
- kind: z7.literal("extension_ui"),
1579
- method: z7.enum(["select", "confirm", "input", "editor"]),
1580
- piRequestIds: z7.array(z7.string())
1654
+ revision: z8.number().int().min(1),
1655
+ source: z8.discriminatedUnion("kind", [
1656
+ z8.object({
1657
+ kind: z8.literal("extension_ui"),
1658
+ method: z8.enum(["select", "confirm", "input", "editor"]),
1659
+ piRequestIds: z8.array(z8.string())
1581
1660
  }),
1582
- z7.object({ kind: z7.literal("unsupported_custom"), title: z7.string().nullable() })
1661
+ z8.object({ kind: z8.literal("unsupported_custom"), title: z8.string().nullable() })
1583
1662
  ]),
1584
- adapterId: z7.string().nullable(),
1663
+ adapterId: z8.string().nullable(),
1585
1664
  permission: PolicyPermission.optional(),
1586
- title: z7.string(),
1665
+ /**
1666
+ * What the dialog is, when its adapter or the host says so: a question to answer, an approval
1667
+ * of something Pi wants to do, or a plan to accept. Absent for a dialog nobody described.
1668
+ */
1669
+ kind: InteractionKind.optional(),
1670
+ /** The tool call that opened the dialog, when the host knows it. */
1671
+ toolCallId: z8.string().optional(),
1672
+ title: z8.string(),
1587
1673
  presentation: UINodeSchema,
1588
1674
  state: InteractionState,
1589
- resolution: z7.object({ by: z7.string(), summary: z7.string(), at: Iso2 }).nullable(),
1675
+ resolution: z8.object({ by: z8.string(), summary: z8.string(), at: Iso2 }).nullable(),
1590
1676
  createdAt: Iso2
1591
1677
  });
1592
- var AttentionReason = z7.enum([
1678
+ var AttentionReason = z8.enum([
1593
1679
  "needs_input",
1594
1680
  "failed",
1595
1681
  "ready_for_review",
@@ -1597,171 +1683,173 @@ var AttentionReason = z7.enum([
1597
1683
  "host_unreachable",
1598
1684
  "cache_expiring"
1599
1685
  ]);
1600
- var AttentionItem = z7.object({
1686
+ var AttentionItem = z8.object({
1601
1687
  id: Id5,
1602
1688
  sessionId: Id5.nullable(),
1603
1689
  taskId: Id5.nullable(),
1604
1690
  projectId: Id5.nullable(),
1605
1691
  reason: AttentionReason,
1606
- severity: z7.enum(["info", "warning", "critical"]),
1607
- summary: z7.string(),
1692
+ severity: z8.enum(["info", "warning", "critical"]),
1693
+ summary: z8.string(),
1608
1694
  interactionId: Id5.nullable(),
1609
- deepLink: z7.string(),
1695
+ deepLink: z8.string(),
1610
1696
  acknowledgedAt: Iso2.nullable(),
1611
1697
  resolvedAt: Iso2.nullable(),
1612
1698
  createdAt: Iso2
1613
1699
  });
1614
- var Device = z7.object({
1700
+ var Device = z8.object({
1615
1701
  id: Id5,
1616
- name: z7.string(),
1702
+ name: z8.string(),
1617
1703
  kind: DeviceKind,
1618
1704
  createdAt: Iso2,
1619
1705
  lastSeenAt: Iso2.nullable(),
1620
1706
  revokedAt: Iso2.nullable(),
1621
- push: z7.object({
1622
- subscribed: z7.boolean(),
1623
- permission: z7.enum(["granted", "denied", "default", "unknown"])
1707
+ push: z8.object({
1708
+ subscribed: z8.boolean(),
1709
+ permission: z8.enum(["granted", "denied", "default", "unknown"])
1624
1710
  }),
1625
- preferredMobile: z7.boolean(),
1626
- enrolledVia: z7.enum(["enrollment", "passkey", "oidc", "admin", "approval"]).default("enrollment")
1627
- });
1628
- var ToolItemData = z7.object({
1629
- toolCallId: z7.string(),
1630
- name: z7.string(),
1631
- status: z7.enum(["running", "ok", "error"]),
1632
- args: z7.unknown(),
1633
- summary: z7.string(),
1634
- output: z7.string(),
1711
+ preferredMobile: z8.boolean(),
1712
+ enrolledVia: z8.enum(["enrollment", "passkey", "oidc", "admin", "approval"]).default("enrollment")
1713
+ });
1714
+ var ToolItemData = z8.object({
1715
+ toolCallId: z8.string(),
1716
+ name: z8.string(),
1717
+ status: z8.enum(["running", "ok", "error"]),
1718
+ args: z8.unknown(),
1719
+ summary: z8.string(),
1720
+ output: z8.string(),
1635
1721
  startedAt: Iso2,
1636
- durationMs: z7.number().nullable(),
1722
+ durationMs: z8.number().nullable(),
1637
1723
  card: UINodeSchema.nullable(),
1638
- adapterId: z7.string().nullable(),
1639
- adapterGeneration: z7.string().uuid().optional()
1724
+ adapterId: z8.string().nullable(),
1725
+ adapterGeneration: z8.string().uuid().optional(),
1726
+ /** `tool.views.v1`: what the host and an adapter say about the call (see tool-view.ts). */
1727
+ view: ToolViewData.optional()
1640
1728
  });
1641
- var TranscriptItem = z7.discriminatedUnion("kind", [
1642
- z7.object({
1729
+ var TranscriptItem = z8.discriminatedUnion("kind", [
1730
+ z8.object({
1643
1731
  id: Id5,
1644
1732
  sessionId: Id5,
1645
- order: z7.number().int(),
1733
+ order: z8.number().int(),
1646
1734
  at: Iso2,
1647
- kind: z7.literal("user"),
1648
- data: z7.object({
1649
- text: z7.string(),
1650
- images: z7.number().int().optional(),
1735
+ kind: z8.literal("user"),
1736
+ data: z8.object({
1737
+ text: z8.string(),
1738
+ images: z8.number().int().optional(),
1651
1739
  /** Pi session entry id, for rewind and fork from this message. */
1652
- entryId: z7.string().optional()
1740
+ entryId: z8.string().optional()
1653
1741
  })
1654
1742
  }),
1655
- z7.object({
1743
+ z8.object({
1656
1744
  id: Id5,
1657
1745
  sessionId: Id5,
1658
- order: z7.number().int(),
1746
+ order: z8.number().int(),
1659
1747
  at: Iso2,
1660
- kind: z7.literal("assistant"),
1661
- data: z7.object({ text: z7.string(), streaming: z7.boolean().optional() })
1748
+ kind: z8.literal("assistant"),
1749
+ data: z8.object({ text: z8.string(), streaming: z8.boolean().optional() })
1662
1750
  }),
1663
- z7.object({
1751
+ z8.object({
1664
1752
  id: Id5,
1665
1753
  sessionId: Id5,
1666
- order: z7.number().int(),
1754
+ order: z8.number().int(),
1667
1755
  at: Iso2,
1668
- kind: z7.literal("thinking"),
1669
- data: z7.object({ text: z7.string() })
1756
+ kind: z8.literal("thinking"),
1757
+ data: z8.object({ text: z8.string() })
1670
1758
  }),
1671
- z7.object({
1759
+ z8.object({
1672
1760
  id: Id5,
1673
1761
  sessionId: Id5,
1674
- order: z7.number().int(),
1762
+ order: z8.number().int(),
1675
1763
  at: Iso2,
1676
- kind: z7.literal("tool"),
1764
+ kind: z8.literal("tool"),
1677
1765
  data: ToolItemData
1678
1766
  }),
1679
- z7.object({
1767
+ z8.object({
1680
1768
  id: Id5,
1681
1769
  sessionId: Id5,
1682
- order: z7.number().int(),
1770
+ order: z8.number().int(),
1683
1771
  at: Iso2,
1684
- kind: z7.literal("notice"),
1685
- data: z7.object({
1772
+ kind: z8.literal("notice"),
1773
+ data: z8.object({
1686
1774
  level: DiagnosticLevel,
1687
- text: z7.string(),
1688
- customType: z7.string().min(1).max(200).optional(),
1775
+ text: z8.string(),
1776
+ customType: z8.string().min(1).max(200).optional(),
1689
1777
  card: UINodeSchema.optional(),
1690
- adapterId: z7.string().optional(),
1691
- adapterGeneration: z7.string().uuid().optional()
1778
+ adapterId: z8.string().optional(),
1779
+ adapterGeneration: z8.string().uuid().optional()
1692
1780
  }).refine((data) => !data.card || !!data.adapterId, "Card requires adapterId")
1693
1781
  }),
1694
- z7.object({
1782
+ z8.object({
1695
1783
  id: Id5,
1696
1784
  sessionId: Id5,
1697
- order: z7.number().int(),
1785
+ order: z8.number().int(),
1698
1786
  at: Iso2,
1699
- kind: z7.literal("interaction"),
1700
- data: z7.object({ interactionId: Id5 })
1787
+ kind: z8.literal("interaction"),
1788
+ data: z8.object({ interactionId: Id5 })
1701
1789
  }),
1702
- z7.object({
1790
+ z8.object({
1703
1791
  id: Id5,
1704
1792
  sessionId: Id5,
1705
- order: z7.number().int(),
1793
+ order: z8.number().int(),
1706
1794
  at: Iso2,
1707
- kind: z7.literal("subagent"),
1708
- data: z7.object({
1709
- runId: z7.string(),
1710
- label: z7.string(),
1711
- status: z7.string(),
1712
- sessionFile: z7.string().nullable(),
1795
+ kind: z8.literal("subagent"),
1796
+ data: z8.object({
1797
+ runId: z8.string(),
1798
+ label: z8.string(),
1799
+ status: z8.string(),
1800
+ sessionFile: z8.string().nullable(),
1713
1801
  linkedSessionId: Id5.nullable()
1714
1802
  })
1715
1803
  }),
1716
- z7.object({
1804
+ z8.object({
1717
1805
  id: Id5,
1718
1806
  sessionId: Id5,
1719
- order: z7.number().int(),
1807
+ order: z8.number().int(),
1720
1808
  at: Iso2,
1721
- kind: z7.literal("system"),
1722
- data: z7.object({ text: z7.string(), suggestion: z7.boolean().optional() })
1809
+ kind: z8.literal("system"),
1810
+ data: z8.object({ text: z8.string(), suggestion: z8.boolean().optional() })
1723
1811
  })
1724
1812
  ]);
1725
- var Panel = z7.object({
1813
+ var Panel = z8.object({
1726
1814
  sessionId: Id5,
1727
- adapterId: z7.string(),
1728
- slot: z7.string(),
1729
- title: z7.string(),
1815
+ adapterId: z8.string(),
1816
+ slot: z8.string(),
1817
+ title: z8.string(),
1730
1818
  node: UINodeSchema.nullable(),
1731
- webRenderer: z7.boolean(),
1732
- mobileFallback: z7.string().nullable(),
1819
+ webRenderer: z8.boolean(),
1820
+ mobileFallback: z8.string().nullable(),
1733
1821
  contribution: ContributionDescriptor.optional(),
1734
- state: z7.unknown().optional(),
1735
- adapterGeneration: z7.string().uuid().optional(),
1822
+ state: z8.unknown().optional(),
1823
+ adapterGeneration: z8.string().uuid().optional(),
1736
1824
  updatedAt: Iso2
1737
1825
  });
1738
- var Diagnostic = z7.object({
1826
+ var Diagnostic = z8.object({
1739
1827
  sessionId: Id5.nullable(),
1740
- adapterId: z7.string().nullable(),
1828
+ adapterId: z8.string().nullable(),
1741
1829
  level: DiagnosticLevel,
1742
- message: z7.string(),
1830
+ message: z8.string(),
1743
1831
  at: Iso2
1744
1832
  });
1745
- var AdapterInfo = z7.object({
1746
- id: z7.string(),
1747
- version: z7.string(),
1748
- tier: z7.enum(["project", "owner", "plugin", "bundled"]),
1749
- target: z7.object({
1750
- extension: z7.string(),
1751
- versionRange: z7.string(),
1752
- testedVersions: z7.array(z7.string())
1833
+ var AdapterInfo = z8.object({
1834
+ id: z8.string(),
1835
+ version: z8.string(),
1836
+ tier: z8.enum(["project", "owner", "plugin", "bundled"]),
1837
+ target: z8.object({
1838
+ extension: z8.string(),
1839
+ versionRange: z8.string(),
1840
+ testedVersions: z8.array(z8.string())
1753
1841
  }),
1754
- capabilities: z7.array(z7.string()),
1755
- webRenderer: z7.boolean(),
1756
- status: z7.enum(["active", "disabled", "error"]),
1757
- detail: z7.string().nullable()
1758
- });
1759
- var Passkey = z7.object({
1760
- id: z7.string(),
1761
- name: z7.string(),
1842
+ capabilities: z8.array(z8.string()),
1843
+ webRenderer: z8.boolean(),
1844
+ status: z8.enum(["active", "disabled", "error"]),
1845
+ detail: z8.string().nullable()
1846
+ });
1847
+ var Passkey = z8.object({
1848
+ id: z8.string(),
1849
+ name: z8.string(),
1762
1850
  createdAt: Iso2,
1763
1851
  lastUsedAt: Iso2.nullable(),
1764
- transports: z7.array(z7.string())
1852
+ transports: z8.array(z8.string())
1765
1853
  });
1766
1854
 
1767
1855
  // packages/protocol/dist/adapter-preview.js
@@ -1774,92 +1862,92 @@ function bounded(input, ctx) {
1774
1862
  return input;
1775
1863
  } catch (error) {
1776
1864
  ctx.addIssue({ code: "custom", message: error.message });
1777
- return z8.NEVER;
1865
+ return z9.NEVER;
1778
1866
  }
1779
1867
  }
1780
- var Id6 = z8.string().min(1).max(200);
1781
- var Text2 = z8.string().max(64 * 1024);
1782
- var Tool = { toolCallId: Id6, name: Id6, args: z8.unknown() };
1868
+ var Id6 = z9.string().min(1).max(200);
1869
+ var Text2 = z9.string().max(64 * 1024);
1870
+ var Tool = { toolCallId: Id6, name: Id6, args: z9.unknown() };
1783
1871
  var DialogCommon = { id: Id6, title: Text2 };
1784
- var AdapterPreviewPiUiRequestSchema = z8.discriminatedUnion("method", [
1785
- z8.object({
1872
+ var AdapterPreviewPiUiRequestSchema = z9.discriminatedUnion("method", [
1873
+ z9.object({
1786
1874
  ...DialogCommon,
1787
- method: z8.literal("select"),
1788
- options: z8.array(Text2).max(200),
1789
- timeout: z8.number().nonnegative().optional()
1875
+ method: z9.literal("select"),
1876
+ options: z9.array(Text2).max(200),
1877
+ timeout: z9.number().nonnegative().optional()
1790
1878
  }).strict(),
1791
- z8.object({
1879
+ z9.object({
1792
1880
  ...DialogCommon,
1793
- method: z8.literal("confirm"),
1881
+ method: z9.literal("confirm"),
1794
1882
  message: Text2,
1795
- timeout: z8.number().nonnegative().optional()
1883
+ timeout: z9.number().nonnegative().optional()
1796
1884
  }).strict(),
1797
- z8.object({
1885
+ z9.object({
1798
1886
  ...DialogCommon,
1799
- method: z8.literal("input"),
1887
+ method: z9.literal("input"),
1800
1888
  placeholder: Text2.optional(),
1801
- timeout: z8.number().nonnegative().optional()
1889
+ timeout: z9.number().nonnegative().optional()
1802
1890
  }).strict(),
1803
- z8.object({ ...DialogCommon, method: z8.literal("editor"), prefill: Text2.optional() }).strict()
1891
+ z9.object({ ...DialogCommon, method: z9.literal("editor"), prefill: Text2.optional() }).strict()
1804
1892
  ]);
1805
- var AdapterPreviewStepSchema = z8.discriminatedUnion("kind", [
1806
- z8.object({ kind: z8.literal("restore") }).strict(),
1807
- z8.object({ kind: z8.literal("toolStart"), data: z8.object(Tool).strict() }).strict(),
1808
- z8.object({
1809
- kind: z8.literal("toolUpdate"),
1810
- data: z8.object({ ...Tool, partialResult: z8.unknown(), details: z8.unknown().optional() }).strict()
1893
+ var AdapterPreviewStepSchema = z9.discriminatedUnion("kind", [
1894
+ z9.object({ kind: z9.literal("restore") }).strict(),
1895
+ z9.object({ kind: z9.literal("toolStart"), data: z9.object(Tool).strict() }).strict(),
1896
+ z9.object({
1897
+ kind: z9.literal("toolUpdate"),
1898
+ data: z9.object({ ...Tool, partialResult: z9.unknown(), details: z9.unknown().optional() }).strict()
1811
1899
  }).strict(),
1812
- z8.object({
1813
- kind: z8.literal("toolEnd"),
1814
- data: z8.object({
1900
+ z9.object({
1901
+ kind: z9.literal("toolEnd"),
1902
+ data: z9.object({
1815
1903
  ...Tool,
1816
- result: z8.unknown(),
1817
- isError: z8.boolean(),
1818
- details: z8.unknown().optional()
1904
+ result: z9.unknown(),
1905
+ isError: z9.boolean(),
1906
+ details: z9.unknown().optional()
1819
1907
  }).strict()
1820
1908
  }).strict(),
1821
- z8.object({
1822
- kind: z8.literal("status"),
1823
- data: z8.object({ key: Id6, text: Text2.optional() }).strict()
1909
+ z9.object({
1910
+ kind: z9.literal("status"),
1911
+ data: z9.object({ key: Id6, text: Text2.optional() }).strict()
1824
1912
  }).strict(),
1825
- z8.object({
1826
- kind: z8.literal("widget"),
1827
- data: z8.object({ key: Id6, lines: z8.array(Text2).max(200).optional() }).strict()
1913
+ z9.object({
1914
+ kind: z9.literal("widget"),
1915
+ data: z9.object({ key: Id6, lines: z9.array(Text2).max(200).optional() }).strict()
1828
1916
  }).strict(),
1829
- z8.object({ kind: z8.literal("dialog"), data: AdapterPreviewPiUiRequestSchema }).strict(),
1830
- z8.object({
1831
- kind: z8.literal("answer"),
1832
- data: z8.object({ requestId: Id6, response: InteractionResponseSchema }).strict()
1917
+ z9.object({ kind: z9.literal("dialog"), data: AdapterPreviewPiUiRequestSchema }).strict(),
1918
+ z9.object({
1919
+ kind: z9.literal("answer"),
1920
+ data: z9.object({ requestId: Id6, response: InteractionResponseSchema }).strict()
1833
1921
  }).strict(),
1834
- z8.object({
1835
- kind: z8.literal("customMessage"),
1836
- data: z8.object({
1922
+ z9.object({
1923
+ kind: z9.literal("customMessage"),
1924
+ data: z9.object({
1837
1925
  customType: Id6,
1838
- content: z8.unknown(),
1839
- display: z8.boolean().optional(),
1840
- details: z8.unknown().optional()
1926
+ content: z9.unknown(),
1927
+ display: z9.boolean().optional(),
1928
+ details: z9.unknown().optional()
1841
1929
  }).strict()
1842
1930
  }).strict(),
1843
- z8.object({
1844
- kind: z8.literal("action"),
1845
- data: z8.object({ actionId: Id6, payload: z8.unknown() }).strict()
1931
+ z9.object({
1932
+ kind: z9.literal("action"),
1933
+ data: z9.object({ actionId: Id6, payload: z9.unknown() }).strict()
1846
1934
  }).strict()
1847
1935
  ]);
1848
- var AdapterPreviewFixtureSchema = z8.unknown().transform(bounded).pipe(z8.object({
1849
- version: z8.literal(1),
1850
- name: z8.string().min(1).max(200),
1851
- initialState: z8.record(z8.string(), z8.record(z8.string(), z8.unknown())).optional(),
1852
- steps: z8.array(AdapterPreviewStepSchema).max(ADAPTER_PREVIEW_MAX_STEPS)
1936
+ var AdapterPreviewFixtureSchema = z9.unknown().transform(bounded).pipe(z9.object({
1937
+ version: z9.literal(1),
1938
+ name: z9.string().min(1).max(200),
1939
+ initialState: z9.record(z9.string(), z9.record(z9.string(), z9.unknown())).optional(),
1940
+ steps: z9.array(AdapterPreviewStepSchema).max(ADAPTER_PREVIEW_MAX_STEPS)
1853
1941
  }).strict());
1854
- var PortableNode = z8.unknown().transform((input, ctx) => {
1942
+ var PortableNode = z9.unknown().transform((input, ctx) => {
1855
1943
  try {
1856
1944
  return validateUINode(input);
1857
1945
  } catch (error) {
1858
1946
  ctx.addIssue({ code: "custom", message: error.message });
1859
- return z8.NEVER;
1947
+ return z9.NEVER;
1860
1948
  }
1861
1949
  });
1862
- var PreviewPanel = Panel.extend({ webRenderer: z8.literal(false) }).superRefine((panel, ctx) => {
1950
+ var PreviewPanel = Panel.extend({ webRenderer: z9.literal(false) }).superRefine((panel, ctx) => {
1863
1951
  try {
1864
1952
  if (panel.sessionId !== ADAPTER_PREVIEW_SESSION_ID)
1865
1953
  throw new Error("Preview panels must use the fake preview session");
@@ -1881,13 +1969,13 @@ var PreviewPanel = Panel.extend({ webRenderer: z8.literal(false) }).superRefine(
1881
1969
  ctx.addIssue({ code: "custom", message: error.message });
1882
1970
  }
1883
1971
  });
1884
- var AdapterPreviewSchema = z8.unknown().transform(bounded).pipe(z8.object({
1885
- version: z8.literal(1),
1886
- name: z8.string().min(1).max(200),
1887
- adapter: z8.object({ id: Id6, version: Id6 }).strict(),
1888
- steps: z8.array(z8.object({
1889
- index: z8.number().int().min(0).max(ADAPTER_PREVIEW_MAX_STEPS - 1),
1890
- kind: z8.enum([
1972
+ var AdapterPreviewSchema = z9.unknown().transform(bounded).pipe(z9.object({
1973
+ version: z9.literal(1),
1974
+ name: z9.string().min(1).max(200),
1975
+ adapter: z9.object({ id: Id6, version: Id6 }).strict(),
1976
+ steps: z9.array(z9.object({
1977
+ index: z9.number().int().min(0).max(ADAPTER_PREVIEW_MAX_STEPS - 1),
1978
+ kind: z9.enum([
1891
1979
  "restore",
1892
1980
  "toolStart",
1893
1981
  "toolUpdate",
@@ -1899,24 +1987,24 @@ var AdapterPreviewSchema = z8.unknown().transform(bounded).pipe(z8.object({
1899
1987
  "customMessage",
1900
1988
  "action"
1901
1989
  ]),
1902
- ok: z8.boolean(),
1903
- error: z8.string().max(4e3).nullable()
1990
+ ok: z9.boolean(),
1991
+ error: z9.string().max(4e3).nullable()
1904
1992
  }).strict()).max(ADAPTER_PREVIEW_MAX_STEPS),
1905
- panels: z8.array(PreviewPanel).max(256),
1906
- interactions: z8.array(z8.object({
1993
+ panels: z9.array(PreviewPanel).max(256),
1994
+ interactions: z9.array(z9.object({
1907
1995
  request: AdapterPreviewPiUiRequestSchema,
1908
1996
  presentation: PortableNode,
1909
- state: z8.enum(["pending", "resolved"])
1997
+ state: z9.enum(["pending", "resolved"])
1910
1998
  }).strict()).max(ADAPTER_PREVIEW_MAX_STEPS),
1911
- cards: z8.array(z8.unknown().transform((input, ctx) => {
1999
+ cards: z9.array(z9.unknown().transform((input, ctx) => {
1912
2000
  try {
1913
2001
  return validateContributionCard(input);
1914
2002
  } catch (error) {
1915
2003
  ctx.addIssue({ code: "custom", message: error.message });
1916
- return z8.NEVER;
2004
+ return z9.NEVER;
1917
2005
  }
1918
2006
  })).max(ADAPTER_PREVIEW_MAX_STEPS * 3),
1919
- diagnostics: z8.array(Diagnostic.extend({ message: z8.string().max(4e3) }).refine((d) => d.sessionId === null || d.sessionId === ADAPTER_PREVIEW_SESSION_ID, "Preview diagnostics must use the fake preview session")).max(200)
2007
+ diagnostics: z9.array(Diagnostic.extend({ message: z9.string().max(4e3) }).refine((d) => d.sessionId === null || d.sessionId === ADAPTER_PREVIEW_SESSION_ID, "Preview diagnostics must use the fake preview session")).max(200)
1920
2008
  }).strict().superRefine((preview, ctx) => {
1921
2009
  const slots = /* @__PURE__ */ new Set();
1922
2010
  let contributions = 0;
@@ -1945,39 +2033,39 @@ var AdapterPreviewSchema = z8.unknown().transform(bounded).pipe(z8.object({
1945
2033
  }));
1946
2034
 
1947
2035
  // packages/protocol/dist/adapters.js
1948
- import { z as z9 } from "zod";
1949
- var Path = z9.string().max(4096);
2036
+ import { z as z10 } from "zod";
2037
+ var Path = z10.string().max(4096);
1950
2038
  var SessionAdapterInfo = AdapterInfo.extend({
1951
- runtimeStatus: z9.enum(["active", "disabled", "unavailable"]),
1952
- runtimeDetail: z9.string().max(4e3).nullable(),
1953
- provenance: z9.object({
1954
- scope: z9.enum(["user", "project", "explicit"]),
2039
+ runtimeStatus: z10.enum(["active", "disabled", "unavailable"]),
2040
+ runtimeDetail: z10.string().max(4e3).nullable(),
2041
+ provenance: z10.object({
2042
+ scope: z10.enum(["user", "project", "explicit"]),
1955
2043
  source: Path.nullable(),
1956
2044
  packageDir: Path.nullable(),
1957
2045
  manifestPath: Path.nullable(),
1958
- targetVersion: z9.string().nullable(),
1959
- entrypoints: z9.array(Path).max(128),
1960
- evidence: z9.enum(["runtime-reported", "package-level", "explicit"])
2046
+ targetVersion: z10.string().nullable(),
2047
+ entrypoints: z10.array(Path).max(128),
2048
+ evidence: z10.enum(["runtime-reported", "package-level", "explicit"])
1961
2049
  })
1962
2050
  });
1963
- var SessionAdaptersResult = z9.object({
1964
- generation: z9.string().uuid().nullable(),
1965
- runtimeId: z9.string().nullable(),
1966
- reloadable: z9.boolean(),
1967
- blockedReason: z9.string().nullable(),
1968
- adapters: z9.array(SessionAdapterInfo).max(256),
1969
- diagnostics: z9.array(Diagnostic).max(100)
2051
+ var SessionAdaptersResult = z10.object({
2052
+ generation: z10.string().uuid().nullable(),
2053
+ runtimeId: z10.string().nullable(),
2054
+ reloadable: z10.boolean(),
2055
+ blockedReason: z10.string().nullable(),
2056
+ adapters: z10.array(SessionAdapterInfo).max(256),
2057
+ diagnostics: z10.array(Diagnostic).max(100)
1970
2058
  });
1971
2059
 
1972
2060
  // packages/protocol/dist/agent-wire.js
1973
- import { z as z10 } from "zod";
1974
- var Id7 = z10.string().min(1).max(200);
1975
- var Instant3 = z10.string().refine((value) => {
2061
+ import { z as z11 } from "zod";
2062
+ var Id7 = z11.string().min(1).max(200);
2063
+ var Instant3 = z11.string().refine((value) => {
1976
2064
  const date = new Date(value);
1977
2065
  return Number.isFinite(date.getTime()) && date.toISOString() === value;
1978
2066
  }, "Expected canonical UTC timestamp");
1979
2067
  var AGENT_FRAME_MAX_BYTES = 128 * 1024;
1980
- var AgentMethod = z10.enum([
2068
+ var AgentMethod = z11.enum([
1981
2069
  "session.bind",
1982
2070
  "task.create",
1983
2071
  "message.send",
@@ -1987,34 +2075,34 @@ var AgentMethod = z10.enum([
1987
2075
  "policy.status",
1988
2076
  "policy.cancel"
1989
2077
  ]);
1990
- var AgentToolMethod = z10.enum(["task.create", "message.send", "inbox.read"]);
1991
- var RequestHash = z10.string().regex(/^[a-f0-9]{64}$/);
1992
- var AgentReceiptPeekRequest = z10.object({ method: AgentToolMethod, args: z10.record(z10.string(), z10.json()) }).strict();
1993
- var AgentReceiptPeekResult = z10.discriminatedUnion("found", [
1994
- z10.object({ found: z10.literal(false) }).strict(),
1995
- z10.object({ found: z10.literal(true), requestHash: RequestHash }).strict()
2078
+ var AgentToolMethod = z11.enum(["task.create", "message.send", "inbox.read"]);
2079
+ var RequestHash = z11.string().regex(/^[a-f0-9]{64}$/);
2080
+ var AgentReceiptPeekRequest = z11.object({ method: AgentToolMethod, args: z11.record(z11.string(), z11.json()) }).strict();
2081
+ var AgentReceiptPeekResult = z11.discriminatedUnion("found", [
2082
+ z11.object({ found: z11.literal(false) }).strict(),
2083
+ z11.object({ found: z11.literal(true), requestHash: RequestHash }).strict()
1996
2084
  ]);
1997
- var AgentReceiptReplay = z10.object({ requestHash: RequestHash }).strict();
1998
- var CreateAgentTask = z10.object({
1999
- objective: z10.string().min(1).max(16e3),
2000
- acceptance: z10.array(z10.string().min(1).max(2e3)).max(100).default([]),
2001
- dependencies: z10.array(Id7).max(100).default([]),
2085
+ var AgentReceiptReplay = z11.object({ requestHash: RequestHash }).strict();
2086
+ var CreateAgentTask = z11.object({
2087
+ objective: z11.string().min(1).max(16e3),
2088
+ acceptance: z11.array(z11.string().min(1).max(2e3)).max(100).default([]),
2089
+ dependencies: z11.array(Id7).max(100).default([]),
2002
2090
  parentTaskId: Id7.nullable().optional(),
2003
2091
  hostId: Id7.optional(),
2004
2092
  profileId: Id7.optional(),
2005
- notifyOnFinish: z10.boolean().default(true)
2093
+ notifyOnFinish: z11.boolean().default(true)
2006
2094
  });
2007
- var SendAgentMessage = z10.object({
2095
+ var SendAgentMessage = z11.object({
2008
2096
  sessionId: Id7,
2009
- body: z10.string().min(1).max(16e3),
2010
- mode: z10.enum(["steer", "queue"]),
2097
+ body: z11.string().min(1).max(16e3),
2098
+ mode: z11.enum(["steer", "queue"]),
2011
2099
  replyTo: Id7.optional()
2012
2100
  });
2013
- var ReadAgentInbox = z10.object({
2014
- after: z10.number().int().nonnegative().default(0),
2015
- limit: z10.number().int().min(1).max(100).default(20)
2101
+ var ReadAgentInbox = z11.object({
2102
+ after: z11.number().int().nonnegative().default(0),
2103
+ limit: z11.number().int().min(1).max(100).default(20)
2016
2104
  });
2017
- var DeliveryState = z10.enum([
2105
+ var DeliveryState = z11.enum([
2018
2106
  "pending",
2019
2107
  "held",
2020
2108
  "deferred",
@@ -2025,46 +2113,46 @@ var DeliveryState = z10.enum([
2025
2113
  "failed"
2026
2114
  ]);
2027
2115
  var AgentMessageFields = {
2028
- seq: z10.number().int().positive(),
2116
+ seq: z11.number().int().positive(),
2029
2117
  id: Id7,
2030
2118
  recipientSessionId: Id7,
2031
2119
  replyTo: Id7.nullable(),
2032
2120
  chainId: Id7,
2033
- depth: z10.number().int().min(0).max(4),
2034
- body: z10.unknown(),
2035
- requestedMode: z10.enum(["steer", "queue"]),
2121
+ depth: z11.number().int().min(0).max(4),
2122
+ body: z11.unknown(),
2123
+ requestedMode: z11.enum(["steer", "queue"]),
2036
2124
  deliveryState: DeliveryState,
2037
- holdUntil: z10.string(),
2038
- readAt: z10.string().nullable(),
2039
- createdAt: z10.string()
2125
+ holdUntil: z11.string(),
2126
+ readAt: z11.string().nullable(),
2127
+ createdAt: z11.string()
2040
2128
  };
2041
- var AgentMessage = z10.discriminatedUnion("kind", [
2042
- z10.object({ ...AgentMessageFields, kind: z10.literal("message"), senderSessionId: Id7 }),
2043
- z10.object({
2129
+ var AgentMessage = z11.discriminatedUnion("kind", [
2130
+ z11.object({ ...AgentMessageFields, kind: z11.literal("message"), senderSessionId: Id7 }),
2131
+ z11.object({
2044
2132
  ...AgentMessageFields,
2045
- kind: z10.literal("completion"),
2133
+ kind: z11.literal("completion"),
2046
2134
  senderSessionId: Id7.nullable()
2047
2135
  })
2048
2136
  ]);
2049
- var AgentInbox = z10.object({
2050
- messages: z10.array(AgentMessage),
2051
- nextAfter: z10.number().int().nonnegative(),
2052
- hasMore: z10.boolean()
2053
- });
2054
- var AgentToolPolicyWait = PolicyEvaluation.options[2].omit({ verdict: true }).extend({ type: z10.literal("policy.required") }).strict();
2055
- var AgentRequestFrame = z10.object({
2056
- type: z10.literal("agent.request"),
2137
+ var AgentInbox = z11.object({
2138
+ messages: z11.array(AgentMessage),
2139
+ nextAfter: z11.number().int().nonnegative(),
2140
+ hasMore: z11.boolean()
2141
+ });
2142
+ var AgentToolPolicyWait = PolicyEvaluation.options[2].omit({ verdict: true }).extend({ type: z11.literal("policy.required") }).strict();
2143
+ var AgentRequestFrame = z11.object({
2144
+ type: z11.literal("agent.request"),
2057
2145
  requestId: Id7,
2058
2146
  sessionId: Id7,
2059
2147
  nativeSessionId: Id7,
2060
2148
  runtimeId: Id7,
2061
- context: z10.object({ humanInputId: Id7.nullable(), causalMessageId: Id7.nullable() }).strict(),
2149
+ context: z11.object({ humanInputId: Id7.nullable(), causalMessageId: Id7.nullable() }).strict(),
2062
2150
  toolCallId: Id7.optional(),
2063
2151
  receiptReplay: AgentReceiptReplay.optional(),
2064
2152
  // Tool-method ingress requires this separately; legacy/non-tool frames remain compatible.
2065
2153
  deadlineAt: Instant3.optional(),
2066
2154
  method: AgentMethod,
2067
- args: z10.unknown()
2155
+ args: z11.unknown()
2068
2156
  }).strict().superRefine((frame, ctx) => {
2069
2157
  if (frame.method === "receipt.peek") {
2070
2158
  if (!frame.toolCallId) {
@@ -2083,63 +2171,63 @@ var AgentRequestFrame = z10.object({
2083
2171
  });
2084
2172
  }
2085
2173
  });
2086
- var AgentResultFrame = z10.discriminatedUnion("ok", [
2087
- z10.object({
2088
- type: z10.literal("agent.result"),
2174
+ var AgentResultFrame = z11.discriminatedUnion("ok", [
2175
+ z11.object({
2176
+ type: z11.literal("agent.result"),
2089
2177
  requestId: Id7,
2090
2178
  runtimeId: Id7,
2091
- ok: z10.literal(true),
2092
- result: z10.unknown()
2179
+ ok: z11.literal(true),
2180
+ result: z11.unknown()
2093
2181
  }),
2094
- z10.object({
2095
- type: z10.literal("agent.result"),
2182
+ z11.object({
2183
+ type: z11.literal("agent.result"),
2096
2184
  requestId: Id7,
2097
2185
  runtimeId: Id7,
2098
- ok: z10.literal(false),
2186
+ ok: z11.literal(false),
2099
2187
  error: ErrorBody
2100
2188
  })
2101
2189
  ]);
2102
2190
 
2103
2191
  // packages/protocol/dist/api.js
2104
- import { z as z14 } from "zod";
2192
+ import { z as z15 } from "zod";
2105
2193
 
2106
2194
  // packages/protocol/dist/host-wire.js
2107
- import { z as z13 } from "zod";
2195
+ import { z as z14 } from "zod";
2108
2196
 
2109
2197
  // packages/protocol/dist/events.js
2110
- import { z as z11 } from "zod";
2198
+ import { z as z12 } from "zod";
2111
2199
  var EventDataSchemas = {
2112
2200
  "host.updated": Host,
2113
2201
  "project.updated": Project,
2114
- "project.deleted": z11.object({ id: z11.string() }),
2202
+ "project.deleted": z12.object({ id: z12.string() }),
2115
2203
  "checkout.updated": Checkout,
2116
2204
  "workspace.updated": Workspace,
2117
- "workspace.deleted": z11.object({ id: z11.string() }),
2205
+ "workspace.deleted": z12.object({ id: z12.string() }),
2118
2206
  "profile.updated": Profile,
2119
- "profile.deleted": z11.object({ id: z11.string() }),
2207
+ "profile.deleted": z12.object({ id: z12.string() }),
2120
2208
  "scope.updated": Scope,
2121
- "scope.deleted": z11.object({ id: z11.string() }),
2209
+ "scope.deleted": z12.object({ id: z12.string() }),
2122
2210
  "session.updated": Session,
2123
2211
  "transcript.item": TranscriptItem,
2124
- "transcript.reset": z11.object({ sessionId: z11.string(), epoch: z11.number().int() }),
2212
+ "transcript.reset": z12.object({ sessionId: z12.string(), epoch: z12.number().int() }),
2125
2213
  "interaction.updated": Interaction,
2126
2214
  "panel.updated": Panel,
2127
- "adapters.updated": z11.object({ hostId: z11.string(), adapters: z11.array(AdapterInfo) }),
2215
+ "adapters.updated": z12.object({ hostId: z12.string(), adapters: z12.array(AdapterInfo) }),
2128
2216
  diagnostic: Diagnostic,
2129
2217
  "task.updated": Task,
2130
- "task.deleted": z11.object({ id: z11.string() }),
2218
+ "task.deleted": z12.object({ id: z12.string() }),
2131
2219
  "run.updated": Run,
2132
2220
  "automation.updated": Automation,
2133
- "automation.deleted": z11.object({ id: z11.string() }),
2221
+ "automation.deleted": z12.object({ id: z12.string() }),
2134
2222
  "occurrence.created": Occurrence,
2135
2223
  "occurrence.updated": Occurrence,
2136
2224
  "attention.updated": AttentionItem,
2137
2225
  "device.updated": Device,
2138
2226
  "issue.updated": TrackedIssue,
2139
- "issue.deleted": z11.object({ id: z11.string() }),
2227
+ "issue.deleted": z12.object({ id: z12.string() }),
2140
2228
  "client.updated": Client,
2141
- "client.deleted": z11.object({ id: z11.string() }),
2142
- "settings.updated": z11.object({ dispatchPaused: z11.boolean() })
2229
+ "client.deleted": z12.object({ id: z12.string() }),
2230
+ "settings.updated": z12.object({ dispatchPaused: z12.boolean() })
2143
2231
  };
2144
2232
  var EVENT_TYPES = Object.keys(EventDataSchemas);
2145
2233
  var LEGACY_EVENT_TYPES = {
@@ -2149,19 +2237,19 @@ function canonicalEventType(type) {
2149
2237
  return LEGACY_EVENT_TYPES[type] ?? type;
2150
2238
  }
2151
2239
  var canonical = (v) => typeof v === "string" ? canonicalEventType(v) : v;
2152
- var EventTypeSchema = z11.preprocess(canonical, z11.enum(EVENT_TYPES));
2153
- var EventScope = z11.object({
2154
- hostId: z11.string().optional(),
2155
- sessionId: z11.string().optional(),
2156
- taskId: z11.string().optional(),
2157
- projectId: z11.string().optional()
2240
+ var EventTypeSchema = z12.preprocess(canonical, z12.enum(EVENT_TYPES));
2241
+ var EventScope = z12.object({
2242
+ hostId: z12.string().optional(),
2243
+ sessionId: z12.string().optional(),
2244
+ taskId: z12.string().optional(),
2245
+ projectId: z12.string().optional()
2158
2246
  });
2159
2247
  var EventEnvelope = EventScope.extend({
2160
- seq: z11.number().int(),
2161
- id: z11.string(),
2248
+ seq: z12.number().int(),
2249
+ id: z12.string(),
2162
2250
  type: EventTypeSchema,
2163
- at: z11.string(),
2164
- data: z11.unknown()
2251
+ at: z12.string(),
2252
+ data: z12.unknown()
2165
2253
  });
2166
2254
  var HOST_EVENT_TYPES = [
2167
2255
  "session.updated",
@@ -2174,353 +2262,355 @@ var HOST_EVENT_TYPES = [
2174
2262
  "workspace.deleted"
2175
2263
  ];
2176
2264
  var HostEvent = EventScope.extend({
2177
- eventId: z11.string(),
2178
- type: z11.preprocess(canonical, z11.enum(HOST_EVENT_TYPES)),
2179
- at: z11.string(),
2180
- data: z11.unknown()
2181
- });
2182
- var StreamDelta = z11.object({
2183
- sessionId: z11.string(),
2184
- itemId: z11.string(),
2185
- kind: z11.enum(["text", "thinking", "tool_args", "tool_output"]),
2186
- delta: z11.string(),
2187
- order: z11.number().int().optional()
2265
+ eventId: z12.string(),
2266
+ type: z12.preprocess(canonical, z12.enum(HOST_EVENT_TYPES)),
2267
+ at: z12.string(),
2268
+ data: z12.unknown()
2269
+ });
2270
+ var StreamDelta = z12.object({
2271
+ sessionId: z12.string(),
2272
+ itemId: z12.string(),
2273
+ kind: z12.enum(["text", "thinking", "tool_args", "tool_output"]),
2274
+ delta: z12.string(),
2275
+ order: z12.number().int().optional()
2188
2276
  });
2189
2277
 
2190
2278
  // packages/protocol/dist/terminal-wire.js
2191
- import { z as z12 } from "zod";
2192
- var Cols = z12.number().int().min(10).max(1e3);
2193
- var Rows = z12.number().int().min(5).max(500);
2194
- var TermViewerToServer = z12.discriminatedUnion("t", [
2195
- z12.object({ t: z12.literal("in"), d: z12.string() }),
2196
- z12.object({ t: z12.literal("resize"), cols: Cols, rows: Rows }),
2197
- z12.object({ t: z12.literal("claim") })
2279
+ import { z as z13 } from "zod";
2280
+ var Cols = z13.number().int().min(10).max(1e3);
2281
+ var Rows = z13.number().int().min(5).max(500);
2282
+ var TermViewerToServer = z13.discriminatedUnion("t", [
2283
+ z13.object({ t: z13.literal("in"), d: z13.string() }),
2284
+ z13.object({ t: z13.literal("resize"), cols: Cols, rows: Rows }),
2285
+ z13.object({ t: z13.literal("claim") })
2198
2286
  ]);
2199
- var TermServerToViewer = z12.discriminatedUnion("t", [
2200
- z12.object({ t: z12.literal("out"), d: z12.string() }),
2201
- z12.object({ t: z12.literal("closed"), reason: z12.string() }),
2202
- z12.object({ t: z12.literal("size"), cols: Cols, rows: Rows, owner: z12.boolean() })
2287
+ var TermServerToViewer = z13.discriminatedUnion("t", [
2288
+ z13.object({ t: z13.literal("out"), d: z13.string() }),
2289
+ z13.object({ t: z13.literal("closed"), reason: z13.string() }),
2290
+ z13.object({ t: z13.literal("size"), cols: Cols, rows: Rows, owner: z13.boolean() })
2203
2291
  ]);
2204
- var TermCoordinatorMsg = z12.discriminatedUnion("t", [
2205
- z12.object({
2206
- t: z12.literal("open"),
2207
- sessionId: z12.string(),
2292
+ var TermCoordinatorMsg = z13.discriminatedUnion("t", [
2293
+ z13.object({
2294
+ t: z13.literal("open"),
2295
+ sessionId: z13.string(),
2208
2296
  cols: Cols,
2209
2297
  rows: Rows,
2210
- passive: z12.boolean().optional()
2298
+ passive: z13.boolean().optional()
2211
2299
  }),
2212
- z12.object({ t: z12.literal("claim") }),
2213
- z12.object({ t: z12.literal("in"), d: z12.string() }),
2214
- z12.object({ t: z12.literal("resize"), cols: Cols, rows: Rows }),
2215
- z12.object({ t: z12.literal("close") })
2300
+ z13.object({ t: z13.literal("claim") }),
2301
+ z13.object({ t: z13.literal("in"), d: z13.string() }),
2302
+ z13.object({ t: z13.literal("resize"), cols: Cols, rows: Rows }),
2303
+ z13.object({ t: z13.literal("close") })
2216
2304
  ]);
2217
2305
 
2218
2306
  // packages/protocol/dist/host-wire.js
2219
- var Origin = z13.enum(["human", "automation"]);
2220
- var DiffRev = z13.string().regex(/^(uncommitted|[0-9a-f]{40})$/);
2221
- var HostCommand = z13.discriminatedUnion("type", [
2222
- z13.object({
2223
- type: z13.literal("session.start"),
2224
- sessionId: z13.string(),
2225
- title: z13.string(),
2226
- workspacePath: z13.string(),
2227
- projectId: z13.string().nullable(),
2307
+ var Origin = z14.enum(["human", "automation"]);
2308
+ var DiffRev = z14.string().regex(/^(uncommitted|[0-9a-f]{40})$/);
2309
+ var HostCommand = z14.discriminatedUnion("type", [
2310
+ z14.object({
2311
+ type: z14.literal("session.start"),
2312
+ sessionId: z14.string(),
2313
+ title: z14.string(),
2314
+ workspacePath: z14.string(),
2315
+ projectId: z14.string().nullable(),
2228
2316
  profile: Profile,
2229
2317
  nativeHandle: NativeHandle.nullable(),
2230
- initialPrompt: z13.string().nullable(),
2231
- dispatchKey: z13.string().nullable(),
2232
- controlRevision: z13.number().int(),
2318
+ initialPrompt: z14.string().nullable(),
2319
+ dispatchKey: z14.string().nullable(),
2320
+ controlRevision: z14.number().int(),
2233
2321
  controlMode: ControlMode,
2234
2322
  origin: Origin,
2235
- readOnly: z13.boolean().default(false),
2236
- policyRequired: z13.boolean().optional()
2323
+ readOnly: z14.boolean().default(false),
2324
+ policyRequired: z14.boolean().optional()
2237
2325
  }),
2238
- z13.object({
2239
- type: z13.literal("session.deliverMessage"),
2240
- sessionId: z13.string(),
2241
- messageId: z13.string(),
2242
- payload: z13.object({
2243
- deliveryId: z13.string(),
2244
- kind: z13.enum(["message", "completion"]),
2245
- text: z13.string()
2326
+ z14.object({
2327
+ type: z14.literal("session.deliverMessage"),
2328
+ sessionId: z14.string(),
2329
+ messageId: z14.string(),
2330
+ payload: z14.object({
2331
+ deliveryId: z14.string(),
2332
+ kind: z14.enum(["message", "completion"]),
2333
+ text: z14.string()
2246
2334
  }),
2247
- mode: z13.enum(["steer", "queue"]),
2248
- holdUntil: z13.string()
2335
+ mode: z14.enum(["steer", "queue"]),
2336
+ holdUntil: z14.string()
2249
2337
  }),
2250
- HostPolicySampleRequest.extend({ type: z13.literal("session.classifyPolicySample") }),
2251
- z13.object({
2252
- type: z13.literal("session.messageStatus"),
2253
- sessionId: z13.string(),
2254
- messageIds: z13.array(z13.string().min(1)).min(1).max(100)
2338
+ HostPolicySampleRequest.extend({ type: z14.literal("session.classifyPolicySample") }),
2339
+ z14.object({
2340
+ type: z14.literal("session.messageStatus"),
2341
+ sessionId: z14.string(),
2342
+ messageIds: z14.array(z14.string().min(1)).min(1).max(100)
2255
2343
  }),
2256
- z13.object({
2257
- type: z13.literal("session.prompt"),
2258
- sessionId: z13.string(),
2259
- text: z13.string(),
2260
- images: z13.array(z13.object({ mimeType: z13.string(), data: z13.string() })).default([]),
2261
- mode: z13.enum(["prompt", "steer", "followUp"]),
2344
+ z14.object({
2345
+ type: z14.literal("session.prompt"),
2346
+ sessionId: z14.string(),
2347
+ text: z14.string(),
2348
+ images: z14.array(z14.object({ mimeType: z14.string(), data: z14.string() })).default([]),
2349
+ mode: z14.enum(["prompt", "steer", "followUp"]),
2262
2350
  origin: Origin,
2263
- controlRevision: z13.number().int()
2351
+ controlRevision: z14.number().int()
2264
2352
  }),
2265
- z13.object({ type: z13.literal("session.abort"), sessionId: z13.string(), clearQueue: z13.boolean() }),
2266
- z13.object({ type: z13.literal("session.stop"), sessionId: z13.string() }),
2267
- z13.object({
2268
- type: z13.literal("session.answer"),
2269
- sessionId: z13.string(),
2270
- interactionId: z13.string(),
2271
- revision: z13.number().int(),
2353
+ z14.object({ type: z14.literal("session.abort"), sessionId: z14.string(), clearQueue: z14.boolean() }),
2354
+ /** `queueClear.v1`: empty Pi's queue without aborting; the receipt's result has the messages. */
2355
+ z14.object({ type: z14.literal("session.clearQueue"), sessionId: z14.string() }),
2356
+ z14.object({ type: z14.literal("session.stop"), sessionId: z14.string() }),
2357
+ z14.object({
2358
+ type: z14.literal("session.answer"),
2359
+ sessionId: z14.string(),
2360
+ interactionId: z14.string(),
2361
+ revision: z14.number().int(),
2272
2362
  response: InteractionResponseSchema,
2273
- deviceId: z13.string()
2363
+ deviceId: z14.string()
2274
2364
  }),
2275
- z13.object({
2276
- type: z13.literal("session.adapterAction"),
2277
- sessionId: z13.string(),
2278
- generation: z13.string().uuid().optional(),
2279
- adapterId: z13.string(),
2280
- actionId: z13.string(),
2281
- payload: z13.unknown()
2365
+ z14.object({
2366
+ type: z14.literal("session.adapterAction"),
2367
+ sessionId: z14.string(),
2368
+ generation: z14.string().uuid().optional(),
2369
+ adapterId: z14.string(),
2370
+ actionId: z14.string(),
2371
+ payload: z14.unknown()
2282
2372
  }),
2283
- z13.object({
2284
- type: z13.literal("session.setControl"),
2285
- sessionId: z13.string(),
2286
- controlRevision: z13.number().int(),
2373
+ z14.object({
2374
+ type: z14.literal("session.setControl"),
2375
+ sessionId: z14.string(),
2376
+ controlRevision: z14.number().int(),
2287
2377
  mode: ControlMode
2288
2378
  }),
2289
- z13.object({ type: z13.literal("session.rename"), sessionId: z13.string(), title: z13.string() }),
2290
- z13.object({ type: z13.literal("session.importable") }),
2291
- z13.object({ type: z13.literal("session.readNative"), sessionFile: z13.string() }),
2292
- z13.object({ type: z13.literal("session.snapshot"), sessionId: z13.string() }),
2293
- z13.object({ type: z13.literal("session.models"), sessionId: z13.string() }),
2294
- z13.object({ type: z13.literal("session.commands"), sessionId: z13.string() }),
2295
- z13.object({
2296
- type: z13.literal("session.complete"),
2297
- sessionId: z13.string(),
2298
- text: z13.string().max(500)
2379
+ z14.object({ type: z14.literal("session.rename"), sessionId: z14.string(), title: z14.string() }),
2380
+ z14.object({ type: z14.literal("session.importable") }),
2381
+ z14.object({ type: z14.literal("session.readNative"), sessionFile: z14.string() }),
2382
+ z14.object({ type: z14.literal("session.snapshot"), sessionId: z14.string() }),
2383
+ z14.object({ type: z14.literal("session.models"), sessionId: z14.string() }),
2384
+ z14.object({ type: z14.literal("session.commands"), sessionId: z14.string() }),
2385
+ z14.object({
2386
+ type: z14.literal("session.complete"),
2387
+ sessionId: z14.string(),
2388
+ text: z14.string().max(500)
2299
2389
  }),
2300
- z13.object({ type: z13.literal("session.tree"), sessionId: z13.string() }),
2301
- z13.object({
2302
- type: z13.literal("session.branch"),
2303
- sessionId: z13.string(),
2304
- entryId: z13.string().nullable(),
2305
- fork: z13.boolean()
2390
+ z14.object({ type: z14.literal("session.tree"), sessionId: z14.string() }),
2391
+ z14.object({
2392
+ type: z14.literal("session.branch"),
2393
+ sessionId: z14.string(),
2394
+ entryId: z14.string().nullable(),
2395
+ fork: z14.boolean()
2306
2396
  }),
2307
- z13.object({
2308
- type: z13.literal("session.navigate"),
2309
- sessionId: z13.string(),
2310
- entryId: z13.string(),
2311
- summarize: z13.boolean(),
2312
- instructions: z13.string().max(2e3).nullable()
2397
+ z14.object({
2398
+ type: z14.literal("session.navigate"),
2399
+ sessionId: z14.string(),
2400
+ entryId: z14.string(),
2401
+ summarize: z14.boolean(),
2402
+ instructions: z14.string().max(2e3).nullable()
2313
2403
  }),
2314
- z13.object({ type: z13.literal("session.reload"), sessionId: z13.string() }),
2315
- z13.object({ type: z13.literal("session.adapters"), sessionId: z13.string() }),
2316
- z13.object({ type: z13.literal("session.reloadAdapters"), sessionId: z13.string() }),
2317
- z13.object({ type: z13.literal("session.export"), sessionId: z13.string() }),
2318
- z13.object({
2319
- type: z13.literal("session.setModel"),
2320
- sessionId: z13.string(),
2321
- provider: z13.string().min(1),
2322
- modelId: z13.string().min(1)
2404
+ z14.object({ type: z14.literal("session.reload"), sessionId: z14.string() }),
2405
+ z14.object({ type: z14.literal("session.adapters"), sessionId: z14.string() }),
2406
+ z14.object({ type: z14.literal("session.reloadAdapters"), sessionId: z14.string() }),
2407
+ z14.object({ type: z14.literal("session.export"), sessionId: z14.string() }),
2408
+ z14.object({
2409
+ type: z14.literal("session.setModel"),
2410
+ sessionId: z14.string(),
2411
+ provider: z14.string().min(1),
2412
+ modelId: z14.string().min(1)
2323
2413
  }),
2324
- z13.object({ type: z13.literal("session.setThinking"), sessionId: z13.string(), level: ThinkingLevel }),
2325
- z13.object({
2326
- type: z13.literal("session.compact"),
2327
- sessionId: z13.string(),
2328
- instructions: z13.string().nullable()
2414
+ z14.object({ type: z14.literal("session.setThinking"), sessionId: z14.string(), level: ThinkingLevel }),
2415
+ z14.object({
2416
+ type: z14.literal("session.compact"),
2417
+ sessionId: z14.string(),
2418
+ instructions: z14.string().nullable()
2329
2419
  }),
2330
- z13.object({ type: z13.literal("checkout.inspect"), path: z13.string() }),
2331
- z13.object({ type: z13.literal("projects.scan"), folder: z13.string().min(1) }),
2332
- z13.object({
2333
- type: z13.literal("projects.suggest"),
2334
- days: z13.number().int().min(1).max(365).default(30)
2420
+ z14.object({ type: z14.literal("checkout.inspect"), path: z14.string() }),
2421
+ z14.object({ type: z14.literal("projects.scan"), folder: z14.string().min(1) }),
2422
+ z14.object({
2423
+ type: z14.literal("projects.suggest"),
2424
+ days: z14.number().int().min(1).max(365).default(30)
2335
2425
  }),
2336
- z13.object({
2337
- type: z13.literal("workspace.discover"),
2338
- checkoutPath: z13.string(),
2339
- worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
2426
+ z14.object({
2427
+ type: z14.literal("workspace.discover"),
2428
+ checkoutPath: z14.string(),
2429
+ worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
2340
2430
  }),
2341
- z13.object({
2342
- type: z13.literal("workspace.create"),
2343
- checkoutPath: z13.string(),
2344
- branch: z13.string(),
2345
- base: z13.string(),
2346
- setupCommand: z13.string().nullable(),
2347
- worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
2431
+ z14.object({
2432
+ type: z14.literal("workspace.create"),
2433
+ checkoutPath: z14.string(),
2434
+ branch: z14.string(),
2435
+ base: z14.string(),
2436
+ setupCommand: z14.string().nullable(),
2437
+ worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
2348
2438
  }),
2349
- z13.object({ type: z13.literal("workspace.status"), path: z13.string(), base: z13.string().nullable() }),
2350
- z13.object({
2351
- type: z13.literal("workspace.remove"),
2352
- path: z13.string(),
2353
- checkoutPath: z13.string(),
2354
- base: z13.string().nullable(),
2355
- force: z13.object({ dirty: z13.boolean(), unmerged: z13.boolean() }),
2439
+ z14.object({ type: z14.literal("workspace.status"), path: z14.string(), base: z14.string().nullable() }),
2440
+ z14.object({
2441
+ type: z14.literal("workspace.remove"),
2442
+ path: z14.string(),
2443
+ checkoutPath: z14.string(),
2444
+ base: z14.string().nullable(),
2445
+ force: z14.object({ dirty: z14.boolean(), unmerged: z14.boolean() }),
2356
2446
  /** Also delete the worktree's local branch (hosts before GitHub issue sync ignore it). */
2357
- deleteBranch: z13.boolean().optional()
2447
+ deleteBranch: z14.boolean().optional()
2358
2448
  }),
2359
- z13.object({
2360
- type: z13.literal("workspace.diff"),
2361
- path: z13.string(),
2362
- base: z13.string().nullable(),
2363
- file: z13.string().nullable(),
2449
+ z14.object({
2450
+ type: z14.literal("workspace.diff"),
2451
+ path: z14.string(),
2452
+ base: z14.string().nullable(),
2453
+ file: z14.string().nullable(),
2364
2454
  /** Hosts without gitLog.v1 never receive it. */
2365
2455
  rev: DiffRev.optional()
2366
2456
  }),
2367
- z13.object({
2368
- type: z13.literal("workspace.log"),
2369
- path: z13.string(),
2370
- base: z13.string().nullable(),
2371
- limit: z13.number().int().min(1).max(200)
2457
+ z14.object({
2458
+ type: z14.literal("workspace.log"),
2459
+ path: z14.string(),
2460
+ base: z14.string().nullable(),
2461
+ limit: z14.number().int().min(1).max(200)
2372
2462
  }),
2373
- z13.object({ type: z13.literal("workspace.files"), path: z13.string(), dir: z13.string() }),
2374
- z13.object({ type: z13.literal("workspace.readFile"), path: z13.string(), file: z13.string() }),
2375
- GitHubHostViewRequest.extend({ type: z13.literal("workspace.prView") }),
2376
- GitHubHostLogsRequest.extend({ type: z13.literal("workspace.prFailedLogs") }),
2377
- GitHubHostMergeRequest.extend({ type: z13.literal("workspace.prMerge") }),
2378
- IssueHostSyncRequest.extend({ type: z13.literal("tracker.sync") }),
2379
- IssueHostPrepareBranchRequest.extend({ type: z13.literal("tracker.prepareBranch") }),
2380
- IssueHostStartIssueRequest.extend({ type: z13.literal("tracker.startIssue") }),
2381
- IssueHostSetStatusRequest.extend({ type: z13.literal("tracker.setStatus") }),
2382
- z13.object({
2383
- type: z13.literal("dispatch.start"),
2384
- dispatchKey: z13.string(),
2385
- runId: z13.string(),
2386
- taskId: z13.string(),
2387
- sessionId: z13.string(),
2388
- projectId: z13.string(),
2389
- title: z13.string(),
2390
- workspace: z13.union([
2391
- z13.object({ path: z13.string() }),
2392
- z13.object({
2393
- createFrom: z13.object({
2394
- checkoutPath: z13.string(),
2395
- branch: z13.string(),
2396
- base: z13.string(),
2397
- setupCommand: z13.string().nullable(),
2398
- worktreeDir: z13.string().default(DEFAULT_WORKTREE_DIR)
2463
+ z14.object({ type: z14.literal("workspace.files"), path: z14.string(), dir: z14.string() }),
2464
+ z14.object({ type: z14.literal("workspace.readFile"), path: z14.string(), file: z14.string() }),
2465
+ GitHubHostViewRequest.extend({ type: z14.literal("workspace.prView") }),
2466
+ GitHubHostLogsRequest.extend({ type: z14.literal("workspace.prFailedLogs") }),
2467
+ GitHubHostMergeRequest.extend({ type: z14.literal("workspace.prMerge") }),
2468
+ IssueHostSyncRequest.extend({ type: z14.literal("tracker.sync") }),
2469
+ IssueHostPrepareBranchRequest.extend({ type: z14.literal("tracker.prepareBranch") }),
2470
+ IssueHostStartIssueRequest.extend({ type: z14.literal("tracker.startIssue") }),
2471
+ IssueHostSetStatusRequest.extend({ type: z14.literal("tracker.setStatus") }),
2472
+ z14.object({
2473
+ type: z14.literal("dispatch.start"),
2474
+ dispatchKey: z14.string(),
2475
+ runId: z14.string(),
2476
+ taskId: z14.string(),
2477
+ sessionId: z14.string(),
2478
+ projectId: z14.string(),
2479
+ title: z14.string(),
2480
+ workspace: z14.union([
2481
+ z14.object({ path: z14.string() }),
2482
+ z14.object({
2483
+ createFrom: z14.object({
2484
+ checkoutPath: z14.string(),
2485
+ branch: z14.string(),
2486
+ base: z14.string(),
2487
+ setupCommand: z14.string().nullable(),
2488
+ worktreeDir: z14.string().default(DEFAULT_WORKTREE_DIR)
2399
2489
  })
2400
2490
  })
2401
2491
  ]),
2402
2492
  nativeHandle: NativeHandle.nullable(),
2403
2493
  profile: Profile,
2404
- prompt: z13.string(),
2494
+ prompt: z14.string(),
2405
2495
  /** The launch's own revision; a takeover always carries a newer one. */
2406
- controlRevision: z13.number().int(),
2496
+ controlRevision: z14.number().int(),
2407
2497
  controlMode: ControlMode.default("automation"),
2408
- policyRequired: z13.boolean().optional()
2498
+ policyRequired: z14.boolean().optional()
2409
2499
  }),
2410
- z13.object({ type: z13.literal("dispatch.reconcile"), dispatchKey: z13.string() }),
2411
- z13.object({
2412
- type: z13.literal("checks.run"),
2413
- sessionId: z13.string(),
2414
- path: z13.string(),
2415
- commands: z13.array(z13.string())
2500
+ z14.object({ type: z14.literal("dispatch.reconcile"), dispatchKey: z14.string() }),
2501
+ z14.object({
2502
+ type: z14.literal("checks.run"),
2503
+ sessionId: z14.string(),
2504
+ path: z14.string(),
2505
+ commands: z14.array(z14.string())
2416
2506
  })
2417
2507
  ]);
2418
- var ImportableSession = z13.object({
2419
- sessionFile: z13.string(),
2420
- sessionId: z13.string(),
2421
- cwd: z13.string(),
2422
- name: z13.string().nullable(),
2423
- mtime: z13.string(),
2424
- inactive: z13.boolean()
2425
- });
2426
- var DiscoveredWorktree = z13.object({
2427
- path: z13.string(),
2428
- head: z13.string().nullable(),
2429
- branch: z13.string().nullable(),
2430
- bare: z13.boolean(),
2431
- detached: z13.boolean(),
2432
- locked: z13.boolean(),
2433
- prunable: z13.boolean(),
2434
- provenance: z13.enum(["managed", "discovered", "main"]),
2508
+ var ImportableSession = z14.object({
2509
+ sessionFile: z14.string(),
2510
+ sessionId: z14.string(),
2511
+ cwd: z14.string(),
2512
+ name: z14.string().nullable(),
2513
+ mtime: z14.string(),
2514
+ inactive: z14.boolean()
2515
+ });
2516
+ var DiscoveredWorktree = z14.object({
2517
+ path: z14.string(),
2518
+ head: z14.string().nullable(),
2519
+ branch: z14.string().nullable(),
2520
+ bare: z14.boolean(),
2521
+ detached: z14.boolean(),
2522
+ locked: z14.boolean(),
2523
+ prunable: z14.boolean(),
2524
+ provenance: z14.enum(["managed", "discovered", "main"]),
2435
2525
  git: GitState.nullable()
2436
2526
  });
2437
- var CheckoutInfo = z13.object({
2438
- root: z13.string(),
2439
- commonDir: z13.string(),
2440
- repoIdentity: z13.string(),
2441
- defaultBranch: z13.string()
2527
+ var CheckoutInfo = z14.object({
2528
+ root: z14.string(),
2529
+ commonDir: z14.string(),
2530
+ repoIdentity: z14.string(),
2531
+ defaultBranch: z14.string()
2442
2532
  });
2443
- var ScannedRepository = CheckoutInfo.extend({ name: z13.string() });
2444
- var ProjectFolderScan = z13.object({
2533
+ var ScannedRepository = CheckoutInfo.extend({ name: z14.string() });
2534
+ var ProjectFolderScan = z14.object({
2445
2535
  /** The folder, ~ expanded and realpath'd. */
2446
- folder: z13.string(),
2447
- repositories: z13.array(ScannedRepository)
2448
- });
2449
- var ProjectSuggestion = z13.object({
2450
- rootPath: z13.string(),
2451
- sessionCount: z13.number().int(),
2452
- lastActivityAt: z13.string()
2453
- });
2454
- var ProjectSuggestions = z13.object({ suggestions: z13.array(ProjectSuggestion) });
2455
- var GitCommit = z13.object({
2456
- sha: z13.string().regex(/^[0-9a-f]{40}$/),
2457
- subject: z13.string().max(300),
2458
- author: z13.string().max(200),
2459
- authoredAt: z13.string(),
2460
- pushed: z13.boolean()
2461
- });
2462
- var LogResult = z13.object({
2536
+ folder: z14.string(),
2537
+ repositories: z14.array(ScannedRepository)
2538
+ });
2539
+ var ProjectSuggestion = z14.object({
2540
+ rootPath: z14.string(),
2541
+ sessionCount: z14.number().int(),
2542
+ lastActivityAt: z14.string()
2543
+ });
2544
+ var ProjectSuggestions = z14.object({ suggestions: z14.array(ProjectSuggestion) });
2545
+ var GitCommit = z14.object({
2546
+ sha: z14.string().regex(/^[0-9a-f]{40}$/),
2547
+ subject: z14.string().max(300),
2548
+ author: z14.string().max(200),
2549
+ authoredAt: z14.string(),
2550
+ pushed: z14.boolean()
2551
+ });
2552
+ var LogResult = z14.object({
2463
2553
  /** The base branch the commits are counted from. */
2464
- base: z13.string(),
2554
+ base: z14.string(),
2465
2555
  /** `branch`: commits since the merge base; `recent`: HEAD's latest commits (no commits of its own). */
2466
- scope: z13.enum(["branch", "recent"]),
2467
- commits: z13.array(GitCommit).max(200),
2468
- truncated: z13.boolean(),
2556
+ scope: z14.enum(["branch", "recent"]),
2557
+ commits: z14.array(GitCommit).max(200),
2558
+ truncated: z14.boolean(),
2469
2559
  /** Changed and untracked files not committed yet. */
2470
- uncommitted: z13.number().int().min(0)
2471
- });
2472
- var DiffFile = z13.object({
2473
- path: z13.string(),
2474
- oldPath: z13.string().nullable(),
2475
- added: z13.number().int(),
2476
- deleted: z13.number().int(),
2477
- status: z13.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
2478
- });
2479
- var DiffResult = z13.object({
2480
- base: z13.string(),
2481
- files: z13.array(DiffFile),
2482
- patch: z13.string().nullable()
2483
- });
2484
- var FileEntry = z13.object({
2485
- name: z13.string(),
2486
- path: z13.string(),
2487
- kind: z13.enum(["file", "dir", "symlink"]),
2488
- size: z13.number().int().nullable()
2489
- });
2490
- var ReconcileResult = z13.union([
2491
- z13.object({ known: z13.literal(false) }),
2492
- z13.object({
2493
- known: z13.literal(true),
2494
- sessionId: z13.string().nullable(),
2495
- state: z13.enum(["accepted", "workspace_ready", "started", "failed"]),
2560
+ uncommitted: z14.number().int().min(0)
2561
+ });
2562
+ var DiffFile = z14.object({
2563
+ path: z14.string(),
2564
+ oldPath: z14.string().nullable(),
2565
+ added: z14.number().int(),
2566
+ deleted: z14.number().int(),
2567
+ status: z14.enum(["added", "modified", "deleted", "renamed", "untracked", "binary"])
2568
+ });
2569
+ var DiffResult = z14.object({
2570
+ base: z14.string(),
2571
+ files: z14.array(DiffFile),
2572
+ patch: z14.string().nullable()
2573
+ });
2574
+ var FileEntry = z14.object({
2575
+ name: z14.string(),
2576
+ path: z14.string(),
2577
+ kind: z14.enum(["file", "dir", "symlink"]),
2578
+ size: z14.number().int().nullable()
2579
+ });
2580
+ var ReconcileResult = z14.union([
2581
+ z14.object({ known: z14.literal(false) }),
2582
+ z14.object({
2583
+ known: z14.literal(true),
2584
+ sessionId: z14.string().nullable(),
2585
+ state: z14.enum(["accepted", "workspace_ready", "started", "failed"]),
2496
2586
  runtime: RuntimeState.nullable(),
2497
- workspacePath: z13.string().nullable(),
2587
+ workspacePath: z14.string().nullable(),
2498
2588
  nativeHandle: NativeHandle.nullable(),
2499
- error: z13.string().nullable(),
2589
+ error: z14.string().nullable(),
2500
2590
  /** `{started: "unknown"}` when the host restarted after Pi may have been spawned. */
2501
- errorDetails: z13.record(z13.string(), z13.unknown()).nullable().default(null)
2591
+ errorDetails: z14.record(z14.string(), z14.unknown()).nullable().default(null)
2502
2592
  })
2503
2593
  ]);
2504
- var DispatchStartResult = z13.object({
2505
- sessionId: z13.string(),
2506
- workspacePath: z13.string(),
2594
+ var DispatchStartResult = z14.object({
2595
+ sessionId: z14.string(),
2596
+ workspacePath: z14.string(),
2507
2597
  nativeHandle: NativeHandle.nullable(),
2508
- reused: z13.boolean(),
2598
+ reused: z14.boolean(),
2509
2599
  /** Why the launch prompt was not delivered to Pi (the session itself started), if it was not. */
2510
- promptError: z13.string().nullable().optional()
2600
+ promptError: z14.string().nullable().optional()
2511
2601
  });
2512
- var AnswerResult = z13.object({
2513
- status: z13.enum(["answered", "already_answered"]),
2602
+ var AnswerResult = z14.object({
2603
+ status: z14.enum(["answered", "already_answered"]),
2514
2604
  interaction: Interaction
2515
2605
  });
2516
- var SnapshotResult = z13.object({
2517
- partial: z13.array(TranscriptItem),
2518
- pendingInteractions: z13.array(Interaction)
2606
+ var SnapshotResult = z14.object({
2607
+ partial: z14.array(TranscriptItem),
2608
+ pendingInteractions: z14.array(Interaction)
2519
2609
  });
2520
- var ChecksResult = z13.object({ results: z13.array(CheckResult) });
2521
- var Receipt = z13.union([
2522
- z13.object({ commandId: z13.string(), ok: z13.literal(true), result: z13.unknown() }),
2523
- z13.object({ commandId: z13.string(), ok: z13.literal(false), error: ErrorBody })
2610
+ var ChecksResult = z14.object({ results: z14.array(CheckResult) });
2611
+ var Receipt = z14.union([
2612
+ z14.object({ commandId: z14.string(), ok: z14.literal(true), result: z14.unknown() }),
2613
+ z14.object({ commandId: z14.string(), ok: z14.literal(false), error: ErrorBody })
2524
2614
  ]);
2525
2615
  var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
2526
2616
  policyContext: HostToolPolicyContext.optional()
@@ -2539,299 +2629,299 @@ var HostAgentRequestFrame = AgentRequestFrame.safeExtend({
2539
2629
  }
2540
2630
  ctx.addIssue({ code: "custom", message: "Host agent frame exceeds 128 KiB or is not JSON." });
2541
2631
  });
2542
- var HostToCoordinator = z13.discriminatedUnion("type", [
2543
- z13.object({
2544
- type: z13.literal("hello"),
2545
- hostId: z13.string(),
2546
- credential: z13.string(),
2547
- name: z13.string(),
2548
- agentVersion: z13.string(),
2549
- piVersion: z13.string().nullable(),
2550
- piCompatible: z13.boolean(),
2632
+ var HostToCoordinator = z14.discriminatedUnion("type", [
2633
+ z14.object({
2634
+ type: z14.literal("hello"),
2635
+ hostId: z14.string(),
2636
+ credential: z14.string(),
2637
+ name: z14.string(),
2638
+ agentVersion: z14.string(),
2639
+ piVersion: z14.string().nullable(),
2640
+ piCompatible: z14.boolean(),
2551
2641
  platform: Platform,
2552
2642
  capabilities: RuntimeCapabilities.nullable(),
2553
2643
  github: HostGitHub.optional(),
2554
- protocolVersion: z13.number().int(),
2555
- features: z13.array(z13.string()).optional()
2644
+ protocolVersion: z14.number().int(),
2645
+ features: z14.array(z14.string()).optional()
2556
2646
  }),
2557
2647
  HostAgentRequestFrame,
2558
- z13.object({ type: z13.literal("event"), hostSeq: z13.number().int(), event: HostEvent }),
2559
- z13.object({ type: z13.literal("stream"), delta: StreamDelta }),
2560
- z13.object({ type: z13.literal("receipt"), receipt: Receipt }),
2561
- z13.object({ type: z13.literal("pong") }),
2562
- z13.object({ type: z13.literal("usage"), usage: z13.array(ProviderUsage) }),
2563
- z13.object({ type: z13.literal("term"), streamId: z13.string(), msg: TermServerToViewer })
2648
+ z14.object({ type: z14.literal("event"), hostSeq: z14.number().int(), event: HostEvent }),
2649
+ z14.object({ type: z14.literal("stream"), delta: StreamDelta }),
2650
+ z14.object({ type: z14.literal("receipt"), receipt: Receipt }),
2651
+ z14.object({ type: z14.literal("pong") }),
2652
+ z14.object({ type: z14.literal("usage"), usage: z14.array(ProviderUsage) }),
2653
+ z14.object({ type: z14.literal("term"), streamId: z14.string(), msg: TermServerToViewer })
2564
2654
  ]);
2565
- var CoordinatorToHost = z13.discriminatedUnion("type", [
2566
- z13.object({
2567
- type: z13.literal("welcome"),
2568
- coordinatorVersion: z13.string(),
2569
- ackedHostSeq: z13.number().int(),
2570
- features: z13.array(z13.string()).optional()
2655
+ var CoordinatorToHost = z14.discriminatedUnion("type", [
2656
+ z14.object({
2657
+ type: z14.literal("welcome"),
2658
+ coordinatorVersion: z14.string(),
2659
+ ackedHostSeq: z14.number().int(),
2660
+ features: z14.array(z14.string()).optional()
2571
2661
  }),
2572
2662
  AgentResultFrame,
2573
- z13.object({ type: z13.literal("ack"), hostSeq: z13.number().int() }),
2574
- z13.object({ type: z13.literal("command"), commandId: z13.string(), command: HostCommand }),
2575
- z13.object({ type: z13.literal("ping") }),
2576
- z13.object({ type: z13.literal("reject"), error: ErrorBody }),
2577
- z13.object({ type: z13.literal("term"), streamId: z13.string(), msg: TermCoordinatorMsg })
2663
+ z14.object({ type: z14.literal("ack"), hostSeq: z14.number().int() }),
2664
+ z14.object({ type: z14.literal("command"), commandId: z14.string(), command: HostCommand }),
2665
+ z14.object({ type: z14.literal("ping") }),
2666
+ z14.object({ type: z14.literal("reject"), error: ErrorBody }),
2667
+ z14.object({ type: z14.literal("term"), streamId: z14.string(), msg: TermCoordinatorMsg })
2578
2668
  ]);
2579
2669
 
2580
2670
  // packages/protocol/dist/api.js
2581
- var EnrollRequest = z14.object({
2582
- token: z14.string().min(1),
2583
- name: z14.string().min(1).max(80),
2671
+ var EnrollRequest = z15.object({
2672
+ token: z15.string().min(1),
2673
+ name: z15.string().min(1).max(80),
2584
2674
  kind: DeviceKind
2585
2675
  });
2586
- var EnrollResponse = z14.object({ deviceId: z14.string(), credential: z14.string() });
2587
- var CreateEnrollmentRequest = z14.object({ kind: z14.enum(["device", "host"]) });
2588
- var CreateEnrollmentResponse = z14.object({
2589
- token: z14.string(),
2590
- url: z14.string(),
2591
- expiresAt: z14.string(),
2592
- qrSvg: z14.string(),
2593
- command: z14.string().nullable()
2676
+ var EnrollResponse = z15.object({ deviceId: z15.string(), credential: z15.string() });
2677
+ var CreateEnrollmentRequest = z15.object({ kind: z15.enum(["device", "host"]) });
2678
+ var CreateEnrollmentResponse = z15.object({
2679
+ token: z15.string(),
2680
+ url: z15.string(),
2681
+ expiresAt: z15.string(),
2682
+ qrSvg: z15.string(),
2683
+ command: z15.string().nullable()
2594
2684
  });
2595
- var HostEnrollRequest = z14.union([
2596
- z14.object({
2597
- token: z14.string().min(1),
2598
- name: z14.string().min(1).max(80),
2685
+ var HostEnrollRequest = z15.union([
2686
+ z15.object({
2687
+ token: z15.string().min(1),
2688
+ name: z15.string().min(1).max(80),
2599
2689
  platform: Platform
2600
2690
  }),
2601
- z14.object({
2602
- secret: z14.string().min(1),
2603
- name: z14.string().min(1).max(80),
2691
+ z15.object({
2692
+ secret: z15.string().min(1),
2693
+ name: z15.string().min(1).max(80),
2604
2694
  platform: Platform
2605
2695
  })
2606
2696
  ]);
2607
- var HostEnrollResponse = z14.object({ hostId: z14.string(), credential: z14.string() });
2608
- var CreateProjectRequest = z14.object({
2609
- name: z14.string().min(1),
2610
- hostId: z14.string(),
2611
- path: z14.string().min(1),
2612
- defaultProfileId: z14.string().nullable().optional(),
2613
- setupCommand: z14.string().nullable().optional(),
2614
- checks: z14.array(z14.string()).optional(),
2615
- maxConcurrentRuns: z14.number().int().min(1).max(32).optional(),
2697
+ var HostEnrollResponse = z15.object({ hostId: z15.string(), credential: z15.string() });
2698
+ var CreateProjectRequest = z15.object({
2699
+ name: z15.string().min(1),
2700
+ hostId: z15.string(),
2701
+ path: z15.string().min(1),
2702
+ defaultProfileId: z15.string().nullable().optional(),
2703
+ setupCommand: z15.string().nullable().optional(),
2704
+ checks: z15.array(z15.string()).optional(),
2705
+ maxConcurrentRuns: z15.number().int().min(1).max(32).optional(),
2616
2706
  worktreeDir: WorktreeDir.optional()
2617
2707
  });
2618
- var UpdateProjectRequest = z14.object({
2619
- name: z14.string().min(1).optional(),
2620
- defaultProfileId: z14.string().nullable().optional(),
2621
- defaultHostId: z14.string().nullable().optional(),
2622
- maxConcurrentRuns: z14.number().int().min(1).max(32).optional(),
2623
- automationEnabled: z14.boolean().optional(),
2624
- setupCommand: z14.string().nullable().optional(),
2625
- checks: z14.array(z14.string()).optional(),
2626
- workspaceSharing: z14.enum(["single_writer", "shared"]).optional(),
2708
+ var UpdateProjectRequest = z15.object({
2709
+ name: z15.string().min(1).optional(),
2710
+ defaultProfileId: z15.string().nullable().optional(),
2711
+ defaultHostId: z15.string().nullable().optional(),
2712
+ maxConcurrentRuns: z15.number().int().min(1).max(32).optional(),
2713
+ automationEnabled: z15.boolean().optional(),
2714
+ setupCommand: z15.string().nullable().optional(),
2715
+ checks: z15.array(z15.string()).optional(),
2716
+ workspaceSharing: z15.enum(["single_writer", "shared"]).optional(),
2627
2717
  worktreeDir: WorktreeDir.optional(),
2628
- ensureSessions: z14.boolean().optional(),
2629
- removeLanded: z14.boolean().optional()
2718
+ ensureSessions: z15.boolean().optional(),
2719
+ removeLanded: z15.boolean().optional()
2630
2720
  });
2631
- var AddCheckoutRequest = z14.object({ hostId: z14.string(), path: z14.string().min(1) });
2721
+ var AddCheckoutRequest = z15.object({ hostId: z15.string(), path: z15.string().min(1) });
2632
2722
  function isProjectFolderPath(s) {
2633
2723
  if (s.includes("\0"))
2634
2724
  return false;
2635
2725
  return s === "~" || s.startsWith("~/") || s.startsWith("/");
2636
2726
  }
2637
- var ProjectFolder = z14.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
2638
- var UpdateHostRequest = z14.object({
2639
- projectFolders: z14.array(ProjectFolder).max(20).optional()
2727
+ var ProjectFolder = z15.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
2728
+ var UpdateHostRequest = z15.object({
2729
+ projectFolders: z15.array(ProjectFolder).max(20).optional()
2640
2730
  });
2641
2731
  var ProjectScanResult = ProjectScan.extend({
2642
- added: z14.array(z14.object({
2643
- projectId: z14.string(),
2644
- name: z14.string(),
2645
- path: z14.string(),
2646
- newProject: z14.boolean()
2732
+ added: z15.array(z15.object({
2733
+ projectId: z15.string(),
2734
+ name: z15.string(),
2735
+ path: z15.string(),
2736
+ newProject: z15.boolean()
2647
2737
  }))
2648
2738
  });
2649
- var ProfileInput = z14.object({
2650
- name: z14.string().min(1),
2651
- provider: z14.string().nullable().default(null),
2652
- model: z14.string().nullable().default(null),
2739
+ var ProfileInput = z15.object({
2740
+ name: z15.string().min(1),
2741
+ provider: z15.string().nullable().default(null),
2742
+ model: z15.string().nullable().default(null),
2653
2743
  thinking: ThinkingLevel.nullable().default(null),
2654
- projectTrust: z14.enum(["ask", "approve", "ignore"]).default("ask"),
2655
- extraArgs: z14.array(ExtraArg).default([]),
2656
- resources: z14.enum(["all", "vanilla"]).default("all")
2657
- });
2658
- var CreateWorkspaceRequest = z14.object({
2659
- checkoutId: z14.string(),
2660
- branch: z14.string().min(1),
2661
- base: z14.string().nullable().optional()
2662
- });
2663
- var RemoveWorkspaceRequest = z14.object({
2664
- force: z14.object({ dirty: z14.boolean(), unmerged: z14.boolean() }).default({ dirty: false, unmerged: false })
2665
- });
2666
- var CreateSessionRequest = z14.object({
2667
- projectId: z14.string(),
2668
- workspace: z14.union([
2669
- z14.object({ existingId: z14.string() }),
2670
- z14.object({
2671
- checkoutId: z14.string(),
2672
- newBranch: z14.string().min(1),
2673
- base: z14.string().nullable().optional()
2744
+ projectTrust: z15.enum(["ask", "approve", "ignore"]).default("ask"),
2745
+ extraArgs: z15.array(ExtraArg).default([]),
2746
+ resources: z15.enum(["all", "vanilla"]).default("all")
2747
+ });
2748
+ var CreateWorkspaceRequest = z15.object({
2749
+ checkoutId: z15.string(),
2750
+ branch: z15.string().min(1),
2751
+ base: z15.string().nullable().optional()
2752
+ });
2753
+ var RemoveWorkspaceRequest = z15.object({
2754
+ force: z15.object({ dirty: z15.boolean(), unmerged: z15.boolean() }).default({ dirty: false, unmerged: false })
2755
+ });
2756
+ var CreateSessionRequest = z15.object({
2757
+ projectId: z15.string(),
2758
+ workspace: z15.union([
2759
+ z15.object({ existingId: z15.string() }),
2760
+ z15.object({
2761
+ checkoutId: z15.string(),
2762
+ newBranch: z15.string().min(1),
2763
+ base: z15.string().nullable().optional()
2674
2764
  })
2675
2765
  ]),
2676
- profileId: z14.string().nullable().optional(),
2677
- prompt: z14.string().default(""),
2678
- title: z14.string().optional(),
2679
- scopeId: z14.string().optional(),
2766
+ profileId: z15.string().nullable().optional(),
2767
+ prompt: z15.string().default(""),
2768
+ title: z15.string().optional(),
2769
+ scopeId: z15.string().optional(),
2680
2770
  /** COMPAT(scopes-rename): remove after 2027-03-01. The old name of scopeId. */
2681
- viewId: z14.string().optional()
2682
- });
2683
- var OpenBranchRequest = z14.object({
2684
- projectId: z14.string(),
2685
- branch: z14.string().min(1),
2686
- hostId: z14.string().optional(),
2687
- base: z14.string().nullable().optional(),
2688
- prompt: z14.string().default(""),
2689
- profileId: z14.string().nullable().optional(),
2690
- title: z14.string().optional(),
2691
- scopeId: z14.string().optional(),
2771
+ viewId: z15.string().optional()
2772
+ });
2773
+ var OpenBranchRequest = z15.object({
2774
+ projectId: z15.string(),
2775
+ branch: z15.string().min(1),
2776
+ hostId: z15.string().optional(),
2777
+ base: z15.string().nullable().optional(),
2778
+ prompt: z15.string().default(""),
2779
+ profileId: z15.string().nullable().optional(),
2780
+ title: z15.string().optional(),
2781
+ scopeId: z15.string().optional(),
2692
2782
  /** COMPAT(scopes-rename): remove after 2027-03-01. The old name of scopeId. */
2693
- viewId: z14.string().optional(),
2783
+ viewId: z15.string().optional(),
2694
2784
  /** Start another session even when the branch has one. */
2695
- another: z14.boolean().default(false)
2696
- });
2697
- var OpenBranchResult = z14.object({ session: Session, created: z14.boolean() });
2698
- var SetPrimaryRequest = z14.object({ primary: z14.boolean() });
2699
- var PromptRequest = z14.object({
2700
- text: z14.string().min(1),
2701
- mode: z14.enum(["prompt", "steer", "followUp"]).default("prompt"),
2702
- images: z14.array(z14.object({ mimeType: z14.string(), data: z14.string() })).default([]),
2703
- clientMessageId: z14.string().optional()
2704
- });
2705
- var CacheAlertRequest = z14.object({
2706
- enabled: z14.boolean(),
2707
- ttlSec: z14.number().int().min(60).max(86400).nullable().default(null)
2708
- });
2709
- var RenameRequest = z14.object({ title: z14.string().min(1).max(200) });
2710
- var SetModelRequest = z14.object({
2711
- provider: z14.string().min(1),
2712
- modelId: z14.string().min(1)
2713
- });
2714
- var SetThinkingRequest = z14.object({ level: ThinkingLevel });
2715
- var CompactRequest = z14.object({ instructions: z14.string().max(4e3).optional() });
2716
- var SessionModelsResult = z14.object({ models: z14.array(SessionModel) });
2717
- var SessionCommandsResult = z14.object({ commands: z14.array(SlashCommand) });
2718
- var CompleteRequest = z14.object({ text: z14.string().min(1).max(500) });
2719
- var CompletionItem = z14.object({
2720
- value: z14.string(),
2721
- label: z14.string(),
2722
- description: z14.string().nullable()
2723
- });
2724
- var SessionCompleteResult = z14.object({
2725
- items: z14.array(CompletionItem).max(50),
2726
- prefix: z14.string()
2727
- });
2728
- var TreeRow = z14.object({
2729
- entryId: z14.string(),
2730
- parentId: z14.string().nullable(),
2731
- depth: z14.number().int(),
2732
- role: z14.enum(["user", "assistant"]),
2733
- text: z14.string(),
2734
- activeBranch: z14.boolean(),
2735
- leaf: z14.boolean(),
2736
- label: z14.string().nullable(),
2737
- at: z14.string().nullable()
2738
- });
2739
- var SessionTreeResult = z14.object({ rows: z14.array(TreeRow) });
2740
- var BranchRequest = z14.object({
2741
- entryId: z14.string().nullable(),
2742
- fork: z14.boolean().default(false)
2743
- });
2744
- var HostBranchResult = z14.object({
2745
- sessionFile: z14.string().nullable(),
2746
- prefill: z14.string().nullable()
2747
- });
2748
- var TranscriptPage = z14.object({
2749
- items: z14.array(TranscriptItem),
2750
- hasMore: z14.boolean(),
2751
- epoch: z14.number().int().optional(),
2752
- rev: z14.number().int().optional(),
2753
- delta: z14.boolean().optional(),
2754
- reset: z14.boolean().optional()
2755
- });
2756
- var NavigateRequest = z14.object({
2757
- entryId: z14.string().min(1),
2758
- summarize: z14.boolean().default(false),
2759
- instructions: z14.string().max(2e3).nullable().default(null)
2760
- });
2761
- var HostNavigateResult = z14.object({
2762
- items: z14.array(TranscriptItem),
2763
- prefill: z14.string().nullable()
2764
- });
2765
- var NavigateResult = z14.object({
2766
- prefill: z14.string().nullable(),
2767
- epoch: z14.number().int()
2768
- });
2769
- var BranchResult = z14.object({
2785
+ another: z15.boolean().default(false)
2786
+ });
2787
+ var OpenBranchResult = z15.object({ session: Session, created: z15.boolean() });
2788
+ var SetPrimaryRequest = z15.object({ primary: z15.boolean() });
2789
+ var PromptRequest = z15.object({
2790
+ text: z15.string().min(1),
2791
+ mode: z15.enum(["prompt", "steer", "followUp"]).default("prompt"),
2792
+ images: z15.array(z15.object({ mimeType: z15.string(), data: z15.string() })).default([]),
2793
+ clientMessageId: z15.string().optional()
2794
+ });
2795
+ var CacheAlertRequest = z15.object({
2796
+ enabled: z15.boolean(),
2797
+ ttlSec: z15.number().int().min(60).max(86400).nullable().default(null)
2798
+ });
2799
+ var RenameRequest = z15.object({ title: z15.string().min(1).max(200) });
2800
+ var SetModelRequest = z15.object({
2801
+ provider: z15.string().min(1),
2802
+ modelId: z15.string().min(1)
2803
+ });
2804
+ var SetThinkingRequest = z15.object({ level: ThinkingLevel });
2805
+ var CompactRequest = z15.object({ instructions: z15.string().max(4e3).optional() });
2806
+ var SessionModelsResult = z15.object({ models: z15.array(SessionModel) });
2807
+ var SessionCommandsResult = z15.object({ commands: z15.array(SlashCommand) });
2808
+ var CompleteRequest = z15.object({ text: z15.string().min(1).max(500) });
2809
+ var CompletionItem = z15.object({
2810
+ value: z15.string(),
2811
+ label: z15.string(),
2812
+ description: z15.string().nullable()
2813
+ });
2814
+ var SessionCompleteResult = z15.object({
2815
+ items: z15.array(CompletionItem).max(50),
2816
+ prefix: z15.string()
2817
+ });
2818
+ var TreeRow = z15.object({
2819
+ entryId: z15.string(),
2820
+ parentId: z15.string().nullable(),
2821
+ depth: z15.number().int(),
2822
+ role: z15.enum(["user", "assistant"]),
2823
+ text: z15.string(),
2824
+ activeBranch: z15.boolean(),
2825
+ leaf: z15.boolean(),
2826
+ label: z15.string().nullable(),
2827
+ at: z15.string().nullable()
2828
+ });
2829
+ var SessionTreeResult = z15.object({ rows: z15.array(TreeRow) });
2830
+ var BranchRequest = z15.object({
2831
+ entryId: z15.string().nullable(),
2832
+ fork: z15.boolean().default(false)
2833
+ });
2834
+ var HostBranchResult = z15.object({
2835
+ sessionFile: z15.string().nullable(),
2836
+ prefill: z15.string().nullable()
2837
+ });
2838
+ var TranscriptPage = z15.object({
2839
+ items: z15.array(TranscriptItem),
2840
+ hasMore: z15.boolean(),
2841
+ epoch: z15.number().int().optional(),
2842
+ rev: z15.number().int().optional(),
2843
+ delta: z15.boolean().optional(),
2844
+ reset: z15.boolean().optional()
2845
+ });
2846
+ var NavigateRequest = z15.object({
2847
+ entryId: z15.string().min(1),
2848
+ summarize: z15.boolean().default(false),
2849
+ instructions: z15.string().max(2e3).nullable().default(null)
2850
+ });
2851
+ var HostNavigateResult = z15.object({
2852
+ items: z15.array(TranscriptItem),
2853
+ prefill: z15.string().nullable()
2854
+ });
2855
+ var NavigateResult = z15.object({
2856
+ prefill: z15.string().nullable(),
2857
+ epoch: z15.number().int()
2858
+ });
2859
+ var BranchResult = z15.object({
2770
2860
  session: Session.nullable(),
2771
- prefill: z14.string().nullable()
2861
+ prefill: z15.string().nullable()
2772
2862
  });
2773
- var SessionExportResult = z14.object({ fileName: z14.string(), content: z14.string() });
2774
- var CommandViewAction = z14.object({
2775
- label: z14.string().min(1).max(80),
2776
- command: z14.string().startsWith("/").max(500),
2777
- tone: z14.enum(["default", "primary", "danger"]).optional()
2863
+ var SessionExportResult = z15.object({ fileName: z15.string(), content: z15.string() });
2864
+ var CommandViewAction = z15.object({
2865
+ label: z15.string().min(1).max(80),
2866
+ command: z15.string().startsWith("/").max(500),
2867
+ tone: z15.enum(["default", "primary", "danger"]).optional()
2778
2868
  });
2779
- var CommandView = z14.object({
2780
- title: z14.string().min(1).max(200),
2869
+ var CommandView = z15.object({
2870
+ title: z15.string().min(1).max(200),
2781
2871
  body: UINodeSchema,
2782
- actions: z14.array(CommandViewAction).max(30).default([])
2872
+ actions: z15.array(CommandViewAction).max(30).default([])
2783
2873
  });
2784
- var ModelStateResult = z14.object({
2874
+ var ModelStateResult = z15.object({
2785
2875
  model: SessionModel.nullable(),
2786
2876
  thinking: ThinkingLevel.nullable()
2787
2877
  });
2788
- var ImportSessionRequest = z14.object({
2789
- hostId: z14.string(),
2790
- sessionFile: z14.string(),
2791
- projectId: z14.string().nullable().optional()
2878
+ var ImportSessionRequest = z15.object({
2879
+ hostId: z15.string(),
2880
+ sessionFile: z15.string(),
2881
+ projectId: z15.string().nullable().optional()
2792
2882
  });
2793
- var AnswerRequest = z14.object({
2794
- revision: z14.number().int(),
2883
+ var AnswerRequest = z15.object({
2884
+ revision: z15.number().int(),
2795
2885
  response: InteractionResponseSchema
2796
2886
  });
2797
- var AdapterActionRequest = z14.object({
2798
- generation: z14.string().uuid().optional(),
2799
- adapterId: z14.string(),
2800
- actionId: z14.string(),
2801
- payload: z14.unknown().optional()
2802
- });
2803
- var TaskPolicyPatch = z14.object({
2804
- hostId: z14.string().nullable().optional(),
2805
- profileId: z14.string().nullable().optional(),
2806
- workspace: z14.object({
2807
- mode: z14.enum(["new_worktree", "existing"]).optional(),
2808
- branch: z14.string().nullable().optional(),
2809
- base: z14.string().nullable().optional(),
2810
- workspaceId: z14.string().optional()
2887
+ var AdapterActionRequest = z15.object({
2888
+ generation: z15.string().uuid().optional(),
2889
+ adapterId: z15.string(),
2890
+ actionId: z15.string(),
2891
+ payload: z15.unknown().optional()
2892
+ });
2893
+ var TaskPolicyPatch = z15.object({
2894
+ hostId: z15.string().nullable().optional(),
2895
+ profileId: z15.string().nullable().optional(),
2896
+ workspace: z15.object({
2897
+ mode: z15.enum(["new_worktree", "existing"]).optional(),
2898
+ branch: z15.string().nullable().optional(),
2899
+ base: z15.string().nullable().optional(),
2900
+ workspaceId: z15.string().optional()
2811
2901
  }).optional(),
2812
- continuation: z14.object({
2813
- enabled: z14.boolean().optional(),
2814
- objective: z14.string().min(1).optional(),
2815
- maxContinuations: z14.number().int().min(1).max(50).optional(),
2816
- maxElapsedMinutes: z14.number().int().min(1).max(1440).optional(),
2817
- maxTokens: z14.number().int().positive().nullable().optional(),
2818
- maxCostUsd: z14.number().positive().nullable().optional()
2902
+ continuation: z15.object({
2903
+ enabled: z15.boolean().optional(),
2904
+ objective: z15.string().min(1).optional(),
2905
+ maxContinuations: z15.number().int().min(1).max(50).optional(),
2906
+ maxElapsedMinutes: z15.number().int().min(1).max(1440).optional(),
2907
+ maxTokens: z15.number().int().positive().nullable().optional(),
2908
+ maxCostUsd: z15.number().positive().nullable().optional()
2819
2909
  }).optional(),
2820
2910
  completion: CompletionPolicy.partial().optional()
2821
2911
  });
2822
- var CreateTaskRequest = z14.object({
2823
- projectId: z14.string(),
2824
- title: z14.string().max(300).optional(),
2912
+ var CreateTaskRequest = z15.object({
2913
+ projectId: z15.string(),
2914
+ title: z15.string().max(300).optional(),
2825
2915
  githubIssueUrl: GitHubIssueUrl.optional(),
2826
- githubIssue: z14.never().optional(),
2827
- launchPrompt: z14.never().optional(),
2828
- objective: z14.string().default(""),
2829
- acceptanceCriteria: z14.array(z14.string()).default([]),
2830
- dependencies: z14.array(z14.string()).default([]),
2831
- parentTaskId: z14.string().nullable().optional(),
2916
+ githubIssue: z15.never().optional(),
2917
+ launchPrompt: z15.never().optional(),
2918
+ objective: z15.string().default(""),
2919
+ acceptanceCriteria: z15.array(z15.string()).default([]),
2920
+ dependencies: z15.array(z15.string()).default([]),
2921
+ parentTaskId: z15.string().nullable().optional(),
2832
2922
  priority: Priority.default(2),
2833
- state: z14.enum(["backlog", "ready"]).default("backlog"),
2834
- notBefore: z14.string().nullable().optional(),
2923
+ state: z15.enum(["backlog", "ready"]).default("backlog"),
2924
+ notBefore: z15.string().nullable().optional(),
2835
2925
  policy: TaskPolicyPatch.optional()
2836
2926
  }).superRefine((v, ctx) => {
2837
2927
  if (v.githubIssueUrl === void 0) {
@@ -2869,32 +2959,32 @@ var CreateTaskRequest = z14.object({
2869
2959
  const issue = githubIssueFromUrl(v.githubIssueUrl);
2870
2960
  return { ...v, title: v.title?.trim() || `${issue.repository} #${issue.number}` };
2871
2961
  });
2872
- var UpdateTaskRequest = z14.object({
2873
- githubIssueUrl: z14.never().optional(),
2874
- githubIssue: z14.never().optional(),
2875
- launchPrompt: z14.never().optional(),
2876
- title: z14.string().min(1).max(300).optional(),
2877
- objective: z14.string().optional(),
2878
- acceptanceCriteria: z14.array(z14.string()).optional(),
2879
- dependencies: z14.array(z14.string()).optional(),
2880
- parentTaskId: z14.string().nullable().optional(),
2962
+ var UpdateTaskRequest = z15.object({
2963
+ githubIssueUrl: z15.never().optional(),
2964
+ githubIssue: z15.never().optional(),
2965
+ launchPrompt: z15.never().optional(),
2966
+ title: z15.string().min(1).max(300).optional(),
2967
+ objective: z15.string().optional(),
2968
+ acceptanceCriteria: z15.array(z15.string()).optional(),
2969
+ dependencies: z15.array(z15.string()).optional(),
2970
+ parentTaskId: z15.string().nullable().optional(),
2881
2971
  priority: Priority.optional(),
2882
- position: z14.number().optional(),
2883
- notBefore: z14.string().nullable().optional(),
2972
+ position: z15.number().optional(),
2973
+ notBefore: z15.string().nullable().optional(),
2884
2974
  policy: TaskPolicyPatch.optional()
2885
2975
  });
2886
- var MoveTaskRequest = z14.object({
2976
+ var MoveTaskRequest = z15.object({
2887
2977
  to: TaskState,
2888
- confirm: z14.boolean().optional(),
2889
- onRunning: z14.enum(["pause", "stop"]).optional(),
2890
- position: z14.number().optional()
2978
+ confirm: z15.boolean().optional(),
2979
+ onRunning: z15.enum(["pause", "stop"]).optional(),
2980
+ position: z15.number().optional()
2891
2981
  });
2892
- var RequestChangesRequest = z14.object({ feedback: z14.array(z14.string().min(1)).min(1) });
2893
- var Eligibility = z14.union([
2894
- z14.object({ eligible: z14.literal(true), hostId: z14.string(), hostName: z14.string() }),
2895
- z14.object({
2896
- eligible: z14.literal(false),
2897
- wait: z14.enum([
2982
+ var RequestChangesRequest = z15.object({ feedback: z15.array(z15.string().min(1)).min(1) });
2983
+ var Eligibility = z15.union([
2984
+ z15.object({ eligible: z15.literal(true), hostId: z15.string(), hostName: z15.string() }),
2985
+ z15.object({
2986
+ eligible: z15.literal(false),
2987
+ wait: z15.enum([
2898
2988
  "dependency",
2899
2989
  "host_offline",
2900
2990
  "project_limit",
@@ -2907,157 +2997,157 @@ var Eligibility = z14.union([
2907
2997
  "already_dispatched",
2908
2998
  "retry_backoff"
2909
2999
  ]),
2910
- message: z14.string()
3000
+ message: z15.string()
2911
3001
  })
2912
3002
  ]);
2913
- var NowResponse = z14.object({
2914
- running: z14.array(z14.object({ taskId: z14.string(), runId: z14.string(), sessionId: z14.string().nullable() })),
2915
- queued: z14.array(z14.object({ taskId: z14.string(), eligibility: Eligibility })),
2916
- dispatchPaused: z14.boolean()
2917
- });
2918
- var AutomationInput = z14.object({
2919
- name: z14.string().min(1),
2920
- enabled: z14.boolean().default(true),
2921
- projectId: z14.string(),
3003
+ var NowResponse = z15.object({
3004
+ running: z15.array(z15.object({ taskId: z15.string(), runId: z15.string(), sessionId: z15.string().nullable() })),
3005
+ queued: z15.array(z15.object({ taskId: z15.string(), eligibility: Eligibility })),
3006
+ dispatchPaused: z15.boolean()
3007
+ });
3008
+ var AutomationInput = z15.object({
3009
+ name: z15.string().min(1),
3010
+ enabled: z15.boolean().default(true),
3011
+ projectId: z15.string(),
2922
3012
  trigger: Trigger,
2923
- filters: z14.array(z14.object({ path: z14.string(), equals: z14.string() })).default([]),
3013
+ filters: z15.array(z15.object({ path: z15.string(), equals: z15.string() })).default([]),
2924
3014
  template: TaskTemplate,
2925
- hostId: z14.string().nullable().default(null),
2926
- profileId: z14.string().nullable().default(null),
2927
- mode: z14.enum(["fresh", "continue", "watch"]).default("fresh"),
2928
- groupingKey: z14.string().nullable().default(null),
2929
- overlap: z14.enum(["skip", "queue_one", "append"]).default("skip"),
2930
- missed: z14.enum(["skip", "run_once"]).default("skip"),
3015
+ hostId: z15.string().nullable().default(null),
3016
+ profileId: z15.string().nullable().default(null),
3017
+ mode: z15.enum(["fresh", "continue", "watch"]).default("fresh"),
3018
+ groupingKey: z15.string().nullable().default(null),
3019
+ overlap: z15.enum(["skip", "queue_one", "append"]).default("skip"),
3020
+ missed: z15.enum(["skip", "run_once"]).default("skip"),
2931
3021
  continuation: ContinuationPolicy.default({ enabled: false }),
2932
3022
  completion: CompletionPolicy.default({ checks: null, requireHumanReview: true })
2933
3023
  });
2934
- var AutomationView = Automation.extend({ summary: z14.string() });
2935
- var AutomationPreview = z14.object({
2936
- summary: z14.string(),
3024
+ var AutomationView = Automation.extend({ summary: z15.string() });
3025
+ var AutomationPreview = z15.object({
3026
+ summary: z15.string(),
2937
3027
  task: TaskTemplate,
2938
- next: z14.array(z14.string())
2939
- });
2940
- var WebhookTokenResponse = z14.object({ token: z14.string(), url: z14.string() });
2941
- var PushSubscriptionRequest = z14.object({
2942
- endpoint: z14.string().url(),
2943
- keys: z14.object({ p256dh: z14.string(), auth: z14.string() }),
2944
- permission: z14.enum(["granted", "denied", "default", "unknown"]).default("granted")
2945
- });
2946
- var NotificationSettings = z14.object({
2947
- quietHours: z14.object({
2948
- start: z14.string().regex(/^\d{2}:\d{2}$/),
2949
- end: z14.string().regex(/^\d{2}:\d{2}$/),
2950
- timezone: z14.string()
3028
+ next: z15.array(z15.string())
3029
+ });
3030
+ var WebhookTokenResponse = z15.object({ token: z15.string(), url: z15.string() });
3031
+ var PushSubscriptionRequest = z15.object({
3032
+ endpoint: z15.string().url(),
3033
+ keys: z15.object({ p256dh: z15.string(), auth: z15.string() }),
3034
+ permission: z15.enum(["granted", "denied", "default", "unknown"]).default("granted")
3035
+ });
3036
+ var NotificationSettings = z15.object({
3037
+ quietHours: z15.object({
3038
+ start: z15.string().regex(/^\d{2}:\d{2}$/),
3039
+ end: z15.string().regex(/^\d{2}:\d{2}$/),
3040
+ timezone: z15.string()
2951
3041
  }).nullable(),
2952
- privatePreviews: z14.boolean(),
2953
- preferredDeviceId: z14.string().nullable()
3042
+ privatePreviews: z15.boolean(),
3043
+ preferredDeviceId: z15.string().nullable()
2954
3044
  });
2955
- var PushPayload = z14.union([
2956
- z14.object({
2957
- type: z14.literal("show"),
2958
- title: z14.string(),
2959
- body: z14.string(),
2960
- tag: z14.string(),
2961
- url: z14.string(),
2962
- renotify: z14.boolean()
3045
+ var PushPayload = z15.union([
3046
+ z15.object({
3047
+ type: z15.literal("show"),
3048
+ title: z15.string(),
3049
+ body: z15.string(),
3050
+ tag: z15.string(),
3051
+ url: z15.string(),
3052
+ renotify: z15.boolean()
2963
3053
  }),
2964
- z14.object({ type: z14.literal("clear"), tag: z14.string() })
3054
+ z15.object({ type: z15.literal("clear"), tag: z15.string() })
2965
3055
  ]);
2966
- var SetupState = z14.object({
2967
- passkey: z14.object({
2968
- available: z14.boolean(),
2969
- registered: z14.boolean(),
2970
- reason: z14.string().nullable()
3056
+ var SetupState = z15.object({
3057
+ passkey: z15.object({
3058
+ available: z15.boolean(),
3059
+ registered: z15.boolean(),
3060
+ reason: z15.string().nullable()
2971
3061
  }),
2972
- oidc: z14.object({ label: z14.string() }).nullable()
3062
+ oidc: z15.object({ label: z15.string() }).nullable()
2973
3063
  });
2974
- var PasskeyRegisterOptionsResponse = z14.object({
2975
- challengeId: z14.string(),
2976
- options: z14.unknown()
3064
+ var PasskeyRegisterOptionsResponse = z15.object({
3065
+ challengeId: z15.string(),
3066
+ options: z15.unknown()
2977
3067
  });
2978
- var PasskeyRegisterVerifyRequest = z14.object({
2979
- challengeId: z14.string(),
2980
- name: z14.string().min(1).max(80),
2981
- response: z14.unknown()
3068
+ var PasskeyRegisterVerifyRequest = z15.object({
3069
+ challengeId: z15.string(),
3070
+ name: z15.string().min(1).max(80),
3071
+ response: z15.unknown()
2982
3072
  });
2983
- var PasskeySignInOptionsResponse = z14.object({
2984
- challengeId: z14.string(),
2985
- options: z14.unknown()
3073
+ var PasskeySignInOptionsResponse = z15.object({
3074
+ challengeId: z15.string(),
3075
+ options: z15.unknown()
2986
3076
  });
2987
- var PasskeySignInVerifyRequest = z14.object({
2988
- challengeId: z14.string(),
2989
- response: z14.unknown(),
2990
- deviceName: z14.string().min(1).max(80),
3077
+ var PasskeySignInVerifyRequest = z15.object({
3078
+ challengeId: z15.string(),
3079
+ response: z15.unknown(),
3080
+ deviceName: z15.string().min(1).max(80),
2991
3081
  kind: DeviceKind.extract(["browser", "pwa"])
2992
3082
  });
2993
- var OidcBeginRequest = z14.object({
2994
- deviceName: z14.string().min(1).max(80),
3083
+ var OidcBeginRequest = z15.object({
3084
+ deviceName: z15.string().min(1).max(80),
2995
3085
  kind: DeviceKind.extract(["browser", "pwa"]),
2996
- next: z14.string().default("/"),
2997
- handoff: z14.boolean().default(false)
2998
- });
2999
- var OidcBeginResponse = z14.object({
3000
- authorizeUrl: z14.string(),
3001
- flowId: z14.string().nullable(),
3002
- pollToken: z14.string().nullable()
3003
- });
3004
- var OidcClaimRequest = z14.object({ flowId: z14.string(), pollToken: z14.string() });
3005
- var OidcClaimResponse = z14.union([
3006
- z14.object({ status: z14.literal("pending") }),
3007
- z14.object({ status: z14.literal("done"), deviceId: z14.string() })
3086
+ next: z15.string().default("/"),
3087
+ handoff: z15.boolean().default(false)
3088
+ });
3089
+ var OidcBeginResponse = z15.object({
3090
+ authorizeUrl: z15.string(),
3091
+ flowId: z15.string().nullable(),
3092
+ pollToken: z15.string().nullable()
3093
+ });
3094
+ var OidcClaimRequest = z15.object({ flowId: z15.string(), pollToken: z15.string() });
3095
+ var OidcClaimResponse = z15.union([
3096
+ z15.object({ status: z15.literal("pending") }),
3097
+ z15.object({ status: z15.literal("done"), deviceId: z15.string() })
3008
3098
  ]);
3009
- var TerminalLoginStartRequest = z14.object({ name: z14.string().min(1).max(80) });
3010
- var TerminalLoginStartResponse = z14.object({
3011
- userCode: z14.string(),
3012
- pollToken: z14.string(),
3013
- verifyUrl: z14.string(),
3014
- expiresAt: z14.string(),
3015
- intervalMs: z14.number().int()
3016
- });
3017
- var TerminalLoginClaimRequest = z14.object({
3018
- userCode: z14.string().min(1),
3019
- pollToken: z14.string().min(1)
3020
- });
3021
- var TerminalLoginClaimResponse = z14.union([
3022
- z14.object({ status: z14.literal("pending") }),
3023
- z14.object({ status: z14.literal("denied") }),
3024
- z14.object({ status: z14.literal("done"), deviceId: z14.string(), credential: z14.string() })
3099
+ var TerminalLoginStartRequest = z15.object({ name: z15.string().min(1).max(80) });
3100
+ var TerminalLoginStartResponse = z15.object({
3101
+ userCode: z15.string(),
3102
+ pollToken: z15.string(),
3103
+ verifyUrl: z15.string(),
3104
+ expiresAt: z15.string(),
3105
+ intervalMs: z15.number().int()
3106
+ });
3107
+ var TerminalLoginClaimRequest = z15.object({
3108
+ userCode: z15.string().min(1),
3109
+ pollToken: z15.string().min(1)
3110
+ });
3111
+ var TerminalLoginClaimResponse = z15.union([
3112
+ z15.object({ status: z15.literal("pending") }),
3113
+ z15.object({ status: z15.literal("denied") }),
3114
+ z15.object({ status: z15.literal("done"), deviceId: z15.string(), credential: z15.string() })
3025
3115
  ]);
3026
- var TerminalLoginRequest = z14.object({
3027
- userCode: z14.string(),
3028
- name: z14.string(),
3029
- requestedFrom: z14.string(),
3030
- createdAt: z14.string(),
3031
- expiresAt: z14.string(),
3032
- status: z14.enum(["pending", "approved", "denied"])
3033
- });
3034
- var AuthMethods = z14.object({
3035
- passkeys: z14.array(Passkey),
3036
- passkeyAvailability: z14.object({ available: z14.boolean(), reason: z14.string().nullable() }),
3037
- oidc: z14.object({
3038
- issuer: z14.string(),
3039
- label: z14.string(),
3040
- ownerMatch: z14.string(),
3041
- status: z14.enum(["ready", "error"]),
3042
- error: z14.string().nullable()
3116
+ var TerminalLoginRequest = z15.object({
3117
+ userCode: z15.string(),
3118
+ name: z15.string(),
3119
+ requestedFrom: z15.string(),
3120
+ createdAt: z15.string(),
3121
+ expiresAt: z15.string(),
3122
+ status: z15.enum(["pending", "approved", "denied"])
3123
+ });
3124
+ var AuthMethods = z15.object({
3125
+ passkeys: z15.array(Passkey),
3126
+ passkeyAvailability: z15.object({ available: z15.boolean(), reason: z15.string().nullable() }),
3127
+ oidc: z15.object({
3128
+ issuer: z15.string(),
3129
+ label: z15.string(),
3130
+ ownerMatch: z15.string(),
3131
+ status: z15.enum(["ready", "error"]),
3132
+ error: z15.string().nullable()
3043
3133
  }).nullable()
3044
3134
  });
3045
- var MeResponse = z14.object({
3135
+ var MeResponse = z15.object({
3046
3136
  device: Device,
3047
- admin: z14.boolean(),
3048
- publicUrl: z14.string()
3137
+ admin: z15.boolean(),
3138
+ publicUrl: z15.string()
3049
3139
  });
3050
- var ClientBindingInput = z14.object({ mirror: ClientMirror, scopeId: z14.string().min(1).nullable().optional() }).refine((b) => b.mirror === "scope" === !!b.scopeId, {
3140
+ var ClientBindingInput = z15.object({ mirror: ClientMirror, scopeId: z15.string().min(1).nullable().optional() }).refine((b) => b.mirror === "scope" === !!b.scopeId, {
3051
3141
  message: "scopeId is required for mirror=scope and only then"
3052
3142
  });
3053
3143
  var ClientReport = Client.pick({ kind: true, name: true, machine: true }).extend({
3054
- hostId: z14.string().nullable().optional(),
3144
+ hostId: z15.string().nullable().optional(),
3055
3145
  /** Sessions in its mirror tabs or windows; omitted when unchanged or unknown. */
3056
- shows: z14.array(z14.string()).max(1e3).optional(),
3146
+ shows: z15.array(z15.string()).max(1e3).optional(),
3057
3147
  /** The binding this client had before bindings were recorded (env file); applied only when none is recorded. */
3058
3148
  seed: ClientBindingInput.optional()
3059
3149
  });
3060
- var ScopeInput = z14.object({
3150
+ var ScopeInput = z15.object({
3061
3151
  name: Scope.shape.name,
3062
3152
  mode: Scope.shape.mode.optional(),
3063
3153
  projectIds: Scope.shape.projectIds.optional(),
@@ -3065,7 +3155,7 @@ var ScopeInput = z14.object({
3065
3155
  /** A GitHub source makes this a GitHub scope; its projects are then kept by GitHub. */
3066
3156
  source: GitHubSourceInput.nullable().optional()
3067
3157
  });
3068
- var ScopePatch = z14.object({
3158
+ var ScopePatch = z15.object({
3069
3159
  name: Scope.shape.name.optional(),
3070
3160
  mode: Scope.shape.mode.optional(),
3071
3161
  projectIds: Scope.shape.projectIds.optional(),
@@ -3073,80 +3163,90 @@ var ScopePatch = z14.object({
3073
3163
  /** null removes the source; an object changes it, or adds one (then hostId and owner are required). */
3074
3164
  source: GitHubSourcePatch.nullable().optional()
3075
3165
  });
3076
- var ProjectSuggestionsResponse = z14.object({
3077
- suggestions: z14.array(ProjectSuggestion.extend({ name: z14.string(), preselected: z14.boolean() }))
3166
+ var ProjectSuggestionsResponse = z15.object({
3167
+ suggestions: z15.array(ProjectSuggestion.extend({ name: z15.string(), preselected: z15.boolean() }))
3078
3168
  });
3079
3169
 
3080
3170
  // packages/protocol/dist/scopes.js
3081
3171
  var CLIENT_OPEN_MS = 10 * 6e4;
3082
3172
 
3083
3173
  // packages/protocol/dist/client-wire.js
3084
- import { z as z15 } from "zod";
3085
- var SyncState = z15.object({
3086
- hosts: z15.array(Host),
3087
- projects: z15.array(Project),
3088
- checkouts: z15.array(Checkout),
3089
- workspaces: z15.array(Workspace),
3090
- profiles: z15.array(Profile),
3174
+ import { z as z16 } from "zod";
3175
+ var SyncState = z16.object({
3176
+ hosts: z16.array(Host),
3177
+ projects: z16.array(Project),
3178
+ checkouts: z16.array(Checkout),
3179
+ workspaces: z16.array(Workspace),
3180
+ profiles: z16.array(Profile),
3091
3181
  /** Scopes; absent from coordinators before 0.21. */
3092
- scopes: z15.array(Scope).default([]),
3093
- sessions: z15.array(Session),
3094
- tasks: z15.array(Task),
3095
- runs: z15.array(Run),
3096
- automations: z15.array(Automation),
3097
- attention: z15.array(AttentionItem),
3098
- interactions: z15.array(Interaction),
3099
- panels: z15.array(Panel),
3100
- devices: z15.array(Device),
3182
+ scopes: z16.array(Scope).default([]),
3183
+ sessions: z16.array(Session),
3184
+ tasks: z16.array(Task),
3185
+ runs: z16.array(Run),
3186
+ automations: z16.array(Automation),
3187
+ attention: z16.array(AttentionItem),
3188
+ interactions: z16.array(Interaction),
3189
+ panels: z16.array(Panel),
3190
+ devices: z16.array(Device),
3101
3191
  /** Tracked issues; absent from older coordinators. */
3102
- issues: z15.array(TrackedIssue).default([]),
3192
+ issues: z16.array(TrackedIssue).default([]),
3103
3193
  /** Clients (herdr and tmux sessions); absent from coordinators before 0.21. */
3104
- clients: z15.array(Client).default([]),
3105
- adapters: z15.record(z15.string(), z15.array(AdapterInfo)),
3106
- dispatchPaused: z15.boolean()
3107
- });
3108
- var Presence = z15.object({
3109
- foreground: z15.boolean(),
3110
- interactedAt: z15.string().nullable(),
3111
- viewing: z15.object({ sessionId: z15.string() }).nullable(),
3194
+ clients: z16.array(Client).default([]),
3195
+ adapters: z16.record(z16.string(), z16.array(AdapterInfo)),
3196
+ dispatchPaused: z16.boolean()
3197
+ });
3198
+ var Presence = z16.object({
3199
+ foreground: z16.boolean(),
3200
+ interactedAt: z16.string().nullable(),
3201
+ viewing: z16.object({ sessionId: z16.string() }).nullable(),
3112
3202
  /**
3113
3203
  * A herdr or tmux daemon reporting the session focused in its client (kept apart from the
3114
3204
  * device's own presence).
3115
3205
  */
3116
- clientId: z15.string().min(1).max(200).optional(),
3206
+ clientId: z16.string().min(1).max(200).optional(),
3117
3207
  /** COMPAT(scopes-rename): remove after 2027-03-01. The old name of clientId. */
3118
- terminalId: z15.string().min(1).max(200).optional()
3119
- });
3120
- var CLIENT_CAPABILITIES = ["adapter.slots.v1", "timeline.cards.v1", "scopes.v1"];
3121
- var ClientToServer = z15.discriminatedUnion("type", [
3122
- z15.object({
3123
- type: z15.literal("hello"),
3124
- cursor: z15.number().int().nullable(),
3125
- capabilities: z15.array(z15.string().min(1).max(80)).max(32).optional(),
3126
- projectionId: z15.string().max(256).nullable().optional()
3208
+ terminalId: z16.string().min(1).max(200).optional()
3209
+ });
3210
+ var CLIENT_CAPABILITIES = [
3211
+ "adapter.slots.v1",
3212
+ "timeline.cards.v1",
3213
+ "scopes.v1",
3214
+ /** The client reads `ToolItemData.view`. */
3215
+ "tool.views.v1",
3216
+ /** The client draws checklist, facts, rows and badge nodes, `section.open` and URL refs. */
3217
+ "ui.nodes.v2",
3218
+ /** The client draws `composer.tracker` and `session.badge` contributions. */
3219
+ "adapter.trackers.v1"
3220
+ ];
3221
+ var ClientToServer = z16.discriminatedUnion("type", [
3222
+ z16.object({
3223
+ type: z16.literal("hello"),
3224
+ cursor: z16.number().int().nullable(),
3225
+ capabilities: z16.array(z16.string().min(1).max(80)).max(32).optional(),
3226
+ projectionId: z16.string().max(256).nullable().optional()
3127
3227
  }),
3128
- z15.object({ type: z15.literal("presence"), presence: Presence }),
3129
- z15.object({ type: z15.literal("ping") })
3228
+ z16.object({ type: z16.literal("presence"), presence: Presence }),
3229
+ z16.object({ type: z16.literal("ping") })
3130
3230
  ]);
3131
- var ServerToClient = z15.discriminatedUnion("type", [
3132
- z15.object({
3133
- type: z15.literal("replay"),
3134
- seq: z15.number().int(),
3135
- events: z15.array(EventEnvelope),
3136
- capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
3137
- projectionId: z15.string().optional()
3231
+ var ServerToClient = z16.discriminatedUnion("type", [
3232
+ z16.object({
3233
+ type: z16.literal("replay"),
3234
+ seq: z16.number().int(),
3235
+ events: z16.array(EventEnvelope),
3236
+ capabilities: z16.array(z16.enum(CLIENT_CAPABILITIES)).optional(),
3237
+ projectionId: z16.string().optional()
3138
3238
  }),
3139
- z15.object({
3140
- type: z15.literal("snapshot"),
3141
- seq: z15.number().int(),
3239
+ z16.object({
3240
+ type: z16.literal("snapshot"),
3241
+ seq: z16.number().int(),
3142
3242
  state: SyncState,
3143
- capabilities: z15.array(z15.enum(CLIENT_CAPABILITIES)).optional(),
3144
- projectionId: z15.string().optional()
3243
+ capabilities: z16.array(z16.enum(CLIENT_CAPABILITIES)).optional(),
3244
+ projectionId: z16.string().optional()
3145
3245
  }),
3146
- z15.object({ type: z15.literal("event"), event: EventEnvelope }),
3147
- z15.object({ type: z15.literal("stream"), delta: StreamDelta }),
3148
- z15.object({ type: z15.literal("pong") }),
3149
- z15.object({ type: z15.literal("force_logout"), reason: z15.string() })
3246
+ z16.object({ type: z16.literal("event"), event: EventEnvelope }),
3247
+ z16.object({ type: z16.literal("stream"), delta: StreamDelta }),
3248
+ z16.object({ type: z16.literal("pong") }),
3249
+ z16.object({ type: z16.literal("force_logout"), reason: z16.string() })
3150
3250
  ]);
3151
3251
 
3152
3252
  // packages/protocol/dist/ids.js
@@ -3154,17 +3254,17 @@ import { monotonicFactory } from "ulid";
3154
3254
  var ulid = monotonicFactory();
3155
3255
 
3156
3256
  // packages/protocol/dist/web-bridge.js
3157
- import { z as z16 } from "zod";
3257
+ import { z as z17 } from "zod";
3158
3258
  var FRAME_MAX_HEIGHT = 4e3;
3159
- var FrameToParentMessageSchema = z16.discriminatedUnion("type", [
3160
- z16.object({
3161
- type: z16.literal("action"),
3162
- actionId: z16.string().min(1).max(200),
3163
- payload: z16.unknown().optional()
3259
+ var FrameToParentMessageSchema = z17.discriminatedUnion("type", [
3260
+ z17.object({
3261
+ type: z17.literal("action"),
3262
+ actionId: z17.string().min(1).max(200),
3263
+ payload: z17.unknown().optional()
3164
3264
  }),
3165
- z16.object({
3166
- type: z16.literal("resize"),
3167
- height: z16.number().finite().min(0).max(FRAME_MAX_HEIGHT)
3265
+ z17.object({
3266
+ type: z17.literal("resize"),
3267
+ height: z17.number().finite().min(0).max(FRAME_MAX_HEIGHT)
3168
3268
  })
3169
3269
  ]);
3170
3270