@chrisjowen/wheelhouse 0.10.0 → 0.11.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 (440) hide show
  1. package/build/client/_app/immutable/assets/0.C7-9O7Er.css +1 -0
  2. package/build/client/_app/immutable/assets/0.C7-9O7Er.css.br +0 -0
  3. package/build/client/_app/immutable/assets/0.C7-9O7Er.css.gz +0 -0
  4. package/build/client/_app/immutable/chunks/{B6Xfoyj4.js → 60JlvdhQ.js} +1 -1
  5. package/build/client/_app/immutable/chunks/60JlvdhQ.js.br +0 -0
  6. package/build/client/_app/immutable/chunks/60JlvdhQ.js.gz +0 -0
  7. package/build/client/_app/immutable/chunks/{CpqCFuwf.js → B-rYWQGG.js} +1 -1
  8. package/build/client/_app/immutable/chunks/B-rYWQGG.js.br +0 -0
  9. package/build/client/_app/immutable/chunks/B-rYWQGG.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/{CTLz5ghs.js → B597Cbe1.js} +1 -1
  11. package/build/client/_app/immutable/chunks/B597Cbe1.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/B597Cbe1.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/{DKQe4Tss.js → BCUUi0V0.js} +1 -1
  14. package/build/client/_app/immutable/chunks/BCUUi0V0.js.br +0 -0
  15. package/build/client/_app/immutable/chunks/{DKQe4Tss.js.gz → BCUUi0V0.js.gz} +0 -0
  16. package/build/client/_app/immutable/chunks/{BfUcVuHG.js → BEKG1Stw.js} +1 -1
  17. package/build/client/_app/immutable/chunks/BEKG1Stw.js.br +0 -0
  18. package/build/client/_app/immutable/chunks/BEKG1Stw.js.gz +0 -0
  19. package/build/client/_app/immutable/chunks/{CA_poXX0.js → BPAziDlG.js} +1 -1
  20. package/build/client/_app/immutable/chunks/BPAziDlG.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/BPAziDlG.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/{cAfuCUf-.js → BaPx3dni.js} +1 -1
  23. package/build/client/_app/immutable/chunks/BaPx3dni.js.br +0 -0
  24. package/build/client/_app/immutable/chunks/BaPx3dni.js.gz +0 -0
  25. package/build/client/_app/immutable/chunks/{-UC3yquZ.js → BiiAyXOY.js} +1 -1
  26. package/build/client/_app/immutable/chunks/BiiAyXOY.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/BiiAyXOY.js.gz +0 -0
  28. package/build/client/_app/immutable/chunks/{aicrexzH.js → C69eHrL5.js} +1 -1
  29. package/build/client/_app/immutable/chunks/C69eHrL5.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/C69eHrL5.js.gz +0 -0
  31. package/build/client/_app/immutable/chunks/{yLdhLQbD.js → CC5Ts_xe.js} +1 -1
  32. package/build/client/_app/immutable/chunks/CC5Ts_xe.js.br +0 -0
  33. package/build/client/_app/immutable/chunks/CC5Ts_xe.js.gz +0 -0
  34. package/build/client/_app/immutable/chunks/{DmYimTF4.js → CPQbfMGI.js} +1 -1
  35. package/build/client/_app/immutable/chunks/CPQbfMGI.js.br +0 -0
  36. package/build/client/_app/immutable/chunks/CPQbfMGI.js.gz +0 -0
  37. package/build/client/_app/immutable/chunks/{CSoC52Vx.js → CSntU4ww.js} +1 -1
  38. package/build/client/_app/immutable/chunks/CSntU4ww.js.br +0 -0
  39. package/build/client/_app/immutable/chunks/CSntU4ww.js.gz +0 -0
  40. package/build/client/_app/immutable/chunks/{4JI5fA27.js → CbTQtfeu.js} +1 -1
  41. package/build/client/_app/immutable/chunks/CbTQtfeu.js.br +0 -0
  42. package/build/client/_app/immutable/chunks/CbTQtfeu.js.gz +0 -0
  43. package/build/client/_app/immutable/chunks/Cbm0yS9E.js +23 -0
  44. package/build/client/_app/immutable/chunks/Cbm0yS9E.js.br +0 -0
  45. package/build/client/_app/immutable/chunks/Cbm0yS9E.js.gz +0 -0
  46. package/build/client/_app/immutable/chunks/{CBeiP5A_.js → ChjkQemt.js} +1 -1
  47. package/build/client/_app/immutable/chunks/ChjkQemt.js.br +0 -0
  48. package/build/client/_app/immutable/chunks/ChjkQemt.js.gz +0 -0
  49. package/build/client/_app/immutable/chunks/{CxJQEvmu.js → CvZklcJq.js} +1 -1
  50. package/build/client/_app/immutable/chunks/CvZklcJq.js.br +0 -0
  51. package/build/client/_app/immutable/chunks/CvZklcJq.js.gz +0 -0
  52. package/build/client/_app/immutable/chunks/{BHmiFpwn.js → D6kQXwLu.js} +1 -1
  53. package/build/client/_app/immutable/chunks/D6kQXwLu.js.br +0 -0
  54. package/build/client/_app/immutable/chunks/D6kQXwLu.js.gz +0 -0
  55. package/build/client/_app/immutable/chunks/{DkrGZW5a.js → D8TgbIKz.js} +1 -1
  56. package/build/client/_app/immutable/chunks/D8TgbIKz.js.br +0 -0
  57. package/build/client/_app/immutable/chunks/D8TgbIKz.js.gz +0 -0
  58. package/build/client/_app/immutable/chunks/{DebP8q1f.js → DSAFUgJn.js} +1 -1
  59. package/build/client/_app/immutable/chunks/DSAFUgJn.js.br +0 -0
  60. package/build/client/_app/immutable/chunks/DSAFUgJn.js.gz +0 -0
  61. package/build/client/_app/immutable/chunks/{DZ6A9wfS.js → DVeiiKip.js} +1 -1
  62. package/build/client/_app/immutable/chunks/DVeiiKip.js.br +0 -0
  63. package/build/client/_app/immutable/chunks/DVeiiKip.js.gz +0 -0
  64. package/build/client/_app/immutable/chunks/{yYKc4xgI.js → DjCsArDj.js} +1 -1
  65. package/build/client/_app/immutable/chunks/DjCsArDj.js.br +0 -0
  66. package/build/client/_app/immutable/chunks/DjCsArDj.js.gz +0 -0
  67. package/build/client/_app/immutable/chunks/{HX17oQGV.js → DnBZO8Il.js} +1 -1
  68. package/build/client/_app/immutable/chunks/DnBZO8Il.js.br +0 -0
  69. package/build/client/_app/immutable/chunks/DnBZO8Il.js.gz +0 -0
  70. package/build/client/_app/immutable/chunks/{CcafVx98.js → Gbvs-EZ4.js} +1 -1
  71. package/build/client/_app/immutable/chunks/Gbvs-EZ4.js.br +1 -0
  72. package/build/client/_app/immutable/chunks/Gbvs-EZ4.js.gz +0 -0
  73. package/build/client/_app/immutable/chunks/{BCRg__8v.js → IKqZ9EUq.js} +1 -1
  74. package/build/client/_app/immutable/chunks/IKqZ9EUq.js.br +0 -0
  75. package/build/client/_app/immutable/chunks/IKqZ9EUq.js.gz +0 -0
  76. package/build/client/_app/immutable/chunks/{BqMdGvwc.js → rZ2-WaWD.js} +2 -2
  77. package/build/client/_app/immutable/chunks/rZ2-WaWD.js.br +0 -0
  78. package/build/client/_app/immutable/chunks/rZ2-WaWD.js.gz +0 -0
  79. package/build/client/_app/immutable/entry/{app.CLSymNWl.js → app.ERrI8AQ5.js} +2 -2
  80. package/build/client/_app/immutable/entry/app.ERrI8AQ5.js.br +0 -0
  81. package/build/client/_app/immutable/entry/app.ERrI8AQ5.js.gz +0 -0
  82. package/build/client/_app/immutable/entry/start.Dw33pepJ.js +1 -0
  83. package/build/client/_app/immutable/entry/start.Dw33pepJ.js.br +0 -0
  84. package/build/client/_app/immutable/entry/start.Dw33pepJ.js.gz +0 -0
  85. package/build/client/_app/immutable/nodes/0.CPXJEdVC.js +9 -0
  86. package/build/client/_app/immutable/nodes/0.CPXJEdVC.js.br +0 -0
  87. package/build/client/_app/immutable/nodes/0.CPXJEdVC.js.gz +0 -0
  88. package/build/client/_app/immutable/nodes/{1.DMeNq-MM.js → 1.BsHjzKoN.js} +1 -1
  89. package/build/client/_app/immutable/nodes/1.BsHjzKoN.js.br +0 -0
  90. package/build/client/_app/immutable/nodes/1.BsHjzKoN.js.gz +0 -0
  91. package/build/client/_app/immutable/nodes/{10.C85i7naL.js → 10.JvkeSj5x.js} +1 -1
  92. package/build/client/_app/immutable/nodes/10.JvkeSj5x.js.br +0 -0
  93. package/build/client/_app/immutable/nodes/10.JvkeSj5x.js.gz +0 -0
  94. package/build/client/_app/immutable/nodes/{11.B3oT5Eyb.js → 11.C9viE404.js} +1 -1
  95. package/build/client/_app/immutable/nodes/11.C9viE404.js.br +0 -0
  96. package/build/client/_app/immutable/nodes/11.C9viE404.js.gz +0 -0
  97. package/build/client/_app/immutable/nodes/{12.CzGzD4iD.js → 12.BWVqITW1.js} +1 -1
  98. package/build/client/_app/immutable/nodes/12.BWVqITW1.js.br +0 -0
  99. package/build/client/_app/immutable/nodes/12.BWVqITW1.js.gz +0 -0
  100. package/build/client/_app/immutable/nodes/{13.hmYycyBf.js → 13.D0u53Jpp.js} +1 -1
  101. package/build/client/_app/immutable/nodes/13.D0u53Jpp.js.br +0 -0
  102. package/build/client/_app/immutable/nodes/13.D0u53Jpp.js.gz +0 -0
  103. package/build/client/_app/immutable/nodes/{14.KtuQwZ-C.js → 14.CNClDl2g.js} +1 -1
  104. package/build/client/_app/immutable/nodes/14.CNClDl2g.js.br +0 -0
  105. package/build/client/_app/immutable/nodes/14.CNClDl2g.js.gz +0 -0
  106. package/build/client/_app/immutable/nodes/{15.C7QObash.js → 15.BJShjxpx.js} +1 -1
  107. package/build/client/_app/immutable/nodes/15.BJShjxpx.js.br +0 -0
  108. package/build/client/_app/immutable/nodes/{15.C7QObash.js.gz → 15.BJShjxpx.js.gz} +0 -0
  109. package/build/client/_app/immutable/nodes/{16.BJOpVasQ.js → 16.Bb3PPsch.js} +1 -1
  110. package/build/client/_app/immutable/nodes/16.Bb3PPsch.js.br +0 -0
  111. package/build/client/_app/immutable/nodes/16.Bb3PPsch.js.gz +0 -0
  112. package/build/client/_app/immutable/nodes/{17.Bk-1GRlF.js → 17.COjMgZvi.js} +1 -1
  113. package/build/client/_app/immutable/nodes/17.COjMgZvi.js.br +0 -0
  114. package/build/client/_app/immutable/nodes/{17.Bk-1GRlF.js.gz → 17.COjMgZvi.js.gz} +0 -0
  115. package/build/client/_app/immutable/nodes/{19.lzLFSTUS.js → 19.BbeSGQyg.js} +1 -1
  116. package/build/client/_app/immutable/nodes/19.BbeSGQyg.js.br +0 -0
  117. package/build/client/_app/immutable/nodes/19.BbeSGQyg.js.gz +0 -0
  118. package/build/client/_app/immutable/nodes/{2.D1A41fuz.js → 2.CBjl08IG.js} +1 -1
  119. package/build/client/_app/immutable/nodes/2.CBjl08IG.js.br +0 -0
  120. package/build/client/_app/immutable/nodes/2.CBjl08IG.js.gz +0 -0
  121. package/build/client/_app/immutable/nodes/{20.DqOEVNtJ.js → 20.2D2FCLQq.js} +1 -1
  122. package/build/client/_app/immutable/nodes/20.2D2FCLQq.js.br +0 -0
  123. package/build/client/_app/immutable/nodes/20.2D2FCLQq.js.gz +0 -0
  124. package/build/client/_app/immutable/nodes/{21.BmaCB5Rb.js → 21.xQ_KUjAi.js} +1 -1
  125. package/build/client/_app/immutable/nodes/21.xQ_KUjAi.js.br +0 -0
  126. package/build/client/_app/immutable/nodes/21.xQ_KUjAi.js.gz +0 -0
  127. package/build/client/_app/immutable/nodes/{22.D4F9Jlfe.js → 22.DuszjIrq.js} +1 -1
  128. package/build/client/_app/immutable/nodes/22.DuszjIrq.js.br +0 -0
  129. package/build/client/_app/immutable/nodes/22.DuszjIrq.js.gz +0 -0
  130. package/build/client/_app/immutable/nodes/{23.CGv8T_kx.js → 23.CKoLeDhM.js} +1 -1
  131. package/build/client/_app/immutable/nodes/23.CKoLeDhM.js.br +0 -0
  132. package/build/client/_app/immutable/nodes/23.CKoLeDhM.js.gz +0 -0
  133. package/build/client/_app/immutable/nodes/{24.DKrgSigC.js → 24.CH1byq7o.js} +1 -1
  134. package/build/client/_app/immutable/nodes/24.CH1byq7o.js.br +0 -0
  135. package/build/client/_app/immutable/nodes/24.CH1byq7o.js.gz +0 -0
  136. package/build/client/_app/immutable/nodes/{25.DsBTVUcU.js → 25.BFrDgbR3.js} +1 -1
  137. package/build/client/_app/immutable/nodes/25.BFrDgbR3.js.br +0 -0
  138. package/build/client/_app/immutable/nodes/25.BFrDgbR3.js.gz +0 -0
  139. package/build/client/_app/immutable/nodes/{26.5XFLLXwF.js → 26.CHB__H6C.js} +1 -1
  140. package/build/client/_app/immutable/nodes/26.CHB__H6C.js.br +0 -0
  141. package/build/client/_app/immutable/nodes/26.CHB__H6C.js.gz +0 -0
  142. package/build/client/_app/immutable/nodes/{27.BgW1QGtl.js → 27.Dn-mDbvz.js} +1 -1
  143. package/build/client/_app/immutable/nodes/27.Dn-mDbvz.js.br +0 -0
  144. package/build/client/_app/immutable/nodes/27.Dn-mDbvz.js.gz +0 -0
  145. package/build/client/_app/immutable/nodes/{28.DeOjXHlX.js → 28.pI-7Vnsb.js} +1 -1
  146. package/build/client/_app/immutable/nodes/28.pI-7Vnsb.js.br +0 -0
  147. package/build/client/_app/immutable/nodes/28.pI-7Vnsb.js.gz +0 -0
  148. package/build/client/_app/immutable/nodes/{3.Dh_akpU9.js → 3.6gLsJ5iP.js} +1 -1
  149. package/build/client/_app/immutable/nodes/3.6gLsJ5iP.js.br +0 -0
  150. package/build/client/_app/immutable/nodes/3.6gLsJ5iP.js.gz +0 -0
  151. package/build/client/_app/immutable/nodes/{4.Bs1kn53S.js → 4.uKPQRIJV.js} +1 -1
  152. package/build/client/_app/immutable/nodes/4.uKPQRIJV.js.br +0 -0
  153. package/build/client/_app/immutable/nodes/4.uKPQRIJV.js.gz +0 -0
  154. package/build/client/_app/immutable/nodes/{6.C71EcMPx.js → 6.CmppqGHA.js} +1 -1
  155. package/build/client/_app/immutable/nodes/6.CmppqGHA.js.br +0 -0
  156. package/build/client/_app/immutable/nodes/6.CmppqGHA.js.gz +0 -0
  157. package/build/client/_app/immutable/nodes/{7.ZTOGuaHI.js → 7.DDZOqRAy.js} +1 -1
  158. package/build/client/_app/immutable/nodes/7.DDZOqRAy.js.br +0 -0
  159. package/build/client/_app/immutable/nodes/7.DDZOqRAy.js.gz +0 -0
  160. package/build/client/_app/immutable/nodes/{8.CvoRv_Q7.js → 8.DH6CiiFf.js} +1 -1
  161. package/build/client/_app/immutable/nodes/8.DH6CiiFf.js.br +0 -0
  162. package/build/client/_app/immutable/nodes/8.DH6CiiFf.js.gz +0 -0
  163. package/build/client/_app/immutable/nodes/{9.BKcDiRzn.js → 9.jlOFlXh8.js} +1 -1
  164. package/build/client/_app/immutable/nodes/9.jlOFlXh8.js.br +0 -0
  165. package/build/client/_app/immutable/nodes/9.jlOFlXh8.js.gz +0 -0
  166. package/build/client/_app/version.json +1 -1
  167. package/build/client/_app/version.json.br +0 -0
  168. package/build/client/_app/version.json.gz +0 -0
  169. package/build/handler.js +4 -4
  170. package/build/index.js +4 -4
  171. package/build/server/chunks/chunks/{DecisionCard.js-DNJjQj6y.js → DecisionCard.js-DQls79M-.js} +3 -3
  172. package/build/server/chunks/chunks/{EtaLine.js-B29ZmIHz.js → EtaLine.js-D5L0wIoo.js} +2 -2
  173. package/build/server/chunks/chunks/{OpenDecision.js-evqpdz3O.js → OpenDecision.js-1bnVd2CO.js} +3 -3
  174. package/build/server/chunks/chunks/{RemotesPanel.js-0dTa0R21.js → RemotesPanel.js-qXJzfoKH.js} +87 -7
  175. package/build/server/chunks/chunks/brief.js-TS-K0lZ6.js +54 -0
  176. package/build/server/chunks/chunks/{chat.svelte.js-PibwBfjx.js → chat.svelte.js-t_sykiqk.js} +2 -2
  177. package/build/server/chunks/chunks/{detail.js-Dgv4KmRL.js → detail.js-BHgTIrxq.js} +2 -2
  178. package/build/server/chunks/chunks/{feedback.js-Czi1E8u9.js → feedback.js-CNjq89nb.js} +2 -2
  179. package/build/server/chunks/chunks/{insights.svelte.js-BLHg5qc-.js → insights.svelte.js-jvJ6zpkP.js} +5 -5
  180. package/build/server/chunks/chunks/{internal.js-BP2QIFKY.js → internal.js-DxO60Agy.js} +3 -3
  181. package/build/server/chunks/chunks/{keychain.js-DJN5Zq29.js → keychain.js-CTV5MMKd.js} +2 -2
  182. package/build/server/chunks/chunks/{live.svelte.js-DmaKnCsQ.js → live.svelte.js-qalupdld.js} +2 -2
  183. package/build/server/chunks/chunks/{marketplace-service.js-DJa250U3.js → marketplace-service.js-DZ7N3g7i.js} +2 -2
  184. package/build/server/chunks/chunks/{page.js-DfEGGxtv.js → page.js-slDjdKdN.js} +2 -2
  185. package/build/server/chunks/chunks/{brief.js-DyAlUufG.js → plain.js-Dc97sYaJ.js} +2 -53
  186. package/build/server/chunks/chunks/{plugins.js-Dfplrp6Q.js → plugins.js-DoEQ8bDp.js} +2 -2
  187. package/build/server/chunks/chunks/{previewhelper2.js-oDj1DB3x.js → previewhelper2.js-D62yPZ3-.js} +3 -3
  188. package/build/server/chunks/chunks/{repo.js-CDmQ4avP.js → repo.js-CpMWC7Dl.js} +2 -2
  189. package/build/server/chunks/chunks/{runtime.js-OVMyjvFp.js → runtime.js-n2Nl0Kn0.js} +4 -3
  190. package/build/server/chunks/chunks/{service.js-BLOqmXsC.js → service.js-BBKBSt-r.js} +2 -2
  191. package/build/server/chunks/chunks/{service2.js-DlF0JRL_.js → service2.js-D8unm3Dr.js} +3 -3
  192. package/build/server/chunks/chunks/{starter.js-D0aq1VOH.js → starter.js-BJtAaz_v.js} +227 -9
  193. package/build/server/chunks/chunks/{view.js-mOm4Yref.js → view.js-DY3ke6NQ.js} +2 -2
  194. package/build/server/chunks/entries/endpoints/api/apps/_op_/{_server.ts.js-BQM1jaCW.js → _server.ts.js-DU337wCA.js} +5 -4
  195. package/build/server/chunks/entries/endpoints/api/cloud/{_server.ts.js-BnfxYZJ4.js → _server.ts.js-DUjwvbDq.js} +14 -5
  196. package/build/server/chunks/entries/endpoints/api/cloud/previews/{_server.ts.js-CuYYpy-k.js → _server.ts.js-fB_wI3kP.js} +5 -4
  197. package/build/server/chunks/entries/endpoints/api/events/{_server.ts.js-v28e8g7l.js → _server.ts.js-HZjTDOIW.js} +5 -4
  198. package/build/server/chunks/entries/endpoints/api/files/{_server.ts.js-Q9s9qdZ9.js → _server.ts.js-vtgE6dmd.js} +5 -4
  199. package/build/server/chunks/entries/endpoints/api/firstmate/chat/{_server.ts.js-BN6RMteU.js → _server.ts.js-CBUM_cHq.js} +5 -4
  200. package/build/server/chunks/entries/endpoints/api/firstmate/commands/{_server.ts.js-C-e8niCf.js → _server.ts.js-gqNm0NgZ.js} +5 -4
  201. package/build/server/chunks/entries/endpoints/api/firstmate/dismiss/{_server.ts.js-CulYtEQF.js → _server.ts.js-DVTt9exZ.js} +5 -4
  202. package/build/server/chunks/entries/endpoints/api/firstmate/input/{_server.ts.js-C6Bz4_ee.js → _server.ts.js-DI8pSLdx.js} +5 -4
  203. package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/{_server.ts.js-BqZfV_xz.js → _server.ts.js-DwNKcPAZ.js} +5 -4
  204. package/build/server/chunks/entries/endpoints/api/firstmate/messages/{_server.ts.js-UWIoNytl.js → _server.ts.js-gn9Pb6xh.js} +5 -4
  205. package/build/server/chunks/entries/endpoints/api/firstmate/pick/{_server.ts.js-DW2s3QXr.js → _server.ts.js-BsuIck0U.js} +5 -4
  206. package/build/server/chunks/entries/endpoints/api/firstmate/reactions/{_server.ts.js-CKcueh0v.js → _server.ts.js-Du1j3gY1.js} +5 -4
  207. package/build/server/chunks/entries/endpoints/api/firstmate/start/{_server.ts.js-DIG6BGUw.js → _server.ts.js-D5_z22cM.js} +5 -4
  208. package/build/server/chunks/entries/endpoints/api/fleet/{_server.ts.js-DbyPkjMG.js → _server.ts.js-CqUodLtV.js} +5 -4
  209. package/build/server/chunks/entries/endpoints/api/gateway/{_server.ts.js-iIWTQNdz.js → _server.ts.js-Bqvpqc3W.js} +5 -4
  210. package/build/server/chunks/entries/endpoints/api/health/{_server.ts.js-C6aIFSPp.js → _server.ts.js-U1yy4XTd.js} +5 -4
  211. package/build/server/chunks/entries/endpoints/api/inbox/{_server.ts.js-KQsJpMC4.js → _server.ts.js-Bt1HEbxQ.js} +5 -4
  212. package/build/server/chunks/entries/endpoints/api/inbox/report/{_server.ts.js-CnyUgKFG.js → _server.ts.js-B1QGwJJx.js} +5 -4
  213. package/build/server/chunks/entries/endpoints/api/insights/{_server.ts.js-CuR7nOsT.js → _server.ts.js-4D31QJkx.js} +5 -4
  214. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/config/{_server.ts.js-B0PprKNy.js → _server.ts.js-BB9t2sPI.js} +5 -4
  215. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/{_server.ts.js-ExGq36cR.js → _server.ts.js-C0lNGC_e.js} +6 -5
  216. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/summary/{_server.ts.js-DEiF7hSn.js → _server.ts.js-BCucQ7kV.js} +7 -6
  217. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/icon/_icon_/{_server.ts.js-CNilnIbo.js → _server.ts.js-K051c2NK.js} +5 -4
  218. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/load/{_server.ts.js-DH8JvoH8.js → _server.ts.js-DXp7CBKJ.js} +2 -2
  219. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/ui/_...path_/{_server.ts.js-BFsGEK3z.js → _server.ts.js-BZjRhE_E.js} +5 -4
  220. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/update/{_server.ts.js-D20dZu-e.js → _server.ts.js-C6pSTIZl.js} +2 -2
  221. package/build/server/chunks/entries/endpoints/api/plugins/{_server.ts.js-CUNuwhSn.js → _server.ts.js-CPTGODgJ.js} +5 -4
  222. package/build/server/chunks/entries/endpoints/api/plugins/inspect/{_server.ts.js-CjBpWyyM.js → _server.ts.js-CYyhaWOu.js} +2 -2
  223. package/build/server/chunks/entries/endpoints/api/plugins/install/{_server.ts.js-BOj-J5oo.js → _server.ts.js-LOfrDPqm.js} +2 -2
  224. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/{_server.ts.js-CwwZDf_S.js → _server.ts.js-CqJSn65A.js} +6 -5
  225. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/icon/_name_/{_server.ts.js-DyB021Bo.js → _server.ts.js-vWLUvqe2.js} +6 -5
  226. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/registries/{_server.ts.js-Dcw_-YKO.js → _server.ts.js-CIy3Yxnj.js} +6 -5
  227. package/build/server/chunks/entries/endpoints/api/plugins/updates/{_server.ts.js-Dn8taLal.js → _server.ts.js-BXKekEzg.js} +2 -2
  228. package/build/server/chunks/entries/endpoints/api/previews/check/{_server.ts.js-CYRaQ1Q9.js → _server.ts.js-DZnqmxa7.js} +5 -4
  229. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/{_server.ts.js-CKz_IHkS.js → _server.ts.js-clRCP6Vz.js} +6 -5
  230. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/{_server.ts.js-B05Zzw2L.js → _server.ts.js-C0v3Eifj.js} +6 -5
  231. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/{_server.ts.js-DIFxtwPN.js → _server.ts.js-B1P26NiL.js} +6 -5
  232. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/{_server.ts.js-DKPspl_e.js → _server.ts.js-_BWFybXT.js} +6 -5
  233. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/file/{_server.ts.js-BzvpX8Lp.js → _server.ts.js-DM_qs0_P.js} +6 -5
  234. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/{_server.ts.js-DaGgjHpa.js → _server.ts.js-Cp4DC5RF.js} +6 -5
  235. package/build/server/chunks/entries/endpoints/api/second-mates/_id_/peek/{_server.ts.js-BDtqyF9w.js → _server.ts.js-CFQmNKZw.js} +5 -4
  236. package/build/server/chunks/entries/endpoints/api/services/{_server.ts.js-CzCXTD-q.js → _server.ts.js-C0Hp3ghu.js} +5 -4
  237. package/build/server/chunks/entries/endpoints/api/setup/{_server.ts.js-f6ZbC1i9.js → _server.ts.js-OI33JqAV.js} +6 -5
  238. package/build/server/chunks/entries/endpoints/api/slots/{_server.ts.js-DeBR06cu.js → _server.ts.js-BOetbdrI.js} +5 -4
  239. package/build/server/chunks/entries/endpoints/api/tasks/_id_/{_server.ts.js-CqZJfk6k.js → _server.ts.js-BE02dpgR.js} +6 -5
  240. package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/{_server.ts.js-BxqmUBCJ.js → _server.ts.js-eXiYz0dl.js} +5 -4
  241. package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/{_server.ts.js-BdHMgaY-.js → _server.ts.js-BzPQmqhd.js} +5 -4
  242. package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/{_server.ts.js-CcwryXxc.js → _server.ts.js-DernPNNa.js} +5 -4
  243. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/{_server.ts.js-DN6VppQL.js → _server.ts.js-CIJerTYj.js} +5 -4
  244. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/helper/{_server.ts.js-CVyRxqaq.js → _server.ts.js-wMw-B2LV.js} +6 -5
  245. package/build/server/chunks/entries/endpoints/api/vault/{_server.ts.js-CKtXqbub.js → _server.ts.js-BQVOZ_2W.js} +5 -4
  246. package/build/server/chunks/entries/endpoints/api/wheelhouse/source/{_server.ts.js-iwhW_cdh.js → _server.ts.js-CBdZ3Hvx.js} +2 -2
  247. package/build/server/chunks/entries/endpoints/api/wheelhouse/update/{_server.ts.js-DnF0-ymm.js → _server.ts.js-BjmmYFHq.js} +2 -2
  248. package/build/server/chunks/entries/endpoints/api/wheelhouse/upgrade/{_server.ts.js-B8tzXzqR.js → _server.ts.js-DxsJBLJe.js} +2 -2
  249. package/build/server/chunks/entries/endpoints/tasks/_id_/review/{_server.ts.js-C_n7oVA8.js → _server.ts.js-DXYaC6o9.js} +5 -4
  250. package/build/server/chunks/entries/{hooks.server.js-D06ps4Om.js → hooks.server.js-CN-DQ0lm.js} +5 -4
  251. package/build/server/chunks/entries/pages/{_layout.server.ts.js-b_JVQfjI.js → _layout.server.ts.js-B3IyG3tO.js} +2 -2
  252. package/build/server/chunks/entries/pages/{_layout.svelte.js-5WXlsqB3.js → _layout.svelte.js-ClwzCpuE.js} +132 -42
  253. package/build/server/chunks/entries/pages/{_page.server.ts.js-DBb-K68h.js → _page.server.ts.js-DF3mUKXU.js} +2 -2
  254. package/build/server/chunks/entries/pages/{_page.svelte.js-DFWU8yJc.js → _page.svelte.js-DotNRhUC.js} +7 -7
  255. package/build/server/chunks/entries/pages/decisions/{_page.server.ts.js-C3xd1s3T.js → _page.server.ts.js-BPsRMW1m.js} +2 -2
  256. package/build/server/chunks/entries/pages/deck/{_page.server.ts.js-DruCAu5Z.js → _page.server.ts.js-CRoejRrt.js} +2 -2
  257. package/build/server/chunks/entries/pages/deck/{_page.svelte.js-BE2e7Hyi.js → _page.svelte.js-DK__ZtkS.js} +7 -7
  258. package/build/server/chunks/entries/pages/files/{_page.server.ts.js-CXFi4LV0.js → _page.server.ts.js-CEQlok_v.js} +2 -2
  259. package/build/server/chunks/entries/pages/harbour/{_page.server.ts.js-DvOPkrBM.js → _page.server.ts.js-aNzCSnrW.js} +2 -2
  260. package/build/server/chunks/entries/pages/harbour/{_page.svelte.js-DW1Zg1aI.js → _page.svelte.js-BmsnWRtI.js} +2 -2
  261. package/build/server/chunks/entries/pages/headroom/{_page.server.ts.js-F2DiEcl8.js → _page.server.ts.js-DYPjOXZ7.js} +2 -2
  262. package/build/server/chunks/entries/pages/inbox/{_page.server.ts.js-CaMBSVLS.js → _page.server.ts.js-CvLRSeh7.js} +2 -2
  263. package/build/server/chunks/entries/pages/inbox/{_page.svelte.js-BddxZY9X.js → _page.svelte.js-aP2FP_cG.js} +4 -4
  264. package/build/server/chunks/entries/pages/more/{_page.svelte.js-CnwXpFY4.js → _page.svelte.js--_4q1cBB.js} +2 -2
  265. package/build/server/chunks/entries/pages/plugins/{_page.svelte.js-Dk84Z-NW.js → _page.svelte.js-CUCt4Yh6.js} +3 -3
  266. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/{_page.server.ts.js-ClGdKDIt.js → _page.server.ts.js-CF2qEBQz.js} +2 -2
  267. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/{_page.svelte.js-BYHP64gx.js → _page.svelte.js-pQ6VEL_L.js} +2 -2
  268. package/build/server/chunks/entries/pages/projects/_id_/{_page.server.ts.js-DEQv1OLm.js → _page.server.ts.js-Drm6Ahc4.js} +3 -3
  269. package/build/server/chunks/entries/pages/projects/_id_/{_page.svelte.js-B9P8UZOd.js → _page.svelte.js-B0wg_ICE.js} +3 -3
  270. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/{_page.server.ts.js-DJFGO-Cc.js → _page.server.ts.js-DdJMUWNL.js} +3 -3
  271. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/{_page.svelte.js-CcwDpwg7.js → _page.svelte.js-2F9iPWld.js} +2 -2
  272. package/build/server/chunks/entries/pages/projects/_id_/passage/{_page.server.ts.js-DjGE65vR.js → _page.server.ts.js-1GII3zKY.js} +4 -4
  273. package/build/server/chunks/entries/pages/projects/_id_/passage/{_page.svelte.js-B3HRzAzL.js → _page.svelte.js-CRoYOdvp.js} +2 -2
  274. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/{_page.server.ts.js-BmjN06QJ.js → _page.server.ts.js-CVsOhaVz.js} +2 -2
  275. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/{_page.svelte.js-DaA-EDRZ.js → _page.svelte.js-C-4CQ9Vj.js} +2 -2
  276. package/build/server/chunks/entries/pages/remotes/{_page.server.ts.js-BCYsX8Qf.js → _page.server.ts.js-Cva09MAW.js} +2 -2
  277. package/build/server/chunks/entries/pages/remotes/{_page.svelte.js-BSG7dgKM.js → _page.svelte.js-jCBA0xmJ.js} +2 -2
  278. package/build/server/chunks/entries/pages/second-mates/{_page.svelte.js-Dd467IE0.js → _page.svelte.js-3euUM2q5.js} +2 -2
  279. package/build/server/chunks/entries/pages/settings/cloud/{_page.server.ts.js-CVexEhWo.js → _page.server.ts.js-CMMEHMa0.js} +2 -2
  280. package/build/server/chunks/entries/pages/settings/cloud/{_page.svelte.js-CCSostfV.js → _page.svelte.js-ZcLxf_7V.js} +2 -2
  281. package/build/server/chunks/entries/pages/settings/gateway/{_page.server.ts.js-BHoaQS8-.js → _page.server.ts.js-CaBLC48A.js} +2 -2
  282. package/build/server/chunks/entries/pages/settings/plugins/{_page.server.ts.js-DnPR5x0p.js → _page.server.ts.js-C80JIole.js} +2 -2
  283. package/build/server/chunks/entries/pages/settings/plugins/{_page.svelte.js-CtZUu0ww.js → _page.svelte.js-CVkf5sHc.js} +3 -3
  284. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/{_page.server.ts.js-BBTiKiTp.js → _page.server.ts.js-GcEMXNzE.js} +2 -2
  285. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/{_page.svelte.js-BL9OERy0.js → _page.svelte.js-Dn6-A1cY.js} +3 -3
  286. package/build/server/chunks/entries/pages/settings/setup/{_page.server.ts.js-UhPQcuM0.js → _page.server.ts.js-fmudFG1R.js} +2 -2
  287. package/build/server/chunks/entries/pages/settings/update/{_page.server.ts.js-DQJnyFPr.js → _page.server.ts.js-Ck0V4NqF.js} +2 -2
  288. package/build/server/chunks/entries/pages/setup/{_page.server.ts.js-ZaOlhvmr.js → _page.server.ts.js-BT2aSao4.js} +3 -3
  289. package/build/server/chunks/entries/pages/setup/{_page.svelte.js-BgqCbRCh.js → _page.svelte.js-BvrzY0TN.js} +3 -3
  290. package/build/server/chunks/entries/pages/tasks/_id_/{_page.server.ts.js-DomAdSYf.js → _page.server.ts.js-DQ9XiVXC.js} +3 -3
  291. package/build/server/chunks/entries/pages/tasks/_id_/{_page.svelte.js-016yK-eG.js → _page.svelte.js-zRkAX1kt.js} +7 -6
  292. package/build/server/chunks/entries/pages/tasks/_id_/doc/{_page.server.ts.js-B3OWfHLh.js → _page.server.ts.js-DYUzrHEd.js} +2 -2
  293. package/build/server/chunks/entries/pages/time/{_page.server.ts.js-D3R_fKKg.js → _page.server.ts.js-PjptcjBY.js} +2 -2
  294. package/build/server/chunks/{handler-LFdZeRhM.js → handler-DhhKWgIp.js} +3 -3
  295. package/build/server/chunks/{index.js-BXq0LqPz.js → index.js-utiPQsQj.js} +2 -2
  296. package/build/server/chunks/{manifest.js-aLGKYQ2c.js → manifest.js-1v5Twa8d.js} +86 -86
  297. package/build/server/chunks/nodes/{0.js-cZzmSKzn.js → 0.js-t5p4uwR-.js} +9 -8
  298. package/build/server/chunks/nodes/{1.js-OfqTUBqN.js → 1.js-B23tX379.js} +2 -2
  299. package/build/server/chunks/nodes/{10.js-XZMNgA-_.js → 10.js-BYgrUxes.js} +3 -3
  300. package/build/server/chunks/nodes/{11.js-BQsBxnqW.js → 11.js-D8KeSOxn.js} +8 -7
  301. package/build/server/chunks/nodes/{12.js-BtN6NNws.js → 12.js-CSqzXf2C.js} +9 -8
  302. package/build/server/chunks/nodes/{13.js-TYF306j2.js → 13.js-BucPbiJc.js} +9 -8
  303. package/build/server/chunks/nodes/{14.js-paIqFLgN.js → 14.js-D5KFW0LX.js} +10 -9
  304. package/build/server/chunks/nodes/{15.js-Cnov1YR7.js → 15.js-DMi0cMxP.js} +9 -8
  305. package/build/server/chunks/nodes/{16.js-ELBvJEOW.js → 16.js-garu2VVL.js} +7 -7
  306. package/build/server/chunks/nodes/{17.js-Ca8V-3qj.js → 17.js-CIGvZ14P.js} +3 -3
  307. package/build/server/chunks/nodes/{19.js-Cnn9fSef.js → 19.js-D0EE2SJv.js} +7 -7
  308. package/build/server/chunks/nodes/{2.js-CAfs3Ddj.js → 2.js-CGs6HugM.js} +8 -7
  309. package/build/server/chunks/nodes/{20.js-Dd2o-zjp.js → 20.js-CVajTuJ7.js} +7 -6
  310. package/build/server/chunks/nodes/{21.js-BoKvVAba.js → 21.js-C53DsYbm.js} +8 -7
  311. package/build/server/chunks/nodes/{22.js-Dsqrw0IR.js → 22.js-IhEljvpJ.js} +8 -7
  312. package/build/server/chunks/nodes/{23.js-DKVqYHOy.js → 23.js-xMwn6OS_.js} +8 -7
  313. package/build/server/chunks/nodes/{24.js-BTDlc3cd.js → 24.js-Bf2yyWwh.js} +4 -4
  314. package/build/server/chunks/nodes/{25.js-B_TBD0eZ.js → 25.js-B4yvgFEW.js} +9 -8
  315. package/build/server/chunks/nodes/{26.js-kw2HsE7Z.js → 26.js-BgrkaBRi.js} +9 -8
  316. package/build/server/chunks/nodes/{27.js-ChPlnFqh.js → 27.js-CmaLV07r.js} +8 -7
  317. package/build/server/chunks/nodes/{28.js-gkTtK_J_.js → 28.js-D5cRvkTM.js} +7 -6
  318. package/build/server/chunks/nodes/{3.js-56YxWA1q.js → 3.js-Dm2pmcK2.js} +7 -6
  319. package/build/server/chunks/nodes/{4.js-QNM4W7ly.js → 4.js-C4ho5OJp.js} +8 -7
  320. package/build/server/chunks/nodes/{5.js-CW12fKyW.js → 5.js-y4HoD1YR.js} +6 -5
  321. package/build/server/chunks/nodes/{6.js-CJ0pRLBP.js → 6.js-CjlWBc3h.js} +8 -7
  322. package/build/server/chunks/nodes/{7.js-_jRitR1O.js → 7.js-Bu-qbDJ5.js} +7 -6
  323. package/build/server/chunks/nodes/{8.js-Wz8EKcS3.js → 8.js-qv_Z5rCa.js} +8 -7
  324. package/build/server/chunks/nodes/{9.js-DWh3J_q7.js → 9.js-txPQIe_t.js} +3 -3
  325. package/dist/cli.js +665 -31
  326. package/dist/wh-vault.js +1 -1
  327. package/package.json +1 -1
  328. package/skills/manage-wheelhouse/SKILL.md +1 -1
  329. package/skills/manage-wheelhouse/references/operations.md +5 -4
  330. package/build/client/_app/immutable/assets/0.CjeOh6H-.css +0 -1
  331. package/build/client/_app/immutable/assets/0.CjeOh6H-.css.br +0 -0
  332. package/build/client/_app/immutable/assets/0.CjeOh6H-.css.gz +0 -0
  333. package/build/client/_app/immutable/chunks/-UC3yquZ.js.br +0 -0
  334. package/build/client/_app/immutable/chunks/-UC3yquZ.js.gz +0 -0
  335. package/build/client/_app/immutable/chunks/4JI5fA27.js.br +0 -0
  336. package/build/client/_app/immutable/chunks/4JI5fA27.js.gz +0 -0
  337. package/build/client/_app/immutable/chunks/B6Xfoyj4.js.br +0 -0
  338. package/build/client/_app/immutable/chunks/B6Xfoyj4.js.gz +0 -0
  339. package/build/client/_app/immutable/chunks/BCRg__8v.js.br +0 -0
  340. package/build/client/_app/immutable/chunks/BCRg__8v.js.gz +0 -0
  341. package/build/client/_app/immutable/chunks/BHmiFpwn.js.br +0 -0
  342. package/build/client/_app/immutable/chunks/BHmiFpwn.js.gz +0 -0
  343. package/build/client/_app/immutable/chunks/BfUcVuHG.js.br +0 -0
  344. package/build/client/_app/immutable/chunks/BfUcVuHG.js.gz +0 -0
  345. package/build/client/_app/immutable/chunks/BqMdGvwc.js.br +0 -0
  346. package/build/client/_app/immutable/chunks/BqMdGvwc.js.gz +0 -0
  347. package/build/client/_app/immutable/chunks/CA_poXX0.js.br +0 -0
  348. package/build/client/_app/immutable/chunks/CA_poXX0.js.gz +0 -0
  349. package/build/client/_app/immutable/chunks/CBeiP5A_.js.br +0 -0
  350. package/build/client/_app/immutable/chunks/CBeiP5A_.js.gz +0 -0
  351. package/build/client/_app/immutable/chunks/CSoC52Vx.js.br +0 -0
  352. package/build/client/_app/immutable/chunks/CSoC52Vx.js.gz +0 -0
  353. package/build/client/_app/immutable/chunks/CTLz5ghs.js.br +0 -0
  354. package/build/client/_app/immutable/chunks/CTLz5ghs.js.gz +0 -0
  355. package/build/client/_app/immutable/chunks/CcafVx98.js.br +0 -3
  356. package/build/client/_app/immutable/chunks/CcafVx98.js.gz +0 -0
  357. package/build/client/_app/immutable/chunks/CpqCFuwf.js.br +0 -0
  358. package/build/client/_app/immutable/chunks/CpqCFuwf.js.gz +0 -0
  359. package/build/client/_app/immutable/chunks/CxJQEvmu.js.br +0 -0
  360. package/build/client/_app/immutable/chunks/CxJQEvmu.js.gz +0 -0
  361. package/build/client/_app/immutable/chunks/DKQe4Tss.js.br +0 -0
  362. package/build/client/_app/immutable/chunks/DZ6A9wfS.js.br +0 -0
  363. package/build/client/_app/immutable/chunks/DZ6A9wfS.js.gz +0 -0
  364. package/build/client/_app/immutable/chunks/DebP8q1f.js.br +0 -0
  365. package/build/client/_app/immutable/chunks/DebP8q1f.js.gz +0 -0
  366. package/build/client/_app/immutable/chunks/DkrGZW5a.js.br +0 -0
  367. package/build/client/_app/immutable/chunks/DkrGZW5a.js.gz +0 -0
  368. package/build/client/_app/immutable/chunks/DmYimTF4.js.br +0 -0
  369. package/build/client/_app/immutable/chunks/DmYimTF4.js.gz +0 -0
  370. package/build/client/_app/immutable/chunks/HX17oQGV.js.br +0 -0
  371. package/build/client/_app/immutable/chunks/HX17oQGV.js.gz +0 -0
  372. package/build/client/_app/immutable/chunks/aicrexzH.js.br +0 -0
  373. package/build/client/_app/immutable/chunks/aicrexzH.js.gz +0 -0
  374. package/build/client/_app/immutable/chunks/cAfuCUf-.js.br +0 -0
  375. package/build/client/_app/immutable/chunks/cAfuCUf-.js.gz +0 -0
  376. package/build/client/_app/immutable/chunks/vll1K05s.js +0 -12
  377. package/build/client/_app/immutable/chunks/vll1K05s.js.br +0 -0
  378. package/build/client/_app/immutable/chunks/vll1K05s.js.gz +0 -0
  379. package/build/client/_app/immutable/chunks/yLdhLQbD.js.br +0 -0
  380. package/build/client/_app/immutable/chunks/yLdhLQbD.js.gz +0 -0
  381. package/build/client/_app/immutable/chunks/yYKc4xgI.js.br +0 -0
  382. package/build/client/_app/immutable/chunks/yYKc4xgI.js.gz +0 -0
  383. package/build/client/_app/immutable/entry/app.CLSymNWl.js.br +0 -0
  384. package/build/client/_app/immutable/entry/app.CLSymNWl.js.gz +0 -0
  385. package/build/client/_app/immutable/entry/start.D4AIF2Ao.js +0 -1
  386. package/build/client/_app/immutable/entry/start.D4AIF2Ao.js.br +0 -0
  387. package/build/client/_app/immutable/entry/start.D4AIF2Ao.js.gz +0 -0
  388. package/build/client/_app/immutable/nodes/0.Bk5Y_mtP.js +0 -10
  389. package/build/client/_app/immutable/nodes/0.Bk5Y_mtP.js.br +0 -0
  390. package/build/client/_app/immutable/nodes/0.Bk5Y_mtP.js.gz +0 -0
  391. package/build/client/_app/immutable/nodes/1.DMeNq-MM.js.br +0 -0
  392. package/build/client/_app/immutable/nodes/1.DMeNq-MM.js.gz +0 -0
  393. package/build/client/_app/immutable/nodes/10.C85i7naL.js.br +0 -0
  394. package/build/client/_app/immutable/nodes/10.C85i7naL.js.gz +0 -0
  395. package/build/client/_app/immutable/nodes/11.B3oT5Eyb.js.br +0 -0
  396. package/build/client/_app/immutable/nodes/11.B3oT5Eyb.js.gz +0 -0
  397. package/build/client/_app/immutable/nodes/12.CzGzD4iD.js.br +0 -0
  398. package/build/client/_app/immutable/nodes/12.CzGzD4iD.js.gz +0 -0
  399. package/build/client/_app/immutable/nodes/13.hmYycyBf.js.br +0 -0
  400. package/build/client/_app/immutable/nodes/13.hmYycyBf.js.gz +0 -0
  401. package/build/client/_app/immutable/nodes/14.KtuQwZ-C.js.br +0 -0
  402. package/build/client/_app/immutable/nodes/14.KtuQwZ-C.js.gz +0 -0
  403. package/build/client/_app/immutable/nodes/15.C7QObash.js.br +0 -0
  404. package/build/client/_app/immutable/nodes/16.BJOpVasQ.js.br +0 -0
  405. package/build/client/_app/immutable/nodes/16.BJOpVasQ.js.gz +0 -0
  406. package/build/client/_app/immutable/nodes/17.Bk-1GRlF.js.br +0 -0
  407. package/build/client/_app/immutable/nodes/19.lzLFSTUS.js.br +0 -3
  408. package/build/client/_app/immutable/nodes/19.lzLFSTUS.js.gz +0 -0
  409. package/build/client/_app/immutable/nodes/2.D1A41fuz.js.br +0 -0
  410. package/build/client/_app/immutable/nodes/2.D1A41fuz.js.gz +0 -0
  411. package/build/client/_app/immutable/nodes/20.DqOEVNtJ.js.br +0 -0
  412. package/build/client/_app/immutable/nodes/20.DqOEVNtJ.js.gz +0 -0
  413. package/build/client/_app/immutable/nodes/21.BmaCB5Rb.js.br +0 -0
  414. package/build/client/_app/immutable/nodes/21.BmaCB5Rb.js.gz +0 -0
  415. package/build/client/_app/immutable/nodes/22.D4F9Jlfe.js.br +0 -0
  416. package/build/client/_app/immutable/nodes/22.D4F9Jlfe.js.gz +0 -0
  417. package/build/client/_app/immutable/nodes/23.CGv8T_kx.js.br +0 -0
  418. package/build/client/_app/immutable/nodes/23.CGv8T_kx.js.gz +0 -0
  419. package/build/client/_app/immutable/nodes/24.DKrgSigC.js.br +0 -0
  420. package/build/client/_app/immutable/nodes/24.DKrgSigC.js.gz +0 -0
  421. package/build/client/_app/immutable/nodes/25.DsBTVUcU.js.br +0 -0
  422. package/build/client/_app/immutable/nodes/25.DsBTVUcU.js.gz +0 -0
  423. package/build/client/_app/immutable/nodes/26.5XFLLXwF.js.br +0 -0
  424. package/build/client/_app/immutable/nodes/26.5XFLLXwF.js.gz +0 -0
  425. package/build/client/_app/immutable/nodes/27.BgW1QGtl.js.br +0 -0
  426. package/build/client/_app/immutable/nodes/27.BgW1QGtl.js.gz +0 -0
  427. package/build/client/_app/immutable/nodes/28.DeOjXHlX.js.br +0 -0
  428. package/build/client/_app/immutable/nodes/28.DeOjXHlX.js.gz +0 -0
  429. package/build/client/_app/immutable/nodes/3.Dh_akpU9.js.br +0 -0
  430. package/build/client/_app/immutable/nodes/3.Dh_akpU9.js.gz +0 -0
  431. package/build/client/_app/immutable/nodes/4.Bs1kn53S.js.br +0 -0
  432. package/build/client/_app/immutable/nodes/4.Bs1kn53S.js.gz +0 -0
  433. package/build/client/_app/immutable/nodes/6.C71EcMPx.js.br +0 -0
  434. package/build/client/_app/immutable/nodes/6.C71EcMPx.js.gz +0 -0
  435. package/build/client/_app/immutable/nodes/7.ZTOGuaHI.js.br +0 -0
  436. package/build/client/_app/immutable/nodes/7.ZTOGuaHI.js.gz +0 -0
  437. package/build/client/_app/immutable/nodes/8.CvoRv_Q7.js.br +0 -0
  438. package/build/client/_app/immutable/nodes/8.CvoRv_Q7.js.gz +0 -0
  439. package/build/client/_app/immutable/nodes/9.BKcDiRzn.js.br +0 -0
  440. package/build/client/_app/immutable/nodes/9.BKcDiRzn.js.gz +0 -0
