@moberg_hr/work-tree 2.23.2 → 2.23.4
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/dist/{account-6ZQ3VFA2.js → account-TSSDZ7HI.js} +26 -27
- package/dist/{account-6ZQ3VFA2.js.map → account-TSSDZ7HI.js.map} +1 -1
- package/dist/{add-repo-WXDEKZRX.js → add-repo-X6BY6Y7G.js} +20 -21
- package/dist/{add-repo-WXDEKZRX.js.map → add-repo-X6BY6Y7G.js.map} +1 -1
- package/dist/{answer-L55DWMR5.js → answer-44MKEQDP.js} +12 -12
- package/dist/{attach-KLVI7BHS.js → attach-4442NY36.js} +21 -22
- package/dist/{attach-KLVI7BHS.js.map → attach-4442NY36.js.map} +1 -1
- package/dist/bin.js +4 -4
- package/dist/{block-BRNRP226.js → block-KH7GT6KC.js} +17 -18
- package/dist/{block-BRNRP226.js.map → block-KH7GT6KC.js.map} +1 -1
- package/dist/{broadcast-GQE7H3MF.js → broadcast-RHPRE6OM.js} +10 -10
- package/dist/{catchup-ZMG4OWF2.js → catchup-POW3OD2J.js} +15 -15
- package/dist/{child-MPXXJ2QX.js → child-Y5H7NS7I.js} +18 -15
- package/dist/child-Y5H7NS7I.js.map +1 -0
- package/dist/{chunk-A53OR6P5.js → chunk-2TXH75I4.js} +7 -7
- package/dist/{chunk-HCYES6U7.js → chunk-32CMRR6M.js} +2 -2
- package/dist/{chunk-VQEMPGJL.js → chunk-4FCPWNZD.js} +2 -2
- package/dist/{chunk-PSALWCBD.js → chunk-4VQJQ6CO.js} +5 -5
- package/dist/{chunk-DK3UMOX7.js → chunk-55MJYS5Q.js} +2 -2
- package/dist/{chunk-773UJC5C.js → chunk-5C5NTOZT.js} +7 -7
- package/dist/{chunk-NREZVTBP.js → chunk-6ER6IBFJ.js} +2 -2
- package/dist/chunk-6SOIHZYE.js +9 -0
- package/dist/{chunk-MMEFW2PI.js → chunk-7FY6V6SF.js} +7 -7
- package/dist/{chunk-ZPDCVDE2.js → chunk-7GMENM2D.js} +2 -2
- package/dist/{chunk-JVOQSU6R.js → chunk-7L3D3SZA.js} +6 -6
- package/dist/{chunk-VPZ5ILKT.js → chunk-7VDNNWPU.js} +5 -5
- package/dist/{chunk-NWKVTUTN.js → chunk-B34R6TQO.js} +399 -192
- package/dist/chunk-B34R6TQO.js.map +1 -0
- package/dist/{chunk-6S3DYLGH.js → chunk-BLCQOJDB.js} +6 -6
- package/dist/{chunk-XB4SCJWD.js → chunk-BMZ4KPUT.js} +7 -7
- package/dist/{chunk-XIN6XUFL.js → chunk-D4XRXS3P.js} +2 -2
- package/dist/{chunk-2JLG65GB.js → chunk-D7ZWESWW.js} +3 -3
- package/dist/{chunk-KJAE7WO5.js → chunk-DIBXT67T.js} +2 -2
- package/dist/{chunk-VNZBFVGY.js → chunk-EFCWSWZK.js} +6 -6
- package/dist/{chunk-HBYXSFLN.js → chunk-F44FMA67.js} +5 -5
- package/dist/{chunk-BBI4YQTS.js → chunk-FC5WCLWJ.js} +18 -18
- package/dist/{chunk-MYXEX6BB.js → chunk-FCMPVWE7.js} +33 -10
- package/dist/chunk-FCMPVWE7.js.map +1 -0
- package/dist/{chunk-C5BBVVHW.js → chunk-FFRNSK4S.js} +2 -2
- package/dist/{chunk-ETWP7MDS.js → chunk-FX4KMK4M.js} +1 -1
- package/dist/chunk-FX4KMK4M.js.map +1 -0
- package/dist/{chunk-RGKGJOES.js → chunk-H2QFMDSU.js} +9 -9
- package/dist/{chunk-LOFGDH5B.js → chunk-IEKDHKGO.js} +2 -2
- package/dist/{chunk-EORL2V7P.js → chunk-IN52DQRN.js} +2 -2
- package/dist/{chunk-G4VKMMIC.js → chunk-IUOY42LA.js} +15 -15
- package/dist/{chunk-XT3FON6A.js → chunk-J5NSFIQ5.js} +5 -5
- package/dist/{chunk-HUGHF45U.js → chunk-JIQ2XXFX.js} +3 -3
- package/dist/{chunk-M2P722BR.js → chunk-JPUNYEQR.js} +2 -2
- package/dist/{chunk-T5GJVUSL.js → chunk-KBEP7BJP.js} +2 -2
- package/dist/chunk-KPAT46RL.js +21 -0
- package/dist/chunk-KPAT46RL.js.map +1 -0
- package/dist/{chunk-HO5KESIB.js → chunk-LC44HSCM.js} +4 -4
- package/dist/{chunk-NLU6MBYT.js → chunk-LCMLUSBQ.js} +12 -12
- package/dist/{chunk-SF3DIIKN.js → chunk-M7GVYIAB.js} +3 -3
- package/dist/{chunk-SUHANL3G.js → chunk-MC5T6J2V.js} +7 -7
- package/dist/{chunk-ZG6HB4BO.js → chunk-MFZRX6GM.js} +13 -17
- package/dist/chunk-MFZRX6GM.js.map +1 -0
- package/dist/{chunk-GNIYYXQX.js → chunk-MSXMX7C7.js} +2 -2
- package/dist/{chunk-XL4YNA3L.js → chunk-NIMROXWE.js} +22 -13
- package/dist/chunk-NIMROXWE.js.map +1 -0
- package/dist/{chunk-IUVMVNIO.js → chunk-NTBTO4SJ.js} +6 -6
- package/dist/{chunk-LW6VCL6S.js → chunk-NUWP3CGK.js} +7 -7
- package/dist/{chunk-NS7WH53I.js → chunk-O45NATRC.js} +2 -2
- package/dist/{chunk-APHVSSLI.js → chunk-OJ23FAT5.js} +2 -2
- package/dist/{chunk-QAIG5FSQ.js → chunk-OOVYRRGT.js} +3 -3
- package/dist/{chunk-XBWS77S2.js → chunk-OTY7XB5J.js} +2 -2
- package/dist/chunk-OU3BTWR6.js +482 -0
- package/dist/chunk-OU3BTWR6.js.map +1 -0
- package/dist/{chunk-MYASALCU.js → chunk-OYNVFQM5.js} +9 -9
- package/dist/{chunk-QMWV4UKB.js → chunk-PLEILEF4.js} +3 -3
- package/dist/{chunk-WH6DAD6D.js → chunk-PX7BDJQV.js} +2 -2
- package/dist/{chunk-GF7RAQFD.js → chunk-QNLWGTNI.js} +3 -3
- package/dist/{chunk-KWJ6S4NZ.js → chunk-S5Z247FI.js} +9 -9
- package/dist/{chunk-BGQ6NUU7.js → chunk-S77BGUVD.js} +4 -4
- package/dist/{chunk-K6FD5WDW.js → chunk-UGZ6WBYP.js} +8 -8
- package/dist/{chunk-QSSCVTFG.js → chunk-UVRGRMN4.js} +4 -4
- package/dist/{chunk-7HQSILMM.js → chunk-V4RNP62T.js} +4 -4
- package/dist/{chunk-7BH2PUYY.js → chunk-W3OU74ER.js} +5 -5
- package/dist/{chunk-CRAGAIOS.js → chunk-W4KMOS7T.js} +11 -11
- package/dist/{chunk-LCYYJFSZ.js → chunk-WD7XHWRQ.js} +5 -5
- package/dist/{chunk-ZHK5XOV5.js → chunk-XMWMC5R2.js} +60 -60
- package/dist/{chunk-BZOYUBK4.js → chunk-XXOOR3IV.js} +6 -6
- package/dist/{chunk-ED6YLB4S.js → chunk-YQSWVHKK.js} +13 -13
- package/dist/chunk-YQSWVHKK.js.map +1 -0
- package/dist/{chunk-DNC2ZJOF.js → chunk-ZCRIGDCK.js} +7 -7
- package/dist/{chunk-P53UYZZ4.js → chunk-ZU2265JN.js} +2 -2
- package/dist/{cleanup-DRELB6UC.js → cleanup-HTM3VX4O.js} +38 -40
- package/dist/{cleanup-DRELB6UC.js.map → cleanup-HTM3VX4O.js.map} +1 -1
- package/dist/{cli-C3U2BC44.js → cli-6UA7NFOP.js} +4 -4
- package/dist/{color-T75ANAWG.js → color-GLNALQJU.js} +14 -14
- package/dist/{config-KI6JOXKW.js → config-MC6A5AOY.js} +16 -17
- package/dist/{config-KI6JOXKW.js.map → config-MC6A5AOY.js.map} +1 -1
- package/dist/{coordinate-4PPZN4U4.js → coordinate-JRJX7LN6.js} +26 -16
- package/dist/coordinate-JRJX7LN6.js.map +1 -0
- package/dist/{diff-NDZPRQV7.js → diff-ABQL4OGG.js} +15 -16
- package/dist/{diff-NDZPRQV7.js.map → diff-ABQL4OGG.js.map} +1 -1
- package/dist/{digest-H5YFX5WR.js → digest-K5LVRZJ2.js} +12 -12
- package/dist/{fork-HHHATXVI.js → fork-SYSHOZEC.js} +33 -35
- package/dist/{fork-HHHATXVI.js.map → fork-SYSHOZEC.js.map} +1 -1
- package/dist/{history-3Z7AS2AC.js → history-UPV5FKKH.js} +10 -10
- package/dist/{hook-KOK7NKCO.js → hook-HKZEOBBJ.js} +31 -24
- package/dist/hook-HKZEOBBJ.js.map +1 -0
- package/dist/{hydrate-VI3XSZQH.js → hydrate-W6LXQTDU.js} +11 -11
- package/dist/{init-7NOKRHNJ.js → init-DXALHRTW.js} +18 -19
- package/dist/{init-7NOKRHNJ.js.map → init-DXALHRTW.js.map} +1 -1
- package/dist/{install-skills-TL5D7HZU.js → install-skills-COQUL6LG.js} +11 -9
- package/dist/install-skills-bin.js +10 -8
- package/dist/install-skills-bin.js.map +1 -1
- package/dist/{keep-G62GSDOQ.js → keep-5725FMZD.js} +12 -12
- package/dist/{list-CEVAZQ4V.js → list-HCD535CS.js} +11 -11
- package/dist/{move-ISAW6RDM.js → move-I46P3OHI.js} +24 -25
- package/dist/{move-ISAW6RDM.js.map → move-I46P3OHI.js.map} +1 -1
- package/dist/{note-YIVFXTGM.js → note-EJMRTSDZ.js} +12 -12
- package/dist/{overlaps-YBEHBRRK.js → overlaps-7KFBI2B2.js} +18 -19
- package/dist/{overlaps-YBEHBRRK.js.map → overlaps-7KFBI2B2.js.map} +1 -1
- package/dist/{pin-J4IDSHRG.js → pin-QR3CSLIU.js} +13 -13
- package/dist/{pr-Z7CPBBGT.js → pr-IOWS2QWR.js} +26 -27
- package/dist/{pr-Z7CPBBGT.js.map → pr-IOWS2QWR.js.map} +1 -1
- package/dist/{prune-UA3UDZSM.js → prune-GUSIRD4X.js} +35 -37
- package/dist/{prune-UA3UDZSM.js.map → prune-GUSIRD4X.js.map} +1 -1
- package/dist/{pty-host-JIQUP62K.js → pty-host-BFPESGGA.js} +29 -32
- package/dist/{pty-host-JIQUP62K.js.map → pty-host-BFPESGGA.js.map} +1 -1
- package/dist/{read-DG4PCLFH.js → read-VL5G36JG.js} +17 -13
- package/dist/{read-DG4PCLFH.js.map → read-VL5G36JG.js.map} +1 -1
- package/dist/{recent-PGD6QYAH.js → recent-WXDFS3EQ.js} +21 -22
- package/dist/{recent-PGD6QYAH.js.map → recent-WXDFS3EQ.js.map} +1 -1
- package/dist/{remove-TPLA64HP.js → remove-FID7UAFE.js} +36 -38
- package/dist/{remove-TPLA64HP.js.map → remove-FID7UAFE.js.map} +1 -1
- package/dist/{report-K3OTT2ED.js → report-4ZFCDVGT.js} +16 -13
- package/dist/report-4ZFCDVGT.js.map +1 -0
- package/dist/{restart-477IX2JX.js → restart-NO3V563I.js} +14 -15
- package/dist/{restart-477IX2JX.js.map → restart-NO3V563I.js.map} +1 -1
- package/dist/{resume-OYBAJCYE.js → resume-HXJQMNLX.js} +21 -22
- package/dist/{resume-OYBAJCYE.js.map → resume-HXJQMNLX.js.map} +1 -1
- package/dist/{review-6PWFSBAO.js → review-F54E75RF.js} +11 -11
- package/dist/{review-now-AT2SPPRO.js → review-now-K3GBWULH.js} +2 -2
- package/dist/{run-XEHF2N4A.js → run-X7VJAHIA.js} +10 -10
- package/dist/{screen-SFU6TCDV.js → screen-2HPSFMT5.js} +12 -12
- package/dist/{search-VJ3BGWPX.js → search-XNWJXKLY.js} +10 -10
- package/dist/{section-ZLINSTGS.js → section-GF4S3RHQ.js} +14 -14
- package/dist/{send-NBP2WYBG.js → send-W3W42FBF.js} +26 -16
- package/dist/send-W3W42FBF.js.map +1 -0
- package/dist/{sessions-UT4I7A43.js → sessions-PQV6NZKZ.js} +31 -33
- package/dist/{sessions-UT4I7A43.js.map → sessions-PQV6NZKZ.js.map} +1 -1
- package/dist/{show-RK2EWOR6.js → show-75JNPHZZ.js} +11 -11
- package/dist/{snooze-T2WWIKZN.js → snooze-R3IISMDC.js} +12 -12
- package/dist/{start-AWHOIA3Q.js → start-PD6MO5H5.js} +12 -12
- package/dist/{state-HK67C4UA.js → state-KUP4OEXR.js} +2 -2
- package/dist/{status-QE2DA6RR.js → status-ZJDIGGFB.js} +15 -16
- package/dist/{status-QE2DA6RR.js.map → status-ZJDIGGFB.js.map} +1 -1
- package/dist/{statusline-Z5HLKDIA.js → statusline-SZPL3QBC.js} +5 -5
- package/dist/{statusline-hook-VPPS3PFO.js → statusline-hook-6BNEVENM.js} +4 -4
- package/dist/{stop-YOU3P3ZR.js → stop-CID5EBHG.js} +12 -12
- package/dist/{sync-74EFTPBJ.js → sync-VV4MLQ4Q.js} +35 -37
- package/dist/{sync-74EFTPBJ.js.map → sync-VV4MLQ4Q.js.map} +1 -1
- package/dist/{time-ZGMZZ5OY.js → time-THNKOLZK.js} +14 -14
- package/dist/{time-actions-VAGRSY5B.js → time-actions-6L4RQ3A7.js} +3 -3
- package/dist/{timesheet-N74LPF5M.js → timesheet-5DYIZGCM.js} +20 -21
- package/dist/{timesheet-N74LPF5M.js.map → timesheet-5DYIZGCM.js.map} +1 -1
- package/dist/{todo-UVKGOG7D.js → todo-VHYBQC3I.js} +2 -2
- package/dist/{tree-FXTCWC6D.js → tree-HCKKRJ6Y.js} +37 -39
- package/dist/{tree-FXTCWC6D.js.map → tree-HCKKRJ6Y.js.map} +1 -1
- package/dist/{update-5QSRHIWH.js → update-MJ4DQLAN.js} +20 -21
- package/dist/{update-5QSRHIWH.js.map → update-MJ4DQLAN.js.map} +1 -1
- package/dist/{usage-CW7CDFU3.js → usage-XLLVYWBE.js} +12 -12
- package/dist/{usage-ask-V2SIRW4F.js → usage-ask-QBLLIHE3.js} +11 -11
- package/dist/version-ATSNJMTH.js +31 -0
- package/dist/version-ATSNJMTH.js.map +1 -0
- package/dist/{wait-XXC3I6DK.js → wait-NIPHM5DN.js} +13 -13
- package/dist/wd-bin.js +3 -3
- package/dist/web/assets/{PtyView-BLTE5F3E.js → PtyView-DCwMId37.js} +2 -2
- package/dist/web/assets/{PtyView-BLTE5F3E.js.map → PtyView-DCwMId37.js.map} +1 -1
- package/dist/web/assets/{index-BiadbzE6.js → index-AQoEcgyy.js} +27 -27
- package/dist/web/assets/index-AQoEcgyy.js.map +1 -0
- package/dist/web/index.html +1 -1
- package/dist/{web-SUSR4IAK.js → web-NMS22ZDZ.js} +198 -92
- package/dist/web-NMS22ZDZ.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/plugins/work-tree/skills/work-sessions/SKILL.md +35 -50
- package/dist/child-MPXXJ2QX.js.map +0 -1
- package/dist/chunk-4CXUVBOD.js +0 -76
- package/dist/chunk-4CXUVBOD.js.map +0 -1
- package/dist/chunk-BMPTUIP4.js +0 -105
- package/dist/chunk-BMPTUIP4.js.map +0 -1
- package/dist/chunk-DYKA3LO3.js +0 -9
- package/dist/chunk-ED6YLB4S.js.map +0 -1
- package/dist/chunk-ETWP7MDS.js.map +0 -1
- package/dist/chunk-MYXEX6BB.js.map +0 -1
- package/dist/chunk-NWKVTUTN.js.map +0 -1
- package/dist/chunk-SJBEIYLK.js +0 -16
- package/dist/chunk-SJBEIYLK.js.map +0 -1
- package/dist/chunk-TC3H7I6O.js +0 -196
- package/dist/chunk-TC3H7I6O.js.map +0 -1
- package/dist/chunk-TNJF7T33.js +0 -17
- package/dist/chunk-TNJF7T33.js.map +0 -1
- package/dist/chunk-XL4YNA3L.js.map +0 -1
- package/dist/chunk-ZG6HB4BO.js.map +0 -1
- package/dist/coordinate-4PPZN4U4.js.map +0 -1
- package/dist/hook-KOK7NKCO.js.map +0 -1
- package/dist/report-K3OTT2ED.js.map +0 -1
- package/dist/send-NBP2WYBG.js.map +0 -1
- package/dist/version-RJ4PCHPB.js +0 -117
- package/dist/version-RJ4PCHPB.js.map +0 -1
- package/dist/web/assets/index-BiadbzE6.js.map +0 -1
- package/dist/web-SUSR4IAK.js.map +0 -1
- /package/dist/{answer-L55DWMR5.js.map → answer-44MKEQDP.js.map} +0 -0
- /package/dist/{broadcast-GQE7H3MF.js.map → broadcast-RHPRE6OM.js.map} +0 -0
- /package/dist/{catchup-ZMG4OWF2.js.map → catchup-POW3OD2J.js.map} +0 -0
- /package/dist/{chunk-A53OR6P5.js.map → chunk-2TXH75I4.js.map} +0 -0
- /package/dist/{chunk-HCYES6U7.js.map → chunk-32CMRR6M.js.map} +0 -0
- /package/dist/{chunk-VQEMPGJL.js.map → chunk-4FCPWNZD.js.map} +0 -0
- /package/dist/{chunk-PSALWCBD.js.map → chunk-4VQJQ6CO.js.map} +0 -0
- /package/dist/{chunk-DK3UMOX7.js.map → chunk-55MJYS5Q.js.map} +0 -0
- /package/dist/{chunk-773UJC5C.js.map → chunk-5C5NTOZT.js.map} +0 -0
- /package/dist/{chunk-NREZVTBP.js.map → chunk-6ER6IBFJ.js.map} +0 -0
- /package/dist/{chunk-DYKA3LO3.js.map → chunk-6SOIHZYE.js.map} +0 -0
- /package/dist/{chunk-MMEFW2PI.js.map → chunk-7FY6V6SF.js.map} +0 -0
- /package/dist/{chunk-ZPDCVDE2.js.map → chunk-7GMENM2D.js.map} +0 -0
- /package/dist/{chunk-JVOQSU6R.js.map → chunk-7L3D3SZA.js.map} +0 -0
- /package/dist/{chunk-VPZ5ILKT.js.map → chunk-7VDNNWPU.js.map} +0 -0
- /package/dist/{chunk-6S3DYLGH.js.map → chunk-BLCQOJDB.js.map} +0 -0
- /package/dist/{chunk-XB4SCJWD.js.map → chunk-BMZ4KPUT.js.map} +0 -0
- /package/dist/{chunk-XIN6XUFL.js.map → chunk-D4XRXS3P.js.map} +0 -0
- /package/dist/{chunk-2JLG65GB.js.map → chunk-D7ZWESWW.js.map} +0 -0
- /package/dist/{chunk-KJAE7WO5.js.map → chunk-DIBXT67T.js.map} +0 -0
- /package/dist/{chunk-VNZBFVGY.js.map → chunk-EFCWSWZK.js.map} +0 -0
- /package/dist/{chunk-HBYXSFLN.js.map → chunk-F44FMA67.js.map} +0 -0
- /package/dist/{chunk-BBI4YQTS.js.map → chunk-FC5WCLWJ.js.map} +0 -0
- /package/dist/{chunk-C5BBVVHW.js.map → chunk-FFRNSK4S.js.map} +0 -0
- /package/dist/{chunk-RGKGJOES.js.map → chunk-H2QFMDSU.js.map} +0 -0
- /package/dist/{chunk-LOFGDH5B.js.map → chunk-IEKDHKGO.js.map} +0 -0
- /package/dist/{chunk-EORL2V7P.js.map → chunk-IN52DQRN.js.map} +0 -0
- /package/dist/{chunk-G4VKMMIC.js.map → chunk-IUOY42LA.js.map} +0 -0
- /package/dist/{chunk-XT3FON6A.js.map → chunk-J5NSFIQ5.js.map} +0 -0
- /package/dist/{chunk-HUGHF45U.js.map → chunk-JIQ2XXFX.js.map} +0 -0
- /package/dist/{chunk-M2P722BR.js.map → chunk-JPUNYEQR.js.map} +0 -0
- /package/dist/{chunk-T5GJVUSL.js.map → chunk-KBEP7BJP.js.map} +0 -0
- /package/dist/{chunk-HO5KESIB.js.map → chunk-LC44HSCM.js.map} +0 -0
- /package/dist/{chunk-NLU6MBYT.js.map → chunk-LCMLUSBQ.js.map} +0 -0
- /package/dist/{chunk-SF3DIIKN.js.map → chunk-M7GVYIAB.js.map} +0 -0
- /package/dist/{chunk-SUHANL3G.js.map → chunk-MC5T6J2V.js.map} +0 -0
- /package/dist/{chunk-GNIYYXQX.js.map → chunk-MSXMX7C7.js.map} +0 -0
- /package/dist/{chunk-IUVMVNIO.js.map → chunk-NTBTO4SJ.js.map} +0 -0
- /package/dist/{chunk-LW6VCL6S.js.map → chunk-NUWP3CGK.js.map} +0 -0
- /package/dist/{chunk-NS7WH53I.js.map → chunk-O45NATRC.js.map} +0 -0
- /package/dist/{chunk-APHVSSLI.js.map → chunk-OJ23FAT5.js.map} +0 -0
- /package/dist/{chunk-QAIG5FSQ.js.map → chunk-OOVYRRGT.js.map} +0 -0
- /package/dist/{chunk-XBWS77S2.js.map → chunk-OTY7XB5J.js.map} +0 -0
- /package/dist/{chunk-MYASALCU.js.map → chunk-OYNVFQM5.js.map} +0 -0
- /package/dist/{chunk-QMWV4UKB.js.map → chunk-PLEILEF4.js.map} +0 -0
- /package/dist/{chunk-WH6DAD6D.js.map → chunk-PX7BDJQV.js.map} +0 -0
- /package/dist/{chunk-GF7RAQFD.js.map → chunk-QNLWGTNI.js.map} +0 -0
- /package/dist/{chunk-KWJ6S4NZ.js.map → chunk-S5Z247FI.js.map} +0 -0
- /package/dist/{chunk-BGQ6NUU7.js.map → chunk-S77BGUVD.js.map} +0 -0
- /package/dist/{chunk-K6FD5WDW.js.map → chunk-UGZ6WBYP.js.map} +0 -0
- /package/dist/{chunk-QSSCVTFG.js.map → chunk-UVRGRMN4.js.map} +0 -0
- /package/dist/{chunk-7HQSILMM.js.map → chunk-V4RNP62T.js.map} +0 -0
- /package/dist/{chunk-7BH2PUYY.js.map → chunk-W3OU74ER.js.map} +0 -0
- /package/dist/{chunk-CRAGAIOS.js.map → chunk-W4KMOS7T.js.map} +0 -0
- /package/dist/{chunk-LCYYJFSZ.js.map → chunk-WD7XHWRQ.js.map} +0 -0
- /package/dist/{chunk-ZHK5XOV5.js.map → chunk-XMWMC5R2.js.map} +0 -0
- /package/dist/{chunk-BZOYUBK4.js.map → chunk-XXOOR3IV.js.map} +0 -0
- /package/dist/{chunk-DNC2ZJOF.js.map → chunk-ZCRIGDCK.js.map} +0 -0
- /package/dist/{chunk-P53UYZZ4.js.map → chunk-ZU2265JN.js.map} +0 -0
- /package/dist/{cli-C3U2BC44.js.map → cli-6UA7NFOP.js.map} +0 -0
- /package/dist/{color-T75ANAWG.js.map → color-GLNALQJU.js.map} +0 -0
- /package/dist/{digest-H5YFX5WR.js.map → digest-K5LVRZJ2.js.map} +0 -0
- /package/dist/{history-3Z7AS2AC.js.map → history-UPV5FKKH.js.map} +0 -0
- /package/dist/{hydrate-VI3XSZQH.js.map → hydrate-W6LXQTDU.js.map} +0 -0
- /package/dist/{install-skills-TL5D7HZU.js.map → install-skills-COQUL6LG.js.map} +0 -0
- /package/dist/{keep-G62GSDOQ.js.map → keep-5725FMZD.js.map} +0 -0
- /package/dist/{list-CEVAZQ4V.js.map → list-HCD535CS.js.map} +0 -0
- /package/dist/{note-YIVFXTGM.js.map → note-EJMRTSDZ.js.map} +0 -0
- /package/dist/{pin-J4IDSHRG.js.map → pin-QR3CSLIU.js.map} +0 -0
- /package/dist/{review-6PWFSBAO.js.map → review-F54E75RF.js.map} +0 -0
- /package/dist/{review-now-AT2SPPRO.js.map → review-now-K3GBWULH.js.map} +0 -0
- /package/dist/{run-XEHF2N4A.js.map → run-X7VJAHIA.js.map} +0 -0
- /package/dist/{screen-SFU6TCDV.js.map → screen-2HPSFMT5.js.map} +0 -0
- /package/dist/{search-VJ3BGWPX.js.map → search-XNWJXKLY.js.map} +0 -0
- /package/dist/{section-ZLINSTGS.js.map → section-GF4S3RHQ.js.map} +0 -0
- /package/dist/{show-RK2EWOR6.js.map → show-75JNPHZZ.js.map} +0 -0
- /package/dist/{snooze-T2WWIKZN.js.map → snooze-R3IISMDC.js.map} +0 -0
- /package/dist/{start-AWHOIA3Q.js.map → start-PD6MO5H5.js.map} +0 -0
- /package/dist/{state-HK67C4UA.js.map → state-KUP4OEXR.js.map} +0 -0
- /package/dist/{statusline-Z5HLKDIA.js.map → statusline-SZPL3QBC.js.map} +0 -0
- /package/dist/{statusline-hook-VPPS3PFO.js.map → statusline-hook-6BNEVENM.js.map} +0 -0
- /package/dist/{stop-YOU3P3ZR.js.map → stop-CID5EBHG.js.map} +0 -0
- /package/dist/{time-ZGMZZ5OY.js.map → time-THNKOLZK.js.map} +0 -0
- /package/dist/{time-actions-VAGRSY5B.js.map → time-actions-6L4RQ3A7.js.map} +0 -0
- /package/dist/{todo-UVKGOG7D.js.map → todo-VHYBQC3I.js.map} +0 -0
- /package/dist/{usage-CW7CDFU3.js.map → usage-XLLVYWBE.js.map} +0 -0
- /package/dist/{usage-ask-V2SIRW4F.js.map → usage-ask-QBLLIHE3.js.map} +0 -0
- /package/dist/{wait-XXC3I6DK.js.map → wait-NIPHM5DN.js.map} +0 -0
|
@@ -3,25 +3,37 @@ import {
|
|
|
3
3
|
withoutParentSession
|
|
4
4
|
} from "./chunk-KGHWHAVF.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
claudeSettingsFile,
|
|
10
|
-
internalClaudeReadOnlySpawn,
|
|
11
|
-
internalClaudeSpawn
|
|
12
|
-
} from "./chunk-BMPTUIP4.js";
|
|
13
|
-
import {
|
|
14
|
-
applyEnvDelta
|
|
15
|
-
} from "./chunk-ED6YLB4S.js";
|
|
6
|
+
json,
|
|
7
|
+
withDb
|
|
8
|
+
} from "./chunk-QGUBOOEN.js";
|
|
16
9
|
import {
|
|
17
10
|
checkedOutBranch
|
|
18
11
|
} from "./chunk-Z6ACV5ZQ.js";
|
|
12
|
+
import {
|
|
13
|
+
savedPath,
|
|
14
|
+
userStatusLine
|
|
15
|
+
} from "./chunk-7ZATXG5F.js";
|
|
19
16
|
import {
|
|
20
17
|
readReadings
|
|
21
18
|
} from "./chunk-JUGF3YE7.js";
|
|
22
19
|
import {
|
|
23
|
-
|
|
24
|
-
} from "./chunk-
|
|
20
|
+
accountOf
|
|
21
|
+
} from "./chunk-BR6OWWAA.js";
|
|
22
|
+
import {
|
|
23
|
+
CLAUDE_READ_ONLY_LINES,
|
|
24
|
+
CLAUDE_READ_ONLY_LOCAL_LINES,
|
|
25
|
+
atLeast,
|
|
26
|
+
claudeReadDenyRules,
|
|
27
|
+
claudeSettingsFile,
|
|
28
|
+
internalClaudeReadOnlySpawn,
|
|
29
|
+
internalClaudeSpawn,
|
|
30
|
+
launchFor,
|
|
31
|
+
parseClaudeVersion,
|
|
32
|
+
runVersion
|
|
33
|
+
} from "./chunk-OU3BTWR6.js";
|
|
34
|
+
import {
|
|
35
|
+
applyEnvDelta
|
|
36
|
+
} from "./chunk-YQSWVHKK.js";
|
|
25
37
|
import {
|
|
26
38
|
accountDir,
|
|
27
39
|
accountDirKey,
|
|
@@ -38,25 +50,20 @@ import {
|
|
|
38
50
|
sessionAccount,
|
|
39
51
|
setUpAccounts,
|
|
40
52
|
validateClaudeAccounts
|
|
41
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-D4XRXS3P.js";
|
|
42
54
|
import {
|
|
43
55
|
DEFAULT_ACCOUNT,
|
|
44
56
|
getConfigPath,
|
|
45
57
|
isAgentId,
|
|
46
58
|
loadConfig
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import {
|
|
49
|
-
savedPath,
|
|
50
|
-
userStatusLine
|
|
51
|
-
} from "./chunk-7ZATXG5F.js";
|
|
52
|
-
import {
|
|
53
|
-
accountOf
|
|
54
|
-
} from "./chunk-BR6OWWAA.js";
|
|
59
|
+
} from "./chunk-FX4KMK4M.js";
|
|
55
60
|
import {
|
|
56
61
|
bootTime,
|
|
62
|
+
killTreeAsync,
|
|
57
63
|
processTable
|
|
58
64
|
} from "./chunk-M2X6OHHR.js";
|
|
59
65
|
import {
|
|
66
|
+
findOnPath,
|
|
60
67
|
spawn_default
|
|
61
68
|
} from "./chunk-QOSAWNOU.js";
|
|
62
69
|
import {
|
|
@@ -68,6 +75,9 @@ import {
|
|
|
68
75
|
import {
|
|
69
76
|
debugLog
|
|
70
77
|
} from "./chunk-IAKOKZYW.js";
|
|
78
|
+
import {
|
|
79
|
+
workCommand
|
|
80
|
+
} from "./chunk-HK6AZQ5Z.js";
|
|
71
81
|
import {
|
|
72
82
|
getConfigDir
|
|
73
83
|
} from "./chunk-F2ECTTSY.js";
|
|
@@ -190,7 +200,147 @@ var AccountAdminError = class extends Error {
|
|
|
190
200
|
};
|
|
191
201
|
|
|
192
202
|
// src/core/agents/index.ts
|
|
193
|
-
import
|
|
203
|
+
import path16 from "path";
|
|
204
|
+
|
|
205
|
+
// src/core/agents/claude/tool-update.ts
|
|
206
|
+
import fs2 from "fs";
|
|
207
|
+
import os from "os";
|
|
208
|
+
import path2 from "path";
|
|
209
|
+
var slash = (p) => p.replace(/\\/g, "/");
|
|
210
|
+
function claudeInstallOf(realFile, platform = process.platform) {
|
|
211
|
+
const f = slash(realFile);
|
|
212
|
+
const brewAt = (marker) => {
|
|
213
|
+
const i = f.indexOf(marker);
|
|
214
|
+
return i > 0 ? path2.join(realFile.slice(0, i), "bin", "brew") : null;
|
|
215
|
+
};
|
|
216
|
+
const cask = brewAt("/Caskroom/claude-code/");
|
|
217
|
+
if (cask) return { kind: "brew-cask", file: realFile, update: { cmd: cask, args: ["upgrade", "--cask", "claude-code"] } };
|
|
218
|
+
const formula = brewAt("/Cellar/claude-code/");
|
|
219
|
+
if (formula) return { kind: "brew-formula", file: realFile, update: { cmd: formula, args: ["upgrade", "claude-code"] } };
|
|
220
|
+
if (/\/claude\/versions\/[^/]+$/.test(f) || /\/\.local\/bin\/claude(\.exe)?$/.test(f))
|
|
221
|
+
return { kind: "native", file: realFile, update: { cmd: realFile, args: ["update"] } };
|
|
222
|
+
const npmAt = f.indexOf("/node_modules/@anthropic-ai/claude-code/");
|
|
223
|
+
if (npmAt > 0) {
|
|
224
|
+
const modules = realFile.slice(0, npmAt);
|
|
225
|
+
const prefix = path2.basename(path2.dirname(modules)) === "lib" ? path2.dirname(path2.dirname(modules)) : path2.dirname(modules);
|
|
226
|
+
const npm = platform === "win32" ? path2.join(prefix, "npm.cmd") : path2.join(prefix, "bin", "npm");
|
|
227
|
+
return { kind: "npm", file: realFile, update: { cmd: npm, args: ["install", "-g", "@anthropic-ai/claude-code@latest"] } };
|
|
228
|
+
}
|
|
229
|
+
return { kind: "unknown", file: realFile, update: null };
|
|
230
|
+
}
|
|
231
|
+
async function latestClaudeVersion(fetchImpl = fetch, timeoutMs = 15e3) {
|
|
232
|
+
try {
|
|
233
|
+
const res = await fetchImpl("https://registry.npmjs.org/@anthropic-ai%2Fclaude-code/latest", {
|
|
234
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
235
|
+
headers: { accept: "application/json" }
|
|
236
|
+
});
|
|
237
|
+
if (!res.ok) return null;
|
|
238
|
+
const v = (await res.json()).version;
|
|
239
|
+
return typeof v === "string" && parseClaudeVersion(v) ? v : null;
|
|
240
|
+
} catch {
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
var RETRY_SAME_MS = 12 * 36e5;
|
|
245
|
+
var KEY = "claude:update-tried";
|
|
246
|
+
function lastTried() {
|
|
247
|
+
return withDb((d) => {
|
|
248
|
+
const row = d.prepare("SELECT value FROM meta WHERE key = ?").get(KEY);
|
|
249
|
+
const v = row ? json.parse(row.value) : null;
|
|
250
|
+
return v && typeof v.version === "string" && typeof v.at === "number" ? { version: v.version, at: v.at } : null;
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
function noteTried(version, at) {
|
|
254
|
+
withDb((d) => d.prepare("INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)").run(KEY, JSON.stringify({ version, at })));
|
|
255
|
+
}
|
|
256
|
+
async function keepClaudeUpdated(io = realToolUpdateIo()) {
|
|
257
|
+
const now = (io.now ?? Date.now)();
|
|
258
|
+
const file = io.find();
|
|
259
|
+
if (!file) return { kind: "cannot", why: "claude isn't on PATH" };
|
|
260
|
+
const install = claudeInstallOf(file, io.platform);
|
|
261
|
+
const installed = await io.installed(file);
|
|
262
|
+
if (!installed) return { kind: "cannot", why: "Claude Code's version can't be told (claude --version gave none)" };
|
|
263
|
+
const latest = await io.latest();
|
|
264
|
+
if (!latest) return { kind: "cannot", why: "couldn't ask npm for the newest Claude Code" };
|
|
265
|
+
if (atLeast(parseClaudeVersion(installed), parseClaudeVersion(latest))) return { kind: "up-to-date", installed };
|
|
266
|
+
if (!install.update)
|
|
267
|
+
return { kind: "cannot", why: `Claude Code ${latest} is out, but work doesn't know how to update this install (${file})` };
|
|
268
|
+
const tried = (io.tried ?? lastTried)();
|
|
269
|
+
if (tried && tried.version === latest && now - tried.at < RETRY_SAME_MS) return { kind: "waiting", installed, latest };
|
|
270
|
+
(io.noteTried ?? noteTried)(latest, now);
|
|
271
|
+
const r = await io.run(install.update.cmd, install.update.args);
|
|
272
|
+
const after = await io.installed(io.find() ?? file) ?? installed;
|
|
273
|
+
if (after !== installed) return { kind: "updated", from: installed, to: after };
|
|
274
|
+
const said = r.output.trim().split("\n").slice(-3).join(" \xB7 ").slice(0, 300);
|
|
275
|
+
return {
|
|
276
|
+
kind: "not-yet",
|
|
277
|
+
installed,
|
|
278
|
+
latest,
|
|
279
|
+
why: r.ok ? `${install.update.cmd.split(/[\\/]/).pop()} found nothing newer yet${said ? ` (${said})` : ""}` : `the update failed: ${said || "no output"}`
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
var UPDATE_TIMEOUT_MS = 10 * 6e4;
|
|
283
|
+
function runUpdate(cmd, args) {
|
|
284
|
+
return new Promise((resolve) => {
|
|
285
|
+
const launch = launchFor(cmd, args);
|
|
286
|
+
if ("refused" in launch) return resolve({ ok: false, output: launch.refused });
|
|
287
|
+
let out = "";
|
|
288
|
+
let settled = false;
|
|
289
|
+
const done = (ok) => {
|
|
290
|
+
if (settled) return;
|
|
291
|
+
settled = true;
|
|
292
|
+
clearTimeout(timer);
|
|
293
|
+
resolve({ ok, output: out.slice(-4e3) });
|
|
294
|
+
};
|
|
295
|
+
const env = { ...process.env, HOMEBREW_NO_ENV_HINTS: "1", HOMEBREW_NO_INSTALL_CLEANUP: "1", NONINTERACTIVE: "1" };
|
|
296
|
+
const child = spawn_default(launch.cmd, launch.args, { cwd: os.homedir(), env, windowsHide: true, stdio: ["ignore", "pipe", "pipe"] });
|
|
297
|
+
const timer = setTimeout(() => {
|
|
298
|
+
if (child.pid) void killTreeAsync(child.pid);
|
|
299
|
+
else child.kill();
|
|
300
|
+
out += "\n(timed out)";
|
|
301
|
+
done(false);
|
|
302
|
+
}, UPDATE_TIMEOUT_MS);
|
|
303
|
+
child.stdout?.on("data", (d) => out += d.toString());
|
|
304
|
+
child.stderr?.on("data", (d) => out += d.toString());
|
|
305
|
+
child.on("error", (e) => (out += `
|
|
306
|
+
${e.message}`, done(false)));
|
|
307
|
+
child.on("close", (code) => done(code === 0));
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
function realToolUpdateIo() {
|
|
311
|
+
return {
|
|
312
|
+
find: () => {
|
|
313
|
+
const f = findOnPath("claude");
|
|
314
|
+
if (!f) return null;
|
|
315
|
+
try {
|
|
316
|
+
return fs2.realpathSync(f);
|
|
317
|
+
} catch {
|
|
318
|
+
return f;
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
installed: async (file) => {
|
|
322
|
+
const text = await runVersion(file);
|
|
323
|
+
const v = text ? parseClaudeVersion(text) : null;
|
|
324
|
+
return v ? v.join(".") : null;
|
|
325
|
+
},
|
|
326
|
+
latest: () => latestClaudeVersion(),
|
|
327
|
+
run: runUpdate
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
function updateCheckText(r) {
|
|
331
|
+
switch (r.kind) {
|
|
332
|
+
case "up-to-date":
|
|
333
|
+
return `Claude Code is up to date (${r.installed})`;
|
|
334
|
+
case "updated":
|
|
335
|
+
return `updated Claude Code ${r.from} \u2192 ${r.to}; sessions move onto it between turns`;
|
|
336
|
+
case "waiting":
|
|
337
|
+
return `Claude Code ${r.latest} is out; tried already, trying again later (this is ${r.installed})`;
|
|
338
|
+
case "not-yet":
|
|
339
|
+
return `Claude Code ${r.latest} is out, still on ${r.installed}: ${r.why}`;
|
|
340
|
+
case "cannot":
|
|
341
|
+
return r.why;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
194
344
|
|
|
195
345
|
// src/core/agents/claude/startup-question.ts
|
|
196
346
|
var YES = /^\s*[❯>]?\s*(?:1\.\s+)?Yes, (?:I trust this folder|proceed)\s*$/;
|
|
@@ -203,23 +353,23 @@ function claudeStartupQuestion(screen) {
|
|
|
203
353
|
}
|
|
204
354
|
|
|
205
355
|
// src/core/agents/claude/temp-folders.ts
|
|
356
|
+
import fs4 from "fs";
|
|
357
|
+
import os3 from "os";
|
|
358
|
+
import path4 from "path";
|
|
359
|
+
|
|
360
|
+
// src/core/agents/claude/activity.ts
|
|
206
361
|
import fs3 from "fs";
|
|
207
362
|
import os2 from "os";
|
|
208
363
|
import path3 from "path";
|
|
209
|
-
|
|
210
|
-
// src/core/agents/claude/activity.ts
|
|
211
|
-
import fs2 from "fs";
|
|
212
|
-
import os from "os";
|
|
213
|
-
import path2 from "path";
|
|
214
364
|
function encodeProjectDir(p) {
|
|
215
|
-
return
|
|
365
|
+
return path3.resolve(p).replace(/[^A-Za-z0-9]/g, "-");
|
|
216
366
|
}
|
|
217
367
|
var listings = /* @__PURE__ */ new Map();
|
|
218
368
|
var NAMES_MAX_AGE_MS = 2e3;
|
|
219
369
|
function projectTranscripts(projectDir, now = Date.now()) {
|
|
220
370
|
let dirMtimeMs;
|
|
221
371
|
try {
|
|
222
|
-
dirMtimeMs =
|
|
372
|
+
dirMtimeMs = fs3.statSync(projectDir).mtimeMs;
|
|
223
373
|
} catch {
|
|
224
374
|
listings.delete(projectDir);
|
|
225
375
|
return [];
|
|
@@ -228,7 +378,7 @@ function projectTranscripts(projectDir, now = Date.now()) {
|
|
|
228
378
|
if (!hit || hit.dirMtimeMs !== dirMtimeMs || now - hit.at >= NAMES_MAX_AGE_MS) {
|
|
229
379
|
let names = [];
|
|
230
380
|
try {
|
|
231
|
-
names =
|
|
381
|
+
names = fs3.readdirSync(projectDir).filter((n) => n.endsWith(".jsonl"));
|
|
232
382
|
} catch {
|
|
233
383
|
}
|
|
234
384
|
hit = { at: now, dirMtimeMs, names };
|
|
@@ -237,8 +387,8 @@ function projectTranscripts(projectDir, now = Date.now()) {
|
|
|
237
387
|
const files = [];
|
|
238
388
|
for (const name of hit.names) {
|
|
239
389
|
try {
|
|
240
|
-
const file =
|
|
241
|
-
const st =
|
|
390
|
+
const file = path3.join(projectDir, name);
|
|
391
|
+
const st = fs3.statSync(file);
|
|
242
392
|
files.push({ file, mtimeMs: st.mtimeMs, size: st.size });
|
|
243
393
|
} catch {
|
|
244
394
|
}
|
|
@@ -251,7 +401,7 @@ function latestJsonlMtimeMs(projectDir) {
|
|
|
251
401
|
return latest;
|
|
252
402
|
}
|
|
253
403
|
function projectsRootOf(configDir) {
|
|
254
|
-
return
|
|
404
|
+
return path3.join(configDir || path3.join(os2.homedir(), ".claude"), "projects");
|
|
255
405
|
}
|
|
256
406
|
function claudeProjectsRoots(first) {
|
|
257
407
|
const accounts = claudeAccounts();
|
|
@@ -260,28 +410,28 @@ function claudeProjectsRoots(first) {
|
|
|
260
410
|
const out = [];
|
|
261
411
|
for (const a of ordered) {
|
|
262
412
|
const root = projectsRootOf(a.dir);
|
|
263
|
-
const key2 =
|
|
413
|
+
const key2 = path3.resolve(root);
|
|
264
414
|
if (seen.has(key2)) continue;
|
|
265
415
|
seen.add(key2);
|
|
266
416
|
out.push(root);
|
|
267
417
|
}
|
|
268
418
|
return out;
|
|
269
419
|
}
|
|
270
|
-
var activityIn = (launchPath, configDir) => latestJsonlMtimeMs(
|
|
420
|
+
var activityIn = (launchPath, configDir) => latestJsonlMtimeMs(path3.join(projectsRootOf(configDir), encodeProjectDir(launchPath)));
|
|
271
421
|
function getClaudeActivityMs(launchPath, configDir) {
|
|
272
422
|
if (configDir) return activityIn(launchPath, configDir);
|
|
273
423
|
let latest = 0;
|
|
274
|
-
for (const root of claudeProjectsRoots()) latest = Math.max(latest, latestJsonlMtimeMs(
|
|
424
|
+
for (const root of claudeProjectsRoots()) latest = Math.max(latest, latestJsonlMtimeMs(path3.join(root, encodeProjectDir(launchPath))));
|
|
275
425
|
return latest;
|
|
276
426
|
}
|
|
277
427
|
function hasClaudeConversation(dir, configDir) {
|
|
278
428
|
return activityIn(dir, configDir) > 0;
|
|
279
429
|
}
|
|
280
430
|
function sessionRunFolders(session, existing = true) {
|
|
281
|
-
const paths = existing ? session.paths.filter((p) =>
|
|
431
|
+
const paths = existing ? session.paths.filter((p) => fs3.existsSync(p)) : session.paths;
|
|
282
432
|
const out = /* @__PURE__ */ new Set();
|
|
283
433
|
if (session.isGroup) {
|
|
284
|
-
for (const p of paths) out.add(
|
|
434
|
+
for (const p of paths) out.add(path3.dirname(p));
|
|
285
435
|
for (const p of paths) out.add(p);
|
|
286
436
|
} else {
|
|
287
437
|
for (const p of paths) out.add(p);
|
|
@@ -289,9 +439,9 @@ function sessionRunFolders(session, existing = true) {
|
|
|
289
439
|
return [...out];
|
|
290
440
|
}
|
|
291
441
|
function resolveResumeLaunch(session) {
|
|
292
|
-
const existing = session.paths.filter((p) =>
|
|
442
|
+
const existing = session.paths.filter((p) => fs3.existsSync(p));
|
|
293
443
|
const first = existing[0] ?? session.paths[0];
|
|
294
|
-
const defaultPath = session.isGroup ?
|
|
444
|
+
const defaultPath = session.isGroup ? path3.dirname(first) : first;
|
|
295
445
|
const candidates = sessionRunFolders(session);
|
|
296
446
|
const configDir = configDirEnv(sessionAccount(session)).CLAUDE_CONFIG_DIR;
|
|
297
447
|
let launchPath = defaultPath;
|
|
@@ -307,16 +457,16 @@ function resolveResumeLaunch(session) {
|
|
|
307
457
|
}
|
|
308
458
|
|
|
309
459
|
// src/core/agents/claude/temp-folders.ts
|
|
310
|
-
function claudeTempRoot(platform = process.platform, uid = typeof process.getuid === "function" ? process.getuid() : -1, tmpdir =
|
|
311
|
-
return platform === "win32" ?
|
|
460
|
+
function claudeTempRoot(platform = process.platform, uid = typeof process.getuid === "function" ? process.getuid() : -1, tmpdir = os3.tmpdir()) {
|
|
461
|
+
return platform === "win32" ? path4.win32.join(tmpdir, "claude") : `/tmp/claude-${uid}`;
|
|
312
462
|
}
|
|
313
463
|
function claudeTempFolders(session, root = claudeTempRoot()) {
|
|
314
|
-
const join = root.includes("\\") ?
|
|
464
|
+
const join = root.includes("\\") ? path4.win32.join : path4.posix.join;
|
|
315
465
|
return sessionRunFolders(session, false).map((folder) => join(root, encodeProjectDir(folder)));
|
|
316
466
|
}
|
|
317
|
-
var realIo = { realpath: (p) =>
|
|
467
|
+
var realIo = { realpath: (p) => fs4.realpathSync.native(p), lstat: (p) => fs4.lstatSync(p) };
|
|
318
468
|
function trustedTempRoot(root = claudeTempRoot(), platform = process.platform, uid = typeof process.getuid === "function" ? process.getuid() : -1, io = realIo) {
|
|
319
|
-
const p = platform === "win32" ?
|
|
469
|
+
const p = platform === "win32" ? path4.win32 : path4.posix;
|
|
320
470
|
try {
|
|
321
471
|
const real = p.join(io.realpath(p.dirname(root)), p.basename(root));
|
|
322
472
|
const st = io.lstat(real);
|
|
@@ -341,16 +491,16 @@ function sessionTempFolders(session, root = claudeTempRoot(), platform = process
|
|
|
341
491
|
}
|
|
342
492
|
|
|
343
493
|
// src/core/agents/claude/folder-trust.ts
|
|
344
|
-
import
|
|
345
|
-
import
|
|
494
|
+
import fs6 from "fs";
|
|
495
|
+
import path6 from "path";
|
|
346
496
|
|
|
347
497
|
// src/core/agents/claude/setup-copy.ts
|
|
348
|
-
import
|
|
349
|
-
import
|
|
350
|
-
import
|
|
498
|
+
import fs5 from "fs";
|
|
499
|
+
import os4 from "os";
|
|
500
|
+
import path5 from "path";
|
|
351
501
|
var TRUSTED_FOLDERS = "trusted folders";
|
|
352
|
-
function globalConfigFile(dir, home =
|
|
353
|
-
return accountDirKey(dir) === accountDirKey(
|
|
502
|
+
function globalConfigFile(dir, home = os4.homedir()) {
|
|
503
|
+
return accountDirKey(dir) === accountDirKey(path5.join(home, ".claude")) ? path5.join(home, ".claude.json") : path5.join(dir, ".claude.json");
|
|
354
504
|
}
|
|
355
505
|
var isObject = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
356
506
|
var same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
@@ -430,7 +580,7 @@ var FILES = ["CLAUDE.md", "statusline-command.sh"];
|
|
|
430
580
|
var FOLDERS = ["agents", "commands"];
|
|
431
581
|
var SETTINGS = ["settings.json", "settings.local.json"];
|
|
432
582
|
function alreadyThere(from, to, io) {
|
|
433
|
-
if (io.isDir(from)) return io.isDir(to) && io.list(from).every((name) => alreadyThere(
|
|
583
|
+
if (io.isDir(from)) return io.isDir(to) && io.list(from).every((name) => alreadyThere(path5.join(from, name), path5.join(to, name), io));
|
|
434
584
|
const a = io.read(from);
|
|
435
585
|
const b = io.read(to);
|
|
436
586
|
return !!a && !!b && a.equals(b);
|
|
@@ -440,31 +590,31 @@ function marketplaceKey(source) {
|
|
|
440
590
|
return args ? args[3].replace(/\\/g, "/").replace(/\/+$/, "").toLowerCase() : null;
|
|
441
591
|
}
|
|
442
592
|
var realSetupIo = {
|
|
443
|
-
exists: (p) =>
|
|
593
|
+
exists: (p) => fs5.existsSync(p),
|
|
444
594
|
isDir: (p) => {
|
|
445
595
|
try {
|
|
446
|
-
return
|
|
596
|
+
return fs5.statSync(p).isDirectory();
|
|
447
597
|
} catch {
|
|
448
598
|
return false;
|
|
449
599
|
}
|
|
450
600
|
},
|
|
451
601
|
list: (dir) => {
|
|
452
602
|
try {
|
|
453
|
-
return
|
|
603
|
+
return fs5.readdirSync(dir);
|
|
454
604
|
} catch {
|
|
455
605
|
return [];
|
|
456
606
|
}
|
|
457
607
|
},
|
|
458
608
|
read: (file) => {
|
|
459
609
|
try {
|
|
460
|
-
return
|
|
610
|
+
return fs5.readFileSync(file);
|
|
461
611
|
} catch {
|
|
462
612
|
return null;
|
|
463
613
|
}
|
|
464
614
|
},
|
|
465
615
|
readJson: (file) => {
|
|
466
616
|
try {
|
|
467
|
-
return JSON.parse(
|
|
617
|
+
return JSON.parse(fs5.readFileSync(file, "utf-8"));
|
|
468
618
|
} catch {
|
|
469
619
|
return null;
|
|
470
620
|
}
|
|
@@ -490,20 +640,20 @@ function withTrusted(config, folders) {
|
|
|
490
640
|
}
|
|
491
641
|
function planSetupCopy(from, to, io = realSetupIo) {
|
|
492
642
|
const items = [];
|
|
493
|
-
const there = (rel) => io.exists(
|
|
494
|
-
const differs = (rel) => !alreadyThere(
|
|
643
|
+
const there = (rel) => io.exists(path5.join(to.dir, rel));
|
|
644
|
+
const differs = (rel) => !alreadyThere(path5.join(from.dir, rel), path5.join(to.dir, rel), io);
|
|
495
645
|
for (const f of FILES)
|
|
496
|
-
if (io.exists(
|
|
646
|
+
if (io.exists(path5.join(from.dir, f)) && differs(f)) items.push({ kind: "file", name: f, does: there(f) ? "replaces" : "adds" });
|
|
497
647
|
for (const d of FOLDERS)
|
|
498
|
-
if (io.isDir(
|
|
648
|
+
if (io.isDir(path5.join(from.dir, d)) && io.list(path5.join(from.dir, d)).length && differs(d))
|
|
499
649
|
items.push({ kind: "folder", name: `${d}/`, does: there(d) ? "merges into" : "adds" });
|
|
500
|
-
for (const skill of io.list(
|
|
501
|
-
if (differs(
|
|
502
|
-
items.push({ kind: "folder", name: `skills/${skill}/`, does: there(
|
|
650
|
+
for (const skill of io.list(path5.join(from.dir, "skills")).filter((s) => s !== "synced" && io.isDir(path5.join(from.dir, "skills", s))))
|
|
651
|
+
if (differs(path5.join("skills", skill)))
|
|
652
|
+
items.push({ kind: "folder", name: `skills/${skill}/`, does: there(path5.join("skills", skill)) ? "replaces" : "adds" });
|
|
503
653
|
for (const s of SETTINGS) {
|
|
504
|
-
const source = io.readJson(
|
|
654
|
+
const source = io.readJson(path5.join(from.dir, s));
|
|
505
655
|
if (!isObject(source)) continue;
|
|
506
|
-
const target = io.readJson(
|
|
656
|
+
const target = io.readJson(path5.join(to.dir, s));
|
|
507
657
|
const have = isObject(target) ? target : {};
|
|
508
658
|
if (!same(mergeSettings(source, have), have))
|
|
509
659
|
items.push({
|
|
@@ -526,8 +676,8 @@ function planSetupCopy(from, to, io = realSetupIo) {
|
|
|
526
676
|
...remote ? { note: `needs its own sign-in on ${to.name}: /mcp \u2192 ${name} \u2192 Authenticate` } : {}
|
|
527
677
|
});
|
|
528
678
|
}
|
|
529
|
-
const markets = io.readJson(
|
|
530
|
-
const haveMarkets = io.readJson(
|
|
679
|
+
const markets = io.readJson(path5.join(from.dir, "plugins", "known_marketplaces.json"));
|
|
680
|
+
const haveMarkets = io.readJson(path5.join(to.dir, "plugins", "known_marketplaces.json"));
|
|
531
681
|
const haveSources = new Set(
|
|
532
682
|
Object.values(isObject(haveMarkets) ? haveMarkets : {}).map((m) => marketplaceKey(isObject(m) ? m.source : null)).filter((k) => k !== null)
|
|
533
683
|
);
|
|
@@ -538,8 +688,8 @@ function planSetupCopy(from, to, io = realSetupIo) {
|
|
|
538
688
|
const args = marketplaceAddArgs(isObject(m) ? m.source : null);
|
|
539
689
|
if (args) items.push({ kind: "marketplace", name, does: "adds", note: args[3] });
|
|
540
690
|
}
|
|
541
|
-
const enabled = objectAt(io.readJson(
|
|
542
|
-
const installed = objectAt(io.readJson(
|
|
691
|
+
const enabled = objectAt(io.readJson(path5.join(from.dir, "settings.json")), "enabledPlugins");
|
|
692
|
+
const installed = objectAt(io.readJson(path5.join(to.dir, "plugins", "installed_plugins.json")), "plugins");
|
|
543
693
|
for (const [id, on] of Object.entries(enabled))
|
|
544
694
|
if (on === true && !(id in installed)) items.push({ kind: "plugin", name: id, does: "adds", note: "installed from its marketplace" });
|
|
545
695
|
const trust = trustToCopy(from, to, io);
|
|
@@ -572,14 +722,14 @@ function setupEnv(dir) {
|
|
|
572
722
|
return accountDirKey(dir) === accountDirKey(defaultAccountDir()) ? { CLAUDE_CONFIG_DIR: null } : { CLAUDE_CONFIG_DIR: dir };
|
|
573
723
|
}
|
|
574
724
|
function mergeSettingsFile(fromFile, toFile) {
|
|
575
|
-
const source = JSON.parse(
|
|
725
|
+
const source = JSON.parse(fs5.readFileSync(fromFile, "utf-8"));
|
|
576
726
|
if (!isObject(source)) throw new Error("its settings are not an object");
|
|
577
|
-
|
|
727
|
+
fs5.mkdirSync(path5.dirname(toFile), { recursive: true });
|
|
578
728
|
ensureFile(toFile, "{}\n");
|
|
579
729
|
withFileLockSync(toFile, () => {
|
|
580
730
|
let target = {};
|
|
581
731
|
try {
|
|
582
|
-
target = JSON.parse(
|
|
732
|
+
target = JSON.parse(fs5.readFileSync(toFile, "utf-8"));
|
|
583
733
|
} catch {
|
|
584
734
|
}
|
|
585
735
|
atomicWriteFile(toFile, `${JSON.stringify(mergeSettings(source, isObject(target) ? target : {}), null, 2)}
|
|
@@ -587,12 +737,12 @@ function mergeSettingsFile(fromFile, toFile) {
|
|
|
587
737
|
});
|
|
588
738
|
}
|
|
589
739
|
function trustFolders(file, folders) {
|
|
590
|
-
|
|
740
|
+
fs5.mkdirSync(path5.dirname(file), { recursive: true });
|
|
591
741
|
ensureFile(file, "{}\n");
|
|
592
742
|
withFileLockSync(file, () => {
|
|
593
743
|
let config;
|
|
594
744
|
try {
|
|
595
|
-
config = JSON.parse(
|
|
745
|
+
config = JSON.parse(fs5.readFileSync(file, "utf-8"));
|
|
596
746
|
} catch {
|
|
597
747
|
throw new Error("its config file can\u2019t be read");
|
|
598
748
|
}
|
|
@@ -604,18 +754,18 @@ async function applySetupCopy(from, to, run = runClaude) {
|
|
|
604
754
|
if (accountDirKey(from.dir) === accountDirKey(to.dir)) throw new Error("an account\u2019s setup can\u2019t be copied to itself");
|
|
605
755
|
const env = setupEnv(to.dir);
|
|
606
756
|
const servers = userMcpServers(from.dir);
|
|
607
|
-
const markets = realSetupIo.readJson(
|
|
757
|
+
const markets = realSetupIo.readJson(path5.join(from.dir, "plugins", "known_marketplaces.json"));
|
|
608
758
|
const results = [];
|
|
609
759
|
for (const item of planSetupCopy(from, to)) {
|
|
610
760
|
try {
|
|
611
761
|
const rel = item.name.replace(/\/$/, "");
|
|
612
762
|
if (item.kind === "file") {
|
|
613
|
-
|
|
614
|
-
|
|
763
|
+
fs5.mkdirSync(to.dir, { recursive: true });
|
|
764
|
+
fs5.copyFileSync(path5.join(from.dir, rel), path5.join(to.dir, rel));
|
|
615
765
|
} else if (item.kind === "folder") {
|
|
616
|
-
|
|
766
|
+
fs5.cpSync(path5.join(from.dir, rel), path5.join(to.dir, rel), { recursive: true, force: true, verbatimSymlinks: true });
|
|
617
767
|
} else if (item.kind === "settings") {
|
|
618
|
-
mergeSettingsFile(
|
|
768
|
+
mergeSettingsFile(path5.join(from.dir, rel), path5.join(to.dir, rel));
|
|
619
769
|
} else if (item.kind === "mcp") {
|
|
620
770
|
if (item.does === "replaces") run(["mcp", "remove", item.name, "--scope", "user"], env);
|
|
621
771
|
const r = run(["mcp", "add-json", item.name, "-", "--scope", "user"], env, JSON.stringify(servers[item.name]));
|
|
@@ -645,14 +795,14 @@ async function applySetupCopy(from, to, run = runClaude) {
|
|
|
645
795
|
var realTrustIo = {
|
|
646
796
|
read(file) {
|
|
647
797
|
try {
|
|
648
|
-
return
|
|
798
|
+
return fs6.readFileSync(file, "utf-8");
|
|
649
799
|
} catch {
|
|
650
800
|
return null;
|
|
651
801
|
}
|
|
652
802
|
},
|
|
653
803
|
update(file, change) {
|
|
654
804
|
withFileLockSync(file, () => {
|
|
655
|
-
const next = change(
|
|
805
|
+
const next = change(fs6.readFileSync(file, "utf-8"));
|
|
656
806
|
if (next !== null) atomicWriteFile(file, next);
|
|
657
807
|
});
|
|
658
808
|
}
|
|
@@ -680,7 +830,7 @@ function trustedConfigText(text, folders) {
|
|
|
680
830
|
` : null;
|
|
681
831
|
}
|
|
682
832
|
function trustFoldersIn(configFile, folders, io = realTrustIo) {
|
|
683
|
-
const keys = [...new Set(folders.map((f) =>
|
|
833
|
+
const keys = [...new Set(folders.map((f) => path6.resolve(f)))];
|
|
684
834
|
const config = parse(io.read(configFile));
|
|
685
835
|
if (config === void 0) return [];
|
|
686
836
|
const missing = keys.filter((f) => !isTrusted(config, f));
|
|
@@ -708,19 +858,19 @@ function claudeToolShell(command) {
|
|
|
708
858
|
}
|
|
709
859
|
|
|
710
860
|
// src/core/agents/claude/adapter.ts
|
|
711
|
-
import
|
|
861
|
+
import path15 from "path";
|
|
712
862
|
|
|
713
863
|
// src/core/agents/claude/files.ts
|
|
714
|
-
import
|
|
715
|
-
import
|
|
864
|
+
import fs7 from "fs";
|
|
865
|
+
import path7 from "path";
|
|
716
866
|
function listTranscripts(session) {
|
|
717
|
-
const dirs = session.isGroup ? [...new Set(session.paths.map((p) =>
|
|
867
|
+
const dirs = session.isGroup ? [...new Set(session.paths.map((p) => path7.dirname(p)))] : session.paths;
|
|
718
868
|
const roots = claudeProjectsRoots(sessionAccount(session));
|
|
719
869
|
const seen = /* @__PURE__ */ new Set();
|
|
720
870
|
const out = [];
|
|
721
871
|
for (const d of dirs)
|
|
722
872
|
for (const root of roots)
|
|
723
|
-
for (const f of projectTranscripts(
|
|
873
|
+
for (const f of projectTranscripts(path7.join(root, encodeProjectDir(d)))) {
|
|
724
874
|
if (seen.has(f.file)) continue;
|
|
725
875
|
seen.add(f.file);
|
|
726
876
|
out.push(f);
|
|
@@ -731,18 +881,18 @@ function listUsageFiles(session) {
|
|
|
731
881
|
const out = [];
|
|
732
882
|
for (const t of listTranscripts(session)) {
|
|
733
883
|
out.push(t);
|
|
734
|
-
const dir =
|
|
884
|
+
const dir = path7.join(t.file.replace(/\.jsonl$/, ""), "subagents");
|
|
735
885
|
let names;
|
|
736
886
|
try {
|
|
737
|
-
names =
|
|
887
|
+
names = fs7.readdirSync(dir);
|
|
738
888
|
} catch {
|
|
739
889
|
continue;
|
|
740
890
|
}
|
|
741
891
|
for (const name of names) {
|
|
742
892
|
if (!name.startsWith("agent-") || !name.endsWith(".jsonl")) continue;
|
|
743
|
-
const file =
|
|
893
|
+
const file = path7.join(dir, name);
|
|
744
894
|
try {
|
|
745
|
-
const st =
|
|
895
|
+
const st = fs7.statSync(file);
|
|
746
896
|
out.push({ file, mtimeMs: st.mtimeMs, size: st.size });
|
|
747
897
|
} catch {
|
|
748
898
|
}
|
|
@@ -770,23 +920,23 @@ function whatOf(meta) {
|
|
|
770
920
|
function lookForBackgroundWork(session, sinceMs, afterMs, quietFrom = afterMs) {
|
|
771
921
|
for (const t of listTranscripts(session)) {
|
|
772
922
|
if (t.mtimeMs < sinceMs - AROUND_TURN_MS) continue;
|
|
773
|
-
const dir =
|
|
923
|
+
const dir = path7.join(t.file.replace(/\.jsonl$/, ""), "subagents");
|
|
774
924
|
let names;
|
|
775
925
|
try {
|
|
776
|
-
names =
|
|
926
|
+
names = fs7.readdirSync(dir);
|
|
777
927
|
} catch {
|
|
778
928
|
continue;
|
|
779
929
|
}
|
|
780
930
|
for (const name of names) {
|
|
781
931
|
if (!name.endsWith(".jsonl")) continue;
|
|
782
|
-
const file =
|
|
932
|
+
const file = path7.join(dir, name);
|
|
783
933
|
try {
|
|
784
|
-
const written =
|
|
934
|
+
const written = fs7.statSync(file).mtimeMs;
|
|
785
935
|
if (written <= quietFrom) continue;
|
|
786
936
|
const metaFile = file.replace(/\.jsonl$/, ".meta.json");
|
|
787
|
-
const startedForTurn =
|
|
937
|
+
const startedForTurn = fs7.statSync(metaFile).mtimeMs >= sinceMs - AROUND_TURN_MS;
|
|
788
938
|
if (written <= afterMs && !startedForTurn) continue;
|
|
789
|
-
const meta = JSON.parse(
|
|
939
|
+
const meta = JSON.parse(fs7.readFileSync(metaFile, "utf8"));
|
|
790
940
|
if (meta && typeof meta === "object" && meta.requestShape === "background")
|
|
791
941
|
return { what: whatOf(meta) };
|
|
792
942
|
} catch {
|
|
@@ -797,7 +947,7 @@ function lookForBackgroundWork(session, sinceMs, afterMs, quietFrom = afterMs) {
|
|
|
797
947
|
}
|
|
798
948
|
|
|
799
949
|
// src/core/conversations/jsonl.ts
|
|
800
|
-
import
|
|
950
|
+
import fs8 from "fs";
|
|
801
951
|
var TAIL_BYTES = 256 * 1024;
|
|
802
952
|
function parseLines(text) {
|
|
803
953
|
const out = [];
|
|
@@ -816,15 +966,15 @@ function readJsonlTail(transcriptPath, bytes = TAIL_BYTES) {
|
|
|
816
966
|
if (!transcriptPath) return [];
|
|
817
967
|
let text;
|
|
818
968
|
try {
|
|
819
|
-
const fd =
|
|
969
|
+
const fd = fs8.openSync(transcriptPath, "r");
|
|
820
970
|
try {
|
|
821
|
-
const size =
|
|
971
|
+
const size = fs8.fstatSync(fd).size;
|
|
822
972
|
const start = Math.max(0, size - bytes);
|
|
823
973
|
const buf = Buffer.alloc(size - start);
|
|
824
|
-
|
|
974
|
+
fs8.readSync(fd, buf, 0, buf.length, start);
|
|
825
975
|
text = buf.toString("utf-8");
|
|
826
976
|
} finally {
|
|
827
|
-
|
|
977
|
+
fs8.closeSync(fd);
|
|
828
978
|
}
|
|
829
979
|
} catch {
|
|
830
980
|
return [];
|
|
@@ -838,7 +988,7 @@ async function readJsonlSince(transcriptPath, sinceMs, timeOf, opts = {}) {
|
|
|
838
988
|
const max = Math.max(chunk, opts.maxBytes ?? SINCE_MAX_BYTES);
|
|
839
989
|
let fh;
|
|
840
990
|
try {
|
|
841
|
-
fh = await
|
|
991
|
+
fh = await fs8.promises.open(transcriptPath, "r");
|
|
842
992
|
} catch {
|
|
843
993
|
return { lines: [], partial: false };
|
|
844
994
|
}
|
|
@@ -1053,10 +1203,10 @@ function claudeContextWindow(model, used) {
|
|
|
1053
1203
|
}
|
|
1054
1204
|
|
|
1055
1205
|
// src/core/agents/claude/hooks.ts
|
|
1056
|
-
import
|
|
1206
|
+
import path9 from "path";
|
|
1057
1207
|
|
|
1058
1208
|
// src/core/agents/claude/permission.ts
|
|
1059
|
-
import
|
|
1209
|
+
import path8 from "path";
|
|
1060
1210
|
function pendingToolUse(entries) {
|
|
1061
1211
|
const answered = /* @__PURE__ */ new Set();
|
|
1062
1212
|
for (const e of entries) {
|
|
@@ -1087,7 +1237,7 @@ var YES_SELECTED_RE = /❯\s*1\.\s*Yes\b/;
|
|
|
1087
1237
|
var squash = (s) => s.replace(/[\s\u2500-\u257f]+/g, "");
|
|
1088
1238
|
function screenAnchor(req) {
|
|
1089
1239
|
if (req.tool === "Bash" || req.tool === "PowerShell") return squash(req.detail.split(" \u23CE ")[0]).slice(0, 40);
|
|
1090
|
-
if (/[\\/]/.test(req.detail) && !/^https?:/.test(req.detail)) return
|
|
1240
|
+
if (/[\\/]/.test(req.detail) && !/^https?:/.test(req.detail)) return path8.basename(req.detail.replace(/\\/g, "/"));
|
|
1091
1241
|
return "";
|
|
1092
1242
|
}
|
|
1093
1243
|
function checkDialog(screen, req) {
|
|
@@ -1147,7 +1297,7 @@ function claudeStatusEvent(edge, payload) {
|
|
|
1147
1297
|
}
|
|
1148
1298
|
}
|
|
1149
1299
|
var toClaude = (h) => ({ owner: h.owner, event: CLAUDE_EVENT[h.edge] });
|
|
1150
|
-
var settingsFiles = () => setUpAccounts().map((a) =>
|
|
1300
|
+
var settingsFiles = () => setUpAccounts().map((a) => path9.join(a.dir, "settings.json"));
|
|
1151
1301
|
var claudeEvents = {
|
|
1152
1302
|
removeInstalled: async (hooks) => {
|
|
1153
1303
|
const inst = await loadInstaller();
|
|
@@ -1174,11 +1324,11 @@ var claudeEvents = {
|
|
|
1174
1324
|
};
|
|
1175
1325
|
|
|
1176
1326
|
// src/core/agents/claude/session-settings.ts
|
|
1177
|
-
import
|
|
1178
|
-
import
|
|
1327
|
+
import fs9 from "fs";
|
|
1328
|
+
import path10 from "path";
|
|
1179
1329
|
var SESSION_SETTINGS_NAME = "claude-settings.json";
|
|
1180
1330
|
var SESSION_ALLOW = ["Bash(work child:*)", "Bash(work report:*)"];
|
|
1181
|
-
var sessionSettingsPath = () =>
|
|
1331
|
+
var sessionSettingsPath = () => path10.join(getConfigDir(), SESSION_SETTINGS_NAME);
|
|
1182
1332
|
function claudeSessionSettings(o) {
|
|
1183
1333
|
const hooks = {};
|
|
1184
1334
|
for (const h of SESSION_HOOKS) {
|
|
@@ -1206,19 +1356,19 @@ function writeSessionSettings(o = {}) {
|
|
|
1206
1356
|
const text = JSON.stringify(claudeSessionSettings({ statusLine, invocation: o.invocation }), null, 2) + "\n";
|
|
1207
1357
|
let now = null;
|
|
1208
1358
|
try {
|
|
1209
|
-
now =
|
|
1359
|
+
now = fs9.readFileSync(file, "utf-8");
|
|
1210
1360
|
} catch {
|
|
1211
1361
|
}
|
|
1212
1362
|
if (now !== text) {
|
|
1213
|
-
|
|
1363
|
+
fs9.mkdirSync(path10.dirname(file), { recursive: true });
|
|
1214
1364
|
atomicWriteFile(file, text);
|
|
1215
1365
|
}
|
|
1216
1366
|
return file;
|
|
1217
1367
|
}
|
|
1218
|
-
var isOurs = (p) => !!p &&
|
|
1368
|
+
var isOurs = (p) => !!p && path10.basename(p) === SESSION_SETTINGS_NAME;
|
|
1219
1369
|
function sessionSettingsFile(o = {}) {
|
|
1220
1370
|
const file = sessionSettingsPath();
|
|
1221
|
-
return o.write === false &&
|
|
1371
|
+
return o.write === false && fs9.existsSync(file) ? file : writeSessionSettings();
|
|
1222
1372
|
}
|
|
1223
1373
|
var startedWithSessionSettings = (commandLine) => commandLine.includes(SESSION_SETTINGS_NAME);
|
|
1224
1374
|
function withSessionSettings(tool, file = sessionSettingsFile()) {
|
|
@@ -1234,9 +1384,9 @@ function withSessionSettings(tool, file = sessionSettingsFile()) {
|
|
|
1234
1384
|
}
|
|
1235
1385
|
|
|
1236
1386
|
// src/core/agents/claude/live.ts
|
|
1237
|
-
import
|
|
1238
|
-
import
|
|
1239
|
-
import
|
|
1387
|
+
import fs10 from "fs";
|
|
1388
|
+
import os5 from "os";
|
|
1389
|
+
import path11 from "path";
|
|
1240
1390
|
var isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
1241
1391
|
function parseLiveClaude(raw) {
|
|
1242
1392
|
if (!isObj(raw)) return null;
|
|
@@ -1266,24 +1416,24 @@ function aliveOnly(list, table, bootMs) {
|
|
|
1266
1416
|
var TTL_MS = 5e3;
|
|
1267
1417
|
var cache = null;
|
|
1268
1418
|
function claudeSessionsDir() {
|
|
1269
|
-
return
|
|
1419
|
+
return path11.join(process.env.CLAUDE_CONFIG_DIR || path11.join(os5.homedir(), ".claude"), "sessions");
|
|
1270
1420
|
}
|
|
1271
1421
|
function claudeSessionsDirs() {
|
|
1272
1422
|
const accounts = claudeAccounts();
|
|
1273
1423
|
if (accounts.length <= 1) return [claudeSessionsDir()];
|
|
1274
|
-
return [...new Set(accounts.map((a) =>
|
|
1424
|
+
return [...new Set(accounts.map((a) => path11.join(a.dir, "sessions")))];
|
|
1275
1425
|
}
|
|
1276
1426
|
function readDir(dir, table) {
|
|
1277
1427
|
let names;
|
|
1278
1428
|
try {
|
|
1279
|
-
names =
|
|
1429
|
+
names = fs10.readdirSync(dir).filter((n) => /^\d+\.json$/.test(n));
|
|
1280
1430
|
} catch {
|
|
1281
1431
|
return [];
|
|
1282
1432
|
}
|
|
1283
1433
|
const parsed = [];
|
|
1284
1434
|
for (const n of names) {
|
|
1285
1435
|
try {
|
|
1286
|
-
const c = parseLiveClaude(JSON.parse(
|
|
1436
|
+
const c = parseLiveClaude(JSON.parse(fs10.readFileSync(path11.join(dir, n), "utf8")));
|
|
1287
1437
|
if (c) parsed.push(c);
|
|
1288
1438
|
} catch {
|
|
1289
1439
|
}
|
|
@@ -1311,12 +1461,12 @@ var typeThenEnter = async (write, text, wait = (ms) => new Promise((r) => setTim
|
|
|
1311
1461
|
};
|
|
1312
1462
|
|
|
1313
1463
|
// src/core/agents/claude/workspace.ts
|
|
1314
|
-
import
|
|
1315
|
-
import
|
|
1464
|
+
import fs11 from "fs";
|
|
1465
|
+
import path12 from "path";
|
|
1316
1466
|
var claudeAllowRule = (r) => `Bash(${r.command}${r.prefix ? ":*" : ""})`;
|
|
1317
1467
|
var claudeWorkspace = {
|
|
1318
1468
|
write(dir, { allow, hooks }) {
|
|
1319
|
-
|
|
1469
|
+
fs11.mkdirSync(path12.join(dir, ".claude"), { recursive: true });
|
|
1320
1470
|
const byEvent = {};
|
|
1321
1471
|
for (const h of hooks) {
|
|
1322
1472
|
(byEvent[CLAUDE_EVENT[h.edge]] ??= []).push({
|
|
@@ -1324,8 +1474,8 @@ var claudeWorkspace = {
|
|
|
1324
1474
|
});
|
|
1325
1475
|
}
|
|
1326
1476
|
const settings = { permissions: { allow: allow.map(claudeAllowRule) }, hooks: byEvent };
|
|
1327
|
-
atomicWriteFile(
|
|
1328
|
-
return [
|
|
1477
|
+
atomicWriteFile(path12.join(dir, ".claude", "settings.json"), JSON.stringify(settings, null, 2) + "\n");
|
|
1478
|
+
return [path12.join(".claude", "settings.json")];
|
|
1329
1479
|
}
|
|
1330
1480
|
};
|
|
1331
1481
|
|
|
@@ -1333,6 +1483,20 @@ var claudeWorkspace = {
|
|
|
1333
1483
|
var MARKETPLACE_REPO = "moberghr/moberg-plugins";
|
|
1334
1484
|
var MARKETPLACE_NAME = "moberg-plugins";
|
|
1335
1485
|
var PLUGIN_SPEC = "work-tree@moberg-plugins";
|
|
1486
|
+
var DEFAULT_EXTRA_PLUGINS = ["mtk"];
|
|
1487
|
+
var PLUGIN_NAME_PATTERN = "^[a-z0-9][a-z0-9-]*$";
|
|
1488
|
+
var configuredSpecs = configView((raw) => pluginSpecs(raw));
|
|
1489
|
+
function pluginSpecs(config) {
|
|
1490
|
+
const raw = config?.claudePlugins;
|
|
1491
|
+
const names = Array.isArray(raw) ? raw.filter((n) => typeof n === "string") : [...DEFAULT_EXTRA_PLUGINS];
|
|
1492
|
+
const ok = new RegExp(PLUGIN_NAME_PATTERN);
|
|
1493
|
+
return [
|
|
1494
|
+
.../* @__PURE__ */ new Set([
|
|
1495
|
+
PLUGIN_SPEC,
|
|
1496
|
+
...names.map((n) => n.trim()).filter((n) => ok.test(n) && n !== "work-tree").map((n) => `${n}@${MARKETPLACE_NAME}`)
|
|
1497
|
+
])
|
|
1498
|
+
];
|
|
1499
|
+
}
|
|
1336
1500
|
var runClaude2 = (args, env) => {
|
|
1337
1501
|
const r = spawn_default.sync("claude", args, {
|
|
1338
1502
|
encoding: "utf8",
|
|
@@ -1346,15 +1510,15 @@ var runClaude2 = (args, env) => {
|
|
|
1346
1510
|
};
|
|
1347
1511
|
var lastLine2 = (r) => `${r.stderr ?? ""}
|
|
1348
1512
|
${r.stdout}`.split("\n").map((l) => l.trim()).filter(Boolean).pop() ?? "";
|
|
1349
|
-
function isInstalled(listJson) {
|
|
1513
|
+
function isInstalled(listJson, spec = PLUGIN_SPEC) {
|
|
1350
1514
|
try {
|
|
1351
1515
|
const list = JSON.parse(listJson);
|
|
1352
|
-
return Array.isArray(list) && list.some((p) => !!p && typeof p === "object" && p.id ===
|
|
1516
|
+
return Array.isArray(list) && list.some((p) => !!p && typeof p === "object" && p.id === spec);
|
|
1353
1517
|
} catch {
|
|
1354
1518
|
return false;
|
|
1355
1519
|
}
|
|
1356
1520
|
}
|
|
1357
|
-
function installFor(run) {
|
|
1521
|
+
function installFor(run, specs = [PLUGIN_SPEC]) {
|
|
1358
1522
|
if (!run(["--version"]).ok) return { ok: false, message: "Claude Code (the `claude` CLI) is not installed" };
|
|
1359
1523
|
const list = run(["plugin", "marketplace", "list"]);
|
|
1360
1524
|
if (!(list.ok && list.stdout.includes(MARKETPLACE_NAME))) {
|
|
@@ -1364,25 +1528,39 @@ function installFor(run) {
|
|
|
1364
1528
|
ok: false,
|
|
1365
1529
|
message: `could not register the Claude Code plugin marketplace (run \`claude plugin marketplace add ${MARKETPLACE_REPO}\`)`
|
|
1366
1530
|
};
|
|
1531
|
+
} else if (specs.length > 1) run(["plugin", "marketplace", "update", MARKETPLACE_NAME]);
|
|
1532
|
+
const said = [];
|
|
1533
|
+
const failed = [];
|
|
1534
|
+
let listed = null;
|
|
1535
|
+
for (const spec of specs) {
|
|
1536
|
+
const install = run(["plugin", "install", spec, "--scope", "user"]);
|
|
1537
|
+
if (install.ok) {
|
|
1538
|
+
if (spec !== PLUGIN_SPEC) run(["plugin", "update", spec]);
|
|
1539
|
+
said.push(`installed the Claude Code plugin ${spec}`);
|
|
1540
|
+
continue;
|
|
1541
|
+
}
|
|
1542
|
+
listed ??= run(["plugin", "list", "--json"]).stdout;
|
|
1543
|
+
if (isInstalled(listed, spec)) {
|
|
1544
|
+
if (spec !== PLUGIN_SPEC) run(["plugin", "update", spec]);
|
|
1545
|
+
said.push(`the Claude Code plugin ${spec} is installed`);
|
|
1546
|
+
continue;
|
|
1547
|
+
}
|
|
1548
|
+
const why = lastLine2(install);
|
|
1549
|
+
failed.push(
|
|
1550
|
+
`could not install the Claude Code plugin ${spec}${why ? ` (${why})` : ""}: run \`claude plugin install ${spec} --scope user\``
|
|
1551
|
+
);
|
|
1367
1552
|
}
|
|
1368
|
-
|
|
1369
|
-
if (install.ok) return { ok: true, message: `installed the Claude Code plugin ${PLUGIN_SPEC}` };
|
|
1370
|
-
if (isInstalled(run(["plugin", "list", "--json"]).stdout))
|
|
1371
|
-
return { ok: true, message: `the Claude Code plugin ${PLUGIN_SPEC} is installed` };
|
|
1372
|
-
const why = lastLine2(install);
|
|
1373
|
-
return {
|
|
1374
|
-
ok: false,
|
|
1375
|
-
message: `could not install the Claude Code plugin${why ? ` (${why})` : ""}: run \`claude plugin install ${PLUGIN_SPEC} --scope user\``
|
|
1376
|
-
};
|
|
1553
|
+
return failed.length ? { ok: false, message: [...failed, ...said].join("; ") } : { ok: true, message: said.join("; ") };
|
|
1377
1554
|
}
|
|
1378
|
-
function claudeSkillsWith(run, accounts = setUpAccounts) {
|
|
1555
|
+
function claudeSkillsWith(run, accounts = setUpAccounts, specs = configuredSpecs) {
|
|
1379
1556
|
return {
|
|
1380
1557
|
async install() {
|
|
1381
1558
|
const list = accounts();
|
|
1382
|
-
|
|
1559
|
+
const all = specs();
|
|
1560
|
+
if (list.length <= 1) return installFor((args) => run(args), all);
|
|
1383
1561
|
const results = list.map((a) => {
|
|
1384
1562
|
const env = a.name === "default" ? { CLAUDE_CONFIG_DIR: null } : { CLAUDE_CONFIG_DIR: a.dir };
|
|
1385
|
-
return { name: a.name, ...installFor((args) => run(args, env)) };
|
|
1563
|
+
return { name: a.name, ...installFor((args) => run(args, env), all) };
|
|
1386
1564
|
});
|
|
1387
1565
|
return { ok: results.every((r) => r.ok), message: results.map((r) => `${r.name}: ${r.message}`).join("; ") };
|
|
1388
1566
|
}
|
|
@@ -1390,14 +1568,14 @@ function claudeSkillsWith(run, accounts = setUpAccounts) {
|
|
|
1390
1568
|
}
|
|
1391
1569
|
var claudeSkills = claudeSkillsWith(runClaude2);
|
|
1392
1570
|
function installClaudeSkillsFor(dir, run = runClaude2) {
|
|
1393
|
-
return installFor((args) => run(args, { CLAUDE_CONFIG_DIR: dir }));
|
|
1571
|
+
return installFor((args) => run(args, { CLAUDE_CONFIG_DIR: dir }), configuredSpecs());
|
|
1394
1572
|
}
|
|
1395
1573
|
|
|
1396
1574
|
// src/core/agents/claude/usage.ts
|
|
1397
1575
|
var installer2;
|
|
1398
|
-
var loadInstaller2 = async () => installer2 ??= await import("./statusline-
|
|
1576
|
+
var loadInstaller2 = async () => installer2 ??= await import("./statusline-SZPL3QBC.js");
|
|
1399
1577
|
var asker;
|
|
1400
|
-
var loadAsker = async () => asker ??= await import("./usage-ask-
|
|
1578
|
+
var loadAsker = async () => asker ??= await import("./usage-ask-QBLLIHE3.js");
|
|
1401
1579
|
function restoreMessage(o, saved = "~/.work/statusline.json") {
|
|
1402
1580
|
switch (o) {
|
|
1403
1581
|
case "restored":
|
|
@@ -1446,18 +1624,18 @@ var claudeUsage = {
|
|
|
1446
1624
|
};
|
|
1447
1625
|
|
|
1448
1626
|
// src/core/agents/claude/account-move.ts
|
|
1449
|
-
import
|
|
1450
|
-
import
|
|
1627
|
+
import fs13 from "fs";
|
|
1628
|
+
import path14 from "path";
|
|
1451
1629
|
|
|
1452
1630
|
// src/core/agents/claude/account-admin.ts
|
|
1453
|
-
import
|
|
1454
|
-
import
|
|
1455
|
-
import
|
|
1631
|
+
import fs12 from "fs";
|
|
1632
|
+
import os6 from "os";
|
|
1633
|
+
import path13 from "path";
|
|
1456
1634
|
async function editConfig(fn) {
|
|
1457
1635
|
const file = getConfigPath();
|
|
1458
|
-
if (!
|
|
1636
|
+
if (!fs12.existsSync(file)) throw new AccountAdminError("No configuration yet: run `work init` first.");
|
|
1459
1637
|
return withFileLock(file, () => {
|
|
1460
|
-
const raw = JSON.parse(
|
|
1638
|
+
const raw = JSON.parse(fs12.readFileSync(file, "utf-8"));
|
|
1461
1639
|
const existing = raw.claudeAccounts;
|
|
1462
1640
|
const accounts = existing && typeof existing === "object" && !Array.isArray(existing) ? { ...existing } : {};
|
|
1463
1641
|
const out = fn(raw, accounts);
|
|
@@ -1469,14 +1647,14 @@ async function editConfig(fn) {
|
|
|
1469
1647
|
}
|
|
1470
1648
|
var validIn = (raw) => validateClaudeAccounts(raw.claudeAccounts, void 0, accountForbiddenRoots(raw)).accounts ?? {};
|
|
1471
1649
|
async function addAccount(name, dir) {
|
|
1472
|
-
const folder = expandAccountDir(dir?.trim() ||
|
|
1650
|
+
const folder = expandAccountDir(dir?.trim() || path13.join(os6.homedir(), `.claude-${name}`));
|
|
1473
1651
|
if (!folder) throw new AccountAdminError(`${dir} is not an absolute folder`);
|
|
1474
1652
|
return editConfig((raw, accounts) => {
|
|
1475
1653
|
if (name in accounts) throw new AccountAdminError(`there is already an account \u201C${name}\u201D`);
|
|
1476
1654
|
const problem = accountProblem(name, folder, Object.values(validIn(raw)), accountForbiddenRoots(raw));
|
|
1477
1655
|
if (problem) throw new AccountAdminError(problem);
|
|
1478
1656
|
try {
|
|
1479
|
-
|
|
1657
|
+
fs12.mkdirSync(folder, { recursive: true });
|
|
1480
1658
|
} catch (e) {
|
|
1481
1659
|
throw new AccountAdminError(`couldn't make ${folder}: ${e instanceof Error ? e.message : String(e)}`);
|
|
1482
1660
|
}
|
|
@@ -1553,14 +1731,14 @@ var AccountMoveError = class extends Error {
|
|
|
1553
1731
|
};
|
|
1554
1732
|
var isDir = (p) => {
|
|
1555
1733
|
try {
|
|
1556
|
-
return
|
|
1734
|
+
return fs13.statSync(p).isDirectory();
|
|
1557
1735
|
} catch {
|
|
1558
1736
|
return false;
|
|
1559
1737
|
}
|
|
1560
1738
|
};
|
|
1561
1739
|
var exists = (p) => {
|
|
1562
1740
|
try {
|
|
1563
|
-
|
|
1741
|
+
fs13.lstatSync(p);
|
|
1564
1742
|
return true;
|
|
1565
1743
|
} catch {
|
|
1566
1744
|
return false;
|
|
@@ -1568,31 +1746,31 @@ var exists = (p) => {
|
|
|
1568
1746
|
};
|
|
1569
1747
|
var mtime = (p) => {
|
|
1570
1748
|
try {
|
|
1571
|
-
return
|
|
1749
|
+
return fs13.statSync(p).mtimeMs;
|
|
1572
1750
|
} catch {
|
|
1573
1751
|
return 0;
|
|
1574
1752
|
}
|
|
1575
1753
|
};
|
|
1576
1754
|
function moveEntry(from, to) {
|
|
1577
|
-
|
|
1755
|
+
fs13.mkdirSync(path14.dirname(to), { recursive: true });
|
|
1578
1756
|
try {
|
|
1579
|
-
|
|
1757
|
+
fs13.renameSync(from, to);
|
|
1580
1758
|
return;
|
|
1581
1759
|
} catch (err) {
|
|
1582
1760
|
const code = err.code;
|
|
1583
1761
|
if (code !== "EXDEV" && code !== "EPERM") throw err;
|
|
1584
1762
|
}
|
|
1585
1763
|
try {
|
|
1586
|
-
|
|
1764
|
+
fs13.cpSync(from, to, { recursive: true, errorOnExist: true, force: false, preserveTimestamps: true });
|
|
1587
1765
|
} catch (err) {
|
|
1588
|
-
|
|
1766
|
+
fs13.rmSync(to, { recursive: true, force: true });
|
|
1589
1767
|
throw err;
|
|
1590
1768
|
}
|
|
1591
1769
|
try {
|
|
1592
|
-
|
|
1770
|
+
fs13.rmSync(from, { recursive: true, force: true });
|
|
1593
1771
|
} catch (err) {
|
|
1594
1772
|
try {
|
|
1595
|
-
|
|
1773
|
+
fs13.cpSync(to, from, { recursive: true, force: false, errorOnExist: false, preserveTimestamps: true });
|
|
1596
1774
|
} catch (back) {
|
|
1597
1775
|
const why = (e) => e instanceof Error ? e.message : String(e);
|
|
1598
1776
|
throw new Error(`${why(err)}; what its delete took couldn't be put back (${why(back)}), so it is kept at ${to} too`, {
|
|
@@ -1600,7 +1778,7 @@ function moveEntry(from, to) {
|
|
|
1600
1778
|
});
|
|
1601
1779
|
}
|
|
1602
1780
|
try {
|
|
1603
|
-
|
|
1781
|
+
fs13.rmSync(to, { recursive: true, force: true });
|
|
1604
1782
|
} catch {
|
|
1605
1783
|
}
|
|
1606
1784
|
throw err;
|
|
@@ -1619,9 +1797,9 @@ function mergeInto(src, dst, tag, steps, moved) {
|
|
|
1619
1797
|
return;
|
|
1620
1798
|
}
|
|
1621
1799
|
if (isDir(src) && isDir(dst)) {
|
|
1622
|
-
for (const name of
|
|
1800
|
+
for (const name of fs13.readdirSync(src)) mergeInto(path14.join(src, name), path14.join(dst, name), tag, steps, moved);
|
|
1623
1801
|
try {
|
|
1624
|
-
|
|
1802
|
+
fs13.rmdirSync(src);
|
|
1625
1803
|
} catch {
|
|
1626
1804
|
}
|
|
1627
1805
|
return;
|
|
@@ -1655,32 +1833,32 @@ function undo(steps) {
|
|
|
1655
1833
|
}
|
|
1656
1834
|
function latestConversation(dir) {
|
|
1657
1835
|
let best = null;
|
|
1658
|
-
for (const name of
|
|
1836
|
+
for (const name of fs13.readdirSync(dir)) {
|
|
1659
1837
|
if (!name.endsWith(".jsonl")) continue;
|
|
1660
|
-
const at = mtime(
|
|
1838
|
+
const at = mtime(path14.join(dir, name));
|
|
1661
1839
|
if (!best || at > best.at) best = { name, at };
|
|
1662
1840
|
}
|
|
1663
1841
|
if (!best) return [];
|
|
1664
1842
|
const id = best.name.slice(0, -".jsonl".length);
|
|
1665
|
-
return [best.name, ...isDir(
|
|
1843
|
+
return [best.name, ...isDir(path14.join(dir, id)) ? [id] : []];
|
|
1666
1844
|
}
|
|
1667
1845
|
function moveConversations(session, fromDir, toDir, tag = "old", opts = {}) {
|
|
1668
1846
|
const steps = [];
|
|
1669
1847
|
const moved = [];
|
|
1670
|
-
if (
|
|
1848
|
+
if (path14.resolve(fromDir) === path14.resolve(toDir)) return { moved };
|
|
1671
1849
|
const emptied = [];
|
|
1672
1850
|
let at = "";
|
|
1673
1851
|
try {
|
|
1674
1852
|
for (const cwd of sessionRunFolders(session, false)) {
|
|
1675
1853
|
const name = encodeProjectDir(cwd);
|
|
1676
|
-
const src =
|
|
1854
|
+
const src = path14.join(projectsRootOf(fromDir), name);
|
|
1677
1855
|
if (!isDir(src)) continue;
|
|
1678
1856
|
at = src;
|
|
1679
|
-
const dst =
|
|
1857
|
+
const dst = path14.join(projectsRootOf(toDir), name);
|
|
1680
1858
|
if (opts.onlyLatest) {
|
|
1681
1859
|
for (const entry of latestConversation(src)) {
|
|
1682
|
-
at =
|
|
1683
|
-
mergeInto(
|
|
1860
|
+
at = path14.join(src, entry);
|
|
1861
|
+
mergeInto(path14.join(src, entry), path14.join(dst, entry), tag, steps, moved);
|
|
1684
1862
|
}
|
|
1685
1863
|
continue;
|
|
1686
1864
|
}
|
|
@@ -1699,7 +1877,7 @@ function moveConversations(session, fromDir, toDir, tag = "old", opts = {}) {
|
|
|
1699
1877
|
}
|
|
1700
1878
|
for (const src of emptied) {
|
|
1701
1879
|
try {
|
|
1702
|
-
|
|
1880
|
+
fs13.rmdirSync(src);
|
|
1703
1881
|
} catch {
|
|
1704
1882
|
}
|
|
1705
1883
|
}
|
|
@@ -1747,12 +1925,8 @@ var claudeAgent = {
|
|
|
1747
1925
|
startedWithSessionHooks: startedWithSessionSettings,
|
|
1748
1926
|
// Its folder marked trusted on the session's account (`projects[<cwd>].hasTrustDialogAccepted`).
|
|
1749
1927
|
trustFolder: (s, cwd) => void trustSessionFolder(s, cwd),
|
|
1750
|
-
// `--add-dir
|
|
1751
|
-
withFolders: (tool, folders) =>
|
|
1752
|
-
const have = new Set(tool.baseArgs.flatMap((a, i) => tool.baseArgs[i - 1] === "--add-dir" ? [a] : []));
|
|
1753
|
-
const add = folders.filter((f) => !have.has(f));
|
|
1754
|
-
return add.length ? { ...tool, baseArgs: [...tool.baseArgs, ...add.flatMap((f) => ["--add-dir", f])] } : tool;
|
|
1755
|
-
}
|
|
1928
|
+
// `--add-dir=<folder>` each, one argument, never twice (a restore's stored tool may have them already).
|
|
1929
|
+
withFolders: (tool, folders) => claudeWithFolders(tool, folders)
|
|
1756
1930
|
},
|
|
1757
1931
|
conversation: {
|
|
1758
1932
|
files: (s) => listTranscripts(s),
|
|
@@ -1776,8 +1950,8 @@ var claudeAgent = {
|
|
|
1776
1950
|
prLinks: claudePrLinks,
|
|
1777
1951
|
// In the session's own account's projects folder: that is where its `--continue` looks.
|
|
1778
1952
|
restoreDir: (s) => {
|
|
1779
|
-
const cwd = s.isGroup && s.paths[0] ?
|
|
1780
|
-
return cwd ?
|
|
1953
|
+
const cwd = s.isGroup && s.paths[0] ? path15.dirname(s.paths[0]) : s.paths[0];
|
|
1954
|
+
return cwd ? path15.join(projectsRootOf(accountDir(sessionAccount(s)) ?? void 0), encodeProjectDir(cwd)) : null;
|
|
1781
1955
|
}
|
|
1782
1956
|
},
|
|
1783
1957
|
events: claudeEvents,
|
|
@@ -1808,7 +1982,7 @@ var claudeAgent = {
|
|
|
1808
1982
|
denyRules: (repos) => claudeReadDenyRules(repos),
|
|
1809
1983
|
// Its flags were measured on one Claude Code (READ_ONLY_MIN_VERSION): an older one gets no checkout run.
|
|
1810
1984
|
// Loaded when a review asks: the hook processes load this adapter on every turn edge.
|
|
1811
|
-
available: async () => (await import("./version-
|
|
1985
|
+
available: async () => (await import("./version-ATSNJMTH.js")).claudeReadOnlyAvailable()
|
|
1812
1986
|
}
|
|
1813
1987
|
},
|
|
1814
1988
|
instructionsFile: "CLAUDE.md",
|
|
@@ -1816,9 +1990,42 @@ var claudeAgent = {
|
|
|
1816
1990
|
instructionsImport: (relPath) => `@${relPath}`,
|
|
1817
1991
|
workspace: claudeWorkspace,
|
|
1818
1992
|
skills: claudeSkills,
|
|
1993
|
+
// Claude Code kept up to date the way it was installed (tool-update.ts).
|
|
1994
|
+
selfUpdate: {
|
|
1995
|
+
enabled: (config) => config?.claudeCode?.autoUpdate !== false,
|
|
1996
|
+
run: async () => {
|
|
1997
|
+
const r = await keepClaudeUpdated();
|
|
1998
|
+
return {
|
|
1999
|
+
text: updateCheckText(r),
|
|
2000
|
+
failed: r.kind === "cannot" || r.kind === "not-yet" && r.why.startsWith("the update failed"),
|
|
2001
|
+
updated: r.kind === "updated"
|
|
2002
|
+
};
|
|
2003
|
+
}
|
|
2004
|
+
},
|
|
1819
2005
|
usage: claudeUsage,
|
|
1820
2006
|
accounts: claudeAccountSwitch
|
|
1821
2007
|
};
|
|
2008
|
+
function claudeWithFolders(tool, folders) {
|
|
2009
|
+
if (!folders.length) return tool;
|
|
2010
|
+
const ours = new Set(folders);
|
|
2011
|
+
const args = [];
|
|
2012
|
+
const have = /* @__PURE__ */ new Set();
|
|
2013
|
+
for (let i = 0; i < tool.baseArgs.length; i++) {
|
|
2014
|
+
const a = tool.baseArgs[i];
|
|
2015
|
+
const next = tool.baseArgs[i + 1];
|
|
2016
|
+
if (a === "--add-dir" && next !== void 0 && ours.has(next)) {
|
|
2017
|
+
args.push(`--add-dir=${next}`);
|
|
2018
|
+
have.add(next);
|
|
2019
|
+
i++;
|
|
2020
|
+
continue;
|
|
2021
|
+
}
|
|
2022
|
+
if (a.startsWith("--add-dir=")) have.add(a.slice("--add-dir=".length));
|
|
2023
|
+
args.push(a);
|
|
2024
|
+
}
|
|
2025
|
+
const add = folders.filter((f) => !have.has(f));
|
|
2026
|
+
const changed = add.length || args.length !== tool.baseArgs.length;
|
|
2027
|
+
return changed ? { ...tool, baseArgs: [...args, ...add.map((f) => `--add-dir=${f}`)] } : tool;
|
|
2028
|
+
}
|
|
1822
2029
|
|
|
1823
2030
|
// src/core/agents/index.ts
|
|
1824
2031
|
var settingsView = configView((p) => {
|
|
@@ -1847,7 +2054,7 @@ function plainAgent(id) {
|
|
|
1847
2054
|
launch: {
|
|
1848
2055
|
tool: (config) => getAiTool(config && getAiTool(config).cmd === id ? config : { aiCommand: id }),
|
|
1849
2056
|
canResume: () => false,
|
|
1850
|
-
resumeLaunch: (s) => ({ launchPath: s.isGroup ?
|
|
2057
|
+
resumeLaunch: (s) => ({ launchPath: s.isGroup ? path16.dirname(s.paths[0] ?? "") : s.paths[0] ?? "", hasConversation: false }),
|
|
1851
2058
|
cleanEnv: (env) => ({ ...env })
|
|
1852
2059
|
},
|
|
1853
2060
|
// Text, a pause, Enter — and no dialog to answer by keystroke (its screen is unknown).
|
|
@@ -1922,20 +2129,20 @@ function agentFor(config, session) {
|
|
|
1922
2129
|
}
|
|
1923
2130
|
|
|
1924
2131
|
// src/core/platform/package-root.ts
|
|
1925
|
-
import
|
|
1926
|
-
import
|
|
2132
|
+
import fs14 from "fs";
|
|
2133
|
+
import path17 from "path";
|
|
1927
2134
|
import { fileURLToPath } from "url";
|
|
1928
2135
|
var cached;
|
|
1929
2136
|
function packageRoot() {
|
|
1930
2137
|
if (cached !== void 0) return cached;
|
|
1931
|
-
let dir =
|
|
2138
|
+
let dir = path17.dirname(fileURLToPath(import.meta.url));
|
|
1932
2139
|
for (; ; ) {
|
|
1933
2140
|
try {
|
|
1934
|
-
const pkg = JSON.parse(
|
|
2141
|
+
const pkg = JSON.parse(fs14.readFileSync(path17.join(dir, "package.json"), "utf8"));
|
|
1935
2142
|
if (pkg.name === "@moberg_hr/work-tree") return cached = dir;
|
|
1936
2143
|
} catch {
|
|
1937
2144
|
}
|
|
1938
|
-
const up =
|
|
2145
|
+
const up = path17.dirname(dir);
|
|
1939
2146
|
if (up === dir) return cached = null;
|
|
1940
2147
|
dir = up;
|
|
1941
2148
|
}
|
|
@@ -1973,4 +2180,4 @@ export {
|
|
|
1973
2180
|
agentFor,
|
|
1974
2181
|
packageRoot
|
|
1975
2182
|
};
|
|
1976
|
-
//# sourceMappingURL=chunk-
|
|
2183
|
+
//# sourceMappingURL=chunk-B34R6TQO.js.map
|