@chrisjowen/wheelhouse 0.4.0 → 0.5.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 (1125) hide show
  1. package/README.md +5 -11
  2. package/build/client/_app/immutable/assets/0.Dts_kSYF.css +1 -0
  3. package/build/client/_app/immutable/assets/0.Dts_kSYF.css.br +0 -0
  4. package/build/client/_app/immutable/assets/0.Dts_kSYF.css.gz +0 -0
  5. package/build/client/_app/immutable/assets/2.CzzIqOIS.css +1 -0
  6. package/build/client/_app/immutable/assets/2.CzzIqOIS.css.br +3 -0
  7. package/build/client/_app/immutable/assets/2.CzzIqOIS.css.gz +0 -0
  8. package/build/client/_app/immutable/assets/Terminal.B4BtIq8f.css +1 -0
  9. package/build/client/_app/immutable/assets/Terminal.B4BtIq8f.css.br +0 -0
  10. package/build/client/_app/immutable/assets/Terminal.B4BtIq8f.css.gz +0 -0
  11. package/build/client/_app/immutable/chunks/2EjJV7Ut.js +1 -0
  12. package/build/client/_app/immutable/chunks/2EjJV7Ut.js.br +0 -0
  13. package/build/client/_app/immutable/chunks/2EjJV7Ut.js.gz +0 -0
  14. package/build/client/_app/immutable/chunks/3Du01Jqv.js +1 -0
  15. package/build/client/_app/immutable/chunks/3Du01Jqv.js.br +0 -0
  16. package/build/client/_app/immutable/chunks/3Du01Jqv.js.gz +0 -0
  17. package/build/client/_app/immutable/chunks/7CAxhLNo.js +1 -0
  18. package/build/client/_app/immutable/chunks/7CAxhLNo.js.br +0 -0
  19. package/build/client/_app/immutable/chunks/7CAxhLNo.js.gz +0 -0
  20. package/build/client/_app/immutable/chunks/A87jk0Q_.js +1 -0
  21. package/build/client/_app/immutable/chunks/A87jk0Q_.js.br +0 -0
  22. package/build/client/_app/immutable/chunks/A87jk0Q_.js.gz +0 -0
  23. package/build/client/_app/immutable/chunks/AuD8JoYA.js +1 -0
  24. package/build/client/_app/immutable/chunks/AuD8JoYA.js.br +0 -0
  25. package/build/client/_app/immutable/chunks/AuD8JoYA.js.gz +0 -0
  26. package/build/client/_app/immutable/chunks/B6vY4CXx.js +1 -0
  27. package/build/client/_app/immutable/chunks/B6vY4CXx.js.br +0 -0
  28. package/build/client/_app/immutable/chunks/B6vY4CXx.js.gz +0 -0
  29. package/build/client/_app/immutable/chunks/BGLZG4iA.js +1 -0
  30. package/build/client/_app/immutable/chunks/BGLZG4iA.js.br +0 -0
  31. package/build/client/_app/immutable/chunks/BGLZG4iA.js.gz +0 -0
  32. package/build/client/_app/immutable/chunks/BGlB5gNb.js +1 -0
  33. package/build/client/_app/immutable/chunks/BGlB5gNb.js.br +0 -0
  34. package/build/client/_app/immutable/chunks/BGlB5gNb.js.gz +0 -0
  35. package/build/client/_app/immutable/chunks/BH6a_FWw.js +1 -0
  36. package/build/client/_app/immutable/chunks/BH6a_FWw.js.br +0 -0
  37. package/build/client/_app/immutable/chunks/BH6a_FWw.js.gz +0 -0
  38. package/build/client/_app/immutable/chunks/BOHkB3dg.js +1 -0
  39. package/build/client/_app/immutable/chunks/BOHkB3dg.js.br +1 -0
  40. package/build/client/_app/immutable/chunks/BOHkB3dg.js.gz +0 -0
  41. package/build/client/_app/immutable/chunks/BOPlc6SC.js +1 -0
  42. package/build/client/_app/immutable/chunks/BOPlc6SC.js.br +0 -0
  43. package/build/client/_app/immutable/chunks/BOPlc6SC.js.gz +0 -0
  44. package/build/client/_app/immutable/chunks/BPPnR44u.js +1 -0
  45. package/build/client/_app/immutable/chunks/BPPnR44u.js.br +0 -0
  46. package/build/client/_app/immutable/chunks/BPPnR44u.js.gz +0 -0
  47. package/build/client/_app/immutable/chunks/BPpteEm-.js +1 -0
  48. package/build/client/_app/immutable/chunks/BPpteEm-.js.br +0 -0
  49. package/build/client/_app/immutable/chunks/BPpteEm-.js.gz +0 -0
  50. package/build/client/_app/immutable/chunks/BSg7AZAN.js +2 -0
  51. package/build/client/_app/immutable/chunks/BSg7AZAN.js.br +0 -0
  52. package/build/client/_app/immutable/chunks/BSg7AZAN.js.gz +0 -0
  53. package/build/client/_app/immutable/chunks/BUM18Vio.js +1 -0
  54. package/build/client/_app/immutable/chunks/BUM18Vio.js.br +0 -0
  55. package/build/client/_app/immutable/chunks/BUM18Vio.js.gz +0 -0
  56. package/build/client/_app/immutable/chunks/BWiLWMsP.js +1 -0
  57. package/build/client/_app/immutable/chunks/BWiLWMsP.js.br +0 -0
  58. package/build/client/_app/immutable/chunks/BWiLWMsP.js.gz +0 -0
  59. package/build/client/_app/immutable/chunks/BXN538J3.js +1 -0
  60. package/build/client/_app/immutable/chunks/BXN538J3.js.br +2 -0
  61. package/build/client/_app/immutable/chunks/BXN538J3.js.gz +0 -0
  62. package/build/client/_app/immutable/chunks/BY5XjwMm.js +1 -0
  63. package/build/client/_app/immutable/chunks/BY5XjwMm.js.br +0 -0
  64. package/build/client/_app/immutable/chunks/BY5XjwMm.js.gz +0 -0
  65. package/build/client/_app/immutable/chunks/Baw6RQZI.js +1 -0
  66. package/build/client/_app/immutable/chunks/Baw6RQZI.js.br +0 -0
  67. package/build/client/_app/immutable/chunks/Baw6RQZI.js.gz +0 -0
  68. package/build/client/_app/immutable/chunks/Bc5hMax7.js +1 -0
  69. package/build/client/_app/immutable/chunks/Bc5hMax7.js.br +0 -0
  70. package/build/client/_app/immutable/chunks/Bc5hMax7.js.gz +0 -0
  71. package/build/client/_app/immutable/chunks/Bc7Ax2k8.js +1 -0
  72. package/build/client/_app/immutable/chunks/Bc7Ax2k8.js.br +0 -0
  73. package/build/client/_app/immutable/chunks/Bc7Ax2k8.js.gz +0 -0
  74. package/build/client/_app/immutable/chunks/BdveifH1.js +1 -0
  75. package/build/client/_app/immutable/chunks/BdveifH1.js.br +0 -0
  76. package/build/client/_app/immutable/chunks/BdveifH1.js.gz +0 -0
  77. package/build/client/_app/immutable/chunks/Bez7sKgF.js +2 -0
  78. package/build/client/_app/immutable/chunks/Bez7sKgF.js.br +0 -0
  79. package/build/client/_app/immutable/chunks/Bez7sKgF.js.gz +0 -0
  80. package/build/client/_app/immutable/chunks/BmPcpuNW.js +1 -0
  81. package/build/client/_app/immutable/chunks/BmPcpuNW.js.br +0 -0
  82. package/build/client/_app/immutable/chunks/BmPcpuNW.js.gz +0 -0
  83. package/build/client/_app/immutable/chunks/BnO3dw9K.js +1 -0
  84. package/build/client/_app/immutable/chunks/BnO3dw9K.js.br +0 -0
  85. package/build/client/_app/immutable/chunks/BnO3dw9K.js.gz +0 -0
  86. package/build/client/_app/immutable/chunks/BnbnQq8I.js +1 -0
  87. package/build/client/_app/immutable/chunks/BnbnQq8I.js.br +0 -0
  88. package/build/client/_app/immutable/chunks/BnbnQq8I.js.gz +0 -0
  89. package/build/client/_app/immutable/chunks/Bo5P6Wsq.js +1 -0
  90. package/build/client/_app/immutable/chunks/Bo5P6Wsq.js.br +0 -0
  91. package/build/client/_app/immutable/chunks/Bo5P6Wsq.js.gz +0 -0
  92. package/build/client/_app/immutable/chunks/BrERyq0H.js +1 -0
  93. package/build/client/_app/immutable/chunks/BrERyq0H.js.br +0 -0
  94. package/build/client/_app/immutable/chunks/BrERyq0H.js.gz +0 -0
  95. package/build/client/_app/immutable/chunks/BuPPYEyE.js +1 -0
  96. package/build/client/_app/immutable/chunks/BuPPYEyE.js.br +0 -0
  97. package/build/client/_app/immutable/chunks/BuPPYEyE.js.gz +0 -0
  98. package/build/client/_app/immutable/chunks/BwD_Dg5N.js +1 -0
  99. package/build/client/_app/immutable/chunks/BwD_Dg5N.js.br +0 -0
  100. package/build/client/_app/immutable/chunks/BwD_Dg5N.js.gz +0 -0
  101. package/build/client/_app/immutable/chunks/BxUI0v0C.js +1 -0
  102. package/build/client/_app/immutable/chunks/BxUI0v0C.js.br +0 -0
  103. package/build/client/_app/immutable/chunks/BxUI0v0C.js.gz +0 -0
  104. package/build/client/_app/immutable/chunks/ByL6RYpC.js +1 -0
  105. package/build/client/_app/immutable/chunks/ByL6RYpC.js.br +0 -0
  106. package/build/client/_app/immutable/chunks/ByL6RYpC.js.gz +0 -0
  107. package/build/client/_app/immutable/chunks/C50HDirP.js +1 -0
  108. package/build/client/_app/immutable/chunks/C50HDirP.js.br +0 -0
  109. package/build/client/_app/immutable/chunks/C50HDirP.js.gz +0 -0
  110. package/build/client/_app/immutable/chunks/C66QDSwd.js +1 -0
  111. package/build/client/_app/immutable/chunks/C66QDSwd.js.br +0 -0
  112. package/build/client/_app/immutable/chunks/C66QDSwd.js.gz +0 -0
  113. package/build/client/_app/immutable/chunks/CCWNleLp.js +1 -0
  114. package/build/client/_app/immutable/chunks/CCWNleLp.js.br +0 -0
  115. package/build/client/_app/immutable/chunks/CCWNleLp.js.gz +0 -0
  116. package/build/client/_app/immutable/chunks/CCz4Nk0V.js +1 -0
  117. package/build/client/_app/immutable/chunks/CCz4Nk0V.js.br +0 -0
  118. package/build/client/_app/immutable/chunks/CCz4Nk0V.js.gz +0 -0
  119. package/build/client/_app/immutable/chunks/CGBjNqYG.js +1 -0
  120. package/build/client/_app/immutable/chunks/CGBjNqYG.js.br +2 -0
  121. package/build/client/_app/immutable/chunks/CGBjNqYG.js.gz +0 -0
  122. package/build/client/_app/immutable/chunks/CIAui2pR.js +1 -0
  123. package/build/client/_app/immutable/chunks/CIAui2pR.js.br +0 -0
  124. package/build/client/_app/immutable/chunks/CIAui2pR.js.gz +0 -0
  125. package/build/client/_app/immutable/chunks/CMAkb8GS.js +1 -0
  126. package/build/client/_app/immutable/chunks/CMAkb8GS.js.br +0 -0
  127. package/build/client/_app/immutable/chunks/CMAkb8GS.js.gz +0 -0
  128. package/build/client/_app/immutable/chunks/CQ-ixhwd.js +1 -0
  129. package/build/client/_app/immutable/chunks/CQ-ixhwd.js.br +0 -0
  130. package/build/client/_app/immutable/chunks/CQ-ixhwd.js.gz +0 -0
  131. package/build/client/_app/immutable/chunks/CQUBPk_4.js +1 -0
  132. package/build/client/_app/immutable/chunks/CQUBPk_4.js.br +0 -0
  133. package/build/client/_app/immutable/chunks/CQUBPk_4.js.gz +0 -0
  134. package/build/client/_app/immutable/chunks/CQbHvgoi.js +1 -0
  135. package/build/client/_app/immutable/chunks/CQbHvgoi.js.br +0 -0
  136. package/build/client/_app/immutable/chunks/CQbHvgoi.js.gz +0 -0
  137. package/build/client/_app/immutable/chunks/CTHD30FL.js +1 -0
  138. package/build/client/_app/immutable/chunks/CTHD30FL.js.br +0 -0
  139. package/build/client/_app/immutable/chunks/CTHD30FL.js.gz +0 -0
  140. package/build/client/_app/immutable/chunks/CVzwUhTG.js +1 -0
  141. package/build/client/_app/immutable/chunks/CVzwUhTG.js.br +0 -0
  142. package/build/client/_app/immutable/chunks/CVzwUhTG.js.gz +0 -0
  143. package/build/client/_app/immutable/chunks/CW2Ovnl0.js +3 -0
  144. package/build/client/_app/immutable/chunks/CW2Ovnl0.js.br +0 -0
  145. package/build/client/_app/immutable/chunks/CW2Ovnl0.js.gz +0 -0
  146. package/build/client/_app/immutable/chunks/CXwBnOE9.js +1 -0
  147. package/build/client/_app/immutable/chunks/CXwBnOE9.js.br +1 -0
  148. package/build/client/_app/immutable/chunks/CXwBnOE9.js.gz +0 -0
  149. package/build/client/_app/immutable/chunks/C_4BzEag.js +1 -0
  150. package/build/client/_app/immutable/chunks/C_4BzEag.js.br +0 -0
  151. package/build/client/_app/immutable/chunks/C_4BzEag.js.gz +0 -0
  152. package/build/client/_app/immutable/chunks/CbBoCW29.js +1 -0
  153. package/build/client/_app/immutable/chunks/CbBoCW29.js.br +0 -0
  154. package/build/client/_app/immutable/chunks/CbBoCW29.js.gz +0 -0
  155. package/build/client/_app/immutable/chunks/CcCgYs-R.js +1 -0
  156. package/build/client/_app/immutable/chunks/CcCgYs-R.js.br +0 -0
  157. package/build/client/_app/immutable/chunks/CcCgYs-R.js.gz +0 -0
  158. package/build/client/_app/immutable/chunks/CfoNxwsz.js +1 -0
  159. package/build/client/_app/immutable/chunks/CfoNxwsz.js.br +0 -0
  160. package/build/client/_app/immutable/chunks/CfoNxwsz.js.gz +0 -0
  161. package/build/client/_app/immutable/chunks/ClsjySa8.js +1 -0
  162. package/build/client/_app/immutable/chunks/ClsjySa8.js.br +0 -0
  163. package/build/client/_app/immutable/chunks/ClsjySa8.js.gz +0 -0
  164. package/build/client/_app/immutable/chunks/CoaeqTa_.js +1 -0
  165. package/build/client/_app/immutable/chunks/CoaeqTa_.js.br +0 -0
  166. package/build/client/_app/immutable/chunks/CoaeqTa_.js.gz +0 -0
  167. package/build/client/_app/immutable/chunks/Cup7Sx9t.js +1 -0
  168. package/build/client/_app/immutable/chunks/Cup7Sx9t.js.br +0 -0
  169. package/build/client/_app/immutable/chunks/Cup7Sx9t.js.gz +0 -0
  170. package/build/client/_app/immutable/chunks/CxC96GTM.js +2 -0
  171. package/build/client/_app/immutable/chunks/CxC96GTM.js.br +0 -0
  172. package/build/client/_app/immutable/chunks/CxC96GTM.js.gz +0 -0
  173. package/build/client/_app/immutable/chunks/D3c133E-.js +6 -0
  174. package/build/client/_app/immutable/chunks/D3c133E-.js.br +0 -0
  175. package/build/client/_app/immutable/chunks/D3c133E-.js.gz +0 -0
  176. package/build/client/_app/immutable/chunks/D44YeCHd.js +1 -0
  177. package/build/client/_app/immutable/chunks/D44YeCHd.js.br +0 -0
  178. package/build/client/_app/immutable/chunks/D44YeCHd.js.gz +0 -0
  179. package/build/client/_app/immutable/chunks/D4mORKzH.js +1 -0
  180. package/build/client/_app/immutable/chunks/D4mORKzH.js.br +0 -0
  181. package/build/client/_app/immutable/chunks/D4mORKzH.js.gz +0 -0
  182. package/build/client/_app/immutable/chunks/DFxmhm_G.js +1 -0
  183. package/build/client/_app/immutable/chunks/DFxmhm_G.js.br +0 -0
  184. package/build/client/_app/immutable/chunks/DFxmhm_G.js.gz +0 -0
  185. package/build/client/_app/immutable/chunks/DHMhHeVH.js +1 -0
  186. package/build/client/_app/immutable/chunks/DHMhHeVH.js.br +0 -0
  187. package/build/client/_app/immutable/chunks/DHMhHeVH.js.gz +0 -0
  188. package/build/client/_app/immutable/chunks/DIorvK89.js +2 -0
  189. package/build/client/_app/immutable/chunks/DIorvK89.js.br +0 -0
  190. package/build/client/_app/immutable/chunks/DIorvK89.js.gz +0 -0
  191. package/build/client/_app/immutable/chunks/DJNADPa5.js +1 -0
  192. package/build/client/_app/immutable/chunks/DJNADPa5.js.br +0 -0
  193. package/build/client/_app/immutable/chunks/DJNADPa5.js.gz +0 -0
  194. package/build/client/_app/immutable/chunks/DKK3Ytks.js +5 -0
  195. package/build/client/_app/immutable/chunks/DKK3Ytks.js.br +0 -0
  196. package/build/client/_app/immutable/chunks/DKK3Ytks.js.gz +0 -0
  197. package/build/client/_app/immutable/chunks/DKQe4Tss.js +1 -0
  198. package/build/client/_app/immutable/chunks/DKQe4Tss.js.br +0 -0
  199. package/build/client/_app/immutable/chunks/DKQe4Tss.js.gz +0 -0
  200. package/build/client/_app/immutable/chunks/DLEyUk0D.js +1 -0
  201. package/build/client/_app/immutable/chunks/DLEyUk0D.js.br +0 -0
  202. package/build/client/_app/immutable/chunks/DLEyUk0D.js.gz +0 -0
  203. package/build/client/_app/immutable/chunks/DNdCwnwU.js +62 -0
  204. package/build/client/_app/immutable/chunks/DNdCwnwU.js.br +0 -0
  205. package/build/client/_app/immutable/chunks/DNdCwnwU.js.gz +0 -0
  206. package/build/client/_app/immutable/chunks/DRD7W95q.js +1 -0
  207. package/build/client/_app/immutable/chunks/DRD7W95q.js.br +0 -0
  208. package/build/client/_app/immutable/chunks/DRD7W95q.js.gz +0 -0
  209. package/build/client/_app/immutable/chunks/DVBYW73Q.js +5 -0
  210. package/build/client/_app/immutable/chunks/DVBYW73Q.js.br +0 -0
  211. package/build/client/_app/immutable/chunks/DVBYW73Q.js.gz +0 -0
  212. package/build/client/_app/immutable/chunks/DVpJ_eyr.js +1 -0
  213. package/build/client/_app/immutable/chunks/DVpJ_eyr.js.br +0 -0
  214. package/build/client/_app/immutable/chunks/DVpJ_eyr.js.gz +0 -0
  215. package/build/client/_app/immutable/chunks/DYnl8SY7.js +2 -0
  216. package/build/client/_app/immutable/chunks/DYnl8SY7.js.br +0 -0
  217. package/build/client/_app/immutable/chunks/DYnl8SY7.js.gz +0 -0
  218. package/build/client/_app/immutable/chunks/DaJnYk4A.js +3 -0
  219. package/build/client/_app/immutable/chunks/DaJnYk4A.js.br +0 -0
  220. package/build/client/_app/immutable/chunks/DaJnYk4A.js.gz +0 -0
  221. package/build/client/_app/immutable/chunks/De0cNRkf.js +1 -0
  222. package/build/client/_app/immutable/chunks/De0cNRkf.js.br +0 -0
  223. package/build/client/_app/immutable/chunks/De0cNRkf.js.gz +0 -0
  224. package/build/client/_app/immutable/chunks/Do0sdwXq.js +1 -0
  225. package/build/client/_app/immutable/chunks/Do0sdwXq.js.br +0 -0
  226. package/build/client/_app/immutable/chunks/Do0sdwXq.js.gz +0 -0
  227. package/build/client/_app/immutable/chunks/Dpw0f7ug.js +1 -0
  228. package/build/client/_app/immutable/chunks/Dpw0f7ug.js.br +2 -0
  229. package/build/client/_app/immutable/chunks/Dpw0f7ug.js.gz +0 -0
  230. package/build/client/_app/immutable/chunks/DrHik0xm.js +4 -0
  231. package/build/client/_app/immutable/chunks/DrHik0xm.js.br +0 -0
  232. package/build/client/_app/immutable/chunks/DrHik0xm.js.gz +0 -0
  233. package/build/client/_app/immutable/chunks/DwsTz5RI.js +1 -0
  234. package/build/client/_app/immutable/chunks/DwsTz5RI.js.br +0 -0
  235. package/build/client/_app/immutable/chunks/DwsTz5RI.js.gz +0 -0
  236. package/build/client/_app/immutable/chunks/Dwy0VzV-.js +1 -0
  237. package/build/client/_app/immutable/chunks/Dwy0VzV-.js.br +0 -0
  238. package/build/client/_app/immutable/chunks/Dwy0VzV-.js.gz +0 -0
  239. package/build/client/_app/immutable/chunks/FngjHabD.js +1 -0
  240. package/build/client/_app/immutable/chunks/FngjHabD.js.br +0 -0
  241. package/build/client/_app/immutable/chunks/FngjHabD.js.gz +0 -0
  242. package/build/client/_app/immutable/chunks/HRKf5gNi.js +1 -0
  243. package/build/client/_app/immutable/chunks/HRKf5gNi.js.br +0 -0
  244. package/build/client/_app/immutable/chunks/HRKf5gNi.js.gz +0 -0
  245. package/build/client/_app/immutable/chunks/Lgjk9zvZ.js +1 -0
  246. package/build/client/_app/immutable/chunks/Lgjk9zvZ.js.br +0 -0
  247. package/build/client/_app/immutable/chunks/Lgjk9zvZ.js.gz +0 -0
  248. package/build/client/_app/immutable/chunks/NuPgyWGU.js +1 -0
  249. package/build/client/_app/immutable/chunks/NuPgyWGU.js.br +0 -0
  250. package/build/client/_app/immutable/chunks/NuPgyWGU.js.gz +0 -0
  251. package/build/client/_app/immutable/chunks/PFaZuA9u.js +1 -0
  252. package/build/client/_app/immutable/chunks/PFaZuA9u.js.br +0 -0
  253. package/build/client/_app/immutable/chunks/PFaZuA9u.js.gz +0 -0
  254. package/build/client/_app/immutable/chunks/RMavvDTm.js +1 -0
  255. package/build/client/_app/immutable/chunks/RMavvDTm.js.br +0 -0
  256. package/build/client/_app/immutable/chunks/RMavvDTm.js.gz +0 -0
  257. package/build/client/_app/immutable/chunks/ZaiibzMt.js +6 -0
  258. package/build/client/_app/immutable/chunks/ZaiibzMt.js.br +0 -0
  259. package/build/client/_app/immutable/chunks/ZaiibzMt.js.gz +0 -0
  260. package/build/client/_app/immutable/chunks/bK8qeGyY.js +1 -0
  261. package/build/client/_app/immutable/chunks/bK8qeGyY.js.br +0 -0
  262. package/build/client/_app/immutable/chunks/bK8qeGyY.js.gz +0 -0
  263. package/build/client/_app/immutable/chunks/cAfuCUf-.js +1 -0
  264. package/build/client/_app/immutable/chunks/cAfuCUf-.js.br +0 -0
  265. package/build/client/_app/immutable/chunks/cAfuCUf-.js.gz +0 -0
  266. package/build/client/_app/immutable/chunks/eCEdyNo9.js +1 -0
  267. package/build/client/_app/immutable/chunks/eCEdyNo9.js.br +0 -0
  268. package/build/client/_app/immutable/chunks/eCEdyNo9.js.gz +0 -0
  269. package/build/client/_app/immutable/chunks/hxhxtxcx.js +1 -0
  270. package/build/client/_app/immutable/chunks/hxhxtxcx.js.br +0 -0
  271. package/build/client/_app/immutable/chunks/hxhxtxcx.js.gz +0 -0
  272. package/build/client/_app/immutable/chunks/iGDeWXtR.js +6 -0
  273. package/build/client/_app/immutable/chunks/iGDeWXtR.js.br +0 -0
  274. package/build/client/_app/immutable/chunks/iGDeWXtR.js.gz +0 -0
  275. package/build/client/_app/immutable/chunks/j64anhl0.js +1 -0
  276. package/build/client/_app/immutable/chunks/j64anhl0.js.br +0 -0
  277. package/build/client/_app/immutable/chunks/j64anhl0.js.gz +0 -0
  278. package/build/client/_app/immutable/chunks/lqt3PSz0.js +1 -0
  279. package/build/client/_app/immutable/chunks/lqt3PSz0.js.br +0 -0
  280. package/build/client/_app/immutable/chunks/lqt3PSz0.js.gz +0 -0
  281. package/build/client/_app/immutable/chunks/nOIbjKpZ.js +1 -0
  282. package/build/client/_app/immutable/chunks/nOIbjKpZ.js.br +0 -0
  283. package/build/client/_app/immutable/chunks/nOIbjKpZ.js.gz +0 -0
  284. package/build/client/_app/immutable/chunks/qTZ8qQLi.js +1 -0
  285. package/build/client/_app/immutable/chunks/qTZ8qQLi.js.br +0 -0
  286. package/build/client/_app/immutable/chunks/qTZ8qQLi.js.gz +0 -0
  287. package/build/client/_app/immutable/chunks/wob-Hxeu.js +1 -0
  288. package/build/client/_app/immutable/chunks/wob-Hxeu.js.br +0 -0
  289. package/build/client/_app/immutable/chunks/wob-Hxeu.js.gz +0 -0
  290. package/build/client/_app/immutable/entry/app.CZVAY_oj.js +2 -0
  291. package/build/client/_app/immutable/entry/app.CZVAY_oj.js.br +0 -0
  292. package/build/client/_app/immutable/entry/app.CZVAY_oj.js.gz +0 -0
  293. package/build/client/_app/immutable/entry/start.rMI4vKXS.js +1 -0
  294. package/build/client/_app/immutable/entry/start.rMI4vKXS.js.br +0 -0
  295. package/build/client/_app/immutable/entry/start.rMI4vKXS.js.gz +0 -0
  296. package/build/client/_app/immutable/nodes/0.CQmuD1Zv.js +8 -0
  297. package/build/client/_app/immutable/nodes/0.CQmuD1Zv.js.br +0 -0
  298. package/build/client/_app/immutable/nodes/0.CQmuD1Zv.js.gz +0 -0
  299. package/build/client/_app/immutable/nodes/1.DdpgO7Ka.js +1 -0
  300. package/build/client/_app/immutable/nodes/1.DdpgO7Ka.js.br +0 -0
  301. package/build/client/_app/immutable/nodes/1.DdpgO7Ka.js.gz +0 -0
  302. package/build/client/_app/immutable/nodes/10.DJUD8eVq.js +3 -0
  303. package/build/client/_app/immutable/nodes/10.DJUD8eVq.js.br +0 -0
  304. package/build/client/_app/immutable/nodes/10.DJUD8eVq.js.gz +0 -0
  305. package/build/client/_app/immutable/nodes/11.DKFA_o9V.js +1 -0
  306. package/build/client/_app/immutable/nodes/11.DKFA_o9V.js.br +0 -0
  307. package/build/client/_app/immutable/nodes/11.DKFA_o9V.js.gz +0 -0
  308. package/build/client/_app/immutable/nodes/12.CTM_OTV_.js +14 -0
  309. package/build/client/_app/immutable/nodes/12.CTM_OTV_.js.br +0 -0
  310. package/build/client/_app/immutable/nodes/12.CTM_OTV_.js.gz +0 -0
  311. package/build/client/_app/immutable/nodes/13.Krih4WLD.js +150 -0
  312. package/build/client/_app/immutable/nodes/13.Krih4WLD.js.br +0 -0
  313. package/build/client/_app/immutable/nodes/13.Krih4WLD.js.gz +0 -0
  314. package/build/client/_app/immutable/nodes/14.B7r3723N.js +4 -0
  315. package/build/client/_app/immutable/nodes/14.B7r3723N.js.br +0 -0
  316. package/build/client/_app/immutable/nodes/14.B7r3723N.js.gz +0 -0
  317. package/build/client/_app/immutable/nodes/16.BY8GismA.js +9 -0
  318. package/build/client/_app/immutable/nodes/16.BY8GismA.js.br +0 -0
  319. package/build/client/_app/immutable/nodes/16.BY8GismA.js.gz +0 -0
  320. package/build/client/_app/immutable/nodes/17.B69G_kwu.js +11 -0
  321. package/build/client/_app/immutable/nodes/17.B69G_kwu.js.br +0 -0
  322. package/build/client/_app/immutable/nodes/17.B69G_kwu.js.gz +0 -0
  323. package/build/client/_app/immutable/nodes/18.CjWRF7kX.js +6 -0
  324. package/build/client/_app/immutable/nodes/18.CjWRF7kX.js.br +0 -0
  325. package/build/client/_app/immutable/nodes/18.CjWRF7kX.js.gz +0 -0
  326. package/build/client/_app/immutable/nodes/19.CkRDiGpy.js +2 -0
  327. package/build/client/_app/immutable/nodes/19.CkRDiGpy.js.br +0 -0
  328. package/build/client/_app/immutable/nodes/19.CkRDiGpy.js.gz +0 -0
  329. package/build/client/_app/immutable/nodes/2.BUlKFUC-.js +27 -0
  330. package/build/client/_app/immutable/nodes/2.BUlKFUC-.js.br +0 -0
  331. package/build/client/_app/immutable/nodes/2.BUlKFUC-.js.gz +0 -0
  332. package/build/client/_app/immutable/nodes/20.FUFWu3Qe.js +4 -0
  333. package/build/client/_app/immutable/nodes/20.FUFWu3Qe.js.br +0 -0
  334. package/build/client/_app/immutable/nodes/20.FUFWu3Qe.js.gz +0 -0
  335. package/build/client/_app/immutable/nodes/21.BamctJ47.js +12 -0
  336. package/build/client/_app/immutable/nodes/21.BamctJ47.js.br +0 -0
  337. package/build/client/_app/immutable/nodes/21.BamctJ47.js.gz +0 -0
  338. package/build/client/_app/immutable/nodes/22.NWBur8bJ.js +4 -0
  339. package/build/client/_app/immutable/nodes/22.NWBur8bJ.js.br +0 -0
  340. package/build/client/_app/immutable/nodes/22.NWBur8bJ.js.gz +0 -0
  341. package/build/client/_app/immutable/nodes/23.DhTZj0my.js +1 -0
  342. package/build/client/_app/immutable/nodes/23.DhTZj0my.js.br +0 -0
  343. package/build/client/_app/immutable/nodes/23.DhTZj0my.js.gz +0 -0
  344. package/build/client/_app/immutable/nodes/24.BoP3zfB0.js +6 -0
  345. package/build/client/_app/immutable/nodes/24.BoP3zfB0.js.br +0 -0
  346. package/build/client/_app/immutable/nodes/24.BoP3zfB0.js.gz +0 -0
  347. package/build/client/_app/immutable/nodes/3.1G4EIrSs.js +5 -0
  348. package/build/client/_app/immutable/nodes/3.1G4EIrSs.js.br +0 -0
  349. package/build/client/_app/immutable/nodes/3.1G4EIrSs.js.gz +0 -0
  350. package/build/client/_app/immutable/nodes/4.DdtsG66Q.js +1 -0
  351. package/build/client/_app/immutable/nodes/4.DdtsG66Q.js.br +0 -0
  352. package/build/client/_app/immutable/nodes/4.DdtsG66Q.js.gz +0 -0
  353. package/build/client/_app/immutable/nodes/5.DyccoAxy.js +2 -0
  354. package/build/client/_app/immutable/nodes/5.DyccoAxy.js.br +0 -0
  355. package/build/client/_app/immutable/nodes/5.DyccoAxy.js.gz +0 -0
  356. package/build/client/_app/immutable/nodes/6.DVqnmOqx.js +7 -0
  357. package/build/client/_app/immutable/nodes/6.DVqnmOqx.js.br +0 -0
  358. package/build/client/_app/immutable/nodes/6.DVqnmOqx.js.gz +0 -0
  359. package/build/client/_app/immutable/nodes/7.E71a9WIZ.js +5 -0
  360. package/build/client/_app/immutable/nodes/7.E71a9WIZ.js.br +0 -0
  361. package/build/client/_app/immutable/nodes/7.E71a9WIZ.js.gz +0 -0
  362. package/build/client/_app/immutable/nodes/9.FCHGbUMu.js +1 -0
  363. package/build/client/_app/immutable/nodes/9.FCHGbUMu.js.br +0 -0
  364. package/build/client/_app/immutable/nodes/9.FCHGbUMu.js.gz +0 -0
  365. package/build/client/_app/version.json +1 -1
  366. package/build/client/_app/version.json.br +0 -0
  367. package/build/client/_app/version.json.gz +0 -0
  368. package/build/handler.js +6 -6
  369. package/build/index.js +6 -6
  370. package/build/server/chunks/chunks/DecisionCard.js-cpsCwUqQ.js +1527 -0
  371. package/build/server/chunks/chunks/DocSheet.js-DjbE7UvD.js +50 -0
  372. package/build/server/chunks/chunks/EtaLine.js-VQ3hGVe_.js +98 -0
  373. package/build/server/chunks/chunks/EveryProjectSwitch.js-qyiXe4b6.js +160 -0
  374. package/build/server/chunks/chunks/Icon.js-jn6AqrcV.js +129 -0
  375. package/build/server/chunks/chunks/InsightsNav.js-lLDiX0XL.js +18 -0
  376. package/build/server/chunks/chunks/InstallFromGitHub.js-C9yJRBNR.js +1271 -0
  377. package/build/server/chunks/chunks/InstallPlugin.js-DgwSKRe6.js +18 -0
  378. package/build/server/chunks/chunks/LinkedText.js-DX5TcH8Y.js +24 -0
  379. package/build/server/chunks/chunks/MateHealthPill.js-DaPIp_mR.js +22 -0
  380. package/build/server/chunks/chunks/MicButton.svelte_svelte_type_style_lang.js-DLtwjooT.js +168 -0
  381. package/build/server/chunks/chunks/ProjectBanner.js-BJPTsURg.js +111 -0
  382. package/build/server/chunks/chunks/ProjectStateMark.js-DPFiZGmv.js +41 -0
  383. package/build/server/chunks/chunks/QuestionList.js-Bd_b28D3.js +187 -0
  384. package/build/server/chunks/chunks/ResizableRail.js-Do0DGmgJ.js +90 -0
  385. package/build/server/chunks/chunks/SettingsNav.js-jQQyTrJy.js +24 -0
  386. package/build/server/chunks/chunks/SlotContent.js-B1Er92ZM.js +701 -0
  387. package/build/server/chunks/chunks/Switch.js-BhybKefp.js +66 -0
  388. package/build/server/chunks/chunks/TimeBar.js-CLjHuPqO.js +32 -0
  389. package/build/server/chunks/chunks/TimeLegend.js-BjY2v8B-.js +29 -0
  390. package/build/server/chunks/chunks/WhereBadge.js-CRKBExDi.js +117 -0
  391. package/build/server/chunks/chunks/addresses.js-DmMJzvLK.js +52 -0
  392. package/build/server/chunks/chunks/aliases.svelte.js-B_fcvoi7.js +138 -0
  393. package/build/server/chunks/chunks/arrow-down.js-Ci4S_D7b.js +18 -0
  394. package/build/server/chunks/chunks/arrow-left.js-Cg_-lrc-.js +18 -0
  395. package/build/server/chunks/chunks/arrow-right.js-CxUHlP9f.js +18 -0
  396. package/build/server/chunks/chunks/arrow-up-right.js-N7FEdMTQ.js +18 -0
  397. package/build/server/chunks/chunks/arrow-up.js-PmeZF98V.js +18 -0
  398. package/build/server/chunks/chunks/berths.js-B282QffH.js +270 -0
  399. package/build/server/chunks/chunks/book-open.js-CNW88M_l.js +23 -0
  400. package/build/server/chunks/chunks/bridge.js-C93awzgB.js +3816 -0
  401. package/build/server/chunks/chunks/brief.js-DyAlUufG.js +152 -0
  402. package/build/server/chunks/chunks/buildlog.js-BCKtSKOt.js +55 -0
  403. package/build/server/chunks/chunks/button.js-BHe5gXSS.js +4027 -0
  404. package/build/server/chunks/chunks/chat.svelte.js-D0GIrFIC.js +744 -0
  405. package/build/server/chunks/chunks/check.js-4JbwdHsv.js +15 -0
  406. package/build/server/chunks/chunks/checks.js-DGdGhp1G.js +258 -0
  407. package/build/server/chunks/chunks/chevron-down.js-DmTyzEbB.js +15 -0
  408. package/build/server/chunks/chunks/chevron-left.js-VvIqRgu-.js +15 -0
  409. package/build/server/chunks/chunks/chevron-right.js-B9uO-JHb.js +15 -0
  410. package/build/server/chunks/chunks/circle-alert.js-BFRVFclW.js +23 -0
  411. package/build/server/chunks/chunks/circle-arrow-up.js-DKZNxUNH.js +20 -0
  412. package/build/server/chunks/chunks/circle-check.js-Dvfipbd4.js +19 -0
  413. package/build/server/chunks/chunks/circle-dashed.js-YHwLNBch.js +24 -0
  414. package/build/server/chunks/chunks/circle-dot.js-Ch-n2Rlg.js +18 -0
  415. package/build/server/chunks/chunks/client.js-CB4UPOdE.js +24 -0
  416. package/build/server/chunks/chunks/clock.js-B3IMuOfM.js +18 -0
  417. package/build/server/chunks/chunks/cloud.js-Cpm1aqak.js +29 -0
  418. package/build/server/chunks/chunks/config.js-E2-TrXNJ.js +185 -0
  419. package/build/server/chunks/chunks/copy.js-73MxeEL2.js +33 -0
  420. package/build/server/chunks/chunks/detail.js-CVM_vUy5.js +146 -0
  421. package/build/server/chunks/chunks/external-link.js-WNZYonko.js +24 -0
  422. package/build/server/chunks/chunks/eye.js-8rR2rjfO.js +23 -0
  423. package/build/server/chunks/chunks/feedback.js-CulH4qzJ.js +67 -0
  424. package/build/server/chunks/chunks/format.js-D3lWEg6U.js +70 -0
  425. package/build/server/chunks/chunks/git-pull-request.js-BQ2omkf6.js +20 -0
  426. package/build/server/chunks/chunks/hand.js-DiJeXYrq.js +25 -0
  427. package/build/server/chunks/chunks/index-server.js-VQAqdywx.js +17 -0
  428. package/build/server/chunks/chunks/index.js-jKxghqQY.js +1524 -0
  429. package/build/server/chunks/chunks/index2.js-BKxRGjDB.js +46 -0
  430. package/build/server/chunks/chunks/internal.js-w6vkkwRD.js +146 -0
  431. package/build/server/chunks/chunks/keychain.js-BqzLDz60.js +51 -0
  432. package/build/server/chunks/chunks/live.svelte.js-Djgmj46r.js +241 -0
  433. package/build/server/chunks/chunks/loader-circle.js-CJDbB9eu.js +16 -0
  434. package/build/server/chunks/chunks/local.js-BRE2JcCw.js +321 -0
  435. package/build/server/chunks/chunks/lock.js-WFfZ7A2H.js +48 -0
  436. package/build/server/chunks/chunks/markdown.js-BpxlEiHu.js +2656 -0
  437. package/build/server/chunks/chunks/message-square.js-Dm6R7CNs.js +22 -0
  438. package/build/server/chunks/chunks/messages-square.js-CVp0zrku.js +47 -0
  439. package/build/server/chunks/chunks/minus.js-BM2anquT.js +15 -0
  440. package/build/server/chunks/chunks/plus.js-DXxrgEhj.js +15 -0
  441. package/build/server/chunks/chunks/previewhelper2.js-C84SWZwf.js +165 -0
  442. package/build/server/chunks/chunks/previewnote.js-DB6VK2fp.js +56 -0
  443. package/build/server/chunks/chunks/pullrequests.js-CCzk2sqm.js +12 -0
  444. package/build/server/chunks/chunks/refresh-cw.js-RN9HWdUi.js +26 -0
  445. package/build/server/chunks/chunks/remote.js-HXu5FbWd.js +12 -0
  446. package/build/server/chunks/chunks/repo.js-U-HvnI1L.js +33 -0
  447. package/build/server/chunks/chunks/root.js-B4TT3ryq.js +3105 -0
  448. package/build/server/chunks/chunks/rotate-cw.js-CFMEeLFy.js +21 -0
  449. package/build/server/chunks/chunks/runtime.js-C9_vMeNI.js +17834 -0
  450. package/build/server/chunks/chunks/scale.js-BtckAplV.js +21 -0
  451. package/build/server/chunks/chunks/scroll-lock.js-KJygphA1.js +2776 -0
  452. package/build/server/chunks/chunks/service.js-B1hdOaDN.js +917 -0
  453. package/build/server/chunks/chunks/service2.js-BTWa2jZr.js +996 -0
  454. package/build/server/chunks/chunks/settings.js-DPuzmbc5.js +694 -0
  455. package/build/server/chunks/chunks/shield-check.js-B6kC206T.js +23 -0
  456. package/build/server/chunks/chunks/ship.js-qXRIImyl.js +31 -0
  457. package/build/server/chunks/chunks/sparkles.js-BBC6X28O.js +26 -0
  458. package/build/server/chunks/chunks/square-terminal.js-CH-qdAR-.js +30 -0
  459. package/build/server/chunks/chunks/terminal.js-BckfZrAP.js +71 -0
  460. package/build/server/chunks/chunks/tone.js-Dxsl-adt.js +31 -0
  461. package/build/server/chunks/chunks/triangle-alert.js-CT6ph0Pz.js +25 -0
  462. package/build/server/chunks/chunks/urls.js-CM6aklCF.js +8 -0
  463. package/build/server/chunks/chunks/utils3.js-BzaceEcr.js +3290 -0
  464. package/build/server/chunks/chunks/vault.js-DZFWbeCU.js +162 -0
  465. package/build/server/chunks/chunks/view.js-D-j8Xe4i.js +76 -0
  466. package/build/server/chunks/chunks/words.js-DoCiNU5f.js +53 -0
  467. package/build/server/chunks/chunks/x.js-Dui6bz7r.js +18 -0
  468. package/build/server/chunks/entries/endpoints/api/apps/_op_/_server.ts.js-ClWDeX-O.js +96 -0
  469. package/build/server/chunks/entries/endpoints/api/cloud/_server.ts.js-D0ZxlpyT.js +100 -0
  470. package/build/server/chunks/entries/endpoints/api/cloud/previews/_server.ts.js-CzR9HxUz.js +43 -0
  471. package/build/server/chunks/entries/endpoints/api/events/_server.ts.js-D6Von-oI.js +106 -0
  472. package/build/server/chunks/entries/endpoints/api/files/_server.ts.js-BBeioKBD.js +55 -0
  473. package/build/server/chunks/entries/endpoints/api/firstmate/chat/_server.ts.js-8YXmzsbj.js +89 -0
  474. package/build/server/chunks/entries/endpoints/api/firstmate/commands/_server.ts.js-IcMxnWTH.js +125 -0
  475. package/build/server/chunks/entries/endpoints/api/firstmate/dismiss/_server.ts.js-BX86Nv_f.js +51 -0
  476. package/build/server/chunks/entries/endpoints/api/firstmate/input/_server.ts.js-CwCZaVxq.js +57 -0
  477. package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/_server.ts.js-DAIjFBQ6.js +50 -0
  478. package/build/server/chunks/entries/endpoints/api/firstmate/messages/_server.ts.js-Bp0i1TSf.js +97 -0
  479. package/build/server/chunks/entries/endpoints/api/firstmate/pick/_server.ts.js-x-ZN1v8u.js +60 -0
  480. package/build/server/chunks/entries/endpoints/api/firstmate/reactions/_server.ts.js-CrhejJqg.js +71 -0
  481. package/build/server/chunks/entries/endpoints/api/firstmate/start/_server.ts.js-DARrnWLV.js +50 -0
  482. package/build/server/chunks/entries/endpoints/api/fleet/_server.ts.js-C21482Qj.js +42 -0
  483. package/build/server/chunks/entries/endpoints/api/gateway/_server.ts.js-AZBAjFk5.js +106 -0
  484. package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-K5a5fYS2.js +42 -0
  485. package/build/server/chunks/entries/endpoints/api/inbox/_server.ts.js-2p7O3IsC.js +66 -0
  486. package/build/server/chunks/entries/endpoints/api/inbox/report/_server.ts.js-C4Nf9iAq.js +57 -0
  487. package/build/server/chunks/entries/endpoints/api/insights/_server.ts.js-DxO2RM1h.js +42 -0
  488. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/config/_server.ts.js-Ba_r2yZV.js +77 -0
  489. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/_server.ts.js-B-zbKKZl.js +66 -0
  490. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/summary/_server.ts.js-BP5jKHJd.js +61 -0
  491. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/icon/_icon_/_server.ts.js-DCoeTXfs.js +58 -0
  492. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/load/_server.ts.js-DNAX_6do.js +25 -0
  493. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/ui/_...path_/_server.ts.js-BA9kzCW7.js +65 -0
  494. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/update/_server.ts.js-_FRBb9ud.js +37 -0
  495. package/build/server/chunks/entries/endpoints/api/plugins/_server.ts.js-DXS9KEsU.js +42 -0
  496. package/build/server/chunks/entries/endpoints/api/plugins/inspect/_server.ts.js-DkkLcUAV.js +37 -0
  497. package/build/server/chunks/entries/endpoints/api/plugins/install/_server.ts.js-Di2Gi4nB.js +40 -0
  498. package/build/server/chunks/entries/endpoints/api/plugins/updates/_server.ts.js-CCW9lm9E.js +25 -0
  499. package/build/server/chunks/entries/endpoints/api/previews/check/_server.ts.js-BFJ5KbW7.js +65 -0
  500. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/_server.ts.js-kTs2YfQY.js +47 -0
  501. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/_server.ts.js-CdfrIT07.js +56 -0
  502. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/_server.ts.js-BsUrjHJ8.js +68 -0
  503. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/_server.ts.js-DXJ8AJ2U.js +55 -0
  504. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/file/_server.ts.js-CcNKahjE.js +78 -0
  505. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/_server.ts.js-68i_0avS.js +61 -0
  506. package/build/server/chunks/entries/endpoints/api/second-mates/_id_/peek/_server.ts.js-CiOf-mL2.js +51 -0
  507. package/build/server/chunks/entries/endpoints/api/services/_server.ts.js-DQQCFyv7.js +61 -0
  508. package/build/server/chunks/entries/endpoints/api/setup/_server.ts.js-VJjaPDdY.js +100 -0
  509. package/build/server/chunks/entries/endpoints/api/slots/_server.ts.js-CR4Gcf9_.js +50 -0
  510. package/build/server/chunks/entries/endpoints/api/tasks/_id_/_server.ts.js-DltGIE9L.js +47 -0
  511. package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/_server.ts.js-BDd9G5oE.js +66 -0
  512. package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/_server.ts.js-pMEofVTc.js +59 -0
  513. package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/_server.ts.js-DO_4lX74.js +107 -0
  514. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/_server.ts.js-BQoQsU0p.js +61 -0
  515. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/helper/_server.ts.js-DDYoFcHJ.js +64 -0
  516. package/build/server/chunks/entries/endpoints/api/vault/_server.ts.js-Zg58kzoY.js +68 -0
  517. package/build/server/chunks/entries/endpoints/api/wheelhouse/update/_server.ts.js-B5gS-34U.js +25 -0
  518. package/build/server/chunks/entries/endpoints/api/wheelhouse/upgrade/_server.ts.js-7p-utTq-.js +25 -0
  519. package/build/server/chunks/entries/endpoints/tasks/_id_/review/_server.ts.js-q1B59Uk1.js +46 -0
  520. package/build/server/chunks/entries/fallbacks/error.svelte.js-BNWK_exe.js +15 -0
  521. package/build/server/chunks/entries/hooks.server.js-CWn0ng54.js +79 -0
  522. package/build/server/chunks/entries/pages/_layout.server.ts.js-BKXSrpSe.js +27 -0
  523. package/build/server/chunks/entries/pages/_layout.svelte.js-BuXMMFDC.js +5454 -0
  524. package/build/server/chunks/entries/pages/_page.server.ts.js-BRGNF6k_.js +16 -0
  525. package/build/server/chunks/entries/pages/_page.svelte.js-AsmQz_JL.js +3907 -0
  526. package/build/server/chunks/entries/pages/decisions/_page.server.ts.js-DmvdMfYo.js +11 -0
  527. package/build/server/chunks/entries/pages/decisions/_page.svelte.js-C-af49k8.js +202 -0
  528. package/build/server/chunks/entries/pages/files/_page.server.ts.js-rZt0XMSd.js +17 -0
  529. package/build/server/chunks/entries/pages/files/_page.svelte.js-_L04ewQE.js +60 -0
  530. package/build/server/chunks/entries/pages/harbour/_page.server.ts.js-PFo8Vfbo.js +46 -0
  531. package/build/server/chunks/entries/pages/harbour/_page.svelte.js-CVRdIgJ8.js +750 -0
  532. package/build/server/chunks/entries/pages/headroom/_page.server.ts.js-DutA9E7E.js +11 -0
  533. package/build/server/chunks/entries/pages/headroom/_page.svelte.js-DsoPeyml.js +183 -0
  534. package/build/server/chunks/entries/pages/inbox/_page.server.ts.js-DqWEpFI-.js +11 -0
  535. package/build/server/chunks/entries/pages/inbox/_page.svelte.js-B6UvwR4D.js +187 -0
  536. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.server.ts.js-BK7K-Ceh.js +16 -0
  537. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.svelte.js-DWyawMgs.js +56 -0
  538. package/build/server/chunks/entries/pages/projects/_id_/_page.server.ts.js-BtFm_m-G.js +23 -0
  539. package/build/server/chunks/entries/pages/projects/_id_/_page.svelte.js-BysaJZTm.js +981 -0
  540. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.server.ts.js-DKFJY-r0.js +21 -0
  541. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.svelte.js-Cxjvoa4A.js +78 -0
  542. package/build/server/chunks/entries/pages/projects/_id_/passage/_page.server.ts.js-DMJBBYoR.js +27 -0
  543. package/build/server/chunks/entries/pages/projects/_id_/passage/_page.svelte.js-Dcp2JU41.js +419 -0
  544. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.server.ts.js-CUct6yy5.js +15 -0
  545. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.svelte.js-BX-QnnUD.js +1881 -0
  546. package/build/server/chunks/entries/pages/second-mates/_page.svelte.js-WE0an3Bj.js +221 -0
  547. package/build/server/chunks/entries/pages/settings/cloud/_page.server.ts.js-CamoAZbV.js +14 -0
  548. package/build/server/chunks/entries/pages/settings/cloud/_page.svelte.js-DZArF-9x.js +220 -0
  549. package/build/server/chunks/entries/pages/settings/gateway/_page.server.ts.js-rXRKJGmI.js +11 -0
  550. package/build/server/chunks/entries/pages/settings/gateway/_page.svelte.js-BDe-2GRf.js +209 -0
  551. package/build/server/chunks/entries/pages/settings/plugins/_page.server.ts.js-rtpQsgMF.js +19 -0
  552. package/build/server/chunks/entries/pages/settings/plugins/_page.svelte.js-DMusjNR_.js +611 -0
  553. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/_page.server.ts.js-BLXp3lDA.js +17 -0
  554. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/_page.svelte.js-DBMtln02.js +229 -0
  555. package/build/server/chunks/entries/pages/settings/setup/_page.server.ts.js-CbjFRPVY.js +11 -0
  556. package/build/server/chunks/entries/pages/settings/setup/_page.svelte.js-ABeTOB0c.js +55 -0
  557. package/build/server/chunks/entries/pages/setup/_page.server.ts.js-wdyYV3qf.js +18 -0
  558. package/build/server/chunks/entries/pages/setup/_page.svelte.js-7M9RVZo5.js +917 -0
  559. package/build/server/chunks/entries/pages/tasks/_id_/_page.server.ts.js-BBftBg-k.js +25 -0
  560. package/build/server/chunks/entries/pages/tasks/_id_/_page.svelte.js-Dy9JaYCa.js +2751 -0
  561. package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.server.ts.js-BScwvgVc.js +24 -0
  562. package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.svelte.js-D0yTdBar.js +79 -0
  563. package/build/server/chunks/entries/pages/time/_page.server.ts.js-CYvux-3H.js +11 -0
  564. package/build/server/chunks/entries/pages/time/_page.svelte.js-CrEVYnzn.js +108 -0
  565. package/build/server/chunks/handler-F_cpDHNU.js +1474 -0
  566. package/build/server/chunks/index.js-BUHkADXw.js +4296 -0
  567. package/build/server/chunks/manifest.js-B8bCR5q6.js +603 -0
  568. package/build/server/chunks/nodes/0.js-Dowvt9F9.js +49 -0
  569. package/build/server/chunks/nodes/1.js-DF5Y9be5.js +9 -0
  570. package/build/server/chunks/nodes/10.js-dixIyGz8.js +49 -0
  571. package/build/server/chunks/nodes/11.js-CdZnnFi5.js +48 -0
  572. package/build/server/chunks/nodes/12.js-DvK5i9DI.js +49 -0
  573. package/build/server/chunks/nodes/13.js-BDecNWzn.js +48 -0
  574. package/build/server/chunks/nodes/14.js-B-DRrca8.js +9 -0
  575. package/build/server/chunks/nodes/16.js-BUpQAAcE.js +22 -0
  576. package/build/server/chunks/nodes/17.js-DSsio5sq.js +47 -0
  577. package/build/server/chunks/nodes/18.js-DUhWP1lx.js +47 -0
  578. package/build/server/chunks/nodes/19.js-DaHeHJsB.js +50 -0
  579. package/build/server/chunks/nodes/2.js-D8Wak2_d.js +47 -0
  580. package/build/server/chunks/nodes/20.js-C2I6HzZg.js +49 -0
  581. package/build/server/chunks/nodes/21.js-CjZTWpEa.js +51 -0
  582. package/build/server/chunks/nodes/22.js-BWtAFeRm.js +48 -0
  583. package/build/server/chunks/nodes/23.js-BxVguke7.js +48 -0
  584. package/build/server/chunks/nodes/24.js-BVvVkNwL.js +47 -0
  585. package/build/server/chunks/nodes/3.js-CZTW-LPi.js +47 -0
  586. package/build/server/chunks/nodes/4.js-BkH70LZu.js +47 -0
  587. package/build/server/chunks/nodes/5.js-B0Eb_9jQ.js +51 -0
  588. package/build/server/chunks/nodes/6.js-gEI0qySH.js +47 -0
  589. package/build/server/chunks/nodes/7.js-BXgRjdNB.js +47 -0
  590. package/build/server/chunks/nodes/9.js-jOBHnWP1.js +47 -0
  591. package/dist/cli.js +2081 -280
  592. package/dist/wh-vault.js +1 -1
  593. package/package.json +1 -1
  594. package/plugins/shared-review/.wheelhouse-plugin/plugin.json +2 -1
  595. package/plugins/shared-review/README.md +3 -1
  596. package/plugins/shared-review/wheelhouse/server/index.js +11 -2
  597. package/plugins/shared-review/wheelhouse/ui/index.js +278 -2
  598. package/plugins/vault/wheelhouse/icon.svg +1 -1
  599. package/build/client/_app/immutable/assets/0.CxNAeXUL.css +0 -1
  600. package/build/client/_app/immutable/assets/0.CxNAeXUL.css.br +0 -0
  601. package/build/client/_app/immutable/assets/0.CxNAeXUL.css.gz +0 -0
  602. package/build/client/_app/immutable/assets/2.DvyEOdRq.css +0 -1
  603. package/build/client/_app/immutable/assets/2.DvyEOdRq.css.br +0 -0
  604. package/build/client/_app/immutable/assets/2.DvyEOdRq.css.gz +0 -0
  605. package/build/client/_app/immutable/chunks/-8jzdSzV.js +0 -1
  606. package/build/client/_app/immutable/chunks/-8jzdSzV.js.br +0 -0
  607. package/build/client/_app/immutable/chunks/-8jzdSzV.js.gz +0 -0
  608. package/build/client/_app/immutable/chunks/1WRcPxqg.js +0 -1
  609. package/build/client/_app/immutable/chunks/1WRcPxqg.js.br +0 -0
  610. package/build/client/_app/immutable/chunks/1WRcPxqg.js.gz +0 -0
  611. package/build/client/_app/immutable/chunks/2u5U2sv5.js +0 -1
  612. package/build/client/_app/immutable/chunks/2u5U2sv5.js.br +0 -2
  613. package/build/client/_app/immutable/chunks/2u5U2sv5.js.gz +0 -0
  614. package/build/client/_app/immutable/chunks/4VJeJzd5.js +0 -1
  615. package/build/client/_app/immutable/chunks/4VJeJzd5.js.br +0 -0
  616. package/build/client/_app/immutable/chunks/4VJeJzd5.js.gz +0 -0
  617. package/build/client/_app/immutable/chunks/6x5fl0iw.js +0 -1
  618. package/build/client/_app/immutable/chunks/6x5fl0iw.js.br +0 -0
  619. package/build/client/_app/immutable/chunks/6x5fl0iw.js.gz +0 -0
  620. package/build/client/_app/immutable/chunks/6x9f8OOX.js +0 -1
  621. package/build/client/_app/immutable/chunks/6x9f8OOX.js.br +0 -0
  622. package/build/client/_app/immutable/chunks/6x9f8OOX.js.gz +0 -0
  623. package/build/client/_app/immutable/chunks/B2ctrXx5.js +0 -1
  624. package/build/client/_app/immutable/chunks/B2ctrXx5.js.br +0 -0
  625. package/build/client/_app/immutable/chunks/B2ctrXx5.js.gz +0 -0
  626. package/build/client/_app/immutable/chunks/B3j8X7eP.js +0 -1
  627. package/build/client/_app/immutable/chunks/B3j8X7eP.js.br +0 -0
  628. package/build/client/_app/immutable/chunks/B3j8X7eP.js.gz +0 -0
  629. package/build/client/_app/immutable/chunks/BBLx2oxZ.js +0 -2
  630. package/build/client/_app/immutable/chunks/BBLx2oxZ.js.br +0 -0
  631. package/build/client/_app/immutable/chunks/BBLx2oxZ.js.gz +0 -0
  632. package/build/client/_app/immutable/chunks/BBWR4qW2.js +0 -1
  633. package/build/client/_app/immutable/chunks/BBWR4qW2.js.br +0 -0
  634. package/build/client/_app/immutable/chunks/BBWR4qW2.js.gz +0 -0
  635. package/build/client/_app/immutable/chunks/BBk8ftHo.js +0 -1
  636. package/build/client/_app/immutable/chunks/BBk8ftHo.js.br +0 -0
  637. package/build/client/_app/immutable/chunks/BBk8ftHo.js.gz +0 -0
  638. package/build/client/_app/immutable/chunks/BHVTrNhR.js +0 -3
  639. package/build/client/_app/immutable/chunks/BHVTrNhR.js.br +0 -0
  640. package/build/client/_app/immutable/chunks/BHVTrNhR.js.gz +0 -0
  641. package/build/client/_app/immutable/chunks/BH_GqTtA.js +0 -1
  642. package/build/client/_app/immutable/chunks/BH_GqTtA.js.br +0 -0
  643. package/build/client/_app/immutable/chunks/BH_GqTtA.js.gz +0 -0
  644. package/build/client/_app/immutable/chunks/BHu5PcTV.js +0 -1
  645. package/build/client/_app/immutable/chunks/BHu5PcTV.js.br +0 -0
  646. package/build/client/_app/immutable/chunks/BHu5PcTV.js.gz +0 -0
  647. package/build/client/_app/immutable/chunks/BKSx-wDn.js +0 -1
  648. package/build/client/_app/immutable/chunks/BKSx-wDn.js.br +0 -0
  649. package/build/client/_app/immutable/chunks/BKSx-wDn.js.gz +0 -0
  650. package/build/client/_app/immutable/chunks/BOY9WARo.js +0 -2
  651. package/build/client/_app/immutable/chunks/BOY9WARo.js.br +0 -0
  652. package/build/client/_app/immutable/chunks/BOY9WARo.js.gz +0 -0
  653. package/build/client/_app/immutable/chunks/BQle5rwK.js +0 -1
  654. package/build/client/_app/immutable/chunks/BQle5rwK.js.br +0 -0
  655. package/build/client/_app/immutable/chunks/BQle5rwK.js.gz +0 -0
  656. package/build/client/_app/immutable/chunks/BRuDnHyc.js +0 -2
  657. package/build/client/_app/immutable/chunks/BRuDnHyc.js.br +0 -0
  658. package/build/client/_app/immutable/chunks/BRuDnHyc.js.gz +0 -0
  659. package/build/client/_app/immutable/chunks/BSMH3sl_.js +0 -1
  660. package/build/client/_app/immutable/chunks/BSMH3sl_.js.br +0 -0
  661. package/build/client/_app/immutable/chunks/BSMH3sl_.js.gz +0 -0
  662. package/build/client/_app/immutable/chunks/BV-FSL0u.js +0 -1
  663. package/build/client/_app/immutable/chunks/BV-FSL0u.js.br +0 -0
  664. package/build/client/_app/immutable/chunks/BV-FSL0u.js.gz +0 -0
  665. package/build/client/_app/immutable/chunks/BXF1nDhR.js +0 -1
  666. package/build/client/_app/immutable/chunks/BXF1nDhR.js.br +0 -0
  667. package/build/client/_app/immutable/chunks/BXF1nDhR.js.gz +0 -0
  668. package/build/client/_app/immutable/chunks/BbU5AsRD.js +0 -1
  669. package/build/client/_app/immutable/chunks/BbU5AsRD.js.br +0 -0
  670. package/build/client/_app/immutable/chunks/BbU5AsRD.js.gz +0 -0
  671. package/build/client/_app/immutable/chunks/BkoErw_r.js +0 -1
  672. package/build/client/_app/immutable/chunks/BkoErw_r.js.br +0 -0
  673. package/build/client/_app/immutable/chunks/BkoErw_r.js.gz +0 -0
  674. package/build/client/_app/immutable/chunks/Bl1tMgf8.js +0 -1
  675. package/build/client/_app/immutable/chunks/Bl1tMgf8.js.br +0 -0
  676. package/build/client/_app/immutable/chunks/Bl1tMgf8.js.gz +0 -0
  677. package/build/client/_app/immutable/chunks/Blj84s6L.js +0 -1
  678. package/build/client/_app/immutable/chunks/Blj84s6L.js.br +0 -0
  679. package/build/client/_app/immutable/chunks/Blj84s6L.js.gz +0 -0
  680. package/build/client/_app/immutable/chunks/Bo1SMwPt.js +0 -1
  681. package/build/client/_app/immutable/chunks/Bo1SMwPt.js.br +0 -0
  682. package/build/client/_app/immutable/chunks/Bo1SMwPt.js.gz +0 -0
  683. package/build/client/_app/immutable/chunks/BudxWdUe.js +0 -1
  684. package/build/client/_app/immutable/chunks/BudxWdUe.js.br +0 -0
  685. package/build/client/_app/immutable/chunks/BudxWdUe.js.gz +0 -0
  686. package/build/client/_app/immutable/chunks/BvCDG8Dd.js +0 -1
  687. package/build/client/_app/immutable/chunks/BvCDG8Dd.js.br +0 -0
  688. package/build/client/_app/immutable/chunks/BvCDG8Dd.js.gz +0 -0
  689. package/build/client/_app/immutable/chunks/BwLAIydi.js +0 -1
  690. package/build/client/_app/immutable/chunks/BwLAIydi.js.br +0 -0
  691. package/build/client/_app/immutable/chunks/BwLAIydi.js.gz +0 -0
  692. package/build/client/_app/immutable/chunks/Bxc9WZZR.js +0 -1
  693. package/build/client/_app/immutable/chunks/Bxc9WZZR.js.br +0 -0
  694. package/build/client/_app/immutable/chunks/Bxc9WZZR.js.gz +0 -0
  695. package/build/client/_app/immutable/chunks/Bxza7kFR.js +0 -1
  696. package/build/client/_app/immutable/chunks/Bxza7kFR.js.br +0 -0
  697. package/build/client/_app/immutable/chunks/Bxza7kFR.js.gz +0 -0
  698. package/build/client/_app/immutable/chunks/BzYzevxb.js +0 -1
  699. package/build/client/_app/immutable/chunks/BzYzevxb.js.br +0 -0
  700. package/build/client/_app/immutable/chunks/BzYzevxb.js.gz +0 -0
  701. package/build/client/_app/immutable/chunks/C03wrLr6.js +0 -1
  702. package/build/client/_app/immutable/chunks/C03wrLr6.js.br +0 -0
  703. package/build/client/_app/immutable/chunks/C03wrLr6.js.gz +0 -0
  704. package/build/client/_app/immutable/chunks/C0nIjZ3F.js +0 -1
  705. package/build/client/_app/immutable/chunks/C0nIjZ3F.js.br +0 -0
  706. package/build/client/_app/immutable/chunks/C0nIjZ3F.js.gz +0 -0
  707. package/build/client/_app/immutable/chunks/CDGwSysF.js +0 -1
  708. package/build/client/_app/immutable/chunks/CDGwSysF.js.br +0 -0
  709. package/build/client/_app/immutable/chunks/CDGwSysF.js.gz +0 -0
  710. package/build/client/_app/immutable/chunks/CEbzGOE-.js +0 -1
  711. package/build/client/_app/immutable/chunks/CEbzGOE-.js.br +0 -0
  712. package/build/client/_app/immutable/chunks/CEbzGOE-.js.gz +0 -0
  713. package/build/client/_app/immutable/chunks/CLeVtrv1.js +0 -1
  714. package/build/client/_app/immutable/chunks/CLeVtrv1.js.br +0 -3
  715. package/build/client/_app/immutable/chunks/CLeVtrv1.js.gz +0 -0
  716. package/build/client/_app/immutable/chunks/CLsVEPfB.js +0 -1
  717. package/build/client/_app/immutable/chunks/CLsVEPfB.js.br +0 -0
  718. package/build/client/_app/immutable/chunks/CLsVEPfB.js.gz +0 -0
  719. package/build/client/_app/immutable/chunks/CLubIfWE.js +0 -1
  720. package/build/client/_app/immutable/chunks/CLubIfWE.js.br +0 -0
  721. package/build/client/_app/immutable/chunks/CLubIfWE.js.gz +0 -0
  722. package/build/client/_app/immutable/chunks/CNcEb8rI.js +0 -1
  723. package/build/client/_app/immutable/chunks/CNcEb8rI.js.br +0 -0
  724. package/build/client/_app/immutable/chunks/CNcEb8rI.js.gz +0 -0
  725. package/build/client/_app/immutable/chunks/CaaP7Cfy.js +0 -1
  726. package/build/client/_app/immutable/chunks/CaaP7Cfy.js.br +0 -0
  727. package/build/client/_app/immutable/chunks/CaaP7Cfy.js.gz +0 -0
  728. package/build/client/_app/immutable/chunks/CbGZd9iT.js +0 -1
  729. package/build/client/_app/immutable/chunks/CbGZd9iT.js.br +0 -0
  730. package/build/client/_app/immutable/chunks/CbGZd9iT.js.gz +0 -0
  731. package/build/client/_app/immutable/chunks/Cbmz3nkf.js +0 -1
  732. package/build/client/_app/immutable/chunks/Cbmz3nkf.js.br +0 -2
  733. package/build/client/_app/immutable/chunks/Cbmz3nkf.js.gz +0 -0
  734. package/build/client/_app/immutable/chunks/CdUf0vBw.js +0 -1
  735. package/build/client/_app/immutable/chunks/CdUf0vBw.js.br +0 -0
  736. package/build/client/_app/immutable/chunks/CdUf0vBw.js.gz +0 -0
  737. package/build/client/_app/immutable/chunks/Ce7qVCDI.js +0 -1
  738. package/build/client/_app/immutable/chunks/Ce7qVCDI.js.br +0 -0
  739. package/build/client/_app/immutable/chunks/Ce7qVCDI.js.gz +0 -0
  740. package/build/client/_app/immutable/chunks/Cio5-ROX.js +0 -6
  741. package/build/client/_app/immutable/chunks/Cio5-ROX.js.br +0 -0
  742. package/build/client/_app/immutable/chunks/Cio5-ROX.js.gz +0 -0
  743. package/build/client/_app/immutable/chunks/CrPP6AgN.js +0 -1
  744. package/build/client/_app/immutable/chunks/CrPP6AgN.js.br +0 -0
  745. package/build/client/_app/immutable/chunks/CrPP6AgN.js.gz +0 -0
  746. package/build/client/_app/immutable/chunks/CyhrvZ9i.js +0 -1
  747. package/build/client/_app/immutable/chunks/CyhrvZ9i.js.br +0 -0
  748. package/build/client/_app/immutable/chunks/CyhrvZ9i.js.gz +0 -0
  749. package/build/client/_app/immutable/chunks/D1pI6A8q.js +0 -1
  750. package/build/client/_app/immutable/chunks/D1pI6A8q.js.br +0 -0
  751. package/build/client/_app/immutable/chunks/D1pI6A8q.js.gz +0 -0
  752. package/build/client/_app/immutable/chunks/D6hXuNzR.js +0 -1
  753. package/build/client/_app/immutable/chunks/D6hXuNzR.js.br +0 -1
  754. package/build/client/_app/immutable/chunks/D6hXuNzR.js.gz +0 -0
  755. package/build/client/_app/immutable/chunks/D8Hr8rhb.js +0 -1
  756. package/build/client/_app/immutable/chunks/D8Hr8rhb.js.br +0 -0
  757. package/build/client/_app/immutable/chunks/D8Hr8rhb.js.gz +0 -0
  758. package/build/client/_app/immutable/chunks/D8s8J8Og.js +0 -1
  759. package/build/client/_app/immutable/chunks/D8s8J8Og.js.br +0 -0
  760. package/build/client/_app/immutable/chunks/D8s8J8Og.js.gz +0 -0
  761. package/build/client/_app/immutable/chunks/DCbu051o.js +0 -1
  762. package/build/client/_app/immutable/chunks/DCbu051o.js.br +0 -2
  763. package/build/client/_app/immutable/chunks/DCbu051o.js.gz +0 -0
  764. package/build/client/_app/immutable/chunks/DDUWrtWf.js +0 -1
  765. package/build/client/_app/immutable/chunks/DDUWrtWf.js.br +0 -0
  766. package/build/client/_app/immutable/chunks/DDUWrtWf.js.gz +0 -0
  767. package/build/client/_app/immutable/chunks/DEIc6x-v.js +0 -1
  768. package/build/client/_app/immutable/chunks/DEIc6x-v.js.br +0 -0
  769. package/build/client/_app/immutable/chunks/DEIc6x-v.js.gz +0 -0
  770. package/build/client/_app/immutable/chunks/DMefFkCx.js +0 -1
  771. package/build/client/_app/immutable/chunks/DMefFkCx.js.br +0 -0
  772. package/build/client/_app/immutable/chunks/DMefFkCx.js.gz +0 -0
  773. package/build/client/_app/immutable/chunks/DQEmyAe4.js +0 -1
  774. package/build/client/_app/immutable/chunks/DQEmyAe4.js.br +0 -2
  775. package/build/client/_app/immutable/chunks/DQEmyAe4.js.gz +0 -0
  776. package/build/client/_app/immutable/chunks/DRK9oYED.js +0 -1
  777. package/build/client/_app/immutable/chunks/DRK9oYED.js.br +0 -0
  778. package/build/client/_app/immutable/chunks/DRK9oYED.js.gz +0 -0
  779. package/build/client/_app/immutable/chunks/DU2mz-vL.js +0 -1
  780. package/build/client/_app/immutable/chunks/DU2mz-vL.js.br +0 -0
  781. package/build/client/_app/immutable/chunks/DU2mz-vL.js.gz +0 -0
  782. package/build/client/_app/immutable/chunks/DWlSINHC.js +0 -1
  783. package/build/client/_app/immutable/chunks/DWlSINHC.js.br +0 -0
  784. package/build/client/_app/immutable/chunks/DWlSINHC.js.gz +0 -0
  785. package/build/client/_app/immutable/chunks/DZJnY8Nx.js +0 -1
  786. package/build/client/_app/immutable/chunks/DZJnY8Nx.js.br +0 -0
  787. package/build/client/_app/immutable/chunks/DZJnY8Nx.js.gz +0 -0
  788. package/build/client/_app/immutable/chunks/DdB79emW.js +0 -1
  789. package/build/client/_app/immutable/chunks/DdB79emW.js.br +0 -0
  790. package/build/client/_app/immutable/chunks/DdB79emW.js.gz +0 -0
  791. package/build/client/_app/immutable/chunks/DdRufa9N.js +0 -1
  792. package/build/client/_app/immutable/chunks/DdRufa9N.js.br +0 -0
  793. package/build/client/_app/immutable/chunks/DdRufa9N.js.gz +0 -0
  794. package/build/client/_app/immutable/chunks/DgOhqfdF.js +0 -1
  795. package/build/client/_app/immutable/chunks/DgOhqfdF.js.br +0 -0
  796. package/build/client/_app/immutable/chunks/DgOhqfdF.js.gz +0 -0
  797. package/build/client/_app/immutable/chunks/Dhv6iBq8.js +0 -1
  798. package/build/client/_app/immutable/chunks/Dhv6iBq8.js.br +0 -0
  799. package/build/client/_app/immutable/chunks/Dhv6iBq8.js.gz +0 -0
  800. package/build/client/_app/immutable/chunks/Dj3Af0xC.js +0 -2
  801. package/build/client/_app/immutable/chunks/Dj3Af0xC.js.br +0 -0
  802. package/build/client/_app/immutable/chunks/Dj3Af0xC.js.gz +0 -0
  803. package/build/client/_app/immutable/chunks/DkG1ReNq.js +0 -1
  804. package/build/client/_app/immutable/chunks/DkG1ReNq.js.br +0 -0
  805. package/build/client/_app/immutable/chunks/DkG1ReNq.js.gz +0 -0
  806. package/build/client/_app/immutable/chunks/DlcOqcbg.js +0 -1
  807. package/build/client/_app/immutable/chunks/DlcOqcbg.js.br +0 -0
  808. package/build/client/_app/immutable/chunks/DlcOqcbg.js.gz +0 -0
  809. package/build/client/_app/immutable/chunks/DnDesMxN.js +0 -1
  810. package/build/client/_app/immutable/chunks/DnDesMxN.js.br +0 -0
  811. package/build/client/_app/immutable/chunks/DnDesMxN.js.gz +0 -0
  812. package/build/client/_app/immutable/chunks/DnQR8b1d.js +0 -62
  813. package/build/client/_app/immutable/chunks/DnQR8b1d.js.br +0 -0
  814. package/build/client/_app/immutable/chunks/DnQR8b1d.js.gz +0 -0
  815. package/build/client/_app/immutable/chunks/DpSftVJo.js +0 -1
  816. package/build/client/_app/immutable/chunks/DpSftVJo.js.br +0 -0
  817. package/build/client/_app/immutable/chunks/DpSftVJo.js.gz +0 -0
  818. package/build/client/_app/immutable/chunks/DqZ9Wm2M.js +0 -1
  819. package/build/client/_app/immutable/chunks/DqZ9Wm2M.js.br +0 -0
  820. package/build/client/_app/immutable/chunks/DqZ9Wm2M.js.gz +0 -0
  821. package/build/client/_app/immutable/chunks/DybGBkO1.js +0 -5
  822. package/build/client/_app/immutable/chunks/DybGBkO1.js.br +0 -0
  823. package/build/client/_app/immutable/chunks/DybGBkO1.js.gz +0 -0
  824. package/build/client/_app/immutable/chunks/He17Vv5l.js +0 -1
  825. package/build/client/_app/immutable/chunks/He17Vv5l.js.br +0 -0
  826. package/build/client/_app/immutable/chunks/He17Vv5l.js.gz +0 -0
  827. package/build/client/_app/immutable/chunks/M3zsQDnS.js +0 -2
  828. package/build/client/_app/immutable/chunks/M3zsQDnS.js.br +0 -0
  829. package/build/client/_app/immutable/chunks/M3zsQDnS.js.gz +0 -0
  830. package/build/client/_app/immutable/chunks/QzT8bZ-S.js +0 -2
  831. package/build/client/_app/immutable/chunks/QzT8bZ-S.js.br +0 -0
  832. package/build/client/_app/immutable/chunks/QzT8bZ-S.js.gz +0 -0
  833. package/build/client/_app/immutable/chunks/TcIaLKEO.js +0 -1
  834. package/build/client/_app/immutable/chunks/TcIaLKEO.js.br +0 -0
  835. package/build/client/_app/immutable/chunks/TcIaLKEO.js.gz +0 -0
  836. package/build/client/_app/immutable/chunks/WKkbnawS.js +0 -1
  837. package/build/client/_app/immutable/chunks/WKkbnawS.js.br +0 -0
  838. package/build/client/_app/immutable/chunks/WKkbnawS.js.gz +0 -0
  839. package/build/client/_app/immutable/chunks/Y3i_x_Ja.js +0 -1
  840. package/build/client/_app/immutable/chunks/Y3i_x_Ja.js.br +0 -0
  841. package/build/client/_app/immutable/chunks/Y3i_x_Ja.js.gz +0 -0
  842. package/build/client/_app/immutable/chunks/Z8zDEyti.js +0 -1
  843. package/build/client/_app/immutable/chunks/Z8zDEyti.js.br +0 -0
  844. package/build/client/_app/immutable/chunks/Z8zDEyti.js.gz +0 -0
  845. package/build/client/_app/immutable/chunks/dKB0cWc2.js +0 -6
  846. package/build/client/_app/immutable/chunks/dKB0cWc2.js.br +0 -0
  847. package/build/client/_app/immutable/chunks/dKB0cWc2.js.gz +0 -0
  848. package/build/client/_app/immutable/chunks/dPAGVN7v.js +0 -6
  849. package/build/client/_app/immutable/chunks/dPAGVN7v.js.br +0 -0
  850. package/build/client/_app/immutable/chunks/dPAGVN7v.js.gz +0 -0
  851. package/build/client/_app/immutable/chunks/dxi_erj0.js +0 -3
  852. package/build/client/_app/immutable/chunks/dxi_erj0.js.br +0 -0
  853. package/build/client/_app/immutable/chunks/dxi_erj0.js.gz +0 -0
  854. package/build/client/_app/immutable/chunks/kE4zxzFD.js +0 -1
  855. package/build/client/_app/immutable/chunks/kE4zxzFD.js.br +0 -0
  856. package/build/client/_app/immutable/chunks/kE4zxzFD.js.gz +0 -0
  857. package/build/client/_app/immutable/chunks/kWmJZSyZ.js +0 -1
  858. package/build/client/_app/immutable/chunks/kWmJZSyZ.js.br +0 -0
  859. package/build/client/_app/immutable/chunks/kWmJZSyZ.js.gz +0 -0
  860. package/build/client/_app/immutable/chunks/ohZIF1HO.js +0 -5
  861. package/build/client/_app/immutable/chunks/ohZIF1HO.js.br +0 -0
  862. package/build/client/_app/immutable/chunks/ohZIF1HO.js.gz +0 -0
  863. package/build/client/_app/immutable/entry/app.BLMRuJuW.js +0 -2
  864. package/build/client/_app/immutable/entry/app.BLMRuJuW.js.br +0 -0
  865. package/build/client/_app/immutable/entry/app.BLMRuJuW.js.gz +0 -0
  866. package/build/client/_app/immutable/entry/start.C5t0JfpX.js +0 -1
  867. package/build/client/_app/immutable/entry/start.C5t0JfpX.js.br +0 -0
  868. package/build/client/_app/immutable/entry/start.C5t0JfpX.js.gz +0 -0
  869. package/build/client/_app/immutable/nodes/0.x0mKzYMw.js +0 -8
  870. package/build/client/_app/immutable/nodes/0.x0mKzYMw.js.br +0 -0
  871. package/build/client/_app/immutable/nodes/0.x0mKzYMw.js.gz +0 -0
  872. package/build/client/_app/immutable/nodes/1.DQwKSgDw.js +0 -1
  873. package/build/client/_app/immutable/nodes/1.DQwKSgDw.js.br +0 -0
  874. package/build/client/_app/immutable/nodes/1.DQwKSgDw.js.gz +0 -0
  875. package/build/client/_app/immutable/nodes/10.Bmz2aEu9.js +0 -3
  876. package/build/client/_app/immutable/nodes/10.Bmz2aEu9.js.br +0 -0
  877. package/build/client/_app/immutable/nodes/10.Bmz2aEu9.js.gz +0 -0
  878. package/build/client/_app/immutable/nodes/11.Dsw17idi.js +0 -1
  879. package/build/client/_app/immutable/nodes/11.Dsw17idi.js.br +0 -0
  880. package/build/client/_app/immutable/nodes/11.Dsw17idi.js.gz +0 -0
  881. package/build/client/_app/immutable/nodes/12.BCfbyZHF.js +0 -14
  882. package/build/client/_app/immutable/nodes/12.BCfbyZHF.js.br +0 -0
  883. package/build/client/_app/immutable/nodes/12.BCfbyZHF.js.gz +0 -0
  884. package/build/client/_app/immutable/nodes/13.BF70RcBN.js +0 -150
  885. package/build/client/_app/immutable/nodes/13.BF70RcBN.js.br +0 -0
  886. package/build/client/_app/immutable/nodes/13.BF70RcBN.js.gz +0 -0
  887. package/build/client/_app/immutable/nodes/14.DUa-e6bC.js +0 -4
  888. package/build/client/_app/immutable/nodes/14.DUa-e6bC.js.br +0 -0
  889. package/build/client/_app/immutable/nodes/14.DUa-e6bC.js.gz +0 -0
  890. package/build/client/_app/immutable/nodes/16.DV4CIsXI.js +0 -11
  891. package/build/client/_app/immutable/nodes/16.DV4CIsXI.js.br +0 -0
  892. package/build/client/_app/immutable/nodes/16.DV4CIsXI.js.gz +0 -0
  893. package/build/client/_app/immutable/nodes/17.BFAervXe.js +0 -9
  894. package/build/client/_app/immutable/nodes/17.BFAervXe.js.br +0 -0
  895. package/build/client/_app/immutable/nodes/17.BFAervXe.js.gz +0 -0
  896. package/build/client/_app/immutable/nodes/18.cqwxGV--.js +0 -2
  897. package/build/client/_app/immutable/nodes/18.cqwxGV--.js.br +0 -0
  898. package/build/client/_app/immutable/nodes/18.cqwxGV--.js.gz +0 -0
  899. package/build/client/_app/immutable/nodes/19.W4wKGIwz.js +0 -3
  900. package/build/client/_app/immutable/nodes/19.W4wKGIwz.js.br +0 -0
  901. package/build/client/_app/immutable/nodes/19.W4wKGIwz.js.gz +0 -0
  902. package/build/client/_app/immutable/nodes/2.DNWuY54S.js +0 -27
  903. package/build/client/_app/immutable/nodes/2.DNWuY54S.js.br +0 -0
  904. package/build/client/_app/immutable/nodes/2.DNWuY54S.js.gz +0 -0
  905. package/build/client/_app/immutable/nodes/20.Bw-IUju8.js +0 -1
  906. package/build/client/_app/immutable/nodes/20.Bw-IUju8.js.br +0 -0
  907. package/build/client/_app/immutable/nodes/20.Bw-IUju8.js.gz +0 -0
  908. package/build/client/_app/immutable/nodes/21.DNFvLLcD.js +0 -6
  909. package/build/client/_app/immutable/nodes/21.DNFvLLcD.js.br +0 -0
  910. package/build/client/_app/immutable/nodes/21.DNFvLLcD.js.gz +0 -0
  911. package/build/client/_app/immutable/nodes/3.COF537Bh.js +0 -5
  912. package/build/client/_app/immutable/nodes/3.COF537Bh.js.br +0 -0
  913. package/build/client/_app/immutable/nodes/3.COF537Bh.js.gz +0 -0
  914. package/build/client/_app/immutable/nodes/4.C69OFBsR.js +0 -1
  915. package/build/client/_app/immutable/nodes/4.C69OFBsR.js.br +0 -0
  916. package/build/client/_app/immutable/nodes/4.C69OFBsR.js.gz +0 -0
  917. package/build/client/_app/immutable/nodes/5.BAZlH_fP.js +0 -2
  918. package/build/client/_app/immutable/nodes/5.BAZlH_fP.js.br +0 -0
  919. package/build/client/_app/immutable/nodes/5.BAZlH_fP.js.gz +0 -0
  920. package/build/client/_app/immutable/nodes/6.BsosOtvd.js +0 -7
  921. package/build/client/_app/immutable/nodes/6.BsosOtvd.js.br +0 -0
  922. package/build/client/_app/immutable/nodes/6.BsosOtvd.js.gz +0 -0
  923. package/build/client/_app/immutable/nodes/7.DnZ-8ovs.js +0 -5
  924. package/build/client/_app/immutable/nodes/7.DnZ-8ovs.js.br +0 -0
  925. package/build/client/_app/immutable/nodes/7.DnZ-8ovs.js.gz +0 -0
  926. package/build/client/_app/immutable/nodes/9.BzSWG3R8.js +0 -1
  927. package/build/client/_app/immutable/nodes/9.BzSWG3R8.js.br +0 -0
  928. package/build/client/_app/immutable/nodes/9.BzSWG3R8.js.gz +0 -0
  929. package/build/server/chunks/chunks/DecisionCard.js-DaA8DYYg.js +0 -586
  930. package/build/server/chunks/chunks/DocSheet.js-COU85_s3.js +0 -50
  931. package/build/server/chunks/chunks/EtaLine.js-CGeZKC7J.js +0 -98
  932. package/build/server/chunks/chunks/EveryProjectSwitch.js-BRDpCeoH.js +0 -200
  933. package/build/server/chunks/chunks/Icon.js-CHJ2UHjC.js +0 -129
  934. package/build/server/chunks/chunks/InsightsNav.js-6PnqzaPk.js +0 -18
  935. package/build/server/chunks/chunks/InstallPlugin.js-Cs1ZrPAp.js +0 -45
  936. package/build/server/chunks/chunks/LinkedText.js-W4YG6iJR.js +0 -34
  937. package/build/server/chunks/chunks/MateHealthPill.js-BNEGFwH8.js +0 -22
  938. package/build/server/chunks/chunks/OpenDecision.js-CYba2eq3.js +0 -1614
  939. package/build/server/chunks/chunks/ProjectBanner.js-DFoHRlbH.js +0 -111
  940. package/build/server/chunks/chunks/ProjectStateMark.js-Dnky_g-x.js +0 -41
  941. package/build/server/chunks/chunks/QuestionList.js-BXYtAgRG.js +0 -51
  942. package/build/server/chunks/chunks/ResizableRail.js-C0NBHdjG.js +0 -50
  943. package/build/server/chunks/chunks/SettingsNav.js-hmRmEglt.js +0 -22
  944. package/build/server/chunks/chunks/SlotContent.js-DvHCWpDg.js +0 -738
  945. package/build/server/chunks/chunks/TaskOverview.js-sfLDib9-.js +0 -568
  946. package/build/server/chunks/chunks/TimeBar.js-D3XrZtTh.js +0 -32
  947. package/build/server/chunks/chunks/TimeLegend.js-B5rkpGtG.js +0 -29
  948. package/build/server/chunks/chunks/WhereBadge.js-CT4hViFh.js +0 -131
  949. package/build/server/chunks/chunks/addresses.js-DMekVPad.js +0 -52
  950. package/build/server/chunks/chunks/aliases.svelte.js-D80jyNJf.js +0 -138
  951. package/build/server/chunks/chunks/arrow-down.js-DUgKe53e.js +0 -18
  952. package/build/server/chunks/chunks/arrow-left.js-Cq9_JtOh.js +0 -18
  953. package/build/server/chunks/chunks/arrow-right.js-AjYDyUqN.js +0 -18
  954. package/build/server/chunks/chunks/arrow-up-right.js-BXDKmOw9.js +0 -18
  955. package/build/server/chunks/chunks/arrow-up.js-Cd_TyexB.js +0 -18
  956. package/build/server/chunks/chunks/berths.js-DAg2ReUw.js +0 -270
  957. package/build/server/chunks/chunks/bridge.js-Cm-aK0Fl.js +0 -3757
  958. package/build/server/chunks/chunks/brief.js-TS-K0lZ6.js +0 -54
  959. package/build/server/chunks/chunks/buildlog.js-BGIHToGa.js +0 -55
  960. package/build/server/chunks/chunks/button.js-Q4mS-EA8.js +0 -7311
  961. package/build/server/chunks/chunks/changes.js-DLL6A8OG.js +0 -40
  962. package/build/server/chunks/chunks/check.js-LVN_jfQU.js +0 -15
  963. package/build/server/chunks/chunks/checks.js-CIo8HrSt.js +0 -221
  964. package/build/server/chunks/chunks/chevron-left.js-DhF4v3Pt.js +0 -15
  965. package/build/server/chunks/chunks/chevron-right.js-D4fnSNoh.js +0 -15
  966. package/build/server/chunks/chunks/circle-alert.js-CTc53lLB.js +0 -23
  967. package/build/server/chunks/chunks/circle-arrow-up.js-v-nE3jR0.js +0 -20
  968. package/build/server/chunks/chunks/circle-dashed.js-QwLaO9U2.js +0 -24
  969. package/build/server/chunks/chunks/circle-dot.js-DMNxPdVx.js +0 -18
  970. package/build/server/chunks/chunks/client.js-BSbbAByJ.js +0 -24
  971. package/build/server/chunks/chunks/clock.js-hPyOuzjG.js +0 -18
  972. package/build/server/chunks/chunks/detail.js-B8abhi3a.js +0 -146
  973. package/build/server/chunks/chunks/external-link.js-BuWBxV8H.js +0 -24
  974. package/build/server/chunks/chunks/eye.js-BvS4v0oz.js +0 -23
  975. package/build/server/chunks/chunks/feedback.js-Jpl8v6Mu.js +0 -67
  976. package/build/server/chunks/chunks/format.js-DKnw8oWK.js +0 -70
  977. package/build/server/chunks/chunks/git-pull-request.js-CXtks_Ym.js +0 -20
  978. package/build/server/chunks/chunks/hand.js-CJ13vqPn.js +0 -25
  979. package/build/server/chunks/chunks/index-server.js-BY3oucHa.js +0 -17
  980. package/build/server/chunks/chunks/index.js-C2v29IkD.js +0 -1524
  981. package/build/server/chunks/chunks/index2.js-DDKi-jKB.js +0 -46
  982. package/build/server/chunks/chunks/internal.js-bN02E8b0.js +0 -146
  983. package/build/server/chunks/chunks/live.svelte.js-D1hNGw9_.js +0 -241
  984. package/build/server/chunks/chunks/loader-circle.js-CNbdxSQ6.js +0 -16
  985. package/build/server/chunks/chunks/markdown.js-0thJlxxD.js +0 -2656
  986. package/build/server/chunks/chunks/message-square.js-Ct7UUpHZ.js +0 -22
  987. package/build/server/chunks/chunks/messages-square.js-S0CnYLu0.js +0 -47
  988. package/build/server/chunks/chunks/minus.js-B7GNC6Bd.js +0 -15
  989. package/build/server/chunks/chunks/plain.js-Dc97sYaJ.js +0 -101
  990. package/build/server/chunks/chunks/plus.js-Dbawo5bL.js +0 -15
  991. package/build/server/chunks/chunks/previewhelper2.js-Fr7JXr0X.js +0 -165
  992. package/build/server/chunks/chunks/pullrequests.js-BobjerQv.js +0 -152
  993. package/build/server/chunks/chunks/pullrequests2.js-CCzk2sqm.js +0 -12
  994. package/build/server/chunks/chunks/repo.js-D4m77kW0.js +0 -33
  995. package/build/server/chunks/chunks/review.js-DoWJxV0D.js +0 -141
  996. package/build/server/chunks/chunks/root.js-iNMFn-Yg.js +0 -3105
  997. package/build/server/chunks/chunks/rotate-cw.js-BPzrB4So.js +0 -21
  998. package/build/server/chunks/chunks/runtime.js-BGOuM-Hy.js +0 -17683
  999. package/build/server/chunks/chunks/scale.js-CkXtBARG.js +0 -21
  1000. package/build/server/chunks/chunks/scroll-lock.js-C4Fj1gEY.js +0 -2797
  1001. package/build/server/chunks/chunks/service.js-CzSbBjc3.js +0 -916
  1002. package/build/server/chunks/chunks/settings.js-BEOX97g7.js +0 -869
  1003. package/build/server/chunks/chunks/shield-check.js-MP-IWW55.js +0 -23
  1004. package/build/server/chunks/chunks/sparkles.js-Cr_IjWR_.js +0 -26
  1005. package/build/server/chunks/chunks/square-terminal.js-DLBEkPpa.js +0 -30
  1006. package/build/server/chunks/chunks/tone.js-oubilaK8.js +0 -59
  1007. package/build/server/chunks/chunks/triangle-alert.js-DGSV_5I9.js +0 -25
  1008. package/build/server/chunks/chunks/urls.js-BrlC6XZ8.js +0 -8
  1009. package/build/server/chunks/chunks/vault.js-CTaWe09z.js +0 -162
  1010. package/build/server/chunks/chunks/view.js-CeInAMHW.js +0 -76
  1011. package/build/server/chunks/chunks/words.js-eWWIwMKr.js +0 -52
  1012. package/build/server/chunks/chunks/x.js-Dhp-BHl8.js +0 -18
  1013. package/build/server/chunks/entries/endpoints/api/apps/_op_/_server.ts.js-smS4TCrQ.js +0 -94
  1014. package/build/server/chunks/entries/endpoints/api/events/_server.ts.js-Bqh9AFl3.js +0 -104
  1015. package/build/server/chunks/entries/endpoints/api/files/_server.ts.js-BM0ps5lk.js +0 -53
  1016. package/build/server/chunks/entries/endpoints/api/firstmate/chat/_server.ts.js-Cm2ckYW2.js +0 -87
  1017. package/build/server/chunks/entries/endpoints/api/firstmate/commands/_server.ts.js-DZCnbYId.js +0 -123
  1018. package/build/server/chunks/entries/endpoints/api/firstmate/dismiss/_server.ts.js-B5fpHEKR.js +0 -49
  1019. package/build/server/chunks/entries/endpoints/api/firstmate/input/_server.ts.js-eq3GdIy6.js +0 -55
  1020. package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/_server.ts.js-CvXW4Pgj.js +0 -48
  1021. package/build/server/chunks/entries/endpoints/api/firstmate/messages/_server.ts.js-Ck9lsiPW.js +0 -95
  1022. package/build/server/chunks/entries/endpoints/api/firstmate/pick/_server.ts.js-S2cNDAv_.js +0 -58
  1023. package/build/server/chunks/entries/endpoints/api/firstmate/reactions/_server.ts.js-Dp5sUKpf.js +0 -69
  1024. package/build/server/chunks/entries/endpoints/api/firstmate/start/_server.ts.js-BRyx-SLk.js +0 -48
  1025. package/build/server/chunks/entries/endpoints/api/fleet/_server.ts.js-DbOj2r3G.js +0 -40
  1026. package/build/server/chunks/entries/endpoints/api/gateway/_server.ts.js-CqNT7hdk.js +0 -104
  1027. package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-s9ct1YaL.js +0 -40
  1028. package/build/server/chunks/entries/endpoints/api/inbox/_server.ts.js-CCbenPIy.js +0 -64
  1029. package/build/server/chunks/entries/endpoints/api/inbox/report/_server.ts.js-YkdQuW03.js +0 -55
  1030. package/build/server/chunks/entries/endpoints/api/insights/_server.ts.js-jMIRKXVy.js +0 -40
  1031. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/config/_server.ts.js-CRz5ap0Z.js +0 -75
  1032. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/_server.ts.js-BUreXPtQ.js +0 -64
  1033. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/summary/_server.ts.js-aLsUJ-HL.js +0 -59
  1034. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/icon/_icon_/_server.ts.js-BQxGrtDq.js +0 -56
  1035. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/load/_server.ts.js-DVwdrfyP.js +0 -24
  1036. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/ui/_...path_/_server.ts.js-fWXa1T6O.js +0 -63
  1037. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/update/_server.ts.js-GzkA-eH4.js +0 -36
  1038. package/build/server/chunks/entries/endpoints/api/plugins/_server.ts.js-Du31g-KO.js +0 -40
  1039. package/build/server/chunks/entries/endpoints/api/plugins/inspect/_server.ts.js-CQYj1ZuS.js +0 -36
  1040. package/build/server/chunks/entries/endpoints/api/plugins/install/_server.ts.js-D6Nprf6i.js +0 -39
  1041. package/build/server/chunks/entries/endpoints/api/plugins/updates/_server.ts.js-DjQvcvOx.js +0 -24
  1042. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/_server.ts.js-DcwsTmlB.js +0 -45
  1043. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/_server.ts.js-CGPbXNqf.js +0 -54
  1044. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/_server.ts.js-CawLRyKI.js +0 -66
  1045. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/_server.ts.js-Cl8Xr77g.js +0 -53
  1046. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/file/_server.ts.js-B3vEVTxZ.js +0 -76
  1047. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/_server.ts.js-iToq6YEa.js +0 -59
  1048. package/build/server/chunks/entries/endpoints/api/second-mates/_id_/peek/_server.ts.js-CwWCiOV_.js +0 -49
  1049. package/build/server/chunks/entries/endpoints/api/services/_server.ts.js-DW8K_vnR.js +0 -59
  1050. package/build/server/chunks/entries/endpoints/api/slots/_server.ts.js-jQeee3c3.js +0 -48
  1051. package/build/server/chunks/entries/endpoints/api/tasks/_id_/_server.ts.js-DjmH3APN.js +0 -45
  1052. package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/_server.ts.js-BKBTwHdx.js +0 -64
  1053. package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/_server.ts.js-Dps2HZrT.js +0 -57
  1054. package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/_server.ts.js-CLrEK2JB.js +0 -105
  1055. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/_server.ts.js-Dajmg1QT.js +0 -59
  1056. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/helper/_server.ts.js-DzbKvWf4.js +0 -62
  1057. package/build/server/chunks/entries/endpoints/api/vault/_server.ts.js-lrCSZ8vJ.js +0 -66
  1058. package/build/server/chunks/entries/endpoints/api/wheelhouse/update/_server.ts.js--J2luqpT.js +0 -24
  1059. package/build/server/chunks/entries/endpoints/api/wheelhouse/upgrade/_server.ts.js-D6jJ1Rr_.js +0 -24
  1060. package/build/server/chunks/entries/endpoints/tasks/_id_/review/_server.ts.js-DFiNNdmX.js +0 -44
  1061. package/build/server/chunks/entries/fallbacks/error.svelte.js-CB4I_wOd.js +0 -15
  1062. package/build/server/chunks/entries/hooks.server.js-BbTmH2JU.js +0 -58
  1063. package/build/server/chunks/entries/pages/_layout.server.ts.js-DTaBhixQ.js +0 -24
  1064. package/build/server/chunks/entries/pages/_layout.svelte.js-BNA76gGJ.js +0 -5551
  1065. package/build/server/chunks/entries/pages/_page.server.ts.js-BjKksIBz.js +0 -16
  1066. package/build/server/chunks/entries/pages/_page.svelte.js-Bgw0FiJG.js +0 -3847
  1067. package/build/server/chunks/entries/pages/decisions/_page.server.ts.js-Cr6eZ4p-.js +0 -11
  1068. package/build/server/chunks/entries/pages/decisions/_page.svelte.js-DcczyFUP.js +0 -201
  1069. package/build/server/chunks/entries/pages/files/_page.server.ts.js-CA3bfaLe.js +0 -17
  1070. package/build/server/chunks/entries/pages/files/_page.svelte.js-BIMqSkgM.js +0 -60
  1071. package/build/server/chunks/entries/pages/harbour/_page.server.ts.js-CGhoI6xu.js +0 -46
  1072. package/build/server/chunks/entries/pages/harbour/_page.svelte.js-BHMB8PKC.js +0 -749
  1073. package/build/server/chunks/entries/pages/headroom/_page.server.ts.js-BRadjeWP.js +0 -11
  1074. package/build/server/chunks/entries/pages/headroom/_page.svelte.js-Yw5NZV8k.js +0 -183
  1075. package/build/server/chunks/entries/pages/inbox/_page.server.ts.js-CB7PXBV1.js +0 -11
  1076. package/build/server/chunks/entries/pages/inbox/_page.svelte.js-BLRcCY5u.js +0 -175
  1077. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.server.ts.js-C9J9SfdQ.js +0 -16
  1078. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/_page.svelte.js-DLxqhull.js +0 -53
  1079. package/build/server/chunks/entries/pages/projects/_id_/_page.server.ts.js-nOOV1sAH.js +0 -23
  1080. package/build/server/chunks/entries/pages/projects/_id_/_page.svelte.js-Doi5pyAo.js +0 -980
  1081. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.server.ts.js-BpSFvmgx.js +0 -21
  1082. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/_page.svelte.js-Cr__zX_O.js +0 -76
  1083. package/build/server/chunks/entries/pages/projects/_id_/passage/_page.server.ts.js-08qgrWt_.js +0 -27
  1084. package/build/server/chunks/entries/pages/projects/_id_/passage/_page.svelte.js-CkM6pjKK.js +0 -418
  1085. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.server.ts.js-Waknjiof.js +0 -15
  1086. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/_page.svelte.js-CN-WwfgH.js +0 -1880
  1087. package/build/server/chunks/entries/pages/second-mates/_page.svelte.js-CO4DG7gS.js +0 -221
  1088. package/build/server/chunks/entries/pages/settings/gateway/_page.server.ts.js-D_-2Bk-X.js +0 -11
  1089. package/build/server/chunks/entries/pages/settings/gateway/_page.svelte.js-DuleT8BP.js +0 -208
  1090. package/build/server/chunks/entries/pages/settings/plugins/_page.server.ts.js-Hls8GEh4.js +0 -19
  1091. package/build/server/chunks/entries/pages/settings/plugins/_page.svelte.js-BUmIRIz2.js +0 -1854
  1092. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/_page.server.ts.js-jKmK8VbO.js +0 -17
  1093. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/_page.svelte.js-B5PSrA4H.js +0 -227
  1094. package/build/server/chunks/entries/pages/tasks/_id_/_page.server.ts.js-BZMRfS-l.js +0 -25
  1095. package/build/server/chunks/entries/pages/tasks/_id_/_page.svelte.js-BYcqWFD7.js +0 -2194
  1096. package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.server.ts.js-CGiroJqZ.js +0 -24
  1097. package/build/server/chunks/entries/pages/tasks/_id_/doc/_page.svelte.js-QzwiMik4.js +0 -79
  1098. package/build/server/chunks/entries/pages/time/_page.server.ts.js-exp39MHH.js +0 -11
  1099. package/build/server/chunks/entries/pages/time/_page.svelte.js-D0Z16ExE.js +0 -108
  1100. package/build/server/chunks/handler-CwbFN6sE.js +0 -1474
  1101. package/build/server/chunks/index.js-CqvbtJcl.js +0 -4296
  1102. package/build/server/chunks/manifest.js-DBKpxwtf.js +0 -551
  1103. package/build/server/chunks/nodes/0.js-CzHBL2FE.js +0 -45
  1104. package/build/server/chunks/nodes/1.js-DttsMtH5.js +0 -9
  1105. package/build/server/chunks/nodes/10.js-DS6-8M5v.js +0 -47
  1106. package/build/server/chunks/nodes/11.js-UkJPwg90.js +0 -46
  1107. package/build/server/chunks/nodes/12.js-Bttwc2Gj.js +0 -47
  1108. package/build/server/chunks/nodes/13.js-DN0IvWCs.js +0 -46
  1109. package/build/server/chunks/nodes/14.js-BPrf4PxP.js +0 -9
  1110. package/build/server/chunks/nodes/16.js-MQWaFHIA.js +0 -45
  1111. package/build/server/chunks/nodes/17.js-BqQwHV4F.js +0 -45
  1112. package/build/server/chunks/nodes/18.js-CpKFgiup.js +0 -48
  1113. package/build/server/chunks/nodes/19.js-CCrOg127.js +0 -46
  1114. package/build/server/chunks/nodes/2.js-FPoIQ4QE.js +0 -45
  1115. package/build/server/chunks/nodes/20.js-B5Fv-_hl.js +0 -46
  1116. package/build/server/chunks/nodes/21.js-DIqkKAtP.js +0 -45
  1117. package/build/server/chunks/nodes/3.js-BBLaot9F.js +0 -45
  1118. package/build/server/chunks/nodes/4.js-cmSXc6Wt.js +0 -45
  1119. package/build/server/chunks/nodes/5.js-CxQRjV9G.js +0 -49
  1120. package/build/server/chunks/nodes/6.js-4fNyzqc9.js +0 -45
  1121. package/build/server/chunks/nodes/7.js-D_kCF7ql.js +0 -45
  1122. package/build/server/chunks/nodes/9.js-Dl3MVT1-.js +0 -45
  1123. /package/build/client/_app/immutable/assets/{pullrequests.Dga9zAug.css → PreviewStudio.Dga9zAug.css} +0 -0
  1124. /package/build/client/_app/immutable/assets/{pullrequests.Dga9zAug.css.br → PreviewStudio.Dga9zAug.css.br} +0 -0
  1125. /package/build/client/_app/immutable/assets/{pullrequests.Dga9zAug.css.gz → PreviewStudio.Dga9zAug.css.gz} +0 -0
