@chrisjowen/wheelhouse 0.16.1 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/build/client/_app/immutable/chunks/{_wNDtuC3.js → BQPyzYAS.js} +1 -1
  2. package/build/client/_app/immutable/chunks/BQPyzYAS.js.br +0 -0
  3. package/build/client/_app/immutable/chunks/BQPyzYAS.js.gz +0 -0
  4. package/build/client/_app/immutable/chunks/{yB7gO-LO.js → BS3n5c7l.js} +1 -1
  5. package/build/client/_app/immutable/chunks/BS3n5c7l.js.br +0 -0
  6. package/build/client/_app/immutable/chunks/BS3n5c7l.js.gz +0 -0
  7. package/build/client/_app/immutable/chunks/{DwipL_Cn.js → Bgm2YDEc.js} +1 -1
  8. package/build/client/_app/immutable/chunks/Bgm2YDEc.js.br +0 -0
  9. package/build/client/_app/immutable/chunks/Bgm2YDEc.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/{Cx2pfZgS.js → CF9qC7cA.js} +1 -1
  11. package/build/client/_app/immutable/chunks/CF9qC7cA.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/CF9qC7cA.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/{CLj8aQLL.js → CGRtmaS4.js} +1 -1
  14. package/build/client/_app/immutable/chunks/CGRtmaS4.js.br +0 -0
  15. package/build/client/_app/immutable/chunks/{CLj8aQLL.js.gz → CGRtmaS4.js.gz} +0 -0
  16. package/build/client/_app/immutable/chunks/{CIDO3V-e.js → CH2Y0BVE.js} +1 -1
  17. package/build/client/_app/immutable/chunks/CH2Y0BVE.js.br +0 -0
  18. package/build/client/_app/immutable/chunks/CH2Y0BVE.js.gz +0 -0
  19. package/build/client/_app/immutable/chunks/{CnNJ9y58.js → CLADX83T.js} +1 -1
  20. package/build/client/_app/immutable/chunks/CLADX83T.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/CLADX83T.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/{BP2Qtph5.js → CS4t4atW.js} +1 -1
  23. package/build/client/_app/immutable/chunks/CS4t4atW.js.br +0 -0
  24. package/build/client/_app/immutable/chunks/CS4t4atW.js.gz +0 -0
  25. package/build/client/_app/immutable/chunks/{CejLiPvM.js → CU0ZJcdF.js} +2 -2
  26. package/build/client/_app/immutable/chunks/CU0ZJcdF.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/CU0ZJcdF.js.gz +0 -0
  28. package/build/client/_app/immutable/chunks/{CXqiEZDa.js → CXsGgEzT.js} +1 -1
  29. package/build/client/_app/immutable/chunks/CXsGgEzT.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/CXsGgEzT.js.gz +0 -0
  31. package/build/client/_app/immutable/chunks/{8PhaMXz9.js → Ch7J5mLH.js} +1 -1
  32. package/build/client/_app/immutable/chunks/Ch7J5mLH.js.br +0 -0
  33. package/build/client/_app/immutable/chunks/Ch7J5mLH.js.gz +0 -0
  34. package/build/client/_app/immutable/chunks/{BaV2UMay.js → ClSB0siN.js} +1 -1
  35. package/build/client/_app/immutable/chunks/ClSB0siN.js.br +0 -0
  36. package/build/client/_app/immutable/chunks/ClSB0siN.js.gz +0 -0
  37. package/build/client/_app/immutable/chunks/{CI38zzdF.js → CxexnUzw.js} +1 -1
  38. package/build/client/_app/immutable/chunks/CxexnUzw.js.br +0 -0
  39. package/build/client/_app/immutable/chunks/CxexnUzw.js.gz +0 -0
  40. package/build/client/_app/immutable/chunks/{eaKSEJEz.js → D8F9xgmh.js} +1 -1
  41. package/build/client/_app/immutable/chunks/D8F9xgmh.js.br +0 -0
  42. package/build/client/_app/immutable/chunks/D8F9xgmh.js.gz +0 -0
  43. package/build/client/_app/immutable/chunks/{DKuj2J54.js → DP7xDWnQ.js} +1 -1
  44. package/build/client/_app/immutable/chunks/DP7xDWnQ.js.br +0 -0
  45. package/build/client/_app/immutable/chunks/DP7xDWnQ.js.gz +0 -0
  46. package/build/client/_app/immutable/chunks/{DF5qBysY.js → DkntkkRH.js} +1 -1
  47. package/build/client/_app/immutable/chunks/DkntkkRH.js.br +0 -0
  48. package/build/client/_app/immutable/chunks/DkntkkRH.js.gz +0 -0
  49. package/build/client/_app/immutable/chunks/{-PxedOl8.js → DwBYQnih.js} +1 -1
  50. package/build/client/_app/immutable/chunks/DwBYQnih.js.br +0 -0
  51. package/build/client/_app/immutable/chunks/DwBYQnih.js.gz +0 -0
  52. package/build/client/_app/immutable/chunks/{C237xJzy.js → RedPhL9b.js} +1 -1
  53. package/build/client/_app/immutable/chunks/RedPhL9b.js.br +0 -0
  54. package/build/client/_app/immutable/chunks/RedPhL9b.js.gz +0 -0
  55. package/build/client/_app/immutable/chunks/{CFyednqY.js → _8osrypQ.js} +1 -1
  56. package/build/client/_app/immutable/chunks/_8osrypQ.js.br +2 -0
  57. package/build/client/_app/immutable/chunks/_8osrypQ.js.gz +0 -0
  58. package/build/client/_app/immutable/chunks/{CYD68e6V.js → iI4tqZHC.js} +1 -1
  59. package/build/client/_app/immutable/chunks/iI4tqZHC.js.br +0 -0
  60. package/build/client/_app/immutable/chunks/iI4tqZHC.js.gz +0 -0
  61. package/build/client/_app/immutable/entry/{app.BOOXafZJ.js → app.DzMOOaXE.js} +2 -2
  62. package/build/client/_app/immutable/entry/app.DzMOOaXE.js.br +0 -0
  63. package/build/client/_app/immutable/entry/app.DzMOOaXE.js.gz +0 -0
  64. package/build/client/_app/immutable/entry/start.BP7YKN_Q.js +1 -0
  65. package/build/client/_app/immutable/entry/start.BP7YKN_Q.js.br +0 -0
  66. package/build/client/_app/immutable/entry/start.BP7YKN_Q.js.gz +0 -0
  67. package/build/client/_app/immutable/nodes/{0.py9DNAwX.js → 0.BIHpRnqw.js} +1 -1
  68. package/build/client/_app/immutable/nodes/0.BIHpRnqw.js.br +0 -0
  69. package/build/client/_app/immutable/nodes/0.BIHpRnqw.js.gz +0 -0
  70. package/build/client/_app/immutable/nodes/{1.CLi5bKEj.js → 1.BJIoIsvP.js} +1 -1
  71. package/build/client/_app/immutable/nodes/1.BJIoIsvP.js.br +0 -0
  72. package/build/client/_app/immutable/nodes/1.BJIoIsvP.js.gz +0 -0
  73. package/build/client/_app/immutable/nodes/{10.yQfIVnsR.js → 10.DRDVy09M.js} +1 -1
  74. package/build/client/_app/immutable/nodes/10.DRDVy09M.js.br +0 -0
  75. package/build/client/_app/immutable/nodes/10.DRDVy09M.js.gz +0 -0
  76. package/build/client/_app/immutable/nodes/{11.B0fQm_d5.js → 11.B2EhouGG.js} +1 -1
  77. package/build/client/_app/immutable/nodes/11.B2EhouGG.js.br +0 -0
  78. package/build/client/_app/immutable/nodes/11.B2EhouGG.js.gz +0 -0
  79. package/build/client/_app/immutable/nodes/{12.DobuoNGx.js → 12.5fuIl1It.js} +1 -1
  80. package/build/client/_app/immutable/nodes/12.5fuIl1It.js.br +0 -0
  81. package/build/client/_app/immutable/nodes/12.5fuIl1It.js.gz +0 -0
  82. package/build/client/_app/immutable/nodes/{13.DrO72J_j.js → 13.BHd8lAXB.js} +1 -1
  83. package/build/client/_app/immutable/nodes/13.BHd8lAXB.js.br +0 -0
  84. package/build/client/_app/immutable/nodes/13.BHd8lAXB.js.gz +0 -0
  85. package/build/client/_app/immutable/nodes/{14.B9bNPNMC.js → 14.DgsN2-TN.js} +1 -1
  86. package/build/client/_app/immutable/nodes/14.DgsN2-TN.js.br +0 -0
  87. package/build/client/_app/immutable/nodes/14.DgsN2-TN.js.gz +0 -0
  88. package/build/client/_app/immutable/nodes/{15.0P3R4toY.js → 15.CPHkfcQw.js} +1 -1
  89. package/build/client/_app/immutable/nodes/15.CPHkfcQw.js.br +0 -0
  90. package/build/client/_app/immutable/nodes/{15.0P3R4toY.js.gz → 15.CPHkfcQw.js.gz} +0 -0
  91. package/build/client/_app/immutable/nodes/{16.BnUrhlYC.js → 16.CrpxQoZ7.js} +1 -1
  92. package/build/client/_app/immutable/nodes/16.CrpxQoZ7.js.br +0 -0
  93. package/build/client/_app/immutable/nodes/16.CrpxQoZ7.js.gz +0 -0
  94. package/build/client/_app/immutable/nodes/{17.CHTdkvmi.js → 17.B83y7TTZ.js} +1 -1
  95. package/build/client/_app/immutable/nodes/17.B83y7TTZ.js.br +0 -0
  96. package/build/client/_app/immutable/nodes/17.B83y7TTZ.js.gz +0 -0
  97. package/build/client/_app/immutable/nodes/{19.BqId6Q50.js → 19.BGzbdUG8.js} +1 -1
  98. package/build/client/_app/immutable/nodes/19.BGzbdUG8.js.br +0 -0
  99. package/build/client/_app/immutable/nodes/19.BGzbdUG8.js.gz +0 -0
  100. package/build/client/_app/immutable/nodes/{2.CEJmYaPJ.js → 2.B_zXlRDw.js} +1 -1
  101. package/build/client/_app/immutable/nodes/2.B_zXlRDw.js.br +0 -0
  102. package/build/client/_app/immutable/nodes/2.B_zXlRDw.js.gz +0 -0
  103. package/build/client/_app/immutable/nodes/{20.CHH39Z2Z.js → 20.CQE-Zjw-.js} +1 -1
  104. package/build/client/_app/immutable/nodes/20.CQE-Zjw-.js.br +0 -0
  105. package/build/client/_app/immutable/nodes/20.CQE-Zjw-.js.gz +0 -0
  106. package/build/client/_app/immutable/nodes/{21.CbnS5dV1.js → 21.BjSp2mZI.js} +1 -1
  107. package/build/client/_app/immutable/nodes/21.BjSp2mZI.js.br +0 -0
  108. package/build/client/_app/immutable/nodes/21.BjSp2mZI.js.gz +0 -0
  109. package/build/client/_app/immutable/nodes/{22.malZaF0r.js → 22.BycUFjCM.js} +1 -1
  110. package/build/client/_app/immutable/nodes/22.BycUFjCM.js.br +0 -0
  111. package/build/client/_app/immutable/nodes/22.BycUFjCM.js.gz +0 -0
  112. package/build/client/_app/immutable/nodes/{23.B-MnoGp_.js → 23.BjOud3nL.js} +1 -1
  113. package/build/client/_app/immutable/nodes/23.BjOud3nL.js.br +0 -0
  114. package/build/client/_app/immutable/nodes/23.BjOud3nL.js.gz +0 -0
  115. package/build/client/_app/immutable/nodes/{24.D4YfUDkp.js → 24.DmaWt7EU.js} +1 -1
  116. package/build/client/_app/immutable/nodes/24.DmaWt7EU.js.br +0 -0
  117. package/build/client/_app/immutable/nodes/24.DmaWt7EU.js.gz +0 -0
  118. package/build/client/_app/immutable/nodes/{25.CGUyx5gm.js → 25.DpdKssoo.js} +1 -1
  119. package/build/client/_app/immutable/nodes/25.DpdKssoo.js.br +0 -0
  120. package/build/client/_app/immutable/nodes/25.DpdKssoo.js.gz +0 -0
  121. package/build/client/_app/immutable/nodes/{26.CSoLyIuT.js → 26.BxG4S8mB.js} +1 -1
  122. package/build/client/_app/immutable/nodes/26.BxG4S8mB.js.br +0 -0
  123. package/build/client/_app/immutable/nodes/26.BxG4S8mB.js.gz +0 -0
  124. package/build/client/_app/immutable/nodes/{28.CnDXbxut.js → 28.Ds4FDR_a.js} +1 -1
  125. package/build/client/_app/immutable/nodes/28.Ds4FDR_a.js.br +0 -0
  126. package/build/client/_app/immutable/nodes/28.Ds4FDR_a.js.gz +0 -0
  127. package/build/client/_app/immutable/nodes/{3.7M8y-hh1.js → 3.CldWfpKa.js} +1 -1
  128. package/build/client/_app/immutable/nodes/3.CldWfpKa.js.br +0 -0
  129. package/build/client/_app/immutable/nodes/3.CldWfpKa.js.gz +0 -0
  130. package/build/client/_app/immutable/nodes/{4.C-_GUkXF.js → 4.Ds0FcslK.js} +1 -1
  131. package/build/client/_app/immutable/nodes/4.Ds0FcslK.js.br +0 -0
  132. package/build/client/_app/immutable/nodes/4.Ds0FcslK.js.gz +0 -0
  133. package/build/client/_app/immutable/nodes/{6.BtFuhrhK.js → 6.CvP4hVA3.js} +1 -1
  134. package/build/client/_app/immutable/nodes/6.CvP4hVA3.js.br +0 -0
  135. package/build/client/_app/immutable/nodes/6.CvP4hVA3.js.gz +0 -0
  136. package/build/client/_app/immutable/nodes/{7.YcUXbAew.js → 7.Ca_DVOMc.js} +1 -1
  137. package/build/client/_app/immutable/nodes/7.Ca_DVOMc.js.br +0 -0
  138. package/build/client/_app/immutable/nodes/7.Ca_DVOMc.js.gz +0 -0
  139. package/build/client/_app/immutable/nodes/{8.DsZ8ckdf.js → 8.D8JqGvkd.js} +1 -1
  140. package/build/client/_app/immutable/nodes/8.D8JqGvkd.js.br +0 -0
  141. package/build/client/_app/immutable/nodes/8.D8JqGvkd.js.gz +0 -0
  142. package/build/client/_app/immutable/nodes/{9.C_to2yZ7.js → 9.CHSFcAbh.js} +1 -1
  143. package/build/client/_app/immutable/nodes/9.CHSFcAbh.js.br +0 -0
  144. package/build/client/_app/immutable/nodes/9.CHSFcAbh.js.gz +0 -0
  145. package/build/client/_app/version.json +1 -1
  146. package/build/client/_app/version.json.br +0 -0
  147. package/build/client/_app/version.json.gz +0 -0
  148. package/build/handler.js +4 -4
  149. package/build/index.js +4 -4
  150. package/build/server/chunks/chunks/{detail.js-C63yRaSC.js → detail.js-T1brxxWW.js} +2 -2
  151. package/build/server/chunks/chunks/{feedback.js-CoDUWcj9.js → feedback.js-0cB22LBt.js} +2 -2
  152. package/build/server/chunks/chunks/{internal.js-DRYzzYai.js → internal.js-BJRpqxxM.js} +3 -3
  153. package/build/server/chunks/chunks/{keychain.js-B__X3k_t.js → keychain.js-CsTOqhf4.js} +2 -2
  154. package/build/server/chunks/chunks/{marketplace-service.js-C0HaauhN.js → marketplace-service.js-CckS3apE.js} +2 -2
  155. package/build/server/chunks/chunks/{page.js-duntsJGm.js → page.js-D5V2PN2q.js} +2 -2
  156. package/build/server/chunks/chunks/{previewhelper2.js-KYHlnmkc.js → previewhelper2.js-DRcdOpNv.js} +2 -2
  157. package/build/server/chunks/chunks/{repo.js-BuqHotOZ.js → repo.js-CsdCOmUL.js} +2 -2
  158. package/build/server/chunks/chunks/{runtime.js-r5K-2IqO.js → runtime.js-CbmzOl0F.js} +711 -292
  159. package/build/server/chunks/chunks/{service.js-DhsbI-7z.js → service.js-DztM8MY5.js} +2 -2
  160. package/build/server/chunks/chunks/{service2.js-DtkDw6vU.js → service2.js-DQccL6zz.js} +5 -6
  161. package/build/server/chunks/chunks/{starter.js-7_g91123.js → starter.js-ROzdTBeO.js} +2 -2
  162. package/build/server/chunks/chunks/{view.js-DsUz24Rz.js → view.js-BDo4J83f.js} +2 -2
  163. package/build/server/chunks/entries/endpoints/api/apps/_op_/{_server.ts.js-Xzvf5h6k.js → _server.ts.js-BTTHbZK6.js} +6 -6
  164. package/build/server/chunks/entries/endpoints/api/cloud/{_server.ts.js-CGAcwpTU.js → _server.ts.js-m9cTbE-7.js} +3 -3
  165. package/build/server/chunks/entries/endpoints/api/cloud/previews/{_server.ts.js-B58Bz7g3.js → _server.ts.js-z8BbPJ2P.js} +6 -6
  166. package/build/server/chunks/entries/endpoints/api/events/{_server.ts.js-CnBeqc-z.js → _server.ts.js-BniUpesu.js} +6 -6
  167. package/build/server/chunks/entries/endpoints/api/files/{_server.ts.js-BBm-d7Q_.js → _server.ts.js-B0WcXQJH.js} +6 -6
  168. package/build/server/chunks/entries/endpoints/api/firstmate/chat/{_server.ts.js-CMM6ufeL.js → _server.ts.js-CncNeTwM.js} +6 -6
  169. package/build/server/chunks/entries/endpoints/api/firstmate/commands/{_server.ts.js-DVh0xnbz.js → _server.ts.js-hnvcy9Ia.js} +6 -6
  170. package/build/server/chunks/entries/endpoints/api/firstmate/dismiss/{_server.ts.js-B6rsXvtL.js → _server.ts.js-BQgc12gv.js} +6 -6
  171. package/build/server/chunks/entries/endpoints/api/firstmate/input/{_server.ts.js-BcnbVb8B.js → _server.ts.js-Cpq1OUlv.js} +6 -6
  172. package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/{_server.ts.js-B2vtZDSn.js → _server.ts.js-DcduvTz-.js} +6 -6
  173. package/build/server/chunks/entries/endpoints/api/firstmate/messages/{_server.ts.js-CqZYPGnv.js → _server.ts.js-r_OTtndR.js} +6 -6
  174. package/build/server/chunks/entries/endpoints/api/firstmate/pick/{_server.ts.js-DyvHq1QM.js → _server.ts.js-DRc0m-xP.js} +6 -6
  175. package/build/server/chunks/entries/endpoints/api/firstmate/reactions/{_server.ts.js-CkQOGcx8.js → _server.ts.js-DBrNAwQy.js} +6 -6
  176. package/build/server/chunks/entries/endpoints/api/firstmate/start/{_server.ts.js-NlWKPhvj.js → _server.ts.js-D1Q8V-y_.js} +6 -6
  177. package/build/server/chunks/entries/endpoints/api/fleet/{_server.ts.js-CGqQFYCY.js → _server.ts.js-cN8CO68M.js} +6 -6
  178. package/build/server/chunks/entries/endpoints/api/gateway/{_server.ts.js-9kdSlog2.js → _server.ts.js-BSpvCzuX.js} +6 -6
  179. package/build/server/chunks/entries/endpoints/api/health/{_server.ts.js-BmX4U6It.js → _server.ts.js-Cs9IYII5.js} +6 -6
  180. package/build/server/chunks/entries/endpoints/api/inbox/{_server.ts.js-DGgwPazr.js → _server.ts.js-D2iFH361.js} +6 -6
  181. package/build/server/chunks/entries/endpoints/api/inbox/report/{_server.ts.js-BhlPv4sX.js → _server.ts.js-BnZZNGqp.js} +6 -6
  182. package/build/server/chunks/entries/endpoints/api/insights/{_server.ts.js-CBv70Y5L.js → _server.ts.js-6-pUqSbs.js} +6 -6
  183. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/config/{_server.ts.js-ZFjBkYRX.js → _server.ts.js-BRHI8EzR.js} +6 -6
  184. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/{_server.ts.js-Dye0RV5S.js → _server.ts.js-D75GJhqf.js} +7 -7
  185. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/summary/{_server.ts.js-R01322_G.js → _server.ts.js-DXlq6GNe.js} +8 -8
  186. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/icon/_icon_/{_server.ts.js-D9D-pKLW.js → _server.ts.js-DzCq67Pq.js} +5 -5
  187. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/load/{_server.ts.js-bsKmmR9t.js → _server.ts.js-DP4Br_Kb.js} +2 -2
  188. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/ui/_...path_/{_server.ts.js-KvMFVmRQ.js → _server.ts.js-BTZibvW1.js} +6 -6
  189. package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/update/{_server.ts.js-otZqZBEm.js → _server.ts.js-BVEiTedk.js} +2 -2
  190. package/build/server/chunks/entries/endpoints/api/plugins/{_server.ts.js-BYHIZAYi.js → _server.ts.js-BARKIuL9.js} +6 -6
  191. package/build/server/chunks/entries/endpoints/api/plugins/inspect/{_server.ts.js-BpZ3GTwz.js → _server.ts.js-vXn-DxW7.js} +2 -2
  192. package/build/server/chunks/entries/endpoints/api/plugins/install/{_server.ts.js-Cl9zK50Z.js → _server.ts.js-BrTsfhpU.js} +2 -2
  193. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/{_server.ts.js-BGPTLoZC.js → _server.ts.js-uLUVa1Yc.js} +7 -7
  194. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/icon/_name_/{_server.ts.js-BVB932SW.js → _server.ts.js-fFGC33td.js} +7 -7
  195. package/build/server/chunks/entries/endpoints/api/plugins/marketplace/registries/{_server.ts.js-D82HBSqM.js → _server.ts.js-CV30SKJH.js} +7 -7
  196. package/build/server/chunks/entries/endpoints/api/plugins/roles/{_server.ts.js-CMSUPmoz.js → _server.ts.js-BmywjWsD.js} +5 -5
  197. package/build/server/chunks/entries/endpoints/api/plugins/updates/{_server.ts.js-DgYB9fQH.js → _server.ts.js-C928jxXA.js} +2 -2
  198. package/build/server/chunks/entries/endpoints/api/previews/check/{_server.ts.js-D87d2rZ_.js → _server.ts.js-DsVDHPoG.js} +6 -6
  199. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/{_server.ts.js-KhwSPgmC.js → _server.ts.js-B5kai_f_.js} +7 -7
  200. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/{_server.ts.js-DZW5ka2V.js → _server.ts.js-DFdhVYKr.js} +7 -7
  201. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/{_server.ts.js-BNTbARpk.js → _server.ts.js-C3rHPgm9.js} +7 -7
  202. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/{_server.ts.js-DOrtYzqZ.js → _server.ts.js-GMslvRRG.js} +7 -7
  203. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/file/{_server.ts.js-CUr8NM7B.js → _server.ts.js-G6S2vjwB.js} +7 -7
  204. package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/{_server.ts.js-2EJ0pusQ.js → _server.ts.js-nDbd4-FQ.js} +7 -7
  205. package/build/server/chunks/entries/endpoints/api/second-mates/_id_/peek/{_server.ts.js-CElRDR1Y.js → _server.ts.js-v9aqCXY5.js} +6 -6
  206. package/build/server/chunks/entries/endpoints/api/services/{_server.ts.js-DnOLyc7Y.js → _server.ts.js-BLxZZ6h-.js} +6 -6
  207. package/build/server/chunks/entries/endpoints/api/setup/{_server.ts.js-CWMcwyIE.js → _server.ts.js-BViJ-Ufk.js} +4 -4
  208. package/build/server/chunks/entries/endpoints/api/slots/{_server.ts.js-CG5PhG0B.js → _server.ts.js-T0HJn3Nc.js} +6 -6
  209. package/build/server/chunks/entries/endpoints/api/tasks/_id_/{_server.ts.js-BaglzvAu.js → _server.ts.js-DN9vhG-X.js} +7 -7
  210. package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/{_server.ts.js-B-Etpm4f.js → _server.ts.js-azR55GM-.js} +6 -6
  211. package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/{_server.ts.js-Bi4V_zBg.js → _server.ts.js-NfTPilV6.js} +6 -6
  212. package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/{_server.ts.js-BL8YDwGM.js → _server.ts.js-DzTACS2K.js} +6 -6
  213. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/{_server.ts.js-Be6htkUX.js → _server.ts.js-iObKq15r.js} +6 -6
  214. package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/helper/{_server.ts.js-D6RTMJ5Z.js → _server.ts.js-CFL0gv8m.js} +7 -7
  215. package/build/server/chunks/entries/endpoints/api/vault/{_server.ts.js-C-MF_p4N.js → _server.ts.js-CxnJ6MH1.js} +6 -6
  216. package/build/server/chunks/entries/endpoints/api/wheelhouse/source/{_server.ts.js-DH3NxauC.js → _server.ts.js-BzHUulBR.js} +2 -2
  217. package/build/server/chunks/entries/endpoints/api/wheelhouse/update/{_server.ts.js-Cyptrvpa.js → _server.ts.js-CwIEgYLU.js} +2 -2
  218. package/build/server/chunks/entries/endpoints/api/wheelhouse/upgrade/{_server.ts.js-zslRlgO8.js → _server.ts.js-BfV0Rwjv.js} +2 -2
  219. package/build/server/chunks/entries/endpoints/tasks/_id_/review/{_server.ts.js-BawOwof0.js → _server.ts.js-D0M-kf3z.js} +6 -6
  220. package/build/server/chunks/entries/{hooks.server.js-DoSFsv-T.js → hooks.server.js-BK27kVep.js} +6 -6
  221. package/build/server/chunks/entries/pages/{_layout.server.ts.js-Be39BJt8.js → _layout.server.ts.js-thMV7ofo.js} +2 -2
  222. package/build/server/chunks/entries/pages/{_page.server.ts.js-BP0lx7aM.js → _page.server.ts.js-IJJCfEOr.js} +2 -2
  223. package/build/server/chunks/entries/pages/decisions/{_page.server.ts.js-C_gST4Ql.js → _page.server.ts.js-BknW8CoP.js} +2 -2
  224. package/build/server/chunks/entries/pages/deck/{_page.server.ts.js-BmoQQEUP.js → _page.server.ts.js-FcsedjYb.js} +2 -2
  225. package/build/server/chunks/entries/pages/files/{_page.server.ts.js-CnW58Q1_.js → _page.server.ts.js-NxhxpluO.js} +2 -2
  226. package/build/server/chunks/entries/pages/harbour/{_page.server.ts.js-IwVthdWl.js → _page.server.ts.js-D0vCnVfw.js} +2 -2
  227. package/build/server/chunks/entries/pages/headroom/{_page.server.ts.js-BNwH-NUG.js → _page.server.ts.js-8pe9nMCl.js} +2 -2
  228. package/build/server/chunks/entries/pages/inbox/{_page.server.ts.js-Xn2rpOlN.js → _page.server.ts.js-D5ACh022.js} +2 -2
  229. package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/{_page.server.ts.js-D9oc4Zbv.js → _page.server.ts.js-BKpNXqUB.js} +2 -2
  230. package/build/server/chunks/entries/pages/projects/_id_/{_page.server.ts.js-B8XcaDI6.js → _page.server.ts.js-DKtUeDFH.js} +3 -3
  231. package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/{_page.server.ts.js-9PxhdtRJ.js → _page.server.ts.js-CAfpJ8z4.js} +3 -3
  232. package/build/server/chunks/entries/pages/projects/_id_/passage/{_page.server.ts.js-DRw5dO8q.js → _page.server.ts.js-DhvAOslS.js} +4 -4
  233. package/build/server/chunks/entries/pages/projects/_id_/passage/edit/{_page.server.ts.js-9h5x_BlZ.js → _page.server.ts.js-BbR8eGg8.js} +2 -2
  234. package/build/server/chunks/entries/pages/remotes/{_page.server.ts.js-DjYOr7fW.js → _page.server.ts.js-CFi9Cpz4.js} +2 -2
  235. package/build/server/chunks/entries/pages/settings/cloud/{_page.server.ts.js-DAG7EeWI.js → _page.server.ts.js-CGyBG4Yp.js} +2 -2
  236. package/build/server/chunks/entries/pages/settings/gateway/{_page.server.ts.js-CF7Pq68d.js → _page.server.ts.js-Bh0E2kwq.js} +2 -2
  237. package/build/server/chunks/entries/pages/settings/plugins/{_page.server.ts.js-BcUQwg4K.js → _page.server.ts.js-DcSZoBEC.js} +2 -2
  238. package/build/server/chunks/entries/pages/settings/plugins/_plugin_/{_page.server.ts.js-BRBNSxOW.js → _page.server.ts.js-v3Tp8x_0.js} +2 -2
  239. package/build/server/chunks/entries/pages/settings/setup/{_page.server.ts.js-CWdA2rpo.js → _page.server.ts.js-BnpgnteD.js} +2 -2
  240. package/build/server/chunks/entries/pages/settings/update/{_page.server.ts.js-Ddip-Rpl.js → _page.server.ts.js-DQfv8ZWG.js} +2 -2
  241. package/build/server/chunks/entries/pages/setup/{_page.server.ts.js-BeaxanMx.js → _page.server.ts.js-CvG2Lr9C.js} +3 -3
  242. package/build/server/chunks/entries/pages/tasks/_id_/{_page.server.ts.js-C_hg-0na.js → _page.server.ts.js-_ivyEUli.js} +3 -3
  243. package/build/server/chunks/entries/pages/tasks/_id_/doc/{_page.server.ts.js-DJFCXtwU.js → _page.server.ts.js-CSJ4X_eg.js} +2 -2
  244. package/build/server/chunks/entries/pages/time/{_page.server.ts.js-BPudgjHm.js → _page.server.ts.js-CUc80zxD.js} +2 -2
  245. package/build/server/chunks/{handler-BCGgzMNK.js → handler-CBnQILkF.js} +3 -3
  246. package/build/server/chunks/{index.js-D3B2sWMy.js → index.js-8K34DF7Q.js} +2 -2
  247. package/build/server/chunks/{manifest.js-wJn9bmrp.js → manifest.js-DqAt-2-E.js} +87 -87
  248. package/build/server/chunks/nodes/{0.js-zlZLRzvM.js → 0.js-B_9UrGRh.js} +8 -8
  249. package/build/server/chunks/nodes/{1.js--1gHO-TC.js → 1.js-DHSqapc6.js} +2 -2
  250. package/build/server/chunks/nodes/{10.js-R4llf3g7.js → 10.js-Cw8UPtK2.js} +2 -2
  251. package/build/server/chunks/nodes/{11.js-Nz-YFyz6.js → 11.js-BIyDysEr.js} +8 -8
  252. package/build/server/chunks/nodes/{12.js-BFoN1hdZ.js → 12.js-ClZNXjgF.js} +9 -9
  253. package/build/server/chunks/nodes/{13.js-C7uxCJSk.js → 13.js-B8qskPtO.js} +9 -9
  254. package/build/server/chunks/nodes/{14.js-KjfLhRwn.js → 14.js-DRbS2pR2.js} +10 -10
  255. package/build/server/chunks/nodes/{15.js-DbvBUigb.js → 15.js-EWY83mDS.js} +9 -9
  256. package/build/server/chunks/nodes/{16.js-C0p6-_Wc.js → 16.js-Cm0oYApC.js} +6 -6
  257. package/build/server/chunks/nodes/{17.js-OgyjPP8E.js → 17.js-Cu5a2UaQ.js} +2 -2
  258. package/build/server/chunks/nodes/{19.js-CjveYWJd.js → 19.js-B7TKyMV0.js} +6 -6
  259. package/build/server/chunks/nodes/{2.js-DBCmgKJ3.js → 2.js-DltTHZOL.js} +8 -8
  260. package/build/server/chunks/nodes/{20.js-BO7QgmVR.js → 20.js-CwLFSrxO.js} +8 -8
  261. package/build/server/chunks/nodes/{21.js-D1siyorn.js → 21.js-D_0U5UVP.js} +8 -8
  262. package/build/server/chunks/nodes/{22.js-BOJevTr3.js → 22.js-C2r9JmW7.js} +8 -8
  263. package/build/server/chunks/nodes/{23.js-By7E4CPh.js → 23.js-h4YwJvrO.js} +8 -8
  264. package/build/server/chunks/nodes/{24.js-CpltmZ68.js → 24.js-BciJ1KTf.js} +4 -4
  265. package/build/server/chunks/nodes/{25.js-lcZJHDCG.js → 25.js-ZCknzNaV.js} +8 -8
  266. package/build/server/chunks/nodes/{26.js-BeZ6lpoO.js → 26.js-BUolTInv.js} +9 -9
  267. package/build/server/chunks/nodes/{27.js-CLYqG4lL.js → 27.js-DcvlJkEN.js} +8 -8
  268. package/build/server/chunks/nodes/{28.js-CBfIHgUg.js → 28.js-DPp6-E4I.js} +8 -8
  269. package/build/server/chunks/nodes/{3.js-Bi0cxlWn.js → 3.js-CLE5bCBt.js} +8 -8
  270. package/build/server/chunks/nodes/{4.js-BzCAFdWl.js → 4.js-BXXDgWZn.js} +8 -8
  271. package/build/server/chunks/nodes/{5.js-CaYpi43a.js → 5.js-BtthxHsw.js} +7 -7
  272. package/build/server/chunks/nodes/{6.js-DiorXbJJ.js → 6.js-C3hPPfLf.js} +8 -8
  273. package/build/server/chunks/nodes/{7.js-CP1Kjbql.js → 7.js-v18x97qv.js} +8 -8
  274. package/build/server/chunks/nodes/{8.js-BuPd1Oz6.js → 8.js-Csojentz.js} +8 -8
  275. package/build/server/chunks/nodes/{9.js-Djv-sGNi.js → 9.js-3NVn9Z4u.js} +2 -2
  276. package/dist/cli.js +951 -81
  277. package/dist/wh-vault.js +1 -1
  278. package/package.json +1 -1
  279. package/skills/manage-wheelhouse/SKILL.md +1 -0
  280. package/skills/manage-wheelhouse/references/operations.md +48 -47
  281. package/build/client/_app/immutable/chunks/-PxedOl8.js.br +0 -0
  282. package/build/client/_app/immutable/chunks/-PxedOl8.js.gz +0 -0
  283. package/build/client/_app/immutable/chunks/8PhaMXz9.js.br +0 -0
  284. package/build/client/_app/immutable/chunks/8PhaMXz9.js.gz +0 -0
  285. package/build/client/_app/immutable/chunks/BP2Qtph5.js.br +0 -0
  286. package/build/client/_app/immutable/chunks/BP2Qtph5.js.gz +0 -0
  287. package/build/client/_app/immutable/chunks/BaV2UMay.js.br +0 -0
  288. package/build/client/_app/immutable/chunks/BaV2UMay.js.gz +0 -0
  289. package/build/client/_app/immutable/chunks/C237xJzy.js.br +0 -0
  290. package/build/client/_app/immutable/chunks/C237xJzy.js.gz +0 -0
  291. package/build/client/_app/immutable/chunks/CFyednqY.js.br +0 -3
  292. package/build/client/_app/immutable/chunks/CFyednqY.js.gz +0 -0
  293. package/build/client/_app/immutable/chunks/CI38zzdF.js.br +0 -0
  294. package/build/client/_app/immutable/chunks/CI38zzdF.js.gz +0 -0
  295. package/build/client/_app/immutable/chunks/CIDO3V-e.js.br +0 -0
  296. package/build/client/_app/immutable/chunks/CIDO3V-e.js.gz +0 -0
  297. package/build/client/_app/immutable/chunks/CLj8aQLL.js.br +0 -0
  298. package/build/client/_app/immutable/chunks/CXqiEZDa.js.br +0 -0
  299. package/build/client/_app/immutable/chunks/CXqiEZDa.js.gz +0 -0
  300. package/build/client/_app/immutable/chunks/CYD68e6V.js.br +0 -0
  301. package/build/client/_app/immutable/chunks/CYD68e6V.js.gz +0 -0
  302. package/build/client/_app/immutable/chunks/CejLiPvM.js.br +0 -0
  303. package/build/client/_app/immutable/chunks/CejLiPvM.js.gz +0 -0
  304. package/build/client/_app/immutable/chunks/CnNJ9y58.js.br +0 -0
  305. package/build/client/_app/immutable/chunks/CnNJ9y58.js.gz +0 -0
  306. package/build/client/_app/immutable/chunks/Cx2pfZgS.js.br +0 -0
  307. package/build/client/_app/immutable/chunks/Cx2pfZgS.js.gz +0 -0
  308. package/build/client/_app/immutable/chunks/DF5qBysY.js.br +0 -0
  309. package/build/client/_app/immutable/chunks/DF5qBysY.js.gz +0 -0
  310. package/build/client/_app/immutable/chunks/DKuj2J54.js.br +0 -0
  311. package/build/client/_app/immutable/chunks/DKuj2J54.js.gz +0 -0
  312. package/build/client/_app/immutable/chunks/DwipL_Cn.js.br +0 -0
  313. package/build/client/_app/immutable/chunks/DwipL_Cn.js.gz +0 -0
  314. package/build/client/_app/immutable/chunks/_wNDtuC3.js.br +0 -0
  315. package/build/client/_app/immutable/chunks/_wNDtuC3.js.gz +0 -0
  316. package/build/client/_app/immutable/chunks/eaKSEJEz.js.br +0 -0
  317. package/build/client/_app/immutable/chunks/eaKSEJEz.js.gz +0 -0
  318. package/build/client/_app/immutable/chunks/yB7gO-LO.js.br +0 -0
  319. package/build/client/_app/immutable/chunks/yB7gO-LO.js.gz +0 -0
  320. package/build/client/_app/immutable/entry/app.BOOXafZJ.js.br +0 -0
  321. package/build/client/_app/immutable/entry/app.BOOXafZJ.js.gz +0 -0
  322. package/build/client/_app/immutable/entry/start.C3VwH72E.js +0 -1
  323. package/build/client/_app/immutable/entry/start.C3VwH72E.js.br +0 -0
  324. package/build/client/_app/immutable/entry/start.C3VwH72E.js.gz +0 -0
  325. package/build/client/_app/immutable/nodes/0.py9DNAwX.js.br +0 -0
  326. package/build/client/_app/immutable/nodes/0.py9DNAwX.js.gz +0 -0
  327. package/build/client/_app/immutable/nodes/1.CLi5bKEj.js.br +0 -0
  328. package/build/client/_app/immutable/nodes/1.CLi5bKEj.js.gz +0 -0
  329. package/build/client/_app/immutable/nodes/10.yQfIVnsR.js.br +0 -0
  330. package/build/client/_app/immutable/nodes/10.yQfIVnsR.js.gz +0 -0
  331. package/build/client/_app/immutable/nodes/11.B0fQm_d5.js.br +0 -0
  332. package/build/client/_app/immutable/nodes/11.B0fQm_d5.js.gz +0 -0
  333. package/build/client/_app/immutable/nodes/12.DobuoNGx.js.br +0 -0
  334. package/build/client/_app/immutable/nodes/12.DobuoNGx.js.gz +0 -0
  335. package/build/client/_app/immutable/nodes/13.DrO72J_j.js.br +0 -0
  336. package/build/client/_app/immutable/nodes/13.DrO72J_j.js.gz +0 -0
  337. package/build/client/_app/immutable/nodes/14.B9bNPNMC.js.br +0 -0
  338. package/build/client/_app/immutable/nodes/14.B9bNPNMC.js.gz +0 -0
  339. package/build/client/_app/immutable/nodes/15.0P3R4toY.js.br +0 -0
  340. package/build/client/_app/immutable/nodes/16.BnUrhlYC.js.br +0 -0
  341. package/build/client/_app/immutable/nodes/16.BnUrhlYC.js.gz +0 -0
  342. package/build/client/_app/immutable/nodes/17.CHTdkvmi.js.br +0 -0
  343. package/build/client/_app/immutable/nodes/17.CHTdkvmi.js.gz +0 -0
  344. package/build/client/_app/immutable/nodes/19.BqId6Q50.js.br +0 -0
  345. package/build/client/_app/immutable/nodes/19.BqId6Q50.js.gz +0 -0
  346. package/build/client/_app/immutable/nodes/2.CEJmYaPJ.js.br +0 -0
  347. package/build/client/_app/immutable/nodes/2.CEJmYaPJ.js.gz +0 -0
  348. package/build/client/_app/immutable/nodes/20.CHH39Z2Z.js.br +0 -0
  349. package/build/client/_app/immutable/nodes/20.CHH39Z2Z.js.gz +0 -0
  350. package/build/client/_app/immutable/nodes/21.CbnS5dV1.js.br +0 -0
  351. package/build/client/_app/immutable/nodes/21.CbnS5dV1.js.gz +0 -0
  352. package/build/client/_app/immutable/nodes/22.malZaF0r.js.br +0 -0
  353. package/build/client/_app/immutable/nodes/22.malZaF0r.js.gz +0 -0
  354. package/build/client/_app/immutable/nodes/23.B-MnoGp_.js.br +0 -0
  355. package/build/client/_app/immutable/nodes/23.B-MnoGp_.js.gz +0 -0
  356. package/build/client/_app/immutable/nodes/24.D4YfUDkp.js.br +0 -0
  357. package/build/client/_app/immutable/nodes/24.D4YfUDkp.js.gz +0 -0
  358. package/build/client/_app/immutable/nodes/25.CGUyx5gm.js.br +0 -0
  359. package/build/client/_app/immutable/nodes/25.CGUyx5gm.js.gz +0 -0
  360. package/build/client/_app/immutable/nodes/26.CSoLyIuT.js.br +0 -0
  361. package/build/client/_app/immutable/nodes/26.CSoLyIuT.js.gz +0 -0
  362. package/build/client/_app/immutable/nodes/28.CnDXbxut.js.br +0 -0
  363. package/build/client/_app/immutable/nodes/28.CnDXbxut.js.gz +0 -0
  364. package/build/client/_app/immutable/nodes/3.7M8y-hh1.js.br +0 -0
  365. package/build/client/_app/immutable/nodes/3.7M8y-hh1.js.gz +0 -0
  366. package/build/client/_app/immutable/nodes/4.C-_GUkXF.js.br +0 -0
  367. package/build/client/_app/immutable/nodes/4.C-_GUkXF.js.gz +0 -0
  368. package/build/client/_app/immutable/nodes/6.BtFuhrhK.js.br +0 -0
  369. package/build/client/_app/immutable/nodes/6.BtFuhrhK.js.gz +0 -0
  370. package/build/client/_app/immutable/nodes/7.YcUXbAew.js.br +0 -0
  371. package/build/client/_app/immutable/nodes/7.YcUXbAew.js.gz +0 -0
  372. package/build/client/_app/immutable/nodes/8.DsZ8ckdf.js.br +0 -0
  373. package/build/client/_app/immutable/nodes/8.DsZ8ckdf.js.gz +0 -0
  374. package/build/client/_app/immutable/nodes/9.C_to2yZ7.js.br +0 -0
  375. package/build/client/_app/immutable/nodes/9.C_to2yZ7.js.gz +0 -0
