@chrisjowen/wheelhouse 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1239) hide show
  1. package/README.md +8 -12
  2. package/build/client/_app/immutable/assets/0.CnotMMJE.css +1 -0
  3. package/build/client/_app/immutable/assets/0.CnotMMJE.css.br +0 -0
  4. package/build/client/_app/immutable/assets/0.CnotMMJE.css.gz +0 -0
  5. package/build/client/_app/immutable/assets/2.9iA_78o1.css +1 -0
  6. package/build/client/_app/immutable/assets/2.9iA_78o1.css.br +0 -0
  7. package/build/client/_app/immutable/assets/2.9iA_78o1.css.gz +0 -0
  8. package/build/client/_app/immutable/assets/DocSheet.36VhUGpN.css +1 -0
  9. package/build/client/_app/immutable/assets/DocSheet.36VhUGpN.css.br +0 -0
  10. package/build/client/_app/immutable/assets/DocSheet.36VhUGpN.css.gz +0 -0
  11. package/build/client/_app/immutable/assets/Terminal.B4BtIq8f.css +1 -0
  12. package/build/client/_app/immutable/assets/Terminal.B4BtIq8f.css.br +0 -0
  13. package/build/client/_app/immutable/assets/Terminal.B4BtIq8f.css.gz +0 -0
  14. package/build/client/_app/immutable/assets/source-serif-4-cyrillic-ext-opsz-italic.Bl6DJqma.woff2 +0 -0
  15. package/build/client/_app/immutable/assets/source-serif-4-cyrillic-ext-opsz-normal.DIwfbPUE.woff2 +0 -0
  16. package/build/client/_app/immutable/assets/source-serif-4-cyrillic-opsz-italic.Dibx14aP.woff2 +0 -0
  17. package/build/client/_app/immutable/assets/source-serif-4-cyrillic-opsz-normal.C0olyEE-.woff2 +0 -0
  18. package/build/client/_app/immutable/assets/source-serif-4-greek-opsz-italic.CMW9dfKg.woff2 +0 -0
  19. package/build/client/_app/immutable/assets/source-serif-4-greek-opsz-normal.DrHU7SY7.woff2 +0 -0
  20. package/build/client/_app/immutable/assets/source-serif-4-latin-ext-opsz-italic.BhUEwDRF.woff2 +0 -0
  21. package/build/client/_app/immutable/assets/source-serif-4-latin-ext-opsz-normal.HoL-AExg.woff2 +0 -0
  22. package/build/client/_app/immutable/assets/source-serif-4-latin-opsz-italic.BOLXpvkj.woff2 +0 -0
  23. package/build/client/_app/immutable/assets/source-serif-4-latin-opsz-normal.BpEBLj1O.woff2 +0 -0
  24. package/build/client/_app/immutable/assets/source-serif-4-vietnamese-opsz-italic.Hh3oeMt5.woff2 +0 -0
  25. package/build/client/_app/immutable/assets/source-serif-4-vietnamese-opsz-normal.DX68cEVD.woff2 +0 -0
  26. package/build/client/_app/immutable/chunks/6KGJY2fN.js +1 -0
  27. package/build/client/_app/immutable/chunks/6KGJY2fN.js.br +0 -0
  28. package/build/client/_app/immutable/chunks/6KGJY2fN.js.gz +0 -0
  29. package/build/client/_app/immutable/chunks/77EackVl.js +1 -0
  30. package/build/client/_app/immutable/chunks/77EackVl.js.br +0 -0
  31. package/build/client/_app/immutable/chunks/77EackVl.js.gz +0 -0
  32. package/build/client/_app/immutable/chunks/81z20Z2j.js +1 -0
  33. package/build/client/_app/immutable/chunks/81z20Z2j.js.br +0 -0
  34. package/build/client/_app/immutable/chunks/81z20Z2j.js.gz +0 -0
  35. package/build/client/_app/immutable/chunks/8S76_oNO.js +1 -0
  36. package/build/client/_app/immutable/chunks/8S76_oNO.js.br +0 -0
  37. package/build/client/_app/immutable/chunks/8S76_oNO.js.gz +0 -0
  38. package/build/client/_app/immutable/chunks/B03u1hTl.js +1 -0
  39. package/build/client/_app/immutable/chunks/B03u1hTl.js.br +0 -0
  40. package/build/client/_app/immutable/chunks/B03u1hTl.js.gz +0 -0
  41. package/build/client/_app/immutable/chunks/B1jHxhG9.js +1 -0
  42. package/build/client/_app/immutable/chunks/B1jHxhG9.js.br +0 -0
  43. package/build/client/_app/immutable/chunks/B1jHxhG9.js.gz +0 -0
  44. package/build/client/_app/immutable/chunks/B2LF3HQi.js +1 -0
  45. package/build/client/_app/immutable/chunks/B2LF3HQi.js.br +0 -0
  46. package/build/client/_app/immutable/chunks/B2LF3HQi.js.gz +0 -0
  47. package/build/client/_app/immutable/chunks/BA9P8WCL.js +1 -0
  48. package/build/client/_app/immutable/chunks/BA9P8WCL.js.br +2 -0
  49. package/build/client/_app/immutable/chunks/BA9P8WCL.js.gz +0 -0
  50. package/build/client/_app/immutable/chunks/BE9KMngo.js +1 -0
  51. package/build/client/_app/immutable/chunks/BE9KMngo.js.br +0 -0
  52. package/build/client/_app/immutable/chunks/BE9KMngo.js.gz +0 -0
  53. package/build/client/_app/immutable/chunks/BEnnwCJ1.js +1 -0
  54. package/build/client/_app/immutable/chunks/BEnnwCJ1.js.br +2 -0
  55. package/build/client/_app/immutable/chunks/BEnnwCJ1.js.gz +0 -0
  56. package/build/client/_app/immutable/chunks/BOaUgn_g.js +1 -0
  57. package/build/client/_app/immutable/chunks/BOaUgn_g.js.br +0 -0
  58. package/build/client/_app/immutable/chunks/BOaUgn_g.js.gz +0 -0
  59. package/build/client/_app/immutable/chunks/BQff8TZK.js +1 -0
  60. package/build/client/_app/immutable/chunks/BQff8TZK.js.br +0 -0
  61. package/build/client/_app/immutable/chunks/BQff8TZK.js.gz +0 -0
  62. package/build/client/_app/immutable/chunks/BSz_K-Yf.js +1 -0
  63. package/build/client/_app/immutable/chunks/BSz_K-Yf.js.br +3 -0
  64. package/build/client/_app/immutable/chunks/BSz_K-Yf.js.gz +0 -0
  65. package/build/client/_app/immutable/chunks/BW9ETppa.js +12 -0
  66. package/build/client/_app/immutable/chunks/BW9ETppa.js.br +0 -0
  67. package/build/client/_app/immutable/chunks/BW9ETppa.js.gz +0 -0
  68. package/build/client/_app/immutable/chunks/BWU6jjG7.js +1 -0
  69. package/build/client/_app/immutable/chunks/BWU6jjG7.js.br +0 -0
  70. package/build/client/_app/immutable/chunks/BWU6jjG7.js.gz +0 -0
  71. package/build/client/_app/immutable/chunks/BXN538J3.js +1 -0
  72. package/build/client/_app/immutable/chunks/BXN538J3.js.br +2 -0
  73. package/build/client/_app/immutable/chunks/BXN538J3.js.gz +0 -0
  74. package/build/client/_app/immutable/chunks/BY5XjwMm.js +1 -0
  75. package/build/client/_app/immutable/chunks/BY5XjwMm.js.br +0 -0
  76. package/build/client/_app/immutable/chunks/BY5XjwMm.js.gz +0 -0
  77. package/build/client/_app/immutable/chunks/BY6-BqNq.js +4 -0
  78. package/build/client/_app/immutable/chunks/BY6-BqNq.js.br +0 -0
  79. package/build/client/_app/immutable/chunks/BY6-BqNq.js.gz +0 -0
  80. package/build/client/_app/immutable/chunks/B_0uUD7w.js +1 -0
  81. package/build/client/_app/immutable/chunks/B_0uUD7w.js.br +0 -0
  82. package/build/client/_app/immutable/chunks/B_0uUD7w.js.gz +0 -0
  83. package/build/client/_app/immutable/chunks/BcbSpnWm.js +1 -0
  84. package/build/client/_app/immutable/chunks/BcbSpnWm.js.br +4 -0
  85. package/build/client/_app/immutable/chunks/BcbSpnWm.js.gz +0 -0
  86. package/build/client/_app/immutable/chunks/Bf3vwO3j.js +5 -0
  87. package/build/client/_app/immutable/chunks/Bf3vwO3j.js.br +0 -0
  88. package/build/client/_app/immutable/chunks/Bf3vwO3j.js.gz +0 -0
  89. package/build/client/_app/immutable/chunks/BjGE9KUs.js +1 -0
  90. package/build/client/_app/immutable/chunks/BjGE9KUs.js.br +2 -0
  91. package/build/client/_app/immutable/chunks/BjGE9KUs.js.gz +0 -0
  92. package/build/client/_app/immutable/chunks/Bk4GHXy3.js +3 -0
  93. package/build/client/_app/immutable/chunks/Bk4GHXy3.js.br +0 -0
  94. package/build/client/_app/immutable/chunks/Bk4GHXy3.js.gz +0 -0
  95. package/build/client/_app/immutable/chunks/BnTDmUXb.js +1 -0
  96. package/build/client/_app/immutable/chunks/BnTDmUXb.js.br +0 -0
  97. package/build/client/_app/immutable/chunks/BnTDmUXb.js.gz +0 -0
  98. package/build/client/_app/immutable/chunks/BnWmCwuC.js +1 -0
  99. package/build/client/_app/immutable/chunks/BnWmCwuC.js.br +0 -0
  100. package/build/client/_app/immutable/chunks/BnWmCwuC.js.gz +0 -0
  101. package/build/client/_app/immutable/chunks/BqW70ENa.js +1 -0
  102. package/build/client/_app/immutable/chunks/BqW70ENa.js.br +0 -0
  103. package/build/client/_app/immutable/chunks/BqW70ENa.js.gz +0 -0
  104. package/build/client/_app/immutable/chunks/Bx_jT140.js +1 -0
  105. package/build/client/_app/immutable/chunks/Bx_jT140.js.br +0 -0
  106. package/build/client/_app/immutable/chunks/Bx_jT140.js.gz +0 -0
  107. package/build/client/_app/immutable/chunks/BxcFe1oU.js +1 -0
  108. package/build/client/_app/immutable/chunks/BxcFe1oU.js.br +0 -0
  109. package/build/client/_app/immutable/chunks/BxcFe1oU.js.gz +0 -0
  110. package/build/client/_app/immutable/chunks/Bxsz_qq0.js +1 -0
  111. package/build/client/_app/immutable/chunks/Bxsz_qq0.js.br +0 -0
  112. package/build/client/_app/immutable/chunks/Bxsz_qq0.js.gz +0 -0
  113. package/build/client/_app/immutable/chunks/BzaeIa_Z.js +3 -0
  114. package/build/client/_app/immutable/chunks/BzaeIa_Z.js.br +0 -0
  115. package/build/client/_app/immutable/chunks/BzaeIa_Z.js.gz +0 -0
  116. package/build/client/_app/immutable/chunks/C0GP2-8b.js +1 -0
  117. package/build/client/_app/immutable/chunks/C0GP2-8b.js.br +0 -0
  118. package/build/client/_app/immutable/chunks/C0GP2-8b.js.gz +0 -0
  119. package/build/client/_app/immutable/chunks/C3tZQRMf.js +1 -0
  120. package/build/client/_app/immutable/chunks/C3tZQRMf.js.br +0 -0
  121. package/build/client/_app/immutable/chunks/C3tZQRMf.js.gz +0 -0
  122. package/build/client/_app/immutable/chunks/C6r96Eyi.js +1 -0
  123. package/build/client/_app/immutable/chunks/C6r96Eyi.js.br +0 -0
  124. package/build/client/_app/immutable/chunks/C6r96Eyi.js.gz +0 -0
  125. package/build/client/_app/immutable/chunks/C6z27OE7.js +2 -0
  126. package/build/client/_app/immutable/chunks/C6z27OE7.js.br +0 -0
  127. package/build/client/_app/immutable/chunks/C6z27OE7.js.gz +0 -0
  128. package/build/client/_app/immutable/chunks/C78ZDsKk.js +1 -0
  129. package/build/client/_app/immutable/chunks/C78ZDsKk.js.br +0 -0
  130. package/build/client/_app/immutable/chunks/C78ZDsKk.js.gz +0 -0
  131. package/build/client/_app/immutable/chunks/C7Fs1mBL.js +62 -0
  132. package/build/client/_app/immutable/chunks/C7Fs1mBL.js.br +0 -0
  133. package/build/client/_app/immutable/chunks/C7Fs1mBL.js.gz +0 -0
  134. package/build/client/_app/immutable/chunks/CCnl98J7.js +1 -0
  135. package/build/client/_app/immutable/chunks/CCnl98J7.js.br +0 -0
  136. package/build/client/_app/immutable/chunks/CCnl98J7.js.gz +0 -0
  137. package/build/client/_app/immutable/chunks/CMfBOxXQ.js +1 -0
  138. package/build/client/_app/immutable/chunks/CMfBOxXQ.js.br +0 -0
  139. package/build/client/_app/immutable/chunks/CMfBOxXQ.js.gz +0 -0
  140. package/build/client/_app/immutable/chunks/COL_5ZfB.js +1 -0
  141. package/build/client/_app/immutable/chunks/COL_5ZfB.js.br +0 -0
  142. package/build/client/_app/immutable/chunks/COL_5ZfB.js.gz +0 -0
  143. package/build/client/_app/immutable/chunks/CTEB9D1A.js +1 -0
  144. package/build/client/_app/immutable/chunks/CTEB9D1A.js.br +0 -0
  145. package/build/client/_app/immutable/chunks/CTEB9D1A.js.gz +0 -0
  146. package/build/client/_app/immutable/chunks/CVgy9834.js +1 -0
  147. package/build/client/_app/immutable/chunks/CVgy9834.js.br +0 -0
  148. package/build/client/_app/immutable/chunks/CVgy9834.js.gz +0 -0
  149. package/build/client/_app/immutable/chunks/CVml0jfr.js +1 -0
  150. package/build/client/_app/immutable/chunks/CVml0jfr.js.br +0 -0
  151. package/build/client/_app/immutable/chunks/CVml0jfr.js.gz +0 -0
  152. package/build/client/_app/immutable/chunks/CYYi7yCr.js +6 -0
  153. package/build/client/_app/immutable/chunks/CYYi7yCr.js.br +0 -0
  154. package/build/client/_app/immutable/chunks/CYYi7yCr.js.gz +0 -0
  155. package/build/client/_app/immutable/chunks/C_4BzEag.js +1 -0
  156. package/build/client/_app/immutable/chunks/C_4BzEag.js.br +0 -0
  157. package/build/client/_app/immutable/chunks/C_4BzEag.js.gz +0 -0
  158. package/build/client/_app/immutable/chunks/CaZX0vxy.js +1 -0
  159. package/build/client/_app/immutable/chunks/CaZX0vxy.js.br +0 -0
  160. package/build/client/_app/immutable/chunks/CaZX0vxy.js.gz +0 -0
  161. package/build/client/_app/immutable/chunks/Cf2gKex7.js +1 -0
  162. package/build/client/_app/immutable/chunks/Cf2gKex7.js.br +0 -0
  163. package/build/client/_app/immutable/chunks/Cf2gKex7.js.gz +0 -0
  164. package/build/client/_app/immutable/chunks/CfqBTqtn.js +2 -0
  165. package/build/client/_app/immutable/chunks/CfqBTqtn.js.br +0 -0
  166. package/build/client/_app/immutable/chunks/CfqBTqtn.js.gz +0 -0
  167. package/build/client/_app/immutable/chunks/CiUQOetT.js +1 -0
  168. package/build/client/_app/immutable/chunks/CiUQOetT.js.br +0 -0
  169. package/build/client/_app/immutable/chunks/CiUQOetT.js.gz +0 -0
  170. package/build/client/_app/immutable/chunks/CiatXE7j.js +1 -0
  171. package/build/client/_app/immutable/chunks/CiatXE7j.js.br +0 -0
  172. package/build/client/_app/immutable/chunks/CiatXE7j.js.gz +0 -0
  173. package/build/client/_app/immutable/chunks/Ck9EoeAb.js +6 -0
  174. package/build/client/_app/immutable/chunks/Ck9EoeAb.js.br +0 -0
  175. package/build/client/_app/immutable/chunks/Ck9EoeAb.js.gz +0 -0
  176. package/build/client/_app/immutable/chunks/ClrkSzQd.js +2 -0
  177. package/build/client/_app/immutable/chunks/ClrkSzQd.js.br +0 -0
  178. package/build/client/_app/immutable/chunks/ClrkSzQd.js.gz +0 -0
  179. package/build/client/_app/immutable/chunks/ClsjySa8.js +1 -0
  180. package/build/client/_app/immutable/chunks/ClsjySa8.js.br +0 -0
  181. package/build/client/_app/immutable/chunks/ClsjySa8.js.gz +0 -0
  182. package/build/client/_app/immutable/chunks/Cnq9BOc7.js +1 -0
  183. package/build/client/_app/immutable/chunks/Cnq9BOc7.js.br +0 -0
  184. package/build/client/_app/immutable/chunks/Cnq9BOc7.js.gz +0 -0
  185. package/build/client/_app/immutable/chunks/Cp8hcA3u.js +1 -0
  186. package/build/client/_app/immutable/chunks/Cp8hcA3u.js.br +0 -0
  187. package/build/client/_app/immutable/chunks/Cp8hcA3u.js.gz +0 -0
  188. package/build/client/_app/immutable/chunks/CqoCr8Ql.js +1 -0
  189. package/build/client/_app/immutable/chunks/CqoCr8Ql.js.br +0 -0
  190. package/build/client/_app/immutable/chunks/CqoCr8Ql.js.gz +0 -0
  191. package/build/client/_app/immutable/chunks/CseexmPn.js +1 -0
  192. package/build/client/_app/immutable/chunks/CseexmPn.js.br +0 -0
  193. package/build/client/_app/immutable/chunks/CseexmPn.js.gz +0 -0
  194. package/build/client/_app/immutable/chunks/CuwOw1LW.js +1 -0
  195. package/build/client/_app/immutable/chunks/CuwOw1LW.js.br +1 -0
  196. package/build/client/_app/immutable/chunks/CuwOw1LW.js.gz +0 -0
  197. package/build/client/_app/immutable/chunks/CyY9v8jo.js +1 -0
  198. package/build/client/_app/immutable/chunks/CyY9v8jo.js.br +0 -0
  199. package/build/client/_app/immutable/chunks/CyY9v8jo.js.gz +0 -0
  200. package/build/client/_app/immutable/chunks/D1FBTLG3.js +1 -0
  201. package/build/client/_app/immutable/chunks/D1FBTLG3.js.br +0 -0
  202. package/build/client/_app/immutable/chunks/D1FBTLG3.js.gz +0 -0
  203. package/build/client/_app/immutable/chunks/D2znDGM9.js +1 -0
  204. package/build/client/_app/immutable/chunks/D2znDGM9.js.br +0 -0
  205. package/build/client/_app/immutable/chunks/D2znDGM9.js.gz +0 -0
  206. package/build/client/_app/immutable/chunks/DBe0ItsO.js +1 -0
  207. package/build/client/_app/immutable/chunks/DBe0ItsO.js.br +0 -0
  208. package/build/client/_app/immutable/chunks/DBe0ItsO.js.gz +0 -0
  209. package/build/client/_app/immutable/chunks/DEvUyhmD.js +1 -0
  210. package/build/client/_app/immutable/chunks/DEvUyhmD.js.br +0 -0
  211. package/build/client/_app/immutable/chunks/DEvUyhmD.js.gz +0 -0
  212. package/build/client/_app/immutable/chunks/DGzCSaT5.js +1 -0
  213. package/build/client/_app/immutable/chunks/DGzCSaT5.js.br +0 -0
  214. package/build/client/_app/immutable/chunks/DGzCSaT5.js.gz +0 -0
  215. package/build/client/_app/immutable/chunks/DJNADPa5.js +1 -0
  216. package/build/client/_app/immutable/chunks/DJNADPa5.js.br +0 -0
  217. package/build/client/_app/immutable/chunks/DJNADPa5.js.gz +0 -0
  218. package/build/client/_app/immutable/chunks/DKMbfGV2.js +1 -0
  219. package/build/client/_app/immutable/chunks/DKMbfGV2.js.br +0 -0
  220. package/build/client/_app/immutable/chunks/DKMbfGV2.js.gz +0 -0
  221. package/build/client/_app/immutable/chunks/DKQe4Tss.js +1 -0
  222. package/build/client/_app/immutable/chunks/DKQe4Tss.js.br +0 -0
  223. package/build/client/_app/immutable/chunks/DKQe4Tss.js.gz +0 -0
  224. package/build/client/_app/immutable/chunks/DMaFToWa.js +1 -0
  225. package/build/client/_app/immutable/chunks/DMaFToWa.js.br +0 -0
  226. package/build/client/_app/immutable/chunks/DMaFToWa.js.gz +0 -0
  227. package/build/client/_app/immutable/chunks/DOcnk_Iz.js +1 -0
  228. package/build/client/_app/immutable/chunks/DOcnk_Iz.js.br +0 -0
  229. package/build/client/_app/immutable/chunks/DOcnk_Iz.js.gz +0 -0
  230. package/build/client/_app/immutable/chunks/DPG9zo5w.js +1 -0
  231. package/build/client/_app/immutable/chunks/DPG9zo5w.js.br +0 -0
  232. package/build/client/_app/immutable/chunks/DPG9zo5w.js.gz +0 -0
  233. package/build/client/_app/immutable/chunks/DaInEhsf.js +1 -0
  234. package/build/client/_app/immutable/chunks/DaInEhsf.js.br +0 -0
  235. package/build/client/_app/immutable/chunks/DaInEhsf.js.gz +0 -0
  236. package/build/client/_app/immutable/chunks/DauXN12s.js +1 -0
  237. package/build/client/_app/immutable/chunks/DauXN12s.js.br +0 -0
  238. package/build/client/_app/immutable/chunks/DauXN12s.js.gz +0 -0
  239. package/build/client/_app/immutable/chunks/DcMObMK7.js +1 -0
  240. package/build/client/_app/immutable/chunks/DcMObMK7.js.br +0 -0
  241. package/build/client/_app/immutable/chunks/DcMObMK7.js.gz +0 -0
  242. package/build/client/_app/immutable/chunks/DhAjT9_1.js +5 -0
  243. package/build/client/_app/immutable/chunks/DhAjT9_1.js.br +0 -0
  244. package/build/client/_app/immutable/chunks/DhAjT9_1.js.gz +0 -0
  245. package/build/client/_app/immutable/chunks/DlNTjUcK.js +1 -0
  246. package/build/client/_app/immutable/chunks/DlNTjUcK.js.br +0 -0
  247. package/build/client/_app/immutable/chunks/DlNTjUcK.js.gz +0 -0
  248. package/build/client/_app/immutable/chunks/DmZFADh0.js +1 -0
  249. package/build/client/_app/immutable/chunks/DmZFADh0.js.br +0 -0
  250. package/build/client/_app/immutable/chunks/DmZFADh0.js.gz +0 -0
  251. package/build/client/_app/immutable/chunks/DmyvifTK.js +1 -0
  252. package/build/client/_app/immutable/chunks/DmyvifTK.js.br +0 -0
  253. package/build/client/_app/immutable/chunks/DmyvifTK.js.gz +0 -0
  254. package/build/client/_app/immutable/chunks/DoRw4E3Y.js +2 -0
  255. package/build/client/_app/immutable/chunks/DoRw4E3Y.js.br +0 -0
  256. package/build/client/_app/immutable/chunks/DoRw4E3Y.js.gz +0 -0
  257. package/build/client/_app/immutable/chunks/DqTdajKC.js +1 -0
  258. package/build/client/_app/immutable/chunks/DqTdajKC.js.br +0 -0
  259. package/build/client/_app/immutable/chunks/DqTdajKC.js.gz +0 -0
  260. package/build/client/_app/immutable/chunks/Dr5WHZNT.js +1 -0
  261. package/build/client/_app/immutable/chunks/Dr5WHZNT.js.br +0 -0
  262. package/build/client/_app/immutable/chunks/Dr5WHZNT.js.gz +0 -0
  263. package/build/client/_app/immutable/chunks/Dt3N8Hez.js +3 -0
  264. package/build/client/_app/immutable/chunks/Dt3N8Hez.js.br +0 -0
  265. package/build/client/_app/immutable/chunks/Dt3N8Hez.js.gz +0 -0
  266. package/build/client/_app/immutable/chunks/DtD2Y_Dr.js +1 -0
  267. package/build/client/_app/immutable/chunks/DtD2Y_Dr.js.br +0 -0
  268. package/build/client/_app/immutable/chunks/DtD2Y_Dr.js.gz +0 -0
  269. package/build/client/_app/immutable/chunks/DyU4yPaU.js +6 -0
  270. package/build/client/_app/immutable/chunks/DyU4yPaU.js.br +0 -0
  271. package/build/client/_app/immutable/chunks/DyU4yPaU.js.gz +0 -0
  272. package/build/client/_app/immutable/chunks/F5SKhJ33.js +1 -0
  273. package/build/client/_app/immutable/chunks/F5SKhJ33.js.br +0 -0
  274. package/build/client/_app/immutable/chunks/F5SKhJ33.js.gz +0 -0
  275. package/build/client/_app/immutable/chunks/FJoUa_PR.js +2 -0
  276. package/build/client/_app/immutable/chunks/FJoUa_PR.js.br +0 -0
  277. package/build/client/_app/immutable/chunks/FJoUa_PR.js.gz +0 -0
  278. package/build/client/_app/immutable/chunks/HE_L8BZy.js +1 -0
  279. package/build/client/_app/immutable/chunks/HE_L8BZy.js.br +0 -0
  280. package/build/client/_app/immutable/chunks/HE_L8BZy.js.gz +0 -0
  281. package/build/client/_app/immutable/chunks/Jyk2s3ap.js +1 -0
  282. package/build/client/_app/immutable/chunks/Jyk2s3ap.js.br +0 -0
  283. package/build/client/_app/immutable/chunks/Jyk2s3ap.js.gz +0 -0
  284. package/build/client/_app/immutable/chunks/Pq0PSdOV.js +1 -0
  285. package/build/client/_app/immutable/chunks/Pq0PSdOV.js.br +0 -0
  286. package/build/client/_app/immutable/chunks/Pq0PSdOV.js.gz +0 -0
  287. package/build/client/_app/immutable/chunks/Qkk13bNR.js +1 -0
  288. package/build/client/_app/immutable/chunks/Qkk13bNR.js.br +0 -0
  289. package/build/client/_app/immutable/chunks/Qkk13bNR.js.gz +0 -0
  290. package/build/client/_app/immutable/chunks/WPBAVIF-.js +1 -0
  291. package/build/client/_app/immutable/chunks/WPBAVIF-.js.br +0 -0
  292. package/build/client/_app/immutable/chunks/WPBAVIF-.js.gz +0 -0
  293. package/build/client/_app/immutable/chunks/ZpfR4O1W.js +1 -0
  294. package/build/client/_app/immutable/chunks/ZpfR4O1W.js.br +3 -0
  295. package/build/client/_app/immutable/chunks/ZpfR4O1W.js.gz +0 -0
  296. package/build/client/_app/immutable/chunks/bz-rffqD.js +1 -0
  297. package/build/client/_app/immutable/chunks/bz-rffqD.js.br +0 -0
  298. package/build/client/_app/immutable/chunks/bz-rffqD.js.gz +0 -0
  299. package/build/client/_app/immutable/chunks/cAfuCUf-.js +1 -0
  300. package/build/client/_app/immutable/chunks/cAfuCUf-.js.br +0 -0
  301. package/build/client/_app/immutable/chunks/cAfuCUf-.js.gz +0 -0
  302. package/build/client/_app/immutable/chunks/cn3db0Eu.js +1 -0
  303. package/build/client/_app/immutable/chunks/cn3db0Eu.js.br +0 -0
  304. package/build/client/_app/immutable/chunks/cn3db0Eu.js.gz +0 -0
  305. package/build/client/_app/immutable/chunks/dPcYB-8F.js +1 -0
  306. package/build/client/_app/immutable/chunks/dPcYB-8F.js.br +0 -0
  307. package/build/client/_app/immutable/chunks/dPcYB-8F.js.gz +0 -0
  308. package/build/client/_app/immutable/chunks/g935d0hS.js +1 -0
  309. package/build/client/_app/immutable/chunks/g935d0hS.js.br +0 -0
  310. package/build/client/_app/immutable/chunks/g935d0hS.js.gz +0 -0
  311. package/build/client/_app/immutable/chunks/hABrpXhm.js +1 -0
  312. package/build/client/_app/immutable/chunks/hABrpXhm.js.br +0 -0
  313. package/build/client/_app/immutable/chunks/hABrpXhm.js.gz +0 -0
  314. package/build/client/_app/immutable/chunks/hG2NMSLy.js +1 -0
  315. package/build/client/_app/immutable/chunks/hG2NMSLy.js.br +0 -0
  316. package/build/client/_app/immutable/chunks/hG2NMSLy.js.gz +0 -0
  317. package/build/client/_app/immutable/chunks/hxhxtxcx.js +1 -0
  318. package/build/client/_app/immutable/chunks/hxhxtxcx.js.br +0 -0
  319. package/build/client/_app/immutable/chunks/hxhxtxcx.js.gz +0 -0
  320. package/build/client/_app/immutable/chunks/k9B4BpVo.js +1 -0
  321. package/build/client/_app/immutable/chunks/k9B4BpVo.js.br +0 -0
  322. package/build/client/_app/immutable/chunks/k9B4BpVo.js.gz +0 -0
  323. package/build/client/_app/immutable/chunks/mldb2ZSY.js +1 -0
  324. package/build/client/_app/immutable/chunks/mldb2ZSY.js.br +0 -0
  325. package/build/client/_app/immutable/chunks/mldb2ZSY.js.gz +0 -0
  326. package/build/client/_app/immutable/chunks/pK-hw0Fs.js +1 -0
  327. package/build/client/_app/immutable/chunks/pK-hw0Fs.js.br +0 -0
  328. package/build/client/_app/immutable/chunks/pK-hw0Fs.js.gz +0 -0
  329. package/build/client/_app/immutable/chunks/qL90aEhP.js +1 -0
  330. package/build/client/_app/immutable/chunks/qL90aEhP.js.br +0 -0
  331. package/build/client/_app/immutable/chunks/qL90aEhP.js.gz +0 -0
  332. package/build/client/_app/immutable/chunks/sJOYqL84.js +1 -0
  333. package/build/client/_app/immutable/chunks/sJOYqL84.js.br +0 -0
  334. package/build/client/_app/immutable/chunks/sJOYqL84.js.gz +0 -0
  335. package/build/client/_app/immutable/chunks/xjN9NojQ.js +1 -0
  336. package/build/client/_app/immutable/chunks/xjN9NojQ.js.br +0 -0
  337. package/build/client/_app/immutable/chunks/xjN9NojQ.js.gz +0 -0
  338. package/build/client/_app/immutable/chunks/xtM1htB2.js +1 -0
  339. package/build/client/_app/immutable/chunks/xtM1htB2.js.br +0 -0
  340. package/build/client/_app/immutable/chunks/xtM1htB2.js.gz +0 -0
  341. package/build/client/_app/immutable/chunks/yErhTWsV.js +1 -0
  342. package/build/client/_app/immutable/chunks/yErhTWsV.js.br +0 -0
  343. package/build/client/_app/immutable/chunks/yErhTWsV.js.gz +0 -0
  344. package/build/client/_app/immutable/entry/app.CNYsYhC4.js +2 -0
  345. package/build/client/_app/immutable/entry/app.CNYsYhC4.js.br +0 -0
  346. package/build/client/_app/immutable/entry/app.CNYsYhC4.js.gz +0 -0
  347. package/build/client/_app/immutable/entry/start.mK_UHwMN.js +1 -0
  348. package/build/client/_app/immutable/entry/start.mK_UHwMN.js.br +0 -0
  349. package/build/client/_app/immutable/entry/start.mK_UHwMN.js.gz +0 -0
  350. package/build/client/_app/immutable/nodes/0.DtN4YFje.js +10 -0
  351. package/build/client/_app/immutable/nodes/0.DtN4YFje.js.br +0 -0
  352. package/build/client/_app/immutable/nodes/0.DtN4YFje.js.gz +0 -0
  353. package/build/client/_app/immutable/nodes/1.ClvVCr4L.js +1 -0
  354. package/build/client/_app/immutable/nodes/1.ClvVCr4L.js.br +0 -0
  355. package/build/client/_app/immutable/nodes/1.ClvVCr4L.js.gz +0 -0
  356. package/build/client/_app/immutable/nodes/11.OqWsY9Nc.js +1 -0
  357. package/build/client/_app/immutable/nodes/11.OqWsY9Nc.js.br +0 -0
  358. package/build/client/_app/immutable/nodes/11.OqWsY9Nc.js.gz +0 -0
  359. package/build/client/_app/immutable/nodes/12.DfgqDS8l.js +3 -0
  360. package/build/client/_app/immutable/nodes/12.DfgqDS8l.js.br +0 -0
  361. package/build/client/_app/immutable/nodes/12.DfgqDS8l.js.gz +0 -0
  362. package/build/client/_app/immutable/nodes/13.1duazv8t.js +1 -0
  363. package/build/client/_app/immutable/nodes/13.1duazv8t.js.br +0 -0
  364. package/build/client/_app/immutable/nodes/13.1duazv8t.js.gz +0 -0
  365. package/build/client/_app/immutable/nodes/14.BfIerr4V.js +14 -0
  366. package/build/client/_app/immutable/nodes/14.BfIerr4V.js.br +0 -0
  367. package/build/client/_app/immutable/nodes/14.BfIerr4V.js.gz +0 -0
  368. package/build/client/_app/immutable/nodes/15.DmLlt-C-.js +150 -0
  369. package/build/client/_app/immutable/nodes/15.DmLlt-C-.js.br +0 -0
  370. package/build/client/_app/immutable/nodes/15.DmLlt-C-.js.gz +0 -0
  371. package/build/client/_app/immutable/nodes/16.CzFG4aOU.js +3 -0
  372. package/build/client/_app/immutable/nodes/16.CzFG4aOU.js.br +0 -0
  373. package/build/client/_app/immutable/nodes/16.CzFG4aOU.js.gz +0 -0
  374. package/build/client/_app/immutable/nodes/17.BaPPg4SL.js +4 -0
  375. package/build/client/_app/immutable/nodes/17.BaPPg4SL.js.br +0 -0
  376. package/build/client/_app/immutable/nodes/17.BaPPg4SL.js.gz +0 -0
  377. package/build/client/_app/immutable/nodes/19.C2oiQ46N.js +2 -0
  378. package/build/client/_app/immutable/nodes/19.C2oiQ46N.js.br +2 -0
  379. package/build/client/_app/immutable/nodes/19.C2oiQ46N.js.gz +0 -0
  380. package/build/client/_app/immutable/nodes/2.Dq_B0Tbj.js +25 -0
  381. package/build/client/_app/immutable/nodes/2.Dq_B0Tbj.js.br +0 -0
  382. package/build/client/_app/immutable/nodes/2.Dq_B0Tbj.js.gz +0 -0
  383. package/build/client/_app/immutable/nodes/20.CPMVfHf7.js +11 -0
  384. package/build/client/_app/immutable/nodes/20.CPMVfHf7.js.br +0 -0
  385. package/build/client/_app/immutable/nodes/20.CPMVfHf7.js.gz +0 -0
  386. package/build/client/_app/immutable/nodes/21.9YuqSrL7.js +6 -0
  387. package/build/client/_app/immutable/nodes/21.9YuqSrL7.js.br +0 -0
  388. package/build/client/_app/immutable/nodes/21.9YuqSrL7.js.gz +0 -0
  389. package/build/client/_app/immutable/nodes/22.BO24qytx.js +2 -0
  390. package/build/client/_app/immutable/nodes/22.BO24qytx.js.br +0 -0
  391. package/build/client/_app/immutable/nodes/22.BO24qytx.js.gz +0 -0
  392. package/build/client/_app/immutable/nodes/23.BZVPu-10.js +4 -0
  393. package/build/client/_app/immutable/nodes/23.BZVPu-10.js.br +0 -0
  394. package/build/client/_app/immutable/nodes/23.BZVPu-10.js.gz +0 -0
  395. package/build/client/_app/immutable/nodes/24.6GcEKUlO.js +7 -0
  396. package/build/client/_app/immutable/nodes/24.6GcEKUlO.js.br +0 -0
  397. package/build/client/_app/immutable/nodes/24.6GcEKUlO.js.gz +0 -0
  398. package/build/client/_app/immutable/nodes/25.w0lArDUN.js +12 -0
  399. package/build/client/_app/immutable/nodes/25.w0lArDUN.js.br +0 -0
  400. package/build/client/_app/immutable/nodes/25.w0lArDUN.js.gz +0 -0
  401. package/build/client/_app/immutable/nodes/26.Hf_eo1VF.js +4 -0
  402. package/build/client/_app/immutable/nodes/26.Hf_eo1VF.js.br +0 -0
  403. package/build/client/_app/immutable/nodes/26.Hf_eo1VF.js.gz +0 -0
  404. package/build/client/_app/immutable/nodes/27.BtdPxpe8.js +1 -0
  405. package/build/client/_app/immutable/nodes/27.BtdPxpe8.js.br +0 -0
  406. package/build/client/_app/immutable/nodes/27.BtdPxpe8.js.gz +0 -0
  407. package/build/client/_app/immutable/nodes/28.CKKhSvp0.js +6 -0
  408. package/build/client/_app/immutable/nodes/28.CKKhSvp0.js.br +0 -0
  409. package/build/client/_app/immutable/nodes/28.CKKhSvp0.js.gz +0 -0
  410. package/build/client/_app/immutable/nodes/3.BtWx-zmQ.js +5 -0
  411. package/build/client/_app/immutable/nodes/3.BtWx-zmQ.js.br +0 -0
  412. package/build/client/_app/immutable/nodes/3.BtWx-zmQ.js.gz +0 -0
  413. package/build/client/_app/immutable/nodes/4.BIwEKk5d.js +1 -0
  414. package/build/client/_app/immutable/nodes/4.BIwEKk5d.js.br +0 -0
  415. package/build/client/_app/immutable/nodes/4.BIwEKk5d.js.gz +0 -0
  416. package/build/client/_app/immutable/nodes/5.DN5gHj4T.js +1 -0
  417. package/build/client/_app/immutable/nodes/5.DN5gHj4T.js.br +0 -0
  418. package/build/client/_app/immutable/nodes/5.DN5gHj4T.js.gz +0 -0
  419. package/build/client/_app/immutable/nodes/6.B2TumWTu.js +2 -0
  420. package/build/client/_app/immutable/nodes/6.B2TumWTu.js.br +0 -0
  421. package/build/client/_app/immutable/nodes/6.B2TumWTu.js.gz +0 -0
  422. package/build/client/_app/immutable/nodes/7.7HwkhZCu.js +7 -0
  423. package/build/client/_app/immutable/nodes/7.7HwkhZCu.js.br +0 -0
  424. package/build/client/_app/immutable/nodes/7.7HwkhZCu.js.gz +0 -0
  425. package/build/client/_app/immutable/nodes/8.BdDQA39V.js +5 -0
  426. package/build/client/_app/immutable/nodes/8.BdDQA39V.js.br +0 -0
  427. package/build/client/_app/immutable/nodes/8.BdDQA39V.js.gz +0 -0
  428. package/build/client/_app/immutable/nodes/9.BFDI6Dge.js +1 -0
  429. package/build/client/_app/immutable/nodes/9.BFDI6Dge.js.br +0 -0
  430. package/build/client/_app/immutable/nodes/9.BFDI6Dge.js.gz +0 -0
  431. package/build/client/_app/version.json +1 -1
  432. package/build/client/_app/version.json.br +0 -0
  433. package/build/client/_app/version.json.gz +0 -0
  434. package/build/client/apple-touch-icon.png +0 -0
  435. package/build/client/icon-192.png +0 -0
  436. package/build/client/icon-512.png +0 -0
  437. package/build/client/manifest.webmanifest +15 -0
  438. package/build/handler.js +6 -6
  439. package/build/index.js +6 -6
  440. package/build/server/chunks/chunks/DecisionCard.js-BGiCJsY8.js +1650 -0
  441. package/build/server/chunks/chunks/DocSheet.js-Bt5HhZU1.js +56 -0
  442. package/build/server/chunks/chunks/EtaLine.js-B29ZmIHz.js +98 -0
  443. package/build/server/chunks/chunks/EveryProjectSwitch.js-Y9V_kZu-.js +160 -0
  444. package/build/server/chunks/chunks/Icon.js-DZKsF3Gu.js +129 -0
  445. package/build/server/chunks/chunks/InsightsNav.js-BuykbHO_.js +18 -0
  446. package/build/server/chunks/chunks/InstallFromGitHub.js-D4tZgz1R.js +691 -0
  447. package/build/server/chunks/chunks/InstallPlugin.js-Bb559YFl.js +18 -0
  448. package/build/server/chunks/chunks/Lightbox.js-Bx6pV-NL.js +34 -0
  449. package/build/server/chunks/chunks/LinkedText.js-Bto6J20h.js +24 -0
  450. package/build/server/chunks/chunks/MateHealthPill.js-DMM619gj.js +22 -0
  451. package/build/server/chunks/chunks/MicButton.svelte_svelte_type_style_lang.js-BPXrY8rN.js +168 -0
  452. package/build/server/chunks/chunks/OpenDecision.js-DXWQXckD.js +47 -0
  453. package/build/server/chunks/chunks/PluginElement.js-B4PKHT2H.js +25 -0
  454. package/build/server/chunks/chunks/ProjectBanner.js-DGz8m8Rb.js +111 -0
  455. package/build/server/chunks/chunks/ProjectStateMark.js-ruGL_Mma.js +41 -0
  456. package/build/server/chunks/chunks/QuestionList.js-CODH1M5Z.js +214 -0
  457. package/build/server/chunks/chunks/RemotesPanel.js-0dTa0R21.js +235 -0
  458. package/build/server/chunks/chunks/ResizableRail.js-CsL4ZlsF.js +23 -0
  459. package/build/server/chunks/chunks/SettingsNav.js-DMJGoXeO.js +25 -0
  460. package/build/server/chunks/chunks/Sheet.js-13o9LKQh.js +3854 -0
  461. package/build/server/chunks/chunks/SlotContent.js-CyN_Ifyi.js +687 -0
  462. package/build/server/chunks/chunks/Switch.js-5SL7Wwa1.js +66 -0
  463. package/build/server/chunks/chunks/TimeBar.js-Dduf0kTb.js +32 -0
  464. package/build/server/chunks/chunks/TimeLegend.js-L8tTH6Ey.js +29 -0
  465. package/build/server/chunks/chunks/WhereBadge.js-DocJaNZe.js +88 -0
  466. package/build/server/chunks/chunks/addresses.js-DmMJzvLK.js +52 -0
  467. package/build/server/chunks/chunks/aliases.svelte.js-C2TIS6Rl.js +138 -0
  468. package/build/server/chunks/chunks/arrow-down.js-aY_1v1NB.js +18 -0
  469. package/build/server/chunks/chunks/arrow-left.js-B6z6NudH.js +18 -0
  470. package/build/server/chunks/chunks/arrow-right.js-vz3YukWJ.js +18 -0
  471. package/build/server/chunks/chunks/arrow-up-right.js-B5ORjULl.js +18 -0
  472. package/build/server/chunks/chunks/arrow-up.js-D8v3fwUB.js +18 -0
  473. package/build/server/chunks/chunks/berths.js-B282QffH.js +270 -0
  474. package/build/server/chunks/chunks/book-open.js-CMP_t0Zr.js +23 -0
  475. package/build/server/chunks/chunks/bridge.js-DW4bV609.js +60 -0
  476. package/build/server/chunks/chunks/brief.js-DyAlUufG.js +152 -0
  477. package/build/server/chunks/chunks/buildlog.js-BCKtSKOt.js +55 -0
  478. package/build/server/chunks/chunks/button.js-Bg2ee8PR.js +4027 -0
  479. package/build/server/chunks/chunks/chat.svelte.js-PibwBfjx.js +744 -0
  480. package/build/server/chunks/chunks/check.js-BizfScOy.js +15 -0
  481. package/build/server/chunks/chunks/checks.js-DGdGhp1G.js +258 -0
  482. package/build/server/chunks/chunks/chevron-down.js-DLf9oWYQ.js +15 -0
  483. package/build/server/chunks/chunks/chevron-left.js-D17b39o2.js +15 -0
  484. package/build/server/chunks/chunks/chevron-right.js-PPUgqXgy.js +15 -0
  485. package/build/server/chunks/chunks/circle-alert.js-B6F_Zxc7.js +23 -0
  486. package/build/server/chunks/chunks/circle-arrow-up.js-CWxi34UW.js +20 -0
  487. package/build/server/chunks/chunks/circle-check.js-oWgE2-Ib.js +19 -0
  488. package/build/server/chunks/chunks/circle-dashed.js-DCwzYTH0.js +24 -0
  489. package/build/server/chunks/chunks/circle-dot.js-DBkCvy7T.js +18 -0
  490. package/build/server/chunks/chunks/client.js-Z9ZB5A3s.js +24 -0
  491. package/build/server/chunks/chunks/clock.js-BRFOn_JF.js +18 -0
  492. package/build/server/chunks/chunks/cloud.js-DiLoEINt.js +30 -0
  493. package/build/server/chunks/chunks/config.js-E2-TrXNJ.js +185 -0
  494. package/build/server/chunks/chunks/copy.js-BTlHqk6c.js +33 -0
  495. package/build/server/chunks/chunks/detail.js-C0HwzMn_.js +146 -0
  496. package/build/server/chunks/chunks/dialog-content.js-CuWOPqMm.js +3356 -0
  497. package/build/server/chunks/chunks/external-link.js-DDXtld4W.js +24 -0
  498. package/build/server/chunks/chunks/eye.js-BTtIKcHk.js +23 -0
  499. package/build/server/chunks/chunks/feedback.js-C0F-OaSn.js +67 -0
  500. package/build/server/chunks/chunks/format.js-D3lWEg6U.js +70 -0
  501. package/build/server/chunks/chunks/git-pull-request.js-DPwvD_k6.js +20 -0
  502. package/build/server/chunks/chunks/hand.js-OgzocAnn.js +25 -0
  503. package/build/server/chunks/chunks/index-server.js-qvYADcF_.js +17 -0
  504. package/build/server/chunks/chunks/index-server2.js-DMc-UvjC.js +19 -0
  505. package/build/server/chunks/chunks/index.js-CNAJQSM0.js +1524 -0
  506. package/build/server/chunks/chunks/index2.js-BuH5pXIO.js +46 -0
  507. package/build/server/chunks/chunks/insights.svelte.js-EX826idS.js +732 -0
  508. package/build/server/chunks/chunks/internal.js-C0t7gs85.js +151 -0
  509. package/build/server/chunks/chunks/keychain.js-Bl9yNOSB.js +52 -0
  510. package/build/server/chunks/chunks/live.svelte.js-DmaKnCsQ.js +241 -0
  511. package/build/server/chunks/chunks/loader-circle.js-B1RYi3bC.js +16 -0
  512. package/build/server/chunks/chunks/lock.js-BRFwEIy_.js +48 -0
  513. package/build/server/chunks/chunks/markdown.js-8EKwlA8M.js +2656 -0
  514. package/build/server/chunks/chunks/message-square.js-CrZeO0AI.js +22 -0
  515. package/build/server/chunks/chunks/messages-square.js-Du4pyX-d.js +47 -0
  516. package/build/server/chunks/chunks/minus.js-oy46PWoK.js +15 -0
  517. package/build/server/chunks/chunks/nav.js-DcQjV5OF.js +30 -0
  518. package/build/server/chunks/chunks/page.js-CJdNW_XA.js +11 -0
  519. package/build/server/chunks/chunks/phone.svelte.js-DSEWkTcb.js +7 -0
  520. package/build/server/chunks/chunks/plus.js-_sWZi-RM.js +15 -0
  521. package/build/server/chunks/chunks/previewhelper2.js-BCYWAXyJ.js +165 -0
  522. package/build/server/chunks/chunks/previewnote.js-DB6VK2fp.js +56 -0
  523. package/build/server/chunks/chunks/pullrequests.js-CCzk2sqm.js +12 -0
  524. package/build/server/chunks/chunks/puzzle.js-DISwYPxF.js +22 -0
  525. package/build/server/chunks/chunks/refresh-cw.js-CbDhy8fm.js +26 -0
  526. package/build/server/chunks/chunks/remote.js-C8NtkvLx.js +13 -0
  527. package/build/server/chunks/chunks/repo.js-CNzWdJys.js +33 -0
  528. package/build/server/chunks/chunks/root.js-BMwYWidL.js +3105 -0
  529. package/build/server/chunks/chunks/rotate-cw.js-BPC6IxqZ.js +21 -0
  530. package/build/server/chunks/chunks/runtime.js-DgaQqsVF.js +17833 -0
  531. package/build/server/chunks/chunks/scale.js-5D4jKhvV.js +21 -0
  532. package/build/server/chunks/chunks/service.js-Cy0qlGNT.js +1337 -0
  533. package/build/server/chunks/chunks/service2.js-BUuLZLu5.js +1140 -0
  534. package/build/server/chunks/chunks/settings.js-CagyrW8Z.js +23 -0
  535. package/build/server/chunks/chunks/settings2.js-DPuzmbc5.js +694 -0
  536. package/build/server/chunks/chunks/shield-check.js-CDitrAGo.js +23 -0
  537. package/build/server/chunks/chunks/ship.js-BVQ9iFsJ.js +31 -0
  538. package/build/server/chunks/chunks/sparkles.js-Mcsine-_.js +26 -0
  539. package/build/server/chunks/chunks/square-terminal.js-CBs-sBt1.js +30 -0
  540. package/build/server/chunks/chunks/starter.js-DRsRq6lV.js +628 -0
  541. package/build/server/chunks/chunks/terminal.js-BckfZrAP.js +71 -0
  542. package/build/server/chunks/chunks/tone.js-Dxsl-adt.js +31 -0
  543. package/build/server/chunks/chunks/triangle-alert.js-DCXyDwgC.js +25 -0
  544. package/build/server/chunks/chunks/updates.js-CPT_S4vG.js +23 -0
  545. package/build/server/chunks/chunks/updates.svelte.js-DaHXemUC.js +88 -0
  546. package/build/server/chunks/chunks/urls.js-CM6aklCF.js +8 -0
  547. package/build/server/chunks/chunks/users.js-B-CA8JtQ.js +20 -0
  548. package/build/server/chunks/chunks/utils3.js-ByN3K_WW.js +3290 -0
  549. package/build/server/chunks/chunks/vault.js-DZFWbeCU.js +162 -0
  550. package/build/server/chunks/chunks/view.js-BSXOPXh3.js +76 -0
  551. package/build/server/chunks/chunks/words.js-DoCiNU5f.js +53 -0
  552. package/build/server/chunks/chunks/x.js-vo5qKISo.js +18 -0
  553. package/build/server/chunks/entries/endpoints/api/apps/_op_/_server.ts.js-DHRttFTZ.js +96 -0
  554. package/build/server/chunks/entries/endpoints/api/cloud/_server.ts.js-DRUnwmY_.js +79 -0
  555. package/build/server/chunks/entries/endpoints/api/cloud/previews/_server.ts.js-Bf8mLtRw.js +43 -0
  556. package/build/server/chunks/entries/endpoints/api/events/_server.ts.js-CFQWYnSF.js +106 -0
  557. package/build/server/chunks/entries/endpoints/api/files/_server.ts.js-DivBWRYq.js +55 -0
  558. package/build/server/chunks/entries/endpoints/api/firstmate/chat/_server.ts.js-tTC_RJl3.js +89 -0
  559. package/build/server/chunks/entries/endpoints/api/firstmate/commands/_server.ts.js-vZvRvOTi.js +125 -0
  560. package/build/server/chunks/entries/endpoints/api/firstmate/dismiss/_server.ts.js-BSZ_yvi2.js +51 -0
  561. package/build/server/chunks/entries/endpoints/api/firstmate/input/_server.ts.js-GcLDzApj.js +57 -0
  562. package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/_server.ts.js-CE4NXzMK.js +50 -0
  563. package/build/server/chunks/entries/endpoints/api/firstmate/messages/_server.ts.js-CaxvkmW1.js +97 -0
  564. package/build/server/chunks/entries/endpoints/api/firstmate/pick/_server.ts.js-DjGy8j6U.js +60 -0
  565. package/build/server/chunks/entries/endpoints/api/firstmate/reactions/_server.ts.js-B9JTcRZ-.js +71 -0
  566. package/build/server/chunks/entries/endpoints/api/firstmate/start/_server.ts.js-LA2imWIt.js +50 -0
  567. package/build/server/chunks/entries/endpoints/api/fleet/_server.ts.js-CpR9UKUp.js +42 -0
  568. package/build/server/chunks/entries/endpoints/api/gateway/_server.ts.js-Ct3zJpGp.js +106 -0
  569. package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-o_9aL7gt.js +42 -0
  570. package/build/server/chunks/entries/endpoints/api/inbox/_server.ts.js-DhOBDQa6.js +66 -0
  571. package/build/server/chunks/entries/endpoints/api/inbox/report/_server.ts.js-BKxB5PDV.js +57 -0
  572. package/build/server/chunks/entries/endpoints/api/insights/_server.ts.js-D5Gg4kol.js +42 -0
  573. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/config/_server.ts.js-A1lw0Ldv.js +77 -0
  574. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/_server.ts.js-BFAOjNft.js +66 -0
  575. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/summary/_server.ts.js-Dmq3DhyB.js +61 -0
  576. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/icon/_icon_/_server.ts.js-Z_D76GMl.js +58 -0
  577. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/load/_server.ts.js-C8BaVcnJ.js +27 -0
  578. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/ui/_...path_/_server.ts.js-BMYZAEQn.js +65 -0
  579. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/update/_server.ts.js-QhAgv3Mq.js +39 -0
  580. package/build/server/chunks/entries/endpoints/api/plugins/_server.ts.js-BkXisb_q.js +42 -0
  581. package/build/server/chunks/entries/endpoints/api/plugins/inspect/_server.ts.js-BxBVAipn.js +39 -0
  582. package/build/server/chunks/entries/endpoints/api/plugins/install/_server.ts.js-DHe0Y-ck.js +42 -0
  583. package/build/server/chunks/entries/endpoints/api/plugins/updates/_server.ts.js-DyrnKFGK.js +27 -0
  584. package/build/server/chunks/entries/endpoints/api/previews/check/_server.ts.js-B5-Q_Pfy.js +65 -0
  585. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/_server.ts.js-CXT0t4GT.js +47 -0
  586. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/_server.ts.js-C4GIfRHH.js +56 -0
  587. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/_server.ts.js-Dc9s4cez.js +68 -0
  588. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/_server.ts.js-vdzB2xgv.js +55 -0
  589. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/file/_server.ts.js-C_FJm_du.js +78 -0
  590. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/_server.ts.js-BULKZ_84.js +61 -0
  591. package/build/server/chunks/entries/endpoints/api/second-mates/_id_/peek/_server.ts.js-BWi__jmG.js +51 -0
  592. package/build/server/chunks/entries/endpoints/api/services/_server.ts.js-Dlm9JukW.js +61 -0
  593. package/build/server/chunks/entries/endpoints/api/setup/_server.ts.js-8KkKfI-b.js +100 -0
  594. package/build/server/chunks/entries/endpoints/api/slots/_server.ts.js-C0t3n3rC.js +50 -0
  595. package/build/server/chunks/entries/endpoints/api/tasks/_id_/_server.ts.js-DhWmfcw8.js +47 -0
  596. package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/_server.ts.js-CzSFHZLr.js +66 -0
  597. package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/_server.ts.js-DXLL2NLX.js +59 -0
  598. package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/_server.ts.js-DscE2sa8.js +107 -0
  599. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/_server.ts.js-qxRt7CO9.js +61 -0
  600. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/helper/_server.ts.js-CVC67F8h.js +64 -0
  601. package/build/server/chunks/entries/endpoints/api/vault/_server.ts.js-C9jI7ywJ.js +68 -0
  602. package/build/server/chunks/entries/endpoints/api/wheelhouse/source/_server.ts.js-QcFb__5e.js +40 -0
  603. package/build/server/chunks/entries/endpoints/api/wheelhouse/update/_server.ts.js-yYEp6hFu.js +27 -0
  604. package/build/server/chunks/entries/endpoints/api/wheelhouse/upgrade/_server.ts.js-YcIPKmyk.js +27 -0
  605. package/build/server/chunks/entries/endpoints/tasks/_id_/review/_server.ts.js-Dl5YccjX.js +46 -0
  606. package/build/server/chunks/entries/fallbacks/error.svelte.js-C0-QO05E.js +15 -0
  607. package/build/server/chunks/entries/hooks.server.js-BGT9tj5a.js +79 -0
  608. package/build/server/chunks/entries/pages/_layout.server.ts.js-BPqTpXnT.js +27 -0
  609. package/build/server/chunks/entries/pages/_layout.svelte.js-DrL1HCPc.js +5501 -0
  610. package/build/server/chunks/entries/pages/_page.server.ts.js-Ck4LSRvY.js +16 -0
  611. package/build/server/chunks/entries/pages/_page.svelte.js-C0XtmgnT.js +3271 -0
  612. package/build/server/chunks/entries/pages/decisions/_page.server.ts.js-ffNDlvSu.js +11 -0
  613. package/build/server/chunks/entries/pages/decisions/_page.svelte.js-CvbTkNdA.js +202 -0
  614. package/build/server/chunks/entries/pages/deck/_page.server.ts.js-DF0j_WRo.js +16 -0
  615. package/build/server/chunks/entries/pages/deck/_page.svelte.js-ByaF4X4f.js +101 -0
  616. package/build/server/chunks/entries/pages/files/_page.server.ts.js-l4nvknAj.js +17 -0
  617. package/build/server/chunks/entries/pages/files/_page.svelte.js-C6FWKguz.js +61 -0
  618. package/build/server/chunks/entries/pages/harbour/_page.server.ts.js-Dbjsqtp9.js +46 -0
  619. package/build/server/chunks/entries/pages/harbour/_page.svelte.js-DW1Zg1aI.js +750 -0
  620. package/build/server/chunks/entries/pages/headroom/_page.server.ts.js-CwQpGWGn.js +11 -0
  621. package/build/server/chunks/entries/pages/headroom/_page.svelte.js-Bofa0rV1.js +183 -0
  622. package/build/server/chunks/entries/pages/inbox/_page.server.ts.js-LnoZxPlZ.js +11 -0
  623. package/build/server/chunks/entries/pages/inbox/_page.svelte.js-NEaMeQr4.js +192 -0
  624. package/build/server/chunks/entries/pages/more/_page.svelte.js-Biw-GzWK.js +108 -0
  625. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.server.ts.js-qN2haElN.js +16 -0
  626. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.svelte.js-IxIvs80b.js +57 -0
  627. package/build/server/chunks/entries/pages/projects/_id_/_page.server.ts.js-C_KiW7id.js +23 -0
  628. package/build/server/chunks/entries/pages/projects/_id_/_page.svelte.js-CZuOnAvk.js +957 -0
  629. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.server.ts.js-Bgx5a4Bq.js +21 -0
  630. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.svelte.js-BiaWDy5c.js +79 -0
  631. package/build/server/chunks/entries/pages/projects/_id_/passage/_page.server.ts.js-BbsvTa0x.js +27 -0
  632. package/build/server/chunks/entries/pages/projects/_id_/passage/_page.svelte.js-B3HRzAzL.js +419 -0
  633. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.server.ts.js-DyN1H2dy.js +15 -0
  634. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.svelte.js-DaA-EDRZ.js +1881 -0
  635. package/build/server/chunks/entries/pages/remotes/_page.server.ts.js-BYdNkq73.js +11 -0
  636. package/build/server/chunks/entries/pages/remotes/_page.svelte.js-BSG7dgKM.js +31 -0
  637. package/build/server/chunks/entries/pages/second-mates/_page.svelte.js-Dd467IE0.js +221 -0
  638. package/build/server/chunks/entries/pages/settings/cloud/_page.server.ts.js-oouHUw1O.js +11 -0
  639. package/build/server/chunks/entries/pages/settings/cloud/_page.svelte.js-CCSostfV.js +33 -0
  640. package/build/server/chunks/entries/pages/settings/gateway/_page.server.ts.js-C4QsORKn.js +11 -0
  641. package/build/server/chunks/entries/pages/settings/gateway/_page.svelte.js-7xxA_syu.js +209 -0
  642. package/build/server/chunks/entries/pages/settings/plugins/_page.server.ts.js-K1Bl3LMF.js +19 -0
  643. package/build/server/chunks/entries/pages/settings/plugins/_page.svelte.js-BclcwMMK.js +611 -0
  644. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/_page.server.ts.js-Bb7A-51X.js +17 -0
  645. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/_page.svelte.js-DU1PVspq.js +229 -0
  646. package/build/server/chunks/entries/pages/settings/setup/_page.server.ts.js-CYEEIqKU.js +11 -0
  647. package/build/server/chunks/entries/pages/settings/setup/_page.svelte.js-el4jo1--.js +55 -0
  648. package/build/server/chunks/entries/pages/settings/update/_page.server.ts.js-Bvs60PVx.js +11 -0
  649. package/build/server/chunks/entries/pages/settings/update/_page.svelte.js-BPBP_MeS.js +61 -0
  650. package/build/server/chunks/entries/pages/setup/_page.server.ts.js-B1wfLoGz.js +18 -0
  651. package/build/server/chunks/entries/pages/setup/_page.svelte.js-Cnl_NDaT.js +979 -0
  652. package/build/server/chunks/entries/pages/tasks/_id_/_page.server.ts.js-CpWnd8Ii.js +25 -0
  653. package/build/server/chunks/entries/pages/tasks/_id_/_page.svelte.js-BsZxwgSh.js +2951 -0
  654. package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.server.ts.js-B16EJzeL.js +24 -0
  655. package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.svelte.js-CbUrpRPl.js +80 -0
  656. package/build/server/chunks/entries/pages/time/_page.server.ts.js-CqYmO2e_.js +11 -0
  657. package/build/server/chunks/entries/pages/time/_page.svelte.js-sI9ldCiM.js +108 -0
  658. package/build/server/chunks/handler-55U1exID.js +1474 -0
  659. package/build/server/chunks/index.js-_VxtUxOR.js +4296 -0
  660. package/build/server/chunks/manifest.js-CvlmBvHi.js +642 -0
  661. package/build/server/chunks/nodes/0.js-0UOgcqd1.js +49 -0
  662. package/build/server/chunks/nodes/1.js-BpZhjsrX.js +9 -0
  663. package/build/server/chunks/nodes/10.js-CqEYHIx6.js +12 -0
  664. package/build/server/chunks/nodes/11.js-D73yUAUK.js +47 -0
  665. package/build/server/chunks/nodes/12.js-wge33Kh_.js +49 -0
  666. package/build/server/chunks/nodes/13.js-CP9VWd6v.js +48 -0
  667. package/build/server/chunks/nodes/14.js-pI9xqI8W.js +49 -0
  668. package/build/server/chunks/nodes/15.js-BADx9-2h.js +48 -0
  669. package/build/server/chunks/nodes/16.js-B1DTie2c.js +25 -0
  670. package/build/server/chunks/nodes/17.js-DqrtuOB_.js +9 -0
  671. package/build/server/chunks/nodes/18.js-DbSnX-1e.js +12 -0
  672. package/build/server/chunks/nodes/19.js-DG8BDwO1.js +25 -0
  673. package/build/server/chunks/nodes/2.js-Blr6vlmx.js +47 -0
  674. package/build/server/chunks/nodes/20.js-P8jhtZV0.js +47 -0
  675. package/build/server/chunks/nodes/21.js-Dahbb_SQ.js +47 -0
  676. package/build/server/chunks/nodes/22.js-Br6SrZKH.js +50 -0
  677. package/build/server/chunks/nodes/23.js-BS4hjiBj.js +49 -0
  678. package/build/server/chunks/nodes/24.js-DGa7X3nY.js +26 -0
  679. package/build/server/chunks/nodes/25.js-C8Rf-PwV.js +51 -0
  680. package/build/server/chunks/nodes/26.js-B8iZRseb.js +48 -0
  681. package/build/server/chunks/nodes/27.js-B8HE4f8h.js +48 -0
  682. package/build/server/chunks/nodes/28.js-NecfT5Uo.js +47 -0
  683. package/build/server/chunks/nodes/3.js-CsbGbh89.js +47 -0
  684. package/build/server/chunks/nodes/4.js-B75wgQPd.js +47 -0
  685. package/build/server/chunks/nodes/5.js-DLOa8tSh.js +47 -0
  686. package/build/server/chunks/nodes/6.js-CiYesw8R.js +51 -0
  687. package/build/server/chunks/nodes/7.js-Bs4Z3Vhh.js +47 -0
  688. package/build/server/chunks/nodes/8.js-BrqJRPDG.js +47 -0
  689. package/build/server/chunks/nodes/9.js-BxYs6WJn.js +9 -0
  690. package/dist/cli.js +2437 -404
  691. package/dist/wh-vault.js +1 -1
  692. package/package.json +3 -1
  693. package/plugins/shared-review/.wheelhouse-plugin/plugin.json +2 -1
  694. package/plugins/shared-review/README.md +3 -1
  695. package/plugins/shared-review/wheelhouse/server/index.js +11 -2
  696. package/plugins/shared-review/wheelhouse/ui/index.js +284 -2
  697. package/plugins/vault/wheelhouse/icon.svg +1 -1
  698. package/skills/manage-wheelhouse/SKILL.md +103 -0
  699. package/skills/manage-wheelhouse/references/operations.md +856 -0
  700. package/build/client/_app/immutable/assets/0.CxNAeXUL.css +0 -1
  701. package/build/client/_app/immutable/assets/0.CxNAeXUL.css.br +0 -0
  702. package/build/client/_app/immutable/assets/0.CxNAeXUL.css.gz +0 -0
  703. package/build/client/_app/immutable/assets/2.DvyEOdRq.css +0 -1
  704. package/build/client/_app/immutable/assets/2.DvyEOdRq.css.br +0 -0
  705. package/build/client/_app/immutable/assets/2.DvyEOdRq.css.gz +0 -0
  706. package/build/client/_app/immutable/assets/DocSheet.CgzYidp-.css +0 -1
  707. package/build/client/_app/immutable/assets/DocSheet.CgzYidp-.css.br +0 -0
  708. package/build/client/_app/immutable/assets/DocSheet.CgzYidp-.css.gz +0 -0
  709. package/build/client/_app/immutable/chunks/-8jzdSzV.js +0 -1
  710. package/build/client/_app/immutable/chunks/-8jzdSzV.js.br +0 -0
  711. package/build/client/_app/immutable/chunks/-8jzdSzV.js.gz +0 -0
  712. package/build/client/_app/immutable/chunks/1WRcPxqg.js +0 -1
  713. package/build/client/_app/immutable/chunks/1WRcPxqg.js.br +0 -0
  714. package/build/client/_app/immutable/chunks/1WRcPxqg.js.gz +0 -0
  715. package/build/client/_app/immutable/chunks/2u5U2sv5.js +0 -1
  716. package/build/client/_app/immutable/chunks/2u5U2sv5.js.br +0 -2
  717. package/build/client/_app/immutable/chunks/2u5U2sv5.js.gz +0 -0
  718. package/build/client/_app/immutable/chunks/4VJeJzd5.js +0 -1
  719. package/build/client/_app/immutable/chunks/4VJeJzd5.js.br +0 -0
  720. package/build/client/_app/immutable/chunks/4VJeJzd5.js.gz +0 -0
  721. package/build/client/_app/immutable/chunks/6x5fl0iw.js +0 -1
  722. package/build/client/_app/immutable/chunks/6x5fl0iw.js.br +0 -0
  723. package/build/client/_app/immutable/chunks/6x5fl0iw.js.gz +0 -0
  724. package/build/client/_app/immutable/chunks/6x9f8OOX.js +0 -1
  725. package/build/client/_app/immutable/chunks/6x9f8OOX.js.br +0 -0
  726. package/build/client/_app/immutable/chunks/6x9f8OOX.js.gz +0 -0
  727. package/build/client/_app/immutable/chunks/B2ctrXx5.js +0 -1
  728. package/build/client/_app/immutable/chunks/B2ctrXx5.js.br +0 -0
  729. package/build/client/_app/immutable/chunks/B2ctrXx5.js.gz +0 -0
  730. package/build/client/_app/immutable/chunks/B3j8X7eP.js +0 -1
  731. package/build/client/_app/immutable/chunks/B3j8X7eP.js.br +0 -0
  732. package/build/client/_app/immutable/chunks/B3j8X7eP.js.gz +0 -0
  733. package/build/client/_app/immutable/chunks/BBLx2oxZ.js +0 -2
  734. package/build/client/_app/immutable/chunks/BBLx2oxZ.js.br +0 -0
  735. package/build/client/_app/immutable/chunks/BBLx2oxZ.js.gz +0 -0
  736. package/build/client/_app/immutable/chunks/BBWR4qW2.js +0 -1
  737. package/build/client/_app/immutable/chunks/BBWR4qW2.js.br +0 -0
  738. package/build/client/_app/immutable/chunks/BBWR4qW2.js.gz +0 -0
  739. package/build/client/_app/immutable/chunks/BBk8ftHo.js +0 -1
  740. package/build/client/_app/immutable/chunks/BBk8ftHo.js.br +0 -0
  741. package/build/client/_app/immutable/chunks/BBk8ftHo.js.gz +0 -0
  742. package/build/client/_app/immutable/chunks/BHVTrNhR.js +0 -3
  743. package/build/client/_app/immutable/chunks/BHVTrNhR.js.br +0 -0
  744. package/build/client/_app/immutable/chunks/BHVTrNhR.js.gz +0 -0
  745. package/build/client/_app/immutable/chunks/BH_GqTtA.js +0 -1
  746. package/build/client/_app/immutable/chunks/BH_GqTtA.js.br +0 -0
  747. package/build/client/_app/immutable/chunks/BH_GqTtA.js.gz +0 -0
  748. package/build/client/_app/immutable/chunks/BHu5PcTV.js +0 -1
  749. package/build/client/_app/immutable/chunks/BHu5PcTV.js.br +0 -0
  750. package/build/client/_app/immutable/chunks/BHu5PcTV.js.gz +0 -0
  751. package/build/client/_app/immutable/chunks/BKSx-wDn.js +0 -1
  752. package/build/client/_app/immutable/chunks/BKSx-wDn.js.br +0 -0
  753. package/build/client/_app/immutable/chunks/BKSx-wDn.js.gz +0 -0
  754. package/build/client/_app/immutable/chunks/BOY9WARo.js +0 -2
  755. package/build/client/_app/immutable/chunks/BOY9WARo.js.br +0 -0
  756. package/build/client/_app/immutable/chunks/BOY9WARo.js.gz +0 -0
  757. package/build/client/_app/immutable/chunks/BQle5rwK.js +0 -1
  758. package/build/client/_app/immutable/chunks/BQle5rwK.js.br +0 -0
  759. package/build/client/_app/immutable/chunks/BQle5rwK.js.gz +0 -0
  760. package/build/client/_app/immutable/chunks/BRuDnHyc.js +0 -2
  761. package/build/client/_app/immutable/chunks/BRuDnHyc.js.br +0 -0
  762. package/build/client/_app/immutable/chunks/BRuDnHyc.js.gz +0 -0
  763. package/build/client/_app/immutable/chunks/BSMH3sl_.js +0 -1
  764. package/build/client/_app/immutable/chunks/BSMH3sl_.js.br +0 -0
  765. package/build/client/_app/immutable/chunks/BSMH3sl_.js.gz +0 -0
  766. package/build/client/_app/immutable/chunks/BV-FSL0u.js +0 -1
  767. package/build/client/_app/immutable/chunks/BV-FSL0u.js.br +0 -0
  768. package/build/client/_app/immutable/chunks/BV-FSL0u.js.gz +0 -0
  769. package/build/client/_app/immutable/chunks/BXF1nDhR.js +0 -1
  770. package/build/client/_app/immutable/chunks/BXF1nDhR.js.br +0 -0
  771. package/build/client/_app/immutable/chunks/BXF1nDhR.js.gz +0 -0
  772. package/build/client/_app/immutable/chunks/BbU5AsRD.js +0 -1
  773. package/build/client/_app/immutable/chunks/BbU5AsRD.js.br +0 -0
  774. package/build/client/_app/immutable/chunks/BbU5AsRD.js.gz +0 -0
  775. package/build/client/_app/immutable/chunks/BkoErw_r.js +0 -1
  776. package/build/client/_app/immutable/chunks/BkoErw_r.js.br +0 -0
  777. package/build/client/_app/immutable/chunks/BkoErw_r.js.gz +0 -0
  778. package/build/client/_app/immutable/chunks/Bl1tMgf8.js +0 -1
  779. package/build/client/_app/immutable/chunks/Bl1tMgf8.js.br +0 -0
  780. package/build/client/_app/immutable/chunks/Bl1tMgf8.js.gz +0 -0
  781. package/build/client/_app/immutable/chunks/Blj84s6L.js +0 -1
  782. package/build/client/_app/immutable/chunks/Blj84s6L.js.br +0 -0
  783. package/build/client/_app/immutable/chunks/Blj84s6L.js.gz +0 -0
  784. package/build/client/_app/immutable/chunks/Bo1SMwPt.js +0 -1
  785. package/build/client/_app/immutable/chunks/Bo1SMwPt.js.br +0 -0
  786. package/build/client/_app/immutable/chunks/Bo1SMwPt.js.gz +0 -0
  787. package/build/client/_app/immutable/chunks/BudxWdUe.js +0 -1
  788. package/build/client/_app/immutable/chunks/BudxWdUe.js.br +0 -0
  789. package/build/client/_app/immutable/chunks/BudxWdUe.js.gz +0 -0
  790. package/build/client/_app/immutable/chunks/BvCDG8Dd.js +0 -1
  791. package/build/client/_app/immutable/chunks/BvCDG8Dd.js.br +0 -0
  792. package/build/client/_app/immutable/chunks/BvCDG8Dd.js.gz +0 -0
  793. package/build/client/_app/immutable/chunks/BwLAIydi.js +0 -1
  794. package/build/client/_app/immutable/chunks/BwLAIydi.js.br +0 -0
  795. package/build/client/_app/immutable/chunks/BwLAIydi.js.gz +0 -0
  796. package/build/client/_app/immutable/chunks/Bxc9WZZR.js +0 -1
  797. package/build/client/_app/immutable/chunks/Bxc9WZZR.js.br +0 -0
  798. package/build/client/_app/immutable/chunks/Bxc9WZZR.js.gz +0 -0
  799. package/build/client/_app/immutable/chunks/Bxza7kFR.js +0 -1
  800. package/build/client/_app/immutable/chunks/Bxza7kFR.js.br +0 -0
  801. package/build/client/_app/immutable/chunks/Bxza7kFR.js.gz +0 -0
  802. package/build/client/_app/immutable/chunks/BzYzevxb.js +0 -1
  803. package/build/client/_app/immutable/chunks/BzYzevxb.js.br +0 -0
  804. package/build/client/_app/immutable/chunks/BzYzevxb.js.gz +0 -0
  805. package/build/client/_app/immutable/chunks/C03wrLr6.js +0 -1
  806. package/build/client/_app/immutable/chunks/C03wrLr6.js.br +0 -0
  807. package/build/client/_app/immutable/chunks/C03wrLr6.js.gz +0 -0
  808. package/build/client/_app/immutable/chunks/C0nIjZ3F.js +0 -1
  809. package/build/client/_app/immutable/chunks/C0nIjZ3F.js.br +0 -0
  810. package/build/client/_app/immutable/chunks/C0nIjZ3F.js.gz +0 -0
  811. package/build/client/_app/immutable/chunks/CDGwSysF.js +0 -1
  812. package/build/client/_app/immutable/chunks/CDGwSysF.js.br +0 -0
  813. package/build/client/_app/immutable/chunks/CDGwSysF.js.gz +0 -0
  814. package/build/client/_app/immutable/chunks/CEbzGOE-.js +0 -1
  815. package/build/client/_app/immutable/chunks/CEbzGOE-.js.br +0 -0
  816. package/build/client/_app/immutable/chunks/CEbzGOE-.js.gz +0 -0
  817. package/build/client/_app/immutable/chunks/CLeVtrv1.js +0 -1
  818. package/build/client/_app/immutable/chunks/CLeVtrv1.js.br +0 -3
  819. package/build/client/_app/immutable/chunks/CLeVtrv1.js.gz +0 -0
  820. package/build/client/_app/immutable/chunks/CLsVEPfB.js +0 -1
  821. package/build/client/_app/immutable/chunks/CLsVEPfB.js.br +0 -0
  822. package/build/client/_app/immutable/chunks/CLsVEPfB.js.gz +0 -0
  823. package/build/client/_app/immutable/chunks/CLubIfWE.js +0 -1
  824. package/build/client/_app/immutable/chunks/CLubIfWE.js.br +0 -0
  825. package/build/client/_app/immutable/chunks/CLubIfWE.js.gz +0 -0
  826. package/build/client/_app/immutable/chunks/CNcEb8rI.js +0 -1
  827. package/build/client/_app/immutable/chunks/CNcEb8rI.js.br +0 -0
  828. package/build/client/_app/immutable/chunks/CNcEb8rI.js.gz +0 -0
  829. package/build/client/_app/immutable/chunks/CWq2437p.js +0 -1
  830. package/build/client/_app/immutable/chunks/CWq2437p.js.br +0 -0
  831. package/build/client/_app/immutable/chunks/CWq2437p.js.gz +0 -0
  832. package/build/client/_app/immutable/chunks/CaaP7Cfy.js +0 -1
  833. package/build/client/_app/immutable/chunks/CaaP7Cfy.js.br +0 -0
  834. package/build/client/_app/immutable/chunks/CaaP7Cfy.js.gz +0 -0
  835. package/build/client/_app/immutable/chunks/CbGZd9iT.js +0 -1
  836. package/build/client/_app/immutable/chunks/CbGZd9iT.js.br +0 -0
  837. package/build/client/_app/immutable/chunks/CbGZd9iT.js.gz +0 -0
  838. package/build/client/_app/immutable/chunks/Cbmz3nkf.js +0 -1
  839. package/build/client/_app/immutable/chunks/Cbmz3nkf.js.br +0 -2
  840. package/build/client/_app/immutable/chunks/Cbmz3nkf.js.gz +0 -0
  841. package/build/client/_app/immutable/chunks/CdUf0vBw.js +0 -1
  842. package/build/client/_app/immutable/chunks/CdUf0vBw.js.br +0 -0
  843. package/build/client/_app/immutable/chunks/CdUf0vBw.js.gz +0 -0
  844. package/build/client/_app/immutable/chunks/Ce7qVCDI.js +0 -1
  845. package/build/client/_app/immutable/chunks/Ce7qVCDI.js.br +0 -0
  846. package/build/client/_app/immutable/chunks/Ce7qVCDI.js.gz +0 -0
  847. package/build/client/_app/immutable/chunks/Cio5-ROX.js +0 -6
  848. package/build/client/_app/immutable/chunks/Cio5-ROX.js.br +0 -0
  849. package/build/client/_app/immutable/chunks/Cio5-ROX.js.gz +0 -0
  850. package/build/client/_app/immutable/chunks/CrPP6AgN.js +0 -1
  851. package/build/client/_app/immutable/chunks/CrPP6AgN.js.br +0 -0
  852. package/build/client/_app/immutable/chunks/CrPP6AgN.js.gz +0 -0
  853. package/build/client/_app/immutable/chunks/CyhrvZ9i.js +0 -1
  854. package/build/client/_app/immutable/chunks/CyhrvZ9i.js.br +0 -0
  855. package/build/client/_app/immutable/chunks/CyhrvZ9i.js.gz +0 -0
  856. package/build/client/_app/immutable/chunks/D1pI6A8q.js +0 -1
  857. package/build/client/_app/immutable/chunks/D1pI6A8q.js.br +0 -0
  858. package/build/client/_app/immutable/chunks/D1pI6A8q.js.gz +0 -0
  859. package/build/client/_app/immutable/chunks/D6hXuNzR.js +0 -1
  860. package/build/client/_app/immutable/chunks/D6hXuNzR.js.br +0 -1
  861. package/build/client/_app/immutable/chunks/D6hXuNzR.js.gz +0 -0
  862. package/build/client/_app/immutable/chunks/D8Hr8rhb.js +0 -1
  863. package/build/client/_app/immutable/chunks/D8Hr8rhb.js.br +0 -0
  864. package/build/client/_app/immutable/chunks/D8Hr8rhb.js.gz +0 -0
  865. package/build/client/_app/immutable/chunks/D8s8J8Og.js +0 -1
  866. package/build/client/_app/immutable/chunks/D8s8J8Og.js.br +0 -0
  867. package/build/client/_app/immutable/chunks/D8s8J8Og.js.gz +0 -0
  868. package/build/client/_app/immutable/chunks/DCbu051o.js +0 -1
  869. package/build/client/_app/immutable/chunks/DCbu051o.js.br +0 -2
  870. package/build/client/_app/immutable/chunks/DCbu051o.js.gz +0 -0
  871. package/build/client/_app/immutable/chunks/DDUWrtWf.js +0 -1
  872. package/build/client/_app/immutable/chunks/DDUWrtWf.js.br +0 -0
  873. package/build/client/_app/immutable/chunks/DDUWrtWf.js.gz +0 -0
  874. package/build/client/_app/immutable/chunks/DEIc6x-v.js +0 -1
  875. package/build/client/_app/immutable/chunks/DEIc6x-v.js.br +0 -0
  876. package/build/client/_app/immutable/chunks/DEIc6x-v.js.gz +0 -0
  877. package/build/client/_app/immutable/chunks/DMefFkCx.js +0 -1
  878. package/build/client/_app/immutable/chunks/DMefFkCx.js.br +0 -0
  879. package/build/client/_app/immutable/chunks/DMefFkCx.js.gz +0 -0
  880. package/build/client/_app/immutable/chunks/DQEmyAe4.js +0 -1
  881. package/build/client/_app/immutable/chunks/DQEmyAe4.js.br +0 -2
  882. package/build/client/_app/immutable/chunks/DQEmyAe4.js.gz +0 -0
  883. package/build/client/_app/immutable/chunks/DRK9oYED.js +0 -1
  884. package/build/client/_app/immutable/chunks/DRK9oYED.js.br +0 -0
  885. package/build/client/_app/immutable/chunks/DRK9oYED.js.gz +0 -0
  886. package/build/client/_app/immutable/chunks/DU2mz-vL.js +0 -1
  887. package/build/client/_app/immutable/chunks/DU2mz-vL.js.br +0 -0
  888. package/build/client/_app/immutable/chunks/DU2mz-vL.js.gz +0 -0
  889. package/build/client/_app/immutable/chunks/DWlSINHC.js +0 -1
  890. package/build/client/_app/immutable/chunks/DWlSINHC.js.br +0 -0
  891. package/build/client/_app/immutable/chunks/DWlSINHC.js.gz +0 -0
  892. package/build/client/_app/immutable/chunks/DZJnY8Nx.js +0 -1
  893. package/build/client/_app/immutable/chunks/DZJnY8Nx.js.br +0 -0
  894. package/build/client/_app/immutable/chunks/DZJnY8Nx.js.gz +0 -0
  895. package/build/client/_app/immutable/chunks/DdB79emW.js +0 -1
  896. package/build/client/_app/immutable/chunks/DdB79emW.js.br +0 -0
  897. package/build/client/_app/immutable/chunks/DdB79emW.js.gz +0 -0
  898. package/build/client/_app/immutable/chunks/DdRufa9N.js +0 -1
  899. package/build/client/_app/immutable/chunks/DdRufa9N.js.br +0 -0
  900. package/build/client/_app/immutable/chunks/DdRufa9N.js.gz +0 -0
  901. package/build/client/_app/immutable/chunks/DgOhqfdF.js +0 -1
  902. package/build/client/_app/immutable/chunks/DgOhqfdF.js.br +0 -0
  903. package/build/client/_app/immutable/chunks/DgOhqfdF.js.gz +0 -0
  904. package/build/client/_app/immutable/chunks/Dhv6iBq8.js +0 -1
  905. package/build/client/_app/immutable/chunks/Dhv6iBq8.js.br +0 -0
  906. package/build/client/_app/immutable/chunks/Dhv6iBq8.js.gz +0 -0
  907. package/build/client/_app/immutable/chunks/Dj3Af0xC.js +0 -2
  908. package/build/client/_app/immutable/chunks/Dj3Af0xC.js.br +0 -0
  909. package/build/client/_app/immutable/chunks/Dj3Af0xC.js.gz +0 -0
  910. package/build/client/_app/immutable/chunks/DkG1ReNq.js +0 -1
  911. package/build/client/_app/immutable/chunks/DkG1ReNq.js.br +0 -0
  912. package/build/client/_app/immutable/chunks/DkG1ReNq.js.gz +0 -0
  913. package/build/client/_app/immutable/chunks/DlcOqcbg.js +0 -1
  914. package/build/client/_app/immutable/chunks/DlcOqcbg.js.br +0 -0
  915. package/build/client/_app/immutable/chunks/DlcOqcbg.js.gz +0 -0
  916. package/build/client/_app/immutable/chunks/DnDesMxN.js +0 -1
  917. package/build/client/_app/immutable/chunks/DnDesMxN.js.br +0 -0
  918. package/build/client/_app/immutable/chunks/DnDesMxN.js.gz +0 -0
  919. package/build/client/_app/immutable/chunks/DnQR8b1d.js +0 -62
  920. package/build/client/_app/immutable/chunks/DnQR8b1d.js.br +0 -0
  921. package/build/client/_app/immutable/chunks/DnQR8b1d.js.gz +0 -0
  922. package/build/client/_app/immutable/chunks/DpSftVJo.js +0 -1
  923. package/build/client/_app/immutable/chunks/DpSftVJo.js.br +0 -0
  924. package/build/client/_app/immutable/chunks/DpSftVJo.js.gz +0 -0
  925. package/build/client/_app/immutable/chunks/DqZ9Wm2M.js +0 -1
  926. package/build/client/_app/immutable/chunks/DqZ9Wm2M.js.br +0 -0
  927. package/build/client/_app/immutable/chunks/DqZ9Wm2M.js.gz +0 -0
  928. package/build/client/_app/immutable/chunks/DybGBkO1.js +0 -5
  929. package/build/client/_app/immutable/chunks/DybGBkO1.js.br +0 -0
  930. package/build/client/_app/immutable/chunks/DybGBkO1.js.gz +0 -0
  931. package/build/client/_app/immutable/chunks/He17Vv5l.js +0 -1
  932. package/build/client/_app/immutable/chunks/He17Vv5l.js.br +0 -0
  933. package/build/client/_app/immutable/chunks/He17Vv5l.js.gz +0 -0
  934. package/build/client/_app/immutable/chunks/M3zsQDnS.js +0 -2
  935. package/build/client/_app/immutable/chunks/M3zsQDnS.js.br +0 -0
  936. package/build/client/_app/immutable/chunks/M3zsQDnS.js.gz +0 -0
  937. package/build/client/_app/immutable/chunks/QzT8bZ-S.js +0 -2
  938. package/build/client/_app/immutable/chunks/QzT8bZ-S.js.br +0 -0
  939. package/build/client/_app/immutable/chunks/QzT8bZ-S.js.gz +0 -0
  940. package/build/client/_app/immutable/chunks/TcIaLKEO.js +0 -1
  941. package/build/client/_app/immutable/chunks/TcIaLKEO.js.br +0 -0
  942. package/build/client/_app/immutable/chunks/TcIaLKEO.js.gz +0 -0
  943. package/build/client/_app/immutable/chunks/WKkbnawS.js +0 -1
  944. package/build/client/_app/immutable/chunks/WKkbnawS.js.br +0 -0
  945. package/build/client/_app/immutable/chunks/WKkbnawS.js.gz +0 -0
  946. package/build/client/_app/immutable/chunks/Y3i_x_Ja.js +0 -1
  947. package/build/client/_app/immutable/chunks/Y3i_x_Ja.js.br +0 -0
  948. package/build/client/_app/immutable/chunks/Y3i_x_Ja.js.gz +0 -0
  949. package/build/client/_app/immutable/chunks/Z8zDEyti.js +0 -1
  950. package/build/client/_app/immutable/chunks/Z8zDEyti.js.br +0 -0
  951. package/build/client/_app/immutable/chunks/Z8zDEyti.js.gz +0 -0
  952. package/build/client/_app/immutable/chunks/dKB0cWc2.js +0 -6
  953. package/build/client/_app/immutable/chunks/dKB0cWc2.js.br +0 -0
  954. package/build/client/_app/immutable/chunks/dKB0cWc2.js.gz +0 -0
  955. package/build/client/_app/immutable/chunks/dPAGVN7v.js +0 -6
  956. package/build/client/_app/immutable/chunks/dPAGVN7v.js.br +0 -0
  957. package/build/client/_app/immutable/chunks/dPAGVN7v.js.gz +0 -0
  958. package/build/client/_app/immutable/chunks/dxi_erj0.js +0 -3
  959. package/build/client/_app/immutable/chunks/dxi_erj0.js.br +0 -0
  960. package/build/client/_app/immutable/chunks/dxi_erj0.js.gz +0 -0
  961. package/build/client/_app/immutable/chunks/kE4zxzFD.js +0 -1
  962. package/build/client/_app/immutable/chunks/kE4zxzFD.js.br +0 -0
  963. package/build/client/_app/immutable/chunks/kE4zxzFD.js.gz +0 -0
  964. package/build/client/_app/immutable/chunks/kWmJZSyZ.js +0 -1
  965. package/build/client/_app/immutable/chunks/kWmJZSyZ.js.br +0 -0
  966. package/build/client/_app/immutable/chunks/kWmJZSyZ.js.gz +0 -0
  967. package/build/client/_app/immutable/chunks/ohZIF1HO.js +0 -5
  968. package/build/client/_app/immutable/chunks/ohZIF1HO.js.br +0 -0
  969. package/build/client/_app/immutable/chunks/ohZIF1HO.js.gz +0 -0
  970. package/build/client/_app/immutable/entry/app.BLMRuJuW.js +0 -2
  971. package/build/client/_app/immutable/entry/app.BLMRuJuW.js.br +0 -0
  972. package/build/client/_app/immutable/entry/app.BLMRuJuW.js.gz +0 -0
  973. package/build/client/_app/immutable/entry/start.C5t0JfpX.js +0 -1
  974. package/build/client/_app/immutable/entry/start.C5t0JfpX.js.br +0 -0
  975. package/build/client/_app/immutable/entry/start.C5t0JfpX.js.gz +0 -0
  976. package/build/client/_app/immutable/nodes/0.x0mKzYMw.js +0 -8
  977. package/build/client/_app/immutable/nodes/0.x0mKzYMw.js.br +0 -0
  978. package/build/client/_app/immutable/nodes/0.x0mKzYMw.js.gz +0 -0
  979. package/build/client/_app/immutable/nodes/1.DQwKSgDw.js +0 -1
  980. package/build/client/_app/immutable/nodes/1.DQwKSgDw.js.br +0 -0
  981. package/build/client/_app/immutable/nodes/1.DQwKSgDw.js.gz +0 -0
  982. package/build/client/_app/immutable/nodes/10.Bmz2aEu9.js +0 -3
  983. package/build/client/_app/immutable/nodes/10.Bmz2aEu9.js.br +0 -0
  984. package/build/client/_app/immutable/nodes/10.Bmz2aEu9.js.gz +0 -0
  985. package/build/client/_app/immutable/nodes/11.Dsw17idi.js +0 -1
  986. package/build/client/_app/immutable/nodes/11.Dsw17idi.js.br +0 -0
  987. package/build/client/_app/immutable/nodes/11.Dsw17idi.js.gz +0 -0
  988. package/build/client/_app/immutable/nodes/12.BCfbyZHF.js +0 -14
  989. package/build/client/_app/immutable/nodes/12.BCfbyZHF.js.br +0 -0
  990. package/build/client/_app/immutable/nodes/12.BCfbyZHF.js.gz +0 -0
  991. package/build/client/_app/immutable/nodes/13.BF70RcBN.js +0 -150
  992. package/build/client/_app/immutable/nodes/13.BF70RcBN.js.br +0 -0
  993. package/build/client/_app/immutable/nodes/13.BF70RcBN.js.gz +0 -0
  994. package/build/client/_app/immutable/nodes/14.DUa-e6bC.js +0 -4
  995. package/build/client/_app/immutable/nodes/14.DUa-e6bC.js.br +0 -0
  996. package/build/client/_app/immutable/nodes/14.DUa-e6bC.js.gz +0 -0
  997. package/build/client/_app/immutable/nodes/16.DV4CIsXI.js +0 -11
  998. package/build/client/_app/immutable/nodes/16.DV4CIsXI.js.br +0 -0
  999. package/build/client/_app/immutable/nodes/16.DV4CIsXI.js.gz +0 -0
  1000. package/build/client/_app/immutable/nodes/17.BFAervXe.js +0 -9
  1001. package/build/client/_app/immutable/nodes/17.BFAervXe.js.br +0 -0
  1002. package/build/client/_app/immutable/nodes/17.BFAervXe.js.gz +0 -0
  1003. package/build/client/_app/immutable/nodes/18.cqwxGV--.js +0 -2
  1004. package/build/client/_app/immutable/nodes/18.cqwxGV--.js.br +0 -0
  1005. package/build/client/_app/immutable/nodes/18.cqwxGV--.js.gz +0 -0
  1006. package/build/client/_app/immutable/nodes/19.W4wKGIwz.js +0 -3
  1007. package/build/client/_app/immutable/nodes/19.W4wKGIwz.js.br +0 -0
  1008. package/build/client/_app/immutable/nodes/19.W4wKGIwz.js.gz +0 -0
  1009. package/build/client/_app/immutable/nodes/2.DNWuY54S.js +0 -27
  1010. package/build/client/_app/immutable/nodes/2.DNWuY54S.js.br +0 -0
  1011. package/build/client/_app/immutable/nodes/2.DNWuY54S.js.gz +0 -0
  1012. package/build/client/_app/immutable/nodes/20.Bw-IUju8.js +0 -1
  1013. package/build/client/_app/immutable/nodes/20.Bw-IUju8.js.br +0 -0
  1014. package/build/client/_app/immutable/nodes/20.Bw-IUju8.js.gz +0 -0
  1015. package/build/client/_app/immutable/nodes/21.DNFvLLcD.js +0 -6
  1016. package/build/client/_app/immutable/nodes/21.DNFvLLcD.js.br +0 -0
  1017. package/build/client/_app/immutable/nodes/21.DNFvLLcD.js.gz +0 -0
  1018. package/build/client/_app/immutable/nodes/3.COF537Bh.js +0 -5
  1019. package/build/client/_app/immutable/nodes/3.COF537Bh.js.br +0 -0
  1020. package/build/client/_app/immutable/nodes/3.COF537Bh.js.gz +0 -0
  1021. package/build/client/_app/immutable/nodes/4.C69OFBsR.js +0 -1
  1022. package/build/client/_app/immutable/nodes/4.C69OFBsR.js.br +0 -0
  1023. package/build/client/_app/immutable/nodes/4.C69OFBsR.js.gz +0 -0
  1024. package/build/client/_app/immutable/nodes/5.BAZlH_fP.js +0 -2
  1025. package/build/client/_app/immutable/nodes/5.BAZlH_fP.js.br +0 -0
  1026. package/build/client/_app/immutable/nodes/5.BAZlH_fP.js.gz +0 -0
  1027. package/build/client/_app/immutable/nodes/6.BsosOtvd.js +0 -7
  1028. package/build/client/_app/immutable/nodes/6.BsosOtvd.js.br +0 -0
  1029. package/build/client/_app/immutable/nodes/6.BsosOtvd.js.gz +0 -0
  1030. package/build/client/_app/immutable/nodes/7.DnZ-8ovs.js +0 -5
  1031. package/build/client/_app/immutable/nodes/7.DnZ-8ovs.js.br +0 -0
  1032. package/build/client/_app/immutable/nodes/7.DnZ-8ovs.js.gz +0 -0
  1033. package/build/client/_app/immutable/nodes/9.BzSWG3R8.js +0 -1
  1034. package/build/client/_app/immutable/nodes/9.BzSWG3R8.js.br +0 -0
  1035. package/build/client/_app/immutable/nodes/9.BzSWG3R8.js.gz +0 -0
  1036. package/build/server/chunks/chunks/DecisionCard.js-DaA8DYYg.js +0 -586
  1037. package/build/server/chunks/chunks/DocSheet.js-COU85_s3.js +0 -50
  1038. package/build/server/chunks/chunks/EtaLine.js-CGeZKC7J.js +0 -98
  1039. package/build/server/chunks/chunks/EveryProjectSwitch.js-BRDpCeoH.js +0 -200
  1040. package/build/server/chunks/chunks/Icon.js-CHJ2UHjC.js +0 -129
  1041. package/build/server/chunks/chunks/InsightsNav.js-6PnqzaPk.js +0 -18
  1042. package/build/server/chunks/chunks/InstallPlugin.js-Cs1ZrPAp.js +0 -45
  1043. package/build/server/chunks/chunks/LinkedText.js-W4YG6iJR.js +0 -34
  1044. package/build/server/chunks/chunks/MateHealthPill.js-BNEGFwH8.js +0 -22
  1045. package/build/server/chunks/chunks/OpenDecision.js-CYba2eq3.js +0 -1614
  1046. package/build/server/chunks/chunks/ProjectBanner.js-DFoHRlbH.js +0 -111
  1047. package/build/server/chunks/chunks/ProjectStateMark.js-Dnky_g-x.js +0 -41
  1048. package/build/server/chunks/chunks/QuestionList.js-BXYtAgRG.js +0 -51
  1049. package/build/server/chunks/chunks/ResizableRail.js-C0NBHdjG.js +0 -50
  1050. package/build/server/chunks/chunks/SettingsNav.js-hmRmEglt.js +0 -22
  1051. package/build/server/chunks/chunks/SlotContent.js-DvHCWpDg.js +0 -738
  1052. package/build/server/chunks/chunks/TaskOverview.js-sfLDib9-.js +0 -568
  1053. package/build/server/chunks/chunks/TimeBar.js-D3XrZtTh.js +0 -32
  1054. package/build/server/chunks/chunks/TimeLegend.js-B5rkpGtG.js +0 -29
  1055. package/build/server/chunks/chunks/WhereBadge.js-CT4hViFh.js +0 -131
  1056. package/build/server/chunks/chunks/addresses.js-DMekVPad.js +0 -52
  1057. package/build/server/chunks/chunks/aliases.svelte.js-D80jyNJf.js +0 -138
  1058. package/build/server/chunks/chunks/arrow-down.js-DUgKe53e.js +0 -18
  1059. package/build/server/chunks/chunks/arrow-left.js-Cq9_JtOh.js +0 -18
  1060. package/build/server/chunks/chunks/arrow-right.js-AjYDyUqN.js +0 -18
  1061. package/build/server/chunks/chunks/arrow-up-right.js-BXDKmOw9.js +0 -18
  1062. package/build/server/chunks/chunks/arrow-up.js-Cd_TyexB.js +0 -18
  1063. package/build/server/chunks/chunks/berths.js-DAg2ReUw.js +0 -270
  1064. package/build/server/chunks/chunks/bridge.js-Cm-aK0Fl.js +0 -3757
  1065. package/build/server/chunks/chunks/brief.js-TS-K0lZ6.js +0 -54
  1066. package/build/server/chunks/chunks/buildlog.js-BGIHToGa.js +0 -55
  1067. package/build/server/chunks/chunks/button.js-Q4mS-EA8.js +0 -7311
  1068. package/build/server/chunks/chunks/changes.js-DLL6A8OG.js +0 -40
  1069. package/build/server/chunks/chunks/check.js-LVN_jfQU.js +0 -15
  1070. package/build/server/chunks/chunks/checks.js-CIo8HrSt.js +0 -221
  1071. package/build/server/chunks/chunks/chevron-left.js-DhF4v3Pt.js +0 -15
  1072. package/build/server/chunks/chunks/chevron-right.js-D4fnSNoh.js +0 -15
  1073. package/build/server/chunks/chunks/circle-alert.js-CTc53lLB.js +0 -23
  1074. package/build/server/chunks/chunks/circle-arrow-up.js-v-nE3jR0.js +0 -20
  1075. package/build/server/chunks/chunks/circle-dashed.js-QwLaO9U2.js +0 -24
  1076. package/build/server/chunks/chunks/circle-dot.js-DMNxPdVx.js +0 -18
  1077. package/build/server/chunks/chunks/client.js-BSbbAByJ.js +0 -24
  1078. package/build/server/chunks/chunks/clock.js-hPyOuzjG.js +0 -18
  1079. package/build/server/chunks/chunks/detail.js-B8abhi3a.js +0 -146
  1080. package/build/server/chunks/chunks/external-link.js-BuWBxV8H.js +0 -24
  1081. package/build/server/chunks/chunks/eye.js-BvS4v0oz.js +0 -23
  1082. package/build/server/chunks/chunks/feedback.js-Jpl8v6Mu.js +0 -67
  1083. package/build/server/chunks/chunks/format.js-DKnw8oWK.js +0 -70
  1084. package/build/server/chunks/chunks/git-pull-request.js-CXtks_Ym.js +0 -20
  1085. package/build/server/chunks/chunks/hand.js-CJ13vqPn.js +0 -25
  1086. package/build/server/chunks/chunks/index-server.js-BY3oucHa.js +0 -17
  1087. package/build/server/chunks/chunks/index-server2.js-DsObimPA.js +0 -9
  1088. package/build/server/chunks/chunks/index.js-C2v29IkD.js +0 -1524
  1089. package/build/server/chunks/chunks/index2.js-DDKi-jKB.js +0 -46
  1090. package/build/server/chunks/chunks/internal.js-bN02E8b0.js +0 -146
  1091. package/build/server/chunks/chunks/live.svelte.js-D1hNGw9_.js +0 -241
  1092. package/build/server/chunks/chunks/loader-circle.js-CNbdxSQ6.js +0 -16
  1093. package/build/server/chunks/chunks/markdown.js-0thJlxxD.js +0 -2656
  1094. package/build/server/chunks/chunks/message-square.js-Ct7UUpHZ.js +0 -22
  1095. package/build/server/chunks/chunks/messages-square.js-S0CnYLu0.js +0 -47
  1096. package/build/server/chunks/chunks/minus.js-B7GNC6Bd.js +0 -15
  1097. package/build/server/chunks/chunks/nav.js-DHSQIdRN.js +0 -29
  1098. package/build/server/chunks/chunks/plain.js-Dc97sYaJ.js +0 -101
  1099. package/build/server/chunks/chunks/plus.js-Dbawo5bL.js +0 -15
  1100. package/build/server/chunks/chunks/previewhelper2.js-Fr7JXr0X.js +0 -165
  1101. package/build/server/chunks/chunks/pullrequests.js-BobjerQv.js +0 -152
  1102. package/build/server/chunks/chunks/pullrequests2.js-CCzk2sqm.js +0 -12
  1103. package/build/server/chunks/chunks/repo.js-D4m77kW0.js +0 -33
  1104. package/build/server/chunks/chunks/review.js-DoWJxV0D.js +0 -141
  1105. package/build/server/chunks/chunks/root.js-iNMFn-Yg.js +0 -3105
  1106. package/build/server/chunks/chunks/rotate-cw.js-BPzrB4So.js +0 -21
  1107. package/build/server/chunks/chunks/runtime.js-BGOuM-Hy.js +0 -17683
  1108. package/build/server/chunks/chunks/scale.js-CkXtBARG.js +0 -21
  1109. package/build/server/chunks/chunks/scroll-lock.js-C4Fj1gEY.js +0 -2797
  1110. package/build/server/chunks/chunks/service.js-CzSbBjc3.js +0 -916
  1111. package/build/server/chunks/chunks/settings.js-BEOX97g7.js +0 -869
  1112. package/build/server/chunks/chunks/shield-check.js-MP-IWW55.js +0 -23
  1113. package/build/server/chunks/chunks/sparkles.js-Cr_IjWR_.js +0 -26
  1114. package/build/server/chunks/chunks/square-terminal.js-DLBEkPpa.js +0 -30
  1115. package/build/server/chunks/chunks/tone.js-oubilaK8.js +0 -59
  1116. package/build/server/chunks/chunks/triangle-alert.js-DGSV_5I9.js +0 -25
  1117. package/build/server/chunks/chunks/urls.js-BrlC6XZ8.js +0 -8
  1118. package/build/server/chunks/chunks/vault.js-CTaWe09z.js +0 -162
  1119. package/build/server/chunks/chunks/view.js-CeInAMHW.js +0 -76
  1120. package/build/server/chunks/chunks/words.js-eWWIwMKr.js +0 -52
  1121. package/build/server/chunks/chunks/x.js-Dhp-BHl8.js +0 -18
  1122. package/build/server/chunks/entries/endpoints/api/apps/_op_/_server.ts.js-smS4TCrQ.js +0 -94
  1123. package/build/server/chunks/entries/endpoints/api/events/_server.ts.js-Bqh9AFl3.js +0 -104
  1124. package/build/server/chunks/entries/endpoints/api/files/_server.ts.js-BM0ps5lk.js +0 -53
  1125. package/build/server/chunks/entries/endpoints/api/firstmate/chat/_server.ts.js-Cm2ckYW2.js +0 -87
  1126. package/build/server/chunks/entries/endpoints/api/firstmate/commands/_server.ts.js-DZCnbYId.js +0 -123
  1127. package/build/server/chunks/entries/endpoints/api/firstmate/dismiss/_server.ts.js-B5fpHEKR.js +0 -49
  1128. package/build/server/chunks/entries/endpoints/api/firstmate/input/_server.ts.js-eq3GdIy6.js +0 -55
  1129. package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/_server.ts.js-CvXW4Pgj.js +0 -48
  1130. package/build/server/chunks/entries/endpoints/api/firstmate/messages/_server.ts.js-Ck9lsiPW.js +0 -95
  1131. package/build/server/chunks/entries/endpoints/api/firstmate/pick/_server.ts.js-S2cNDAv_.js +0 -58
  1132. package/build/server/chunks/entries/endpoints/api/firstmate/reactions/_server.ts.js-Dp5sUKpf.js +0 -69
  1133. package/build/server/chunks/entries/endpoints/api/firstmate/start/_server.ts.js-BRyx-SLk.js +0 -48
  1134. package/build/server/chunks/entries/endpoints/api/fleet/_server.ts.js-DbOj2r3G.js +0 -40
  1135. package/build/server/chunks/entries/endpoints/api/gateway/_server.ts.js-CqNT7hdk.js +0 -104
  1136. package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-s9ct1YaL.js +0 -40
  1137. package/build/server/chunks/entries/endpoints/api/inbox/_server.ts.js-CCbenPIy.js +0 -64
  1138. package/build/server/chunks/entries/endpoints/api/inbox/report/_server.ts.js-YkdQuW03.js +0 -55
  1139. package/build/server/chunks/entries/endpoints/api/insights/_server.ts.js-jMIRKXVy.js +0 -40
  1140. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/config/_server.ts.js-CRz5ap0Z.js +0 -75
  1141. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/_server.ts.js-BUreXPtQ.js +0 -64
  1142. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/summary/_server.ts.js-aLsUJ-HL.js +0 -59
  1143. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/icon/_icon_/_server.ts.js-BQxGrtDq.js +0 -56
  1144. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/load/_server.ts.js-DVwdrfyP.js +0 -24
  1145. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/ui/_...path_/_server.ts.js-fWXa1T6O.js +0 -63
  1146. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/update/_server.ts.js-GzkA-eH4.js +0 -36
  1147. package/build/server/chunks/entries/endpoints/api/plugins/_server.ts.js-Du31g-KO.js +0 -40
  1148. package/build/server/chunks/entries/endpoints/api/plugins/inspect/_server.ts.js-CQYj1ZuS.js +0 -36
  1149. package/build/server/chunks/entries/endpoints/api/plugins/install/_server.ts.js-D6Nprf6i.js +0 -39
  1150. package/build/server/chunks/entries/endpoints/api/plugins/updates/_server.ts.js-DjQvcvOx.js +0 -24
  1151. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/_server.ts.js-DcwsTmlB.js +0 -45
  1152. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/_server.ts.js-CGPbXNqf.js +0 -54
  1153. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/_server.ts.js-CawLRyKI.js +0 -66
  1154. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/_server.ts.js-Cl8Xr77g.js +0 -53
  1155. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/file/_server.ts.js-B3vEVTxZ.js +0 -76
  1156. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/_server.ts.js-iToq6YEa.js +0 -59
  1157. package/build/server/chunks/entries/endpoints/api/second-mates/_id_/peek/_server.ts.js-CwWCiOV_.js +0 -49
  1158. package/build/server/chunks/entries/endpoints/api/services/_server.ts.js-DW8K_vnR.js +0 -59
  1159. package/build/server/chunks/entries/endpoints/api/slots/_server.ts.js-jQeee3c3.js +0 -48
  1160. package/build/server/chunks/entries/endpoints/api/tasks/_id_/_server.ts.js-DjmH3APN.js +0 -45
  1161. package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/_server.ts.js-BKBTwHdx.js +0 -64
  1162. package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/_server.ts.js-Dps2HZrT.js +0 -57
  1163. package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/_server.ts.js-CLrEK2JB.js +0 -105
  1164. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/_server.ts.js-Dajmg1QT.js +0 -59
  1165. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/helper/_server.ts.js-DzbKvWf4.js +0 -62
  1166. package/build/server/chunks/entries/endpoints/api/vault/_server.ts.js-lrCSZ8vJ.js +0 -66
  1167. package/build/server/chunks/entries/endpoints/api/wheelhouse/update/_server.ts.js--J2luqpT.js +0 -24
  1168. package/build/server/chunks/entries/endpoints/api/wheelhouse/upgrade/_server.ts.js-D6jJ1Rr_.js +0 -24
  1169. package/build/server/chunks/entries/endpoints/tasks/_id_/review/_server.ts.js-DFiNNdmX.js +0 -44
  1170. package/build/server/chunks/entries/fallbacks/error.svelte.js-CB4I_wOd.js +0 -15
  1171. package/build/server/chunks/entries/hooks.server.js-BbTmH2JU.js +0 -58
  1172. package/build/server/chunks/entries/pages/_layout.server.ts.js-DTaBhixQ.js +0 -24
  1173. package/build/server/chunks/entries/pages/_layout.svelte.js-BNA76gGJ.js +0 -5551
  1174. package/build/server/chunks/entries/pages/_page.server.ts.js-BjKksIBz.js +0 -16
  1175. package/build/server/chunks/entries/pages/_page.svelte.js-Bgw0FiJG.js +0 -3847
  1176. package/build/server/chunks/entries/pages/decisions/_page.server.ts.js-Cr6eZ4p-.js +0 -11
  1177. package/build/server/chunks/entries/pages/decisions/_page.svelte.js-DcczyFUP.js +0 -201
  1178. package/build/server/chunks/entries/pages/files/_page.server.ts.js-CA3bfaLe.js +0 -17
  1179. package/build/server/chunks/entries/pages/files/_page.svelte.js-BIMqSkgM.js +0 -60
  1180. package/build/server/chunks/entries/pages/harbour/_page.server.ts.js-CGhoI6xu.js +0 -46
  1181. package/build/server/chunks/entries/pages/harbour/_page.svelte.js-BHMB8PKC.js +0 -749
  1182. package/build/server/chunks/entries/pages/headroom/_page.server.ts.js-BRadjeWP.js +0 -11
  1183. package/build/server/chunks/entries/pages/headroom/_page.svelte.js-Yw5NZV8k.js +0 -183
  1184. package/build/server/chunks/entries/pages/inbox/_page.server.ts.js-CB7PXBV1.js +0 -11
  1185. package/build/server/chunks/entries/pages/inbox/_page.svelte.js-BLRcCY5u.js +0 -175
  1186. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.server.ts.js-C9J9SfdQ.js +0 -16
  1187. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.svelte.js-DLxqhull.js +0 -53
  1188. package/build/server/chunks/entries/pages/projects/_id_/_page.server.ts.js-nOOV1sAH.js +0 -23
  1189. package/build/server/chunks/entries/pages/projects/_id_/_page.svelte.js-Doi5pyAo.js +0 -980
  1190. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.server.ts.js-BpSFvmgx.js +0 -21
  1191. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.svelte.js-Cr__zX_O.js +0 -76
  1192. package/build/server/chunks/entries/pages/projects/_id_/passage/_page.server.ts.js-08qgrWt_.js +0 -27
  1193. package/build/server/chunks/entries/pages/projects/_id_/passage/_page.svelte.js-CkM6pjKK.js +0 -418
  1194. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.server.ts.js-Waknjiof.js +0 -15
  1195. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.svelte.js-CN-WwfgH.js +0 -1880
  1196. package/build/server/chunks/entries/pages/second-mates/_page.svelte.js-CO4DG7gS.js +0 -221
  1197. package/build/server/chunks/entries/pages/settings/gateway/_page.server.ts.js-D_-2Bk-X.js +0 -11
  1198. package/build/server/chunks/entries/pages/settings/gateway/_page.svelte.js-DuleT8BP.js +0 -208
  1199. package/build/server/chunks/entries/pages/settings/plugins/_page.server.ts.js-Hls8GEh4.js +0 -19
  1200. package/build/server/chunks/entries/pages/settings/plugins/_page.svelte.js-BUmIRIz2.js +0 -1854
  1201. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/_page.server.ts.js-jKmK8VbO.js +0 -17
  1202. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/_page.svelte.js-B5PSrA4H.js +0 -227
  1203. package/build/server/chunks/entries/pages/tasks/_id_/_page.server.ts.js-BZMRfS-l.js +0 -25
  1204. package/build/server/chunks/entries/pages/tasks/_id_/_page.svelte.js-BYcqWFD7.js +0 -2194
  1205. package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.server.ts.js-CGiroJqZ.js +0 -24
  1206. package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.svelte.js-QzwiMik4.js +0 -79
  1207. package/build/server/chunks/entries/pages/time/_page.server.ts.js-exp39MHH.js +0 -11
  1208. package/build/server/chunks/entries/pages/time/_page.svelte.js-D0Z16ExE.js +0 -108
  1209. package/build/server/chunks/handler-CwbFN6sE.js +0 -1474
  1210. package/build/server/chunks/index.js-CqvbtJcl.js +0 -4296
  1211. package/build/server/chunks/manifest.js-DBKpxwtf.js +0 -551
  1212. package/build/server/chunks/nodes/0.js-CzHBL2FE.js +0 -45
  1213. package/build/server/chunks/nodes/1.js-DttsMtH5.js +0 -9
  1214. package/build/server/chunks/nodes/10.js-DS6-8M5v.js +0 -47
  1215. package/build/server/chunks/nodes/11.js-UkJPwg90.js +0 -46
  1216. package/build/server/chunks/nodes/12.js-Bttwc2Gj.js +0 -47
  1217. package/build/server/chunks/nodes/13.js-DN0IvWCs.js +0 -46
  1218. package/build/server/chunks/nodes/14.js-BPrf4PxP.js +0 -9
  1219. package/build/server/chunks/nodes/15.js-B9n86nFk.js +0 -12
  1220. package/build/server/chunks/nodes/16.js-MQWaFHIA.js +0 -45
  1221. package/build/server/chunks/nodes/17.js-BqQwHV4F.js +0 -45
  1222. package/build/server/chunks/nodes/18.js-CpKFgiup.js +0 -48
  1223. package/build/server/chunks/nodes/19.js-CCrOg127.js +0 -46
  1224. package/build/server/chunks/nodes/2.js-FPoIQ4QE.js +0 -45
  1225. package/build/server/chunks/nodes/20.js-B5Fv-_hl.js +0 -46
  1226. package/build/server/chunks/nodes/21.js-DIqkKAtP.js +0 -45
  1227. package/build/server/chunks/nodes/3.js-BBLaot9F.js +0 -45
  1228. package/build/server/chunks/nodes/4.js-cmSXc6Wt.js +0 -45
  1229. package/build/server/chunks/nodes/5.js-CxQRjV9G.js +0 -49
  1230. package/build/server/chunks/nodes/6.js-4fNyzqc9.js +0 -45
  1231. package/build/server/chunks/nodes/7.js-D_kCF7ql.js +0 -45
  1232. package/build/server/chunks/nodes/8.js-D32pPbKa.js +0 -12
  1233. package/build/server/chunks/nodes/9.js-Dl3MVT1-.js +0 -45
  1234. /package/build/client/_app/immutable/assets/{5.5dJKCkOT.css → 6.5dJKCkOT.css} +0 -0
  1235. /package/build/client/_app/immutable/assets/{5.5dJKCkOT.css.br → 6.5dJKCkOT.css.br} +0 -0
  1236. /package/build/client/_app/immutable/assets/{5.5dJKCkOT.css.gz → 6.5dJKCkOT.css.gz} +0 -0
  1237. /package/build/client/_app/immutable/assets/{pullrequests.Dga9zAug.css → PreviewStudio.Dga9zAug.css} +0 -0
  1238. /package/build/client/_app/immutable/assets/{pullrequests.Dga9zAug.css.br → PreviewStudio.Dga9zAug.css.br} +0 -0
  1239. /package/build/client/_app/immutable/assets/{pullrequests.Dga9zAug.css.gz → PreviewStudio.Dga9zAug.css.gz} +0 -0