package/dist/cli.js CHANGED
@@ -4,12 +4,12 @@
4
4
  import { fork, spawn as spawn4 } from "node:child_process";
5
5
  import { existsSync as existsSync2 } from "node:fs";
6
6
  import { createServer } from "node:http";
7
- import path13 from "node:path";
7
+ import path16 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.5.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,16 +510,1298 @@ function writePluginSettings(dir, id, settings2) {
440
510
  });
441
511
  }
442
512
 
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";
526
+ import path3 from "node:path";
527
+
528
+ // src/lib/server/cloud/protocol.ts
529
+ import {
530
+ createHash,
531
+ createPrivateKey,
532
+ createPublicKey,
533
+ generateKeyPairSync,
534
+ sign
535
+ } from "node:crypto";
536
+ var PROTOCOL = 1;
537
+ var FRAME_HTTP = 1;
538
+ var FRAME_WS_TEXT = 2;
539
+ var FRAME_WS_BINARY = 3;
540
+ var DEFAULT_LIMITS = {
541
+ maxStreams: 256,
542
+ window: 256 * 1024,
543
+ maxFrame: 64 * 1024,
544
+ maxBody: 32 * 1024 * 1024,
545
+ maxWsMessage: 4 * 1024 * 1024
546
+ };
547
+ var MAX_CONTROL_BYTES = 256 * 1024;
548
+ var MAX_HEADER_BYTES = 64 * 1024;
549
+ var MAX_HEADER_ENTRIES = 200;
550
+ var b64u = (b) => Buffer.from(b).toString("base64url");
551
+ var SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
552
+ function newDeviceKey() {
553
+ const { privateKey } = generateKeyPairSync("ed25519");
554
+ return deviceKey(privateKey);
555
+ }
556
+ function deviceKey(privateKey) {
557
+ const der = createPublicKey(privateKey).export({ format: "der", type: "spki" });
558
+ return { privateKey, publicKey: b64u(der.subarray(SPKI_PREFIX.length)) };
559
+ }
560
+ var exportKey = (k) => b64u(k.privateKey.export({ format: "der", type: "pkcs8" }));
561
+ function importKey(stored) {
562
+ const text2 = stored.trim();
563
+ if (!/^[A-Za-z0-9_-]{40,200}$/.test(text2)) return null;
564
+ try {
565
+ const k = createPrivateKey({
566
+ key: Buffer.from(text2, "base64url"),
567
+ format: "der",
568
+ type: "pkcs8"
569
+ });
570
+ return k.asymmetricKeyType === "ed25519" ? deviceKey(k) : null;
571
+ } catch {
572
+ return null;
573
+ }
574
+ }
575
+ var BASE32 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
576
+ function base32(bytes) {
577
+ let bits = 0;
578
+ let value = 0;
579
+ let out = "";
580
+ for (const b of bytes) {
581
+ value = value << 8 | b;
582
+ bits += 8;
583
+ while (bits >= 5) {
584
+ out += BASE32[value >>> bits - 5 & 31];
585
+ bits -= 5;
586
+ }
587
+ }
588
+ if (bits > 0) out += BASE32[value << 5 - bits & 31];
589
+ return out;
590
+ }
591
+ function fingerprint(publicKey) {
592
+ const digest = createHash("sha256").update(Buffer.from(publicKey, "base64url")).digest();
593
+ return base32(digest.subarray(0, 10)).match(/.{4}/g).join("-");
594
+ }
595
+ function signed(key, context, ...fields) {
596
+ const message = [context, ...fields.map(String)].join("\n");
597
+ return b64u(sign(null, Buffer.from(message, "utf8"), key.privateKey));
598
+ }
599
+ var pollSig = (key, pairingId) => signed(key, "whc-pair-poll-v1", pairingId);
600
+ var unpairSig = (key, deviceId, ts) => signed(key, "whc-unpair-v1", deviceId, ts);
601
+ var connectSig = (key, nonce, deviceId) => signed(key, "whc-connect-v1", nonce, deviceId);
602
+ function encodeFrame(kind, id, payload) {
603
+ const head = Buffer.allocUnsafe(5);
604
+ head[0] = kind;
605
+ head.writeUInt32BE(id, 1);
606
+ return Buffer.concat([head, payload]);
607
+ }
608
+ function decodeFrame(data) {
609
+ if (data.length < 5) return null;
610
+ return { kind: data[0], id: data.readUInt32BE(1), payload: data.subarray(5) };
611
+ }
612
+ function closeAction(code) {
613
+ switch (code) {
614
+ case 4400:
615
+ return { kind: "reconnect", note: "the gateway reported a protocol error" };
616
+ case 4401:
617
+ return {
618
+ kind: "stop",
619
+ reason: "The gateway does not know this machine (4401). Pair it again: wheelhouse remote connect."
620
+ };
621
+ case 4403:
622
+ return {
623
+ kind: "stop",
624
+ forget: true,
625
+ reason: "This machine was removed from Wheelhouse Cloud (4403), so its key was deleted. Pair it again: wheelhouse remote connect."
626
+ };
627
+ case 4409:
628
+ return {
629
+ kind: "stop",
630
+ reason: "Another connection with this machine\u2019s key replaced this one (4409). Make sure only one Wheelhouse connects, then restart it."
631
+ };
632
+ case 4426:
633
+ return {
634
+ kind: "stop",
635
+ reason: "The gateway no longer speaks this Wheelhouse\u2019s protocol (4426). Update Wheelhouse: wheelhouse upgrade."
636
+ };
637
+ case 4429:
638
+ return { kind: "reconnect", minDelayMs: 6e4, note: "too many connects" };
639
+ default:
640
+ return { kind: "reconnect" };
641
+ }
642
+ }
643
+ var backoffMs = (attempt, random = Math.random) => Math.floor(random() * Math.min(6e4, 1e3 * 2 ** attempt));
644
+ var HOP_BY_HOP = /* @__PURE__ */ new Set([
645
+ "connection",
646
+ "keep-alive",
647
+ "proxy-authenticate",
648
+ "proxy-authorization",
649
+ "proxy-connection",
650
+ "te",
651
+ "trailer",
652
+ "transfer-encoding",
653
+ "upgrade"
654
+ ]);
655
+ function isRestartPath(path17) {
656
+ let p = path17.split(/[?#]/, 1)[0];
657
+ for (let i = 0; i < 3; i++) {
658
+ try {
659
+ const d = decodeURIComponent(p);
660
+ if (d === p) break;
661
+ p = d;
662
+ } catch {
663
+ break;
664
+ }
665
+ }
666
+ const flat = p.replace(/\\/g, "/").replace(/\/{2,}/g, "/");
667
+ const normal = URL.parse(flat, "http://x")?.pathname ?? flat;
668
+ return [flat, normal].some((s) => s.toLowerCase().startsWith("/api/wheelhouse/restart"));
669
+ }
670
+
671
+ // src/lib/server/cloud/settings.ts
672
+ var CLOUD_SETTINGS_SCHEMA = "wheelhouse-cloud-settings.v1";
673
+ var CLOUD_STATUS_SCHEMA = "wheelhouse-cloud-status.v1";
674
+ var CLOUD_KEYCHAIN_SERVICE = "wheelhouse-cloud";
675
+ var cloudDir = (configDir) => path3.join(configDir, "cloud");
676
+ var LOOPBACK = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]"]);
677
+ function gatewayOrigin(raw) {
678
+ const u = URL.parse(raw.trim());
679
+ if (!u) return { ok: false, error: `${raw.trim() || "That"} is not a URL.` };
680
+ if (u.username || u.password)
681
+ return { ok: false, error: "The gateway URL may not carry credentials." };
682
+ const loopback = LOOPBACK.has(u.hostname.toLowerCase());
683
+ if (u.protocol !== "https:" && !(u.protocol === "http:" && loopback)) {
684
+ return { ok: false, error: "The gateway must be an https:// URL." };
685
+ }
686
+ if (u.pathname !== "/" && u.pathname !== "" || u.search || u.hash) {
687
+ return {
688
+ ok: false,
689
+ error: "Give the gateway as its address only, such as https://cloud.example.com."
690
+ };
691
+ }
692
+ return { ok: true, origin: u.origin };
693
+ }
694
+ var isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
695
+ var str = (v) => typeof v === "string" && v ? v : null;
696
+ function parseDevice(v) {
697
+ if (!isObj(v)) return null;
698
+ const id = str(v.id);
699
+ const gateway = str(v.gateway);
700
+ const publicKey = str(v.publicKey);
701
+ if (!id || !gateway || !publicKey || !gatewayOrigin(gateway).ok) return null;
702
+ return {
703
+ id,
704
+ name: str(v.name) ?? id,
705
+ gateway,
706
+ publicKey,
707
+ user: str(v.user),
708
+ pairedAt: str(v.pairedAt) ?? (/* @__PURE__ */ new Date(0)).toISOString()
709
+ };
710
+ }
711
+ function parseSessions(v) {
712
+ if (!Array.isArray(v)) return [];
713
+ return v.filter(isObj).flatMap((s) => {
714
+ const id = str(s.id);
715
+ if (!id) return [];
716
+ return [
717
+ {
718
+ id,
719
+ user: str(s.user) ?? "",
720
+ firstAt: str(s.firstAt) ?? "",
721
+ lastAt: str(s.lastAt) ?? "",
722
+ requests: typeof s.requests === "number" ? s.requests : 0
723
+ }
724
+ ];
725
+ });
726
+ }
727
+ async function writeAtomic(file, text2) {
728
+ await mkdir2(path3.dirname(file), { recursive: true, mode: 448 });
729
+ const tmp = `${file}.tmp-${process.pid}-${randomBytes(4).toString("hex")}`;
730
+ try {
731
+ await writeFile2(tmp, text2, { mode: 384 });
732
+ await rename2(tmp, file);
733
+ } catch (e) {
734
+ await rm(tmp, { force: true });
735
+ throw e;
736
+ }
737
+ }
738
+ function alive(pid) {
739
+ if (!Number.isInteger(pid) || pid <= 0) return false;
740
+ try {
741
+ process.kill(pid, 0);
742
+ return true;
743
+ } catch (e) {
744
+ return e.code === "EPERM";
745
+ }
746
+ }
747
+ var CloudSettings = class {
748
+ constructor(dir, keychain = null) {
749
+ this.dir = dir;
750
+ this.keychain = keychain;
751
+ }
752
+ dir;
753
+ keychain;
754
+ get file() {
755
+ return path3.join(this.dir, "settings.json");
756
+ }
757
+ get keyFile() {
758
+ return path3.join(this.dir, "device.key");
759
+ }
760
+ get statusFile() {
761
+ return path3.join(this.dir, "status.json");
762
+ }
763
+ /** The settings, with defaults (off, no gateway, no device) for anything missing or unreadable, with why. */
764
+ async read() {
765
+ const settings2 = { enabled: false, gateway: "", device: null };
766
+ let text2;
767
+ try {
768
+ text2 = await readFile2(this.file, "utf8");
769
+ } catch (e) {
770
+ if (e.code === "ENOENT") return { settings: settings2, error: null };
771
+ return { settings: settings2, error: `${this.file} could not be read: ${e.message}` };
772
+ }
773
+ let parsed;
774
+ try {
775
+ parsed = JSON.parse(text2);
776
+ } catch {
777
+ return { settings: settings2, error: `${this.file} is not valid JSON.` };
778
+ }
779
+ if (!isObj(parsed) || parsed.schema !== CLOUD_SETTINGS_SCHEMA) {
780
+ return { settings: settings2, error: `${this.file} is not a Wheelhouse Cloud settings file.` };
781
+ }
782
+ const gateway = str(parsed.gateway);
783
+ const origin = gateway ? gatewayOrigin(gateway) : null;
784
+ return {
785
+ settings: {
786
+ enabled: parsed.enabled === true,
787
+ gateway: origin?.ok ? origin.origin : "",
788
+ device: parseDevice(parsed.device)
789
+ },
790
+ error: null
791
+ };
792
+ }
793
+ async update(change) {
794
+ const { settings: settings2 } = await this.read();
795
+ change(settings2);
796
+ await writeAtomic(
797
+ this.file,
798
+ JSON.stringify({ schema: CLOUD_SETTINGS_SCHEMA, ...settings2 }, null, " ") + "\n"
799
+ );
800
+ return settings2;
801
+ }
802
+ /** The Keychain account for this directory's device key, so each config directory has its own. */
803
+ async keychainAccount() {
804
+ const real2 = await realpath(this.dir).catch(() => path3.resolve(this.dir));
805
+ return `device:${createHash2("sha256").update(real2).digest("hex").slice(0, 16)}`;
806
+ }
807
+ /** The device key and where it is kept: the Keychain first, then the file. */
808
+ async findKey() {
809
+ const kept = this.keychain ? await this.keychain.get(await this.keychainAccount()).catch(() => null) : null;
810
+ const fromKeychain = kept ? importKey(kept) : null;
811
+ if (fromKeychain) return { key: fromKeychain, where: this.keychain.where };
812
+ try {
813
+ const s = await lstat(this.keyFile);
814
+ if (!s.isFile()) return null;
815
+ if ((s.mode & 63) !== 0) await chmod(this.keyFile, 384);
816
+ const key = importKey(await readFile2(this.keyFile, "utf8"));
817
+ return key ? { key, where: this.keyFile } : null;
818
+ } catch {
819
+ return null;
820
+ }
821
+ }
822
+ /** Keep the key in the Keychain, else in its file, replacing any before; returns where it went. */
823
+ async setKey(key) {
824
+ await mkdir2(this.dir, { recursive: true, mode: 448 });
825
+ const stored = exportKey(key);
826
+ const account = await this.keychainAccount();
827
+ const kept = this.keychain ? await this.keychain.set(account, stored).then(
828
+ () => true,
829
+ () => false
830
+ ) : false;
831
+ if (kept) {
832
+ await rm(this.keyFile, { force: true });
833
+ return this.keychain.where;
834
+ }
835
+ await this.keychain?.remove(account).catch(() => false);
836
+ await writeAtomic(this.keyFile, `${stored}
837
+ `);
838
+ await chmod(this.dir, 448).catch(() => {
839
+ });
840
+ return this.keyFile;
841
+ }
842
+ /** Forget this machine's device: its key wherever it is kept, and its record. */
843
+ async forget() {
844
+ await this.keychain?.remove(await this.keychainAccount()).catch(() => false);
845
+ await rm(this.keyFile, { force: true });
846
+ await this.update((s) => s.device = null);
847
+ }
848
+ async readStatus() {
849
+ try {
850
+ const v = JSON.parse(await readFile2(this.statusFile, "utf8"));
851
+ if (!isObj(v) || v.schema !== CLOUD_STATUS_SCHEMA || typeof v.pid !== "number") return null;
852
+ const state = v.state === "online" || v.state === "stopped" ? v.state : "connecting";
853
+ return {
854
+ pid: v.pid,
855
+ state,
856
+ reason: str(v.reason),
857
+ gateway: str(v.gateway) ?? "",
858
+ deviceId: str(v.deviceId) ?? "",
859
+ since: str(v.since),
860
+ lastSeen: str(v.lastSeen),
861
+ updatedAt: str(v.updatedAt) ?? "",
862
+ sessions: parseSessions(v.sessions)
863
+ };
864
+ } catch {
865
+ return null;
866
+ }
867
+ }
868
+ async writeStatus(s) {
869
+ await writeAtomic(
870
+ this.statusFile,
871
+ JSON.stringify({ schema: CLOUD_STATUS_SCHEMA, ...s }, null, " ") + "\n"
872
+ );
873
+ }
874
+ /** Changes whenever the settings or the key file are written, so a running connector notices. */
875
+ async stamp() {
876
+ const one = async (f) => {
877
+ try {
878
+ const s = await stat3(f);
879
+ return `${s.mtimeMs}:${s.size}:${s.ino}`;
880
+ } catch {
881
+ return "-";
882
+ }
883
+ };
884
+ return (await Promise.all([this.file, this.keyFile].map(one))).join("|");
885
+ }
886
+ /** What Settings → Cloud and `wheelhouse remote status` show. */
887
+ async view(viaRelay = false) {
888
+ const { settings: settings2, error } = await this.read();
889
+ const found = settings2.device ? await this.findKey() : null;
890
+ const status = await this.readStatus();
891
+ const device = settings2.device && found ? {
892
+ id: settings2.device.id,
893
+ name: settings2.device.name,
894
+ user: settings2.device.user,
895
+ fingerprint: fingerprint(settings2.device.publicKey),
896
+ pairedAt: settings2.device.pairedAt
897
+ } : null;
898
+ const live = status && device && status.deviceId === device.id && alive(status.pid) ? status : null;
899
+ let state;
900
+ let reason = error;
901
+ if (!settings2.enabled) state = "off";
902
+ else if (!device) {
903
+ state = "not-paired";
904
+ if (settings2.device && !found) {
905
+ reason = "This machine\u2019s device key is missing, so it cannot connect. Pair it again.";
906
+ } else if (status?.state === "stopped" && status.reason) {
907
+ reason = status.reason;
908
+ }
909
+ } else if (!live) {
910
+ state = status && status.deviceId === device.id && status.state === "stopped" && status.reason ? "stopped" : "not-running";
911
+ if (state === "stopped") reason = status.reason;
912
+ } else {
913
+ state = live.state === "online" ? "online" : live.state === "stopped" ? "stopped" : "connecting";
914
+ reason = live.reason ?? reason;
915
+ }
916
+ const recent = status && device && status.deviceId === device.id ? status : null;
917
+ return {
918
+ schema: "wheelhouse-cloud.v1",
919
+ enabled: settings2.enabled,
920
+ gateway: settings2.gateway,
921
+ device,
922
+ keyStore: found?.where ?? null,
923
+ state,
924
+ reason,
925
+ since: live?.state === "online" ? live.since : null,
926
+ lastSeen: recent?.lastSeen ?? null,
927
+ sessions: recent?.sessions ?? [],
928
+ viaRelay
929
+ };
930
+ }
931
+ };
932
+
933
+ // src/lib/server/cloud/local.ts
934
+ function cloudKeychain() {
935
+ return process.platform === "darwin" ? macKeychain(CLOUD_KEYCHAIN_SERVICE) : null;
936
+ }
937
+
938
+ // src/lib/server/cloud/connector.ts
939
+ import WebSocket2 from "ws";
940
+
941
+ // src/lib/server/cloud/relay.ts
942
+ import http from "node:http";
943
+ import WebSocket from "ws";
944
+ var CREDIT_BATCH = 64 * 1024;
945
+ var IDLE_MS = 5 * 6e4;
946
+ var WS_HANDSHAKE_MS = 12e3;
947
+ var isObj2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
948
+ var headerSafe = (s) => {
949
+ for (let i = 0; i < s.length; i++) {
950
+ const c = s.charCodeAt(i);
951
+ if (c < 32 && c !== 9 || c === 127) return false;
952
+ }
953
+ return true;
954
+ };
955
+ function parseRelay(v) {
956
+ if (!isObj2(v) || !isObj2(v.user)) return null;
957
+ const { sessionId, origin, previewOrigin } = v;
958
+ const { id, name } = v.user;
959
+ const all = [sessionId, origin, previewOrigin, id];
960
+ if (!all.every((s) => typeof s === "string" && s.length <= 512 && headerSafe(s))) return null;
961
+ return {
962
+ sessionId,
963
+ user: { id, name: typeof name === "string" ? name : "" },
964
+ origin,
965
+ previewOrigin
966
+ };
967
+ }
968
+ function parseHeaders(v) {
969
+ if (!Array.isArray(v) || v.length > MAX_HEADER_ENTRIES) return null;
970
+ let bytes = 0;
971
+ const out = [];
972
+ for (const h of v) {
973
+ if (!Array.isArray(h) || h.length !== 2) return null;
974
+ const [name, value] = h;
975
+ if (typeof name !== "string" || typeof value !== "string") return null;
976
+ if (!/^[!#$%&'*+.^_`|~0-9a-z-]+$/i.test(name) || !headerSafe(value)) return null;
977
+ bytes += name.length + value.length + 4;
978
+ out.push([name.toLowerCase(), value]);
979
+ }
980
+ return bytes <= MAX_HEADER_BYTES ? out : null;
981
+ }
982
+ var Relay = class {
983
+ constructor(opts) {
984
+ this.opts = opts;
985
+ this.idleMs = opts.idleMs ?? IDLE_MS;
986
+ }
987
+ opts;
988
+ streams = /* @__PURE__ */ new Map();
989
+ /**
990
+ * Streams still being admitted (the preview ports are looked up first),
991
+ * with the body frames and `req.end` that arrived meanwhile; a reset
992
+ * meanwhile removes the entry, and the stream is then never opened.
993
+ */
994
+ early = /* @__PURE__ */ new Map();
995
+ lastId = 0;
996
+ closed = false;
997
+ idleMs;
998
+ get open() {
999
+ return this.streams.size;
1000
+ }
1001
+ /** A control message about a stream. */
1002
+ control(msg) {
1003
+ if (this.closed) return;
1004
+ const id = typeof msg.id === "number" ? msg.id : -1;
1005
+ switch (msg.t) {
1006
+ case "req":
1007
+ case "ws":
1008
+ if (this.streams.has(id) || this.early.has(id)) break;
1009
+ this.early.set(id, { frames: [], bytes: 0, end: false });
1010
+ void (msg.t === "req" ? this.request(id, msg) : this.socket(id, msg));
1011
+ break;
1012
+ case "req.end": {
1013
+ const e = this.early.get(id);
1014
+ if (e) e.end = true;
1015
+ const s = this.streams.get(id);
1016
+ if (s?.kind === "http") s.req.end();
1017
+ break;
1018
+ }
1019
+ case "credit": {
1020
+ const s = this.streams.get(id);
1021
+ if (s && typeof msg.bytes === "number" && msg.bytes > 0) this.credited(s, msg.bytes);
1022
+ break;
1023
+ }
1024
+ case "reset":
1025
+ this.early.delete(id);
1026
+ this.drop(id);
1027
+ break;
1028
+ case "ws.close": {
1029
+ const s = this.streams.get(id);
1030
+ if (s?.kind !== "ws") break;
1031
+ this.streams.delete(id);
1032
+ const code = typeof msg.code === "number" ? msg.code : 1e3;
1033
+ const reason = typeof msg.reason === "string" ? msg.reason.slice(0, 123) : "";
1034
+ try {
1035
+ s.ws.close(closable(code), reason);
1036
+ } catch {
1037
+ s.ws.terminate();
1038
+ }
1039
+ break;
1040
+ }
1041
+ }
1042
+ }
1043
+ /** A binary frame: request body, or a WebSocket message for the local side. */
1044
+ frame(kind, id, payload) {
1045
+ const { window, maxFrame, maxWsMessage, maxBody } = this.opts.limits;
1046
+ const e = this.early.get(id);
1047
+ if (e) {
1048
+ if (e.bytes >= window) {
1049
+ this.early.delete(id);
1050
+ return this.reset(id, "protocol", "The credit window was exceeded.", { force: true });
1051
+ }
1052
+ e.bytes += payload.length;
1053
+ e.frames.push([kind, payload]);
1054
+ return;
1055
+ }
1056
+ const s = this.streams.get(id);
1057
+ if (!s) return;
1058
+ if (s.flow.in >= window) return this.reset(s.id, "protocol", "The credit window was exceeded.");
1059
+ s.flow.in += payload.length;
1060
+ if (s.kind === "http") {
1061
+ if (kind !== FRAME_HTTP || payload.length > maxFrame) {
1062
+ return this.reset(s.id, "protocol", "Unexpected frame for an HTTP stream.");
1063
+ }
1064
+ s.received += payload.length;
1065
+ if (s.received > maxBody) return this.reset(s.id, "too_large");
1066
+ this.touch(s);
1067
+ s.req.write(payload, () => this.passed(s, payload.length));
1068
+ return;
1069
+ }
1070
+ if (kind !== FRAME_WS_TEXT && kind !== FRAME_WS_BINARY || !s.accepted) {
1071
+ return this.reset(s.id, "protocol", "Unexpected frame for a WebSocket stream.");
1072
+ }
1073
+ if (payload.length > maxWsMessage) return this.reset(s.id, "too_large");
1074
+ s.ws.send(payload, { binary: kind === FRAME_WS_BINARY }, () => this.passed(s, payload.length));
1075
+ }
1076
+ /** The device socket is gone: every stream on it ends (§7). */
1077
+ closeAll() {
1078
+ this.closed = true;
1079
+ this.early.clear();
1080
+ for (const id of [...this.streams.keys()]) this.drop(id);
1081
+ }
1082
+ /** Open a stream admitted meanwhile, with what arrived for it; false when it was reset first. */
1083
+ opened(s) {
1084
+ const e = this.early.get(s.id);
1085
+ if (!e) {
1086
+ this.drop(s.id);
1087
+ return false;
1088
+ }
1089
+ this.early.delete(s.id);
1090
+ for (const [kind, payload] of e.frames) this.frame(kind, s.id, payload);
1091
+ if (e.end && s.kind === "http" && this.streams.get(s.id) === s) s.req.end();
1092
+ return true;
1093
+ }
1094
+ passed(s, n) {
1095
+ if (this.streams.get(s.id) !== s) return;
1096
+ s.flow.passed += n;
1097
+ const drained = s.kind === "http" ? s.req.writableLength === 0 : s.ws.bufferedAmount === 0;
1098
+ const batch = Math.min(CREDIT_BATCH, Math.floor(this.opts.limits.window / 2));
1099
+ if (s.flow.passed >= batch || drained) {
1100
+ this.opts.send({ t: "credit", id: s.id, bytes: s.flow.passed });
1101
+ s.flow.in -= s.flow.passed;
1102
+ s.flow.passed = 0;
1103
+ }
1104
+ }
1105
+ credited(s, n) {
1106
+ s.flow.out = Math.max(0, s.flow.out - n);
1107
+ if (s.kind === "http") return this.flush(s);
1108
+ if (s.flow.out >= this.opts.limits.window) return;
1109
+ if (s.paused) {
1110
+ s.paused = false;
1111
+ s.ws.resume();
1112
+ }
1113
+ }
1114
+ /** Send one WebSocket message to the gateway; true while the stream's window still has room. */
1115
+ sendMessage(s, kind, data) {
1116
+ this.opts.sendFrame(encodeFrame(kind, s.id, data));
1117
+ s.flow.out += data.length;
1118
+ return s.flow.out < this.opts.limits.window;
1119
+ }
1120
+ /**
1121
+ * Send queued response body while the window has room, a frame of at most
1122
+ * maxFrame at a time (§6.1); the local answer is paused while any waits, and
1123
+ * `res.end` follows the last of it.
1124
+ */
1125
+ flush(s) {
1126
+ const { maxFrame, window } = this.opts.limits;
1127
+ while (s.queue.length && s.flow.out < window) {
1128
+ const head = s.queue[0];
1129
+ const piece = head.subarray(0, maxFrame);
1130
+ if (piece.length === head.length) s.queue.shift();
1131
+ else s.queue[0] = head.subarray(maxFrame);
1132
+ this.opts.sendFrame(encodeFrame(FRAME_HTTP, s.id, piece));
1133
+ s.flow.out += piece.length;
1134
+ }
1135
+ if (s.queue.length) s.res?.pause();
1136
+ else if (s.ended) this.finish(s);
1137
+ else s.res?.resume();
1138
+ }
1139
+ reset(id, code, message, extra = {}) {
1140
+ const was = this.streams.has(id);
1141
+ this.drop(id);
1142
+ if (was || extra.force) {
1143
+ const { force: _, ...rest } = extra;
1144
+ void _;
1145
+ this.opts.send({ t: "reset", id, code, ...message ? { message } : {}, ...rest });
1146
+ }
1147
+ }
1148
+ /** Forget a stream and abort its local side, sending nothing. */
1149
+ drop(id) {
1150
+ const s = this.streams.get(id);
1151
+ if (!s) return;
1152
+ this.streams.delete(id);
1153
+ if (s.kind === "http") {
1154
+ if (s.idle) clearTimeout(s.idle);
1155
+ s.req.destroy();
1156
+ s.res?.destroy();
1157
+ } else s.ws.terminate();
1158
+ }
1159
+ touch(s) {
1160
+ if (!s.res) return;
1161
+ if (s.idle) clearTimeout(s.idle);
1162
+ s.idle = setTimeout(() => this.reset(s.id, "timeout"), this.idleMs);
1163
+ s.idle.unref?.();
1164
+ }
1165
+ /**
1166
+ * What the request may reach, or the reset that refuses it (§6.4): the
1167
+ * stream id is new, the target is Wheelhouse or one of its previews, the path
1168
+ * is an absolute path that is not the restart, and the cloud is on here.
1169
+ */
1170
+ async admit(id, msg) {
1171
+ if (!Number.isInteger(id) || id <= this.lastId || id > 4294967295) {
1172
+ return { ok: false, code: "protocol", message: "Stream ids must increase." };
1173
+ }
1174
+ this.lastId = id;
1175
+ if (this.streams.size >= this.opts.limits.maxStreams) return { ok: false, code: "limit" };
1176
+ const relay = parseRelay(msg.relay);
1177
+ const headers = parseHeaders(msg.headers);
1178
+ const path17 = msg.path;
1179
+ if (!relay || !headers || typeof path17 !== "string" || !path17.startsWith("/") || path17.length > 8192 || !headerSafe(path17) || path17.includes(" ")) {
1180
+ return { ok: false, code: "protocol", message: "The request is malformed." };
1181
+ }
1182
+ if (!this.opts.targets.enabled()) {
1183
+ return {
1184
+ ok: false,
1185
+ code: "refused",
1186
+ message: "Wheelhouse Cloud is turned off on this machine."
1187
+ };
1188
+ }
1189
+ if (isRestartPath(path17)) {
1190
+ return {
1191
+ ok: false,
1192
+ code: "refused",
1193
+ message: "Wheelhouse cannot be restarted through the cloud."
1194
+ };
1195
+ }
1196
+ const target = isObj2(msg.target) ? msg.target : {};
1197
+ const app = this.opts.targets.appPort();
1198
+ if (target.kind === "app") {
1199
+ return { ok: true, port: app, host: "127.0.0.1", path: path17, headers, relay };
1200
+ }
1201
+ const port = target.port;
1202
+ if (target.kind !== "port" || typeof port !== "number" || !Number.isInteger(port) || port < 1 || port > 65535) {
1203
+ return { ok: false, code: "protocol", message: "Unknown target." };
1204
+ }
1205
+ if (port === app || !(await this.opts.targets.previewPorts()).has(port)) {
1206
+ return { ok: false, code: "refused", message: "That port is not a Wheelhouse preview." };
1207
+ }
1208
+ return { ok: true, port, host: "localhost", path: path17, headers, relay };
1209
+ }
1210
+ /** §6.3: the headers for the local request. */
1211
+ localHeaders(a, originChecked, ws) {
1212
+ const out = {};
1213
+ for (const [name, value] of a.headers) {
1214
+ if (HOP_BY_HOP.has(name) || name === "host" || name === "origin") continue;
1215
+ if (name.startsWith("x-wheelhouse-remote")) continue;
1216
+ if (ws && name.startsWith("sec-websocket-")) continue;
1217
+ const had = out[name];
1218
+ if (had === void 0) out[name] = value;
1219
+ else if (name === "cookie") out[name] = `${had}; ${value}`;
1220
+ else out[name] = Array.isArray(had) ? [...had, value] : [had, value];
1221
+ }
1222
+ const local = `${a.host}:${a.port}`;
1223
+ out.host = local;
1224
+ if (originChecked) out.origin = `http://${local}`;
1225
+ out["x-wheelhouse-remote"] = "1";
1226
+ out["x-wheelhouse-remote-user"] = a.relay.user.id;
1227
+ out["x-wheelhouse-remote-session"] = a.relay.sessionId;
1228
+ out["x-wheelhouse-remote-origin"] = a.relay.origin;
1229
+ out["x-wheelhouse-remote-preview"] = a.relay.previewOrigin;
1230
+ return out;
1231
+ }
1232
+ async request(id, msg) {
1233
+ const a = await this.admit(id, msg);
1234
+ if (this.closed || !this.early.has(id)) return;
1235
+ const method = typeof msg.method === "string" && /^[A-Z]{1,20}$/.test(msg.method) ? msg.method : null;
1236
+ if (!a.ok || !method) {
1237
+ this.early.delete(id);
1238
+ if (!a.ok) return this.reset(id, a.code, a.message, { force: true });
1239
+ return this.reset(id, "protocol", "The method is malformed.", { force: true });
1240
+ }
1241
+ this.opts.onRelayed?.(a.relay);
1242
+ const req = http.request({
1243
+ host: a.host,
1244
+ port: a.port,
1245
+ method,
1246
+ path: a.path,
1247
+ headers: this.localHeaders(a, msg.originChecked === true, false),
1248
+ setHost: false
1249
+ });
1250
+ const s = {
1251
+ kind: "http",
1252
+ id,
1253
+ flow: { out: 0, in: 0, passed: 0 },
1254
+ req,
1255
+ res: null,
1256
+ queue: [],
1257
+ ended: false,
1258
+ received: 0,
1259
+ idle: null
1260
+ };
1261
+ this.streams.set(id, s);
1262
+ req.on("error", (e) => {
1263
+ if (this.streams.get(id) !== s) return;
1264
+ const refused2 = !s.res && ["ECONNREFUSED", "ECONNRESET", "EHOSTUNREACH", "ENOTFOUND"].includes(e.code ?? "");
1265
+ this.reset(id, refused2 ? "unreachable" : "internal");
1266
+ });
1267
+ req.on("response", (res) => this.respond(s, method, res, a));
1268
+ if (msg.body !== true) req.end();
1269
+ this.opened(s);
1270
+ }
1271
+ respond(s, method, res, a) {
1272
+ if (this.streams.get(s.id) !== s) return void res.destroy();
1273
+ s.res = res;
1274
+ const headers = [];
1275
+ let bytes = 0;
1276
+ const raw = res.rawHeaders;
1277
+ for (let i = 0; i + 1 < raw.length; i += 2) {
1278
+ const name = raw[i].toLowerCase();
1279
+ if (HOP_BY_HOP.has(name)) continue;
1280
+ let value = raw[i + 1];
1281
+ if (name === "location") value = relativeLocation(value, a.host, a.port);
1282
+ bytes += name.length + value.length + 4;
1283
+ headers.push([name, value]);
1284
+ }
1285
+ if (headers.length > MAX_HEADER_ENTRIES || bytes > MAX_HEADER_BYTES) {
1286
+ return this.reset(s.id, "protocol", "The local answer\u2019s headers are too large.");
1287
+ }
1288
+ this.opts.send({ t: "res", id: s.id, status: res.statusCode ?? 502, headers });
1289
+ this.touch(s);
1290
+ const status = res.statusCode ?? 0;
1291
+ if (method === "HEAD" || status === 204 || status === 304) {
1292
+ res.resume();
1293
+ this.finish(s);
1294
+ return;
1295
+ }
1296
+ res.on("data", (chunk) => {
1297
+ if (this.streams.get(s.id) !== s) return;
1298
+ this.touch(s);
1299
+ s.queue.push(chunk);
1300
+ this.flush(s);
1301
+ });
1302
+ res.on("end", () => {
1303
+ if (this.streams.get(s.id) !== s) return;
1304
+ s.ended = true;
1305
+ this.flush(s);
1306
+ });
1307
+ res.on("error", () => {
1308
+ if (this.streams.get(s.id) === s) this.reset(s.id, "internal");
1309
+ });
1310
+ }
1311
+ finish(s) {
1312
+ if (this.streams.get(s.id) !== s) return;
1313
+ this.opts.send({ t: "res.end", id: s.id });
1314
+ this.streams.delete(s.id);
1315
+ if (s.idle) clearTimeout(s.idle);
1316
+ if (!s.req.writableFinished) s.req.destroy();
1317
+ }
1318
+ async socket(id, msg) {
1319
+ const a = await this.admit(id, msg);
1320
+ if (this.closed || !this.early.has(id)) return;
1321
+ if (!a.ok) {
1322
+ this.early.delete(id);
1323
+ return this.reset(id, a.code, a.message, { force: true });
1324
+ }
1325
+ const protocols = Array.isArray(msg.protocols) ? msg.protocols.filter(
1326
+ (p) => typeof p === "string" && /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(p)
1327
+ ) : [];
1328
+ this.opts.onRelayed?.(a.relay);
1329
+ const headers = this.localHeaders(a, msg.originChecked === true, true);
1330
+ const ws = new WebSocket(`ws://${a.host}:${a.port}${a.path}`, protocols, {
1331
+ headers,
1332
+ perMessageDeflate: false,
1333
+ handshakeTimeout: this.opts.wsHandshakeMs ?? WS_HANDSHAKE_MS,
1334
+ maxPayload: this.opts.limits.maxWsMessage,
1335
+ followRedirects: false
1336
+ });
1337
+ const s = {
1338
+ kind: "ws",
1339
+ id,
1340
+ flow: { out: 0, in: 0, passed: 0 },
1341
+ ws,
1342
+ accepted: false,
1343
+ paused: false
1344
+ };
1345
+ this.streams.set(id, s);
1346
+ if (!this.opened(s)) return;
1347
+ const mine = () => this.streams.get(id) === s;
1348
+ ws.on("unexpected-response", (req, res) => {
1349
+ const status = res.statusCode ?? 502;
1350
+ res.resume();
1351
+ req.destroy();
1352
+ if (mine())
1353
+ this.reset(id, status === 403 || status === 401 ? "refused" : "unreachable", void 0, {
1354
+ status
1355
+ });
1356
+ });
1357
+ ws.on("open", () => {
1358
+ if (!mine()) return void ws.terminate();
1359
+ s.accepted = true;
1360
+ this.opts.send({ t: "ws.accept", id, protocol: ws.protocol || null });
1361
+ });
1362
+ ws.on("message", (data, isBinary) => {
1363
+ if (!mine()) return;
1364
+ const buf = Buffer.isBuffer(data) ? data : Array.isArray(data) ? Buffer.concat(data) : Buffer.from(data);
1365
+ if (buf.length > this.opts.limits.maxWsMessage) return this.reset(id, "too_large");
1366
+ if (!this.sendMessage(s, isBinary ? FRAME_WS_BINARY : FRAME_WS_TEXT, buf) && !s.paused) {
1367
+ s.paused = true;
1368
+ ws.pause();
1369
+ }
1370
+ });
1371
+ ws.on("error", (e) => {
1372
+ if (!mine()) return;
1373
+ if (s.accepted) return this.reset(id, "internal");
1374
+ this.reset(id, /timed out/i.test(e.message) ? "timeout" : "unreachable");
1375
+ });
1376
+ ws.on("close", (code, reason) => {
1377
+ if (!mine()) return;
1378
+ this.streams.delete(id);
1379
+ if (!s.accepted) return this.opts.send({ t: "reset", id, code: "unreachable" });
1380
+ const sent = code === 1005 ? 1e3 : code === 1006 ? 1011 : code;
1381
+ this.opts.send({
1382
+ t: "ws.close",
1383
+ id,
1384
+ code: sent,
1385
+ reason: reason.toString("utf8").slice(0, 123)
1386
+ });
1387
+ });
1388
+ }
1389
+ };
1390
+ function closable(code) {
1391
+ if (code === 1e3 || code >= 3e3 && code <= 4999) return code;
1392
+ if (code >= 1001 && code <= 1014 && ![1004, 1005, 1006].includes(code)) return code;
1393
+ return 1e3;
1394
+ }
1395
+ function relativeLocation(value, host, port) {
1396
+ const u = URL.parse(value);
1397
+ if (!u || u.protocol !== "http:") return value;
1398
+ const same = u.port === String(port) && (u.hostname === host || u.hostname === "127.0.0.1" || u.hostname === "localhost");
1399
+ return same ? `${u.pathname}${u.search}${u.hash}` : value;
1400
+ }
1401
+
1402
+ // src/lib/server/cloud/connector.ts
1403
+ var HELLO_MS = 15e3;
1404
+ var STABLE_MS = 6e4;
1405
+ var isObj3 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
1406
+ function connectUrl(gateway) {
1407
+ const u = new URL("/v1/connect", gateway);
1408
+ u.protocol = u.protocol === "https:" ? "wss:" : "ws:";
1409
+ return u.href;
1410
+ }
1411
+ var Connector = class {
1412
+ constructor(opts) {
1413
+ this.opts = opts;
1414
+ this.random = opts.random ?? Math.random;
1415
+ }
1416
+ opts;
1417
+ state = "connecting";
1418
+ ws = null;
1419
+ relay = null;
1420
+ attempt = 0;
1421
+ retry = null;
1422
+ watchdog = null;
1423
+ stable = null;
1424
+ stopped = false;
1425
+ random;
1426
+ start() {
1427
+ this.stopped = false;
1428
+ this.connect();
1429
+ }
1430
+ /** Close the socket and stop reconnecting. */
1431
+ stop(reason = null) {
1432
+ if (this.stopped) return;
1433
+ this.stopped = true;
1434
+ if (this.retry) clearTimeout(this.retry);
1435
+ this.retry = null;
1436
+ this.teardown();
1437
+ const ws = this.ws;
1438
+ this.ws = null;
1439
+ if (ws) {
1440
+ try {
1441
+ ws.close(1e3);
1442
+ } catch {
1443
+ ws.terminate();
1444
+ }
1445
+ setTimeout(() => ws.terminate(), 2e3).unref?.();
1446
+ }
1447
+ this.set("stopped", reason);
1448
+ }
1449
+ set(state, reason) {
1450
+ this.state = state;
1451
+ this.opts.events.state(state, reason);
1452
+ }
1453
+ log(line) {
1454
+ this.opts.events.log?.(line);
1455
+ }
1456
+ teardown() {
1457
+ if (this.watchdog) clearTimeout(this.watchdog);
1458
+ if (this.stable) clearTimeout(this.stable);
1459
+ this.watchdog = this.stable = null;
1460
+ this.relay?.closeAll();
1461
+ this.relay = null;
1462
+ }
1463
+ connect() {
1464
+ if (this.stopped) return;
1465
+ this.set("connecting", null);
1466
+ const ws = new WebSocket2(connectUrl(this.opts.gateway), {
1467
+ headers: { "X-WHC-Protocol": String(PROTOCOL) },
1468
+ perMessageDeflate: false,
1469
+ handshakeTimeout: 15e3,
1470
+ maxPayload: DEFAULT_LIMITS.maxWsMessage + 5 + 1024,
1471
+ followRedirects: false
1472
+ });
1473
+ this.ws = ws;
1474
+ let limits = DEFAULT_LIMITS;
1475
+ let ready = false;
1476
+ let heartbeatMs = 2e4;
1477
+ const mine = () => this.ws === ws;
1478
+ const send = (msg) => {
1479
+ if (mine() && ws.readyState === WebSocket2.OPEN) ws.send(JSON.stringify(msg));
1480
+ };
1481
+ const alive3 = (ms) => {
1482
+ if (this.watchdog) clearTimeout(this.watchdog);
1483
+ this.watchdog = setTimeout(() => {
1484
+ this.log("The gateway went quiet; reconnecting.");
1485
+ ws.terminate();
1486
+ }, ms);
1487
+ this.watchdog.unref?.();
1488
+ };
1489
+ let upgradeStatus = null;
1490
+ ws.on("unexpected-response", (req, res) => {
1491
+ upgradeStatus = res.statusCode ?? 0;
1492
+ res.resume();
1493
+ req.destroy();
1494
+ ws.emit("close", upgradeStatus === 426 ? 4426 : 1006, Buffer.alloc(0));
1495
+ });
1496
+ ws.on("open", () => alive3(this.opts.helloMs ?? HELLO_MS));
1497
+ ws.on("message", (data, isBinary) => {
1498
+ if (!mine()) return;
1499
+ this.opts.events.seen?.();
1500
+ alive3(ready ? heartbeatMs * 3 : this.opts.helloMs ?? HELLO_MS);
1501
+ if (isBinary) {
1502
+ const f = ready ? decodeFrame(data) : null;
1503
+ if (f) this.relay?.frame(f.kind, f.id, f.payload);
1504
+ return;
1505
+ }
1506
+ if (data.length > MAX_CONTROL_BYTES) return;
1507
+ let msg;
1508
+ try {
1509
+ msg = JSON.parse(data.toString("utf8"));
1510
+ } catch {
1511
+ return;
1512
+ }
1513
+ if (!isObj3(msg) || typeof msg.t !== "string") return;
1514
+ if (!ready) {
1515
+ if (msg.t === "hello" && typeof msg.nonce === "string") {
1516
+ if (typeof msg.protocol === "number" && msg.protocol < PROTOCOL) {
1517
+ this.log(
1518
+ `The gateway speaks protocol ${msg.protocol}; this Wheelhouse speaks ${PROTOCOL}.`
1519
+ );
1520
+ }
1521
+ send({
1522
+ t: "auth",
1523
+ protocol: PROTOCOL,
1524
+ deviceId: this.opts.deviceId,
1525
+ sig: connectSig(this.opts.key, msg.nonce, this.opts.deviceId),
1526
+ agent: { name: "wheelhouse", version: this.opts.version },
1527
+ features: []
1528
+ });
1529
+ } else if (msg.t === "ready") {
1530
+ ready = true;
1531
+ if (typeof msg.heartbeatMs === "number" && msg.heartbeatMs >= 1e3) {
1532
+ heartbeatMs = msg.heartbeatMs;
1533
+ }
1534
+ limits = readLimits(msg.limits);
1535
+ alive3(heartbeatMs * 3);
1536
+ this.relay = new Relay({
1537
+ limits,
1538
+ targets: this.opts.targets,
1539
+ send,
1540
+ sendFrame: (frame) => {
1541
+ if (mine() && ws.readyState === WebSocket2.OPEN) ws.send(frame, { binary: true });
1542
+ },
1543
+ onRelayed: (r) => this.opts.events.relayed?.(r)
1544
+ });
1545
+ this.stable = setTimeout(() => this.attempt = 0, this.opts.stableMs ?? STABLE_MS);
1546
+ this.stable.unref?.();
1547
+ this.set("online", null);
1548
+ }
1549
+ return;
1550
+ }
1551
+ if (msg.t === "ping") return send({ t: "pong", ts: msg.ts });
1552
+ if (msg.t === "pong") return;
1553
+ this.relay?.control(msg);
1554
+ });
1555
+ ws.on("error", (e) => {
1556
+ if (mine()) this.log(`Gateway connection error: ${e.message}`);
1557
+ });
1558
+ ws.on("close", (code) => {
1559
+ if (!mine()) return;
1560
+ this.ws = null;
1561
+ this.teardown();
1562
+ if (this.stopped) return;
1563
+ const action = closeAction(code);
1564
+ if (action.kind === "stop") {
1565
+ this.stopped = true;
1566
+ if (action.forget) this.opts.events.revoked?.();
1567
+ this.set("stopped", action.reason);
1568
+ return;
1569
+ }
1570
+ if (action.note) this.log(`The gateway closed the connection: ${action.note}.`);
1571
+ const wait = Math.max(action.minDelayMs ?? 0, backoffMs(this.attempt, this.random));
1572
+ this.attempt = Math.min(this.attempt + 1, 16);
1573
+ const reason = upgradeStatus ? `The gateway answered ${upgradeStatus}; trying again.` : ready ? "The connection dropped; reconnecting." : "Could not reach the gateway; trying again.";
1574
+ this.set("connecting", reason);
1575
+ this.retry = setTimeout(() => this.connect(), wait);
1576
+ this.retry.unref?.();
1577
+ });
1578
+ }
1579
+ };
1580
+ function readLimits(v) {
1581
+ const out = { ...DEFAULT_LIMITS };
1582
+ if (!isObj3(v)) return out;
1583
+ for (const k of Object.keys(out)) {
1584
+ const n = v[k];
1585
+ if (typeof n === "number" && Number.isInteger(n) && n > 0) out[k] = n;
1586
+ }
1587
+ return out;
1588
+ }
1589
+
1590
+ // src/lib/server/cloud/service.ts
1591
+ var POLL_MS = 3e3;
1592
+ var SEEN_WRITE_MS = 15e3;
1593
+ var MAX_SESSIONS = 20;
1594
+ var HOLDER_FRESH_MS = 3 * 6e4;
1595
+ var CloudService = class {
1596
+ constructor(opts) {
1597
+ this.opts = opts;
1598
+ this.pid = opts.pid ?? process.pid;
1599
+ this.now = opts.now ?? Date.now;
1600
+ }
1601
+ opts;
1602
+ connector = null;
1603
+ /** The device and gateway the connector was started for, and the settings stamp then. */
1604
+ running = null;
1605
+ stamp = "";
1606
+ timer = null;
1607
+ enabled = false;
1608
+ status = null;
1609
+ writing = Promise.resolve();
1610
+ lastSeenWrite = 0;
1611
+ /** Why the connector stopped by itself; it stays stopped until the settings change. */
1612
+ halted = false;
1613
+ sessions = /* @__PURE__ */ new Map();
1614
+ pid;
1615
+ now;
1616
+ ticking = false;
1617
+ /** Stopped: a look still in flight must not start a connector. */
1618
+ closed = false;
1619
+ /** Start watching the settings; resolves after the first look. */
1620
+ async start() {
1621
+ this.closed = false;
1622
+ await this.tick();
1623
+ this.timer = setInterval(() => void this.tick(), this.opts.pollMs ?? POLL_MS);
1624
+ this.timer.unref?.();
1625
+ }
1626
+ /** Close the socket and stop watching; the status says the connector stopped. */
1627
+ async stop() {
1628
+ this.closed = true;
1629
+ if (this.timer) clearInterval(this.timer);
1630
+ this.timer = null;
1631
+ this.halt();
1632
+ await this.writing;
1633
+ }
1634
+ get state() {
1635
+ return this.connector?.state ?? "idle";
1636
+ }
1637
+ halt() {
1638
+ const c = this.connector;
1639
+ this.connector = null;
1640
+ this.running = null;
1641
+ c?.stop();
1642
+ if (this.status && this.status.pid === this.pid) {
1643
+ this.write({ ...this.status, state: "stopped", reason: null, since: null });
1644
+ }
1645
+ }
1646
+ write(s) {
1647
+ this.status = s;
1648
+ const next = { ...s, updatedAt: new Date(this.now()).toISOString() };
1649
+ this.writing = this.writing.then(() => this.opts.settings.writeStatus(next)).catch(
1650
+ (e) => this.opts.log(`Wheelhouse Cloud could not write its status: ${e.message}`)
1651
+ );
1652
+ }
1653
+ /** Another live process holds the device's socket. */
1654
+ async heldElsewhere(deviceId) {
1655
+ const s = await this.opts.settings.readStatus();
1656
+ if (!s || s.pid === this.pid || s.deviceId !== deviceId || s.state === "stopped") return null;
1657
+ const fresh = this.now() - Date.parse(s.updatedAt) < HOLDER_FRESH_MS;
1658
+ return fresh && alive(s.pid) ? s.pid : null;
1659
+ }
1660
+ async tick() {
1661
+ if (this.ticking || this.closed) return;
1662
+ this.ticking = true;
1663
+ try {
1664
+ await this.look();
1665
+ } finally {
1666
+ this.ticking = false;
1667
+ }
1668
+ }
1669
+ async look() {
1670
+ const stamp = await this.opts.settings.stamp();
1671
+ const changed = stamp !== this.stamp;
1672
+ this.stamp = stamp;
1673
+ if (changed) this.halted = false;
1674
+ const { settings: settings2 } = await this.opts.settings.read();
1675
+ this.enabled = settings2.enabled;
1676
+ const device = settings2.enabled ? settings2.device : null;
1677
+ if (!device || this.halted) {
1678
+ if (this.connector) {
1679
+ if (!device) this.opts.log("Wheelhouse Cloud is off or not paired here; disconnected.");
1680
+ this.halt();
1681
+ }
1682
+ return;
1683
+ }
1684
+ const same = this.running && this.running.deviceId === device.id && this.running.gateway === device.gateway;
1685
+ if (same) return;
1686
+ if (this.connector) this.halt();
1687
+ const holder = await this.heldElsewhere(device.id);
1688
+ if (holder) {
1689
+ if (changed) {
1690
+ this.opts.log(
1691
+ `Wheelhouse Cloud is already connected by process ${holder}; leaving it to that one.`
1692
+ );
1693
+ }
1694
+ return;
1695
+ }
1696
+ const found = await this.opts.settings.findKey();
1697
+ if (this.closed) return;
1698
+ if (!found) {
1699
+ if (changed)
1700
+ this.opts.log(
1701
+ "Wheelhouse Cloud: this machine\u2019s device key is missing. Pair it again: wheelhouse remote connect."
1702
+ );
1703
+ return;
1704
+ }
1705
+ const before = await this.opts.settings.readStatus();
1706
+ if (this.closed) return;
1707
+ const seen = before?.deviceId === device.id ? [...before.sessions].reverse() : [];
1708
+ this.sessions = new Map(seen.map((s) => [s.id, s]));
1709
+ this.running = { deviceId: device.id, gateway: device.gateway };
1710
+ const base = {
1711
+ pid: this.pid,
1712
+ state: "connecting",
1713
+ reason: null,
1714
+ gateway: device.gateway,
1715
+ deviceId: device.id,
1716
+ since: null,
1717
+ lastSeen: null,
1718
+ updatedAt: "",
1719
+ sessions: [...this.sessions.values()].reverse()
1720
+ };
1721
+ this.status = base;
1722
+ const connector = new Connector({
1723
+ gateway: device.gateway,
1724
+ deviceId: device.id,
1725
+ key: found.key,
1726
+ version: this.opts.version,
1727
+ targets: {
1728
+ appPort: this.opts.appPort,
1729
+ previewPorts: this.opts.previewPorts,
1730
+ enabled: () => this.enabled
1731
+ },
1732
+ events: {
1733
+ state: (state, reason) => {
1734
+ if (this.connector !== connector) return;
1735
+ const at = new Date(this.now()).toISOString();
1736
+ const was = this.status?.state;
1737
+ this.write({
1738
+ ...this.status,
1739
+ state,
1740
+ reason,
1741
+ since: state === "online" ? at : null,
1742
+ lastSeen: state === "online" ? at : this.status.lastSeen
1743
+ });
1744
+ if (state === "online" && was !== "online") {
1745
+ this.opts.log(`Wheelhouse Cloud: connected to ${device.gateway} as ${device.name}.`);
1746
+ }
1747
+ if (state === "stopped" && reason) {
1748
+ this.halted = true;
1749
+ this.running = null;
1750
+ this.connector = null;
1751
+ this.opts.log(`Wheelhouse Cloud stopped: ${reason}`);
1752
+ }
1753
+ },
1754
+ seen: () => {
1755
+ if (this.connector !== connector || !this.status) return;
1756
+ const now = this.now();
1757
+ this.status.lastSeen = new Date(now).toISOString();
1758
+ if (now - this.lastSeenWrite >= SEEN_WRITE_MS) {
1759
+ this.lastSeenWrite = now;
1760
+ this.write(this.status);
1761
+ }
1762
+ },
1763
+ relayed: (r) => this.relayed(r),
1764
+ revoked: () => {
1765
+ void this.opts.settings.forget().catch(() => {
1766
+ });
1767
+ },
1768
+ log: (line) => this.opts.log(`Wheelhouse Cloud: ${line}`)
1769
+ }
1770
+ });
1771
+ this.connector = connector;
1772
+ this.write(base);
1773
+ connector.start();
1774
+ }
1775
+ /** §6.4: a local log of each relay session, without paths, bodies or header values. */
1776
+ relayed(r) {
1777
+ const at = new Date(this.now()).toISOString();
1778
+ const had = this.sessions.get(r.sessionId);
1779
+ if (!had) {
1780
+ this.opts.log(
1781
+ `Wheelhouse Cloud: relay session ${r.sessionId.slice(0, 8)} opened by ${r.user.name || r.user.id}.`
1782
+ );
1783
+ }
1784
+ 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 };
1785
+ this.sessions.delete(r.sessionId);
1786
+ this.sessions.set(r.sessionId, s);
1787
+ while (this.sessions.size > MAX_SESSIONS)
1788
+ this.sessions.delete(this.sessions.keys().next().value);
1789
+ if (!this.status) return;
1790
+ this.status.sessions = [...this.sessions.values()].reverse();
1791
+ if (!had) this.write(this.status);
1792
+ }
1793
+ };
1794
+
443
1795
  // src/lib/server/plugins/installed.ts
444
- import { mkdir as mkdir2, readFile as readFile2, rename as rename2, writeFile as writeFile2 } from "node:fs/promises";
1796
+ import { mkdir as mkdir3, readFile as readFile3, rename as rename3, writeFile as writeFile3 } from "node:fs/promises";
445
1797
  import { homedir as homedir2 } from "node:os";
446
- import path3 from "node:path";
1798
+ import path4 from "node:path";
447
1799
  var INSTALLED_FILE = "installed.json";
448
1800
  var SCHEMA = "wheelhouse-installed-plugins.v1";
449
1801
  var EMPTY_INSTALLED = () => ({ schema: SCHEMA, plugins: {} });
450
1802
  function defaultPluginsDir(env) {
451
- if (env.WHEELHOUSE_PLUGINS_DIR) return path3.resolve(env.WHEELHOUSE_PLUGINS_DIR);
452
- return path3.join(homedir2(), ".wheelhouse", "plugins");
1803
+ if (env.WHEELHOUSE_PLUGINS_DIR) return path4.resolve(env.WHEELHOUSE_PLUGINS_DIR);
1804
+ return path4.join(homedir2(), ".wheelhouse", "plugins");
453
1805
  }
454
1806
  var isRecord2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
455
1807
  function record(v) {
@@ -461,10 +1813,10 @@ function record(v) {
461
1813
  return { repository, ref, commit, version: version2, installedAt, enabled };
462
1814
  }
463
1815
  async function readInstalled(dir) {
464
- const file = path3.join(dir, INSTALLED_FILE);
1816
+ const file = path4.join(dir, INSTALLED_FILE);
465
1817
  let text2;
466
1818
  try {
467
- text2 = await readFile2(file, "utf8");
1819
+ text2 = await readFile3(file, "utf8");
468
1820
  } catch (e) {
469
1821
  if (e.code === "ENOENT")
470
1822
  return { ok: true, installed: EMPTY_INSTALLED() };
@@ -488,17 +1840,38 @@ async function readInstalled(dir) {
488
1840
  return { ok: true, installed };
489
1841
  }
490
1842
  async function writeInstalled(dir, installed) {
491
- await mkdir2(dir, { recursive: true });
492
- const file = path3.join(dir, INSTALLED_FILE);
1843
+ await mkdir3(dir, { recursive: true });
1844
+ const file = path4.join(dir, INSTALLED_FILE);
493
1845
  const tmp = `${file}.${process.pid}.tmp`;
494
- await writeFile2(tmp, `${JSON.stringify(installed, null, " ")}
1846
+ await writeFile3(tmp, `${JSON.stringify(installed, null, " ")}
495
1847
  `);
496
- await rename2(tmp, file);
1848
+ await rename3(tmp, file);
1849
+ }
1850
+
1851
+ // src/lib/server/setup/remembered.ts
1852
+ import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
1853
+ import path5 from "node:path";
1854
+ var REMEMBERED_FILE = "firstmate.json";
1855
+ var rememberedFile = (configDir) => path5.join(configDir, REMEMBERED_FILE);
1856
+ function readRemembered(configDir) {
1857
+ let raw;
1858
+ try {
1859
+ raw = JSON.parse(readFileSync(rememberedFile(configDir), "utf8"));
1860
+ } catch {
1861
+ return null;
1862
+ }
1863
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return null;
1864
+ const { firstmate, home } = raw;
1865
+ if (typeof firstmate !== "string" || !path5.isAbsolute(firstmate)) return null;
1866
+ if (home !== void 0 && home !== null && (typeof home !== "string" || !path5.isAbsolute(home))) {
1867
+ return null;
1868
+ }
1869
+ return { firstmate, home: typeof home === "string" ? home : null };
497
1870
  }
498
1871
 
499
1872
  // src/lib/server/store/store.ts
500
1873
  import { realpathSync } from "node:fs";
501
- import path4 from "node:path";
1874
+ import path6 from "node:path";
502
1875
 
503
1876
  // src/lib/inbox.ts
504
1877
  var SNOOZE_MS = 4 * 3600 * 1e3;
@@ -522,22 +1895,22 @@ var SUMMARY_SYSTEM = [
522
1895
 
523
1896
  // src/lib/server/store/store.ts
524
1897
  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");
1898
+ if (env.WHEELHOUSE_STATE_DIR) return path6.resolve(env.WHEELHOUSE_STATE_DIR);
1899
+ if (env.XDG_STATE_HOME) return path6.join(path6.resolve(env.XDG_STATE_HOME), "wheelhouse");
1900
+ return path6.join(env.HOME ?? "", ".local", "state", "wheelhouse");
528
1901
  }
529
1902
  function real(p) {
530
- const abs = path4.resolve(p);
1903
+ const abs = path6.resolve(p);
531
1904
  try {
532
1905
  return realpathSync(abs);
533
1906
  } catch {
534
- const parent = path4.dirname(abs);
535
- return parent === abs ? abs : path4.join(real(parent), path4.basename(abs));
1907
+ const parent = path6.dirname(abs);
1908
+ return parent === abs ? abs : path6.join(real(parent), path6.basename(abs));
536
1909
  }
537
1910
  }
538
1911
  function isInside(p, dir) {
539
- const rel = path4.relative(real(dir), real(p));
540
- return rel === "" || !rel.startsWith("..") && !path4.isAbsolute(rel);
1912
+ const rel = path6.relative(real(dir), real(p));
1913
+ return rel === "" || !rel.startsWith("..") && !path6.isAbsolute(rel);
541
1914
  }
542
1915
 
543
1916
  // src/lib/server/restart.ts
@@ -548,7 +1921,7 @@ function setRestart(fn) {
548
1921
  }
549
1922
 
550
1923
  // cli/gateway.ts
551
- import path6 from "node:path";
1924
+ import path8 from "node:path";
552
1925
  import { Argument, Command, InvalidArgumentError } from "commander";
553
1926
 
554
1927
  // src/lib/gateway.ts
@@ -559,20 +1932,20 @@ var DEFAULT_GATEWAY_ALERTS = ["question", "pr-green", "stuck"];
559
1932
  var PAIRING_MS = 10 * 6e4;
560
1933
 
561
1934
  // src/lib/server/gateway/channels/discord.ts
562
- import WebSocket from "ws";
1935
+ import WebSocket3 from "ws";
563
1936
  var DISCORD_API = "https://discord.com/api/v10";
564
1937
  var DISCORD_INTENTS = 1 << 12;
565
1938
  var REQUEST_TIMEOUT_MS = 15e3;
566
1939
  var wsTransport = {
567
1940
  fetch: (url, init) => fetch(url, init),
568
1941
  connect(url, on) {
569
- const ws = new WebSocket(url);
1942
+ const ws = new WebSocket3(url);
570
1943
  ws.on("message", (data) => on.message(data.toString()));
571
1944
  ws.on("close", (code) => on.close(code));
572
1945
  ws.on("error", (e) => on.error(e));
573
1946
  return {
574
1947
  send: (data) => {
575
- if (ws.readyState === WebSocket.OPEN) ws.send(data);
1948
+ if (ws.readyState === WebSocket3.OPEN) ws.send(data);
576
1949
  },
577
1950
  close: (code) => ws.close(code)
578
1951
  };
@@ -586,7 +1959,7 @@ var DiscordError = class extends Error {
586
1959
  }
587
1960
  status;
588
1961
  };
589
- var str = (v) => typeof v === "string" && v ? v : null;
1962
+ var str2 = (v) => typeof v === "string" && v ? v : null;
590
1963
  function sleep(ms, signal) {
591
1964
  return new Promise((resolve) => {
592
1965
  const t = setTimeout(done, ms);
@@ -598,7 +1971,7 @@ function sleep(ms, signal) {
598
1971
  signal?.addEventListener("abort", done, { once: true });
599
1972
  });
600
1973
  }
601
- async function call(transport, token, version2, method, route, what, body) {
1974
+ async function call(transport, token, version2, method, route, what, body2) {
602
1975
  const redact = (s) => s.split(token).join("[token]");
603
1976
  for (let attempt = 0; ; attempt++) {
604
1977
  let res;
@@ -610,7 +1983,7 @@ async function call(transport, token, version2, method, route, what, body) {
610
1983
  "content-type": "application/json",
611
1984
  "user-agent": `DiscordBot (https://github.com/chrisjowen/wheelhouse, ${version2})`
612
1985
  },
613
- body: body === void 0 ? void 0 : JSON.stringify(body),
1986
+ body: body2 === void 0 ? void 0 : JSON.stringify(body2),
614
1987
  signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
615
1988
  });
616
1989
  } catch (e) {
@@ -628,120 +2001,71 @@ async function call(transport, token, version2, method, route, what, body) {
628
2001
  if (!res.ok) {
629
2002
  let said = "";
630
2003
  try {
631
- said = str(JSON.parse(text2).message) ?? "";
2004
+ said = str2(JSON.parse(text2).message) ?? "";
632
2005
  } catch {
633
2006
  }
634
2007
  throw new DiscordError(
635
2008
  res.status,
636
2009
  redact(`Discord would not ${what} (${res.status}${said ? `: ${said}` : ""}).`)
637
- );
638
- }
639
- return text2 ? JSON.parse(text2) : void 0;
640
- }
641
- }
642
- async function checkDiscordToken(token, opts = {}) {
643
- 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;
2010
+ );
724
2011
  }
725
- };
2012
+ return text2 ? JSON.parse(text2) : void 0;
2013
+ }
726
2014
  }
