@moberg_hr/work-tree 2.23.1 → 2.23.3
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-O62WFR7C.js → account-CCXROECI.js} +29 -28
- package/dist/{account-O62WFR7C.js.map → account-CCXROECI.js.map} +1 -1
- package/dist/{add-repo-FTAMMPVM.js → add-repo-KYSKVWWL.js} +20 -21
- package/dist/{add-repo-FTAMMPVM.js.map → add-repo-KYSKVWWL.js.map} +1 -1
- package/dist/{answer-LKNMN2ZM.js → answer-M5SVGKGO.js} +12 -12
- package/dist/{attach-A3KA4YTK.js → attach-YHIUKOTE.js} +21 -22
- package/dist/{attach-A3KA4YTK.js.map → attach-YHIUKOTE.js.map} +1 -1
- package/dist/bin.js +4 -4
- package/dist/{block-3ZUFH2RO.js → block-ONJSUTQ6.js} +17 -18
- package/dist/{block-3ZUFH2RO.js.map → block-ONJSUTQ6.js.map} +1 -1
- package/dist/{broadcast-I23BZI3R.js → broadcast-TVDWHKJE.js} +10 -10
- package/dist/{catchup-G4EOJIZP.js → catchup-UGDVV5RI.js} +15 -15
- package/dist/{child-MVNEFA2I.js → child-GPVONLJF.js} +18 -15
- package/dist/child-GPVONLJF.js.map +1 -0
- package/dist/{chunk-NXS53NHR.js → chunk-2MAMYB72.js} +4 -4
- package/dist/{chunk-ZNRPBP5O.js → chunk-2YDY25YI.js} +138 -7
- package/dist/chunk-2YDY25YI.js.map +1 -0
- package/dist/{chunk-HCYES6U7.js → chunk-32CMRR6M.js} +2 -2
- package/dist/{chunk-24FQ5XXN.js → chunk-35WLDIMQ.js} +3 -3
- package/dist/{chunk-FHC6KHIH.js → chunk-3DPHZKSL.js} +2 -2
- package/dist/{chunk-NWKVTUTN.js → chunk-3PO2LUY7.js} +355 -176
- package/dist/chunk-3PO2LUY7.js.map +1 -0
- package/dist/{chunk-T5GJVUSL.js → chunk-4CUYK2XD.js} +2 -2
- package/dist/{chunk-IVS2MAHD.js → chunk-4JQ3CMLS.js} +3 -3
- package/dist/{chunk-U4XSBYQW.js → chunk-5KYEDVL7.js} +5 -5
- package/dist/{chunk-N7T6NPE2.js → chunk-6A6XOLVB.js} +6 -6
- package/dist/{chunk-ZX4ONO5Y.js → chunk-6EFDXIA6.js} +5 -5
- package/dist/{chunk-NREZVTBP.js → chunk-6ER6IBFJ.js} +2 -2
- package/dist/{chunk-XIN6XUFL.js → chunk-6NOZK4JY.js} +2 -2
- package/dist/{chunk-4FN45EAF.js → chunk-7CH7FS5V.js} +3 -3
- package/dist/{chunk-OPV6BE3W.js → chunk-AB2KARHU.js} +8 -8
- package/dist/{chunk-GHY7GZWN.js → chunk-ADOCX5G3.js} +4 -4
- package/dist/{chunk-2MJQTFTI.js → chunk-B26TVG74.js} +3 -3
- package/dist/{chunk-GN7EAXHU.js → chunk-BFGD6UNG.js} +83 -21
- package/dist/chunk-BFGD6UNG.js.map +1 -0
- package/dist/{chunk-WOY35FXP.js → chunk-BHPTGWMO.js} +14 -12
- package/dist/chunk-BHPTGWMO.js.map +1 -0
- package/dist/{chunk-HNZ736XN.js → chunk-BUFPEKEG.js} +5 -5
- package/dist/{chunk-GNIYYXQX.js → chunk-CNR4IKC7.js} +2 -2
- package/dist/{chunk-5SXTMOO6.js → chunk-CUEAIOPD.js} +6 -6
- package/dist/{chunk-MVBBESXK.js → chunk-D4VRDMPK.js} +4 -4
- package/dist/{chunk-YKTJL4SW.js → chunk-D66CHEKN.js} +7 -7
- package/dist/{chunk-GF7RAQFD.js → chunk-FB7OAPCV.js} +3 -3
- package/dist/{chunk-ZMJR4Z6O.js → chunk-FW35KEAD.js} +2 -2
- package/dist/{chunk-2JLG65GB.js → chunk-G6LOB5IT.js} +3 -3
- package/dist/{chunk-HQDQRC4F.js → chunk-HEGROFQI.js} +2 -2
- package/dist/{chunk-ET5K6S5H.js → chunk-IMVJ3NEI.js} +22 -11
- package/dist/chunk-IMVJ3NEI.js.map +1 -0
- package/dist/chunk-J5QY4YRW.js +151 -0
- package/dist/chunk-J5QY4YRW.js.map +1 -0
- package/dist/{chunk-XBWS77S2.js → chunk-J7IGCYHZ.js} +2 -2
- package/dist/{chunk-5QENUGSC.js → chunk-JYYI2M4H.js} +18 -18
- package/dist/{chunk-MQXMYVZV.js → chunk-K3I2ZG2R.js} +15 -15
- package/dist/chunk-KBYXAQS3.js +482 -0
- package/dist/chunk-KBYXAQS3.js.map +1 -0
- package/dist/{chunk-4HQEYZIM.js → chunk-KEIID3YY.js} +7 -7
- package/dist/{chunk-INXHVNMZ.js → chunk-KPPDUVMP.js} +11 -11
- package/dist/{chunk-W5YYTITQ.js → chunk-KVLPKFGJ.js} +2 -2
- package/dist/{chunk-BI7HIO2I.js → chunk-LSEEMJH7.js} +6 -6
- package/dist/{chunk-44QJVFOF.js → chunk-M6PVGN5W.js} +2 -2
- package/dist/{chunk-HPUD5IGB.js → chunk-MBYQBTH2.js} +4 -4
- package/dist/{chunk-TL7VLRRF.js → chunk-MFSXOQLX.js} +7 -7
- package/dist/{chunk-VH5FRKJM.js → chunk-MG773CN7.js} +7 -7
- package/dist/{chunk-2FNYJEOH.js → chunk-NA4AOKAJ.js} +2 -2
- package/dist/{chunk-GTFMUWK6.js → chunk-NH6QDR7V.js} +7 -7
- package/dist/{chunk-ZG6HB4BO.js → chunk-NKC3QM4W.js} +13 -17
- package/dist/chunk-NKC3QM4W.js.map +1 -0
- package/dist/{chunk-HUWWMTNG.js → chunk-NVVDE63M.js} +22 -13
- package/dist/chunk-NVVDE63M.js.map +1 -0
- package/dist/{chunk-6PZ7RCXK.js → chunk-O3YB7GKT.js} +2 -2
- package/dist/{chunk-NS7WH53I.js → chunk-O45NATRC.js} +2 -2
- package/dist/{chunk-IXZOZZGD.js → chunk-OFIIGVE7.js} +9 -9
- package/dist/{chunk-DHZ5DF6Y.js → chunk-OPZL2MRQ.js} +34 -10
- package/dist/chunk-OPZL2MRQ.js.map +1 -0
- package/dist/{chunk-ETWP7MDS.js → chunk-Q53APMHH.js} +1 -1
- package/dist/chunk-Q53APMHH.js.map +1 -0
- package/dist/{chunk-IRDWXDID.js → chunk-QTDNSMOT.js} +2 -2
- package/dist/{chunk-XTAYJDL2.js → chunk-QZW77GWD.js} +6 -6
- package/dist/chunk-REVI2JIA.js +9 -0
- package/dist/{chunk-U2A2DHWP.js → chunk-RO25CJ2V.js} +5 -5
- package/dist/{chunk-ETAPX4JN.js → chunk-RSJZG4SD.js} +9 -9
- package/dist/chunk-RWGD6EXK.js +21 -0
- package/dist/chunk-RWGD6EXK.js.map +1 -0
- package/dist/{chunk-XWKN2HJD.js → chunk-S2Q6M64P.js} +60 -60
- package/dist/{chunk-773UJC5C.js → chunk-SEFMLXA6.js} +7 -7
- package/dist/{chunk-ZLPK2LQ3.js → chunk-V6U4HDFJ.js} +5 -5
- package/dist/{chunk-EORL2V7P.js → chunk-XPMXRCBW.js} +2 -2
- package/dist/{chunk-IXC6EXVJ.js → chunk-XR6EXIZN.js} +5 -5
- package/dist/{chunk-ROEEXEN7.js → chunk-XWUX474Q.js} +4 -150
- package/dist/chunk-XWUX474Q.js.map +1 -0
- package/dist/{chunk-APHVSSLI.js → chunk-XZAJSEXA.js} +2 -2
- package/dist/{chunk-ED6YLB4S.js → chunk-YQSWVHKK.js} +13 -13
- package/dist/chunk-YQSWVHKK.js.map +1 -0
- package/dist/{cleanup-ANVUCOBK.js → cleanup-54DBWJWN.js} +38 -40
- package/dist/{cleanup-ANVUCOBK.js.map → cleanup-54DBWJWN.js.map} +1 -1
- package/dist/{cli-CAF6VCVO.js → cli-VOZ6BCM5.js} +4 -4
- package/dist/{color-7CQNI6Y4.js → color-BVSEJ6G5.js} +14 -14
- package/dist/{config-EXQY26W4.js → config-6H54DGHU.js} +16 -17
- package/dist/{config-EXQY26W4.js.map → config-6H54DGHU.js.map} +1 -1
- package/dist/{coordinate-LRY7LXS6.js → coordinate-WXN3OGJE.js} +26 -16
- package/dist/coordinate-WXN3OGJE.js.map +1 -0
- package/dist/{diff-JRK3AUD5.js → diff-ZBMQVDNF.js} +15 -16
- package/dist/{diff-JRK3AUD5.js.map → diff-ZBMQVDNF.js.map} +1 -1
- package/dist/{digest-2AFW3WBL.js → digest-XEHPAI5L.js} +12 -12
- package/dist/{fork-DSNMPWUE.js → fork-UBBXUFNS.js} +33 -35
- package/dist/{fork-DSNMPWUE.js.map → fork-UBBXUFNS.js.map} +1 -1
- package/dist/{history-RFIDCGQY.js → history-CK3FEKBC.js} +10 -10
- package/dist/{hook-XBALB337.js → hook-FRKNNKO3.js} +31 -24
- package/dist/hook-FRKNNKO3.js.map +1 -0
- package/dist/{hydrate-DAEY4PB6.js → hydrate-K6TOIE7S.js} +11 -11
- package/dist/{init-4BK3T34W.js → init-JJFHX26N.js} +18 -19
- package/dist/{init-4BK3T34W.js.map → init-JJFHX26N.js.map} +1 -1
- package/dist/{install-skills-TL5D7HZU.js → install-skills-IUD6FMAF.js} +11 -9
- package/dist/install-skills-bin.js +10 -8
- package/dist/install-skills-bin.js.map +1 -1
- package/dist/{keep-57TUKADV.js → keep-APP2WSKT.js} +12 -12
- package/dist/{list-DRQRIT6U.js → list-OHGYVSWI.js} +11 -11
- package/dist/{move-UEHJ375P.js → move-OU33UWX6.js} +24 -25
- package/dist/{move-UEHJ375P.js.map → move-OU33UWX6.js.map} +1 -1
- package/dist/{note-FHPDVBRI.js → note-ELTUIFB6.js} +12 -12
- package/dist/{overlaps-GKAKEUB6.js → overlaps-C7LV7U47.js} +18 -19
- package/dist/{overlaps-GKAKEUB6.js.map → overlaps-C7LV7U47.js.map} +1 -1
- package/dist/{pin-CFTQDPPC.js → pin-W7A4GXHE.js} +13 -13
- package/dist/{pr-ZP4COZEZ.js → pr-G5PW3CQB.js} +26 -27
- package/dist/{pr-ZP4COZEZ.js.map → pr-G5PW3CQB.js.map} +1 -1
- package/dist/{prune-IQB2T45B.js → prune-ZVGGPC2X.js} +35 -37
- package/dist/{prune-IQB2T45B.js.map → prune-ZVGGPC2X.js.map} +1 -1
- package/dist/{pty-host-BPFGJFBC.js → pty-host-QRHAVCCV.js} +71 -32
- package/dist/pty-host-QRHAVCCV.js.map +1 -0
- package/dist/{read-DHJ6VY44.js → read-FHJHBUDI.js} +17 -13
- package/dist/{read-DHJ6VY44.js.map → read-FHJHBUDI.js.map} +1 -1
- package/dist/{recent-OZW2ZNJ4.js → recent-QOCMWXZY.js} +21 -22
- package/dist/{recent-OZW2ZNJ4.js.map → recent-QOCMWXZY.js.map} +1 -1
- package/dist/{remove-MW25RLNV.js → remove-BIF6SAUC.js} +36 -38
- package/dist/{remove-MW25RLNV.js.map → remove-BIF6SAUC.js.map} +1 -1
- package/dist/{report-II75EKM6.js → report-7TRHC2CQ.js} +16 -13
- package/dist/report-7TRHC2CQ.js.map +1 -0
- package/dist/{restart-4BGVRBX6.js → restart-YVWOAA7D.js} +14 -15
- package/dist/{restart-4BGVRBX6.js.map → restart-YVWOAA7D.js.map} +1 -1
- package/dist/{resume-4J53KDCO.js → resume-KDCRPOAZ.js} +21 -22
- package/dist/{resume-4J53KDCO.js.map → resume-KDCRPOAZ.js.map} +1 -1
- package/dist/{review-WKB3K6LI.js → review-YH5TH37K.js} +11 -11
- package/dist/{review-now-AT2SPPRO.js → review-now-4NBXZUJV.js} +2 -2
- package/dist/{run-YS2D7WAQ.js → run-T6YFDM2T.js} +10 -10
- package/dist/{screen-VVRNQXVW.js → screen-LXXS4KCS.js} +12 -12
- package/dist/{search-MKYCKZF4.js → search-HOIGQH66.js} +10 -10
- package/dist/{section-Y6RDD3MN.js → section-NF6SAXSF.js} +14 -14
- package/dist/{send-AZM2XKN2.js → send-ELRCW7PJ.js} +26 -16
- package/dist/send-ELRCW7PJ.js.map +1 -0
- package/dist/{sessions-OER6VNQJ.js → sessions-Y5X6OG3D.js} +31 -33
- package/dist/{sessions-OER6VNQJ.js.map → sessions-Y5X6OG3D.js.map} +1 -1
- package/dist/{show-33VV3XCF.js → show-5NYBZRYX.js} +11 -11
- package/dist/{snooze-OFYZVVYS.js → snooze-J2PV4C6X.js} +12 -12
- package/dist/{start-OEQ5VW7Y.js → start-DO4UJCS4.js} +12 -12
- package/dist/{state-HK67C4UA.js → state-63M6QBOW.js} +2 -2
- package/dist/{status-HPYMNO2T.js → status-FHIC2MKA.js} +15 -16
- package/dist/{status-HPYMNO2T.js.map → status-FHIC2MKA.js.map} +1 -1
- package/dist/{statusline-Z5HLKDIA.js → statusline-UP2KMHYX.js} +5 -5
- package/dist/{statusline-hook-VPPS3PFO.js → statusline-hook-6BNEVENM.js} +4 -4
- package/dist/{stop-QNICDWAU.js → stop-T2E62H4M.js} +12 -12
- package/dist/{sync-RH3M47QK.js → sync-3E4STI7L.js} +35 -37
- package/dist/{sync-RH3M47QK.js.map → sync-3E4STI7L.js.map} +1 -1
- package/dist/{time-PM72GK5W.js → time-JVF77UUA.js} +14 -14
- package/dist/{time-actions-O3MCB7FU.js → time-actions-JM3QKB5T.js} +3 -3
- package/dist/{timesheet-HJXQ4KHL.js → timesheet-B2HNBQQM.js} +23 -23
- package/dist/timesheet-B2HNBQQM.js.map +1 -0
- package/dist/{todo-UVKGOG7D.js → todo-3UNVCCMY.js} +2 -2
- package/dist/{tree-RGT736E3.js → tree-EMUBZEDU.js} +37 -39
- package/dist/{tree-RGT736E3.js.map → tree-EMUBZEDU.js.map} +1 -1
- package/dist/{update-CMYVBWV3.js → update-4XHZ4VQZ.js} +20 -21
- package/dist/{update-CMYVBWV3.js.map → update-4XHZ4VQZ.js.map} +1 -1
- package/dist/{usage-VEKD3JPL.js → usage-JDXG5SDA.js} +12 -12
- package/dist/{usage-ask-V2SIRW4F.js → usage-ask-5ZWNYLVJ.js} +11 -11
- package/dist/version-VT2JXBQT.js +31 -0
- package/dist/version-VT2JXBQT.js.map +1 -0
- package/dist/{wait-RQZU3KDY.js → wait-FEN3WAEQ.js} +13 -13
- package/dist/wd-bin.js +3 -3
- package/dist/web/assets/{PtyView-qP6blm2-.js → PtyView-C1X1ErwB.js} +2 -2
- package/dist/web/assets/{PtyView-qP6blm2-.js.map → PtyView-C1X1ErwB.js.map} +1 -1
- package/dist/web/assets/{index-yBTfBzDm.css → index-CfTmdABt.css} +1 -1
- package/dist/web/assets/index-vE5o2Ywu.js +129 -0
- package/dist/web/assets/index-vE5o2Ywu.js.map +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-GOCU26ZD.js → web-LU6GSQMK.js} +185 -100
- package/dist/web-LU6GSQMK.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-MVNEFA2I.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-DHZ5DF6Y.js.map +0 -1
- package/dist/chunk-ED6YLB4S.js.map +0 -1
- package/dist/chunk-ET5K6S5H.js.map +0 -1
- package/dist/chunk-ETWP7MDS.js.map +0 -1
- package/dist/chunk-GN7EAXHU.js.map +0 -1
- package/dist/chunk-HUWWMTNG.js.map +0 -1
- package/dist/chunk-NRX5V443.js +0 -9
- package/dist/chunk-NWKVTUTN.js.map +0 -1
- package/dist/chunk-ROEEXEN7.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-WOY35FXP.js.map +0 -1
- package/dist/chunk-ZG6HB4BO.js.map +0 -1
- package/dist/chunk-ZNRPBP5O.js.map +0 -1
- package/dist/coordinate-LRY7LXS6.js.map +0 -1
- package/dist/hook-XBALB337.js.map +0 -1
- package/dist/pty-host-BPFGJFBC.js.map +0 -1
- package/dist/report-II75EKM6.js.map +0 -1
- package/dist/send-AZM2XKN2.js.map +0 -1
- package/dist/timesheet-HJXQ4KHL.js.map +0 -1
- package/dist/version-RJ4PCHPB.js +0 -117
- package/dist/version-RJ4PCHPB.js.map +0 -1
- package/dist/web/assets/index-DuFRboh6.js +0 -129
- package/dist/web/assets/index-DuFRboh6.js.map +0 -1
- package/dist/web-GOCU26ZD.js.map +0 -1
- /package/dist/{answer-LKNMN2ZM.js.map → answer-M5SVGKGO.js.map} +0 -0
- /package/dist/{broadcast-I23BZI3R.js.map → broadcast-TVDWHKJE.js.map} +0 -0
- /package/dist/{catchup-G4EOJIZP.js.map → catchup-UGDVV5RI.js.map} +0 -0
- /package/dist/{chunk-NXS53NHR.js.map → chunk-2MAMYB72.js.map} +0 -0
- /package/dist/{chunk-HCYES6U7.js.map → chunk-32CMRR6M.js.map} +0 -0
- /package/dist/{chunk-24FQ5XXN.js.map → chunk-35WLDIMQ.js.map} +0 -0
- /package/dist/{chunk-FHC6KHIH.js.map → chunk-3DPHZKSL.js.map} +0 -0
- /package/dist/{chunk-T5GJVUSL.js.map → chunk-4CUYK2XD.js.map} +0 -0
- /package/dist/{chunk-IVS2MAHD.js.map → chunk-4JQ3CMLS.js.map} +0 -0
- /package/dist/{chunk-U4XSBYQW.js.map → chunk-5KYEDVL7.js.map} +0 -0
- /package/dist/{chunk-N7T6NPE2.js.map → chunk-6A6XOLVB.js.map} +0 -0
- /package/dist/{chunk-ZX4ONO5Y.js.map → chunk-6EFDXIA6.js.map} +0 -0
- /package/dist/{chunk-NREZVTBP.js.map → chunk-6ER6IBFJ.js.map} +0 -0
- /package/dist/{chunk-XIN6XUFL.js.map → chunk-6NOZK4JY.js.map} +0 -0
- /package/dist/{chunk-4FN45EAF.js.map → chunk-7CH7FS5V.js.map} +0 -0
- /package/dist/{chunk-OPV6BE3W.js.map → chunk-AB2KARHU.js.map} +0 -0
- /package/dist/{chunk-GHY7GZWN.js.map → chunk-ADOCX5G3.js.map} +0 -0
- /package/dist/{chunk-2MJQTFTI.js.map → chunk-B26TVG74.js.map} +0 -0
- /package/dist/{chunk-HNZ736XN.js.map → chunk-BUFPEKEG.js.map} +0 -0
- /package/dist/{chunk-GNIYYXQX.js.map → chunk-CNR4IKC7.js.map} +0 -0
- /package/dist/{chunk-5SXTMOO6.js.map → chunk-CUEAIOPD.js.map} +0 -0
- /package/dist/{chunk-MVBBESXK.js.map → chunk-D4VRDMPK.js.map} +0 -0
- /package/dist/{chunk-YKTJL4SW.js.map → chunk-D66CHEKN.js.map} +0 -0
- /package/dist/{chunk-GF7RAQFD.js.map → chunk-FB7OAPCV.js.map} +0 -0
- /package/dist/{chunk-ZMJR4Z6O.js.map → chunk-FW35KEAD.js.map} +0 -0
- /package/dist/{chunk-2JLG65GB.js.map → chunk-G6LOB5IT.js.map} +0 -0
- /package/dist/{chunk-HQDQRC4F.js.map → chunk-HEGROFQI.js.map} +0 -0
- /package/dist/{chunk-XBWS77S2.js.map → chunk-J7IGCYHZ.js.map} +0 -0
- /package/dist/{chunk-5QENUGSC.js.map → chunk-JYYI2M4H.js.map} +0 -0
- /package/dist/{chunk-MQXMYVZV.js.map → chunk-K3I2ZG2R.js.map} +0 -0
- /package/dist/{chunk-4HQEYZIM.js.map → chunk-KEIID3YY.js.map} +0 -0
- /package/dist/{chunk-INXHVNMZ.js.map → chunk-KPPDUVMP.js.map} +0 -0
- /package/dist/{chunk-W5YYTITQ.js.map → chunk-KVLPKFGJ.js.map} +0 -0
- /package/dist/{chunk-BI7HIO2I.js.map → chunk-LSEEMJH7.js.map} +0 -0
- /package/dist/{chunk-44QJVFOF.js.map → chunk-M6PVGN5W.js.map} +0 -0
- /package/dist/{chunk-HPUD5IGB.js.map → chunk-MBYQBTH2.js.map} +0 -0
- /package/dist/{chunk-TL7VLRRF.js.map → chunk-MFSXOQLX.js.map} +0 -0
- /package/dist/{chunk-VH5FRKJM.js.map → chunk-MG773CN7.js.map} +0 -0
- /package/dist/{chunk-2FNYJEOH.js.map → chunk-NA4AOKAJ.js.map} +0 -0
- /package/dist/{chunk-GTFMUWK6.js.map → chunk-NH6QDR7V.js.map} +0 -0
- /package/dist/{chunk-6PZ7RCXK.js.map → chunk-O3YB7GKT.js.map} +0 -0
- /package/dist/{chunk-NS7WH53I.js.map → chunk-O45NATRC.js.map} +0 -0
- /package/dist/{chunk-IXZOZZGD.js.map → chunk-OFIIGVE7.js.map} +0 -0
- /package/dist/{chunk-IRDWXDID.js.map → chunk-QTDNSMOT.js.map} +0 -0
- /package/dist/{chunk-XTAYJDL2.js.map → chunk-QZW77GWD.js.map} +0 -0
- /package/dist/{chunk-NRX5V443.js.map → chunk-REVI2JIA.js.map} +0 -0
- /package/dist/{chunk-U2A2DHWP.js.map → chunk-RO25CJ2V.js.map} +0 -0
- /package/dist/{chunk-ETAPX4JN.js.map → chunk-RSJZG4SD.js.map} +0 -0
- /package/dist/{chunk-XWKN2HJD.js.map → chunk-S2Q6M64P.js.map} +0 -0
- /package/dist/{chunk-773UJC5C.js.map → chunk-SEFMLXA6.js.map} +0 -0
- /package/dist/{chunk-ZLPK2LQ3.js.map → chunk-V6U4HDFJ.js.map} +0 -0
- /package/dist/{chunk-EORL2V7P.js.map → chunk-XPMXRCBW.js.map} +0 -0
- /package/dist/{chunk-IXC6EXVJ.js.map → chunk-XR6EXIZN.js.map} +0 -0
- /package/dist/{chunk-APHVSSLI.js.map → chunk-XZAJSEXA.js.map} +0 -0
- /package/dist/{cli-CAF6VCVO.js.map → cli-VOZ6BCM5.js.map} +0 -0
- /package/dist/{color-7CQNI6Y4.js.map → color-BVSEJ6G5.js.map} +0 -0
- /package/dist/{digest-2AFW3WBL.js.map → digest-XEHPAI5L.js.map} +0 -0
- /package/dist/{history-RFIDCGQY.js.map → history-CK3FEKBC.js.map} +0 -0
- /package/dist/{hydrate-DAEY4PB6.js.map → hydrate-K6TOIE7S.js.map} +0 -0
- /package/dist/{install-skills-TL5D7HZU.js.map → install-skills-IUD6FMAF.js.map} +0 -0
- /package/dist/{keep-57TUKADV.js.map → keep-APP2WSKT.js.map} +0 -0
- /package/dist/{list-DRQRIT6U.js.map → list-OHGYVSWI.js.map} +0 -0
- /package/dist/{note-FHPDVBRI.js.map → note-ELTUIFB6.js.map} +0 -0
- /package/dist/{pin-CFTQDPPC.js.map → pin-W7A4GXHE.js.map} +0 -0
- /package/dist/{review-WKB3K6LI.js.map → review-YH5TH37K.js.map} +0 -0
- /package/dist/{review-now-AT2SPPRO.js.map → review-now-4NBXZUJV.js.map} +0 -0
- /package/dist/{run-YS2D7WAQ.js.map → run-T6YFDM2T.js.map} +0 -0
- /package/dist/{screen-VVRNQXVW.js.map → screen-LXXS4KCS.js.map} +0 -0
- /package/dist/{search-MKYCKZF4.js.map → search-HOIGQH66.js.map} +0 -0
- /package/dist/{section-Y6RDD3MN.js.map → section-NF6SAXSF.js.map} +0 -0
- /package/dist/{show-33VV3XCF.js.map → show-5NYBZRYX.js.map} +0 -0
- /package/dist/{snooze-OFYZVVYS.js.map → snooze-J2PV4C6X.js.map} +0 -0
- /package/dist/{start-OEQ5VW7Y.js.map → start-DO4UJCS4.js.map} +0 -0
- /package/dist/{state-HK67C4UA.js.map → state-63M6QBOW.js.map} +0 -0
- /package/dist/{statusline-Z5HLKDIA.js.map → statusline-UP2KMHYX.js.map} +0 -0
- /package/dist/{statusline-hook-VPPS3PFO.js.map → statusline-hook-6BNEVENM.js.map} +0 -0
- /package/dist/{stop-QNICDWAU.js.map → stop-T2E62H4M.js.map} +0 -0
- /package/dist/{time-PM72GK5W.js.map → time-JVF77UUA.js.map} +0 -0
- /package/dist/{time-actions-O3MCB7FU.js.map → time-actions-JM3QKB5T.js.map} +0 -0
- /package/dist/{todo-UVKGOG7D.js.map → todo-3UNVCCMY.js.map} +0 -0
- /package/dist/{usage-VEKD3JPL.js.map → usage-JDXG5SDA.js.map} +0 -0
- /package/dist/{usage-ask-V2SIRW4F.js.map → usage-ask-5ZWNYLVJ.js.map} +0 -0
- /package/dist/{wait-RQZU3KDY.js.map → wait-FEN3WAEQ.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-KBYXAQS3.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-6NOZK4JY.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-Q53APMHH.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
|
|
|
@@ -1395,9 +1545,9 @@ function installClaudeSkillsFor(dir, run = runClaude2) {
|
|
|
1395
1545
|
|
|
1396
1546
|
// src/core/agents/claude/usage.ts
|
|
1397
1547
|
var installer2;
|
|
1398
|
-
var loadInstaller2 = async () => installer2 ??= await import("./statusline-
|
|
1548
|
+
var loadInstaller2 = async () => installer2 ??= await import("./statusline-UP2KMHYX.js");
|
|
1399
1549
|
var asker;
|
|
1400
|
-
var loadAsker = async () => asker ??= await import("./usage-ask-
|
|
1550
|
+
var loadAsker = async () => asker ??= await import("./usage-ask-5ZWNYLVJ.js");
|
|
1401
1551
|
function restoreMessage(o, saved = "~/.work/statusline.json") {
|
|
1402
1552
|
switch (o) {
|
|
1403
1553
|
case "restored":
|
|
@@ -1446,18 +1596,18 @@ var claudeUsage = {
|
|
|
1446
1596
|
};
|
|
1447
1597
|
|
|
1448
1598
|
// src/core/agents/claude/account-move.ts
|
|
1449
|
-
import
|
|
1450
|
-
import
|
|
1599
|
+
import fs13 from "fs";
|
|
1600
|
+
import path14 from "path";
|
|
1451
1601
|
|
|
1452
1602
|
// src/core/agents/claude/account-admin.ts
|
|
1453
|
-
import
|
|
1454
|
-
import
|
|
1455
|
-
import
|
|
1603
|
+
import fs12 from "fs";
|
|
1604
|
+
import os6 from "os";
|
|
1605
|
+
import path13 from "path";
|
|
1456
1606
|
async function editConfig(fn) {
|
|
1457
1607
|
const file = getConfigPath();
|
|
1458
|
-
if (!
|
|
1608
|
+
if (!fs12.existsSync(file)) throw new AccountAdminError("No configuration yet: run `work init` first.");
|
|
1459
1609
|
return withFileLock(file, () => {
|
|
1460
|
-
const raw = JSON.parse(
|
|
1610
|
+
const raw = JSON.parse(fs12.readFileSync(file, "utf-8"));
|
|
1461
1611
|
const existing = raw.claudeAccounts;
|
|
1462
1612
|
const accounts = existing && typeof existing === "object" && !Array.isArray(existing) ? { ...existing } : {};
|
|
1463
1613
|
const out = fn(raw, accounts);
|
|
@@ -1469,14 +1619,14 @@ async function editConfig(fn) {
|
|
|
1469
1619
|
}
|
|
1470
1620
|
var validIn = (raw) => validateClaudeAccounts(raw.claudeAccounts, void 0, accountForbiddenRoots(raw)).accounts ?? {};
|
|
1471
1621
|
async function addAccount(name, dir) {
|
|
1472
|
-
const folder = expandAccountDir(dir?.trim() ||
|
|
1622
|
+
const folder = expandAccountDir(dir?.trim() || path13.join(os6.homedir(), `.claude-${name}`));
|
|
1473
1623
|
if (!folder) throw new AccountAdminError(`${dir} is not an absolute folder`);
|
|
1474
1624
|
return editConfig((raw, accounts) => {
|
|
1475
1625
|
if (name in accounts) throw new AccountAdminError(`there is already an account \u201C${name}\u201D`);
|
|
1476
1626
|
const problem = accountProblem(name, folder, Object.values(validIn(raw)), accountForbiddenRoots(raw));
|
|
1477
1627
|
if (problem) throw new AccountAdminError(problem);
|
|
1478
1628
|
try {
|
|
1479
|
-
|
|
1629
|
+
fs12.mkdirSync(folder, { recursive: true });
|
|
1480
1630
|
} catch (e) {
|
|
1481
1631
|
throw new AccountAdminError(`couldn't make ${folder}: ${e instanceof Error ? e.message : String(e)}`);
|
|
1482
1632
|
}
|
|
@@ -1553,14 +1703,14 @@ var AccountMoveError = class extends Error {
|
|
|
1553
1703
|
};
|
|
1554
1704
|
var isDir = (p) => {
|
|
1555
1705
|
try {
|
|
1556
|
-
return
|
|
1706
|
+
return fs13.statSync(p).isDirectory();
|
|
1557
1707
|
} catch {
|
|
1558
1708
|
return false;
|
|
1559
1709
|
}
|
|
1560
1710
|
};
|
|
1561
1711
|
var exists = (p) => {
|
|
1562
1712
|
try {
|
|
1563
|
-
|
|
1713
|
+
fs13.lstatSync(p);
|
|
1564
1714
|
return true;
|
|
1565
1715
|
} catch {
|
|
1566
1716
|
return false;
|
|
@@ -1568,31 +1718,31 @@ var exists = (p) => {
|
|
|
1568
1718
|
};
|
|
1569
1719
|
var mtime = (p) => {
|
|
1570
1720
|
try {
|
|
1571
|
-
return
|
|
1721
|
+
return fs13.statSync(p).mtimeMs;
|
|
1572
1722
|
} catch {
|
|
1573
1723
|
return 0;
|
|
1574
1724
|
}
|
|
1575
1725
|
};
|
|
1576
1726
|
function moveEntry(from, to) {
|
|
1577
|
-
|
|
1727
|
+
fs13.mkdirSync(path14.dirname(to), { recursive: true });
|
|
1578
1728
|
try {
|
|
1579
|
-
|
|
1729
|
+
fs13.renameSync(from, to);
|
|
1580
1730
|
return;
|
|
1581
1731
|
} catch (err) {
|
|
1582
1732
|
const code = err.code;
|
|
1583
1733
|
if (code !== "EXDEV" && code !== "EPERM") throw err;
|
|
1584
1734
|
}
|
|
1585
1735
|
try {
|
|
1586
|
-
|
|
1736
|
+
fs13.cpSync(from, to, { recursive: true, errorOnExist: true, force: false, preserveTimestamps: true });
|
|
1587
1737
|
} catch (err) {
|
|
1588
|
-
|
|
1738
|
+
fs13.rmSync(to, { recursive: true, force: true });
|
|
1589
1739
|
throw err;
|
|
1590
1740
|
}
|
|
1591
1741
|
try {
|
|
1592
|
-
|
|
1742
|
+
fs13.rmSync(from, { recursive: true, force: true });
|
|
1593
1743
|
} catch (err) {
|
|
1594
1744
|
try {
|
|
1595
|
-
|
|
1745
|
+
fs13.cpSync(to, from, { recursive: true, force: false, errorOnExist: false, preserveTimestamps: true });
|
|
1596
1746
|
} catch (back) {
|
|
1597
1747
|
const why = (e) => e instanceof Error ? e.message : String(e);
|
|
1598
1748
|
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 +1750,7 @@ function moveEntry(from, to) {
|
|
|
1600
1750
|
});
|
|
1601
1751
|
}
|
|
1602
1752
|
try {
|
|
1603
|
-
|
|
1753
|
+
fs13.rmSync(to, { recursive: true, force: true });
|
|
1604
1754
|
} catch {
|
|
1605
1755
|
}
|
|
1606
1756
|
throw err;
|
|
@@ -1619,9 +1769,9 @@ function mergeInto(src, dst, tag, steps, moved) {
|
|
|
1619
1769
|
return;
|
|
1620
1770
|
}
|
|
1621
1771
|
if (isDir(src) && isDir(dst)) {
|
|
1622
|
-
for (const name of
|
|
1772
|
+
for (const name of fs13.readdirSync(src)) mergeInto(path14.join(src, name), path14.join(dst, name), tag, steps, moved);
|
|
1623
1773
|
try {
|
|
1624
|
-
|
|
1774
|
+
fs13.rmdirSync(src);
|
|
1625
1775
|
} catch {
|
|
1626
1776
|
}
|
|
1627
1777
|
return;
|
|
@@ -1655,32 +1805,32 @@ function undo(steps) {
|
|
|
1655
1805
|
}
|
|
1656
1806
|
function latestConversation(dir) {
|
|
1657
1807
|
let best = null;
|
|
1658
|
-
for (const name of
|
|
1808
|
+
for (const name of fs13.readdirSync(dir)) {
|
|
1659
1809
|
if (!name.endsWith(".jsonl")) continue;
|
|
1660
|
-
const at = mtime(
|
|
1810
|
+
const at = mtime(path14.join(dir, name));
|
|
1661
1811
|
if (!best || at > best.at) best = { name, at };
|
|
1662
1812
|
}
|
|
1663
1813
|
if (!best) return [];
|
|
1664
1814
|
const id = best.name.slice(0, -".jsonl".length);
|
|
1665
|
-
return [best.name, ...isDir(
|
|
1815
|
+
return [best.name, ...isDir(path14.join(dir, id)) ? [id] : []];
|
|
1666
1816
|
}
|
|
1667
1817
|
function moveConversations(session, fromDir, toDir, tag = "old", opts = {}) {
|
|
1668
1818
|
const steps = [];
|
|
1669
1819
|
const moved = [];
|
|
1670
|
-
if (
|
|
1820
|
+
if (path14.resolve(fromDir) === path14.resolve(toDir)) return { moved };
|
|
1671
1821
|
const emptied = [];
|
|
1672
1822
|
let at = "";
|
|
1673
1823
|
try {
|
|
1674
1824
|
for (const cwd of sessionRunFolders(session, false)) {
|
|
1675
1825
|
const name = encodeProjectDir(cwd);
|
|
1676
|
-
const src =
|
|
1826
|
+
const src = path14.join(projectsRootOf(fromDir), name);
|
|
1677
1827
|
if (!isDir(src)) continue;
|
|
1678
1828
|
at = src;
|
|
1679
|
-
const dst =
|
|
1829
|
+
const dst = path14.join(projectsRootOf(toDir), name);
|
|
1680
1830
|
if (opts.onlyLatest) {
|
|
1681
1831
|
for (const entry of latestConversation(src)) {
|
|
1682
|
-
at =
|
|
1683
|
-
mergeInto(
|
|
1832
|
+
at = path14.join(src, entry);
|
|
1833
|
+
mergeInto(path14.join(src, entry), path14.join(dst, entry), tag, steps, moved);
|
|
1684
1834
|
}
|
|
1685
1835
|
continue;
|
|
1686
1836
|
}
|
|
@@ -1699,7 +1849,7 @@ function moveConversations(session, fromDir, toDir, tag = "old", opts = {}) {
|
|
|
1699
1849
|
}
|
|
1700
1850
|
for (const src of emptied) {
|
|
1701
1851
|
try {
|
|
1702
|
-
|
|
1852
|
+
fs13.rmdirSync(src);
|
|
1703
1853
|
} catch {
|
|
1704
1854
|
}
|
|
1705
1855
|
}
|
|
@@ -1747,12 +1897,8 @@ var claudeAgent = {
|
|
|
1747
1897
|
startedWithSessionHooks: startedWithSessionSettings,
|
|
1748
1898
|
// Its folder marked trusted on the session's account (`projects[<cwd>].hasTrustDialogAccepted`).
|
|
1749
1899
|
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
|
-
}
|
|
1900
|
+
// `--add-dir=<folder>` each, one argument, never twice (a restore's stored tool may have them already).
|
|
1901
|
+
withFolders: (tool, folders) => claudeWithFolders(tool, folders)
|
|
1756
1902
|
},
|
|
1757
1903
|
conversation: {
|
|
1758
1904
|
files: (s) => listTranscripts(s),
|
|
@@ -1776,8 +1922,8 @@ var claudeAgent = {
|
|
|
1776
1922
|
prLinks: claudePrLinks,
|
|
1777
1923
|
// In the session's own account's projects folder: that is where its `--continue` looks.
|
|
1778
1924
|
restoreDir: (s) => {
|
|
1779
|
-
const cwd = s.isGroup && s.paths[0] ?
|
|
1780
|
-
return cwd ?
|
|
1925
|
+
const cwd = s.isGroup && s.paths[0] ? path15.dirname(s.paths[0]) : s.paths[0];
|
|
1926
|
+
return cwd ? path15.join(projectsRootOf(accountDir(sessionAccount(s)) ?? void 0), encodeProjectDir(cwd)) : null;
|
|
1781
1927
|
}
|
|
1782
1928
|
},
|
|
1783
1929
|
events: claudeEvents,
|
|
@@ -1808,7 +1954,7 @@ var claudeAgent = {
|
|
|
1808
1954
|
denyRules: (repos) => claudeReadDenyRules(repos),
|
|
1809
1955
|
// Its flags were measured on one Claude Code (READ_ONLY_MIN_VERSION): an older one gets no checkout run.
|
|
1810
1956
|
// Loaded when a review asks: the hook processes load this adapter on every turn edge.
|
|
1811
|
-
available: async () => (await import("./version-
|
|
1957
|
+
available: async () => (await import("./version-VT2JXBQT.js")).claudeReadOnlyAvailable()
|
|
1812
1958
|
}
|
|
1813
1959
|
},
|
|
1814
1960
|
instructionsFile: "CLAUDE.md",
|
|
@@ -1816,9 +1962,42 @@ var claudeAgent = {
|
|
|
1816
1962
|
instructionsImport: (relPath) => `@${relPath}`,
|
|
1817
1963
|
workspace: claudeWorkspace,
|
|
1818
1964
|
skills: claudeSkills,
|
|
1965
|
+
// Claude Code kept up to date the way it was installed (tool-update.ts).
|
|
1966
|
+
selfUpdate: {
|
|
1967
|
+
enabled: (config) => config?.claudeCode?.autoUpdate !== false,
|
|
1968
|
+
run: async () => {
|
|
1969
|
+
const r = await keepClaudeUpdated();
|
|
1970
|
+
return {
|
|
1971
|
+
text: updateCheckText(r),
|
|
1972
|
+
failed: r.kind === "cannot" || r.kind === "not-yet" && r.why.startsWith("the update failed"),
|
|
1973
|
+
updated: r.kind === "updated"
|
|
1974
|
+
};
|
|
1975
|
+
}
|
|
1976
|
+
},
|
|
1819
1977
|
usage: claudeUsage,
|
|
1820
1978
|
accounts: claudeAccountSwitch
|
|
1821
1979
|
};
|
|
1980
|
+
function claudeWithFolders(tool, folders) {
|
|
1981
|
+
if (!folders.length) return tool;
|
|
1982
|
+
const ours = new Set(folders);
|
|
1983
|
+
const args = [];
|
|
1984
|
+
const have = /* @__PURE__ */ new Set();
|
|
1985
|
+
for (let i = 0; i < tool.baseArgs.length; i++) {
|
|
1986
|
+
const a = tool.baseArgs[i];
|
|
1987
|
+
const next = tool.baseArgs[i + 1];
|
|
1988
|
+
if (a === "--add-dir" && next !== void 0 && ours.has(next)) {
|
|
1989
|
+
args.push(`--add-dir=${next}`);
|
|
1990
|
+
have.add(next);
|
|
1991
|
+
i++;
|
|
1992
|
+
continue;
|
|
1993
|
+
}
|
|
1994
|
+
if (a.startsWith("--add-dir=")) have.add(a.slice("--add-dir=".length));
|
|
1995
|
+
args.push(a);
|
|
1996
|
+
}
|
|
1997
|
+
const add = folders.filter((f) => !have.has(f));
|
|
1998
|
+
const changed = add.length || args.length !== tool.baseArgs.length;
|
|
1999
|
+
return changed ? { ...tool, baseArgs: [...args, ...add.map((f) => `--add-dir=${f}`)] } : tool;
|
|
2000
|
+
}
|
|
1822
2001
|
|
|
1823
2002
|
// src/core/agents/index.ts
|
|
1824
2003
|
var settingsView = configView((p) => {
|
|
@@ -1847,7 +2026,7 @@ function plainAgent(id) {
|
|
|
1847
2026
|
launch: {
|
|
1848
2027
|
tool: (config) => getAiTool(config && getAiTool(config).cmd === id ? config : { aiCommand: id }),
|
|
1849
2028
|
canResume: () => false,
|
|
1850
|
-
resumeLaunch: (s) => ({ launchPath: s.isGroup ?
|
|
2029
|
+
resumeLaunch: (s) => ({ launchPath: s.isGroup ? path16.dirname(s.paths[0] ?? "") : s.paths[0] ?? "", hasConversation: false }),
|
|
1851
2030
|
cleanEnv: (env) => ({ ...env })
|
|
1852
2031
|
},
|
|
1853
2032
|
// Text, a pause, Enter — and no dialog to answer by keystroke (its screen is unknown).
|
|
@@ -1922,20 +2101,20 @@ function agentFor(config, session) {
|
|
|
1922
2101
|
}
|
|
1923
2102
|
|
|
1924
2103
|
// src/core/platform/package-root.ts
|
|
1925
|
-
import
|
|
1926
|
-
import
|
|
2104
|
+
import fs14 from "fs";
|
|
2105
|
+
import path17 from "path";
|
|
1927
2106
|
import { fileURLToPath } from "url";
|
|
1928
2107
|
var cached;
|
|
1929
2108
|
function packageRoot() {
|
|
1930
2109
|
if (cached !== void 0) return cached;
|
|
1931
|
-
let dir =
|
|
2110
|
+
let dir = path17.dirname(fileURLToPath(import.meta.url));
|
|
1932
2111
|
for (; ; ) {
|
|
1933
2112
|
try {
|
|
1934
|
-
const pkg = JSON.parse(
|
|
2113
|
+
const pkg = JSON.parse(fs14.readFileSync(path17.join(dir, "package.json"), "utf8"));
|
|
1935
2114
|
if (pkg.name === "@moberg_hr/work-tree") return cached = dir;
|
|
1936
2115
|
} catch {
|
|
1937
2116
|
}
|
|
1938
|
-
const up =
|
|
2117
|
+
const up = path17.dirname(dir);
|
|
1939
2118
|
if (up === dir) return cached = null;
|
|
1940
2119
|
dir = up;
|
|
1941
2120
|
}
|
|
@@ -1973,4 +2152,4 @@ export {
|
|
|
1973
2152
|
agentFor,
|
|
1974
2153
|
packageRoot
|
|
1975
2154
|
};
|
|
1976
|
-
//# sourceMappingURL=chunk-
|
|
2155
|
+
//# sourceMappingURL=chunk-3PO2LUY7.js.map
|