package/dist/cli.js CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  // cli/index.ts
4
4
  import { fork, spawn as spawn4 } from "node:child_process";
5
- import { existsSync as existsSync2 } from "node:fs";
5
+ import { existsSync as existsSync3 } from "node:fs";
6
6
  import { createServer } from "node:http";
7
- import path13 from "node:path";
7
+ import path18 from "node:path";
8
8
  import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
9
- import { Command as Command4, InvalidArgumentError as InvalidArgumentError2 } from "commander";
9
+ import { Command as Command5, InvalidArgumentError as InvalidArgumentError3 } from "commander";
10
10
 
11
11
  // package.json
12
- var version = "0.4.0";
12
+ var version = "0.6.0";
13
13
 
14
14
  // src/lib/chat/attachments.ts
15
15
  var UPLOAD_MAX_BYTES = 25 * 1024 * 1024;
@@ -225,30 +225,47 @@ function findFirstmateDir(start) {
225
225
  }
226
226
  }
227
227
  var expandHome = (p, env) => p === "~" || p.startsWith("~/") ? path.join(env.HOME ?? "", p.slice(1)) : p;
228
+ function notFirstmate(dir) {
229
+ if (!isDir(dir)) return `Firstmate directory not found: ${dir}`;
230
+ if (!looksLikeFirstmate(dir)) {
231
+ return `${dir} is not a Firstmate checkout (bin/fm-fleet-snapshot.sh is missing).`;
232
+ }
233
+ return null;
234
+ }
228
235
  function resolveInstall(input) {
229
236
  const notes = [];
230
237
  let firstmateDir;
238
+ let source;
231
239
  if (input.firstmate) {
232
240
  firstmateDir = path.resolve(input.cwd, expandHome(input.firstmate, input.env));
233
- if (!isDir(firstmateDir)) {
234
- return { ok: false, error: `Firstmate directory not found: ${firstmateDir}` };
235
- }
236
- if (!looksLikeFirstmate(firstmateDir)) {
237
- return {
238
- ok: false,
239
- error: `${firstmateDir} is not a Firstmate checkout (bin/fm-fleet-snapshot.sh is missing).`
240
- };
241
- }
241
+ const wrong = notFirstmate(firstmateDir);
242
+ if (wrong) return { ok: false, error: wrong, missing: false };
243
+ source = "flag";
242
244
  } else {
243
245
  const found = findFirstmateDir(input.cwd);
244
- if (!found) {
246
+ if (found) {
247
+ firstmateDir = found;
248
+ source = "cwd";
249
+ notes.push(`Found Firstmate at ${firstmateDir}`);
250
+ } else if (input.remembered) {
251
+ firstmateDir = path.resolve(input.remembered.firstmate);
252
+ const wrong = notFirstmate(firstmateDir);
253
+ if (wrong) {
254
+ return {
255
+ ok: false,
256
+ error: `The Firstmate that setup remembered is gone. ${wrong}`,
257
+ missing: true
258
+ };
259
+ }
260
+ source = "remembered";
261
+ notes.push(`Using the Firstmate setup remembered: ${firstmateDir}`);
262
+ } else {
245
263
  return {
246
264
  ok: false,
247
- error: "Could not find a Firstmate checkout. Run wheelhouse inside one, or pass --firstmate <dir>."
265
+ error: "Could not find a Firstmate checkout. Run wheelhouse inside one, pass --firstmate <dir>, or set one up from the page.",
266
+ missing: true
248
267
  };
249
268
  }
250
- firstmateDir = found;
251
- notes.push(`Found Firstmate at ${firstmateDir}`);
252
269
  }
253
270
  let homeDir;
254
271
  if (input.home) {
@@ -256,19 +273,23 @@ function resolveInstall(input) {
256
273
  } else if (input.env.FM_HOME) {
257
274
  homeDir = path.resolve(input.cwd, expandHome(input.env.FM_HOME, input.env));
258
275
  notes.push(`Using the operational home from FM_HOME: ${homeDir}`);
276
+ } else if (source === "remembered" && input.remembered?.home) {
277
+ homeDir = path.resolve(input.remembered.home);
259
278
  } else {
260
279
  homeDir = firstmateDir;
261
280
  }
281
+ const flagged = Boolean(input.home || input.env.FM_HOME);
262
282
  if (!isDir(homeDir)) {
263
- return { ok: false, error: `Firstmate home not found: ${homeDir}` };
283
+ return { ok: false, error: `Firstmate home not found: ${homeDir}`, missing: !flagged };
264
284
  }
265
285
  if (!isDir(path.join(homeDir, "state"))) {
266
286
  return {
267
287
  ok: false,
268
- error: `${homeDir} is not a Firstmate operational home (it has no state/ directory). Pass --home <dir>.`
288
+ error: `${homeDir} is not a Firstmate operational home (it has no state/ directory). Pass --home <dir>.`,
289
+ missing: !flagged && source !== "flag"
269
290
  };
270
291
  }
271
- return { ok: true, install: { firstmateDir, homeDir }, notes };
292
+ return { ok: true, install: { firstmateDir, homeDir }, notes, source };
272
293
  }
273
294
  var HEADER_BYTES = 256 * 1024;
274
295
  async function readHead(file) {
@@ -334,6 +355,55 @@ async function checkCompatibility(install2) {
334
355
  };
335
356
  }
336
357
 
358
+ // src/lib/server/gateway/keychain.ts
359
+ import { spawn as spawn2 } from "node:child_process";
360
+ var KEYCHAIN_SERVICE = "wheelhouse-gateway";
361
+ var SECURITY = "/usr/bin/security";
362
+ var NOT_FOUND = 44;
363
+ function security(args, input = "") {
364
+ return new Promise((resolve, reject) => {
365
+ const child = spawn2(SECURITY, args, { stdio: ["pipe", "pipe", "ignore"] });
366
+ let stdout = "";
367
+ child.stdout.setEncoding("utf8").on("data", (d) => stdout += d);
368
+ child.on("error", reject);
369
+ child.on("close", (code) => resolve({ code: code ?? -1, stdout }));
370
+ child.stdin.on("error", () => {
371
+ });
372
+ child.stdin.end(input);
373
+ });
374
+ }
375
+ function macKeychain(service = KEYCHAIN_SERVICE) {
376
+ const failed = (what, code) => new Error(`the macOS Keychain could not ${what} (security exited ${code})`);
377
+ return {
378
+ where: `the macOS Keychain (${service})`,
379
+ async get(account) {
380
+ const r = await security(["find-generic-password", "-s", service, "-a", account, "-w"]);
381
+ if (r.code === NOT_FOUND) return null;
382
+ if (r.code !== 0) throw failed("read it", r.code);
383
+ return r.stdout.trim() || null;
384
+ },
385
+ async set(account, secret) {
386
+ if (!/^[A-Za-z0-9._-]+$/.test(secret))
387
+ throw new Error("not a secret the Keychain line can hold");
388
+ const r = await security(
389
+ ["-i"],
390
+ `add-generic-password -U -s ${service} -a ${account} -w ${secret}
391
+ `
392
+ );
393
+ if (r.code !== 0) throw failed("keep it", r.code);
394
+ },
395
+ async remove(account) {
396
+ const r = await security(["delete-generic-password", "-s", service, "-a", account]);
397
+ if (r.code === NOT_FOUND) return false;
398
+ if (r.code !== 0) throw failed("remove it", r.code);
399
+ return true;
400
+ }
401
+ };
402
+ }
403
+ function defaultKeychain() {
404
+ return process.platform === "darwin" ? macKeychain() : null;
405
+ }
406
+
337
407
  // src/lib/server/plugins/config.ts
338
408
  import { mkdir, readFile, rename, stat as stat2, writeFile } from "node:fs/promises";
339
409
  import { homedir } from "node:os";
@@ -440,168 +510,1659 @@ function writePluginSettings(dir, id, settings2) {
440
510
  });
441
511
  }