727
- function defaultKeychain() {
728
- return process.platform === "darwin" ? macKeychain() : null;
2015
+ async function checkDiscordToken(token, opts = {}) {
2016
+ const transport = opts.transport ?? wsTransport;
2017
+ const version2 = opts.version ?? "0";
2018
+ try {
2019
+ const me = await call(
2020
+ transport,
2021
+ token,
2022
+ version2,
2023
+ "GET",
2024
+ "/users/@me",
2025
+ "say who the bot is"
2026
+ );
2027
+ const id = str2(me?.id);
2028
+ if (!id) return { ok: false, error: "Discord did not say who the bot is." };
2029
+ const app = await call(
2030
+ transport,
2031
+ token,
2032
+ version2,
2033
+ "GET",
2034
+ "/applications/@me",
2035
+ "describe the application"
2036
+ ).catch(() => null);
2037
+ return {
2038
+ ok: true,
2039
+ bot: { id, name: str2(me.global_name) ?? str2(me.username) ?? id },
2040
+ appId: str2(app?.id) ?? id,
2041
+ publicBot: typeof app?.bot_public === "boolean" ? app.bot_public : null
2042
+ };
2043
+ } catch (e) {
2044
+ const status = e instanceof DiscordError ? e.status : 0;
2045
+ if (status === 401)
2046
+ return {
2047
+ ok: false,
2048
+ error: "Discord refused this token: it is not a valid bot token, or it was reset."
2049
+ };
2050
+ return { ok: false, error: e.message };
2051
+ }
729
2052
  }
2053
+ var inviteUrl = (appId) => `https://discord.com/oauth2/authorize?client_id=${encodeURIComponent(appId)}&scope=bot&permissions=0`;
730
2054
 
731
2055
  // src/lib/server/gateway/settings.ts
732
- import { createHash, randomBytes } from "node:crypto";
2056
+ import { createHash as createHash3, randomBytes as randomBytes2 } from "node:crypto";
733
2057
  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
2058
+ chmod as chmod2,
2059
+ lstat as lstat2,
2060
+ mkdir as mkdir4,
2061
+ readFile as readFile4,
2062
+ realpath as realpath2,
2063
+ rename as rename4,
2064
+ rm as rm2,
2065
+ stat as stat4,
2066
+ writeFile as writeFile4
743
2067
  } from "node:fs/promises";