@@ -1,12 +1,13 @@
1
1
  import { readFile, readdir, stat, open, realpath, mkdir, writeFile, rename, rm, access, constants, lstat, chmod, appendFile, mkdtemp } from 'node:fs/promises';
2
2
  import os, { homedir, tmpdir } from 'node:os';
3
3
  import path from 'node:path';
4
- import { v as version, d as defaultKeychain } from './keychain.js-B__X3k_t.js';
5
- import { readFileSync, existsSync, mkdirSync, writeFileSync, renameSync, openSync, closeSync, watch, statSync, fstatSync, readSync, accessSync, constants as constants$1, realpathSync, lstatSync, rmSync } from 'node:fs';
6
- import { spawn, execFileSync } from 'node:child_process';
4
+ import { v as version, d as defaultKeychain } from './keychain.js-CsTOqhf4.js';
5
+ import { readFileSync, existsSync, mkdirSync, writeFileSync, renameSync, openSync, closeSync, watch, statSync, fstatSync, readSync, accessSync, constants as constants$1, rmSync, realpathSync, lstatSync } from 'node:fs';
6
+ import { spawn, execFileSync, execFile } from 'node:child_process';
7
7
  import { l as loopbackPreview, f as frameRefusal } from './preview.js-CbgkVvT_.js';
