@chrisjowen/wheelhouse 0.11.0 → 0.12.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 (402) hide show
  1. package/README.md +23 -1
  2. package/build/client/_app/immutable/assets/0.CS9-5c8D.css +1 -0
  3. package/build/client/_app/immutable/assets/0.CS9-5c8D.css.br +0 -0
  4. package/build/client/_app/immutable/assets/0.CS9-5c8D.css.gz +0 -0
  5. package/build/client/_app/immutable/chunks/{B597Cbe1.js → 8JUY7TGF.js} +1 -1
  6. package/build/client/_app/immutable/chunks/8JUY7TGF.js.br +0 -0
  7. package/build/client/_app/immutable/chunks/8JUY7TGF.js.gz +0 -0
  8. package/build/client/_app/immutable/chunks/{Cbm0yS9E.js → B78SKOml.js} +1 -1
  9. package/build/client/_app/immutable/chunks/B78SKOml.js.br +0 -0
  10. package/build/client/_app/immutable/chunks/B78SKOml.js.gz +0 -0
  11. package/build/client/_app/immutable/chunks/{CPQbfMGI.js → BIJDRvOc.js} +1 -1
  12. package/build/client/_app/immutable/chunks/BIJDRvOc.js.br +0 -0
  13. package/build/client/_app/immutable/chunks/BIJDRvOc.js.gz +0 -0
  14. package/build/client/_app/immutable/chunks/{DVeiiKip.js → BYUAxBPx.js} +1 -1
  15. package/build/client/_app/immutable/chunks/BYUAxBPx.js.br +0 -0
  16. package/build/client/_app/immutable/chunks/BYUAxBPx.js.gz +0 -0
  17. package/build/client/_app/immutable/chunks/BezBg3rs.js +1 -0
  18. package/build/client/_app/immutable/chunks/BezBg3rs.js.br +0 -0
  19. package/build/client/_app/immutable/chunks/BezBg3rs.js.gz +0 -0
  20. package/build/client/_app/immutable/chunks/{DnBZO8Il.js → BrlWJk4r.js} +1 -1
  21. package/build/client/_app/immutable/chunks/BrlWJk4r.js.br +0 -0
  22. package/build/client/_app/immutable/chunks/BrlWJk4r.js.gz +0 -0
  23. package/build/client/_app/immutable/chunks/{BiiAyXOY.js → Bw22EWRR.js} +1 -1
  24. package/build/client/_app/immutable/chunks/Bw22EWRR.js.br +0 -0
  25. package/build/client/_app/immutable/chunks/Bw22EWRR.js.gz +0 -0
  26. package/build/client/_app/immutable/chunks/{CC5Ts_xe.js → C6B0JAFe.js} +1 -1
  27. package/build/client/_app/immutable/chunks/C6B0JAFe.js.br +0 -0
  28. package/build/client/_app/immutable/chunks/C6B0JAFe.js.gz +0 -0
  29. package/build/client/_app/immutable/chunks/{BEKG1Stw.js → C8OIAOGW.js} +1 -1
  30. package/build/client/_app/immutable/chunks/C8OIAOGW.js.br +0 -0
  31. package/build/client/_app/immutable/chunks/C8OIAOGW.js.gz +0 -0
  32. package/build/client/_app/immutable/chunks/{60JlvdhQ.js → CEHCs8E4.js} +1 -1
  33. package/build/client/_app/immutable/chunks/CEHCs8E4.js.br +0 -0
  34. package/build/client/_app/immutable/chunks/CEHCs8E4.js.gz +0 -0
  35. package/build/client/_app/immutable/chunks/{ChjkQemt.js → CL60_qsS.js} +1 -1
  36. package/build/client/_app/immutable/chunks/CL60_qsS.js.br +0 -0
  37. package/build/client/_app/immutable/chunks/CL60_qsS.js.gz +0 -0
  38. package/build/client/_app/immutable/chunks/{C69eHrL5.js → CeuOu7QI.js} +1 -1
  39. package/build/client/_app/immutable/chunks/CeuOu7QI.js.br +0 -0
  40. package/build/client/_app/immutable/chunks/CeuOu7QI.js.gz +0 -0
  41. package/build/client/_app/immutable/chunks/{CSntU4ww.js → Cn9pLe1S.js} +1 -1
  42. package/build/client/_app/immutable/chunks/Cn9pLe1S.js.br +0 -0
  43. package/build/client/_app/immutable/chunks/Cn9pLe1S.js.gz +0 -0
  44. package/build/client/_app/immutable/chunks/{CvZklcJq.js → D1QZsS_n.js} +1 -1
  45. package/build/client/_app/immutable/chunks/D1QZsS_n.js.br +0 -0
  46. package/build/client/_app/immutable/chunks/D1QZsS_n.js.gz +0 -0
  47. package/build/client/_app/immutable/chunks/{IKqZ9EUq.js → D3z87-GH.js} +5 -5
  48. package/build/client/_app/immutable/chunks/D3z87-GH.js.br +0 -0
  49. package/build/client/_app/immutable/chunks/D3z87-GH.js.gz +0 -0
  50. package/build/client/_app/immutable/chunks/{DSAFUgJn.js → D69HGG2e.js} +1 -1
  51. package/build/client/_app/immutable/chunks/D69HGG2e.js.br +0 -0
  52. package/build/client/_app/immutable/chunks/D69HGG2e.js.gz +0 -0
  53. package/build/client/_app/immutable/chunks/{B-rYWQGG.js → DGZVZsEx.js} +1 -1
  54. package/build/client/_app/immutable/chunks/DGZVZsEx.js.br +0 -0
  55. package/build/client/_app/immutable/chunks/DGZVZsEx.js.gz +0 -0
  56. package/build/client/_app/immutable/chunks/{rZ2-WaWD.js → Dbi_7cO_.js} +2 -2
  57. package/build/client/_app/immutable/chunks/Dbi_7cO_.js.br +0 -0
  58. package/build/client/_app/immutable/chunks/Dbi_7cO_.js.gz +0 -0
  59. package/build/client/_app/immutable/chunks/{DjCsArDj.js → Dq4WC4aT.js} +1 -1
  60. package/build/client/_app/immutable/chunks/Dq4WC4aT.js.br +0 -0
  61. package/build/client/_app/immutable/chunks/Dq4WC4aT.js.gz +0 -0
  62. package/build/client/_app/immutable/chunks/{Gbvs-EZ4.js → QrHSSdjC.js} +1 -1
  63. package/build/client/_app/immutable/chunks/QrHSSdjC.js.br +2 -0
  64. package/build/client/_app/immutable/chunks/QrHSSdjC.js.gz +0 -0
  65. package/build/client/_app/immutable/chunks/{BPAziDlG.js → bOtONP_M.js} +1 -1
  66. package/build/client/_app/immutable/chunks/bOtONP_M.js.br +0 -0
  67. package/build/client/_app/immutable/chunks/bOtONP_M.js.gz +0 -0
  68. package/build/client/_app/immutable/entry/app.B0SozPUz.js +2 -0
  69. package/build/client/_app/immutable/entry/app.B0SozPUz.js.br +0 -0
  70. package/build/client/_app/immutable/entry/app.B0SozPUz.js.gz +0 -0
  71. package/build/client/_app/immutable/entry/start.BgyXy-5i.js +1 -0
  72. package/build/client/_app/immutable/entry/start.BgyXy-5i.js.br +0 -0
  73. package/build/client/_app/immutable/entry/start.BgyXy-5i.js.gz +0 -0
  74. package/build/client/_app/immutable/nodes/{0.CPXJEdVC.js → 0.BH-p6KNP.js} +1 -1
  75. package/build/client/_app/immutable/nodes/0.BH-p6KNP.js.br +0 -0
  76. package/build/client/_app/immutable/nodes/0.BH-p6KNP.js.gz +0 -0
  77. package/build/client/_app/immutable/nodes/{1.BsHjzKoN.js → 1.5bKMe7me.js} +1 -1
  78. package/build/client/_app/immutable/nodes/1.5bKMe7me.js.br +0 -0
  79. package/build/client/_app/immutable/nodes/1.5bKMe7me.js.gz +0 -0
  80. package/build/client/_app/immutable/nodes/{10.JvkeSj5x.js → 10.CuyB--Be.js} +1 -1
  81. package/build/client/_app/immutable/nodes/10.CuyB--Be.js.br +0 -0
  82. package/build/client/_app/immutable/nodes/10.CuyB--Be.js.gz +0 -0
  83. package/build/client/_app/immutable/nodes/{11.C9viE404.js → 11.Cp96bYst.js} +1 -1
  84. package/build/client/_app/immutable/nodes/11.Cp96bYst.js.br +0 -0
  85. package/build/client/_app/immutable/nodes/11.Cp96bYst.js.gz +0 -0
  86. package/build/client/_app/immutable/nodes/{12.BWVqITW1.js → 12.B9kS4-UK.js} +1 -1
  87. package/build/client/_app/immutable/nodes/12.B9kS4-UK.js.br +0 -0
  88. package/build/client/_app/immutable/nodes/12.B9kS4-UK.js.gz +0 -0
  89. package/build/client/_app/immutable/nodes/{13.D0u53Jpp.js → 13.ie4sMrRi.js} +1 -1
  90. package/build/client/_app/immutable/nodes/13.ie4sMrRi.js.br +0 -0
  91. package/build/client/_app/immutable/nodes/13.ie4sMrRi.js.gz +0 -0
  92. package/build/client/_app/immutable/nodes/{14.CNClDl2g.js → 14.CqfbcQC3.js} +1 -1
  93. package/build/client/_app/immutable/nodes/14.CqfbcQC3.js.br +0 -0
  94. package/build/client/_app/immutable/nodes/14.CqfbcQC3.js.gz +0 -0
  95. package/build/client/_app/immutable/nodes/{15.BJShjxpx.js → 15.ClcEiTus.js} +1 -1
  96. package/build/client/_app/immutable/nodes/15.ClcEiTus.js.br +0 -0
  97. package/build/client/_app/immutable/nodes/15.ClcEiTus.js.gz +0 -0
  98. package/build/client/_app/immutable/nodes/{16.Bb3PPsch.js → 16.Lubye7rY.js} +1 -1
  99. package/build/client/_app/immutable/nodes/16.Lubye7rY.js.br +0 -0
  100. package/build/client/_app/immutable/nodes/16.Lubye7rY.js.gz +0 -0
  101. package/build/client/_app/immutable/nodes/{17.COjMgZvi.js → 17.CZsgvMnU.js} +1 -1
  102. package/build/client/_app/immutable/nodes/17.CZsgvMnU.js.br +0 -0
  103. package/build/client/_app/immutable/nodes/17.CZsgvMnU.js.gz +0 -0
  104. package/build/client/_app/immutable/nodes/{19.BbeSGQyg.js → 19.nb4PEk6e.js} +1 -1
  105. package/build/client/_app/immutable/nodes/19.nb4PEk6e.js.br +0 -0
  106. package/build/client/_app/immutable/nodes/19.nb4PEk6e.js.gz +0 -0
  107. package/build/client/_app/immutable/nodes/2.DBpcacIW.js +26 -0
  108. package/build/client/_app/immutable/nodes/2.DBpcacIW.js.br +0 -0
  109. package/build/client/_app/immutable/nodes/2.DBpcacIW.js.gz +0 -0
  110. package/build/client/_app/immutable/nodes/{20.2D2FCLQq.js → 20.DKDJA76m.js} +1 -1
  111. package/build/client/_app/immutable/nodes/20.DKDJA76m.js.br +0 -0
  112. package/build/client/_app/immutable/nodes/20.DKDJA76m.js.gz +0 -0
  113. package/build/client/_app/immutable/nodes/{21.xQ_KUjAi.js → 21.DDSJrVwV.js} +1 -1
  114. package/build/client/_app/immutable/nodes/21.DDSJrVwV.js.br +0 -0
  115. package/build/client/_app/immutable/nodes/21.DDSJrVwV.js.gz +0 -0
  116. package/build/client/_app/immutable/nodes/{22.DuszjIrq.js → 22.Bf2Y4qtK.js} +1 -1
  117. package/build/client/_app/immutable/nodes/22.Bf2Y4qtK.js.br +0 -0
  118. package/build/client/_app/immutable/nodes/22.Bf2Y4qtK.js.gz +0 -0
  119. package/build/client/_app/immutable/nodes/{23.CKoLeDhM.js → 23.CgSRzQDr.js} +1 -1
  120. package/build/client/_app/immutable/nodes/23.CgSRzQDr.js.br +0 -0
  121. package/build/client/_app/immutable/nodes/23.CgSRzQDr.js.gz +0 -0
  122. package/build/client/_app/immutable/nodes/{24.CH1byq7o.js → 24.fKJczgYC.js} +1 -1
  123. package/build/client/_app/immutable/nodes/24.fKJczgYC.js.br +0 -0
  124. package/build/client/_app/immutable/nodes/24.fKJczgYC.js.gz +0 -0
  125. package/build/client/_app/immutable/nodes/25.BzI2N_Dl.js +14 -0
  126. package/build/client/_app/immutable/nodes/25.BzI2N_Dl.js.br +0 -0
  127. package/build/client/_app/immutable/nodes/25.BzI2N_Dl.js.gz +0 -0
  128. package/build/client/_app/immutable/nodes/{26.CHB__H6C.js → 26.Bl7bQZez.js} +1 -1
  129. package/build/client/_app/immutable/nodes/26.Bl7bQZez.js.br +0 -0
  130. package/build/client/_app/immutable/nodes/26.Bl7bQZez.js.gz +0 -0
  131. package/build/client/_app/immutable/nodes/{28.pI-7Vnsb.js → 28.B9EWyQv6.js} +1 -1
  132. package/build/client/_app/immutable/nodes/28.B9EWyQv6.js.br +0 -0
  133. package/build/client/_app/immutable/nodes/28.B9EWyQv6.js.gz +0 -0
  134. package/build/client/_app/immutable/nodes/{3.6gLsJ5iP.js → 3.DMxCWZ16.js} +1 -1
  135. package/build/client/_app/immutable/nodes/3.DMxCWZ16.js.br +0 -0
  136. package/build/client/_app/immutable/nodes/3.DMxCWZ16.js.gz +0 -0
  137. package/build/client/_app/immutable/nodes/{4.uKPQRIJV.js → 4.Bj_V5H0A.js} +1 -1
  138. package/build/client/_app/immutable/nodes/4.Bj_V5H0A.js.br +0 -0
  139. package/build/client/_app/immutable/nodes/4.Bj_V5H0A.js.gz +0 -0
  140. package/build/client/_app/immutable/nodes/{6.CmppqGHA.js → 6.BAzIGIXP.js} +1 -1
  141. package/build/client/_app/immutable/nodes/6.BAzIGIXP.js.br +0 -0
  142. package/build/client/_app/immutable/nodes/6.BAzIGIXP.js.gz +0 -0
  143. package/build/client/_app/immutable/nodes/{7.DDZOqRAy.js → 7.CpRItf5T.js} +1 -1
  144. package/build/client/_app/immutable/nodes/7.CpRItf5T.js.br +0 -0
  145. package/build/client/_app/immutable/nodes/7.CpRItf5T.js.gz +0 -0
  146. package/build/client/_app/immutable/nodes/{8.DH6CiiFf.js → 8.BRbaXe0L.js} +1 -1
  147. package/build/client/_app/immutable/nodes/8.BRbaXe0L.js.br +0 -0
  148. package/build/client/_app/immutable/nodes/8.BRbaXe0L.js.gz +0 -0
  149. package/build/client/_app/immutable/nodes/{9.jlOFlXh8.js → 9.DpQmfi7O.js} +1 -1
  150. package/build/client/_app/immutable/nodes/9.DpQmfi7O.js.br +0 -0
  151. package/build/client/_app/immutable/nodes/9.DpQmfi7O.js.gz +0 -0
  152. package/build/client/_app/version.json +1 -1
  153. package/build/client/_app/version.json.br +0 -0
  154. package/build/client/_app/version.json.gz +0 -0
  155. package/build/handler.js +4 -4
  156. package/build/index.js +4 -4
  157. package/build/server/chunks/chunks/{DecisionCard.js-DQls79M-.js → DecisionCard.js-Cim80Nvw.js} +2 -2
  158. package/build/server/chunks/chunks/{OpenDecision.js-1bnVd2CO.js → OpenDecision.js-BVAXM8UF.js} +3 -3
  159. package/build/server/chunks/chunks/{chat.svelte.js-t_sykiqk.js → chat.svelte.js-BcKQjH6T.js} +5 -1
  160. package/build/server/chunks/chunks/{detail.js-BHgTIrxq.js → detail.js-BBCxJBpU.js} +2 -2
  161. package/build/server/chunks/chunks/{feedback.js-CNjq89nb.js → feedback.js-DHLUCzN_.js} +2 -2
  162. package/build/server/chunks/chunks/harness.js-DPojOlFJ.js +16 -0
  163. package/build/server/chunks/chunks/{insights.svelte.js-jvJ6zpkP.js → insights.svelte.js-CLCl4593.js} +4 -4
  164. package/build/server/chunks/chunks/{internal.js-DxO60Agy.js → internal.js-CedW099c.js} +3 -3
  165. package/build/server/chunks/chunks/{keychain.js-CTV5MMKd.js → keychain.js-CspIw1lK.js} +2 -2
  166. package/build/server/chunks/chunks/{marketplace-service.js-DZ7N3g7i.js → marketplace-service.js-O-2c34nr.js} +2 -2
  167. package/build/server/chunks/chunks/{page.js-slDjdKdN.js → page.js-BRRl6mg_.js} +2 -2
  168. package/build/server/chunks/chunks/{previewhelper2.js-D62yPZ3-.js → previewhelper2.js-CLYvgGeM.js} +2 -2
  169. package/build/server/chunks/chunks/{repo.js-CpMWC7Dl.js → repo.js-BQv7p3Qv.js} +2 -2
  170. package/build/server/chunks/chunks/{runtime.js-n2Nl0Kn0.js → runtime.js-ja9fpm3a.js} +2111 -788
  171. package/build/server/chunks/chunks/{service.js-BBKBSt-r.js → service.js-CHB5De_m.js} +2 -2
  172. package/build/server/chunks/chunks/{service2.js-D8unm3Dr.js → service2.js-BSXaHqaf.js} +24 -10
  173. package/build/server/chunks/chunks/{starter.js-BJtAaz_v.js → starter.js-BL6kYdY7.js} +2 -2
  174. package/build/server/chunks/chunks/{terminal.js-BckfZrAP.js → terminal.js-s8yEF1TY.js} +3 -1
  175. package/build/server/chunks/chunks/{view.js-DY3ke6NQ.js → view.js-DvrTXTsb.js} +2 -2
  176. package/build/server/chunks/entries/endpoints/api/apps/_op_/{_server.ts.js-DU337wCA.js → _server.ts.js-DJDX8mej.js} +6 -5
  177. package/build/server/chunks/entries/endpoints/api/cloud/{_server.ts.js-DUjwvbDq.js → _server.ts.js-ZpNBOdE6.js} +3 -3
  178. package/build/server/chunks/entries/endpoints/api/cloud/previews/{_server.ts.js-fB_wI3kP.js → _server.ts.js-cLGgBi-L.js} +6 -5
  179. package/build/server/chunks/entries/endpoints/api/events/{_server.ts.js-HZjTDOIW.js → _server.ts.js-DyA-Ftti.js} +6 -5
  180. package/build/server/chunks/entries/endpoints/api/files/{_server.ts.js-vtgE6dmd.js → _server.ts.js-BRutjWld.js} +6 -5
  181. package/build/server/chunks/entries/endpoints/api/firstmate/chat/{_server.ts.js-CBUM_cHq.js → _server.ts.js-CSUsZ_Uy.js} +6 -5
  182. package/build/server/chunks/entries/endpoints/api/firstmate/commands/{_server.ts.js-gqNm0NgZ.js → _server.ts.js-CyMAbBop.js} +9 -5
  183. package/build/server/chunks/entries/endpoints/api/firstmate/dismiss/{_server.ts.js-DVTt9exZ.js → _server.ts.js-C1QNh7Fv.js} +6 -5
  184. package/build/server/chunks/entries/endpoints/api/firstmate/input/{_server.ts.js-DI8pSLdx.js → _server.ts.js-xAS3zgy6.js} +6 -5
  185. package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/{_server.ts.js-DwNKcPAZ.js → _server.ts.js-C0ChpkPv.js} +6 -5
  186. package/build/server/chunks/entries/endpoints/api/firstmate/messages/{_server.ts.js-gn9Pb6xh.js → _server.ts.js-Dg8UqJYL.js} +7 -6
  187. package/build/server/chunks/entries/endpoints/api/firstmate/pick/{_server.ts.js-BsuIck0U.js → _server.ts.js-KtXAKUKl.js} +6 -5
  188. package/build/server/chunks/entries/endpoints/api/firstmate/reactions/{_server.ts.js-Du1j3gY1.js → _server.ts.js-SfyGIsms.js} +6 -5
  189. package/build/server/chunks/entries/endpoints/api/firstmate/start/{_server.ts.js-D5_z22cM.js → _server.ts.js-uKjVaQqO.js} +6 -5
  190. package/build/server/chunks/entries/endpoints/api/fleet/{_server.ts.js-CqUodLtV.js → _server.ts.js-Bh09YMSB.js} +6 -5
  191. package/build/server/chunks/entries/endpoints/api/gateway/{_server.ts.js-Bqvpqc3W.js → _server.ts.js-DiOWY9as.js} +6 -5
  192. package/build/server/chunks/entries/endpoints/api/health/{_server.ts.js-U1yy4XTd.js → _server.ts.js-BRjxK-9y.js} +6 -5
  193. package/build/server/chunks/entries/endpoints/api/inbox/{_server.ts.js-Bt1HEbxQ.js → _server.ts.js-CA3XQih9.js} +6 -5
  194. package/build/server/chunks/entries/endpoints/api/inbox/report/{_server.ts.js-B1QGwJJx.js → _server.ts.js-B5MRXVz2.js} +6 -5
  195. package/build/server/chunks/entries/endpoints/api/insights/{_server.ts.js-4D31QJkx.js → _server.ts.js-Hj5j2VEd.js} +6 -5
  196. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/config/{_server.ts.js-BB9t2sPI.js → _server.ts.js-CG5hVtIr.js} +6 -5
  197. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/{_server.ts.js-C0lNGC_e.js → _server.ts.js-CbfYfN4W.js} +7 -6
  198. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/summary/{_server.ts.js-BCucQ7kV.js → _server.ts.js-Cntqh4w-.js} +7 -6
  199. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/icon/_icon_/{_server.ts.js-K051c2NK.js → _server.ts.js-DbaYfmK8.js} +5 -4
  200. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/load/{_server.ts.js-DXp7CBKJ.js → _server.ts.js-CMC6khtq.js} +2 -2
  201. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/ui/_...path_/{_server.ts.js-BZjRhE_E.js → _server.ts.js-DiCaOT3E.js} +6 -5
  202. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/update/{_server.ts.js-C6pSTIZl.js → _server.ts.js-DQZxZKa4.js} +2 -2
  203. package/build/server/chunks/entries/endpoints/api/plugins/{_server.ts.js-CPTGODgJ.js → _server.ts.js-CaQ772k3.js} +6 -5
  204. package/build/server/chunks/entries/endpoints/api/plugins/inspect/{_server.ts.js-CYyhaWOu.js → _server.ts.js-DkjBSjdS.js} +2 -2
  205. package/build/server/chunks/entries/endpoints/api/plugins/install/{_server.ts.js-LOfrDPqm.js → _server.ts.js-BLEOrgEt.js} +2 -2
  206. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/{_server.ts.js-CqJSn65A.js → _server.ts.js-rrfRBhVX.js} +7 -6
  207. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/icon/_name_/{_server.ts.js-vWLUvqe2.js → _server.ts.js-DEaeguu1.js} +7 -6
  208. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/registries/{_server.ts.js-CIy3Yxnj.js → _server.ts.js-DGviOddp.js} +7 -6
  209. package/build/server/chunks/entries/endpoints/api/plugins/updates/{_server.ts.js-BXKekEzg.js → _server.ts.js-BfwOLICk.js} +2 -2
  210. package/build/server/chunks/entries/endpoints/api/previews/check/{_server.ts.js-DZnqmxa7.js → _server.ts.js-C3dZCo79.js} +6 -5
  211. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/{_server.ts.js-clRCP6Vz.js → _server.ts.js-QCxCUoaZ.js} +7 -6
  212. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/{_server.ts.js-C0v3Eifj.js → _server.ts.js-CIHZWmY6.js} +7 -6
  213. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/{_server.ts.js-B1P26NiL.js → _server.ts.js-9MZ6ZU7W.js} +7 -6
  214. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/{_server.ts.js-_BWFybXT.js → _server.ts.js-YJgYZpm2.js} +7 -6
  215. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/file/{_server.ts.js-DM_qs0_P.js → _server.ts.js-DRO0yFlG.js} +7 -6
  216. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/{_server.ts.js-Cp4DC5RF.js → _server.ts.js--78Nc6jj.js} +7 -6
  217. package/build/server/chunks/entries/endpoints/api/second-mates/_id_/peek/{_server.ts.js-CFQmNKZw.js → _server.ts.js-B92-w9Jt.js} +6 -5
  218. package/build/server/chunks/entries/endpoints/api/services/{_server.ts.js-C0Hp3ghu.js → _server.ts.js-BlgDs2xk.js} +6 -5
  219. package/build/server/chunks/entries/endpoints/api/setup/{_server.ts.js-OI33JqAV.js → _server.ts.js-Cc70st9n.js} +6 -5
  220. package/build/server/chunks/entries/endpoints/api/slots/{_server.ts.js-BOetbdrI.js → _server.ts.js-COmpO5sc.js} +6 -5
  221. package/build/server/chunks/entries/endpoints/api/tasks/_id_/{_server.ts.js-BE02dpgR.js → _server.ts.js-DcHNA_QH.js} +7 -6
  222. package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/{_server.ts.js-eXiYz0dl.js → _server.ts.js-BIBAGkdF.js} +6 -5
  223. package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/{_server.ts.js-BzPQmqhd.js → _server.ts.js-DXKDhcRn.js} +6 -5
  224. package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/{_server.ts.js-DernPNNa.js → _server.ts.js-BgJD7i53.js} +6 -5
  225. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/{_server.ts.js-CIJerTYj.js → _server.ts.js-CxKGr5ok.js} +6 -5
  226. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/helper/{_server.ts.js-wMw-B2LV.js → _server.ts.js-k2erXAMq.js} +6 -5
  227. package/build/server/chunks/entries/endpoints/api/vault/{_server.ts.js-BQVOZ_2W.js → _server.ts.js-BUmsnNMT.js} +6 -5
  228. package/build/server/chunks/entries/endpoints/api/wheelhouse/source/{_server.ts.js-CBdZ3Hvx.js → _server.ts.js-Dic1r8FA.js} +2 -2
  229. package/build/server/chunks/entries/endpoints/api/wheelhouse/update/{_server.ts.js-BjmmYFHq.js → _server.ts.js-DCDFOP3H.js} +2 -2
  230. package/build/server/chunks/entries/endpoints/api/wheelhouse/upgrade/{_server.ts.js-DxsJBLJe.js → _server.ts.js-DyaR3iKq.js} +2 -2
  231. package/build/server/chunks/entries/endpoints/tasks/_id_/review/{_server.ts.js-DXYaC6o9.js → _server.ts.js-Ds9qnblb.js} +6 -5
  232. package/build/server/chunks/entries/{hooks.server.js-CN-DQ0lm.js → hooks.server.js-BLsrrww8.js} +6 -5
  233. package/build/server/chunks/entries/pages/{_layout.server.ts.js-B3IyG3tO.js → _layout.server.ts.js-CWJXWFa8.js} +2 -2
  234. package/build/server/chunks/entries/pages/{_layout.svelte.js-ClwzCpuE.js → _layout.svelte.js-CuWnZ-US.js} +2 -2
  235. package/build/server/chunks/entries/pages/{_page.server.ts.js-DF3mUKXU.js → _page.server.ts.js-DcIo1Fkt.js} +2 -2
  236. package/build/server/chunks/entries/pages/{_page.svelte.js-DotNRhUC.js → _page.svelte.js-CGR2VowD.js} +33 -19
  237. package/build/server/chunks/entries/pages/decisions/{_page.server.ts.js-BPsRMW1m.js → _page.server.ts.js-Cumc04zT.js} +2 -2
  238. package/build/server/chunks/entries/pages/deck/{_page.server.ts.js-CRoejRrt.js → _page.server.ts.js-BvnBsHnq.js} +2 -2
  239. package/build/server/chunks/entries/pages/deck/{_page.svelte.js-DK__ZtkS.js → _page.svelte.js-zqjb3tWK.js} +5 -5
  240. package/build/server/chunks/entries/pages/files/{_page.server.ts.js-CEQlok_v.js → _page.server.ts.js-DVzHoqMO.js} +2 -2
  241. package/build/server/chunks/entries/pages/harbour/{_page.server.ts.js-aNzCSnrW.js → _page.server.ts.js-BK7WgAXR.js} +2 -2
  242. package/build/server/chunks/entries/pages/headroom/{_page.server.ts.js-DYPjOXZ7.js → _page.server.ts.js-B_et4vbk.js} +2 -2
  243. package/build/server/chunks/entries/pages/inbox/{_page.server.ts.js-CvLRSeh7.js → _page.server.ts.js-DWY01zRh.js} +2 -2
  244. package/build/server/chunks/entries/pages/inbox/{_page.svelte.js-aP2FP_cG.js → _page.svelte.js-DLpzhD2s.js} +3 -3
  245. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/{_page.server.ts.js-CF2qEBQz.js → _page.server.ts.js-Be_vf2s9.js} +2 -2
  246. package/build/server/chunks/entries/pages/projects/_id_/{_page.server.ts.js-Drm6Ahc4.js → _page.server.ts.js-euICzR6h.js} +3 -3
  247. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/{_page.server.ts.js-DdJMUWNL.js → _page.server.ts.js-CO-iqBAD.js} +3 -3
  248. package/build/server/chunks/entries/pages/projects/_id_/passage/{_page.server.ts.js-1GII3zKY.js → _page.server.ts.js-DzQmyVut.js} +4 -4
  249. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/{_page.server.ts.js-CVsOhaVz.js → _page.server.ts.js-ByePQa4g.js} +2 -2
  250. package/build/server/chunks/entries/pages/remotes/{_page.server.ts.js-Cva09MAW.js → _page.server.ts.js-DRj_7nDd.js} +2 -2
  251. package/build/server/chunks/entries/pages/settings/cloud/{_page.server.ts.js-CMMEHMa0.js → _page.server.ts.js-QWGL2-Cn.js} +2 -2
  252. package/build/server/chunks/entries/pages/settings/gateway/{_page.server.ts.js-CaBLC48A.js → _page.server.ts.js-DAOkZ-fE.js} +2 -2
  253. package/build/server/chunks/entries/pages/settings/plugins/{_page.server.ts.js-C80JIole.js → _page.server.ts.js-jeZvTAgT.js} +2 -2
  254. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/{_page.server.ts.js-GcEMXNzE.js → _page.server.ts.js-Bzo5Uals.js} +2 -2
  255. package/build/server/chunks/entries/pages/settings/setup/{_page.server.ts.js-fmudFG1R.js → _page.server.ts.js-1XiCbDhc.js} +2 -2
  256. package/build/server/chunks/entries/pages/settings/update/{_page.server.ts.js-Ck0V4NqF.js → _page.server.ts.js-DwYnrxXG.js} +2 -2
  257. package/build/server/chunks/entries/pages/setup/{_page.server.ts.js-BT2aSao4.js → _page.server.ts.js-DP--6Ko6.js} +3 -3
  258. package/build/server/chunks/entries/pages/setup/{_page.svelte.js-BvrzY0TN.js → _page.svelte.js-CB6DNUFE.js} +108 -85
  259. package/build/server/chunks/entries/pages/tasks/_id_/{_page.server.ts.js-DQ9XiVXC.js → _page.server.ts.js-Dl0z8pkQ.js} +3 -3
  260. package/build/server/chunks/entries/pages/tasks/_id_/{_page.svelte.js-zRkAX1kt.js → _page.svelte.js-Cali_YuK.js} +4 -4
  261. package/build/server/chunks/entries/pages/tasks/_id_/doc/{_page.server.ts.js-DYUzrHEd.js → _page.server.ts.js-CyPpYkuJ.js} +2 -2
  262. package/build/server/chunks/entries/pages/time/{_page.server.ts.js-PjptcjBY.js → _page.server.ts.js-DlcJgtrb.js} +2 -2
  263. package/build/server/chunks/{handler-DhhKWgIp.js → handler-pU2T6cxW.js} +3 -3
  264. package/build/server/chunks/{index.js-utiPQsQj.js → index.js-B3YyBD1_.js} +2 -2
  265. package/build/server/chunks/{manifest.js-1v5Twa8d.js → manifest.js-D3OqJAbv.js} +86 -86
  266. package/build/server/chunks/nodes/{0.js-t5p4uwR-.js → 0.js-DapnlcBu.js} +10 -9
  267. package/build/server/chunks/nodes/{1.js-B23tX379.js → 1.js-B2zVBiHu.js} +2 -2
  268. package/build/server/chunks/nodes/{10.js-BYgrUxes.js → 10.js-CwfaDBrN.js} +2 -2
  269. package/build/server/chunks/nodes/{11.js-D8KeSOxn.js → 11.js-BSKCzLBk.js} +8 -7
  270. package/build/server/chunks/nodes/{12.js-CSqzXf2C.js → 12.js-Cw0R3pzN.js} +9 -8
  271. package/build/server/chunks/nodes/{13.js-BucPbiJc.js → 13.js-1CllvmKU.js} +9 -8
  272. package/build/server/chunks/nodes/{14.js-D5KFW0LX.js → 14.js-Duo10iYX.js} +10 -9
  273. package/build/server/chunks/nodes/{15.js-DMi0cMxP.js → 15.js-yyKjbIPm.js} +9 -8
  274. package/build/server/chunks/nodes/{16.js-garu2VVL.js → 16.js-Bw3O413k.js} +6 -6
  275. package/build/server/chunks/nodes/{17.js-CIGvZ14P.js → 17.js-CKJWbBiG.js} +2 -2
  276. package/build/server/chunks/nodes/{19.js-D0EE2SJv.js → 19.js-gqmNp-1X.js} +6 -6
  277. package/build/server/chunks/nodes/{2.js-CGs6HugM.js → 2.js-DbAE0QSU.js} +9 -8
  278. package/build/server/chunks/nodes/{20.js-CVajTuJ7.js → 20.js-DyVwaMHk.js} +8 -7
  279. package/build/server/chunks/nodes/{21.js-C53DsYbm.js → 21.js-UWLpwye1.js} +8 -7
  280. package/build/server/chunks/nodes/{22.js-IhEljvpJ.js → 22.js-DjQqtx9a.js} +8 -7
  281. package/build/server/chunks/nodes/{23.js-xMwn6OS_.js → 23.js-BRxy911D.js} +9 -8
  282. package/build/server/chunks/nodes/{24.js-Bf2yyWwh.js → 24.js-QS0KOwss.js} +4 -4
  283. package/build/server/chunks/nodes/{25.js-B4yvgFEW.js → 25.js-PQ5YJuMR.js} +10 -9
  284. package/build/server/chunks/nodes/{26.js-BgrkaBRi.js → 26.js-CVgNTrxq.js} +10 -9
  285. package/build/server/chunks/nodes/{27.js-CmaLV07r.js → 27.js-D362fjZ7.js} +8 -7
  286. package/build/server/chunks/nodes/{28.js-D5cRvkTM.js → 28.js-CquKiHnq.js} +8 -7
  287. package/build/server/chunks/nodes/{3.js-Dm2pmcK2.js → 3.js-_ZrsIscU.js} +8 -7
  288. package/build/server/chunks/nodes/{4.js-C4ho5OJp.js → 4.js-CMBAdl6x.js} +9 -8
  289. package/build/server/chunks/nodes/{5.js-y4HoD1YR.js → 5.js-DRAnyeo0.js} +7 -6
  290. package/build/server/chunks/nodes/{6.js-CjlWBc3h.js → 6.js-CWsHGKdF.js} +8 -7
  291. package/build/server/chunks/nodes/{7.js-Bu-qbDJ5.js → 7.js-BzkPQGE-.js} +8 -7
  292. package/build/server/chunks/nodes/{8.js-qv_Z5rCa.js → 8.js-DppreJ1j.js} +9 -8
  293. package/build/server/chunks/nodes/{9.js-txPQIe_t.js → 9.js-CWCKh6Lz.js} +2 -2
  294. package/dist/cli.js +389 -241
  295. package/dist/wh-vault.js +1 -1
  296. package/package.json +1 -1
  297. package/build/client/_app/immutable/assets/0.C7-9O7Er.css +0 -1
  298. package/build/client/_app/immutable/assets/0.C7-9O7Er.css.br +0 -0
  299. package/build/client/_app/immutable/assets/0.C7-9O7Er.css.gz +0 -0
  300. package/build/client/_app/immutable/chunks/60JlvdhQ.js.br +0 -0
  301. package/build/client/_app/immutable/chunks/60JlvdhQ.js.gz +0 -0
  302. package/build/client/_app/immutable/chunks/B-rYWQGG.js.br +0 -0
  303. package/build/client/_app/immutable/chunks/B-rYWQGG.js.gz +0 -0
  304. package/build/client/_app/immutable/chunks/B597Cbe1.js.br +0 -0
  305. package/build/client/_app/immutable/chunks/B597Cbe1.js.gz +0 -0
  306. package/build/client/_app/immutable/chunks/BEKG1Stw.js.br +0 -0
  307. package/build/client/_app/immutable/chunks/BEKG1Stw.js.gz +0 -0
  308. package/build/client/_app/immutable/chunks/BPAziDlG.js.br +0 -0
  309. package/build/client/_app/immutable/chunks/BPAziDlG.js.gz +0 -0
  310. package/build/client/_app/immutable/chunks/BiiAyXOY.js.br +0 -0
  311. package/build/client/_app/immutable/chunks/BiiAyXOY.js.gz +0 -0
  312. package/build/client/_app/immutable/chunks/C69eHrL5.js.br +0 -0
  313. package/build/client/_app/immutable/chunks/C69eHrL5.js.gz +0 -0
  314. package/build/client/_app/immutable/chunks/CC5Ts_xe.js.br +0 -0
  315. package/build/client/_app/immutable/chunks/CC5Ts_xe.js.gz +0 -0
  316. package/build/client/_app/immutable/chunks/CPQbfMGI.js.br +0 -0
  317. package/build/client/_app/immutable/chunks/CPQbfMGI.js.gz +0 -0
  318. package/build/client/_app/immutable/chunks/CSntU4ww.js.br +0 -0
  319. package/build/client/_app/immutable/chunks/CSntU4ww.js.gz +0 -0
  320. package/build/client/_app/immutable/chunks/Cbm0yS9E.js.br +0 -0
  321. package/build/client/_app/immutable/chunks/Cbm0yS9E.js.gz +0 -0
  322. package/build/client/_app/immutable/chunks/ChjkQemt.js.br +0 -0
  323. package/build/client/_app/immutable/chunks/ChjkQemt.js.gz +0 -0
  324. package/build/client/_app/immutable/chunks/CvZklcJq.js.br +0 -0
  325. package/build/client/_app/immutable/chunks/CvZklcJq.js.gz +0 -0
  326. package/build/client/_app/immutable/chunks/DSAFUgJn.js.br +0 -0
  327. package/build/client/_app/immutable/chunks/DSAFUgJn.js.gz +0 -0
  328. package/build/client/_app/immutable/chunks/DVeiiKip.js.br +0 -0
  329. package/build/client/_app/immutable/chunks/DVeiiKip.js.gz +0 -0
  330. package/build/client/_app/immutable/chunks/DjCsArDj.js.br +0 -0
  331. package/build/client/_app/immutable/chunks/DjCsArDj.js.gz +0 -0
  332. package/build/client/_app/immutable/chunks/DnBZO8Il.js.br +0 -0
  333. package/build/client/_app/immutable/chunks/DnBZO8Il.js.gz +0 -0
  334. package/build/client/_app/immutable/chunks/Gbvs-EZ4.js.br +0 -1
  335. package/build/client/_app/immutable/chunks/Gbvs-EZ4.js.gz +0 -0
  336. package/build/client/_app/immutable/chunks/IKqZ9EUq.js.br +0 -0
  337. package/build/client/_app/immutable/chunks/IKqZ9EUq.js.gz +0 -0
  338. package/build/client/_app/immutable/chunks/rZ2-WaWD.js.br +0 -0
  339. package/build/client/_app/immutable/chunks/rZ2-WaWD.js.gz +0 -0
  340. package/build/client/_app/immutable/chunks/wU4H_Xw3.js +0 -1
  341. package/build/client/_app/immutable/chunks/wU4H_Xw3.js.br +0 -0
  342. package/build/client/_app/immutable/chunks/wU4H_Xw3.js.gz +0 -0
  343. package/build/client/_app/immutable/entry/app.ERrI8AQ5.js +0 -2
  344. package/build/client/_app/immutable/entry/app.ERrI8AQ5.js.br +0 -0
  345. package/build/client/_app/immutable/entry/app.ERrI8AQ5.js.gz +0 -0
  346. package/build/client/_app/immutable/entry/start.Dw33pepJ.js +0 -1
  347. package/build/client/_app/immutable/entry/start.Dw33pepJ.js.br +0 -0
  348. package/build/client/_app/immutable/entry/start.Dw33pepJ.js.gz +0 -0
  349. package/build/client/_app/immutable/nodes/0.CPXJEdVC.js.br +0 -0
  350. package/build/client/_app/immutable/nodes/0.CPXJEdVC.js.gz +0 -0
  351. package/build/client/_app/immutable/nodes/1.BsHjzKoN.js.br +0 -0
  352. package/build/client/_app/immutable/nodes/1.BsHjzKoN.js.gz +0 -0
  353. package/build/client/_app/immutable/nodes/10.JvkeSj5x.js.br +0 -0
  354. package/build/client/_app/immutable/nodes/10.JvkeSj5x.js.gz +0 -0
  355. package/build/client/_app/immutable/nodes/11.C9viE404.js.br +0 -0
  356. package/build/client/_app/immutable/nodes/11.C9viE404.js.gz +0 -0
  357. package/build/client/_app/immutable/nodes/12.BWVqITW1.js.br +0 -0
  358. package/build/client/_app/immutable/nodes/12.BWVqITW1.js.gz +0 -0
  359. package/build/client/_app/immutable/nodes/13.D0u53Jpp.js.br +0 -0
  360. package/build/client/_app/immutable/nodes/13.D0u53Jpp.js.gz +0 -0
  361. package/build/client/_app/immutable/nodes/14.CNClDl2g.js.br +0 -0
  362. package/build/client/_app/immutable/nodes/14.CNClDl2g.js.gz +0 -0
  363. package/build/client/_app/immutable/nodes/15.BJShjxpx.js.br +0 -0
  364. package/build/client/_app/immutable/nodes/15.BJShjxpx.js.gz +0 -0
  365. package/build/client/_app/immutable/nodes/16.Bb3PPsch.js.br +0 -0
  366. package/build/client/_app/immutable/nodes/16.Bb3PPsch.js.gz +0 -0
  367. package/build/client/_app/immutable/nodes/17.COjMgZvi.js.br +0 -0
  368. package/build/client/_app/immutable/nodes/17.COjMgZvi.js.gz +0 -0
  369. package/build/client/_app/immutable/nodes/19.BbeSGQyg.js.br +0 -0
  370. package/build/client/_app/immutable/nodes/19.BbeSGQyg.js.gz +0 -0
  371. package/build/client/_app/immutable/nodes/2.CBjl08IG.js +0 -25
  372. package/build/client/_app/immutable/nodes/2.CBjl08IG.js.br +0 -0
  373. package/build/client/_app/immutable/nodes/2.CBjl08IG.js.gz +0 -0
  374. package/build/client/_app/immutable/nodes/20.2D2FCLQq.js.br +0 -0
  375. package/build/client/_app/immutable/nodes/20.2D2FCLQq.js.gz +0 -0
  376. package/build/client/_app/immutable/nodes/21.xQ_KUjAi.js.br +0 -0
  377. package/build/client/_app/immutable/nodes/21.xQ_KUjAi.js.gz +0 -0
  378. package/build/client/_app/immutable/nodes/22.DuszjIrq.js.br +0 -0
  379. package/build/client/_app/immutable/nodes/22.DuszjIrq.js.gz +0 -0
  380. package/build/client/_app/immutable/nodes/23.CKoLeDhM.js.br +0 -0
  381. package/build/client/_app/immutable/nodes/23.CKoLeDhM.js.gz +0 -0
  382. package/build/client/_app/immutable/nodes/24.CH1byq7o.js.br +0 -0
  383. package/build/client/_app/immutable/nodes/24.CH1byq7o.js.gz +0 -0
  384. package/build/client/_app/immutable/nodes/25.BFrDgbR3.js +0 -12
  385. package/build/client/_app/immutable/nodes/25.BFrDgbR3.js.br +0 -0
  386. package/build/client/_app/immutable/nodes/25.BFrDgbR3.js.gz +0 -0
  387. package/build/client/_app/immutable/nodes/26.CHB__H6C.js.br +0 -0
  388. package/build/client/_app/immutable/nodes/26.CHB__H6C.js.gz +0 -0
  389. package/build/client/_app/immutable/nodes/28.pI-7Vnsb.js.br +0 -0
  390. package/build/client/_app/immutable/nodes/28.pI-7Vnsb.js.gz +0 -0
  391. package/build/client/_app/immutable/nodes/3.6gLsJ5iP.js.br +0 -0
  392. package/build/client/_app/immutable/nodes/3.6gLsJ5iP.js.gz +0 -0
  393. package/build/client/_app/immutable/nodes/4.uKPQRIJV.js.br +0 -0
  394. package/build/client/_app/immutable/nodes/4.uKPQRIJV.js.gz +0 -0
  395. package/build/client/_app/immutable/nodes/6.CmppqGHA.js.br +0 -0
  396. package/build/client/_app/immutable/nodes/6.CmppqGHA.js.gz +0 -0
  397. package/build/client/_app/immutable/nodes/7.DDZOqRAy.js.br +0 -0
  398. package/build/client/_app/immutable/nodes/7.DDZOqRAy.js.gz +0 -0
  399. package/build/client/_app/immutable/nodes/8.DH6CiiFf.js.br +0 -0
  400. package/build/client/_app/immutable/nodes/8.DH6CiiFf.js.gz +0 -0
  401. package/build/client/_app/immutable/nodes/9.jlOFlXh8.js.br +0 -0
  402. package/build/client/_app/immutable/nodes/9.jlOFlXh8.js.gz +0 -0
