@moberg_hr/work-tree 2.21.0 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{account-RCMYHLUP.js → account-7QAH33LA.js} +11 -11
- package/dist/{add-repo-4NQUBY2A.js → add-repo-BFHI76SN.js} +7 -7
- package/dist/{answer-PAMFIP4B.js → answer-MWBEM7P7.js} +5 -5
- package/dist/{attach-QX72JAJN.js → attach-OTWK6PD5.js} +9 -9
- package/dist/bin.js +2 -2
- package/dist/{block-GLMNDZJC.js → block-EB22EIRA.js} +7 -7
- package/dist/{broadcast-4AMVPDUV.js → broadcast-BUJ5PWPB.js} +3 -3
- package/dist/{catchup-AWIE3PVF.js → catchup-YD3OCG66.js} +8 -8
- package/dist/{child-HG4WXOMX.js → child-OAKEKASR.js} +9 -9
- package/dist/{chunk-NS5K4IN5.js → chunk-2GIPYZCX.js} +5 -5
- package/dist/{chunk-LCKBOPFU.js → chunk-2YGXGVLV.js} +4 -4
- package/dist/{chunk-VAFS24P4.js → chunk-3LY3FKBF.js} +3 -3
- package/dist/{chunk-CVN5E4SU.js → chunk-42MSD6GF.js} +2 -2
- package/dist/{chunk-GFCVBKHL.js → chunk-5C6N447O.js} +2 -2
- package/dist/{chunk-XOEGBVWQ.js → chunk-5K33LDOS.js} +3 -3
- package/dist/{chunk-4FQ4QOIF.js → chunk-5QJQXRRY.js} +5 -5
- package/dist/{chunk-JKARKFLX.js → chunk-6GQG5CTJ.js} +6 -6
- package/dist/{chunk-HNK36GM3.js → chunk-6TY74NY6.js} +5 -5
- package/dist/{chunk-JNYXRMZL.js → chunk-6UJLYHK5.js} +2 -2
- package/dist/{chunk-DDDWQ36P.js → chunk-AI4BMD74.js} +4 -4
- package/dist/{chunk-QUOA4RSP.js → chunk-AO2IFRQW.js} +3 -3
- package/dist/{chunk-74FGCQML.js → chunk-C4W2VTOP.js} +3 -3
- package/dist/{chunk-IPXOVAEX.js → chunk-DD4GYEFQ.js} +3 -3
- package/dist/{chunk-KLJMHYU7.js → chunk-EDOYMSIA.js} +2 -2
- package/dist/chunk-EDOYMSIA.js.map +1 -0
- package/dist/{chunk-2IK6EQXW.js → chunk-EGYNUNKI.js} +5 -5
- package/dist/{chunk-YNPORFRR.js → chunk-FO37VXQE.js} +2 -2
- package/dist/{chunk-U3UPGZGQ.js → chunk-FYDBT6AI.js} +2 -2
- package/dist/{chunk-IMO7KKYZ.js → chunk-GRHVKD2K.js} +72 -3
- package/dist/chunk-GRHVKD2K.js.map +1 -0
- package/dist/{chunk-2EXZ24MI.js → chunk-H5SEBLE2.js} +3 -3
- package/dist/{chunk-OW7YUW4W.js → chunk-H7QMUEEA.js} +2 -2
- package/dist/{chunk-XHTBWRXU.js → chunk-I2JMZBZY.js} +4 -4
- package/dist/{chunk-XN77RX4I.js → chunk-INPJC2TX.js} +4 -4
- package/dist/{chunk-BOQJBO4K.js → chunk-IPIVNBKT.js} +2 -2
- package/dist/{chunk-4EPMJVQY.js → chunk-IQWUHU2D.js} +4 -4
- package/dist/{chunk-ZBVVI3XT.js → chunk-JBQOBCH4.js} +2 -2
- package/dist/{chunk-JZZJRVWZ.js → chunk-KLUN6KKF.js} +3 -3
- package/dist/{chunk-YM3DJE2Q.js → chunk-MAXPKVQM.js} +4 -4
- package/dist/{chunk-3BXCMTFV.js → chunk-MSWU4NDC.js} +2 -2
- package/dist/{chunk-COBR6DBI.js → chunk-OOFCBN43.js} +2 -2
- package/dist/{chunk-2MZODCSG.js → chunk-ORBZDEPN.js} +2 -2
- package/dist/{chunk-XCQD5XSN.js → chunk-QAK5RTKL.js} +4 -4
- package/dist/{chunk-IYJHSMXQ.js → chunk-QBB5JDFF.js} +2 -2
- package/dist/{chunk-YKWDZCUW.js → chunk-QWD76K3E.js} +152 -112
- package/dist/chunk-QWD76K3E.js.map +1 -0
- package/dist/{chunk-X3ON5EYW.js → chunk-S7Z3UJW7.js} +2 -2
- package/dist/{chunk-I3AO3NVC.js → chunk-SE3M6KDX.js} +2 -2
- package/dist/{chunk-777W7BCX.js → chunk-TCKNRYWG.js} +9 -9
- package/dist/{chunk-PKY63672.js → chunk-THHDB7JN.js} +2 -2
- package/dist/chunk-TIRRXH6I.js +9 -0
- package/dist/{chunk-E4EQDJD2.js → chunk-UPYZYJPK.js} +3 -3
- package/dist/{chunk-POF2FE4S.js → chunk-V7TACE53.js} +7 -7
- package/dist/{chunk-AGICFQMJ.js → chunk-VQDE3DRG.js} +13 -2
- package/dist/{chunk-AGICFQMJ.js.map → chunk-VQDE3DRG.js.map} +1 -1
- package/dist/{chunk-NISGFF25.js → chunk-WRINMNRX.js} +4 -4
- package/dist/{chunk-A5O3CP37.js → chunk-XOA3X4MN.js} +3 -3
- package/dist/{chunk-WDGQAGF4.js → chunk-XT3HB45X.js} +4 -4
- package/dist/{chunk-LYUD6DNS.js → chunk-XVE23FA2.js} +4 -3
- package/dist/chunk-XVE23FA2.js.map +1 -0
- package/dist/{chunk-NJ7CHZJS.js → chunk-Z5SKKACK.js} +2 -2
- package/dist/{chunk-MGMRLWJA.js → chunk-ZG3W3DJ3.js} +6 -6
- package/dist/{chunk-FGZVHEFP.js → chunk-ZLIW4G24.js} +57 -57
- package/dist/{cleanup-757RQ5NW.js → cleanup-2VQTVWIG.js} +21 -21
- package/dist/{cli-RRT5BOWM.js → cli-KRTX5VN7.js} +3 -3
- package/dist/{color-SMQZHNFH.js → color-2G5SIVSI.js} +5 -5
- package/dist/{config-TSNQIWAG.js → config-XBTJVJK3.js} +5 -5
- package/dist/{coordinate-RJOG5DCS.js → coordinate-S3HTZFMP.js} +10 -10
- package/dist/{diff-GBVTHXCV.js → diff-63GBECFI.js} +6 -6
- package/dist/{digest-UFZSHQCP.js → digest-367JAS7G.js} +5 -5
- package/dist/{fork-5ISDLKQF.js → fork-ALCUOTFA.js} +18 -18
- package/dist/{history-ZX5COG2M.js → history-JESCVDIU.js} +3 -3
- package/dist/{hook-3LHEQPBM.js → hook-2Y4UOTZ6.js} +41 -8
- package/dist/hook-2Y4UOTZ6.js.map +1 -0
- package/dist/{hydrate-N6ZIPOLK.js → hydrate-F2BZ6K7Y.js} +3 -3
- package/dist/{init-P42G52BR.js → init-QPU6VIYG.js} +7 -7
- package/dist/{install-skills-N63CWTOH.js → install-skills-KSLTHRHH.js} +3 -3
- package/dist/install-skills-bin.js +2 -2
- package/dist/{keep-HZC6HIWF.js → keep-DJRHEEFB.js} +5 -5
- package/dist/{list-UAQKE4BT.js → list-5AVOAFXA.js} +3 -3
- package/dist/{move-TUX7SKKM.js → move-75DQHXBR.js} +8 -8
- package/dist/{note-SLVYVDC5.js → note-VFFRLSIF.js} +5 -5
- package/dist/{overlaps-HC7GB3OL.js → overlaps-JW7C7MWI.js} +8 -8
- package/dist/{pin-73FSKVDV.js → pin-CE63RHI3.js} +5 -5
- package/dist/{pr-FJHTWA6C.js → pr-ONSSW6J4.js} +13 -13
- package/dist/{prune-4DG3YNHQ.js → prune-HHTATOOQ.js} +19 -19
- package/dist/{pty-host-72PLYNBT.js → pty-host-4LWIAULG.js} +7 -7
- package/dist/{read-VFPXCEP6.js → read-O72SGX7S.js} +5 -5
- package/dist/{recent-MT4K3M7A.js → recent-TI6O5KHP.js} +8 -8
- package/dist/{remove-CTXCSMMJ.js → remove-L7YB6227.js} +20 -20
- package/dist/{report-OZN3UE3W.js → report-2NXU55QS.js} +8 -8
- package/dist/{restart-P3HCOUJY.js → restart-P352BMWT.js} +5 -5
- package/dist/{resume-IQTLSLS3.js → resume-PAHRZPAJ.js} +8 -8
- package/dist/{review-RAFSZBOC.js → review-WPHNJ47M.js} +4 -4
- package/dist/{run-UYTHFJ7P.js → run-3CYZS4BM.js} +3 -3
- package/dist/{screen-A33PDNY4.js → screen-YX7C4PXH.js} +5 -5
- package/dist/{search-RIZJANOI.js → search-3LOJM3G4.js} +3 -3
- package/dist/{section-XOWMNRLK.js → section-RMQAANNH.js} +5 -5
- package/dist/{send-DTHWOC4Z.js → send-S3BBWJHD.js} +6 -6
- package/dist/{sessions-PP555IEM.js → sessions-5WRAWFNI.js} +16 -16
- package/dist/show-VGC7QTGL.js +94 -0
- package/dist/show-VGC7QTGL.js.map +1 -0
- package/dist/{snooze-F43627DM.js → snooze-5TASHLGL.js} +5 -5
- package/dist/{start-LQP5L2UY.js → start-JGVD2O5V.js} +5 -5
- package/dist/{status-U3OJRC4Y.js → status-ZO54EQVF.js} +6 -6
- package/dist/{stop-EQCUYVUF.js → stop-XXLTBUCF.js} +5 -5
- package/dist/{sync-GQBVRSSD.js → sync-2BTD7U2A.js} +19 -19
- package/dist/{time-FOC4HMSX.js → time-WHUJH7FC.js} +6 -6
- package/dist/{timesheet-YEKW5L2L.js → timesheet-T575FQNM.js} +8 -8
- package/dist/{tree-2L6ZCDCE.js → tree-PV6GRIRG.js} +18 -18
- package/dist/{update-RO7OB54G.js → update-W5KD6237.js} +10 -10
- package/dist/{usage-2OYLKV6R.js → usage-AB2UAMHM.js} +5 -5
- package/dist/{wait-4LZJ5WNQ.js → wait-RULOZMLR.js} +6 -6
- package/dist/wd-bin.js +2 -2
- package/dist/web/assets/{PtyView-B11_5QTN.js → PtyView-BTvDVP2F.js} +27 -27
- package/dist/web/assets/PtyView-BTvDVP2F.js.map +1 -0
- package/dist/web/assets/index-C-u0RGnu.css +1 -0
- package/dist/web/assets/index-CBDCRV_L.js +129 -0
- package/dist/web/assets/index-CBDCRV_L.js.map +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-A6FWH4WT.js → web-4JKMKTTD.js} +800 -475
- package/dist/web-4JKMKTTD.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/plugins/work-tree/skills/work-sessions/SKILL.md +1 -1
- package/dist/chunk-5GW6OEYN.js +0 -9
- package/dist/chunk-IMO7KKYZ.js.map +0 -1
- package/dist/chunk-KLJMHYU7.js.map +0 -1
- package/dist/chunk-LYUD6DNS.js.map +0 -1
- package/dist/chunk-YKWDZCUW.js.map +0 -1
- package/dist/hook-3LHEQPBM.js.map +0 -1
- package/dist/show-ZY2X46TS.js +0 -68
- package/dist/show-ZY2X46TS.js.map +0 -1
- package/dist/web/assets/PtyView-B11_5QTN.js.map +0 -1
- package/dist/web/assets/index-Cuq2OWKw.css +0 -1
- package/dist/web/assets/index-Rj1VHPO1.js +0 -127
- package/dist/web/assets/index-Rj1VHPO1.js.map +0 -1
- package/dist/web-A6FWH4WT.js.map +0 -1
- /package/dist/{account-RCMYHLUP.js.map → account-7QAH33LA.js.map} +0 -0
- /package/dist/{add-repo-4NQUBY2A.js.map → add-repo-BFHI76SN.js.map} +0 -0
- /package/dist/{answer-PAMFIP4B.js.map → answer-MWBEM7P7.js.map} +0 -0
- /package/dist/{attach-QX72JAJN.js.map → attach-OTWK6PD5.js.map} +0 -0
- /package/dist/{block-GLMNDZJC.js.map → block-EB22EIRA.js.map} +0 -0
- /package/dist/{broadcast-4AMVPDUV.js.map → broadcast-BUJ5PWPB.js.map} +0 -0
- /package/dist/{catchup-AWIE3PVF.js.map → catchup-YD3OCG66.js.map} +0 -0
- /package/dist/{child-HG4WXOMX.js.map → child-OAKEKASR.js.map} +0 -0
- /package/dist/{chunk-NS5K4IN5.js.map → chunk-2GIPYZCX.js.map} +0 -0
- /package/dist/{chunk-LCKBOPFU.js.map → chunk-2YGXGVLV.js.map} +0 -0
- /package/dist/{chunk-VAFS24P4.js.map → chunk-3LY3FKBF.js.map} +0 -0
- /package/dist/{chunk-CVN5E4SU.js.map → chunk-42MSD6GF.js.map} +0 -0
- /package/dist/{chunk-GFCVBKHL.js.map → chunk-5C6N447O.js.map} +0 -0
- /package/dist/{chunk-XOEGBVWQ.js.map → chunk-5K33LDOS.js.map} +0 -0
- /package/dist/{chunk-4FQ4QOIF.js.map → chunk-5QJQXRRY.js.map} +0 -0
- /package/dist/{chunk-JKARKFLX.js.map → chunk-6GQG5CTJ.js.map} +0 -0
- /package/dist/{chunk-HNK36GM3.js.map → chunk-6TY74NY6.js.map} +0 -0
- /package/dist/{chunk-JNYXRMZL.js.map → chunk-6UJLYHK5.js.map} +0 -0
- /package/dist/{chunk-DDDWQ36P.js.map → chunk-AI4BMD74.js.map} +0 -0
- /package/dist/{chunk-QUOA4RSP.js.map → chunk-AO2IFRQW.js.map} +0 -0
- /package/dist/{chunk-74FGCQML.js.map → chunk-C4W2VTOP.js.map} +0 -0
- /package/dist/{chunk-IPXOVAEX.js.map → chunk-DD4GYEFQ.js.map} +0 -0
- /package/dist/{chunk-2IK6EQXW.js.map → chunk-EGYNUNKI.js.map} +0 -0
- /package/dist/{chunk-YNPORFRR.js.map → chunk-FO37VXQE.js.map} +0 -0
- /package/dist/{chunk-U3UPGZGQ.js.map → chunk-FYDBT6AI.js.map} +0 -0
- /package/dist/{chunk-2EXZ24MI.js.map → chunk-H5SEBLE2.js.map} +0 -0
- /package/dist/{chunk-OW7YUW4W.js.map → chunk-H7QMUEEA.js.map} +0 -0
- /package/dist/{chunk-XHTBWRXU.js.map → chunk-I2JMZBZY.js.map} +0 -0
- /package/dist/{chunk-XN77RX4I.js.map → chunk-INPJC2TX.js.map} +0 -0
- /package/dist/{chunk-BOQJBO4K.js.map → chunk-IPIVNBKT.js.map} +0 -0
- /package/dist/{chunk-4EPMJVQY.js.map → chunk-IQWUHU2D.js.map} +0 -0
- /package/dist/{chunk-ZBVVI3XT.js.map → chunk-JBQOBCH4.js.map} +0 -0
- /package/dist/{chunk-JZZJRVWZ.js.map → chunk-KLUN6KKF.js.map} +0 -0
- /package/dist/{chunk-YM3DJE2Q.js.map → chunk-MAXPKVQM.js.map} +0 -0
- /package/dist/{chunk-3BXCMTFV.js.map → chunk-MSWU4NDC.js.map} +0 -0
- /package/dist/{chunk-COBR6DBI.js.map → chunk-OOFCBN43.js.map} +0 -0
- /package/dist/{chunk-2MZODCSG.js.map → chunk-ORBZDEPN.js.map} +0 -0
- /package/dist/{chunk-XCQD5XSN.js.map → chunk-QAK5RTKL.js.map} +0 -0
- /package/dist/{chunk-IYJHSMXQ.js.map → chunk-QBB5JDFF.js.map} +0 -0
- /package/dist/{chunk-X3ON5EYW.js.map → chunk-S7Z3UJW7.js.map} +0 -0
- /package/dist/{chunk-I3AO3NVC.js.map → chunk-SE3M6KDX.js.map} +0 -0
- /package/dist/{chunk-777W7BCX.js.map → chunk-TCKNRYWG.js.map} +0 -0
- /package/dist/{chunk-PKY63672.js.map → chunk-THHDB7JN.js.map} +0 -0
- /package/dist/{chunk-5GW6OEYN.js.map → chunk-TIRRXH6I.js.map} +0 -0
- /package/dist/{chunk-E4EQDJD2.js.map → chunk-UPYZYJPK.js.map} +0 -0
- /package/dist/{chunk-POF2FE4S.js.map → chunk-V7TACE53.js.map} +0 -0
- /package/dist/{chunk-NISGFF25.js.map → chunk-WRINMNRX.js.map} +0 -0
- /package/dist/{chunk-A5O3CP37.js.map → chunk-XOA3X4MN.js.map} +0 -0
- /package/dist/{chunk-WDGQAGF4.js.map → chunk-XT3HB45X.js.map} +0 -0
- /package/dist/{chunk-NJ7CHZJS.js.map → chunk-Z5SKKACK.js.map} +0 -0
- /package/dist/{chunk-MGMRLWJA.js.map → chunk-ZG3W3DJ3.js.map} +0 -0
- /package/dist/{chunk-FGZVHEFP.js.map → chunk-ZLIW4G24.js.map} +0 -0
- /package/dist/{cleanup-757RQ5NW.js.map → cleanup-2VQTVWIG.js.map} +0 -0
- /package/dist/{cli-RRT5BOWM.js.map → cli-KRTX5VN7.js.map} +0 -0
- /package/dist/{color-SMQZHNFH.js.map → color-2G5SIVSI.js.map} +0 -0
- /package/dist/{config-TSNQIWAG.js.map → config-XBTJVJK3.js.map} +0 -0
- /package/dist/{coordinate-RJOG5DCS.js.map → coordinate-S3HTZFMP.js.map} +0 -0
- /package/dist/{diff-GBVTHXCV.js.map → diff-63GBECFI.js.map} +0 -0
- /package/dist/{digest-UFZSHQCP.js.map → digest-367JAS7G.js.map} +0 -0
- /package/dist/{fork-5ISDLKQF.js.map → fork-ALCUOTFA.js.map} +0 -0
- /package/dist/{history-ZX5COG2M.js.map → history-JESCVDIU.js.map} +0 -0
- /package/dist/{hydrate-N6ZIPOLK.js.map → hydrate-F2BZ6K7Y.js.map} +0 -0
- /package/dist/{init-P42G52BR.js.map → init-QPU6VIYG.js.map} +0 -0
- /package/dist/{install-skills-N63CWTOH.js.map → install-skills-KSLTHRHH.js.map} +0 -0
- /package/dist/{keep-HZC6HIWF.js.map → keep-DJRHEEFB.js.map} +0 -0
- /package/dist/{list-UAQKE4BT.js.map → list-5AVOAFXA.js.map} +0 -0
- /package/dist/{move-TUX7SKKM.js.map → move-75DQHXBR.js.map} +0 -0
- /package/dist/{note-SLVYVDC5.js.map → note-VFFRLSIF.js.map} +0 -0
- /package/dist/{overlaps-HC7GB3OL.js.map → overlaps-JW7C7MWI.js.map} +0 -0
- /package/dist/{pin-73FSKVDV.js.map → pin-CE63RHI3.js.map} +0 -0
- /package/dist/{pr-FJHTWA6C.js.map → pr-ONSSW6J4.js.map} +0 -0
- /package/dist/{prune-4DG3YNHQ.js.map → prune-HHTATOOQ.js.map} +0 -0
- /package/dist/{pty-host-72PLYNBT.js.map → pty-host-4LWIAULG.js.map} +0 -0
- /package/dist/{read-VFPXCEP6.js.map → read-O72SGX7S.js.map} +0 -0
- /package/dist/{recent-MT4K3M7A.js.map → recent-TI6O5KHP.js.map} +0 -0
- /package/dist/{remove-CTXCSMMJ.js.map → remove-L7YB6227.js.map} +0 -0
- /package/dist/{report-OZN3UE3W.js.map → report-2NXU55QS.js.map} +0 -0
- /package/dist/{restart-P3HCOUJY.js.map → restart-P352BMWT.js.map} +0 -0
- /package/dist/{resume-IQTLSLS3.js.map → resume-PAHRZPAJ.js.map} +0 -0
- /package/dist/{review-RAFSZBOC.js.map → review-WPHNJ47M.js.map} +0 -0
- /package/dist/{run-UYTHFJ7P.js.map → run-3CYZS4BM.js.map} +0 -0
- /package/dist/{screen-A33PDNY4.js.map → screen-YX7C4PXH.js.map} +0 -0
- /package/dist/{search-RIZJANOI.js.map → search-3LOJM3G4.js.map} +0 -0
- /package/dist/{section-XOWMNRLK.js.map → section-RMQAANNH.js.map} +0 -0
- /package/dist/{send-DTHWOC4Z.js.map → send-S3BBWJHD.js.map} +0 -0
- /package/dist/{sessions-PP555IEM.js.map → sessions-5WRAWFNI.js.map} +0 -0
- /package/dist/{snooze-F43627DM.js.map → snooze-5TASHLGL.js.map} +0 -0
- /package/dist/{start-LQP5L2UY.js.map → start-JGVD2O5V.js.map} +0 -0
- /package/dist/{status-U3OJRC4Y.js.map → status-ZO54EQVF.js.map} +0 -0
- /package/dist/{stop-EQCUYVUF.js.map → stop-XXLTBUCF.js.map} +0 -0
- /package/dist/{sync-GQBVRSSD.js.map → sync-2BTD7U2A.js.map} +0 -0
- /package/dist/{time-FOC4HMSX.js.map → time-WHUJH7FC.js.map} +0 -0
- /package/dist/{timesheet-YEKW5L2L.js.map → timesheet-T575FQNM.js.map} +0 -0
- /package/dist/{tree-2L6ZCDCE.js.map → tree-PV6GRIRG.js.map} +0 -0
- /package/dist/{update-RO7OB54G.js.map → update-W5KD6237.js.map} +0 -0
- /package/dist/{usage-2OYLKV6R.js.map → usage-AB2UAMHM.js.map} +0 -0
- /package/dist/{wait-4LZJ5WNQ.js.map → wait-RULOZMLR.js.map} +0 -0
|
@@ -190,7 +190,7 @@ var AccountAdminError = class extends Error {
|
|
|
190
190
|
};
|
|
191
191
|
|
|
192
192
|
// src/core/agents/index.ts
|
|
193
|
-
import
|
|
193
|
+
import path14 from "path";
|
|
194
194
|
|
|
195
195
|
// src/core/agents/claude/startup-question.ts
|
|
196
196
|
var YES = /^\s*[❯>]?\s*1\.\s+Yes, (?:I trust this folder|proceed)\s*$/;
|
|
@@ -203,11 +203,9 @@ function claudeStartupQuestion(screen) {
|
|
|
203
203
|
return yes >= 0 && tail.slice(yes + 1).some((l) => NO.test(l)) ? TRUST_QUESTION : null;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
// src/core/agents/claude/
|
|
207
|
-
import path12 from "path";
|
|
208
|
-
|
|
209
|
-
// src/core/agents/claude/files.ts
|
|
206
|
+
// src/core/agents/claude/temp-folders.ts
|
|
210
207
|
import fs3 from "fs";
|
|
208
|
+
import os2 from "os";
|
|
211
209
|
import path3 from "path";
|
|
212
210
|
|
|
213
211
|
// src/core/agents/claude/activity.ts
|
|
@@ -309,15 +307,54 @@ function resolveResumeLaunch(session) {
|
|
|
309
307
|
return { launchPath, hasConversation: bestMs > 0 };
|
|
310
308
|
}
|
|
311
309
|
|
|
310
|
+
// src/core/agents/claude/temp-folders.ts
|
|
311
|
+
function claudeTempRoot(platform = process.platform, uid = typeof process.getuid === "function" ? process.getuid() : -1, tmpdir = os2.tmpdir()) {
|
|
312
|
+
return platform === "win32" ? path3.win32.join(tmpdir, "claude") : `/tmp/claude-${uid}`;
|
|
313
|
+
}
|
|
314
|
+
function claudeTempFolders(session, root = claudeTempRoot()) {
|
|
315
|
+
const join = root.includes("\\") ? path3.win32.join : path3.posix.join;
|
|
316
|
+
return sessionRunFolders(session, false).map((folder) => join(root, encodeProjectDir(folder)));
|
|
317
|
+
}
|
|
318
|
+
var realIo = { realpath: (p) => fs3.realpathSync.native(p), lstat: (p) => fs3.lstatSync(p) };
|
|
319
|
+
function trustedTempRoot(root = claudeTempRoot(), platform = process.platform, uid = typeof process.getuid === "function" ? process.getuid() : -1, io = realIo) {
|
|
320
|
+
const p = platform === "win32" ? path3.win32 : path3.posix;
|
|
321
|
+
try {
|
|
322
|
+
const real = p.join(io.realpath(p.dirname(root)), p.basename(root));
|
|
323
|
+
const st = io.lstat(real);
|
|
324
|
+
if (!st.isDirectory() || st.isSymbolicLink()) return null;
|
|
325
|
+
if (platform !== "win32" && (st.uid !== uid || (st.mode & 63) !== 0)) return null;
|
|
326
|
+
return real;
|
|
327
|
+
} catch {
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function sessionTempFolders(session, root = claudeTempRoot(), platform = process.platform, uid = typeof process.getuid === "function" ? process.getuid() : -1, io = realIo) {
|
|
332
|
+
const real = trustedTempRoot(root, platform, uid, io);
|
|
333
|
+
if (!real) return [];
|
|
334
|
+
return claudeTempFolders(session, real).filter((f) => {
|
|
335
|
+
try {
|
|
336
|
+
const st = io.lstat(f);
|
|
337
|
+
return st.isDirectory() && !st.isSymbolicLink();
|
|
338
|
+
} catch {
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// src/core/agents/claude/adapter.ts
|
|
345
|
+
import path13 from "path";
|
|
346
|
+
|
|
312
347
|
// src/core/agents/claude/files.ts
|
|
348
|
+
import fs4 from "fs";
|
|
349
|
+
import path4 from "path";
|
|
313
350
|
function listTranscripts(session) {
|
|
314
|
-
const dirs = session.isGroup ? [...new Set(session.paths.map((p) =>
|
|
351
|
+
const dirs = session.isGroup ? [...new Set(session.paths.map((p) => path4.dirname(p)))] : session.paths;
|
|
315
352
|
const roots = claudeProjectsRoots(sessionAccount(session));
|
|
316
353
|
const seen = /* @__PURE__ */ new Set();
|
|
317
354
|
const out = [];
|
|
318
355
|
for (const d of dirs)
|
|
319
356
|
for (const root of roots)
|
|
320
|
-
for (const f of projectTranscripts(
|
|
357
|
+
for (const f of projectTranscripts(path4.join(root, encodeProjectDir(d)))) {
|
|
321
358
|
if (seen.has(f.file)) continue;
|
|
322
359
|
seen.add(f.file);
|
|
323
360
|
out.push(f);
|
|
@@ -328,18 +365,18 @@ function listUsageFiles(session) {
|
|
|
328
365
|
const out = [];
|
|
329
366
|
for (const t of listTranscripts(session)) {
|
|
330
367
|
out.push(t);
|
|
331
|
-
const dir =
|
|
368
|
+
const dir = path4.join(t.file.replace(/\.jsonl$/, ""), "subagents");
|
|
332
369
|
let names;
|
|
333
370
|
try {
|
|
334
|
-
names =
|
|
371
|
+
names = fs4.readdirSync(dir);
|
|
335
372
|
} catch {
|
|
336
373
|
continue;
|
|
337
374
|
}
|
|
338
375
|
for (const name of names) {
|
|
339
376
|
if (!name.startsWith("agent-") || !name.endsWith(".jsonl")) continue;
|
|
340
|
-
const file =
|
|
377
|
+
const file = path4.join(dir, name);
|
|
341
378
|
try {
|
|
342
|
-
const st =
|
|
379
|
+
const st = fs4.statSync(file);
|
|
343
380
|
out.push({ file, mtimeMs: st.mtimeMs, size: st.size });
|
|
344
381
|
} catch {
|
|
345
382
|
}
|
|
@@ -367,23 +404,23 @@ function whatOf(meta) {
|
|
|
367
404
|
function lookForBackgroundWork(session, sinceMs, afterMs, quietFrom = afterMs) {
|
|
368
405
|
for (const t of listTranscripts(session)) {
|
|
369
406
|
if (t.mtimeMs < sinceMs - AROUND_TURN_MS) continue;
|
|
370
|
-
const dir =
|
|
407
|
+
const dir = path4.join(t.file.replace(/\.jsonl$/, ""), "subagents");
|
|
371
408
|
let names;
|
|
372
409
|
try {
|
|
373
|
-
names =
|
|
410
|
+
names = fs4.readdirSync(dir);
|
|
374
411
|
} catch {
|
|
375
412
|
continue;
|
|
376
413
|
}
|
|
377
414
|
for (const name of names) {
|
|
378
415
|
if (!name.endsWith(".jsonl")) continue;
|
|
379
|
-
const file =
|
|
416
|
+
const file = path4.join(dir, name);
|
|
380
417
|
try {
|
|
381
|
-
const written =
|
|
418
|
+
const written = fs4.statSync(file).mtimeMs;
|
|
382
419
|
if (written <= quietFrom) continue;
|
|
383
420
|
const metaFile = file.replace(/\.jsonl$/, ".meta.json");
|
|
384
|
-
const startedForTurn =
|
|
421
|
+
const startedForTurn = fs4.statSync(metaFile).mtimeMs >= sinceMs - AROUND_TURN_MS;
|
|
385
422
|
if (written <= afterMs && !startedForTurn) continue;
|
|
386
|
-
const meta = JSON.parse(
|
|
423
|
+
const meta = JSON.parse(fs4.readFileSync(metaFile, "utf8"));
|
|
387
424
|
if (meta && typeof meta === "object" && meta.requestShape === "background")
|
|
388
425
|
return { what: whatOf(meta) };
|
|
389
426
|
} catch {
|
|
@@ -394,7 +431,7 @@ function lookForBackgroundWork(session, sinceMs, afterMs, quietFrom = afterMs) {
|
|
|
394
431
|
}
|
|
395
432
|
|
|
396
433
|
// src/core/conversations/jsonl.ts
|
|
397
|
-
import
|
|
434
|
+
import fs5 from "fs";
|
|
398
435
|
var TAIL_BYTES = 256 * 1024;
|
|
399
436
|
function parseLines(text) {
|
|
400
437
|
const out = [];
|
|
@@ -413,15 +450,15 @@ function readJsonlTail(transcriptPath, bytes = TAIL_BYTES) {
|
|
|
413
450
|
if (!transcriptPath) return [];
|
|
414
451
|
let text;
|
|
415
452
|
try {
|
|
416
|
-
const fd =
|
|
453
|
+
const fd = fs5.openSync(transcriptPath, "r");
|
|
417
454
|
try {
|
|
418
|
-
const size =
|
|
455
|
+
const size = fs5.fstatSync(fd).size;
|
|
419
456
|
const start = Math.max(0, size - bytes);
|
|
420
457
|
const buf = Buffer.alloc(size - start);
|
|
421
|
-
|
|
458
|
+
fs5.readSync(fd, buf, 0, buf.length, start);
|
|
422
459
|
text = buf.toString("utf-8");
|
|
423
460
|
} finally {
|
|
424
|
-
|
|
461
|
+
fs5.closeSync(fd);
|
|
425
462
|
}
|
|
426
463
|
} catch {
|
|
427
464
|
return [];
|
|
@@ -435,7 +472,7 @@ async function readJsonlSince(transcriptPath, sinceMs, timeOf, opts = {}) {
|
|
|
435
472
|
const max = Math.max(chunk, opts.maxBytes ?? SINCE_MAX_BYTES);
|
|
436
473
|
let fh;
|
|
437
474
|
try {
|
|
438
|
-
fh = await
|
|
475
|
+
fh = await fs5.promises.open(transcriptPath, "r");
|
|
439
476
|
} catch {
|
|
440
477
|
return { lines: [], partial: false };
|
|
441
478
|
}
|
|
@@ -650,10 +687,10 @@ function claudeContextWindow(model, used) {
|
|
|
650
687
|
}
|
|
651
688
|
|
|
652
689
|
// src/core/agents/claude/hooks.ts
|
|
653
|
-
import
|
|
690
|
+
import path6 from "path";
|
|
654
691
|
|
|
655
692
|
// src/core/agents/claude/permission.ts
|
|
656
|
-
import
|
|
693
|
+
import path5 from "path";
|
|
657
694
|
function pendingToolUse(entries) {
|
|
658
695
|
const answered = /* @__PURE__ */ new Set();
|
|
659
696
|
for (const e of entries) {
|
|
@@ -684,7 +721,7 @@ var YES_SELECTED_RE = /❯\s*1\.\s*Yes\b/;
|
|
|
684
721
|
var squash = (s) => s.replace(/[\s\u2500-\u257f]+/g, "");
|
|
685
722
|
function screenAnchor(req) {
|
|
686
723
|
if (req.tool === "Bash" || req.tool === "PowerShell") return squash(req.detail.split(" \u23CE ")[0]).slice(0, 40);
|
|
687
|
-
if (/[\\/]/.test(req.detail) && !/^https?:/.test(req.detail)) return
|
|
724
|
+
if (/[\\/]/.test(req.detail) && !/^https?:/.test(req.detail)) return path5.basename(req.detail.replace(/\\/g, "/"));
|
|
688
725
|
return "";
|
|
689
726
|
}
|
|
690
727
|
function checkDialog(screen, req) {
|
|
@@ -744,7 +781,7 @@ function claudeStatusEvent(edge, payload) {
|
|
|
744
781
|
}
|
|
745
782
|
}
|
|
746
783
|
var toClaude = (h) => ({ owner: h.owner, event: CLAUDE_EVENT[h.edge] });
|
|
747
|
-
var settingsFiles = () => setUpAccounts().map((a) =>
|
|
784
|
+
var settingsFiles = () => setUpAccounts().map((a) => path6.join(a.dir, "settings.json"));
|
|
748
785
|
var claudeEvents = {
|
|
749
786
|
removeInstalled: async (hooks) => {
|
|
750
787
|
const inst = await loadInstaller();
|
|
@@ -771,11 +808,11 @@ var claudeEvents = {
|
|
|
771
808
|
};
|
|
772
809
|
|
|
773
810
|
// src/core/agents/claude/session-settings.ts
|
|
774
|
-
import
|
|
775
|
-
import
|
|
811
|
+
import fs6 from "fs";
|
|
812
|
+
import path7 from "path";
|
|
776
813
|
var SESSION_SETTINGS_NAME = "claude-settings.json";
|
|
777
814
|
var SESSION_ALLOW = ["Bash(work child:*)", "Bash(work report:*)"];
|
|
778
|
-
var sessionSettingsPath = () =>
|
|
815
|
+
var sessionSettingsPath = () => path7.join(getConfigDir(), SESSION_SETTINGS_NAME);
|
|
779
816
|
function claudeSessionSettings(o) {
|
|
780
817
|
const hooks = {};
|
|
781
818
|
for (const h of SESSION_HOOKS) {
|
|
@@ -785,6 +822,7 @@ function claudeSessionSettings(o) {
|
|
|
785
822
|
}
|
|
786
823
|
hooks.SessionStart = [{ hooks: [{ type: "command", command: workCommand(["hook", "session-start"], o.invocation), timeout: 10 }] }];
|
|
787
824
|
hooks.SessionEnd = [{ hooks: [{ type: "command", command: workCommand(["hook", "session-end"], o.invocation), timeout: 10 }] }];
|
|
825
|
+
hooks.StopFailure = [{ hooks: [{ type: "command", command: workCommand(["hook", "stop-failure"], o.invocation), timeout: 10 }] }];
|
|
788
826
|
return {
|
|
789
827
|
hooks,
|
|
790
828
|
// A coordinator's own sessions (session-children.ts): `work child` acts only on the sessions the one running it
|
|
@@ -802,19 +840,19 @@ function writeSessionSettings(o = {}) {
|
|
|
802
840
|
const text = JSON.stringify(claudeSessionSettings({ statusLine, invocation: o.invocation }), null, 2) + "\n";
|
|
803
841
|
let now = null;
|
|
804
842
|
try {
|
|
805
|
-
now =
|
|
843
|
+
now = fs6.readFileSync(file, "utf-8");
|
|
806
844
|
} catch {
|
|
807
845
|
}
|
|
808
846
|
if (now !== text) {
|
|
809
|
-
|
|
847
|
+
fs6.mkdirSync(path7.dirname(file), { recursive: true });
|
|
810
848
|
atomicWriteFile(file, text);
|
|
811
849
|
}
|
|
812
850
|
return file;
|
|
813
851
|
}
|
|
814
|
-
var isOurs = (p) => !!p &&
|
|
852
|
+
var isOurs = (p) => !!p && path7.basename(p) === SESSION_SETTINGS_NAME;
|
|
815
853
|
function sessionSettingsFile(o = {}) {
|
|
816
854
|
const file = sessionSettingsPath();
|
|
817
|
-
return o.write === false &&
|
|
855
|
+
return o.write === false && fs6.existsSync(file) ? file : writeSessionSettings();
|
|
818
856
|
}
|
|
819
857
|
var startedWithSessionSettings = (commandLine) => commandLine.includes(SESSION_SETTINGS_NAME);
|
|
820
858
|
function withSessionSettings(tool, file = sessionSettingsFile()) {
|
|
@@ -830,9 +868,9 @@ function withSessionSettings(tool, file = sessionSettingsFile()) {
|
|
|
830
868
|
}
|
|
831
869
|
|
|
832
870
|
// src/core/agents/claude/live.ts
|
|
833
|
-
import
|
|
834
|
-
import
|
|
835
|
-
import
|
|
871
|
+
import fs7 from "fs";
|
|
872
|
+
import os3 from "os";
|
|
873
|
+
import path8 from "path";
|
|
836
874
|
var isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
837
875
|
function parseLiveClaude(raw) {
|
|
838
876
|
if (!isObj(raw)) return null;
|
|
@@ -862,24 +900,24 @@ function aliveOnly(list, table, bootMs) {
|
|
|
862
900
|
var TTL_MS = 5e3;
|
|
863
901
|
var cache = null;
|
|
864
902
|
function claudeSessionsDir() {
|
|
865
|
-
return
|
|
903
|
+
return path8.join(process.env.CLAUDE_CONFIG_DIR || path8.join(os3.homedir(), ".claude"), "sessions");
|
|
866
904
|
}
|
|
867
905
|
function claudeSessionsDirs() {
|
|
868
906
|
const accounts = claudeAccounts();
|
|
869
907
|
if (accounts.length <= 1) return [claudeSessionsDir()];
|
|
870
|
-
return [...new Set(accounts.map((a) =>
|
|
908
|
+
return [...new Set(accounts.map((a) => path8.join(a.dir, "sessions")))];
|
|
871
909
|
}
|
|
872
910
|
function readDir(dir, table) {
|
|
873
911
|
let names;
|
|
874
912
|
try {
|
|
875
|
-
names =
|
|
913
|
+
names = fs7.readdirSync(dir).filter((n) => /^\d+\.json$/.test(n));
|
|
876
914
|
} catch {
|
|
877
915
|
return [];
|
|
878
916
|
}
|
|
879
917
|
const parsed = [];
|
|
880
918
|
for (const n of names) {
|
|
881
919
|
try {
|
|
882
|
-
const c = parseLiveClaude(JSON.parse(
|
|
920
|
+
const c = parseLiveClaude(JSON.parse(fs7.readFileSync(path8.join(dir, n), "utf8")));
|
|
883
921
|
if (c) parsed.push(c);
|
|
884
922
|
} catch {
|
|
885
923
|
}
|
|
@@ -907,12 +945,12 @@ var typeThenEnter = async (write, text, wait = (ms) => new Promise((r) => setTim
|
|
|
907
945
|
};
|
|
908
946
|
|
|
909
947
|
// src/core/agents/claude/workspace.ts
|
|
910
|
-
import
|
|
911
|
-
import
|
|
948
|
+
import fs8 from "fs";
|
|
949
|
+
import path9 from "path";
|
|
912
950
|
var claudeAllowRule = (r) => `Bash(${r.command}${r.prefix ? ":*" : ""})`;
|
|
913
951
|
var claudeWorkspace = {
|
|
914
952
|
write(dir, { allow, hooks }) {
|
|
915
|
-
|
|
953
|
+
fs8.mkdirSync(path9.join(dir, ".claude"), { recursive: true });
|
|
916
954
|
const byEvent = {};
|
|
917
955
|
for (const h of hooks) {
|
|
918
956
|
(byEvent[CLAUDE_EVENT[h.edge]] ??= []).push({
|
|
@@ -920,8 +958,8 @@ var claudeWorkspace = {
|
|
|
920
958
|
});
|
|
921
959
|
}
|
|
922
960
|
const settings = { permissions: { allow: allow.map(claudeAllowRule) }, hooks: byEvent };
|
|
923
|
-
atomicWriteFile(
|
|
924
|
-
return [
|
|
961
|
+
atomicWriteFile(path9.join(dir, ".claude", "settings.json"), JSON.stringify(settings, null, 2) + "\n");
|
|
962
|
+
return [path9.join(".claude", "settings.json")];
|
|
925
963
|
}
|
|
926
964
|
};
|
|
927
965
|
|
|
@@ -1042,21 +1080,21 @@ var claudeUsage = {
|
|
|
1042
1080
|
};
|
|
1043
1081
|
|
|
1044
1082
|
// src/core/agents/claude/account-move.ts
|
|
1083
|
+
import fs11 from "fs";
|
|
1084
|
+
import path12 from "path";
|
|
1085
|
+
|
|
1086
|
+
// src/core/agents/claude/account-admin.ts
|
|
1045
1087
|
import fs10 from "fs";
|
|
1088
|
+
import os5 from "os";
|
|
1046
1089
|
import path11 from "path";
|
|
1047
1090
|
|
|
1048
|
-
// src/core/agents/claude/
|
|
1091
|
+
// src/core/agents/claude/setup-copy.ts
|
|
1049
1092
|
import fs9 from "fs";
|
|
1050
1093
|
import os4 from "os";
|
|
1051
1094
|
import path10 from "path";
|
|
1052
|
-
|
|
1053
|
-
// src/core/agents/claude/setup-copy.ts
|
|
1054
|
-
import fs8 from "fs";
|
|
1055
|
-
import os3 from "os";
|
|
1056
|
-
import path9 from "path";
|
|
1057
1095
|
var TRUSTED_FOLDERS = "trusted folders";
|
|
1058
|
-
function globalConfigFile(dir, home =
|
|
1059
|
-
return accountDirKey(dir) === accountDirKey(
|
|
1096
|
+
function globalConfigFile(dir, home = os4.homedir()) {
|
|
1097
|
+
return accountDirKey(dir) === accountDirKey(path10.join(home, ".claude")) ? path10.join(home, ".claude.json") : path10.join(dir, ".claude.json");
|
|
1060
1098
|
}
|
|
1061
1099
|
var isObject = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
1062
1100
|
var same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
@@ -1136,7 +1174,7 @@ var FILES = ["CLAUDE.md", "statusline-command.sh"];
|
|
|
1136
1174
|
var FOLDERS = ["agents", "commands"];
|
|
1137
1175
|
var SETTINGS = ["settings.json", "settings.local.json"];
|
|
1138
1176
|
function alreadyThere(from, to, io) {
|
|
1139
|
-
if (io.isDir(from)) return io.isDir(to) && io.list(from).every((name) => alreadyThere(
|
|
1177
|
+
if (io.isDir(from)) return io.isDir(to) && io.list(from).every((name) => alreadyThere(path10.join(from, name), path10.join(to, name), io));
|
|
1140
1178
|
const a = io.read(from);
|
|
1141
1179
|
const b = io.read(to);
|
|
1142
1180
|
return !!a && !!b && a.equals(b);
|
|
@@ -1146,31 +1184,31 @@ function marketplaceKey(source) {
|
|
|
1146
1184
|
return args ? args[3].replace(/\\/g, "/").replace(/\/+$/, "").toLowerCase() : null;
|
|
1147
1185
|
}
|
|
1148
1186
|
var realSetupIo = {
|
|
1149
|
-
exists: (p) =>
|
|
1187
|
+
exists: (p) => fs9.existsSync(p),
|
|
1150
1188
|
isDir: (p) => {
|
|
1151
1189
|
try {
|
|
1152
|
-
return
|
|
1190
|
+
return fs9.statSync(p).isDirectory();
|
|
1153
1191
|
} catch {
|
|
1154
1192
|
return false;
|
|
1155
1193
|
}
|
|
1156
1194
|
},
|
|
1157
1195
|
list: (dir) => {
|
|
1158
1196
|
try {
|
|
1159
|
-
return
|
|
1197
|
+
return fs9.readdirSync(dir);
|
|
1160
1198
|
} catch {
|
|
1161
1199
|
return [];
|
|
1162
1200
|
}
|
|
1163
1201
|
},
|
|
1164
1202
|
read: (file) => {
|
|
1165
1203
|
try {
|
|
1166
|
-
return
|
|
1204
|
+
return fs9.readFileSync(file);
|
|
1167
1205
|
} catch {
|
|
1168
1206
|
return null;
|
|
1169
1207
|
}
|
|
1170
1208
|
},
|
|
1171
1209
|
readJson: (file) => {
|
|
1172
1210
|
try {
|
|
1173
|
-
return JSON.parse(
|
|
1211
|
+
return JSON.parse(fs9.readFileSync(file, "utf-8"));
|
|
1174
1212
|
} catch {
|
|
1175
1213
|
return null;
|
|
1176
1214
|
}
|
|
@@ -1196,20 +1234,20 @@ function withTrusted(config, folders) {
|
|
|
1196
1234
|
}
|
|
1197
1235
|
function planSetupCopy(from, to, io = realSetupIo) {
|
|
1198
1236
|
const items = [];
|
|
1199
|
-
const there = (rel) => io.exists(
|
|
1200
|
-
const differs = (rel) => !alreadyThere(
|
|
1237
|
+
const there = (rel) => io.exists(path10.join(to.dir, rel));
|
|
1238
|
+
const differs = (rel) => !alreadyThere(path10.join(from.dir, rel), path10.join(to.dir, rel), io);
|
|
1201
1239
|
for (const f of FILES)
|
|
1202
|
-
if (io.exists(
|
|
1240
|
+
if (io.exists(path10.join(from.dir, f)) && differs(f)) items.push({ kind: "file", name: f, does: there(f) ? "replaces" : "adds" });
|
|
1203
1241
|
for (const d of FOLDERS)
|
|
1204
|
-
if (io.isDir(
|
|
1242
|
+
if (io.isDir(path10.join(from.dir, d)) && io.list(path10.join(from.dir, d)).length && differs(d))
|
|
1205
1243
|
items.push({ kind: "folder", name: `${d}/`, does: there(d) ? "merges into" : "adds" });
|
|
1206
|
-
for (const skill of io.list(
|
|
1207
|
-
if (differs(
|
|
1208
|
-
items.push({ kind: "folder", name: `skills/${skill}/`, does: there(
|
|
1244
|
+
for (const skill of io.list(path10.join(from.dir, "skills")).filter((s) => s !== "synced" && io.isDir(path10.join(from.dir, "skills", s))))
|
|
1245
|
+
if (differs(path10.join("skills", skill)))
|
|
1246
|
+
items.push({ kind: "folder", name: `skills/${skill}/`, does: there(path10.join("skills", skill)) ? "replaces" : "adds" });
|
|
1209
1247
|
for (const s of SETTINGS) {
|
|
1210
|
-
const source = io.readJson(
|
|
1248
|
+
const source = io.readJson(path10.join(from.dir, s));
|
|
1211
1249
|
if (!isObject(source)) continue;
|
|
1212
|
-
const target = io.readJson(
|
|
1250
|
+
const target = io.readJson(path10.join(to.dir, s));
|
|
1213
1251
|
const have = isObject(target) ? target : {};
|
|
1214
1252
|
if (!same(mergeSettings(source, have), have))
|
|
1215
1253
|
items.push({
|
|
@@ -1232,8 +1270,8 @@ function planSetupCopy(from, to, io = realSetupIo) {
|
|
|
1232
1270
|
...remote ? { note: `needs its own sign-in on ${to.name}: /mcp \u2192 ${name} \u2192 Authenticate` } : {}
|
|
1233
1271
|
});
|
|
1234
1272
|
}
|
|
1235
|
-
const markets = io.readJson(
|
|
1236
|
-
const haveMarkets = io.readJson(
|
|
1273
|
+
const markets = io.readJson(path10.join(from.dir, "plugins", "known_marketplaces.json"));
|
|
1274
|
+
const haveMarkets = io.readJson(path10.join(to.dir, "plugins", "known_marketplaces.json"));
|
|
1237
1275
|
const haveSources = new Set(
|
|
1238
1276
|
Object.values(isObject(haveMarkets) ? haveMarkets : {}).map((m) => marketplaceKey(isObject(m) ? m.source : null)).filter((k) => k !== null)
|
|
1239
1277
|
);
|
|
@@ -1244,8 +1282,8 @@ function planSetupCopy(from, to, io = realSetupIo) {
|
|
|
1244
1282
|
const args = marketplaceAddArgs(isObject(m) ? m.source : null);
|
|
1245
1283
|
if (args) items.push({ kind: "marketplace", name, does: "adds", note: args[3] });
|
|
1246
1284
|
}
|
|
1247
|
-
const enabled = objectAt(io.readJson(
|
|
1248
|
-
const installed = objectAt(io.readJson(
|
|
1285
|
+
const enabled = objectAt(io.readJson(path10.join(from.dir, "settings.json")), "enabledPlugins");
|
|
1286
|
+
const installed = objectAt(io.readJson(path10.join(to.dir, "plugins", "installed_plugins.json")), "plugins");
|
|
1249
1287
|
for (const [id, on] of Object.entries(enabled))
|
|
1250
1288
|
if (on === true && !(id in installed)) items.push({ kind: "plugin", name: id, does: "adds", note: "installed from its marketplace" });
|
|
1251
1289
|
const trust = trustToCopy(from, to, io);
|
|
@@ -1278,14 +1316,14 @@ function setupEnv(dir) {
|
|
|
1278
1316
|
return accountDirKey(dir) === accountDirKey(defaultAccountDir()) ? { CLAUDE_CONFIG_DIR: null } : { CLAUDE_CONFIG_DIR: dir };
|
|
1279
1317
|
}
|
|
1280
1318
|
function mergeSettingsFile(fromFile, toFile) {
|
|
1281
|
-
const source = JSON.parse(
|
|
1319
|
+
const source = JSON.parse(fs9.readFileSync(fromFile, "utf-8"));
|
|
1282
1320
|
if (!isObject(source)) throw new Error("its settings are not an object");
|
|
1283
|
-
|
|
1321
|
+
fs9.mkdirSync(path10.dirname(toFile), { recursive: true });
|
|
1284
1322
|
ensureFile(toFile, "{}\n");
|
|
1285
1323
|
withFileLockSync(toFile, () => {
|
|
1286
1324
|
let target = {};
|
|
1287
1325
|
try {
|
|
1288
|
-
target = JSON.parse(
|
|
1326
|
+
target = JSON.parse(fs9.readFileSync(toFile, "utf-8"));
|
|
1289
1327
|
} catch {
|
|
1290
1328
|
}
|
|
1291
1329
|
atomicWriteFile(toFile, `${JSON.stringify(mergeSettings(source, isObject(target) ? target : {}), null, 2)}
|
|
@@ -1293,12 +1331,12 @@ function mergeSettingsFile(fromFile, toFile) {
|
|
|
1293
1331
|
});
|
|
1294
1332
|
}
|
|
1295
1333
|
function trustFolders(file, folders) {
|
|
1296
|
-
|
|
1334
|
+
fs9.mkdirSync(path10.dirname(file), { recursive: true });
|
|
1297
1335
|
ensureFile(file, "{}\n");
|
|
1298
1336
|
withFileLockSync(file, () => {
|
|
1299
1337
|
let config;
|
|
1300
1338
|
try {
|
|
1301
|
-
config = JSON.parse(
|
|
1339
|
+
config = JSON.parse(fs9.readFileSync(file, "utf-8"));
|
|
1302
1340
|
} catch {
|
|
1303
1341
|
throw new Error("its config file can\u2019t be read");
|
|
1304
1342
|
}
|
|
@@ -1310,18 +1348,18 @@ async function applySetupCopy(from, to, run = runClaude2) {
|
|
|
1310
1348
|
if (accountDirKey(from.dir) === accountDirKey(to.dir)) throw new Error("an account\u2019s setup can\u2019t be copied to itself");
|
|
1311
1349
|
const env = setupEnv(to.dir);
|
|
1312
1350
|
const servers = userMcpServers(from.dir);
|
|
1313
|
-
const markets = realSetupIo.readJson(
|
|
1351
|
+
const markets = realSetupIo.readJson(path10.join(from.dir, "plugins", "known_marketplaces.json"));
|
|
1314
1352
|
const results = [];
|
|
1315
1353
|
for (const item of planSetupCopy(from, to)) {
|
|
1316
1354
|
try {
|
|
1317
1355
|
const rel = item.name.replace(/\/$/, "");
|
|
1318
1356
|
if (item.kind === "file") {
|
|
1319
|
-
|
|
1320
|
-
|
|
1357
|
+
fs9.mkdirSync(to.dir, { recursive: true });
|
|
1358
|
+
fs9.copyFileSync(path10.join(from.dir, rel), path10.join(to.dir, rel));
|
|
1321
1359
|
} else if (item.kind === "folder") {
|
|
1322
|
-
|
|
1360
|
+
fs9.cpSync(path10.join(from.dir, rel), path10.join(to.dir, rel), { recursive: true, force: true, verbatimSymlinks: true });
|
|
1323
1361
|
} else if (item.kind === "settings") {
|
|
1324
|
-
mergeSettingsFile(
|
|
1362
|
+
mergeSettingsFile(path10.join(from.dir, rel), path10.join(to.dir, rel));
|
|
1325
1363
|
} else if (item.kind === "mcp") {
|
|
1326
1364
|
if (item.does === "replaces") run(["mcp", "remove", item.name, "--scope", "user"], env);
|
|
1327
1365
|
const r = run(["mcp", "add-json", item.name, "-", "--scope", "user"], env, JSON.stringify(servers[item.name]));
|
|
@@ -1350,9 +1388,9 @@ async function applySetupCopy(from, to, run = runClaude2) {
|
|
|
1350
1388
|
// src/core/agents/claude/account-admin.ts
|
|
1351
1389
|
async function editConfig(fn) {
|
|
1352
1390
|
const file = getConfigPath();
|
|
1353
|
-
if (!
|
|
1391
|
+
if (!fs10.existsSync(file)) throw new AccountAdminError("No configuration yet: run `work init` first.");
|
|
1354
1392
|
return withFileLock(file, () => {
|
|
1355
|
-
const raw = JSON.parse(
|
|
1393
|
+
const raw = JSON.parse(fs10.readFileSync(file, "utf-8"));
|
|
1356
1394
|
const existing = raw.claudeAccounts;
|
|
1357
1395
|
const accounts = existing && typeof existing === "object" && !Array.isArray(existing) ? { ...existing } : {};
|
|
1358
1396
|
const out = fn(raw, accounts);
|
|
@@ -1364,14 +1402,14 @@ async function editConfig(fn) {
|
|
|
1364
1402
|
}
|
|
1365
1403
|
var validIn = (raw) => validateClaudeAccounts(raw.claudeAccounts, void 0, accountForbiddenRoots(raw)).accounts ?? {};
|
|
1366
1404
|
async function addAccount(name, dir) {
|
|
1367
|
-
const folder = expandAccountDir(dir?.trim() ||
|
|
1405
|
+
const folder = expandAccountDir(dir?.trim() || path11.join(os5.homedir(), `.claude-${name}`));
|
|
1368
1406
|
if (!folder) throw new AccountAdminError(`${dir} is not an absolute folder`);
|
|
1369
1407
|
return editConfig((raw, accounts) => {
|
|
1370
1408
|
if (name in accounts) throw new AccountAdminError(`there is already an account \u201C${name}\u201D`);
|
|
1371
1409
|
const problem = accountProblem(name, folder, Object.values(validIn(raw)), accountForbiddenRoots(raw));
|
|
1372
1410
|
if (problem) throw new AccountAdminError(problem);
|
|
1373
1411
|
try {
|
|
1374
|
-
|
|
1412
|
+
fs10.mkdirSync(folder, { recursive: true });
|
|
1375
1413
|
} catch (e) {
|
|
1376
1414
|
throw new AccountAdminError(`couldn't make ${folder}: ${e instanceof Error ? e.message : String(e)}`);
|
|
1377
1415
|
}
|
|
@@ -1448,14 +1486,14 @@ var AccountMoveError = class extends Error {
|
|
|
1448
1486
|
};
|
|
1449
1487
|
var isDir = (p) => {
|
|
1450
1488
|
try {
|
|
1451
|
-
return
|
|
1489
|
+
return fs11.statSync(p).isDirectory();
|
|
1452
1490
|
} catch {
|
|
1453
1491
|
return false;
|
|
1454
1492
|
}
|
|
1455
1493
|
};
|
|
1456
1494
|
var exists = (p) => {
|
|
1457
1495
|
try {
|
|
1458
|
-
|
|
1496
|
+
fs11.lstatSync(p);
|
|
1459
1497
|
return true;
|
|
1460
1498
|
} catch {
|
|
1461
1499
|
return false;
|
|
@@ -1463,31 +1501,31 @@ var exists = (p) => {
|
|
|
1463
1501
|
};
|
|
1464
1502
|
var mtime = (p) => {
|
|
1465
1503
|
try {
|
|
1466
|
-
return
|
|
1504
|
+
return fs11.statSync(p).mtimeMs;
|
|
1467
1505
|
} catch {
|
|
1468
1506
|
return 0;
|
|
1469
1507
|
}
|
|
1470
1508
|
};
|
|
1471
1509
|
function moveEntry(from, to) {
|
|
1472
|
-
|
|
1510
|
+
fs11.mkdirSync(path12.dirname(to), { recursive: true });
|
|
1473
1511
|
try {
|
|
1474
|
-
|
|
1512
|
+
fs11.renameSync(from, to);
|
|
1475
1513
|
return;
|
|
1476
1514
|
} catch (err) {
|
|
1477
1515
|
const code = err.code;
|
|
1478
1516
|
if (code !== "EXDEV" && code !== "EPERM") throw err;
|
|
1479
1517
|
}
|
|
1480
1518
|
try {
|
|
1481
|
-
|
|
1519
|
+
fs11.cpSync(from, to, { recursive: true, errorOnExist: true, force: false, preserveTimestamps: true });
|
|
1482
1520
|
} catch (err) {
|
|
1483
|
-
|
|
1521
|
+
fs11.rmSync(to, { recursive: true, force: true });
|
|
1484
1522
|
throw err;
|
|
1485
1523
|
}
|
|
1486
1524
|
try {
|
|
1487
|
-
|
|
1525
|
+
fs11.rmSync(from, { recursive: true, force: true });
|
|
1488
1526
|
} catch (err) {
|
|
1489
1527
|
try {
|
|
1490
|
-
|
|
1528
|
+
fs11.cpSync(to, from, { recursive: true, force: false, errorOnExist: false, preserveTimestamps: true });
|
|
1491
1529
|
} catch (back) {
|
|
1492
1530
|
const why = (e) => e instanceof Error ? e.message : String(e);
|
|
1493
1531
|
throw new Error(`${why(err)}; what its delete took couldn't be put back (${why(back)}), so it is kept at ${to} too`, {
|
|
@@ -1495,7 +1533,7 @@ function moveEntry(from, to) {
|
|
|
1495
1533
|
});
|
|
1496
1534
|
}
|
|
1497
1535
|
try {
|
|
1498
|
-
|
|
1536
|
+
fs11.rmSync(to, { recursive: true, force: true });
|
|
1499
1537
|
} catch {
|
|
1500
1538
|
}
|
|
1501
1539
|
throw err;
|
|
@@ -1514,9 +1552,9 @@ function mergeInto(src, dst, tag, steps, moved) {
|
|
|
1514
1552
|
return;
|
|
1515
1553
|
}
|
|
1516
1554
|
if (isDir(src) && isDir(dst)) {
|
|
1517
|
-
for (const name of
|
|
1555
|
+
for (const name of fs11.readdirSync(src)) mergeInto(path12.join(src, name), path12.join(dst, name), tag, steps, moved);
|
|
1518
1556
|
try {
|
|
1519
|
-
|
|
1557
|
+
fs11.rmdirSync(src);
|
|
1520
1558
|
} catch {
|
|
1521
1559
|
}
|
|
1522
1560
|
return;
|
|
@@ -1550,32 +1588,32 @@ function undo(steps) {
|
|
|
1550
1588
|
}
|
|
1551
1589
|
function latestConversation(dir) {
|
|
1552
1590
|
let best = null;
|
|
1553
|
-
for (const name of
|
|
1591
|
+
for (const name of fs11.readdirSync(dir)) {
|
|
1554
1592
|
if (!name.endsWith(".jsonl")) continue;
|
|
1555
|
-
const at = mtime(
|
|
1593
|
+
const at = mtime(path12.join(dir, name));
|
|
1556
1594
|
if (!best || at > best.at) best = { name, at };
|
|
1557
1595
|
}
|
|
1558
1596
|
if (!best) return [];
|
|
1559
1597
|
const id = best.name.slice(0, -".jsonl".length);
|
|
1560
|
-
return [best.name, ...isDir(
|
|
1598
|
+
return [best.name, ...isDir(path12.join(dir, id)) ? [id] : []];
|
|
1561
1599
|
}
|
|
1562
1600
|
function moveConversations(session, fromDir, toDir, tag = "old", opts = {}) {
|
|
1563
1601
|
const steps = [];
|
|
1564
1602
|
const moved = [];
|
|
1565
|
-
if (
|
|
1603
|
+
if (path12.resolve(fromDir) === path12.resolve(toDir)) return { moved };
|
|
1566
1604
|
const emptied = [];
|
|
1567
1605
|
let at = "";
|
|
1568
1606
|
try {
|
|
1569
1607
|
for (const cwd of sessionRunFolders(session, false)) {
|
|
1570
1608
|
const name = encodeProjectDir(cwd);
|
|
1571
|
-
const src =
|
|
1609
|
+
const src = path12.join(projectsRootOf(fromDir), name);
|
|
1572
1610
|
if (!isDir(src)) continue;
|
|
1573
1611
|
at = src;
|
|
1574
|
-
const dst =
|
|
1612
|
+
const dst = path12.join(projectsRootOf(toDir), name);
|
|
1575
1613
|
if (opts.onlyLatest) {
|
|
1576
1614
|
for (const entry of latestConversation(src)) {
|
|
1577
|
-
at =
|
|
1578
|
-
mergeInto(
|
|
1615
|
+
at = path12.join(src, entry);
|
|
1616
|
+
mergeInto(path12.join(src, entry), path12.join(dst, entry), tag, steps, moved);
|
|
1579
1617
|
}
|
|
1580
1618
|
continue;
|
|
1581
1619
|
}
|
|
@@ -1594,7 +1632,7 @@ function moveConversations(session, fromDir, toDir, tag = "old", opts = {}) {
|
|
|
1594
1632
|
}
|
|
1595
1633
|
for (const src of emptied) {
|
|
1596
1634
|
try {
|
|
1597
|
-
|
|
1635
|
+
fs11.rmdirSync(src);
|
|
1598
1636
|
} catch {
|
|
1599
1637
|
}
|
|
1600
1638
|
}
|
|
@@ -1663,13 +1701,15 @@ var claudeAgent = {
|
|
|
1663
1701
|
prLinks: claudePrLinks,
|
|
1664
1702
|
// In the session's own account's projects folder: that is where its `--continue` looks.
|
|
1665
1703
|
restoreDir: (s) => {
|
|
1666
|
-
const cwd = s.isGroup && s.paths[0] ?
|
|
1667
|
-
return cwd ?
|
|
1704
|
+
const cwd = s.isGroup && s.paths[0] ? path13.dirname(s.paths[0]) : s.paths[0];
|
|
1705
|
+
return cwd ? path13.join(projectsRootOf(accountDir(sessionAccount(s)) ?? void 0), encodeProjectDir(cwd)) : null;
|
|
1668
1706
|
}
|
|
1669
1707
|
},
|
|
1670
1708
|
events: claudeEvents,
|
|
1671
1709
|
// Its transcripts, and the per-process state files (a Claude opened or closed in a terminal tab shows at once), of every account.
|
|
1672
1710
|
activityRoots: () => [.../* @__PURE__ */ new Set([...claudeProjectsRoots(), ...claudeSessionsDirs()])],
|
|
1711
|
+
// Its scratch folders for the session (an artifact's HTML before it is published): the pane beside the terminal shows files there.
|
|
1712
|
+
tempFolders: (s) => sessionTempFolders(s),
|
|
1673
1713
|
live: { running: (table) => readLiveClaudes(void 0, void 0, table) },
|
|
1674
1714
|
input: {
|
|
1675
1715
|
submit: typeThenEnter,
|
|
@@ -1732,7 +1772,7 @@ function plainAgent(id) {
|
|
|
1732
1772
|
launch: {
|
|
1733
1773
|
tool: (config) => getAiTool(config && getAiTool(config).cmd === id ? config : { aiCommand: id }),
|
|
1734
1774
|
canResume: () => false,
|
|
1735
|
-
resumeLaunch: (s) => ({ launchPath: s.isGroup ?
|
|
1775
|
+
resumeLaunch: (s) => ({ launchPath: s.isGroup ? path14.dirname(s.paths[0] ?? "") : s.paths[0] ?? "", hasConversation: false }),
|
|
1736
1776
|
cleanEnv: (env) => ({ ...env })
|
|
1737
1777
|
},
|
|
1738
1778
|
// Text, a pause, Enter — and no dialog to answer by keystroke (its screen is unknown).
|
|
@@ -1829,4 +1869,4 @@ export {
|
|
|
1829
1869
|
agentToRecord,
|
|
1830
1870
|
agentFor
|
|
1831
1871
|
};
|
|
1832
|
-
//# sourceMappingURL=chunk-
|
|
1872
|
+
//# sourceMappingURL=chunk-QWD76K3E.js.map
|