442
512
 
443
- // src/lib/server/plugins/installed.ts
444
- import { mkdir as mkdir2, readFile as readFile2, rename as rename2, writeFile as writeFile2 } from "node:fs/promises";
445
- import { homedir as homedir2 } from "node:os";
513
+ // src/lib/server/cloud/settings.ts
514
+ import { createHash as createHash2, randomBytes } from "node:crypto";
515
+ import {
516
+ chmod,
517
+ lstat,
518
+ mkdir as mkdir2,
519
+ readFile as readFile2,
520
+ realpath,
521
+ rename as rename2,
522
+ rm,
523
+ stat as stat3,
524
+ writeFile as writeFile2
525
+ } from "node:fs/promises";
446
526
  import path3 from "node:path";
447
- var INSTALLED_FILE = "installed.json";
448
- var SCHEMA = "wheelhouse-installed-plugins.v1";
449
- var EMPTY_INSTALLED = () => ({ schema: SCHEMA, plugins: {} });
450
- function defaultPluginsDir(env) {
451
- if (env.WHEELHOUSE_PLUGINS_DIR) return path3.resolve(env.WHEELHOUSE_PLUGINS_DIR);
452
- return path3.join(homedir2(), ".wheelhouse", "plugins");
527
+
528
+ // src/lib/cloud.ts
529
+ var DEFAULT_GATEWAY = "https://cloud.chrisjowen.net";
530
+
531
+ // src/lib/server/cloud/protocol.ts
532
+ import {
533
+ createHash,
534
+ createPrivateKey,
535
+ createPublicKey,
536
+ generateKeyPairSync,
537
+ sign
538
+ } from "node:crypto";
539
+ var PROTOCOL = 1;
540
+ var FRAME_HTTP = 1;
541
+ var FRAME_WS_TEXT = 2;
542
+ var FRAME_WS_BINARY = 3;
543
+ var DEFAULT_LIMITS = {
544
+ maxStreams: 256,
545
+ window: 256 * 1024,
546
+ maxFrame: 64 * 1024,
547
+ maxBody: 32 * 1024 * 1024,
548
+ maxWsMessage: 4 * 1024 * 1024
549
+ };
550
+ var MAX_CONTROL_BYTES = 256 * 1024;
551
+ var MAX_HEADER_BYTES = 64 * 1024;
552
+ var MAX_HEADER_ENTRIES = 200;
553
+ var b64u = (b) => Buffer.from(b).toString("base64url");
554
+ var SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
555
+ function newDeviceKey() {
556
+ const { privateKey } = generateKeyPairSync("ed25519");
557
+ return deviceKey(privateKey);
453
558
  }
454
- var isRecord2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
455
- function record(v) {
456
- if (!isRecord2(v)) return null;
457
- const { repository, ref, commit, version: version2, installedAt, enabled } = v;
458
- if (typeof repository !== "string" || ref !== null && typeof ref !== "string" || typeof commit !== "string" || typeof version2 !== "string" || typeof installedAt !== "string" || typeof enabled !== "boolean") {
459
- return null;
460
- }
461
- return { repository, ref, commit, version: version2, installedAt, enabled };
559
+ function deviceKey(privateKey) {
560
+ const der = createPublicKey(privateKey).export({ format: "der", type: "spki" });
561
+ return { privateKey, publicKey: b64u(der.subarray(SPKI_PREFIX.length)) };
462
562
  }
463
- async function readInstalled(dir) {
464
- const file = path3.join(dir, INSTALLED_FILE);
465
- let text2;
466
- try {
467
- text2 = await readFile2(file, "utf8");
468
- } catch (e) {
469
- if (e.code === "ENOENT")
470
- return { ok: true, installed: EMPTY_INSTALLED() };
471
- return { ok: false, error: `could not read ${file}: ${e.message}` };
472
- }
473
- let raw;
563
+ var exportKey = (k) => b64u(k.privateKey.export({ format: "der", type: "pkcs8" }));
564
+ function importKey(stored) {
565
+ const text2 = stored.trim();
566
+ if (!/^[A-Za-z0-9_-]{40,200}$/.test(text2)) return null;
474
567
  try {
475
- raw = JSON.parse(text2);
476
- } catch (e) {
477
- return { ok: false, error: `${file} is not valid JSON: ${e.message}` };
478
- }
479
- if (!isRecord2(raw) || raw.schema !== SCHEMA || !isRecord2(raw.plugins)) {
480
- return { ok: false, error: `${file} is not a ${SCHEMA} record` };
568
+ const k = createPrivateKey({
569
+ key: Buffer.from(text2, "base64url"),
570
+ format: "der",
571
+ type: "pkcs8"
572
+ });
573
+ return k.asymmetricKeyType === "ed25519" ? deviceKey(k) : null;
574
+ } catch {
575
+ return null;
481
576
  }
482
- const installed = EMPTY_INSTALLED();
483
- for (const [id, v] of Object.entries(raw.plugins)) {
484
- const r = record(v);
485
- if (!r) return { ok: false, error: `${file}: the entry for "${id}" is not a valid record` };
486
- installed.plugins[id] = r;
577
+ }
578
+ var BASE32 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
579
+ function base32(bytes) {
580
+ let bits = 0;
581
+ let value = 0;
582
+ let out = "";
583
+ for (const b of bytes) {
584
+ value = value << 8 | b;
585
+ bits += 8;
586
+ while (bits >= 5) {
587
+ out += BASE32[value >>> bits - 5 & 31];
588
+ bits -= 5;
589
+ }
487
590
  }
488
- return { ok: true, installed };
591
+ if (bits > 0) out += BASE32[value << 5 - bits & 31];
592
+ return out;
489
593
  }
490
- async function writeInstalled(dir, installed) {
491
- await mkdir2(dir, { recursive: true });
492
- const file = path3.join(dir, INSTALLED_FILE);
493
- const tmp = `${file}.${process.pid}.tmp`;
494
- await writeFile2(tmp, `${JSON.stringify(installed, null, " ")}
495
- `);
496
- await rename2(tmp, file);
594
+ function fingerprint(publicKey) {
595
+ const digest = createHash("sha256").update(Buffer.from(publicKey, "base64url")).digest();
596
+ return base32(digest.subarray(0, 10)).match(/.{4}/g).join("-");
497
597
  }
498
-
499
- // src/lib/server/store/store.ts
500
- import { realpathSync } from "node:fs";
501
- import path4 from "node:path";
502
-
503
- // src/lib/inbox.ts
504
- var SNOOZE_MS = 4 * 3600 * 1e3;
505
-
506
- // src/lib/previewhelper.ts
507
- var HELPER_SYSTEM = [
508
- "You are the preview helper in Wheelhouse. The captain is reviewing the live preview of one task a coding worker built, and is talking it through with you before any feedback goes to Firstmate, who runs the crew.",
509
- "You see only this task: its page, the part the captain points at, its screenshots (read them with the Read tool when they help), its instructions and its history. You know nothing else and cannot change anything.",
510
- "Answer what the captain asks about the page or the work, plainly and briefly. When what the captain wants is unclear, ask one short question back. When the instructions or history settle a question, say so and quote them.",
511
- "Whenever the captain wants something changed, put it in `suggest` as one feedback line for the worker: one change per line, in plain words, saying where on the page it is. Do not suggest a line already on the list. When the captain only asks a question, `suggest` is empty.",
512
- "Never say you will change, send or fix anything: the captain edits the list and sends it to Firstmate when ready.",
513
- "Write for someone who is not a programmer: no code, file names or jargon. Keep `reply` to a few sentences."
514
- ].join("\n\n");
515
- var SUMMARY_SYSTEM = [
516
- "You are the preview helper in Wheelhouse. The captain is about to send Firstmate, who runs the crew, a list of feedback several people left about one task a coding worker built. Before it goes, you tidy the list into clear points for the worker.",
517
- "Each item is one person\u2019s comment, with any replies folded in, and where on the page it points. Turn the list into points: one change per point, in plain words, saying where on the page it is. Merge items that ask for the same change, and keep who asked when it matters. Leave out chat that asks for nothing (thanks, agreement with no new ask), unless it settles a question in another item. Keep every distinct ask: do not drop, soften or invent one.",
518
- "For each point, give `from`: the numbers of the items it came from, and `points`: where on the page it is, briefly (or an empty string when it is about nothing in particular).",
519
- "Never say you will change, send or fix anything: the captain edits and picks the points and sends them.",
520
- "Write for someone who is not a programmer: no code, file names or jargon."
521
- ].join("\n\n");
522
-
523
- // src/lib/server/store/store.ts
524
- function defaultStateDir(env) {
525
- if (env.WHEELHOUSE_STATE_DIR) return path4.resolve(env.WHEELHOUSE_STATE_DIR);
526
- if (env.XDG_STATE_HOME) return path4.join(path4.resolve(env.XDG_STATE_HOME), "wheelhouse");
527
- return path4.join(env.HOME ?? "", ".local", "state", "wheelhouse");
598
+ function signed(key, context, ...fields) {
599
+ const message = [context, ...fields.map(String)].join("\n");
600
+ return b64u(sign(null, Buffer.from(message, "utf8"), key.privateKey));
528
601
  }
529
- function real(p) {
530
- const abs = path4.resolve(p);
531
- try {
532
- return realpathSync(abs);
533
- } catch {
534
- const parent = path4.dirname(abs);
535
- return parent === abs ? abs : path4.join(real(parent), path4.basename(abs));
536
- }
602
+ var pollSig = (key, pairingId) => signed(key, "whc-pair-poll-v1", pairingId);
603
+ var unpairSig = (key, deviceId, ts) => signed(key, "whc-unpair-v1", deviceId, ts);
604
+ var connectSig = (key, nonce, deviceId) => signed(key, "whc-connect-v1", nonce, deviceId);
605
+ function encodeFrame(kind, id, payload) {
606
+ const head = Buffer.allocUnsafe(5);
607
+ head[0] = kind;
608
+ head.writeUInt32BE(id, 1);
609
+ return Buffer.concat([head, payload]);
537
610
  }
538
- function isInside(p, dir) {
539
- const rel = path4.relative(real(dir), real(p));
540
- return rel === "" || !rel.startsWith("..") && !path4.isAbsolute(rel);
611
+ function decodeFrame(data) {
612
+ if (data.length < 5) return null;
613
+ return { kind: data[0], id: data.readUInt32BE(1), payload: data.subarray(5) };
541
614
  }
542
-
543
- // src/lib/server/restart.ts
544
- var KEY = /* @__PURE__ */ Symbol.for("wheelhouse.restart");
545
- var g = globalThis;
546
- function setRestart(fn) {
547
- g[KEY] = fn ?? void 0;
615
+ function closeAction(code) {
616
+ switch (code) {
617
+ case 4400:
618
+ return { kind: "reconnect", note: "the gateway reported a protocol error" };
619
+ case 4401:
620
+ return {
621
+ kind: "stop",
622
+ reason: "The gateway does not know this machine (4401). Pair it again: wheelhouse remote connect."
623
+ };
624
+ case 4403:
625
+ return {
626
+ kind: "stop",
627
+ forget: true,
628
+ reason: "This machine was removed from Wheelhouse Cloud (4403), so its key was deleted. Pair it again: wheelhouse remote connect."
629
+ };
630
+ case 4409:
631
+ return {
632
+ kind: "stop",
633
+ reason: "Another connection with this machine\u2019s key replaced this one (4409). Make sure only one Wheelhouse connects, then restart it."
634
+ };
635
+ case 4426:
636
+ return {
637
+ kind: "stop",
638
+ reason: "The gateway no longer speaks this Wheelhouse\u2019s protocol (4426). Update Wheelhouse: wheelhouse upgrade."
639
+ };
640
+ case 4429:
641
+ return { kind: "reconnect", minDelayMs: 6e4, note: "too many connects" };
642
+ default:
643
+ return { kind: "reconnect" };
644
+ }
645
+ }
646
+ var backoffMs = (attempt, random = Math.random) => Math.floor(random() * Math.min(6e4, 1e3 * 2 ** attempt));
647
+ var HOP_BY_HOP = /* @__PURE__ */ new Set([
648
+ "connection",
649
+ "keep-alive",
650
+ "proxy-authenticate",
651
+ "proxy-authorization",
652
+ "proxy-connection",
653
+ "te",
654
+ "trailer",
655
+ "transfer-encoding",
656
+ "upgrade"
657
+ ]);
658
+ function isRestartPath(path19) {
659
+ let p = path19.split(/[?#]/, 1)[0];
660
+ for (let i = 0; i < 3; i++) {
661
+ try {
662
+ const d = decodeURIComponent(p);
663
+ if (d === p) break;
664
+ p = d;
665
+ } catch {
666
+ break;
667
+ }
668
+ }
669
+ const flat = p.replace(/\\/g, "/").replace(/\/{2,}/g, "/");
670
+ const normal = URL.parse(flat, "http://x")?.pathname ?? flat;
671
+ return [flat, normal].some((s) => s.toLowerCase().startsWith("/api/wheelhouse/restart"));
548
672
  }
549
673
 
550
- // cli/gateway.ts
551
- import path6 from "node:path";
552
- import { Argument, Command, InvalidArgumentError } from "commander";
553
-
554
- // src/lib/gateway.ts
555
- var GATEWAY_CHANNELS = [
556
- { channel: "discord", label: "Discord" }
557
- ];
558
- var DEFAULT_GATEWAY_ALERTS = ["question", "pr-green", "stuck"];
559
- var PAIRING_MS = 10 * 6e4;
560
-
561
- // src/lib/server/gateway/channels/discord.ts
562
- import WebSocket from "ws";
563
- var DISCORD_API = "https://discord.com/api/v10";
564
- var DISCORD_INTENTS = 1 << 12;
565
- var REQUEST_TIMEOUT_MS = 15e3;
566
- var wsTransport = {
567
- fetch: (url, init) => fetch(url, init),
568
- connect(url, on) {
569
- const ws = new WebSocket(url);
570
- ws.on("message", (data) => on.message(data.toString()));
571
- ws.on("close", (code) => on.close(code));
572
- ws.on("error", (e) => on.error(e));
674
+ // src/lib/server/cloud/settings.ts
675
+ var CLOUD_SETTINGS_SCHEMA = "wheelhouse-cloud-settings.v1";
676
+ var CLOUD_STATUS_SCHEMA = "wheelhouse-cloud-status.v1";
677
+ var CLOUD_KEYCHAIN_SERVICE = "wheelhouse-cloud";
678
+ var cloudDir = (configDir) => path3.join(configDir, "cloud");
679
+ var LOOPBACK = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]"]);
680
+ function gatewayOrigin(raw) {
681
+ const u = URL.parse(raw.trim());
682
+ if (!u) return { ok: false, error: `${raw.trim() || "That"} is not a URL.` };
683
+ if (u.username || u.password)
684
+ return { ok: false, error: "The gateway URL may not carry credentials." };
685
+ const loopback = LOOPBACK.has(u.hostname.toLowerCase());
686
+ if (u.protocol !== "https:" && !(u.protocol === "http:" && loopback)) {
687
+ return { ok: false, error: "The gateway must be an https:// URL." };
688
+ }
689
+ if (u.pathname !== "/" && u.pathname !== "" || u.search || u.hash) {
573
690
  return {
574
- send: (data) => {
575
- if (ws.readyState === WebSocket.OPEN) ws.send(data);
576
- },
577
- close: (code) => ws.close(code)
691
+ ok: false,
692
+ error: "Give the gateway as its address only, such as https://cloud.example.com."
578
693
  };
579
694
  }
580
- };
581
- var DiscordError = class extends Error {
582
- constructor(status, message) {
583
- super(message);
584
- this.status = status;
585
- this.name = "DiscordError";
586
- }
587
- status;
588
- };
695
+ return { ok: true, origin: u.origin };
696
+ }
697
+ var isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
589
698
  var str = (v) => typeof v === "string" && v ? v : null;
590
- function sleep(ms, signal) {
591
- return new Promise((resolve) => {
592
- const t = setTimeout(done, ms);
593
- function done() {
594
- clearTimeout(t);
595
- signal?.removeEventListener("abort", done);
596
- resolve();
597
- }
598
- signal?.addEventListener("abort", done, { once: true });
699
+ function parseDevice(v) {
700
+ if (!isObj(v)) return null;
701
+ const id = str(v.id);
702
+ const gateway = str(v.gateway);
703
+ const publicKey = str(v.publicKey);
704
+ if (!id || !gateway || !publicKey || !gatewayOrigin(gateway).ok) return null;
705
+ return {
706
+ id,
707
+ name: str(v.name) ?? id,
708
+ gateway,
709
+ publicKey,
710
+ user: str(v.user),
711
+ pairedAt: str(v.pairedAt) ?? (/* @__PURE__ */ new Date(0)).toISOString()
712
+ };
713
+ }
714
+ function parseSessions(v) {
715
+ if (!Array.isArray(v)) return [];
716
+ return v.filter(isObj).flatMap((s) => {
717
+ const id = str(s.id);
718
+ if (!id) return [];
719
+ return [
720
+ {
721
+ id,
722
+ user: str(s.user) ?? "",
723
+ firstAt: str(s.firstAt) ?? "",
724
+ lastAt: str(s.lastAt) ?? "",
725
+ requests: typeof s.requests === "number" ? s.requests : 0
726
+ }
727
+ ];
599
728
  });
600
729
  }
601
- async function call(transport, token, version2, method, route, what, body) {
602
- const redact = (s) => s.split(token).join("[token]");
603
- for (let attempt = 0; ; attempt++) {
604
- let res;
730
+ async function writeAtomic(file, text2) {
731
+ await mkdir2(path3.dirname(file), { recursive: true, mode: 448 });
732
+ const tmp = `${file}.tmp-${process.pid}-${randomBytes(4).toString("hex")}`;
733
+ try {
734
+ await writeFile2(tmp, text2, { mode: 384 });
735
+ await rename2(tmp, file);
736
+ } catch (e) {
737
+ await rm(tmp, { force: true });
738
+ throw e;
739
+ }
740
+ }
741
+ function alive(pid) {
742
+ if (!Number.isInteger(pid) || pid <= 0) return false;
743
+ try {
744
+ process.kill(pid, 0);
745
+ return true;
746
+ } catch (e) {
747
+ return e.code === "EPERM";
748
+ }
749
+ }
750
+ var CloudSettings = class {
751
+ constructor(dir, keychain = null) {
752
+ this.dir = dir;
753
+ this.keychain = keychain;
754
+ }
755
+ dir;
756
+ keychain;
757
+ get file() {
758
+ return path3.join(this.dir, "settings.json");
759
+ }
760
+ get keyFile() {
761
+ return path3.join(this.dir, "device.key");
762
+ }
763
+ get statusFile() {
764
+ return path3.join(this.dir, "status.json");
765
+ }
766
+ /** The settings, with defaults (off, not started, the default gateway, no device) for anything missing or unreadable, with why. */
767
+ async read() {
768
+ const settings2 = {
769
+ enabled: false,
770
+ started: false,
771
+ gateway: DEFAULT_GATEWAY,
772
+ device: null
773
+ };
774
+ let text2;
775
+ try {
776
+ text2 = await readFile2(this.file, "utf8");
777
+ } catch (e) {
778
+ if (e.code === "ENOENT") return { settings: settings2, error: null };
779
+ return { settings: settings2, error: `${this.file} could not be read: ${e.message}` };
780
+ }
781
+ let parsed;
782
+ try {
783
+ parsed = JSON.parse(text2);
784
+ } catch {
785
+ return { settings: settings2, error: `${this.file} is not valid JSON.` };
786
+ }
787
+ if (!isObj(parsed) || parsed.schema !== CLOUD_SETTINGS_SCHEMA) {
788
+ return { settings: settings2, error: `${this.file} is not a Wheelhouse Cloud settings file.` };
789
+ }
790
+ const gateway = str(parsed.gateway);
791
+ const origin = gateway ? gatewayOrigin(gateway) : null;
792
+ return {
793
+ settings: {
794
+ enabled: parsed.enabled === true,
795
+ started: parsed.started === true,
796
+ gateway: origin?.ok ? origin.origin : DEFAULT_GATEWAY,
797
+ device: parseDevice(parsed.device)
798
+ },
799
+ error: null
800
+ };
801
+ }
802
+ async update(change) {
803
+ const { settings: settings2 } = await this.read();
804
+ change(settings2);
805
+ if (!settings2.gateway) settings2.gateway = DEFAULT_GATEWAY;
806
+ const gateway = settings2.gateway === DEFAULT_GATEWAY ? "" : settings2.gateway;
807
+ await writeAtomic(
808
+ this.file,
809
+ JSON.stringify({ schema: CLOUD_SETTINGS_SCHEMA, ...settings2, gateway }, null, " ") + "\n"
810
+ );
811
+ return settings2;
812
+ }
813
+ /** The Keychain account for this directory's device key, so each config directory has its own. */
814
+ async keychainAccount() {
815
+ const real2 = await realpath(this.dir).catch(() => path3.resolve(this.dir));
816
+ return `device:${createHash2("sha256").update(real2).digest("hex").slice(0, 16)}`;
817
+ }
818
+ /** The device key and where it is kept: the Keychain first, then the file. */
819
+ async findKey() {
820
+ const kept = this.keychain ? await this.keychain.get(await this.keychainAccount()).catch(() => null) : null;
821
+ const fromKeychain = kept ? importKey(kept) : null;
822
+ if (fromKeychain) return { key: fromKeychain, where: this.keychain.where };
823
+ try {
824
+ const s = await lstat(this.keyFile);
825
+ if (!s.isFile()) return null;
826
+ if ((s.mode & 63) !== 0) await chmod(this.keyFile, 384);
827
+ const key = importKey(await readFile2(this.keyFile, "utf8"));
828
+ return key ? { key, where: this.keyFile } : null;
829
+ } catch {
830
+ return null;
831
+ }
832
+ }
833
+ /** Keep the key in the Keychain, else in its file, replacing any before; returns where it went. */
834
+ async setKey(key) {
835
+ await mkdir2(this.dir, { recursive: true, mode: 448 });
836
+ const stored = exportKey(key);
837
+ const account = await this.keychainAccount();
838
+ const kept = this.keychain ? await this.keychain.set(account, stored).then(
839
+ () => true,
840
+ () => false
841
+ ) : false;
842
+ if (kept) {
843
+ await rm(this.keyFile, { force: true });
844
+ return this.keychain.where;
845
+ }
846
+ await this.keychain?.remove(account).catch(() => false);
847
+ await writeAtomic(this.keyFile, `${stored}
848
+ `);
849
+ await chmod(this.dir, 448).catch(() => {
850
+ });
851
+ return this.keyFile;
852
+ }
853
+ /** Forget this machine's device: its key wherever it is kept, and its record, and stop remote access. */
854
+ async forget() {
855
+ await this.keychain?.remove(await this.keychainAccount()).catch(() => false);
856
+ await rm(this.keyFile, { force: true });
857
+ await this.update((s) => {
858
+ s.device = null;
859
+ s.started = false;
860
+ });
861
+ }
862
+ async readStatus() {
863
+ try {
864
+ const v = JSON.parse(await readFile2(this.statusFile, "utf8"));
865
+ if (!isObj(v) || v.schema !== CLOUD_STATUS_SCHEMA || typeof v.pid !== "number") return null;
866
+ const state = v.state === "online" || v.state === "stopped" ? v.state : "connecting";
867
+ return {
868
+ pid: v.pid,
869
+ state,
870
+ reason: str(v.reason),
871
+ gateway: str(v.gateway) ?? "",
872
+ deviceId: str(v.deviceId) ?? "",
873
+ since: str(v.since),
874
+ lastSeen: str(v.lastSeen),
875
+ updatedAt: str(v.updatedAt) ?? "",
876
+ sessions: parseSessions(v.sessions)
877
+ };
878
+ } catch {
879
+ return null;
880
+ }
881
+ }
882
+ async writeStatus(s) {
883
+ await writeAtomic(
884
+ this.statusFile,
885
+ JSON.stringify({ schema: CLOUD_STATUS_SCHEMA, ...s }, null, " ") + "\n"
886
+ );
887
+ }
888
+ /** Changes whenever the settings or the key file are written, so a running connector notices. */
889
+ async stamp() {
890
+ const one = async (f) => {
891
+ try {
892
+ const s = await stat3(f);
893
+ return `${s.mtimeMs}:${s.size}:${s.ino}`;
894
+ } catch {
895
+ return "-";
896
+ }
897
+ };
898
+ return (await Promise.all([this.file, this.keyFile].map(one))).join("|");
899
+ }
900
+ /** What the Remotes page, Settings → Cloud and `wheelhouse remote status` show. */
901
+ async view(viaRelay = false) {
902
+ const { settings: settings2, error } = await this.read();
903
+ const found = settings2.device ? await this.findKey() : null;
904
+ const status = await this.readStatus();
905
+ const device = settings2.device && found ? {
906
+ id: settings2.device.id,
907
+ name: settings2.device.name,
908
+ user: settings2.device.user,
909
+ fingerprint: fingerprint(settings2.device.publicKey),
910
+ pairedAt: settings2.device.pairedAt
911
+ } : null;
912
+ const live = status && device && status.deviceId === device.id && alive(status.pid) ? status : null;
913
+ let state;
914
+ let reason = error;
915
+ if (!settings2.enabled) state = "off";
916
+ else if (!device) {
917
+ state = "not-paired";
918
+ if (settings2.device && !found) {
919
+ reason = "This machine\u2019s device key is missing, so it cannot connect. Pair it again.";
920
+ } else if (status?.state === "stopped" && status.reason) {
921
+ reason = status.reason;
922
+ }
923
+ } else if (!live) {
924
+ if (!settings2.started) state = "off";
925
+ else
926
+ state = status && status.deviceId === device.id && status.state === "stopped" && status.reason ? "stopped" : "not-running";
927
+ if (state === "stopped") reason = status.reason;
928
+ } else {
929
+ state = live.state === "online" ? "online" : live.state === "stopped" ? "stopped" : "connecting";
930
+ reason = live.reason ?? reason;
931
+ }
932
+ const recent = status && device && status.deviceId === device.id ? status : null;
933
+ return {
934
+ schema: "wheelhouse-cloud.v1",
935
+ enabled: settings2.enabled,
936
+ started: settings2.started,
937
+ gateway: settings2.gateway,
938
+ device,
939
+ keyStore: found?.where ?? null,
940
+ state,
941
+ reason,
942
+ since: live?.state === "online" ? live.since : null,
943
+ lastSeen: recent?.lastSeen ?? null,
944
+ sessions: recent?.sessions ?? [],
945
+ viaRelay
946
+ };
947
+ }
948
+ };
949
+
950
+ // src/lib/server/cloud/local.ts
951
+ function cloudKeychain() {
952
+ return process.platform === "darwin" ? macKeychain(CLOUD_KEYCHAIN_SERVICE) : null;
953
+ }
954
+
955
+ // src/lib/server/cloud/connector.ts
956
+ import WebSocket2 from "ws";
957
+
958
+ // src/lib/server/cloud/relay.ts
959
+ import http from "node:http";
960
+ import WebSocket from "ws";
961
+ var CREDIT_BATCH = 64 * 1024;
962
+ var IDLE_MS = 5 * 6e4;
963
+ var WS_HANDSHAKE_MS = 12e3;
964
+ var isObj2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
965
+ var headerSafe = (s) => {
966
+ for (let i = 0; i < s.length; i++) {
967
+ const c = s.charCodeAt(i);
968
+ if (c < 32 && c !== 9 || c === 127) return false;
969
+ }
970
+ return true;
971
+ };
972
+ function parseRelay(v) {
973
+ if (!isObj2(v) || !isObj2(v.user)) return null;
974
+ const { sessionId, origin, previewOrigin } = v;
975
+ const { id, name } = v.user;
976
+ const all = [sessionId, origin, previewOrigin, id];
977
+ if (!all.every((s) => typeof s === "string" && s.length <= 512 && headerSafe(s))) return null;
978
+ return {
979
+ sessionId,
980
+ user: { id, name: typeof name === "string" ? name : "" },
981
+ origin,
982
+ previewOrigin
983
+ };
984
+ }
985
+ function parseHeaders(v) {
986
+ if (!Array.isArray(v) || v.length > MAX_HEADER_ENTRIES) return null;
987
+ let bytes = 0;
988
+ const out = [];
989
+ for (const h of v) {
990
+ if (!Array.isArray(h) || h.length !== 2) return null;
991
+ const [name, value] = h;
992
+ if (typeof name !== "string" || typeof value !== "string") return null;
993
+ if (!/^[!#$%&'*+.^_`|~0-9a-z-]+$/i.test(name) || !headerSafe(value)) return null;
994
+ bytes += name.length + value.length + 4;
995
+ out.push([name.toLowerCase(), value]);
996
+ }
997
+ return bytes <= MAX_HEADER_BYTES ? out : null;
998
+ }
999
+ var Relay = class {
1000
+ constructor(opts) {
1001
+ this.opts = opts;
1002
+ this.idleMs = opts.idleMs ?? IDLE_MS;
1003
+ }
1004
+ opts;
1005
+ streams = /* @__PURE__ */ new Map();
1006
+ /**
1007
+ * Streams still being admitted (the preview ports are looked up first),
1008
+ * with the body frames and `req.end` that arrived meanwhile; a reset
1009
+ * meanwhile removes the entry, and the stream is then never opened.
1010
+ */
1011
+ early = /* @__PURE__ */ new Map();
1012
+ lastId = 0;
1013
+ closed = false;
1014
+ idleMs;
1015
+ get open() {
1016
+ return this.streams.size;
1017
+ }
1018
+ /** A control message about a stream. */
1019
+ control(msg) {
1020
+ if (this.closed) return;
1021
+ const id = typeof msg.id === "number" ? msg.id : -1;
1022
+ switch (msg.t) {
1023
+ case "req":
1024
+ case "ws":
1025
+ if (this.streams.has(id) || this.early.has(id)) break;
1026
+ this.early.set(id, { frames: [], bytes: 0, end: false });
1027
+ void (msg.t === "req" ? this.request(id, msg) : this.socket(id, msg));
1028
+ break;
1029
+ case "req.end": {
1030
+ const e = this.early.get(id);
1031
+ if (e) e.end = true;
1032
+ const s = this.streams.get(id);
1033
+ if (s?.kind === "http") s.req.end();
1034
+ break;
1035
+ }
1036
+ case "credit": {
1037
+ const s = this.streams.get(id);
1038
+ if (s && typeof msg.bytes === "number" && msg.bytes > 0) this.credited(s, msg.bytes);
1039
+ break;
1040
+ }
1041
+ case "reset":
1042
+ this.early.delete(id);
1043
+ this.drop(id);
1044
+ break;
1045
+ case "ws.close": {
1046
+ const s = this.streams.get(id);
1047
+ if (s?.kind !== "ws") break;
1048
+ this.streams.delete(id);
1049
+ const code = typeof msg.code === "number" ? msg.code : 1e3;
1050
+ const reason = typeof msg.reason === "string" ? msg.reason.slice(0, 123) : "";
1051
+ try {
1052
+ s.ws.close(closable(code), reason);
1053
+ } catch {
1054
+ s.ws.terminate();
1055
+ }
1056
+ break;
1057
+ }
1058
+ }
1059
+ }
1060
+ /** A binary frame: request body, or a WebSocket message for the local side. */
1061
+ frame(kind, id, payload) {
1062
+ const { window, maxFrame, maxWsMessage, maxBody } = this.opts.limits;
1063
+ const e = this.early.get(id);
1064
+ if (e) {
1065
+ if (e.bytes >= window) {
1066
+ this.early.delete(id);
1067
+ return this.reset(id, "protocol", "The credit window was exceeded.", { force: true });
1068
+ }
1069
+ e.bytes += payload.length;
1070
+ e.frames.push([kind, payload]);
1071
+ return;
1072
+ }
1073
+ const s = this.streams.get(id);
1074
+ if (!s) return;
1075
+ if (s.flow.in >= window) return this.reset(s.id, "protocol", "The credit window was exceeded.");
1076
+ s.flow.in += payload.length;
1077
+ if (s.kind === "http") {
1078
+ if (kind !== FRAME_HTTP || payload.length > maxFrame) {
1079
+ return this.reset(s.id, "protocol", "Unexpected frame for an HTTP stream.");
1080
+ }
1081
+ s.received += payload.length;
1082
+ if (s.received > maxBody) return this.reset(s.id, "too_large");
1083
+ this.touch(s);
1084
+ s.req.write(payload, () => this.passed(s, payload.length));
1085
+ return;
1086
+ }
1087
+ if (kind !== FRAME_WS_TEXT && kind !== FRAME_WS_BINARY || !s.accepted) {
1088
+ return this.reset(s.id, "protocol", "Unexpected frame for a WebSocket stream.");
1089
+ }
1090
+ if (payload.length > maxWsMessage) return this.reset(s.id, "too_large");
1091
+ s.ws.send(payload, { binary: kind === FRAME_WS_BINARY }, () => this.passed(s, payload.length));
1092
+ }
1093
+ /** The device socket is gone: every stream on it ends (§7). */
1094
+ closeAll() {
1095
+ this.closed = true;
1096
+ this.early.clear();
1097
+ for (const id of [...this.streams.keys()]) this.drop(id);
1098
+ }
1099
+ /** Open a stream admitted meanwhile, with what arrived for it; false when it was reset first. */
1100
+ opened(s) {
1101
+ const e = this.early.get(s.id);
1102
+ if (!e) {
1103
+ this.drop(s.id);
1104
+ return false;
1105
+ }
1106
+ this.early.delete(s.id);
1107
+ for (const [kind, payload] of e.frames) this.frame(kind, s.id, payload);
1108
+ if (e.end && s.kind === "http" && this.streams.get(s.id) === s) s.req.end();
1109
+ return true;
1110
+ }
1111
+ passed(s, n) {
1112
+ if (this.streams.get(s.id) !== s) return;
1113
+ s.flow.passed += n;
1114
+ const drained = s.kind === "http" ? s.req.writableLength === 0 : s.ws.bufferedAmount === 0;
1115
+ const batch = Math.min(CREDIT_BATCH, Math.floor(this.opts.limits.window / 2));
1116
+ if (s.flow.passed >= batch || drained) {
1117
+ this.opts.send({ t: "credit", id: s.id, bytes: s.flow.passed });
1118
+ s.flow.in -= s.flow.passed;
1119
+ s.flow.passed = 0;
1120
+ }
1121
+ }
1122
+ credited(s, n) {
1123
+ s.flow.out = Math.max(0, s.flow.out - n);
1124
+ if (s.kind === "http") return this.flush(s);
1125
+ if (s.flow.out >= this.opts.limits.window) return;
1126
+ if (s.paused) {
1127
+ s.paused = false;
1128
+ s.ws.resume();
1129
+ }
1130
+ }
1131
+ /** Send one WebSocket message to the gateway; true while the stream's window still has room. */
1132
+ sendMessage(s, kind, data) {
1133
+ this.opts.sendFrame(encodeFrame(kind, s.id, data));
1134
+ s.flow.out += data.length;
1135
+ return s.flow.out < this.opts.limits.window;
1136
+ }
1137
+ /**
1138
+ * Send queued response body while the window has room, a frame of at most
1139
+ * maxFrame at a time (§6.1); the local answer is paused while any waits, and
1140
+ * `res.end` follows the last of it.
1141
+ */
1142
+ flush(s) {
1143
+ const { maxFrame, window } = this.opts.limits;
1144
+ while (s.queue.length && s.flow.out < window) {
1145
+ const head = s.queue[0];
1146
+ const piece = head.subarray(0, maxFrame);
1147
+ if (piece.length === head.length) s.queue.shift();
1148
+ else s.queue[0] = head.subarray(maxFrame);
1149
+ this.opts.sendFrame(encodeFrame(FRAME_HTTP, s.id, piece));
1150
+ s.flow.out += piece.length;
1151
+ }
1152
+ if (s.queue.length) s.res?.pause();
1153
+ else if (s.ended) this.finish(s);
1154
+ else s.res?.resume();
1155
+ }
1156
+ reset(id, code, message, extra = {}) {
1157
+ const was = this.streams.has(id);
1158
+ this.drop(id);
1159
+ if (was || extra.force) {
1160
+ const { force: _, ...rest } = extra;
1161
+ void _;
1162
+ this.opts.send({ t: "reset", id, code, ...message ? { message } : {}, ...rest });
1163
+ }
1164
+ }
1165
+ /** Forget a stream and abort its local side, sending nothing. */
1166
+ drop(id) {
1167
+ const s = this.streams.get(id);
1168
+ if (!s) return;
1169
+ this.streams.delete(id);
1170
+ if (s.kind === "http") {
1171
+ if (s.idle) clearTimeout(s.idle);
1172
+ s.req.destroy();
1173
+ s.res?.destroy();
1174
+ } else s.ws.terminate();
1175
+ }
1176
+ touch(s) {
1177
+ if (!s.res) return;
1178
+ if (s.idle) clearTimeout(s.idle);
1179
+ s.idle = setTimeout(() => this.reset(s.id, "timeout"), this.idleMs);
1180
+ s.idle.unref?.();
1181
+ }
1182
+ /**
1183
+ * What the request may reach, or the reset that refuses it (§6.4): the
1184
+ * stream id is new, the target is Wheelhouse or one of its previews, the path
1185
+ * is an absolute path that is not the restart, and the cloud is on here.
1186
+ */
1187
+ async admit(id, msg) {
1188
+ if (!Number.isInteger(id) || id <= this.lastId || id > 4294967295) {
1189
+ return { ok: false, code: "protocol", message: "Stream ids must increase." };
1190
+ }
1191
+ this.lastId = id;
1192
+ if (this.streams.size >= this.opts.limits.maxStreams) return { ok: false, code: "limit" };
1193
+ const relay = parseRelay(msg.relay);
1194
+ const headers = parseHeaders(msg.headers);
1195
+ const path19 = msg.path;
1196
+ if (!relay || !headers || typeof path19 !== "string" || !path19.startsWith("/") || path19.length > 8192 || !headerSafe(path19) || path19.includes(" ")) {
1197
+ return { ok: false, code: "protocol", message: "The request is malformed." };
1198
+ }
1199
+ if (!this.opts.targets.enabled()) {
1200
+ return {
1201
+ ok: false,
1202
+ code: "refused",
1203
+ message: "Wheelhouse Cloud is turned off on this machine."
1204
+ };
1205
+ }
1206
+ if (isRestartPath(path19)) {
1207
+ return {
1208
+ ok: false,
1209
+ code: "refused",
1210
+ message: "Wheelhouse cannot be restarted through the cloud."
1211
+ };
1212
+ }
1213
+ const target = isObj2(msg.target) ? msg.target : {};
1214
+ const app = this.opts.targets.appPort();
1215
+ if (target.kind === "app") {
1216
+ return { ok: true, port: app, host: "127.0.0.1", path: path19, headers, relay };
1217
+ }
1218
+ const port = target.port;
1219
+ if (target.kind !== "port" || typeof port !== "number" || !Number.isInteger(port) || port < 1 || port > 65535) {
1220
+ return { ok: false, code: "protocol", message: "Unknown target." };
1221
+ }
1222
+ if (port === app || !(await this.opts.targets.previewPorts()).has(port)) {
1223
+ return { ok: false, code: "refused", message: "That port is not a Wheelhouse preview." };
1224
+ }
1225
+ return { ok: true, port, host: "localhost", path: path19, headers, relay };
1226
+ }
1227
+ /** §6.3: the headers for the local request. */
1228
+ localHeaders(a, originChecked, ws) {
1229
+ const out = {};
1230
+ for (const [name, value] of a.headers) {
1231
+ if (HOP_BY_HOP.has(name) || name === "host" || name === "origin") continue;
1232
+ if (name.startsWith("x-wheelhouse-remote")) continue;
1233
+ if (ws && name.startsWith("sec-websocket-")) continue;
1234
+ const had = out[name];
1235
+ if (had === void 0) out[name] = value;
1236
+ else if (name === "cookie") out[name] = `${had}; ${value}`;
1237
+ else out[name] = Array.isArray(had) ? [...had, value] : [had, value];
1238
+ }
1239
+ const local = `${a.host}:${a.port}`;
1240
+ out.host = local;
1241
+ if (originChecked) out.origin = `http://${local}`;
1242
+ out["x-wheelhouse-remote"] = "1";
1243
+ out["x-wheelhouse-remote-user"] = a.relay.user.id;
1244
+ out["x-wheelhouse-remote-session"] = a.relay.sessionId;
1245
+ out["x-wheelhouse-remote-origin"] = a.relay.origin;
1246
+ out["x-wheelhouse-remote-preview"] = a.relay.previewOrigin;
1247
+ return out;
1248
+ }
1249
+ async request(id, msg) {
1250
+ const a = await this.admit(id, msg);
1251
+ if (this.closed || !this.early.has(id)) return;
1252
+ const method = typeof msg.method === "string" && /^[A-Z]{1,20}$/.test(msg.method) ? msg.method : null;
1253
+ if (!a.ok || !method) {
1254
+ this.early.delete(id);
1255
+ if (!a.ok) return this.reset(id, a.code, a.message, { force: true });
1256
+ return this.reset(id, "protocol", "The method is malformed.", { force: true });
1257
+ }
1258
+ this.opts.onRelayed?.(a.relay);
1259
+ const req = http.request({
1260
+ host: a.host,
1261
+ port: a.port,
1262
+ method,
1263
+ path: a.path,
1264
+ headers: this.localHeaders(a, msg.originChecked === true, false),
1265
+ setHost: false
1266
+ });
1267
+ const s = {
1268
+ kind: "http",
1269
+ id,
1270
+ flow: { out: 0, in: 0, passed: 0 },
1271
+ req,
1272
+ res: null,
1273
+ queue: [],
1274
+ ended: false,
1275
+ received: 0,
1276
+ idle: null
1277
+ };
1278
+ this.streams.set(id, s);
1279
+ req.on("error", (e) => {
1280
+ if (this.streams.get(id) !== s) return;
1281
+ const refused2 = !s.res && ["ECONNREFUSED", "ECONNRESET", "EHOSTUNREACH", "ENOTFOUND"].includes(e.code ?? "");
1282
+ this.reset(id, refused2 ? "unreachable" : "internal");
1283
+ });
1284
+ req.on("response", (res) => this.respond(s, method, res, a));
1285
+ if (msg.body !== true) req.end();
1286
+ this.opened(s);
1287
+ }
1288
+ respond(s, method, res, a) {
1289
+ if (this.streams.get(s.id) !== s) return void res.destroy();
1290
+ s.res = res;
1291
+ const headers = [];
1292
+ let bytes = 0;
1293
+ const raw = res.rawHeaders;
1294
+ for (let i = 0; i + 1 < raw.length; i += 2) {
1295
+ const name = raw[i].toLowerCase();
1296
+ if (HOP_BY_HOP.has(name)) continue;
1297
+ let value = raw[i + 1];
1298
+ if (name === "location") value = relativeLocation(value, a.host, a.port);
1299
+ bytes += name.length + value.length + 4;
1300
+ headers.push([name, value]);
1301
+ }
1302
+ if (headers.length > MAX_HEADER_ENTRIES || bytes > MAX_HEADER_BYTES) {
1303
+ return this.reset(s.id, "protocol", "The local answer\u2019s headers are too large.");
1304
+ }
1305
+ this.opts.send({ t: "res", id: s.id, status: res.statusCode ?? 502, headers });
1306
+ this.touch(s);
1307
+ const status = res.statusCode ?? 0;
1308
+ if (method === "HEAD" || status === 204 || status === 304) {
1309
+ res.resume();
1310
+ this.finish(s);
1311
+ return;
1312
+ }
1313
+ res.on("data", (chunk) => {
1314
+ if (this.streams.get(s.id) !== s) return;
1315
+ this.touch(s);
1316
+ s.queue.push(chunk);
1317
+ this.flush(s);
1318
+ });
1319
+ res.on("end", () => {
1320
+ if (this.streams.get(s.id) !== s) return;
1321
+ s.ended = true;
1322
+ this.flush(s);
1323
+ });
1324
+ res.on("error", () => {
1325
+ if (this.streams.get(s.id) === s) this.reset(s.id, "internal");
1326
+ });
1327
+ }
1328
+ finish(s) {
1329
+ if (this.streams.get(s.id) !== s) return;
1330
+ this.opts.send({ t: "res.end", id: s.id });
1331
+ this.streams.delete(s.id);
1332
+ if (s.idle) clearTimeout(s.idle);
1333
+ if (!s.req.writableFinished) s.req.destroy();
1334
+ }
1335
+ async socket(id, msg) {
1336
+ const a = await this.admit(id, msg);
1337
+ if (this.closed || !this.early.has(id)) return;
1338
+ if (!a.ok) {
1339
+ this.early.delete(id);
1340
+ return this.reset(id, a.code, a.message, { force: true });
1341
+ }
1342
+ const protocols = Array.isArray(msg.protocols) ? msg.protocols.filter(
1343
+ (p) => typeof p === "string" && /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(p)
1344
+ ) : [];
1345
+ this.opts.onRelayed?.(a.relay);
1346
+ const headers = this.localHeaders(a, msg.originChecked === true, true);
1347
+ const ws = new WebSocket(`ws://${a.host}:${a.port}${a.path}`, protocols, {
1348
+ headers,
1349
+ perMessageDeflate: false,
1350
+ handshakeTimeout: this.opts.wsHandshakeMs ?? WS_HANDSHAKE_MS,
1351
+ maxPayload: this.opts.limits.maxWsMessage,
1352
+ followRedirects: false
1353
+ });
1354
+ const s = {
1355
+ kind: "ws",
1356
+ id,
1357
+ flow: { out: 0, in: 0, passed: 0 },
1358
+ ws,
1359
+ accepted: false,
1360
+ paused: false
1361
+ };
1362
+ this.streams.set(id, s);
1363
+ if (!this.opened(s)) return;
1364
+ const mine = () => this.streams.get(id) === s;
1365
+ ws.on("unexpected-response", (req, res) => {
1366
+ const status = res.statusCode ?? 502;
1367
+ res.resume();
1368
+ req.destroy();
1369
+ if (mine())
1370
+ this.reset(id, status === 403 || status === 401 ? "refused" : "unreachable", void 0, {
1371
+ status
1372
+ });
1373
+ });
1374
+ ws.on("open", () => {
1375
+ if (!mine()) return void ws.terminate();
1376
+ s.accepted = true;
1377
+ this.opts.send({ t: "ws.accept", id, protocol: ws.protocol || null });
1378
+ });
1379
+ ws.on("message", (data, isBinary) => {
1380
+ if (!mine()) return;
1381
+ const buf = Buffer.isBuffer(data) ? data : Array.isArray(data) ? Buffer.concat(data) : Buffer.from(data);
1382
+ if (buf.length > this.opts.limits.maxWsMessage) return this.reset(id, "too_large");
1383
+ if (!this.sendMessage(s, isBinary ? FRAME_WS_BINARY : FRAME_WS_TEXT, buf) && !s.paused) {
1384
+ s.paused = true;
1385
+ ws.pause();
1386
+ }
1387
+ });
1388
+ ws.on("error", (e) => {
1389
+ if (!mine()) return;
1390
+ if (s.accepted) return this.reset(id, "internal");
1391
+ this.reset(id, /timed out/i.test(e.message) ? "timeout" : "unreachable");
1392
+ });
1393
+ ws.on("close", (code, reason) => {
1394
+ if (!mine()) return;
1395
+ this.streams.delete(id);
1396
+ if (!s.accepted) return this.opts.send({ t: "reset", id, code: "unreachable" });
1397
+ const sent = code === 1005 ? 1e3 : code === 1006 ? 1011 : code;
1398
+ this.opts.send({
1399
+ t: "ws.close",
1400
+ id,
1401
+ code: sent,
1402
+ reason: reason.toString("utf8").slice(0, 123)
1403
+ });
1404
+ });
1405
+ }
1406
+ };
1407
+ function closable(code) {
1408
+ if (code === 1e3 || code >= 3e3 && code <= 4999) return code;
1409
+ if (code >= 1001 && code <= 1014 && ![1004, 1005, 1006].includes(code)) return code;
1410
+ return 1e3;
1411
+ }
1412
+ function relativeLocation(value, host, port) {
1413
+ const u = URL.parse(value);
1414
+ if (!u || u.protocol !== "http:") return value;
1415
+ const same = u.port === String(port) && (u.hostname === host || u.hostname === "127.0.0.1" || u.hostname === "localhost");
1416
+ return same ? `${u.pathname}${u.search}${u.hash}` : value;
1417
+ }
1418
+
1419
+ // src/lib/server/cloud/connector.ts
1420
+ var HELLO_MS = 15e3;
1421
+ var STABLE_MS = 6e4;
1422
+ var isObj3 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
1423
+ function connectUrl(gateway) {
1424
+ const u = new URL("/v1/connect", gateway);
1425
+ u.protocol = u.protocol === "https:" ? "wss:" : "ws:";
1426
+ return u.href;
1427
+ }
1428
+ var Connector = class {
1429
+ constructor(opts) {
1430
+ this.opts = opts;
1431
+ this.random = opts.random ?? Math.random;
1432
+ }
1433
+ opts;
1434
+ state = "connecting";
1435
+ ws = null;
1436
+ relay = null;
1437
+ attempt = 0;
1438
+ retry = null;
1439
+ watchdog = null;
1440
+ stable = null;
1441
+ stopped = false;
1442
+ random;
1443
+ start() {
1444
+ this.stopped = false;
1445
+ this.connect();
1446
+ }
1447
+ /** Close the socket and stop reconnecting. */
1448
+ stop(reason = null) {
1449
+ if (this.stopped) return;
1450
+ this.stopped = true;
1451
+ if (this.retry) clearTimeout(this.retry);
1452
+ this.retry = null;
1453
+ this.teardown();
1454
+ const ws = this.ws;
1455
+ this.ws = null;
1456
+ if (ws) {
1457
+ try {
1458
+ ws.close(1e3);
1459
+ } catch {
1460
+ ws.terminate();
1461
+ }
1462
+ setTimeout(() => ws.terminate(), 2e3).unref?.();
1463
+ }
1464
+ this.set("stopped", reason);
1465
+ }
1466
+ set(state, reason) {
1467
+ this.state = state;
1468
+ this.opts.events.state(state, reason);
1469
+ }
1470
+ log(line) {
1471
+ this.opts.events.log?.(line);
1472
+ }
1473
+ teardown() {
1474
+ if (this.watchdog) clearTimeout(this.watchdog);
1475
+ if (this.stable) clearTimeout(this.stable);
1476
+ this.watchdog = this.stable = null;
1477
+ this.relay?.closeAll();
1478
+ this.relay = null;
1479
+ }
1480
+ connect() {
1481
+ if (this.stopped) return;
1482
+ this.set("connecting", null);
1483
+ const ws = new WebSocket2(connectUrl(this.opts.gateway), {
1484
+ headers: { "X-WHC-Protocol": String(PROTOCOL) },
1485
+ perMessageDeflate: false,
1486
+ handshakeTimeout: 15e3,
1487
+ maxPayload: DEFAULT_LIMITS.maxWsMessage + 5 + 1024,
1488
+ followRedirects: false
1489
+ });
1490
+ this.ws = ws;
1491
+ let limits = DEFAULT_LIMITS;
1492
+ let ready = false;
1493
+ let heartbeatMs = 2e4;
1494
+ const mine = () => this.ws === ws;
1495
+ const send = (msg) => {
1496
+ if (mine() && ws.readyState === WebSocket2.OPEN) ws.send(JSON.stringify(msg));
1497
+ };
1498
+ const alive3 = (ms) => {
1499
+ if (this.watchdog) clearTimeout(this.watchdog);
1500
+ this.watchdog = setTimeout(() => {
1501
+ this.log("The gateway went quiet; reconnecting.");
1502
+ ws.terminate();
1503
+ }, ms);
1504
+ this.watchdog.unref?.();
1505
+ };
1506
+ let upgradeStatus = null;
1507
+ ws.on("unexpected-response", (req, res) => {
1508
+ upgradeStatus = res.statusCode ?? 0;
1509
+ res.resume();
1510
+ req.destroy();
1511
+ ws.emit("close", upgradeStatus === 426 ? 4426 : 1006, Buffer.alloc(0));
1512
+ });
1513
+ ws.on("open", () => alive3(this.opts.helloMs ?? HELLO_MS));
1514
+ ws.on("message", (data, isBinary) => {
1515
+ if (!mine()) return;
1516
+ this.opts.events.seen?.();
1517
+ alive3(ready ? heartbeatMs * 3 : this.opts.helloMs ?? HELLO_MS);
1518
+ if (isBinary) {
1519
+ const f = ready ? decodeFrame(data) : null;
1520
+ if (f) this.relay?.frame(f.kind, f.id, f.payload);
1521
+ return;
1522
+ }
1523
+ if (data.length > MAX_CONTROL_BYTES) return;
1524
+ let msg;
1525
+ try {
1526
+ msg = JSON.parse(data.toString("utf8"));
1527
+ } catch {
1528
+ return;
1529
+ }
1530
+ if (!isObj3(msg) || typeof msg.t !== "string") return;
1531
+ if (!ready) {
1532
+ if (msg.t === "hello" && typeof msg.nonce === "string") {
1533
+ if (typeof msg.protocol === "number" && msg.protocol < PROTOCOL) {
1534
+ this.log(
1535
+ `The gateway speaks protocol ${msg.protocol}; this Wheelhouse speaks ${PROTOCOL}.`
1536
+ );
1537
+ }
1538
+ send({
1539
+ t: "auth",
1540
+ protocol: PROTOCOL,
1541
+ deviceId: this.opts.deviceId,
1542
+ sig: connectSig(this.opts.key, msg.nonce, this.opts.deviceId),
1543
+ agent: { name: "wheelhouse", version: this.opts.version },
1544
+ features: []
1545
+ });
1546
+ } else if (msg.t === "ready") {
1547
+ ready = true;
1548
+ if (typeof msg.heartbeatMs === "number" && msg.heartbeatMs >= 1e3) {
1549
+ heartbeatMs = msg.heartbeatMs;
1550
+ }
1551
+ limits = readLimits(msg.limits);
1552
+ alive3(heartbeatMs * 3);
1553
+ this.relay = new Relay({
1554
+ limits,
1555
+ targets: this.opts.targets,
1556
+ send,
1557
+ sendFrame: (frame) => {
1558
+ if (mine() && ws.readyState === WebSocket2.OPEN) ws.send(frame, { binary: true });
1559
+ },
1560
+ onRelayed: (r) => this.opts.events.relayed?.(r)
1561
+ });
1562
+ this.stable = setTimeout(() => this.attempt = 0, this.opts.stableMs ?? STABLE_MS);
1563
+ this.stable.unref?.();
1564
+ this.set("online", null);
1565
+ }
1566
+ return;
1567
+ }
1568
+ if (msg.t === "ping") return send({ t: "pong", ts: msg.ts });
1569
+ if (msg.t === "pong") return;
1570
+ this.relay?.control(msg);
1571
+ });
1572
+ ws.on("error", (e) => {
1573
+ if (mine()) this.log(`Gateway connection error: ${e.message}`);
1574
+ });
1575
+ ws.on("close", (code) => {
1576
+ if (!mine()) return;
1577
+ this.ws = null;
1578
+ this.teardown();
1579
+ if (this.stopped) return;
1580
+ const action = closeAction(code);
1581
+ if (action.kind === "stop") {
1582
+ this.stopped = true;
1583
+ if (action.forget) this.opts.events.revoked?.();
1584
+ this.set("stopped", action.reason);
1585
+ return;
1586
+ }
1587
+ if (action.note) this.log(`The gateway closed the connection: ${action.note}.`);
1588
+ const wait = Math.max(action.minDelayMs ?? 0, backoffMs(this.attempt, this.random));
1589
+ this.attempt = Math.min(this.attempt + 1, 16);
1590
+ const reason = upgradeStatus ? `The gateway answered ${upgradeStatus}; trying again.` : ready ? "The connection dropped; reconnecting." : "Could not reach the gateway; trying again.";
1591
+ this.set("connecting", reason);
1592
+ this.retry = setTimeout(() => this.connect(), wait);
1593
+ this.retry.unref?.();
1594
+ });
1595
+ }
1596
+ };
1597
+ function readLimits(v) {
1598
+ const out = { ...DEFAULT_LIMITS };
1599
+ if (!isObj3(v)) return out;
1600
+ for (const k of Object.keys(out)) {
1601
+ const n = v[k];
1602
+ if (typeof n === "number" && Number.isInteger(n) && n > 0) out[k] = n;
1603
+ }
1604
+ return out;
1605
+ }
1606
+
1607
+ // src/lib/server/cloud/service.ts
1608
+ var POLL_MS = 3e3;
1609
+ var SEEN_WRITE_MS = 15e3;
1610
+ var MAX_SESSIONS = 20;
1611
+ var HOLDER_FRESH_MS = 3 * 6e4;
1612
+ var CloudService = class {
1613
+ constructor(opts) {
1614
+ this.opts = opts;
1615
+ this.pid = opts.pid ?? process.pid;
1616
+ this.now = opts.now ?? Date.now;
1617
+ }
1618
+ opts;
1619
+ connector = null;
1620
+ /** The device and gateway the connector was started for, and the settings stamp then. */
1621
+ running = null;
1622
+ stamp = "";
1623
+ timer = null;
1624
+ enabled = false;
1625
+ status = null;
1626
+ writing = Promise.resolve();
1627
+ lastSeenWrite = 0;
1628
+ /** Why the connector stopped by itself; it stays stopped until the settings change. */
1629
+ halted = false;
1630
+ sessions = /* @__PURE__ */ new Map();
1631
+ pid;
1632
+ now;
1633
+ ticking = false;
1634
+ /** Stopped: a look still in flight must not start a connector. */
1635
+ closed = false;
1636
+ /** Start watching the settings; resolves after the first look. */
1637
+ async start() {
1638
+ this.closed = false;
1639
+ await this.tick();
1640
+ this.timer = setInterval(() => void this.tick(), this.opts.pollMs ?? POLL_MS);
1641
+ this.timer.unref?.();
1642
+ }
1643
+ /** Close the socket and stop watching; the status says the connector stopped. */
1644
+ async stop() {
1645
+ this.closed = true;
1646
+ if (this.timer) clearInterval(this.timer);
1647
+ this.timer = null;
1648
+ this.halt();
1649
+ await this.writing;
1650
+ }
1651
+ get state() {
1652
+ return this.connector?.state ?? "idle";
1653
+ }
1654
+ halt() {
1655
+ const c = this.connector;
1656
+ this.connector = null;
1657
+ this.running = null;
1658
+ c?.stop();
1659
+ if (this.status && this.status.pid === this.pid) {
1660
+ this.write({ ...this.status, state: "stopped", reason: null, since: null });
1661
+ }
1662
+ }
1663
+ write(s) {
1664
+ this.status = s;
1665
+ const next = { ...s, updatedAt: new Date(this.now()).toISOString() };
1666
+ this.writing = this.writing.then(() => this.opts.settings.writeStatus(next)).catch(
1667
+ (e) => this.opts.log(`Wheelhouse Cloud could not write its status: ${e.message}`)
1668
+ );
1669
+ }
1670
+ /** Another live process holds the device's socket. */
1671
+ async heldElsewhere(deviceId) {
1672
+ const s = await this.opts.settings.readStatus();
1673
+ if (!s || s.pid === this.pid || s.deviceId !== deviceId || s.state === "stopped") return null;
1674
+ const fresh = this.now() - Date.parse(s.updatedAt) < HOLDER_FRESH_MS;
1675
+ return fresh && alive(s.pid) ? s.pid : null;
1676
+ }
1677
+ async tick() {
1678
+ if (this.ticking || this.closed) return;
1679
+ this.ticking = true;
1680
+ try {
1681
+ await this.look();
1682
+ } finally {
1683
+ this.ticking = false;
1684
+ }
1685
+ }
1686
+ async look() {
1687
+ const stamp = await this.opts.settings.stamp();
1688
+ const changed = stamp !== this.stamp;
1689
+ this.stamp = stamp;
1690
+ if (changed) this.halted = false;
1691
+ const { settings: settings2 } = await this.opts.settings.read();
1692
+ this.enabled = settings2.enabled && (settings2.started || this.opts.startedOnly === false);
1693
+ const device = this.enabled ? settings2.device : null;
1694
+ if (!device || this.halted) {
1695
+ if (this.connector) {
1696
+ if (!device) this.opts.log("Wheelhouse Cloud is stopped or not paired here; disconnected.");
1697
+ this.halt();
1698
+ }
1699
+ return;
1700
+ }
1701
+ const same = this.running && this.running.deviceId === device.id && this.running.gateway === device.gateway;
1702
+ if (same) return;
1703
+ if (this.connector) this.halt();
1704
+ const holder = await this.heldElsewhere(device.id);
1705
+ if (holder) {
1706
+ if (changed) {
1707
+ this.opts.log(
1708
+ `Wheelhouse Cloud is already connected by process ${holder}; leaving it to that one.`
1709
+ );
1710
+ }
1711
+ return;
1712
+ }
1713
+ const found = await this.opts.settings.findKey();
1714
+ if (this.closed) return;
1715
+ if (!found) {
1716
+ if (changed)
1717
+ this.opts.log(
1718
+ "Wheelhouse Cloud: this machine\u2019s device key is missing. Pair it again: wheelhouse remote connect."
1719
+ );
1720
+ return;
1721
+ }
1722
+ const before = await this.opts.settings.readStatus();
1723
+ if (this.closed) return;
1724
+ const seen = before?.deviceId === device.id ? [...before.sessions].reverse() : [];
1725
+ this.sessions = new Map(seen.map((s) => [s.id, s]));
1726
+ this.running = { deviceId: device.id, gateway: device.gateway };
1727
+ const base = {
1728
+ pid: this.pid,
1729
+ state: "connecting",
1730
+ reason: null,
1731
+ gateway: device.gateway,
1732
+ deviceId: device.id,
1733
+ since: null,
1734
+ lastSeen: null,
1735
+ updatedAt: "",
1736
+ sessions: [...this.sessions.values()].reverse()
1737
+ };
1738
+ this.status = base;
1739
+ const connector = new Connector({
1740
+ gateway: device.gateway,
1741
+ deviceId: device.id,
1742
+ key: found.key,
1743
+ version: this.opts.version,
1744
+ targets: {
1745
+ appPort: this.opts.appPort,
1746
+ previewPorts: this.opts.previewPorts,
1747
+ enabled: () => this.enabled
1748
+ },
1749
+ events: {
1750
+ state: (state, reason) => {
1751
+ if (this.connector !== connector) return;
1752
+ const at = new Date(this.now()).toISOString();
1753
+ const was = this.status?.state;
1754
+ this.write({
1755
+ ...this.status,
1756
+ state,
1757
+ reason,
1758
+ since: state === "online" ? at : null,
1759
+ lastSeen: state === "online" ? at : this.status.lastSeen
1760
+ });
1761
+ if (state === "online" && was !== "online") {
1762
+ this.opts.log(`Wheelhouse Cloud: connected to ${device.gateway} as ${device.name}.`);
1763
+ }
1764
+ if (state === "stopped" && reason) {
1765
+ this.halted = true;
1766
+ this.running = null;
1767
+ this.connector = null;
1768
+ this.opts.log(`Wheelhouse Cloud stopped: ${reason}`);
1769
+ }
1770
+ },
1771
+ seen: () => {
1772
+ if (this.connector !== connector || !this.status) return;
1773
+ const now = this.now();
1774
+ this.status.lastSeen = new Date(now).toISOString();
1775
+ if (now - this.lastSeenWrite >= SEEN_WRITE_MS) {
1776
+ this.lastSeenWrite = now;
1777
+ this.write(this.status);
1778
+ }
1779
+ },
1780
+ relayed: (r) => this.relayed(r),
1781
+ revoked: () => {
1782
+ void this.opts.settings.forget().catch(() => {
1783
+ });
1784
+ },
1785
+ log: (line) => this.opts.log(`Wheelhouse Cloud: ${line}`)
1786
+ }
1787
+ });
1788
+ this.connector = connector;
1789
+ this.write(base);
1790
+ connector.start();
1791
+ }
1792
+ /** §6.4: a local log of each relay session, without paths, bodies or header values. */
1793
+ relayed(r) {
1794
+ const at = new Date(this.now()).toISOString();
1795
+ const had = this.sessions.get(r.sessionId);
1796
+ if (!had) {
1797
+ this.opts.log(
1798
+ `Wheelhouse Cloud: relay session ${r.sessionId.slice(0, 8)} opened by ${r.user.name || r.user.id}.`
1799
+ );
1800
+ }
1801
+ const s = had ? { ...had, lastAt: at, requests: had.requests + 1 } : { id: r.sessionId, user: r.user.name || r.user.id, firstAt: at, lastAt: at, requests: 1 };
1802
+ this.sessions.delete(r.sessionId);
1803
+ this.sessions.set(r.sessionId, s);
1804
+ while (this.sessions.size > MAX_SESSIONS)
1805
+ this.sessions.delete(this.sessions.keys().next().value);
1806
+ if (!this.status) return;
1807
+ this.status.sessions = [...this.sessions.values()].reverse();
1808
+ if (!had) this.write(this.status);
1809
+ }
1810
+ };
1811
+
1812
+ // src/lib/server/plugins/installed.ts
1813
+ import { mkdir as mkdir3, readFile as readFile3, rename as rename3, writeFile as writeFile3 } from "node:fs/promises";
1814
+ import { homedir as homedir2 } from "node:os";
1815
+ import path4 from "node:path";
1816
+ var INSTALLED_FILE = "installed.json";
1817
+ var SCHEMA = "wheelhouse-installed-plugins.v1";
1818
+ var EMPTY_INSTALLED = () => ({ schema: SCHEMA, plugins: {} });
1819
+ function defaultPluginsDir(env) {
1820
+ if (env.WHEELHOUSE_PLUGINS_DIR) return path4.resolve(env.WHEELHOUSE_PLUGINS_DIR);
1821
+ return path4.join(homedir2(), ".wheelhouse", "plugins");
1822
+ }
1823
+ var isRecord2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
1824
+ function record(v) {
1825
+ if (!isRecord2(v)) return null;
1826
+ const { repository, ref, commit, version: version2, installedAt, enabled } = v;
1827
+ if (typeof repository !== "string" || ref !== null && typeof ref !== "string" || typeof commit !== "string" || typeof version2 !== "string" || typeof installedAt !== "string" || typeof enabled !== "boolean") {
1828
+ return null;
1829
+ }
1830
+ return { repository, ref, commit, version: version2, installedAt, enabled };
1831
+ }
1832
+ async function readInstalled(dir) {
1833
+ const file = path4.join(dir, INSTALLED_FILE);
1834
+ let text2;
1835
+ try {
1836
+ text2 = await readFile3(file, "utf8");
1837
+ } catch (e) {
1838
+ if (e.code === "ENOENT")
1839
+ return { ok: true, installed: EMPTY_INSTALLED() };
1840
+ return { ok: false, error: `could not read ${file}: ${e.message}` };
1841
+ }
1842
+ let raw;
1843
+ try {
1844
+ raw = JSON.parse(text2);
1845
+ } catch (e) {
1846
+ return { ok: false, error: `${file} is not valid JSON: ${e.message}` };
1847
+ }
1848
+ if (!isRecord2(raw) || raw.schema !== SCHEMA || !isRecord2(raw.plugins)) {
1849
+ return { ok: false, error: `${file} is not a ${SCHEMA} record` };
1850
+ }
1851
+ const installed = EMPTY_INSTALLED();
1852
+ for (const [id, v] of Object.entries(raw.plugins)) {
1853
+ const r = record(v);
1854
+ if (!r) return { ok: false, error: `${file}: the entry for "${id}" is not a valid record` };
1855
+ installed.plugins[id] = r;
1856
+ }
1857
+ return { ok: true, installed };
1858
+ }
1859
+ async function writeInstalled(dir, installed) {
1860
+ await mkdir3(dir, { recursive: true });
1861
+ const file = path4.join(dir, INSTALLED_FILE);
1862
+ const tmp = `${file}.${process.pid}.tmp`;
1863
+ await writeFile3(tmp, `${JSON.stringify(installed, null, " ")}
1864
+ `);
1865
+ await rename3(tmp, file);
1866
+ }
1867
+
1868
+ // src/lib/server/setup/skill.ts
1869
+ import { createHash as createHash3 } from "node:crypto";
1870
+ import {
1871
+ lstat as lstat2,
1872
+ mkdir as mkdir4,
1873
+ mkdtemp,
1874
+ readFile as readFile4,
1875
+ readdir,
1876
+ realpath as realpath2,
1877
+ rename as rename4,
1878
+ rm as rm2,
1879
+ writeFile as writeFile4
1880
+ } from "node:fs/promises";
1881
+ import { homedir as homedir3 } from "node:os";
1882
+ import path5 from "node:path";
1883
+ var NAME = "manage-wheelhouse";
1884
+ var RECEIPT = ".wheelhouse-managed.json";
1885
+ var FILES = ["SKILL.md", "references/operations.md"];
1886
+ var hash = (text2) => createHash3("sha256").update(text2).digest("hex");
1887
+ async function physical(file) {
1888
+ try {
1889
+ return await realpath2(file);
1890
+ } catch (e) {
1891
+ if (e.code !== "ENOENT") throw e;
1892
+ const parent = path5.dirname(file);
1893
+ if (parent === file) throw e;
1894
+ return path5.join(await physical(parent), path5.basename(file));
1895
+ }
1896
+ }
1897
+ async function present(file) {
1898
+ try {
1899
+ await lstat2(file);
1900
+ return true;
1901
+ } catch (e) {
1902
+ if (e.code === "ENOENT") return false;
1903
+ throw e;
1904
+ }
1905
+ }
1906
+ async function contents(dir, prefix = "") {
1907
+ const result = {};
1908
+ for (const entry2 of await readdir(dir, { withFileTypes: true })) {
1909
+ const rel = prefix + entry2.name;
1910
+ if (entry2.isDirectory())
1911
+ Object.assign(result, await contents(path5.join(dir, entry2.name), rel + "/"));
1912
+ else if (entry2.isFile()) result[rel] = hash(await readFile4(path5.join(dir, entry2.name), "utf8"));
1913
+ else throw new Error("The skill contains a symbolic link or special file.");
1914
+ }
1915
+ return result;
1916
+ }
1917
+ async function inspect(target, hashes) {
1918
+ if (!await present(target)) return "absent";
1919
+ try {
1920
+ if (!(await lstat2(target)).isDirectory()) return "foreign";
1921
+ const receipt = JSON.parse(await readFile4(path5.join(target, RECEIPT), "utf8"));
1922
+ const actual = await contents(target);
1923
+ delete actual[RECEIPT];
1924
+ 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);
1925
+ if (!unchanged) return "foreign";
1926
+ return receipt.version === version && Object.keys(actual).length === Object.keys(hashes).length && Object.entries(hashes).every(([file, digest]) => actual[file] === digest) ? "current" : "managed";
1927
+ } catch {
1928
+ return await present(target) ? "foreign" : "absent";
1929
+ }
1930
+ }
1931
+ async function installWheelhouseSkill(install2, env, sourceDir = path5.join(env.WHEELHOUSE_INSTALL_DIR || process.cwd(), "skills", NAME)) {
1932
+ if (env.WHEELHOUSE_MANAGE_SKILL === "0")
1933
+ return { state: "disabled", message: "Wheelhouse skill installation is disabled." };
1934
+ const parent = path5.resolve(
1935
+ env.CLAUDE_CONFIG_DIR || path5.join(env.HOME || homedir3(), ".claude"),
1936
+ "skills"
1937
+ );
1938
+ const target = path5.join(parent, NAME);
1939
+ const current = {
1940
+ state: "current",
1941
+ message: `Wheelhouse skill is current at ${target}.`
1942
+ };
1943
+ let stage = null;
1944
+ try {
1945
+ const destinations = [await physical(parent), await physical(target)];
1946
+ for (const dir of [install2.firstmateDir, install2.homeDir]) {
1947
+ const protectedDir = await physical(path5.resolve(dir));
1948
+ if (destinations.some(
1949
+ (destination) => destination === protectedDir || destination.startsWith(protectedDir + path5.sep)
1950
+ ))
1951
+ return {
1952
+ state: "skipped",
1953
+ message: `Left ${target} unchanged: user skills location is inside Firstmate's checkout or home.`
1954
+ };
1955
+ }
1956
+ await mkdir4(parent, { recursive: true });
1957
+ const files = Object.fromEntries(
1958
+ await Promise.all(
1959
+ FILES.map(
1960
+ async (file) => [file, await readFile4(path5.join(sourceDir, file), "utf8")]
1961
+ )
1962
+ )
1963
+ );
1964
+ const hashes = Object.fromEntries(
1965
+ Object.entries(files).map(([file, text2]) => [file, hash(text2)])
1966
+ );
1967
+ const found = await inspect(target, hashes);
1968
+ if (found === "current") return current;
1969
+ if (found === "foreign")
1970
+ return {
1971
+ state: "skipped",
1972
+ message: `Left ${target} unchanged: locally edited or not managed by Wheelhouse. Move it aside to install the bundled skill.`
1973
+ };
1974
+ let now = found;
1975
+ const exists2 = found === "managed";
1976
+ stage = await mkdtemp(path5.join(parent, ".wheelhouse-skill-"));
1977
+ for (const [file, text2] of Object.entries(files)) {
1978
+ await mkdir4(path5.dirname(path5.join(stage, file)), { recursive: true });
1979
+ await writeFile4(path5.join(stage, file), text2);
1980
+ }
1981
+ await writeFile4(
1982
+ path5.join(stage, RECEIPT),
1983
+ JSON.stringify({ schema: "wheelhouse-skill.v1", version, files: hashes }) + "\n"
1984
+ );
1985
+ const backup = stage + "-previous";
1986
+ for (let attempt = 1; ; attempt++) {
1987
+ let error = new Error("another copy appeared while installing");
1988
+ if (now !== "foreign")
1989
+ try {
1990
+ if (now === "managed") await rename4(target, backup);
1991
+ await rename4(stage, target);
1992
+ break;
1993
+ } catch (e) {
1994
+ error = e;
1995
+ await rename4(backup, target).catch(() => {
1996
+ });
1997
+ } finally {
1998
+ await rm2(backup, { recursive: true, force: true });
1999
+ }
2000
+ now = await inspect(target, hashes);
2001
+ if (now === "current") return current;
2002
+ if (attempt === 20) throw error;
2003
+ await new Promise((resolve) => setTimeout(resolve, 10 * attempt));
2004
+ }
2005
+ stage = null;
2006
+ return {
2007
+ state: exists2 ? "updated" : "installed",
2008
+ message: `Wheelhouse skill ${exists2 ? "updated" : "installed"} at ${target}.`
2009
+ };
2010
+ } catch (e) {
2011
+ return {
2012
+ state: "error",
2013
+ message: `Could not install Wheelhouse skill at ${target}: ${e.message}`
2014
+ };
2015
+ } finally {
2016
+ if (stage) await rm2(stage, { recursive: true, force: true });
2017
+ }
2018
+ }
2019
+
2020
+ // src/lib/server/setup/remembered.ts
2021
+ import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
2022
+ import path6 from "node:path";
2023
+ var REMEMBERED_FILE = "firstmate.json";
2024
+ var rememberedFile = (configDir) => path6.join(configDir, REMEMBERED_FILE);
2025
+ function readRemembered(configDir) {
2026
+ let raw;
2027
+ try {
2028
+ raw = JSON.parse(readFileSync(rememberedFile(configDir), "utf8"));
2029
+ } catch {
2030
+ return null;
2031
+ }
2032
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return null;
2033
+ const { firstmate, home } = raw;
2034
+ if (typeof firstmate !== "string" || !path6.isAbsolute(firstmate)) return null;
2035
+ if (home !== void 0 && home !== null && (typeof home !== "string" || !path6.isAbsolute(home))) {
2036
+ return null;
2037
+ }
2038
+ return { firstmate, home: typeof home === "string" ? home : null };
2039
+ }
2040
+
2041
+ // src/lib/server/store/store.ts
2042
+ import { realpathSync } from "node:fs";
2043
+ import path7 from "node:path";
2044
+
2045
+ // src/lib/inbox.ts
2046
+ var SNOOZE_MS = 4 * 3600 * 1e3;
2047
+
2048
+ // src/lib/previewhelper.ts
2049
+ var HELPER_SYSTEM = [
2050
+ "You are the preview helper in Wheelhouse. The captain is reviewing the live preview of one task a coding worker built, and is talking it through with you before any feedback goes to Firstmate, who runs the crew.",
2051
+ "You see only this task: its page, the part the captain points at, its screenshots (read them with the Read tool when they help), its instructions and its history. You know nothing else and cannot change anything.",
2052
+ "Answer what the captain asks about the page or the work, plainly and briefly. When what the captain wants is unclear, ask one short question back. When the instructions or history settle a question, say so and quote them.",
2053
+ "Whenever the captain wants something changed, put it in `suggest` as one feedback line for the worker: one change per line, in plain words, saying where on the page it is. Do not suggest a line already on the list. When the captain only asks a question, `suggest` is empty.",
2054
+ "Never say you will change, send or fix anything: the captain edits the list and sends it to Firstmate when ready.",
2055
+ "Write for someone who is not a programmer: no code, file names or jargon. Keep `reply` to a few sentences."
2056
+ ].join("\n\n");
2057
+ var SUMMARY_SYSTEM = [
2058
+ "You are the preview helper in Wheelhouse. The captain is about to send Firstmate, who runs the crew, a list of feedback several people left about one task a coding worker built. Before it goes, you tidy the list into clear points for the worker.",
2059
+ "Each item is one person\u2019s comment, with any replies folded in, and where on the page it points. Turn the list into points: one change per point, in plain words, saying where on the page it is. Merge items that ask for the same change, and keep who asked when it matters. Leave out chat that asks for nothing (thanks, agreement with no new ask), unless it settles a question in another item. Keep every distinct ask: do not drop, soften or invent one.",
2060
+ "For each point, give `from`: the numbers of the items it came from, and `points`: where on the page it is, briefly (or an empty string when it is about nothing in particular).",
2061
+ "Never say you will change, send or fix anything: the captain edits and picks the points and sends them.",
2062
+ "Write for someone who is not a programmer: no code, file names or jargon."
2063
+ ].join("\n\n");
2064
+
2065
+ // src/lib/server/store/store.ts
2066
+ function defaultStateDir(env) {
2067
+ if (env.WHEELHOUSE_STATE_DIR) return path7.resolve(env.WHEELHOUSE_STATE_DIR);
2068
+ if (env.XDG_STATE_HOME) return path7.join(path7.resolve(env.XDG_STATE_HOME), "wheelhouse");
2069
+ return path7.join(env.HOME ?? "", ".local", "state", "wheelhouse");
2070
+ }
2071
+ function real(p) {
2072
+ const abs = path7.resolve(p);
2073
+ try {
2074
+ return realpathSync(abs);
2075
+ } catch {
2076
+ const parent = path7.dirname(abs);
2077
+ return parent === abs ? abs : path7.join(real(parent), path7.basename(abs));
2078
+ }
2079
+ }
2080
+ function isInside(p, dir) {
2081
+ const rel = path7.relative(real(dir), real(p));
2082
+ return rel === "" || !rel.startsWith("..") && !path7.isAbsolute(rel);
2083
+ }
2084
+
2085
+ // src/lib/server/restart.ts
2086
+ var KEY = /* @__PURE__ */ Symbol.for("wheelhouse.restart");
2087
+ var g = globalThis;
2088
+ function setRestart(fn) {
2089
+ g[KEY] = fn ?? void 0;
2090
+ }
2091
+
2092
+ // src/lib/server/upgrade/settings.ts
2093
+ import { existsSync as existsSync2, readFileSync as readFileSync2, rmSync } from "node:fs";
2094
+ import path8 from "node:path";
2095
+ var updateDir = (configDir) => path8.join(configDir, "update");
2096
+ var handoffFile = (configDir) => path8.join(updateDir(configDir), "next-install");
2097
+ function takeHandoff(configDir) {
2098
+ const file = handoffFile(configDir);
2099
+ let dir;
2100
+ try {
2101
+ dir = readFileSync2(file, "utf8").trim();
2102
+ } catch {
2103
+ return null;
2104
+ }
2105
+ rmSync(file, { force: true });
2106
+ if (!dir || !path8.isAbsolute(dir)) return null;
2107
+ const built = existsSync2(path8.join(dir, "dist", "cli.js")) && existsSync2(path8.join(dir, "build", "handler.js"));
2108
+ return built ? dir : null;
2109
+ }
2110
+
2111
+ // cli/gateway.ts
2112
+ import path10 from "node:path";
2113
+ import { Argument, Command, InvalidArgumentError } from "commander";
2114
+
2115
+ // src/lib/gateway.ts
2116
+ var GATEWAY_CHANNELS = [
2117
+ { channel: "discord", label: "Discord" }
2118
+ ];
2119
+ var DEFAULT_GATEWAY_ALERTS = ["question", "pr-green", "stuck"];
2120
+ var PAIRING_MS = 10 * 6e4;
2121
+
2122
+ // src/lib/server/gateway/channels/discord.ts
2123
+ import WebSocket3 from "ws";
2124
+ var DISCORD_API = "https://discord.com/api/v10";
2125
+ var DISCORD_INTENTS = 1 << 12;
2126
+ var REQUEST_TIMEOUT_MS = 15e3;
2127
+ var wsTransport = {
2128
+ fetch: (url, init) => fetch(url, init),
2129
+ connect(url, on) {
2130
+ const ws = new WebSocket3(url);
2131
+ ws.on("message", (data) => on.message(data.toString()));
2132
+ ws.on("close", (code) => on.close(code));
2133
+ ws.on("error", (e) => on.error(e));
2134
+ return {
2135
+ send: (data) => {
2136
+ if (ws.readyState === WebSocket3.OPEN) ws.send(data);
2137
+ },
2138
+ close: (code) => ws.close(code)
2139
+ };
2140
+ }
2141
+ };
2142
+ var DiscordError = class extends Error {
2143
+ constructor(status, message) {
2144
+ super(message);
2145
+ this.status = status;
2146
+ this.name = "DiscordError";
2147
+ }
2148
+ status;
2149
+ };
2150
+ var str2 = (v) => typeof v === "string" && v ? v : null;
2151
+ function sleep(ms, signal) {
2152
+ return new Promise((resolve) => {
2153
+ const t = setTimeout(done, ms);
2154
+ function done() {
2155
+ clearTimeout(t);
2156
+ signal?.removeEventListener("abort", done);
2157
+ resolve();
2158
+ }
2159
+ signal?.addEventListener("abort", done, { once: true });
2160
+ });
2161
+ }
2162
+ async function call(transport, token, version2, method, route, what, body2) {
2163
+ const redact = (s) => s.split(token).join("[token]");
2164
+ for (let attempt = 0; ; attempt++) {
2165
+ let res;
605
2166
  try {
606
2167
  res = await transport.fetch(`${DISCORD_API}${route}`, {
607
2168
  method,
@@ -610,7 +2171,7 @@ async function call(transport, token, version2, method, route, what, body) {
610
2171
  "content-type": "application/json",
611
2172
  "user-agent": `DiscordBot (https://github.com/chrisjowen/wheelhouse, ${version2})`
612
2173
  },
613
- body: body === void 0 ? void 0 : JSON.stringify(body),
2174
+ body: body2 === void 0 ? void 0 : JSON.stringify(body2),
614
2175
  signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
615
2176
  });
616
2177
  } catch (e) {
@@ -628,7 +2189,7 @@ async function call(transport, token, version2, method, route, what, body) {
628
2189
  if (!res.ok) {
629
2190
  let said = "";
630
2191
  try {
631
- said = str(JSON.parse(text2).message) ?? "";
2192
+ said = str2(JSON.parse(text2).message) ?? "";
632
2193
  } catch {
633
2194
  }
634
2195
  throw new DiscordError(
@@ -641,107 +2202,58 @@ async function call(transport, token, version2, method, route, what, body) {
641
2202
  }
642
2203
  async function checkDiscordToken(token, opts = {}) {
643
2204
  const transport = opts.transport ?? wsTransport;
644
- const version2 = opts.version ?? "0";
645
- try {
646
- const me = await call(
647
- transport,
648
- token,
649
- version2,
650
- "GET",
651
- "/users/@me",
652
- "say who the bot is"
653
- );
654
- const id = str(me?.id);
655
- if (!id) return { ok: false, error: "Discord did not say who the bot is." };
656
- const app = await call(
657
- transport,
658
- token,
659
- version2,
660
- "GET",
661
- "/applications/@me",
662
- "describe the application"
663
- ).catch(() => null);
664
- return {
665
- ok: true,
666
- bot: { id, name: str(me.global_name) ?? str(me.username) ?? id },
667
- appId: str(app?.id) ?? id,
668
- publicBot: typeof app?.bot_public === "boolean" ? app.bot_public : null
669
- };
670
- } catch (e) {
671
- const status = e instanceof DiscordError ? e.status : 0;
672
- if (status === 401)
673
- return {
674
- ok: false,
675
- error: "Discord refused this token: it is not a valid bot token, or it was reset."
676
- };
677
- return { ok: false, error: e.message };
678
- }
679
- }
680
- var inviteUrl = (appId) => `https://discord.com/oauth2/authorize?client_id=${encodeURIComponent(appId)}&scope=bot&permissions=0`;
681
-
682
- // src/lib/server/gateway/keychain.ts
683
- import { spawn as spawn2 } from "node:child_process";
684
- var KEYCHAIN_SERVICE = "wheelhouse-gateway";
685
- var SECURITY = "/usr/bin/security";
686
- var NOT_FOUND = 44;
687
- function security(args, input = "") {
688
- return new Promise((resolve, reject) => {
689
- const child = spawn2(SECURITY, args, { stdio: ["pipe", "pipe", "ignore"] });
690
- let stdout = "";
691
- child.stdout.setEncoding("utf8").on("data", (d) => stdout += d);
692
- child.on("error", reject);
693
- child.on("close", (code) => resolve({ code: code ?? -1, stdout }));
694
- child.stdin.on("error", () => {
695
- });
696
- child.stdin.end(input);
697
- });
698
- }
699
- function macKeychain(service = KEYCHAIN_SERVICE) {
700
- const failed = (what, code) => new Error(`the macOS Keychain could not ${what} (security exited ${code})`);
701
- return {
702
- where: `the macOS Keychain (${service})`,
703
- async get(account) {
704
- const r = await security(["find-generic-password", "-s", service, "-a", account, "-w"]);
705
- if (r.code === NOT_FOUND) return null;
706
- if (r.code !== 0) throw failed("read it", r.code);
707
- return r.stdout.trim() || null;
708
- },
709
- async set(account, secret) {
710
- if (!/^[A-Za-z0-9._-]+$/.test(secret))
711
- throw new Error("not a secret the Keychain line can hold");
712
- const r = await security(
713
- ["-i"],
714
- `add-generic-password -U -s ${service} -a ${account} -w ${secret}
715
- `
716
- );
717
- if (r.code !== 0) throw failed("keep it", r.code);
718
- },
719
- async remove(account) {
720
- const r = await security(["delete-generic-password", "-s", service, "-a", account]);
721
- if (r.code === NOT_FOUND) return false;
722
- if (r.code !== 0) throw failed("remove it", r.code);
723
- return true;
724
- }
725
- };
726
- }
727
- function defaultKeychain() {
728
- return process.platform === "darwin" ? macKeychain() : null;
2205
+ const version2 = opts.version ?? "0";
2206
+ try {
2207
+ const me = await call(
2208
+ transport,
2209
+ token,
2210
+ version2,
2211
+ "GET",
2212
+ "/users/@me",
2213
+ "say who the bot is"
2214
+ );
2215
+ const id = str2(me?.id);
2216
+ if (!id) return { ok: false, error: "Discord did not say who the bot is." };
2217
+ const app = await call(
2218
+ transport,
2219
+ token,
2220
+ version2,
2221
+ "GET",
2222
+ "/applications/@me",
2223
+ "describe the application"
2224
+ ).catch(() => null);
2225
+ return {
2226
+ ok: true,
2227
+ bot: { id, name: str2(me.global_name) ?? str2(me.username) ?? id },
2228
+ appId: str2(app?.id) ?? id,
2229
+ publicBot: typeof app?.bot_public === "boolean" ? app.bot_public : null
2230
+ };
2231
+ } catch (e) {
2232
+ const status = e instanceof DiscordError ? e.status : 0;
2233
+ if (status === 401)
2234
+ return {
2235
+ ok: false,
2236
+ error: "Discord refused this token: it is not a valid bot token, or it was reset."
2237
+ };
2238
+ return { ok: false, error: e.message };
2239
+ }
729
2240
  }
2241
+ var inviteUrl = (appId) => `https://discord.com/oauth2/authorize?client_id=${encodeURIComponent(appId)}&scope=bot&permissions=0`;
730
2242
 
731
2243
  // src/lib/server/gateway/settings.ts
732
- import { createHash, randomBytes } from "node:crypto";
2244
+ import { createHash as createHash4, randomBytes as randomBytes2 } from "node:crypto";
733
2245
  import {
734
- chmod,
735
- lstat,
736
- mkdir as mkdir3,
737
- readFile as readFile3,
738
- realpath,
739
- rename as rename3,
740
- rm,
741
- stat as stat3,
742
- writeFile as writeFile3
2246
+ chmod as chmod2,
2247
+ lstat as lstat3,
2248
+ mkdir as mkdir5,
2249
+ readFile as readFile5,
2250
+ realpath as realpath3,
2251
+ rename as rename5,
2252
+ rm as rm3,
2253
+ stat as stat4,
2254
+ writeFile as writeFile5
743
2255
  } from "node:fs/promises";
744
- import path5 from "node:path";
2256
+ import path9 from "node:path";
745
2257
 
746
2258
  // src/lib/bell.ts
747
2259
  var ALERT_KINDS = [
@@ -760,7 +2272,7 @@ var QUIET_AFTER_MS = 20 * 6e4;
760
2272
  // src/lib/server/gateway/settings.ts
761
2273
  var GATEWAY_SETTINGS_SCHEMA = "wheelhouse-gateway-settings.v1";
762
2274
  var SETTINGS_FILE = "settings.json";
763
- var gatewayDir = (configDir) => path5.join(configDir, "gateway");
2275
+ var gatewayDir = (configDir) => path9.join(configDir, "gateway");
764
2276
  function defaultSettings() {
765
2277
  return Object.fromEntries(
766
2278
  GATEWAY_CHANNELS.map((c) => [
@@ -774,17 +2286,17 @@ function cleanToken(raw) {
774
2286
  if (t.length < 50 || t.length > 200) return null;
775
2287
  return /^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t) ? t : null;
776
2288
  }
777
- var isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
778
- var str2 = (v) => typeof v === "string" && v ? v : null;
2289
+ var isObj4 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
2290
+ var str3 = (v) => typeof v === "string" && v ? v : null;
779
2291
  var KINDS = new Set(ALERT_KINDS.map((k) => k.kind));
780
2292
  function parsePeer(v) {
781
- if (!isObj(v)) return null;
782
- const id = str2(v.id);
2293
+ if (!isObj4(v)) return null;
2294
+ const id = str3(v.id);
783
2295
  if (!id || !/^\d{1,32}$/.test(id)) return null;
784
- return { id, name: str2(v.name) ?? id, dm: str2(v.dm), at: str2(v.at) ?? (/* @__PURE__ */ new Date(0)).toISOString() };
2296
+ return { id, name: str3(v.name) ?? id, dm: str3(v.dm), at: str3(v.at) ?? (/* @__PURE__ */ new Date(0)).toISOString() };
785
2297
  }
786
2298
  function parseChannel(v, fallback) {
787
- if (!isObj(v)) return fallback;
2299
+ if (!isObj4(v)) return fallback;
788
2300
  return {
789
2301
  enabled: typeof v.enabled === "boolean" ? v.enabled : fallback.enabled,
790
2302
  paired: parsePeer(v.paired),
@@ -792,14 +2304,14 @@ function parseChannel(v, fallback) {
792
2304
  titlesOnly: typeof v.titlesOnly === "boolean" ? v.titlesOnly : fallback.titlesOnly
793
2305
  };
794
2306
  }
795
- async function writeAtomic(file, text2) {
796
- await mkdir3(path5.dirname(file), { recursive: true, mode: 448 });
797
- const tmp = `${file}.tmp-${process.pid}-${randomBytes(4).toString("hex")}`;
2307
+ async function writeAtomic2(file, text2) {
2308
+ await mkdir5(path9.dirname(file), { recursive: true, mode: 448 });
2309
+ const tmp = `${file}.tmp-${process.pid}-${randomBytes2(4).toString("hex")}`;
798
2310
  try {
799
- await writeFile3(tmp, text2, { mode: 384 });
800
- await rename3(tmp, file);
2311
+ await writeFile5(tmp, text2, { mode: 384 });
2312
+ await rename5(tmp, file);
801
2313
  } catch (e) {
802
- await rm(tmp, { force: true });
2314
+ await rm3(tmp, { force: true });
803
2315
  throw e;
804
2316
  }
805
2317
  }
@@ -811,17 +2323,17 @@ var GatewaySettings = class {
811
2323
  dir;
812
2324
  keychain;
813
2325
  get file() {
814
- return path5.join(this.dir, SETTINGS_FILE);
2326
+ return path9.join(this.dir, SETTINGS_FILE);
815
2327
  }
816
2328
  tokenFile(channel) {
817
- return path5.join(this.dir, `${channel}.token`);
2329
+ return path9.join(this.dir, `${channel}.token`);
818
2330
  }
819
2331
  /** The settings, with defaults for anything missing; an unreadable file reads as the defaults, with why. */
820
2332
  async read() {
821
2333
  const settings2 = defaultSettings();
822
2334
  let text2;
823
2335
  try {
824
- text2 = await readFile3(this.file, "utf8");
2336
+ text2 = await readFile5(this.file, "utf8");
825
2337
  } catch (e) {
826
2338
  if (e.code === "ENOENT") return { settings: settings2, error: null };
827
2339
  return { settings: settings2, error: `${this.file} could not be read: ${e.message}` };
@@ -832,7 +2344,7 @@ var GatewaySettings = class {
832
2344
  } catch {
833
2345
  return { settings: settings2, error: `${this.file} is not valid JSON.` };
834
2346
  }
835
- if (!isObj(parsed) || parsed.schema !== GATEWAY_SETTINGS_SCHEMA) {
2347
+ if (!isObj4(parsed) || parsed.schema !== GATEWAY_SETTINGS_SCHEMA) {
836
2348
  return { settings: settings2, error: `${this.file} is not a Wheelhouse gateway settings file.` };
837
2349
  }
838
2350
  for (const { channel } of GATEWAY_CHANNELS) {
@@ -844,7 +2356,7 @@ var GatewaySettings = class {
844
2356
  async update(change) {
845
2357
  const { settings: settings2 } = await this.read();
846
2358
  change(settings2);
847
- await writeAtomic(
2359
+ await writeAtomic2(
848
2360
  this.file,
849
2361
  JSON.stringify({ schema: GATEWAY_SETTINGS_SCHEMA, ...settings2 }, null, " ") + "\n"
850
2362
  );
@@ -861,10 +2373,10 @@ var GatewaySettings = class {
861
2373
  if (fromKeychain) return { token: fromKeychain, where: this.keychain.where };
862
2374
  const file = this.tokenFile(channel);
863
2375
  try {
864
- const s = await lstat(file);
2376
+ const s = await lstat3(file);
865
2377
  if (!s.isFile()) return null;
866
- if ((s.mode & 63) !== 0) await chmod(file, 384);
867
- const token = cleanToken(await readFile3(file, "utf8"));
2378
+ if ((s.mode & 63) !== 0) await chmod2(file, 384);
2379
+ const token = cleanToken(await readFile5(file, "utf8"));
868
2380
  return token ? { token, where: file } : null;
869
2381
  } catch {
870
2382
  return null;
@@ -879,12 +2391,12 @@ var GatewaySettings = class {
879
2391
  * directory has its own token.
880
2392
  */
881
2393
  async keychainAccount(channel) {
882
- const real2 = await realpath(this.dir).catch(() => path5.resolve(this.dir));
883
- return `${channel}:${createHash("sha256").update(real2).digest("hex").slice(0, 16)}`;
2394
+ const real2 = await realpath3(this.dir).catch(() => path9.resolve(this.dir));
2395
+ return `${channel}:${createHash4("sha256").update(real2).digest("hex").slice(0, 16)}`;
884
2396
  }
885
2397
  /** Keep the token in the Keychain, else in its file, replacing the one before; returns where it went. */
886
2398
  async setToken(channel, token) {
887
- await mkdir3(this.dir, { recursive: true, mode: 448 });
2399
+ await mkdir5(this.dir, { recursive: true, mode: 448 });
888
2400
  const keychain = this.keychain;
889
2401
  const account = await this.keychainAccount(channel);
890
2402
  const kept = keychain ? await keychain.set(account, token).then(
@@ -892,12 +2404,12 @@ var GatewaySettings = class {
892
2404
  () => false
893
2405
  ) : false;
894
2406
  if (kept) {
895
- await rm(this.tokenFile(channel), { force: true });
2407
+ await rm3(this.tokenFile(channel), { force: true });
896
2408
  } else {
897
2409
  await keychain?.remove(account).catch(() => false);
898
- await writeAtomic(this.tokenFile(channel), `${token}
2410
+ await writeAtomic2(this.tokenFile(channel), `${token}
899
2411
  `);
900
- await chmod(this.dir, 448).catch(() => {
2412
+ await chmod2(this.dir, 448).catch(() => {
901
2413
  });
902
2414
  }
903
2415
  await this.update(() => {
@@ -908,7 +2420,7 @@ var GatewaySettings = class {
908
2420
  async stamp() {
909
2421
  const one = async (f) => {
910
2422
  try {
911
- const s = await stat3(f);
2423
+ const s = await stat4(f);
912
2424
  return `${s.mtimeMs}:${s.size}:${s.ino}`;
913
2425
  } catch {
914
2426
  return "-";
@@ -998,8 +2510,12 @@ function gatewayCommand(over = {}) {
998
2510
  );
999
2511
  const settingsFor = (c) => {
1000
2512
  const dir = c.optsWithGlobals().configDir;
1001
- const configDir = dir ? path6.resolve(dir) : defaultConfigDir(deps.env);
1002
- const found = resolveInstall({ cwd: process.cwd(), env: deps.env });
2513
+ const configDir = dir ? path10.resolve(dir) : defaultConfigDir(deps.env);
2514
+ const found = resolveInstall({
2515
+ cwd: process.cwd(),
2516
+ env: deps.env,
2517
+ remembered: readRemembered(configDir)
2518
+ });
1003
2519
  if (found.ok && isInside(configDir, found.install.homeDir)) {
1004
2520
  deps.error(
1005
2521
  `wheelhouse: the config directory ${configDir} is inside the Firstmate home, where the crew can read it. Pass --config-dir <dir> outside it.`
@@ -1115,16 +2631,16 @@ function gatewayCommand(over = {}) {
1115
2631
 
1116
2632
  // cli/plugin.ts
1117
2633
  import { createInterface } from "node:readline/promises";
1118
- import path10 from "node:path";
2634
+ import path14 from "node:path";
1119
2635
  import { Command as Command2 } from "commander";
1120
2636
 
1121
2637
  // src/lib/server/plugins/install.ts
1122
2638
  import { execFile } from "node:child_process";
1123
- import { mkdir as mkdir4, mkdtemp, readFile as readFile4, realpath as realpath2, rename as rename4, rm as rm2, stat as stat4 } from "node:fs/promises";
1124
- import path8 from "node:path";
2639
+ 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";
2640
+ import path12 from "node:path";
1125
2641
 
1126
2642
  // src/lib/server/plugins/manifest.ts
1127
- import path7 from "node:path";
2643
+ import path11 from "node:path";
1128
2644
 
1129
2645
  // src/lib/plugins/addresses.ts
1130
2646
  var TEMPLATE = /^[a-z0-9-]*\{port\}[a-z0-9-]*(?:\.[a-z0-9-]+)*\.localhost$/;
@@ -1141,7 +2657,8 @@ var SLOTS = [
1141
2657
  "bridge.card",
1142
2658
  "home.card",
1143
2659
  "header.indicator",
1144
- "nav.page"
2660
+ "nav.page",
2661
+ "preview.action"
1145
2662
  ];
1146
2663
  var CAPABILITIES = ["feedback"];
1147
2664
 
@@ -1154,7 +2671,7 @@ var SUPPORTED_API_VERSIONS = [PLUGIN_API_VERSION, PLUGIN_API_VERSION - 1].filter
1154
2671
  // src/lib/server/plugins/manifest.ts
1155
2672
  var MANIFEST_DIR = ".wheelhouse-plugin";
1156
2673
  var MANIFEST_FILE = "plugin.json";
1157
- var manifestPath = (pluginDir) => path7.join(pluginDir, MANIFEST_DIR, MANIFEST_FILE);
2674
+ var manifestPath = (pluginDir) => path11.join(pluginDir, MANIFEST_DIR, MANIFEST_FILE);
1158
2675
  var MANIFEST_FIELDS = [
1159
2676
  "$schema",
1160
2677
  "name",
@@ -1201,7 +2718,7 @@ var SEMVER = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
1201
2718
  var MAX_TEXT = 400;
1202
2719
  var isRecord3 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
1203
2720
  function insidePath(f) {
1204
- return typeof f === "string" && f.length > 0 && !path7.isAbsolute(f) && !f.split(/[\\/]/).some((part) => part === ".." || part === "" || part === ".");
2721
+ return typeof f === "string" && f.length > 0 && !path11.isAbsolute(f) && !f.split(/[\\/]/).some((part) => part === ".." || part === "" || part === ".");
1205
2722
  }
1206
2723
  var ICON_TYPES = {
1207
2724
  ".svg": "image/svg+xml",
@@ -1299,7 +2816,7 @@ function wheelhouse(v) {
1299
2816
  }
1300
2817
  if (!insidePath(c.icon))
1301
2818
  throw new Invalid(`${where}.icon must be a plain path inside the plugin`);
1302
- if (!ICON_TYPES[path7.extname(c.icon).toLowerCase()]) {
2819
+ if (!ICON_TYPES[path11.extname(c.icon).toLowerCase()]) {
1303
2820
  throw new Invalid(`${where}.icon must be an image: ${Object.keys(ICON_TYPES).join(", ")}`);
1304
2821
  }
1305
2822
  declared.icon = c.icon;
@@ -1596,11 +3113,11 @@ async function gatherSettings(id, specs, o) {
1596
3113
 
1597
3114
  // src/lib/server/plugins/install.ts
1598
3115
  var ID2 = /^[a-z][a-z0-9-]{0,39}$/;
1599
- var NAME = /^[A-Za-z0-9_.-]+$/;
3116
+ var NAME2 = /^[A-Za-z0-9_.-]+$/;
1600
3117
  var SHA = /^[0-9a-f]{7,40}$/;
1601
3118
  function parseSource(spec) {
1602
3119
  const m = /^([^/@\s]+)\/([^/@\s]+?)(?:\.git)?(?:@(\S+))?$/.exec(spec.trim());
1603
- if (!m || !NAME.test(m[1]) || !NAME.test(m[2]) || m[1].startsWith("-") || m[2].startsWith(".")) {
3120
+ if (!m || !NAME2.test(m[1]) || !NAME2.test(m[2]) || m[1].startsWith("-") || m[2].startsWith(".")) {
1604
3121
  return null;
1605
3122
  }
1606
3123
  const ref = m[3] ?? null;
@@ -1652,20 +3169,20 @@ async function fetchSource(source, into, deps) {
1652
3169
  await step(["checkout", "-q", "--detach", "FETCH_HEAD"]);
1653
3170
  }
1654
3171
  const commit = await step(["rev-parse", "HEAD"]);
1655
- await rm2(path8.join(into, ".git"), { recursive: true, force: true });
3172
+ await rm4(path12.join(into, ".git"), { recursive: true, force: true });
1656
3173
  return commit;
1657
3174
  }
1658
3175
  async function checkCopy(dir) {
1659
3176
  let text2;
1660
3177
  try {
1661
- text2 = await readFile4(manifestPath(dir), "utf8");
3178
+ text2 = await readFile6(manifestPath(dir), "utf8");
1662
3179
  } catch {
1663
3180
  throw new Refused("it has no .wheelhouse-plugin/plugin.json, so it is not a Wheelhouse plugin");
1664
3181
  }
1665
3182
  const parsed = parseManifest(text2);
1666
3183
  if (!parsed.ok) throw new Refused(`its manifest is not valid: ${parsed.error}`);
1667
3184
  const m = parsed.manifest;
1668
- const base = await realpath2(dir);
3185
+ const base = await realpath4(dir);
1669
3186
  for (const [what, rel] of [
1670
3187
  ["server entry", m.wheelhouse.server],
1671
3188
  ["ui bundle", m.wheelhouse.ui]
@@ -1673,12 +3190,12 @@ async function checkCopy(dir) {
1673
3190
  if (!rel) continue;
1674
3191
  let file;
1675
3192
  try {
1676
- file = await realpath2(path8.join(base, rel));
1677
- if (!(await stat4(file)).isFile()) throw new Error();
3193
+ file = await realpath4(path12.join(base, rel));
3194
+ if (!(await stat5(file)).isFile()) throw new Error();
1678
3195
  } catch {
1679
3196
  throw new Refused(`its ${what} ${rel} is missing`);
1680
3197
  }
1681
- if (!file.startsWith(base + path8.sep))
3198
+ if (!file.startsWith(base + path12.sep))
1682
3199
  throw new Refused(`its ${what} leads outside the plugin`);
1683
3200
  }
1684
3201
  return m;
@@ -1720,12 +3237,12 @@ function describeManifest(m, from, commit) {
1720
3237
  ];
1721
3238
  }
1722
3239
  async function withStaging(dir, work) {
1723
- await mkdir4(dir, { recursive: true });
1724
- const staging = await mkdtemp(path8.join(dir, ".staging-"));
3240
+ await mkdir6(dir, { recursive: true });
3241
+ const staging = await mkdtemp2(path12.join(dir, ".staging-"));
1725
3242
  try {
1726
3243
  return await work(staging);
1727
3244
  } finally {
1728
- await rm2(staging, { recursive: true, force: true });
3245
+ await rm4(staging, { recursive: true, force: true });
1729
3246
  }
1730
3247
  }
1731
3248
  async function guarded(work) {
@@ -1758,7 +3275,7 @@ async function settle(m, deps, o) {
1758
3275
  async function keepSettings(id, settings2, deps) {
1759
3276
  const w = await writePluginSettings(deps.configDir, id, settings2);
1760
3277
  if (!w.ok) throw new Refused(`could not keep ${id}'s settings: ${w.error}`);
1761
- deps.log(`Kept ${id}'s settings in ${path8.join(deps.configDir, PLUGINS_FILE)}.`);
3278
+ deps.log(`Kept ${id}'s settings in ${path12.join(deps.configDir, PLUGINS_FILE)}.`);
1762
3279
  }
1763
3280
  async function reload(deps, what, yes) {
1764
3281
  const r = await deps.restart(async (url, busy) => {
@@ -1799,7 +3316,7 @@ function install(spec, deps, o = {}) {
1799
3316
  const commit = await fetchSource(source, staging, deps);
1800
3317
  expected(commit, o.expect, repository);
1801
3318
  const m = await checkCopy(staging);
1802
- const target = path8.join(deps.dir, m.name);
3319
+ const target = path12.join(deps.dir, m.name);
1803
3320
  if (installed.plugins[m.name]) {
1804
3321
  throw new Refused(
1805
3322
  `${m.name} is already installed from ${label(installed.plugins[m.name])}; use \`wheelhouse plugin update ${m.name}\``
@@ -1819,7 +3336,7 @@ function install(spec, deps, o = {}) {
1819
3336
  }
1820
3337
  const settings2 = await settle(m, deps, { yes: o.yes, given: answers });
1821
3338
  if (settings2) await keepSettings(m.name, settings2, deps);
1822
- await rename4(staging, target);
3339
+ await rename6(staging, target);
1823
3340
  installed.plugins[m.name] = {
1824
3341
  repository,
1825
3342
  ref: source.ref,
@@ -1874,17 +3391,17 @@ function update(id, deps, o = {}) {
1874
3391
  if (!o.yes && !await deps.confirm(`Update ${id}?`)) throw new Refused("not updated");
1875
3392
  const settings2 = await settle(m, deps, { yes: o.yes, given: answers });
1876
3393
  if (settings2) await keepSettings(id, settings2, deps);
1877
- const target = path8.join(deps.dir, id);
1878
- const old = await mkdtemp(path8.join(deps.dir, ".old-"));
1879
- const parked = path8.join(old, id);
1880
- if (await exists(target)) await rename4(target, parked);
3394
+ const target = path12.join(deps.dir, id);
3395
+ const old = await mkdtemp2(path12.join(deps.dir, ".old-"));
3396
+ const parked = path12.join(old, id);
3397
+ if (await exists(target)) await rename6(target, parked);
1881
3398
  try {
1882
- await rename4(staging, target);
3399
+ await rename6(staging, target);
1883
3400
  } catch (e) {
1884
- if (await exists(parked)) await rename4(parked, target);
3401
+ if (await exists(parked)) await rename6(parked, target);
1885
3402
  throw e;
1886
3403
  } finally {
1887
- await rm2(old, { recursive: true, force: true });
3404
+ await rm4(old, { recursive: true, force: true });
1888
3405
  }
1889
3406
  installed.plugins[id] = {
1890
3407
  ...was,
@@ -1905,7 +3422,7 @@ function remove(id, deps, o = {}) {
1905
3422
  if (!ID2.test(id)) throw new Refused(`"${id}" is not a plugin id`);
1906
3423
  const installed = await record2(deps);
1907
3424
  if (!installed.plugins[id]) throw new Refused(`${id} is not installed`);
1908
- await rm2(path8.join(deps.dir, id), { recursive: true, force: true });
3425
+ await rm4(path12.join(deps.dir, id), { recursive: true, force: true });
1909
3426
  delete installed.plugins[id];
1910
3427
  await writeInstalled(deps.dir, installed);
1911
3428
  deps.log(`Removed ${id}.`);
@@ -1943,7 +3460,7 @@ function row(id, r, width) {
1943
3460
  }
1944
3461
  async function exists(p) {
1945
3462
  try {
1946
- await stat4(p);
3463
+ await stat5(p);
1947
3464
  return true;
1948
3465
  } catch {
1949
3466
  return false;
@@ -1951,25 +3468,25 @@ async function exists(p) {
1951
3468
  }
1952
3469
 
1953
3470
  // cli/running.ts
1954
- import { randomBytes as randomBytes2, timingSafeEqual } from "node:crypto";
1955
- import { mkdirSync, rmSync, writeFileSync } from "node:fs";
1956
- import { readdir, readFile as readFile5, rm as rm3 } from "node:fs/promises";
1957
- import path9 from "node:path";
3471
+ import { randomBytes as randomBytes3, timingSafeEqual } from "node:crypto";
3472
+ import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "node:fs";
3473
+ import { readdir as readdir2, readFile as readFile7, rm as rm5 } from "node:fs/promises";
3474
+ import path13 from "node:path";
1958
3475
  var RESTART_EXIT = 75;
1959
3476
  var RESTART_PATH = "/api/wheelhouse/restart";
1960
3477
  var RUNNING_DIR = ".running";
1961
3478
  var TIMEOUT_MS = 3e3;
1962
- var newToken = () => randomBytes2(24).toString("hex");
3479
+ var newToken = () => randomBytes3(24).toString("hex");
1963
3480
  function writeRunning(pluginsDir, r) {
1964
- const dir = path9.join(pluginsDir, RUNNING_DIR);
1965
- mkdirSync(dir, { recursive: true, mode: 448 });
1966
- const file = path9.join(dir, `${r.pid}.json`);
1967
- writeFileSync(file, `${JSON.stringify(r)}
3481
+ const dir = path13.join(pluginsDir, RUNNING_DIR);
3482
+ mkdirSync2(dir, { recursive: true, mode: 448 });
3483
+ const file = path13.join(dir, `${r.pid}.json`);
3484
+ writeFileSync2(file, `${JSON.stringify(r)}
1968
3485
  `, { mode: 384 });
1969
3486
  return file;
1970
3487
  }
1971
3488
  function removeRunning(file) {
1972
- rmSync(file, { force: true });
3489
+ rmSync2(file, { force: true });
1973
3490
  }
1974
3491
  var sameToken = (got, want) => {
1975
3492
  const a = Buffer.from(got);
@@ -1996,7 +3513,7 @@ function restartHandler(token, restart, busy) {
1996
3513
  return true;
1997
3514
  };
1998
3515
  }
1999
- var alive = (pid) => {
3516
+ var alive2 = (pid) => {
2000
3517
  try {
2001
3518
  process.kill(pid, 0);
2002
3519
  return true;
@@ -2006,26 +3523,26 @@ var alive = (pid) => {
2006
3523
  };
2007
3524
  var refused = (e) => e.cause?.code === "ECONNREFUSED";
2008
3525
  async function requestRestart(pluginsDir, proceed) {
2009
- const dir = path9.join(pluginsDir, RUNNING_DIR);
3526
+ const dir = path13.join(pluginsDir, RUNNING_DIR);
2010
3527
  const out = { restarted: [], failed: [], kept: [] };
2011
3528
  let names;
2012
3529
  try {
2013
- names = (await readdir(dir)).filter((n) => /^\d+\.json$/.test(n)).sort();
3530
+ names = (await readdir2(dir)).filter((n) => /^\d+\.json$/.test(n)).sort();
2014
3531
  } catch {
2015
3532
  return out;
2016
3533
  }
2017
3534
  for (const name of names) {
2018
- const file = path9.join(dir, name);
3535
+ const file = path13.join(dir, name);
2019
3536
  let r;
2020
3537
  try {
2021
- r = JSON.parse(await readFile5(file, "utf8"));
3538
+ r = JSON.parse(await readFile7(file, "utf8"));
2022
3539
  if (typeof r.url !== "string" || typeof r.token !== "string") throw new Error();
2023
3540
  } catch {
2024
- await rm3(file, { force: true });
3541
+ await rm5(file, { force: true });
2025
3542
  continue;
2026
3543
  }
2027
- if (typeof r.pid === "number" && !alive(r.pid)) {
2028
- await rm3(file, { force: true });
3544
+ if (typeof r.pid === "number" && !alive2(r.pid)) {
3545
+ await rm5(file, { force: true });
2029
3546
  continue;
2030
3547
  }
2031
3548
  const headers = { authorization: `Bearer ${r.token}` };
@@ -2049,7 +3566,7 @@ async function requestRestart(pluginsDir, proceed) {
2049
3566
  if (res.status === 202) out.restarted.push(r.url);
2050
3567
  else out.failed.push({ url: r.url, reason: `it answered ${res.status}` });
2051
3568
  } catch (e) {
2052
- if (refused(e)) await rm3(file, { force: true });
3569
+ if (refused(e)) await rm5(file, { force: true });
2053
3570
  else out.failed.push({ url: r.url, reason: e.message });
2054
3571
  }
2055
3572
  }
@@ -2094,10 +3611,10 @@ function pluginCommand(over = {}) {
2094
3611
  );
2095
3612
  const deps = (c) => {
2096
3613
  const g2 = c.optsWithGlobals();
2097
- const dir = g2.pluginsDir ? path10.resolve(g2.pluginsDir) : defaultPluginsDir(env);
3614
+ const dir = g2.pluginsDir ? path14.resolve(g2.pluginsDir) : defaultPluginsDir(env);
2098
3615
  return {
2099
3616
  dir,
2100
- configDir: g2.configDir ? path10.resolve(g2.configDir) : defaultConfigDir(env),
3617
+ configDir: g2.configDir ? path14.resolve(g2.configDir) : defaultConfigDir(env),
2101
3618
  confirm: askTerminal,
2102
3619
  ask: askLine,
2103
3620
  restart: (proceed) => requestRestart(dir, proceed),
@@ -2131,6 +3648,467 @@ function pluginCommand(over = {}) {
2131
3648
  return cmd;
2132
3649
  }
2133
3650
 
3651
+ // cli/remote.ts
3652
+ import path15 from "node:path";
3653
+ import { Command as Command3, InvalidArgumentError as InvalidArgumentError2 } from "commander";
3654
+
3655
+ // src/lib/server/cloud/pairing.ts
3656
+ import { hostname } from "node:os";
3657
+ function machineName() {
3658
+ return hostname().replace(/\.local$/i, "").slice(0, 60) || "Wheelhouse";
3659
+ }
3660
+ async function keepDevice(settings2, gateway, key, name, device, opts = {}) {
3661
+ const where = await settings2.setKey(key);
3662
+ await settings2.update((x) => {
3663
+ x.enabled = true;
3664
+ if (opts.start) x.started = true;
3665
+ x.gateway = gateway;
3666
+ x.device = {
3667
+ id: device.deviceId,
3668
+ name: device.name || name,
3669
+ gateway,
3670
+ publicKey: key.publicKey,
3671
+ user: device.user,
3672
+ pairedAt: (/* @__PURE__ */ new Date()).toISOString()
3673
+ };
3674
+ });
3675
+ return where;
3676
+ }
3677
+ var isObj5 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
3678
+ async function body(r) {
3679
+ const v = await r.json().catch(() => null);
3680
+ return isObj5(v) ? v : {};
3681
+ }
3682
+ async function post(f, url, payload) {
3683
+ return f(url, {
3684
+ method: "POST",
3685
+ headers: { "content-type": "application/json" },
3686
+ body: JSON.stringify(payload),
3687
+ redirect: "error",
3688
+ signal: AbortSignal.timeout(15e3)
3689
+ });
3690
+ }
3691
+ var unreachable = (gateway, e) => `The gateway at ${gateway} could not be reached: ${e.message}`;
3692
+ async function startPairing(gateway, key, machine, deps = {}) {
3693
+ const f = deps.fetch ?? fetch;
3694
+ let r;
3695
+ try {
3696
+ r = await post(f, `${gateway}/v1/pair/start`, {
3697
+ protocol: PROTOCOL,
3698
+ publicKey: key.publicKey,
3699
+ name: machine.name.slice(0, 60) || "Wheelhouse",
3700
+ platform: machine.platform.slice(0, 40),
3701
+ agent: { name: "wheelhouse", version: machine.version.slice(0, 40) }
3702
+ });
3703
+ } catch (e) {
3704
+ return { ok: false, error: unreachable(gateway, e) };
3705
+ }
3706
+ const b = await body(r);
3707
+ if (r.status === 426) {
3708
+ return {
3709
+ ok: false,
3710
+ error: "The gateway no longer speaks this Wheelhouse\u2019s protocol. Update Wheelhouse: wheelhouse upgrade."
3711
+ };
3712
+ }
3713
+ if (r.status === 429) {
3714
+ const wait = typeof b.retryAfter === "number" ? ` Try again in ${Math.ceil(b.retryAfter / 60)} min.` : "";
3715
+ return { ok: false, error: `The gateway is refusing more pairings for now.${wait}` };
3716
+ }
3717
+ if (r.status !== 201 && r.status !== 200) {
3718
+ const why = typeof b.message === "string" ? `: ${b.message.slice(0, 200)}` : "";
3719
+ return { ok: false, error: `The gateway refused the pairing (${r.status})${why}.` };
3720
+ }
3721
+ const start = {
3722
+ pairingId: typeof b.pairingId === "string" ? b.pairingId : "",
3723
+ userCode: typeof b.userCode === "string" ? b.userCode : "",
3724
+ // The page the captain types the code on: the gateway's own, never one it names.
3725
+ verificationUri: `${gateway}/pair`,
3726
+ fingerprint: typeof b.fingerprint === "string" ? b.fingerprint : "",
3727
+ expiresIn: typeof b.expiresIn === "number" ? b.expiresIn : 600,
3728
+ interval: typeof b.interval === "number" && b.interval > 0 ? b.interval : 3
3729
+ };
3730
+ if (!start.pairingId || !/^[23456789BCDFGHJKLMNPQRSTVWXZ]{4}-?[23456789BCDFGHJKLMNPQRSTVWXZ]{4}$/i.test(start.userCode)) {
3731
+ return {
3732
+ ok: false,
3733
+ error: "The gateway\u2019s answer is not a pairing this Wheelhouse understands."
3734
+ };
3735
+ }
3736
+ const own = fingerprint(key.publicKey);
3737
+ if (start.fingerprint !== own) {
3738
+ return {
3739
+ ok: false,
3740
+ error: `The gateway reports this machine\u2019s key as ${start.fingerprint || "nothing"}, not ${own}. Nothing was paired; do not use this gateway.`
3741
+ };
3742
+ }
3743
+ return { ok: true, start };
3744
+ }
3745
+ async function pollPairing(gateway, key, start, deps = {}) {
3746
+ const f = deps.fetch ?? fetch;
3747
+ const sleep2 = deps.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
3748
+ const now = deps.now ?? Date.now;
3749
+ const until = now() + start.expiresIn * 1e3;
3750
+ let interval = start.interval;
3751
+ let failures = 0;
3752
+ const cancelled = { status: "failed", reason: "The pairing was cancelled." };
3753
+ while (now() < until) {
3754
+ await sleep2(interval * 1e3);
3755
+ if (deps.signal?.aborted) return cancelled;
3756
+ let r;
3757
+ try {
3758
+ r = await post(f, `${gateway}/v1/pair/poll`, {
3759
+ pairingId: start.pairingId,
3760
+ sig: pollSig(key, start.pairingId)
3761
+ });
3762
+ } catch (e) {
3763
+ if (deps.signal?.aborted) return cancelled;
3764
+ if (++failures >= 5) return { status: "failed", reason: unreachable(gateway, e) };
3765
+ continue;
3766
+ }
3767
+ failures = 0;
3768
+ const b = await body(r);
3769
+ if (deps.signal?.aborted) return cancelled;
3770
+ if (r.status === 429) {
3771
+ interval += 5;
3772
+ if (typeof b.retryAfter === "number") await sleep2(b.retryAfter * 1e3);
3773
+ continue;
3774
+ }
3775
+ if (r.status === 410)
3776
+ return { status: "expired", reason: "The code expired before it was approved." };
3777
+ if (r.status === 401) {
3778
+ return { status: "failed", reason: "The gateway no longer knows this pairing." };
3779
+ }
3780
+ if (r.status !== 200) {
3781
+ if (++failures >= 5) return { status: "failed", reason: `The gateway answered ${r.status}.` };
3782
+ continue;
3783
+ }
3784
+ if (b.status === "approved" && typeof b.deviceId === "string" && b.deviceId) {
3785
+ const user = isObj5(b.user) && typeof b.user.name === "string" ? b.user.name : null;
3786
+ return {
3787
+ status: "approved",
3788
+ device: { deviceId: b.deviceId, name: typeof b.name === "string" ? b.name : "", user }
3789
+ };
3790
+ }
3791
+ if (b.status === "denied")
3792
+ return { status: "denied", reason: "The pairing was denied on the gateway." };
3793
+ if (b.status === "expired")
3794
+ return { status: "expired", reason: "The code expired before it was approved." };
3795
+ }
3796
+ return { status: "expired", reason: "The code expired before it was approved." };
3797
+ }
3798
+ async function unpair(gateway, key, deviceId, deps = {}) {
3799
+ const f = deps.fetch ?? fetch;
3800
+ const ts = (deps.now ?? Date.now)();
3801
+ try {
3802
+ const r = await post(f, `${gateway}/v1/device/unpair`, {
3803
+ deviceId,
3804
+ ts,
3805
+ sig: unpairSig(key, deviceId, ts)
3806
+ });
3807
+ if (r.status === 204 || r.status === 200) return { ok: true };
3808
+ return { ok: false, error: `The gateway answered ${r.status}.` };
3809
+ } catch (e) {
3810
+ return { ok: false, error: unreachable(gateway, e) };
3811
+ }
3812
+ }
3813
+ async function disconnect(settings2, deps = {}) {
3814
+ const { settings: s } = await settings2.read();
3815
+ const found = s.device ? await settings2.findKey() : null;
3816
+ await settings2.forget();
3817
+ await settings2.update((x) => x.enabled = false);
3818
+ const told = s.device && found ? await unpair(s.device.gateway, found.key, s.device.id, deps) : null;
3819
+ return {
3820
+ device: s.device?.name ?? null,
3821
+ revoked: told?.ok ?? false,
3822
+ error: told && !told.ok ? told.error : null
3823
+ };
3824
+ }
3825
+
3826
+ // cli/remote.ts
3827
+ function parsePort2(value) {
3828
+ const n = Number(value);
3829
+ if (!Number.isInteger(n) || n < 1 || n > 65535) {
3830
+ throw new InvalidArgumentError2("Port must be a whole number from 1 to 65535.");
3831
+ }
3832
+ return n;
3833
+ }
3834
+ var WARNING = "Warning: whoever approves this code can use this machine\u2019s Wheelhouse from anywhere, terminals included, so they can run commands here. Type the code yourself, only at the address above, and only approve when the fingerprint matches. If someone sent you this command or asked you for the code, stop now (Ctrl+C).";
3835
+ function localPreviewPorts(appPort, ttlMs = 2e3) {
3836
+ let cached = null;
3837
+ return () => {
3838
+ if (cached && Date.now() - cached.at < ttlMs) return cached.ports;
3839
+ const ports = (async () => {
3840
+ try {
3841
+ const r = await fetch(`http://127.0.0.1:${appPort()}/api/cloud/previews`, {
3842
+ signal: AbortSignal.timeout(1500)
3843
+ });
3844
+ const body2 = await r.json();
3845
+ return new Set(
3846
+ Array.isArray(body2.ports) ? body2.ports.filter((p) => Number.isInteger(p)) : []
3847
+ );
3848
+ } catch {
3849
+ return /* @__PURE__ */ new Set();
3850
+ }
3851
+ })();
3852
+ cached = { at: Date.now(), ports };
3853
+ return ports;
3854
+ };
3855
+ }
3856
+ async function wheelhouseUp(port) {
3857
+ try {
3858
+ const r = await fetch(`http://127.0.0.1:${port}/api/health`, {
3859
+ signal: AbortSignal.timeout(1500)
3860
+ });
3861
+ return r.ok;
3862
+ } catch {
3863
+ return false;
3864
+ }
3865
+ }
3866
+ function waitForSignal() {
3867
+ return new Promise((resolve) => {
3868
+ process.once("SIGINT", () => resolve());
3869
+ process.once("SIGTERM", () => resolve());
3870
+ });
3871
+ }
3872
+ var ago = (iso) => {
3873
+ if (!iso) return "never";
3874
+ const s = Math.max(0, Math.round((Date.now() - Date.parse(iso)) / 1e3));
3875
+ return s < 90 ? `${s} s ago` : s < 5400 ? `${Math.round(s / 60)} min ago` : new Date(iso).toLocaleString();
3876
+ };
3877
+ function remoteCommand(over = {}) {
3878
+ const deps = {
3879
+ env: process.env,
3880
+ keychain: cloudKeychain(),
3881
+ pairing: {},
3882
+ machineName,
3883
+ wheelhouseUp,
3884
+ waitForStop: waitForSignal,
3885
+ log: (line) => console.log(line),
3886
+ error: (line) => console.error(line),
3887
+ ...over
3888
+ };
3889
+ const cmd = new Command3("remote").description(
3890
+ "Reach this Wheelhouse from anywhere through a Wheelhouse Cloud gateway (off until you start it on the Remotes page, or `remote run`)."
3891
+ ).option(
3892
+ "--config-dir <dir>",
3893
+ "the Wheelhouse config directory (default: $WHEELHOUSE_CONFIG_DIR, else $XDG_CONFIG_HOME/wheelhouse, else ~/.config/wheelhouse)"
3894
+ );
3895
+ const fail = (line) => {
3896
+ deps.error(`wheelhouse: ${line}`);
3897
+ process.exitCode = 1;
3898
+ };
3899
+ const settingsFor = (c) => {
3900
+ const dir = c.optsWithGlobals().configDir;
3901
+ const configDir = dir ? path15.resolve(dir) : defaultConfigDir(deps.env);
3902
+ const found = resolveInstall({ cwd: process.cwd(), env: deps.env });
3903
+ if (found.ok && isInside(configDir, found.install.homeDir)) {
3904
+ fail(
3905
+ `the config directory ${configDir} is inside the Firstmate home, where the crew can read it. Pass --config-dir <dir> outside it.`
3906
+ );
3907
+ return null;
3908
+ }
3909
+ return new CloudSettings(cloudDir(configDir), deps.keychain);
3910
+ };
3911
+ const gatewayFor = async (settings2, given2) => {
3912
+ const raw = given2 ?? (await settings2.read()).settings.gateway;
3913
+ const origin = gatewayOrigin(raw);
3914
+ if (!origin.ok) {
3915
+ fail(origin.error);
3916
+ return null;
3917
+ }
3918
+ await settings2.update((x) => x.gateway = origin.origin);
3919
+ return origin.origin;
3920
+ };
3921
+ const machine = (name) => ({
3922
+ name: (name ?? deps.machineName()).trim().slice(0, 60) || "Wheelhouse",
3923
+ platform: `${process.platform}-${process.arch}`,
3924
+ version
3925
+ });
3926
+ const keep = async (settings2, gateway, key, name, device) => {
3927
+ const where = await keepDevice(settings2, gateway, key, name, device);
3928
+ deps.log(
3929
+ `Connected: ${device.name || name}${device.user ? `, approved by ${device.user}` : ""}.`
3930
+ );
3931
+ deps.log(`Its key is kept in ${where}, readable by you only; it never leaves this machine.`);
3932
+ };
3933
+ cmd.command("connect").description(
3934
+ "Pair this machine with a gateway: shows a code to type there and a fingerprint to check."
3935
+ ).option(
3936
+ "--gateway <url>",
3937
+ `the gateway, such as https://cloud.example.com (remembered; default ${DEFAULT_GATEWAY})`
3938
+ ).option("--name <name>", "the name this machine gets there (default: its host name)").action(async (o, c) => {
3939
+ const settings2 = settingsFor(c);
3940
+ if (!settings2) return;
3941
+ const { settings: s } = await settings2.read();
3942
+ if (s.device && await settings2.findKey()) {
3943
+ return fail(
3944
+ `this machine is already connected to ${s.device.gateway} as ${s.device.name}. Run \`wheelhouse remote disconnect\` first.`
3945
+ );
3946
+ }
3947
+ const gateway = await gatewayFor(settings2, o.gateway);
3948
+ if (!gateway) return;
3949
+ const key = newDeviceKey();
3950
+ const m = machine(o.name);
3951
+ const name = m.name;
3952
+ const started = await startPairing(gateway, key, m, deps.pairing);
3953
+ if (!started.ok) return fail(started.error);
3954
+ const p = started.start;
3955
+ const mins = Math.round(p.expiresIn / 60);
3956
+ deps.log(`Pairing this machine (${name}) with Wheelhouse Cloud at ${gateway}.`);
3957
+ deps.log("");
3958
+ deps.log(` 1. On a device you trust, sign in at ${p.verificationUri}`);
3959
+ deps.log(` 2. Type this code there: ${p.userCode}`);
3960
+ deps.log(` 3. Pick this machine\u2019s fingerprint: ${fingerprint(key.publicKey)}`);
3961
+ deps.log("");
3962
+ deps.log(WARNING);
3963
+ deps.log("");
3964
+ deps.log(`Waiting for approval (the code works for ${mins} minutes)\u2026`);
3965
+ const outcome = await pollPairing(gateway, key, p, deps.pairing);
3966
+ if (outcome.status !== "approved") return fail(`${outcome.reason} Nothing was paired.`);
3967
+ await keep(settings2, gateway, key, name, outcome.device);
3968
+ deps.log(
3969
+ "Start it on the Remotes page in Wheelhouse, which keeps the connection up while `wheelhouse open` runs; or run `wheelhouse remote run`."
3970
+ );
3971
+ });
3972
+ cmd.command("status").description("Show whether this machine is connected, since when, and its relay sessions.").action(async (_o, c) => {
3973
+ const settings2 = settingsFor(c);
3974
+ if (!settings2) return;
3975
+ const v = await settings2.view();
3976
+ deps.log("Wheelhouse Cloud");
3977
+ deps.log(` Turned: ${v.enabled ? "on" : "off"}`);
3978
+ deps.log(
3979
+ ` Started: ${v.started ? "yes, on the Remotes page" : "no (Start on the Remotes page in Wheelhouse, or wheelhouse remote run)"}`
3980
+ );
3981
+ deps.log(` Gateway: ${v.gateway}`);
3982
+ deps.log(
3983
+ ` Machine: ${v.device ? `${v.device.name} (fingerprint ${v.device.fingerprint})${v.device.user ? `, approved by ${v.device.user}` : ""}` : "not paired (wheelhouse remote connect)"}`
3984
+ );
3985
+ if (v.keyStore) deps.log(` Key: ${v.keyStore}`);
3986
+ const states = {
3987
+ off: "off (not started)",
3988
+ "not-paired": "not paired",
3989
+ "not-running": "not running (start Wheelhouse, or wheelhouse remote run)",
3990
+ connecting: "connecting",
3991
+ online: `online since ${v.since ? new Date(v.since).toLocaleString() : "?"}`,
3992
+ stopped: "stopped"
3993
+ };
3994
+ deps.log(` Connection: ${states[v.state]}${v.reason ? ` (${v.reason})` : ""}`);
3995
+ if (v.device) deps.log(` Last seen: ${ago(v.lastSeen)}`);
3996
+ if (v.sessions.length) {
3997
+ deps.log(" Relay sessions:");
3998
+ for (const s of v.sessions.slice(0, 10)) {
3999
+ deps.log(
4000
+ ` ${s.id.slice(0, 8)} ${s.user} ${s.requests} request${s.requests === 1 ? "" : "s"}, last ${ago(s.lastAt)}`
4001
+ );
4002
+ }
4003
+ }
4004
+ });
4005
+ cmd.command("disconnect").description("Revoke this machine on its gateway and delete its key here.").action(async (_o, c) => {
4006
+ const settings2 = settingsFor(c);
4007
+ if (!settings2) return;
4008
+ const r = await disconnect(settings2, deps.pairing);
4009
+ if (!r.device) return deps.log("This machine was not connected; Wheelhouse Cloud is off.");
4010
+ if (r.revoked)
4011
+ deps.log(`Disconnected ${r.device}: the gateway revoked it and its key is deleted here.`);
4012
+ else {
4013
+ deps.log(`Deleted ${r.device}\u2019s key here; Wheelhouse Cloud is off.`);
4014
+ deps.log(
4015
+ `Warning: the gateway could not be told (${r.error}). Remove the machine from its list of machines too.`
4016
+ );
4017
+ }
4018
+ });
4019
+ for (const [name, on] of [
4020
+ ["on", true],
4021
+ ["off", false]
4022
+ ]) {
4023
+ cmd.command(name).description(
4024
+ on ? "Turn Wheelhouse Cloud back on for this paired machine." : "Turn Wheelhouse Cloud off: the connection closes and nothing is relayed, but the pairing is kept."
4025
+ ).action(async (_o, c) => {
4026
+ const settings2 = settingsFor(c);
4027
+ if (!settings2) return;
4028
+ const s = await settings2.update((x) => x.enabled = on);
4029
+ deps.log(
4030
+ on && !s.device ? "Wheelhouse Cloud is on, but this machine is not paired: wheelhouse remote connect." : `Wheelhouse Cloud is turned ${name}.`
4031
+ );
4032
+ });
4033
+ }
4034
+ cmd.command("run").description(
4035
+ "Keep the connection up now, without starting it on the Remotes page, relaying to the Wheelhouse on --port; pairs first when this machine is not paired yet."
4036
+ ).option("--port <n>", "the port the local Wheelhouse listens on", parsePort2, 4310).option(
4037
+ "--gateway <url>",
4038
+ `the gateway to pair with, when this machine is not paired yet (default: the one set, else ${DEFAULT_GATEWAY})`
4039
+ ).option("--name <name>", "the name this machine gets there (default: its host name)").action(async (o, c) => {
4040
+ const settings2 = settingsFor(c);
4041
+ if (!settings2) return;
4042
+ const alive3 = setInterval(() => {
4043
+ }, 1 << 30);
4044
+ try {
4045
+ await relayUntilStopped(settings2, o);
4046
+ } finally {
4047
+ clearInterval(alive3);
4048
+ }
4049
+ });
4050
+ async function relayUntilStopped(settings2, o) {
4051
+ const stopped = deps.waitForStop().then(() => null);
4052
+ let v = await settings2.view();
4053
+ if (v.device && !v.enabled) return fail("Wheelhouse Cloud is off here: wheelhouse remote on.");
4054
+ if (!v.device && !await pairHeadless(settings2, o, stopped)) return;
4055
+ v = await settings2.view();
4056
+ if (!await deps.wheelhouseUp(o.port)) {
4057
+ deps.log(
4058
+ `Warning: no Wheelhouse answers on port ${o.port} yet; relayed pages fail until one does.`
4059
+ );
4060
+ }
4061
+ const service = new CloudService({
4062
+ settings: settings2,
4063
+ version,
4064
+ // Asked for here, explicitly: no need to start it on the Remotes page too.
4065
+ startedOnly: false,
4066
+ appPort: () => o.port,
4067
+ previewPorts: localPreviewPorts(() => o.port),
4068
+ log: (line) => deps.log(line)
4069
+ });
4070
+ await service.start();
4071
+ deps.log(`Relaying to http://127.0.0.1:${o.port}/. Press Ctrl+C to disconnect.`);
4072
+ await stopped;
4073
+ await service.stop();
4074
+ }
4075
+ async function pairHeadless(settings2, o, stopped) {
4076
+ const gateway = await gatewayFor(settings2, o.gateway);
4077
+ if (!gateway) return false;
4078
+ const m = machine(o.name);
4079
+ const sleep2 = deps.pairing.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
4080
+ for (let attempt = 0; ; attempt++) {
4081
+ const key = newDeviceKey();
4082
+ const started = await Promise.race([startPairing(gateway, key, m, deps.pairing), stopped]);
4083
+ if (!started) return false;
4084
+ if (!started.ok) {
4085
+ fail(started.error);
4086
+ return false;
4087
+ }
4088
+ const p = started.start;
4089
+ deps.log(
4090
+ `Wheelhouse Cloud: to pair ${m.name}, sign in at ${p.verificationUri}, type the code ${p.userCode} and pick the fingerprint ${fingerprint(key.publicKey)} (within ${Math.round(p.expiresIn / 60)} minutes). ${WARNING}`
4091
+ );
4092
+ const outcome = await Promise.race([pollPairing(gateway, key, p, deps.pairing), stopped]);
4093
+ if (!outcome) return false;
4094
+ if (outcome.status === "approved") {
4095
+ await keep(settings2, gateway, key, m.name, outcome.device);
4096
+ return true;
4097
+ }
4098
+ if (outcome.status !== "expired") {
4099
+ fail(`${outcome.reason} Nothing was paired.`);
4100
+ return false;
4101
+ }
4102
+ const wait = Math.min(5e3 * 2 ** attempt, 5 * 6e4);
4103
+ deps.log(
4104
+ `Wheelhouse Cloud: ${outcome.reason} A new code follows in ${Math.round(wait / 1e3)} s.`
4105
+ );
4106
+ if (await Promise.race([sleep2(wait).then(() => true), stopped]) === null) return false;
4107
+ }
4108
+ }
4109
+ return cmd;
4110
+ }
4111
+
2134
4112
  // cli/supervise.ts
2135
4113
  var MAX_RESTARTS = 5;
2136
4114
  var RESTART_WINDOW_MS = 6e4;
@@ -2214,14 +4192,14 @@ function supervise(opts) {
2214
4192
 
2215
4193
  // cli/upgrade.ts
2216
4194
  import { spawn as spawn3 } from "node:child_process";
2217
- import path12 from "node:path";
4195
+ import path17 from "node:path";
2218
4196
  import { fileURLToPath } from "node:url";
2219
- import { Command as Command3 } from "commander";
4197
+ import { Command as Command4 } from "commander";
2220
4198
 
2221
4199
  // src/lib/server/upgrade/clone.ts
2222
4200
  import { execFile as execFile2 } from "node:child_process";
2223
- import { readFile as readFile6, realpath as realpath3 } from "node:fs/promises";
2224
- import path11 from "node:path";
4201
+ import { mkdir as mkdir7, readdir as readdir3, readFile as readFile8, realpath as realpath5 } from "node:fs/promises";
4202
+ import path16 from "node:path";
2225
4203
  var COMMITS_SHOWN = 20;
2226
4204
  var OUTPUT_KEPT = 6e4;
2227
4205
  var runCommand = (cmd, args, cwd) => new Promise((resolve) => {
@@ -2267,11 +4245,11 @@ async function checkClone(deps) {
2267
4245
  changes: []
2268
4246
  };
2269
4247
  out.current.version = packageVersion(
2270
- await readFile6(path11.join(deps.dir, "package.json"), "utf8").catch(() => null)
4248
+ await readFile8(path16.join(deps.dir, "package.json"), "utf8").catch(() => null)
2271
4249
  );
2272
4250
  const top = await g2("rev-parse", "--show-toplevel");
2273
- const here = await realpath3(deps.dir).catch(() => deps.dir);
2274
- if (top.code !== 0 || await realpath3(top.stdout.trim()).catch(() => "") !== here) {
4251
+ const here = await realpath5(deps.dir).catch(() => deps.dir);
4252
+ if (top.code !== 0 || await realpath5(top.stdout.trim()).catch(() => "") !== here) {
2275
4253
  out.reason = `${deps.dir} is not a git clone, so Wheelhouse cannot upgrade it; update it the way it was installed (for npm, \`npm install -g @chrisjowen/wheelhouse\`)`;
2276
4254
  return out;
2277
4255
  }
@@ -2381,10 +4359,19 @@ var UPGRADE_STEPS = [
2381
4359
  { step: "build", label: "Build" },
2382
4360
  { step: "restart", label: "Restart Wheelhouse" }
2383
4361
  ];
4362
+ var LINK = { step: "link", label: "Link the clone (npm link)" };
4363
+ var CLONE_SWITCH_STEPS = [...UPGRADE_STEPS.slice(0, -1), LINK, UPGRADE_STEPS[4]];
4364
+ var CLONE_SETUP_STEPS = [
4365
+ { step: "clone", label: "Clone from GitHub" },
4366
+ UPGRADE_STEPS[2],
4367
+ UPGRADE_STEPS[3],
4368
+ LINK,
4369
+ UPGRADE_STEPS[4]
4370
+ ];
2384
4371
 
2385
4372
  // cli/upgrade.ts
2386
4373
  function installDir() {
2387
- return path12.resolve(path12.dirname(fileURLToPath(import.meta.url)), "..");
4374
+ return path17.resolve(path17.dirname(fileURLToPath(import.meta.url)), "..");
2388
4375
  }
2389
4376
  var runInherit = (cmd, args, cwd) => new Promise((resolve) => {
2390
4377
  const child = spawn3(cmd, args, { cwd, stdio: "inherit" });
@@ -2451,13 +4438,13 @@ async function upgrade(deps, o = {}) {
2451
4438
  }
2452
4439
  function upgradeCommand(over = {}) {
2453
4440
  const env = over.env ?? process.env;
2454
- return new Command3("upgrade").description(
4441
+ return new Command4("upgrade").description(
2455
4442
  "Fast-forward this Wheelhouse clone to the newest commit on GitHub, rebuild it and restart Wheelhouse."
2456
4443
  ).option("--check", "only say whether there is a newer version").option("-y, --yes", "upgrade (and restart, even mid-work) without asking").option(
2457
4444
  "--plugins-dir <dir>",
2458
4445
  "the plugins directory the running Wheelhouse loads from, to find it (default: $WHEELHOUSE_PLUGINS_DIR, else ~/.wheelhouse/plugins)"
2459
4446
  ).action(async (o) => {
2460
- const pluginsDir = o.pluginsDir ? path12.resolve(o.pluginsDir) : defaultPluginsDir(env);
4447
+ const pluginsDir = o.pluginsDir ? path17.resolve(o.pluginsDir) : defaultPluginsDir(env);
2461
4448
  const ok = await upgrade(
2462
4449
  {
2463
4450
  dir: installDir(),
@@ -2476,16 +4463,16 @@ function upgradeCommand(over = {}) {
2476
4463
  var DEFAULT_PORT = 4310;
2477
4464
  var HOST = "127.0.0.1";
2478
4465
  var runtimeHolder = () => globalThis[/* @__PURE__ */ Symbol.for("wheelhouse.runtime")];
2479
- function parsePort2(value) {
4466
+ function parsePort3(value) {
2480
4467
  const n = Number(value);
2481
4468
  if (!Number.isInteger(n) || n < 0 || n > 65535) {
2482
- throw new InvalidArgumentError2("Port must be a whole number from 0 to 65535.");
4469
+ throw new InvalidArgumentError3("Port must be a whole number from 0 to 65535.");
2483
4470
  }
2484
4471
  return n;
2485
4472
  }
2486
4473
  function handlerPath() {
2487
- const here = path13.dirname(fileURLToPath2(import.meta.url));
2488
- return path13.resolve(here, "..", "build", "handler.js");
4474
+ const here = path18.dirname(fileURLToPath2(import.meta.url));
4475
+ return path18.resolve(here, "..", "build", "handler.js");
2489
4476
  }
2490
4477
  function openBrowser(url) {
2491
4478
  const [cmd, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["cmd", ["/c", "start", '""', url]] : ["xdg-open", [url]];
@@ -2498,71 +4485,101 @@ function openBrowser(url) {
2498
4485
  }
2499
4486
  }
2500
4487
  async function open2(opts) {
4488
+ const configDir = opts.configDir ? path18.resolve(opts.configDir) : defaultConfigDir(process.env);
4489
+ const stateDir = opts.stateDir ? path18.resolve(opts.stateDir) : defaultStateDir(process.env);
2501
4490
  const resolved = resolveInstall({
2502
4491
  firstmate: opts.firstmate,
2503
4492
  home: opts.home,
2504
4493
  cwd: process.cwd(),
2505
- env: process.env
4494
+ env: process.env,
4495
+ remembered: readRemembered(configDir)
2506
4496
  });
2507
- if (!resolved.ok) {
4497
+ const setup = !resolved.ok && resolved.missing;
4498
+ if (!resolved.ok && !setup) {
2508
4499
  console.error(`wheelhouse: ${resolved.error}`);
2509
4500
  process.exit(1);
2510
4501
  }
2511
- const { install: install2, notes } = resolved;
2512
- for (const n of notes) console.log(n);
2513
- console.log(`Firstmate: ${install2.firstmateDir}`);
2514
- console.log(`Home: ${install2.homeDir}`);
2515
- const compat = await checkCompatibility(install2);
2516
- if (compat.compatible) {
2517
- console.log(
2518
- `Scripts: compatible${compat.firstmateVersion ? ` (Firstmate ${compat.firstmateVersion})` : ""}`
2519
- );
4502
+ if (resolved.ok) {
4503
+ const { install: install2, notes } = resolved;
4504
+ for (const n of notes) console.log(n);
4505
+ console.log(`Firstmate: ${install2.firstmateDir}`);
4506
+ console.log(`Home: ${install2.homeDir}`);
4507
+ const compat = await checkCompatibility(install2);
4508
+ if (compat.compatible) {
4509
+ console.log(
4510
+ `Scripts: compatible${compat.firstmateVersion ? ` (Firstmate ${compat.firstmateVersion})` : ""}`
4511
+ );
4512
+ } else {
4513
+ console.warn("Warning: this Firstmate may not be compatible with Wheelhouse:");
4514
+ for (const p of compat.problems) console.warn(` - ${p}`);
4515
+ console.warn("Wheelhouse will start and show what it can; see /api/health.");
4516
+ }
4517
+ if (isInside(stateDir, install2.homeDir)) {
4518
+ console.error(
4519
+ `wheelhouse: the state directory ${stateDir} is inside the Firstmate home. Wheelhouse never writes there; pass --state-dir <dir> outside it.`
4520
+ );
4521
+ process.exit(1);
4522
+ }
4523
+ if (isInside(configDir, install2.homeDir)) {
4524
+ console.error(
4525
+ `wheelhouse: the config directory ${configDir} is inside the Firstmate home. Wheelhouse never reads its own config from there; pass --config-dir <dir> outside it.`
4526
+ );
4527
+ process.exit(1);
4528
+ }
4529
+ if (resolved.source !== "remembered") {
4530
+ process.env.WHEELHOUSE_FIRSTMATE_DIR = install2.firstmateDir;
4531
+ process.env.WHEELHOUSE_HOME = install2.homeDir;
4532
+ } else if (opts.home) {
4533
+ process.env.WHEELHOUSE_HOME = install2.homeDir;
4534
+ }
2520
4535
  } else {
2521
- console.warn("Warning: this Firstmate may not be compatible with Wheelhouse:");
2522
- for (const p of compat.problems) console.warn(` - ${p}`);
2523
- console.warn("Wheelhouse will start and show what it can; see /api/health.");
2524
- }
2525
- const stateDir = opts.stateDir ? path13.resolve(opts.stateDir) : defaultStateDir(process.env);
2526
- if (isInside(stateDir, install2.homeDir)) {
2527
- console.error(
2528
- `wheelhouse: the state directory ${stateDir} is inside the Firstmate home. Wheelhouse never writes there; pass --state-dir <dir> outside it.`
2529
- );
2530
- process.exit(1);
4536
+ console.log(`Firstmate: not found. ${resolved.error}`);
4537
+ console.log("Setup: the page opens the setup wizard to clone or choose one.");
2531
4538
  }
2532
4539
  console.log(`State: ${stateDir}`);
2533
- const configDir = opts.configDir ? path13.resolve(opts.configDir) : defaultConfigDir(process.env);
2534
- if (isInside(configDir, install2.homeDir)) {
2535
- console.error(
2536
- `wheelhouse: the config directory ${configDir} is inside the Firstmate home. Wheelhouse never reads its own config from there; pass --config-dir <dir> outside it.`
2537
- );
2538
- process.exit(1);
2539
- }
2540
4540
  console.log(`Config: ${configDir}`);
2541
4541
  const file = handlerPath();
2542
- if (!existsSync2(file)) {
4542
+ if (!existsSync3(file)) {
2543
4543
  console.error(
2544
4544
  `wheelhouse: the web app is not built (${file} is missing). Run \`npm run build\`.`
2545
4545
  );
2546
4546
  process.exit(1);
2547
4547
  }
2548
- process.env.WHEELHOUSE_FIRSTMATE_DIR = install2.firstmateDir;
2549
- process.env.WHEELHOUSE_HOME = install2.homeDir;
2550
4548
  process.env.WHEELHOUSE_STATE_DIR = stateDir;
2551
4549
  process.env.WHEELHOUSE_CONFIG_DIR = configDir;
2552
- if (opts.pluginsDir) process.env.WHEELHOUSE_PLUGINS_DIR = path13.resolve(opts.pluginsDir);
2553
- process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path13.resolve(path13.dirname(file), "..", "plugins");
2554
- process.env.WHEELHOUSE_INSTALL_DIR = path13.resolve(path13.dirname(file), "..");
4550
+ if (opts.pluginsDir) process.env.WHEELHOUSE_PLUGINS_DIR = path18.resolve(opts.pluginsDir);
4551
+ process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path18.resolve(path18.dirname(file), "..", "plugins");
4552
+ process.env.WHEELHOUSE_INSTALL_DIR = path18.resolve(path18.dirname(file), "..");
2555
4553
  if (opts.tmuxSocket) process.env.WHEELHOUSE_TMUX_SOCKET = opts.tmuxSocket;
2556
4554
  process.env.WHEELHOUSE_SKIP_PERMISSIONS = opts.skipPermissions ? "1" : "0";
2557
- const cli = fileURLToPath2(import.meta.url);
4555
+ let cli = fileURLToPath2(import.meta.url);
4556
+ let serverPort = opts.port;
4557
+ const cloud = new CloudService({
4558
+ settings: new CloudSettings(cloudDir(configDir), cloudKeychain()),
4559
+ version,
4560
+ appPort: () => serverPort,
4561
+ previewPorts: localPreviewPorts(() => serverPort),
4562
+ log: (line) => console.warn(line)
4563
+ });
2558
4564
  const watcher = supervise({
2559
4565
  port: opts.port,
2560
- start: (port, restart) => fork(cli, ["__server", "--port", String(port)], {
2561
- env: { ...process.env, WHEELHOUSE_RESTARTED: restart ? "1" : "0" },
2562
- stdio: ["ignore", "inherit", "inherit", "ipc"]
2563
- }),
4566
+ start: (port, restart) => {
4567
+ const next = takeHandoff(configDir);
4568
+ if (next && restart) {
4569
+ cli = path18.join(next, "dist", "cli.js");
4570
+ process.env.WHEELHOUSE_INSTALL_DIR = next;
4571
+ process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path18.join(next, "plugins");
4572
+ console.log(`Wheelhouse now runs from ${next}.`);
4573
+ }
4574
+ return fork(cli, ["__server", "--port", String(port)], {
4575
+ env: { ...process.env, WHEELHOUSE_RESTARTED: restart ? "1" : "0" },
4576
+ stdio: ["ignore", "inherit", "inherit", "ipc"]
4577
+ });
4578
+ },
2564
4579
  onReady: (port) => {
2565
- const url = `http://${HOST}:${port}/`;
4580
+ serverPort = port;
4581
+ void cloud.start();
4582
+ const url = `http://${HOST}:${port}/${setup ? "setup" : ""}`;
2566
4583
  console.log(`Wheelhouse is listening on ${url}`);
2567
4584
  console.log("Press Ctrl+C to close Wheelhouse. Firstmate and its crew keep running.");
2568
4585
  if (opts.browser) openBrowser(url);
@@ -2571,9 +4588,21 @@ async function open2(opts) {
2571
4588
  });
2572
4589
  process.on("SIGINT", watcher.stop);
2573
4590
  process.on("SIGTERM", watcher.stop);
2574
- process.exit(await watcher.done);
4591
+ const code = await watcher.done;
4592
+ await cloud.stop();
4593
+ process.exit(code);
2575
4594
  }
2576
4595
  async function serve(opts) {
4596
+ process.env.WHEELHOUSE_INSTALL_DIR = path18.resolve(path18.dirname(handlerPath()), "..");
4597
+ const selected = resolveInstall({
4598
+ firstmate: process.env.WHEELHOUSE_FIRSTMATE_DIR,
4599
+ home: process.env.WHEELHOUSE_HOME,
4600
+ cwd: process.cwd(),
4601
+ env: process.env,
4602
+ remembered: readRemembered(defaultConfigDir(process.env))
4603
+ });
4604
+ if (selected.ok)
4605
+ console.log((await installWheelhouseSkill(selected.install, process.env)).message);
2577
4606
  process.env.WHEELHOUSE_URL = `http://${HOST}:${opts.port}`;
2578
4607
  process.env.BODY_SIZE_LIMIT ??= String(UPLOAD_MAX_BYTES + 64 * 1024);
2579
4608
  const { handler } = await import(pathToFileURL(handlerPath()).href);
@@ -2638,13 +4667,16 @@ async function serve(opts) {
2638
4667
  process.on("disconnect", () => close(0));
2639
4668
  }
2640
4669
  function program() {
2641
- const cli = new Command4("wheelhouse").description("A local companion to Firstmate: watch the crew at work from a web UI.").version(version);
4670
+ const cli = new Command5("wheelhouse").description("A local companion to Firstmate: watch the crew at work from a web UI.").version(version);
2642
4671
  cli.command("open", { isDefault: true }).description(
2643
- "Start Wheelhouse, start (or show) the Firstmate session, and open it in the browser."
2644
- ).option("--firstmate <dir>", "Firstmate code directory (default: the checkout you are in)").option(
4672
+ "Start Wheelhouse, start (or show) the Firstmate session, and open it in the browser; with no Firstmate yet, open the setup wizard."
4673
+ ).option(
4674
+ "--firstmate <dir>",
4675
+ "Firstmate code directory (default: the checkout you are in, else the one setup remembered; with none, the page opens the setup wizard)"
4676
+ ).option(
2645
4677
  "--home <dir>",
2646
- "Firstmate operational home (default: $FM_HOME, else the code directory)"
2647
- ).option("--port <n>", "port to listen on (127.0.0.1 only)", parsePort2, DEFAULT_PORT).option(
4678
+ "Firstmate operational home (default: $FM_HOME, else the one setup remembered, else the code directory)"
4679
+ ).option("--port <n>", "port to listen on (127.0.0.1 only)", parsePort3, DEFAULT_PORT).option(
2648
4680
  "--state-dir <dir>",
2649
4681
  "where Wheelhouse keeps its own records (default: $WHEELHOUSE_STATE_DIR, else $XDG_STATE_HOME/wheelhouse, else ~/.local/state/wheelhouse)"
2650
4682
  ).option(
@@ -2660,10 +4692,11 @@ function program() {
2660
4692
  "--no-skip-permissions",
2661
4693
  "start Firstmate without --dangerously-skip-permissions, so Claude Code asks before tools run (answer in the terminal drawer)"
2662
4694
  ).action((opts) => open2(opts));
2663
- cli.command("__server", { hidden: true }).description("Wheelhouse's server, as `open` starts it under its watcher.").option("--port <n>", "port to listen on (127.0.0.1 only)", parsePort2, DEFAULT_PORT).action((opts) => serve(opts));
4695
+ cli.command("__server", { hidden: true }).description("Wheelhouse's server, as `open` starts it under its watcher.").option("--port <n>", "port to listen on (127.0.0.1 only)", parsePort3, DEFAULT_PORT).action((opts) => serve(opts));
2664
4696
  cli.addCommand(pluginCommand());
2665
4697
  cli.addCommand(upgradeCommand());
2666
4698
  cli.addCommand(gatewayCommand());
4699
+ cli.addCommand(remoteCommand());
2667
4700
  return cli;
2668
4701
  }
2669
4702
  await program().parseAsync(process.argv);