@chrisjowen/wheelhouse 0.7.0 → 0.9.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 (390) hide show
  1. package/README.md +2 -2
  2. package/build/client/_app/immutable/chunks/{3bC4bjBI.js → BEc8oFj4.js} +1 -1
  3. package/build/client/_app/immutable/chunks/BEc8oFj4.js.br +0 -0
  4. package/build/client/_app/immutable/chunks/BEc8oFj4.js.gz +0 -0
  5. package/build/client/_app/immutable/chunks/{BrrBgLVG.js → BI6mOQIC.js} +1 -1
  6. package/build/client/_app/immutable/chunks/BI6mOQIC.js.br +0 -0
  7. package/build/client/_app/immutable/chunks/BI6mOQIC.js.gz +0 -0
  8. package/build/client/_app/immutable/chunks/{CgxyeCeP.js → BJLLbknR.js} +1 -1
  9. package/build/client/_app/immutable/chunks/BJLLbknR.js.br +0 -0
  10. package/build/client/_app/immutable/chunks/BJLLbknR.js.gz +0 -0
  11. package/build/client/_app/immutable/chunks/BNpuLzpy.js +2 -0
  12. package/build/client/_app/immutable/chunks/BNpuLzpy.js.br +0 -0
  13. package/build/client/_app/immutable/chunks/BNpuLzpy.js.gz +0 -0
  14. package/build/client/_app/immutable/chunks/{CNKI0WqS.js → BRfuAoq7.js} +1 -1
  15. package/build/client/_app/immutable/chunks/BRfuAoq7.js.br +0 -0
  16. package/build/client/_app/immutable/chunks/BRfuAoq7.js.gz +0 -0
  17. package/build/client/_app/immutable/chunks/{BlJ-AbFb.js → BSRqsJCa.js} +4 -4
  18. package/build/client/_app/immutable/chunks/BSRqsJCa.js.br +0 -0
  19. package/build/client/_app/immutable/chunks/BSRqsJCa.js.gz +0 -0
  20. package/build/client/_app/immutable/chunks/{CEhBf-yV.js → BTTjxuqT.js} +1 -1
  21. package/build/client/_app/immutable/chunks/BTTjxuqT.js.br +0 -0
  22. package/build/client/_app/immutable/chunks/BTTjxuqT.js.gz +0 -0
  23. package/build/client/_app/immutable/chunks/{CzbTCvH8.js → BveXuSek.js} +1 -1
  24. package/build/client/_app/immutable/chunks/BveXuSek.js.br +0 -0
  25. package/build/client/_app/immutable/chunks/BveXuSek.js.gz +0 -0
  26. package/build/client/_app/immutable/chunks/C0DPNoH0.js +5 -0
  27. package/build/client/_app/immutable/chunks/C0DPNoH0.js.br +0 -0
  28. package/build/client/_app/immutable/chunks/C0DPNoH0.js.gz +0 -0
  29. package/build/client/_app/immutable/chunks/{BibAhIE3.js → CNPFxlMK.js} +1 -1
  30. package/build/client/_app/immutable/chunks/CNPFxlMK.js.br +0 -0
  31. package/build/client/_app/immutable/chunks/CNPFxlMK.js.gz +0 -0
  32. package/build/client/_app/immutable/chunks/{D9coJX5q.js → CTb_ccym.js} +1 -1
  33. package/build/client/_app/immutable/chunks/CTb_ccym.js.br +0 -0
  34. package/build/client/_app/immutable/chunks/CTb_ccym.js.gz +0 -0
  35. package/build/client/_app/immutable/chunks/{10ROkIhN.js → CeCmrTGW.js} +1 -1
  36. package/build/client/_app/immutable/chunks/CeCmrTGW.js.br +0 -0
  37. package/build/client/_app/immutable/chunks/CeCmrTGW.js.gz +0 -0
  38. package/build/client/_app/immutable/chunks/{C9ed1vbc.js → DCmP9xcb.js} +2 -2
  39. package/build/client/_app/immutable/chunks/DCmP9xcb.js.br +0 -0
  40. package/build/client/_app/immutable/chunks/DCmP9xcb.js.gz +0 -0
  41. package/build/client/_app/immutable/chunks/{DHss7SEY.js → DHiN7982.js} +1 -1
  42. package/build/client/_app/immutable/chunks/DHiN7982.js.br +0 -0
  43. package/build/client/_app/immutable/chunks/{DHss7SEY.js.gz → DHiN7982.js.gz} +0 -0
  44. package/build/client/_app/immutable/chunks/{Ns_iZj-K.js → DVPW54rN.js} +1 -1
  45. package/build/client/_app/immutable/chunks/DVPW54rN.js.br +0 -0
  46. package/build/client/_app/immutable/chunks/DVPW54rN.js.gz +0 -0
  47. package/build/client/_app/immutable/chunks/{Dk0_dSfe.js → Dby6Wn4J.js} +1 -1
  48. package/build/client/_app/immutable/chunks/Dby6Wn4J.js.br +0 -0
  49. package/build/client/_app/immutable/chunks/Dby6Wn4J.js.gz +0 -0
  50. package/build/client/_app/immutable/chunks/{CR4i-JqL.js → Dzuse5SP.js} +1 -1
  51. package/build/client/_app/immutable/chunks/Dzuse5SP.js.br +0 -0
  52. package/build/client/_app/immutable/chunks/Dzuse5SP.js.gz +0 -0
  53. package/build/client/_app/immutable/chunks/{CRK1Q1tO.js → Lwq8jsO7.js} +1 -1
  54. package/build/client/_app/immutable/chunks/Lwq8jsO7.js.br +0 -0
  55. package/build/client/_app/immutable/chunks/Lwq8jsO7.js.gz +0 -0
  56. package/build/client/_app/immutable/chunks/{DMDL4MuU.js → Mzyfuo21.js} +1 -1
  57. package/build/client/_app/immutable/chunks/Mzyfuo21.js.br +1 -0
  58. package/build/client/_app/immutable/chunks/Mzyfuo21.js.gz +0 -0
  59. package/build/client/_app/immutable/chunks/{Om8BmhPE.js → kdhJpKON.js} +1 -1
  60. package/build/client/_app/immutable/chunks/kdhJpKON.js.br +0 -0
  61. package/build/client/_app/immutable/chunks/kdhJpKON.js.gz +0 -0
  62. package/build/client/_app/immutable/entry/{app.5tTdQ_02.js → app.DqKfT2WZ.js} +2 -2
  63. package/build/client/_app/immutable/entry/app.DqKfT2WZ.js.br +0 -0
  64. package/build/client/_app/immutable/entry/app.DqKfT2WZ.js.gz +0 -0
  65. package/build/client/_app/immutable/entry/start.DEmSMT5Q.js +1 -0
  66. package/build/client/_app/immutable/entry/start.DEmSMT5Q.js.br +0 -0
  67. package/build/client/_app/immutable/entry/start.DEmSMT5Q.js.gz +0 -0
  68. package/build/client/_app/immutable/nodes/{0.nyx2R9Qf.js → 0.CszE2Pm2.js} +5 -5
  69. package/build/client/_app/immutable/nodes/0.CszE2Pm2.js.br +0 -0
  70. package/build/client/_app/immutable/nodes/0.CszE2Pm2.js.gz +0 -0
  71. package/build/client/_app/immutable/nodes/{1.BkR_IPYS.js → 1.DdeexMc3.js} +1 -1
  72. package/build/client/_app/immutable/nodes/1.DdeexMc3.js.br +0 -0
  73. package/build/client/_app/immutable/nodes/1.DdeexMc3.js.gz +0 -0
  74. package/build/client/_app/immutable/nodes/{10.BS87tv1l.js → 10.C33nTvVg.js} +1 -1
  75. package/build/client/_app/immutable/nodes/10.C33nTvVg.js.br +0 -0
  76. package/build/client/_app/immutable/nodes/10.C33nTvVg.js.gz +0 -0
  77. package/build/client/_app/immutable/nodes/{11.DddxDkJ4.js → 11.Bitd-Um8.js} +1 -1
  78. package/build/client/_app/immutable/nodes/11.Bitd-Um8.js.br +0 -0
  79. package/build/client/_app/immutable/nodes/11.Bitd-Um8.js.gz +0 -0
  80. package/build/client/_app/immutable/nodes/{12.C9qwM8Di.js → 12.DvJMt_BX.js} +1 -1
  81. package/build/client/_app/immutable/nodes/12.DvJMt_BX.js.br +0 -0
  82. package/build/client/_app/immutable/nodes/12.DvJMt_BX.js.gz +0 -0
  83. package/build/client/_app/immutable/nodes/{13.CAV9o7bd.js → 13.CNcETgxx.js} +1 -1
  84. package/build/client/_app/immutable/nodes/13.CNcETgxx.js.br +0 -0
  85. package/build/client/_app/immutable/nodes/13.CNcETgxx.js.gz +0 -0
  86. package/build/client/_app/immutable/nodes/{14.B_Err-YM.js → 14.D45aaeoF.js} +1 -1
  87. package/build/client/_app/immutable/nodes/14.D45aaeoF.js.br +0 -0
  88. package/build/client/_app/immutable/nodes/14.D45aaeoF.js.gz +0 -0
  89. package/build/client/_app/immutable/nodes/{15.1PcFIFZ6.js → 15.BeC_sH9Y.js} +1 -1
  90. package/build/client/_app/immutable/nodes/15.BeC_sH9Y.js.br +0 -0
  91. package/build/client/_app/immutable/nodes/15.BeC_sH9Y.js.gz +0 -0
  92. package/build/client/_app/immutable/nodes/{16.CgtK_xkO.js → 16.CzLyGYG9.js} +1 -1
  93. package/build/client/_app/immutable/nodes/16.CzLyGYG9.js.br +0 -0
  94. package/build/client/_app/immutable/nodes/16.CzLyGYG9.js.gz +0 -0
  95. package/build/client/_app/immutable/nodes/{17.BQxfvX3S.js → 17.BHPNPH8i.js} +1 -1
  96. package/build/client/_app/immutable/nodes/17.BHPNPH8i.js.br +0 -0
  97. package/build/client/_app/immutable/nodes/17.BHPNPH8i.js.gz +0 -0
  98. package/build/client/_app/immutable/nodes/{19.Dxd8I8Tp.js → 19.D5AWgi46.js} +1 -1
  99. package/build/client/_app/immutable/nodes/19.D5AWgi46.js.br +0 -0
  100. package/build/client/_app/immutable/nodes/19.D5AWgi46.js.gz +0 -0
  101. package/build/client/_app/immutable/nodes/2.D9LnprvD.js +25 -0
  102. package/build/client/_app/immutable/nodes/2.D9LnprvD.js.br +0 -0
  103. package/build/client/_app/immutable/nodes/2.D9LnprvD.js.gz +0 -0
  104. package/build/client/_app/immutable/nodes/{20.DYaAa9CP.js → 20.Ds8FV7bT.js} +1 -1
  105. package/build/client/_app/immutable/nodes/20.Ds8FV7bT.js.br +0 -0
  106. package/build/client/_app/immutable/nodes/20.Ds8FV7bT.js.gz +0 -0
  107. package/build/client/_app/immutable/nodes/{21.9uUpE64z.js → 21.D-_n5D6I.js} +1 -1
  108. package/build/client/_app/immutable/nodes/21.D-_n5D6I.js.br +0 -0
  109. package/build/client/_app/immutable/nodes/21.D-_n5D6I.js.gz +0 -0
  110. package/build/client/_app/immutable/nodes/{22.DcPvaPFW.js → 22.Dvb0-l-Z.js} +1 -1
  111. package/build/client/_app/immutable/nodes/22.Dvb0-l-Z.js.br +0 -0
  112. package/build/client/_app/immutable/nodes/22.Dvb0-l-Z.js.gz +0 -0
  113. package/build/client/_app/immutable/nodes/{23.BRDz0rFN.js → 23.CkYg9r5_.js} +1 -1
  114. package/build/client/_app/immutable/nodes/23.CkYg9r5_.js.br +0 -0
  115. package/build/client/_app/immutable/nodes/23.CkYg9r5_.js.gz +0 -0
  116. package/build/client/_app/immutable/nodes/{24.BStaoFul.js → 24.BhEQq-vG.js} +1 -1
  117. package/build/client/_app/immutable/nodes/24.BhEQq-vG.js.br +0 -0
  118. package/build/client/_app/immutable/nodes/24.BhEQq-vG.js.gz +0 -0
  119. package/build/client/_app/immutable/nodes/{25.BlmlFpt5.js → 25.B8eeSi6k.js} +1 -1
  120. package/build/client/_app/immutable/nodes/25.B8eeSi6k.js.br +0 -0
  121. package/build/client/_app/immutable/nodes/25.B8eeSi6k.js.gz +0 -0
  122. package/build/client/_app/immutable/nodes/{26.C4_nQTcn.js → 26.DOI4ga1U.js} +1 -1
  123. package/build/client/_app/immutable/nodes/26.DOI4ga1U.js.br +0 -0
  124. package/build/client/_app/immutable/nodes/26.DOI4ga1U.js.gz +0 -0
  125. package/build/client/_app/immutable/nodes/{28.CQY0WaJv.js → 28.Be9xcVGE.js} +1 -1
  126. package/build/client/_app/immutable/nodes/28.Be9xcVGE.js.br +0 -0
  127. package/build/client/_app/immutable/nodes/28.Be9xcVGE.js.gz +0 -0
  128. package/build/client/_app/immutable/nodes/{3.DxySQdM7.js → 3.HO48O20f.js} +1 -1
  129. package/build/client/_app/immutable/nodes/3.HO48O20f.js.br +0 -0
  130. package/build/client/_app/immutable/nodes/3.HO48O20f.js.gz +0 -0
  131. package/build/client/_app/immutable/nodes/{4.BjZ-CStr.js → 4.CviaWtQ7.js} +1 -1
  132. package/build/client/_app/immutable/nodes/4.CviaWtQ7.js.br +0 -0
  133. package/build/client/_app/immutable/nodes/4.CviaWtQ7.js.gz +0 -0
  134. package/build/client/_app/immutable/nodes/{6.CDJqtSQa.js → 6.CaGWrOVU.js} +1 -1
  135. package/build/client/_app/immutable/nodes/6.CaGWrOVU.js.br +0 -0
  136. package/build/client/_app/immutable/nodes/6.CaGWrOVU.js.gz +0 -0
  137. package/build/client/_app/immutable/nodes/{7.Cj9o22fB.js → 7.Uonnco-V.js} +1 -1
  138. package/build/client/_app/immutable/nodes/7.Uonnco-V.js.br +0 -0
  139. package/build/client/_app/immutable/nodes/7.Uonnco-V.js.gz +0 -0
  140. package/build/client/_app/immutable/nodes/{8.BN9L31QZ.js → 8.hwuLwhy_.js} +1 -1
  141. package/build/client/_app/immutable/nodes/8.hwuLwhy_.js.br +0 -0
  142. package/build/client/_app/immutable/nodes/8.hwuLwhy_.js.gz +0 -0
  143. package/build/client/_app/immutable/nodes/{9.CidVBUPU.js → 9.BsDB_kf_.js} +1 -1
  144. package/build/client/_app/immutable/nodes/9.BsDB_kf_.js.br +0 -0
  145. package/build/client/_app/immutable/nodes/9.BsDB_kf_.js.gz +0 -0
  146. package/build/client/_app/version.json +1 -1
  147. package/build/client/_app/version.json.br +0 -0
  148. package/build/client/_app/version.json.gz +0 -0
  149. package/build/handler.js +4 -4
  150. package/build/index.js +4 -4
  151. package/build/server/chunks/chunks/{DecisionCard.js-BGiCJsY8.js → DecisionCard.js-DNJjQj6y.js} +23 -2
  152. package/build/server/chunks/chunks/{OpenDecision.js-DXWQXckD.js → OpenDecision.js-evqpdz3O.js} +2 -2
  153. package/build/server/chunks/chunks/{SlotContent.js-CyN_Ifyi.js → SlotContent.js-Dfh5Tmlb.js} +25 -11
  154. package/build/server/chunks/chunks/{decisionform.js-Cy0nUQ8l.js → decisionform.js-Ds5LU9Wh.js} +61 -2
  155. package/build/server/chunks/chunks/{detail.js-4QMxTp3B.js → detail.js-MTO7d0oZ.js} +2 -2
  156. package/build/server/chunks/chunks/{feedback.js-CGKliEXP.js → feedback.js-BcVOtfsi.js} +2 -2
  157. package/build/server/chunks/chunks/{insights.svelte.js-EX826idS.js → insights.svelte.js-BLHg5qc-.js} +4 -4
  158. package/build/server/chunks/chunks/{internal.js-D5XVe7pC.js → internal.js-B3jvxbpC.js} +3 -3
  159. package/build/server/chunks/chunks/{keychain.js-DBjGr5_S.js → keychain.js-fsxzS7dh.js} +2 -2
  160. package/build/server/chunks/chunks/{marketplace-service.js-z40kf_0h.js → marketplace-service.js-DIosJVMH.js} +2 -2
  161. package/build/server/chunks/chunks/{page.js-BXexw6ll.js → page.js-C30cD0Wp.js} +2 -2
  162. package/build/server/chunks/chunks/{previewhelper2.js-CDywcDnG.js → previewhelper2.js-bodEg9Jj.js} +2 -2
  163. package/build/server/chunks/chunks/{repo.js-UPu3kKmt.js → repo.js-He5oSLdW.js} +2 -2
  164. package/build/server/chunks/chunks/{runtime.js-BaL3oaQT.js → runtime.js-CFXY9khN.js} +173 -33
  165. package/build/server/chunks/chunks/{service.js-V5RheQmO.js → service.js-CMaRpVXw.js} +2 -2
  166. package/build/server/chunks/chunks/{service2.js-B4ps0Ctj.js → service2.js-DxTR_5ki.js} +3 -3
  167. package/build/server/chunks/chunks/{starter.js-CToN2q4C.js → starter.js-BEeKej_N.js} +2 -2
  168. package/build/server/chunks/chunks/{vault.js-DZFWbeCU.js → vault.js-kx-rYEM0.js} +5 -2
  169. package/build/server/chunks/chunks/{view.js-BhCZpcmS.js → view.js-BqciV_nu.js} +2 -2
  170. package/build/server/chunks/entries/endpoints/api/apps/_op_/{_server.ts.js-BfVnbEJi.js → _server.ts.js-DYk_zGmD.js} +5 -5
  171. package/build/server/chunks/entries/endpoints/api/cloud/{_server.ts.js-gDIrdF8E.js → _server.ts.js-BZ5xAnps.js} +3 -3
  172. package/build/server/chunks/entries/endpoints/api/cloud/previews/{_server.ts.js-DGoN-Aq8.js → _server.ts.js-B1wMsqtV.js} +5 -5
  173. package/build/server/chunks/entries/endpoints/api/events/{_server.ts.js-BhzdmLvA.js → _server.ts.js-B6yJINJv.js} +5 -5
  174. package/build/server/chunks/entries/endpoints/api/files/{_server.ts.js-CVlgrFXb.js → _server.ts.js-XkHjWwFF.js} +5 -5
  175. package/build/server/chunks/entries/endpoints/api/firstmate/chat/{_server.ts.js-9aoy7ZF7.js → _server.ts.js-CSWXw2oP.js} +5 -5
  176. package/build/server/chunks/entries/endpoints/api/firstmate/commands/{_server.ts.js-CyT2Pbcp.js → _server.ts.js-DjUmuNfh.js} +5 -5
  177. package/build/server/chunks/entries/endpoints/api/firstmate/dismiss/{_server.ts.js-Dnqm4dd6.js → _server.ts.js-fo49iwRo.js} +5 -5
  178. package/build/server/chunks/entries/endpoints/api/firstmate/input/{_server.ts.js-CavwYEx8.js → _server.ts.js-Ugm4xiSu.js} +5 -5
  179. package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/{_server.ts.js-GROjQZEh.js → _server.ts.js-qhSNM_-L.js} +5 -5
  180. package/build/server/chunks/entries/endpoints/api/firstmate/messages/{_server.ts.js-BJip-5FK.js → _server.ts.js-BtpO3tEp.js} +5 -5
  181. package/build/server/chunks/entries/endpoints/api/firstmate/pick/{_server.ts.js-CCBFlYKv.js → _server.ts.js-C-wEt7Gp.js} +5 -5
  182. package/build/server/chunks/entries/endpoints/api/firstmate/reactions/{_server.ts.js-DTIoU2q2.js → _server.ts.js-gJ_-WFJW.js} +5 -5
  183. package/build/server/chunks/entries/endpoints/api/firstmate/start/{_server.ts.js-DPoR4y_N.js → _server.ts.js-5vfw0icS.js} +5 -5
  184. package/build/server/chunks/entries/endpoints/api/fleet/{_server.ts.js-t8tNxBTY.js → _server.ts.js-Dv0n3oCp.js} +5 -5
  185. package/build/server/chunks/entries/endpoints/api/gateway/{_server.ts.js-DMlSei-s.js → _server.ts.js-D1tixfXq.js} +5 -5
  186. package/build/server/chunks/entries/endpoints/api/health/{_server.ts.js-tSLyvPFZ.js → _server.ts.js-oViIkbvM.js} +5 -5
  187. package/build/server/chunks/entries/endpoints/api/inbox/{_server.ts.js-tTZENAI_.js → _server.ts.js-C-QStpbo.js} +5 -5
  188. package/build/server/chunks/entries/endpoints/api/inbox/report/{_server.ts.js-Cx_L25-b.js → _server.ts.js-DhpVdO1p.js} +5 -5
  189. package/build/server/chunks/entries/endpoints/api/insights/{_server.ts.js-CPyIyXoH.js → _server.ts.js-DmdgYa9p.js} +5 -5
  190. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/config/{_server.ts.js-CXo4suaA.js → _server.ts.js-Dz22C5Oc.js} +5 -5
  191. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/{_server.ts.js-D9RmtexN.js → _server.ts.js-DFZimBsr.js} +6 -6
  192. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/summary/{_server.ts.js-d8idtHxV.js → _server.ts.js-xQVDvaLL.js} +7 -7
  193. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/icon/_icon_/{_server.ts.js-BtKPgMMX.js → _server.ts.js-vSP17Umu.js} +5 -5
  194. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/load/{_server.ts.js-DfVFlfmn.js → _server.ts.js-CRbLNZwV.js} +2 -2
  195. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/ui/_...path_/{_server.ts.js-D_5qmDQj.js → _server.ts.js-NnSaW2ui.js} +5 -5
  196. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/update/{_server.ts.js-Be52RhNi.js → _server.ts.js-B_bNv5Rb.js} +2 -2
  197. package/build/server/chunks/entries/endpoints/api/plugins/{_server.ts.js-CmpFGeGG.js → _server.ts.js-xDx3TswX.js} +5 -5
  198. package/build/server/chunks/entries/endpoints/api/plugins/inspect/{_server.ts.js-yLFiI4pP.js → _server.ts.js-DXQjVykz.js} +2 -2
  199. package/build/server/chunks/entries/endpoints/api/plugins/install/{_server.ts.js-CxgKx6i9.js → _server.ts.js-mFTzbdMz.js} +2 -2
  200. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/{_server.ts.js-BU9lEbTp.js → _server.ts.js-CQwT7ZXd.js} +6 -6
  201. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/icon/_name_/{_server.ts.js-C0tLOukZ.js → _server.ts.js-BAO68cNk.js} +6 -6
  202. package/build/server/chunks/entries/endpoints/api/plugins/updates/{_server.ts.js-DPhrDKSA.js → _server.ts.js-CTJ1ub0U.js} +2 -2
  203. package/build/server/chunks/entries/endpoints/api/previews/check/{_server.ts.js-Bh9SYfJF.js → _server.ts.js-WdB3REaP.js} +5 -5
  204. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/{_server.ts.js-CQFR5-Fw.js → _server.ts.js-C9UD4jOU.js} +6 -6
  205. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/{_server.ts.js-B39cZnfl.js → _server.ts.js-Dkij69tw.js} +6 -6
  206. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/{_server.ts.js-DF06LxEL.js → _server.ts.js-CeTvV9nP.js} +6 -6
  207. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/{_server.ts.js-9xLTcS6U.js → _server.ts.js-COx2XJO9.js} +6 -6
  208. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/file/{_server.ts.js-LwwnVgqR.js → _server.ts.js-ftRSLVkK.js} +6 -6
  209. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/{_server.ts.js-DeYHHLdF.js → _server.ts.js-Bsx4lHpp.js} +6 -6
  210. package/build/server/chunks/entries/endpoints/api/second-mates/_id_/peek/{_server.ts.js-9Q5rh-nV.js → _server.ts.js-BppnE5BC.js} +5 -5
  211. package/build/server/chunks/entries/endpoints/api/services/{_server.ts.js-DGOWTcmR.js → _server.ts.js-Gqwhj3Jr.js} +5 -5
  212. package/build/server/chunks/entries/endpoints/api/setup/{_server.ts.js-Dq1qaQm4.js → _server.ts.js-CbPpORog.js} +6 -6
  213. package/build/server/chunks/entries/endpoints/api/slots/{_server.ts.js-IhCd1sEN.js → _server.ts.js-DVip_Q6n.js} +5 -5
  214. package/build/server/chunks/entries/endpoints/api/tasks/_id_/{_server.ts.js-4vgjPOMC.js → _server.ts.js-DnGmNxrE.js} +6 -6
  215. package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/{_server.ts.js-CLBgSJYk.js → _server.ts.js-zPPo2S2T.js} +5 -5
  216. package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/{_server.ts.js-DxYdVc46.js → _server.ts.js-Bx2c6dMt.js} +5 -5
  217. package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/{_server.ts.js-B8TvK9f-.js → _server.ts.js-BarbsV9y.js} +5 -5
  218. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/{_server.ts.js-DsnLgqhv.js → _server.ts.js-D4DgKHLG.js} +5 -5
  219. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/helper/{_server.ts.js-ClpXR-UZ.js → _server.ts.js-I42PMQ4f.js} +6 -6
  220. package/build/server/chunks/entries/endpoints/api/vault/{_server.ts.js-BI3HNCv5.js → _server.ts.js-Cpcb_-3s.js} +6 -9
  221. package/build/server/chunks/entries/endpoints/api/wheelhouse/source/{_server.ts.js-Eu3LE6pk.js → _server.ts.js-Bt82w57y.js} +2 -2
  222. package/build/server/chunks/entries/endpoints/api/wheelhouse/update/{_server.ts.js-AQ1oWw8k.js → _server.ts.js-CBNLk0kR.js} +2 -2
  223. package/build/server/chunks/entries/endpoints/api/wheelhouse/upgrade/{_server.ts.js-CyR-bXgz.js → _server.ts.js-CAy-PnPf.js} +2 -2
  224. package/build/server/chunks/entries/endpoints/tasks/_id_/review/{_server.ts.js-Ct9DiA-K.js → _server.ts.js-DJsxRu_J.js} +5 -5
  225. package/build/server/chunks/entries/{hooks.server.js-B-w5pxTt.js → hooks.server.js-DP6V3oGk.js} +5 -5
  226. package/build/server/chunks/entries/pages/{_layout.server.ts.js-BMt02WMM.js → _layout.server.ts.js-bqdgxqy5.js} +4 -2
  227. package/build/server/chunks/entries/pages/{_page.server.ts.js-DwNm2toz.js → _page.server.ts.js-DmT_6LZz.js} +2 -2
  228. package/build/server/chunks/entries/pages/{_page.svelte.js-BtxV2jdf.js → _page.svelte.js-DFWU8yJc.js} +8 -8
  229. package/build/server/chunks/entries/pages/decisions/{_page.server.ts.js-D-44hsr0.js → _page.server.ts.js-BdI5Bl75.js} +2 -2
  230. package/build/server/chunks/entries/pages/deck/{_page.server.ts.js-BFheQ1G4.js → _page.server.ts.js-ZOYAnM_g.js} +2 -2
  231. package/build/server/chunks/entries/pages/deck/{_page.svelte.js-ByaF4X4f.js → _page.svelte.js-BE2e7Hyi.js} +7 -7
  232. package/build/server/chunks/entries/pages/files/{_page.server.ts.js-BMzddleo.js → _page.server.ts.js-CWf8RxOy.js} +2 -2
  233. package/build/server/chunks/entries/pages/harbour/{_page.server.ts.js-DmjUOiNJ.js → _page.server.ts.js-BTfsZht8.js} +2 -2
  234. package/build/server/chunks/entries/pages/headroom/{_page.server.ts.js-C7rRpkZm.js → _page.server.ts.js-o_cuSwWH.js} +2 -2
  235. package/build/server/chunks/entries/pages/inbox/{_page.server.ts.js-n2HUhlCl.js → _page.server.ts.js-DPqNxi58.js} +2 -2
  236. package/build/server/chunks/entries/pages/inbox/{_page.svelte.js-NEaMeQr4.js → _page.svelte.js-BddxZY9X.js} +3 -3
  237. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/{_page.server.ts.js-DDLSBK6u.js → _page.server.ts.js-NvhMRXin.js} +2 -2
  238. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/{_page.svelte.js-IxIvs80b.js → _page.svelte.js-BYHP64gx.js} +3 -3
  239. package/build/server/chunks/entries/pages/projects/_id_/{_page.server.ts.js-DXWoDip6.js → _page.server.ts.js-ZNFvlLOS.js} +3 -3
  240. package/build/server/chunks/entries/pages/projects/_id_/{_page.svelte.js-CZuOnAvk.js → _page.svelte.js-B9P8UZOd.js} +3 -3
  241. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/{_page.server.ts.js-nPHleLS6.js → _page.server.ts.js-CIFxbd8n.js} +3 -3
  242. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/{_page.svelte.js-BiaWDy5c.js → _page.svelte.js-CcwDpwg7.js} +3 -3
  243. package/build/server/chunks/entries/pages/projects/_id_/passage/{_page.server.ts.js-BbPQRuLV.js → _page.server.ts.js-CxzZpBL2.js} +4 -4
  244. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/{_page.server.ts.js-Dxn5UA86.js → _page.server.ts.js-BIwdjBgl.js} +2 -2
  245. package/build/server/chunks/entries/pages/remotes/{_page.server.ts.js-Bs11MPTR.js → _page.server.ts.js-C8KVdW_q.js} +2 -2
  246. package/build/server/chunks/entries/pages/settings/cloud/{_page.server.ts.js-C_FYYuua.js → _page.server.ts.js-Bdohjqlm.js} +2 -2
  247. package/build/server/chunks/entries/pages/settings/gateway/{_page.server.ts.js-BW2cUJKc.js → _page.server.ts.js-Et20xA2U.js} +2 -2
  248. package/build/server/chunks/entries/pages/settings/plugins/{_page.server.ts.js-D2t07ExQ.js → _page.server.ts.js-B8chH9Vi.js} +2 -2
  249. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/{_page.server.ts.js-DLp30Ukw.js → _page.server.ts.js-DzzCMiD4.js} +2 -2
  250. package/build/server/chunks/entries/pages/settings/setup/{_page.server.ts.js-BmL2mnpV.js → _page.server.ts.js-BfdXFrRT.js} +2 -2
  251. package/build/server/chunks/entries/pages/settings/update/{_page.server.ts.js-DYuR0iKH.js → _page.server.ts.js-DVlBLn5S.js} +2 -2
  252. package/build/server/chunks/entries/pages/setup/{_page.server.ts.js-DL17BAP4.js → _page.server.ts.js-D6jIgQJ4.js} +3 -3
  253. package/build/server/chunks/entries/pages/tasks/_id_/{_page.server.ts.js-DnxuSVns.js → _page.server.ts.js-Ux_kUFGa.js} +3 -3
  254. package/build/server/chunks/entries/pages/tasks/_id_/{_page.svelte.js-DJJ0XJa2.js → _page.svelte.js-016yK-eG.js} +6 -6
  255. package/build/server/chunks/entries/pages/tasks/_id_/doc/{_page.server.ts.js-7MjU8ocn.js → _page.server.ts.js-2jI6Wnm5.js} +2 -2
  256. package/build/server/chunks/entries/pages/time/{_page.server.ts.js-CkdUjMfH.js → _page.server.ts.js-Gz8g7Lxm.js} +2 -2
  257. package/build/server/chunks/{handler-Dvpbthxv.js → handler-BBfqHGlL.js} +3 -3
  258. package/build/server/chunks/{index.js-Xrzvi4-9.js → index.js-otQ83TL7.js} +2 -2
  259. package/build/server/chunks/{manifest.js-CFBVUirS.js → manifest.js-CwfU9jR_.js} +85 -85
  260. package/build/server/chunks/nodes/{0.js-xs6nMfls.js → 0.js-DY-FCb4h.js} +7 -7
  261. package/build/server/chunks/nodes/{1.js-D44sE2Qh.js → 1.js-C1gj4J7r.js} +2 -2
  262. package/build/server/chunks/nodes/{10.js-DKDSJpCU.js → 10.js-D8sF_M7G.js} +2 -2
  263. package/build/server/chunks/nodes/{11.js-BPuus2gN.js → 11.js-DGbnw6E-.js} +8 -8
  264. package/build/server/chunks/nodes/{12.js-3aQPHNvX.js → 12.js-yixeL-nb.js} +9 -9
  265. package/build/server/chunks/nodes/{13.js-gL8EHuM-.js → 13.js-CgHVwdU1.js} +9 -9
  266. package/build/server/chunks/nodes/{14.js-BYQRhe5N.js → 14.js-IMBVJfKF.js} +9 -9
  267. package/build/server/chunks/nodes/{15.js-Dqwr_Gqz.js → 15.js-Bn-Gtc7-.js} +8 -8
  268. package/build/server/chunks/nodes/{16.js-D3I5Ls7F.js → 16.js-CaZFpcDh.js} +6 -6
  269. package/build/server/chunks/nodes/{17.js-DzfLONnh.js → 17.js-BR4Pwbjy.js} +2 -2
  270. package/build/server/chunks/nodes/{19.js-Fwi2_4BB.js → 19.js-DTnGR4UX.js} +6 -6
  271. package/build/server/chunks/nodes/{2.js-oxG8p7dM.js → 2.js-DuZD1_ae.js} +8 -8
  272. package/build/server/chunks/nodes/{20.js-wR9uHTLT.js → 20.js-c7-2nU-p.js} +7 -7
  273. package/build/server/chunks/nodes/{21.js-C0wKxVsy.js → 21.js-Yv1PzkRI.js} +7 -7
  274. package/build/server/chunks/nodes/{22.js-BK5wsznE.js → 22.js-B_RyHclK.js} +7 -7
  275. package/build/server/chunks/nodes/{23.js-DIBFab3_.js → 23.js-BlDPhnR6.js} +8 -8
  276. package/build/server/chunks/nodes/{24.js-CJkXQqMe.js → 24.js-D7qarZq6.js} +4 -4
  277. package/build/server/chunks/nodes/{25.js-DjfBbASo.js → 25.js-BIbn9KYt.js} +8 -8
  278. package/build/server/chunks/nodes/{26.js-DohrkkWV.js → 26.js-D0_dD3EO.js} +9 -9
  279. package/build/server/chunks/nodes/{27.js-Y78p8Mkp.js → 27.js-B0p1due2.js} +7 -7
  280. package/build/server/chunks/nodes/{28.js-B9PS_kQT.js → 28.js-CRdgyvv_.js} +7 -7
  281. package/build/server/chunks/nodes/{3.js-C0Y4_J3H.js → 3.js-DKrxSrj9.js} +7 -7
  282. package/build/server/chunks/nodes/{4.js-g7Rvo_y_.js → 4.js-BRXw-v-L.js} +8 -8
  283. package/build/server/chunks/nodes/{5.js-BI6tJn-5.js → 5.js-C3ug9NBN.js} +6 -6
  284. package/build/server/chunks/nodes/{6.js-C91r2w4N.js → 6.js-BuWS4Z2-.js} +7 -7
  285. package/build/server/chunks/nodes/{7.js-DvHVz249.js → 7.js-BaxSjbK8.js} +7 -7
  286. package/build/server/chunks/nodes/{8.js-DkNCnJN3.js → 8.js-Cqzz53er.js} +8 -8
  287. package/build/server/chunks/nodes/{9.js-CtTaAH6h.js → 9.js-BGvUqMX3.js} +2 -2
  288. package/dist/cli.js +48 -1
  289. package/dist/wh-vault.js +573 -205
  290. package/package.json +1 -1
  291. package/plugins/vault/.wheelhouse-plugin/plugin.json +1 -1
  292. package/build/client/_app/immutable/chunks/10ROkIhN.js.br +0 -0
  293. package/build/client/_app/immutable/chunks/10ROkIhN.js.gz +0 -0
  294. package/build/client/_app/immutable/chunks/3bC4bjBI.js.br +0 -0
  295. package/build/client/_app/immutable/chunks/3bC4bjBI.js.gz +0 -0
  296. package/build/client/_app/immutable/chunks/BibAhIE3.js.br +0 -0
  297. package/build/client/_app/immutable/chunks/BibAhIE3.js.gz +0 -0
  298. package/build/client/_app/immutable/chunks/BlJ-AbFb.js.br +0 -0
  299. package/build/client/_app/immutable/chunks/BlJ-AbFb.js.gz +0 -0
  300. package/build/client/_app/immutable/chunks/Bm0kgZn-.js +0 -3
  301. package/build/client/_app/immutable/chunks/Bm0kgZn-.js.br +0 -0
  302. package/build/client/_app/immutable/chunks/Bm0kgZn-.js.gz +0 -0
  303. package/build/client/_app/immutable/chunks/BrrBgLVG.js.br +0 -0
  304. package/build/client/_app/immutable/chunks/BrrBgLVG.js.gz +0 -0
  305. package/build/client/_app/immutable/chunks/C9ed1vbc.js.br +0 -0
  306. package/build/client/_app/immutable/chunks/C9ed1vbc.js.gz +0 -0
  307. package/build/client/_app/immutable/chunks/CEhBf-yV.js.br +0 -0
  308. package/build/client/_app/immutable/chunks/CEhBf-yV.js.gz +0 -0
  309. package/build/client/_app/immutable/chunks/CNKI0WqS.js.br +0 -0
  310. package/build/client/_app/immutable/chunks/CNKI0WqS.js.gz +0 -0
  311. package/build/client/_app/immutable/chunks/CR4i-JqL.js.br +0 -0
  312. package/build/client/_app/immutable/chunks/CR4i-JqL.js.gz +0 -0
  313. package/build/client/_app/immutable/chunks/CRK1Q1tO.js.br +0 -0
  314. package/build/client/_app/immutable/chunks/CRK1Q1tO.js.gz +0 -0
  315. package/build/client/_app/immutable/chunks/CgxyeCeP.js.br +0 -0
  316. package/build/client/_app/immutable/chunks/CgxyeCeP.js.gz +0 -0
  317. package/build/client/_app/immutable/chunks/CzbTCvH8.js.br +0 -0
  318. package/build/client/_app/immutable/chunks/CzbTCvH8.js.gz +0 -0
  319. package/build/client/_app/immutable/chunks/D9coJX5q.js.br +0 -0
  320. package/build/client/_app/immutable/chunks/D9coJX5q.js.gz +0 -0
  321. package/build/client/_app/immutable/chunks/DHss7SEY.js.br +0 -0
  322. package/build/client/_app/immutable/chunks/DMDL4MuU.js.br +0 -0
  323. package/build/client/_app/immutable/chunks/DMDL4MuU.js.gz +0 -0
  324. package/build/client/_app/immutable/chunks/Dk0_dSfe.js.br +0 -0
  325. package/build/client/_app/immutable/chunks/Dk0_dSfe.js.gz +0 -0
  326. package/build/client/_app/immutable/chunks/DrciKyih.js +0 -5
  327. package/build/client/_app/immutable/chunks/DrciKyih.js.br +0 -0
  328. package/build/client/_app/immutable/chunks/DrciKyih.js.gz +0 -0
  329. package/build/client/_app/immutable/chunks/Ns_iZj-K.js.br +0 -0
  330. package/build/client/_app/immutable/chunks/Ns_iZj-K.js.gz +0 -0
  331. package/build/client/_app/immutable/chunks/Om8BmhPE.js.br +0 -0
  332. package/build/client/_app/immutable/chunks/Om8BmhPE.js.gz +0 -0
  333. package/build/client/_app/immutable/entry/app.5tTdQ_02.js.br +0 -0
  334. package/build/client/_app/immutable/entry/app.5tTdQ_02.js.gz +0 -0
  335. package/build/client/_app/immutable/entry/start.C62i1LAH.js +0 -1
  336. package/build/client/_app/immutable/entry/start.C62i1LAH.js.br +0 -0
  337. package/build/client/_app/immutable/entry/start.C62i1LAH.js.gz +0 -0
  338. package/build/client/_app/immutable/nodes/0.nyx2R9Qf.js.br +0 -0
  339. package/build/client/_app/immutable/nodes/0.nyx2R9Qf.js.gz +0 -0
  340. package/build/client/_app/immutable/nodes/1.BkR_IPYS.js.br +0 -0
  341. package/build/client/_app/immutable/nodes/1.BkR_IPYS.js.gz +0 -0
  342. package/build/client/_app/immutable/nodes/10.BS87tv1l.js.br +0 -0
  343. package/build/client/_app/immutable/nodes/10.BS87tv1l.js.gz +0 -0
  344. package/build/client/_app/immutable/nodes/11.DddxDkJ4.js.br +0 -0
  345. package/build/client/_app/immutable/nodes/11.DddxDkJ4.js.gz +0 -0
  346. package/build/client/_app/immutable/nodes/12.C9qwM8Di.js.br +0 -0
  347. package/build/client/_app/immutable/nodes/12.C9qwM8Di.js.gz +0 -0
  348. package/build/client/_app/immutable/nodes/13.CAV9o7bd.js.br +0 -0
  349. package/build/client/_app/immutable/nodes/13.CAV9o7bd.js.gz +0 -0
  350. package/build/client/_app/immutable/nodes/14.B_Err-YM.js.br +0 -0
  351. package/build/client/_app/immutable/nodes/14.B_Err-YM.js.gz +0 -0
  352. package/build/client/_app/immutable/nodes/15.1PcFIFZ6.js.br +0 -0
  353. package/build/client/_app/immutable/nodes/15.1PcFIFZ6.js.gz +0 -0
  354. package/build/client/_app/immutable/nodes/16.CgtK_xkO.js.br +0 -0
  355. package/build/client/_app/immutable/nodes/16.CgtK_xkO.js.gz +0 -0
  356. package/build/client/_app/immutable/nodes/17.BQxfvX3S.js.br +0 -0
  357. package/build/client/_app/immutable/nodes/17.BQxfvX3S.js.gz +0 -0
  358. package/build/client/_app/immutable/nodes/19.Dxd8I8Tp.js.br +0 -0
  359. package/build/client/_app/immutable/nodes/19.Dxd8I8Tp.js.gz +0 -0
  360. package/build/client/_app/immutable/nodes/2.D4QEyk_4.js +0 -25
  361. package/build/client/_app/immutable/nodes/2.D4QEyk_4.js.br +0 -0
  362. package/build/client/_app/immutable/nodes/2.D4QEyk_4.js.gz +0 -0
  363. package/build/client/_app/immutable/nodes/20.DYaAa9CP.js.br +0 -0
  364. package/build/client/_app/immutable/nodes/20.DYaAa9CP.js.gz +0 -0
  365. package/build/client/_app/immutable/nodes/21.9uUpE64z.js.br +0 -0
  366. package/build/client/_app/immutable/nodes/21.9uUpE64z.js.gz +0 -0
  367. package/build/client/_app/immutable/nodes/22.DcPvaPFW.js.br +0 -0
  368. package/build/client/_app/immutable/nodes/22.DcPvaPFW.js.gz +0 -0
  369. package/build/client/_app/immutable/nodes/23.BRDz0rFN.js.br +0 -0
  370. package/build/client/_app/immutable/nodes/23.BRDz0rFN.js.gz +0 -0
  371. package/build/client/_app/immutable/nodes/24.BStaoFul.js.br +0 -0
  372. package/build/client/_app/immutable/nodes/24.BStaoFul.js.gz +0 -0
  373. package/build/client/_app/immutable/nodes/25.BlmlFpt5.js.br +0 -0
  374. package/build/client/_app/immutable/nodes/25.BlmlFpt5.js.gz +0 -0
  375. package/build/client/_app/immutable/nodes/26.C4_nQTcn.js.br +0 -0
  376. package/build/client/_app/immutable/nodes/26.C4_nQTcn.js.gz +0 -0
  377. package/build/client/_app/immutable/nodes/28.CQY0WaJv.js.br +0 -0
  378. package/build/client/_app/immutable/nodes/28.CQY0WaJv.js.gz +0 -0
  379. package/build/client/_app/immutable/nodes/3.DxySQdM7.js.br +0 -0
  380. package/build/client/_app/immutable/nodes/3.DxySQdM7.js.gz +0 -0
  381. package/build/client/_app/immutable/nodes/4.BjZ-CStr.js.br +0 -0
  382. package/build/client/_app/immutable/nodes/4.BjZ-CStr.js.gz +0 -0
  383. package/build/client/_app/immutable/nodes/6.CDJqtSQa.js.br +0 -0
  384. package/build/client/_app/immutable/nodes/6.CDJqtSQa.js.gz +0 -0
  385. package/build/client/_app/immutable/nodes/7.Cj9o22fB.js.br +0 -0
  386. package/build/client/_app/immutable/nodes/7.Cj9o22fB.js.gz +0 -0
  387. package/build/client/_app/immutable/nodes/8.BN9L31QZ.js.br +0 -0
  388. package/build/client/_app/immutable/nodes/8.BN9L31QZ.js.gz +0 -0
  389. package/build/client/_app/immutable/nodes/9.CidVBUPU.js.br +0 -0
  390. package/build/client/_app/immutable/nodes/9.CidVBUPU.js.gz +0 -0
