@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.
- package/build/client/_app/immutable/chunks/{_wNDtuC3.js → BQPyzYAS.js} +1 -1
- package/build/client/_app/immutable/chunks/BQPyzYAS.js.br +0 -0
- package/build/client/_app/immutable/chunks/BQPyzYAS.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{yB7gO-LO.js → BS3n5c7l.js} +1 -1
- package/build/client/_app/immutable/chunks/BS3n5c7l.js.br +0 -0
- package/build/client/_app/immutable/chunks/BS3n5c7l.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DwipL_Cn.js → Bgm2YDEc.js} +1 -1
- package/build/client/_app/immutable/chunks/Bgm2YDEc.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bgm2YDEc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Cx2pfZgS.js → CF9qC7cA.js} +1 -1
- package/build/client/_app/immutable/chunks/CF9qC7cA.js.br +0 -0
- package/build/client/_app/immutable/chunks/CF9qC7cA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CLj8aQLL.js → CGRtmaS4.js} +1 -1
- package/build/client/_app/immutable/chunks/CGRtmaS4.js.br +0 -0
- package/build/client/_app/immutable/chunks/{CLj8aQLL.js.gz → CGRtmaS4.js.gz} +0 -0
- package/build/client/_app/immutable/chunks/{CIDO3V-e.js → CH2Y0BVE.js} +1 -1
- package/build/client/_app/immutable/chunks/CH2Y0BVE.js.br +0 -0
- package/build/client/_app/immutable/chunks/CH2Y0BVE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CnNJ9y58.js → CLADX83T.js} +1 -1
- package/build/client/_app/immutable/chunks/CLADX83T.js.br +0 -0
- package/build/client/_app/immutable/chunks/CLADX83T.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BP2Qtph5.js → CS4t4atW.js} +1 -1
- package/build/client/_app/immutable/chunks/CS4t4atW.js.br +0 -0
- package/build/client/_app/immutable/chunks/CS4t4atW.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CejLiPvM.js → CU0ZJcdF.js} +2 -2
- package/build/client/_app/immutable/chunks/CU0ZJcdF.js.br +0 -0
- package/build/client/_app/immutable/chunks/CU0ZJcdF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CXqiEZDa.js → CXsGgEzT.js} +1 -1
- package/build/client/_app/immutable/chunks/CXsGgEzT.js.br +0 -0
- package/build/client/_app/immutable/chunks/CXsGgEzT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{8PhaMXz9.js → Ch7J5mLH.js} +1 -1
- package/build/client/_app/immutable/chunks/Ch7J5mLH.js.br +0 -0
- package/build/client/_app/immutable/chunks/Ch7J5mLH.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BaV2UMay.js → ClSB0siN.js} +1 -1
- package/build/client/_app/immutable/chunks/ClSB0siN.js.br +0 -0
- package/build/client/_app/immutable/chunks/ClSB0siN.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CI38zzdF.js → CxexnUzw.js} +1 -1
- package/build/client/_app/immutable/chunks/CxexnUzw.js.br +0 -0
- package/build/client/_app/immutable/chunks/CxexnUzw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{eaKSEJEz.js → D8F9xgmh.js} +1 -1
- package/build/client/_app/immutable/chunks/D8F9xgmh.js.br +0 -0
- package/build/client/_app/immutable/chunks/D8F9xgmh.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DKuj2J54.js → DP7xDWnQ.js} +1 -1
- package/build/client/_app/immutable/chunks/DP7xDWnQ.js.br +0 -0
- package/build/client/_app/immutable/chunks/DP7xDWnQ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DF5qBysY.js → DkntkkRH.js} +1 -1
- package/build/client/_app/immutable/chunks/DkntkkRH.js.br +0 -0
- package/build/client/_app/immutable/chunks/DkntkkRH.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{-PxedOl8.js → DwBYQnih.js} +1 -1
- package/build/client/_app/immutable/chunks/DwBYQnih.js.br +0 -0
- package/build/client/_app/immutable/chunks/DwBYQnih.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{C237xJzy.js → RedPhL9b.js} +1 -1
- package/build/client/_app/immutable/chunks/RedPhL9b.js.br +0 -0
- package/build/client/_app/immutable/chunks/RedPhL9b.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CFyednqY.js → _8osrypQ.js} +1 -1
- package/build/client/_app/immutable/chunks/_8osrypQ.js.br +2 -0
- package/build/client/_app/immutable/chunks/_8osrypQ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CYD68e6V.js → iI4tqZHC.js} +1 -1
- package/build/client/_app/immutable/chunks/iI4tqZHC.js.br +0 -0
- package/build/client/_app/immutable/chunks/iI4tqZHC.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.BOOXafZJ.js → app.DzMOOaXE.js} +2 -2
- package/build/client/_app/immutable/entry/app.DzMOOaXE.js.br +0 -0
- package/build/client/_app/immutable/entry/app.DzMOOaXE.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BP7YKN_Q.js +1 -0
- package/build/client/_app/immutable/entry/start.BP7YKN_Q.js.br +0 -0
- package/build/client/_app/immutable/entry/start.BP7YKN_Q.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.py9DNAwX.js → 0.BIHpRnqw.js} +1 -1
- package/build/client/_app/immutable/nodes/0.BIHpRnqw.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.BIHpRnqw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.CLi5bKEj.js → 1.BJIoIsvP.js} +1 -1
- package/build/client/_app/immutable/nodes/1.BJIoIsvP.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.BJIoIsvP.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{10.yQfIVnsR.js → 10.DRDVy09M.js} +1 -1
- package/build/client/_app/immutable/nodes/10.DRDVy09M.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.DRDVy09M.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{11.B0fQm_d5.js → 11.B2EhouGG.js} +1 -1
- package/build/client/_app/immutable/nodes/11.B2EhouGG.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.B2EhouGG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{12.DobuoNGx.js → 12.5fuIl1It.js} +1 -1
- package/build/client/_app/immutable/nodes/12.5fuIl1It.js.br +0 -0
- package/build/client/_app/immutable/nodes/12.5fuIl1It.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{13.DrO72J_j.js → 13.BHd8lAXB.js} +1 -1
- package/build/client/_app/immutable/nodes/13.BHd8lAXB.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.BHd8lAXB.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{14.B9bNPNMC.js → 14.DgsN2-TN.js} +1 -1
- package/build/client/_app/immutable/nodes/14.DgsN2-TN.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.DgsN2-TN.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{15.0P3R4toY.js → 15.CPHkfcQw.js} +1 -1
- package/build/client/_app/immutable/nodes/15.CPHkfcQw.js.br +0 -0
- package/build/client/_app/immutable/nodes/{15.0P3R4toY.js.gz → 15.CPHkfcQw.js.gz} +0 -0
- package/build/client/_app/immutable/nodes/{16.BnUrhlYC.js → 16.CrpxQoZ7.js} +1 -1
- package/build/client/_app/immutable/nodes/16.CrpxQoZ7.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.CrpxQoZ7.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{17.CHTdkvmi.js → 17.B83y7TTZ.js} +1 -1
- package/build/client/_app/immutable/nodes/17.B83y7TTZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.B83y7TTZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{19.BqId6Q50.js → 19.BGzbdUG8.js} +1 -1
- package/build/client/_app/immutable/nodes/19.BGzbdUG8.js.br +0 -0
- package/build/client/_app/immutable/nodes/19.BGzbdUG8.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.CEJmYaPJ.js → 2.B_zXlRDw.js} +1 -1
- package/build/client/_app/immutable/nodes/2.B_zXlRDw.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.B_zXlRDw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{20.CHH39Z2Z.js → 20.CQE-Zjw-.js} +1 -1
- package/build/client/_app/immutable/nodes/20.CQE-Zjw-.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.CQE-Zjw-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{21.CbnS5dV1.js → 21.BjSp2mZI.js} +1 -1
- package/build/client/_app/immutable/nodes/21.BjSp2mZI.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.BjSp2mZI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{22.malZaF0r.js → 22.BycUFjCM.js} +1 -1
- package/build/client/_app/immutable/nodes/22.BycUFjCM.js.br +0 -0
- package/build/client/_app/immutable/nodes/22.BycUFjCM.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{23.B-MnoGp_.js → 23.BjOud3nL.js} +1 -1
- package/build/client/_app/immutable/nodes/23.BjOud3nL.js.br +0 -0
- package/build/client/_app/immutable/nodes/23.BjOud3nL.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{24.D4YfUDkp.js → 24.DmaWt7EU.js} +1 -1
- package/build/client/_app/immutable/nodes/24.DmaWt7EU.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.DmaWt7EU.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{25.CGUyx5gm.js → 25.DpdKssoo.js} +1 -1
- package/build/client/_app/immutable/nodes/25.DpdKssoo.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.DpdKssoo.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{26.CSoLyIuT.js → 26.BxG4S8mB.js} +1 -1
- package/build/client/_app/immutable/nodes/26.BxG4S8mB.js.br +0 -0
- package/build/client/_app/immutable/nodes/26.BxG4S8mB.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{28.CnDXbxut.js → 28.Ds4FDR_a.js} +1 -1
- package/build/client/_app/immutable/nodes/28.Ds4FDR_a.js.br +0 -0
- package/build/client/_app/immutable/nodes/28.Ds4FDR_a.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.7M8y-hh1.js → 3.CldWfpKa.js} +1 -1
- package/build/client/_app/immutable/nodes/3.CldWfpKa.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.CldWfpKa.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{4.C-_GUkXF.js → 4.Ds0FcslK.js} +1 -1
- package/build/client/_app/immutable/nodes/4.Ds0FcslK.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.Ds0FcslK.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.BtFuhrhK.js → 6.CvP4hVA3.js} +1 -1
- package/build/client/_app/immutable/nodes/6.CvP4hVA3.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.CvP4hVA3.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.YcUXbAew.js → 7.Ca_DVOMc.js} +1 -1
- package/build/client/_app/immutable/nodes/7.Ca_DVOMc.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.Ca_DVOMc.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{8.DsZ8ckdf.js → 8.D8JqGvkd.js} +1 -1
- package/build/client/_app/immutable/nodes/8.D8JqGvkd.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.D8JqGvkd.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{9.C_to2yZ7.js → 9.CHSFcAbh.js} +1 -1
- package/build/client/_app/immutable/nodes/9.CHSFcAbh.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.CHSFcAbh.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/handler.js +4 -4
- package/build/index.js +4 -4
- package/build/server/chunks/chunks/{detail.js-C63yRaSC.js → detail.js-T1brxxWW.js} +2 -2
- package/build/server/chunks/chunks/{feedback.js-CoDUWcj9.js → feedback.js-0cB22LBt.js} +2 -2
- package/build/server/chunks/chunks/{internal.js-DRYzzYai.js → internal.js-BJRpqxxM.js} +3 -3
- package/build/server/chunks/chunks/{keychain.js-B__X3k_t.js → keychain.js-CsTOqhf4.js} +2 -2
- package/build/server/chunks/chunks/{marketplace-service.js-C0HaauhN.js → marketplace-service.js-CckS3apE.js} +2 -2
- package/build/server/chunks/chunks/{page.js-duntsJGm.js → page.js-D5V2PN2q.js} +2 -2
- package/build/server/chunks/chunks/{previewhelper2.js-KYHlnmkc.js → previewhelper2.js-DRcdOpNv.js} +2 -2
- package/build/server/chunks/chunks/{repo.js-BuqHotOZ.js → repo.js-CsdCOmUL.js} +2 -2
- package/build/server/chunks/chunks/{runtime.js-r5K-2IqO.js → runtime.js-CbmzOl0F.js} +711 -292
- package/build/server/chunks/chunks/{service.js-DhsbI-7z.js → service.js-DztM8MY5.js} +2 -2
- package/build/server/chunks/chunks/{service2.js-DtkDw6vU.js → service2.js-DQccL6zz.js} +5 -6
- package/build/server/chunks/chunks/{starter.js-7_g91123.js → starter.js-ROzdTBeO.js} +2 -2
- package/build/server/chunks/chunks/{view.js-DsUz24Rz.js → view.js-BDo4J83f.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/apps/_op_/{_server.ts.js-Xzvf5h6k.js → _server.ts.js-BTTHbZK6.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/cloud/{_server.ts.js-CGAcwpTU.js → _server.ts.js-m9cTbE-7.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/cloud/previews/{_server.ts.js-B58Bz7g3.js → _server.ts.js-z8BbPJ2P.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/events/{_server.ts.js-CnBeqc-z.js → _server.ts.js-BniUpesu.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/files/{_server.ts.js-BBm-d7Q_.js → _server.ts.js-B0WcXQJH.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/firstmate/chat/{_server.ts.js-CMM6ufeL.js → _server.ts.js-CncNeTwM.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/firstmate/commands/{_server.ts.js-DVh0xnbz.js → _server.ts.js-hnvcy9Ia.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/firstmate/dismiss/{_server.ts.js-B6rsXvtL.js → _server.ts.js-BQgc12gv.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/firstmate/input/{_server.ts.js-BcnbVb8B.js → _server.ts.js-Cpq1OUlv.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/firstmate/interrupt/{_server.ts.js-B2vtZDSn.js → _server.ts.js-DcduvTz-.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/firstmate/messages/{_server.ts.js-CqZYPGnv.js → _server.ts.js-r_OTtndR.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/firstmate/pick/{_server.ts.js-DyvHq1QM.js → _server.ts.js-DRc0m-xP.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/firstmate/reactions/{_server.ts.js-CkQOGcx8.js → _server.ts.js-DBrNAwQy.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/firstmate/start/{_server.ts.js-NlWKPhvj.js → _server.ts.js-D1Q8V-y_.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/fleet/{_server.ts.js-CGqQFYCY.js → _server.ts.js-cN8CO68M.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/gateway/{_server.ts.js-9kdSlog2.js → _server.ts.js-BSpvCzuX.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/health/{_server.ts.js-BmX4U6It.js → _server.ts.js-Cs9IYII5.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/inbox/{_server.ts.js-DGgwPazr.js → _server.ts.js-D2iFH361.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/inbox/report/{_server.ts.js-BhlPv4sX.js → _server.ts.js-BnZZNGqp.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/insights/{_server.ts.js-CBv70Y5L.js → _server.ts.js-6-pUqSbs.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/config/{_server.ts.js-ZFjBkYRX.js → _server.ts.js-BRHI8EzR.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/{_server.ts.js-Dye0RV5S.js → _server.ts.js-D75GJhqf.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/feedback/summary/{_server.ts.js-R01322_G.js → _server.ts.js-DXlq6GNe.js} +8 -8
- package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/icon/_icon_/{_server.ts.js-D9D-pKLW.js → _server.ts.js-DzCq67Pq.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/load/{_server.ts.js-bsKmmR9t.js → _server.ts.js-DP4Br_Kb.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/ui/_...path_/{_server.ts.js-KvMFVmRQ.js → _server.ts.js-BTZibvW1.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/plugins/_plugin_/update/{_server.ts.js-otZqZBEm.js → _server.ts.js-BVEiTedk.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/plugins/{_server.ts.js-BYHIZAYi.js → _server.ts.js-BARKIuL9.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/plugins/inspect/{_server.ts.js-BpZ3GTwz.js → _server.ts.js-vXn-DxW7.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/plugins/install/{_server.ts.js-Cl9zK50Z.js → _server.ts.js-BrTsfhpU.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/plugins/marketplace/{_server.ts.js-BGPTLoZC.js → _server.ts.js-uLUVa1Yc.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/plugins/marketplace/icon/_name_/{_server.ts.js-BVB932SW.js → _server.ts.js-fFGC33td.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/plugins/marketplace/registries/{_server.ts.js-D82HBSqM.js → _server.ts.js-CV30SKJH.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/plugins/roles/{_server.ts.js-CMSUPmoz.js → _server.ts.js-BmywjWsD.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/plugins/updates/{_server.ts.js-DgYB9fQH.js → _server.ts.js-C928jxXA.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/previews/check/{_server.ts.js-D87d2rZ_.js → _server.ts.js-DsVDHPoG.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/{_server.ts.js-KhwSPgmC.js → _server.ts.js-B5kai_f_.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/commands/{_server.ts.js-DZW5ka2V.js → _server.ts.js-DFdhVYKr.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/consent/{_server.ts.js-BNTbARpk.js → _server.ts.js-C3rHPgm9.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/draft/{_server.ts.js-DOrtYzqZ.js → _server.ts.js-GMslvRRG.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/file/{_server.ts.js-CUr8NM7B.js → _server.ts.js-G6S2vjwB.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/projects/_id_/passage/test/{_server.ts.js-2EJ0pusQ.js → _server.ts.js-nDbd4-FQ.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/second-mates/_id_/peek/{_server.ts.js-CElRDR1Y.js → _server.ts.js-v9aqCXY5.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/services/{_server.ts.js-DnOLyc7Y.js → _server.ts.js-BLxZZ6h-.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/setup/{_server.ts.js-CWMcwyIE.js → _server.ts.js-BViJ-Ufk.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/slots/{_server.ts.js-CG5PhG0B.js → _server.ts.js-T0HJn3Nc.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/{_server.ts.js-BaglzvAu.js → _server.ts.js-DN9vhG-X.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/artifacts/_...name_/{_server.ts.js-B-Etpm4f.js → _server.ts.js-azR55GM-.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/diff/{_server.ts.js-Bi4V_zBg.js → _server.ts.js-NfTPilV6.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/output/{_server.ts.js-BL8YDwGM.js → _server.ts.js-DzTACS2K.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/{_server.ts.js-Be6htkUX.js → _server.ts.js-iObKq15r.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/tasks/_id_/preview/helper/{_server.ts.js-D6RTMJ5Z.js → _server.ts.js-CFL0gv8m.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/vault/{_server.ts.js-C-MF_p4N.js → _server.ts.js-CxnJ6MH1.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/wheelhouse/source/{_server.ts.js-DH3NxauC.js → _server.ts.js-BzHUulBR.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/wheelhouse/update/{_server.ts.js-Cyptrvpa.js → _server.ts.js-CwIEgYLU.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/wheelhouse/upgrade/{_server.ts.js-zslRlgO8.js → _server.ts.js-BfV0Rwjv.js} +2 -2
- package/build/server/chunks/entries/endpoints/tasks/_id_/review/{_server.ts.js-BawOwof0.js → _server.ts.js-D0M-kf3z.js} +6 -6
- package/build/server/chunks/entries/{hooks.server.js-DoSFsv-T.js → hooks.server.js-BK27kVep.js} +6 -6
- package/build/server/chunks/entries/pages/{_layout.server.ts.js-Be39BJt8.js → _layout.server.ts.js-thMV7ofo.js} +2 -2
- package/build/server/chunks/entries/pages/{_page.server.ts.js-BP0lx7aM.js → _page.server.ts.js-IJJCfEOr.js} +2 -2
- package/build/server/chunks/entries/pages/decisions/{_page.server.ts.js-C_gST4Ql.js → _page.server.ts.js-BknW8CoP.js} +2 -2
- package/build/server/chunks/entries/pages/deck/{_page.server.ts.js-BmoQQEUP.js → _page.server.ts.js-FcsedjYb.js} +2 -2
- package/build/server/chunks/entries/pages/files/{_page.server.ts.js-CnW58Q1_.js → _page.server.ts.js-NxhxpluO.js} +2 -2
- package/build/server/chunks/entries/pages/harbour/{_page.server.ts.js-IwVthdWl.js → _page.server.ts.js-D0vCnVfw.js} +2 -2
- package/build/server/chunks/entries/pages/headroom/{_page.server.ts.js-BNwH-NUG.js → _page.server.ts.js-8pe9nMCl.js} +2 -2
- package/build/server/chunks/entries/pages/inbox/{_page.server.ts.js-Xn2rpOlN.js → _page.server.ts.js-D5ACh022.js} +2 -2
- package/build/server/chunks/entries/pages/plugins/_plugin_/_page_/{_page.server.ts.js-D9oc4Zbv.js → _page.server.ts.js-BKpNXqUB.js} +2 -2
- package/build/server/chunks/entries/pages/projects/_id_/{_page.server.ts.js-B8XcaDI6.js → _page.server.ts.js-DKtUeDFH.js} +3 -3
- package/build/server/chunks/entries/pages/projects/_id_/_plugin_/_tab_/{_page.server.ts.js-9PxhdtRJ.js → _page.server.ts.js-CAfpJ8z4.js} +3 -3
- package/build/server/chunks/entries/pages/projects/_id_/passage/{_page.server.ts.js-DRw5dO8q.js → _page.server.ts.js-DhvAOslS.js} +4 -4
- 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
- package/build/server/chunks/entries/pages/remotes/{_page.server.ts.js-DjYOr7fW.js → _page.server.ts.js-CFi9Cpz4.js} +2 -2
- package/build/server/chunks/entries/pages/settings/cloud/{_page.server.ts.js-DAG7EeWI.js → _page.server.ts.js-CGyBG4Yp.js} +2 -2
- package/build/server/chunks/entries/pages/settings/gateway/{_page.server.ts.js-CF7Pq68d.js → _page.server.ts.js-Bh0E2kwq.js} +2 -2
- package/build/server/chunks/entries/pages/settings/plugins/{_page.server.ts.js-BcUQwg4K.js → _page.server.ts.js-DcSZoBEC.js} +2 -2
- package/build/server/chunks/entries/pages/settings/plugins/_plugin_/{_page.server.ts.js-BRBNSxOW.js → _page.server.ts.js-v3Tp8x_0.js} +2 -2
- package/build/server/chunks/entries/pages/settings/setup/{_page.server.ts.js-CWdA2rpo.js → _page.server.ts.js-BnpgnteD.js} +2 -2
- package/build/server/chunks/entries/pages/settings/update/{_page.server.ts.js-Ddip-Rpl.js → _page.server.ts.js-DQfv8ZWG.js} +2 -2
- package/build/server/chunks/entries/pages/setup/{_page.server.ts.js-BeaxanMx.js → _page.server.ts.js-CvG2Lr9C.js} +3 -3
- package/build/server/chunks/entries/pages/tasks/_id_/{_page.server.ts.js-C_hg-0na.js → _page.server.ts.js-_ivyEUli.js} +3 -3
- package/build/server/chunks/entries/pages/tasks/_id_/doc/{_page.server.ts.js-DJFCXtwU.js → _page.server.ts.js-CSJ4X_eg.js} +2 -2
- package/build/server/chunks/entries/pages/time/{_page.server.ts.js-BPudgjHm.js → _page.server.ts.js-CUc80zxD.js} +2 -2
- package/build/server/chunks/{handler-BCGgzMNK.js → handler-CBnQILkF.js} +3 -3
- package/build/server/chunks/{index.js-D3B2sWMy.js → index.js-8K34DF7Q.js} +2 -2
- package/build/server/chunks/{manifest.js-wJn9bmrp.js → manifest.js-DqAt-2-E.js} +87 -87
- package/build/server/chunks/nodes/{0.js-zlZLRzvM.js → 0.js-B_9UrGRh.js} +8 -8
- package/build/server/chunks/nodes/{1.js--1gHO-TC.js → 1.js-DHSqapc6.js} +2 -2
- package/build/server/chunks/nodes/{10.js-R4llf3g7.js → 10.js-Cw8UPtK2.js} +2 -2
- package/build/server/chunks/nodes/{11.js-Nz-YFyz6.js → 11.js-BIyDysEr.js} +8 -8
- package/build/server/chunks/nodes/{12.js-BFoN1hdZ.js → 12.js-ClZNXjgF.js} +9 -9
- package/build/server/chunks/nodes/{13.js-C7uxCJSk.js → 13.js-B8qskPtO.js} +9 -9
- package/build/server/chunks/nodes/{14.js-KjfLhRwn.js → 14.js-DRbS2pR2.js} +10 -10
- package/build/server/chunks/nodes/{15.js-DbvBUigb.js → 15.js-EWY83mDS.js} +9 -9
- package/build/server/chunks/nodes/{16.js-C0p6-_Wc.js → 16.js-Cm0oYApC.js} +6 -6
- package/build/server/chunks/nodes/{17.js-OgyjPP8E.js → 17.js-Cu5a2UaQ.js} +2 -2
- package/build/server/chunks/nodes/{19.js-CjveYWJd.js → 19.js-B7TKyMV0.js} +6 -6
- package/build/server/chunks/nodes/{2.js-DBCmgKJ3.js → 2.js-DltTHZOL.js} +8 -8
- package/build/server/chunks/nodes/{20.js-BO7QgmVR.js → 20.js-CwLFSrxO.js} +8 -8
- package/build/server/chunks/nodes/{21.js-D1siyorn.js → 21.js-D_0U5UVP.js} +8 -8
- package/build/server/chunks/nodes/{22.js-BOJevTr3.js → 22.js-C2r9JmW7.js} +8 -8
- package/build/server/chunks/nodes/{23.js-By7E4CPh.js → 23.js-h4YwJvrO.js} +8 -8
- package/build/server/chunks/nodes/{24.js-CpltmZ68.js → 24.js-BciJ1KTf.js} +4 -4
- package/build/server/chunks/nodes/{25.js-lcZJHDCG.js → 25.js-ZCknzNaV.js} +8 -8
- package/build/server/chunks/nodes/{26.js-BeZ6lpoO.js → 26.js-BUolTInv.js} +9 -9
- package/build/server/chunks/nodes/{27.js-CLYqG4lL.js → 27.js-DcvlJkEN.js} +8 -8
- package/build/server/chunks/nodes/{28.js-CBfIHgUg.js → 28.js-DPp6-E4I.js} +8 -8
- package/build/server/chunks/nodes/{3.js-Bi0cxlWn.js → 3.js-CLE5bCBt.js} +8 -8
- package/build/server/chunks/nodes/{4.js-BzCAFdWl.js → 4.js-BXXDgWZn.js} +8 -8
- package/build/server/chunks/nodes/{5.js-CaYpi43a.js → 5.js-BtthxHsw.js} +7 -7
- package/build/server/chunks/nodes/{6.js-DiorXbJJ.js → 6.js-C3hPPfLf.js} +8 -8
- package/build/server/chunks/nodes/{7.js-CP1Kjbql.js → 7.js-v18x97qv.js} +8 -8
- package/build/server/chunks/nodes/{8.js-BuPd1Oz6.js → 8.js-Csojentz.js} +8 -8
- package/build/server/chunks/nodes/{9.js-Djv-sGNi.js → 9.js-3NVn9Z4u.js} +2 -2
- package/dist/cli.js +951 -81
- package/dist/wh-vault.js +1 -1
- package/package.json +1 -1
- package/skills/manage-wheelhouse/SKILL.md +1 -0
- package/skills/manage-wheelhouse/references/operations.md +48 -47
- package/build/client/_app/immutable/chunks/-PxedOl8.js.br +0 -0
- package/build/client/_app/immutable/chunks/-PxedOl8.js.gz +0 -0
- package/build/client/_app/immutable/chunks/8PhaMXz9.js.br +0 -0
- package/build/client/_app/immutable/chunks/8PhaMXz9.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BP2Qtph5.js.br +0 -0
- package/build/client/_app/immutable/chunks/BP2Qtph5.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BaV2UMay.js.br +0 -0
- package/build/client/_app/immutable/chunks/BaV2UMay.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C237xJzy.js.br +0 -0
- package/build/client/_app/immutable/chunks/C237xJzy.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CFyednqY.js.br +0 -3
- package/build/client/_app/immutable/chunks/CFyednqY.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CI38zzdF.js.br +0 -0
- package/build/client/_app/immutable/chunks/CI38zzdF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CIDO3V-e.js.br +0 -0
- package/build/client/_app/immutable/chunks/CIDO3V-e.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CLj8aQLL.js.br +0 -0
- package/build/client/_app/immutable/chunks/CXqiEZDa.js.br +0 -0
- package/build/client/_app/immutable/chunks/CXqiEZDa.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CYD68e6V.js.br +0 -0
- package/build/client/_app/immutable/chunks/CYD68e6V.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CejLiPvM.js.br +0 -0
- package/build/client/_app/immutable/chunks/CejLiPvM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CnNJ9y58.js.br +0 -0
- package/build/client/_app/immutable/chunks/CnNJ9y58.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cx2pfZgS.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cx2pfZgS.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DF5qBysY.js.br +0 -0
- package/build/client/_app/immutable/chunks/DF5qBysY.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DKuj2J54.js.br +0 -0
- package/build/client/_app/immutable/chunks/DKuj2J54.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DwipL_Cn.js.br +0 -0
- package/build/client/_app/immutable/chunks/DwipL_Cn.js.gz +0 -0
- package/build/client/_app/immutable/chunks/_wNDtuC3.js.br +0 -0
- package/build/client/_app/immutable/chunks/_wNDtuC3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/eaKSEJEz.js.br +0 -0
- package/build/client/_app/immutable/chunks/eaKSEJEz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/yB7gO-LO.js.br +0 -0
- package/build/client/_app/immutable/chunks/yB7gO-LO.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.BOOXafZJ.js.br +0 -0
- package/build/client/_app/immutable/entry/app.BOOXafZJ.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.C3VwH72E.js +0 -1
- package/build/client/_app/immutable/entry/start.C3VwH72E.js.br +0 -0
- package/build/client/_app/immutable/entry/start.C3VwH72E.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.py9DNAwX.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.py9DNAwX.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.CLi5bKEj.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.CLi5bKEj.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.yQfIVnsR.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.yQfIVnsR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.B0fQm_d5.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.B0fQm_d5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/12.DobuoNGx.js.br +0 -0
- package/build/client/_app/immutable/nodes/12.DobuoNGx.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.DrO72J_j.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.DrO72J_j.js.gz +0 -0
- package/build/client/_app/immutable/nodes/14.B9bNPNMC.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.B9bNPNMC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.0P3R4toY.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.BnUrhlYC.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.BnUrhlYC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/17.CHTdkvmi.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.CHTdkvmi.js.gz +0 -0
- package/build/client/_app/immutable/nodes/19.BqId6Q50.js.br +0 -0
- package/build/client/_app/immutable/nodes/19.BqId6Q50.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.CEJmYaPJ.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CEJmYaPJ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/20.CHH39Z2Z.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.CHH39Z2Z.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.CbnS5dV1.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.CbnS5dV1.js.gz +0 -0
- package/build/client/_app/immutable/nodes/22.malZaF0r.js.br +0 -0
- package/build/client/_app/immutable/nodes/22.malZaF0r.js.gz +0 -0
- package/build/client/_app/immutable/nodes/23.B-MnoGp_.js.br +0 -0
- package/build/client/_app/immutable/nodes/23.B-MnoGp_.js.gz +0 -0
- package/build/client/_app/immutable/nodes/24.D4YfUDkp.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.D4YfUDkp.js.gz +0 -0
- package/build/client/_app/immutable/nodes/25.CGUyx5gm.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.CGUyx5gm.js.gz +0 -0
- package/build/client/_app/immutable/nodes/26.CSoLyIuT.js.br +0 -0
- package/build/client/_app/immutable/nodes/26.CSoLyIuT.js.gz +0 -0
- package/build/client/_app/immutable/nodes/28.CnDXbxut.js.br +0 -0
- package/build/client/_app/immutable/nodes/28.CnDXbxut.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.7M8y-hh1.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.7M8y-hh1.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.C-_GUkXF.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.C-_GUkXF.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.BtFuhrhK.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.BtFuhrhK.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.YcUXbAew.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.YcUXbAew.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.DsZ8ckdf.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.DsZ8ckdf.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.C_to2yZ7.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.C_to2yZ7.js.gz +0 -0
package/dist/cli.js
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
import { fork, spawn as spawn4 } from "node:child_process";
|
|
5
5
|
import { existsSync as existsSync3 } from "node:fs";
|
|
6
6
|
import { createServer } from "node:http";
|
|
7
|
-
import
|
|
8
|
-
import { fileURLToPath as
|
|
9
|
-
import { Command as
|
|
7
|
+
import path28 from "node:path";
|
|
8
|
+
import { fileURLToPath as fileURLToPath3, pathToFileURL } from "node:url";
|
|
9
|
+
import { Command as Command6, InvalidArgumentError as InvalidArgumentError3 } from "commander";
|
|
10
10
|
|
|
11
11
|
// package.json
|
|
12
|
-
var version = "0.
|
|
12
|
+
var version = "0.17.1";
|
|
13
13
|
|
|
14
14
|
// src/lib/harness.ts
|
|
15
15
|
var HARNESSES = ["claude", "codex", "opencode", "pi"];
|
|
@@ -28,7 +28,7 @@ import path2 from "node:path";
|
|
|
28
28
|
import { createInterface } from "node:readline/promises";
|
|
29
29
|
|
|
30
30
|
// src/lib/server/sessions/tmux.ts
|
|
31
|
-
import { accessSync, constants, statSync } from "node:fs";
|
|
31
|
+
import { accessSync, constants, rmSync, statSync, writeFileSync } from "node:fs";
|
|
32
32
|
import path from "node:path";
|
|
33
33
|
|
|
34
34
|
// src/lib/server/firstmate/exec.ts
|
|
@@ -214,7 +214,30 @@ var DROPPED_VARIABLES = [
|
|
|
214
214
|
"CODEX_INTERNAL_ORIGINATOR_OVERRIDE"
|
|
215
215
|
];
|
|
216
216
|
var DROP = new Set(DROPPED_VARIABLES);
|
|
217
|
+
var COMMAND_UNSET = [
|
|
218
|
+
...DROPPED_VARIABLES,
|
|
219
|
+
"CLAUDE_CODE_CHILD_SESSION",
|
|
220
|
+
"CLAUDE_CODE_SESSION_ID",
|
|
221
|
+
"CLAUDE_CODE_SESSION_ATTENDED",
|
|
222
|
+
"CLAUDE_CODE_EXECPATH",
|
|
223
|
+
"CLAUDE_EFFORT"
|
|
224
|
+
];
|
|
217
225
|
var PASTE_MAX_INPUT_BYTES = 65 * 1024;
|
|
226
|
+
var PANE_VARIABLES = [
|
|
227
|
+
"TMUX",
|
|
228
|
+
"TMUX_PANE",
|
|
229
|
+
"TERM",
|
|
230
|
+
"TERM_PROGRAM",
|
|
231
|
+
"TERM_PROGRAM_VERSION",
|
|
232
|
+
"COLORTERM"
|
|
233
|
+
];
|
|
234
|
+
var SESSION_SCRIPT = [
|
|
235
|
+
`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`,
|
|
236
|
+
'. "$1"',
|
|
237
|
+
'/bin/rm -f "$1"',
|
|
238
|
+
"shift",
|
|
239
|
+
'exec "$@"'
|
|
240
|
+
].join("\n");
|
|
218
241
|
|
|
219
242
|
// cli/harness.ts
|
|
220
243
|
async function savedHarness(file) {
|
|
@@ -836,8 +859,8 @@ function fingerprint(publicKey) {
|
|
|
836
859
|
return base32(digest.subarray(0, 10)).match(/.{4}/g).join("-");
|
|
837
860
|
}
|
|
838
861
|
function signed(key, context, ...fields) {
|
|
839
|
-
const
|
|
840
|
-
return b64u(sign(null, Buffer.from(
|
|
862
|
+
const message2 = [context, ...fields.map(String)].join("\n");
|
|
863
|
+
return b64u(sign(null, Buffer.from(message2, "utf8"), key.privateKey));
|
|
841
864
|
}
|
|
842
865
|
var pollSig = (key, pairingId) => signed(key, "whc-pair-poll-v1", pairingId);
|
|
843
866
|
var unpairSig = (key, deviceId, ts) => signed(key, "whc-unpair-v1", deviceId, ts);
|
|
@@ -895,8 +918,8 @@ var HOP_BY_HOP = /* @__PURE__ */ new Set([
|
|
|
895
918
|
"transfer-encoding",
|
|
896
919
|
"upgrade"
|
|
897
920
|
]);
|
|
898
|
-
function isRestartPath(
|
|
899
|
-
let p =
|
|
921
|
+
function isRestartPath(path29) {
|
|
922
|
+
let p = path29.split(/[?#]/, 1)[0];
|
|
900
923
|
for (let i = 0; i < 3; i++) {
|
|
901
924
|
try {
|
|
902
925
|
const d = decodeURIComponent(p);
|
|
@@ -1505,7 +1528,7 @@ var CloudSettings = class {
|
|
|
1505
1528
|
async view(viaRelay = false) {
|
|
1506
1529
|
const { settings: settings2, error } = await this.read();
|
|
1507
1530
|
const found = settings2.device ? await this.findKey() : null;
|
|
1508
|
-
const
|
|
1531
|
+
const status2 = await this.readStatus();
|
|
1509
1532
|
const device = settings2.device && found ? {
|
|
1510
1533
|
id: settings2.device.id,
|
|
1511
1534
|
name: settings2.device.name,
|
|
@@ -1516,7 +1539,7 @@ var CloudSettings = class {
|
|
|
1516
1539
|
pinnedAt: settings2.device.pinnedAt,
|
|
1517
1540
|
pending: pendingView(settings2.device)
|
|
1518
1541
|
} : null;
|
|
1519
|
-
const live =
|
|
1542
|
+
const live = status2 && device && status2.deviceId === device.id && alive(status2.pid) ? status2 : null;
|
|
1520
1543
|
let state;
|
|
1521
1544
|
let reason = error;
|
|
1522
1545
|
if (!settings2.enabled) state = "off";
|
|
@@ -1524,19 +1547,19 @@ var CloudSettings = class {
|
|
|
1524
1547
|
state = "not-paired";
|
|
1525
1548
|
if (settings2.device && !found) {
|
|
1526
1549
|
reason = "This machine\u2019s device key is missing, so it cannot connect. Pair it again.";
|
|
1527
|
-
} else if (
|
|
1528
|
-
reason =
|
|
1550
|
+
} else if (status2?.state === "stopped" && status2.reason) {
|
|
1551
|
+
reason = status2.reason;
|
|
1529
1552
|
}
|
|
1530
1553
|
} else if (!live) {
|
|
1531
1554
|
if (!settings2.started) state = "off";
|
|
1532
1555
|
else
|
|
1533
|
-
state =
|
|
1534
|
-
if (state === "stopped") reason =
|
|
1556
|
+
state = status2 && status2.deviceId === device.id && status2.state === "stopped" && status2.reason ? "stopped" : "not-running";
|
|
1557
|
+
if (state === "stopped") reason = status2.reason;
|
|
1535
1558
|
} else {
|
|
1536
1559
|
state = live.state === "online" ? "online" : live.state === "stopped" ? "stopped" : "connecting";
|
|
1537
1560
|
reason = live.reason ?? reason;
|
|
1538
1561
|
}
|
|
1539
|
-
const recent =
|
|
1562
|
+
const recent = status2 && device && status2.deviceId === device.id ? status2 : null;
|
|
1540
1563
|
return {
|
|
1541
1564
|
schema: "wheelhouse-cloud.v1",
|
|
1542
1565
|
enabled: settings2.enabled,
|
|
@@ -1701,9 +1724,9 @@ var Relay = class {
|
|
|
1701
1724
|
s.ws.send(payload, { binary: kind === FRAME_WS_BINARY }, () => this.passed(s, payload.length));
|
|
1702
1725
|
}
|
|
1703
1726
|
/** A relay session ended, or is no longer served: every stream of it is reset. */
|
|
1704
|
-
endSession(sessionId,
|
|
1727
|
+
endSession(sessionId, message2) {
|
|
1705
1728
|
for (const s of [...this.streams.values()]) {
|
|
1706
|
-
if (s.session === sessionId) this.reset(s.id, "refused",
|
|
1729
|
+
if (s.session === sessionId) this.reset(s.id, "refused", message2);
|
|
1707
1730
|
}
|
|
1708
1731
|
}
|
|
1709
1732
|
/** The device socket is gone: every stream on it ends (§7). */
|
|
@@ -1769,13 +1792,13 @@ var Relay = class {
|
|
|
1769
1792
|
else if (s.ended) this.finish(s);
|
|
1770
1793
|
else s.res?.resume();
|
|
1771
1794
|
}
|
|
1772
|
-
reset(id, code,
|
|
1795
|
+
reset(id, code, message2, extra = {}) {
|
|
1773
1796
|
const was = this.streams.has(id);
|
|
1774
1797
|
this.drop(id);
|
|
1775
1798
|
if (was || extra.force) {
|
|
1776
1799
|
const { force: _, ...rest } = extra;
|
|
1777
1800
|
void _;
|
|
1778
|
-
this.opts.send({ t: "reset", id, code, ...
|
|
1801
|
+
this.opts.send({ t: "reset", id, code, ...message2 ? { message: message2 } : {}, ...rest });
|
|
1779
1802
|
}
|
|
1780
1803
|
}
|
|
1781
1804
|
/** Forget a stream and abort its local side, sending nothing. */
|
|
@@ -1809,8 +1832,8 @@ var Relay = class {
|
|
|
1809
1832
|
if (this.streams.size >= this.opts.limits.maxStreams) return { ok: false, code: "limit" };
|
|
1810
1833
|
const relay = parseRelay(msg.relay);
|
|
1811
1834
|
const headers = parseHeaders(msg.headers);
|
|
1812
|
-
const
|
|
1813
|
-
if (!relay || !headers || typeof
|
|
1835
|
+
const path29 = msg.path;
|
|
1836
|
+
if (!relay || !headers || typeof path29 !== "string" || !path29.startsWith("/") || path29.length > 8192 || !headerSafe(path29) || path29.includes(" ")) {
|
|
1814
1837
|
return { ok: false, code: "protocol", message: "The request is malformed." };
|
|
1815
1838
|
}
|
|
1816
1839
|
const refusal = this.opts.sessionRefusal?.(relay.sessionId);
|
|
@@ -1822,7 +1845,7 @@ var Relay = class {
|
|
|
1822
1845
|
message: "Wheelhouse Cloud is turned off on this machine."
|
|
1823
1846
|
};
|
|
1824
1847
|
}
|
|
1825
|
-
if (isRestartPath(
|
|
1848
|
+
if (isRestartPath(path29)) {
|
|
1826
1849
|
return {
|
|
1827
1850
|
ok: false,
|
|
1828
1851
|
code: "refused",
|
|
@@ -1832,7 +1855,7 @@ var Relay = class {
|
|
|
1832
1855
|
const target = isObj2(msg.target) ? msg.target : {};
|
|
1833
1856
|
const app = this.opts.targets.appPort();
|
|
1834
1857
|
if (target.kind === "app") {
|
|
1835
|
-
return { ok: true, port: app, host: "127.0.0.1", path:
|
|
1858
|
+
return { ok: true, port: app, host: "127.0.0.1", path: path29, headers, relay };
|
|
1836
1859
|
}
|
|
1837
1860
|
const port = target.port;
|
|
1838
1861
|
if (target.kind !== "port" || typeof port !== "number" || !Number.isInteger(port) || port < 1 || port > 65535) {
|
|
@@ -1843,7 +1866,7 @@ var Relay = class {
|
|
|
1843
1866
|
}
|
|
1844
1867
|
const late = this.opts.sessionRefusal?.(relay.sessionId);
|
|
1845
1868
|
if (late) return { ok: false, code: "refused", message: late };
|
|
1846
|
-
return { ok: true, port, host: "localhost", path:
|
|
1869
|
+
return { ok: true, port, host: "localhost", path: path29, headers, relay };
|
|
1847
1870
|
}
|
|
1848
1871
|
/** §6.3: the headers for the local request. */
|
|
1849
1872
|
localHeaders(a, originChecked, ws) {
|
|
@@ -1926,8 +1949,8 @@ var Relay = class {
|
|
|
1926
1949
|
}
|
|
1927
1950
|
this.opts.send({ t: "res", id: s.id, status: res.statusCode ?? 502, headers });
|
|
1928
1951
|
this.touch(s);
|
|
1929
|
-
const
|
|
1930
|
-
if (method === "HEAD" ||
|
|
1952
|
+
const status2 = res.statusCode ?? 0;
|
|
1953
|
+
if (method === "HEAD" || status2 === 204 || status2 === 304) {
|
|
1931
1954
|
res.resume();
|
|
1932
1955
|
this.finish(s);
|
|
1933
1956
|
return;
|
|
@@ -1986,12 +2009,12 @@ var Relay = class {
|
|
|
1986
2009
|
if (!this.opened(s)) return;
|
|
1987
2010
|
const mine = () => this.streams.get(id) === s;
|
|
1988
2011
|
ws.on("unexpected-response", (req, res) => {
|
|
1989
|
-
const
|
|
2012
|
+
const status2 = res.statusCode ?? 502;
|
|
1990
2013
|
res.resume();
|
|
1991
2014
|
req.destroy();
|
|
1992
2015
|
if (mine())
|
|
1993
|
-
this.reset(id,
|
|
1994
|
-
status
|
|
2016
|
+
this.reset(id, status2 === 403 || status2 === 401 ? "refused" : "unreachable", void 0, {
|
|
2017
|
+
status: status2
|
|
1995
2018
|
});
|
|
1996
2019
|
});
|
|
1997
2020
|
ws.on("open", () => {
|
|
@@ -2607,7 +2630,7 @@ async function writeInstalled(dir, installed) {
|
|
|
2607
2630
|
}
|
|
2608
2631
|
|
|
2609
2632
|
// src/lib/server/setup/remembered.ts
|
|
2610
|
-
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
2633
|
+
import { mkdirSync, readFileSync, renameSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
2611
2634
|
import path7 from "node:path";
|
|
2612
2635
|
var REMEMBERED_FILE = "firstmate.json";
|
|
2613
2636
|
var rememberedFile = (configDir) => path7.join(configDir, REMEMBERED_FILE);
|
|
@@ -2672,7 +2695,7 @@ function isInside(p, dir) {
|
|
|
2672
2695
|
}
|
|
2673
2696
|
|
|
2674
2697
|
// src/lib/server/sessions/choice.ts
|
|
2675
|
-
import { mkdirSync as mkdirSync2, readFileSync as readFileSync2, renameSync as renameSync2, rmSync, writeFileSync as
|
|
2698
|
+
import { mkdirSync as mkdirSync2, readFileSync as readFileSync2, renameSync as renameSync2, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
2676
2699
|
import path9 from "node:path";
|
|
2677
2700
|
var SESSION_BACKENDS = ["tmux", "herdr"];
|
|
2678
2701
|
var SESSION_BACKEND_FILE = "session-backend.json";
|
|
@@ -2755,14 +2778,6 @@ function resolveSessionBackend(opts) {
|
|
|
2755
2778
|
var DEFAULT_HERDR_SESSION = "wheelhouse";
|
|
2756
2779
|
var HERDR_SESSION = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
|
|
2757
2780
|
var PASTE_MAX_BYTES = 65 * 1024;
|
|
2758
|
-
var PANE_UNSET = [
|
|
2759
|
-
...DROPPED_VARIABLES,
|
|
2760
|
-
"CLAUDE_CODE_CHILD_SESSION",
|
|
2761
|
-
"CLAUDE_CODE_SESSION_ID",
|
|
2762
|
-
"CLAUDE_CODE_SESSION_ATTENDED",
|
|
2763
|
-
"CLAUDE_CODE_EXECPATH",
|
|
2764
|
-
"CLAUDE_EFFORT"
|
|
2765
|
-
];
|
|
2766
2781
|
|
|
2767
2782
|
// src/lib/server/restart.ts
|
|
2768
2783
|
var KEY = /* @__PURE__ */ Symbol.for("wheelhouse.restart");
|
|
@@ -2772,7 +2787,7 @@ function setRestart(fn) {
|
|
|
2772
2787
|
}
|
|
2773
2788
|
|
|
2774
2789
|
// src/lib/server/upgrade/settings.ts
|
|
2775
|
-
import { existsSync as existsSync2, readFileSync as readFileSync3, rmSync as
|
|
2790
|
+
import { existsSync as existsSync2, readFileSync as readFileSync3, rmSync as rmSync3 } from "node:fs";
|
|
2776
2791
|
import path10 from "node:path";
|
|
2777
2792
|
var updateDir = (configDir) => path10.join(configDir, "update");
|
|
2778
2793
|
var handoffFile = (configDir) => path10.join(updateDir(configDir), "next-install");
|
|
@@ -2784,7 +2799,7 @@ function takeHandoff(configDir) {
|
|
|
2784
2799
|
} catch {
|
|
2785
2800
|
return null;
|
|
2786
2801
|
}
|
|
2787
|
-
|
|
2802
|
+
rmSync3(file, { force: true });
|
|
2788
2803
|
if (!dir || !path10.isAbsolute(dir)) return null;
|
|
2789
2804
|
const built = existsSync2(path10.join(dir, "dist", "cli.js")) && existsSync2(path10.join(dir, "build", "handler.js"));
|
|
2790
2805
|
return built ? dir : null;
|
|
@@ -2822,9 +2837,9 @@ var wsTransport = {
|
|
|
2822
2837
|
}
|
|
2823
2838
|
};
|
|
2824
2839
|
var DiscordError = class extends Error {
|
|
2825
|
-
constructor(
|
|
2826
|
-
super(
|
|
2827
|
-
this.status =
|
|
2840
|
+
constructor(status2, message2) {
|
|
2841
|
+
super(message2);
|
|
2842
|
+
this.status = status2;
|
|
2828
2843
|
this.name = "DiscordError";
|
|
2829
2844
|
}
|
|
2830
2845
|
status;
|
|
@@ -2911,8 +2926,8 @@ async function checkDiscordToken(token, opts = {}) {
|
|
|
2911
2926
|
publicBot: typeof app?.bot_public === "boolean" ? app.bot_public : null
|
|
2912
2927
|
};
|
|
2913
2928
|
} catch (e) {
|
|
2914
|
-
const
|
|
2915
|
-
if (
|
|
2929
|
+
const status2 = e instanceof DiscordError ? e.status : 0;
|
|
2930
|
+
if (status2 === 401)
|
|
2916
2931
|
return {
|
|
2917
2932
|
ok: false,
|
|
2918
2933
|
error: "Discord refused this token: it is not a valid bot token, or it was reset."
|
|
@@ -4172,7 +4187,7 @@ async function exists(p) {
|
|
|
4172
4187
|
|
|
4173
4188
|
// cli/running.ts
|
|
4174
4189
|
import { randomBytes as randomBytes6, timingSafeEqual } from "node:crypto";
|
|
4175
|
-
import { mkdirSync as mkdirSync3, rmSync as
|
|
4190
|
+
import { mkdirSync as mkdirSync3, rmSync as rmSync4, writeFileSync as writeFileSync4 } from "node:fs";
|
|
4176
4191
|
import { readdir, readFile as readFile7, rm as rm5 } from "node:fs/promises";
|
|
4177
4192
|
import path15 from "node:path";
|
|
4178
4193
|
var RESTART_EXIT = 75;
|
|
@@ -4184,12 +4199,12 @@ function writeRunning(pluginsDir, r) {
|
|
|
4184
4199
|
const dir = path15.join(pluginsDir, RUNNING_DIR);
|
|
4185
4200
|
mkdirSync3(dir, { recursive: true, mode: 448 });
|
|
4186
4201
|
const file = path15.join(dir, `${r.pid}.json`);
|
|
4187
|
-
|
|
4202
|
+
writeFileSync4(file, `${JSON.stringify(r)}
|
|
4188
4203
|
`, { mode: 384 });
|
|
4189
4204
|
return file;
|
|
4190
4205
|
}
|
|
4191
4206
|
function removeRunning(file) {
|
|
4192
|
-
|
|
4207
|
+
rmSync4(file, { force: true });
|
|
4193
4208
|
}
|
|
4194
4209
|
var sameToken = (got, want) => {
|
|
4195
4210
|
const a = Buffer.from(got);
|
|
@@ -4691,7 +4706,7 @@ function remoteCommand(over = {}) {
|
|
|
4691
4706
|
platform: `${process.platform}-${process.arch}`,
|
|
4692
4707
|
version
|
|
4693
4708
|
});
|
|
4694
|
-
const
|
|
4709
|
+
const keep2 = async (settings2, gateway, key, name, device) => {
|
|
4695
4710
|
const where = await keepDevice(settings2, gateway, key, name, device);
|
|
4696
4711
|
deps.log(
|
|
4697
4712
|
`Connected: ${device.name || name}${device.user ? `, approved by ${device.user}` : ""}.`
|
|
@@ -4742,7 +4757,7 @@ function remoteCommand(over = {}) {
|
|
|
4742
4757
|
deps.log(`Waiting for approval (the code works for ${mins} minutes)\u2026`);
|
|
4743
4758
|
const outcome = await pollPairing(gateway, key, p, deps.pairing);
|
|
4744
4759
|
if (outcome.status !== "approved") return fail(`${outcome.reason} Nothing was paired.`);
|
|
4745
|
-
await
|
|
4760
|
+
await keep2(settings2, gateway, key, name, outcome.device);
|
|
4746
4761
|
deps.log(
|
|
4747
4762
|
"Start it on the Remotes page in Wheelhouse, which keeps the connection up while `wheelhouse open` runs; or run `wheelhouse remote run`."
|
|
4748
4763
|
);
|
|
@@ -4925,7 +4940,7 @@ function remoteCommand(over = {}) {
|
|
|
4925
4940
|
const outcome = await Promise.race([pollPairing(gateway, key, p, deps.pairing), stopped]);
|
|
4926
4941
|
if (!outcome) return false;
|
|
4927
4942
|
if (outcome.status === "approved") {
|
|
4928
|
-
await
|
|
4943
|
+
await keep2(settings2, gateway, key, m.name, outcome.device);
|
|
4929
4944
|
return true;
|
|
4930
4945
|
}
|
|
4931
4946
|
if (outcome.status !== "expired") {
|
|
@@ -4942,6 +4957,860 @@ function remoteCommand(over = {}) {
|
|
|
4942
4957
|
return cmd;
|
|
4943
4958
|
}
|
|
4944
4959
|
|
|
4960
|
+
// cli/skills.ts
|
|
4961
|
+
import path25 from "node:path";
|
|
4962
|
+
import { fileURLToPath } from "node:url";
|
|
4963
|
+
import { Command as Command4 } from "commander";
|
|
4964
|
+
|
|
4965
|
+
// src/lib/server/material/ops.ts
|
|
4966
|
+
import { execFile as execFile3 } from "node:child_process";
|
|
4967
|
+
import { mkdtemp as mkdtemp3, readFile as readFile13, rm as rm9 } from "node:fs/promises";
|
|
4968
|
+
import { tmpdir } from "node:os";
|
|
4969
|
+
import path24 from "node:path";
|
|
4970
|
+
|
|
4971
|
+
// src/lib/server/material/bundle.ts
|
|
4972
|
+
import { readFile as readFile8 } from "node:fs/promises";
|
|
4973
|
+
import path18 from "node:path";
|
|
4974
|
+
var REVIEW_SURFACE_MARKER = "<!-- wheelhouse:review-surface -->";
|
|
4975
|
+
var SKILLS = [
|
|
4976
|
+
{
|
|
4977
|
+
name: "manage-wheelhouse",
|
|
4978
|
+
files: ["SKILL.md", "references/operations.md"],
|
|
4979
|
+
assumptions: [
|
|
4980
|
+
{ file: "bin/fm-inbox.sh", marker: "fm-inbox.sh reply" },
|
|
4981
|
+
{ file: "bin/fm-inbox.sh", marker: "fm-inbox.sh receipts" }
|
|
4982
|
+
]
|
|
4983
|
+
}
|
|
4984
|
+
];
|
|
4985
|
+
var plain = (s) => s.replace(/[^\p{L}\p{N} ._()-]+/gu, " ").replace(/\s+/g, " ").trim().slice(0, 60) || "the plugin";
|
|
4986
|
+
function reviewSurfaceSection(surface) {
|
|
4987
|
+
if (!surface) {
|
|
4988
|
+
return [
|
|
4989
|
+
"Active review surface: **built-in**. Firstmate\u2019s Lavish boards and Wheelhouse\u2019s live preview, with its preview helper, are how the captain reviews work.",
|
|
4990
|
+
"Show the captain an HTML artifact as Firstmate\u2019s own Lavish rule says, and a running app by reporting `preview <url>` (see Preview cards below).",
|
|
4991
|
+
"Wheelhouse rewrites this section when the captain chooses a review-surface plugin in Settings \u2192 Plugins (`GET /api/plugins` lists `roles`)."
|
|
4992
|
+
].join(" ");
|
|
4993
|
+
}
|
|
4994
|
+
const name = plain(surface.name);
|
|
4995
|
+
const where = surface.repository ? `its README in https://github.com/${surface.repository}` : "`wheelhouse plugin list` and `GET /api/plugins`";
|
|
4996
|
+
return [
|
|
4997
|
+
`Active review surface: **${name}** (the \`${surface.id}\` plugin), chosen by the captain in Wheelhouse Settings \u2192 Plugins. While it is on it replaces Lavish and Wheelhouse\u2019s preview helper.`,
|
|
4998
|
+
"",
|
|
4999
|
+
`- Use ${name} instead of Lavish for anything you or a worker would show the captain: an HTML artifact, a board, a design, a running app. This overrides the Lavish line in scout and worker briefs: open no Lavish board for the captain while this section names a plugin, and when you write a brief, tell the worker to use ${name} instead of Lavish.`,
|
|
5000
|
+
`- A running app still reports \`preview <url>\` (see Preview cards below); Wheelhouse shows ${name}\u2019s button as the primary action on that preview, with no preview helper or board link.`,
|
|
5001
|
+
`- How to use ${name} is the plugin\u2019s own; see ${where}. When it cannot show something, tell the captain rather than quietly falling back to Lavish.`,
|
|
5002
|
+
`- Wheelhouse rewrites this section whenever the role changes: the captain chooses another plugin or the built-in, or turns ${name} off or removes it.`
|
|
5003
|
+
].join("\n");
|
|
5004
|
+
}
|
|
5005
|
+
async function renderSkill(skillsRoot, skill, inputs) {
|
|
5006
|
+
const tree = {};
|
|
5007
|
+
for (const file of skill.files) {
|
|
5008
|
+
const text2 = await readFile8(path18.join(skillsRoot, skill.name, file), "utf8");
|
|
5009
|
+
tree[file] = file === "SKILL.md" ? text2.replace(REVIEW_SURFACE_MARKER, () => reviewSurfaceSection(inputs.reviewSurface)) : text2;
|
|
5010
|
+
}
|
|
5011
|
+
return tree;
|
|
5012
|
+
}
|
|
5013
|
+
|
|
5014
|
+
// src/lib/server/material/files.ts
|
|
5015
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
5016
|
+
import { lstat as lstat3, mkdir as mkdir7, readFile as readFile9, readdir as readdir2, realpath as realpath4, rename as rename7, rm as rm6, writeFile as writeFile6 } from "node:fs/promises";
|
|
5017
|
+
import path19 from "node:path";
|
|
5018
|
+
var sha2562 = (text2) => createHash5("sha256").update(text2).digest("hex");
|
|
5019
|
+
var hashTree = (tree) => Object.fromEntries(Object.entries(tree).map(([file, text2]) => [file, sha2562(text2)]));
|
|
5020
|
+
function sameHashes(a, b) {
|
|
5021
|
+
const keys = Object.keys(a);
|
|
5022
|
+
return keys.length === Object.keys(b).length && keys.every((k) => b[k] === a[k]);
|
|
5023
|
+
}
|
|
5024
|
+
async function present(file) {
|
|
5025
|
+
try {
|
|
5026
|
+
await lstat3(file);
|
|
5027
|
+
return true;
|
|
5028
|
+
} catch (e) {
|
|
5029
|
+
if (e.code === "ENOENT") return false;
|
|
5030
|
+
throw e;
|
|
5031
|
+
}
|
|
5032
|
+
}
|
|
5033
|
+
async function physical(file) {
|
|
5034
|
+
try {
|
|
5035
|
+
return await realpath4(file);
|
|
5036
|
+
} catch (e) {
|
|
5037
|
+
if (e.code !== "ENOENT") throw e;
|
|
5038
|
+
const parent = path19.dirname(file);
|
|
5039
|
+
if (parent === file) throw e;
|
|
5040
|
+
return path19.join(await physical(parent), path19.basename(file));
|
|
5041
|
+
}
|
|
5042
|
+
}
|
|
5043
|
+
async function insideAny(targets, protectedDirs) {
|
|
5044
|
+
const real2 = await Promise.all(targets.map(physical));
|
|
5045
|
+
for (const dir of protectedDirs) {
|
|
5046
|
+
const p = await physical(path19.resolve(dir));
|
|
5047
|
+
if (real2.some((t) => t === p || t.startsWith(p + path19.sep))) return true;
|
|
5048
|
+
}
|
|
5049
|
+
return false;
|
|
5050
|
+
}
|
|
5051
|
+
async function readTree(dir, prefix = "") {
|
|
5052
|
+
const tree = {};
|
|
5053
|
+
for (const entry2 of await readdir2(dir, { withFileTypes: true })) {
|
|
5054
|
+
const rel = prefix + entry2.name;
|
|
5055
|
+
if (entry2.isDirectory())
|
|
5056
|
+
Object.assign(tree, await readTree(path19.join(dir, entry2.name), rel + "/"));
|
|
5057
|
+
else if (entry2.isFile()) tree[rel] = await readFile9(path19.join(dir, entry2.name), "utf8");
|
|
5058
|
+
else throw new Error(`${rel} is a symbolic link or special file.`);
|
|
5059
|
+
}
|
|
5060
|
+
return tree;
|
|
5061
|
+
}
|
|
5062
|
+
async function writeTree(dir, tree) {
|
|
5063
|
+
for (const [file, text2] of Object.entries(tree)) {
|
|
5064
|
+
await mkdir7(path19.dirname(path19.join(dir, file)), { recursive: true });
|
|
5065
|
+
await writeFile6(path19.join(dir, file), text2);
|
|
5066
|
+
}
|
|
5067
|
+
}
|
|
5068
|
+
async function replaceTree(dir, tree) {
|
|
5069
|
+
const stage = `${dir}.new-${process.pid}-${Date.now()}`;
|
|
5070
|
+
await rm6(stage, { recursive: true, force: true });
|
|
5071
|
+
await writeTree(stage, tree);
|
|
5072
|
+
await mkdir7(stage, { recursive: true });
|
|
5073
|
+
await rm6(dir, { recursive: true, force: true });
|
|
5074
|
+
await rename7(stage, dir);
|
|
5075
|
+
}
|
|
5076
|
+
async function writeAtomic3(file, text2, mode = 384) {
|
|
5077
|
+
await mkdir7(path19.dirname(file), { recursive: true });
|
|
5078
|
+
const tmp = `${file}.${process.pid}-${Date.now()}.tmp`;
|
|
5079
|
+
await writeFile6(tmp, text2, { mode });
|
|
5080
|
+
await rename7(tmp, file);
|
|
5081
|
+
}
|
|
5082
|
+
|
|
5083
|
+
// src/lib/server/material/manifest.ts
|
|
5084
|
+
import { readFile as readFile10, rename as rename8, rm as rm7 } from "node:fs/promises";
|
|
5085
|
+
import path20 from "node:path";
|
|
5086
|
+
var MANIFEST_SCHEMA = "wheelhouse-material.v1";
|
|
5087
|
+
var HISTORY_MAX = 50;
|
|
5088
|
+
var materialDir = (configDir) => path20.join(configDir, "agent-material");
|
|
5089
|
+
var manifestFile = (dir) => path20.join(dir, "manifest.json");
|
|
5090
|
+
var settingsFile = (dir) => path20.join(dir, "settings.json");
|
|
5091
|
+
var folder = (id) => id.replace(/[^A-Za-z0-9@._-]/g, "_");
|
|
5092
|
+
var baseDir = (dir, id) => path20.join(dir, "base", folder(id));
|
|
5093
|
+
var proposedDir = (dir, id) => path20.join(dir, "proposed", folder(id));
|
|
5094
|
+
var backupDir = (dir, id, at) => path20.join(dir, "backup", folder(id), at.toISOString().replace(/[:.]/g, "-"));
|
|
5095
|
+
function emptyManifest(version2, harness) {
|
|
5096
|
+
return {
|
|
5097
|
+
schema: MANIFEST_SCHEMA,
|
|
5098
|
+
wheelhouse: { version: version2 },
|
|
5099
|
+
firstmate: null,
|
|
5100
|
+
render: { reviewSurface: null, harness },
|
|
5101
|
+
items: {},
|
|
5102
|
+
history: []
|
|
5103
|
+
};
|
|
5104
|
+
}
|
|
5105
|
+
function valid(m) {
|
|
5106
|
+
const x = m;
|
|
5107
|
+
return !!x && x.schema === MANIFEST_SCHEMA && typeof x.items === "object" && x.items !== null && Array.isArray(x.history) && typeof x.render === "object" && x.render !== null;
|
|
5108
|
+
}
|
|
5109
|
+
async function readManifest(dir, look = false) {
|
|
5110
|
+
const file = manifestFile(dir);
|
|
5111
|
+
let text2;
|
|
5112
|
+
try {
|
|
5113
|
+
text2 = await readFile10(file, "utf8");
|
|
5114
|
+
} catch (e) {
|
|
5115
|
+
if (e.code === "ENOENT") return null;
|
|
5116
|
+
throw e;
|
|
5117
|
+
}
|
|
5118
|
+
try {
|
|
5119
|
+
const m = JSON.parse(text2);
|
|
5120
|
+
if (valid(m)) return m;
|
|
5121
|
+
} catch {
|
|
5122
|
+
}
|
|
5123
|
+
if (!look) await rename8(file, `${file}.invalid-${Date.now()}`);
|
|
5124
|
+
return null;
|
|
5125
|
+
}
|
|
5126
|
+
async function writeManifest(dir, m) {
|
|
5127
|
+
m.history = m.history.slice(-HISTORY_MAX);
|
|
5128
|
+
await writeAtomic3(manifestFile(dir), JSON.stringify(m, null, 2) + "\n");
|
|
5129
|
+
}
|
|
5130
|
+
async function readBase(dir, id) {
|
|
5131
|
+
const d = baseDir(dir, id);
|
|
5132
|
+
return await present(d) ? readTree(d) : null;
|
|
5133
|
+
}
|
|
5134
|
+
var saveBase = (dir, id, tree) => replaceTree(baseDir(dir, id), tree);
|
|
5135
|
+
async function saveProposed(dir, id, tree) {
|
|
5136
|
+
if (tree) await replaceTree(proposedDir(dir, id), tree);
|
|
5137
|
+
else await rm7(proposedDir(dir, id), { recursive: true, force: true });
|
|
5138
|
+
}
|
|
5139
|
+
async function forgetItem(dir, id) {
|
|
5140
|
+
await rm7(baseDir(dir, id), { recursive: true, force: true });
|
|
5141
|
+
await rm7(proposedDir(dir, id), { recursive: true, force: true });
|
|
5142
|
+
}
|
|
5143
|
+
async function readOff(dir) {
|
|
5144
|
+
try {
|
|
5145
|
+
const s = JSON.parse(await readFile10(settingsFile(dir), "utf8"));
|
|
5146
|
+
return new Set(
|
|
5147
|
+
Object.entries(s.items ?? {}).filter(([, on]) => on === false).map(([id]) => id)
|
|
5148
|
+
);
|
|
5149
|
+
} catch {
|
|
5150
|
+
return /* @__PURE__ */ new Set();
|
|
5151
|
+
}
|
|
5152
|
+
}
|
|
5153
|
+
async function writeOff(dir, off) {
|
|
5154
|
+
const items = Object.fromEntries([...off].sort().map((id) => [id, false]));
|
|
5155
|
+
await writeAtomic3(settingsFile(dir), JSON.stringify({ items }, null, 2) + "\n");
|
|
5156
|
+
}
|
|
5157
|
+
var chains = /* @__PURE__ */ new Map();
|
|
5158
|
+
function serialize(dir, work) {
|
|
5159
|
+
const prev = chains.get(dir) ?? Promise.resolve();
|
|
5160
|
+
const run = prev.then(work, work);
|
|
5161
|
+
const settled = run.catch(() => {
|
|
5162
|
+
});
|
|
5163
|
+
chains.set(dir, settled);
|
|
5164
|
+
void settled.then(() => {
|
|
5165
|
+
if (chains.get(dir) === settled) chains.delete(dir);
|
|
5166
|
+
});
|
|
5167
|
+
return run;
|
|
5168
|
+
}
|
|
5169
|
+
|
|
5170
|
+
// src/lib/server/material/skilldir.ts
|
|
5171
|
+
import { lstat as lstat4, mkdir as mkdir8, mkdtemp as mkdtemp2, readFile as readFile11, rename as rename9, rm as rm8, writeFile as writeFile7 } from "node:fs/promises";
|
|
5172
|
+
import path21 from "node:path";
|
|
5173
|
+
var RECEIPT = ".wheelhouse-managed.json";
|
|
5174
|
+
var RECEIPT_SCHEMA = "wheelhouse-skill.v1";
|
|
5175
|
+
function receiptHashes(text2) {
|
|
5176
|
+
try {
|
|
5177
|
+
const r = JSON.parse(text2);
|
|
5178
|
+
if (r.schema !== RECEIPT_SCHEMA || !r.files || typeof r.files !== "object") return null;
|
|
5179
|
+
const files = Object.entries(r.files);
|
|
5180
|
+
return files.every(([, v]) => typeof v === "string") ? r.files : null;
|
|
5181
|
+
} catch {
|
|
5182
|
+
return null;
|
|
5183
|
+
}
|
|
5184
|
+
}
|
|
5185
|
+
async function readLocal(target) {
|
|
5186
|
+
try {
|
|
5187
|
+
if (!await present(target)) return { kind: "absent" };
|
|
5188
|
+
if (!(await lstat4(target)).isDirectory())
|
|
5189
|
+
return { kind: "unreadable", reason: "it is a symbolic link or not a folder" };
|
|
5190
|
+
const tree = await readTree(target);
|
|
5191
|
+
const receipt = RECEIPT in tree ? receiptHashes(tree[RECEIPT]) : null;
|
|
5192
|
+
delete tree[RECEIPT];
|
|
5193
|
+
return { kind: "files", tree, receipt };
|
|
5194
|
+
} catch (e) {
|
|
5195
|
+
if (!await present(target).catch(() => true)) return { kind: "absent" };
|
|
5196
|
+
return { kind: "unreadable", reason: e.message };
|
|
5197
|
+
}
|
|
5198
|
+
}
|
|
5199
|
+
var receiptText = (version2, hashes) => JSON.stringify({ schema: RECEIPT_SCHEMA, version: version2, files: hashes }) + "\n";
|
|
5200
|
+
async function swapIn(target, tree, receipt, check) {
|
|
5201
|
+
const parent = path21.dirname(target);
|
|
5202
|
+
await mkdir8(parent, { recursive: true });
|
|
5203
|
+
const stage = await mkdtemp2(path21.join(parent, ".wheelhouse-skill-"));
|
|
5204
|
+
let placed = false;
|
|
5205
|
+
try {
|
|
5206
|
+
await writeTree(stage, tree);
|
|
5207
|
+
await writeFile7(path21.join(stage, RECEIPT), receipt);
|
|
5208
|
+
const backup = stage + "-previous";
|
|
5209
|
+
for (let attempt = 1; ; attempt++) {
|
|
5210
|
+
const now = await readLocal(target);
|
|
5211
|
+
const verdict = check(now);
|
|
5212
|
+
if (verdict !== "replace") return verdict;
|
|
5213
|
+
try {
|
|
5214
|
+
if (now.kind !== "absent") await rename9(target, backup);
|
|
5215
|
+
await rename9(stage, target);
|
|
5216
|
+
placed = true;
|
|
5217
|
+
return "swapped";
|
|
5218
|
+
} catch (e) {
|
|
5219
|
+
await rename9(backup, target).catch(() => {
|
|
5220
|
+
});
|
|
5221
|
+
if (attempt === 20) throw e;
|
|
5222
|
+
} finally {
|
|
5223
|
+
await rm8(backup, { recursive: true, force: true });
|
|
5224
|
+
}
|
|
5225
|
+
await new Promise((resolve) => setTimeout(resolve, 10 * attempt));
|
|
5226
|
+
}
|
|
5227
|
+
} finally {
|
|
5228
|
+
if (!placed) await rm8(stage, { recursive: true, force: true });
|
|
5229
|
+
}
|
|
5230
|
+
}
|
|
5231
|
+
|
|
5232
|
+
// src/lib/server/material/sync.ts
|
|
5233
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
5234
|
+
import { readFile as readFile12, stat as stat6 } from "node:fs/promises";
|
|
5235
|
+
import path23 from "node:path";
|
|
5236
|
+
|
|
5237
|
+
// src/lib/server/material/targets.ts
|
|
5238
|
+
import { homedir as homedir3 } from "node:os";
|
|
5239
|
+
import path22 from "node:path";
|
|
5240
|
+
function skillRootDir(root, env) {
|
|
5241
|
+
const home = env.HOME || homedir3();
|
|
5242
|
+
return root === "claude" ? path22.resolve(env.CLAUDE_CONFIG_DIR || path22.join(home, ".claude"), "skills") : path22.resolve(home, ".agents", "skills");
|
|
5243
|
+
}
|
|
5244
|
+
var rootsFor = (harness) => harness === "claude" ? ["claude"] : ["claude", "agents"];
|
|
5245
|
+
|
|
5246
|
+
// src/lib/server/material/sync.ts
|
|
5247
|
+
var skillId = (name, root) => `skill:${name}@${root}`;
|
|
5248
|
+
function plannedSkills(env, harness) {
|
|
5249
|
+
return SKILLS.flatMap(
|
|
5250
|
+
(skill) => rootsFor(harness).map((root) => ({
|
|
5251
|
+
id: skillId(skill.name, root),
|
|
5252
|
+
skill,
|
|
5253
|
+
target: path23.join(skillRootDir(root, env), skill.name)
|
|
5254
|
+
}))
|
|
5255
|
+
);
|
|
5256
|
+
}
|
|
5257
|
+
function decide(o) {
|
|
5258
|
+
if (o.local === "unreadable") return "foreign";
|
|
5259
|
+
if (o.local === null) return "install";
|
|
5260
|
+
if (!o.bases.length) return "foreign";
|
|
5261
|
+
const local = o.local;
|
|
5262
|
+
if (sameHashes(local, o.next)) return "current";
|
|
5263
|
+
if (o.kept && sameHashes(local, o.kept.local) && sameHashes(o.next, o.kept.next)) return "kept";
|
|
5264
|
+
return o.bases.some((b) => sameHashes(local, b)) ? "update" : "modified";
|
|
5265
|
+
}
|
|
5266
|
+
var AS_STATE = {
|
|
5267
|
+
install: "installed",
|
|
5268
|
+
update: "updated",
|
|
5269
|
+
current: "current",
|
|
5270
|
+
kept: "kept",
|
|
5271
|
+
modified: "modified",
|
|
5272
|
+
foreign: "foreign"
|
|
5273
|
+
};
|
|
5274
|
+
var localHashes = (l) => l.kind === "absent" ? null : l.kind === "unreadable" ? "unreadable" : hashTree(l.tree);
|
|
5275
|
+
function message(state, id, target, detail) {
|
|
5276
|
+
switch (state) {
|
|
5277
|
+
case "installed":
|
|
5278
|
+
return `Wheelhouse skill installed at ${target}.`;
|
|
5279
|
+
case "updated":
|
|
5280
|
+
return `Wheelhouse skill updated at ${target}.`;
|
|
5281
|
+
case "current":
|
|
5282
|
+
return `Wheelhouse skill is current at ${target}.`;
|
|
5283
|
+
case "kept":
|
|
5284
|
+
return `Wheelhouse skill at ${target} keeps its local edits, as asked.`;
|
|
5285
|
+
case "modified":
|
|
5286
|
+
return `Left ${target} unchanged: it was locally edited${detail ? ` (${detail})` : ""}. \`wheelhouse skills diff ${id}\` compares it with this version; \`accept\` or \`keep\` settles it.`;
|
|
5287
|
+
case "foreign":
|
|
5288
|
+
return `Left ${target} unchanged: not managed by Wheelhouse${detail ? ` (${detail})` : ""}. \`wheelhouse skills adopt ${id}\` replaces it with the bundled version.`;
|
|
5289
|
+
case "refused":
|
|
5290
|
+
return `Left ${target} unchanged: ${detail ?? "it is inside Firstmate's checkout or home"}.`;
|
|
5291
|
+
case "off":
|
|
5292
|
+
return `${id} is turned off; \`wheelhouse skills sync ${id}\` turns it on again.`;
|
|
5293
|
+
case "error":
|
|
5294
|
+
return `Could not install Wheelhouse skill at ${target}: ${detail}`;
|
|
5295
|
+
}
|
|
5296
|
+
}
|
|
5297
|
+
function record3(m, id, kind, target, bundle, version2, files, now) {
|
|
5298
|
+
m.items[id] = { id, kind, target, bundle, version: version2, files, writtenAt: now.toISOString() };
|
|
5299
|
+
}
|
|
5300
|
+
async function syncSkill(ctx, dir, m, item, tree, dryRun) {
|
|
5301
|
+
const { id, target } = item;
|
|
5302
|
+
const result = (state, detail) => ({
|
|
5303
|
+
id,
|
|
5304
|
+
kind: "skill-dir",
|
|
5305
|
+
target,
|
|
5306
|
+
state,
|
|
5307
|
+
message: message(state, id, target, detail)
|
|
5308
|
+
});
|
|
5309
|
+
if (await insideAny([path23.dirname(target), target], [ctx.install.firstmateDir, ctx.install.homeDir]))
|
|
5310
|
+
return result("refused", "user skills location is inside Firstmate's checkout or home");
|
|
5311
|
+
const next = hashTree(tree);
|
|
5312
|
+
const rec = m.items[id];
|
|
5313
|
+
const verdict = (l) => decide({
|
|
5314
|
+
local: localHashes(l),
|
|
5315
|
+
next,
|
|
5316
|
+
bases: [rec?.files, l.kind === "files" ? l.receipt : null].filter((b) => !!b),
|
|
5317
|
+
kept: rec?.kept
|
|
5318
|
+
});
|
|
5319
|
+
const now = await readLocal(target);
|
|
5320
|
+
const first = verdict(now);
|
|
5321
|
+
const at = ctx.now?.() ?? /* @__PURE__ */ new Date();
|
|
5322
|
+
if (dryRun) {
|
|
5323
|
+
return result(AS_STATE[first], now.kind === "unreadable" ? now.reason : void 0);
|
|
5324
|
+
}
|
|
5325
|
+
if (first === "install" || first === "update") {
|
|
5326
|
+
const outcome = await swapIn(target, tree, receiptText(ctx.version, next), (l) => {
|
|
5327
|
+
const v = verdict(l);
|
|
5328
|
+
return v === "install" || v === "update" ? "replace" : v === "current" ? "done" : "stop";
|
|
5329
|
+
});
|
|
5330
|
+
if (outcome === "stop") return syncSkill(ctx, dir, m, item, tree, dryRun);
|
|
5331
|
+
record3(m, id, "skill-dir", target, item.skill.name, ctx.version, next, at);
|
|
5332
|
+
await saveBase(dir, id, tree);
|
|
5333
|
+
await saveProposed(dir, id, null);
|
|
5334
|
+
return result(
|
|
5335
|
+
outcome === "swapped" ? first === "install" ? "installed" : "updated" : "current"
|
|
5336
|
+
);
|
|
5337
|
+
}
|
|
5338
|
+
if (first === "current") {
|
|
5339
|
+
if (!rec || !sameHashes(rec.files, next) || rec.kept) {
|
|
5340
|
+
record3(m, id, "skill-dir", target, item.skill.name, ctx.version, next, at);
|
|
5341
|
+
await saveBase(dir, id, tree);
|
|
5342
|
+
}
|
|
5343
|
+
await saveProposed(dir, id, null);
|
|
5344
|
+
return result("current");
|
|
5345
|
+
}
|
|
5346
|
+
if (first === "modified") {
|
|
5347
|
+
if (!rec && now.kind === "files" && now.receipt)
|
|
5348
|
+
record3(m, id, "skill-dir", target, item.skill.name, "unknown", now.receipt, at);
|
|
5349
|
+
await saveProposed(dir, id, tree);
|
|
5350
|
+
return result("modified");
|
|
5351
|
+
}
|
|
5352
|
+
return result(first, now.kind === "unreadable" ? now.reason : void 0);
|
|
5353
|
+
}
|
|
5354
|
+
async function installOver(ctx, dir, m, item, tree) {
|
|
5355
|
+
const next = hashTree(tree);
|
|
5356
|
+
const outcome = await swapIn(
|
|
5357
|
+
item.target,
|
|
5358
|
+
tree,
|
|
5359
|
+
receiptText(ctx.version, next),
|
|
5360
|
+
(l) => l.kind === "unreadable" ? "stop" : "replace"
|
|
5361
|
+
);
|
|
5362
|
+
if (outcome === "stop")
|
|
5363
|
+
throw new Error(`${item.target} is a symbolic link or holds one; move it aside first`);
|
|
5364
|
+
record3(
|
|
5365
|
+
m,
|
|
5366
|
+
item.id,
|
|
5367
|
+
"skill-dir",
|
|
5368
|
+
item.target,
|
|
5369
|
+
item.skill.name,
|
|
5370
|
+
ctx.version,
|
|
5371
|
+
next,
|
|
5372
|
+
ctx.now?.() ?? /* @__PURE__ */ new Date()
|
|
5373
|
+
);
|
|
5374
|
+
await saveBase(dir, item.id, tree);
|
|
5375
|
+
await saveProposed(dir, item.id, null);
|
|
5376
|
+
}
|
|
5377
|
+
function gitHead(dir) {
|
|
5378
|
+
return new Promise(
|
|
5379
|
+
(resolve) => execFile2(
|
|
5380
|
+
"git",
|
|
5381
|
+
["-C", dir, "rev-parse", "HEAD"],
|
|
5382
|
+
{ timeout: 5e3 },
|
|
5383
|
+
(error, stdout) => resolve(error ? null : stdout.trim() || null)
|
|
5384
|
+
)
|
|
5385
|
+
);
|
|
5386
|
+
}
|
|
5387
|
+
async function checkAssumptions(firstmateDir) {
|
|
5388
|
+
const checks = [];
|
|
5389
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5390
|
+
for (const a of SKILLS.flatMap((s) => s.assumptions)) {
|
|
5391
|
+
const key = `${a.file}\0${a.marker}`;
|
|
5392
|
+
if (seen.has(key)) continue;
|
|
5393
|
+
seen.add(key);
|
|
5394
|
+
let text2 = "";
|
|
5395
|
+
try {
|
|
5396
|
+
text2 = await readFile12(path23.join(firstmateDir, a.file), "utf8");
|
|
5397
|
+
} catch {
|
|
5398
|
+
}
|
|
5399
|
+
checks.push({ ...a, present: text2.includes(a.marker) });
|
|
5400
|
+
}
|
|
5401
|
+
return checks;
|
|
5402
|
+
}
|
|
5403
|
+
function summary(items, drift) {
|
|
5404
|
+
const notable = items.filter((i) => i.state !== "current" && i.state !== "off");
|
|
5405
|
+
const lines = (notable.length ? notable : items).map((i) => i.message);
|
|
5406
|
+
if (drift.length)
|
|
5407
|
+
lines.push(
|
|
5408
|
+
`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.`
|
|
5409
|
+
);
|
|
5410
|
+
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";
|
|
5411
|
+
return { state, message: lines.join(" ") || "Wheelhouse installs nothing here.", items, drift };
|
|
5412
|
+
}
|
|
5413
|
+
var disabled = (message2) => ({
|
|
5414
|
+
state: "disabled",
|
|
5415
|
+
message: message2,
|
|
5416
|
+
items: [],
|
|
5417
|
+
drift: []
|
|
5418
|
+
});
|
|
5419
|
+
async function syncMaterial(ctx, inputs, opts = {}) {
|
|
5420
|
+
if (ctx.env.WHEELHOUSE_MANAGE_SKILL === "0")
|
|
5421
|
+
return disabled("Wheelhouse skill installation is disabled.");
|
|
5422
|
+
if (!ctx.skillsRoot)
|
|
5423
|
+
return disabled(
|
|
5424
|
+
"Wheelhouse skill is left as it is: only the packaged Wheelhouse server installs it."
|
|
5425
|
+
);
|
|
5426
|
+
const skillsRoot = ctx.skillsRoot;
|
|
5427
|
+
const dir = materialDir(ctx.configDir);
|
|
5428
|
+
const dryRun = opts.dryRun ?? false;
|
|
5429
|
+
return serialize(dir, async () => {
|
|
5430
|
+
const m = await readManifest(dir, dryRun) ?? emptyManifest(ctx.version, inputs.harness);
|
|
5431
|
+
const off = await readOff(dir);
|
|
5432
|
+
const items = [];
|
|
5433
|
+
const trees = /* @__PURE__ */ new Map();
|
|
5434
|
+
for (const item of plannedSkills(ctx.env, inputs.harness)) {
|
|
5435
|
+
if (opts.only && !opts.only.includes(item.id)) continue;
|
|
5436
|
+
if (off.has(item.id)) {
|
|
5437
|
+
items.push({
|
|
5438
|
+
id: item.id,
|
|
5439
|
+
kind: "skill-dir",
|
|
5440
|
+
target: item.target,
|
|
5441
|
+
state: "off",
|
|
5442
|
+
message: message("off", item.id, item.target)
|
|
5443
|
+
});
|
|
5444
|
+
continue;
|
|
5445
|
+
}
|
|
5446
|
+
let tree = trees.get(item.skill.name);
|
|
5447
|
+
if (!tree) {
|
|
5448
|
+
tree = await renderSkill(skillsRoot, item.skill, inputs).catch((e) => e);
|
|
5449
|
+
trees.set(item.skill.name, tree);
|
|
5450
|
+
}
|
|
5451
|
+
try {
|
|
5452
|
+
if (tree instanceof Error) throw tree;
|
|
5453
|
+
items.push(await syncSkill(ctx, dir, m, item, tree, dryRun));
|
|
5454
|
+
} catch (e) {
|
|
5455
|
+
items.push({
|
|
5456
|
+
id: item.id,
|
|
5457
|
+
kind: "skill-dir",
|
|
5458
|
+
target: item.target,
|
|
5459
|
+
state: "error",
|
|
5460
|
+
message: message("error", item.id, item.target, e.message)
|
|
5461
|
+
});
|
|
5462
|
+
}
|
|
5463
|
+
}
|
|
5464
|
+
const assumptions = await checkAssumptions(ctx.install.firstmateDir);
|
|
5465
|
+
const drift = assumptions.filter((a) => !a.present);
|
|
5466
|
+
if (!dryRun) {
|
|
5467
|
+
const now = (ctx.now?.() ?? /* @__PURE__ */ new Date()).toISOString();
|
|
5468
|
+
m.firstmate = {
|
|
5469
|
+
dir: ctx.install.firstmateDir,
|
|
5470
|
+
home: ctx.install.homeDir,
|
|
5471
|
+
commit: await (ctx.commit ?? gitHead)(ctx.install.firstmateDir),
|
|
5472
|
+
checkedAt: now,
|
|
5473
|
+
assumptions
|
|
5474
|
+
};
|
|
5475
|
+
m.render = { reviewSurface: inputs.reviewSurface, harness: inputs.harness };
|
|
5476
|
+
const changes = items.filter((i) => i.state === "installed" || i.state === "updated").map((i) => ({ id: i.id, state: i.state }));
|
|
5477
|
+
if (changes.length) m.history.push({ at: now, version: ctx.version, changes });
|
|
5478
|
+
m.wheelhouse = { version: ctx.version };
|
|
5479
|
+
try {
|
|
5480
|
+
await writeManifest(dir, m);
|
|
5481
|
+
} catch (e) {
|
|
5482
|
+
return {
|
|
5483
|
+
...summary(items, drift),
|
|
5484
|
+
state: "error",
|
|
5485
|
+
message: `Could not record Wheelhouse's agent material in ${dir}: ${e.message}`
|
|
5486
|
+
};
|
|
5487
|
+
}
|
|
5488
|
+
}
|
|
5489
|
+
return summary(items, drift);
|
|
5490
|
+
}).catch((e) => ({
|
|
5491
|
+
state: "error",
|
|
5492
|
+
message: `Could not sync Wheelhouse's agent material in ${dir}: ${e.message}`,
|
|
5493
|
+
items: [],
|
|
5494
|
+
drift: []
|
|
5495
|
+
}));
|
|
5496
|
+
}
|
|
5497
|
+
|
|
5498
|
+
// src/lib/server/material/ops.ts
|
|
5499
|
+
async function savedHarness2(configDir) {
|
|
5500
|
+
try {
|
|
5501
|
+
const raw = JSON.parse(await readFile13(path24.join(configDir, "harness.json"), "utf8"));
|
|
5502
|
+
return parseHarness(raw.harness);
|
|
5503
|
+
} catch {
|
|
5504
|
+
return "claude";
|
|
5505
|
+
}
|
|
5506
|
+
}
|
|
5507
|
+
async function skillsCli(o) {
|
|
5508
|
+
const dir = materialDir(o.configDir);
|
|
5509
|
+
let m;
|
|
5510
|
+
try {
|
|
5511
|
+
m = await readManifest(dir, true);
|
|
5512
|
+
} catch (e) {
|
|
5513
|
+
return { ok: false, error: `Could not read ${dir}/manifest.json: ${e.message}` };
|
|
5514
|
+
}
|
|
5515
|
+
const remembered = readRemembered(o.configDir);
|
|
5516
|
+
const install2 = m?.firstmate ? { firstmateDir: m.firstmate.dir, homeDir: m.firstmate.home } : remembered ? { firstmateDir: remembered.firstmate, homeDir: remembered.home ?? remembered.firstmate } : null;
|
|
5517
|
+
if (!install2)
|
|
5518
|
+
return {
|
|
5519
|
+
ok: false,
|
|
5520
|
+
error: "Wheelhouse is not connected to a Firstmate yet. Open Wheelhouse (`wheelhouse open`) first"
|
|
5521
|
+
};
|
|
5522
|
+
const inputs = m?.render ?? {
|
|
5523
|
+
reviewSurface: null,
|
|
5524
|
+
harness: await savedHarness2(o.configDir)
|
|
5525
|
+
};
|
|
5526
|
+
return {
|
|
5527
|
+
ok: true,
|
|
5528
|
+
value: {
|
|
5529
|
+
ctx: {
|
|
5530
|
+
install: install2,
|
|
5531
|
+
env: o.env,
|
|
5532
|
+
configDir: o.configDir,
|
|
5533
|
+
skillsRoot: o.skillsRoot,
|
|
5534
|
+
version: o.version
|
|
5535
|
+
},
|
|
5536
|
+
inputs,
|
|
5537
|
+
dir
|
|
5538
|
+
}
|
|
5539
|
+
};
|
|
5540
|
+
}
|
|
5541
|
+
async function status(c) {
|
|
5542
|
+
const result = await syncMaterial(c.ctx, c.inputs, { dryRun: true });
|
|
5543
|
+
const m = await readManifest(c.dir, true);
|
|
5544
|
+
return {
|
|
5545
|
+
schema: "wheelhouse-skills-status.v1",
|
|
5546
|
+
result,
|
|
5547
|
+
manifest: m ? { wheelhouse: m.wheelhouse, firstmate: m.firstmate, render: m.render } : null
|
|
5548
|
+
};
|
|
5549
|
+
}
|
|
5550
|
+
async function sync(c, ids) {
|
|
5551
|
+
const unknown = ids.filter((id) => !itemOf(c, id));
|
|
5552
|
+
if (unknown.length) return { ok: false, error: `No such item: ${unknown.join(", ")}` };
|
|
5553
|
+
if (ids.length) {
|
|
5554
|
+
await serialize(c.dir, async () => {
|
|
5555
|
+
const off = await readOff(c.dir);
|
|
5556
|
+
if (ids.some((id) => off.delete(id))) await writeOff(c.dir, off);
|
|
5557
|
+
});
|
|
5558
|
+
}
|
|
5559
|
+
return { ok: true, value: await syncMaterial(c.ctx, c.inputs, ids.length ? { only: ids } : {}) };
|
|
5560
|
+
}
|
|
5561
|
+
var itemOf = (c, id) => plannedSkills(c.ctx.env, c.inputs.harness).find((i) => i.id === id);
|
|
5562
|
+
var render = (c, item) => renderSkill(c.ctx.skillsRoot, item.skill, { reviewSurface: c.inputs.reviewSurface });
|
|
5563
|
+
async function stateOf(c, id) {
|
|
5564
|
+
const r = await syncMaterial(c.ctx, c.inputs, { dryRun: true, only: [id] });
|
|
5565
|
+
return r.items[0]?.state;
|
|
5566
|
+
}
|
|
5567
|
+
function diffDirs(a, b, labels) {
|
|
5568
|
+
return new Promise(
|
|
5569
|
+
(resolve, reject) => execFile3(
|
|
5570
|
+
"diff",
|
|
5571
|
+
["-ruN", "--label", labels[0], "--label", labels[1], a, b],
|
|
5572
|
+
{ maxBuffer: 16 * 1024 * 1024 },
|
|
5573
|
+
(error, stdout) => {
|
|
5574
|
+
if (error && error.code !== 1) reject(error);
|
|
5575
|
+
else resolve(stdout);
|
|
5576
|
+
}
|
|
5577
|
+
)
|
|
5578
|
+
);
|
|
5579
|
+
}
|
|
5580
|
+
async function diff(c, id) {
|
|
5581
|
+
const item = itemOf(c, id);
|
|
5582
|
+
if (!item) return { ok: false, error: `No such item: ${id}` };
|
|
5583
|
+
const local = await readLocal(item.target);
|
|
5584
|
+
if (local.kind === "unreadable")
|
|
5585
|
+
return { ok: false, error: `Cannot read ${item.target}: ${local.reason}` };
|
|
5586
|
+
const next = await render(c, item);
|
|
5587
|
+
const base = await readBase(c.dir, id);
|
|
5588
|
+
const scratch = await mkdtemp3(path24.join(tmpdir(), "wheelhouse-skills-diff-"));
|
|
5589
|
+
try {
|
|
5590
|
+
const put = async (name, tree) => {
|
|
5591
|
+
const d = path24.join(scratch, name);
|
|
5592
|
+
await replaceTree(d, tree);
|
|
5593
|
+
return d;
|
|
5594
|
+
};
|
|
5595
|
+
const localDir = await put("local", local.kind === "files" ? local.tree : {});
|
|
5596
|
+
const nextDir = await put("next", next);
|
|
5597
|
+
const parts = [];
|
|
5598
|
+
if (base) {
|
|
5599
|
+
const baseDir2 = await put("base", base);
|
|
5600
|
+
parts.push(
|
|
5601
|
+
`# Edits since Wheelhouse wrote ${item.target}
|
|
5602
|
+
`,
|
|
5603
|
+
await diffDirs(baseDir2, localDir, ["wheelhouse-wrote", "now"]) || "(none)\n",
|
|
5604
|
+
`
|
|
5605
|
+
# What this version of Wheelhouse changes
|
|
5606
|
+
`,
|
|
5607
|
+
await diffDirs(baseDir2, nextDir, ["wheelhouse-wrote", "this-version"]) || "(none)\n"
|
|
5608
|
+
);
|
|
5609
|
+
} else {
|
|
5610
|
+
parts.push(
|
|
5611
|
+
`# ${item.target} compared with this version (Wheelhouse has no record of what it wrote there)
|
|
5612
|
+
`,
|
|
5613
|
+
await diffDirs(localDir, nextDir, ["now", "this-version"]) || "(no differences)\n"
|
|
5614
|
+
);
|
|
5615
|
+
}
|
|
5616
|
+
return { ok: true, value: parts.join("") };
|
|
5617
|
+
} finally {
|
|
5618
|
+
await rm9(scratch, { recursive: true, force: true });
|
|
5619
|
+
}
|
|
5620
|
+
}
|
|
5621
|
+
async function replace(c, id, expect) {
|
|
5622
|
+
const item = itemOf(c, id);
|
|
5623
|
+
if (!item) return { ok: false, error: `No such item: ${id}` };
|
|
5624
|
+
const state = await stateOf(c, id);
|
|
5625
|
+
if (state !== expect)
|
|
5626
|
+
return {
|
|
5627
|
+
ok: false,
|
|
5628
|
+
error: `${id} is ${state ?? "not planned"}, not ${expect === "foreign" ? "foreign (not managed by Wheelhouse)" : "locally edited"}`
|
|
5629
|
+
};
|
|
5630
|
+
const tree = await render(c, item);
|
|
5631
|
+
return serialize(c.dir, async () => {
|
|
5632
|
+
const local = await readLocal(item.target);
|
|
5633
|
+
if (local.kind === "unreadable")
|
|
5634
|
+
return {
|
|
5635
|
+
ok: false,
|
|
5636
|
+
error: `${item.target} is a symbolic link or holds one; move it aside first`
|
|
5637
|
+
};
|
|
5638
|
+
const m = await readManifest(c.dir) ?? emptyManifest(c.ctx.version, c.inputs.harness);
|
|
5639
|
+
const backup = backupDir(c.dir, id, c.ctx.now?.() ?? /* @__PURE__ */ new Date());
|
|
5640
|
+
if (local.kind === "files") await replaceTree(backup, local.tree);
|
|
5641
|
+
await installOver(c.ctx, c.dir, m, item, tree);
|
|
5642
|
+
await writeManifest(c.dir, m);
|
|
5643
|
+
return {
|
|
5644
|
+
ok: true,
|
|
5645
|
+
value: `Installed this version at ${item.target}${local.kind === "files" ? `; the copy that was there is in ${backup}` : ""}.`
|
|
5646
|
+
};
|
|
5647
|
+
});
|
|
5648
|
+
}
|
|
5649
|
+
async function keep(c, id) {
|
|
5650
|
+
const item = itemOf(c, id);
|
|
5651
|
+
if (!item) return { ok: false, error: `No such item: ${id}` };
|
|
5652
|
+
const state = await stateOf(c, id);
|
|
5653
|
+
if (state !== "modified") return { ok: false, error: `${id} is ${state}, not locally edited` };
|
|
5654
|
+
const next = hashTree(await render(c, item));
|
|
5655
|
+
return serialize(c.dir, async () => {
|
|
5656
|
+
const local = await readLocal(item.target);
|
|
5657
|
+
if (local.kind !== "files") return { ok: false, error: `${item.target} changed meanwhile` };
|
|
5658
|
+
const m = await readManifest(c.dir) ?? emptyManifest(c.ctx.version, c.inputs.harness);
|
|
5659
|
+
const rec = m.items[id] ?? {
|
|
5660
|
+
id,
|
|
5661
|
+
kind: "skill-dir",
|
|
5662
|
+
target: item.target,
|
|
5663
|
+
bundle: item.skill.name,
|
|
5664
|
+
version: "unknown",
|
|
5665
|
+
files: local.receipt ?? {},
|
|
5666
|
+
writtenAt: (c.ctx.now?.() ?? /* @__PURE__ */ new Date()).toISOString()
|
|
5667
|
+
};
|
|
5668
|
+
m.items[id] = { ...rec, kept: { local: hashTree(local.tree), next } };
|
|
5669
|
+
await writeManifest(c.dir, m);
|
|
5670
|
+
return {
|
|
5671
|
+
ok: true,
|
|
5672
|
+
value: `Keeping ${item.target} as it is; Wheelhouse flags it again when a later version changes the skill.`
|
|
5673
|
+
};
|
|
5674
|
+
});
|
|
5675
|
+
}
|
|
5676
|
+
async function uninstall(c, ids) {
|
|
5677
|
+
return serialize(c.dir, async () => {
|
|
5678
|
+
const m = await readManifest(c.dir);
|
|
5679
|
+
const planned = plannedSkills(c.ctx.env, c.inputs.harness);
|
|
5680
|
+
const known = new Map([
|
|
5681
|
+
...planned.map((p) => [p.id, p.target]),
|
|
5682
|
+
...Object.values(m?.items ?? {}).map((r) => [r.id, r.target])
|
|
5683
|
+
]);
|
|
5684
|
+
const unknown = ids.filter((id) => !known.has(id));
|
|
5685
|
+
if (unknown.length) return { ok: false, error: `No such item: ${unknown.join(", ")}` };
|
|
5686
|
+
const off = await readOff(c.dir);
|
|
5687
|
+
const lines = [];
|
|
5688
|
+
for (const [id, target] of known) {
|
|
5689
|
+
if (ids.length && !ids.includes(id)) continue;
|
|
5690
|
+
const local = await readLocal(target);
|
|
5691
|
+
const rec = m?.items[id];
|
|
5692
|
+
const bases = [rec?.files, local.kind === "files" ? local.receipt : null].filter((b) => !!b);
|
|
5693
|
+
const ours = local.kind === "absent" || local.kind === "files" && bases.some((b) => sameHashes(hashTree(local.tree), b));
|
|
5694
|
+
if (!ours) {
|
|
5695
|
+
lines.push(
|
|
5696
|
+
`Left ${target}: ${local.kind === "files" ? "it was locally edited" : "it is not a folder Wheelhouse wrote"}. Remove it yourself if you no longer want it.`
|
|
5697
|
+
);
|
|
5698
|
+
continue;
|
|
5699
|
+
}
|
|
5700
|
+
if (local.kind === "files") await rm9(target, { recursive: true, force: true });
|
|
5701
|
+
await forgetItem(c.dir, id);
|
|
5702
|
+
if (m) delete m.items[id];
|
|
5703
|
+
off.add(id);
|
|
5704
|
+
lines.push(
|
|
5705
|
+
`Removed ${target}; Wheelhouse will not install ${id} again until \`wheelhouse skills sync ${id}\`.`
|
|
5706
|
+
);
|
|
5707
|
+
}
|
|
5708
|
+
if (m) await writeManifest(c.dir, m);
|
|
5709
|
+
await writeOff(c.dir, off);
|
|
5710
|
+
return { ok: true, value: lines };
|
|
5711
|
+
});
|
|
5712
|
+
}
|
|
5713
|
+
|
|
5714
|
+
// cli/skills.ts
|
|
5715
|
+
var bundledSkills = () => path25.resolve(path25.dirname(fileURLToPath(import.meta.url)), "..", "skills");
|
|
5716
|
+
var PENDING = { installed: "missing", updated: "outdated" };
|
|
5717
|
+
function printResult(r, log, pending = false) {
|
|
5718
|
+
for (const i of r.items)
|
|
5719
|
+
log(`${(pending && PENDING[i.state] || i.state).padEnd(9)} ${i.id} ${i.target}`);
|
|
5720
|
+
for (const d of r.drift) log(`drift Firstmate no longer has \`${d.marker}\` in ${d.file}`);
|
|
5721
|
+
if (r.state === "disabled") log(r.message);
|
|
5722
|
+
}
|
|
5723
|
+
function skillsCommand(over = {}) {
|
|
5724
|
+
const deps = {
|
|
5725
|
+
env: process.env,
|
|
5726
|
+
skillsRoot: bundledSkills(),
|
|
5727
|
+
confirm: askTerminal,
|
|
5728
|
+
log: (line) => console.log(line),
|
|
5729
|
+
error: (line) => console.error(line),
|
|
5730
|
+
...over
|
|
5731
|
+
};
|
|
5732
|
+
const cmd = new Command4("skills").description(
|
|
5733
|
+
"The agent skills Wheelhouse installs for Firstmate and its crew: what is installed, what changed, and settling local edits."
|
|
5734
|
+
).option(
|
|
5735
|
+
"--config-dir <dir>",
|
|
5736
|
+
"the Wheelhouse config whose agent-material/ keeps the record (default: $WHEELHOUSE_CONFIG_DIR, else $XDG_CONFIG_HOME/wheelhouse, else ~/.config/wheelhouse)"
|
|
5737
|
+
);
|
|
5738
|
+
const fail = (error) => {
|
|
5739
|
+
deps.error(`wheelhouse: ${error}.`);
|
|
5740
|
+
process.exitCode = 1;
|
|
5741
|
+
};
|
|
5742
|
+
const run = async (c, work) => {
|
|
5743
|
+
const g2 = c.optsWithGlobals();
|
|
5744
|
+
const s = await skillsCli({
|
|
5745
|
+
env: deps.env,
|
|
5746
|
+
configDir: g2.configDir ? path25.resolve(g2.configDir) : defaultConfigDir(deps.env),
|
|
5747
|
+
skillsRoot: deps.skillsRoot,
|
|
5748
|
+
version
|
|
5749
|
+
});
|
|
5750
|
+
if (!s.ok) return fail(s.error);
|
|
5751
|
+
await work(s.value);
|
|
5752
|
+
};
|
|
5753
|
+
const report = (o) => {
|
|
5754
|
+
if (!o.ok) return fail(o.error);
|
|
5755
|
+
for (const line of [].concat(o.value)) deps.log(line);
|
|
5756
|
+
};
|
|
5757
|
+
const confirmed = async (yes, question2) => yes || await deps.confirm(question2);
|
|
5758
|
+
cmd.command("status").description(
|
|
5759
|
+
"Show each item and its state (missing and outdated ones are what `sync` would install or update), and any Firstmate drift."
|
|
5760
|
+
).option("--json", "print the full status as JSON (wheelhouse-skills-status.v1)").action(
|
|
5761
|
+
(o, c) => run(c, async (s) => {
|
|
5762
|
+
const v = await status(s);
|
|
5763
|
+
if (o.json) return deps.log(JSON.stringify(v, null, 2));
|
|
5764
|
+
printResult(v.result, deps.log, true);
|
|
5765
|
+
if (v.result.state === "attention" || v.result.state === "error") {
|
|
5766
|
+
deps.log("");
|
|
5767
|
+
deps.log(v.result.message);
|
|
5768
|
+
}
|
|
5769
|
+
})
|
|
5770
|
+
);
|
|
5771
|
+
cmd.command("sync [ids...]").description(
|
|
5772
|
+
"Install missing items and update unchanged ones to this version; naming items turns them on again."
|
|
5773
|
+
).action(
|
|
5774
|
+
(ids, _o, c) => run(c, async (s) => {
|
|
5775
|
+
const o = await sync(s, ids);
|
|
5776
|
+
if (!o.ok) return fail(o.error);
|
|
5777
|
+
printResult(o.value, deps.log);
|
|
5778
|
+
if (o.value.state === "error") fail(o.value.message.replace(/\.$/, ""));
|
|
5779
|
+
})
|
|
5780
|
+
);
|
|
5781
|
+
cmd.command("diff <id>").description("Compare an item with what Wheelhouse wrote there and with this version.").action(
|
|
5782
|
+
(id, _o, c) => run(c, async (s) => report(await diff(s, id)))
|
|
5783
|
+
);
|
|
5784
|
+
cmd.command("accept <id>").description("Replace a locally edited item with this version (the edited copy is backed up).").option("-y, --yes", "replace without asking").action(
|
|
5785
|
+
(id, o, c) => run(c, async (s) => {
|
|
5786
|
+
if (!await confirmed(o.yes, `Replace your edited ${id} with this version?`)) return;
|
|
5787
|
+
report(await replace(s, id, "modified"));
|
|
5788
|
+
})
|
|
5789
|
+
);
|
|
5790
|
+
cmd.command("keep <id>").description("Keep a locally edited item as it is until a later version changes it again.").action(
|
|
5791
|
+
(id, _o, c) => run(c, async (s) => report(await keep(s, id)))
|
|
5792
|
+
);
|
|
5793
|
+
cmd.command("adopt <id>").description(
|
|
5794
|
+
"Replace a copy Wheelhouse did not install with the bundled version, and manage it from now on (the copy is backed up)."
|
|
5795
|
+
).option("-y, --yes", "replace without asking").action(
|
|
5796
|
+
(id, o, c) => run(c, async (s) => {
|
|
5797
|
+
if (!await confirmed(o.yes, `Replace the existing ${id} with Wheelhouse's version?`))
|
|
5798
|
+
return;
|
|
5799
|
+
report(await replace(s, id, "foreign"));
|
|
5800
|
+
})
|
|
5801
|
+
);
|
|
5802
|
+
cmd.command("uninstall [ids...]").description(
|
|
5803
|
+
"Remove items Wheelhouse installed (all of them, or those named) and stop installing them; edited copies are left."
|
|
5804
|
+
).option("-y, --yes", "remove without asking").action(
|
|
5805
|
+
(ids, o, c) => run(c, async (s) => {
|
|
5806
|
+
const what = ids.length ? ids.join(", ") : "every skill Wheelhouse installed";
|
|
5807
|
+
if (!await confirmed(o.yes, `Remove ${what}?`)) return;
|
|
5808
|
+
report(await uninstall(s, ids));
|
|
5809
|
+
})
|
|
5810
|
+
);
|
|
5811
|
+
return cmd;
|
|
5812
|
+
}
|
|
5813
|
+
|
|
4945
5814
|
// cli/supervise.ts
|
|
4946
5815
|
var MAX_RESTARTS = 5;
|
|
4947
5816
|
var RESTART_WINDOW_MS = 6e4;
|
|
@@ -5025,18 +5894,18 @@ function supervise(opts) {
|
|
|
5025
5894
|
|
|
5026
5895
|
// cli/upgrade.ts
|
|
5027
5896
|
import { spawn as spawn3 } from "node:child_process";
|
|
5028
|
-
import
|
|
5029
|
-
import { fileURLToPath } from "node:url";
|
|
5030
|
-
import { Command as
|
|
5897
|
+
import path27 from "node:path";
|
|
5898
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
5899
|
+
import { Command as Command5 } from "commander";
|
|
5031
5900
|
|
|
5032
5901
|
// src/lib/server/upgrade/clone.ts
|
|
5033
|
-
import { execFile as
|
|
5034
|
-
import { mkdir as
|
|
5035
|
-
import
|
|
5902
|
+
import { execFile as execFile4 } from "node:child_process";
|
|
5903
|
+
import { mkdir as mkdir9, readdir as readdir3, readFile as readFile14, realpath as realpath5 } from "node:fs/promises";
|
|
5904
|
+
import path26 from "node:path";
|
|
5036
5905
|
var COMMITS_SHOWN = 20;
|
|
5037
5906
|
var OUTPUT_KEPT = 6e4;
|
|
5038
5907
|
var runCommand = (cmd, args, cwd) => new Promise((resolve) => {
|
|
5039
|
-
|
|
5908
|
+
execFile4(cmd, args, { cwd, maxBuffer: 64 * 1024 * 1024 }, (err, stdout, stderr) => {
|
|
5040
5909
|
const output = `${String(stdout)}${String(stderr)}`;
|
|
5041
5910
|
resolve({
|
|
5042
5911
|
code: err ? typeof err.code === "number" ? err.code : 1 : 0,
|
|
@@ -5078,11 +5947,11 @@ async function checkClone(deps) {
|
|
|
5078
5947
|
changes: []
|
|
5079
5948
|
};
|
|
5080
5949
|
out.current.version = packageVersion(
|
|
5081
|
-
await
|
|
5950
|
+
await readFile14(path26.join(deps.dir, "package.json"), "utf8").catch(() => null)
|
|
5082
5951
|
);
|
|
5083
5952
|
const top = await g2("rev-parse", "--show-toplevel");
|
|
5084
|
-
const here = await
|
|
5085
|
-
if (top.code !== 0 || await
|
|
5953
|
+
const here = await realpath5(deps.dir).catch(() => deps.dir);
|
|
5954
|
+
if (top.code !== 0 || await realpath5(top.stdout.trim()).catch(() => "") !== here) {
|
|
5086
5955
|
out.reason = `${deps.dir} is not a git clone, so Wheelhouse cannot upgrade it; update it the way it was installed (for npm, \`npm install -g @chrisjowen/wheelhouse\`)`;
|
|
5087
5956
|
return out;
|
|
5088
5957
|
}
|
|
@@ -5127,8 +5996,8 @@ async function checkClone(deps) {
|
|
|
5127
5996
|
return { sha, subject, date };
|
|
5128
5997
|
});
|
|
5129
5998
|
const on = await g2("symbolic-ref", "--quiet", "--short", "HEAD");
|
|
5130
|
-
const
|
|
5131
|
-
const changes =
|
|
5999
|
+
const status2 = await g2("status", "--porcelain", "--untracked-files=no");
|
|
6000
|
+
const changes = status2.stdout.split("\n").filter((l) => l.trim());
|
|
5132
6001
|
out.state = "refused";
|
|
5133
6002
|
if (on.code !== 0) {
|
|
5134
6003
|
out.reason = `${deps.dir} is not on a branch (detached HEAD), so it cannot fast-forward to ${branch}`;
|
|
@@ -5204,7 +6073,7 @@ var CLONE_SETUP_STEPS = [
|
|
|
5204
6073
|
|
|
5205
6074
|
// cli/upgrade.ts
|
|
5206
6075
|
function installDir() {
|
|
5207
|
-
return
|
|
6076
|
+
return path27.resolve(path27.dirname(fileURLToPath2(import.meta.url)), "..");
|
|
5208
6077
|
}
|
|
5209
6078
|
var runInherit = (cmd, args, cwd) => new Promise((resolve) => {
|
|
5210
6079
|
const child = spawn3(cmd, args, { cwd, stdio: "inherit" });
|
|
@@ -5271,13 +6140,13 @@ async function upgrade(deps, o = {}) {
|
|
|
5271
6140
|
}
|
|
5272
6141
|
function upgradeCommand(over = {}) {
|
|
5273
6142
|
const env = over.env ?? process.env;
|
|
5274
|
-
return new
|
|
6143
|
+
return new Command5("upgrade").description(
|
|
5275
6144
|
"Fast-forward this Wheelhouse clone to the newest commit on GitHub, rebuild it and restart Wheelhouse."
|
|
5276
6145
|
).option("--check", "only say whether there is a newer version").option("-y, --yes", "upgrade (and restart, even mid-work) without asking").option(
|
|
5277
6146
|
"--plugins-dir <dir>",
|
|
5278
6147
|
"the plugins directory the running Wheelhouse loads from, to find it (default: $WHEELHOUSE_PLUGINS_DIR, else ~/.wheelhouse/plugins)"
|
|
5279
6148
|
).action(async (o) => {
|
|
5280
|
-
const pluginsDir = o.pluginsDir ?
|
|
6149
|
+
const pluginsDir = o.pluginsDir ? path27.resolve(o.pluginsDir) : defaultPluginsDir(env);
|
|
5281
6150
|
const ok = await upgrade(
|
|
5282
6151
|
{
|
|
5283
6152
|
dir: installDir(),
|
|
@@ -5304,8 +6173,8 @@ function parsePort3(value) {
|
|
|
5304
6173
|
return n;
|
|
5305
6174
|
}
|
|
5306
6175
|
function handlerPath() {
|
|
5307
|
-
const here =
|
|
5308
|
-
return
|
|
6176
|
+
const here = path28.dirname(fileURLToPath3(import.meta.url));
|
|
6177
|
+
return path28.resolve(here, "..", "build", "handler.js");
|
|
5309
6178
|
}
|
|
5310
6179
|
function openBrowser(url) {
|
|
5311
6180
|
const [cmd, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["cmd", ["/c", "start", '""', url]] : ["xdg-open", [url]];
|
|
@@ -5318,8 +6187,8 @@ function openBrowser(url) {
|
|
|
5318
6187
|
}
|
|
5319
6188
|
}
|
|
5320
6189
|
async function open2(opts) {
|
|
5321
|
-
const configDir = opts.configDir ?
|
|
5322
|
-
const stateDir = opts.stateDir ?
|
|
6190
|
+
const configDir = opts.configDir ? path28.resolve(opts.configDir) : defaultConfigDir(process.env);
|
|
6191
|
+
const stateDir = opts.stateDir ? path28.resolve(opts.stateDir) : defaultStateDir(process.env);
|
|
5323
6192
|
const resolved = resolveInstall({
|
|
5324
6193
|
firstmate: opts.firstmate,
|
|
5325
6194
|
home: opts.home,
|
|
@@ -5408,12 +6277,12 @@ async function open2(opts) {
|
|
|
5408
6277
|
}
|
|
5409
6278
|
process.env.WHEELHOUSE_STATE_DIR = stateDir;
|
|
5410
6279
|
process.env.WHEELHOUSE_CONFIG_DIR = configDir;
|
|
5411
|
-
if (opts.pluginsDir) process.env.WHEELHOUSE_PLUGINS_DIR =
|
|
5412
|
-
process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR =
|
|
5413
|
-
process.env.WHEELHOUSE_INSTALL_DIR =
|
|
6280
|
+
if (opts.pluginsDir) process.env.WHEELHOUSE_PLUGINS_DIR = path28.resolve(opts.pluginsDir);
|
|
6281
|
+
process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path28.resolve(path28.dirname(file), "..", "plugins");
|
|
6282
|
+
process.env.WHEELHOUSE_INSTALL_DIR = path28.resolve(path28.dirname(file), "..");
|
|
5414
6283
|
if (opts.tmuxSocket) process.env.WHEELHOUSE_TMUX_SOCKET = opts.tmuxSocket;
|
|
5415
6284
|
process.env.WHEELHOUSE_SKIP_PERMISSIONS = opts.skipPermissions ? "1" : "0";
|
|
5416
|
-
let cli =
|
|
6285
|
+
let cli = fileURLToPath3(import.meta.url);
|
|
5417
6286
|
let serverPort = opts.port;
|
|
5418
6287
|
const cloud = new CloudService({
|
|
5419
6288
|
settings: new CloudSettings(cloudDir(configDir), cloudKeychain()),
|
|
@@ -5427,9 +6296,9 @@ async function open2(opts) {
|
|
|
5427
6296
|
start: (port, restart) => {
|
|
5428
6297
|
const next = takeHandoff(configDir);
|
|
5429
6298
|
if (next && restart) {
|
|
5430
|
-
cli =
|
|
6299
|
+
cli = path28.join(next, "dist", "cli.js");
|
|
5431
6300
|
process.env.WHEELHOUSE_INSTALL_DIR = next;
|
|
5432
|
-
process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR =
|
|
6301
|
+
process.env.WHEELHOUSE_BUNDLED_PLUGINS_DIR = path28.join(next, "plugins");
|
|
5433
6302
|
console.log(`Wheelhouse now runs from ${next}.`);
|
|
5434
6303
|
}
|
|
5435
6304
|
return fork(cli, ["__server", "--port", String(port)], {
|
|
@@ -5454,7 +6323,7 @@ async function open2(opts) {
|
|
|
5454
6323
|
process.exit(code);
|
|
5455
6324
|
}
|
|
5456
6325
|
async function serve(opts) {
|
|
5457
|
-
process.env.WHEELHOUSE_INSTALL_DIR =
|
|
6326
|
+
process.env.WHEELHOUSE_INSTALL_DIR = path28.resolve(path28.dirname(handlerPath()), "..");
|
|
5458
6327
|
process.env.WHEELHOUSE_URL = `http://${HOST}:${opts.port}`;
|
|
5459
6328
|
process.env.BODY_SIZE_LIMIT ??= String(UPLOAD_MAX_BYTES + 64 * 1024);
|
|
5460
6329
|
const { handler } = await import(pathToFileURL(handlerPath()).href);
|
|
@@ -5519,7 +6388,7 @@ async function serve(opts) {
|
|
|
5519
6388
|
process.on("disconnect", () => close(0));
|
|
5520
6389
|
}
|
|
5521
6390
|
function program() {
|
|
5522
|
-
const cli = new
|
|
6391
|
+
const cli = new Command6("wheelhouse").description("A local companion to Firstmate: watch the crew at work from a web UI.").version(version);
|
|
5523
6392
|
cli.command("open", { isDefault: true }).description(
|
|
5524
6393
|
"Start Wheelhouse, start (or show) the Firstmate session, and open it in the browser; with no Firstmate yet, open the setup wizard."
|
|
5525
6394
|
).option(
|
|
@@ -5533,7 +6402,7 @@ function program() {
|
|
|
5533
6402
|
"where Wheelhouse keeps its own records (default: $WHEELHOUSE_STATE_DIR, else $XDG_STATE_HOME/wheelhouse, else ~/.local/state/wheelhouse)"
|
|
5534
6403
|
).option(
|
|
5535
6404
|
"--tmux-socket <name>",
|
|
5536
|
-
"
|
|
6405
|
+
"a tmux server of its own (tmux -L <name>) for the Firstmate session (default: $WHEELHOUSE_TMUX_SOCKET, else tmux's default server, which the crew share)"
|
|
5537
6406
|
).option(
|
|
5538
6407
|
"--session-backend <name>",
|
|
5539
6408
|
"what runs the Firstmate session: tmux, or herdr (experimental) (default: $WHEELHOUSE_SESSION_BACKEND, else the setup wizard's choice, else herdr when Firstmate's config/backend is herdr, else tmux)",
|
|
@@ -5583,6 +6452,7 @@ function program() {
|
|
|
5583
6452
|
cli.addCommand(upgradeCommand());
|
|
5584
6453
|
cli.addCommand(gatewayCommand());
|
|
5585
6454
|
cli.addCommand(remoteCommand());
|
|
6455
|
+
cli.addCommand(skillsCommand());
|
|
5586
6456
|
return cli;
|
|
5587
6457
|
}
|
|
5588
6458
|
await program().parseAsync(process.argv);
|