8
8
  import { p as previewNoteOf, a as pageOf } from './previewnote.js-DB6VK2fp.js';
9
9
  import { p as plainStatus, c as clean } from './plain.js-Dc97sYaJ.js';
10
+ import { timingSafeEqual, randomBytes, randomUUID, createHash, createHmac } from 'node:crypto';
10
11
  import { B as BRIEF_MAX_BYTES, p as parseBrief } from './brief.js-TS-K0lZ6.js';
11
12
  import { d as defaultStateDir, i as isInside, s as storeFileFor, M as MessageStore, c as changeRoute, a as isChangeRequest, r as readyTimes, t as taskRuns, D as DECISIVE, C as CI_READY_NOTE, w as workerWindow } from './store.js-H2CHLL0k.js';
12
13
  import { parseDocument } from 'yaml';
@@ -15,14 +16,14 @@ import { s as shortTitle } from './format.js-D3lWEg6U.js';
15
16
  import { r as runStep, c as checksLine } from './checks.js-DGdGhp1G.js';
16
17
  import net, { createServer } from 'node:net';
17
18
  import { D as DECIDED_MAX, d as detectHosted, p as portInHost, h as hostedAddress } from './decisionform.js-Ds5LU9Wh.js';
18
- import { timingSafeEqual, randomBytes, randomUUID, createHash, createHmac } from 'node:crypto';
19
+ import { p as parseHarness, H as HARNESS_NAMES } from './harness.js-DPojOlFJ.js';
20
+ import { d as defaultConfigDir, P as PluginConfigFile, a as PLUGINS_FILE, R as ROLES, b as SLOT_SCOPE, i as isEnabled, E as EMPTY_CONFIG, S as SLOTS, C as CAPABILITIES, c as chooseRole, e as changePlugin } from './config.js-CjvhJWDv.js';
19
21
  import { T as TERMINAL_PATH, a as TERMINAL_PROTOCOL, b as TERMINAL_CLOSE, S as SETUP_TERMINAL_PATH, c as TOKEN_PROTOCOL_PREFIX } from './terminal.js-BUurgI6D.js';
20
22
  import WebSocket, { WebSocketServer } from 'ws';
21
23
  import { r as roundId, t as testLine } from './buildlog.js-BCKtSKOt.js';
22
24
  import { a as alertsFor, r as raise, s as sessionAlert, d as digest, A as ALERT_KINDS } from './bell.js-DuW71LLn.js';
23
25
  import { C as CHOICES, N as NOTE_MAX, b as closable, p as picksLine, d as closeText, e as answerText, D as DECIDED_LABEL, f as choiceLabel, g as awaitsAnswer, o as optionsFor, h as holdCardId, q as questionLine, a as answerOf } from './inbox.js-CnikIOgr.js';
24
26
  import { D as DOC_EXT$1 } from './docpath.js-D27w_pf9.js';
25
- import { d as defaultConfigDir, P as PluginConfigFile, a as PLUGINS_FILE, R as ROLES, b as SLOT_SCOPE, i as isEnabled, E as EMPTY_CONFIG, S as SLOTS, C as CAPABILITIES, c as chooseRole, e as changePlugin } from './config.js-CjvhJWDv.js';
26
27
  import { d as defaultPluginsDir, r as readInstalled, S as SUPPORTED_API_VERSIONS, s as settingViews, m as manifestPath, p as parseManifest, f as fromExport } from './settings2.js-8JjZvg3U.js';
27
28
  import { pathToFileURL } from 'node:url';
28
29
  import { l as localhostName, m as matchHost, a as loopbackAddresses, v as validHostTemplate } from './addresses.js-DmMJzvLK.js';
@@ -31,7 +32,6 @@ import { p as projectTabHref, a as parseSlotKey } from './keys.js-iHygUPeb.js';
31
32
  import { v as validPullRequestQuery } from './pullrequests.js-CCzk2sqm.js';
32
33
  import { createServer as createServer$1 } from 'node:http';
33
34
  import { n as needsYou } from './harbour.js-D3N7u1_p.js';
34
- import { p as parseHarness, H as HARNESS_NAMES } from './harness.js-DPojOlFJ.js';
35
35
  import { R as ROLE_WORDS } from './words.js-DDFrKS99.js';
36
36
  import './urls.js-CM6aklCF.js';
37
37
  import './previewhelper.js-D_I_aa96.js';
@@ -1108,9 +1108,11 @@ function toPeek(r, mate, lines) {
1108
1108
  const reason = r.error.kind === "missing-script" ? `This Firstmate has no ${r.error.script}, so Wheelhouse cannot look at it.` : `Could not read its terminal: ${r.error.message}`;
1109
1109
  return { ...off(reason, lines), capturedAt: r.observedAt };
1110
1110
  }
1111
- const DEFAULT_TMUX_SOCKET = "wheelhouse";
1111
+ const LEGACY_TMUX_SOCKET = "wheelhouse";
1112
1112
  const TMUX_SOCKET = /^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$/;
1113
1113
  const NO_SERVER = /no server running|error connecting to|no sessions/i;
