@moberg_hr/work-tree 2.3.2 → 2.4.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/README.md +6 -1
- package/dist/add-repo-5SYBDVG2.js +384 -0
- package/dist/add-repo-5SYBDVG2.js.map +1 -0
- package/dist/{answer-UWI22VOE.js → answer-OA2WTJCZ.js} +11 -11
- package/dist/{attach-HYHEXW5J.js → attach-5GXPA7BV.js} +14 -14
- package/dist/bin.js +5 -5
- package/dist/{block-A25XE7HC.js → block-VINEC2MW.js} +11 -11
- package/dist/{broadcast-AG7P5BKQ.js → broadcast-ENAJDNVU.js} +8 -8
- package/dist/{catchup-VTGG7BAR.js → catchup-NC4WHSBF.js} +14 -14
- package/dist/{chunk-XDBMLTFY.js → chunk-3HBHM2VX.js} +4 -4
- package/dist/chunk-3IOIY4W6.js +39 -0
- package/dist/chunk-3IOIY4W6.js.map +1 -0
- package/dist/{chunk-7OBX4MJY.js → chunk-3KOYICWB.js} +4 -4
- package/dist/{chunk-HWIRY3WO.js → chunk-3NISM3OI.js} +7 -6
- package/dist/chunk-3NISM3OI.js.map +1 -0
- package/dist/{chunk-ZSXMIPU4.js → chunk-3Q6S6TRY.js} +3 -3
- package/dist/{chunk-MEK7BIVS.js → chunk-45X4QO4V.js} +37 -17
- package/dist/chunk-45X4QO4V.js.map +1 -0
- package/dist/{chunk-3D63HGOG.js → chunk-4ETSGWB2.js} +3 -3
- package/dist/{chunk-IVPV6VPW.js → chunk-4VNUU6S6.js} +3 -3
- package/dist/{chunk-7W6I4VXA.js → chunk-65YMLGQB.js} +7 -7
- package/dist/{chunk-C3E7XETB.js → chunk-6KM2C2UO.js} +7 -7
- package/dist/{chunk-R5QLAXNJ.js → chunk-6SJOM62D.js} +2 -2
- package/dist/{chunk-ROLNJOSE.js → chunk-A53IRCOO.js} +2 -1
- package/dist/chunk-A53IRCOO.js.map +1 -0
- package/dist/{chunk-QQNPAZNP.js → chunk-AC6N2EIN.js} +12 -11
- package/dist/{chunk-QQNPAZNP.js.map → chunk-AC6N2EIN.js.map} +1 -1
- package/dist/{chunk-YIODX4PM.js → chunk-AKGDIBSE.js} +2 -2
- package/dist/{chunk-HWP4NEYL.js → chunk-BCPH3SZM.js} +2 -2
- package/dist/{chunk-4P533364.js → chunk-BO3BNBBE.js} +7 -7
- package/dist/chunk-BUCSF4QS.js +9 -0
- package/dist/{chunk-KNYEQLIF.js → chunk-BURVDS7U.js} +2 -2
- package/dist/{chunk-MF6LDFDW.js → chunk-C224P3D3.js} +2 -2
- package/dist/{chunk-B3HIALTV.js → chunk-CGJGWALF.js} +2 -2
- package/dist/{chunk-CALBDLDJ.js → chunk-DHBKD2TG.js} +3 -3
- package/dist/{chunk-PIEYQBWL.js → chunk-EASMYJG3.js} +13 -12
- package/dist/chunk-EASMYJG3.js.map +1 -0
- package/dist/{chunk-EOETYHTD.js → chunk-FRCV6NWT.js} +2 -2
- package/dist/{chunk-GOHSGTR5.js → chunk-FXHTSSV2.js} +3 -3
- package/dist/{chunk-NER44YB7.js → chunk-FXIEYT6L.js} +8 -8
- package/dist/{chunk-WRUQPVTS.js → chunk-GDCTRDUY.js} +4 -4
- package/dist/{chunk-DRYY4BPY.js → chunk-I2TUJLI4.js} +5 -5
- package/dist/{chunk-IJ6YYFXY.js → chunk-IOSB2HMV.js} +3 -3
- package/dist/{chunk-5EGGS6Y6.js → chunk-JCCGLFMU.js} +94 -56
- package/dist/chunk-JCCGLFMU.js.map +1 -0
- package/dist/{chunk-Y2HNFNCS.js → chunk-JCMGIW7G.js} +5 -3
- package/dist/chunk-JCMGIW7G.js.map +1 -0
- package/dist/{chunk-YV2MPIFG.js → chunk-JDW4GXEA.js} +4 -4
- package/dist/{chunk-LMLVJEY7.js → chunk-L3JK6V5I.js} +2 -2
- package/dist/{chunk-T6YP6GPK.js → chunk-L7OQ7O4K.js} +3 -3
- package/dist/{chunk-WMOXIFBF.js → chunk-LYKWTHOD.js} +38 -10
- package/dist/chunk-LYKWTHOD.js.map +1 -0
- package/dist/{chunk-KPGO5VFR.js → chunk-M2TQNGMD.js} +5 -5
- package/dist/{chunk-Y33WKESH.js → chunk-MAFJE26N.js} +2 -2
- package/dist/{chunk-CIAXJC5H.js → chunk-MM32YZT6.js} +4 -4
- package/dist/{chunk-OB63GDEC.js → chunk-OESAI3XS.js} +2 -2
- package/dist/{chunk-722K7XWW.js → chunk-PLOO7NQU.js} +4 -4
- package/dist/{chunk-DMUZIBPM.js → chunk-R2SR3PER.js} +10 -4
- package/dist/chunk-R2SR3PER.js.map +1 -0
- package/dist/{chunk-B2Q5BYOD.js → chunk-R7334LAS.js} +5 -5
- package/dist/{chunk-NM4SABMQ.js → chunk-RFQRVXFQ.js} +529 -424
- package/dist/chunk-RFQRVXFQ.js.map +1 -0
- package/dist/{chunk-U3NYRIFH.js → chunk-S4ILKUFN.js} +13 -3
- package/dist/{chunk-U3NYRIFH.js.map → chunk-S4ILKUFN.js.map} +1 -1
- package/dist/{chunk-H7KH5CDM.js → chunk-SBRHGEFP.js} +3 -3
- package/dist/{chunk-CGMFZOS5.js → chunk-VES42DOD.js} +236 -81
- package/dist/chunk-VES42DOD.js.map +1 -0
- package/dist/chunk-VGQV4LX7.js +33 -0
- package/dist/chunk-VGQV4LX7.js.map +1 -0
- package/dist/{chunk-OBFHGN7Q.js → chunk-WOAFMVKW.js} +2 -2
- package/dist/{chunk-TKL4B2OI.js → chunk-WUJJ2FTK.js} +8 -4
- package/dist/chunk-WUJJ2FTK.js.map +1 -0
- package/dist/{chunk-CFO2JMKW.js → chunk-XEIREYW6.js} +29 -25
- package/dist/chunk-XEIREYW6.js.map +1 -0
- package/dist/{chunk-QDKLIYGR.js → chunk-XZ5DA5X4.js} +14 -3
- package/dist/{chunk-QDKLIYGR.js.map → chunk-XZ5DA5X4.js.map} +1 -1
- package/dist/{chunk-TBOE7DG5.js → chunk-YDYHURVA.js} +2 -2
- package/dist/{chunk-75I3DHVU.js → chunk-ZFSV65M5.js} +3 -3
- package/dist/{chunk-RFE4EBUP.js → chunk-ZHKE637Q.js} +3 -3
- package/dist/{chunk-XFRSOUBJ.js → chunk-ZKOI6PH4.js} +67 -56
- package/dist/chunk-ZKOI6PH4.js.map +1 -0
- package/dist/{cleanup-Q6AQXSRS.js → cleanup-7VJ4KUMR.js} +28 -27
- package/dist/{cleanup-Q6AQXSRS.js.map → cleanup-7VJ4KUMR.js.map} +1 -1
- package/dist/cli-HTBQ4DSS.js +18 -0
- package/dist/{command-hook-installer-2ZFJJGKY.js → command-hook-installer-PTTVCWH7.js} +4 -4
- package/dist/{config-DOPH6NOU.js → config-CREG6OI3.js} +9 -9
- package/dist/{diff-DZJLSTRO.js → diff-UYXZID2B.js} +12 -12
- package/dist/{digest-QTNPN2E6.js → digest-I5Z6W2EP.js} +10 -10
- package/dist/{fork-HDJ54HH2.js → fork-5AOB45N2.js} +26 -25
- package/dist/{fork-HDJ54HH2.js.map → fork-5AOB45N2.js.map} +1 -1
- package/dist/history-3LFLB4FO.js +55 -0
- package/dist/{hook-V7JNOY2E.js → hook-SJOCXGLD.js} +14 -14
- package/dist/{hydrate-NGZ26R2Y.js → hydrate-YEJCVZZ7.js} +29 -12
- package/dist/hydrate-YEJCVZZ7.js.map +1 -0
- package/dist/{init-BQIBLPP5.js → init-6F67TVM7.js} +9 -9
- package/dist/{install-skills-LCXJIHK4.js → install-skills-ESCNSPBY.js} +4 -4
- package/dist/install-skills-bin.js +3 -3
- package/dist/{list-4KATUVO3.js → list-NHZUEVTA.js} +32 -12
- package/dist/list-NHZUEVTA.js.map +1 -0
- package/dist/{move-LYO5J2ZH.js → move-JICK4XA5.js} +25 -23
- package/dist/{move-LYO5J2ZH.js.map → move-JICK4XA5.js.map} +1 -1
- package/dist/{note-7XR4YA6R.js → note-KZMWEGZP.js} +11 -11
- package/dist/{overlaps-5WKQT3LX.js → overlaps-O353DOQI.js} +9 -9
- package/dist/{pin-GJM3KSG7.js → pin-7CON36HF.js} +11 -11
- package/dist/{pr-YO7XSYUA.js → pr-4KUGJDZ2.js} +14 -14
- package/dist/{prune-BUGPJLLO.js → prune-KQ77276H.js} +27 -26
- package/dist/{prune-BUGPJLLO.js.map → prune-KQ77276H.js.map} +1 -1
- package/dist/{pty-host-O5H4FKWF.js → pty-host-MSCJGN5G.js} +10 -10
- package/dist/{read-XMU63E3F.js → read-J42H6OVE.js} +10 -10
- package/dist/{recent-73SHXIFU.js → recent-BZQP3RKA.js} +10 -10
- package/dist/recent-BZQP3RKA.js.map +1 -0
- package/dist/{remove-ZXDVVOHF.js → remove-GRRKSGS7.js} +28 -27
- package/dist/{remove-ZXDVVOHF.js.map → remove-GRRKSGS7.js.map} +1 -1
- package/dist/report-BSETCIYQ.js +18 -0
- package/dist/{restart-S4D7LD3A.js → restart-REFEZGH2.js} +11 -11
- package/dist/{resume-YIIQIJCS.js → resume-RGP2BCKL.js} +10 -10
- package/dist/resume-RGP2BCKL.js.map +1 -0
- package/dist/{run-WN2O7EX7.js → run-WYDFP6EL.js} +7 -7
- package/dist/{screen-LX6XHNYN.js → screen-YWJLDINC.js} +11 -11
- package/dist/{search-DCDJVBKW.js → search-M4DU4GUB.js} +7 -7
- package/dist/{section-XD46IHMW.js → section-AYN6EHPO.js} +11 -11
- package/dist/{send-P4NILVGL.js → send-O3SI53O7.js} +16 -16
- package/dist/{sessions-POSS5NRV.js → sessions-4BASM7AC.js} +20 -20
- package/dist/{snooze-ONAR2WNP.js → snooze-F3NT7PZO.js} +10 -10
- package/dist/{start-6YKHYYX5.js → start-7OQNLGDU.js} +11 -11
- package/dist/{state-NV4FQNMT.js → state-NRK5CBXZ.js} +5 -5
- package/dist/{status-KYRZRITO.js → status-HLOEWXJ3.js} +8 -8
- package/dist/{stop-QU372WAY.js → stop-YRGANOU7.js} +11 -11
- package/dist/{sync-JR24WVJ7.js → sync-YDK5R7XQ.js} +27 -26
- package/dist/{sync-JR24WVJ7.js.map → sync-YDK5R7XQ.js.map} +1 -1
- package/dist/{time-FYXXC5XC.js → time-T5RBWMDN.js} +12 -12
- package/dist/time-actions-FLLFYEVY.js +15 -0
- package/dist/time-actions-FLLFYEVY.js.map +1 -0
- package/dist/{timesheet-57EG6ABE.js → timesheet-UB6OASXF.js} +14 -14
- package/dist/{todo-UDYY4QTY.js → todo-OE62TNES.js} +6 -6
- package/dist/{tree-RDPJOIDT.js → tree-DRDDTXQ2.js} +42 -24
- package/dist/tree-DRDDTXQ2.js.map +1 -0
- package/dist/{update-OZXFQMYI.js → update-S57YQGPG.js} +13 -13
- package/dist/{wait-3MQST3FP.js → wait-2CRY7XQ5.js} +11 -11
- package/dist/wd-bin.js +9 -9
- package/dist/web/assets/{PtyView-DBG0B_A4.js → PtyView-DAqdRe88.js} +2 -2
- package/dist/web/assets/{PtyView-DBG0B_A4.js.map → PtyView-DAqdRe88.js.map} +1 -1
- package/dist/web/assets/index-CDYWfNo_.css +1 -0
- package/dist/web/assets/index-DGXvjEJe.js +119 -0
- package/dist/web/assets/index-DGXvjEJe.js.map +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-DSJT4HSI.js → web-OG6ZPJON.js} +471 -298
- package/dist/web-OG6ZPJON.js.map +1 -0
- package/npm-shrinkwrap.json +6 -6
- package/package.json +2 -2
- package/dist/chunk-5EGGS6Y6.js.map +0 -1
- package/dist/chunk-CFO2JMKW.js.map +0 -1
- package/dist/chunk-CGMFZOS5.js.map +0 -1
- package/dist/chunk-DMUZIBPM.js.map +0 -1
- package/dist/chunk-HWIRY3WO.js.map +0 -1
- package/dist/chunk-KPGR4JRE.js +0 -9
- package/dist/chunk-MEK7BIVS.js.map +0 -1
- package/dist/chunk-NM4SABMQ.js.map +0 -1
- package/dist/chunk-PIEYQBWL.js.map +0 -1
- package/dist/chunk-ROLNJOSE.js.map +0 -1
- package/dist/chunk-TKL4B2OI.js.map +0 -1
- package/dist/chunk-WMOXIFBF.js.map +0 -1
- package/dist/chunk-XFRSOUBJ.js.map +0 -1
- package/dist/chunk-Y2HNFNCS.js.map +0 -1
- package/dist/cli-X4Z2UYJZ.js +0 -18
- package/dist/hydrate-NGZ26R2Y.js.map +0 -1
- package/dist/list-4KATUVO3.js.map +0 -1
- package/dist/recent-73SHXIFU.js.map +0 -1
- package/dist/report-TEIRRYH4.js +0 -16
- package/dist/resume-YIIQIJCS.js.map +0 -1
- package/dist/time-actions-L3OWQHEX.js +0 -15
- package/dist/tree-RDPJOIDT.js.map +0 -1
- package/dist/web/assets/index-DoT3bzyK.css +0 -1
- package/dist/web/assets/index-rLMVfFdt.js +0 -119
- package/dist/web/assets/index-rLMVfFdt.js.map +0 -1
- package/dist/web-DSJT4HSI.js.map +0 -1
- /package/dist/{answer-UWI22VOE.js.map → answer-OA2WTJCZ.js.map} +0 -0
- /package/dist/{attach-HYHEXW5J.js.map → attach-5GXPA7BV.js.map} +0 -0
- /package/dist/{block-A25XE7HC.js.map → block-VINEC2MW.js.map} +0 -0
- /package/dist/{broadcast-AG7P5BKQ.js.map → broadcast-ENAJDNVU.js.map} +0 -0
- /package/dist/{catchup-VTGG7BAR.js.map → catchup-NC4WHSBF.js.map} +0 -0
- /package/dist/{chunk-XDBMLTFY.js.map → chunk-3HBHM2VX.js.map} +0 -0
- /package/dist/{chunk-7OBX4MJY.js.map → chunk-3KOYICWB.js.map} +0 -0
- /package/dist/{chunk-ZSXMIPU4.js.map → chunk-3Q6S6TRY.js.map} +0 -0
- /package/dist/{chunk-3D63HGOG.js.map → chunk-4ETSGWB2.js.map} +0 -0
- /package/dist/{chunk-IVPV6VPW.js.map → chunk-4VNUU6S6.js.map} +0 -0
- /package/dist/{chunk-7W6I4VXA.js.map → chunk-65YMLGQB.js.map} +0 -0
- /package/dist/{chunk-C3E7XETB.js.map → chunk-6KM2C2UO.js.map} +0 -0
- /package/dist/{chunk-R5QLAXNJ.js.map → chunk-6SJOM62D.js.map} +0 -0
- /package/dist/{chunk-YIODX4PM.js.map → chunk-AKGDIBSE.js.map} +0 -0
- /package/dist/{chunk-HWP4NEYL.js.map → chunk-BCPH3SZM.js.map} +0 -0
- /package/dist/{chunk-4P533364.js.map → chunk-BO3BNBBE.js.map} +0 -0
- /package/dist/{chunk-KPGR4JRE.js.map → chunk-BUCSF4QS.js.map} +0 -0
- /package/dist/{chunk-KNYEQLIF.js.map → chunk-BURVDS7U.js.map} +0 -0
- /package/dist/{chunk-MF6LDFDW.js.map → chunk-C224P3D3.js.map} +0 -0
- /package/dist/{chunk-B3HIALTV.js.map → chunk-CGJGWALF.js.map} +0 -0
- /package/dist/{chunk-CALBDLDJ.js.map → chunk-DHBKD2TG.js.map} +0 -0
- /package/dist/{chunk-EOETYHTD.js.map → chunk-FRCV6NWT.js.map} +0 -0
- /package/dist/{chunk-GOHSGTR5.js.map → chunk-FXHTSSV2.js.map} +0 -0
- /package/dist/{chunk-NER44YB7.js.map → chunk-FXIEYT6L.js.map} +0 -0
- /package/dist/{chunk-WRUQPVTS.js.map → chunk-GDCTRDUY.js.map} +0 -0
- /package/dist/{chunk-DRYY4BPY.js.map → chunk-I2TUJLI4.js.map} +0 -0
- /package/dist/{chunk-IJ6YYFXY.js.map → chunk-IOSB2HMV.js.map} +0 -0
- /package/dist/{chunk-YV2MPIFG.js.map → chunk-JDW4GXEA.js.map} +0 -0
- /package/dist/{chunk-LMLVJEY7.js.map → chunk-L3JK6V5I.js.map} +0 -0
- /package/dist/{chunk-T6YP6GPK.js.map → chunk-L7OQ7O4K.js.map} +0 -0
- /package/dist/{chunk-KPGO5VFR.js.map → chunk-M2TQNGMD.js.map} +0 -0
- /package/dist/{chunk-Y33WKESH.js.map → chunk-MAFJE26N.js.map} +0 -0
- /package/dist/{chunk-CIAXJC5H.js.map → chunk-MM32YZT6.js.map} +0 -0
- /package/dist/{chunk-OB63GDEC.js.map → chunk-OESAI3XS.js.map} +0 -0
- /package/dist/{chunk-722K7XWW.js.map → chunk-PLOO7NQU.js.map} +0 -0
- /package/dist/{chunk-B2Q5BYOD.js.map → chunk-R7334LAS.js.map} +0 -0
- /package/dist/{chunk-H7KH5CDM.js.map → chunk-SBRHGEFP.js.map} +0 -0
- /package/dist/{chunk-OBFHGN7Q.js.map → chunk-WOAFMVKW.js.map} +0 -0
- /package/dist/{chunk-TBOE7DG5.js.map → chunk-YDYHURVA.js.map} +0 -0
- /package/dist/{chunk-75I3DHVU.js.map → chunk-ZFSV65M5.js.map} +0 -0
- /package/dist/{chunk-RFE4EBUP.js.map → chunk-ZHKE637Q.js.map} +0 -0
- /package/dist/{cli-X4Z2UYJZ.js.map → cli-HTBQ4DSS.js.map} +0 -0
- /package/dist/{command-hook-installer-2ZFJJGKY.js.map → command-hook-installer-PTTVCWH7.js.map} +0 -0
- /package/dist/{config-DOPH6NOU.js.map → config-CREG6OI3.js.map} +0 -0
- /package/dist/{diff-DZJLSTRO.js.map → diff-UYXZID2B.js.map} +0 -0
- /package/dist/{digest-QTNPN2E6.js.map → digest-I5Z6W2EP.js.map} +0 -0
- /package/dist/{install-skills-LCXJIHK4.js.map → history-3LFLB4FO.js.map} +0 -0
- /package/dist/{hook-V7JNOY2E.js.map → hook-SJOCXGLD.js.map} +0 -0
- /package/dist/{init-BQIBLPP5.js.map → init-6F67TVM7.js.map} +0 -0
- /package/dist/{report-TEIRRYH4.js.map → install-skills-ESCNSPBY.js.map} +0 -0
- /package/dist/{note-7XR4YA6R.js.map → note-KZMWEGZP.js.map} +0 -0
- /package/dist/{overlaps-5WKQT3LX.js.map → overlaps-O353DOQI.js.map} +0 -0
- /package/dist/{pin-GJM3KSG7.js.map → pin-7CON36HF.js.map} +0 -0
- /package/dist/{pr-YO7XSYUA.js.map → pr-4KUGJDZ2.js.map} +0 -0
- /package/dist/{pty-host-O5H4FKWF.js.map → pty-host-MSCJGN5G.js.map} +0 -0
- /package/dist/{read-XMU63E3F.js.map → read-J42H6OVE.js.map} +0 -0
- /package/dist/{time-actions-L3OWQHEX.js.map → report-BSETCIYQ.js.map} +0 -0
- /package/dist/{restart-S4D7LD3A.js.map → restart-REFEZGH2.js.map} +0 -0
- /package/dist/{run-WN2O7EX7.js.map → run-WYDFP6EL.js.map} +0 -0
- /package/dist/{screen-LX6XHNYN.js.map → screen-YWJLDINC.js.map} +0 -0
- /package/dist/{search-DCDJVBKW.js.map → search-M4DU4GUB.js.map} +0 -0
- /package/dist/{section-XD46IHMW.js.map → section-AYN6EHPO.js.map} +0 -0
- /package/dist/{send-P4NILVGL.js.map → send-O3SI53O7.js.map} +0 -0
- /package/dist/{sessions-POSS5NRV.js.map → sessions-4BASM7AC.js.map} +0 -0
- /package/dist/{snooze-ONAR2WNP.js.map → snooze-F3NT7PZO.js.map} +0 -0
- /package/dist/{start-6YKHYYX5.js.map → start-7OQNLGDU.js.map} +0 -0
- /package/dist/{state-NV4FQNMT.js.map → state-NRK5CBXZ.js.map} +0 -0
- /package/dist/{status-KYRZRITO.js.map → status-HLOEWXJ3.js.map} +0 -0
- /package/dist/{stop-QU372WAY.js.map → stop-YRGANOU7.js.map} +0 -0
- /package/dist/{time-FYXXC5XC.js.map → time-T5RBWMDN.js.map} +0 -0
- /package/dist/{timesheet-57EG6ABE.js.map → timesheet-UB6OASXF.js.map} +0 -0
- /package/dist/{todo-UDYY4QTY.js.map → todo-OE62TNES.js.map} +0 -0
- /package/dist/{update-OZXFQMYI.js.map → update-S57YQGPG.js.map} +0 -0
- /package/dist/{wait-3MQST3FP.js.map → wait-2CRY7XQ5.js.map} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
sessionFolderPath
|
|
4
|
+
} from "./chunk-VGQV4LX7.js";
|
|
2
5
|
import {
|
|
3
6
|
isLeftover,
|
|
4
7
|
putLeftoverBack,
|
|
5
8
|
setLeftoverAside,
|
|
6
9
|
takeLeftover
|
|
7
10
|
} from "./chunk-KUCMJHQW.js";
|
|
8
|
-
import {
|
|
9
|
-
resolveProjectTarget
|
|
10
|
-
} from "./chunk-DMUZIBPM.js";
|
|
11
11
|
import {
|
|
12
12
|
makeFolder,
|
|
13
13
|
worktreeFolderMessage
|
|
@@ -15,6 +15,9 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
isBuildOutputPath
|
|
17
17
|
} from "./chunk-5WM24P5N.js";
|
|
18
|
+
import {
|
|
19
|
+
resolveProjectTarget
|
|
20
|
+
} from "./chunk-R2SR3PER.js";
|
|
18
21
|
import {
|
|
19
22
|
fetchRemoteAsync,
|
|
20
23
|
getCurrentBranch,
|
|
@@ -26,38 +29,42 @@ import {
|
|
|
26
29
|
parseWorktreeList,
|
|
27
30
|
remoteBranchExists,
|
|
28
31
|
repoState
|
|
29
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-AKGDIBSE.js";
|
|
30
33
|
import {
|
|
31
34
|
archiveDirFor,
|
|
32
35
|
archiveRoot,
|
|
33
36
|
bestEffort,
|
|
34
37
|
findSession,
|
|
35
38
|
forgetOtherBaseCheckoutEntries,
|
|
39
|
+
isFolderSession,
|
|
36
40
|
loadHistory,
|
|
37
41
|
readArchive,
|
|
42
|
+
recordedRepos,
|
|
38
43
|
restoreArchivedTranscripts,
|
|
39
44
|
restoreUncommitted,
|
|
40
45
|
runGitAsync,
|
|
46
|
+
sessionRepos,
|
|
41
47
|
setSessionTitle,
|
|
42
48
|
upsertSession,
|
|
43
49
|
upsertSessionWithPort,
|
|
44
50
|
writeArchiveRecord
|
|
45
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-RFQRVXFQ.js";
|
|
46
52
|
import {
|
|
47
53
|
agentFor
|
|
48
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-JCMGIW7G.js";
|
|
49
55
|
import {
|
|
50
56
|
sessionIdFor
|
|
51
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-FXHTSSV2.js";
|
|
52
58
|
import {
|
|
53
59
|
report
|
|
54
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-S4ILKUFN.js";
|
|
55
61
|
import {
|
|
56
62
|
debug
|
|
57
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-FRCV6NWT.js";
|
|
58
64
|
import {
|
|
65
|
+
atomicWriteFile,
|
|
59
66
|
getConfigDir
|
|
60
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-A53IRCOO.js";
|
|
61
68
|
|
|
62
69
|
// src/core/git/base-spec.ts
|
|
63
70
|
var BaseSpecError = class extends Error {
|
|
@@ -110,7 +117,7 @@ function toBaseSpec(base) {
|
|
|
110
117
|
}
|
|
111
118
|
|
|
112
119
|
// src/core/worktree/worktree.ts
|
|
113
|
-
import
|
|
120
|
+
import fs4 from "fs";
|
|
114
121
|
|
|
115
122
|
// src/core/archive/archive-restore.ts
|
|
116
123
|
import path2 from "path";
|
|
@@ -280,11 +287,53 @@ function worktreeFor(s, alias, config) {
|
|
|
280
287
|
}
|
|
281
288
|
|
|
282
289
|
// src/core/worktree/worktree.ts
|
|
283
|
-
import
|
|
290
|
+
import path5 from "path";
|
|
284
291
|
|
|
285
|
-
// src/core/worktree/
|
|
292
|
+
// src/core/worktree/session-instructions.ts
|
|
286
293
|
import fs2 from "fs";
|
|
287
294
|
import path3 from "path";
|
|
295
|
+
var BLOCK_START = "<!-- work:repos -->";
|
|
296
|
+
var BLOCK_END = "<!-- /work:repos -->";
|
|
297
|
+
var HEADING = "This session's repos, each a folder here:";
|
|
298
|
+
function block(imports) {
|
|
299
|
+
return [BLOCK_START, HEADING, "", ...imports, BLOCK_END].join("\n");
|
|
300
|
+
}
|
|
301
|
+
function renderInstructions(existing, imports) {
|
|
302
|
+
const next = block(imports);
|
|
303
|
+
const start = existing.indexOf(BLOCK_START);
|
|
304
|
+
const end = start >= 0 ? existing.indexOf(BLOCK_END, start) : -1;
|
|
305
|
+
if (start >= 0 && end >= 0) return existing.slice(0, start) + next + existing.slice(end + BLOCK_END.length);
|
|
306
|
+
if (!existing.trim()) return `${next}
|
|
307
|
+
`;
|
|
308
|
+
return `${existing.replace(/\s*$/, "")}
|
|
309
|
+
|
|
310
|
+
${next}
|
|
311
|
+
`;
|
|
312
|
+
}
|
|
313
|
+
function readOrEmpty(file) {
|
|
314
|
+
try {
|
|
315
|
+
return fs2.readFileSync(file, "utf8");
|
|
316
|
+
} catch (err) {
|
|
317
|
+
if (err.code === "ENOENT") return "";
|
|
318
|
+
throw err;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function hasInstructionsBlock(file) {
|
|
322
|
+
return readOrEmpty(file).includes(BLOCK_START);
|
|
323
|
+
}
|
|
324
|
+
function writeSessionInstructions(folder, repoFolders, fileName, importLine) {
|
|
325
|
+
const imported = repoFolders.filter((repo) => fs2.existsSync(path3.join(folder, repo, fileName)));
|
|
326
|
+
const imports = imported.map((repo) => importLine(`${repo.replace(/\\/g, "/")}/${fileName}`));
|
|
327
|
+
const file = path3.join(folder, fileName);
|
|
328
|
+
const existing = readOrEmpty(file);
|
|
329
|
+
const next = renderInstructions(existing, imports);
|
|
330
|
+
if (next !== existing) atomicWriteFile(file, next);
|
|
331
|
+
return imported;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// src/core/worktree/copy-files.ts
|
|
335
|
+
import fs3 from "fs";
|
|
336
|
+
import path4 from "path";
|
|
288
337
|
import { globSync } from "glob";
|
|
289
338
|
var EXCLUDED_DIRS = ["bin", "obj", "node_modules", ".git"];
|
|
290
339
|
function copyConfigFiles(repoPath, worktreePath, patterns) {
|
|
@@ -292,12 +341,12 @@ function copyConfigFiles(repoPath, worktreePath, patterns) {
|
|
|
292
341
|
const normalized = pattern.replace(/\\/g, "/");
|
|
293
342
|
if (normalized.startsWith(".claude/")) {
|
|
294
343
|
const relativePath = normalized;
|
|
295
|
-
const sourcePath =
|
|
296
|
-
if (
|
|
297
|
-
const destPath =
|
|
298
|
-
const destDir =
|
|
299
|
-
|
|
300
|
-
|
|
344
|
+
const sourcePath = path4.join(repoPath, relativePath);
|
|
345
|
+
if (fs3.existsSync(sourcePath)) {
|
|
346
|
+
const destPath = path4.join(worktreePath, relativePath);
|
|
347
|
+
const destDir = path4.dirname(destPath);
|
|
348
|
+
fs3.mkdirSync(destDir, { recursive: true });
|
|
349
|
+
fs3.copyFileSync(sourcePath, destPath);
|
|
301
350
|
report("info", ` Copied: ${relativePath}`);
|
|
302
351
|
}
|
|
303
352
|
continue;
|
|
@@ -313,11 +362,11 @@ function copyConfigFiles(repoPath, worktreePath, patterns) {
|
|
|
313
362
|
if (parts.some((p) => EXCLUDED_DIRS.includes(p))) {
|
|
314
363
|
continue;
|
|
315
364
|
}
|
|
316
|
-
const sourcePath =
|
|
317
|
-
const destPath =
|
|
318
|
-
const destDir =
|
|
319
|
-
|
|
320
|
-
|
|
365
|
+
const sourcePath = path4.join(repoPath, match);
|
|
366
|
+
const destPath = path4.join(worktreePath, match);
|
|
367
|
+
const destDir = path4.dirname(destPath);
|
|
368
|
+
fs3.mkdirSync(destDir, { recursive: true });
|
|
369
|
+
fs3.copyFileSync(sourcePath, destPath);
|
|
321
370
|
report("info", ` Copied: ${match}`);
|
|
322
371
|
}
|
|
323
372
|
}
|
|
@@ -371,9 +420,9 @@ function fastForwardBranch(repoPath, branchName) {
|
|
|
371
420
|
}
|
|
372
421
|
function samePath(a, b) {
|
|
373
422
|
const norm = (p) => {
|
|
374
|
-
let r =
|
|
423
|
+
let r = path5.resolve(p);
|
|
375
424
|
try {
|
|
376
|
-
r =
|
|
425
|
+
r = fs4.realpathSync.native(r);
|
|
377
426
|
} catch {
|
|
378
427
|
}
|
|
379
428
|
return process.platform === "win32" ? r.toLowerCase() : r;
|
|
@@ -394,9 +443,9 @@ function createSingleWorktree(repoPath, worktreePath, branchName, config, baseBr
|
|
|
394
443
|
}
|
|
395
444
|
}
|
|
396
445
|
const made = makeSingleWorktree(repoPath, worktreePath, branchName, config, baseBranch, pull, fetched, created);
|
|
397
|
-
if (!made && aside && !
|
|
446
|
+
if (!made && aside && !fs4.existsSync(worktreePath)) {
|
|
398
447
|
try {
|
|
399
|
-
|
|
448
|
+
fs4.renameSync(aside, worktreePath);
|
|
400
449
|
takeLeftover(worktreePath);
|
|
401
450
|
} catch {
|
|
402
451
|
report("warn", ` what was left of it is still at ${aside}`);
|
|
@@ -405,11 +454,11 @@ function createSingleWorktree(repoPath, worktreePath, branchName, config, baseBr
|
|
|
405
454
|
return made;
|
|
406
455
|
}
|
|
407
456
|
function makeSingleWorktree(repoPath, worktreePath, branchName, config, baseBranch, pull, fetched, created) {
|
|
408
|
-
if (
|
|
457
|
+
if (fs4.existsSync(worktreePath)) {
|
|
409
458
|
if (isGitRepo(worktreePath)) {
|
|
410
459
|
const currentBranch = getCurrentBranch(worktreePath);
|
|
411
460
|
if (currentBranch === branchName) {
|
|
412
|
-
report("
|
|
461
|
+
report("info", ` Worktree already exists at: ${worktreePath}`);
|
|
413
462
|
if (pull) pullLatestForBranch(worktreePath, branchName);
|
|
414
463
|
return true;
|
|
415
464
|
}
|
|
@@ -431,7 +480,7 @@ function makeSingleWorktree(repoPath, worktreePath, branchName, config, baseBran
|
|
|
431
480
|
report("error", " Remove that worktree first, or use the existing one.");
|
|
432
481
|
return false;
|
|
433
482
|
}
|
|
434
|
-
const parentDir =
|
|
483
|
+
const parentDir = path5.dirname(worktreePath);
|
|
435
484
|
const cantMake = makeFolder(parentDir);
|
|
436
485
|
if (cantMake) {
|
|
437
486
|
report("error", worktreeFolderMessage(parentDir, config.worktreesRoot, cantMake));
|
|
@@ -451,7 +500,7 @@ function makeSingleWorktree(repoPath, worktreePath, branchName, config, baseBran
|
|
|
451
500
|
const baseBranchLabel = baseRepoBranch ?? "(detached HEAD)";
|
|
452
501
|
report("info", ` Pulling latest changes for main repo (on ${baseBranchLabel})...`);
|
|
453
502
|
if (baseRepoBranch && !["master", "main", "dev"].includes(baseRepoBranch)) {
|
|
454
|
-
report("
|
|
503
|
+
report("detail", ` Note: base repo is on '${baseRepoBranch}', not master/main/dev`);
|
|
455
504
|
}
|
|
456
505
|
const baseRepoPull = git(["pull", "--quiet"], repoPath);
|
|
457
506
|
baseRepoPullFailed = baseRepoPull.exitCode !== 0;
|
|
@@ -515,7 +564,7 @@ function makeSingleWorktree(repoPath, worktreePath, branchName, config, baseBran
|
|
|
515
564
|
return true;
|
|
516
565
|
}
|
|
517
566
|
function wouldRefuseRemoval(worktreePath, force) {
|
|
518
|
-
if (force || !
|
|
567
|
+
if (force || !fs4.existsSync(worktreePath)) return false;
|
|
519
568
|
const state = repoState(worktreePath);
|
|
520
569
|
if (state === "not-a-repo") return false;
|
|
521
570
|
if (state === "unknown") return true;
|
|
@@ -527,13 +576,13 @@ function isDeleteFailure(stderr) {
|
|
|
527
576
|
return /failed to delete/i.test(stderr);
|
|
528
577
|
}
|
|
529
578
|
function removeSingleWorktree(repoPath, worktreePath, branchName, force) {
|
|
530
|
-
if (!
|
|
579
|
+
if (!fs4.existsSync(worktreePath)) {
|
|
531
580
|
report("warn", ` Worktree does not exist at: ${worktreePath}`);
|
|
532
581
|
return true;
|
|
533
582
|
}
|
|
534
583
|
const state = repoState(worktreePath);
|
|
535
584
|
if (state === "not-a-repo") {
|
|
536
|
-
|
|
585
|
+
fs4.rmSync(worktreePath, { recursive: true, force: true });
|
|
537
586
|
git(["worktree", "prune"], repoPath);
|
|
538
587
|
report("info", ` Removed invalid worktree directory: ${worktreePath}`);
|
|
539
588
|
return true;
|
|
@@ -570,7 +619,7 @@ function removeSingleWorktree(repoPath, worktreePath, branchName, force) {
|
|
|
570
619
|
return true;
|
|
571
620
|
} else if (isDeleteFailure(result.stderr)) {
|
|
572
621
|
try {
|
|
573
|
-
|
|
622
|
+
fs4.rmSync(worktreePath, { recursive: true, force: true, maxRetries: 3, retryDelay: 200 });
|
|
574
623
|
} catch (err) {
|
|
575
624
|
report("error", ` Failed to remove worktree: ${worktreePath}`);
|
|
576
625
|
report("error", ` ${err.message}`);
|
|
@@ -581,7 +630,7 @@ function removeSingleWorktree(repoPath, worktreePath, branchName, force) {
|
|
|
581
630
|
report("success", ` Removed worktree: ${worktreePath} (finished the delete git could not: ${why})`);
|
|
582
631
|
return true;
|
|
583
632
|
} else if (force && state === "unknown") {
|
|
584
|
-
|
|
633
|
+
fs4.rmSync(worktreePath, { recursive: true, force: true });
|
|
585
634
|
git(["worktree", "prune"], repoPath);
|
|
586
635
|
report("success", ` Removed worktree folder git could not read: ${worktreePath}`);
|
|
587
636
|
return true;
|
|
@@ -602,15 +651,23 @@ async function setupWorktree(targetName, branchName, config, base, jiraKey, opts
|
|
|
602
651
|
return null;
|
|
603
652
|
}
|
|
604
653
|
const workTreeDirName = branchName.replace(/\//g, "-");
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
654
|
+
const sessionTarget = target.isGroup ? target.name : targetName;
|
|
655
|
+
const explicit = explicitRepos(sessionTarget, branchName, opts.repos, config);
|
|
656
|
+
if (explicit && "error" in explicit) {
|
|
657
|
+
report("error", explicit.error);
|
|
658
|
+
return null;
|
|
659
|
+
}
|
|
660
|
+
const asFolder = target.isGroup || !!explicit || folderSessionFor(targetName, branchName, config);
|
|
661
|
+
const repoAliases = asFolder ? groupReposFor(sessionTarget, branchName, explicit?.repos ?? target.repoAliases, config) : target.repoAliases;
|
|
662
|
+
if (asFolder && repoAliases.length === 0) {
|
|
663
|
+
report("error", `none of this session's repos are in your config: add them back (work config add) to open it`);
|
|
664
|
+
return null;
|
|
665
|
+
}
|
|
666
|
+
bestEffort("recreate the archived branch", () => recreateArchivedBranches(sessionTarget, branchName, repoAliases, config));
|
|
667
|
+
const checkoutFor = opts.checkoutFor ?? archivedHeads(sessionTarget, branchName);
|
|
610
668
|
if (checkoutFor) opts = { ...opts, checkoutFor };
|
|
611
|
-
const result =
|
|
669
|
+
const result = asFolder ? await setupGroupWorktree(sessionTarget, repoAliases, branchName, config, spec, jiraKey, opts) : await setupSingleWorktree(targetName, branchName, workTreeDirName, config, spec, jiraKey, opts);
|
|
612
670
|
if (result) {
|
|
613
|
-
const sessionTarget = target.isGroup ? target.name : targetName;
|
|
614
671
|
const session = findSession(loadHistory(), sessionTarget, branchName);
|
|
615
672
|
if (session) bestEffort("restore the archived conversation", () => restoreArchivedTranscripts(session), 0);
|
|
616
673
|
if (session)
|
|
@@ -620,13 +677,39 @@ async function setupWorktree(targetName, branchName, config, base, jiraKey, opts
|
|
|
620
677
|
if (session) bestEffort("put back its local settings", () => restoreArchivedIgnored(session, config));
|
|
621
678
|
const tips = session ? readArchive(sessionIdFor(session))?.tips ?? {} : {};
|
|
622
679
|
for (const p of result.paths) {
|
|
623
|
-
const alias =
|
|
680
|
+
const alias = asFolder ? repoAliases.find((a) => path5.basename(config.repos[a] ?? "").toLowerCase() === path5.basename(p).toLowerCase()) : targetName;
|
|
624
681
|
putBackLeftover(p, alias ? tips[alias] : void 0);
|
|
625
682
|
}
|
|
626
683
|
if (opts.name?.trim()) await setSessionTitle(sessionTarget, branchName, opts.name);
|
|
627
684
|
}
|
|
628
685
|
return result;
|
|
629
686
|
}
|
|
687
|
+
function folderSessionFor(alias, branch, config) {
|
|
688
|
+
const known = findSession(loadHistory(), alias, branch);
|
|
689
|
+
if (known) return isFolderSession(known);
|
|
690
|
+
if (config.sessionFolders !== true) return false;
|
|
691
|
+
const repoPath = config.repos[alias];
|
|
692
|
+
if (!repoPath || !fs4.existsSync(repoPath)) return false;
|
|
693
|
+
return !parseWorktreeList(repoPath).some((wt) => wt.branch === branch && path5.resolve(wt.path) !== path5.resolve(repoPath));
|
|
694
|
+
}
|
|
695
|
+
function explicitRepos(sessionTarget, branch, repos, config) {
|
|
696
|
+
if (!repos?.length || findSession(loadHistory(), sessionTarget, branch)) return void 0;
|
|
697
|
+
const unique = [...new Set(repos)];
|
|
698
|
+
const unknown = unique.filter((a) => !config.repos[a]);
|
|
699
|
+
if (unknown.length) return { error: `not in your config: ${unknown.join(", ")}` };
|
|
700
|
+
const folders = unique.map((a) => path5.basename(config.repos[a]).toLowerCase());
|
|
701
|
+
if (new Set(folders).size !== folders.length) return { error: `two of these repos have the same folder name: ${unique.join(", ")}` };
|
|
702
|
+
return { repos: unique };
|
|
703
|
+
}
|
|
704
|
+
function groupReposFor(sessionTarget, branch, configured, config) {
|
|
705
|
+
const known = findSession(loadHistory(), sessionTarget, branch);
|
|
706
|
+
const own = known ? listedRepos(known, config) : null;
|
|
707
|
+
if (!own) return configured;
|
|
708
|
+
const gone = own.filter((r) => !config.repos[r.alias]).map((r) => r.alias);
|
|
709
|
+
if (gone.length) report("warn", `not in your config any more, so not set up: ${gone.join(", ")}`);
|
|
710
|
+
return own.map((r) => r.alias).filter((a) => !gone.includes(a));
|
|
711
|
+
}
|
|
712
|
+
var sameRepos = (a, b) => a.length === b.length && a.every((x) => b.includes(x));
|
|
630
713
|
function putBackLeftover(worktree, tip) {
|
|
631
714
|
const aside = takeLeftover(worktree);
|
|
632
715
|
if (!aside) return;
|
|
@@ -668,8 +751,14 @@ function archivedHeads(sessionTarget, branch) {
|
|
|
668
751
|
const rec = readArchive(sessionIdFor(session));
|
|
669
752
|
return rec?.worktreeRemoved && rec.heads && Object.keys(rec.heads).length ? rec.heads : void 0;
|
|
670
753
|
}
|
|
671
|
-
async function setupGroupWorktree(groupName, repoAliases, branchName,
|
|
672
|
-
const groupWorktreePath =
|
|
754
|
+
async function setupGroupWorktree(groupName, repoAliases, branchName, config, spec, jiraKey, opts = {}) {
|
|
755
|
+
const groupWorktreePath = sessionFolderPath(
|
|
756
|
+
groupName,
|
|
757
|
+
branchName,
|
|
758
|
+
config,
|
|
759
|
+
findSession(loadHistory(), groupName, branchName),
|
|
760
|
+
fs4.existsSync
|
|
761
|
+
);
|
|
673
762
|
if (!isEmptyBaseSpec(spec)) {
|
|
674
763
|
const unknownAliases = baseSpecOverrideAliases(spec).filter((a) => !repoAliases.includes(a));
|
|
675
764
|
if (unknownAliases.length > 0) {
|
|
@@ -701,7 +790,8 @@ async function setupGroupWorktree(groupName, repoAliases, branchName, workTreeDi
|
|
|
701
790
|
return null;
|
|
702
791
|
}
|
|
703
792
|
}
|
|
704
|
-
|
|
793
|
+
const isConfiguredGroup = Object.prototype.hasOwnProperty.call(config.groups, groupName);
|
|
794
|
+
report("step", `Creating ${isConfiguredGroup ? "group worktree" : "session folder"}: ${groupName}/${branchName}`);
|
|
705
795
|
report("detail", `Directory: ${groupWorktreePath}`);
|
|
706
796
|
report("info", "");
|
|
707
797
|
const cantMake = makeFolder(groupWorktreePath);
|
|
@@ -711,7 +801,7 @@ async function setupGroupWorktree(groupName, repoAliases, branchName, workTreeDi
|
|
|
711
801
|
}
|
|
712
802
|
const createdWorktrees = [];
|
|
713
803
|
const baseBranches = {};
|
|
714
|
-
const toCreate = repoAliases.filter((alias) => !
|
|
804
|
+
const toCreate = repoAliases.filter((alias) => !fs4.existsSync(path5.join(groupWorktreePath, path5.basename(config.repos[alias]))));
|
|
715
805
|
const fetched = /* @__PURE__ */ new Set();
|
|
716
806
|
if (toCreate.length > 1) {
|
|
717
807
|
report("info", `Fetching ${toCreate.length} repos\u2026`);
|
|
@@ -726,8 +816,8 @@ async function setupGroupWorktree(groupName, repoAliases, branchName, workTreeDi
|
|
|
726
816
|
}
|
|
727
817
|
for (const alias of repoAliases) {
|
|
728
818
|
const repoPath = config.repos[alias];
|
|
729
|
-
const repoName =
|
|
730
|
-
const subWorktreePath =
|
|
819
|
+
const repoName = path5.basename(repoPath);
|
|
820
|
+
const subWorktreePath = path5.join(groupWorktreePath, repoName);
|
|
731
821
|
const repoBase = baseForAlias(spec, alias);
|
|
732
822
|
const created = {};
|
|
733
823
|
report("step", `[${alias}] (${repoName}):`);
|
|
@@ -752,8 +842,8 @@ async function setupGroupWorktree(groupName, repoAliases, branchName, workTreeDi
|
|
|
752
842
|
removeSingleWorktree(wt.repoPath, wt.worktreePath, branchName, true);
|
|
753
843
|
}
|
|
754
844
|
try {
|
|
755
|
-
if (
|
|
756
|
-
|
|
845
|
+
if (fs4.readdirSync(groupWorktreePath).length === 0) {
|
|
846
|
+
fs4.rmSync(groupWorktreePath, { recursive: true, force: true });
|
|
757
847
|
}
|
|
758
848
|
} catch {
|
|
759
849
|
}
|
|
@@ -762,23 +852,55 @@ async function setupGroupWorktree(groupName, repoAliases, branchName, workTreeDi
|
|
|
762
852
|
}
|
|
763
853
|
}
|
|
764
854
|
const configDir = getConfigDir();
|
|
765
|
-
const claudeMdSrc =
|
|
766
|
-
const
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
|
|
855
|
+
const claudeMdSrc = path5.join(configDir, `${groupName}.claude.md`);
|
|
856
|
+
const known = findSession(loadHistory(), groupName, branchName);
|
|
857
|
+
const agent = agentFor(config, known);
|
|
858
|
+
const instructionsFile = agent.instructionsFile;
|
|
859
|
+
const claudeMdDest = path5.join(groupWorktreePath, instructionsFile);
|
|
860
|
+
const wantsImports = known ? !!known.instructions || hasInstructionsBlock(claudeMdDest) || !isConfiguredGroup : !isConfiguredGroup || config.sessionFolders === true || !sameRepos(config.groups[groupName], repoAliases);
|
|
861
|
+
const importLine = agent.instructionsImport;
|
|
862
|
+
const byImport = wantsImports && !!importLine;
|
|
863
|
+
if (byImport && importLine) {
|
|
864
|
+
if (known?.instructions === "summary+imports" && !fs4.existsSync(claudeMdDest) && fs4.existsSync(claudeMdSrc))
|
|
865
|
+
fs4.copyFileSync(claudeMdSrc, claudeMdDest);
|
|
866
|
+
const imports = writeSessionInstructions(
|
|
867
|
+
groupWorktreePath,
|
|
868
|
+
createdWorktrees.map((wt) => path5.basename(wt.worktreePath)),
|
|
869
|
+
instructionsFile,
|
|
870
|
+
importLine
|
|
871
|
+
);
|
|
872
|
+
report("info", "");
|
|
873
|
+
report("success", `${instructionsFile} in the session folder imports ${imports.length} repo file(s)`);
|
|
874
|
+
} else if (wantsImports && !isConfiguredGroup) {
|
|
875
|
+
report("info", "");
|
|
876
|
+
report("warn", `${agent.name} can't import files into ${instructionsFile}: each repo's own is in its folder`);
|
|
877
|
+
} else if (fs4.existsSync(claudeMdSrc)) {
|
|
878
|
+
fs4.copyFileSync(claudeMdSrc, claudeMdDest);
|
|
770
879
|
report("info", "");
|
|
771
880
|
report("success", `Copied the group's ${instructionsFile} to the worktree root`);
|
|
772
881
|
} else {
|
|
773
882
|
report("info", "");
|
|
774
883
|
report("warn", `Warning: the group's ${instructionsFile} not found at ${claudeMdSrc}`);
|
|
775
|
-
report("warn", `Run 'work config
|
|
884
|
+
report("warn", `Run 'work config group regen ${groupName}' to generate it.`);
|
|
776
885
|
}
|
|
777
886
|
const allPaths = createdWorktrees.map((wt) => wt.worktreePath);
|
|
778
887
|
const distinctBases = [...new Set(Object.values(baseBranches))];
|
|
779
888
|
const everyRepo = Object.keys(baseBranches).length === allPaths.length;
|
|
780
889
|
const representativeBase = spec.default ?? (distinctBases.length === 1 && everyRepo ? distinctBases[0] : void 0);
|
|
781
|
-
const
|
|
890
|
+
const own = known ? listedRepos(known, config) : null;
|
|
891
|
+
const gone = (own ?? []).filter((r) => !config.repos[r.alias] && !r.guessed);
|
|
892
|
+
const owns = !known || !!own;
|
|
893
|
+
const { port } = await upsertSessionWithPort(
|
|
894
|
+
groupName,
|
|
895
|
+
true,
|
|
896
|
+
branchName,
|
|
897
|
+
owns ? [...allPaths, ...gone.map((r) => r.path)] : allPaths,
|
|
898
|
+
config,
|
|
899
|
+
jiraKey,
|
|
900
|
+
representativeBase,
|
|
901
|
+
baseBranches,
|
|
902
|
+
owns ? { repos: [...repoAliases, ...gone.map((r) => r.alias)], ...byImport && !known ? { instructions: "imports" } : {} } : {}
|
|
903
|
+
);
|
|
782
904
|
report("info", "");
|
|
783
905
|
report("info", `Branch: ${branchName}`);
|
|
784
906
|
if (port !== void 0) report("detail", `Dev-server port: ${port}`);
|
|
@@ -786,8 +908,8 @@ async function setupGroupWorktree(groupName, repoAliases, branchName, workTreeDi
|
|
|
786
908
|
}
|
|
787
909
|
async function setupSingleWorktree(targetName, branchName, workTreeDirName, config, spec, jiraKey, opts = {}) {
|
|
788
910
|
const repoPath = config.repos[targetName];
|
|
789
|
-
const repoName =
|
|
790
|
-
let workTreePath =
|
|
911
|
+
const repoName = path5.basename(repoPath);
|
|
912
|
+
let workTreePath = path5.join(config.worktreesRoot, repoName, workTreeDirName);
|
|
791
913
|
const unknownAliases = baseSpecOverrideAliases(spec).filter((a) => a !== targetName);
|
|
792
914
|
if (unknownAliases.length > 0) {
|
|
793
915
|
report("error", `--base names repo(s) other than '${targetName}': ${unknownAliases.join(", ")}`);
|
|
@@ -795,12 +917,12 @@ async function setupSingleWorktree(targetName, branchName, workTreeDirName, conf
|
|
|
795
917
|
}
|
|
796
918
|
const baseBranch = baseForAlias(spec, targetName);
|
|
797
919
|
const created = {};
|
|
798
|
-
if (!
|
|
920
|
+
if (!fs4.existsSync(repoPath)) {
|
|
799
921
|
report("error", `Repository path does not exist: ${repoPath}`);
|
|
800
922
|
return null;
|
|
801
923
|
}
|
|
802
924
|
const worktrees = parseWorktreeList(repoPath);
|
|
803
|
-
const existing = worktrees.find((wt) => wt.branch === branchName &&
|
|
925
|
+
const existing = worktrees.find((wt) => wt.branch === branchName && path5.resolve(wt.path) !== path5.resolve(repoPath));
|
|
804
926
|
if (existing) {
|
|
805
927
|
if (baseBranch) {
|
|
806
928
|
report("error", `Cannot use --base: worktree for '${branchName}' already exists at ${existing.path}`);
|
|
@@ -823,6 +945,7 @@ async function setupSingleWorktree(targetName, branchName, workTreeDirName, conf
|
|
|
823
945
|
if (!success) return null;
|
|
824
946
|
}
|
|
825
947
|
const base = baseBranch ?? created.from;
|
|
948
|
+
const isNew = !findSession(loadHistory(), targetName, branchName);
|
|
826
949
|
const { port } = await upsertSessionWithPort(
|
|
827
950
|
targetName,
|
|
828
951
|
false,
|
|
@@ -831,44 +954,54 @@ async function setupSingleWorktree(targetName, branchName, workTreeDirName, conf
|
|
|
831
954
|
config,
|
|
832
955
|
jiraKey,
|
|
833
956
|
base,
|
|
834
|
-
base ? { [workTreePath]: base } : void 0
|
|
957
|
+
base ? { [workTreePath]: base } : void 0,
|
|
958
|
+
isNew ? { repos: [targetName] } : {}
|
|
835
959
|
);
|
|
836
960
|
report("info", `Branch: ${branchName}`);
|
|
837
961
|
if (port !== void 0) report("detail", `Dev-server port: ${port}`);
|
|
838
962
|
return { launchDir: workTreePath, paths: [workTreePath], isGroup: false, port };
|
|
839
963
|
}
|
|
840
964
|
var normalizeWorktreePath = (p) => {
|
|
841
|
-
let full =
|
|
965
|
+
let full = path5.resolve(p);
|
|
842
966
|
try {
|
|
843
|
-
full =
|
|
967
|
+
full = fs4.realpathSync.native(full);
|
|
844
968
|
} catch {
|
|
845
969
|
}
|
|
846
970
|
return full.replace(/\\/g, "/").replace(/\/$/, "").toLowerCase();
|
|
847
971
|
};
|
|
848
972
|
function teardownWorktree(target, isGroup, branch, config, force = true, paths) {
|
|
849
|
-
const
|
|
850
|
-
if (isGroup && config.groups[target]) {
|
|
851
|
-
const
|
|
852
|
-
const groupWorktreePath =
|
|
973
|
+
const own = isGroup || recordedFolderSession(target, branch) ? ownGroupRepos(target, branch, paths, config) : null;
|
|
974
|
+
if ((isGroup || own) && (own || config.groups[target])) {
|
|
975
|
+
const known = findSession(loadHistory(), target, branch) ?? (paths?.length ? { paths } : null);
|
|
976
|
+
const groupWorktreePath = sessionFolderPath(target, branch, config, known, fs4.existsSync);
|
|
977
|
+
const repos = own ?? config.groups[target].map((alias) => ({
|
|
978
|
+
alias,
|
|
979
|
+
path: config.repos[alias] ? path5.join(groupWorktreePath, path5.basename(config.repos[alias])) : ""
|
|
980
|
+
}));
|
|
853
981
|
let allRemoved = true;
|
|
854
|
-
for (const alias of
|
|
982
|
+
for (const { alias, path: subWorktreePath } of repos) {
|
|
855
983
|
const repoPath = config.repos[alias];
|
|
856
|
-
if (!repoPath)
|
|
857
|
-
|
|
858
|
-
|
|
984
|
+
if (!repoPath) {
|
|
985
|
+
if (subWorktreePath && fs4.existsSync(subWorktreePath)) {
|
|
986
|
+
report("warn", `[${alias}] isn't in your config any more: ${subWorktreePath} is left as it is`);
|
|
987
|
+
allRemoved = false;
|
|
988
|
+
}
|
|
989
|
+
continue;
|
|
990
|
+
}
|
|
991
|
+
const repoName = path5.basename(repoPath);
|
|
859
992
|
report("step", `[${alias}] (${repoName}):`);
|
|
860
993
|
if (!removeSingleWorktree(repoPath, subWorktreePath, branch, force)) {
|
|
861
994
|
allRemoved = false;
|
|
862
995
|
}
|
|
863
996
|
}
|
|
864
|
-
const claudeMd =
|
|
997
|
+
const claudeMd = path5.join(groupWorktreePath, agentFor(config, findSession(loadHistory(), target, branch)).instructionsFile);
|
|
865
998
|
try {
|
|
866
|
-
if (
|
|
999
|
+
if (fs4.existsSync(claudeMd)) fs4.unlinkSync(claudeMd);
|
|
867
1000
|
} catch {
|
|
868
1001
|
}
|
|
869
1002
|
try {
|
|
870
|
-
if (
|
|
871
|
-
|
|
1003
|
+
if (fs4.existsSync(groupWorktreePath) && fs4.readdirSync(groupWorktreePath).length === 0) {
|
|
1004
|
+
fs4.rmSync(groupWorktreePath, { recursive: true, force: true });
|
|
872
1005
|
report("success", `Cleaned up group directory: ${groupWorktreePath}`);
|
|
873
1006
|
}
|
|
874
1007
|
} catch {
|
|
@@ -888,13 +1021,32 @@ function teardownWorktree(target, isGroup, branch, config, force = true, paths)
|
|
|
888
1021
|
return false;
|
|
889
1022
|
}
|
|
890
1023
|
}
|
|
1024
|
+
function recordedFolderSession(target, branch) {
|
|
1025
|
+
const s = findSession(loadHistory(), target, branch);
|
|
1026
|
+
return !!s && isFolderSession(s) && Array.isArray(s.repos);
|
|
1027
|
+
}
|
|
1028
|
+
function listedRepos(s, config) {
|
|
1029
|
+
const recorded = recordedRepos(s);
|
|
1030
|
+
if (recorded) return recorded;
|
|
1031
|
+
return Array.isArray(s.repos) && s.isGroup ? sessionRepos(s, config) : null;
|
|
1032
|
+
}
|
|
1033
|
+
function ownGroupRepos(target, branch, paths, config) {
|
|
1034
|
+
const s = findSession(loadHistory(), target, branch);
|
|
1035
|
+
const own = s ? listedRepos(s, config) : null;
|
|
1036
|
+
if (!own) return null;
|
|
1037
|
+
const given = paths ?? [];
|
|
1038
|
+
return own.map((r) => ({
|
|
1039
|
+
alias: r.alias,
|
|
1040
|
+
path: given.find((p) => normalizeWorktreePath(p) === normalizeWorktreePath(r.path)) ?? r.path
|
|
1041
|
+
}));
|
|
1042
|
+
}
|
|
891
1043
|
async function openBaseCheckout(targetName, config, opts = {}) {
|
|
892
1044
|
const target = resolveProjectTarget(targetName, config);
|
|
893
1045
|
if (!target) return { ok: false, error: `Project or group not found: ${targetName}` };
|
|
894
1046
|
if (target.isGroup) return { ok: false, error: `${targetName} is a group: give it a branch (a group has no one checkout to open)` };
|
|
895
1047
|
const repoPath = config.repos[targetName];
|
|
896
1048
|
if (!repoPath) return { ok: false, error: `Repository path not configured for: ${targetName}` };
|
|
897
|
-
if (!
|
|
1049
|
+
if (!fs4.existsSync(repoPath)) return { ok: false, error: `Repository path does not exist: ${repoPath}` };
|
|
898
1050
|
const branch = getCurrentBranch(repoPath) ?? "(detached)";
|
|
899
1051
|
if (opts.pull !== false && branch && branch !== "(detached)") pullLatestForBranch(repoPath, branch);
|
|
900
1052
|
await upsertSession(targetName, false, branch, [repoPath], opts.jiraKey);
|
|
@@ -906,13 +1058,16 @@ async function openBaseCheckout(targetName, config, opts = {}) {
|
|
|
906
1058
|
export {
|
|
907
1059
|
saveIgnored,
|
|
908
1060
|
worktreeFor,
|
|
1061
|
+
writeSessionInstructions,
|
|
909
1062
|
BaseSpecError,
|
|
910
1063
|
parseBaseSpec,
|
|
911
1064
|
isEmptyBaseSpec,
|
|
912
1065
|
toBaseSpec,
|
|
1066
|
+
createSingleWorktree,
|
|
913
1067
|
wouldRefuseRemoval,
|
|
1068
|
+
removeSingleWorktree,
|
|
914
1069
|
setupWorktree,
|
|
915
1070
|
teardownWorktree,
|
|
916
1071
|
openBaseCheckout
|
|
917
1072
|
};
|
|
918
|
-
//# sourceMappingURL=chunk-
|
|
1073
|
+
//# sourceMappingURL=chunk-VES42DOD.js.map
|