@chrisjowen/wheelhouse 0.11.0 → 0.12.1

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 (403) 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/{BPAziDlG.js → A55xgzkD.js} +1 -1
  6. package/build/client/_app/immutable/chunks/A55xgzkD.js.br +0 -0
  7. package/build/client/_app/immutable/chunks/A55xgzkD.js.gz +0 -0
  8. package/build/client/_app/immutable/chunks/{DSAFUgJn.js → BBJBkIrw.js} +1 -1
  9. package/build/client/_app/immutable/chunks/BBJBkIrw.js.br +0 -0
  10. package/build/client/_app/immutable/chunks/BBJBkIrw.js.gz +0 -0
  11. package/build/client/_app/immutable/chunks/{DnBZO8Il.js → BFhVmACN.js} +1 -1
  12. package/build/client/_app/immutable/chunks/BFhVmACN.js.br +0 -0
  13. package/build/client/_app/immutable/chunks/BFhVmACN.js.gz +0 -0
  14. package/build/client/_app/immutable/chunks/{CC5Ts_xe.js → BdTUpAzj.js} +1 -1
  15. package/build/client/_app/immutable/chunks/BdTUpAzj.js.br +0 -0
  16. package/build/client/_app/immutable/chunks/BdTUpAzj.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/{BiiAyXOY.js → Blcu9fuE.js} +1 -1
  21. package/build/client/_app/immutable/chunks/Blcu9fuE.js.br +0 -0
  22. package/build/client/_app/immutable/chunks/Blcu9fuE.js.gz +0 -0
  23. package/build/client/_app/immutable/chunks/{ChjkQemt.js → CEkqhJ8-.js} +1 -1
  24. package/build/client/_app/immutable/chunks/CEkqhJ8-.js.br +0 -0
  25. package/build/client/_app/immutable/chunks/CEkqhJ8-.js.gz +0 -0
  26. package/build/client/_app/immutable/chunks/{60JlvdhQ.js → CLy6GMrT.js} +1 -1
  27. package/build/client/_app/immutable/chunks/CLy6GMrT.js.br +0 -0
  28. package/build/client/_app/immutable/chunks/CLy6GMrT.js.gz +0 -0
  29. package/build/client/_app/immutable/chunks/{BEKG1Stw.js → CM7YbvcE.js} +1 -1
  30. package/build/client/_app/immutable/chunks/CM7YbvcE.js.br +0 -0
  31. package/build/client/_app/immutable/chunks/CM7YbvcE.js.gz +0 -0
  32. package/build/client/_app/immutable/chunks/{C69eHrL5.js → CogyHa6-.js} +1 -1
  33. package/build/client/_app/immutable/chunks/CogyHa6-.js.br +0 -0
  34. package/build/client/_app/immutable/chunks/CogyHa6-.js.gz +0 -0
  35. package/build/client/_app/immutable/chunks/{B597Cbe1.js → CuH1GpU9.js} +1 -1
  36. package/build/client/_app/immutable/chunks/CuH1GpU9.js.br +0 -0
  37. package/build/client/_app/immutable/chunks/CuH1GpU9.js.gz +0 -0
  38. package/build/client/_app/immutable/chunks/{DVeiiKip.js → D90Ga_Id.js} +1 -1
  39. package/build/client/_app/immutable/chunks/D90Ga_Id.js.br +0 -0
  40. package/build/client/_app/immutable/chunks/D90Ga_Id.js.gz +0 -0
  41. package/build/client/_app/immutable/chunks/{DjCsArDj.js → D9uOQyZY.js} +1 -1
  42. package/build/client/_app/immutable/chunks/D9uOQyZY.js.br +0 -0
  43. package/build/client/_app/immutable/chunks/D9uOQyZY.js.gz +0 -0
  44. package/build/client/_app/immutable/chunks/{CvZklcJq.js → DQWdnL7h.js} +1 -1
  45. package/build/client/_app/immutable/chunks/DQWdnL7h.js.br +0 -0
  46. package/build/client/_app/immutable/chunks/DQWdnL7h.js.gz +0 -0
  47. package/build/client/_app/immutable/chunks/{CSntU4ww.js → DZhp5Clk.js} +1 -1
  48. package/build/client/_app/immutable/chunks/DZhp5Clk.js.br +0 -0
  49. package/build/client/_app/immutable/chunks/DZhp5Clk.js.gz +0 -0
  50. package/build/client/_app/immutable/chunks/DjTSkyf1.js +2 -0
  51. package/build/client/_app/immutable/chunks/DjTSkyf1.js.br +0 -0
  52. package/build/client/_app/immutable/chunks/DjTSkyf1.js.gz +0 -0
  53. package/build/client/_app/immutable/chunks/{CPQbfMGI.js → Lo9Y985M.js} +1 -1
  54. package/build/client/_app/immutable/chunks/Lo9Y985M.js.br +0 -0
  55. package/build/client/_app/immutable/chunks/Lo9Y985M.js.gz +0 -0
  56. package/build/client/_app/immutable/chunks/{Cbm0yS9E.js → caSIyyev.js} +1 -1
  57. package/build/client/_app/immutable/chunks/caSIyyev.js.br +0 -0
  58. package/build/client/_app/immutable/chunks/caSIyyev.js.gz +0 -0
  59. package/build/client/_app/immutable/chunks/{IKqZ9EUq.js → n-cYDyaA.js} +5 -5
  60. package/build/client/_app/immutable/chunks/n-cYDyaA.js.br +0 -0
  61. package/build/client/_app/immutable/chunks/n-cYDyaA.js.gz +0 -0
  62. package/build/client/_app/immutable/chunks/{Gbvs-EZ4.js → s_exGbLS.js} +1 -1
  63. package/build/client/_app/immutable/chunks/s_exGbLS.js.br +2 -0
  64. package/build/client/_app/immutable/chunks/s_exGbLS.js.gz +0 -0
  65. package/build/client/_app/immutable/chunks/yQaRdTPY.js +1 -0
  66. package/build/client/_app/immutable/chunks/yQaRdTPY.js.br +0 -0
  67. package/build/client/_app/immutable/chunks/yQaRdTPY.js.gz +0 -0
  68. package/build/client/_app/immutable/entry/app.BgHDSK-f.js +2 -0
  69. package/build/client/_app/immutable/entry/app.BgHDSK-f.js.br +0 -0
  70. package/build/client/_app/immutable/entry/app.BgHDSK-f.js.gz +0 -0
  71. package/build/client/_app/immutable/entry/start.Cv7YY8BY.js +1 -0
  72. package/build/client/_app/immutable/entry/start.Cv7YY8BY.js.br +0 -0
  73. package/build/client/_app/immutable/entry/start.Cv7YY8BY.js.gz +0 -0
  74. package/build/client/_app/immutable/nodes/{0.CPXJEdVC.js → 0.DuFkC-WN.js} +1 -1
  75. package/build/client/_app/immutable/nodes/0.DuFkC-WN.js.br +0 -0
  76. package/build/client/_app/immutable/nodes/0.DuFkC-WN.js.gz +0 -0
  77. package/build/client/_app/immutable/nodes/{1.BsHjzKoN.js → 1.BXoD9o7T.js} +1 -1
  78. package/build/client/_app/immutable/nodes/1.BXoD9o7T.js.br +0 -0
  79. package/build/client/_app/immutable/nodes/1.BXoD9o7T.js.gz +0 -0
  80. package/build/client/_app/immutable/nodes/{10.JvkeSj5x.js → 10.Cei28q9Z.js} +1 -1
  81. package/build/client/_app/immutable/nodes/10.Cei28q9Z.js.br +0 -0
  82. package/build/client/_app/immutable/nodes/10.Cei28q9Z.js.gz +0 -0
  83. package/build/client/_app/immutable/nodes/{11.C9viE404.js → 11.BstaTigc.js} +1 -1
  84. package/build/client/_app/immutable/nodes/11.BstaTigc.js.br +0 -0
  85. package/build/client/_app/immutable/nodes/11.BstaTigc.js.gz +0 -0
  86. package/build/client/_app/immutable/nodes/{12.BWVqITW1.js → 12.C26mRRF_.js} +1 -1
  87. package/build/client/_app/immutable/nodes/12.C26mRRF_.js.br +0 -0
  88. package/build/client/_app/immutable/nodes/12.C26mRRF_.js.gz +0 -0
  89. package/build/client/_app/immutable/nodes/{13.D0u53Jpp.js → 13.D5cvQijt.js} +1 -1
  90. package/build/client/_app/immutable/nodes/13.D5cvQijt.js.br +0 -0
  91. package/build/client/_app/immutable/nodes/13.D5cvQijt.js.gz +0 -0
  92. package/build/client/_app/immutable/nodes/{14.CNClDl2g.js → 14.ixNG0i6M.js} +1 -1
  93. package/build/client/_app/immutable/nodes/14.ixNG0i6M.js.br +0 -0
  94. package/build/client/_app/immutable/nodes/14.ixNG0i6M.js.gz +0 -0
  95. package/build/client/_app/immutable/nodes/{15.BJShjxpx.js → 15.U-YpZ2mY.js} +1 -1
  96. package/build/client/_app/immutable/nodes/15.U-YpZ2mY.js.br +0 -0
  97. package/build/client/_app/immutable/nodes/15.U-YpZ2mY.js.gz +0 -0
  98. package/build/client/_app/immutable/nodes/{16.Bb3PPsch.js → 16.DYyQlMIj.js} +1 -1
  99. package/build/client/_app/immutable/nodes/16.DYyQlMIj.js.br +0 -0
  100. package/build/client/_app/immutable/nodes/16.DYyQlMIj.js.gz +0 -0
  101. package/build/client/_app/immutable/nodes/{17.COjMgZvi.js → 17.CjNdiCZc.js} +1 -1
  102. package/build/client/_app/immutable/nodes/17.CjNdiCZc.js.br +0 -0
  103. package/build/client/_app/immutable/nodes/17.CjNdiCZc.js.gz +0 -0
  104. package/build/client/_app/immutable/nodes/{19.BbeSGQyg.js → 19.aX3EJcGD.js} +1 -1
  105. package/build/client/_app/immutable/nodes/19.aX3EJcGD.js.br +0 -0
  106. package/build/client/_app/immutable/nodes/19.aX3EJcGD.js.gz +0 -0
  107. package/build/client/_app/immutable/nodes/2.MoMLMEsA.js +26 -0
  108. package/build/client/_app/immutable/nodes/2.MoMLMEsA.js.br +0 -0
  109. package/build/client/_app/immutable/nodes/2.MoMLMEsA.js.gz +0 -0
  110. package/build/client/_app/immutable/nodes/{20.2D2FCLQq.js → 20.BcpIwTNR.js} +1 -1
  111. package/build/client/_app/immutable/nodes/20.BcpIwTNR.js.br +0 -0
  112. package/build/client/_app/immutable/nodes/20.BcpIwTNR.js.gz +0 -0
  113. package/build/client/_app/immutable/nodes/{21.xQ_KUjAi.js → 21.BdNRERDN.js} +1 -1
  114. package/build/client/_app/immutable/nodes/21.BdNRERDN.js.br +0 -0
  115. package/build/client/_app/immutable/nodes/21.BdNRERDN.js.gz +0 -0
  116. package/build/client/_app/immutable/nodes/{22.DuszjIrq.js → 22.UIlcgKG0.js} +1 -1
  117. package/build/client/_app/immutable/nodes/22.UIlcgKG0.js.br +0 -0
  118. package/build/client/_app/immutable/nodes/22.UIlcgKG0.js.gz +0 -0
  119. package/build/client/_app/immutable/nodes/{23.CKoLeDhM.js → 23.B59tMz3Z.js} +1 -1
  120. package/build/client/_app/immutable/nodes/23.B59tMz3Z.js.br +0 -0
  121. package/build/client/_app/immutable/nodes/23.B59tMz3Z.js.gz +0 -0
  122. package/build/client/_app/immutable/nodes/{24.CH1byq7o.js → 24.DQjTWFAo.js} +1 -1
  123. package/build/client/_app/immutable/nodes/24.DQjTWFAo.js.br +0 -0
  124. package/build/client/_app/immutable/nodes/24.DQjTWFAo.js.gz +0 -0
  125. package/build/client/_app/immutable/nodes/25.DX_SiK1J.js +14 -0
  126. package/build/client/_app/immutable/nodes/25.DX_SiK1J.js.br +0 -0
  127. package/build/client/_app/immutable/nodes/25.DX_SiK1J.js.gz +0 -0
  128. package/build/client/_app/immutable/nodes/{26.CHB__H6C.js → 26.Bqb00dxX.js} +1 -1
  129. package/build/client/_app/immutable/nodes/26.Bqb00dxX.js.br +0 -0
  130. package/build/client/_app/immutable/nodes/26.Bqb00dxX.js.gz +0 -0
  131. package/build/client/_app/immutable/nodes/{28.pI-7Vnsb.js → 28.DAJOyPmp.js} +1 -1
  132. package/build/client/_app/immutable/nodes/28.DAJOyPmp.js.br +0 -0
  133. package/build/client/_app/immutable/nodes/28.DAJOyPmp.js.gz +0 -0
  134. package/build/client/_app/immutable/nodes/{3.6gLsJ5iP.js → 3.CU4V9yAo.js} +1 -1
  135. package/build/client/_app/immutable/nodes/3.CU4V9yAo.js.br +0 -0
  136. package/build/client/_app/immutable/nodes/3.CU4V9yAo.js.gz +0 -0
  137. package/build/client/_app/immutable/nodes/{4.uKPQRIJV.js → 4.CIKGpO-h.js} +1 -1
  138. package/build/client/_app/immutable/nodes/4.CIKGpO-h.js.br +0 -0
  139. package/build/client/_app/immutable/nodes/4.CIKGpO-h.js.gz +0 -0
  140. package/build/client/_app/immutable/nodes/{6.CmppqGHA.js → 6.DV-LKwUi.js} +1 -1
  141. package/build/client/_app/immutable/nodes/6.DV-LKwUi.js.br +0 -0
  142. package/build/client/_app/immutable/nodes/6.DV-LKwUi.js.gz +0 -0
  143. package/build/client/_app/immutable/nodes/{7.DDZOqRAy.js → 7.tNzUdkoK.js} +1 -1
  144. package/build/client/_app/immutable/nodes/7.tNzUdkoK.js.br +0 -0
  145. package/build/client/_app/immutable/nodes/{7.DDZOqRAy.js.gz → 7.tNzUdkoK.js.gz} +0 -0
  146. package/build/client/_app/immutable/nodes/{8.DH6CiiFf.js → 8._d4-szlB.js} +1 -1
  147. package/build/client/_app/immutable/nodes/8._d4-szlB.js.br +0 -0
  148. package/build/client/_app/immutable/nodes/8._d4-szlB.js.gz +0 -0
  149. package/build/client/_app/immutable/nodes/{9.jlOFlXh8.js → 9.CIkGA4QL.js} +1 -1
  150. package/build/client/_app/immutable/nodes/9.CIkGA4QL.js.br +0 -0
  151. package/build/client/_app/immutable/nodes/9.CIkGA4QL.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-kIQeRhX8.js} +2 -2
  161. package/build/server/chunks/chunks/{feedback.js-CNjq89nb.js → feedback.js-Cn_aMwGt.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--IrZpGIw.js} +3 -3
  165. package/build/server/chunks/chunks/{keychain.js-CTV5MMKd.js → keychain.js-EzFAr7ky.js} +2 -2
  166. package/build/server/chunks/chunks/{marketplace-service.js-DZ7N3g7i.js → marketplace-service.js-BWJLUgci.js} +2 -2
  167. package/build/server/chunks/chunks/{page.js-slDjdKdN.js → page.js-uCRgTfkr.js} +2 -2
  168. package/build/server/chunks/chunks/{previewhelper2.js-D62yPZ3-.js → previewhelper2.js-CheYey18.js} +2 -2
  169. package/build/server/chunks/chunks/{repo.js-CpMWC7Dl.js → repo.js-mwBuCebU.js} +2 -2
  170. package/build/server/chunks/chunks/{runtime.js-n2Nl0Kn0.js → runtime.js-DOQwJsyV.js} +2629 -935
  171. package/build/server/chunks/chunks/{service.js-BBKBSt-r.js → service.js-BhegRU14.js} +2 -2
  172. package/build/server/chunks/chunks/{service2.js-D8unm3Dr.js → service2.js-CjX60BFh.js} +24 -10
  173. package/build/server/chunks/chunks/{starter.js-BJtAaz_v.js → starter.js-BoD-v_RX.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-DRvLRn9a.js} +2 -2
  176. package/build/server/chunks/entries/endpoints/api/apps/_op_/{_server.ts.js-DU337wCA.js → _server.ts.js-LjS85cY1.js} +6 -5
  177. package/build/server/chunks/entries/endpoints/api/cloud/{_server.ts.js-DUjwvbDq.js → _server.ts.js-CPapFlxB.js} +3 -3
  178. package/build/server/chunks/entries/endpoints/api/cloud/previews/{_server.ts.js-fB_wI3kP.js → _server.ts.js-C5rpQOtz.js} +6 -5
  179. package/build/server/chunks/entries/endpoints/api/events/{_server.ts.js-HZjTDOIW.js → _server.ts.js-Bh9CCsJR.js} +6 -5
  180. package/build/server/chunks/entries/endpoints/api/files/{_server.ts.js-vtgE6dmd.js → _server.ts.js-B81tIgYM.js} +6 -5
  181. package/build/server/chunks/entries/endpoints/api/firstmate/chat/{_server.ts.js-CBUM_cHq.js → _server.ts.js-DJe3RKYn.js} +6 -5
  182. package/build/server/chunks/entries/endpoints/api/firstmate/commands/{_server.ts.js-gqNm0NgZ.js → _server.ts.js-DrNM-EZz.js} +9 -5
  183. package/build/server/chunks/entries/endpoints/api/firstmate/dismiss/{_server.ts.js-DVTt9exZ.js → _server.ts.js-CyHX-fjj.js} +6 -5
  184. package/build/server/chunks/entries/endpoints/api/firstmate/input/{_server.ts.js-DI8pSLdx.js → _server.ts.js-BGNA3rRL.js} +6 -5
  185. package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/{_server.ts.js-DwNKcPAZ.js → _server.ts.js-gxW-vjq6.js} +6 -5
  186. package/build/server/chunks/entries/endpoints/api/firstmate/messages/{_server.ts.js-gn9Pb6xh.js → _server.ts.js-CjKZKlSx.js} +7 -6
  187. package/build/server/chunks/entries/endpoints/api/firstmate/pick/{_server.ts.js-BsuIck0U.js → _server.ts.js-Bf6fufw1.js} +6 -5
  188. package/build/server/chunks/entries/endpoints/api/firstmate/reactions/{_server.ts.js-Du1j3gY1.js → _server.ts.js-CunTg6B4.js} +6 -5
  189. package/build/server/chunks/entries/endpoints/api/firstmate/start/{_server.ts.js-D5_z22cM.js → _server.ts.js-BFn0GxSV.js} +6 -5
  190. package/build/server/chunks/entries/endpoints/api/fleet/{_server.ts.js-CqUodLtV.js → _server.ts.js-BPiDH1by.js} +6 -5
  191. package/build/server/chunks/entries/endpoints/api/gateway/{_server.ts.js-Bqvpqc3W.js → _server.ts.js-CH_ZiSS9.js} +6 -5
  192. package/build/server/chunks/entries/endpoints/api/health/{_server.ts.js-U1yy4XTd.js → _server.ts.js-CHeUHBaj.js} +6 -5
  193. package/build/server/chunks/entries/endpoints/api/inbox/{_server.ts.js-Bt1HEbxQ.js → _server.ts.js-B6-h2R89.js} +6 -5
  194. package/build/server/chunks/entries/endpoints/api/inbox/report/{_server.ts.js-B1QGwJJx.js → _server.ts.js-CtXL8XCq.js} +6 -5
  195. package/build/server/chunks/entries/endpoints/api/insights/{_server.ts.js-4D31QJkx.js → _server.ts.js-CdsJGtOe.js} +6 -5
  196. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/config/{_server.ts.js-BB9t2sPI.js → _server.ts.js-yVkcjBkv.js} +6 -5
  197. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/{_server.ts.js-C0lNGC_e.js → _server.ts.js-BLyJO_Mo.js} +7 -6
  198. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/summary/{_server.ts.js-BCucQ7kV.js → _server.ts.js-Dp9Lk4LX.js} +7 -6
  199. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/icon/_icon_/{_server.ts.js-K051c2NK.js → _server.ts.js-BKYjzuX1.js} +5 -4
  200. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/load/{_server.ts.js-DXp7CBKJ.js → _server.ts.js-DXIA842d.js} +2 -2
  201. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/ui/_...path_/{_server.ts.js-BZjRhE_E.js → _server.ts.js-DkhsnbSG.js} +6 -5
  202. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/update/{_server.ts.js-C6pSTIZl.js → _server.ts.js-SeWa829w.js} +2 -2
  203. package/build/server/chunks/entries/endpoints/api/plugins/{_server.ts.js-CPTGODgJ.js → _server.ts.js-CIQPuCVw.js} +6 -5
  204. package/build/server/chunks/entries/endpoints/api/plugins/inspect/{_server.ts.js-CYyhaWOu.js → _server.ts.js-DT0sbWwu.js} +2 -2
  205. package/build/server/chunks/entries/endpoints/api/plugins/install/{_server.ts.js-LOfrDPqm.js → _server.ts.js-Cn2rbNUE.js} +2 -2
  206. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/{_server.ts.js-CqJSn65A.js → _server.ts.js-D8cqx7e8.js} +7 -6
  207. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/icon/_name_/{_server.ts.js-vWLUvqe2.js → _server.ts.js-DNxzMqSL.js} +7 -6
  208. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/registries/{_server.ts.js-CIy3Yxnj.js → _server.ts.js-CMrMjFz3.js} +7 -6
  209. package/build/server/chunks/entries/endpoints/api/plugins/updates/{_server.ts.js-BXKekEzg.js → _server.ts.js-Dk4WI0lC.js} +2 -2
  210. package/build/server/chunks/entries/endpoints/api/previews/check/{_server.ts.js-DZnqmxa7.js → _server.ts.js-CybVxq0q.js} +6 -5
  211. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/{_server.ts.js-clRCP6Vz.js → _server.ts.js-Du0F1uRC.js} +7 -6
  212. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/{_server.ts.js-C0v3Eifj.js → _server.ts.js-DktLe6aY.js} +7 -6
  213. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/{_server.ts.js-B1P26NiL.js → _server.ts.js-B3AFWOQ5.js} +7 -6
  214. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/{_server.ts.js-_BWFybXT.js → _server.ts.js-CFZKkvHd.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-DOuE8mQe.js} +7 -6
  216. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/{_server.ts.js-Cp4DC5RF.js → _server.ts.js-Dnqj-B1I.js} +7 -6
  217. package/build/server/chunks/entries/endpoints/api/second-mates/_id_/peek/{_server.ts.js-CFQmNKZw.js → _server.ts.js-CsQ9Iy4e.js} +6 -5
  218. package/build/server/chunks/entries/endpoints/api/services/{_server.ts.js-C0Hp3ghu.js → _server.ts.js-Q9_2hESc.js} +6 -5
  219. package/build/server/chunks/entries/endpoints/api/setup/{_server.ts.js-OI33JqAV.js → _server.ts.js-fJhkF-dq.js} +6 -5
  220. package/build/server/chunks/entries/endpoints/api/slots/{_server.ts.js-BOetbdrI.js → _server.ts.js-DE5Za2Qf.js} +6 -5
  221. package/build/server/chunks/entries/endpoints/api/tasks/_id_/{_server.ts.js-BE02dpgR.js → _server.ts.js-B_Wi2EUQ.js} +7 -6
  222. package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/{_server.ts.js-eXiYz0dl.js → _server.ts.js-ESVAlaL0.js} +6 -5
  223. package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/{_server.ts.js-BzPQmqhd.js → _server.ts.js-BYen5YjB.js} +6 -5
  224. package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/{_server.ts.js-DernPNNa.js → _server.ts.js-D9JD2y98.js} +6 -5
  225. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/{_server.ts.js-CIJerTYj.js → _server.ts.js-BcZEsLxW.js} +6 -5
  226. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/helper/{_server.ts.js-wMw-B2LV.js → _server.ts.js-nEQ-LWc3.js} +6 -5
  227. package/build/server/chunks/entries/endpoints/api/vault/{_server.ts.js-BQVOZ_2W.js → _server.ts.js-BglmY8Dv.js} +6 -5
  228. package/build/server/chunks/entries/endpoints/api/wheelhouse/source/{_server.ts.js-CBdZ3Hvx.js → _server.ts.js-Dcu4o_kg.js} +2 -2
  229. package/build/server/chunks/entries/endpoints/api/wheelhouse/update/{_server.ts.js-BjmmYFHq.js → _server.ts.js-D8DNzTCl.js} +2 -2
  230. package/build/server/chunks/entries/endpoints/api/wheelhouse/upgrade/{_server.ts.js-DxsJBLJe.js → _server.ts.js-C88U185K.js} +2 -2
  231. package/build/server/chunks/entries/endpoints/tasks/_id_/review/{_server.ts.js-DXYaC6o9.js → _server.ts.js-D5X3NXNQ.js} +6 -5
  232. package/build/server/chunks/entries/{hooks.server.js-CN-DQ0lm.js → hooks.server.js-BoVfKVBv.js} +6 -5
  233. package/build/server/chunks/entries/pages/{_layout.server.ts.js-B3IyG3tO.js → _layout.server.ts.js-DonkPB5v.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-BPlndbwo.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-D0TSKupF.js} +2 -2
  238. package/build/server/chunks/entries/pages/deck/{_page.server.ts.js-CRoejRrt.js → _page.server.ts.js-DGxVR_vz.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-Ccs1E7eE.js} +2 -2
  241. package/build/server/chunks/entries/pages/harbour/{_page.server.ts.js-aNzCSnrW.js → _page.server.ts.js-DdVNEwXK.js} +2 -2
  242. package/build/server/chunks/entries/pages/headroom/{_page.server.ts.js-DYPjOXZ7.js → _page.server.ts.js-DJkL5LjM.js} +2 -2
  243. package/build/server/chunks/entries/pages/inbox/{_page.server.ts.js-CvLRSeh7.js → _page.server.ts.js-zxQIlwfl.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-XD-2cABX.js} +2 -2
  246. package/build/server/chunks/entries/pages/projects/_id_/{_page.server.ts.js-Drm6Ahc4.js → _page.server.ts.js-BgCyi1X-.js} +3 -3
  247. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/{_page.server.ts.js-DdJMUWNL.js → _page.server.ts.js-fo0xabfK.js} +3 -3
  248. package/build/server/chunks/entries/pages/projects/_id_/passage/{_page.server.ts.js-1GII3zKY.js → _page.server.ts.js-Cbg44XDV.js} +4 -4
  249. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/{_page.server.ts.js-CVsOhaVz.js → _page.server.ts.js-BUp_Y-KL.js} +2 -2
  250. package/build/server/chunks/entries/pages/remotes/{_page.server.ts.js-Cva09MAW.js → _page.server.ts.js-0-aDiI-u.js} +2 -2
  251. package/build/server/chunks/entries/pages/settings/cloud/{_page.server.ts.js-CMMEHMa0.js → _page.server.ts.js-DUYpwlCw.js} +2 -2
  252. package/build/server/chunks/entries/pages/settings/gateway/{_page.server.ts.js-CaBLC48A.js → _page.server.ts.js-B-EvG_LJ.js} +2 -2
  253. package/build/server/chunks/entries/pages/settings/plugins/{_page.server.ts.js-C80JIole.js → _page.server.ts.js-e1XEpYYO.js} +2 -2
  254. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/{_page.server.ts.js-GcEMXNzE.js → _page.server.ts.js-DQlX1ZXD.js} +2 -2
  255. package/build/server/chunks/entries/pages/settings/setup/{_page.server.ts.js-fmudFG1R.js → _page.server.ts.js-3vhPyRFz.js} +2 -2
  256. package/build/server/chunks/entries/pages/settings/update/{_page.server.ts.js-Ck0V4NqF.js → _page.server.ts.js-CmGgMlAh.js} +2 -2
  257. package/build/server/chunks/entries/pages/setup/{_page.server.ts.js-BT2aSao4.js → _page.server.ts.js-CcUv_Pl5.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-BSp2WAoD.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-BUVzUDIr.js} +2 -2
  262. package/build/server/chunks/entries/pages/time/{_page.server.ts.js-PjptcjBY.js → _page.server.ts.js-CthFCAvj.js} +2 -2
  263. package/build/server/chunks/{handler-DhhKWgIp.js → handler-CoNcksE3.js} +3 -3
  264. package/build/server/chunks/{index.js-utiPQsQj.js → index.js-DeIgBt_r.js} +2 -2
  265. package/build/server/chunks/{manifest.js-1v5Twa8d.js → manifest.js-DABDEm-u.js} +86 -86
  266. package/build/server/chunks/nodes/{0.js-t5p4uwR-.js → 0.js-YKoWN0t_.js} +10 -9
  267. package/build/server/chunks/nodes/{1.js-B23tX379.js → 1.js-BrhSX20y.js} +2 -2
  268. package/build/server/chunks/nodes/{10.js-BYgrUxes.js → 10.js-DfgINkv2.js} +2 -2
  269. package/build/server/chunks/nodes/{11.js-D8KeSOxn.js → 11.js-DiTSd3ll.js} +8 -7
  270. package/build/server/chunks/nodes/{12.js-CSqzXf2C.js → 12.js-50Nn94Ac.js} +9 -8
  271. package/build/server/chunks/nodes/{13.js-BucPbiJc.js → 13.js-Bqj2sWs_.js} +9 -8
  272. package/build/server/chunks/nodes/{14.js-D5KFW0LX.js → 14.js-Cv1hpyWZ.js} +10 -9
  273. package/build/server/chunks/nodes/{15.js-DMi0cMxP.js → 15.js-D7gELe63.js} +9 -8
  274. package/build/server/chunks/nodes/{16.js-garu2VVL.js → 16.js-DCHbFZQk.js} +6 -6
  275. package/build/server/chunks/nodes/{17.js-CIGvZ14P.js → 17.js-CRE1rbZ5.js} +2 -2
  276. package/build/server/chunks/nodes/{19.js-D0EE2SJv.js → 19.js-CFuW5rd2.js} +6 -6
  277. package/build/server/chunks/nodes/{2.js-CGs6HugM.js → 2.js-BgPLJqKL.js} +9 -8
  278. package/build/server/chunks/nodes/{20.js-CVajTuJ7.js → 20.js-DGixTdKt.js} +8 -7
  279. package/build/server/chunks/nodes/{21.js-C53DsYbm.js → 21.js-fW8cmY-P.js} +8 -7
  280. package/build/server/chunks/nodes/{22.js-IhEljvpJ.js → 22.js-BLhqsr4_.js} +8 -7
  281. package/build/server/chunks/nodes/{23.js-xMwn6OS_.js → 23.js-I9w_LkUL.js} +9 -8
  282. package/build/server/chunks/nodes/{24.js-Bf2yyWwh.js → 24.js-Dbyn5eyG.js} +4 -4
  283. package/build/server/chunks/nodes/{25.js-B4yvgFEW.js → 25.js-Dc-E-pmn.js} +10 -9
  284. package/build/server/chunks/nodes/{26.js-BgrkaBRi.js → 26.js-Cqr1BLCa.js} +10 -9
  285. package/build/server/chunks/nodes/{27.js-CmaLV07r.js → 27.js-JKZQuSb7.js} +8 -7
  286. package/build/server/chunks/nodes/{28.js-D5cRvkTM.js → 28.js-BN16VFpu.js} +8 -7
  287. package/build/server/chunks/nodes/{3.js-Dm2pmcK2.js → 3.js-CZln8kr1.js} +8 -7
  288. package/build/server/chunks/nodes/{4.js-C4ho5OJp.js → 4.js-mbQFO9SD.js} +9 -8
  289. package/build/server/chunks/nodes/{5.js-y4HoD1YR.js → 5.js-gufn1Eo1.js} +7 -6
  290. package/build/server/chunks/nodes/{6.js-CjlWBc3h.js → 6.js-Cdfpyr6S.js} +8 -7
  291. package/build/server/chunks/nodes/{7.js-Bu-qbDJ5.js → 7.js-DRJdiMQL.js} +8 -7
  292. package/build/server/chunks/nodes/{8.js-qv_Z5rCa.js → 8.js-B4stLJHw.js} +9 -8
  293. package/build/server/chunks/nodes/{9.js-txPQIe_t.js → 9.js-DYcjt0Hs.js} +2 -2
  294. package/dist/cli.js +404 -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 +0 -1
  303. package/build/client/_app/immutable/chunks/B-rYWQGG.js.br +0 -0
  304. package/build/client/_app/immutable/chunks/B-rYWQGG.js.gz +0 -0
  305. package/build/client/_app/immutable/chunks/B597Cbe1.js.br +0 -0
  306. package/build/client/_app/immutable/chunks/B597Cbe1.js.gz +0 -0
  307. package/build/client/_app/immutable/chunks/BEKG1Stw.js.br +0 -0
  308. package/build/client/_app/immutable/chunks/BEKG1Stw.js.gz +0 -0
  309. package/build/client/_app/immutable/chunks/BPAziDlG.js.br +0 -0
  310. package/build/client/_app/immutable/chunks/BPAziDlG.js.gz +0 -0
  311. package/build/client/_app/immutable/chunks/BiiAyXOY.js.br +0 -0
  312. package/build/client/_app/immutable/chunks/BiiAyXOY.js.gz +0 -0
  313. package/build/client/_app/immutable/chunks/C69eHrL5.js.br +0 -0
  314. package/build/client/_app/immutable/chunks/C69eHrL5.js.gz +0 -0
  315. package/build/client/_app/immutable/chunks/CC5Ts_xe.js.br +0 -0
  316. package/build/client/_app/immutable/chunks/CC5Ts_xe.js.gz +0 -0
  317. package/build/client/_app/immutable/chunks/CPQbfMGI.js.br +0 -0
  318. package/build/client/_app/immutable/chunks/CPQbfMGI.js.gz +0 -0
  319. package/build/client/_app/immutable/chunks/CSntU4ww.js.br +0 -0
  320. package/build/client/_app/immutable/chunks/CSntU4ww.js.gz +0 -0
  321. package/build/client/_app/immutable/chunks/Cbm0yS9E.js.br +0 -0
  322. package/build/client/_app/immutable/chunks/Cbm0yS9E.js.gz +0 -0
  323. package/build/client/_app/immutable/chunks/ChjkQemt.js.br +0 -0
  324. package/build/client/_app/immutable/chunks/ChjkQemt.js.gz +0 -0
  325. package/build/client/_app/immutable/chunks/CvZklcJq.js.br +0 -0
  326. package/build/client/_app/immutable/chunks/CvZklcJq.js.gz +0 -0
  327. package/build/client/_app/immutable/chunks/DSAFUgJn.js.br +0 -0
  328. package/build/client/_app/immutable/chunks/DSAFUgJn.js.gz +0 -0
  329. package/build/client/_app/immutable/chunks/DVeiiKip.js.br +0 -0
  330. package/build/client/_app/immutable/chunks/DVeiiKip.js.gz +0 -0
  331. package/build/client/_app/immutable/chunks/DjCsArDj.js.br +0 -0
  332. package/build/client/_app/immutable/chunks/DjCsArDj.js.gz +0 -0
  333. package/build/client/_app/immutable/chunks/DnBZO8Il.js.br +0 -0
  334. package/build/client/_app/immutable/chunks/DnBZO8Il.js.gz +0 -0
  335. package/build/client/_app/immutable/chunks/Gbvs-EZ4.js.br +0 -1
  336. package/build/client/_app/immutable/chunks/Gbvs-EZ4.js.gz +0 -0
  337. package/build/client/_app/immutable/chunks/IKqZ9EUq.js.br +0 -0
  338. package/build/client/_app/immutable/chunks/IKqZ9EUq.js.gz +0 -0
  339. package/build/client/_app/immutable/chunks/rZ2-WaWD.js +0 -2
  340. package/build/client/_app/immutable/chunks/rZ2-WaWD.js.br +0 -0
  341. package/build/client/_app/immutable/chunks/rZ2-WaWD.js.gz +0 -0
  342. package/build/client/_app/immutable/chunks/wU4H_Xw3.js +0 -1
  343. package/build/client/_app/immutable/chunks/wU4H_Xw3.js.br +0 -0
  344. package/build/client/_app/immutable/chunks/wU4H_Xw3.js.gz +0 -0
  345. package/build/client/_app/immutable/entry/app.ERrI8AQ5.js +0 -2
  346. package/build/client/_app/immutable/entry/app.ERrI8AQ5.js.br +0 -0
  347. package/build/client/_app/immutable/entry/app.ERrI8AQ5.js.gz +0 -0
  348. package/build/client/_app/immutable/entry/start.Dw33pepJ.js +0 -1
  349. package/build/client/_app/immutable/entry/start.Dw33pepJ.js.br +0 -0
  350. package/build/client/_app/immutable/entry/start.Dw33pepJ.js.gz +0 -0
  351. package/build/client/_app/immutable/nodes/0.CPXJEdVC.js.br +0 -0
  352. package/build/client/_app/immutable/nodes/0.CPXJEdVC.js.gz +0 -0
  353. package/build/client/_app/immutable/nodes/1.BsHjzKoN.js.br +0 -0
  354. package/build/client/_app/immutable/nodes/1.BsHjzKoN.js.gz +0 -0
  355. package/build/client/_app/immutable/nodes/10.JvkeSj5x.js.br +0 -0
  356. package/build/client/_app/immutable/nodes/10.JvkeSj5x.js.gz +0 -0
  357. package/build/client/_app/immutable/nodes/11.C9viE404.js.br +0 -0
  358. package/build/client/_app/immutable/nodes/11.C9viE404.js.gz +0 -0
  359. package/build/client/_app/immutable/nodes/12.BWVqITW1.js.br +0 -0
  360. package/build/client/_app/immutable/nodes/12.BWVqITW1.js.gz +0 -0
  361. package/build/client/_app/immutable/nodes/13.D0u53Jpp.js.br +0 -0
  362. package/build/client/_app/immutable/nodes/13.D0u53Jpp.js.gz +0 -0
  363. package/build/client/_app/immutable/nodes/14.CNClDl2g.js.br +0 -0
  364. package/build/client/_app/immutable/nodes/14.CNClDl2g.js.gz +0 -0
  365. package/build/client/_app/immutable/nodes/15.BJShjxpx.js.br +0 -0
  366. package/build/client/_app/immutable/nodes/15.BJShjxpx.js.gz +0 -0
  367. package/build/client/_app/immutable/nodes/16.Bb3PPsch.js.br +0 -0
  368. package/build/client/_app/immutable/nodes/16.Bb3PPsch.js.gz +0 -0
  369. package/build/client/_app/immutable/nodes/17.COjMgZvi.js.br +0 -0
  370. package/build/client/_app/immutable/nodes/17.COjMgZvi.js.gz +0 -0
  371. package/build/client/_app/immutable/nodes/19.BbeSGQyg.js.br +0 -0
  372. package/build/client/_app/immutable/nodes/19.BbeSGQyg.js.gz +0 -0
  373. package/build/client/_app/immutable/nodes/2.CBjl08IG.js +0 -25
  374. package/build/client/_app/immutable/nodes/2.CBjl08IG.js.br +0 -0
  375. package/build/client/_app/immutable/nodes/2.CBjl08IG.js.gz +0 -0
  376. package/build/client/_app/immutable/nodes/20.2D2FCLQq.js.br +0 -0
  377. package/build/client/_app/immutable/nodes/20.2D2FCLQq.js.gz +0 -0
  378. package/build/client/_app/immutable/nodes/21.xQ_KUjAi.js.br +0 -0
  379. package/build/client/_app/immutable/nodes/21.xQ_KUjAi.js.gz +0 -0
  380. package/build/client/_app/immutable/nodes/22.DuszjIrq.js.br +0 -0
  381. package/build/client/_app/immutable/nodes/22.DuszjIrq.js.gz +0 -0
  382. package/build/client/_app/immutable/nodes/23.CKoLeDhM.js.br +0 -0
  383. package/build/client/_app/immutable/nodes/23.CKoLeDhM.js.gz +0 -0
  384. package/build/client/_app/immutable/nodes/24.CH1byq7o.js.br +0 -0
  385. package/build/client/_app/immutable/nodes/24.CH1byq7o.js.gz +0 -0
  386. package/build/client/_app/immutable/nodes/25.BFrDgbR3.js +0 -12
  387. package/build/client/_app/immutable/nodes/25.BFrDgbR3.js.br +0 -0
  388. package/build/client/_app/immutable/nodes/25.BFrDgbR3.js.gz +0 -0
  389. package/build/client/_app/immutable/nodes/26.CHB__H6C.js.br +0 -0
  390. package/build/client/_app/immutable/nodes/26.CHB__H6C.js.gz +0 -0
  391. package/build/client/_app/immutable/nodes/28.pI-7Vnsb.js.br +0 -0
  392. package/build/client/_app/immutable/nodes/28.pI-7Vnsb.js.gz +0 -0
  393. package/build/client/_app/immutable/nodes/3.6gLsJ5iP.js.br +0 -0
  394. package/build/client/_app/immutable/nodes/3.6gLsJ5iP.js.gz +0 -0
  395. package/build/client/_app/immutable/nodes/4.uKPQRIJV.js.br +0 -0
  396. package/build/client/_app/immutable/nodes/4.uKPQRIJV.js.gz +0 -0
  397. package/build/client/_app/immutable/nodes/6.CmppqGHA.js.br +0 -0
  398. package/build/client/_app/immutable/nodes/6.CmppqGHA.js.gz +0 -0
  399. package/build/client/_app/immutable/nodes/7.DDZOqRAy.js.br +0 -0
  400. package/build/client/_app/immutable/nodes/8.DH6CiiFf.js.br +0 -0
  401. package/build/client/_app/immutable/nodes/8.DH6CiiFf.js.gz +0 -0
  402. package/build/client/_app/immutable/nodes/9.jlOFlXh8.js.br +0 -0
  403. 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.1";
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,182 @@ 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 DROPPED_VARIABLES = [
203
+ "TMUX",
204
+ "TMUX_PANE",
205
+ "FM_HOME",
206
+ "CLAUDECODE",
207
+ "CLAUDE_CODE_ENTRYPOINT",
208
+ "CLAUDE_CODE_SSE_PORT",
209
+ "CLAUDE_PID",
210
+ "CLAUDE_SESSION_ID",
211
+ "CLAUDE_PROJECT_DIR",
212
+ "CLAUDE_ENV_FILE",
213
+ "CODEX_THREAD_ID",
214
+ "CODEX_INTERNAL_ORIGINATOR_OVERRIDE"
215
+ ];
216
+ var DROP = new Set(DROPPED_VARIABLES);
217
+ var PASTE_MAX_INPUT_BYTES = 65 * 1024;
218
+
219
+ // cli/harness.ts
220
+ async function savedHarness(file) {
221
+ let text2;
222
+ try {
223
+ text2 = await readFile(file, "utf8");
224
+ } catch (error) {
225
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") return null;
226
+ throw new Error(`Cannot read ${file}. Check its permissions.`, { cause: error });
227
+ }
228
+ try {
229
+ const value = JSON.parse(text2);
230
+ if (!value || typeof value !== "object" || !("harness" in value) || typeof value.harness !== "string") {
231
+ throw new Error("Expected an object with a harness name.");
232
+ }
233
+ return parseHarness(value.harness);
234
+ } catch (error) {
235
+ throw new Error(
236
+ `Invalid saved tool choice in ${file}. Set --harness to replace it, or edit or remove this file.`,
237
+ { cause: error }
238
+ );
239
+ }
240
+ }
241
+ async function saveHarness(file, harness) {
242
+ await mkdir(path2.dirname(file), { recursive: true, mode: 448 });
243
+ const temporary = `${file}.${process.pid}.${randomBytes(8).toString("hex")}.tmp`;
244
+ try {
245
+ await writeFile(temporary, `${JSON.stringify({ harness })}
246
+ `, { flag: "wx", mode: 384 });
247
+ await rename(temporary, file);
248
+ } finally {
249
+ await rm(temporary, { force: true });
250
+ }
251
+ }
252
+ async function chooseHarness(installed, find, env) {
253
+ const fzf = find("fzf");
254
+ if (fzf) {
255
+ const result = spawnSync(fzf, ["--prompt=Firstmate tool > ", "--height=~10", "--no-multi"], {
256
+ input: `${installed.join("\n")}
257
+ `,
258
+ encoding: "utf8",
259
+ env,
260
+ stdio: ["pipe", "pipe", "inherit"]
261
+ });
262
+ if (result.error) throw result.error;
263
+ if (result.status === 1 || result.status === 130 || result.signal === "SIGINT") return null;
264
+ if (result.status !== 0)
265
+ throw new Error("The tool picker failed. Run again with --harness <name>.");
266
+ return result.stdout.trim() || null;
267
+ }
268
+ const input = createInterface({ input: process.stdin, output: process.stdout });
269
+ const controller = new AbortController();
270
+ input.once("SIGINT", () => controller.abort());
271
+ input.once("close", () => controller.abort());
272
+ try {
273
+ const choices = installed.map((name, index) => `${index + 1}. ${name}`).join("\n");
274
+ const answer = (await input.question(`Choose Firstmate's tool:
275
+ ${choices}
276
+ Number (blank to cancel): `, {
277
+ signal: controller.signal
278
+ })).trim();
279
+ if (!answer) return null;
280
+ const choice = /^\d+$/.test(answer) ? installed[Number(answer) - 1] : void 0;
281
+ if (!choice)
282
+ throw new Error(`Choose a number from 1 to ${installed.length}, or use --harness <name>.`);
283
+ return choice;
284
+ } catch (error) {
285
+ if (controller.signal.aborted) return null;
286
+ throw error;
287
+ } finally {
288
+ input.close();
289
+ }
290
+ }
291
+ async function resolveHarness(options2) {
292
+ const { env } = options2;
293
+ const file = path2.join(options2.configDir, "harness.json");
294
+ const requested = options2.explicit ?? env.WHEELHOUSE_HARNESS;
295
+ if (requested !== void 0) {
296
+ const harness2 = parseHarness(requested);
297
+ await saveHarness(file, harness2);
298
+ return harness2;
299
+ }
300
+ const saved = await savedHarness(file);
301
+ if (saved) return saved;
302
+ const interactive = options2.interactive ?? (process.stdin.isTTY === true && process.stdout.isTTY === true);
303
+ if (!interactive) return "claude";
304
+ const find = options2.find ?? ((name) => which(name, env.PATH));
305
+ const installed = HARNESSES.filter((harness2) => find(harness2));
306
+ if (!installed.length) return "claude";
307
+ const selected = installed.length === 1 ? installed[0] : await (options2.choose ?? ((choices) => chooseHarness(choices, find, env)))(installed);
308
+ if (selected === null)
309
+ throw new Error("Tool selection cancelled. No Firstmate session was started.");
310
+ const harness = installed.find((name) => name === selected);
311
+ if (!harness)
312
+ throw new Error(
313
+ "The selected tool is not installed. Choose an installed tool or use --harness <name>."
314
+ );
315
+ await saveHarness(file, harness);
316
+ return harness;
317
+ }
318
+
319
+ // src/lib/chat/attachments.ts
320
+ var UPLOAD_MAX_BYTES = 25 * 1024 * 1024;
321
+ var UNIT = { B: 1, KB: 1024, MB: 1024 * 1024 };
322
+
323
+ // src/lib/hosted.ts
324
+ var PREVIEW_URL_ENV = "WHEELHOUSE_PREVIEW_URL";
325
+ function previewPattern(raw) {
326
+ if (typeof raw !== "string") return null;
327
+ const v = raw.trim();
328
+ if (v.length > 300 || v.split("{port}").length !== 2) return null;
329
+ const m = /^https?:\/\/([a-z0-9.-]*(?:\{port\}[a-z0-9.-]*)?)(?::\d{1,5})?(\/[^?#]*)?$/i.exec(v);
330
+ if (!m) return null;
331
+ const u = URL.parse(v.replace("{port}", "1"));
332
+ return u && u.hostname === m[1].replace("{port}", "1").toLowerCase() ? v : null;
333
+ }
334
+ function workspaceHost(raw) {
335
+ const u = URL.parse(raw?.trim() ?? "");
336
+ if (!u || u.protocol !== "https:" || u.username || u.password || u.port) return null;
337
+ return /^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/i.test(u.hostname) ? u.hostname.toLowerCase() : null;
338
+ }
339
+ function detectHosted(env) {
340
+ const set = env[PREVIEW_URL_ENV]?.trim();
341
+ let problem = null;
342
+ if (set) {
343
+ if (set.toLowerCase() === "off") return { hosted: null, problem: null };
344
+ const pattern = previewPattern(set);
345
+ if (pattern) return { hosted: { pattern, source: "configured" }, problem: null };
346
+ 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.`;
347
+ }
348
+ const gitpod = workspaceHost(env.GITPOD_WORKSPACE_URL);
349
+ if (gitpod) return { hosted: { pattern: `https://{port}-${gitpod}`, source: "gitpod" }, problem };
350
+ const name = env.CODESPACE_NAME?.trim().toLowerCase();
351
+ const domain = env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN?.trim().toLowerCase();
352
+ if (name && domain && /^[a-z0-9-]+$/.test(name) && /^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/.test(domain)) {
353
+ return {
354
+ hosted: { pattern: `https://${name}-{port}.${domain}`, source: "codespaces" },
355
+ problem
356
+ };
357
+ }
358
+ return { hosted: null, problem };
359
+ }
360
+
216
361
  // src/lib/server/firstmate/install.ts
362
+ import { access, constants as constants2, open, stat } from "node:fs/promises";
363
+ import { existsSync, statSync as statSync2 } from "node:fs";
364
+ import path3 from "node:path";
217
365
  var MESSAGING_PURPOSE = "messages to Firstmate";
218
366
  var SUPPORTED_SCRIPTS = [
219
367
  {
@@ -242,10 +390,10 @@ var SUPPORTED_SCRIPTS = [
242
390
  purpose: "worker terminal output"
243
391
  }
244
392
  ];
245
- var scriptPath = (firstmateDir, name) => path.join(firstmateDir, "bin", name);
393
+ var scriptPath = (firstmateDir, name) => path3.join(firstmateDir, "bin", name);
246
394
  var isDir = (p) => {
247
395
  try {
248
- return statSync(p).isDirectory();
396
+ return statSync2(p).isDirectory();
249
397
  } catch {
250
398
  return false;
251
399
  }
@@ -254,15 +402,15 @@ function looksLikeFirstmate(dir) {
254
402
  return existsSync(scriptPath(dir, "fm-fleet-snapshot.sh"));
255
403
  }
256
404
  function findFirstmateDir(start) {
257
- let dir = path.resolve(start);
405
+ let dir = path3.resolve(start);
258
406
  for (; ; ) {
259
407
  if (looksLikeFirstmate(dir)) return dir;
260
- const parent = path.dirname(dir);
408
+ const parent = path3.dirname(dir);
261
409
  if (parent === dir) return null;
262
410
  dir = parent;
263
411
  }
264
412
  }
265
- var expandHome = (p, env) => p === "~" || p.startsWith("~/") ? path.join(env.HOME ?? "", p.slice(1)) : p;
413
+ var expandHome = (p, env) => p === "~" || p.startsWith("~/") ? path3.join(env.HOME ?? "", p.slice(1)) : p;
266
414
  function notFirstmate(dir) {
267
415
  if (!isDir(dir)) return `Firstmate directory not found: ${dir}`;
268
416
  if (!looksLikeFirstmate(dir)) {
@@ -275,7 +423,7 @@ function resolveInstall(input) {
275
423
  let firstmateDir;
276
424
  let source;
277
425
  if (input.firstmate) {
278
- firstmateDir = path.resolve(input.cwd, expandHome(input.firstmate, input.env));
426
+ firstmateDir = path3.resolve(input.cwd, expandHome(input.firstmate, input.env));
279
427
  const wrong = notFirstmate(firstmateDir);
280
428
  if (wrong) return { ok: false, error: wrong, missing: false };
281
429
  source = "flag";
@@ -286,7 +434,7 @@ function resolveInstall(input) {
286
434
  source = "cwd";
287
435
  notes.push(`Found Firstmate at ${firstmateDir}`);
288
436
  } else if (input.remembered) {
289
- firstmateDir = path.resolve(input.remembered.firstmate);
437
+ firstmateDir = path3.resolve(input.remembered.firstmate);
290
438
  const wrong = notFirstmate(firstmateDir);
291
439
  if (wrong) {
292
440
  return {
@@ -307,12 +455,12 @@ function resolveInstall(input) {
307
455
  }
308
456
  let homeDir;
309
457
  if (input.home) {
310
- homeDir = path.resolve(input.cwd, expandHome(input.home, input.env));
458
+ homeDir = path3.resolve(input.cwd, expandHome(input.home, input.env));
311
459
  } else if (input.env.FM_HOME) {
312
- homeDir = path.resolve(input.cwd, expandHome(input.env.FM_HOME, input.env));
460
+ homeDir = path3.resolve(input.cwd, expandHome(input.env.FM_HOME, input.env));
313
461
  notes.push(`Using the operational home from FM_HOME: ${homeDir}`);
314
462
  } else if (source === "remembered" && input.remembered?.home) {
315
- homeDir = path.resolve(input.remembered.home);
463
+ homeDir = path3.resolve(input.remembered.home);
316
464
  } else {
317
465
  homeDir = firstmateDir;
318
466
  }
@@ -320,7 +468,7 @@ function resolveInstall(input) {
320
468
  if (!isDir(homeDir)) {
321
469
  return { ok: false, error: `Firstmate home not found: ${homeDir}`, missing: !flagged };
322
470
  }
323
- if (!isDir(path.join(homeDir, "state"))) {
471
+ if (!isDir(path3.join(homeDir, "state"))) {
324
472
  return {
325
473
  ok: false,
326
474
  error: `${homeDir} is not a Firstmate operational home (it has no state/ directory). Pass --home <dir>.`,
@@ -350,7 +498,7 @@ async function checkScript(firstmateDir, s) {
350
498
  return { ...base, ok: false, problem: `${s.name} is missing` };
351
499
  }
352
500
  try {
353
- await access(file, constants.X_OK);
501
+ await access(file, constants2.X_OK);
354
502
  } catch {
355
503
  return { ...base, ok: false, problem: `${s.name} is not executable` };
356
504
  }
@@ -443,13 +591,13 @@ function defaultKeychain() {
443
591
  }
444
592
 
445
593
  // src/lib/server/plugins/config.ts
446
- import { mkdir, readFile, rename, stat as stat2, writeFile } from "node:fs/promises";
594
+ import { mkdir as mkdir2, readFile as readFile2, rename as rename2, stat as stat2, writeFile as writeFile2 } from "node:fs/promises";
447
595
  import { homedir } from "node:os";
448
- import path2 from "node:path";
596
+ import path4 from "node:path";
449
597
  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");
598
+ if (env.WHEELHOUSE_CONFIG_DIR) return path4.resolve(env.WHEELHOUSE_CONFIG_DIR);
599
+ if (env.XDG_CONFIG_HOME) return path4.join(env.XDG_CONFIG_HOME, "wheelhouse");
600
+ return path4.join(homedir(), ".config", "wheelhouse");
453
601
  }
454
602
  var PLUGINS_FILE = "plugins.json";
455
603
  var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
@@ -499,7 +647,7 @@ function parsePluginConfig(text2) {
499
647
  async function readRaw(file) {
500
648
  let text2;
501
649
  try {
502
- text2 = await readFile(file, "utf8");
650
+ text2 = await readFile2(file, "utf8");
503
651
  } catch (e) {
504
652
  if (e.code === "ENOENT") return { ok: true, raw: null };
505
653
  return { ok: false, error: `could not read ${file}: ${e.message}` };
@@ -509,7 +657,7 @@ async function readRaw(file) {
509
657
  return { ok: true, raw: JSON.parse(text2) };
510
658
  }
511
659
  async function readPluginSettings(dir, id) {
512
- const r = await readRaw(path2.join(dir, PLUGINS_FILE));
660
+ const r = await readRaw(path4.join(dir, PLUGINS_FILE));
513
661
  if (!r.ok) return r;
514
662
  const plugins = r.raw?.plugins ?? {};
515
663
  return { ok: true, settings: { ...plugins[id]?.settings ?? {} } };
@@ -517,7 +665,7 @@ async function readPluginSettings(dir, id) {
517
665
  var editing = Promise.resolve();
518
666
  function editPlugin(dir, id, change) {
519
667
  const run = editing.then(async () => {
520
- const file = path2.join(dir, PLUGINS_FILE);
668
+ const file = path4.join(dir, PLUGINS_FILE);
521
669
  const r = await readRaw(file);
522
670
  if (!r.ok) return r;
523
671
  const raw = r.raw ?? {};
@@ -528,11 +676,11 @@ function editPlugin(dir, id, change) {
528
676
  else delete plugins[id];
529
677
  raw.plugins = plugins;
530
678
  try {
531
- await mkdir(dir, { recursive: true });
679
+ await mkdir2(dir, { recursive: true });
532
680
  const tmp = `${file}.${process.pid}.tmp`;
533
- await writeFile(tmp, `${JSON.stringify(raw, null, " ")}
681
+ await writeFile2(tmp, `${JSON.stringify(raw, null, " ")}
534
682
  `);
535
- await rename(tmp, file);
683
+ await rename2(tmp, file);
536
684
  } catch (e) {
537
685
  return { ok: false, error: `could not write ${file}: ${e.message}` };
538
686
  }
@@ -549,25 +697,25 @@ function writePluginSettings(dir, id, settings2) {
549
697
  }
550
698
 
551
699
  // src/lib/server/cloud/settings.ts
552
- import { createHash as createHash3, randomBytes as randomBytes2 } from "node:crypto";
700
+ import { createHash as createHash3, randomBytes as randomBytes3 } from "node:crypto";
553
701
  import {
554
702
  chmod,
555
703
  lstat,
556
- mkdir as mkdir2,
557
- readFile as readFile2,
704
+ mkdir as mkdir3,
705
+ readFile as readFile3,
558
706
  realpath,
559
- rename as rename2,
560
- rm,
707
+ rename as rename3,
708
+ rm as rm2,
561
709
  stat as stat3,
562
- writeFile as writeFile2
710
+ writeFile as writeFile3
563
711
  } from "node:fs/promises";
564
- import path3 from "node:path";
712
+ import path5 from "node:path";
565
713
 
566
714
  // src/lib/cloud.ts
567
715
  var DEFAULT_GATEWAY = "https://cloud.chrisjowen.net";
568
716
 
569
717
  // src/lib/server/cloud/passkeys.ts
570
- import { createHash as createHash2, createPublicKey as createPublicKey2, randomBytes, verify } from "node:crypto";
718
+ import { createHash as createHash2, createPublicKey as createPublicKey2, randomBytes as randomBytes2, verify } from "node:crypto";
571
719
 
572
720
  // src/lib/server/cloud/protocol.ts
573
721
  import {
@@ -696,8 +844,8 @@ var HOP_BY_HOP = /* @__PURE__ */ new Set([
696
844
  "transfer-encoding",
697
845
  "upgrade"
698
846
  ]);
699
- function isRestartPath(path19) {
700
- let p = path19.split(/[?#]/, 1)[0];
847
+ function isRestartPath(path21) {
848
+ let p = path21.split(/[?#]/, 1)[0];
701
849
  for (let i = 0; i < 3; i++) {
702
850
  try {
703
851
  const d = decodeURIComponent(p);
@@ -757,7 +905,7 @@ var TAGS = {
757
905
  pins: Buffer.from("whc-pins-v2\n", "utf8")
758
906
  };
759
907
  function newChallenge(purpose) {
760
- return Buffer.concat([TAGS[purpose], randomBytes(32)]).toString("base64url");
908
+ return Buffer.concat([TAGS[purpose], randomBytes2(32)]).toString("base64url");
761
909
  }
762
910
  function assertionProblem(assertion, expected2) {
763
911
  if (typeof assertion !== "object" || assertion === null) return "no passkey signature";
@@ -997,7 +1145,7 @@ var CLOUD_SETTINGS_SCHEMA = "wheelhouse-cloud-settings.v1";
997
1145
  var CLOUD_STATUS_SCHEMA = "wheelhouse-cloud-status.v1";
998
1146
  var CLOUD_KEYCHAIN_SERVICE = "wheelhouse-cloud";
999
1147
  var lapsed = (p, now = Date.now()) => !(now - Date.parse(p.requestedAt) <= PENDING_PINS_MS);
1000
- var cloudDir = (configDir) => path3.join(configDir, "cloud");
1148
+ var cloudDir = (configDir) => path5.join(configDir, "cloud");
1001
1149
  var LOOPBACK = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]"]);
1002
1150
  function gatewayOrigin(raw) {
1003
1151
  const u = URL.parse(raw.trim());
@@ -1085,13 +1233,13 @@ function parseSessions(v) {
1085
1233
  });
1086
1234
  }
1087
1235
  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")}`;
1236
+ await mkdir3(path5.dirname(file), { recursive: true, mode: 448 });
1237
+ const tmp = `${file}.tmp-${process.pid}-${randomBytes3(4).toString("hex")}`;
1090
1238
  try {
1091
- await writeFile2(tmp, text2, { mode: 384 });
1092
- await rename2(tmp, file);
1239
+ await writeFile3(tmp, text2, { mode: 384 });
1240
+ await rename3(tmp, file);
1093
1241
  } catch (e) {
1094
- await rm(tmp, { force: true });
1242
+ await rm2(tmp, { force: true });
1095
1243
  throw e;
1096
1244
  }
1097
1245
  }
@@ -1112,13 +1260,13 @@ var CloudSettings = class {
1112
1260
  dir;
1113
1261
  keychain;
1114
1262
  get file() {
1115
- return path3.join(this.dir, "settings.json");
1263
+ return path5.join(this.dir, "settings.json");
1116
1264
  }
1117
1265
  get keyFile() {
1118
- return path3.join(this.dir, "device.key");
1266
+ return path5.join(this.dir, "device.key");
1119
1267
  }
1120
1268
  get statusFile() {
1121
- return path3.join(this.dir, "status.json");
1269
+ return path5.join(this.dir, "status.json");
1122
1270
  }
1123
1271
  /** The settings, with defaults (off, not started, the default gateway, no device) for anything missing or unreadable, with why. */
1124
1272
  async read() {
@@ -1130,7 +1278,7 @@ var CloudSettings = class {
1130
1278
  };
1131
1279
  let text2;
1132
1280
  try {
1133
- text2 = await readFile2(this.file, "utf8");
1281
+ text2 = await readFile3(this.file, "utf8");
1134
1282
  } catch (e) {
1135
1283
  if (e.code === "ENOENT") return { settings: settings2, error: null };
1136
1284
  return { settings: settings2, error: `${this.file} could not be read: ${e.message}` };
@@ -1169,7 +1317,7 @@ var CloudSettings = class {
1169
1317
  }
1170
1318
  /** The Keychain account for this directory's device key, so each config directory has its own. */
1171
1319
  async keychainAccount() {
1172
- const real2 = await realpath(this.dir).catch(() => path3.resolve(this.dir));
1320
+ const real2 = await realpath(this.dir).catch(() => path5.resolve(this.dir));
1173
1321
  return `device:${createHash3("sha256").update(real2).digest("hex").slice(0, 16)}`;
1174
1322
  }
1175
1323
  /** The device key and where it is kept: the Keychain first, then the file. */
@@ -1181,7 +1329,7 @@ var CloudSettings = class {
1181
1329
  const s = await lstat(this.keyFile);
1182
1330
  if (!s.isFile()) return null;
1183
1331
  if ((s.mode & 63) !== 0) await chmod(this.keyFile, 384);
1184
- const key = importKey(await readFile2(this.keyFile, "utf8"));
1332
+ const key = importKey(await readFile3(this.keyFile, "utf8"));
1185
1333
  return key ? { key, where: this.keyFile } : null;
1186
1334
  } catch {
1187
1335
  return null;
@@ -1189,7 +1337,7 @@ var CloudSettings = class {
1189
1337
  }
1190
1338
  /** Keep the key in the Keychain, else in its file, replacing any before; returns where it went. */
1191
1339
  async setKey(key) {
1192
- await mkdir2(this.dir, { recursive: true, mode: 448 });
1340
+ await mkdir3(this.dir, { recursive: true, mode: 448 });
1193
1341
  const stored = exportKey(key);
1194
1342
  const account = await this.keychainAccount();
1195
1343
  const kept = this.keychain ? await this.keychain.set(account, stored).then(
@@ -1197,7 +1345,7 @@ var CloudSettings = class {
1197
1345
  () => false
1198
1346
  ) : false;
1199
1347
  if (kept) {
1200
- await rm(this.keyFile, { force: true });
1348
+ await rm2(this.keyFile, { force: true });
1201
1349
  return this.keychain.where;
1202
1350
  }
1203
1351
  await this.keychain?.remove(account).catch(() => false);
@@ -1210,7 +1358,7 @@ var CloudSettings = class {
1210
1358
  /** Forget this machine's device: its key wherever it is kept, and its record, and stop remote access. */
1211
1359
  async forget() {
1212
1360
  await this.keychain?.remove(await this.keychainAccount()).catch(() => false);
1213
- await rm(this.keyFile, { force: true });
1361
+ await rm2(this.keyFile, { force: true });
1214
1362
  await this.update((s) => {
1215
1363
  s.device = null;
1216
1364
  s.started = false;
@@ -1266,7 +1414,7 @@ var CloudSettings = class {
1266
1414
  }
1267
1415
  async readStatus() {
1268
1416
  try {
1269
- const v = JSON.parse(await readFile2(this.statusFile, "utf8"));
1417
+ const v = JSON.parse(await readFile3(this.statusFile, "utf8"));
1270
1418
  if (!isObj(v) || v.schema !== CLOUD_STATUS_SCHEMA || typeof v.pid !== "number") return null;
1271
1419
  const state = v.state === "online" || v.state === "stopped" ? v.state : "connecting";
1272
1420
  return {
@@ -1361,7 +1509,7 @@ function cloudKeychain() {
1361
1509
  }
1362
1510
 
1363
1511
  // src/lib/server/cloud/service.ts
1364
- import { randomBytes as randomBytes3 } from "node:crypto";
1512
+ import { randomBytes as randomBytes4 } from "node:crypto";
1365
1513
 
1366
1514
  // src/lib/server/cloud/connector.ts
1367
1515
  import WebSocket2 from "ws";
@@ -1610,8 +1758,8 @@ var Relay = class {
1610
1758
  if (this.streams.size >= this.opts.limits.maxStreams) return { ok: false, code: "limit" };
1611
1759
  const relay = parseRelay(msg.relay);
1612
1760
  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(" ")) {
1761
+ const path21 = msg.path;
1762
+ if (!relay || !headers || typeof path21 !== "string" || !path21.startsWith("/") || path21.length > 8192 || !headerSafe(path21) || path21.includes(" ")) {
1615
1763
  return { ok: false, code: "protocol", message: "The request is malformed." };
1616
1764
  }
1617
1765
  const refusal = this.opts.sessionRefusal?.(relay.sessionId);
@@ -1623,7 +1771,7 @@ var Relay = class {
1623
1771
  message: "Wheelhouse Cloud is turned off on this machine."
1624
1772
  };
1625
1773
  }
1626
- if (isRestartPath(path19)) {
1774
+ if (isRestartPath(path21)) {
1627
1775
  return {
1628
1776
  ok: false,
1629
1777
  code: "refused",
@@ -1633,7 +1781,7 @@ var Relay = class {
1633
1781
  const target = isObj2(msg.target) ? msg.target : {};
1634
1782
  const app = this.opts.targets.appPort();
1635
1783
  if (target.kind === "app") {
1636
- return { ok: true, port: app, host: "127.0.0.1", path: path19, headers, relay };
1784
+ return { ok: true, port: app, host: "127.0.0.1", path: path21, headers, relay };
1637
1785
  }
1638
1786
  const port = target.port;
1639
1787
  if (target.kind !== "port" || typeof port !== "number" || !Number.isInteger(port) || port < 1 || port > 65535) {
@@ -1644,7 +1792,7 @@ var Relay = class {
1644
1792
  }
1645
1793
  const late = this.opts.sessionRefusal?.(relay.sessionId);
1646
1794
  if (late) return { ok: false, code: "refused", message: late };
1647
- return { ok: true, port, host: "localhost", path: path19, headers, relay };
1795
+ return { ok: true, port, host: "localhost", path: path21, headers, relay };
1648
1796
  }
1649
1797
  /** §6.3: the headers for the local request. */
1650
1798
  localHeaders(a, originChecked, ws) {
@@ -2287,7 +2435,7 @@ var CloudService = class {
2287
2435
  }
2288
2436
  x.device.pending = {
2289
2437
  ...p,
2290
- id: randomBytes3(8).toString("hex"),
2438
+ id: randomBytes4(8).toString("hex"),
2291
2439
  requestedAt: new Date(this.now()).toISOString()
2292
2440
  };
2293
2441
  });
@@ -2352,15 +2500,15 @@ var CloudService = class {
2352
2500
  };
2353
2501
 
2354
2502
  // src/lib/server/plugins/installed.ts
2355
- import { mkdir as mkdir3, readFile as readFile3, rename as rename3, writeFile as writeFile3 } from "node:fs/promises";
2503
+ import { mkdir as mkdir4, readFile as readFile4, rename as rename4, writeFile as writeFile4 } from "node:fs/promises";
2356
2504
  import { homedir as homedir2 } from "node:os";
2357
- import path4 from "node:path";
2505
+ import path6 from "node:path";
2358
2506
  var INSTALLED_FILE = "installed.json";
2359
2507
  var SCHEMA = "wheelhouse-installed-plugins.v1";
2360
2508
  var EMPTY_INSTALLED = () => ({ schema: SCHEMA, plugins: {} });
2361
2509
  function defaultPluginsDir(env) {
2362
- if (env.WHEELHOUSE_PLUGINS_DIR) return path4.resolve(env.WHEELHOUSE_PLUGINS_DIR);
2363
- return path4.join(homedir2(), ".wheelhouse", "plugins");
2510
+ if (env.WHEELHOUSE_PLUGINS_DIR) return path6.resolve(env.WHEELHOUSE_PLUGINS_DIR);
2511
+ return path6.join(homedir2(), ".wheelhouse", "plugins");
2364
2512
  }
2365
2513
  var isRecord2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
2366
2514
  function record(v) {
@@ -2372,10 +2520,10 @@ function record(v) {
2372
2520
  return { repository, ref, commit, version: version2, installedAt, enabled };
2373
2521
  }
2374
2522
  async function readInstalled(dir) {
2375
- const file = path4.join(dir, INSTALLED_FILE);
2523
+ const file = path6.join(dir, INSTALLED_FILE);
2376
2524
  let text2;
2377
2525
  try {
2378
- text2 = await readFile3(file, "utf8");
2526
+ text2 = await readFile4(file, "utf8");
2379
2527
  } catch (e) {
2380
2528
  if (e.code === "ENOENT")
2381
2529
  return { ok: true, installed: EMPTY_INSTALLED() };
@@ -2399,29 +2547,29 @@ async function readInstalled(dir) {
2399
2547
  return { ok: true, installed };
2400
2548
  }
2401
2549
  async function writeInstalled(dir, installed) {
2402
- await mkdir3(dir, { recursive: true });
2403
- const file = path4.join(dir, INSTALLED_FILE);
2550
+ await mkdir4(dir, { recursive: true });
2551
+ const file = path6.join(dir, INSTALLED_FILE);
2404
2552
  const tmp = `${file}.${process.pid}.tmp`;
2405
- await writeFile3(tmp, `${JSON.stringify(installed, null, " ")}
2553
+ await writeFile4(tmp, `${JSON.stringify(installed, null, " ")}
2406
2554
  `);
2407
- await rename3(tmp, file);
2555
+ await rename4(tmp, file);
2408
2556
  }
2409
2557
 
2410
2558
  // src/lib/server/setup/skill.ts
2411
2559
  import { createHash as createHash4 } from "node:crypto";
2412
2560
  import {
2413
2561
  lstat as lstat2,
2414
- mkdir as mkdir4,
2562
+ mkdir as mkdir5,
2415
2563
  mkdtemp,
2416
- readFile as readFile4,
2564
+ readFile as readFile5,
2417
2565
  readdir,
2418
2566
  realpath as realpath2,
2419
- rename as rename4,
2420
- rm as rm2,
2421
- writeFile as writeFile4
2567
+ rename as rename5,
2568
+ rm as rm3,
2569
+ writeFile as writeFile5
2422
2570
  } from "node:fs/promises";
2423
2571
  import { homedir as homedir3 } from "node:os";
2424
- import path5 from "node:path";
2572
+ import path7 from "node:path";
2425
2573
  var NAME = "manage-wheelhouse";
2426
2574
  var RECEIPT = ".wheelhouse-managed.json";
2427
2575
  var FILES = ["SKILL.md", "references/operations.md"];
@@ -2431,9 +2579,9 @@ async function physical(file) {
2431
2579
  return await realpath2(file);
2432
2580
  } catch (e) {
2433
2581
  if (e.code !== "ENOENT") throw e;
2434
- const parent = path5.dirname(file);
2582
+ const parent = path7.dirname(file);
2435
2583
  if (parent === file) throw e;
2436
- return path5.join(await physical(parent), path5.basename(file));
2584
+ return path7.join(await physical(parent), path7.basename(file));
2437
2585
  }
2438
2586
  }
2439
2587
  async function present(file) {
@@ -2450,8 +2598,8 @@ async function contents(dir, prefix = "") {
2450
2598
  for (const entry2 of await readdir(dir, { withFileTypes: true })) {
2451
2599
  const rel = prefix + entry2.name;
2452
2600
  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"));
2601
+ Object.assign(result, await contents(path7.join(dir, entry2.name), rel + "/"));
2602
+ else if (entry2.isFile()) result[rel] = hash(await readFile5(path7.join(dir, entry2.name), "utf8"));
2455
2603
  else throw new Error("The skill contains a symbolic link or special file.");
2456
2604
  }
2457
2605
  return result;
@@ -2460,7 +2608,7 @@ async function inspect(target, hashes) {
2460
2608
  if (!await present(target)) return "absent";
2461
2609
  try {
2462
2610
  if (!(await lstat2(target)).isDirectory()) return "foreign";
2463
- const receipt = JSON.parse(await readFile4(path5.join(target, RECEIPT), "utf8"));
2611
+ const receipt = JSON.parse(await readFile5(path7.join(target, RECEIPT), "utf8"));
2464
2612
  const actual = await contents(target);
2465
2613
  delete actual[RECEIPT];
2466
2614
  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 +2618,14 @@ async function inspect(target, hashes) {
2470
2618
  return await present(target) ? "foreign" : "absent";
2471
2619
  }
2472
2620
  }
2473
- async function installWheelhouseSkill(install2, env, sourceDir = path5.join(env.WHEELHOUSE_INSTALL_DIR || process.cwd(), "skills", NAME)) {
2621
+ async function installWheelhouseSkill(install2, env, sourceDir = path7.join(env.WHEELHOUSE_INSTALL_DIR || process.cwd(), "skills", NAME)) {
2474
2622
  if (env.WHEELHOUSE_MANAGE_SKILL === "0")
2475
2623
  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"),
2624
+ const parent = path7.resolve(
2625
+ env.CLAUDE_CONFIG_DIR || path7.join(env.HOME || homedir3(), ".claude"),
2478
2626
  "skills"
2479
2627
  );
2480
- const target = path5.join(parent, NAME);
2628
+ const target = path7.join(parent, NAME);
2481
2629
  const current = {
2482
2630
  state: "current",
2483
2631
  message: `Wheelhouse skill is current at ${target}.`
@@ -2486,20 +2634,20 @@ async function installWheelhouseSkill(install2, env, sourceDir = path5.join(env.
2486
2634
  try {
2487
2635
  const destinations = [await physical(parent), await physical(target)];
2488
2636
  for (const dir of [install2.firstmateDir, install2.homeDir]) {
2489
- const protectedDir = await physical(path5.resolve(dir));
2637
+ const protectedDir = await physical(path7.resolve(dir));
2490
2638
  if (destinations.some(
2491
- (destination) => destination === protectedDir || destination.startsWith(protectedDir + path5.sep)
2639
+ (destination) => destination === protectedDir || destination.startsWith(protectedDir + path7.sep)
2492
2640
  ))
2493
2641
  return {
2494
2642
  state: "skipped",
2495
2643
  message: `Left ${target} unchanged: user skills location is inside Firstmate's checkout or home.`
2496
2644
  };
2497
2645
  }
2498
- await mkdir4(parent, { recursive: true });
2646
+ await mkdir5(parent, { recursive: true });
2499
2647
  const files = Object.fromEntries(
2500
2648
  await Promise.all(
2501
2649
  FILES.map(
2502
- async (file) => [file, await readFile4(path5.join(sourceDir, file), "utf8")]
2650
+ async (file) => [file, await readFile5(path7.join(sourceDir, file), "utf8")]
2503
2651
  )
2504
2652
  )
2505
2653
  );
@@ -2515,13 +2663,13 @@ async function installWheelhouseSkill(install2, env, sourceDir = path5.join(env.
2515
2663
  };
2516
2664
  let now = found;
2517
2665
  const exists2 = found === "managed";
2518
- stage = await mkdtemp(path5.join(parent, ".wheelhouse-skill-"));
2666
+ stage = await mkdtemp(path7.join(parent, ".wheelhouse-skill-"));
2519
2667
  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);
2668
+ await mkdir5(path7.dirname(path7.join(stage, file)), { recursive: true });
2669
+ await writeFile5(path7.join(stage, file), text2);
2522
2670
  }
2523
- await writeFile4(
2524
- path5.join(stage, RECEIPT),
2671
+ await writeFile5(
2672
+ path7.join(stage, RECEIPT),
2525
2673
  JSON.stringify({ schema: "wheelhouse-skill.v1", version, files: hashes }) + "\n"
2526
2674
  );
2527
2675
  const backup = stage + "-previous";
@@ -2529,15 +2677,15 @@ async function installWheelhouseSkill(install2, env, sourceDir = path5.join(env.
2529
2677
  let error = new Error("another copy appeared while installing");
2530
2678
  if (now !== "foreign")
2531
2679
  try {
2532
- if (now === "managed") await rename4(target, backup);
2533
- await rename4(stage, target);
2680
+ if (now === "managed") await rename5(target, backup);
2681
+ await rename5(stage, target);
2534
2682
  break;
2535
2683
  } catch (e) {
2536
2684
  error = e;
2537
- await rename4(backup, target).catch(() => {
2685
+ await rename5(backup, target).catch(() => {
2538
2686
  });
2539
2687
  } finally {
2540
- await rm2(backup, { recursive: true, force: true });
2688
+ await rm3(backup, { recursive: true, force: true });
2541
2689
  }
2542
2690
  now = await inspect(target, hashes);
2543
2691
  if (now === "current") return current;
@@ -2555,15 +2703,15 @@ async function installWheelhouseSkill(install2, env, sourceDir = path5.join(env.
2555
2703
  message: `Could not install Wheelhouse skill at ${target}: ${e.message}`
2556
2704
  };
2557
2705
  } finally {
2558
- if (stage) await rm2(stage, { recursive: true, force: true });
2706
+ if (stage) await rm3(stage, { recursive: true, force: true });
2559
2707
  }
2560
2708
  }
2561
2709
 
2562
2710
  // src/lib/server/setup/remembered.ts
2563
2711
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
2564
- import path6 from "node:path";
2712
+ import path8 from "node:path";
2565
2713
  var REMEMBERED_FILE = "firstmate.json";
2566
- var rememberedFile = (configDir) => path6.join(configDir, REMEMBERED_FILE);
2714
+ var rememberedFile = (configDir) => path8.join(configDir, REMEMBERED_FILE);
2567
2715
  function readRemembered(configDir) {
2568
2716
  let raw;
2569
2717
  try {
@@ -2573,8 +2721,8 @@ function readRemembered(configDir) {
2573
2721
  }
2574
2722
  if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return null;
2575
2723
  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))) {
2724
+ if (typeof firstmate !== "string" || !path8.isAbsolute(firstmate)) return null;
2725
+ if (home !== void 0 && home !== null && (typeof home !== "string" || !path8.isAbsolute(home))) {
2578
2726
  return null;
2579
2727
  }
2580
2728
  return { firstmate, home: typeof home === "string" ? home : null };
@@ -2582,7 +2730,7 @@ function readRemembered(configDir) {
2582
2730
 
2583
2731
  // src/lib/server/store/store.ts
2584
2732
  import { realpathSync } from "node:fs";
2585
- import path7 from "node:path";
2733
+ import path9 from "node:path";
2586
2734
 
2587
2735
  // src/lib/inbox.ts
2588
2736
  var SNOOZE_MS = 4 * 3600 * 1e3;
@@ -2606,22 +2754,22 @@ var SUMMARY_SYSTEM = [
2606
2754
 
2607
2755
  // src/lib/server/store/store.ts
2608
2756
  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");
2757
+ if (env.WHEELHOUSE_STATE_DIR) return path9.resolve(env.WHEELHOUSE_STATE_DIR);
2758
+ if (env.XDG_STATE_HOME) return path9.join(path9.resolve(env.XDG_STATE_HOME), "wheelhouse");
2759
+ return path9.join(env.HOME ?? "", ".local", "state", "wheelhouse");
2612
2760
  }
2613
2761
  function real(p) {
2614
- const abs = path7.resolve(p);
2762
+ const abs = path9.resolve(p);
2615
2763
  try {
2616
2764
  return realpathSync(abs);
2617
2765
  } catch {
2618
- const parent = path7.dirname(abs);
2619
- return parent === abs ? abs : path7.join(real(parent), path7.basename(abs));
2766
+ const parent = path9.dirname(abs);
2767
+ return parent === abs ? abs : path9.join(real(parent), path9.basename(abs));
2620
2768
  }
2621
2769
  }
2622
2770
  function isInside(p, dir) {
2623
- const rel = path7.relative(real(dir), real(p));
2624
- return rel === "" || !rel.startsWith("..") && !path7.isAbsolute(rel);
2771
+ const rel = path9.relative(real(dir), real(p));
2772
+ return rel === "" || !rel.startsWith("..") && !path9.isAbsolute(rel);
2625
2773
  }
2626
2774
 
2627
2775
  // src/lib/server/restart.ts
@@ -2633,9 +2781,9 @@ function setRestart(fn) {
2633
2781
 
2634
2782
  // src/lib/server/upgrade/settings.ts
2635
2783
  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");
2784
+ import path10 from "node:path";
2785
+ var updateDir = (configDir) => path10.join(configDir, "update");
2786
+ var handoffFile = (configDir) => path10.join(updateDir(configDir), "next-install");
2639
2787
  function takeHandoff(configDir) {
2640
2788
  const file = handoffFile(configDir);
2641
2789
  let dir;
@@ -2645,13 +2793,13 @@ function takeHandoff(configDir) {
2645
2793
  return null;
2646
2794
  }
2647
2795
  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"));
2796
+ if (!dir || !path10.isAbsolute(dir)) return null;
2797
+ const built = existsSync2(path10.join(dir, "dist", "cli.js")) && existsSync2(path10.join(dir, "build", "handler.js"));
2650
2798
  return built ? dir : null;
2651
2799
  }
2652
2800
 
2653
2801
  // cli/gateway.ts
2654
- import path10 from "node:path";
2802
+ import path12 from "node:path";
2655
2803
  import { Argument, Command, InvalidArgumentError } from "commander";
2656
2804
 
2657
2805
  // src/lib/gateway.ts
@@ -2783,19 +2931,19 @@ async function checkDiscordToken(token, opts = {}) {
2783
2931
  var inviteUrl = (appId) => `https://discord.com/oauth2/authorize?client_id=${encodeURIComponent(appId)}&scope=bot&permissions=0`;
2784
2932
 
2785
2933
  // src/lib/server/gateway/settings.ts
2786
- import { createHash as createHash5, randomBytes as randomBytes4 } from "node:crypto";
2934
+ import { createHash as createHash5, randomBytes as randomBytes5 } from "node:crypto";
2787
2935
  import {
2788
2936
  chmod as chmod2,
2789
2937
  lstat as lstat3,
2790
- mkdir as mkdir5,
2791
- readFile as readFile5,
2938
+ mkdir as mkdir6,
2939
+ readFile as readFile6,
2792
2940
  realpath as realpath3,
2793
- rename as rename5,
2794
- rm as rm3,
2941
+ rename as rename6,
2942
+ rm as rm4,
2795
2943
  stat as stat4,
2796
- writeFile as writeFile5
2944
+ writeFile as writeFile6
2797
2945
  } from "node:fs/promises";
2798
- import path9 from "node:path";
2946
+ import path11 from "node:path";
2799
2947
 
2800
2948
  // src/lib/bell.ts
2801
2949
  var ALERT_KINDS = [
@@ -2814,7 +2962,7 @@ var QUIET_AFTER_MS = 20 * 6e4;
2814
2962
  // src/lib/server/gateway/settings.ts
2815
2963
  var GATEWAY_SETTINGS_SCHEMA = "wheelhouse-gateway-settings.v1";
2816
2964
  var SETTINGS_FILE = "settings.json";
2817
- var gatewayDir = (configDir) => path9.join(configDir, "gateway");
2965
+ var gatewayDir = (configDir) => path11.join(configDir, "gateway");
2818
2966
  function defaultSettings() {
2819
2967
  return Object.fromEntries(
2820
2968
  GATEWAY_CHANNELS.map((c) => [
@@ -2847,13 +2995,13 @@ function parseChannel(v, fallback) {
2847
2995
  };
2848
2996
  }
2849
2997
  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")}`;
2998
+ await mkdir6(path11.dirname(file), { recursive: true, mode: 448 });
2999
+ const tmp = `${file}.tmp-${process.pid}-${randomBytes5(4).toString("hex")}`;
2852
3000
  try {
2853
- await writeFile5(tmp, text2, { mode: 384 });
2854
- await rename5(tmp, file);
3001
+ await writeFile6(tmp, text2, { mode: 384 });
3002
+ await rename6(tmp, file);
2855
3003
  } catch (e) {
2856
- await rm3(tmp, { force: true });
3004
+ await rm4(tmp, { force: true });
2857
3005
  throw e;
2858
3006
  }
2859
3007
  }
@@ -2865,17 +3013,17 @@ var GatewaySettings = class {
2865
3013
  dir;
2866
3014
  keychain;
2867
3015
  get file() {
2868
- return path9.join(this.dir, SETTINGS_FILE);
3016
+ return path11.join(this.dir, SETTINGS_FILE);
2869
3017
  }
2870
3018
  tokenFile(channel) {
2871
- return path9.join(this.dir, `${channel}.token`);
3019
+ return path11.join(this.dir, `${channel}.token`);
2872
3020
  }
2873
3021
  /** The settings, with defaults for anything missing; an unreadable file reads as the defaults, with why. */
2874
3022
  async read() {
2875
3023
  const settings2 = defaultSettings();
2876
3024
  let text2;
2877
3025
  try {
2878
- text2 = await readFile5(this.file, "utf8");
3026
+ text2 = await readFile6(this.file, "utf8");
2879
3027
  } catch (e) {
2880
3028
  if (e.code === "ENOENT") return { settings: settings2, error: null };
2881
3029
  return { settings: settings2, error: `${this.file} could not be read: ${e.message}` };
@@ -2918,7 +3066,7 @@ var GatewaySettings = class {
2918
3066
  const s = await lstat3(file);
2919
3067
  if (!s.isFile()) return null;
2920
3068
  if ((s.mode & 63) !== 0) await chmod2(file, 384);
2921
- const token = cleanToken(await readFile5(file, "utf8"));
3069
+ const token = cleanToken(await readFile6(file, "utf8"));
2922
3070
  return token ? { token, where: file } : null;
2923
3071
  } catch {
2924
3072
  return null;
@@ -2933,12 +3081,12 @@ var GatewaySettings = class {
2933
3081
  * directory has its own token.
2934
3082
  */
2935
3083
  async keychainAccount(channel) {
2936
- const real2 = await realpath3(this.dir).catch(() => path9.resolve(this.dir));
3084
+ const real2 = await realpath3(this.dir).catch(() => path11.resolve(this.dir));
2937
3085
  return `${channel}:${createHash5("sha256").update(real2).digest("hex").slice(0, 16)}`;
2938
3086
  }
2939
3087
  /** Keep the token in the Keychain, else in its file, replacing the one before; returns where it went. */
2940
3088
  async setToken(channel, token) {
2941
- await mkdir5(this.dir, { recursive: true, mode: 448 });
3089
+ await mkdir6(this.dir, { recursive: true, mode: 448 });
2942
3090
  const keychain = this.keychain;
2943
3091
  const account = await this.keychainAccount(channel);
2944
3092
  const kept = keychain ? await keychain.set(account, token).then(
@@ -2946,7 +3094,7 @@ var GatewaySettings = class {
2946
3094
  () => false
2947
3095
  ) : false;
2948
3096
  if (kept) {
2949
- await rm3(this.tokenFile(channel), { force: true });
3097
+ await rm4(this.tokenFile(channel), { force: true });
2950
3098
  } else {
2951
3099
  await keychain?.remove(account).catch(() => false);
2952
3100
  await writeAtomic2(this.tokenFile(channel), `${token}
@@ -3052,7 +3200,7 @@ function gatewayCommand(over = {}) {
3052
3200
  );
3053
3201
  const settingsFor = (c) => {
3054
3202
  const dir = c.optsWithGlobals().configDir;
3055
- const configDir = dir ? path10.resolve(dir) : defaultConfigDir(deps.env);
3203
+ const configDir = dir ? path12.resolve(dir) : defaultConfigDir(deps.env);
3056
3204
  const found = resolveInstall({
3057
3205
  cwd: process.cwd(),
3058
3206
  env: deps.env,
@@ -3172,17 +3320,17 @@ function gatewayCommand(over = {}) {
3172
3320
  }
3173
3321
 
3174
3322
  // cli/plugin.ts
3175
- import { createInterface } from "node:readline/promises";
3176
- import path14 from "node:path";
3323
+ import { createInterface as createInterface2 } from "node:readline/promises";
3324
+ import path16 from "node:path";
3177
3325
  import { Command as Command2 } from "commander";
3178
3326
 
3179
3327
  // src/lib/server/plugins/install.ts
3180
3328
  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";
3329
+ 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";
3330
+ import path14 from "node:path";
3183
3331
 
3184
3332
  // src/lib/server/plugins/manifest.ts
3185
- import path11 from "node:path";
3333
+ import path13 from "node:path";
3186
3334
 
3187
3335
  // src/lib/plugins/addresses.ts
3188
3336
  var TEMPLATE = /^[a-z0-9-]*\{port\}[a-z0-9-]*(?:\.[a-z0-9-]+)*\.localhost$/;
@@ -3213,7 +3361,7 @@ var SUPPORTED_API_VERSIONS = [PLUGIN_API_VERSION, PLUGIN_API_VERSION - 1].filter
3213
3361
  // src/lib/server/plugins/manifest.ts
3214
3362
  var MANIFEST_DIR = ".wheelhouse-plugin";
3215
3363
  var MANIFEST_FILE = "plugin.json";
3216
- var manifestPath = (pluginDir) => path11.join(pluginDir, MANIFEST_DIR, MANIFEST_FILE);
3364
+ var manifestPath = (pluginDir) => path13.join(pluginDir, MANIFEST_DIR, MANIFEST_FILE);
3217
3365
  var MANIFEST_FIELDS = [
3218
3366
  "$schema",
3219
3367
  "name",
@@ -3260,7 +3408,7 @@ var SEMVER = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
3260
3408
  var MAX_TEXT = 400;
3261
3409
  var isRecord3 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
3262
3410
  function insidePath(f) {
3263
- return typeof f === "string" && f.length > 0 && !path11.isAbsolute(f) && !f.split(/[\\/]/).some((part) => part === ".." || part === "" || part === ".");
3411
+ return typeof f === "string" && f.length > 0 && !path13.isAbsolute(f) && !f.split(/[\\/]/).some((part) => part === ".." || part === "" || part === ".");
3264
3412
  }
3265
3413
  var ICON_TYPES = {
3266
3414
  ".svg": "image/svg+xml",
@@ -3358,7 +3506,7 @@ function wheelhouse(v) {
3358
3506
  }
3359
3507
  if (!insidePath(c.icon))
3360
3508
  throw new Invalid(`${where}.icon must be a plain path inside the plugin`);
3361
- if (!ICON_TYPES[path11.extname(c.icon).toLowerCase()]) {
3509
+ if (!ICON_TYPES[path13.extname(c.icon).toLowerCase()]) {
3362
3510
  throw new Invalid(`${where}.icon must be an image: ${Object.keys(ICON_TYPES).join(", ")}`);
3363
3511
  }
3364
3512
  declared.icon = c.icon;
@@ -3711,13 +3859,13 @@ async function fetchSource(source, into, deps) {
3711
3859
  await step(["checkout", "-q", "--detach", "FETCH_HEAD"]);
3712
3860
  }
3713
3861
  const commit = await step(["rev-parse", "HEAD"]);
3714
- await rm4(path12.join(into, ".git"), { recursive: true, force: true });
3862
+ await rm5(path14.join(into, ".git"), { recursive: true, force: true });
3715
3863
  return commit;
3716
3864
  }
3717
3865
  async function checkCopy(dir) {
3718
3866
  let text2;
3719
3867
  try {
3720
- text2 = await readFile6(manifestPath(dir), "utf8");
3868
+ text2 = await readFile7(manifestPath(dir), "utf8");
3721
3869
  } catch {
3722
3870
  throw new Refused("it has no .wheelhouse-plugin/plugin.json, so it is not a Wheelhouse plugin");
3723
3871
  }
@@ -3732,12 +3880,12 @@ async function checkCopy(dir) {
3732
3880
  if (!rel) continue;
3733
3881
  let file;
3734
3882
  try {
3735
- file = await realpath4(path12.join(base, rel));
3883
+ file = await realpath4(path14.join(base, rel));
3736
3884
  if (!(await stat5(file)).isFile()) throw new Error();
3737
3885
  } catch {
3738
3886
  throw new Refused(`its ${what} ${rel} is missing`);
3739
3887
  }
3740
- if (!file.startsWith(base + path12.sep))
3888
+ if (!file.startsWith(base + path14.sep))
3741
3889
  throw new Refused(`its ${what} leads outside the plugin`);
3742
3890
  }
3743
3891
  return m;
@@ -3779,12 +3927,12 @@ function describeManifest(m, from, commit) {
3779
3927
  ];
3780
3928
  }
3781
3929
  async function withStaging(dir, work) {
3782
- await mkdir6(dir, { recursive: true });
3783
- const staging = await mkdtemp2(path12.join(dir, ".staging-"));
3930
+ await mkdir7(dir, { recursive: true });
3931
+ const staging = await mkdtemp2(path14.join(dir, ".staging-"));
3784
3932
  try {
3785
3933
  return await work(staging);
3786
3934
  } finally {
3787
- await rm4(staging, { recursive: true, force: true });
3935
+ await rm5(staging, { recursive: true, force: true });
3788
3936
  }
3789
3937
  }
3790
3938
  async function guarded(work) {
@@ -3817,7 +3965,7 @@ async function settle(m, deps, o) {
3817
3965
  async function keepSettings(id, settings2, deps) {
3818
3966
  const w = await writePluginSettings(deps.configDir, id, settings2);
3819
3967
  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)}.`);
3968
+ deps.log(`Kept ${id}'s settings in ${path14.join(deps.configDir, PLUGINS_FILE)}.`);
3821
3969
  }
3822
3970
  async function reload(deps, what, yes) {
3823
3971
  const r = await deps.restart(async (url, busy) => {
@@ -3858,7 +4006,7 @@ function install(spec, deps, o = {}) {
3858
4006
  const commit = await fetchSource(source, staging, deps);
3859
4007
  expected(commit, o.expect, repository);
3860
4008
  const m = await checkCopy(staging);
3861
- const target = path12.join(deps.dir, m.name);
4009
+ const target = path14.join(deps.dir, m.name);
3862
4010
  if (installed.plugins[m.name]) {
3863
4011
  throw new Refused(
3864
4012
  `${m.name} is already installed from ${label(installed.plugins[m.name])}; use \`wheelhouse plugin update ${m.name}\``
@@ -3878,7 +4026,7 @@ function install(spec, deps, o = {}) {
3878
4026
  }
3879
4027
  const settings2 = await settle(m, deps, { yes: o.yes, given: answers });
3880
4028
  if (settings2) await keepSettings(m.name, settings2, deps);
3881
- await rename6(staging, target);
4029
+ await rename7(staging, target);
3882
4030
  installed.plugins[m.name] = {
3883
4031
  repository,
3884
4032
  ref: source.ref,
@@ -3933,17 +4081,17 @@ function update(id, deps, o = {}) {
3933
4081
  if (!o.yes && !await deps.confirm(`Update ${id}?`)) throw new Refused("not updated");
3934
4082
  const settings2 = await settle(m, deps, { yes: o.yes, given: answers });
3935
4083
  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);
4084
+ const target = path14.join(deps.dir, id);
4085
+ const old = await mkdtemp2(path14.join(deps.dir, ".old-"));
4086
+ const parked = path14.join(old, id);
4087
+ if (await exists(target)) await rename7(target, parked);
3940
4088
  try {
3941
- await rename6(staging, target);
4089
+ await rename7(staging, target);
3942
4090
  } catch (e) {
3943
- if (await exists(parked)) await rename6(parked, target);
4091
+ if (await exists(parked)) await rename7(parked, target);
3944
4092
  throw e;
3945
4093
  } finally {
3946
- await rm4(old, { recursive: true, force: true });
4094
+ await rm5(old, { recursive: true, force: true });
3947
4095
  }
3948
4096
  installed.plugins[id] = {
3949
4097
  ...was,
@@ -3964,7 +4112,7 @@ function remove(id, deps, o = {}) {
3964
4112
  if (!ID2.test(id)) throw new Refused(`"${id}" is not a plugin id`);
3965
4113
  const installed = await record2(deps);
3966
4114
  if (!installed.plugins[id]) throw new Refused(`${id} is not installed`);
3967
- await rm4(path12.join(deps.dir, id), { recursive: true, force: true });
4115
+ await rm5(path14.join(deps.dir, id), { recursive: true, force: true });
3968
4116
  delete installed.plugins[id];
3969
4117
  await writeInstalled(deps.dir, installed);
3970
4118
  deps.log(`Removed ${id}.`);
@@ -4010,19 +4158,19 @@ async function exists(p) {
4010
4158
  }
4011
4159
 
4012
4160
  // cli/running.ts
4013
- import { randomBytes as randomBytes5, timingSafeEqual } from "node:crypto";
4161
+ import { randomBytes as randomBytes6, timingSafeEqual } from "node:crypto";
4014
4162
  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";
4163
+ import { readdir as readdir2, readFile as readFile8, rm as rm6 } from "node:fs/promises";
4164
+ import path15 from "node:path";
4017
4165
  var RESTART_EXIT = 75;
4018
4166
  var RESTART_PATH = "/api/wheelhouse/restart";
4019
4167
  var RUNNING_DIR = ".running";
4020
4168
  var TIMEOUT_MS = 3e3;
4021
- var newToken = () => randomBytes5(24).toString("hex");
4169
+ var newToken = () => randomBytes6(24).toString("hex");
4022
4170
  function writeRunning(pluginsDir, r) {
4023
- const dir = path13.join(pluginsDir, RUNNING_DIR);
4171
+ const dir = path15.join(pluginsDir, RUNNING_DIR);
4024
4172
  mkdirSync2(dir, { recursive: true, mode: 448 });
4025
- const file = path13.join(dir, `${r.pid}.json`);
4173
+ const file = path15.join(dir, `${r.pid}.json`);
4026
4174
  writeFileSync2(file, `${JSON.stringify(r)}
4027
4175
  `, { mode: 384 });
4028
4176
  return file;
@@ -4065,7 +4213,7 @@ var alive2 = (pid) => {
4065
4213
  };
4066
4214
  var refused = (e) => e.cause?.code === "ECONNREFUSED";
4067
4215
  async function requestRestart(pluginsDir, proceed) {
4068
- const dir = path13.join(pluginsDir, RUNNING_DIR);
4216
+ const dir = path15.join(pluginsDir, RUNNING_DIR);
4069
4217
  const out = { restarted: [], failed: [], kept: [] };
4070
4218
  let names;
4071
4219
  try {
@@ -4074,17 +4222,17 @@ async function requestRestart(pluginsDir, proceed) {
4074
4222
  return out;
4075
4223
  }
4076
4224
  for (const name of names) {
4077
- const file = path13.join(dir, name);
4225
+ const file = path15.join(dir, name);
4078
4226
  let r;
4079
4227
  try {
4080
- r = JSON.parse(await readFile7(file, "utf8"));
4228
+ r = JSON.parse(await readFile8(file, "utf8"));
4081
4229
  if (typeof r.url !== "string" || typeof r.token !== "string") throw new Error();
4082
4230
  } catch {
4083
- await rm5(file, { force: true });
4231
+ await rm6(file, { force: true });
4084
4232
  continue;
4085
4233
  }
4086
4234
  if (typeof r.pid === "number" && !alive2(r.pid)) {
4087
- await rm5(file, { force: true });
4235
+ await rm6(file, { force: true });
4088
4236
  continue;
4089
4237
  }
4090
4238
  const headers = { authorization: `Bearer ${r.token}` };
@@ -4108,7 +4256,7 @@ async function requestRestart(pluginsDir, proceed) {
4108
4256
  if (res.status === 202) out.restarted.push(r.url);
4109
4257
  else out.failed.push({ url: r.url, reason: `it answered ${res.status}` });
4110
4258
  } catch (e) {
4111
- if (refused(e)) await rm5(file, { force: true });
4259
+ if (refused(e)) await rm6(file, { force: true });
4112
4260
  else out.failed.push({ url: r.url, reason: e.message });
4113
4261
  }
4114
4262
  }
@@ -4121,7 +4269,7 @@ async function askTerminal(question2) {
4121
4269
  console.error("wheelhouse: no terminal to ask on; pass --yes to agree without asking.");
4122
4270
  return false;
4123
4271
  }
4124
- const rl = createInterface({ input: process.stdin, output: process.stdout });
4272
+ const rl = createInterface2({ input: process.stdin, output: process.stdout });
4125
4273
  try {
4126
4274
  return /^y(es)?$/i.test((await rl.question(`${question2} [y/N] `)).trim());
4127
4275
  } finally {
@@ -4130,7 +4278,7 @@ async function askTerminal(question2) {
4130
4278
  }
4131
4279
  async function askLine(question2) {
4132
4280
  if (!process.stdin.isTTY) return null;
4133
- const rl = createInterface({ input: process.stdin, output: process.stdout });
4281
+ const rl = createInterface2({ input: process.stdin, output: process.stdout });
4134
4282
  try {
4135
4283
  return await new Promise((resolve) => {
4136
4284
  rl.once("close", () => resolve(null));
@@ -4153,10 +4301,10 @@ function pluginCommand(over = {}) {
4153
4301
  );
4154
4302
  const deps = (c) => {
4155
4303
  const g2 = c.optsWithGlobals();
4156
- const dir = g2.pluginsDir ? path14.resolve(g2.pluginsDir) : defaultPluginsDir(env);
4304
+ const dir = g2.pluginsDir ? path16.resolve(g2.pluginsDir) : defaultPluginsDir(env);
4157
4305
  return {
4158
4306
  dir,
4159
- configDir: g2.configDir ? path14.resolve(g2.configDir) : defaultConfigDir(env),
4307
+ configDir: g2.configDir ? path16.resolve(g2.configDir) : defaultConfigDir(env),
4160
4308
  confirm: askTerminal,
4161
4309
  ask: askLine,
4162
4310
  restart: (proceed) => requestRestart(dir, proceed),
@@ -4191,7 +4339,7 @@ function pluginCommand(over = {}) {
4191
4339
  }
4192
4340
 
4193
4341
  // cli/remote.ts
4194
- import path15 from "node:path";
4342
+ import path17 from "node:path";
4195
4343
  import { Command as Command3, InvalidArgumentError as InvalidArgumentError2 } from "commander";
4196
4344
 
4197
4345
  // src/lib/server/cloud/pairing.ts
@@ -4505,7 +4653,7 @@ function remoteCommand(over = {}) {
4505
4653
  };
4506
4654
  const settingsFor = (c) => {
4507
4655
  const dir = c.optsWithGlobals().configDir;
4508
- const configDir = dir ? path15.resolve(dir) : defaultConfigDir(deps.env);
4656
+ const configDir = dir ? path17.resolve(dir) : defaultConfigDir(deps.env);
4509
4657
  const found = resolveInstall({ cwd: process.cwd(), env: deps.env });
4510
4658
  if (found.ok && isInside(configDir, found.install.homeDir)) {
4511
4659
  fail(
@@ -4864,14 +5012,14 @@ function supervise(opts) {
4864
5012
 
4865
5013
  // cli/upgrade.ts
4866
5014
  import { spawn as spawn3 } from "node:child_process";
4867
- import path17 from "node:path";
5015
+ import path19 from "node:path";
4868
5016
  import { fileURLToPath } from "node:url";
4869
5017
  import { Command as Command4 } from "commander";
4870
5018
 
4871
5019
  // src/lib/server/upgrade/clone.ts
4872
5020
  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";
5021
+ import { mkdir as mkdir8, readdir as readdir3, readFile as readFile9, realpath as realpath5 } from "node:fs/promises";
5022
+ import path18 from "node:path";
4875
5023
  var COMMITS_SHOWN = 20;
4876
5024
  var OUTPUT_KEPT = 6e4;
4877
5025
  var runCommand = (cmd, args, cwd) => new Promise((resolve) => {
@@ -4917,7 +5065,7 @@ async function checkClone(deps) {
4917
5065
  changes: []
4918
5066
  };
4919
5067
  out.current.version = packageVersion(
4920
- await readFile8(path16.join(deps.dir, "package.json"), "utf8").catch(() => null)
5068
+ await readFile9(path18.join(deps.dir, "package.json"), "utf8").catch(() => null)
4921
5069
  );
4922
5070
  const top = await g2("rev-parse", "--show-toplevel");
4923
5071
  const here = await realpath5(deps.dir).catch(() => deps.dir);
@@ -5043,7 +5191,7 @@ var CLONE_SETUP_STEPS = [
5043
5191
 
5044
5192
  // cli/upgrade.ts
5045
5193
  function installDir() {
5046
- return path17.resolve(path17.dirname(fileURLToPath(import.meta.url)), "..");
5194
+ return path19.resolve(path19.dirname(fileURLToPath(import.meta.url)), "..");
5047
5195
  }
5048
5196
  var runInherit = (cmd, args, cwd) => new Promise((resolve) => {
5049
5197
  const child = spawn3(cmd, args, { cwd, stdio: "inherit" });
@@ -5116,7 +5264,7 @@ function upgradeCommand(over = {}) {
5116
5264
  "--plugins-dir <dir>",
5117
5265
  "the plugins directory the running Wheelhouse loads from, to find it (default: $WHEELHOUSE_PLUGINS_DIR, else ~/.wheelhouse/plugins)"
5118
5266
  ).action(async (o) => {
5119
- const pluginsDir = o.pluginsDir ? path17.resolve(o.pluginsDir) : defaultPluginsDir(env);
5267
+ const pluginsDir = o.pluginsDir ? path19.resolve(o.pluginsDir) : defaultPluginsDir(env);
5120
5268
  const ok = await upgrade(
5121
5269
  {
5122
5270
  dir: installDir(),
@@ -5143,8 +5291,8 @@ function parsePort3(value) {
5143
5291
  return n;
5144
5292
  }
5145
5293
  function handlerPath() {
5146
- const here = path18.dirname(fileURLToPath2(import.meta.url));
5147
- return path18.resolve(here, "..", "build", "handler.js");
5294
+ const here = path20.dirname(fileURLToPath2(import.meta.url));
5295
+ return path20.resolve(here, "..", "build", "handler.js");
5148
5296
  }
5149
5297
  function openBrowser(url) {
5150
5298
  const [cmd, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["cmd", ["/c", "start", '""', url]] : ["xdg-open", [url]];
@@ -5157,8 +5305,8 @@ function openBrowser(url) {
5157
5305
  }
5158
5306
  }
5159
5307
  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);
5308
+ const configDir = opts.configDir ? path20.resolve(opts.configDir) : defaultConfigDir(process.env);
5309
+ const stateDir = opts.stateDir ? path20.resolve(opts.stateDir) : defaultStateDir(process.env);
5162
5310
  const resolved = resolveInstall({
5163
5311
  firstmate: opts.firstmate,
5164
5312
  home: opts.home,
@@ -5216,6 +5364,11 @@ async function open2(opts) {
5216
5364
  if (hosted.hosted) {
5217
5365
  console.log(`Previews: ${hosted.hosted.pattern} (${hosted.hosted.source})`);
5218
5366
  }
5367
+ process.env.WHEELHOUSE_HARNESS = await resolveHarness({
5368
+ explicit: opts.harness,
5369
+ env: process.env,
5370
+ configDir
5371
+ });
5219
5372
  const file = handlerPath();
5220
5373
  if (!existsSync3(file)) {
5221
5374
  console.error(
@@ -5225,9 +5378,9 @@ async function open2(opts) {
5225
5378
  }
5226
5379
  process.env.WHEELHOUSE_STATE_DIR = stateDir;
5227
5380
  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), "..");
5381
+ if (opts.pluginsDir) process.env.WHEELHOUSE_PLUGINS_DIR = path20.resolve(opts.pluginsDir);
5382
+ process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path20.resolve(path20.dirname(file), "..", "plugins");
5383
+ process.env.WHEELHOUSE_INSTALL_DIR = path20.resolve(path20.dirname(file), "..");
5231
5384
  if (opts.tmuxSocket) process.env.WHEELHOUSE_TMUX_SOCKET = opts.tmuxSocket;
5232
5385
  process.env.WHEELHOUSE_SKIP_PERMISSIONS = opts.skipPermissions ? "1" : "0";
5233
5386
  let cli = fileURLToPath2(import.meta.url);
@@ -5244,9 +5397,9 @@ async function open2(opts) {
5244
5397
  start: (port, restart) => {
5245
5398
  const next = takeHandoff(configDir);
5246
5399
  if (next && restart) {
5247
- cli = path18.join(next, "dist", "cli.js");
5400
+ cli = path20.join(next, "dist", "cli.js");
5248
5401
  process.env.WHEELHOUSE_INSTALL_DIR = next;
5249
- process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path18.join(next, "plugins");
5402
+ process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path20.join(next, "plugins");
5250
5403
  console.log(`Wheelhouse now runs from ${next}.`);
5251
5404
  }
5252
5405
  return fork(cli, ["__server", "--port", String(port)], {
@@ -5271,7 +5424,7 @@ async function open2(opts) {
5271
5424
  process.exit(code);
5272
5425
  }
5273
5426
  async function serve(opts) {
5274
- process.env.WHEELHOUSE_INSTALL_DIR = path18.resolve(path18.dirname(handlerPath()), "..");
5427
+ process.env.WHEELHOUSE_INSTALL_DIR = path20.resolve(path20.dirname(handlerPath()), "..");
5275
5428
  const selected = resolveInstall({
5276
5429
  firstmate: process.env.WHEELHOUSE_FIRSTMATE_DIR,
5277
5430
  home: process.env.WHEELHOUSE_HOME,
@@ -5370,6 +5523,16 @@ function program() {
5370
5523
  "--preview-url <pattern>",
5371
5524
  `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
5525
  ).option("--no-browser", "do not open the browser").option(
5526
+ "--harness <name>",
5527
+ "Firstmate tool: claude, codex, opencode, pi (default: environment, saved choice, or interactive picker; noninteractive fallback: claude)",
5528
+ (value) => {
5529
+ try {
5530
+ return parseHarness(value);
5531
+ } catch (e) {
5532
+ throw new InvalidArgumentError3(e instanceof Error ? e.message : String(e));
5533
+ }
5534
+ }
5535
+ ).option(
5373
5536
  "--no-skip-permissions",
5374
5537
  "start Firstmate without --dangerously-skip-permissions, so Claude Code asks before tools run (answer in the terminal drawer)"
5375
5538
  ).action((opts) => open2(opts));