package/dist/wh-vault.js CHANGED
@@ -1,21 +1,30 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // cli/vault/keychain.ts
4
- import { spawn } from "node:child_process";
3
+ // cli/vault/program.ts
4
+ import { readFile as readFile5, stat } from "node:fs/promises";
5
+ import path7 from "node:path";
6
+ import { Command, InvalidArgumentError } from "commander";
5
7
 
6
- // cli/vault/backend.ts
7
- var BackendError = class extends Error {
8
- constructor(kind, message) {
9
- super(message);
10
- this.kind = kind;
11
- this.name = "BackendError";
12
- }
13
- kind;
14
- };
8
+ // package.json
9
+ var version = "0.9.0";
10
+
11
+ // src/lib/server/plugins/config.ts
12
+ import { homedir } from "node:os";
13
+ import path from "node:path";
14
+ function defaultConfigDir(env) {
15
+ if (env.WHEELHOUSE_CONFIG_DIR) return path.resolve(env.WHEELHOUSE_CONFIG_DIR);
16
+ if (env.XDG_CONFIG_HOME) return path.join(env.XDG_CONFIG_HOME, "wheelhouse");
17
+ return path.join(homedir(), ".config", "wheelhouse");
18
+ }
19
+ var editing = Promise.resolve();
20
+
21
+ // cli/vault/audit.ts
22
+ import { appendFile, chmod as chmod2, open, readFile as readFile2 } from "node:fs/promises";
23
+ import path3 from "node:path";
15
24
 