1114
+ const serverArgs = (socket) => socket ? ["-L", socket] : [];
1115
+ const firstmateServers = (socket) => socket ? [socket] : [null, LEGACY_TMUX_SOCKET];
1114
1116
  function which(name2, envPath) {
1115
1117
  for (const dir of (envPath ?? "").split(path.delimiter)) {
1116
1118
  if (!dir) continue;
@@ -1141,6 +1143,25 @@ const DROPPED_VARIABLES = [
1141
1143
  "CODEX_INTERNAL_ORIGINATOR_OVERRIDE"
1142
1144
  ];
1143
1145
  const DROP = new Set(DROPPED_VARIABLES);
1146
+ const COMMAND_UNSET = [
1147
+ ...DROPPED_VARIABLES,
1148
+ "CLAUDE_CODE_CHILD_SESSION",
1149
+ "CLAUDE_CODE_SESSION_ID",
1150
+ "CLAUDE_CODE_SESSION_ATTENDED",
1151
+ "CLAUDE_CODE_EXECPATH",
1152
+ "CLAUDE_EFFORT"
1153
+ ];
1154
+ const COMMAND_UNSET_PREFIXES = ["CLAUDE_CODE_MESSAGING_"];
1155
+ function cleanCommand(shBinary, spec) {
1156
+ const unset = COMMAND_UNSET.filter((name2) => !(name2 in spec.env));
1157
+ const families = COMMAND_UNSET_PREFIXES.map((p) => `${p}*`).join("|");
1158
+ const script = [
1159
+ `unset ${unset.join(" ")}`,
1160
+ `for n in $(env | while IFS== read -r n _; do case "$n" in (*[!A-Za-z0-9_]*) ;; (${families}) echo "$n" ;; esac; done); do unset "$n"; done`,
1161
+ 'exec "$@"'
1162
+ ].join("\n");
1163
+ return [shBinary, "-c", script, "sh", ...spec.argv];
1164
+ }
1144
1165
  function sessionEnv(env) {
1145
1166
  const out = {};
1146
1167
  for (const [k, v] of Object.entries(env)) {
@@ -1175,7 +1196,28 @@ const TMUX_KEYS = {
1175
1196
  "8": "8",
1176
1197
  "9": "9"
1177
1198
  };
1178
- function launchArgv(spec) {
1199
+ const PANE_VARIABLES = [
1200
+ "TMUX",
1201
+ "TMUX_PANE",
1202
+ "TERM",
1203
+ "TERM_PROGRAM",
1204
+ "TERM_PROGRAM_VERSION",
1205
+ "COLORTERM"
1206
+ ];
1207
+ const SESSION_SCRIPT = [
1208
+ `for n in $(env | while IFS== read -r n _; do case "$n" in ('' | [0-9]* | *[!A-Za-z0-9_]* | ${PANE_VARIABLES.join(" | ")}) ;; (*) echo "$n" ;; esac; done); do unset "$n"; done`,
1209
+ '. "$1"',
1210
+ '/bin/rm -f "$1"',
1211
+ "shift",
1212
+ 'exec "$@"'
1213
+ ].join("\n");
1214
+ function envFileContent(env) {
1215
+ return Object.entries(env).filter(
1216
+ ([k, v]) => v !== void 0 && /^[A-Za-z_][A-Za-z0-9_]*$/.test(k) && !PANE_VARIABLES.includes(k)
1217
+ ).map(([k, v]) => `export ${k}='${v.replace(/'/g, `'\\''`)}'
1218
+ `).join("");
1219
+ }
1220
+ function launchArgv(spec, envPath) {
1179
1221
  return [
1180
1222
  "new-session",
1181
1223
  "-d",
@@ -1189,36 +1231,45 @@ function launchArgv(spec) {
1189
1231
  spec.cwd,
1190
1232
  ...Object.entries(spec.env).flatMap(([k, v]) => ["-e", `${k}=${v}`]),
1191
1233
  "--",
1234
+ "/bin/sh",
1235
+ "-c",
1236
+ SESSION_SCRIPT,
1237
+ "sh",
1238
+ envPath,
1192
1239
  ...spec.argv
1193
1240
  ];
1194
1241
  }
1195
- const attachHint = (socket) => shellLine(["tmux", "-L", socket, "attach", "-t", FIRSTMATE_TMUX]);
1242
+ const attachHint = (socket) => shellLine(["tmux", ...serverArgs(socket), "attach", "-t", FIRSTMATE_TMUX]);
1196
1243
  class TmuxBackend {
1197
1244
  label = "tmux";
1245
+ /** The configured socket, or null for the default server. */
1246
+ configured;
1247
+ /** The server the session is on: running() keeps it current. */
1198
1248
  socket;
1199
1249
  env;
1200
1250
  find;
1201
1251
  run;
1202
1252
  constructor(opts) {
1203
- this.socket = opts.socket || DEFAULT_TMUX_SOCKET;
1253
+ this.configured = opts.socket || null;
1254
+ this.socket = this.configured;
1204
1255
  this.env = opts.env;
1205
1256
  this.find = opts.find;
1206
1257
  this.run = opts.run ?? runBounded;
1207
1258
  }
1208
1259
  unavailable() {
1209
- if (!TMUX_SOCKET.test(this.socket)) {
1210
- return `The tmux socket name ${JSON.stringify(this.socket)} is not valid; use letters, digits, '.', '_' or '-'.`;
1260
+ if (this.configured !== null && !TMUX_SOCKET.test(this.configured)) {
1261
+ return `The tmux socket name ${JSON.stringify(this.configured)} is not valid; use letters, digits, '.', '_' or '-'.`;
1211
1262
  }
1212
1263
  if (!this.find("tmux")) {
1213
1264
  return "tmux is not installed or not on PATH. Install tmux (for example `brew install tmux`) and restart Wheelhouse.";
1214
1265
  }
1215
1266
  return null;
1216
1267
  }
1217
- /** Run tmux on Wheelhouse's own server only; nothing reaches tmux any other way. */
1218
- tmux(args, extra = {}) {
1268
+ /** Run tmux on the session's server only; nothing reaches tmux any other way. */
1269
+ tmux(args, extra = {}, socket = this.socket) {
1219
1270
  const tmux = this.find("tmux");
1220
1271
  if (!tmux) return Promise.reject(new Error("tmux is missing"));
1221
- return this.run(tmux, ["-L", this.socket, ...args], {
1272
+ return this.run(tmux, [...serverArgs(socket), ...args], {
1222
1273
  env: this.env,
1223
1274
  timeoutMs: TMUX_TIMEOUT_MS$1,
1224
1275
  maxOutputBytes: 256 * 1024,
@@ -1226,15 +1277,28 @@ class TmuxBackend {
1226
1277
  });
1227
1278
  }
1228
1279
  async running() {
1229
- if (!this.find("tmux") || !TMUX_SOCKET.test(this.socket)) return null;
1230
- const r = await this.tmux(["list-sessions", "-F", "#{session_name}"]);
1231
- if (r.ok) return r.stdout.split("\n").includes(FIRSTMATE_TMUX);
1232
- if (r.kind === "exit" && NO_SERVER.test(r.stderr)) return false;
1233
- return null;
1280
+ if (!this.find("tmux") || this.unavailable()) return null;
1281
+ for (const socket of firstmateServers(this.configured)) {
1282
+ const r = await this.tmux(["list-sessions", "-F", "#{session_name}"], {}, socket);
1283
+ if (r.ok && r.stdout.split("\n").includes(FIRSTMATE_TMUX)) {
1284
+ this.socket = socket;
1285
+ return true;
1286
+ }
1287
+ const absent = r.ok || r.kind === "exit" && NO_SERVER.test(r.stderr);
1288
+ if (!absent && socket === this.configured) return null;
1289
+ }
1290
+ this.socket = this.configured;
1291
+ return false;
1234
1292
  }
1235
1293
  async start(spec) {
1236
- const r = await this.tmux(launchArgv(spec), { cwd: spec.cwd });
1294
+ const envPath = path.join(tmpdir(), `wh-firstmate-env-${randomBytes(8).toString("hex")}`);
1295
+ writeFileSync(envPath, envFileContent({ ...this.env, ...spec.env }), {
1296
+ mode: 384,
1297
+ flag: "wx"
1298
+ });
1299
+ const r = await this.tmux(launchArgv(spec, envPath), { cwd: spec.cwd });
1237
1300
  if (!r.ok) {
1301
+ rmSync(envPath, { force: true });
1238
1302
  return {
1239
1303
  ok: false,
1240
1304
  error: `tmux could not start Firstmate: ${r.stderr.trim() || r.message}`
@@ -1246,7 +1310,7 @@ class TmuxBackend {
1246
1310
  return { ok: true };
1247
1311
  }
1248
1312
  async variable(name2) {
1249
- const r = await this.tmux(["show-environment", "-t", FIRSTMATE_TMUX, name2]);
1313
+ const r = await this.tmux(["show-environment", "-t", `=${FIRSTMATE_TMUX}:`, name2]);
1250
1314
  if (r.ok) return r.stdout.trim().replace(new RegExp(`^${name2}=`), "");
1251
1315
  return /unknown variable/.test(r.stderr) ? "" : null;
1252
1316
  }
@@ -1293,8 +1357,7 @@ class TmuxBackend {
1293
1357
  return {
1294
1358
  argv: [
1295
1359
  this.find("tmux"),
1296
- "-L",
1297
- this.socket,
1360
+ ...serverArgs(this.socket),
1298
1361
  "attach-session",
1299
1362
  "-t",
1300
1363
  `=${FIRSTMATE_TMUX}`
@@ -1307,21 +1370,24 @@ class TmuxBackend {
1307
1370
  }
1308
1371
  }
1309
1372
  function firstmateTmux(opts) {
1310
- const socket = opts.tmuxSocket || DEFAULT_TMUX_SOCKET;
1373
+ const socket = opts.tmuxSocket || null;
1311
1374
  const env = sessionEnv(opts.env ?? process.env);
1312
1375
  const find = opts.find ?? ((name2) => which(name2, env.PATH));
1313
1376
  const run = opts.run ?? runBounded;
1314
1377
  return async () => {
1315
1378
  const tmux = find("tmux");
1316
- if (!tmux || !TMUX_SOCKET.test(socket)) return null;
1317
- const r = await run(
1318
- tmux,
1319
- ["-L", socket, "display-message", "-p", "-t", `=${FIRSTMATE_TMUX}:`, TMUX_FORMAT],
1320
- { env, timeoutMs: TMUX_TIMEOUT_MS$1, maxOutputBytes: 64 * 1024 }
1321
- );
1322
- if (!r.ok) return null;
1323
- const value = r.stdout.trim().replace(/,\$(\d+)$/, ",$1");
1324
- return /^\/.*,\d+,\d+$/.test(value) ? value : null;
1379
+ if (!tmux || socket !== null && !TMUX_SOCKET.test(socket)) return null;
1380
+ for (const server of firstmateServers(socket)) {
1381
+ const r = await run(
1382
+ tmux,
1383
+ [...serverArgs(server), "display-message", "-p", "-t", `=${FIRSTMATE_TMUX}:`, TMUX_FORMAT],
1384
+ { env, timeoutMs: TMUX_TIMEOUT_MS$1, maxOutputBytes: 64 * 1024 }
1385
+ );
1386
+ if (!r.ok) continue;
1387
+ const value = r.stdout.trim().replace(/,\$(\d+)$/, ",$1");
1388
+ return /^\/.*,\d+,\d+$/.test(value) ? value : null;
1389
+ }
1390
+ return null;
1325
1391
  };
1326
1392
  }
1327
1393
  const CREW_FALLBACK = DEFAULT_SERVER;
@@ -1357,7 +1423,7 @@ function parseWindows(stdout) {
1357
1423
  const matches = (w, e) => w.session === e.session && w.names.includes(e.window);
1358
1424
  function crewTmux(opts) {
1359
1425
  const state = path.join(opts.homeDir, "state");
1360
- const socket = opts.tmuxSocket || DEFAULT_TMUX_SOCKET;
1426
+ const socket = opts.tmuxSocket || null;
1361
1427
  const own = opts.env ?? process.env;
1362
1428
  const env = sessionEnv(own);
1363
1429
  const find = opts.find ?? ((name2) => which(name2, env.PATH));
@@ -1392,9 +1458,8 @@ function crewTmux(opts) {
1392
1458
  return out.length ? out : null;
1393
1459
  }
1394
1460
  function servers() {
1395
- const list2 = [];
1396
- if (TMUX_SOCKET.test(socket)) list2.push(["-L", socket]);
1397
- list2.push([]);
1461
+ const list2 = firstmateServers(socket).filter((s) => s === null || TMUX_SOCKET.test(s)).map(serverArgs);
1462
+ if (socket) list2.push([]);
1398
1463
  const inherited = own.TMUX?.replace(/,[^,]*,[^,]*$/, "");
1399
1464
  if (inherited?.startsWith("/")) list2.push(["-S", inherited]);
1400
1465
  return list2;
@@ -3500,24 +3565,24 @@ function deriveLiveTask(task2, ctx, fmRoot) {
3500
3565
  shots: signals?.shots ?? []
3501
3566
  };
3502
3567
  }
3503
- function deriveBacklogTask(record, ctx, orphan) {
3504
- const ledger = ctx.ledger.get(record.id) ?? null;
3505
- const track = trackOf(record.kind ?? ledger?.dispatched?.kind ?? null);
3506
- const prUrl = record.prUrl ?? ledger?.merged?.pr ?? ledger?.prReady?.pr ?? null;
3568
+ function deriveBacklogTask(record2, ctx, orphan) {
3569
+ const ledger = ctx.ledger.get(record2.id) ?? null;
3570
+ const track = trackOf(record2.kind ?? ledger?.dispatched?.kind ?? null);
3571
+ const prUrl = record2.prUrl ?? ledger?.merged?.pr ?? ledger?.prReady?.pr ?? null;
3507
3572
  let status2;
3508
3573
  let summary2 = null;
3509
3574
  let attention = null;
3510
- if (record.state === "done" || track === "ship" && ledger?.merged) {
3575
+ if (record2.state === "done" || track === "ship" && ledger?.merged) {
3511
3576
  status2 = "landed";
3512
- const verb = record.completion.verb || (record.state === "done" ? "done" : "merged");
3513
- const when = ledger?.merged ? ageText(Math.max(0, ctx.nowSeconds - ledger.merged.ts)) : record.completion.date ? `on ${record.completion.date}` : null;
3577
+ const verb = record2.completion.verb || (record2.state === "done" ? "done" : "merged");
3578
+ const when = ledger?.merged ? ageText(Math.max(0, ctx.nowSeconds - ledger.merged.ts)) : record2.completion.date ? `on ${record2.completion.date}` : null;
3514
3579
  summary2 = when ? `${verb[0].toUpperCase()}${verb.slice(1)} ${when}.` : null;
3515
- } else if (record.captainActionable) {
3580
+ } else if (record2.captainActionable) {
3516
3581
  status2 = "needs-decision";
3517
3582
  attention = {
3518
3583
  kind: "decision",
3519
3584
  owner: "captain",
3520
- text: record.holdReason ?? "Firstmate is holding this for you.",
3585
+ text: record2.holdReason ?? "Firstmate is holding this for you.",
3521
3586
  url: null
3522
3587
  };
3523
3588
  summary2 = attention.text;
@@ -3526,12 +3591,12 @@ function deriveBacklogTask(record, ctx, orphan) {
3526
3591
  summary2 = "Firstmate lists this as in flight, but has no worker record for it.";
3527
3592
  } else {
3528
3593
  status2 = "queued";
3529
- summary2 = record.unresolvedBlockerIds.length ? `Waiting on ${record.unresolvedBlockerIds.join(", ")}.` : "Not started yet.";
3594
+ summary2 = record2.unresolvedBlockerIds.length ? `Waiting on ${record2.unresolvedBlockerIds.join(", ")}.` : "Not started yet.";
3530
3595
  }
3531
- const projectId = record.repo ?? ledger?.dispatched?.project ?? UNASSIGNED;
3596
+ const projectId = record2.repo ?? ledger?.dispatched?.project ?? UNASSIGNED;
3532
3597
  const passage = (ctx.stagesFor ?? stagesFor)(projectId).passage({
3533
3598
  track,
3534
- backlogState: record.state,
3599
+ backlogState: record2.state,
3535
3600
  live: false,
3536
3601
  crewState: null,
3537
3602
  crewSource: null,
@@ -3539,20 +3604,20 @@ function deriveBacklogTask(record, ctx, orphan) {
3539
3604
  yolo: null,
3540
3605
  prUrl,
3541
3606
  prReady: false,
3542
- merged: record.state === "done" || ledger?.merged !== null && ledger?.merged !== void 0,
3607
+ merged: record2.state === "done" || ledger?.merged !== null && ledger?.merged !== void 0,
3543
3608
  reportPresent: false,
3544
- captainHold: record.captainActionable,
3545
- taskId: record.id,
3546
- landedAt: landedAt(ledger, record.state === "done" ? record.completion.date : null),
3609
+ captainHold: record2.captainActionable,
3610
+ taskId: record2.id,
3611
+ landedAt: landedAt(ledger, record2.state === "done" ? record2.completion.date : null),
3547
3612
  preview: previewFact(ledger)
3548
3613
  });
3549
- const title = record.title ?? record.id;
3614
+ const title = record2.title ?? record2.id;
3550
3615
  return {
3551
- id: record.id,
3616
+ id: record2.id,
3552
3617
  title,
3553
3618
  shortTitle: shortTitle(title, projectId),
3554
3619
  projectId,
3555
- kind: record.kind,
3620
+ kind: record2.kind,
3556
3621
  track,
3557
3622
  status: status2,
3558
3623
  statusLabel: STATUS_LABEL[status2],
@@ -3560,10 +3625,10 @@ function deriveBacklogTask(record, ctx, orphan) {
3560
3625
  runs: track === "ship" && prUrl ? taskRuns({
3561
3626
  prUrl,
3562
3627
  ledger,
3563
- feedback: ctx.review?.get(record.id)?.feedback ?? null,
3628
+ feedback: ctx.review?.get(record2.id)?.feedback ?? null,
3564
3629
  sent: ctx.sent ?? [],
3565
- taskId: record.id,
3566
- merged: record.state === "done" || !!ledger?.merged
3630
+ taskId: record2.id,
3631
+ merged: record2.state === "done" || !!ledger?.merged
3567
3632
  }) : null,
3568
3633
  summary: summary2,
3569
3634
  summaryIsHistory: false,
@@ -3578,32 +3643,32 @@ function deriveBacklogTask(record, ctx, orphan) {
3578
3643
  attention,
3579
3644
  current: null,
3580
3645
  pr: prUrl ? { url: prUrl, number: prNumber(prUrl) } : null,
3581
- since: record.since,
3582
- completedOn: record.state === "done" ? record.completion.date : null,
3646
+ since: record2.since,
3647
+ completedOn: record2.state === "done" ? record2.completion.date : null,
3583
3648
  mergedAt: ledger?.merged ? isoSeconds(ledger.merged.ts) : null,
3584
3649
  preview: preview(ledger),
3585
3650
  board: board(ledger),
3586
- blockedBy: record.unresolvedBlockerIds,
3651
+ blockedBy: record2.unresolvedBlockerIds,
3587
3652
  hasReport: false,
3588
3653
  outputAvailable: false,
3589
- outputNote: record.state === "done" ? "This task has landed; its worker is gone." : "No worker is running for this task.",
3590
- thumb: ctx.thumbs.get(record.id) ?? { kind: "none" },
3591
- screenshots: ctx.review?.get(record.id)?.screenshots ?? 0,
3592
- shots: ctx.review?.get(record.id)?.shots ?? []
3654
+ outputNote: record2.state === "done" ? "This task has landed; its worker is gone." : "No worker is running for this task.",
3655
+ thumb: ctx.thumbs.get(record2.id) ?? { kind: "none" },
3656
+ screenshots: ctx.review?.get(record2.id)?.screenshots ?? 0,
3657
+ shots: ctx.review?.get(record2.id)?.shots ?? []
3593
3658
  };
3594
3659
  }
3595
3660
  function backlogOnly(snapshot) {
3596
3661
  const live = new Set(snapshot.tasks.map((t) => t.id));
3597
3662
  const orphans = new Set(snapshot.orphanInFlight);
3598
- return snapshot.backlog.records.filter((r) => !live.has(r.id) && r.kind !== "secondmate").filter((r) => r.state === "queued" || r.state === "done" || orphans.has(r.id)).map((record) => ({ record, orphan: orphans.has(record.id) }));
3663
+ return snapshot.backlog.records.filter((r) => !live.has(r.id) && r.kind !== "secondmate").filter((r) => r.state === "queued" || r.state === "done" || orphans.has(r.id)).map((record2) => ({ record: record2, orphan: orphans.has(record2.id) }));
3599
3664
  }
3600
3665
  const isSecondMateRow = (t) => t.kind === "secondmate";
3601
3666
  function deriveTasks(snapshot, ctx) {
3602
3667
  const fmRoot = snapshot.roots.fmRoot;
3603
3668
  const rows = snapshot.tasks.filter((t) => !isSecondMateRow(t));
3604
3669
  const tasks = rows.map((t) => deriveLiveTask(t, ctx, fmRoot));
3605
- for (const { record, orphan } of backlogOnly(snapshot)) {
3606
- tasks.push(deriveBacklogTask(record, ctx, orphan));
3670
+ for (const { record: record2, orphan } of backlogOnly(snapshot)) {
3671
+ tasks.push(deriveBacklogTask(record2, ctx, orphan));
3607
3672
  }
3608
3673
  const paths = /* @__PURE__ */ new Map();
3609
3674
  for (const t of rows) {
@@ -4106,8 +4171,8 @@ class EvidenceReader {
4106
4171
  });
4107
4172
  }
4108
4173
  return this.prs.get(`${id} ${url}`, async () => {
4109
- const cached = await this.contributions(id, url);
4110
- if (cached) return cached;
4174
+ const cached2 = await this.contributions(id, url);
4175
+ if (cached2) return cached2;
4111
4176
  if (!this.useGh) {
4112
4177
  return { available: false, reason: "No cached PR observation from Firstmate." };
4113
4178
  }
@@ -5862,11 +5927,17 @@ function writeRemembered(configDir, r) {
5862
5927
  `, { mode: 420 });
5863
5928
  renameSync(tmp, file);
5864
5929
  }
5865
- const NAME = "manage-wheelhouse";
5866
- const RECEIPT = ".wheelhouse-managed.json";
5867
- const FILES = ["SKILL.md", "references/operations.md"];
5868
- const hash = (text2) => createHash("sha256").update(text2).digest("hex");
5869
5930
  const REVIEW_SURFACE_MARKER = "<!-- wheelhouse:review-surface -->";
5931
+ const SKILLS = [
5932
+ {
5933
+ name: "manage-wheelhouse",
5934
+ files: ["SKILL.md", "references/operations.md"],
5935
+ assumptions: [
5936
+ { file: "bin/fm-inbox.sh", marker: "fm-inbox.sh reply" },
5937
+ { file: "bin/fm-inbox.sh", marker: "fm-inbox.sh receipts" }
5938
+ ]
5939
+ }
5940
+ ];
5870
5941
  const plain = (s) => s.replace(/[^\p{L}\p{N} ._()-]+/gu, " ").replace(/\s+/g, " ").trim().slice(0, 60) || "the plugin";
5871
5942
  function reviewSurfaceSection(surface) {
5872
5943
  if (!surface) {
@@ -5887,7 +5958,29 @@ function reviewSurfaceSection(surface) {
5887
5958
  `- Wheelhouse rewrites this section whenever the role changes: the captain chooses another plugin or the built-in, or turns ${name2} off or removes it.`
5888
5959
  ].join("\n");
5889
5960
  }
5890
- const renderSkill = (text2, surface) => text2.replace(REVIEW_SURFACE_MARKER, () => reviewSurfaceSection(surface));
5961
+ async function renderSkill(skillsRoot, skill, inputs) {
5962
+ const tree = {};
5963
+ for (const file of skill.files) {
5964
+ const text2 = await readFile(path.join(skillsRoot, skill.name, file), "utf8");
5965
+ tree[file] = file === "SKILL.md" ? text2.replace(REVIEW_SURFACE_MARKER, () => reviewSurfaceSection(inputs.reviewSurface)) : text2;
5966
+ }
5967
+ return tree;
5968
+ }
5969
+ const sha256 = (text2) => createHash("sha256").update(text2).digest("hex");
5970
+ const hashTree = (tree) => Object.fromEntries(Object.entries(tree).map(([file, text2]) => [file, sha256(text2)]));
5971
+ function sameHashes(a, b) {
5972
+ const keys = Object.keys(a);
5973
+ return keys.length === Object.keys(b).length && keys.every((k) => b[k] === a[k]);
5974
+ }
5975
+ async function present(file) {
5976
+ try {
5977
+ await lstat(file);
5978
+ return true;
5979
+ } catch (e) {
5980
+ if (e.code === "ENOENT") return false;
5981
+ throw e;
5982
+ }
5983
+ }
5891
5984
  async function physical(file) {
5892
5985
  try {
5893
5986
  return await realpath(file);
@@ -5898,161 +5991,436 @@ async function physical(file) {
5898
5991
  return path.join(await physical(parent), path.basename(file));
5899
5992
  }
5900
5993
  }
5901
- async function present(file) {
5902
- try {
5903
- await lstat(file);
5904
- return true;
5905
- } catch (e) {
5906
- if (e.code === "ENOENT") return false;
5907
- throw e;
5994
+ async function insideAny(targets, protectedDirs) {
5995
+ const real2 = await Promise.all(targets.map(physical));
5996
+ for (const dir of protectedDirs) {
5997
+ const p = await physical(path.resolve(dir));
5998
+ if (real2.some((t) => t === p || t.startsWith(p + path.sep))) return true;
5908
5999
  }
6000
+ return false;
5909
6001
  }
5910
- async function contents(dir, prefix = "") {
5911
- const result2 = {};
6002
+ async function readTree(dir, prefix = "") {
6003
+ const tree = {};
5912
6004
  for (const entry of await readdir(dir, { withFileTypes: true })) {
5913
6005
  const rel = prefix + entry.name;
5914
6006
  if (entry.isDirectory())
5915
- Object.assign(result2, await contents(path.join(dir, entry.name), rel + "/"));
5916
- else if (entry.isFile()) result2[rel] = hash(await readFile(path.join(dir, entry.name), "utf8"));
5917
- else throw new Error("The skill contains a symbolic link or special file.");
5918
- }
5919
- return result2;
6007
+ Object.assign(tree, await readTree(path.join(dir, entry.name), rel + "/"));
6008
+ else if (entry.isFile()) tree[rel] = await readFile(path.join(dir, entry.name), "utf8");
6009
+ else throw new Error(`${rel} is a symbolic link or special file.`);
6010
+ }
6011
+ return tree;
6012
+ }
6013
+ async function writeTree(dir, tree) {
6014
+ for (const [file, text2] of Object.entries(tree)) {
6015
+ await mkdir(path.dirname(path.join(dir, file)), { recursive: true });
6016
+ await writeFile(path.join(dir, file), text2);
6017
+ }
6018
+ }
6019
+ async function replaceTree(dir, tree) {
6020
+ const stage2 = `${dir}.new-${process.pid}-${Date.now()}`;
6021
+ await rm(stage2, { recursive: true, force: true });
6022
+ await writeTree(stage2, tree);
6023
+ await mkdir(stage2, { recursive: true });
6024
+ await rm(dir, { recursive: true, force: true });
6025
+ await rename(stage2, dir);
6026
+ }
6027
+ async function writeAtomic$1(file, text2, mode = 384) {
6028
+ await mkdir(path.dirname(file), { recursive: true });
6029
+ const tmp = `${file}.${process.pid}-${Date.now()}.tmp`;
6030
+ await writeFile(tmp, text2, { mode });
6031
+ await rename(tmp, file);
6032
+ }
6033
+ const MANIFEST_SCHEMA = "wheelhouse-material.v1";
6034
+ const materialDir = (configDir) => path.join(configDir, "agent-material");
6035
+ const manifestFile = (dir) => path.join(dir, "manifest.json");
6036
+ const settingsFile = (dir) => path.join(dir, "settings.json");
6037
+ const folder = (id) => id.replace(/[^A-Za-z0-9@._-]/g, "_");
6038
+ const baseDir = (dir, id) => path.join(dir, "base", folder(id));
6039
+ const proposedDir = (dir, id) => path.join(dir, "proposed", folder(id));
6040
+ function emptyManifest(version2, harness) {
6041
+ return {
6042
+ schema: MANIFEST_SCHEMA,
6043
+ wheelhouse: { version: version2 },
6044
+ firstmate: null,
6045
+ render: { reviewSurface: null, harness },
6046
+ items: {},
6047
+ history: []
6048
+ };
6049
+ }
6050
+ function valid(m) {
6051
+ const x = m;
6052
+ return !!x && x.schema === MANIFEST_SCHEMA && typeof x.items === "object" && x.items !== null && Array.isArray(x.history) && typeof x.render === "object" && x.render !== null;
5920
6053
  }
5921
- async function inspect(target, hashes) {
5922
- if (!await present(target)) return "absent";
6054
+ async function readManifest(dir, look = false) {
6055
+ const file = manifestFile(dir);
6056
+ let text2;
5923
6057
  try {
5924
- if (!(await lstat(target)).isDirectory()) return "foreign";
5925
- const receipt = JSON.parse(await readFile(path.join(target, RECEIPT), "utf8"));
5926
- const actual = await contents(target);
5927
- delete actual[RECEIPT];
5928
- const unchanged = receipt.schema === "wheelhouse-skill.v1" && receipt.files && Object.keys(actual).length === Object.keys(receipt.files).length && Object.entries(actual).every(([file, digest2]) => receipt.files[file] === digest2);
5929
- if (!unchanged) return "foreign";
5930
- return receipt.version === version && Object.keys(actual).length === Object.keys(hashes).length && Object.entries(hashes).every(([file, digest2]) => actual[file] === digest2) ? "current" : "managed";
6058
+ text2 = await readFile(file, "utf8");
6059
+ } catch (e) {
6060
+ if (e.code === "ENOENT") return null;
6061
+ throw e;
6062
+ }
6063
+ try {
6064
+ const m = JSON.parse(text2);
6065
+ if (valid(m)) return m;
5931
6066
  } catch {
5932
- return await present(target) ? "foreign" : "absent";
5933
6067
  }
6068
+ if (!look) await rename(file, `${file}.invalid-${Date.now()}`);
6069
+ return null;
5934
6070
  }
5935
- async function installWheelhouseSkill(install, env, sourceDir = env.WHEELHOUSE_INSTALL_DIR ? path.join(env.WHEELHOUSE_INSTALL_DIR, "skills", NAME) : void 0, surface = null) {
5936
- if (env.WHEELHOUSE_MANAGE_SKILL === "0")
5937
- return { state: "disabled", message: "Wheelhouse skill installation is disabled." };
5938
- if (!sourceDir)
5939
- return {
5940
- state: "disabled",
5941
- message: "Wheelhouse skill is left as it is: only the packaged Wheelhouse server installs it."
5942
- };
5943
- const parent = path.resolve(
5944
- env.CLAUDE_CONFIG_DIR || path.join(env.HOME || homedir(), ".claude"),
5945
- "skills"
5946
- );
5947
- const target = path.join(parent, NAME);
5948
- const current = {
5949
- state: "current",
5950
- message: `Wheelhouse skill is current at ${target}.`
5951
- };
5952
- let stage2 = null;
6071
+ async function writeManifest(dir, m) {
6072
+ m.history = m.history.slice(-50);
6073
+ await writeAtomic$1(manifestFile(dir), JSON.stringify(m, null, 2) + "\n");
6074
+ }
6075
+ const saveBase = (dir, id, tree) => replaceTree(baseDir(dir, id), tree);
6076
+ async function saveProposed(dir, id, tree) {
6077
+ if (tree) await replaceTree(proposedDir(dir, id), tree);
6078
+ else await rm(proposedDir(dir, id), { recursive: true, force: true });
6079
+ }
6080
+ async function readOff(dir) {
5953
6081
  try {
5954
- const destinations = [await physical(parent), await physical(target)];
5955
- for (const dir of [install.firstmateDir, install.homeDir]) {
5956
- const protectedDir = await physical(path.resolve(dir));
5957
- if (destinations.some(
5958
- (destination) => destination === protectedDir || destination.startsWith(protectedDir + path.sep)
5959
- ))
5960
- return {
5961
- state: "skipped",
5962
- message: `Left ${target} unchanged: user skills location is inside Firstmate's checkout or home.`
5963
- };
5964
- }
5965
- await mkdir(parent, { recursive: true });
5966
- const files = Object.fromEntries(
5967
- await Promise.all(
5968
- FILES.map(async (file) => {
5969
- const text2 = await readFile(path.join(sourceDir, file), "utf8");
5970
- return [file, file === "SKILL.md" ? renderSkill(text2, surface) : text2];
5971
- })
5972
- )
5973
- );
5974
- const hashes = Object.fromEntries(
5975
- Object.entries(files).map(([file, text2]) => [file, hash(text2)])
5976
- );
5977
- const found = await inspect(target, hashes);
5978
- if (found === "current") return current;
5979
- if (found === "foreign")
5980
- return {
5981
- state: "skipped",
5982
- message: `Left ${target} unchanged: locally edited or not managed by Wheelhouse. Move it aside to install the bundled skill.`
5983
- };
5984
- let now = found;
5985
- const exists2 = found === "managed";
5986
- stage2 = await mkdtemp(path.join(parent, ".wheelhouse-skill-"));
5987
- for (const [file, text2] of Object.entries(files)) {
5988
- await mkdir(path.dirname(path.join(stage2, file)), { recursive: true });
5989
- await writeFile(path.join(stage2, file), text2);
5990
- }
5991
- await writeFile(
5992
- path.join(stage2, RECEIPT),
5993
- JSON.stringify({ schema: "wheelhouse-skill.v1", version, files: hashes }) + "\n"
6082
+ const s = JSON.parse(await readFile(settingsFile(dir), "utf8"));
6083
+ return new Set(
6084
+ Object.entries(s.items ?? {}).filter(([, on]) => on === false).map(([id]) => id)
5994
6085
  );
6086
+ } catch {
6087
+ return /* @__PURE__ */ new Set();
6088
+ }
6089
+ }
6090
+ const chains = /* @__PURE__ */ new Map();
6091
+ function serialize(dir, work) {
6092
+ const prev = chains.get(dir) ?? Promise.resolve();
6093
+ const run = prev.then(work, work);
6094
+ const settled2 = run.catch(() => {
6095
+ });
6096
+ chains.set(dir, settled2);
6097
+ void settled2.then(() => {
6098
+ if (chains.get(dir) === settled2) chains.delete(dir);
6099
+ });
6100
+ return run;
6101
+ }
6102
+ const RECEIPT = ".wheelhouse-managed.json";
6103
+ const RECEIPT_SCHEMA = "wheelhouse-skill.v1";
6104
+ function receiptHashes(text2) {
6105
+ try {
6106
+ const r = JSON.parse(text2);
6107
+ if (r.schema !== RECEIPT_SCHEMA || !r.files || typeof r.files !== "object") return null;
6108
+ const files = Object.entries(r.files);
6109
+ return files.every(([, v]) => typeof v === "string") ? r.files : null;
6110
+ } catch {
6111
+ return null;
6112
+ }
6113
+ }
6114
+ async function readLocal(target) {
6115
+ try {
6116
+ if (!await present(target)) return { kind: "absent" };
6117
+ if (!(await lstat(target)).isDirectory())
6118
+ return { kind: "unreadable", reason: "it is a symbolic link or not a folder" };
6119
+ const tree = await readTree(target);
6120
+ const receipt = RECEIPT in tree ? receiptHashes(tree[RECEIPT]) : null;
6121
+ delete tree[RECEIPT];
6122
+ return { kind: "files", tree, receipt };
6123
+ } catch (e) {
6124
+ if (!await present(target).catch(() => true)) return { kind: "absent" };
6125
+ return { kind: "unreadable", reason: e.message };
6126
+ }
6127
+ }
6128
+ const receiptText = (version2, hashes) => JSON.stringify({ schema: RECEIPT_SCHEMA, version: version2, files: hashes }) + "\n";
6129
+ async function swapIn(target, tree, receipt, check2) {
6130
+ const parent = path.dirname(target);
6131
+ await mkdir(parent, { recursive: true });
6132
+ const stage2 = await mkdtemp(path.join(parent, ".wheelhouse-skill-"));
6133
+ let placed = false;
6134
+ try {
6135
+ await writeTree(stage2, tree);
6136
+ await writeFile(path.join(stage2, RECEIPT), receipt);
5995
6137
  const backup = stage2 + "-previous";
5996
6138
  for (let attempt2 = 1; ; attempt2++) {
5997
- let error = new Error("another copy appeared while installing");
5998
- if (now !== "foreign")
5999
- try {
6000
- if (now === "managed") await rename(target, backup);
6001
- await rename(stage2, target);
6002
- break;
6003
- } catch (e) {
6004
- error = e;
6005
- await rename(backup, target).catch(() => {
6006
- });
6007
- } finally {
6008
- await rm(backup, { recursive: true, force: true });
6009
- }
6010
- now = await inspect(target, hashes);
6011
- if (now === "current") return current;
6012
- if (attempt2 === 20) throw error;
6139
+ const now = await readLocal(target);
6140
+ const verdict = check2(now);
6141
+ if (verdict !== "replace") return verdict;
6142
+ try {
6143
+ if (now.kind !== "absent") await rename(target, backup);
6144
+ await rename(stage2, target);
6145
+ placed = true;
6146
+ return "swapped";
6147
+ } catch (e) {
6148
+ await rename(backup, target).catch(() => {
6149
+ });
6150
+ if (attempt2 === 20) throw e;
6151
+ } finally {
6152
+ await rm(backup, { recursive: true, force: true });
6153
+ }
6013
6154
  await new Promise((resolve) => setTimeout(resolve, 10 * attempt2));
6014
6155
  }
6015
- stage2 = null;
6016
- return {
6017
- state: exists2 ? "updated" : "installed",
6018
- message: `Wheelhouse skill ${exists2 ? "updated" : "installed"} at ${target}.`
6019
- };
6020
- } catch (e) {
6021
- return {
6022
- state: "error",
6023
- message: `Could not install Wheelhouse skill at ${target}: ${e.message}`
6024
- };
6025
6156
  } finally {
6026
- if (stage2) await rm(stage2, { recursive: true, force: true });
6157
+ if (!placed) await rm(stage2, { recursive: true, force: true });
6158
+ }
6159
+ }
6160
+ function skillRootDir(root, env) {
6161
+ const home = env.HOME || homedir();
6162
+ return root === "claude" ? path.resolve(env.CLAUDE_CONFIG_DIR || path.join(home, ".claude"), "skills") : path.resolve(home, ".agents", "skills");
6163
+ }
6164
+ const rootsFor = (harness) => harness === "claude" ? ["claude"] : ["claude", "agents"];
6165
+ const skillId = (name2, root) => `skill:${name2}@${root}`;
6166
+ function plannedSkills(env, harness) {
6167
+ return SKILLS.flatMap(
6168
+ (skill) => rootsFor(harness).map((root) => ({
6169
+ id: skillId(skill.name, root),
6170
+ skill,
6171
+ target: path.join(skillRootDir(root, env), skill.name)
6172
+ }))
6173
+ );
6174
+ }
6175
+ function decide(o) {
6176
+ if (o.local === "unreadable") return "foreign";
6177
+ if (o.local === null) return "install";
6178
+ if (!o.bases.length) return "foreign";
6179
+ const local = o.local;
6180
+ if (sameHashes(local, o.next)) return "current";
6181
+ if (o.kept && sameHashes(local, o.kept.local) && sameHashes(o.next, o.kept.next)) return "kept";
6182
+ return o.bases.some((b) => sameHashes(local, b)) ? "update" : "modified";
6183
+ }
6184
+ const AS_STATE = {
6185
+ install: "installed",
6186
+ update: "updated",
6187
+ current: "current",
6188
+ kept: "kept",
6189
+ modified: "modified",
6190
+ foreign: "foreign"
6191
+ };
6192
+ const localHashes = (l) => l.kind === "absent" ? null : l.kind === "unreadable" ? "unreadable" : hashTree(l.tree);
6193
+ function message$3(state, id, target, detail) {
6194
+ switch (state) {
6195
+ case "installed":
6196
+ return `Wheelhouse skill installed at ${target}.`;
6197
+ case "updated":
6198
+ return `Wheelhouse skill updated at ${target}.`;
6199
+ case "current":
6200
+ return `Wheelhouse skill is current at ${target}.`;
6201
+ case "kept":
6202
+ return `Wheelhouse skill at ${target} keeps its local edits, as asked.`;
6203
+ case "modified":
6204
+ return `Left ${target} unchanged: it was locally edited${detail ? ` (${detail})` : ""}. \`wheelhouse skills diff ${id}\` compares it with this version; \`accept\` or \`keep\` settles it.`;
6205
+ case "foreign":
6206
+ return `Left ${target} unchanged: not managed by Wheelhouse${detail ? ` (${detail})` : ""}. \`wheelhouse skills adopt ${id}\` replaces it with the bundled version.`;
6207
+ case "refused":
6208
+ return `Left ${target} unchanged: ${detail ?? "it is inside Firstmate's checkout or home"}.`;
6209
+ case "off":
6210
+ return `${id} is turned off; \`wheelhouse skills sync ${id}\` turns it on again.`;
6211
+ case "error":
6212
+ return `Could not install Wheelhouse skill at ${target}: ${detail}`;
6213
+ }
6214
+ }
6215
+ function record(m, id, kind, target, bundle, version2, files, now) {
6216
+ m.items[id] = { id, kind, target, bundle, version: version2, files, writtenAt: now.toISOString() };
6217
+ }
6218
+ async function syncSkill(ctx, dir, m, item, tree, dryRun) {
6219
+ const { id, target } = item;
6220
+ const result2 = (state, detail) => ({
6221
+ id,
6222
+ kind: "skill-dir",
6223
+ target,
6224
+ state,
6225
+ message: message$3(state, id, target, detail)
6226
+ });
6227
+ if (await insideAny([path.dirname(target), target], [ctx.install.firstmateDir, ctx.install.homeDir]))
6228
+ return result2("refused", "user skills location is inside Firstmate's checkout or home");
6229
+ const next = hashTree(tree);
6230
+ const rec = m.items[id];
6231
+ const verdict = (l) => decide({
6232
+ local: localHashes(l),
6233
+ next,
6234
+ bases: [rec?.files, l.kind === "files" ? l.receipt : null].filter((b) => !!b),
6235
+ kept: rec?.kept
6236
+ });
6237
+ const now = await readLocal(target);
6238
+ const first = verdict(now);
6239
+ const at = ctx.now?.() ?? /* @__PURE__ */ new Date();
6240
+ if (dryRun) {
6241
+ return result2(AS_STATE[first], now.kind === "unreadable" ? now.reason : void 0);
6242
+ }
6243
+ if (first === "install" || first === "update") {
6244
+ const outcome = await swapIn(target, tree, receiptText(ctx.version, next), (l) => {
6245
+ const v = verdict(l);
6246
+ return v === "install" || v === "update" ? "replace" : v === "current" ? "done" : "stop";
6247
+ });
6248
+ if (outcome === "stop") return syncSkill(ctx, dir, m, item, tree, dryRun);
6249
+ record(m, id, "skill-dir", target, item.skill.name, ctx.version, next, at);
6250
+ await saveBase(dir, id, tree);
6251
+ await saveProposed(dir, id, null);
6252
+ return result2(
6253
+ outcome === "swapped" ? first === "install" ? "installed" : "updated" : "current"
6254
+ );
6255
+ }
6256
+ if (first === "current") {
6257
+ if (!rec || !sameHashes(rec.files, next) || rec.kept) {
6258
+ record(m, id, "skill-dir", target, item.skill.name, ctx.version, next, at);
6259
+ await saveBase(dir, id, tree);
6260
+ }
6261
+ await saveProposed(dir, id, null);
6262
+ return result2("current");
6263
+ }
6264
+ if (first === "modified") {
6265
+ if (!rec && now.kind === "files" && now.receipt)
6266
+ record(m, id, "skill-dir", target, item.skill.name, "unknown", now.receipt, at);
6267
+ await saveProposed(dir, id, tree);
6268
+ return result2("modified");
6269
+ }
6270
+ return result2(first, now.kind === "unreadable" ? now.reason : void 0);
6271
+ }
6272
+ function gitHead(dir) {
6273
+ return new Promise(
6274
+ (resolve) => execFile(
6275
+ "git",
6276
+ ["-C", dir, "rev-parse", "HEAD"],
6277
+ { timeout: 5e3 },
6278
+ (error, stdout) => resolve(error ? null : stdout.trim() || null)
6279
+ )
6280
+ );
6281
+ }
6282
+ async function checkAssumptions(firstmateDir) {
6283
+ const checks = [];
6284
+ const seen = /* @__PURE__ */ new Set();
6285
+ for (const a of SKILLS.flatMap((s) => s.assumptions)) {
6286
+ const key = `${a.file}\0${a.marker}`;
6287
+ if (seen.has(key)) continue;
6288
+ seen.add(key);
6289
+ let text2 = "";
6290
+ try {
6291
+ text2 = await readFile(path.join(firstmateDir, a.file), "utf8");
6292
+ } catch {
6293
+ }
6294
+ checks.push({ ...a, present: text2.includes(a.marker) });
6027
6295
  }
6296
+ return checks;
6297
+ }
6298
+ function summary$1(items, drift) {
6299
+ const notable = items.filter((i) => i.state !== "current" && i.state !== "off");
6300
+ const lines = (notable.length ? notable : items).map((i) => i.message);
6301
+ if (drift.length)
6302
+ lines.push(
6303
+ `Firstmate's checkout no longer has ${drift.map((d) => `\`${d.marker}\` in ${d.file}`).join(", ")}, which the bundled skills rely on; they may describe it wrongly until Wheelhouse is updated.`
6304
+ );
6305
+ const state = items.some((i) => i.state === "error") ? "error" : drift.length || items.some((i) => i.state === "modified" || i.state === "foreign" || i.state === "refused") ? "attention" : "ok";
6306
+ return { state, message: lines.join(" ") || "Wheelhouse installs nothing here.", items, drift };
6307
+ }
6308
+ const disabled = (message2) => ({
6309
+ state: "disabled",
6310
+ message: message2,
6311
+ items: [],
6312
+ drift: []
6313
+ });
6314
+ async function syncMaterial(ctx, inputs, opts = {}) {
6315
+ if (ctx.env.WHEELHOUSE_MANAGE_SKILL === "0")
6316
+ return disabled("Wheelhouse skill installation is disabled.");
6317
+ if (!ctx.skillsRoot)
6318
+ return disabled(
6319
+ "Wheelhouse skill is left as it is: only the packaged Wheelhouse server installs it."
6320
+ );
6321
+ const skillsRoot = ctx.skillsRoot;
6322
+ const dir = materialDir(ctx.configDir);
6323
+ const dryRun = opts.dryRun ?? false;
6324
+ return serialize(dir, async () => {
6325
+ const m = await readManifest(dir, dryRun) ?? emptyManifest(ctx.version, inputs.harness);
6326
+ const off2 = await readOff(dir);
6327
+ const items = [];
6328
+ const trees = /* @__PURE__ */ new Map();
6329
+ for (const item of plannedSkills(ctx.env, inputs.harness)) {
6330
+ if (opts.only && !opts.only.includes(item.id)) continue;
6331
+ if (off2.has(item.id)) {
6332
+ items.push({
6333
+ id: item.id,
6334
+ kind: "skill-dir",
6335
+ target: item.target,
6336
+ state: "off",
6337
+ message: message$3("off", item.id, item.target)
6338
+ });
6339
+ continue;
6340
+ }
6341
+ let tree = trees.get(item.skill.name);
6342
+ if (!tree) {
6343
+ tree = await renderSkill(skillsRoot, item.skill, inputs).catch((e) => e);
6344
+ trees.set(item.skill.name, tree);
6345
+ }
6346
+ try {
6347
+ if (tree instanceof Error) throw tree;
6348
+ items.push(await syncSkill(ctx, dir, m, item, tree, dryRun));
6349
+ } catch (e) {
6350
+ items.push({
6351
+ id: item.id,
6352
+ kind: "skill-dir",
6353
+ target: item.target,
6354
+ state: "error",
6355
+ message: message$3("error", item.id, item.target, e.message)
6356
+ });
6357
+ }
6358
+ }
6359
+ const assumptions = await checkAssumptions(ctx.install.firstmateDir);
6360
+ const drift = assumptions.filter((a) => !a.present);
6361
+ if (!dryRun) {
6362
+ const now = (ctx.now?.() ?? /* @__PURE__ */ new Date()).toISOString();
6363
+ m.firstmate = {
6364
+ dir: ctx.install.firstmateDir,
6365
+ home: ctx.install.homeDir,
6366
+ commit: await (ctx.commit ?? gitHead)(ctx.install.firstmateDir),
6367
+ checkedAt: now,
6368
+ assumptions
6369
+ };
6370
+ m.render = { reviewSurface: inputs.reviewSurface, harness: inputs.harness };
6371
+ const changes = items.filter((i) => i.state === "installed" || i.state === "updated").map((i) => ({ id: i.id, state: i.state }));
6372
+ if (changes.length) m.history.push({ at: now, version: ctx.version, changes });
6373
+ m.wheelhouse = { version: ctx.version };
6374
+ try {
6375
+ await writeManifest(dir, m);
6376
+ } catch (e) {
6377
+ return {
6378
+ ...summary$1(items, drift),
6379
+ state: "error",
6380
+ message: `Could not record Wheelhouse's agent material in ${dir}: ${e.message}`
6381
+ };
6382
+ }
6383
+ }
6384
+ return summary$1(items, drift);
6385
+ }).catch((e) => ({
6386
+ state: "error",
6387
+ message: `Could not sync Wheelhouse's agent material in ${dir}: ${e.message}`,
6388
+ items: [],
6389
+ drift: []
6390
+ }));
6391
+ }
6392
+ function reviewSurfaceOf(active, statuses) {
6393
+ if (!active) return null;
6394
+ const status2 = statuses.find((s) => s.id === active.id && s.state === "loaded");
6395
+ return { id: active.id, name: active.name, repository: status2?.repository ?? null };
6028
6396
  }
6029
6397
  const RETRY_MS = 6e4;
6030
- class SkillSync {
6031
- constructor(surface, install, log = () => {
6398
+ class MaterialSync {
6399
+ constructor(inputs, run, log = () => {
6032
6400
  }, now = Date.now) {
6033
- this.surface = surface;
6034
- this.install = install;
6401
+ this.inputs = inputs;
6402
+ this.run = run;
6035
6403
  this.log = log;
6036
6404
  this.now = now;
6037
6405
  }
6038
- surface;
6039
- install;
6406
+ inputs;
6407
+ run;
6040
6408
  log;
6041
6409
  now;
6042
- /** The surface last installed: a plugin id, '' for the built-in, undefined before the first. */
6043
6410
  last;
6044
6411
  chain = Promise.resolve();
6045
- /** The last failed install: its surface key, when it ran, and its message. */
6046
6412
  failed = null;
6047
- /** Reinstall the skill when the active review surface changed; null when it had not. */
6413
+ latest = null;
6414
+ /** Sync when the inputs changed; null when they had not. */
6048
6415
  sync() {
6049
6416
  const run = this.chain.then(async () => {
6050
- const surface = await this.surface();
6051
- const key = surface?.id ?? "";
6417
+ const inputs = await this.inputs();
6418
+ const key = JSON.stringify(inputs);
6052
6419
  if (key === this.last) return null;
6053
6420
  const f = this.failed;
6054
6421
  if (f?.key === key && this.now() - f.at < RETRY_MS) return null;
6055
- const r = await this.install(surface);
6422
+ const r = await this.run({ reviewSurface: inputs.reviewSurface, harness: inputs.harness });
6423
+ this.latest = r;
6056
6424
  if (r.state === "error") {
6057
6425
  this.last = void 0;
6058
6426
  this.failed = { key, at: this.now(), message: r.message };
@@ -6068,11 +6436,68 @@ class SkillSync {
6068
6436
  });
6069
6437
  return run;
6070
6438
  }
6439
+ /** The last sync's outcome, for /api/health. */
6440
+ view() {
6441
+ const r = this.latest;
6442
+ if (!r) return { state: "unknown", message: null, items: [], drift: [] };
6443
+ return {
6444
+ state: r.state,
6445
+ message: r.message,
6446
+ items: r.items.map(({ id, state, target }) => ({ id, state, target })),
6447
+ drift: r.drift.map(({ file, marker }) => ({ file, marker }))
6448
+ };
6449
+ }
6071
6450
  }
6072
- function reviewSurfaceOf(active, statuses) {
6073
- if (!active) return null;
6074
- const status2 = statuses.find((s) => s.id === active.id && s.state === "loaded");
6075
- return { id: active.id, name: active.name, repository: status2?.repository ?? null };
6451
+ function cached(fn, ms, now = Date.now) {
6452
+ let at = -Infinity;
6453
+ let value = null;
6454
+ return () => {
6455
+ if (!value || now() - at >= ms) {
6456
+ at = now();
6457
+ value = fn();
6458
+ }
6459
+ return value;
6460
+ };
6461
+ }
6462
+ function materialContext(install, env) {
6463
+ return {
6464
+ install,
6465
+ env,
6466
+ configDir: defaultConfigDir(env),
6467
+ skillsRoot: env.WHEELHOUSE_INSTALL_DIR ? path.join(env.WHEELHOUSE_INSTALL_DIR, "skills") : void 0,
6468
+ version
6469
+ };
6470
+ }
6471
+ function serverHarness(env) {
6472
+ try {
6473
+ return parseHarness(env.WHEELHOUSE_HARNESS);
6474
+ } catch {
6475
+ return "claude";
6476
+ }
6477
+ }
6478
+ async function syncForServer(install, env, plugins) {
6479
+ const reviewSurface = plugins ? reviewSurfaceOf(await plugins.roleProvider("review.surface"), plugins.status()) : null;
6480
+ return syncMaterial(materialContext(install, env), {
6481
+ reviewSurface,
6482
+ harness: serverHarness(env)
6483
+ });
6484
+ }
6485
+ const COMMIT_MS = 6e4;
6486
+ function materialSync(install, env, plugins, log) {
6487
+ const commit2 = cached(() => gitHead(install.firstmateDir), COMMIT_MS);
6488
+ const ctx = { ...materialContext(install, env), commit: () => commit2() };
6489
+ return new MaterialSync(
6490
+ async () => ({
6491
+ reviewSurface: reviewSurfaceOf(
6492
+ await plugins.roleProvider("review.surface"),
6493
+ plugins.status()
6494
+ ),
6495
+ harness: serverHarness(env),
6496
+ firstmateCommit: await commit2()
6497
+ }),
6498
+ (inputs) => syncMaterial(ctx, inputs),
6499
+ log
6500
+ );
6076
6501
  }
6077
6502
  const SESSION_HEADER = "x-wheelhouse-session";
6078
6503
  const LOOPBACK_HOST = /^(127\.0\.0\.1|localhost|\[::1\])(:\d+)?$/i;
@@ -7844,6 +8269,12 @@ class BuildReader {
7844
8269
  }
7845
8270
  }
7846
8271
  const DEFAULT_INTERVAL$1 = 5e3;
8272
+ const UNSYNCED_MATERIAL = {
8273
+ state: "unknown",
8274
+ message: null,
8275
+ items: [],
8276
+ drift: []
8277
+ };
7847
8278
  const CARD_SHOTS = 4;
7848
8279
  class Collector {
7849
8280
  opts;
@@ -7852,6 +8283,7 @@ class Collector {
7852
8283
  running = false;
7853
8284
  ticking = null;
7854
8285
  listeners = /* @__PURE__ */ new Set();
8286
+ material = null;
7855
8287
  snapshot = null;
7856
8288
  ready = null;
7857
8289
  readyError = null;
@@ -8003,7 +8435,7 @@ class Collector {
8003
8435
  worktree: t.worktree.present ? t.worktree.path : null,
8004
8436
  row: t
8005
8437
  })),
8006
- ...backlogOnly(snap).map(({ record }) => ({ id: record.id, worktree: null, row: null }))
8438
+ ...backlogOnly(snap).map(({ record: record2 }) => ({ id: record2.id, worktree: null, row: null }))
8007
8439
  ];
8008
8440
  const thumbs = /* @__PURE__ */ new Map();
8009
8441
  const review = /* @__PURE__ */ new Map();
@@ -8201,6 +8633,10 @@ class Collector {
8201
8633
  return this.snapshot?.tasks.find((t) => t.id === id) ?? null;
8202
8634
  }
8203
8635
  mateFacts = null;
8636
+ /** Where health reads the last sync of Wheelhouse's agent material (material/sync.ts). */
8637
+ setMaterial(f) {
8638
+ this.material = f;
8639
+ }
8204
8640
  /** Where a second mate's task's PR and preview come from, once read (matetasks.ts). */
8205
8641
  setMateFacts(f) {
8206
8642
  this.mateFacts = f;
@@ -8301,7 +8737,8 @@ class Collector {
8301
8737
  configDir: null,
8302
8738
  problem: "Passage files are not set up.",
8303
8739
  checksRunning: 0
8304
- }
8740
+ },
8741
+ material: this.material?.() ?? UNSYNCED_MATERIAL
8305
8742
  };
8306
8743
  }
8307
8744
  messaging() {
@@ -10582,9 +11019,9 @@ class InboxService {
10582
11019
  line = p.line;
10583
11020
  }
10584
11021
  const text2 = closing ? closeText(card, note2 || null) : answerText(card, choice, note2 || null, decided ? null : line, decided || null);
10585
- const valid = validateSend(requestId, text2, card.taskId);
10586
- if (!valid.ok) return valid;
10587
- const sent = await messenger.send(valid.input);
11022
+ const valid2 = validateSend(requestId, text2, card.taskId);
11023
+ if (!valid2.ok) return valid2;
11024
+ const sent = await messenger.send(valid2.input);
10588
11025
  if (sent.ok && sent.message.delivery !== "failed") {
10589
11026
  await this.deps.answered?.record({
10590
11027
  requestId: sent.message.requestId,
@@ -10922,11 +11359,11 @@ class WatchStore {
10922
11359
  get(projectId) {
10923
11360
  return this.projects.get(projectId) ?? null;
10924
11361
  }
10925
- set(projectId, record) {
11362
+ set(projectId, record2) {
10926
11363
  this.projects.set(projectId, {
10927
- mode: record.mode,
10928
- rule: record.rule,
10929
- seen: record.seen.slice(-MAX_SEEN)
11364
+ mode: record2.mode,
11365
+ rule: record2.rule,
11366
+ seen: record2.seen.slice(-MAX_SEEN)
10930
11367
  });
10931
11368
  }
10932
11369
  forget(projectId) {
@@ -10985,13 +11422,13 @@ class IssueWatcher {
10985
11422
  }
10986
11423
  const rule = ruleKey(watchRule(settings, p.id));
10987
11424
  if (!p.ok || !p.rule || ruleKey(p.rule) !== rule) continue;
10988
- const record = store.get(p.id);
10989
- if (!record || record.mode !== mode || record.rule !== rule) {
11425
+ const record2 = store.get(p.id);
11426
+ if (!record2 || record2.mode !== mode || record2.rule !== rule) {
10990
11427
  store.set(p.id, { mode, rule, seen: p.issues.map((i) => i.url) });
10991
11428
  changed = true;
10992
11429
  continue;
10993
11430
  }
10994
- const seen = new Set(record.seen);
11431
+ const seen = new Set(record2.seen);
10995
11432
  for (const issue of p.issues) {
10996
11433
  if (seen.has(issue.url)) continue;
10997
11434
  if (issue.inHand) {
@@ -11004,7 +11441,7 @@ class IssueWatcher {
11004
11441
  seen.add(issue.url);
11005
11442
  }
11006
11443
  }
11007
- if (seen.size !== record.seen.length) {
11444
+ if (seen.size !== record2.seen.length) {
11008
11445
  store.set(p.id, { mode, rule, seen: [...seen] });
11009
11446
  changed = true;
11010
11447
  }
@@ -13110,8 +13547,8 @@ function toolResult(r) {
13110
13547
  return { ok: true, result: r };
13111
13548
  }
13112
13549
  function appHtml(r, uri) {
13113
- const contents2 = Array.isArray(r?.contents) ? r.contents.filter(isRecord) : [];
13114
- const item = contents2.find((c) => c.uri === uri) ?? contents2[0];
13550
+ const contents = Array.isArray(r?.contents) ? r.contents.filter(isRecord) : [];
13551
+ const item = contents.find((c) => c.uri === uri) ?? contents[0];
13115
13552
  if (!item) return { ok: false, reason: "the server sent no content." };
13116
13553
  const mime = String(item.mimeType ?? "").replace(/\s+/g, "").toLowerCase();
13117
13554
  if (mime !== APP_MIME) {
@@ -14623,8 +15060,8 @@ class PassageService {
14623
15060
  const refsFor = async () => {
14624
15061
  if (refs) return refs;
14625
15062
  if (!f.prUrl || !this.useGh) return null;
14626
- const cached = this.refs.status(`refs|${f.prUrl}`)?.result;
14627
- refs = cached && !cached.problem ? cached.refs : (await readTaskRefs(f.prUrl, this.deps)).refs;
15063
+ const cached2 = this.refs.status(`refs|${f.prUrl}`)?.result;
15064
+ refs = cached2 && !cached2.problem ? cached2.refs : (await readTaskRefs(f.prUrl, this.deps)).refs;
14628
15065
  return refs;
14629
15066
  };
14630
15067
  const ctx = async (checkId, spec, releaseTag) => ({
@@ -15903,15 +16340,15 @@ class Gateway {
15903
16340
  }
15904
16341
  const requestId = `${channel}:${e.id}`;
15905
16342
  const taskId = e.inReplyTo ? this.deps.record.sentAt(e.inReplyTo)?.taskId ?? null : null;
15906
- const valid = validateSend(requestId, `${provenance(label(channel))}
16343
+ const valid2 = validateSend(requestId, `${provenance(label(channel))}
15907
16344
  ${text2}`, taskId);
15908
- if (!valid.ok) {
15909
- this.log(channel, { event: "refuse", from: e.from, id: e.id, reason: valid.error });
15910
- await say(valid.error);
16345
+ if (!valid2.ok) {
16346
+ this.log(channel, { event: "refuse", from: e.from, id: e.id, reason: valid2.error });
16347
+ await say(valid2.error);
15911
16348
  return;
15912
16349
  }
15913
16350
  if (this.deps.record.note(requestId)) {
15914
- const r2 = await this.deps.messenger.send(valid.input);
16351
+ const r2 = await this.deps.messenger.send(valid2.input);
15915
16352
  this.log(
15916
16353
  channel,
15917
16354
  r2.ok ? { event: "accept", from: e.from, id: e.id, requestId, taskId, what: "redelivered" } : { event: "refuse", from: e.from, id: e.id, requestId, reason: r2.error }
@@ -15941,7 +16378,7 @@ ${text2}`, taskId);
15941
16378
  replied: null
15942
16379
  });
15943
16380
  await this.deps.record.save();
15944
- const r = await this.deps.messenger.send(valid.input);
16381
+ const r = await this.deps.messenger.send(valid2.input);
15945
16382
  if (!r.ok) {
15946
16383
  this.log(channel, { event: "refuse", from: e.from, id: e.id, requestId, reason: r.error });
15947
16384
  const n = this.deps.record.note(requestId);
@@ -16173,9 +16610,9 @@ ${text2}`, taskId);
16173
16610
  * piece; returns where that piece went, or null when it could not be sent.
16174
16611
  */
16175
16612
  async post(channel, adapter, to, draft, replyTo = null, what = "notice") {
16176
- const record = this.deps.record;
16613
+ const record2 = this.deps.record;
16177
16614
  const actions = draft.actions.slice(0, adapter.limits.buttons);
16178
- const tokens = actions.map((a) => record.grant(channel, a.action, BUTTON_TTL_MS));
16615
+ const tokens = actions.map((a) => record2.grant(channel, a.action, BUTTON_TTL_MS));
16179
16616
  const buttons = [
16180
16617
  ...actions.map((a, i) => ({ label: a.label, token: tokens[i], style: a.style })),
16181
16618
  ...draft.links.map((l) => ({ label: l.label, url: l.url }))
@@ -16193,13 +16630,13 @@ ${text2}`, taskId);
16193
16630
  });
16194
16631
  }
16195
16632
  } catch (e) {
16196
- record.revoke(tokens);
16633
+ record2.revoke(tokens);
16197
16634
  this.log(channel, { event: "error", what, reason: e.message });
16198
16635
  return null;
16199
16636
  }
16200
16637
  if (!ref) return null;
16201
- record.attach(tokens, ref);
16202
- record.addSent({
16638
+ record2.attach(tokens, ref);
16639
+ record2.addSent({
16203
16640
  channel,
16204
16641
  ref,
16205
16642
  taskId: draft.taskId,
@@ -16208,7 +16645,7 @@ ${text2}`, taskId);
16208
16645
  text: tokens.length ? pieces[pieces.length - 1] : "",
16209
16646
  links: draft.links.filter((l) => buttons.some((b) => "url" in b && b.url === l.url))
16210
16647
  });
16211
- await record.save();
16648
+ await record2.save();
16212
16649
  this.log(channel, { event: "send", from: to.id, id: ref.id, taskId: draft.taskId, what });
16213
16650
  return ref;
16214
16651
  }
@@ -16756,8 +17193,8 @@ function normalize(entry, sessionId) {
16756
17193
  async function piSnapshot(opts) {
16757
17194
  if (!opts.sessionNonce?.trim()) return null;
16758
17195
  try {
16759
- const receiptText = await readBounded(opts.hookFile, RECEIPT_BYTES$1);
16760
- const receipt = receiptText === null ? null : object$2(JSON.parse(receiptText));
17196
+ const receiptText2 = await readBounded(opts.hookFile, RECEIPT_BYTES$1);
17197
+ const receipt = receiptText2 === null ? null : object$2(JSON.parse(receiptText2));
16761
17198
  if (!receipt || receipt.wheelhouse_nonce !== opts.sessionNonce || typeof receipt.session_id !== "string" || !receipt.session_id || typeof receipt.transcript_path !== "string" || !path.isAbsolute(receipt.transcript_path) || typeof receipt.cwd !== "string" || !path.isAbsolute(receipt.cwd) || !(receipt.leaf_id === null || typeof receipt.leaf_id === "string"))
16762
17199
  return null;
16763
17200
  const sessionId = receipt.session_id;
@@ -16915,19 +17352,19 @@ async function newestFor(o, dir) {
16915
17352
  }
16916
17353
  let best = null;
16917
17354
  for (const d of dirs) {
16918
- const folder = path.join(o.projectsDir, d);
17355
+ const folder2 = path.join(o.projectsDir, d);
16919
17356
  let files;
16920
17357
  try {
16921
- files = (await readdir(folder)).filter((f) => f.endsWith(".jsonl"));
17358
+ files = (await readdir(folder2)).filter((f) => f.endsWith(".jsonl"));
16922
17359
  } catch {
16923
17360
  continue;
16924
17361
  }
16925
17362
  let newest2 = null;
16926
17363
  for (const f of files) {
16927
17364
  try {
16928
- const s = await stat(path.join(folder, f));
17365
+ const s = await stat(path.join(folder2, f));
16929
17366
  if (!newest2 || s.mtimeMs > newest2.mtime)
16930
- newest2 = { file: path.join(folder, f), mtime: s.mtimeMs };
17367
+ newest2 = { file: path.join(folder2, f), mtime: s.mtimeMs };
16931
17368
  } catch {
16932
17369
  }
16933
17370
  }
@@ -17085,9 +17522,9 @@ class ChatFeed {
17085
17522
  this.source = source;
17086
17523
  const records2 = [];
17087
17524
  this.calls.clear();
17088
- for (const record of snapshot?.records ?? []) {
17089
- this.noteToolCalls(record);
17090
- const compact = slim(record);
17525
+ for (const record2 of snapshot?.records ?? []) {
17526
+ this.noteToolCalls(record2);
17527
+ const compact = slim(record2);
17091
17528
  if (compact) records2.push(compact);
17092
17529
  }
17093
17530
  if (records2.length > MAX_RECORDS) {
@@ -17164,17 +17601,17 @@ class ChatFeed {
17164
17601
  lines.pop();
17165
17602
  if (startedMidway) lines.shift();
17166
17603
  const fresh = [];
17167
- const seen = new Set(this.records.map((record) => record.uuid));
17604
+ const seen = new Set(this.records.map((record2) => record2.uuid));
17168
17605
  for (const line of lines) {
17169
17606
  if (!line.trim()) continue;
17170
17607
  try {
17171
17608
  const raw = JSON.parse(line);
17172
17609
  const decoded = this.opts.decode ? this.opts.decode(raw, this.session?.harness ?? "claude") : [raw];
17173
- for (const record of decoded) {
17174
- if (this.opts.decode && this.session?.harness !== "claude" && seen.has(record.uuid))
17610
+ for (const record2 of decoded) {
17611
+ if (this.opts.decode && this.session?.harness !== "claude" && seen.has(record2.uuid))
17175
17612
  continue;
17176
- this.noteToolCalls(record);
17177
- const r = slim(record);
17613
+ this.noteToolCalls(record2);
17614
+ const r = slim(record2);
17178
17615
  if (r) {
17179
17616
  fresh.push(r);
17180
17617
  seen.add(r.uuid);
@@ -17732,15 +18169,6 @@ const HERDR_AMBIENT = [
17732
18169
  "HERDR_TAB_ID",
17733
18170
  "HERDR_WORKSPACE_ID"
17734
18171
  ];
17735
- const PANE_UNSET = [
17736
- ...DROPPED_VARIABLES,
17737
- "CLAUDE_CODE_CHILD_SESSION",
17738
- "CLAUDE_CODE_SESSION_ID",
17739
- "CLAUDE_CODE_SESSION_ATTENDED",
17740
- "CLAUDE_CODE_EXECPATH",
17741
- "CLAUDE_EFFORT"
17742
- ];
17743
- const PANE_UNSET_PREFIXES = ["CLAUDE_CODE_MESSAGING_"];
17744
18172
  const HERDR_KEYS = {
17745
18173
  Enter: "Enter",
17746
18174
  Escape: "Escape",
@@ -17866,14 +18294,7 @@ function parseRecord(text2) {
17866
18294
  };
17867
18295
  }
17868
18296
  function paneArgv(shBinary, spec) {
17869
- const unset = PANE_UNSET.filter((name2) => !(name2 in spec.env));
17870
- const families = PANE_UNSET_PREFIXES.map((p) => `${p}*`).join("|");
17871
- const script = [
17872
- `unset ${unset.join(" ")}`,
17873
- `for n in $(env | while IFS== read -r n _; do case "$n" in (*[!A-Za-z0-9_]*) ;; (${families}) echo "$n" ;; esac; done); do unset "$n"; done`,
17874
- 'exec "$@"'
17875
- ].join("\n");
17876
- return [shBinary, "-c", script, "sh", ...spec.argv];
18297
+ return cleanCommand(shBinary, spec);
17877
18298
  }
17878
18299
  function launchScript(shBinary, spec) {
17879
18300
  return `rm -f "$0"
@@ -17954,15 +18375,15 @@ class HerdrBackend {
17954
18375
  }
17955
18376
  async readRecord() {
17956
18377
  try {
17957
- const record = parseRecord(await readFile(this.recordFile, "utf8"));
17958
- return record && record.session === this.session ? record : null;
18378
+ const record2 = parseRecord(await readFile(this.recordFile, "utf8"));
18379
+ return record2 && record2.session === this.session ? record2 : null;
17959
18380
  } catch {
17960
18381
  return null;
17961
18382
  }
17962
18383
  }
17963
- async writeRecord(record) {
18384
+ async writeRecord(record2) {
17964
18385
  const tmp = `${this.recordFile}.${process.pid}.tmp`;
17965
- await writeFile(tmp, JSON.stringify(record), { mode: 384 });
18386
+ await writeFile(tmp, JSON.stringify(record2), { mode: 384 });
17966
18387
  await rename(tmp, this.recordFile);
17967
18388
  }
17968
18389
  /** The pane to type into: the one running() found live, else the recorded one. */
@@ -17979,9 +18400,9 @@ class HerdrBackend {
17979
18400
  return null;
17980
18401
  }
17981
18402
  if (!status2.running) return false;
17982
- const record = await this.readRecord();
17983
- if (!record) return false;
17984
- const r = await this.herdr(["pane", "get", record.paneId]);
18403
+ const record2 = await this.readRecord();
18404
+ if (!record2) return false;
18405
+ const r = await this.herdr(["pane", "get", record2.paneId]);
17985
18406
  if (!r.ok) {
17986
18407
  if (herdrCode(r) === "pane_not_found") return false;
17987
18408
  this.lastProblem = `herdr could not report Firstmate's pane: ${herdrError(r)}`;
@@ -17993,8 +18414,8 @@ class HerdrBackend {
17993
18414
  this.lastProblem = "herdr gave an answer about Firstmate's pane that Wheelhouse does not understand.";
17994
18415
  return null;
17995
18416
  }
17996
- if (terminal !== record.terminalId) return false;
17997
- this.live = record;
18417
+ if (terminal !== record2.terminalId) return false;
18418
+ this.live = record2;
17998
18419
  return true;
17999
18420
  }
18000
18421
  /** Start the session's herdr server when it is not running, wait for it to answer, and give its status. */
@@ -18027,7 +18448,7 @@ class HerdrBackend {
18027
18448
  const started = compareVersions(status2.clientVersion, HERDR_PANE_START_VERSION) < 0 ? await this.startAgent(sh, spec) : await this.startInWorkspace(sh, spec);
18028
18449
  if ("error" in started) return { ok: false, error: started.error };
18029
18450
  const { paneId, terminalId } = started;
18030
- const record = {
18451
+ const record2 = {
18031
18452
  schema: RECORD_SCHEMA,
18032
18453
  session: this.session,
18033
18454
  paneId,
@@ -18035,14 +18456,14 @@ class HerdrBackend {
18035
18456
  env: { ...spec.env }
18036
18457
  };
18037
18458
  try {
18038
- await this.writeRecord(record);
18459
+ await this.writeRecord(record2);
18039
18460
  } catch (e) {
18040
18461
  return {
18041
18462
  ok: false,
18042
18463
  error: `herdr started Firstmate in pane ${paneId}, but Wheelhouse could not record it: ${e.message}`
18043
18464
  };
18044
18465
  }
18045
- this.live = record;
18466
+ this.live = record2;
18046
18467
  await this.herdr([
18047
18468
  "terminal",
18048
18469
  "session",
@@ -18850,9 +19271,9 @@ async function locateCodexTranscript(opts, state) {
18850
19271
  const relative = path.relative(root, file);
18851
19272
  if (cwd !== receiptCwd || !relative || relative.startsWith("..") || path.isAbsolute(relative))
18852
19273
  return null;
18853
- const record = object(await readJson(file, META_BYTES, true));
18854
- const meta = object(record?.payload);
18855
- if (record?.type !== "session_meta" || !meta || meta.id !== receipt.session_id || meta.originator !== "codex-tui" || meta.source !== "cli" && meta.source !== "vscode" || typeof meta.cwd !== "string" || !path.isAbsolute(meta.cwd) || await realpath(meta.cwd) !== cwd)
19274
+ const record2 = object(await readJson(file, META_BYTES, true));
19275
+ const meta = object(record2?.payload);
19276
+ if (record2?.type !== "session_meta" || !meta || meta.id !== receipt.session_id || meta.originator !== "codex-tui" || meta.source !== "cli" && meta.source !== "vscode" || typeof meta.cwd !== "string" || !path.isAbsolute(meta.cwd) || await realpath(meta.cwd) !== cwd)
18856
19277
  return null;
18857
19278
  return { how: "hook", file };
18858
19279
  } catch {
@@ -18883,11 +19304,11 @@ function mcpResult(value) {
18883
19304
  return typeof result2.message === "string" ? result2.message : "";
18884
19305
  }
18885
19306
  function codexRecords(raw) {
18886
- const record = object(raw);
18887
- const payload = object(record?.payload);
18888
- if (record?.type !== "event_msg" || !payload || typeof record.timestamp !== "string" || !Number.isFinite(Date.parse(record.timestamp)))
19307
+ const record2 = object(raw);
19308
+ const payload = object(record2?.payload);
19309
+ if (record2?.type !== "event_msg" || !payload || typeof record2.timestamp !== "string" || !Number.isFinite(Date.parse(record2.timestamp)))
18889
19310
  return [];
18890
- const timestamp2 = record.timestamp;
19311
+ const timestamp2 = record2.timestamp;
18891
19312
  const turnId = typeof payload.turn_id === "string" ? payload.turn_id : null;
18892
19313
  if (payload.type === "task_complete" && turnId) {
18893
19314
  return [
@@ -19564,11 +19985,8 @@ async function create(env, opts = {}) {
19564
19985
  sandbox: (key, csp) => sandbox.url(key, csp),
19565
19986
  version
19566
19987
  });
19567
- const skill = new SkillSync(
19568
- async () => reviewSurfaceOf(await plugins.roleProvider("review.surface"), plugins.status()),
19569
- (surface) => installWheelhouseSkill(install, env, void 0, surface),
19570
- (line) => console.log(line)
19571
- );
19988
+ const skill = materialSync(install, env, plugins, (line) => console.log(line));
19989
+ collector.setMaterial(() => skill.view());
19572
19990
  await skill.sync();
19573
19991
  if (opts.startSession === false) {
19574
19992
  console.log("Firstmate: connected by setup; it starts when setup finishes.");
@@ -19667,9 +20085,9 @@ async function createGateway(install, env, deps) {
19667
20085
  if (!messenger) return null;
19668
20086
  const configDir = defaultConfigDir(env);
19669
20087
  const stateDir = defaultStateDir(env);
19670
- let record;
20088
+ let record2;
19671
20089
  try {
19672
- record = await GatewayRecord.open(
20090
+ record2 = await GatewayRecord.open(
19673
20091
  path.join(path.dirname(storeFileFor(stateDir, install.homeDir)), "gateway.json")
19674
20092
  );
19675
20093
  } catch (e) {
@@ -19679,7 +20097,7 @@ async function createGateway(install, env, deps) {
19679
20097
  const audits = /* @__PURE__ */ new Map();
19680
20098
  const gateway = new Gateway({
19681
20099
  settings: new GatewaySettings(gatewayDir(configDir), defaultKeychain()),
19682
- record,
20100
+ record: record2,
19683
20101
  audit: (c) => {
19684
20102
  let log = audits.get(c);
19685
20103
  if (!log) {
@@ -19902,7 +20320,8 @@ function unconfiguredHealth(error) {
19902
20320
  },
19903
20321
  ledger: { available: false, reason: null },
19904
20322
  messaging: { available: false, reason: error, store: null },
19905
- passages: { configDir: null, problem: error, checksRunning: 0 }
20323
+ passages: { configDir: null, problem: error, checksRunning: 0 },
20324
+ material: UNSYNCED_MATERIAL
19906
20325
  };
19907
20326
  }
19908
20327
  function unavailableMessages(reason) {
@@ -20276,5 +20695,5 @@ const runtime = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
20276
20695
  upgradeRuntime
20277
20696
  }, Symbol.toStringTag, { value: "Module" }));
20278
20697
 
20279
- export { resolveSessionBackend as $, currentGateway as A, currentPlugins as B, currentPluginPage as C, watchSettingsError as D, changePluginConfig as E, runBounded as F, GATEWAY_CHANNELS as G, which as H, INPUT_MAX_BYTES as I, pluginIconFile as J, pluginUiFile as K, LOOPBACK_HOST as L, MAX_CHAT_CALLS as M, chooseRoleProvider as N, previewProber as O, PROJECT_ID as P, MAX_FILE_BYTES$1 as Q, REQUEST_ID$1 as R, PEEK_DEFAULT_LINES as S, pluginService as T, refusesSetup as U, checkHerdr as V, WATCH_PLUGIN as W, HERDR_MIN_VERSION as X, findFirstmateDir as Y, looksLikeFirstmate as Z, SETUP_SUGGESTIONS as _, sessionToken as a, readSavedBackend as a0, DEFAULT_HERDR_SESSION as a1, writeSavedBackend as a2, reviewSurfaceOf as a3, installWheelhouseSkill as a4, writeRemembered as a5, reconnectRuntime as a6, setupWorkDir as a7, setupTerminals as a8, checkCompatibility as a9, bundledPluginsDir as aa, currentSlots as ab, GAPS as ac, WORKTREE_GONE as ad, PEEK_MAX_LINES as ae, parseChange as af, MAX_VALUE_BYTES as ag, currentDecisions as ah, readDoc as ai, currentTime as aj, runtime as ak, currentPullRequestTabs as b, currentReviewSurface as c, currentHostedPreviews as d, currentAddressRewrites as e, currentInbox as f, getRuntime as g, currentHeadroom as h, isMutating as i, currentHealth as j, currentFleet as k, currentRailInsights as l, loadSlots as m, currentPreviewPorts as n, currentMessages as o, serverInstance as p, unconfiguredHealth as q, refuseMutation as r, servedOrigin as s, currentFileRoots as t, unconfiguredFleet as u, readAsset as v, unavailableFirstmate as w, parseMateTaskId as x, validateSend as y, isReactionId as z };
20280
- //# sourceMappingURL=runtime.js-r5K-2IqO.js.map
20698
+ export { resolveSessionBackend as $, currentGateway as A, currentPlugins as B, currentPluginPage as C, watchSettingsError as D, changePluginConfig as E, runBounded as F, GATEWAY_CHANNELS as G, which as H, INPUT_MAX_BYTES as I, pluginIconFile as J, pluginUiFile as K, LOOPBACK_HOST as L, MAX_CHAT_CALLS as M, chooseRoleProvider as N, previewProber as O, PROJECT_ID as P, MAX_FILE_BYTES$1 as Q, REQUEST_ID$1 as R, PEEK_DEFAULT_LINES as S, pluginService as T, refusesSetup as U, checkHerdr as V, WATCH_PLUGIN as W, HERDR_MIN_VERSION as X, findFirstmateDir as Y, looksLikeFirstmate as Z, SETUP_SUGGESTIONS as _, sessionToken as a, readSavedBackend as a0, DEFAULT_HERDR_SESSION as a1, writeSavedBackend as a2, syncForServer as a3, writeRemembered as a4, reconnectRuntime as a5, setupWorkDir as a6, setupTerminals as a7, checkCompatibility as a8, bundledPluginsDir as a9, currentSlots as aa, GAPS as ab, WORKTREE_GONE as ac, PEEK_MAX_LINES as ad, parseChange as ae, MAX_VALUE_BYTES as af, currentDecisions as ag, readDoc as ah, currentTime as ai, runtime as aj, currentPullRequestTabs as b, currentReviewSurface as c, currentHostedPreviews as d, currentAddressRewrites as e, currentInbox as f, getRuntime as g, currentHeadroom as h, isMutating as i, currentHealth as j, currentFleet as k, currentRailInsights as l, loadSlots as m, currentPreviewPorts as n, currentMessages as o, serverInstance as p, unconfiguredHealth as q, refuseMutation as r, servedOrigin as s, currentFileRoots as t, unconfiguredFleet as u, readAsset as v, unavailableFirstmate as w, parseMateTaskId as x, validateSend as y, isReactionId as z };
20699
+ //# sourceMappingURL=runtime.js-CbmzOl0F.js.map