package/dist/cli.js CHANGED
@@ -4,58 +4,31 @@
4
4
  import { fork, spawn as spawn4 } from "node:child_process";
5
5
  import { existsSync as existsSync3 } from "node:fs";
6
6
  import { createServer } from "node:http";
7
- import path18 from "node:path";
7
+ import path20 from "node:path";
8
8
  import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
9
9
  import { Command as Command5, InvalidArgumentError as InvalidArgumentError3 } from "commander";
10
10
 
11
11
  // package.json
12
- var version = "0.11.0";
13
-
14
- // src/lib/chat/attachments.ts
15
- var UPLOAD_MAX_BYTES = 25 * 1024 * 1024;
16
- var UNIT = { B: 1, KB: 1024, MB: 1024 * 1024 };
12
+ var version = "0.12.0";
17
13
 
18
- // src/lib/hosted.ts
19
- var PREVIEW_URL_ENV = "WHEELHOUSE_PREVIEW_URL";
20
- function previewPattern(raw) {
21
- if (typeof raw !== "string") return null;
22
- const v = raw.trim();
23
- if (v.length > 300 || v.split("{port}").length !== 2) return null;
24
- const m = /^https?:\/\/([a-z0-9.-]*(?:\{port\}[a-z0-9.-]*)?)(?::\d{1,5})?(\/[^?#]*)?$/i.exec(v);
25
- if (!m) return null;
26
- const u = URL.parse(v.replace("{port}", "1"));
27
- return u && u.hostname === m[1].replace("{port}", "1").toLowerCase() ? v : null;
28
- }
29
- function workspaceHost(raw) {
30
- const u = URL.parse(raw?.trim() ?? "");
31
- if (!u || u.protocol !== "https:" || u.username || u.password || u.port) return null;
32
- return /^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/i.test(u.hostname) ? u.hostname.toLowerCase() : null;
33
- }
34
- function detectHosted(env) {
35
- const set = env[PREVIEW_URL_ENV]?.trim();
36
- let problem = null;
37
- if (set) {
38
- if (set.toLowerCase() === "off") return { hosted: null, problem: null };
39
- const pattern = previewPattern(set);
40
- if (pattern) return { hosted: { pattern, source: "configured" }, problem: null };
41
- problem = `${PREVIEW_URL_ENV} is not a preview URL pattern (an http(s) URL with {port} once in its host or path, such as https://{port}.example.dev), so it is ignored.`;
42
- }
43
- const gitpod = workspaceHost(env.GITPOD_WORKSPACE_URL);
44
- if (gitpod) return { hosted: { pattern: `https://{port}-${gitpod}`, source: "gitpod" }, problem };
45
- const name = env.CODESPACE_NAME?.trim().toLowerCase();
46
- const domain = env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN?.trim().toLowerCase();
47
- if (name && domain && /^[a-z0-9-]+$/.test(name) && /^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/.test(domain)) {
48
- return {
49
- hosted: { pattern: `https://${name}-{port}.${domain}`, source: "codespaces" },
50
- problem
51
- };
52
- }
53
- return { hosted: null, problem };
14
+ // src/lib/harness.ts
15
+ var HARNESSES = ["claude", "codex", "opencode", "pi"];
16
+ function parseHarness(value = "claude") {
17
+ const harness = HARNESSES.find((name) => name === value);
18
+ if (!harness)
19
+ throw new Error(`Unknown harness ${JSON.stringify(value)}. Choose ${HARNESSES.join(", ")}.`);
20
+ return harness;
54
21
  }
55
22
 
56
- // src/lib/server/firstmate/install.ts
57
- import { access, constants, open, stat } from "node:fs/promises";
58
- import { existsSync, statSync } from "node:fs";
23
+ // cli/harness.ts
24
+ import { spawnSync } from "node:child_process";
25
+ import { randomBytes } from "node:crypto";
26
+ import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
27
+ import path2 from "node:path";
28
+ import { createInterface } from "node:readline/promises";
29
+
30
+ // src/lib/server/sessions/tmux.ts
31
+ import { accessSync, constants, statSync } from "node:fs";
59
32
  import path from "node:path";
60
33
 
61
34
  // src/lib/server/firstmate/exec.ts
@@ -213,7 +186,167 @@ function runBounded(file, args, opts) {
213
186
  });
214
187
  }
215
188
 
189
+ // src/lib/server/sessions/tmux.ts
190
+ function which(name, envPath) {
191
+ for (const dir of (envPath ?? "").split(path.delimiter)) {
192
+ if (!dir) continue;
193
+ const file = path.join(dir, name);
194
+ try {
195
+ accessSync(file, constants.X_OK);
196
+ if (statSync(file).isFile()) return file;
197
+ } catch {
198
+ }
199
+ }
200
+ return null;
201
+ }
202
+ var PASTE_MAX_INPUT_BYTES = 65 * 1024;
203
+
204
+ // cli/harness.ts
205
+ async function savedHarness(file) {
206
+ let text2;
207
+ try {
208
+ text2 = await readFile(file, "utf8");
209
+ } catch (error) {
210
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") return null;
211
+ throw new Error(`Cannot read ${file}. Check its permissions.`, { cause: error });
212
+ }
213
+ try {
214
+ const value = JSON.parse(text2);
215
+ if (!value || typeof value !== "object" || !("harness" in value) || typeof value.harness !== "string") {
216
+ throw new Error("Expected an object with a harness name.");
217
+ }
218
+ return parseHarness(value.harness);
219
+ } catch (error) {
220
+ throw new Error(
221
+ `Invalid saved tool choice in ${file}. Set --harness to replace it, or edit or remove this file.`,
222
+ { cause: error }
223
+ );
224
+ }
225
+ }
226
+ async function saveHarness(file, harness) {
227
+ await mkdir(path2.dirname(file), { recursive: true, mode: 448 });
228
+ const temporary = `${file}.${process.pid}.${randomBytes(8).toString("hex")}.tmp`;
229
+ try {
230
+ await writeFile(temporary, `${JSON.stringify({ harness })}
231
+ `, { flag: "wx", mode: 384 });
232
+ await rename(temporary, file);
233
+ } finally {
234
+ await rm(temporary, { force: true });
235
+ }
236
+ }
237
+ async function chooseHarness(installed, find, env) {
238
+ const fzf = find("fzf");
239
+ if (fzf) {
240
+ const result = spawnSync(fzf, ["--prompt=Firstmate tool > ", "--height=~10", "--no-multi"], {
241
+ input: `${installed.join("\n")}
242
+ `,
243
+ encoding: "utf8",
244
+ env,
245
+ stdio: ["pipe", "pipe", "inherit"]
246
+ });
247
+ if (result.error) throw result.error;
248
+ if (result.status === 1 || result.status === 130 || result.signal === "SIGINT") return null;
249
+ if (result.status !== 0)
250
+ throw new Error("The tool picker failed. Run again with --harness <name>.");
251
+ return result.stdout.trim() || null;
252
+ }
253
+ const input = createInterface({ input: process.stdin, output: process.stdout });
254
+ const controller = new AbortController();
255
+ input.once("SIGINT", () => controller.abort());
256
+ input.once("close", () => controller.abort());
257
+ try {
258
+ const choices = installed.map((name, index) => `${index + 1}. ${name}`).join("\n");
259
+ const answer = (await input.question(`Choose Firstmate's tool:
260
+ ${choices}
261
+ Number (blank to cancel): `, {
262
+ signal: controller.signal
263
+ })).trim();
264
+ if (!answer) return null;
265
+ const choice = /^\d+$/.test(answer) ? installed[Number(answer) - 1] : void 0;
266
+ if (!choice)
267
+ throw new Error(`Choose a number from 1 to ${installed.length}, or use --harness <name>.`);
268
+ return choice;
269
+ } catch (error) {
270
+ if (controller.signal.aborted) return null;
271
+ throw error;
272
+ } finally {
273
+ input.close();
274
+ }
275
+ }
276
+ async function resolveHarness(options2) {
277
+ const { env } = options2;
278
+ const file = path2.join(options2.configDir, "harness.json");
279
+ const requested = options2.explicit ?? env.WHEELHOUSE_HARNESS;
280
+ if (requested !== void 0) {
281
+ const harness2 = parseHarness(requested);
282
+ await saveHarness(file, harness2);
283
+ return harness2;
284
+ }
285
+ const saved = await savedHarness(file);
286
+ if (saved) return saved;
287
+ const interactive = options2.interactive ?? (process.stdin.isTTY === true && process.stdout.isTTY === true);
288
+ if (!interactive) return "claude";
289
+ const find = options2.find ?? ((name) => which(name, env.PATH));
290
+ const installed = HARNESSES.filter((harness2) => find(harness2));
291
+ if (!installed.length) return "claude";
292
+ const selected = installed.length === 1 ? installed[0] : await (options2.choose ?? ((choices) => chooseHarness(choices, find, env)))(installed);
293
+ if (selected === null)
294
+ throw new Error("Tool selection cancelled. No Firstmate session was started.");
295
+ const harness = installed.find((name) => name === selected);
296
+ if (!harness)
297
+ throw new Error(
298
+ "The selected tool is not installed. Choose an installed tool or use --harness <name>."
299
+ );
300
+ await saveHarness(file, harness);
301
+ return harness;
302
+ }
303
+
304
+ // src/lib/chat/attachments.ts
305
+ var UPLOAD_MAX_BYTES = 25 * 1024 * 1024;
306
+ var UNIT = { B: 1, KB: 1024, MB: 1024 * 1024 };
307
+
308
+ // src/lib/hosted.ts
309
+ var PREVIEW_URL_ENV = "WHEELHOUSE_PREVIEW_URL";
310
+ function previewPattern(raw) {
311
+ if (typeof raw !== "string") return null;
312
+ const v = raw.trim();
313
+ if (v.length > 300 || v.split("{port}").length !== 2) return null;
314
+ const m = /^https?:\/\/([a-z0-9.-]*(?:\{port\}[a-z0-9.-]*)?)(?::\d{1,5})?(\/[^?#]*)?$/i.exec(v);
315
+ if (!m) return null;
316
+ const u = URL.parse(v.replace("{port}", "1"));
317
+ return u && u.hostname === m[1].replace("{port}", "1").toLowerCase() ? v : null;
318
+ }
319
+ function workspaceHost(raw) {
320
+ const u = URL.parse(raw?.trim() ?? "");
321
+ if (!u || u.protocol !== "https:" || u.username || u.password || u.port) return null;
322
+ return /^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/i.test(u.hostname) ? u.hostname.toLowerCase() : null;
323
+ }
324
+ function detectHosted(env) {
325
+ const set = env[PREVIEW_URL_ENV]?.trim();
326
+ let problem = null;
327
+ if (set) {
328
+ if (set.toLowerCase() === "off") return { hosted: null, problem: null };
329
+ const pattern = previewPattern(set);
330
+ if (pattern) return { hosted: { pattern, source: "configured" }, problem: null };
331
+ problem = `${PREVIEW_URL_ENV} is not a preview URL pattern (an http(s) URL with {port} once in its host or path, such as https://{port}.example.dev), so it is ignored.`;
332
+ }
333
+ const gitpod = workspaceHost(env.GITPOD_WORKSPACE_URL);
334
+ if (gitpod) return { hosted: { pattern: `https://{port}-${gitpod}`, source: "gitpod" }, problem };
335
+ const name = env.CODESPACE_NAME?.trim().toLowerCase();
336
+ const domain = env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN?.trim().toLowerCase();
337
+ if (name && domain && /^[a-z0-9-]+$/.test(name) && /^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/.test(domain)) {
338
+ return {
339
+ hosted: { pattern: `https://${name}-{port}.${domain}`, source: "codespaces" },
340
+ problem
341
+ };
342
+ }
343
+ return { hosted: null, problem };
344
+ }
345
+
216
346
  // src/lib/server/firstmate/install.ts
347
+ import { access, constants as constants2, open, stat } from "node:fs/promises";
348
+ import { existsSync, statSync as statSync2 } from "node:fs";
349
+ import path3 from "node:path";
217
350
  var MESSAGING_PURPOSE = "messages to Firstmate";
218
351
  var SUPPORTED_SCRIPTS = [
219
352
  {
@@ -242,10 +375,10 @@ var SUPPORTED_SCRIPTS = [
242
375
  purpose: "worker terminal output"
243
376
  }
244
377
  ];
245
- var scriptPath = (firstmateDir, name) => path.join(firstmateDir, "bin", name);
378
+ var scriptPath = (firstmateDir, name) => path3.join(firstmateDir, "bin", name);
246
379
  var isDir = (p) => {
247
380
  try {
248
- return statSync(p).isDirectory();
381
+ return statSync2(p).isDirectory();
249
382
  } catch {
250
383
  return false;
251
384
  }
@@ -254,15 +387,15 @@ function looksLikeFirstmate(dir) {
254
387
  return existsSync(scriptPath(dir, "fm-fleet-snapshot.sh"));
255
388
  }
256
389
  function findFirstmateDir(start) {
257
- let dir = path.resolve(start);
390
+ let dir = path3.resolve(start);
258
391
  for (; ; ) {
259
392
  if (looksLikeFirstmate(dir)) return dir;
260
- const parent = path.dirname(dir);
393
+ const parent = path3.dirname(dir);
261
394
  if (parent === dir) return null;
262
395
  dir = parent;
263
396
  }
264
397
  }
265
- var expandHome = (p, env) => p === "~" || p.startsWith("~/") ? path.join(env.HOME ?? "", p.slice(1)) : p;
398
+ var expandHome = (p, env) => p === "~" || p.startsWith("~/") ? path3.join(env.HOME ?? "", p.slice(1)) : p;
266
399
  function notFirstmate(dir) {
267
400
  if (!isDir(dir)) return `Firstmate directory not found: ${dir}`;
268
401
  if (!looksLikeFirstmate(dir)) {
@@ -275,7 +408,7 @@ function resolveInstall(input) {
275
408
  let firstmateDir;
276
409
  let source;
277
410
  if (input.firstmate) {
278
- firstmateDir = path.resolve(input.cwd, expandHome(input.firstmate, input.env));
411
+ firstmateDir = path3.resolve(input.cwd, expandHome(input.firstmate, input.env));
279
412
  const wrong = notFirstmate(firstmateDir);
280
413
  if (wrong) return { ok: false, error: wrong, missing: false };
281
414
  source = "flag";
@@ -286,7 +419,7 @@ function resolveInstall(input) {
286
419
  source = "cwd";
287
420
  notes.push(`Found Firstmate at ${firstmateDir}`);
288
421
  } else if (input.remembered) {
289
- firstmateDir = path.resolve(input.remembered.firstmate);
422
+ firstmateDir = path3.resolve(input.remembered.firstmate);
290
423
  const wrong = notFirstmate(firstmateDir);
291
424
  if (wrong) {
292
425
  return {
@@ -307,12 +440,12 @@ function resolveInstall(input) {
307
440
  }
308
441
  let homeDir;
309
442
  if (input.home) {
310
- homeDir = path.resolve(input.cwd, expandHome(input.home, input.env));
443
+ homeDir = path3.resolve(input.cwd, expandHome(input.home, input.env));
311
444
  } else if (input.env.FM_HOME) {
312
- homeDir = path.resolve(input.cwd, expandHome(input.env.FM_HOME, input.env));
445
+ homeDir = path3.resolve(input.cwd, expandHome(input.env.FM_HOME, input.env));
313
446
  notes.push(`Using the operational home from FM_HOME: ${homeDir}`);
314
447
  } else if (source === "remembered" && input.remembered?.home) {
315
- homeDir = path.resolve(input.remembered.home);
448
+ homeDir = path3.resolve(input.remembered.home);
316
449
  } else {
317
450
  homeDir = firstmateDir;
318
451
  }
@@ -320,7 +453,7 @@ function resolveInstall(input) {
320
453
  if (!isDir(homeDir)) {
321
454
  return { ok: false, error: `Firstmate home not found: ${homeDir}`, missing: !flagged };
322
455
  }
323
- if (!isDir(path.join(homeDir, "state"))) {
456
+ if (!isDir(path3.join(homeDir, "state"))) {
324
457
  return {
325
458
  ok: false,
326
459
  error: `${homeDir} is not a Firstmate operational home (it has no state/ directory). Pass --home <dir>.`,
@@ -350,7 +483,7 @@ async function checkScript(firstmateDir, s) {
350
483
  return { ...base, ok: false, problem: `${s.name} is missing` };
351
484
  }
352
485
  try {
353
- await access(file, constants.X_OK);
486
+ await access(file, constants2.X_OK);
354
487
  } catch {
355
488
  return { ...base, ok: false, problem: `${s.name} is not executable` };
356
489
  }
@@ -443,13 +576,13 @@ function defaultKeychain() {
443
576
  }
444
577
 
445
578
  // src/lib/server/plugins/config.ts
446
- import { mkdir, readFile, rename, stat as stat2, writeFile } from "node:fs/promises";
579
+ import { mkdir as mkdir2, readFile as readFile2, rename as rename2, stat as stat2, writeFile as writeFile2 } from "node:fs/promises";
447
580
  import { homedir } from "node:os";
448
- import path2 from "node:path";
581
+ import path4 from "node:path";
449
582
  function defaultConfigDir(env) {
450
- if (env.WHEELHOUSE_CONFIG_DIR) return path2.resolve(env.WHEELHOUSE_CONFIG_DIR);
451
- if (env.XDG_CONFIG_HOME) return path2.join(env.XDG_CONFIG_HOME, "wheelhouse");
452
- return path2.join(homedir(), ".config", "wheelhouse");
583
+ if (env.WHEELHOUSE_CONFIG_DIR) return path4.resolve(env.WHEELHOUSE_CONFIG_DIR);
584
+ if (env.XDG_CONFIG_HOME) return path4.join(env.XDG_CONFIG_HOME, "wheelhouse");
585
+ return path4.join(homedir(), ".config", "wheelhouse");
453
586
  }
454
587
  var PLUGINS_FILE = "plugins.json";
455
588
  var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
@@ -499,7 +632,7 @@ function parsePluginConfig(text2) {
499
632
  async function readRaw(file) {
500
633
  let text2;
501
634
  try {
502
- text2 = await readFile(file, "utf8");
635
+ text2 = await readFile2(file, "utf8");
503
636
  } catch (e) {
504
637
  if (e.code === "ENOENT") return { ok: true, raw: null };
505
638
  return { ok: false, error: `could not read ${file}: ${e.message}` };
@@ -509,7 +642,7 @@ async function readRaw(file) {
509
642
  return { ok: true, raw: JSON.parse(text2) };
510
643
  }
511
644
  async function readPluginSettings(dir, id) {
512
- const r = await readRaw(path2.join(dir, PLUGINS_FILE));
645
+ const r = await readRaw(path4.join(dir, PLUGINS_FILE));
513
646
  if (!r.ok) return r;
514
647
  const plugins = r.raw?.plugins ?? {};
515
648
  return { ok: true, settings: { ...plugins[id]?.settings ?? {} } };
@@ -517,7 +650,7 @@ async function readPluginSettings(dir, id) {
517
650
  var editing = Promise.resolve();
518
651
  function editPlugin(dir, id, change) {
519
652
  const run = editing.then(async () => {
520
- const file = path2.join(dir, PLUGINS_FILE);
653
+ const file = path4.join(dir, PLUGINS_FILE);
521
654
  const r = await readRaw(file);
522
655
  if (!r.ok) return r;
523
656
  const raw = r.raw ?? {};
@@ -528,11 +661,11 @@ function editPlugin(dir, id, change) {
528
661
  else delete plugins[id];
529
662
  raw.plugins = plugins;
530
663
  try {
531
- await mkdir(dir, { recursive: true });
664
+ await mkdir2(dir, { recursive: true });
532
665
  const tmp = `${file}.${process.pid}.tmp`;
533
- await writeFile(tmp, `${JSON.stringify(raw, null, " ")}
666
+ await writeFile2(tmp, `${JSON.stringify(raw, null, " ")}
534
667
  `);
535
- await rename(tmp, file);
668
+ await rename2(tmp, file);
536
669
  } catch (e) {
537
670
  return { ok: false, error: `could not write ${file}: ${e.message}` };
538
671
  }
@@ -549,25 +682,25 @@ function writePluginSettings(dir, id, settings2) {
549
682
  }
550
683
 
551
684
  // src/lib/server/cloud/settings.ts
552
- import { createHash as createHash3, randomBytes as randomBytes2 } from "node:crypto";
685
+ import { createHash as createHash3, randomBytes as randomBytes3 } from "node:crypto";
553
686
  import {
554
687
  chmod,
555
688
  lstat,
556
- mkdir as mkdir2,
557
- readFile as readFile2,
689
+ mkdir as mkdir3,
690
+ readFile as readFile3,
558
691
  realpath,
559
- rename as rename2,
560
- rm,
692
+ rename as rename3,
693
+ rm as rm2,
561
694
  stat as stat3,
562
- writeFile as writeFile2
695
+ writeFile as writeFile3
563
696
  } from "node:fs/promises";
564
- import path3 from "node:path";
697
+ import path5 from "node:path";
565
698
 
566
699
  // src/lib/cloud.ts
567
700
  var DEFAULT_GATEWAY = "https://cloud.chrisjowen.net";
568
701
 
569
702
  // src/lib/server/cloud/passkeys.ts
570
- import { createHash as createHash2, createPublicKey as createPublicKey2, randomBytes, verify } from "node:crypto";
703
+ import { createHash as createHash2, createPublicKey as createPublicKey2, randomBytes as randomBytes2, verify } from "node:crypto";
571
704
 
572
705
  // src/lib/server/cloud/protocol.ts
573
706
  import {
@@ -696,8 +829,8 @@ var HOP_BY_HOP = /* @__PURE__ */ new Set([
696
829
  "transfer-encoding",
697
830
  "upgrade"
698
831
  ]);
699
- function isRestartPath(path19) {
700
- let p = path19.split(/[?#]/, 1)[0];
832
+ function isRestartPath(path21) {
833
+ let p = path21.split(/[?#]/, 1)[0];
701
834
  for (let i = 0; i < 3; i++) {
702
835
  try {
703
836
  const d = decodeURIComponent(p);
@@ -757,7 +890,7 @@ var TAGS = {
757
890
  pins: Buffer.from("whc-pins-v2\n", "utf8")
758
891
  };
759
892
  function newChallenge(purpose) {
760
- return Buffer.concat([TAGS[purpose], randomBytes(32)]).toString("base64url");
893
+ return Buffer.concat([TAGS[purpose], randomBytes2(32)]).toString("base64url");
761
894
  }
762
895
  function assertionProblem(assertion, expected2) {
763
896
  if (typeof assertion !== "object" || assertion === null) return "no passkey signature";
@@ -997,7 +1130,7 @@ var CLOUD_SETTINGS_SCHEMA = "wheelhouse-cloud-settings.v1";
997
1130
  var CLOUD_STATUS_SCHEMA = "wheelhouse-cloud-status.v1";
998
1131
  var CLOUD_KEYCHAIN_SERVICE = "wheelhouse-cloud";
999
1132
  var lapsed = (p, now = Date.now()) => !(now - Date.parse(p.requestedAt) <= PENDING_PINS_MS);
1000
- var cloudDir = (configDir) => path3.join(configDir, "cloud");
1133
+ var cloudDir = (configDir) => path5.join(configDir, "cloud");
1001
1134
  var LOOPBACK = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]"]);
1002
1135
  function gatewayOrigin(raw) {
1003
1136
  const u = URL.parse(raw.trim());
@@ -1085,13 +1218,13 @@ function parseSessions(v) {
1085
1218
  });
1086
1219
  }
1087
1220
  async function writeAtomic(file, text2) {
1088
- await mkdir2(path3.dirname(file), { recursive: true, mode: 448 });
1089
- const tmp = `${file}.tmp-${process.pid}-${randomBytes2(4).toString("hex")}`;
1221
+ await mkdir3(path5.dirname(file), { recursive: true, mode: 448 });
1222
+ const tmp = `${file}.tmp-${process.pid}-${randomBytes3(4).toString("hex")}`;
1090
1223
  try {
1091
- await writeFile2(tmp, text2, { mode: 384 });
1092
- await rename2(tmp, file);
1224
+ await writeFile3(tmp, text2, { mode: 384 });
1225
+ await rename3(tmp, file);
1093
1226
  } catch (e) {
1094
- await rm(tmp, { force: true });
1227
+ await rm2(tmp, { force: true });
1095
1228
  throw e;
1096
1229
  }
1097
1230
  }
@@ -1112,13 +1245,13 @@ var CloudSettings = class {
1112
1245
  dir;
1113
1246
  keychain;
1114
1247
  get file() {
1115
- return path3.join(this.dir, "settings.json");
1248
+ return path5.join(this.dir, "settings.json");
1116
1249
  }
1117
1250
  get keyFile() {
1118
- return path3.join(this.dir, "device.key");
1251
+ return path5.join(this.dir, "device.key");
1119
1252
  }
1120
1253
  get statusFile() {
1121
- return path3.join(this.dir, "status.json");
1254
+ return path5.join(this.dir, "status.json");
1122
1255
  }
1123
1256
  /** The settings, with defaults (off, not started, the default gateway, no device) for anything missing or unreadable, with why. */
1124
1257
  async read() {
@@ -1130,7 +1263,7 @@ var CloudSettings = class {
1130
1263
  };
1131
1264
  let text2;
1132
1265
  try {
1133
- text2 = await readFile2(this.file, "utf8");
1266
+ text2 = await readFile3(this.file, "utf8");
1134
1267
  } catch (e) {
1135
1268
  if (e.code === "ENOENT") return { settings: settings2, error: null };
1136
1269
  return { settings: settings2, error: `${this.file} could not be read: ${e.message}` };
@@ -1169,7 +1302,7 @@ var CloudSettings = class {
1169
1302
  }
1170
1303
  /** The Keychain account for this directory's device key, so each config directory has its own. */
1171
1304
  async keychainAccount() {
1172
- const real2 = await realpath(this.dir).catch(() => path3.resolve(this.dir));
1305
+ const real2 = await realpath(this.dir).catch(() => path5.resolve(this.dir));
1173
1306
  return `device:${createHash3("sha256").update(real2).digest("hex").slice(0, 16)}`;
1174
1307
  }
1175
1308
  /** The device key and where it is kept: the Keychain first, then the file. */
@@ -1181,7 +1314,7 @@ var CloudSettings = class {
1181
1314
  const s = await lstat(this.keyFile);
1182
1315
  if (!s.isFile()) return null;
1183
1316
  if ((s.mode & 63) !== 0) await chmod(this.keyFile, 384);
1184
- const key = importKey(await readFile2(this.keyFile, "utf8"));
1317
+ const key = importKey(await readFile3(this.keyFile, "utf8"));
1185
1318
  return key ? { key, where: this.keyFile } : null;
1186
1319
  } catch {
1187
1320
  return null;
@@ -1189,7 +1322,7 @@ var CloudSettings = class {
1189
1322
  }
1190
1323
  /** Keep the key in the Keychain, else in its file, replacing any before; returns where it went. */
1191
1324
  async setKey(key) {
1192
- await mkdir2(this.dir, { recursive: true, mode: 448 });
1325
+ await mkdir3(this.dir, { recursive: true, mode: 448 });
1193
1326
  const stored = exportKey(key);
1194
1327
  const account = await this.keychainAccount();
1195
1328
  const kept = this.keychain ? await this.keychain.set(account, stored).then(
@@ -1197,7 +1330,7 @@ var CloudSettings = class {
1197
1330
  () => false
1198
1331
  ) : false;
1199
1332
  if (kept) {
1200
- await rm(this.keyFile, { force: true });
1333
+ await rm2(this.keyFile, { force: true });
1201
1334
  return this.keychain.where;
1202
1335
  }
1203
1336
  await this.keychain?.remove(account).catch(() => false);
@@ -1210,7 +1343,7 @@ var CloudSettings = class {
1210
1343
  /** Forget this machine's device: its key wherever it is kept, and its record, and stop remote access. */
1211
1344
  async forget() {
1212
1345
  await this.keychain?.remove(await this.keychainAccount()).catch(() => false);
1213
- await rm(this.keyFile, { force: true });
1346
+ await rm2(this.keyFile, { force: true });
1214
1347
  await this.update((s) => {
1215
1348
  s.device = null;
1216
1349
  s.started = false;
@@ -1266,7 +1399,7 @@ var CloudSettings = class {
1266
1399
  }
1267
1400
  async readStatus() {
1268
1401
  try {
1269
- const v = JSON.parse(await readFile2(this.statusFile, "utf8"));
1402
+ const v = JSON.parse(await readFile3(this.statusFile, "utf8"));
1270
1403
  if (!isObj(v) || v.schema !== CLOUD_STATUS_SCHEMA || typeof v.pid !== "number") return null;
1271
1404
  const state = v.state === "online" || v.state === "stopped" ? v.state : "connecting";
1272
1405
  return {
@@ -1361,7 +1494,7 @@ function cloudKeychain() {
1361
1494
  }
1362
1495
 
1363
1496
  // src/lib/server/cloud/service.ts
1364
- import { randomBytes as randomBytes3 } from "node:crypto";
1497
+ import { randomBytes as randomBytes4 } from "node:crypto";
1365
1498
 
1366
1499
  // src/lib/server/cloud/connector.ts
1367
1500
  import WebSocket2 from "ws";
@@ -1610,8 +1743,8 @@ var Relay = class {
1610
1743
  if (this.streams.size >= this.opts.limits.maxStreams) return { ok: false, code: "limit" };
1611
1744
  const relay = parseRelay(msg.relay);
1612
1745
  const headers = parseHeaders(msg.headers);
1613
- const path19 = msg.path;
1614
- if (!relay || !headers || typeof path19 !== "string" || !path19.startsWith("/") || path19.length > 8192 || !headerSafe(path19) || path19.includes(" ")) {
1746
+ const path21 = msg.path;
1747
+ if (!relay || !headers || typeof path21 !== "string" || !path21.startsWith("/") || path21.length > 8192 || !headerSafe(path21) || path21.includes(" ")) {
1615
1748
  return { ok: false, code: "protocol", message: "The request is malformed." };
1616
1749
  }
1617
1750
  const refusal = this.opts.sessionRefusal?.(relay.sessionId);
@@ -1623,7 +1756,7 @@ var Relay = class {
1623
1756
  message: "Wheelhouse Cloud is turned off on this machine."
1624
1757
  };
1625
1758
  }
1626
- if (isRestartPath(path19)) {
1759
+ if (isRestartPath(path21)) {
1627
1760
  return {
1628
1761
  ok: false,
1629
1762
  code: "refused",
@@ -1633,7 +1766,7 @@ var Relay = class {
1633
1766
  const target = isObj2(msg.target) ? msg.target : {};
1634
1767
  const app = this.opts.targets.appPort();
1635
1768
  if (target.kind === "app") {
1636
- return { ok: true, port: app, host: "127.0.0.1", path: path19, headers, relay };
1769
+ return { ok: true, port: app, host: "127.0.0.1", path: path21, headers, relay };
1637
1770
  }
1638
1771
  const port = target.port;
1639
1772
  if (target.kind !== "port" || typeof port !== "number" || !Number.isInteger(port) || port < 1 || port > 65535) {
@@ -1644,7 +1777,7 @@ var Relay = class {
1644
1777
  }
1645
1778
  const late = this.opts.sessionRefusal?.(relay.sessionId);
1646
1779
  if (late) return { ok: false, code: "refused", message: late };
1647
- return { ok: true, port, host: "localhost", path: path19, headers, relay };
1780
+ return { ok: true, port, host: "localhost", path: path21, headers, relay };
1648
1781
  }
1649
1782
  /** §6.3: the headers for the local request. */
1650
1783
  localHeaders(a, originChecked, ws) {
@@ -2287,7 +2420,7 @@ var CloudService = class {
2287
2420
  }
2288
2421
  x.device.pending = {
2289
2422
  ...p,
2290
- id: randomBytes3(8).toString("hex"),
2423
+ id: randomBytes4(8).toString("hex"),
2291
2424
  requestedAt: new Date(this.now()).toISOString()
2292
2425
  };
2293
2426
  });
@@ -2352,15 +2485,15 @@ var CloudService = class {
2352
2485
  };
2353
2486
 
2354
2487
  // src/lib/server/plugins/installed.ts
2355
- import { mkdir as mkdir3, readFile as readFile3, rename as rename3, writeFile as writeFile3 } from "node:fs/promises";
2488
+ import { mkdir as mkdir4, readFile as readFile4, rename as rename4, writeFile as writeFile4 } from "node:fs/promises";
2356
2489
  import { homedir as homedir2 } from "node:os";
2357
- import path4 from "node:path";
2490
+ import path6 from "node:path";
2358
2491
  var INSTALLED_FILE = "installed.json";
2359
2492
  var SCHEMA = "wheelhouse-installed-plugins.v1";
2360
2493
  var EMPTY_INSTALLED = () => ({ schema: SCHEMA, plugins: {} });
2361
2494
  function defaultPluginsDir(env) {
2362
- if (env.WHEELHOUSE_PLUGINS_DIR) return path4.resolve(env.WHEELHOUSE_PLUGINS_DIR);
2363
- return path4.join(homedir2(), ".wheelhouse", "plugins");
2495
+ if (env.WHEELHOUSE_PLUGINS_DIR) return path6.resolve(env.WHEELHOUSE_PLUGINS_DIR);
2496
+ return path6.join(homedir2(), ".wheelhouse", "plugins");
2364
2497
  }
2365
2498
  var isRecord2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
2366
2499
  function record(v) {
@@ -2372,10 +2505,10 @@ function record(v) {
2372
2505
  return { repository, ref, commit, version: version2, installedAt, enabled };
2373
2506
  }
2374
2507
  async function readInstalled(dir) {
2375
- const file = path4.join(dir, INSTALLED_FILE);
2508
+ const file = path6.join(dir, INSTALLED_FILE);
2376
2509
  let text2;
2377
2510
  try {
2378
- text2 = await readFile3(file, "utf8");
2511
+ text2 = await readFile4(file, "utf8");
2379
2512
  } catch (e) {
2380
2513
  if (e.code === "ENOENT")
2381
2514
  return { ok: true, installed: EMPTY_INSTALLED() };
@@ -2399,29 +2532,29 @@ async function readInstalled(dir) {
2399
2532
  return { ok: true, installed };
2400
2533
  }
2401
2534
  async function writeInstalled(dir, installed) {
2402
- await mkdir3(dir, { recursive: true });
2403
- const file = path4.join(dir, INSTALLED_FILE);
2535
+ await mkdir4(dir, { recursive: true });
2536
+ const file = path6.join(dir, INSTALLED_FILE);
2404
2537
  const tmp = `${file}.${process.pid}.tmp`;
2405
- await writeFile3(tmp, `${JSON.stringify(installed, null, " ")}
2538
+ await writeFile4(tmp, `${JSON.stringify(installed, null, " ")}
2406
2539
  `);
2407
- await rename3(tmp, file);
2540
+ await rename4(tmp, file);
2408
2541
  }
2409
2542
 
2410
2543
  // src/lib/server/setup/skill.ts
2411
2544
  import { createHash as createHash4 } from "node:crypto";
2412
2545
  import {
2413
2546
  lstat as lstat2,
2414
- mkdir as mkdir4,
2547
+ mkdir as mkdir5,
2415
2548
  mkdtemp,
2416
- readFile as readFile4,
2549
+ readFile as readFile5,
2417
2550
  readdir,
2418
2551
  realpath as realpath2,
2419
- rename as rename4,
2420
- rm as rm2,
2421
- writeFile as writeFile4
2552
+ rename as rename5,
2553
+ rm as rm3,
2554
+ writeFile as writeFile5
2422
2555
  } from "node:fs/promises";
2423
2556
  import { homedir as homedir3 } from "node:os";
2424
- import path5 from "node:path";
2557
+ import path7 from "node:path";
2425
2558
  var NAME = "manage-wheelhouse";
2426
2559
  var RECEIPT = ".wheelhouse-managed.json";
2427
2560
  var FILES = ["SKILL.md", "references/operations.md"];
@@ -2431,9 +2564,9 @@ async function physical(file) {
2431
2564
  return await realpath2(file);
2432
2565
  } catch (e) {
2433
2566
  if (e.code !== "ENOENT") throw e;
2434
- const parent = path5.dirname(file);
2567
+ const parent = path7.dirname(file);
2435
2568
  if (parent === file) throw e;
2436
- return path5.join(await physical(parent), path5.basename(file));
2569
+ return path7.join(await physical(parent), path7.basename(file));
2437
2570
  }
2438
2571
  }
2439
2572
  async function present(file) {
@@ -2450,8 +2583,8 @@ async function contents(dir, prefix = "") {
2450
2583
  for (const entry2 of await readdir(dir, { withFileTypes: true })) {
2451
2584
  const rel = prefix + entry2.name;
2452
2585
  if (entry2.isDirectory())
2453
- Object.assign(result, await contents(path5.join(dir, entry2.name), rel + "/"));
2454
- else if (entry2.isFile()) result[rel] = hash(await readFile4(path5.join(dir, entry2.name), "utf8"));
2586
+ Object.assign(result, await contents(path7.join(dir, entry2.name), rel + "/"));
2587
+ else if (entry2.isFile()) result[rel] = hash(await readFile5(path7.join(dir, entry2.name), "utf8"));
2455
2588
  else throw new Error("The skill contains a symbolic link or special file.");
2456
2589
  }
2457
2590
  return result;
@@ -2460,7 +2593,7 @@ async function inspect(target, hashes) {
2460
2593
  if (!await present(target)) return "absent";
2461
2594
  try {
2462
2595
  if (!(await lstat2(target)).isDirectory()) return "foreign";
2463
- const receipt = JSON.parse(await readFile4(path5.join(target, RECEIPT), "utf8"));
2596
+ const receipt = JSON.parse(await readFile5(path7.join(target, RECEIPT), "utf8"));
2464
2597
  const actual = await contents(target);
2465
2598
  delete actual[RECEIPT];
2466
2599
  const unchanged = receipt.schema === "wheelhouse-skill.v1" && receipt.files && Object.keys(actual).length === Object.keys(receipt.files).length && Object.entries(actual).every(([file, digest]) => receipt.files[file] === digest);
@@ -2470,14 +2603,14 @@ async function inspect(target, hashes) {
2470
2603
  return await present(target) ? "foreign" : "absent";
2471
2604
  }
2472
2605
  }
2473
- async function installWheelhouseSkill(install2, env, sourceDir = path5.join(env.WHEELHOUSE_INSTALL_DIR || process.cwd(), "skills", NAME)) {
2606
+ async function installWheelhouseSkill(install2, env, sourceDir = path7.join(env.WHEELHOUSE_INSTALL_DIR || process.cwd(), "skills", NAME)) {
2474
2607
  if (env.WHEELHOUSE_MANAGE_SKILL === "0")
2475
2608
  return { state: "disabled", message: "Wheelhouse skill installation is disabled." };
2476
- const parent = path5.resolve(
2477
- env.CLAUDE_CONFIG_DIR || path5.join(env.HOME || homedir3(), ".claude"),
2609
+ const parent = path7.resolve(
2610
+ env.CLAUDE_CONFIG_DIR || path7.join(env.HOME || homedir3(), ".claude"),
2478
2611
  "skills"
2479
2612
  );
2480
- const target = path5.join(parent, NAME);
2613
+ const target = path7.join(parent, NAME);
2481
2614
  const current = {
2482
2615
  state: "current",
2483
2616
  message: `Wheelhouse skill is current at ${target}.`
@@ -2486,20 +2619,20 @@ async function installWheelhouseSkill(install2, env, sourceDir = path5.join(env.
2486
2619
  try {
2487
2620
  const destinations = [await physical(parent), await physical(target)];
2488
2621
  for (const dir of [install2.firstmateDir, install2.homeDir]) {
2489
- const protectedDir = await physical(path5.resolve(dir));
2622
+ const protectedDir = await physical(path7.resolve(dir));
2490
2623
  if (destinations.some(
2491
- (destination) => destination === protectedDir || destination.startsWith(protectedDir + path5.sep)
2624
+ (destination) => destination === protectedDir || destination.startsWith(protectedDir + path7.sep)
2492
2625
  ))
2493
2626
  return {
2494
2627
  state: "skipped",
2495
2628
  message: `Left ${target} unchanged: user skills location is inside Firstmate's checkout or home.`
2496
2629
  };
2497
2630
  }
2498
- await mkdir4(parent, { recursive: true });
2631
+ await mkdir5(parent, { recursive: true });
2499
2632
  const files = Object.fromEntries(
2500
2633
  await Promise.all(
2501
2634
  FILES.map(
2502
- async (file) => [file, await readFile4(path5.join(sourceDir, file), "utf8")]
2635
+ async (file) => [file, await readFile5(path7.join(sourceDir, file), "utf8")]
2503
2636
  )
2504
2637
  )
2505
2638
  );
@@ -2515,13 +2648,13 @@ async function installWheelhouseSkill(install2, env, sourceDir = path5.join(env.
2515
2648
  };
2516
2649
  let now = found;
2517
2650
  const exists2 = found === "managed";
2518
- stage = await mkdtemp(path5.join(parent, ".wheelhouse-skill-"));
2651
+ stage = await mkdtemp(path7.join(parent, ".wheelhouse-skill-"));
2519
2652
  for (const [file, text2] of Object.entries(files)) {
2520
- await mkdir4(path5.dirname(path5.join(stage, file)), { recursive: true });
2521
- await writeFile4(path5.join(stage, file), text2);
2653
+ await mkdir5(path7.dirname(path7.join(stage, file)), { recursive: true });
2654
+ await writeFile5(path7.join(stage, file), text2);
2522
2655
  }
2523
- await writeFile4(
2524
- path5.join(stage, RECEIPT),
2656
+ await writeFile5(
2657
+ path7.join(stage, RECEIPT),
2525
2658
  JSON.stringify({ schema: "wheelhouse-skill.v1", version, files: hashes }) + "\n"
2526
2659
  );
2527
2660
  const backup = stage + "-previous";
@@ -2529,15 +2662,15 @@ async function installWheelhouseSkill(install2, env, sourceDir = path5.join(env.
2529
2662
  let error = new Error("another copy appeared while installing");
2530
2663
  if (now !== "foreign")
2531
2664
  try {
2532
- if (now === "managed") await rename4(target, backup);
2533
- await rename4(stage, target);
2665
+ if (now === "managed") await rename5(target, backup);
2666
+ await rename5(stage, target);
2534
2667
  break;
2535
2668
  } catch (e) {
2536
2669
  error = e;
2537
- await rename4(backup, target).catch(() => {
2670
+ await rename5(backup, target).catch(() => {
2538
2671
  });
2539
2672
  } finally {
2540
- await rm2(backup, { recursive: true, force: true });
2673
+ await rm3(backup, { recursive: true, force: true });
2541
2674
  }
2542
2675
  now = await inspect(target, hashes);
2543
2676
  if (now === "current") return current;
@@ -2555,15 +2688,15 @@ async function installWheelhouseSkill(install2, env, sourceDir = path5.join(env.
2555
2688
  message: `Could not install Wheelhouse skill at ${target}: ${e.message}`
2556
2689
  };
2557
2690
  } finally {
2558
- if (stage) await rm2(stage, { recursive: true, force: true });
2691
+ if (stage) await rm3(stage, { recursive: true, force: true });
2559
2692
  }
2560
2693
  }
2561
2694
 
2562
2695
  // src/lib/server/setup/remembered.ts
2563
2696
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
2564
- import path6 from "node:path";
2697
+ import path8 from "node:path";
2565
2698
  var REMEMBERED_FILE = "firstmate.json";
2566
- var rememberedFile = (configDir) => path6.join(configDir, REMEMBERED_FILE);
2699
+ var rememberedFile = (configDir) => path8.join(configDir, REMEMBERED_FILE);
2567
2700
  function readRemembered(configDir) {
2568
2701
  let raw;
2569
2702
  try {
@@ -2573,8 +2706,8 @@ function readRemembered(configDir) {
2573
2706
  }
2574
2707
  if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return null;
2575
2708
  const { firstmate, home } = raw;
2576
- if (typeof firstmate !== "string" || !path6.isAbsolute(firstmate)) return null;
2577
- if (home !== void 0 && home !== null && (typeof home !== "string" || !path6.isAbsolute(home))) {
2709
+ if (typeof firstmate !== "string" || !path8.isAbsolute(firstmate)) return null;
2710
+ if (home !== void 0 && home !== null && (typeof home !== "string" || !path8.isAbsolute(home))) {
2578
2711
  return null;
2579
2712
  }
2580
2713
  return { firstmate, home: typeof home === "string" ? home : null };
@@ -2582,7 +2715,7 @@ function readRemembered(configDir) {
2582
2715
 
2583
2716
  // src/lib/server/store/store.ts
2584
2717
  import { realpathSync } from "node:fs";
2585
- import path7 from "node:path";
2718
+ import path9 from "node:path";
2586
2719
 
2587
2720
  // src/lib/inbox.ts
2588
2721
  var SNOOZE_MS = 4 * 3600 * 1e3;
@@ -2606,22 +2739,22 @@ var SUMMARY_SYSTEM = [
2606
2739
 
2607
2740
  // src/lib/server/store/store.ts
2608
2741
  function defaultStateDir(env) {
2609
- if (env.WHEELHOUSE_STATE_DIR) return path7.resolve(env.WHEELHOUSE_STATE_DIR);
2610
- if (env.XDG_STATE_HOME) return path7.join(path7.resolve(env.XDG_STATE_HOME), "wheelhouse");
2611
- return path7.join(env.HOME ?? "", ".local", "state", "wheelhouse");
2742
+ if (env.WHEELHOUSE_STATE_DIR) return path9.resolve(env.WHEELHOUSE_STATE_DIR);
2743
+ if (env.XDG_STATE_HOME) return path9.join(path9.resolve(env.XDG_STATE_HOME), "wheelhouse");
2744
+ return path9.join(env.HOME ?? "", ".local", "state", "wheelhouse");
2612
2745
  }
2613
2746
  function real(p) {
2614
- const abs = path7.resolve(p);
2747
+ const abs = path9.resolve(p);
2615
2748
  try {
2616
2749
  return realpathSync(abs);
2617
2750
  } catch {
2618
- const parent = path7.dirname(abs);
2619
- return parent === abs ? abs : path7.join(real(parent), path7.basename(abs));
2751
+ const parent = path9.dirname(abs);
2752
+ return parent === abs ? abs : path9.join(real(parent), path9.basename(abs));
2620
2753
  }
2621
2754
  }
2622
2755
  function isInside(p, dir) {
2623
- const rel = path7.relative(real(dir), real(p));
2624
- return rel === "" || !rel.startsWith("..") && !path7.isAbsolute(rel);
2756
+ const rel = path9.relative(real(dir), real(p));
2757
+ return rel === "" || !rel.startsWith("..") && !path9.isAbsolute(rel);
2625
2758
  }
2626
2759
 
2627
2760
  // src/lib/server/restart.ts
@@ -2633,9 +2766,9 @@ function setRestart(fn) {
2633
2766
 
2634
2767
  // src/lib/server/upgrade/settings.ts
2635
2768
  import { existsSync as existsSync2, readFileSync as readFileSync2, rmSync } from "node:fs";
2636
- import path8 from "node:path";
2637
- var updateDir = (configDir) => path8.join(configDir, "update");
2638
- var handoffFile = (configDir) => path8.join(updateDir(configDir), "next-install");
2769
+ import path10 from "node:path";
2770
+ var updateDir = (configDir) => path10.join(configDir, "update");
2771
+ var handoffFile = (configDir) => path10.join(updateDir(configDir), "next-install");
2639
2772
  function takeHandoff(configDir) {
2640
2773
  const file = handoffFile(configDir);
2641
2774
  let dir;
@@ -2645,13 +2778,13 @@ function takeHandoff(configDir) {
2645
2778
  return null;
2646
2779
  }
2647
2780
  rmSync(file, { force: true });
2648
- if (!dir || !path8.isAbsolute(dir)) return null;
2649
- const built = existsSync2(path8.join(dir, "dist", "cli.js")) && existsSync2(path8.join(dir, "build", "handler.js"));
2781
+ if (!dir || !path10.isAbsolute(dir)) return null;
2782
+ const built = existsSync2(path10.join(dir, "dist", "cli.js")) && existsSync2(path10.join(dir, "build", "handler.js"));
2650
2783
  return built ? dir : null;
2651
2784
  }
2652
2785
 
2653
2786
  // cli/gateway.ts
2654
- import path10 from "node:path";
2787
+ import path12 from "node:path";
2655
2788
  import { Argument, Command, InvalidArgumentError } from "commander";
2656
2789
 
2657
2790
  // src/lib/gateway.ts
@@ -2783,19 +2916,19 @@ async function checkDiscordToken(token, opts = {}) {
2783
2916
  var inviteUrl = (appId) => `https://discord.com/oauth2/authorize?client_id=${encodeURIComponent(appId)}&scope=bot&permissions=0`;
2784
2917
 
2785
2918
  // src/lib/server/gateway/settings.ts
2786
- import { createHash as createHash5, randomBytes as randomBytes4 } from "node:crypto";
2919
+ import { createHash as createHash5, randomBytes as randomBytes5 } from "node:crypto";
2787
2920
  import {
2788
2921
  chmod as chmod2,
2789
2922
  lstat as lstat3,
2790
- mkdir as mkdir5,
2791
- readFile as readFile5,
2923
+ mkdir as mkdir6,
2924
+ readFile as readFile6,
2792
2925
  realpath as realpath3,
2793
- rename as rename5,
2794
- rm as rm3,
2926
+ rename as rename6,
2927
+ rm as rm4,
2795
2928
  stat as stat4,
2796
- writeFile as writeFile5
2929
+ writeFile as writeFile6
2797
2930
  } from "node:fs/promises";
2798
- import path9 from "node:path";
2931
+ import path11 from "node:path";
2799
2932
 
2800
2933
  // src/lib/bell.ts
2801
2934
  var ALERT_KINDS = [
@@ -2814,7 +2947,7 @@ var QUIET_AFTER_MS = 20 * 6e4;
2814
2947
  // src/lib/server/gateway/settings.ts
2815
2948
  var GATEWAY_SETTINGS_SCHEMA = "wheelhouse-gateway-settings.v1";
2816
2949
  var SETTINGS_FILE = "settings.json";
2817
- var gatewayDir = (configDir) => path9.join(configDir, "gateway");
2950
+ var gatewayDir = (configDir) => path11.join(configDir, "gateway");
2818
2951
  function defaultSettings() {
2819
2952
  return Object.fromEntries(
2820
2953
  GATEWAY_CHANNELS.map((c) => [
@@ -2847,13 +2980,13 @@ function parseChannel(v, fallback) {
2847
2980
  };
2848
2981
  }
2849
2982
  async function writeAtomic2(file, text2) {
2850
- await mkdir5(path9.dirname(file), { recursive: true, mode: 448 });
2851
- const tmp = `${file}.tmp-${process.pid}-${randomBytes4(4).toString("hex")}`;
2983
+ await mkdir6(path11.dirname(file), { recursive: true, mode: 448 });
2984
+ const tmp = `${file}.tmp-${process.pid}-${randomBytes5(4).toString("hex")}`;
2852
2985
  try {
2853
- await writeFile5(tmp, text2, { mode: 384 });
2854
- await rename5(tmp, file);
2986
+ await writeFile6(tmp, text2, { mode: 384 });
2987
+ await rename6(tmp, file);
2855
2988
  } catch (e) {
2856
- await rm3(tmp, { force: true });
2989
+ await rm4(tmp, { force: true });
2857
2990
  throw e;
2858
2991
  }
2859
2992
  }
@@ -2865,17 +2998,17 @@ var GatewaySettings = class {
2865
2998
  dir;
2866
2999
  keychain;
2867
3000
  get file() {
2868
- return path9.join(this.dir, SETTINGS_FILE);
3001
+ return path11.join(this.dir, SETTINGS_FILE);
2869
3002
  }
2870
3003
  tokenFile(channel) {
2871
- return path9.join(this.dir, `${channel}.token`);
3004
+ return path11.join(this.dir, `${channel}.token`);
2872
3005
  }
2873
3006
  /** The settings, with defaults for anything missing; an unreadable file reads as the defaults, with why. */
2874
3007
  async read() {
2875
3008
  const settings2 = defaultSettings();
2876
3009
  let text2;
2877
3010
  try {
2878
- text2 = await readFile5(this.file, "utf8");
3011
+ text2 = await readFile6(this.file, "utf8");
2879
3012
  } catch (e) {
2880
3013
  if (e.code === "ENOENT") return { settings: settings2, error: null };
2881
3014
  return { settings: settings2, error: `${this.file} could not be read: ${e.message}` };
@@ -2918,7 +3051,7 @@ var GatewaySettings = class {
2918
3051
  const s = await lstat3(file);
2919
3052
  if (!s.isFile()) return null;
2920
3053
  if ((s.mode & 63) !== 0) await chmod2(file, 384);
2921
- const token = cleanToken(await readFile5(file, "utf8"));
3054
+ const token = cleanToken(await readFile6(file, "utf8"));
2922
3055
  return token ? { token, where: file } : null;
2923
3056
  } catch {
2924
3057
  return null;
@@ -2933,12 +3066,12 @@ var GatewaySettings = class {
2933
3066
  * directory has its own token.
2934
3067
  */
2935
3068
  async keychainAccount(channel) {
2936
- const real2 = await realpath3(this.dir).catch(() => path9.resolve(this.dir));
3069
+ const real2 = await realpath3(this.dir).catch(() => path11.resolve(this.dir));
2937
3070
  return `${channel}:${createHash5("sha256").update(real2).digest("hex").slice(0, 16)}`;
2938
3071
  }
2939
3072
  /** Keep the token in the Keychain, else in its file, replacing the one before; returns where it went. */
2940
3073
  async setToken(channel, token) {
2941
- await mkdir5(this.dir, { recursive: true, mode: 448 });
3074
+ await mkdir6(this.dir, { recursive: true, mode: 448 });
2942
3075
  const keychain = this.keychain;
2943
3076
  const account = await this.keychainAccount(channel);
2944
3077
  const kept = keychain ? await keychain.set(account, token).then(
@@ -2946,7 +3079,7 @@ var GatewaySettings = class {
2946
3079
  () => false
2947
3080
  ) : false;
2948
3081
  if (kept) {
2949
- await rm3(this.tokenFile(channel), { force: true });
3082
+ await rm4(this.tokenFile(channel), { force: true });
2950
3083
  } else {
2951
3084
  await keychain?.remove(account).catch(() => false);
2952
3085
  await writeAtomic2(this.tokenFile(channel), `${token}
@@ -3052,7 +3185,7 @@ function gatewayCommand(over = {}) {
3052
3185
  );
3053
3186
  const settingsFor = (c) => {
3054
3187
  const dir = c.optsWithGlobals().configDir;
3055
- const configDir = dir ? path10.resolve(dir) : defaultConfigDir(deps.env);
3188
+ const configDir = dir ? path12.resolve(dir) : defaultConfigDir(deps.env);
3056
3189
  const found = resolveInstall({
3057
3190
  cwd: process.cwd(),
3058
3191
  env: deps.env,
@@ -3172,17 +3305,17 @@ function gatewayCommand(over = {}) {
3172
3305
  }
3173
3306
 
3174
3307
  // cli/plugin.ts
3175
- import { createInterface } from "node:readline/promises";
3176
- import path14 from "node:path";
3308
+ import { createInterface as createInterface2 } from "node:readline/promises";
3309
+ import path16 from "node:path";
3177
3310
  import { Command as Command2 } from "commander";
3178
3311
 
3179
3312
  // src/lib/server/plugins/install.ts
3180
3313
  import { execFile } from "node:child_process";
3181
- import { mkdir as mkdir6, mkdtemp as mkdtemp2, readFile as readFile6, realpath as realpath4, rename as rename6, rm as rm4, stat as stat5 } from "node:fs/promises";
3182
- import path12 from "node:path";
3314
+ import { mkdir as mkdir7, mkdtemp as mkdtemp2, readFile as readFile7, realpath as realpath4, rename as rename7, rm as rm5, stat as stat5 } from "node:fs/promises";
3315
+ import path14 from "node:path";
3183
3316
 
3184
3317
  // src/lib/server/plugins/manifest.ts
3185
- import path11 from "node:path";
3318
+ import path13 from "node:path";
3186
3319
 
3187
3320
  // src/lib/plugins/addresses.ts
3188
3321
  var TEMPLATE = /^[a-z0-9-]*\{port\}[a-z0-9-]*(?:\.[a-z0-9-]+)*\.localhost$/;
@@ -3213,7 +3346,7 @@ var SUPPORTED_API_VERSIONS = [PLUGIN_API_VERSION, PLUGIN_API_VERSION - 1].filter
3213
3346
  // src/lib/server/plugins/manifest.ts
3214
3347
  var MANIFEST_DIR = ".wheelhouse-plugin";
3215
3348
  var MANIFEST_FILE = "plugin.json";
3216
- var manifestPath = (pluginDir) => path11.join(pluginDir, MANIFEST_DIR, MANIFEST_FILE);
3349
+ var manifestPath = (pluginDir) => path13.join(pluginDir, MANIFEST_DIR, MANIFEST_FILE);
3217
3350
  var MANIFEST_FIELDS = [
3218
3351
  "$schema",
3219
3352
  "name",
@@ -3260,7 +3393,7 @@ var SEMVER = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
3260
3393
  var MAX_TEXT = 400;
3261
3394
  var isRecord3 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
3262
3395
  function insidePath(f) {
3263
- return typeof f === "string" && f.length > 0 && !path11.isAbsolute(f) && !f.split(/[\\/]/).some((part) => part === ".." || part === "" || part === ".");
3396
+ return typeof f === "string" && f.length > 0 && !path13.isAbsolute(f) && !f.split(/[\\/]/).some((part) => part === ".." || part === "" || part === ".");
3264
3397
  }
3265
3398
  var ICON_TYPES = {
3266
3399
  ".svg": "image/svg+xml",
@@ -3358,7 +3491,7 @@ function wheelhouse(v) {
3358
3491
  }
3359
3492
  if (!insidePath(c.icon))
3360
3493
  throw new Invalid(`${where}.icon must be a plain path inside the plugin`);
3361
- if (!ICON_TYPES[path11.extname(c.icon).toLowerCase()]) {
3494
+ if (!ICON_TYPES[path13.extname(c.icon).toLowerCase()]) {
3362
3495
  throw new Invalid(`${where}.icon must be an image: ${Object.keys(ICON_TYPES).join(", ")}`);
3363
3496
  }
3364
3497
  declared.icon = c.icon;
@@ -3711,13 +3844,13 @@ async function fetchSource(source, into, deps) {
3711
3844
  await step(["checkout", "-q", "--detach", "FETCH_HEAD"]);
3712
3845
  }
3713
3846
  const commit = await step(["rev-parse", "HEAD"]);
3714
- await rm4(path12.join(into, ".git"), { recursive: true, force: true });
3847
+ await rm5(path14.join(into, ".git"), { recursive: true, force: true });
3715
3848
  return commit;
3716
3849
  }
3717
3850
  async function checkCopy(dir) {
3718
3851
  let text2;
3719
3852
  try {
3720
- text2 = await readFile6(manifestPath(dir), "utf8");
3853
+ text2 = await readFile7(manifestPath(dir), "utf8");
3721
3854
  } catch {
3722
3855
  throw new Refused("it has no .wheelhouse-plugin/plugin.json, so it is not a Wheelhouse plugin");
3723
3856
  }
@@ -3732,12 +3865,12 @@ async function checkCopy(dir) {
3732
3865
  if (!rel) continue;
3733
3866
  let file;
3734
3867
  try {
3735
- file = await realpath4(path12.join(base, rel));
3868
+ file = await realpath4(path14.join(base, rel));
3736
3869
  if (!(await stat5(file)).isFile()) throw new Error();
3737
3870
  } catch {
3738
3871
  throw new Refused(`its ${what} ${rel} is missing`);
3739
3872
  }
3740
- if (!file.startsWith(base + path12.sep))
3873
+ if (!file.startsWith(base + path14.sep))
3741
3874
  throw new Refused(`its ${what} leads outside the plugin`);
3742
3875
  }
3743
3876
  return m;
@@ -3779,12 +3912,12 @@ function describeManifest(m, from, commit) {
3779
3912
  ];
3780
3913
  }
3781
3914
  async function withStaging(dir, work) {
3782
- await mkdir6(dir, { recursive: true });
3783
- const staging = await mkdtemp2(path12.join(dir, ".staging-"));
3915
+ await mkdir7(dir, { recursive: true });
3916
+ const staging = await mkdtemp2(path14.join(dir, ".staging-"));
3784
3917
  try {
3785
3918
  return await work(staging);
3786
3919
  } finally {
3787
- await rm4(staging, { recursive: true, force: true });
3920
+ await rm5(staging, { recursive: true, force: true });
3788
3921
  }
3789
3922
  }
3790
3923
  async function guarded(work) {
@@ -3817,7 +3950,7 @@ async function settle(m, deps, o) {
3817
3950
  async function keepSettings(id, settings2, deps) {
3818
3951
  const w = await writePluginSettings(deps.configDir, id, settings2);
3819
3952
  if (!w.ok) throw new Refused(`could not keep ${id}'s settings: ${w.error}`);
3820
- deps.log(`Kept ${id}'s settings in ${path12.join(deps.configDir, PLUGINS_FILE)}.`);
3953
+ deps.log(`Kept ${id}'s settings in ${path14.join(deps.configDir, PLUGINS_FILE)}.`);
3821
3954
  }
3822
3955
  async function reload(deps, what, yes) {
3823
3956
  const r = await deps.restart(async (url, busy) => {
@@ -3858,7 +3991,7 @@ function install(spec, deps, o = {}) {
3858
3991
  const commit = await fetchSource(source, staging, deps);
3859
3992
  expected(commit, o.expect, repository);
3860
3993
  const m = await checkCopy(staging);
3861
- const target = path12.join(deps.dir, m.name);
3994
+ const target = path14.join(deps.dir, m.name);
3862
3995
  if (installed.plugins[m.name]) {
3863
3996
  throw new Refused(
3864
3997
  `${m.name} is already installed from ${label(installed.plugins[m.name])}; use \`wheelhouse plugin update ${m.name}\``
@@ -3878,7 +4011,7 @@ function install(spec, deps, o = {}) {
3878
4011
  }
3879
4012
  const settings2 = await settle(m, deps, { yes: o.yes, given: answers });
3880
4013
  if (settings2) await keepSettings(m.name, settings2, deps);
3881
- await rename6(staging, target);
4014
+ await rename7(staging, target);
3882
4015
  installed.plugins[m.name] = {
3883
4016
  repository,
3884
4017
  ref: source.ref,
@@ -3933,17 +4066,17 @@ function update(id, deps, o = {}) {
3933
4066
  if (!o.yes && !await deps.confirm(`Update ${id}?`)) throw new Refused("not updated");
3934
4067
  const settings2 = await settle(m, deps, { yes: o.yes, given: answers });
3935
4068
  if (settings2) await keepSettings(id, settings2, deps);
3936
- const target = path12.join(deps.dir, id);
3937
- const old = await mkdtemp2(path12.join(deps.dir, ".old-"));
3938
- const parked = path12.join(old, id);
3939
- if (await exists(target)) await rename6(target, parked);
4069
+ const target = path14.join(deps.dir, id);
4070
+ const old = await mkdtemp2(path14.join(deps.dir, ".old-"));
4071
+ const parked = path14.join(old, id);
4072
+ if (await exists(target)) await rename7(target, parked);
3940
4073
  try {
3941
- await rename6(staging, target);
4074
+ await rename7(staging, target);
3942
4075
  } catch (e) {
3943
- if (await exists(parked)) await rename6(parked, target);
4076
+ if (await exists(parked)) await rename7(parked, target);
3944
4077
  throw e;
3945
4078
  } finally {
3946
- await rm4(old, { recursive: true, force: true });
4079
+ await rm5(old, { recursive: true, force: true });
3947
4080
  }
3948
4081
  installed.plugins[id] = {
3949
4082
  ...was,
@@ -3964,7 +4097,7 @@ function remove(id, deps, o = {}) {
3964
4097
  if (!ID2.test(id)) throw new Refused(`"${id}" is not a plugin id`);
3965
4098
  const installed = await record2(deps);
3966
4099
  if (!installed.plugins[id]) throw new Refused(`${id} is not installed`);
3967
- await rm4(path12.join(deps.dir, id), { recursive: true, force: true });
4100
+ await rm5(path14.join(deps.dir, id), { recursive: true, force: true });
3968
4101
  delete installed.plugins[id];
3969
4102
  await writeInstalled(deps.dir, installed);
3970
4103
  deps.log(`Removed ${id}.`);
@@ -4010,19 +4143,19 @@ async function exists(p) {
4010
4143
  }
4011
4144
 
4012
4145
  // cli/running.ts
4013
- import { randomBytes as randomBytes5, timingSafeEqual } from "node:crypto";
4146
+ import { randomBytes as randomBytes6, timingSafeEqual } from "node:crypto";
4014
4147
  import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "node:fs";
4015
- import { readdir as readdir2, readFile as readFile7, rm as rm5 } from "node:fs/promises";
4016
- import path13 from "node:path";
4148
+ import { readdir as readdir2, readFile as readFile8, rm as rm6 } from "node:fs/promises";
4149
+ import path15 from "node:path";
4017
4150
  var RESTART_EXIT = 75;
4018
4151
  var RESTART_PATH = "/api/wheelhouse/restart";
4019
4152
  var RUNNING_DIR = ".running";
4020
4153
  var TIMEOUT_MS = 3e3;
4021
- var newToken = () => randomBytes5(24).toString("hex");
4154
+ var newToken = () => randomBytes6(24).toString("hex");
4022
4155
  function writeRunning(pluginsDir, r) {
4023
- const dir = path13.join(pluginsDir, RUNNING_DIR);
4156
+ const dir = path15.join(pluginsDir, RUNNING_DIR);
4024
4157
  mkdirSync2(dir, { recursive: true, mode: 448 });
4025
- const file = path13.join(dir, `${r.pid}.json`);
4158
+ const file = path15.join(dir, `${r.pid}.json`);
4026
4159
  writeFileSync2(file, `${JSON.stringify(r)}
4027
4160
  `, { mode: 384 });
4028
4161
  return file;
@@ -4065,7 +4198,7 @@ var alive2 = (pid) => {
4065
4198
  };
4066
4199
  var refused = (e) => e.cause?.code === "ECONNREFUSED";
4067
4200
  async function requestRestart(pluginsDir, proceed) {
4068
- const dir = path13.join(pluginsDir, RUNNING_DIR);
4201
+ const dir = path15.join(pluginsDir, RUNNING_DIR);
4069
4202
  const out = { restarted: [], failed: [], kept: [] };
4070
4203
  let names;
4071
4204
  try {
@@ -4074,17 +4207,17 @@ async function requestRestart(pluginsDir, proceed) {
4074
4207
  return out;
4075
4208
  }
4076
4209
  for (const name of names) {
4077
- const file = path13.join(dir, name);
4210
+ const file = path15.join(dir, name);
4078
4211
  let r;
4079
4212
  try {
4080
- r = JSON.parse(await readFile7(file, "utf8"));
4213
+ r = JSON.parse(await readFile8(file, "utf8"));
4081
4214
  if (typeof r.url !== "string" || typeof r.token !== "string") throw new Error();
4082
4215
  } catch {
4083
- await rm5(file, { force: true });
4216
+ await rm6(file, { force: true });
4084
4217
  continue;
4085
4218
  }
4086
4219
  if (typeof r.pid === "number" && !alive2(r.pid)) {
4087
- await rm5(file, { force: true });
4220
+ await rm6(file, { force: true });
4088
4221
  continue;
4089
4222
  }
4090
4223
  const headers = { authorization: `Bearer ${r.token}` };
@@ -4108,7 +4241,7 @@ async function requestRestart(pluginsDir, proceed) {
4108
4241
  if (res.status === 202) out.restarted.push(r.url);
4109
4242
  else out.failed.push({ url: r.url, reason: `it answered ${res.status}` });
4110
4243
  } catch (e) {
4111
- if (refused(e)) await rm5(file, { force: true });
4244
+ if (refused(e)) await rm6(file, { force: true });
4112
4245
  else out.failed.push({ url: r.url, reason: e.message });
4113
4246
  }
4114
4247
  }
@@ -4121,7 +4254,7 @@ async function askTerminal(question2) {
4121
4254
  console.error("wheelhouse: no terminal to ask on; pass --yes to agree without asking.");
4122
4255
  return false;
4123
4256
  }
4124
- const rl = createInterface({ input: process.stdin, output: process.stdout });
4257
+ const rl = createInterface2({ input: process.stdin, output: process.stdout });
4125
4258
  try {
4126
4259
  return /^y(es)?$/i.test((await rl.question(`${question2} [y/N] `)).trim());
4127
4260
  } finally {
@@ -4130,7 +4263,7 @@ async function askTerminal(question2) {
4130
4263
  }
4131
4264
  async function askLine(question2) {
4132
4265
  if (!process.stdin.isTTY) return null;
4133
- const rl = createInterface({ input: process.stdin, output: process.stdout });
4266
+ const rl = createInterface2({ input: process.stdin, output: process.stdout });
4134
4267
  try {
4135
4268
  return await new Promise((resolve) => {
4136
4269
  rl.once("close", () => resolve(null));
@@ -4153,10 +4286,10 @@ function pluginCommand(over = {}) {
4153
4286
  );
4154
4287
  const deps = (c) => {
4155
4288
  const g2 = c.optsWithGlobals();
4156
- const dir = g2.pluginsDir ? path14.resolve(g2.pluginsDir) : defaultPluginsDir(env);
4289
+ const dir = g2.pluginsDir ? path16.resolve(g2.pluginsDir) : defaultPluginsDir(env);
4157
4290
  return {
4158
4291
  dir,
4159
- configDir: g2.configDir ? path14.resolve(g2.configDir) : defaultConfigDir(env),
4292
+ configDir: g2.configDir ? path16.resolve(g2.configDir) : defaultConfigDir(env),
4160
4293
  confirm: askTerminal,
4161
4294
  ask: askLine,
4162
4295
  restart: (proceed) => requestRestart(dir, proceed),
@@ -4191,7 +4324,7 @@ function pluginCommand(over = {}) {
4191
4324
  }
4192
4325
 
4193
4326
  // cli/remote.ts
4194
- import path15 from "node:path";
4327
+ import path17 from "node:path";
4195
4328
  import { Command as Command3, InvalidArgumentError as InvalidArgumentError2 } from "commander";
4196
4329
 
4197
4330
  // src/lib/server/cloud/pairing.ts
@@ -4505,7 +4638,7 @@ function remoteCommand(over = {}) {
4505
4638
  };
4506
4639
  const settingsFor = (c) => {
4507
4640
  const dir = c.optsWithGlobals().configDir;
4508
- const configDir = dir ? path15.resolve(dir) : defaultConfigDir(deps.env);
4641
+ const configDir = dir ? path17.resolve(dir) : defaultConfigDir(deps.env);
4509
4642
  const found = resolveInstall({ cwd: process.cwd(), env: deps.env });
4510
4643
  if (found.ok && isInside(configDir, found.install.homeDir)) {
4511
4644
  fail(
@@ -4864,14 +4997,14 @@ function supervise(opts) {
4864
4997
 
4865
4998
  // cli/upgrade.ts
4866
4999
  import { spawn as spawn3 } from "node:child_process";
4867
- import path17 from "node:path";
5000
+ import path19 from "node:path";
4868
5001
  import { fileURLToPath } from "node:url";
4869
5002
  import { Command as Command4 } from "commander";
4870
5003
 
4871
5004
  // src/lib/server/upgrade/clone.ts
4872
5005
  import { execFile as execFile2 } from "node:child_process";
4873
- import { mkdir as mkdir7, readdir as readdir3, readFile as readFile8, realpath as realpath5 } from "node:fs/promises";
4874
- import path16 from "node:path";
5006
+ import { mkdir as mkdir8, readdir as readdir3, readFile as readFile9, realpath as realpath5 } from "node:fs/promises";
5007
+ import path18 from "node:path";
4875
5008
  var COMMITS_SHOWN = 20;
4876
5009
  var OUTPUT_KEPT = 6e4;
4877
5010
  var runCommand = (cmd, args, cwd) => new Promise((resolve) => {
@@ -4917,7 +5050,7 @@ async function checkClone(deps) {
4917
5050
  changes: []
4918
5051
  };
4919
5052
  out.current.version = packageVersion(
4920
- await readFile8(path16.join(deps.dir, "package.json"), "utf8").catch(() => null)
5053
+ await readFile9(path18.join(deps.dir, "package.json"), "utf8").catch(() => null)
4921
5054
  );
4922
5055
  const top = await g2("rev-parse", "--show-toplevel");
4923
5056
  const here = await realpath5(deps.dir).catch(() => deps.dir);
@@ -5043,7 +5176,7 @@ var CLONE_SETUP_STEPS = [
5043
5176
 
5044
5177
  // cli/upgrade.ts
5045
5178
  function installDir() {
5046
- return path17.resolve(path17.dirname(fileURLToPath(import.meta.url)), "..");
5179
+ return path19.resolve(path19.dirname(fileURLToPath(import.meta.url)), "..");
5047
5180
  }
5048
5181
  var runInherit = (cmd, args, cwd) => new Promise((resolve) => {
5049
5182
  const child = spawn3(cmd, args, { cwd, stdio: "inherit" });
@@ -5116,7 +5249,7 @@ function upgradeCommand(over = {}) {
5116
5249
  "--plugins-dir <dir>",
5117
5250
  "the plugins directory the running Wheelhouse loads from, to find it (default: $WHEELHOUSE_PLUGINS_DIR, else ~/.wheelhouse/plugins)"
5118
5251
  ).action(async (o) => {
5119
- const pluginsDir = o.pluginsDir ? path17.resolve(o.pluginsDir) : defaultPluginsDir(env);
5252
+ const pluginsDir = o.pluginsDir ? path19.resolve(o.pluginsDir) : defaultPluginsDir(env);
5120
5253
  const ok = await upgrade(
5121
5254
  {
5122
5255
  dir: installDir(),
@@ -5143,8 +5276,8 @@ function parsePort3(value) {
5143
5276
  return n;
5144
5277
  }
5145
5278
  function handlerPath() {
5146
- const here = path18.dirname(fileURLToPath2(import.meta.url));
5147
- return path18.resolve(here, "..", "build", "handler.js");
5279
+ const here = path20.dirname(fileURLToPath2(import.meta.url));
5280
+ return path20.resolve(here, "..", "build", "handler.js");
5148
5281
  }
5149
5282
  function openBrowser(url) {
5150
5283
  const [cmd, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["cmd", ["/c", "start", '""', url]] : ["xdg-open", [url]];
@@ -5157,8 +5290,8 @@ function openBrowser(url) {
5157
5290
  }
5158
5291
  }
5159
5292
  async function open2(opts) {
5160
- const configDir = opts.configDir ? path18.resolve(opts.configDir) : defaultConfigDir(process.env);
5161
- const stateDir = opts.stateDir ? path18.resolve(opts.stateDir) : defaultStateDir(process.env);
5293
+ const configDir = opts.configDir ? path20.resolve(opts.configDir) : defaultConfigDir(process.env);
5294
+ const stateDir = opts.stateDir ? path20.resolve(opts.stateDir) : defaultStateDir(process.env);
5162
5295
  const resolved = resolveInstall({
5163
5296
  firstmate: opts.firstmate,
5164
5297
  home: opts.home,
@@ -5216,6 +5349,11 @@ async function open2(opts) {
5216
5349
  if (hosted.hosted) {
5217
5350
  console.log(`Previews: ${hosted.hosted.pattern} (${hosted.hosted.source})`);
5218
5351
  }
5352
+ process.env.WHEELHOUSE_HARNESS = await resolveHarness({
5353
+ explicit: opts.harness,
5354
+ env: process.env,
5355
+ configDir
5356
+ });
5219
5357
  const file = handlerPath();
5220
5358
  if (!existsSync3(file)) {
5221
5359
  console.error(
@@ -5225,9 +5363,9 @@ async function open2(opts) {
5225
5363
  }
5226
5364
  process.env.WHEELHOUSE_STATE_DIR = stateDir;
5227
5365
  process.env.WHEELHOUSE_CONFIG_DIR = configDir;
5228
- if (opts.pluginsDir) process.env.WHEELHOUSE_PLUGINS_DIR = path18.resolve(opts.pluginsDir);
5229
- process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path18.resolve(path18.dirname(file), "..", "plugins");
5230
- process.env.WHEELHOUSE_INSTALL_DIR = path18.resolve(path18.dirname(file), "..");
5366
+ if (opts.pluginsDir) process.env.WHEELHOUSE_PLUGINS_DIR = path20.resolve(opts.pluginsDir);
5367
+ process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path20.resolve(path20.dirname(file), "..", "plugins");
5368
+ process.env.WHEELHOUSE_INSTALL_DIR = path20.resolve(path20.dirname(file), "..");
5231
5369
  if (opts.tmuxSocket) process.env.WHEELHOUSE_TMUX_SOCKET = opts.tmuxSocket;
5232
5370
  process.env.WHEELHOUSE_SKIP_PERMISSIONS = opts.skipPermissions ? "1" : "0";
5233
5371
  let cli = fileURLToPath2(import.meta.url);
@@ -5244,9 +5382,9 @@ async function open2(opts) {
5244
5382
  start: (port, restart) => {
5245
5383
  const next = takeHandoff(configDir);
5246
5384
  if (next && restart) {
5247
- cli = path18.join(next, "dist", "cli.js");
5385
+ cli = path20.join(next, "dist", "cli.js");
5248
5386
  process.env.WHEELHOUSE_INSTALL_DIR = next;
5249
- process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path18.join(next, "plugins");
5387
+ process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path20.join(next, "plugins");
5250
5388
  console.log(`Wheelhouse now runs from ${next}.`);
5251
5389
  }
5252
5390
  return fork(cli, ["__server", "--port", String(port)], {
@@ -5271,7 +5409,7 @@ async function open2(opts) {
5271
5409
  process.exit(code);
5272
5410
  }
5273
5411
  async function serve(opts) {
5274
- process.env.WHEELHOUSE_INSTALL_DIR = path18.resolve(path18.dirname(handlerPath()), "..");
5412
+ process.env.WHEELHOUSE_INSTALL_DIR = path20.resolve(path20.dirname(handlerPath()), "..");
5275
5413
  const selected = resolveInstall({
5276
5414
  firstmate: process.env.WHEELHOUSE_FIRSTMATE_DIR,
5277
5415
  home: process.env.WHEELHOUSE_HOME,
@@ -5370,6 +5508,16 @@ function program() {
5370
5508
  "--preview-url <pattern>",
5371
5509
  `where a hosted dev environment serves this computer's ports, with {port} once, such as https://{port}.example.dev; previews and links to addresses on this computer open there ("off" turns it off; default: $${PREVIEW_URL_ENV}, else Gitpod's or Codespaces' own, detected)`
5372
5510
  ).option("--no-browser", "do not open the browser").option(
5511
+ "--harness <name>",
5512
+ "Firstmate tool: claude, codex, opencode, pi (default: environment, saved choice, or interactive picker; noninteractive fallback: claude)",
5513
+ (value) => {
5514
+ try {
5515
+ return parseHarness(value);
5516
+ } catch (e) {
5517
+ throw new InvalidArgumentError3(e instanceof Error ? e.message : String(e));
5518
+ }
5519
+ }
5520
+ ).option(
5373
5521
  "--no-skip-permissions",
5374
5522
  "start Firstmate without --dangerously-skip-permissions, so Claude Code asks before tools run (answer in the terminal drawer)"
5375
5523
  ).action((opts) => open2(opts));