16
25
  // cli/vault/store.ts
17
26
  import { chmod, mkdir, readFile, rename, writeFile } from "node:fs/promises";
18
- import path from "node:path";
27
+ import path2 from "node:path";
19
28
 
20
29
  // src/lib/vault.ts
21
30
  var SECRET_NAME = /^[A-Za-z_][A-Za-z0-9_]{0,127}$/;
@@ -25,7 +34,7 @@ var PROJECT_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
25
34
  var VAULT_FILE = "vault.json";
26
35
  var SCHEMA = "wh-vault.v1";
27
36
  function vaultDir(configDir) {
28
- return path.join(configDir, "vault");
37
+ return path2.join(configDir, "vault");
29
38
  }
30
39
  function emptyVault(backend) {
31
40
  return { schema: SCHEMA, backend, secrets: {} };
@@ -56,7 +65,7 @@ function parseVault(text) {
56
65
  return { schema: SCHEMA, backend: v.backend, secrets };
57
66
  }
58
67
  async function readVault(dir) {
59
- const file = path.join(dir, VAULT_FILE);
68
+ const file = path2.join(dir, VAULT_FILE);
60
69
  let text;
61
70
  try {
62
71
  text = await readFile(file, "utf8");
@@ -76,7 +85,7 @@ async function ensureDir(dir) {
76
85
  }
77
86
  async function writeVault(dir, vault) {
78
87
  await ensureDir(dir);
79
- const file = path.join(dir, VAULT_FILE);
88
+ const file = path2.join(dir, VAULT_FILE);
80
89
  const tmp = `${file}.${process.pid}.tmp`;
81
90
  await writeFile(tmp, `${JSON.stringify(vault, null, " ")}
82
91
  `, { mode: 384 });
@@ -87,160 +96,7 @@ function grantedTo(vault, project) {
87
96
  return Object.entries(vault.secrets).filter(([, s]) => s.projects.includes(project)).map(([name]) => name).sort();
88
97
  }
89
98
 
90
- // cli/vault/keychain.ts
91
- var KEYCHAIN_SERVICE = "wheelhouse-vault";
92
- var SECURITY = "/usr/bin/security";
93
- var MAX_LINE_BYTES = 4e3;
94
- var TIMEOUT_MS = 12e4;
95
- var ENCODED = "wh-vault:base64:";
96
- var EXIT_NOT_FOUND = 44;
97
- var EXIT_INTERACTION_NOT_ALLOWED = 36;
98
- function securityRunner(file = SECURITY, timeoutMs = TIMEOUT_MS) {
99
- return (args, input) => new Promise((resolve) => {
100
- const child = spawn(file, args, {
101
- stdio: [input === void 0 ? "ignore" : "pipe", "pipe", "pipe"]
102
- });
103
- const out = [];
104
- const err = [];
105
- let timedOut = false;
106
- const timer = setTimeout(() => {
107
- timedOut = true;
108
- child.kill("SIGKILL");
109
- }, timeoutMs);
110
- child.stdout?.on("data", (c) => out.push(c));
111
- child.stderr?.on("data", (c) => err.push(c));
112
- child.on("error", (e) => {
113
- clearTimeout(timer);
114
- resolve({ code: null, stdout: "", stderr: "", spawnError: e.message });
115
- });
116
- child.on("close", (code) => {
117
- clearTimeout(timer);
118
- resolve({
119
- code,
120
- stdout: Buffer.concat(out).toString("utf8"),
121
- stderr: Buffer.concat(err).toString("utf8"),
122
- timedOut
123
- });
124
- });
125
- if (input !== void 0 && child.stdin) {
126
- child.stdin.on("error", () => {
127
- });
128
- child.stdin.end(input);
129
- }
130
- });
131
- }
132
- function encodeValue(value) {
133
- return /^[\x20-\x7e]*$/.test(value) && !value.startsWith(ENCODED) ? value : ENCODED + Buffer.from(value, "utf8").toString("base64");
134
- }
135
- function decodeValue(stored) {
136
- return stored.startsWith(ENCODED) ? Buffer.from(stored.slice(ENCODED.length), "base64").toString("utf8") : stored;
137
- }
138
- var KeychainBackend = class {
139
- constructor(security = securityRunner()) {
140
- this.security = security;
141
- }
142
- security;
143
- id = "keychain";
144
- where = "the macOS login Keychain";
145
- async get(name) {
146
- this.check(name);
147
- const r = await this.security([
148
- "find-generic-password",
149
- "-s",
150
- KEYCHAIN_SERVICE,
151
- "-a",
152
- name,
153
- "-w"
154
- ]);
155
- if (r.code !== 0) throw this.failure(r, name, "read");
156
- return decodeValue(r.stdout.endsWith("\n") ? r.stdout.slice(0, -1) : r.stdout);
157
- }
158
- async set(name, value) {
159
- this.check(name);
160
- const hex = Buffer.from(encodeValue(value), "utf8").toString("hex");
161
- const line = `add-generic-password -U -s ${KEYCHAIN_SERVICE} -a ${name} -l "${KEYCHAIN_SERVICE} ${name}" -X ${hex}
162
- `;
163
- if (Buffer.byteLength(line) > MAX_LINE_BYTES) {
164
- const room = Math.floor(
165
- (MAX_LINE_BYTES - (Buffer.byteLength(line) - hex.length)) / 2 - ENCODED.length
166
- );
167
- throw new BackendError(
168
- "too-large",
169
- `the value is too long for the Keychain through the security tool (at most about ${Math.max(room, 0)} bytes)`
170
- );
171
- }
172
- const r = await this.security(["-i"], line);
173
- if (r.code !== 0)
174
- throw this.failure({ ...r, stdout: "", stderr: redact(r.stderr, hex) }, name, "store");
175
- }
176
- async remove(name) {
177
- this.check(name);
178
- const r = await this.security(["delete-generic-password", "-s", KEYCHAIN_SERVICE, "-a", name]);
179
- if (r.code === 0) return;
180
- const e = this.failure(r, name, "delete");
181
- if (e.kind !== "not-found") throw e;
182
- }
183
- /** A secret name is safe to write unquoted into a `security -i` line. */
184
- check(name) {
185
- if (!SECRET_NAME.test(name))
186
- throw new BackendError("failed", `${JSON.stringify(name)} is not a secret name`);
187
- }
188
- failure(r, name, verb) {
189
- if (r.spawnError !== void 0) {
190
- return new BackendError(
191
- "unavailable",
192
- `could not run ${SECURITY} (${r.spawnError}); the Keychain backend works on macOS only`
193
- );
194
- }
195
- if (r.timedOut) {
196
- return new BackendError(
197
- "failed",
198
- `the Keychain did not answer within ${TIMEOUT_MS / 1e3} s; a Keychain dialog may be waiting on the Mac's screen`
199
- );
200
- }
201
- if (r.code === EXIT_INTERACTION_NOT_ALLOWED || /interaction is not allowed/i.test(r.stderr)) {
202
- return new BackendError(
203
- "interaction-not-allowed",
204
- `the Keychain would not answer here ("User interaction is not allowed"): this terminal runs outside the Mac's login session, so the Keychain cannot ask to be unlocked or to allow access`
205
- );
206
- }
207
- if (r.code === EXIT_NOT_FOUND || /could not be found/i.test(r.stderr)) {
208
- return new BackendError("not-found", `the Keychain has no value for ${name}`);
209
- }
210
- const said = r.stderr.trim().split("\n")[0]?.replace(/^security:\s*/, "") ?? "";
211
- return new BackendError(
212
- "failed",
213
- `the Keychain could not ${verb} ${name} (security exited ${r.code ?? "abnormally"}${said ? `: ${said}` : ""})`
214
- );
215
- }
216
- };
217
- function redact(text, hex) {
218
- let out = text.split(hex).join("[value]");
219
- out = out.replace(/[0-9a-fA-F]{16,}/g, "[value]");
220
- return out;
221
- }
222
-
223
- // cli/vault/program.ts
224
- import { readFile as readFile4, stat } from "node:fs/promises";
225
- import path6 from "node:path";
226
- import { Command, InvalidArgumentError } from "commander";
227
-
228
- // package.json
229
- var version = "0.7.0";
230
-
231
- // src/lib/server/plugins/config.ts
232
- import { homedir } from "node:os";
233
- import path2 from "node:path";
234
- function defaultConfigDir(env) {
235
- if (env.WHEELHOUSE_CONFIG_DIR) return path2.resolve(env.WHEELHOUSE_CONFIG_DIR);
236
- if (env.XDG_CONFIG_HOME) return path2.join(env.XDG_CONFIG_HOME, "wheelhouse");
237
- return path2.join(homedir(), ".config", "wheelhouse");
238
- }
239
- var editing = Promise.resolve();
240
-
241
99
  // cli/vault/audit.ts
242
- import { appendFile, chmod as chmod2, open, readFile as readFile2 } from "node:fs/promises";
243
- import path3 from "node:path";
244
100
  var AUDIT_FILE = "audit.jsonl";
245
101
  async function appendAudit(dir, entry) {
246
102
  await ensureDir(dir);
@@ -297,6 +153,16 @@ async function lastUsed(dir) {
297
153
  return used;
298
154
  }
299
155
 
156
+ // cli/vault/backend.ts
157
+ var BackendError = class extends Error {
158
+ constructor(kind, message) {
159
+ super(message);
160
+ this.kind = kind;
161
+ this.name = "BackendError";
162
+ }
163
+ kind;
164
+ };
165
+
300
166
  // cli/vault/caller.ts
301
167
  import { execFile } from "node:child_process";
302
168
  import { readFile as readFile3 } from "node:fs/promises";
@@ -404,7 +270,7 @@ function parseValue(raw) {
404
270
  var isTail = (rest) => !rest.trim() || rest.trim().startsWith("#");
405
271
 
406
272
  // cli/vault/run.ts
407
- import { spawn as spawn2 } from "node:child_process";
273
+ import { spawn } from "node:child_process";
408
274
  import { constants } from "node:os";
409
275
  import path5 from "node:path";
410
276
 
@@ -467,8 +333,8 @@ var Masker = class {
467
333
  // cli/vault/run.ts
468
334
  var EXIT_REFUSED = 125;
469
335
  var EXIT_CANNOT_RUN = 126;
470
- var EXIT_NOT_FOUND2 = 127;
471
- async function runWithSecrets(command, only, deps) {
336
+ var EXIT_NOT_FOUND = 127;
337
+ async function runWithSecrets(command, only2, deps) {
472
338
  const now = deps.now ?? (() => /* @__PURE__ */ new Date());
473
339
  const say = (line) => deps.stderr.write(`wh-vault: ${line}
474
340
  `);
@@ -500,21 +366,21 @@ async function runWithSecrets(command, only, deps) {
500
366
  };
501
367
  if (!project) {
502
368
  return refuse(
503
- only ?? [],
369
+ only2 ?? [],
504
370
  "could not tell which project this is: there is no Firstmate task record (FM_TASK_ID) and no origin remote here"
505
371
  );
506
372
  }
507
373
  const granted = grantedTo(vault, project);
508
374
  let names2;
509
- if (only?.length) {
510
- const missing = only.filter((n) => !granted.includes(n));
375
+ if (only2?.length) {
376
+ const missing = only2.filter((n) => !granted.includes(n));
511
377
  if (missing.length) {
512
378
  return refuse(
513
- only,
379
+ only2,
514
380
  `${missing.join(", ")} ${missing.length === 1 ? "is" : "are"} not granted to ${project}; the captain grants one with \`wh-vault grant NAME ${project}\``
515
381
  );
516
382
  }
517
- names2 = [...new Set(only)];
383
+ names2 = [...new Set(only2)];
518
384
  } else {
519
385
  if (!granted.length) {
520
386
  return refuse(
@@ -562,7 +428,7 @@ async function runWithSecrets(command, only, deps) {
562
428
  }
563
429
  function spawnMasked(command, values, deps) {
564
430
  return new Promise((resolve) => {
565
- const child = spawn2(command[0], command.slice(1), {
431
+ const child = spawn(command[0], command.slice(1), {
566
432
  cwd: deps.cwd,
567
433
  env: { ...deps.env, ...values },
568
434
  stdio: ["inherit", "pipe", "pipe"]
@@ -589,7 +455,7 @@ function spawnMasked(command, values, deps) {
589
455
  child.on(
590
456
  "error",
591
457
  (e) => done(
592
- e.code === "ENOENT" ? { error: `${command[0]}: command not found.`, code: EXIT_NOT_FOUND2 } : { error: `${command[0]}: ${e.message}.`, code: EXIT_CANNOT_RUN }
458
+ e.code === "ENOENT" ? { error: `${command[0]}: command not found.`, code: EXIT_NOT_FOUND } : { error: `${command[0]}: ${e.message}.`, code: EXIT_CANNOT_RUN }
593
459
  )
594
460
  );
595
461
  child.on("close", (code, signal) => {
@@ -601,6 +467,437 @@ function spawnMasked(command, values, deps) {
601
467
  });
602
468
  }
603
469
 
470
+ // cli/vault/env-file.ts
471
+ import { randomBytes } from "node:crypto";
472
+ import { constants as constants2 } from "node:fs";
473
+ import { chmod as chmod3, lstat, open as open2, readFile as readFile4, rename as rename2, rm } from "node:fs/promises";
474
+ import path6 from "node:path";
475
+ var ENV_FILE = "values.env";
476
+ var EnvFileBackend = class {
477
+ /** `dir` is the vault folder (store.ts vaultDir). */
478
+ constructor(dir) {
479
+ this.dir = dir;
480
+ this.file = path6.join(dir, ENV_FILE);
481
+ this.where = `the plaintext env file ${this.file}`;
482
+ }
483
+ dir;
484
+ id = "env-file";
485
+ where;
486
+ short = "the env file";
487
+ file;
488
+ async get(name) {
489
+ this.checkName(name);
490
+ const v = (await this.read()).get(name);
491
+ if (v === void 0)
492
+ throw new BackendError("not-found", `the env file has no value for ${name}`);
493
+ return v;
494
+ }
495
+ async set(name, value) {
496
+ this.checkName(name);
497
+ const values = await this.read();
498
+ values.set(name, value);
499
+ await this.write(values);
500
+ }
501
+ async remove(name) {
502
+ this.checkName(name);
503
+ const values = await this.read();
504
+ if (!values.delete(name)) return;
505
+ await this.write(values);
506
+ }
507
+ async storeProblem() {
508
+ try {
509
+ await this.read();
510
+ return null;
511
+ } catch (e) {
512
+ return e instanceof Error ? e.message : String(e);
513
+ }
514
+ }
515
+ /** Every value in the file; none when there is no file yet. */
516
+ async read() {
517
+ let st;
518
+ try {
519
+ st = await lstat(this.file);
520
+ } catch (e) {
521
+ if (e.code === "ENOENT") return /* @__PURE__ */ new Map();
522
+ throw this.unavailable(`cannot read ${this.file}: ${e.message}`);
523
+ }
524
+ if (!st.isFile()) throw this.unavailable(`${this.file} is not a plain file; it is not used`);
525
+ if (typeof process.getuid === "function" && st.uid !== process.getuid()) {
526
+ throw this.unavailable(`${this.file} belongs to another user; it is not used`);
527
+ }
528
+ if (st.mode & 63) {
529
+ throw this.unavailable(
530
+ `${this.file} can be read by other users (mode ${(st.mode & 511).toString(8)}); it is not used until only you can read it: chmod 600 ${this.file}`
531
+ );
532
+ }
533
+ let text;
534
+ try {
535
+ text = await readFile4(this.file, "utf8");
536
+ } catch (e) {
537
+ throw this.unavailable(`cannot read ${this.file}: ${e.message}`);
538
+ }
539
+ const parsed = parseDotenv(text);
540
+ if (parsed.skipped.length) {
541
+ throw new BackendError(
542
+ "failed",
543
+ `${this.file} has line${parsed.skipped.length === 1 ? "" : "s"} ${parsed.skipped.join(", ")} that wh-vault cannot read`
544
+ );
545
+ }
546
+ return new Map(parsed.entries.map((e) => [e.name, e.value]));
547
+ }
548
+ /** The whole file, through a new 0600 file that replaces it. */
549
+ async write(values) {
550
+ await ensureDir(this.dir);
551
+ const text = [...values].sort(([a], [b]) => a.localeCompare(b)).map(([name, value]) => `${name}="${quote(value)}"
552
+ `).join("");
553
+ const tmp = `${this.file}.${process.pid}.${randomBytes(6).toString("hex")}.tmp`;
554
+ const fh = await open2(
555
+ tmp,
556
+ constants2.O_WRONLY | constants2.O_CREAT | constants2.O_EXCL | constants2.O_NOFOLLOW,
557
+ 384
558
+ );
559
+ try {
560
+ await fh.writeFile(text, "utf8");
561
+ await fh.sync();
562
+ } catch (e) {
563
+ await fh.close();
564
+ await rm(tmp, { force: true });
565
+ throw e;
566
+ }
567
+ await fh.close();
568
+ await chmod3(tmp, 384);
569
+ await rename2(tmp, this.file);
570
+ }
571
+ checkName(name) {
572
+ if (!SECRET_NAME.test(name))
573
+ throw new BackendError("failed", `${JSON.stringify(name)} is not a secret name`);
574
+ }
575
+ unavailable(message) {
576
+ return new BackendError("unavailable", message);
577
+ }
578
+ };
579
+ function quote(value) {
580
+ return value.replace(
581
+ /[\\"\n\r\t]/g,
582
+ (c) => c === "\n" ? "\\n" : c === "\r" ? "\\r" : c === " " ? "\\t" : `\\${c}`
583
+ );
584
+ }
585
+
586
+ // cli/vault/keychain.ts
587
+ import { existsSync } from "node:fs";
588
+
589
+ // cli/vault/tool.ts
590
+ import { spawn as spawn2 } from "node:child_process";
591
+ function toolRunner(file, timeoutMs) {
592
+ return (args, input) => new Promise((resolve) => {
593
+ const child = spawn2(file, args, {
594
+ stdio: [input === void 0 ? "ignore" : "pipe", "pipe", "pipe"]
595
+ });
596
+ const out = [];
597
+ const err = [];
598
+ let timedOut = false;
599
+ const timer = setTimeout(() => {
600
+ timedOut = true;
601
+ child.kill("SIGKILL");
602
+ }, timeoutMs);
603
+ child.stdout?.on("data", (c) => out.push(c));
604
+ child.stderr?.on("data", (c) => err.push(c));
605
+ child.on("error", (e) => {
606
+ clearTimeout(timer);
607
+ resolve({ code: null, stdout: "", stderr: "", spawnError: e.message });
608
+ });
609
+ child.on("close", (code) => {
610
+ clearTimeout(timer);
611
+ resolve({
612
+ code,
613
+ stdout: Buffer.concat(out).toString("utf8"),
614
+ stderr: Buffer.concat(err).toString("utf8"),
615
+ timedOut
616
+ });
617
+ });
618
+ if (input !== void 0 && child.stdin) {
619
+ child.stdin.on("error", () => {
620
+ });
621
+ child.stdin.end(input);
622
+ }
623
+ });
624
+ }
625
+
626
+ // cli/vault/keychain.ts
627
+ var KEYCHAIN_SERVICE = "wheelhouse-vault";
628
+ var SECURITY = "/usr/bin/security";
629
+ var MAX_LINE_BYTES = 4e3;
630
+ var TIMEOUT_MS = 12e4;
631
+ var ENCODED = "wh-vault:base64:";
632
+ var EXIT_NOT_FOUND2 = 44;
633
+ var EXIT_INTERACTION_NOT_ALLOWED = 36;
634
+ function securityRunner(file = SECURITY, timeoutMs = TIMEOUT_MS) {
635
+ return toolRunner(file, timeoutMs);
636
+ }
637
+ function encodeValue(value) {
638
+ return /^[\x20-\x7e]*$/.test(value) && !value.startsWith(ENCODED) ? value : ENCODED + Buffer.from(value, "utf8").toString("base64");
639
+ }
640
+ function decodeValue(stored) {
641
+ return stored.startsWith(ENCODED) ? Buffer.from(stored.slice(ENCODED.length), "base64").toString("utf8") : stored;
642
+ }
643
+ var KeychainBackend = class {
644
+ constructor(security = securityRunner(), hasSecurity = () => existsSync(SECURITY)) {
645
+ this.security = security;
646
+ this.hasSecurity = hasSecurity;
647
+ }
648
+ security;
649
+ hasSecurity;
650
+ id = "keychain";
651
+ where = "the macOS login Keychain";
652
+ short = "the Keychain";
653
+ async storeProblem() {
654
+ return this.hasSecurity() ? null : `the vault keeps values in the macOS login Keychain, and this computer has no ${SECURITY}`;
655
+ }
656
+ async get(name) {
657
+ this.check(name);
658
+ const r = await this.security([
659
+ "find-generic-password",
660
+ "-s",
661
+ KEYCHAIN_SERVICE,
662
+ "-a",
663
+ name,
664
+ "-w"
665
+ ]);
666
+ if (r.code !== 0) throw this.failure(r, name, "read");
667
+ return decodeValue(r.stdout.endsWith("\n") ? r.stdout.slice(0, -1) : r.stdout);
668
+ }
669
+ async set(name, value) {
670
+ this.check(name);
671
+ const hex = Buffer.from(encodeValue(value), "utf8").toString("hex");
672
+ const line = `add-generic-password -U -s ${KEYCHAIN_SERVICE} -a ${name} -l "${KEYCHAIN_SERVICE} ${name}" -X ${hex}
673
+ `;
674
+ if (Buffer.byteLength(line) > MAX_LINE_BYTES) {
675
+ const room = Math.floor(
676
+ (MAX_LINE_BYTES - (Buffer.byteLength(line) - hex.length)) / 2 - ENCODED.length
677
+ );
678
+ throw new BackendError(
679
+ "too-large",
680
+ `the value is too long for the Keychain through the security tool (at most about ${Math.max(room, 0)} bytes)`
681
+ );
682
+ }
683
+ const r = await this.security(["-i"], line);
684
+ if (r.code !== 0)
685
+ throw this.failure({ ...r, stdout: "", stderr: redact(r.stderr, hex) }, name, "store");
686
+ }
687
+ async remove(name) {
688
+ this.check(name);
689
+ const r = await this.security(["delete-generic-password", "-s", KEYCHAIN_SERVICE, "-a", name]);
690
+ if (r.code === 0) return;
691
+ const e = this.failure(r, name, "delete");
692
+ if (e.kind !== "not-found") throw e;
693
+ }
694
+ /** A secret name is safe to write unquoted into a `security -i` line. */
695
+ check(name) {
696
+ if (!SECRET_NAME.test(name))
697
+ throw new BackendError("failed", `${JSON.stringify(name)} is not a secret name`);
698
+ }
699
+ failure(r, name, verb) {
700
+ if (r.spawnError !== void 0) {
701
+ return new BackendError(
702
+ "unavailable",
703
+ `could not run ${SECURITY} (${r.spawnError}); the Keychain backend works on macOS only`
704
+ );
705
+ }
706
+ if (r.timedOut) {
707
+ return new BackendError(
708
+ "failed",
709
+ `the Keychain did not answer within ${TIMEOUT_MS / 1e3} s; a Keychain dialog may be waiting on the Mac's screen`
710
+ );
711
+ }
712
+ if (r.code === EXIT_INTERACTION_NOT_ALLOWED || /interaction is not allowed/i.test(r.stderr)) {
713
+ return new BackendError(
714
+ "interaction-not-allowed",
715
+ `the Keychain would not answer here ("User interaction is not allowed"): this terminal runs outside the Mac's login session, so the Keychain cannot ask to be unlocked or to allow access`
716
+ );
717
+ }
718
+ if (r.code === EXIT_NOT_FOUND2 || /could not be found/i.test(r.stderr)) {
719
+ return new BackendError("not-found", `the Keychain has no value for ${name}`);
720
+ }
721
+ const said = r.stderr.trim().split("\n")[0]?.replace(/^security:\s*/, "") ?? "";
722
+ return new BackendError(
723
+ "failed",
724
+ `the Keychain could not ${verb} ${name} (security exited ${r.code ?? "abnormally"}${said ? `: ${said}` : ""})`
725
+ );
726
+ }
727
+ };
728
+ function redact(text, hex) {
729
+ let out = text.split(hex).join("[value]");
730
+ out = out.replace(/[0-9a-fA-F]{16,}/g, "[value]");
731
+ return out;
732
+ }
733
+
734
+ // cli/vault/secret-service.ts
735
+ var SECRET_SERVICE_ATTRIBUTE = "wheelhouse-vault";
736
+ var SECRET_TOOL = "secret-tool";
737
+ var GDBUS = "gdbus";
738
+ var MAX_VALUE_BYTES = 8191;
739
+ var TIMEOUT_MS2 = 12e4;
740
+ var CHECK_TIMEOUT_MS = 1e4;
741
+ var PROBE_NAME = "wh-vault-check";
742
+ var SecretServiceBackend = class {
743
+ constructor(secretTool = toolRunner(SECRET_TOOL, TIMEOUT_MS2), gdbus = toolRunner(GDBUS, CHECK_TIMEOUT_MS)) {
744
+ this.secretTool = secretTool;
745
+ this.gdbus = gdbus;
746
+ }
747
+ secretTool;
748
+ gdbus;
749
+ id = "secret-service";
750
+ where = "the login keyring (Secret Service)";
751
+ short = "the keyring";
752
+ async get(name) {
753
+ this.checkName(name);
754
+ const r = await this.secretTool(["lookup", ...attributes(name)]);
755
+ if (r.code === 0) return r.stdout;
756
+ if (silent(r)) {
757
+ const locked = await this.lockedProblem();
758
+ if (locked) throw new BackendError("unavailable", locked);
759
+ throw new BackendError("not-found", `the keyring has no value for ${name}`);
760
+ }
761
+ throw this.failure(r, name, "read");
762
+ }
763
+ async set(name, value) {
764
+ this.checkName(name);
765
+ if (Buffer.byteLength(value) > MAX_VALUE_BYTES) {
766
+ throw new BackendError(
767
+ "too-large",
768
+ `the value is too long for the keyring through secret-tool (at most ${MAX_VALUE_BYTES.toLocaleString("en-US")} bytes)`
769
+ );
770
+ }
771
+ const r = await this.secretTool(
772
+ ["store", "--label", `${SECRET_SERVICE_ATTRIBUTE} ${name}`, ...attributes(name)],
773
+ value
774
+ );
775
+ if (r.code !== 0) throw this.failure(r, name, "store", value);
776
+ if (/too long/i.test(r.stderr)) {
777
+ await this.secretTool(["clear", ...attributes(name)]);
778
+ throw new BackendError("too-large", `secret-tool would not take the whole value of ${name}`);
779
+ }
780
+ }
781
+ async remove(name) {
782
+ this.checkName(name);
783
+ const r = await this.secretTool(["clear", ...attributes(name)]);
784
+ if (r.code === 0) return;
785
+ if (silent(r)) {
786
+ const locked = await this.lockedProblem();
787
+ if (locked) throw new BackendError("unavailable", locked);
788
+ return;
789
+ }
790
+ throw this.failure(r, name, "delete");
791
+ }
792
+ async storeProblem() {
793
+ const r = await this.secretTool(["lookup", ...attributes(PROBE_NAME)]);
794
+ if (r.code !== 0 && !silent(r)) return this.failure(r, "", "answer").message;
795
+ const state = await this.keyring();
796
+ if (typeof state === "object") return state.problem;
797
+ if (state === "locked") return LOCKED;
798
+ return null;
799
+ }
800
+ /** Why the keyring cannot answer, if it is locked or missing; else null. */
801
+ async lockedProblem() {
802
+ const state = await this.keyring();
803
+ if (state === "locked") return LOCKED;
804
+ return typeof state === "object" ? state.problem : null;
805
+ }
806
+ /** The default keyring's state, from its `Locked` property; reads no value. */
807
+ async keyring() {
808
+ const r = await this.gdbus([
809
+ "call",
810
+ "--session",
811
+ "--dest",
812
+ "org.freedesktop.secrets",
813
+ "--object-path",
814
+ "/org/freedesktop/secrets/aliases/default",
815
+ "--method",
816
+ "org.freedesktop.DBus.Properties.Get",
817
+ "org.freedesktop.Secret.Collection",
818
+ "Locked"
819
+ ]);
820
+ if (r.spawnError !== void 0 || r.timedOut) return "unknown";
821
+ if (r.code === 0) {
822
+ if (/<?\btrue\b>?/.test(r.stdout)) return "locked";
823
+ if (/<?\bfalse\b>?/.test(r.stdout)) return "unlocked";
824
+ return "unknown";
825
+ }
826
+ const problem = explain(r.stderr);
827
+ return problem ? { problem } : "unknown";
828
+ }
829
+ /** A secret name is all an attribute value here ever is. */
830
+ checkName(name) {
831
+ if (!SECRET_NAME.test(name))
832
+ throw new BackendError("failed", `${JSON.stringify(name)} is not a secret name`);
833
+ }
834
+ failure(r, name, verb, value) {
835
+ if (r.spawnError !== void 0) {
836
+ const missing = /ENOENT/.test(r.spawnError);
837
+ return new BackendError(
838
+ "unavailable",
839
+ `${missing ? `${SECRET_TOOL} is not installed` : `could not run ${SECRET_TOOL} (${r.spawnError})`}; the vault reaches the Secret Service on Linux through it, from libsecret's tools (the libsecret-tools package on Debian and Ubuntu, libsecret on Fedora and Arch)`
840
+ );
841
+ }
842
+ if (r.timedOut) {
843
+ return new BackendError(
844
+ "failed",
845
+ `the keyring did not answer within ${TIMEOUT_MS2 / 1e3} s; a prompt to unlock it may be waiting on the screen`
846
+ );
847
+ }
848
+ const problem = explain(r.stderr);
849
+ if (problem) return new BackendError("unavailable", problem);
850
+ const line = r.stderr.trim().split("\n")[0]?.replace(/^secret-tool:\s*/, "") ?? "";
851
+ const said = value && line.includes(value) ? "" : line;
852
+ return new BackendError(
853
+ "failed",
854
+ `the keyring could not ${name ? `${verb} ${name}` : verb} (secret-tool exited ${r.code ?? "abnormally"}${said ? `: ${said}` : ""})`
855
+ );
856
+ }
857
+ };
858
+ var LOCKED = "the login keyring is locked, and the Secret Service would not unlock it here; unlock it (log in to the desktop, or unlock it in a keyring manager) and try again";
859
+ function attributes(name) {
860
+ return ["service", SECRET_SERVICE_ATTRIBUTE, "account", name];
861
+ }
862
+ function silent(r) {
863
+ return r.code === 1 && !r.stderr.trim() && !r.timedOut && r.spawnError === void 0;
864
+ }
865
+ function explain(stderr) {
866
+ if (/autolaunch D-Bus|DBUS_SESSION_BUS_ADDRESS|Error connecting|Could not connect|Failed to connect|Unable to autolaunch/i.test(
867
+ stderr
868
+ )) {
869
+ return "there is no D-Bus session here for the Secret Service to answer on (DBUS_SESSION_BUS_ADDRESS is not set and there is no desktop login), as on a server with no keyring";
870
+ }
871
+ if (/org\.freedesktop\.secrets was not provided|ServiceUnknown|name is not activatable/i.test(
872
+ stderr
873
+ )) {
874
+ return "no Secret Service keyring (such as gnome-keyring) is running in this session";
875
+ }
876
+ if (/locked collection|is locked/i.test(stderr)) return LOCKED;
877
+ if (/Object does not exist at path|No such object|UnknownObject/i.test(stderr)) {
878
+ return "the Secret Service has no default keyring to store values in";
879
+ }
880
+ return null;
881
+ }
882
+
883
+ // cli/vault/select.ts
884
+ function only(backend) {
885
+ return { primary: backend, ids: [backend.id], make: () => backend, hint: () => null };
886
+ }
887
+ var ENV_FILE_HINT = "to keep values in a plaintext file in the vault folder instead, protected only by its permissions, opt in with `wh-vault backend env-file` (see docs/vault.md)";
888
+ var KEYRING_SESSION_HINT = "the vault's secrets are in the Secret Service keyring, so use wh-vault from a session that can reach it, such as the desktop session";
889
+ function platformBackends(platform = process.platform) {
890
+ if (platform !== "linux") return only(new KeychainBackend());
891
+ const keyring = new SecretServiceBackend();
892
+ return {
893
+ primary: keyring,
894
+ ids: [keyring.id, "env-file"],
895
+ make: (id, dir) => id === "env-file" ? new EnvFileBackend(dir) : keyring,
896
+ // Offered when there is no keyring to use, not when there is one that is locked.
897
+ hint: (current, problem, held) => current.id !== keyring.id || problem.startsWith(LOCKED) ? null : held ? KEYRING_SESSION_HINT : ENV_FILE_HINT
898
+ };
899
+ }
900
+
604
901
  // cli/vault/program.ts
605
902
  var CliError = class extends Error {
606
903
  constructor(message, code = 1) {
@@ -650,10 +947,12 @@ function columns(rows) {
650
947
  }
651
948
  function vaultProgram(deps) {
652
949
  const now = deps.now ?? (() => /* @__PURE__ */ new Date());
950
+ const backends = "make" in deps.backend ? deps.backend : only(deps.backend);
951
+ const primary = backends.primary;
653
952
  const out = (line = "") => deps.stdout.write(`${line}
654
953
  `);
655
954
  const program = new Command("wh-vault").description(
656
- "Secrets for Firstmate\u2019s crew by name, never by value: values stay in the macOS login Keychain, and a project\u2019s granted secrets reach one command at a time."
955
+ `Secrets for Firstmate\u2019s crew by name, never by value: values stay in ${primary.where}, and a project\u2019s granted secrets reach one command at a time.`
657
956
  ).version(version).option(
658
957
  "--config-dir <dir>",
659
958
  "the Wheelhouse config directory whose vault folder holds the vault (default: $WHEELHOUSE_CONFIG_DIR, else $XDG_CONFIG_HOME/wheelhouse, else ~/.config/wheelhouse)"
@@ -664,7 +963,7 @@ function vaultProgram(deps) {
664
963
  });
665
964
  const dirOf = () => {
666
965
  const configDir = program.opts().configDir;
667
- return vaultDir(configDir ? path6.resolve(deps.cwd, configDir) : defaultConfigDir(deps.env));
966
+ return vaultDir(configDir ? path7.resolve(deps.cwd, configDir) : defaultConfigDir(deps.env));
668
967
  };
669
968
  const caller = () => (deps.caller ?? (() => resolveCaller({ env: deps.env, cwd: deps.cwd })))();
670
969
  const task = () => {
@@ -673,13 +972,19 @@ function vaultProgram(deps) {
673
972
  };
674
973
  const audit = (dir, e) => appendAudit(dir, { at: now().toISOString(), task: task(), ...e });
675
974
  const loadVault = async (dir) => {
676
- const vault = await readVault(dir) ?? emptyVault(deps.backend.id);
677
- if (vault.backend !== deps.backend.id) {
975
+ const vault = await readVault(dir) ?? emptyVault(primary.id);
976
+ const backend = backends.make(vault.backend, dir);
977
+ if (vault.backend !== backend.id) {
678
978
  throw new CliError(
679
979
  `this vault keeps its values in the ${vault.backend} backend, which this wh-vault does not have`
680
980
  );
681
981
  }
682
- return vault;
982
+ return { vault, backend };
983
+ };
984
+ const withHint = (e, backend, vault) => {
985
+ if (!(e instanceof BackendError) || e.kind !== "unavailable") return e;
986
+ const hint = backends.hint(backend, e.message, Object.keys(vault.secrets).length);
987
+ return hint ? new BackendError(e.kind, `${e.message}; ${hint}`) : e;
683
988
  };
684
989
  const needSecret = (vault, name) => {
685
990
  if (!vault.secrets[name]) {
@@ -699,29 +1004,31 @@ function vaultProgram(deps) {
699
1004
  process.exitCode = e instanceof CliError ? e.code : 1;
700
1005
  }
701
1006
  };
702
- const store = async (dir, vault, name, value) => {
1007
+ const store = async (backend, vault, name, value) => {
703
1008
  if (!value) throw new CliError(`no value given for ${name}; nothing was stored`);
704
- await deps.backend.set(name, value);
1009
+ try {
1010
+ await backend.set(name, value);
1011
+ } catch (e) {
1012
+ throw withHint(e, backend, vault);
1013
+ }
705
1014
  const at = now().toISOString();
706
1015
  const had = vault.secrets[name];
707
1016
  vault.secrets[name] = had ? { ...had, updatedAt: at } : { projects: [], createdAt: at, updatedAt: at };
708
1017
  return !!had;
709
1018
  };
710
1019
  program.command("set <name>").description(
711
- "Store a value under NAME in the Keychain, typed without echo (or piped on stdin); replaces any value already there."
1020
+ `Store a value under NAME in ${primary.short}, typed without echo (or piped on stdin); replaces any value already there.`
712
1021
  ).action(
713
1022
  act(async (name) => {
714
1023
  secretName(name);
715
1024
  const dir = dirOf();
716
- const vault = await loadVault(dir);
1025
+ const { vault, backend } = await loadVault(dir);
717
1026
  const value = await deps.readValue(`Value for ${name} (not shown): `);
718
1027
  if (value === null) throw new CliError(`no value given for ${name}; nothing was stored`);
719
- const replaced = await store(dir, vault, name, value);
1028
+ const replaced = await store(backend, vault, name, value);
720
1029
  await writeVault(dir, vault);
721
1030
  await audit(dir, { event: "set", names: [name], project: null });
722
- out(
723
- replaced ? `Replaced the value of ${name}.` : `Stored ${name} in ${deps.backend.where}.`
724
- );
1031
+ out(replaced ? `Replaced the value of ${name}.` : `Stored ${name} in ${backend.where}.`);
725
1032
  const projects = vault.secrets[name].projects;
726
1033
  out(
727
1034
  projects.length ? `Granted to: ${projects.join(", ")}.` : `No project may use it yet. Grant it with: wh-vault grant ${name} <project>`
@@ -729,14 +1036,14 @@ function vaultProgram(deps) {
729
1036
  })
730
1037
  );
731
1038
  program.command("import <file>").description(
732
- "Store every NAME=value line of a .env file in the Keychain, then show how to delete the file."
1039
+ `Store every NAME=value line of a .env file in ${primary.short}, then show how to delete the file.`
733
1040
  ).action(
734
1041
  act(async (file) => {
735
- const full = path6.resolve(deps.cwd, file);
1042
+ const full = path7.resolve(deps.cwd, file);
736
1043
  let text;
737
1044
  try {
738
1045
  if (!(await stat(full)).isFile()) throw new Error("not a file");
739
- text = await readFile4(full, "utf8");
1046
+ text = await readFile5(full, "utf8");
740
1047
  } catch (e) {
741
1048
  throw new CliError(`cannot read ${file}: ${messageOf(e)}`);
742
1049
  }
@@ -758,7 +1065,7 @@ function vaultProgram(deps) {
758
1065
  }
759
1066
  if (!entries.length) throw new CliError(`${file} has no NAME=value lines to import`);
760
1067
  const dir = dirOf();
761
- const vault = await loadVault(dir);
1068
+ const { vault, backend } = await loadVault(dir);
762
1069
  const stored = [];
763
1070
  const replaced = [];
764
1071
  let failure = null;
@@ -769,7 +1076,7 @@ function vaultProgram(deps) {
769
1076
  continue;
770
1077
  }
771
1078
  try {
772
- (await store(dir, vault, name, value) ? replaced : stored).push(name);
1079
+ (await store(backend, vault, name, value) ? replaced : stored).push(name);
773
1080
  } catch (e) {
774
1081
  failure = e;
775
1082
  break;
@@ -780,7 +1087,7 @@ function vaultProgram(deps) {
780
1087
  await writeVault(dir, vault);
781
1088
  await audit(dir, { event: "set", names: done, project: null });
782
1089
  }
783
- if (stored.length) out(`Stored in ${deps.backend.where}: ${stored.join(", ")}.`);
1090
+ if (stored.length) out(`Stored in ${backend.where}: ${stored.join(", ")}.`);
784
1091
  if (replaced.length) out(`Replaced: ${replaced.join(", ")}.`);
785
1092
  if (failure) throw failure;
786
1093
  out(
@@ -806,7 +1113,7 @@ function vaultProgram(deps) {
806
1113
  JSON.stringify({
807
1114
  schema: "wh-vault.list.v1",
808
1115
  initialized: vault !== null,
809
- backend: vault?.backend ?? deps.backend.id,
1116
+ backend: vault?.backend ?? primary.id,
810
1117
  secrets
811
1118
  })
812
1119
  );
@@ -855,7 +1162,7 @@ function vaultProgram(deps) {
855
1162
  secretName(name);
856
1163
  projects.forEach(projectId);
857
1164
  const dir = dirOf();
858
- const vault = await loadVault(dir);
1165
+ const { vault } = await loadVault(dir);
859
1166
  needSecret(vault, name);
860
1167
  const s = vault.secrets[name];
861
1168
  const set = new Set(s.projects);
@@ -872,13 +1179,13 @@ function vaultProgram(deps) {
872
1179
  });
873
1180
  program.command("grant <name> <projects...>").description("Let commands run for these projects receive NAME.").action(changeGrant("grant"));
874
1181
  program.command("revoke <name> <projects...>").description("Stop commands run for these projects receiving NAME.").action(changeGrant("revoke"));
875
- program.command("remove <name>").description("Delete NAME\u2019s value from the Keychain and its grants from the vault.").action(
1182
+ program.command("remove <name>").description(`Delete NAME\u2019s value from ${primary.short} and its grants from the vault.`).action(
876
1183
  act(async (name) => {
877
1184
  secretName(name);
878
1185
  const dir = dirOf();
879
- const vault = await loadVault(dir);
1186
+ const { vault, backend } = await loadVault(dir);
880
1187
  needSecret(vault, name);
881
- await deps.backend.remove(name);
1188
+ await backend.remove(name);
882
1189
  delete vault.secrets[name];
883
1190
  await writeVault(dir, vault);
884
1191
  await audit(dir, { event: "remove", names: [name], project: null });
@@ -894,9 +1201,11 @@ function vaultProgram(deps) {
894
1201
  ).passThroughOptions().action(
895
1202
  act(async (command, o) => {
896
1203
  if (!command.length) throw new CliError("no command given: wh-vault run -- <command>", 2);
1204
+ const dir = dirOf();
1205
+ const recorded = (await readVault(dir))?.backend ?? primary.id;
897
1206
  return runWithSecrets(command, o.only, {
898
- backend: deps.backend,
899
- dir: dirOf(),
1207
+ backend: backends.make(recorded, dir),
1208
+ dir,
900
1209
  caller: await caller(),
901
1210
  env: deps.env,
902
1211
  cwd: deps.cwd,
@@ -907,6 +1216,65 @@ function vaultProgram(deps) {
907
1216
  });
908
1217
  })
909
1218
  );
1219
+ program.command("backend [id]").description(
1220
+ `Where this vault keeps its values and whether a value can be stored there now; with an id, keep them in that backend instead (${backends.ids.join(" or ")}), while the vault holds no secret. Never values.`
1221
+ ).option("--json", "machine-readable output").action(
1222
+ act(async (id, o) => {
1223
+ const dir = dirOf();
1224
+ if (id !== void 0) {
1225
+ if (!backends.ids.includes(id)) {
1226
+ throw new CliError(
1227
+ `this computer has no ${JSON.stringify(id)} backend; it has ${backends.ids.join(" and ")}`,
1228
+ 2
1229
+ );
1230
+ }
1231
+ const vault = await readVault(dir) ?? emptyVault(primary.id);
1232
+ const count = Object.keys(vault.secrets).length;
1233
+ if (vault.backend !== id && count) {
1234
+ const was = backends.make(vault.backend, dir);
1235
+ const where = was.id === vault.backend ? was.where : `the ${vault.backend} backend`;
1236
+ throw new CliError(
1237
+ `the vault holds ${count} secret${count === 1 ? "" : "s"} in ${where}; wh-vault does not move values between backends, so remove ${count === 1 ? "it" : "them"} first (\`wh-vault list --all\`)`
1238
+ );
1239
+ }
1240
+ vault.backend = id;
1241
+ await writeVault(dir, vault);
1242
+ }
1243
+ const current = await readVault(dir);
1244
+ const recorded = current?.backend ?? primary.id;
1245
+ const backend = backends.make(recorded, dir);
1246
+ const known = backend.id === recorded;
1247
+ const problem = known ? await backend.storeProblem() : `this vault keeps its values in the ${recorded} backend, which this wh-vault does not have`;
1248
+ const hint = problem && known ? backends.hint(backend, problem, Object.keys(current?.secrets ?? {}).length) : null;
1249
+ const reason = problem ? hint ? `${problem}; ${hint}` : problem : null;
1250
+ if (o.json) {
1251
+ out(
1252
+ JSON.stringify({
1253
+ schema: "wh-vault.backend.v1",
1254
+ backend: recorded,
1255
+ where: known ? backend.where : null,
1256
+ canStore: !problem,
1257
+ reason,
1258
+ choices: backends.ids
1259
+ })
1260
+ );
1261
+ return;
1262
+ }
1263
+ if (id !== void 0) out(`Values are now kept in ${backend.where}.`);
1264
+ else if (known) out(`Values are kept in ${backend.where}.`);
1265
+ if (backend.id === "env-file") {
1266
+ out(
1267
+ "That file is plaintext at rest, protected only by its permissions (0600, in a 0700 folder). Prefer a Secret Service keyring where there is one: wh-vault backend secret-service"
1268
+ );
1269
+ }
1270
+ if (!reason) {
1271
+ out("A value can be stored there now.");
1272
+ return;
1273
+ }
1274
+ out(`A value cannot be stored here now: ${reason}.`);
1275
+ return 1;
1276
+ })
1277
+ );
910
1278
  program.command("audit").description(
911
1279
  "The usage log, newest first: who used which names, when, for what and how it ended. Never values."
912
1280
  ).option("--project <id>", "only this project", projectId).option("--task <id>", "only this Firstmate task").option("--name <name>", "only uses of this secret", secretName).option("--event <event>", "only run, set, remove, grant or revoke").option("--limit <n>", "at most this many (default 50)", limit).option("--json", "machine-readable output").action(
@@ -993,7 +1361,7 @@ async function readStdin(input = process.stdin) {
993
1361
 
994
1362
  // cli/vault/index.ts
995
1363
  await vaultProgram({
996
- backend: new KeychainBackend(),
1364
+ backend: platformBackends(),
997
1365
  env: process.env,
998
1366
  cwd: process.cwd(),
999
1367
  stdout: process.stdout,