744
- import path5 from "node:path";
2068
+ import path7 from "node:path";
745
2069
 
746
2070
  // src/lib/bell.ts
747
2071
  var ALERT_KINDS = [
@@ -760,7 +2084,7 @@ var QUIET_AFTER_MS = 20 * 6e4;
760
2084
  // src/lib/server/gateway/settings.ts
761
2085
  var GATEWAY_SETTINGS_SCHEMA = "wheelhouse-gateway-settings.v1";
762
2086
  var SETTINGS_FILE = "settings.json";
763
- var gatewayDir = (configDir) => path5.join(configDir, "gateway");
2087
+ var gatewayDir = (configDir) => path7.join(configDir, "gateway");
764
2088
  function defaultSettings() {
765
2089
  return Object.fromEntries(
766
2090
  GATEWAY_CHANNELS.map((c) => [
@@ -774,17 +2098,17 @@ function cleanToken(raw) {
774
2098
  if (t.length < 50 || t.length > 200) return null;
775
2099
  return /^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t) ? t : null;
776
2100
  }
777
- var isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
778
- var str2 = (v) => typeof v === "string" && v ? v : null;
2101
+ var isObj4 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
2102
+ var str3 = (v) => typeof v === "string" && v ? v : null;
779
2103
  var KINDS = new Set(ALERT_KINDS.map((k) => k.kind));
780
2104
  function parsePeer(v) {
781
- if (!isObj(v)) return null;
782
- const id = str2(v.id);
2105
+ if (!isObj4(v)) return null;
2106
+ const id = str3(v.id);
783
2107
  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() };
2108
+ return { id, name: str3(v.name) ?? id, dm: str3(v.dm), at: str3(v.at) ?? (/* @__PURE__ */ new Date(0)).toISOString() };
785
2109
  }
786
2110
  function parseChannel(v, fallback) {
787
- if (!isObj(v)) return fallback;
2111
+ if (!isObj4(v)) return fallback;
788
2112
  return {
789
2113
  enabled: typeof v.enabled === "boolean" ? v.enabled : fallback.enabled,
790
2114
  paired: parsePeer(v.paired),
@@ -792,14 +2116,14 @@ function parseChannel(v, fallback) {
792
2116
  titlesOnly: typeof v.titlesOnly === "boolean" ? v.titlesOnly : fallback.titlesOnly
793
2117
  };
794
2118
  }
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")}`;
2119
+ async function writeAtomic2(file, text2) {
2120
+ await mkdir4(path7.dirname(file), { recursive: true, mode: 448 });
2121
+ const tmp = `${file}.tmp-${process.pid}-${randomBytes2(4).toString("hex")}`;
798
2122
  try {
799
- await writeFile3(tmp, text2, { mode: 384 });
800
- await rename3(tmp, file);
2123
+ await writeFile4(tmp, text2, { mode: 384 });
2124
+ await rename4(tmp, file);
801
2125
  } catch (e) {
802
- await rm(tmp, { force: true });
2126
+ await rm2(tmp, { force: true });
803
2127
  throw e;
804
2128
  }
805
2129
  }
@@ -811,17 +2135,17 @@ var GatewaySettings = class {
811
2135
  dir;
812
2136
  keychain;
813
2137
  get file() {
814
- return path5.join(this.dir, SETTINGS_FILE);
2138
+ return path7.join(this.dir, SETTINGS_FILE);
815
2139
  }
816
2140
  tokenFile(channel) {
817
- return path5.join(this.dir, `${channel}.token`);
2141
+ return path7.join(this.dir, `${channel}.token`);
818
2142
  }
819
2143
  /** The settings, with defaults for anything missing; an unreadable file reads as the defaults, with why. */
820
2144
  async read() {
821
2145
  const settings2 = defaultSettings();
822
2146
  let text2;
823
2147
  try {
824
- text2 = await readFile3(this.file, "utf8");
2148
+ text2 = await readFile4(this.file, "utf8");
825
2149
  } catch (e) {
826
2150
  if (e.code === "ENOENT") return { settings: settings2, error: null };
827
2151
  return { settings: settings2, error: `${this.file} could not be read: ${e.message}` };
@@ -832,7 +2156,7 @@ var GatewaySettings = class {
832
2156
  } catch {
833
2157
  return { settings: settings2, error: `${this.file} is not valid JSON.` };
834
2158
  }
835
- if (!isObj(parsed) || parsed.schema !== GATEWAY_SETTINGS_SCHEMA) {
2159
+ if (!isObj4(parsed) || parsed.schema !== GATEWAY_SETTINGS_SCHEMA) {
836
2160
  return { settings: settings2, error: `${this.file} is not a Wheelhouse gateway settings file.` };
837
2161
  }
838
2162
  for (const { channel } of GATEWAY_CHANNELS) {
@@ -844,7 +2168,7 @@ var GatewaySettings = class {
844
2168
  async update(change) {
845
2169
  const { settings: settings2 } = await this.read();
846
2170
  change(settings2);
847
- await writeAtomic(
2171
+ await writeAtomic2(
848
2172
  this.file,
849
2173
  JSON.stringify({ schema: GATEWAY_SETTINGS_SCHEMA, ...settings2 }, null, " ") + "\n"
850
2174
  );
@@ -861,10 +2185,10 @@ var GatewaySettings = class {
861
2185
  if (fromKeychain) return { token: fromKeychain, where: this.keychain.where };
862
2186
  const file = this.tokenFile(channel);
863
2187
  try {
864
- const s = await lstat(file);
2188
+ const s = await lstat2(file);
865
2189
  if (!s.isFile()) return null;
866
- if ((s.mode & 63) !== 0) await chmod(file, 384);
867
- const token = cleanToken(await readFile3(file, "utf8"));
2190
+ if ((s.mode & 63) !== 0) await chmod2(file, 384);
2191
+ const token = cleanToken(await readFile4(file, "utf8"));
868
2192
  return token ? { token, where: file } : null;
869
2193
  } catch {
870
2194
  return null;
@@ -879,12 +2203,12 @@ var GatewaySettings = class {
879
2203
  * directory has its own token.
880
2204
  */
881
2205
  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)}`;
2206
+ const real2 = await realpath2(this.dir).catch(() => path7.resolve(this.dir));
2207
+ return `${channel}:${createHash3("sha256").update(real2).digest("hex").slice(0, 16)}`;
884
2208
  }
885
2209
  /** Keep the token in the Keychain, else in its file, replacing the one before; returns where it went. */
886
2210
  async setToken(channel, token) {
887
- await mkdir3(this.dir, { recursive: true, mode: 448 });
2211
+ await mkdir4(this.dir, { recursive: true, mode: 448 });
888
2212
  const keychain = this.keychain;
889
2213
  const account = await this.keychainAccount(channel);
890
2214
  const kept = keychain ? await keychain.set(account, token).then(
@@ -892,12 +2216,12 @@ var GatewaySettings = class {
892
2216
  () => false
893
2217
  ) : false;
894
2218
  if (kept) {
895
- await rm(this.tokenFile(channel), { force: true });
2219
+ await rm2(this.tokenFile(channel), { force: true });
896
2220
  } else {
897
2221
  await keychain?.remove(account).catch(() => false);
898
- await writeAtomic(this.tokenFile(channel), `${token}
2222
+ await writeAtomic2(this.tokenFile(channel), `${token}
899
2223
  `);
900
- await chmod(this.dir, 448).catch(() => {
2224
+ await chmod2(this.dir, 448).catch(() => {
901
2225
  });
902
2226
  }
903
2227
  await this.update(() => {
@@ -908,7 +2232,7 @@ var GatewaySettings = class {
908
2232
  async stamp() {
909
2233
  const one = async (f) => {
910
2234
  try {
911
- const s = await stat3(f);
2235
+ const s = await stat4(f);
912
2236
  return `${s.mtimeMs}:${s.size}:${s.ino}`;
913
2237
  } catch {
914
2238
  return "-";
@@ -998,8 +2322,12 @@ function gatewayCommand(over = {}) {
998
2322
  );
999
2323
  const settingsFor = (c) => {
1000
2324
  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 });
2325
+ const configDir = dir ? path8.resolve(dir) : defaultConfigDir(deps.env);
2326
+ const found = resolveInstall({
2327
+ cwd: process.cwd(),
2328
+ env: deps.env,
2329
+ remembered: readRemembered(configDir)
2330
+ });
1003
2331
  if (found.ok && isInside(configDir, found.install.homeDir)) {
1004
2332
  deps.error(
1005
2333
  `wheelhouse: the config directory ${configDir} is inside the Firstmate home, where the crew can read it. Pass --config-dir <dir> outside it.`
@@ -1115,16 +2443,16 @@ function gatewayCommand(over = {}) {
1115
2443
 
1116
2444
  // cli/plugin.ts
1117
2445
  import { createInterface } from "node:readline/promises";
1118
- import path10 from "node:path";
2446
+ import path12 from "node:path";
1119
2447
  import { Command as Command2 } from "commander";
1120
2448
 
1121
2449
  // src/lib/server/plugins/install.ts
1122
2450
  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";
2451
+ import { mkdir as mkdir5, mkdtemp, readFile as readFile5, realpath as realpath3, rename as rename5, rm as rm3, stat as stat5 } from "node:fs/promises";
2452
+ import path10 from "node:path";
1125
2453
 
1126
2454
  // src/lib/server/plugins/manifest.ts
1127
- import path7 from "node:path";
2455
+ import path9 from "node:path";
1128
2456
 
1129
2457
  // src/lib/plugins/addresses.ts
1130
2458
  var TEMPLATE = /^[a-z0-9-]*\{port\}[a-z0-9-]*(?:\.[a-z0-9-]+)*\.localhost$/;
@@ -1141,7 +2469,8 @@ var SLOTS = [
1141
2469
  "bridge.card",
1142
2470
  "home.card",
1143
2471
  "header.indicator",
1144
- "nav.page"
2472
+ "nav.page",
2473
+ "preview.action"
1145
2474
  ];
1146
2475
  var CAPABILITIES = ["feedback"];
1147
2476
 
@@ -1154,7 +2483,7 @@ var SUPPORTED_API_VERSIONS = [PLUGIN_API_VERSION, PLUGIN_API_VERSION - 1].filter
1154
2483
  // src/lib/server/plugins/manifest.ts
1155
2484
  var MANIFEST_DIR = ".wheelhouse-plugin";
1156
2485
  var MANIFEST_FILE = "plugin.json";
1157
- var manifestPath = (pluginDir) => path7.join(pluginDir, MANIFEST_DIR, MANIFEST_FILE);
2486
+ var manifestPath = (pluginDir) => path9.join(pluginDir, MANIFEST_DIR, MANIFEST_FILE);
1158
2487
  var MANIFEST_FIELDS = [
1159
2488
  "$schema",
1160
2489
  "name",
@@ -1201,7 +2530,7 @@ var SEMVER = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
1201
2530
  var MAX_TEXT = 400;
1202
2531
  var isRecord3 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
1203
2532
  function insidePath(f) {
1204
- return typeof f === "string" && f.length > 0 && !path7.isAbsolute(f) && !f.split(/[\\/]/).some((part) => part === ".." || part === "" || part === ".");
2533
+ return typeof f === "string" && f.length > 0 && !path9.isAbsolute(f) && !f.split(/[\\/]/).some((part) => part === ".." || part === "" || part === ".");
1205
2534
  }
1206
2535
  var ICON_TYPES = {
1207
2536
  ".svg": "image/svg+xml",
@@ -1299,7 +2628,7 @@ function wheelhouse(v) {
1299
2628
  }
1300
2629
  if (!insidePath(c.icon))
1301
2630
  throw new Invalid(`${where}.icon must be a plain path inside the plugin`);
1302
- if (!ICON_TYPES[path7.extname(c.icon).toLowerCase()]) {
2631
+ if (!ICON_TYPES[path9.extname(c.icon).toLowerCase()]) {
1303
2632
  throw new Invalid(`${where}.icon must be an image: ${Object.keys(ICON_TYPES).join(", ")}`);
1304
2633
  }
1305
2634
  declared.icon = c.icon;
@@ -1652,20 +2981,20 @@ async function fetchSource(source, into, deps) {
1652
2981
  await step(["checkout", "-q", "--detach", "FETCH_HEAD"]);
1653
2982
  }
1654
2983
  const commit = await step(["rev-parse", "HEAD"]);
1655
- await rm2(path8.join(into, ".git"), { recursive: true, force: true });
2984
+ await rm3(path10.join(into, ".git"), { recursive: true, force: true });
1656
2985
  return commit;
1657
2986
  }
1658
2987
  async function checkCopy(dir) {
1659
2988
  let text2;
1660
2989
  try {
1661
- text2 = await readFile4(manifestPath(dir), "utf8");
2990
+ text2 = await readFile5(manifestPath(dir), "utf8");
1662
2991
  } catch {
1663
2992
  throw new Refused("it has no .wheelhouse-plugin/plugin.json, so it is not a Wheelhouse plugin");
1664
2993
  }
1665
2994
  const parsed = parseManifest(text2);
1666
2995
  if (!parsed.ok) throw new Refused(`its manifest is not valid: ${parsed.error}`);
1667
2996
  const m = parsed.manifest;
1668
- const base = await realpath2(dir);
2997
+ const base = await realpath3(dir);
1669
2998
  for (const [what, rel] of [
1670
2999
  ["server entry", m.wheelhouse.server],
1671
3000
  ["ui bundle", m.wheelhouse.ui]
@@ -1673,12 +3002,12 @@ async function checkCopy(dir) {
1673
3002
  if (!rel) continue;
1674
3003
  let file;
1675
3004
  try {
1676
- file = await realpath2(path8.join(base, rel));
1677
- if (!(await stat4(file)).isFile()) throw new Error();
3005
+ file = await realpath3(path10.join(base, rel));
3006
+ if (!(await stat5(file)).isFile()) throw new Error();
1678
3007
  } catch {
1679
3008
  throw new Refused(`its ${what} ${rel} is missing`);
1680
3009
  }
1681
- if (!file.startsWith(base + path8.sep))
3010
+ if (!file.startsWith(base + path10.sep))
1682
3011
  throw new Refused(`its ${what} leads outside the plugin`);
1683
3012
  }
1684
3013
  return m;
@@ -1720,12 +3049,12 @@ function describeManifest(m, from, commit) {
1720
3049
  ];
1721
3050
  }
1722
3051
  async function withStaging(dir, work) {
1723
- await mkdir4(dir, { recursive: true });
1724
- const staging = await mkdtemp(path8.join(dir, ".staging-"));
3052
+ await mkdir5(dir, { recursive: true });
3053
+ const staging = await mkdtemp(path10.join(dir, ".staging-"));
1725
3054
  try {
1726
3055
  return await work(staging);
1727
3056
  } finally {
1728
- await rm2(staging, { recursive: true, force: true });
3057
+ await rm3(staging, { recursive: true, force: true });
1729
3058
  }
1730
3059
  }
1731
3060
  async function guarded(work) {
@@ -1758,7 +3087,7 @@ async function settle(m, deps, o) {
1758
3087
  async function keepSettings(id, settings2, deps) {
1759
3088
  const w = await writePluginSettings(deps.configDir, id, settings2);
1760
3089
  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)}.`);
3090
+ deps.log(`Kept ${id}'s settings in ${path10.join(deps.configDir, PLUGINS_FILE)}.`);
1762
3091
  }
1763
3092
  async function reload(deps, what, yes) {
1764
3093
  const r = await deps.restart(async (url, busy) => {
@@ -1799,7 +3128,7 @@ function install(spec, deps, o = {}) {
1799
3128
  const commit = await fetchSource(source, staging, deps);
1800
3129
  expected(commit, o.expect, repository);
1801
3130
  const m = await checkCopy(staging);
1802
- const target = path8.join(deps.dir, m.name);
3131
+ const target = path10.join(deps.dir, m.name);
1803
3132
  if (installed.plugins[m.name]) {
1804
3133
  throw new Refused(
1805
3134
  `${m.name} is already installed from ${label(installed.plugins[m.name])}; use \`wheelhouse plugin update ${m.name}\``
@@ -1819,7 +3148,7 @@ function install(spec, deps, o = {}) {
1819
3148
  }
1820
3149
  const settings2 = await settle(m, deps, { yes: o.yes, given: answers });
1821
3150
  if (settings2) await keepSettings(m.name, settings2, deps);
1822
- await rename4(staging, target);
3151
+ await rename5(staging, target);
1823
3152
  installed.plugins[m.name] = {
1824
3153
  repository,
1825
3154
  ref: source.ref,
@@ -1874,17 +3203,17 @@ function update(id, deps, o = {}) {
1874
3203
  if (!o.yes && !await deps.confirm(`Update ${id}?`)) throw new Refused("not updated");
1875
3204
  const settings2 = await settle(m, deps, { yes: o.yes, given: answers });
1876
3205
  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);
3206
+ const target = path10.join(deps.dir, id);
3207
+ const old = await mkdtemp(path10.join(deps.dir, ".old-"));
3208
+ const parked = path10.join(old, id);
3209
+ if (await exists(target)) await rename5(target, parked);
1881
3210
  try {
1882
- await rename4(staging, target);
3211
+ await rename5(staging, target);
1883
3212
  } catch (e) {
1884
- if (await exists(parked)) await rename4(parked, target);
3213
+ if (await exists(parked)) await rename5(parked, target);
1885
3214
  throw e;
1886
3215
  } finally {
1887
- await rm2(old, { recursive: true, force: true });
3216
+ await rm3(old, { recursive: true, force: true });
1888
3217
  }
1889
3218
  installed.plugins[id] = {
1890
3219
  ...was,
@@ -1905,7 +3234,7 @@ function remove(id, deps, o = {}) {
1905
3234
  if (!ID2.test(id)) throw new Refused(`"${id}" is not a plugin id`);
1906
3235
  const installed = await record2(deps);
1907
3236
  if (!installed.plugins[id]) throw new Refused(`${id} is not installed`);
1908
- await rm2(path8.join(deps.dir, id), { recursive: true, force: true });
3237
+ await rm3(path10.join(deps.dir, id), { recursive: true, force: true });
1909
3238
  delete installed.plugins[id];
1910
3239
  await writeInstalled(deps.dir, installed);
1911
3240
  deps.log(`Removed ${id}.`);
@@ -1943,7 +3272,7 @@ function row(id, r, width) {
1943
3272
  }
1944
3273
  async function exists(p) {
1945
3274
  try {
1946
- await stat4(p);
3275
+ await stat5(p);
1947
3276
  return true;
1948
3277
  } catch {
1949
3278
  return false;
@@ -1951,20 +3280,20 @@ async function exists(p) {
1951
3280
  }
1952
3281
 
1953
3282
  // 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";
3283
+ import { randomBytes as randomBytes3, timingSafeEqual } from "node:crypto";
3284
+ import { mkdirSync as mkdirSync2, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
3285
+ import { readdir, readFile as readFile6, rm as rm4 } from "node:fs/promises";
3286
+ import path11 from "node:path";
1958
3287
  var RESTART_EXIT = 75;
1959
3288
  var RESTART_PATH = "/api/wheelhouse/restart";
1960
3289
  var RUNNING_DIR = ".running";
1961
3290
  var TIMEOUT_MS = 3e3;
1962
- var newToken = () => randomBytes2(24).toString("hex");
3291
+ var newToken = () => randomBytes3(24).toString("hex");
1963
3292
  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)}
3293
+ const dir = path11.join(pluginsDir, RUNNING_DIR);
3294
+ mkdirSync2(dir, { recursive: true, mode: 448 });
3295
+ const file = path11.join(dir, `${r.pid}.json`);
3296
+ writeFileSync2(file, `${JSON.stringify(r)}
1968
3297
  `, { mode: 384 });
1969
3298
  return file;
1970
3299
  }
@@ -1996,7 +3325,7 @@ function restartHandler(token, restart, busy) {
1996
3325
  return true;
1997
3326
  };
1998
3327
  }
1999
- var alive = (pid) => {
3328
+ var alive2 = (pid) => {
2000
3329
  try {
2001
3330
  process.kill(pid, 0);
2002
3331
  return true;
@@ -2006,7 +3335,7 @@ var alive = (pid) => {
2006
3335
  };
2007
3336
  var refused = (e) => e.cause?.code === "ECONNREFUSED";
2008
3337
  async function requestRestart(pluginsDir, proceed) {
2009
- const dir = path9.join(pluginsDir, RUNNING_DIR);
3338
+ const dir = path11.join(pluginsDir, RUNNING_DIR);
2010
3339
  const out = { restarted: [], failed: [], kept: [] };
2011
3340
  let names;
2012
3341
  try {
@@ -2015,17 +3344,17 @@ async function requestRestart(pluginsDir, proceed) {
2015
3344
  return out;
2016
3345
  }
2017
3346
  for (const name of names) {
2018
- const file = path9.join(dir, name);
3347
+ const file = path11.join(dir, name);
2019
3348
  let r;
2020
3349
  try {
2021
- r = JSON.parse(await readFile5(file, "utf8"));
3350
+ r = JSON.parse(await readFile6(file, "utf8"));
2022
3351
  if (typeof r.url !== "string" || typeof r.token !== "string") throw new Error();
2023
3352
  } catch {
2024
- await rm3(file, { force: true });
3353
+ await rm4(file, { force: true });
2025
3354
  continue;
2026
3355
  }
2027
- if (typeof r.pid === "number" && !alive(r.pid)) {
2028
- await rm3(file, { force: true });
3356
+ if (typeof r.pid === "number" && !alive2(r.pid)) {
3357
+ await rm4(file, { force: true });
2029
3358
  continue;
2030
3359
  }
2031
3360
  const headers = { authorization: `Bearer ${r.token}` };
@@ -2049,7 +3378,7 @@ async function requestRestart(pluginsDir, proceed) {
2049
3378
  if (res.status === 202) out.restarted.push(r.url);
2050
3379
  else out.failed.push({ url: r.url, reason: `it answered ${res.status}` });
2051
3380
  } catch (e) {
2052
- if (refused(e)) await rm3(file, { force: true });
3381
+ if (refused(e)) await rm4(file, { force: true });
2053
3382
  else out.failed.push({ url: r.url, reason: e.message });
2054
3383
  }
2055
3384
  }
@@ -2094,10 +3423,10 @@ function pluginCommand(over = {}) {
2094
3423
  );
2095
3424
  const deps = (c) => {
2096
3425
  const g2 = c.optsWithGlobals();
2097
- const dir = g2.pluginsDir ? path10.resolve(g2.pluginsDir) : defaultPluginsDir(env);
3426
+ const dir = g2.pluginsDir ? path12.resolve(g2.pluginsDir) : defaultPluginsDir(env);
2098
3427
  return {
2099
3428
  dir,
2100
- configDir: g2.configDir ? path10.resolve(g2.configDir) : defaultConfigDir(env),
3429
+ configDir: g2.configDir ? path12.resolve(g2.configDir) : defaultConfigDir(env),
2101
3430
  confirm: askTerminal,
2102
3431
  ask: askLine,
2103
3432
  restart: (proceed) => requestRestart(dir, proceed),
@@ -2131,6 +3460,451 @@ function pluginCommand(over = {}) {
2131
3460
  return cmd;
2132
3461
  }
2133
3462
 
3463
+ // cli/remote.ts
3464
+ import { hostname } from "node:os";
3465
+ import path13 from "node:path";
3466
+ import { Command as Command3, InvalidArgumentError as InvalidArgumentError2 } from "commander";
3467
+
3468
+ // src/lib/server/cloud/pairing.ts
3469
+ var isObj5 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
3470
+ async function body(r) {
3471
+ const v = await r.json().catch(() => null);
3472
+ return isObj5(v) ? v : {};
3473
+ }
3474
+ async function post(f, url, payload) {
3475
+ return f(url, {
3476
+ method: "POST",
3477
+ headers: { "content-type": "application/json" },
3478
+ body: JSON.stringify(payload),
3479
+ redirect: "error",
3480
+ signal: AbortSignal.timeout(15e3)
3481
+ });
3482
+ }
3483
+ var unreachable = (gateway, e) => `The gateway at ${gateway} could not be reached: ${e.message}`;
3484
+ async function startPairing(gateway, key, machine, deps = {}) {
3485
+ const f = deps.fetch ?? fetch;
3486
+ let r;
3487
+ try {
3488
+ r = await post(f, `${gateway}/v1/pair/start`, {
3489
+ protocol: PROTOCOL,
3490
+ publicKey: key.publicKey,
3491
+ name: machine.name.slice(0, 60) || "Wheelhouse",
3492
+ platform: machine.platform.slice(0, 40),
3493
+ agent: { name: "wheelhouse", version: machine.version.slice(0, 40) }
3494
+ });
3495
+ } catch (e) {
3496
+ return { ok: false, error: unreachable(gateway, e) };
3497
+ }
3498
+ const b = await body(r);
3499
+ if (r.status === 426) {
3500
+ return {
3501
+ ok: false,
3502
+ error: "The gateway no longer speaks this Wheelhouse\u2019s protocol. Update Wheelhouse: wheelhouse upgrade."
3503
+ };
3504
+ }
3505
+ if (r.status === 429) {
3506
+ const wait = typeof b.retryAfter === "number" ? ` Try again in ${Math.ceil(b.retryAfter / 60)} min.` : "";
3507
+ return { ok: false, error: `The gateway is refusing more pairings for now.${wait}` };
3508
+ }
3509
+ if (r.status !== 201 && r.status !== 200) {
3510
+ const why = typeof b.message === "string" ? `: ${b.message.slice(0, 200)}` : "";
3511
+ return { ok: false, error: `The gateway refused the pairing (${r.status})${why}.` };
3512
+ }
3513
+ const start = {
3514
+ pairingId: typeof b.pairingId === "string" ? b.pairingId : "",
3515
+ userCode: typeof b.userCode === "string" ? b.userCode : "",
3516
+ // The page the captain types the code on: the gateway's own, never one it names.
3517
+ verificationUri: `${gateway}/pair`,
3518
+ fingerprint: typeof b.fingerprint === "string" ? b.fingerprint : "",
3519
+ expiresIn: typeof b.expiresIn === "number" ? b.expiresIn : 600,
3520
+ interval: typeof b.interval === "number" && b.interval > 0 ? b.interval : 3
3521
+ };
3522
+ if (!start.pairingId || !/^[23456789BCDFGHJKLMNPQRSTVWXZ]{4}-?[23456789BCDFGHJKLMNPQRSTVWXZ]{4}$/i.test(start.userCode)) {
3523
+ return {
3524
+ ok: false,
3525
+ error: "The gateway\u2019s answer is not a pairing this Wheelhouse understands."
3526
+ };
3527
+ }
3528
+ const own = fingerprint(key.publicKey);
3529
+ if (start.fingerprint !== own) {
3530
+ return {
3531
+ ok: false,
3532
+ error: `The gateway reports this machine\u2019s key as ${start.fingerprint || "nothing"}, not ${own}. Nothing was paired; do not use this gateway.`
3533
+ };
3534
+ }
3535
+ return { ok: true, start };
3536
+ }
3537
+ async function pollPairing(gateway, key, start, deps = {}) {
3538
+ const f = deps.fetch ?? fetch;
3539
+ const sleep2 = deps.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
3540
+ const now = deps.now ?? Date.now;
3541
+ const until = now() + start.expiresIn * 1e3;
3542
+ let interval = start.interval;
3543
+ let failures = 0;
3544
+ while (now() < until) {
3545
+ await sleep2(interval * 1e3);
3546
+ let r;
3547
+ try {
3548
+ r = await post(f, `${gateway}/v1/pair/poll`, {
3549
+ pairingId: start.pairingId,
3550
+ sig: pollSig(key, start.pairingId)
3551
+ });
3552
+ } catch (e) {
3553
+ if (++failures >= 5) return { status: "failed", reason: unreachable(gateway, e) };
3554
+ continue;
3555
+ }
3556
+ failures = 0;
3557
+ const b = await body(r);
3558
+ if (r.status === 429) {
3559
+ interval += 5;
3560
+ if (typeof b.retryAfter === "number") await sleep2(b.retryAfter * 1e3);
3561
+ continue;
3562
+ }
3563
+ if (r.status === 410)
3564
+ return { status: "expired", reason: "The code expired before it was approved." };
3565
+ if (r.status === 401) {
3566
+ return { status: "failed", reason: "The gateway no longer knows this pairing." };
3567
+ }
3568
+ if (r.status !== 200) {
3569
+ if (++failures >= 5) return { status: "failed", reason: `The gateway answered ${r.status}.` };
3570
+ continue;
3571
+ }
3572
+ if (b.status === "approved" && typeof b.deviceId === "string" && b.deviceId) {
3573
+ const user = isObj5(b.user) && typeof b.user.name === "string" ? b.user.name : null;
3574
+ return {
3575
+ status: "approved",
3576
+ device: { deviceId: b.deviceId, name: typeof b.name === "string" ? b.name : "", user }
3577
+ };
3578
+ }
3579
+ if (b.status === "denied")
3580
+ return { status: "denied", reason: "The pairing was denied on the gateway." };
3581
+ if (b.status === "expired")
3582
+ return { status: "expired", reason: "The code expired before it was approved." };
3583
+ }
3584
+ return { status: "expired", reason: "The code expired before it was approved." };
3585
+ }
3586
+ async function unpair(gateway, key, deviceId, deps = {}) {
3587
+ const f = deps.fetch ?? fetch;
3588
+ const ts = (deps.now ?? Date.now)();
3589
+ try {
3590
+ const r = await post(f, `${gateway}/v1/device/unpair`, {
3591
+ deviceId,
3592
+ ts,
3593
+ sig: unpairSig(key, deviceId, ts)
3594
+ });
3595
+ if (r.status === 204 || r.status === 200) return { ok: true };
3596
+ return { ok: false, error: `The gateway answered ${r.status}.` };
3597
+ } catch (e) {
3598
+ return { ok: false, error: unreachable(gateway, e) };
3599
+ }
3600
+ }
3601
+ async function disconnect(settings2, deps = {}) {
3602
+ const { settings: s } = await settings2.read();
3603
+ const found = s.device ? await settings2.findKey() : null;
3604
+ const told = s.device && found ? await unpair(s.device.gateway, found.key, s.device.id, deps) : null;
3605
+ await settings2.forget();
3606
+ await settings2.update((x) => x.enabled = false);
3607
+ return {
3608
+ device: s.device?.name ?? null,
3609
+ revoked: told?.ok ?? false,
3610
+ error: told && !told.ok ? told.error : null
3611
+ };
3612
+ }
3613
+
3614
+ // cli/remote.ts
3615
+ function parsePort2(value) {
3616
+ const n = Number(value);
3617
+ if (!Number.isInteger(n) || n < 1 || n > 65535) {
3618
+ throw new InvalidArgumentError2("Port must be a whole number from 1 to 65535.");
3619
+ }
3620
+ return n;
3621
+ }
3622
+ 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).";
3623
+ function machineName() {
3624
+ return hostname().replace(/\.local$/i, "").slice(0, 60) || "Wheelhouse";
3625
+ }
3626
+ function localPreviewPorts(appPort, ttlMs = 2e3) {
3627
+ let cached = null;
3628
+ return () => {
3629
+ if (cached && Date.now() - cached.at < ttlMs) return cached.ports;
3630
+ const ports = (async () => {
3631
+ try {
3632
+ const r = await fetch(`http://127.0.0.1:${appPort()}/api/cloud/previews`, {
3633
+ signal: AbortSignal.timeout(1500)
3634
+ });
3635
+ const body2 = await r.json();
3636
+ return new Set(
3637
+ Array.isArray(body2.ports) ? body2.ports.filter((p) => Number.isInteger(p)) : []
3638
+ );
3639
+ } catch {
3640
+ return /* @__PURE__ */ new Set();
3641
+ }
3642
+ })();
3643
+ cached = { at: Date.now(), ports };
3644
+ return ports;
3645
+ };
3646
+ }
3647
+ async function wheelhouseUp(port) {
3648
+ try {
3649
+ const r = await fetch(`http://127.0.0.1:${port}/api/health`, {
3650
+ signal: AbortSignal.timeout(1500)
3651
+ });
3652
+ return r.ok;
3653
+ } catch {
3654
+ return false;
3655
+ }
3656
+ }
3657
+ function waitForSignal() {
3658
+ return new Promise((resolve) => {
3659
+ process.once("SIGINT", () => resolve());
3660
+ process.once("SIGTERM", () => resolve());
3661
+ });
3662
+ }
3663
+ var ago = (iso) => {
3664
+ if (!iso) return "never";
3665
+ const s = Math.max(0, Math.round((Date.now() - Date.parse(iso)) / 1e3));
3666
+ return s < 90 ? `${s} s ago` : s < 5400 ? `${Math.round(s / 60)} min ago` : new Date(iso).toLocaleString();
3667
+ };
3668
+ function remoteCommand(over = {}) {
3669
+ const deps = {
3670
+ env: process.env,
3671
+ keychain: cloudKeychain(),
3672
+ pairing: {},
3673
+ machineName,
3674
+ wheelhouseUp,
3675
+ waitForStop: waitForSignal,
3676
+ log: (line) => console.log(line),
3677
+ error: (line) => console.error(line),
3678
+ ...over
3679
+ };
3680
+ const cmd = new Command3("remote").description(
3681
+ "Reach this Wheelhouse from anywhere through a Wheelhouse Cloud gateway (off until you connect)."
3682
+ ).option(
3683
+ "--config-dir <dir>",
3684
+ "the Wheelhouse config directory (default: $WHEELHOUSE_CONFIG_DIR, else $XDG_CONFIG_HOME/wheelhouse, else ~/.config/wheelhouse)"
3685
+ );
3686
+ const fail = (line) => {
3687
+ deps.error(`wheelhouse: ${line}`);
3688
+ process.exitCode = 1;
3689
+ };
3690
+ const settingsFor = (c) => {
3691
+ const dir = c.optsWithGlobals().configDir;
3692
+ const configDir = dir ? path13.resolve(dir) : defaultConfigDir(deps.env);
3693
+ const found = resolveInstall({ cwd: process.cwd(), env: deps.env });
3694
+ if (found.ok && isInside(configDir, found.install.homeDir)) {
3695
+ fail(
3696
+ `the config directory ${configDir} is inside the Firstmate home, where the crew can read it. Pass --config-dir <dir> outside it.`
3697
+ );
3698
+ return null;
3699
+ }
3700
+ return new CloudSettings(cloudDir(configDir), deps.keychain);
3701
+ };
3702
+ const gatewayFor = async (settings2, given2) => {
3703
+ const raw = given2 ?? (await settings2.read()).settings.gateway;
3704
+ if (!raw) {
3705
+ fail("name the gateway: --gateway https://<your gateway>");
3706
+ return null;
3707
+ }
3708
+ const origin = gatewayOrigin(raw);
3709
+ if (!origin.ok) {
3710
+ fail(origin.error);
3711
+ return null;
3712
+ }
3713
+ await settings2.update((x) => x.gateway = origin.origin);
3714
+ return origin.origin;
3715
+ };
3716
+ const machine = (name) => ({
3717
+ name: (name ?? deps.machineName()).trim().slice(0, 60) || "Wheelhouse",
3718
+ platform: `${process.platform}-${process.arch}`,
3719
+ version
3720
+ });
3721
+ const keep = async (settings2, gateway, key, name, device) => {
3722
+ const where = await settings2.setKey(key);
3723
+ await settings2.update((x) => {
3724
+ x.enabled = true;
3725
+ x.gateway = gateway;
3726
+ x.device = {
3727
+ id: device.deviceId,
3728
+ name: device.name || name,
3729
+ gateway,
3730
+ publicKey: key.publicKey,
3731
+ user: device.user,
3732
+ pairedAt: (/* @__PURE__ */ new Date()).toISOString()
3733
+ };
3734
+ });
3735
+ deps.log(
3736
+ `Connected: ${device.name || name}${device.user ? `, approved by ${device.user}` : ""}.`
3737
+ );
3738
+ deps.log(`Its key is kept in ${where}, readable by you only; it never leaves this machine.`);
3739
+ };
3740
+ cmd.command("connect").description(
3741
+ "Pair this machine with a gateway: shows a code to type there and a fingerprint to check."
3742
+ ).option("--gateway <url>", "the gateway, such as https://cloud.example.com (remembered)").option("--name <name>", "the name this machine gets there (default: its host name)").action(async (o, c) => {
3743
+ const settings2 = settingsFor(c);
3744
+ if (!settings2) return;
3745
+ const { settings: s } = await settings2.read();
3746
+ if (s.device && await settings2.findKey()) {
3747
+ return fail(
3748
+ `this machine is already connected to ${s.device.gateway} as ${s.device.name}. Run \`wheelhouse remote disconnect\` first.`
3749
+ );
3750
+ }
3751
+ const gateway = await gatewayFor(settings2, o.gateway);
3752
+ if (!gateway) return;
3753
+ const key = newDeviceKey();
3754
+ const m = machine(o.name);
3755
+ const name = m.name;
3756
+ const started = await startPairing(gateway, key, m, deps.pairing);
3757
+ if (!started.ok) return fail(started.error);
3758
+ const p = started.start;
3759
+ const mins = Math.round(p.expiresIn / 60);
3760
+ deps.log(`Pairing this machine (${name}) with Wheelhouse Cloud at ${gateway}.`);
3761
+ deps.log("");
3762
+ deps.log(` 1. On a device you trust, sign in at ${p.verificationUri}`);
3763
+ deps.log(` 2. Type this code there: ${p.userCode}`);
3764
+ deps.log(` 3. Pick this machine\u2019s fingerprint: ${fingerprint(key.publicKey)}`);
3765
+ deps.log("");
3766
+ deps.log(WARNING);
3767
+ deps.log("");
3768
+ deps.log(`Waiting for approval (the code works for ${mins} minutes)\u2026`);
3769
+ const outcome = await pollPairing(gateway, key, p, deps.pairing);
3770
+ if (outcome.status !== "approved") return fail(`${outcome.reason} Nothing was paired.`);
3771
+ await keep(settings2, gateway, key, name, outcome.device);
3772
+ deps.log(
3773
+ "A running Wheelhouse connects within seconds; without one, `wheelhouse remote run` keeps the connection up."
3774
+ );
3775
+ });
3776
+ cmd.command("status").description("Show whether this machine is connected, since when, and its relay sessions.").action(async (_o, c) => {
3777
+ const settings2 = settingsFor(c);
3778
+ if (!settings2) return;
3779
+ const v = await settings2.view();
3780
+ deps.log("Wheelhouse Cloud");
3781
+ deps.log(` Turned: ${v.enabled ? "on" : "off"}`);
3782
+ deps.log(` Gateway: ${v.gateway || "none (wheelhouse remote connect --gateway <url>)"}`);
3783
+ deps.log(
3784
+ ` Machine: ${v.device ? `${v.device.name} (fingerprint ${v.device.fingerprint})${v.device.user ? `, approved by ${v.device.user}` : ""}` : "not paired (wheelhouse remote connect)"}`
3785
+ );
3786
+ if (v.keyStore) deps.log(` Key: ${v.keyStore}`);
3787
+ const states = {
3788
+ off: "off",
3789
+ "not-paired": "not paired",
3790
+ "not-running": "not running (start Wheelhouse, or wheelhouse remote run)",
3791
+ connecting: "connecting",
3792
+ online: `online since ${v.since ? new Date(v.since).toLocaleString() : "?"}`,
3793
+ stopped: "stopped"
3794
+ };
3795
+ deps.log(` Connection: ${states[v.state]}${v.reason ? ` (${v.reason})` : ""}`);
3796
+ if (v.device) deps.log(` Last seen: ${ago(v.lastSeen)}`);
3797
+ if (v.sessions.length) {
3798
+ deps.log(" Relay sessions:");
3799
+ for (const s of v.sessions.slice(0, 10)) {
3800
+ deps.log(
3801
+ ` ${s.id.slice(0, 8)} ${s.user} ${s.requests} request${s.requests === 1 ? "" : "s"}, last ${ago(s.lastAt)}`
3802
+ );
3803
+ }
3804
+ }
3805
+ });
3806
+ cmd.command("disconnect").description("Revoke this machine on its gateway and delete its key here.").action(async (_o, c) => {
3807
+ const settings2 = settingsFor(c);
3808
+ if (!settings2) return;
3809
+ const r = await disconnect(settings2, deps.pairing);
3810
+ if (!r.device) return deps.log("This machine was not connected; Wheelhouse Cloud is off.");
3811
+ if (r.revoked)
3812
+ deps.log(`Disconnected ${r.device}: the gateway revoked it and its key is deleted here.`);
3813
+ else {
3814
+ deps.log(`Deleted ${r.device}\u2019s key here; Wheelhouse Cloud is off.`);
3815
+ deps.log(
3816
+ `Warning: the gateway could not be told (${r.error}). Remove the machine from its list of machines too.`
3817
+ );
3818
+ }
3819
+ });
3820
+ for (const [name, on] of [
3821
+ ["on", true],
3822
+ ["off", false]
3823
+ ]) {
3824
+ cmd.command(name).description(
3825
+ 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."
3826
+ ).action(async (_o, c) => {
3827
+ const settings2 = settingsFor(c);
3828
+ if (!settings2) return;
3829
+ const s = await settings2.update((x) => x.enabled = on);
3830
+ deps.log(
3831
+ on && !s.device ? "Wheelhouse Cloud is on, but this machine is not paired: wheelhouse remote connect." : `Wheelhouse Cloud is turned ${name}.`
3832
+ );
3833
+ });
3834
+ }
3835
+ cmd.command("run").description(
3836
+ "Keep the connection up without `wheelhouse open` (it does this itself), relaying to the Wheelhouse on --port; pairs first when this machine is not paired yet."
3837
+ ).option("--port <n>", "the port the local Wheelhouse listens on", parsePort2, 4310).option("--gateway <url>", "the gateway to pair with, when this machine is not paired yet").option("--name <name>", "the name this machine gets there (default: its host name)").action(async (o, c) => {
3838
+ const settings2 = settingsFor(c);
3839
+ if (!settings2) return;
3840
+ const alive3 = setInterval(() => {
3841
+ }, 1 << 30);
3842
+ try {
3843
+ await relayUntilStopped(settings2, o);
3844
+ } finally {
3845
+ clearInterval(alive3);
3846
+ }
3847
+ });
3848
+ async function relayUntilStopped(settings2, o) {
3849
+ const stopped = deps.waitForStop().then(() => null);
3850
+ let v = await settings2.view();
3851
+ if (v.device && !v.enabled) return fail("Wheelhouse Cloud is off here: wheelhouse remote on.");
3852
+ if (!v.device && !await pairHeadless(settings2, o, stopped)) return;
3853
+ v = await settings2.view();
3854
+ if (!await deps.wheelhouseUp(o.port)) {
3855
+ deps.log(
3856
+ `Warning: no Wheelhouse answers on port ${o.port} yet; relayed pages fail until one does.`
3857
+ );
3858
+ }
3859
+ const service = new CloudService({
3860
+ settings: settings2,
3861
+ version,
3862
+ appPort: () => o.port,
3863
+ previewPorts: localPreviewPorts(() => o.port),
3864
+ log: (line) => deps.log(line)
3865
+ });
3866
+ await service.start();
3867
+ deps.log(`Relaying to http://127.0.0.1:${o.port}/. Press Ctrl+C to disconnect.`);
3868
+ await stopped;
3869
+ await service.stop();
3870
+ }
3871
+ async function pairHeadless(settings2, o, stopped) {
3872
+ const gateway = await gatewayFor(settings2, o.gateway);
3873
+ if (!gateway) return false;
3874
+ const m = machine(o.name);
3875
+ const sleep2 = deps.pairing.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
3876
+ for (let attempt = 0; ; attempt++) {
3877
+ const key = newDeviceKey();
3878
+ const started = await Promise.race([startPairing(gateway, key, m, deps.pairing), stopped]);
3879
+ if (!started) return false;
3880
+ if (!started.ok) {
3881
+ fail(started.error);
3882
+ return false;
3883
+ }
3884
+ const p = started.start;
3885
+ deps.log(
3886
+ `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}`
3887
+ );
3888
+ const outcome = await Promise.race([pollPairing(gateway, key, p, deps.pairing), stopped]);
3889
+ if (!outcome) return false;
3890
+ if (outcome.status === "approved") {
3891
+ await keep(settings2, gateway, key, m.name, outcome.device);
3892
+ return true;
3893
+ }
3894
+ if (outcome.status !== "expired") {
3895
+ fail(`${outcome.reason} Nothing was paired.`);
3896
+ return false;
3897
+ }
3898
+ const wait = Math.min(5e3 * 2 ** attempt, 5 * 6e4);
3899
+ deps.log(
3900
+ `Wheelhouse Cloud: ${outcome.reason} A new code follows in ${Math.round(wait / 1e3)} s.`
3901
+ );
3902
+ if (await Promise.race([sleep2(wait).then(() => true), stopped]) === null) return false;
3903
+ }
3904
+ }
3905
+ return cmd;
3906
+ }
3907
+
2134
3908
  // cli/supervise.ts
2135
3909
  var MAX_RESTARTS = 5;
2136
3910
  var RESTART_WINDOW_MS = 6e4;
@@ -2214,14 +3988,14 @@ function supervise(opts) {
2214
3988
 
2215
3989
  // cli/upgrade.ts
2216
3990
  import { spawn as spawn3 } from "node:child_process";
2217
- import path12 from "node:path";
3991
+ import path15 from "node:path";
2218
3992
  import { fileURLToPath } from "node:url";
2219
- import { Command as Command3 } from "commander";
3993
+ import { Command as Command4 } from "commander";
2220
3994
 
2221
3995
  // src/lib/server/upgrade/clone.ts
2222
3996
  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";
3997
+ import { readFile as readFile7, realpath as realpath4 } from "node:fs/promises";
3998
+ import path14 from "node:path";
2225
3999
  var COMMITS_SHOWN = 20;
2226
4000
  var OUTPUT_KEPT = 6e4;
2227
4001
  var runCommand = (cmd, args, cwd) => new Promise((resolve) => {
@@ -2267,11 +4041,11 @@ async function checkClone(deps) {
2267
4041
  changes: []
2268
4042
  };
2269
4043
  out.current.version = packageVersion(
2270
- await readFile6(path11.join(deps.dir, "package.json"), "utf8").catch(() => null)
4044
+ await readFile7(path14.join(deps.dir, "package.json"), "utf8").catch(() => null)
2271
4045
  );
2272
4046
  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) {
4047
+ const here = await realpath4(deps.dir).catch(() => deps.dir);
4048
+ if (top.code !== 0 || await realpath4(top.stdout.trim()).catch(() => "") !== here) {
2275
4049
  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
4050
  return out;
2277
4051
  }
@@ -2384,7 +4158,7 @@ var UPGRADE_STEPS = [
2384
4158
 
2385
4159
  // cli/upgrade.ts
2386
4160
  function installDir() {
2387
- return path12.resolve(path12.dirname(fileURLToPath(import.meta.url)), "..");
4161
+ return path15.resolve(path15.dirname(fileURLToPath(import.meta.url)), "..");
2388
4162
  }
2389
4163
  var runInherit = (cmd, args, cwd) => new Promise((resolve) => {
2390
4164
  const child = spawn3(cmd, args, { cwd, stdio: "inherit" });
@@ -2451,13 +4225,13 @@ async function upgrade(deps, o = {}) {
2451
4225
  }
2452
4226
  function upgradeCommand(over = {}) {
2453
4227
  const env = over.env ?? process.env;
2454
- return new Command3("upgrade").description(
4228
+ return new Command4("upgrade").description(
2455
4229
  "Fast-forward this Wheelhouse clone to the newest commit on GitHub, rebuild it and restart Wheelhouse."
2456
4230
  ).option("--check", "only say whether there is a newer version").option("-y, --yes", "upgrade (and restart, even mid-work) without asking").option(
2457
4231
  "--plugins-dir <dir>",
2458
4232
  "the plugins directory the running Wheelhouse loads from, to find it (default: $WHEELHOUSE_PLUGINS_DIR, else ~/.wheelhouse/plugins)"
2459
4233
  ).action(async (o) => {
2460
- const pluginsDir = o.pluginsDir ? path12.resolve(o.pluginsDir) : defaultPluginsDir(env);
4234
+ const pluginsDir = o.pluginsDir ? path15.resolve(o.pluginsDir) : defaultPluginsDir(env);
2461
4235
  const ok = await upgrade(
2462
4236
  {
2463
4237
  dir: installDir(),
@@ -2476,16 +4250,16 @@ function upgradeCommand(over = {}) {
2476
4250
  var DEFAULT_PORT = 4310;
2477
4251
  var HOST = "127.0.0.1";
2478
4252
  var runtimeHolder = () => globalThis[/* @__PURE__ */ Symbol.for("wheelhouse.runtime")];
2479
- function parsePort2(value) {
4253
+ function parsePort3(value) {
2480
4254
  const n = Number(value);
2481
4255
  if (!Number.isInteger(n) || n < 0 || n > 65535) {
2482
- throw new InvalidArgumentError2("Port must be a whole number from 0 to 65535.");
4256
+ throw new InvalidArgumentError3("Port must be a whole number from 0 to 65535.");
2483
4257
  }
2484
4258
  return n;
2485
4259
  }
2486
4260
  function handlerPath() {
2487
- const here = path13.dirname(fileURLToPath2(import.meta.url));
2488
- return path13.resolve(here, "..", "build", "handler.js");
4261
+ const here = path16.dirname(fileURLToPath2(import.meta.url));
4262
+ return path16.resolve(here, "..", "build", "handler.js");
2489
4263
  }
2490
4264
  function openBrowser(url) {
2491
4265
  const [cmd, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["cmd", ["/c", "start", '""', url]] : ["xdg-open", [url]];
@@ -2498,45 +4272,58 @@ function openBrowser(url) {
2498
4272
  }
2499
4273
  }
2500
4274
  async function open2(opts) {
4275
+ const configDir = opts.configDir ? path16.resolve(opts.configDir) : defaultConfigDir(process.env);
4276
+ const stateDir = opts.stateDir ? path16.resolve(opts.stateDir) : defaultStateDir(process.env);
2501
4277
  const resolved = resolveInstall({
2502
4278
  firstmate: opts.firstmate,
2503
4279
  home: opts.home,
2504
4280
  cwd: process.cwd(),
2505
- env: process.env
4281
+ env: process.env,
4282
+ remembered: readRemembered(configDir)
2506
4283
  });
2507
- if (!resolved.ok) {
4284
+ const setup = !resolved.ok && resolved.missing;
4285
+ if (!resolved.ok && !setup) {
2508
4286
  console.error(`wheelhouse: ${resolved.error}`);
2509
4287
  process.exit(1);
2510
4288
  }
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
- );
4289
+ if (resolved.ok) {
4290
+ const { install: install2, notes } = resolved;
4291
+ for (const n of notes) console.log(n);
4292
+ console.log(`Firstmate: ${install2.firstmateDir}`);
4293
+ console.log(`Home: ${install2.homeDir}`);
4294
+ const compat = await checkCompatibility(install2);
4295
+ if (compat.compatible) {
4296
+ console.log(
4297
+ `Scripts: compatible${compat.firstmateVersion ? ` (Firstmate ${compat.firstmateVersion})` : ""}`
4298
+ );
4299
+ } else {
4300
+ console.warn("Warning: this Firstmate may not be compatible with Wheelhouse:");
4301
+ for (const p of compat.problems) console.warn(` - ${p}`);
4302
+ console.warn("Wheelhouse will start and show what it can; see /api/health.");
4303
+ }
4304
+ if (isInside(stateDir, install2.homeDir)) {
4305
+ console.error(
4306
+ `wheelhouse: the state directory ${stateDir} is inside the Firstmate home. Wheelhouse never writes there; pass --state-dir <dir> outside it.`
4307
+ );
4308
+ process.exit(1);
4309
+ }
4310
+ if (isInside(configDir, install2.homeDir)) {
4311
+ console.error(
4312
+ `wheelhouse: the config directory ${configDir} is inside the Firstmate home. Wheelhouse never reads its own config from there; pass --config-dir <dir> outside it.`
4313
+ );
4314
+ process.exit(1);
4315
+ }
4316
+ if (resolved.source !== "remembered") {
4317
+ process.env.WHEELHOUSE_FIRSTMATE_DIR = install2.firstmateDir;
4318
+ process.env.WHEELHOUSE_HOME = install2.homeDir;
4319
+ } else if (opts.home) {
4320
+ process.env.WHEELHOUSE_HOME = install2.homeDir;
4321
+ }
2520
4322
  } 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);
4323
+ console.log(`Firstmate: not found. ${resolved.error}`);
4324
+ console.log("Setup: the page opens the setup wizard to clone or choose one.");
2531
4325
  }
2532
4326
  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
4327
  console.log(`Config: ${configDir}`);
2541
4328
  const file = handlerPath();
2542
4329
  if (!existsSync2(file)) {
@@ -2545,16 +4332,22 @@ async function open2(opts) {
2545
4332
  );
2546
4333
  process.exit(1);
2547
4334
  }
2548
- process.env.WHEELHOUSE_FIRSTMATE_DIR = install2.firstmateDir;
2549
- process.env.WHEELHOUSE_HOME = install2.homeDir;
2550
4335
  process.env.WHEELHOUSE_STATE_DIR = stateDir;
2551
4336
  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), "..");
4337
+ if (opts.pluginsDir) process.env.WHEELHOUSE_PLUGINS_DIR = path16.resolve(opts.pluginsDir);
4338
+ process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path16.resolve(path16.dirname(file), "..", "plugins");
4339
+ process.env.WHEELHOUSE_INSTALL_DIR = path16.resolve(path16.dirname(file), "..");
2555
4340
  if (opts.tmuxSocket) process.env.WHEELHOUSE_TMUX_SOCKET = opts.tmuxSocket;
2556
4341
  process.env.WHEELHOUSE_SKIP_PERMISSIONS = opts.skipPermissions ? "1" : "0";
2557
4342
  const cli = fileURLToPath2(import.meta.url);
4343
+ let serverPort = opts.port;
4344
+ const cloud = new CloudService({
4345
+ settings: new CloudSettings(cloudDir(configDir), cloudKeychain()),
4346
+ version,
4347
+ appPort: () => serverPort,
4348
+ previewPorts: localPreviewPorts(() => serverPort),
4349
+ log: (line) => console.warn(line)
4350
+ });
2558
4351
  const watcher = supervise({
2559
4352
  port: opts.port,
2560
4353
  start: (port, restart) => fork(cli, ["__server", "--port", String(port)], {
@@ -2562,7 +4355,9 @@ async function open2(opts) {
2562
4355
  stdio: ["ignore", "inherit", "inherit", "ipc"]
2563
4356
  }),
2564
4357
  onReady: (port) => {
2565
- const url = `http://${HOST}:${port}/`;
4358
+ serverPort = port;
4359
+ void cloud.start();
4360
+ const url = `http://${HOST}:${port}/${setup ? "setup" : ""}`;
2566
4361
  console.log(`Wheelhouse is listening on ${url}`);
2567
4362
  console.log("Press Ctrl+C to close Wheelhouse. Firstmate and its crew keep running.");
2568
4363
  if (opts.browser) openBrowser(url);
@@ -2571,7 +4366,9 @@ async function open2(opts) {
2571
4366
  });
2572
4367
  process.on("SIGINT", watcher.stop);
2573
4368
  process.on("SIGTERM", watcher.stop);
2574
- process.exit(await watcher.done);
4369
+ const code = await watcher.done;
4370
+ await cloud.stop();
4371
+ process.exit(code);
2575
4372
  }
2576
4373
  async function serve(opts) {
2577
4374
  process.env.WHEELHOUSE_URL = `http://${HOST}:${opts.port}`;
@@ -2638,13 +4435,16 @@ async function serve(opts) {
2638
4435
  process.on("disconnect", () => close(0));
2639
4436
  }
2640
4437
  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);
4438
+ const cli = new Command5("wheelhouse").description("A local companion to Firstmate: watch the crew at work from a web UI.").version(version);
2642
4439
  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(
4440
+ "Start Wheelhouse, start (or show) the Firstmate session, and open it in the browser; with no Firstmate yet, open the setup wizard."
4441
+ ).option(
4442
+ "--firstmate <dir>",
4443
+ "Firstmate code directory (default: the checkout you are in, else the one setup remembered; with none, the page opens the setup wizard)"
4444
+ ).option(
2645
4445
  "--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(
4446
+ "Firstmate operational home (default: $FM_HOME, else the one setup remembered, else the code directory)"
4447
+ ).option("--port <n>", "port to listen on (127.0.0.1 only)", parsePort3, DEFAULT_PORT).option(
2648
4448
  "--state-dir <dir>",
2649
4449
  "where Wheelhouse keeps its own records (default: $WHEELHOUSE_STATE_DIR, else $XDG_STATE_HOME/wheelhouse, else ~/.local/state/wheelhouse)"
2650
4450
  ).option(
@@ -2660,10 +4460,11 @@ function program() {
2660
4460
  "--no-skip-permissions",
2661
4461
  "start Firstmate without --dangerously-skip-permissions, so Claude Code asks before tools run (answer in the terminal drawer)"
2662
4462
  ).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));
4463
+ 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
4464
  cli.addCommand(pluginCommand());
2665
4465
  cli.addCommand(upgradeCommand());
2666
4466
  cli.addCommand(gatewayCommand());
4467
+ cli.addCommand(remoteCommand());
2667
4468
  return cli;
2668
4469
  }
2669
4470
  await program().parseAsync(process.argv);