package/dist/cli.js CHANGED
@@ -9,7 +9,7 @@ import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
9
9
  import { Command as Command5, InvalidArgumentError as InvalidArgumentError3 } from "commander";
10
10
 
11
11
  // package.json
12
- var version = "0.10.0";
12
+ var version = "0.11.0";
13
13
 
14
14
  // src/lib/chat/attachments.ts
15
15
  var UPLOAD_MAX_BYTES = 25 * 1024 * 1024;
@@ -549,7 +549,7 @@ function writePluginSettings(dir, id, settings2) {
549
549
  }
550
550
 
551
551
  // src/lib/server/cloud/settings.ts
552
- import { createHash as createHash2, randomBytes } from "node:crypto";
552
+ import { createHash as createHash3, randomBytes as randomBytes2 } from "node:crypto";
553
553
  import {
554
554
  chmod,
555
555
  lstat,
@@ -566,6 +566,9 @@ import path3 from "node:path";
566
566
  // src/lib/cloud.ts
567
567
  var DEFAULT_GATEWAY = "https://cloud.chrisjowen.net";
568
568
 
569
+ // src/lib/server/cloud/passkeys.ts
570
+ import { createHash as createHash2, createPublicKey as createPublicKey2, randomBytes, verify } from "node:crypto";
571
+
569
572
  // src/lib/server/cloud/protocol.ts
570
573
  import {
571
574
  createHash,
@@ -574,7 +577,7 @@ import {
574
577
  generateKeyPairSync,
575
578
  sign
576
579
  } from "node:crypto";
577
- var PROTOCOL = 1;
580
+ var PROTOCOL = 2;
578
581
  var FRAME_HTTP = 1;
579
582
  var FRAME_WS_TEXT = 2;
580
583
  var FRAME_WS_BINARY = 3;
@@ -709,10 +712,291 @@ function isRestartPath(path19) {
709
712
  return [flat, normal].some((s) => s.toLowerCase().startsWith("/api/wheelhouse/restart"));
710
713
  }
711
714
 
715
+ // src/lib/server/cloud/passkeys.ts
716
+ var MAX_PINS = 20;
717
+ var B64U = /^[A-Za-z0-9_-]+$/;
718
+ var isB64u = (v, max) => typeof v === "string" && v.length <= max && B64U.test(v);
719
+ function fits(key, alg) {
720
+ if (alg === -7) {
721
+ return key.asymmetricKeyType === "ec" && key.asymmetricKeyDetails?.namedCurve === "prime256v1";
722
+ }
723
+ if (alg === -8) return key.asymmetricKeyType === "ed25519";
724
+ if (alg === -257) return key.asymmetricKeyType === "rsa";
725
+ return false;
726
+ }
727
+ function publicKeyOf(p) {
728
+ try {
729
+ const key = createPublicKey2({
730
+ key: Buffer.from(p.publicKey, "base64url"),
731
+ format: "der",
732
+ type: "spki"
733
+ });
734
+ return fits(key, p.alg) ? key : null;
735
+ } catch {
736
+ return null;
737
+ }
738
+ }
739
+ function parsePasskeys(v) {
740
+ if (!Array.isArray(v) || v.length < 1 || v.length > MAX_PINS) return null;
741
+ const out = [];
742
+ for (const p of v) {
743
+ if (typeof p !== "object" || p === null) return null;
744
+ const { id, publicKey, alg, name } = p;
745
+ if (!isB64u(id, 1024) || !isB64u(publicKey, 4096) || typeof alg !== "number") return null;
746
+ const pin = { id, publicKey, alg, name: typeof name === "string" ? name.slice(0, 60) : "" };
747
+ if (!publicKeyOf(pin) || out.some((o) => o.id === id)) return null;
748
+ out.push(pin);
749
+ }
750
+ return out;
751
+ }
752
+ var passkeyFingerprint = (p) => fingerprint(p.publicKey);
753
+ var sha256 = (b) => createHash2("sha256").update(b).digest();
754
+ var TAGS = {
755
+ pair: Buffer.from("whc-pair-v2\n", "utf8"),
756
+ session: Buffer.from("whc-session-v2\n", "utf8"),
757
+ pins: Buffer.from("whc-pins-v2\n", "utf8")
758
+ };
759
+ function newChallenge(purpose) {
760
+ return Buffer.concat([TAGS[purpose], randomBytes(32)]).toString("base64url");
761
+ }
762
+ function assertionProblem(assertion, expected2) {
763
+ if (typeof assertion !== "object" || assertion === null) return "no passkey signature";
764
+ const { id, response: r } = assertion;
765
+ if (typeof id !== "string" || typeof r !== "object" || r === null) {
766
+ return "a malformed passkey signature";
767
+ }
768
+ const passkey = expected2.passkeys.find((p) => p.id === id);
769
+ if (!passkey) return "signed with a passkey this machine does not trust";
770
+ const { clientDataJSON, authenticatorData, signature } = r;
771
+ if (!isB64u(clientDataJSON, 8192) || !isB64u(authenticatorData, 8192) || !isB64u(signature, 2048)) {
772
+ return "a malformed passkey signature";
773
+ }
774
+ const clientData = Buffer.from(clientDataJSON, "base64url");
775
+ let c;
776
+ try {
777
+ const parsed = JSON.parse(clientData.toString("utf8"));
778
+ if (typeof parsed !== "object" || parsed === null) return "malformed client data";
779
+ c = parsed;
780
+ } catch {
781
+ return "malformed client data";
782
+ }
783
+ if (c.type !== "webauthn.get") return "not a passkey sign-in";
784
+ const tag = TAGS[expected2.purpose];
785
+ if (typeof c.challenge !== "string" || !Buffer.from(c.challenge, "base64url").subarray(0, tag.length).equals(tag)) {
786
+ return "signed a challenge for another purpose";
787
+ }
788
+ if (c.challenge !== expected2.challenge) return "signed another challenge";
789
+ if (c.origin !== expected2.origin) return "signed for another site";
790
+ if (c.crossOrigin !== void 0 && c.crossOrigin !== false) return "signed inside another site";
791
+ const authData = Buffer.from(authenticatorData, "base64url");
792
+ if (authData.length < 37) return "malformed authenticator data";
793
+ const rpId = URL.parse(expected2.origin)?.hostname ?? "";
794
+ if (!authData.subarray(0, 32).equals(sha256(rpId))) return "signed for another site";
795
+ const flags = authData[32];
796
+ if (!(flags & 1) || !(flags & 4)) return "the passkey did not verify the captain";
797
+ const key = publicKeyOf(passkey);
798
+ if (!key) return "a pinned passkey is malformed";
799
+ const signed2 = Buffer.concat([authData, sha256(clientData)]);
800
+ try {
801
+ const ok = verify(
802
+ passkey.alg === -8 ? null : "sha256",
803
+ signed2,
804
+ key,
805
+ Buffer.from(signature, "base64url")
806
+ );
807
+ return ok ? null : "a bad passkey signature";
808
+ } catch {
809
+ return "a bad passkey signature";
810
+ }
811
+ }
812
+
813
+ // src/lib/server/cloud/guard.ts
814
+ var CHALLENGE_TTL_MS = 6 * 6e4;
815
+ var VERIFIED_SESSION_MS = 8 * 60 * 6e4;
816
+ var PENDING_PINS_MS = 60 * 6e4;
817
+ var MAX_CHALLENGES = 16;
818
+ var MAX_VERIFIED = 64;
819
+ var idOf = (v) => typeof v === "string" && v.length > 0 && v.length <= 64 ? v : void 0;
820
+ var SessionGuard = class {
821
+ constructor(opts) {
822
+ this.opts = opts;
823
+ this.pinned = opts.pins;
824
+ this.now = opts.now ?? Date.now;
825
+ }
826
+ opts;
827
+ pinned;
828
+ /** Challenges issued and not yet seen signed, by purpose and session id or ref. */
829
+ challenges = /* @__PURE__ */ new Map();
830
+ /** Sessions a trusted passkey signed, and when. */
831
+ verified = /* @__PURE__ */ new Map();
832
+ /** Sessions whose streams were refused, so each is logged once. */
833
+ refused = /* @__PURE__ */ new Set();
834
+ now;
835
+ /** This machine checks every session's passkey signature itself. */
836
+ get checks() {
837
+ return this.pinned !== null;
838
+ }
839
+ /** The credential ids of the passkeys it trusts, as `auth.pins` names them. */
840
+ get credentials() {
841
+ return (this.pinned ?? []).map((p) => p.id);
842
+ }
843
+ /**
844
+ * Why a stream of this relay session is refused (§6.4), or null when it may
845
+ * be served. The first refusal of each session is logged: a stream of a
846
+ * session nobody signed is what a gateway acting on its own would send.
847
+ */
848
+ refusal(sessionId) {
849
+ if (!this.checks) return null;
850
+ const at = this.verified.get(sessionId);
851
+ const why = at === void 0 ? "No trusted passkey signed this session." : this.now() - at > VERIFIED_SESSION_MS ? "This session was signed more than 8 hours ago; open the machine again." : null;
852
+ if (why && !this.refused.has(sessionId)) {
853
+ this.refused.add(sessionId);
854
+ while (this.refused.size > MAX_VERIFIED) {
855
+ this.refused.delete(this.refused.values().next().value);
856
+ }
857
+ this.log(`refused the streams of session ${sessionId.slice(0, 8)}: ${why}`);
858
+ }
859
+ return why;
860
+ }
861
+ /** Forget the verified sessions past their 8 hours, returning them so their streams can end. */
862
+ sweep() {
863
+ const old = [...this.verified].filter(([, at]) => this.now() - at > VERIFIED_SESSION_MS);
864
+ for (const [id] of old) this.verified.delete(id);
865
+ return old.map(([id]) => id);
866
+ }
867
+ /**
868
+ * A `session.*` or `pins.*` control message from the gateway, and the
869
+ * answer to send back (none for `session.end`, or one that is not for it).
870
+ */
871
+ async handle(msg) {
872
+ const sessionId = idOf(msg.sessionId);
873
+ const ref = idOf(msg.ref);
874
+ switch (msg.t) {
875
+ case "session.challenge":
876
+ return sessionId ? { t: "session.challenge", sessionId, ...this.issue("session", sessionId) } : null;
877
+ case "pins.challenge":
878
+ return ref ? { t: "pins.challenge", ref, ...this.issue("pins", ref) } : null;
879
+ case "session.verify": {
880
+ if (!sessionId) return null;
881
+ const problem = this.spend("session", sessionId, msg.assertion);
882
+ if (problem) {
883
+ this.log(`refused to open session ${sessionId.slice(0, 8)}: ${problem}`);
884
+ return { t: "session.verified", sessionId, ok: false, reason: problem };
885
+ }
886
+ this.verified.delete(sessionId);
887
+ this.verified.set(sessionId, this.now());
888
+ while (this.verified.size > MAX_VERIFIED) {
889
+ this.verified.delete(this.verified.keys().next().value);
890
+ }
891
+ this.log(`session ${sessionId.slice(0, 8)} was signed with a trusted passkey.`);
892
+ return { t: "session.verified", sessionId, ok: true };
893
+ }
894
+ case "session.end":
895
+ if (sessionId) this.verified.delete(sessionId);
896
+ return null;
897
+ case "pins.update":
898
+ return ref ? this.proposed(ref, msg) : null;
899
+ default:
900
+ return null;
901
+ }
902
+ }
903
+ /**
904
+ * The answer to a `session.*` or `pins.*` request on a connection that may
905
+ * not have sessions signed (a gateway that negotiated protocol 1): nothing
906
+ * is issued, checked or kept, and `why` says so.
907
+ */
908
+ refuse(msg, why) {
909
+ const sessionId = idOf(msg.sessionId);
910
+ const ref = idOf(msg.ref);
911
+ switch (msg.t) {
912
+ case "session.challenge":
913
+ return sessionId ? { t: "session.challenge", sessionId, challenge: null, error: why } : null;
914
+ case "session.verify":
915
+ return sessionId ? { t: "session.verified", sessionId, ok: false, reason: why } : null;
916
+ case "pins.challenge":
917
+ return ref ? { t: "pins.challenge", ref, challenge: null, error: why } : null;
918
+ case "pins.update":
919
+ return ref ? { t: "pins.updated", ref, ok: false, reason: why } : null;
920
+ default:
921
+ return null;
922
+ }
923
+ }
924
+ /** The captain approved the pending change here: trust its passkeys from now on. */
925
+ repin(pins) {
926
+ this.pinned = pins;
927
+ this.log(`now trusts ${pins.map((p) => p.name || p.id.slice(0, 8)).join(", ")}.`);
928
+ }
929
+ /**
930
+ * `pins.update`: a new list, signed by a passkey trusted now (never one on
931
+ * the new list alone), is kept as the pending change for the captain to
932
+ * approve here; it changes nothing until they do.
933
+ */
934
+ async proposed(ref, msg) {
935
+ const signedBy = this.pinned?.find((p) => p.id === msg.assertion?.id);
936
+ const problem = this.spend("pins", ref, msg.assertion);
937
+ const passkeys = parsePasskeys(msg.passkeys);
938
+ const refused2 = problem ?? (passkeys ? null : "the new list of passkeys is malformed");
939
+ if (refused2 || !passkeys) {
940
+ this.log(`kept its trusted passkeys: ${refused2}`);
941
+ return { t: "pins.updated", ref, ok: false, reason: refused2 };
942
+ }
943
+ try {
944
+ await this.opts.propose({ ref, passkeys, signedBy: signedBy?.name ?? "" });
945
+ } catch (e) {
946
+ const reason = `the new passkeys could not be kept: ${e.message}`.slice(0, 200);
947
+ this.log(`kept its trusted passkeys: ${reason}`);
948
+ return { t: "pins.updated", ref, ok: false, reason };
949
+ }
950
+ this.log(
951
+ `was asked to trust ${passkeys.map((p) => p.name || p.id.slice(0, 8)).join(", ")} instead; approve or reject that on the Remotes page.`
952
+ );
953
+ return { t: "pins.updated", ref, ok: true, pending: true };
954
+ }
955
+ log(line) {
956
+ this.opts.log?.(line);
957
+ }
958
+ /** A fresh challenge for one session or pins update, and the passkeys that may sign it. */
959
+ issue(purpose, id) {
960
+ if (!this.pinned?.length) {
961
+ return { challenge: null, error: "this machine has no pinned passkeys" };
962
+ }
963
+ const now = this.now();
964
+ for (const [k, c] of this.challenges) if (c.expires < now) this.challenges.delete(k);
965
+ const key = `${purpose}:${id}`;
966
+ const challenge = newChallenge(purpose);
967
+ this.challenges.delete(key);
968
+ this.challenges.set(key, { challenge, expires: now + CHALLENGE_TTL_MS });
969
+ while (this.challenges.size > MAX_CHALLENGES) {
970
+ this.challenges.delete(this.challenges.keys().next().value);
971
+ }
972
+ return { challenge, credentials: this.credentials };
973
+ }
974
+ /**
975
+ * Use up the challenge issued for this purpose and id, pass or fail, and
976
+ * check the assertion against it.
977
+ */
978
+ spend(purpose, id, assertion) {
979
+ const key = `${purpose}:${id}`;
980
+ const issued = this.challenges.get(key);
981
+ this.challenges.delete(key);
982
+ if (!this.pinned?.length) return "this machine has no pinned passkeys";
983
+ if (!issued || issued.expires < this.now()) {
984
+ return "no live challenge for it: never issued, already used, or expired";
985
+ }
986
+ return assertionProblem(assertion, {
987
+ purpose,
988
+ challenge: issued.challenge,
989
+ origin: this.opts.origin,
990
+ passkeys: this.pinned
991
+ });
992
+ }
993
+ };
994
+
712
995
  // src/lib/server/cloud/settings.ts
713
996
  var CLOUD_SETTINGS_SCHEMA = "wheelhouse-cloud-settings.v1";
714
997
  var CLOUD_STATUS_SCHEMA = "wheelhouse-cloud-status.v1";
715
998
  var CLOUD_KEYCHAIN_SERVICE = "wheelhouse-cloud";
999
+ var lapsed = (p, now = Date.now()) => !(now - Date.parse(p.requestedAt) <= PENDING_PINS_MS);
716
1000
  var cloudDir = (configDir) => path3.join(configDir, "cloud");
717
1001
  var LOOPBACK = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]"]);
718
1002
  function gatewayOrigin(raw) {
@@ -746,7 +1030,42 @@ function parseDevice(v) {
746
1030
  gateway,
747
1031
  publicKey,
748
1032
  user: str(v.user),
749
- pairedAt: str(v.pairedAt) ?? (/* @__PURE__ */ new Date(0)).toISOString()
1033
+ pairedAt: str(v.pairedAt) ?? (/* @__PURE__ */ new Date(0)).toISOString(),
1034
+ // Pins that can't be read never mean none: no silent downgrade, every session is refused.
1035
+ pins: v.pins === void 0 || v.pins === null ? null : parsePasskeys(v.pins) ?? [],
1036
+ pinnedAt: str(v.pinnedAt),
1037
+ pending: parsePending(v.pending),
1038
+ undelivered: Array.isArray(v.undelivered) ? v.undelivered.map(parseDecided).filter((d) => d !== null).slice(-MAX_UNDELIVERED) : []
1039
+ };
1040
+ }
1041
+ function parsePending(v) {
1042
+ if (!isObj(v)) return null;
1043
+ const id = str(v.id);
1044
+ const ref = str(v.ref);
1045
+ const passkeys = parsePasskeys(v.passkeys);
1046
+ const requestedAt = str(v.requestedAt);
1047
+ if (!id || !ref || !passkeys || !requestedAt) return null;
1048
+ return { id, ref, passkeys, signedBy: str(v.signedBy) ?? "", requestedAt };
1049
+ }
1050
+ var MAX_UNDELIVERED = 16;
1051
+ function parseDecided(v) {
1052
+ if (!isObj(v) || !str(v.ref) || typeof v.approved !== "boolean") return null;
1053
+ const reason = ["rejected", "expired", "replaced"].includes(v.reason) ? v.reason : null;
1054
+ return { ref: v.ref, approved: v.approved, reason, at: str(v.at) ?? "" };
1055
+ }
1056
+ var shown = (pins) => pins.map((p) => ({ name: p.name, fingerprint: passkeyFingerprint(p) }));
1057
+ function pendingView(device) {
1058
+ const p = device.pending;
1059
+ if (!p || lapsed(p)) return null;
1060
+ const now = new Set((device.pins ?? []).map((k) => k.id));
1061
+ const next = new Set(p.passkeys.map((k) => k.id));
1062
+ return {
1063
+ id: p.id,
1064
+ passkeys: p.passkeys.map((k) => ({ ...shown([k])[0], added: !now.has(k.id) })),
1065
+ removed: shown((device.pins ?? []).filter((k) => !next.has(k.id))),
1066
+ signedBy: p.signedBy,
1067
+ requestedAt: p.requestedAt,
1068
+ expiresAt: new Date(Date.parse(p.requestedAt) + PENDING_PINS_MS).toISOString()
750
1069
  };
751
1070
  }
752
1071
  function parseSessions(v) {
@@ -767,7 +1086,7 @@ function parseSessions(v) {
767
1086
  }
768
1087
  async function writeAtomic(file, text2) {
769
1088
  await mkdir2(path3.dirname(file), { recursive: true, mode: 448 });
770
- const tmp = `${file}.tmp-${process.pid}-${randomBytes(4).toString("hex")}`;
1089
+ const tmp = `${file}.tmp-${process.pid}-${randomBytes2(4).toString("hex")}`;
771
1090
  try {
772
1091
  await writeFile2(tmp, text2, { mode: 384 });
773
1092
  await rename2(tmp, file);
@@ -851,7 +1170,7 @@ var CloudSettings = class {
851
1170
  /** The Keychain account for this directory's device key, so each config directory has its own. */
852
1171
  async keychainAccount() {
853
1172
  const real2 = await realpath(this.dir).catch(() => path3.resolve(this.dir));
854
- return `device:${createHash2("sha256").update(real2).digest("hex").slice(0, 16)}`;
1173
+ return `device:${createHash3("sha256").update(real2).digest("hex").slice(0, 16)}`;
855
1174
  }
856
1175
  /** The device key and where it is kept: the Keychain first, then the file. */
857
1176
  async findKey() {
@@ -897,6 +1216,54 @@ var CloudSettings = class {
897
1216
  s.started = false;
898
1217
  });
899
1218
  }
1219
+ /**
1220
+ * The captain approved, here, the pending change `id` (§6.6): its passkeys
1221
+ * become the ones this machine trusts. Only that change, and only within
1222
+ * its hour: one the gateway has replaced since they looked (even under the
1223
+ * same ref), or one that lapsed, is not approved.
1224
+ */
1225
+ approvePins(id, now = Date.now()) {
1226
+ return this.settle(id, now, (device, pending) => {
1227
+ device.pins = pending.passkeys;
1228
+ device.pinnedAt = new Date(now).toISOString();
1229
+ return { approved: true, reason: null };
1230
+ });
1231
+ }
1232
+ /** The captain rejected the pending change `id`: the passkeys trusted stay as they are. */
1233
+ rejectPins(id, now = Date.now()) {
1234
+ return this.settle(id, now, () => ({ approved: false, reason: "rejected" }));
1235
+ }
1236
+ /** The pending change `id` lapsed with nobody deciding: it counts as rejected. */
1237
+ expirePins(id, now = Date.now()) {
1238
+ return this.settle(id, now, () => ({ approved: false, reason: "expired" }), true);
1239
+ }
1240
+ async settle(id, now, take, lapsing = false) {
1241
+ let error = null;
1242
+ try {
1243
+ await this.update((s) => {
1244
+ const pending = s.device?.pending;
1245
+ if (!s.device || !pending || pending.id !== id) {
1246
+ error = "No such change of passkeys is waiting; look again.";
1247
+ } else if (lapsed(pending, now) !== lapsing) {
1248
+ error = "That change of passkeys expired; ask for it again on the gateway.";
1249
+ }
1250
+ if (error) throw new Error(error);
1251
+ const decision = take(s.device, pending);
1252
+ s.device.pending = null;
1253
+ const list2 = s.device.undelivered;
1254
+ list2.push({ ref: pending.ref, ...decision, at: new Date(now).toISOString() });
1255
+ for (const dropped of list2.splice(0, list2.length - MAX_UNDELIVERED)) {
1256
+ console.warn(
1257
+ `Wheelhouse Cloud: dropped the decision on change ${dropped.ref} before the gateway was told; its next connection names the passkeys trusted.`
1258
+ );
1259
+ }
1260
+ });
1261
+ } catch (e) {
1262
+ if (error) return { ok: false, error };
1263
+ throw e;
1264
+ }
1265
+ return { ok: true };
1266
+ }
900
1267
  async readStatus() {
901
1268
  try {
902
1269
  const v = JSON.parse(await readFile2(this.statusFile, "utf8"));
@@ -945,7 +1312,10 @@ var CloudSettings = class {
945
1312
  name: settings2.device.name,
946
1313
  user: settings2.device.user,
947
1314
  fingerprint: fingerprint(settings2.device.publicKey),
948
- pairedAt: settings2.device.pairedAt
1315
+ pairedAt: settings2.device.pairedAt,
1316
+ passkeys: settings2.device.pins ? shown(settings2.device.pins) : null,
1317
+ pinnedAt: settings2.device.pinnedAt,
1318
+ pending: pendingView(settings2.device)
949
1319
  } : null;
950
1320
  const live = status && device && status.deviceId === device.id && alive(status.pid) ? status : null;
951
1321
  let state;
@@ -990,6 +1360,9 @@ function cloudKeychain() {
990
1360
  return process.platform === "darwin" ? macKeychain(CLOUD_KEYCHAIN_SERVICE) : null;
991
1361
  }
992
1362
 
1363
+ // src/lib/server/cloud/service.ts
1364
+ import { randomBytes as randomBytes3 } from "node:crypto";
1365
+
993
1366
  // src/lib/server/cloud/connector.ts
994
1367
  import WebSocket2 from "ws";
995
1368
 
@@ -1128,6 +1501,12 @@ var Relay = class {
1128
1501
  if (payload.length > maxWsMessage) return this.reset(s.id, "too_large");
1129
1502
  s.ws.send(payload, { binary: kind === FRAME_WS_BINARY }, () => this.passed(s, payload.length));
1130
1503
  }
1504
+ /** A relay session ended, or is no longer served: every stream of it is reset. */
1505
+ endSession(sessionId, message) {
1506
+ for (const s of [...this.streams.values()]) {
1507
+ if (s.session === sessionId) this.reset(s.id, "refused", message);
1508
+ }
1509
+ }
1131
1510
  /** The device socket is gone: every stream on it ends (§7). */
1132
1511
  closeAll() {
1133
1512
  this.closed = true;
@@ -1219,8 +1598,9 @@ var Relay = class {
1219
1598
  }
1220
1599
  /**
1221
1600
  * What the request may reach, or the reset that refuses it (§6.4): the
1222
- * stream id is new, the target is Wheelhouse or one of its previews, the path
1223
- * is an absolute path that is not the restart, and the cloud is on here.
1601
+ * stream id is new, the session is one this machine serves, the target is
1602
+ * Wheelhouse or one of its previews, the path is an absolute path that is
1603
+ * not the restart, and the cloud is on here.
1224
1604
  */
1225
1605
  async admit(id, msg) {
1226
1606
  if (!Number.isInteger(id) || id <= this.lastId || id > 4294967295) {
@@ -1234,6 +1614,8 @@ var Relay = class {
1234
1614
  if (!relay || !headers || typeof path19 !== "string" || !path19.startsWith("/") || path19.length > 8192 || !headerSafe(path19) || path19.includes(" ")) {
1235
1615
  return { ok: false, code: "protocol", message: "The request is malformed." };
1236
1616
  }
1617
+ const refusal = this.opts.sessionRefusal?.(relay.sessionId);
1618
+ if (refusal) return { ok: false, code: "refused", message: refusal };
1237
1619
  if (!this.opts.targets.enabled()) {
1238
1620
  return {
1239
1621
  ok: false,
@@ -1260,6 +1642,8 @@ var Relay = class {
1260
1642
  if (port === app || !(await this.opts.targets.previewPorts()).has(port)) {
1261
1643
  return { ok: false, code: "refused", message: "That port is not a Wheelhouse preview." };
1262
1644
  }
1645
+ const late = this.opts.sessionRefusal?.(relay.sessionId);
1646
+ if (late) return { ok: false, code: "refused", message: late };
1263
1647
  return { ok: true, port, host: "localhost", path: path19, headers, relay };
1264
1648
  }
1265
1649
  /** §6.3: the headers for the local request. */
@@ -1305,6 +1689,7 @@ var Relay = class {
1305
1689
  const s = {
1306
1690
  kind: "http",
1307
1691
  id,
1692
+ session: a.relay.sessionId,
1308
1693
  flow: { out: 0, in: 0, passed: 0 },
1309
1694
  req,
1310
1695
  res: null,
@@ -1392,6 +1777,7 @@ var Relay = class {
1392
1777
  const s = {
1393
1778
  kind: "ws",
1394
1779
  id,
1780
+ session: a.relay.sessionId,
1395
1781
  flow: { out: 0, in: 0, passed: 0 },
1396
1782
  ws,
1397
1783
  accepted: false,
@@ -1457,6 +1843,8 @@ function relativeLocation(value, host, port) {
1457
1843
  // src/lib/server/cloud/connector.ts
1458
1844
  var HELLO_MS = 15e3;
1459
1845
  var STABLE_MS = 6e4;
1846
+ var SWEEP_MS = 6e4;
1847
+ var NOT_SIGNED_HERE = "this gateway cannot have sessions signed, so this machine with pinned passkeys serves nothing through it";
1460
1848
  var isObj3 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
1461
1849
  function connectUrl(gateway) {
1462
1850
  const u = new URL("/v1/connect", gateway);
@@ -1467,6 +1855,13 @@ var Connector = class {
1467
1855
  constructor(opts) {
1468
1856
  this.opts = opts;
1469
1857
  this.random = opts.random ?? Math.random;
1858
+ this.guard = new SessionGuard({
1859
+ origin: new URL(opts.gateway).origin,
1860
+ pins: opts.pins,
1861
+ propose: (p) => opts.events.proposed?.(p) ?? Promise.reject(new Error("there is nowhere to keep it")),
1862
+ log: (line) => this.log(`This machine ${line}`),
1863
+ now: opts.now
1864
+ });
1470
1865
  }
1471
1866
  opts;
1472
1867
  state = "connecting";
@@ -1476,10 +1871,24 @@ var Connector = class {
1476
1871
  retry = null;
1477
1872
  watchdog = null;
1478
1873
  stable = null;
1874
+ sweeper = null;
1479
1875
  stopped = false;
1480
1876
  random;
1877
+ /** The sessions this machine verified: kept across reconnects, as relay sessions are (§7). */
1878
+ guard;
1879
+ /** Sends on the socket while it is ready. */
1880
+ live = null;
1881
+ /** Decisions on a change of pins made while no socket was ready, sent after the next `ready`. */
1882
+ undelivered = [];
1481
1883
  start() {
1482
1884
  this.stopped = false;
1885
+ if (this.sweeper) clearInterval(this.sweeper);
1886
+ this.sweeper = setInterval(() => {
1887
+ for (const id of this.guard.sweep()) {
1888
+ this.relay?.endSession(id, "This session was signed more than 8 hours ago.");
1889
+ }
1890
+ }, this.opts.sweepMs ?? SWEEP_MS);
1891
+ this.sweeper.unref?.();
1483
1892
  this.connect();
1484
1893
  }
1485
1894
  /** Close the socket and stop reconnecting. */
@@ -1487,7 +1896,8 @@ var Connector = class {
1487
1896
  if (this.stopped) return;
1488
1897
  this.stopped = true;
1489
1898
  if (this.retry) clearTimeout(this.retry);
1490
- this.retry = null;
1899
+ if (this.sweeper) clearInterval(this.sweeper);
1900
+ this.retry = this.sweeper = null;
1491
1901
  this.teardown();
1492
1902
  const ws = this.ws;
1493
1903
  this.ws = null;
@@ -1508,7 +1918,26 @@ var Connector = class {
1508
1918
  log(line) {
1509
1919
  this.opts.events.log?.(line);
1510
1920
  }
1921
+ /**
1922
+ * The captain decided, here, on the pending change of pins `ref` (§6.6),
1923
+ * already applied to the guard. The gateway is told with `pins.decided`,
1924
+ * naming the pins after the decision; now, or after the next `ready` when
1925
+ * no socket is ready.
1926
+ */
1927
+ decide(d) {
1928
+ const msg = {
1929
+ t: "pins.decided",
1930
+ ref: d.ref,
1931
+ approved: d.approved,
1932
+ ...d.approved ? {} : { reason: d.reason ?? "rejected" },
1933
+ pins: this.guard.credentials
1934
+ };
1935
+ if (this.live) return this.live(msg);
1936
+ this.undelivered.push(msg);
1937
+ while (this.undelivered.length > 8) this.undelivered.shift();
1938
+ }
1511
1939
  teardown() {
1940
+ this.live = null;
1512
1941
  if (this.watchdog) clearTimeout(this.watchdog);
1513
1942
  if (this.stable) clearTimeout(this.stable);
1514
1943
  this.watchdog = this.stable = null;
@@ -1528,6 +1957,7 @@ var Connector = class {
1528
1957
  this.ws = ws;
1529
1958
  let limits = DEFAULT_LIMITS;
1530
1959
  let ready = false;
1960
+ let downgraded = null;
1531
1961
  let heartbeatMs = 2e4;
1532
1962
  const mine = () => this.ws === ws;
1533
1963
  const send = (msg) => {
@@ -1568,26 +1998,24 @@ var Connector = class {
1568
1998
  if (!isObj3(msg) || typeof msg.t !== "string") return;
1569
1999
  if (!ready) {
1570
2000
  if (msg.t === "hello" && typeof msg.nonce === "string") {
1571
- if (typeof msg.protocol === "number" && msg.protocol < PROTOCOL) {
1572
- this.log(
1573
- `The gateway speaks protocol ${msg.protocol}; this Wheelhouse speaks ${PROTOCOL}.`
1574
- );
1575
- }
1576
2001
  send({
1577
2002
  t: "auth",
1578
2003
  protocol: PROTOCOL,
1579
2004
  deviceId: this.opts.deviceId,
1580
2005
  sig: connectSig(this.opts.key, msg.nonce, this.opts.deviceId),
1581
2006
  agent: { name: "wheelhouse", version: this.opts.version },
1582
- features: []
2007
+ features: [],
2008
+ pins: this.guard.credentials
1583
2009
  });
1584
2010
  } else if (msg.t === "ready") {
1585
2011
  ready = true;
2012
+ const agreed = typeof msg.protocol === "number" ? Math.min(msg.protocol, PROTOCOL) : 1;
1586
2013
  if (typeof msg.heartbeatMs === "number" && msg.heartbeatMs >= 1e3) {
1587
2014
  heartbeatMs = msg.heartbeatMs;
1588
2015
  }
1589
2016
  limits = readLimits(msg.limits);
1590
2017
  alive3(heartbeatMs * 3);
2018
+ downgraded = this.guard.checks && agreed < 2 ? `This gateway speaks protocol ${agreed}, so it cannot have sessions signed with your passkey; this machine refuses every session it relays until the gateway is updated.` : null;
1591
2019
  this.relay = new Relay({
1592
2020
  limits,
1593
2021
  targets: this.opts.targets,
@@ -1595,16 +2023,35 @@ var Connector = class {
1595
2023
  sendFrame: (frame) => {
1596
2024
  if (mine() && ws.readyState === WebSocket2.OPEN) ws.send(frame, { binary: true });
1597
2025
  },
1598
- onRelayed: (r) => this.opts.events.relayed?.(r)
2026
+ onRelayed: (r) => this.opts.events.relayed?.(r),
2027
+ sessionRefusal: (id) => downgraded ? NOT_SIGNED_HERE : this.guard.refusal(id)
1599
2028
  });
1600
2029
  this.stable = setTimeout(() => this.attempt = 0, this.opts.stableMs ?? STABLE_MS);
1601
2030
  this.stable.unref?.();
1602
- this.set("online", null);
2031
+ if (downgraded) this.log(downgraded);
2032
+ this.set("online", downgraded);
2033
+ this.live = send;
2034
+ for (const m of this.undelivered.splice(0)) send(m);
1603
2035
  }
1604
2036
  return;
1605
2037
  }
1606
2038
  if (msg.t === "ping") return send({ t: "pong", ts: msg.ts });
1607
2039
  if (msg.t === "pong") return;
2040
+ if (msg.t.startsWith("session.") || msg.t.startsWith("pins.")) {
2041
+ if (msg.t === "session.end" && typeof msg.sessionId === "string") {
2042
+ this.relay?.endSession(msg.sessionId, "The relay session ended.");
2043
+ }
2044
+ if (downgraded && msg.t !== "session.end") {
2045
+ const reply = this.guard.refuse(msg, NOT_SIGNED_HERE);
2046
+ if (reply) send(reply);
2047
+ return;
2048
+ }
2049
+ void this.guard.handle(msg).then(
2050
+ (reply) => reply && send(reply),
2051
+ (e) => this.log(`Could not answer ${msg.t}: ${e.message}`)
2052
+ );
2053
+ return;
2054
+ }
1608
2055
  this.relay?.control(msg);
1609
2056
  });
1610
2057
  ws.on("error", (e) => {
@@ -1647,6 +2094,7 @@ var POLL_MS = 3e3;
1647
2094
  var SEEN_WRITE_MS = 15e3;
1648
2095
  var MAX_SESSIONS = 20;
1649
2096
  var HOLDER_FRESH_MS = 3 * 6e4;
2097
+ var decidedKey = (d) => `${d.ref}:${d.at}`;
1650
2098
  var CloudService = class {
1651
2099
  constructor(opts) {
1652
2100
  this.opts = opts;
@@ -1671,6 +2119,8 @@ var CloudService = class {
1671
2119
  ticking = false;
1672
2120
  /** Stopped: a look still in flight must not start a connector. */
1673
2121
  closed = false;
2122
+ /** The decisions on changes of pins already handed to a connector by this process. */
2123
+ handed = /* @__PURE__ */ new Set();
1674
2124
  /** Start watching the settings; resolves after the first look. */
1675
2125
  async start() {
1676
2126
  this.closed = false;
@@ -1736,8 +2186,13 @@ var CloudService = class {
1736
2186
  }
1737
2187
  return;
1738
2188
  }
2189
+ const pins = JSON.stringify(device.pins);
1739
2190
  const same = this.running && this.running.deviceId === device.id && this.running.gateway === device.gateway;
1740
- if (same) return;
2191
+ if (same && this.connector) {
2192
+ await this.settlePins(this.connector, device);
2193
+ if (!this.running || this.running.pins === pins) return;
2194
+ this.opts.log("Wheelhouse Cloud: the passkeys this machine trusts changed; reconnecting.");
2195
+ }
1741
2196
  if (this.connector) this.halt();
1742
2197
  const holder = await this.heldElsewhere(device.id);
1743
2198
  if (holder) {
@@ -1761,7 +2216,7 @@ var CloudService = class {
1761
2216
  if (this.closed) return;
1762
2217
  const seen = before?.deviceId === device.id ? [...before.sessions].reverse() : [];
1763
2218
  this.sessions = new Map(seen.map((s) => [s.id, s]));
1764
- this.running = { deviceId: device.id, gateway: device.gateway };
2219
+ this.running = { deviceId: device.id, gateway: device.gateway, pins };
1765
2220
  const base = {
1766
2221
  pid: this.pid,
1767
2222
  state: "connecting",
@@ -1779,6 +2234,8 @@ var CloudService = class {
1779
2234
  deviceId: device.id,
1780
2235
  key: found.key,
1781
2236
  version: this.opts.version,
2237
+ pins: device.pins,
2238
+ now: this.now,
1782
2239
  targets: {
1783
2240
  appPort: this.opts.appPort,
1784
2241
  previewPorts: this.opts.previewPorts,
@@ -1820,6 +2277,23 @@ var CloudService = class {
1820
2277
  void this.opts.settings.forget().catch(() => {
1821
2278
  });
1822
2279
  },
2280
+ proposed: async (p) => {
2281
+ let before2 = null;
2282
+ await this.opts.settings.update((x) => {
2283
+ if (x.device?.id !== device.id) throw new Error("this machine is no longer paired");
2284
+ const was = x.device.pending;
2285
+ if (was && was.ref !== p.ref) {
2286
+ before2 = { ref: was.ref, reason: lapsed(was, this.now()) ? "expired" : "replaced" };
2287
+ }
2288
+ x.device.pending = {
2289
+ ...p,
2290
+ id: randomBytes3(8).toString("hex"),
2291
+ requestedAt: new Date(this.now()).toISOString()
2292
+ };
2293
+ });
2294
+ const b = before2;
2295
+ if (b) connector.decide({ ref: b.ref, approved: false, reason: b.reason });
2296
+ },
1823
2297
  log: (line) => this.opts.log(`Wheelhouse Cloud: ${line}`)
1824
2298
  }
1825
2299
  });
@@ -1827,6 +2301,36 @@ var CloudService = class {
1827
2301
  this.write(base);
1828
2302
  connector.start();
1829
2303
  }
2304
+ /**
2305
+ * The pending change of pins: one past its hour lapses (as rejected), and a
2306
+ * decision the captain made here, in this process or another, goes to the
2307
+ * connector once, which applies it and tells the gateway.
2308
+ */
2309
+ async settlePins(connector, device) {
2310
+ if (device.pending && lapsed(device.pending, this.now())) {
2311
+ await this.opts.settings.expirePins(device.pending.id, this.now());
2312
+ return;
2313
+ }
2314
+ const fresh = device.undelivered.filter((d) => !this.handed.has(decidedKey(d)));
2315
+ if (!fresh.length) return;
2316
+ const pins = JSON.stringify(device.pins);
2317
+ if (pins !== this.running.pins && device.pins?.length) {
2318
+ connector.guard.repin(device.pins);
2319
+ this.running.pins = pins;
2320
+ }
2321
+ for (const d of fresh) {
2322
+ this.handed.add(decidedKey(d));
2323
+ connector.decide({ ref: d.ref, approved: d.approved, reason: d.reason });
2324
+ this.opts.log(
2325
+ d.approved ? `Wheelhouse Cloud: the new passkeys were approved here; this machine trusts them now.` : `Wheelhouse Cloud: the change of passkeys was ${d.reason ?? "rejected"}; this machine trusts the same passkeys as before.`
2326
+ );
2327
+ }
2328
+ const sent = new Set(fresh.map(decidedKey));
2329
+ await this.opts.settings.update((x) => {
2330
+ if (x.device?.id !== device.id) return;
2331
+ x.device.undelivered = x.device.undelivered.filter((d) => !sent.has(decidedKey(d)));
2332
+ });
2333
+ }
1830
2334
  /** §6.4: a local log of each relay session, without paths, bodies or header values. */
1831
2335
  relayed(r) {
1832
2336
  const at = new Date(this.now()).toISOString();
@@ -1904,7 +2408,7 @@ async function writeInstalled(dir, installed) {
1904
2408
  }
1905
2409
 
1906
2410
  // src/lib/server/setup/skill.ts
1907
- import { createHash as createHash3 } from "node:crypto";
2411
+ import { createHash as createHash4 } from "node:crypto";
1908
2412
  import {
1909
2413
  lstat as lstat2,
1910
2414
  mkdir as mkdir4,
@@ -1921,7 +2425,7 @@ import path5 from "node:path";
1921
2425
  var NAME = "manage-wheelhouse";
1922
2426
  var RECEIPT = ".wheelhouse-managed.json";
1923
2427
  var FILES = ["SKILL.md", "references/operations.md"];
1924
- var hash = (text2) => createHash3("sha256").update(text2).digest("hex");
2428
+ var hash = (text2) => createHash4("sha256").update(text2).digest("hex");
1925
2429
  async function physical(file) {
1926
2430
  try {
1927
2431
  return await realpath2(file);
@@ -2279,7 +2783,7 @@ async function checkDiscordToken(token, opts = {}) {
2279
2783
  var inviteUrl = (appId) => `https://discord.com/oauth2/authorize?client_id=${encodeURIComponent(appId)}&scope=bot&permissions=0`;
2280
2784
 
2281
2785
  // src/lib/server/gateway/settings.ts
2282
- import { createHash as createHash4, randomBytes as randomBytes2 } from "node:crypto";
2786
+ import { createHash as createHash5, randomBytes as randomBytes4 } from "node:crypto";
2283
2787
  import {
2284
2788
  chmod as chmod2,
2285
2789
  lstat as lstat3,
@@ -2344,7 +2848,7 @@ function parseChannel(v, fallback) {
2344
2848
  }
2345
2849
  async function writeAtomic2(file, text2) {
2346
2850
  await mkdir5(path9.dirname(file), { recursive: true, mode: 448 });
2347
- const tmp = `${file}.tmp-${process.pid}-${randomBytes2(4).toString("hex")}`;
2851
+ const tmp = `${file}.tmp-${process.pid}-${randomBytes4(4).toString("hex")}`;
2348
2852
  try {
2349
2853
  await writeFile5(tmp, text2, { mode: 384 });
2350
2854
  await rename5(tmp, file);
@@ -2430,7 +2934,7 @@ var GatewaySettings = class {
2430
2934
  */
2431
2935
  async keychainAccount(channel) {
2432
2936
  const real2 = await realpath3(this.dir).catch(() => path9.resolve(this.dir));
2433
- return `${channel}:${createHash4("sha256").update(real2).digest("hex").slice(0, 16)}`;
2937
+ return `${channel}:${createHash5("sha256").update(real2).digest("hex").slice(0, 16)}`;
2434
2938
  }
2435
2939
  /** Keep the token in the Keychain, else in its file, replacing the one before; returns where it went. */
2436
2940
  async setToken(channel, token) {
@@ -3506,7 +4010,7 @@ async function exists(p) {
3506
4010
  }
3507
4011
 
3508
4012
  // cli/running.ts
3509
- import { randomBytes as randomBytes3, timingSafeEqual } from "node:crypto";
4013
+ import { randomBytes as randomBytes5, timingSafeEqual } from "node:crypto";
3510
4014
  import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "node:fs";
3511
4015
  import { readdir as readdir2, readFile as readFile7, rm as rm5 } from "node:fs/promises";
3512
4016
  import path13 from "node:path";
@@ -3514,7 +4018,7 @@ var RESTART_EXIT = 75;
3514
4018
  var RESTART_PATH = "/api/wheelhouse/restart";
3515
4019
  var RUNNING_DIR = ".running";
3516
4020
  var TIMEOUT_MS = 3e3;
3517
- var newToken = () => randomBytes3(24).toString("hex");
4021
+ var newToken = () => randomBytes5(24).toString("hex");
3518
4022
  function writeRunning(pluginsDir, r) {
3519
4023
  const dir = path13.join(pluginsDir, RUNNING_DIR);
3520
4024
  mkdirSync2(dir, { recursive: true, mode: 448 });
@@ -3701,13 +4205,18 @@ async function keepDevice(settings2, gateway, key, name, device, opts = {}) {
3701
4205
  x.enabled = true;
3702
4206
  if (opts.start) x.started = true;
3703
4207
  x.gateway = gateway;
4208
+ const now = (/* @__PURE__ */ new Date()).toISOString();
3704
4209
  x.device = {
3705
4210
  id: device.deviceId,
3706
4211
  name: device.name || name,
3707
4212
  gateway,
3708
4213
  publicKey: key.publicKey,
3709
4214
  user: device.user,
3710
- pairedAt: (/* @__PURE__ */ new Date()).toISOString()
4215
+ pairedAt: now,
4216
+ pins: device.pins,
4217
+ pinnedAt: device.pins ? now : null,
4218
+ pending: null,
4219
+ undelivered: []
3711
4220
  };
3712
4221
  });
3713
4222
  return where;
@@ -3729,10 +4238,12 @@ async function post(f, url, payload) {
3729
4238
  var unreachable = (gateway, e) => `The gateway at ${gateway} could not be reached: ${e.message}`;
3730
4239
  async function startPairing(gateway, key, machine, deps = {}) {
3731
4240
  const f = deps.fetch ?? fetch;
4241
+ const pinChallenge = newChallenge("pair");
3732
4242
  let r;
3733
4243
  try {
3734
4244
  r = await post(f, `${gateway}/v1/pair/start`, {
3735
4245
  protocol: PROTOCOL,
4246
+ pin: { challenge: pinChallenge },
3736
4247
  publicKey: key.publicKey,
3737
4248
  name: machine.name.slice(0, 60) || "Wheelhouse",
3738
4249
  platform: machine.platform.slice(0, 40),
@@ -3763,7 +4274,8 @@ async function startPairing(gateway, key, machine, deps = {}) {
3763
4274
  verificationUri: `${gateway}/pair`,
3764
4275
  fingerprint: typeof b.fingerprint === "string" ? b.fingerprint : "",
3765
4276
  expiresIn: typeof b.expiresIn === "number" ? b.expiresIn : 600,
3766
- interval: typeof b.interval === "number" && b.interval > 0 ? b.interval : 3
4277
+ interval: typeof b.interval === "number" && b.interval > 0 ? b.interval : 3,
4278
+ pinChallenge
3767
4279
  };
3768
4280
  if (!start.pairingId || !/^[23456789BCDFGHJKLMNPQRSTVWXZ]{4}-?[23456789BCDFGHJKLMNPQRSTVWXZ]{4}$/i.test(start.userCode)) {
3769
4281
  return {
@@ -3821,9 +4333,22 @@ async function pollPairing(gateway, key, start, deps = {}) {
3821
4333
  }
3822
4334
  if (b.status === "approved" && typeof b.deviceId === "string" && b.deviceId) {
3823
4335
  const user = isObj5(b.user) && typeof b.user.name === "string" ? b.user.name : null;
4336
+ const pinned = approvedPins(b.pins, start.pinChallenge, gateway);
4337
+ if (!pinned.ok) {
4338
+ await unpair(gateway, key, b.deviceId, deps);
4339
+ return {
4340
+ status: "failed",
4341
+ reason: `The approval\u2019s passkey signature did not check out on this machine (${pinned.problem}), so it was not paired. Do not use this gateway until you know why.`
4342
+ };
4343
+ }
3824
4344
  return {
3825
4345
  status: "approved",
3826
- device: { deviceId: b.deviceId, name: typeof b.name === "string" ? b.name : "", user }
4346
+ device: {
4347
+ deviceId: b.deviceId,
4348
+ name: typeof b.name === "string" ? b.name : "",
4349
+ user,
4350
+ pins: pinned.pins
4351
+ }
3827
4352
  };
3828
4353
  }
3829
4354
  if (b.status === "denied")
@@ -3833,6 +4358,19 @@ async function pollPairing(gateway, key, start, deps = {}) {
3833
4358
  }
3834
4359
  return { status: "expired", reason: "The code expired before it was approved." };
3835
4360
  }
4361
+ function approvedPins(v, challenge, gateway) {
4362
+ if (v === void 0) return { ok: true, pins: null };
4363
+ const pins = isObj5(v) ? parsePasskeys(v.passkeys) : null;
4364
+ if (!pins || !isObj5(v)) return { ok: false, problem: "the passkeys it names are malformed" };
4365
+ const origin = new URL(gateway).origin;
4366
+ const problem = assertionProblem(v.assertion, {
4367
+ purpose: "pair",
4368
+ challenge,
4369
+ origin,
4370
+ passkeys: pins
4371
+ });
4372
+ return problem ? { ok: false, problem } : { ok: true, pins };
4373
+ }
3836
4374
  async function unpair(gateway, key, deviceId, deps = {}) {
3837
4375
  const f = deps.fetch ?? fetch;
3838
4376
  const ts = (deps.now ?? Date.now)();
@@ -3907,6 +4445,37 @@ function waitForSignal() {
3907
4445
  process.once("SIGTERM", () => resolve());
3908
4446
  });
3909
4447
  }
4448
+ function trusted(passkeys) {
4449
+ if (passkeys === null) {
4450
+ return [
4451
+ "not checked here: this machine was paired without passkeys, so it serves any session the gateway opens. Revoke it and pair it again to have it check each one."
4452
+ ];
4453
+ }
4454
+ if (!passkeys.length) {
4455
+ return [
4456
+ "could not be read, so this machine refuses every session. Revoke it and pair it again."
4457
+ ];
4458
+ }
4459
+ return [
4460
+ "only a session one of these signs is served:",
4461
+ ...passkeys.map((p) => ` ${p.fingerprint} ${p.name || "(unnamed)"}`)
4462
+ ];
4463
+ }
4464
+ function pendingLines(p) {
4465
+ const when = new Date(p.requestedAt).toLocaleString();
4466
+ return [
4467
+ `the gateway asked, ${when}${p.signedBy ? `, signed with ${p.signedBy}` : ""}, for this machine to trust instead:`,
4468
+ ...p.passkeys.map(
4469
+ (k) => ` ${k.fingerprint} ${k.name || "(unnamed)"}${k.added ? " (new)" : ""}`
4470
+ ),
4471
+ ...p.removed.length ? [
4472
+ "and to stop trusting:",
4473
+ ...p.removed.map((k) => ` ${k.fingerprint} ${k.name || "(unnamed)"}`)
4474
+ ] : [],
4475
+ "Approve only a change you started yourself, after checking each new fingerprint against the passkey or authenticator itself, or a device you trust: not against the gateway\u2019s Account page, which the gateway serves.",
4476
+ `Nothing changes until you decide, here, by ${new Date(p.expiresAt).toLocaleTimeString()}, naming this change by its id: wheelhouse remote pins approve ${p.id.slice(0, 8)}, or reject ${p.id.slice(0, 8)}.`
4477
+ ];
4478
+ }
3910
4479
  var ago = (iso) => {
3911
4480
  if (!iso) return "never";
3912
4481
  const s = Math.max(0, Math.round((Date.now() - Date.parse(iso)) / 1e3));
@@ -3967,6 +4536,16 @@ function remoteCommand(over = {}) {
3967
4536
  `Connected: ${device.name || name}${device.user ? `, approved by ${device.user}` : ""}.`
3968
4537
  );
3969
4538
  deps.log(`Its key is kept in ${where}, readable by you only; it never leaves this machine.`);
4539
+ if (device.pins) {
4540
+ deps.log(
4541
+ "It checks each session itself: only a session one of these passkeys signs is served (check their fingerprints against your passkeys or authenticators themselves, or a device you trust, not only a page the gateway serves):"
4542
+ );
4543
+ for (const p of device.pins) deps.log(` ${passkeyFingerprint(p)} ${p.name || "(unnamed)"}`);
4544
+ } else {
4545
+ deps.log(
4546
+ "Warning: the gateway pinned none of your passkeys (it speaks only protocol 1), so this machine does not check sessions itself: it serves any session the gateway opens. Pair it again once the gateway is updated."
4547
+ );
4548
+ }
3970
4549
  };
3971
4550
  cmd.command("connect").description(
3972
4551
  "Pair this machine with a gateway: shows a code to type there and a fingerprint to check."
@@ -4007,7 +4586,9 @@ function remoteCommand(over = {}) {
4007
4586
  "Start it on the Remotes page in Wheelhouse, which keeps the connection up while `wheelhouse open` runs; or run `wheelhouse remote run`."
4008
4587
  );
4009
4588
  });
4010
- cmd.command("status").description("Show whether this machine is connected, since when, and its relay sessions.").action(async (_o, c) => {
4589
+ cmd.command("status").description(
4590
+ "Show whether this machine is connected, since when, the passkeys it trusts to sign its sessions, and its relay sessions."
4591
+ ).action(async (_o, c) => {
4011
4592
  const settings2 = settingsFor(c);
4012
4593
  if (!settings2) return;
4013
4594
  const v = await settings2.view();
@@ -4021,6 +4602,16 @@ function remoteCommand(over = {}) {
4021
4602
  ` Machine: ${v.device ? `${v.device.name} (fingerprint ${v.device.fingerprint})${v.device.user ? `, approved by ${v.device.user}` : ""}` : "not paired (wheelhouse remote connect)"}`
4022
4603
  );
4023
4604
  if (v.keyStore) deps.log(` Key: ${v.keyStore}`);
4605
+ if (v.device) {
4606
+ const [first, ...rest] = trusted(v.device.passkeys);
4607
+ deps.log(` Sessions: ${first}`);
4608
+ for (const line of rest) deps.log(` ${line}`);
4609
+ if (v.device.pending) {
4610
+ const [ask, ...more] = pendingLines(v.device.pending);
4611
+ deps.log(` Pending: ${ask}`);
4612
+ for (const line of more) deps.log(` ${line}`);
4613
+ }
4614
+ }
4024
4615
  const states = {
4025
4616
  off: "off (not started)",
4026
4617
  "not-paired": "not paired",
@@ -4040,6 +4631,49 @@ function remoteCommand(over = {}) {
4040
4631
  }
4041
4632
  }
4042
4633
  });
4634
+ const pins = cmd.command("pins").description(
4635
+ "Show the passkeys this machine trusts to sign its sessions, and any change of them the gateway asked for."
4636
+ ).action(async (_o, c) => {
4637
+ const settings2 = settingsFor(c);
4638
+ if (!settings2) return;
4639
+ const v = await settings2.view();
4640
+ if (!v.device) return deps.log("This machine is not paired (wheelhouse remote connect).");
4641
+ for (const line of trusted(v.device.passkeys)) deps.log(line);
4642
+ if (v.device.pending) for (const line of pendingLines(v.device.pending)) deps.log(line);
4643
+ else deps.log("No change of them is waiting.");
4644
+ });
4645
+ for (const [name, approve] of [
4646
+ ["approve", true],
4647
+ ["reject", false]
4648
+ ]) {
4649
+ pins.command(`${name} [id]`).description(
4650
+ approve ? "Approve the change of trusted passkeys the gateway asked for, named by its id (at least 8 characters, as `pins` shows it): this machine trusts them from now on." : "Reject the change of trusted passkeys the gateway asked for, named by its id (at least 8 characters, as `pins` shows it): this machine keeps trusting the passkeys it does."
4651
+ ).action(async (id, _o, c) => {
4652
+ const settings2 = settingsFor(c);
4653
+ if (!settings2) return;
4654
+ const pending = (await settings2.view()).device?.pending;
4655
+ if (!pending) return fail("no change of trusted passkeys is waiting.");
4656
+ if (!id) {
4657
+ for (const line of pendingLines(pending)) deps.log(line);
4658
+ return fail(
4659
+ `name the change, by at least the 8 characters of its id: wheelhouse remote pins ${name} ${pending.id.slice(0, 8)}.`
4660
+ );
4661
+ }
4662
+ if (id.length < 8 || !pending.id.startsWith(id)) {
4663
+ return fail(
4664
+ `the change waiting is ${pending.id.slice(0, 8)}, not ${id}. Look again: wheelhouse remote pins.`
4665
+ );
4666
+ }
4667
+ const r = approve ? await settings2.approvePins(pending.id) : await settings2.rejectPins(pending.id);
4668
+ if (!r.ok) return fail(r.error);
4669
+ if (!approve) {
4670
+ return deps.log("Rejected: this machine keeps trusting the passkeys it did.");
4671
+ }
4672
+ deps.log("Approved: this machine now trusts only these passkeys to sign its sessions:");
4673
+ for (const k of pending.passkeys) deps.log(` ${k.fingerprint} ${k.name || "(unnamed)"}`);
4674
+ deps.log("A running connection takes them up within seconds.");
4675
+ });
4676
+ }
4043
4677
  cmd.command("disconnect").description("Revoke this machine on its gateway and delete its key here.").action(async (_o, c) => {
4044
4678
  const settings2 = settingsFor(c);
4045
4679
  if (!settings2) return;