@moberg_hr/work-tree 2.6.4 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-SOJAHTL5.js +245 -0
- package/dist/account-SOJAHTL5.js.map +1 -0
- package/dist/{add-repo-J2KNR7S3.js → add-repo-B4ITRH4Q.js} +38 -33
- package/dist/{add-repo-J2KNR7S3.js.map → add-repo-B4ITRH4Q.js.map} +1 -1
- package/dist/{answer-3INUTHDR.js → answer-JHK4SZAH.js} +16 -12
- package/dist/{answer-3INUTHDR.js.map → answer-JHK4SZAH.js.map} +1 -1
- package/dist/{attach-EQARDJEU.js → attach-3IU7O7YE.js} +19 -15
- package/dist/{attach-EQARDJEU.js.map → attach-3IU7O7YE.js.map} +1 -1
- package/dist/bin.js +12 -8
- package/dist/bin.js.map +1 -1
- package/dist/{block-K2RSDPMB.js → block-JTA7ULQS.js} +16 -12
- package/dist/{block-K2RSDPMB.js.map → block-JTA7ULQS.js.map} +1 -1
- package/dist/{broadcast-NIFOTFCC.js → broadcast-JKPTCLUZ.js} +13 -9
- package/dist/{broadcast-NIFOTFCC.js.map → broadcast-JKPTCLUZ.js.map} +1 -1
- package/dist/{catchup-OF2EBZCA.js → catchup-MT55LLAS.js} +19 -15
- package/dist/{catchup-OF2EBZCA.js.map → catchup-MT55LLAS.js.map} +1 -1
- package/dist/{chunk-GTVQYGY3.js → chunk-26MWJLDS.js} +3 -3
- package/dist/{chunk-IID3W5PI.js → chunk-27BDXWSY.js} +9 -5
- package/dist/{chunk-IID3W5PI.js.map → chunk-27BDXWSY.js.map} +1 -1
- package/dist/{chunk-TQKIAQJT.js → chunk-27UC5NXT.js} +20 -16
- package/dist/chunk-27UC5NXT.js.map +1 -0
- package/dist/{chunk-2FUNUN5C.js → chunk-2MQWAQ2D.js} +8 -8
- package/dist/{chunk-G635EV2D.js → chunk-3N3UQEC4.js} +2 -2
- package/dist/{chunk-SMZ7W34L.js → chunk-3TN77GOI.js} +9 -4
- package/dist/chunk-3TN77GOI.js.map +1 -0
- package/dist/{chunk-QLTENN7R.js → chunk-45DVD6HF.js} +17 -13
- package/dist/{chunk-QLTENN7R.js.map → chunk-45DVD6HF.js.map} +1 -1
- package/dist/chunk-4NITDMDH.js +372 -0
- package/dist/chunk-4NITDMDH.js.map +1 -0
- package/dist/{chunk-EYUBVLPF.js → chunk-5QGCF3PS.js} +2 -2
- package/dist/{chunk-75MIXOUK.js → chunk-6THUVP6T.js} +27 -13
- package/dist/chunk-6THUVP6T.js.map +1 -0
- package/dist/{chunk-5ZGF2M52.js → chunk-7GGIVYWP.js} +7 -7
- package/dist/{chunk-MJNXAAJF.js → chunk-7NVEGPZT.js} +2 -2
- package/dist/{chunk-ZGXRWL7T.js → chunk-AU27USPZ.js} +2 -2
- package/dist/chunk-BOEAOIQT.js +43 -0
- package/dist/chunk-BOEAOIQT.js.map +1 -0
- package/dist/{chunk-HNFWIJRZ.js → chunk-BUX66OI7.js} +6 -6
- package/dist/{chunk-ZPJ5W2KB.js → chunk-C4T3F3XO.js} +4 -4
- package/dist/{chunk-ADGQADDE.js → chunk-CI4EAIMR.js} +23 -17
- package/dist/chunk-CI4EAIMR.js.map +1 -0
- package/dist/chunk-DJ2X4LKE.js +9 -0
- package/dist/{chunk-VESYLAVA.js → chunk-F6M255O5.js} +614 -314
- package/dist/chunk-F6M255O5.js.map +1 -0
- package/dist/chunk-FDKJFIUU.js +169 -0
- package/dist/chunk-FDKJFIUU.js.map +1 -0
- package/dist/{chunk-4VVIBQ4P.js → chunk-FMCSF2QB.js} +58 -53
- package/dist/chunk-FMCSF2QB.js.map +1 -0
- package/dist/{chunk-OUUDQA7O.js → chunk-GNGXYXBC.js} +2 -2
- package/dist/{chunk-ZYTZBGBP.js → chunk-HN2QQMMX.js} +22 -22
- package/dist/{chunk-MYDQNX7W.js → chunk-ICJPVSRY.js} +2 -2
- package/dist/{chunk-5UICLGJK.js → chunk-IRKYLDMX.js} +89 -13
- package/dist/chunk-IRKYLDMX.js.map +1 -0
- package/dist/{chunk-YIWGKZOZ.js → chunk-IWO4DILT.js} +10 -6
- package/dist/{chunk-YIWGKZOZ.js.map → chunk-IWO4DILT.js.map} +1 -1
- package/dist/{chunk-MHHVNQB4.js → chunk-IXC7JM35.js} +4 -4
- package/dist/{chunk-FBJKFNKX.js → chunk-J2AZIO22.js} +2 -2
- package/dist/{chunk-CGVYVTGF.js → chunk-J36ULZBO.js} +2 -2
- package/dist/{chunk-FO7B466S.js → chunk-JU5T3JIN.js} +10 -7
- package/dist/chunk-JU5T3JIN.js.map +1 -0
- package/dist/{chunk-24GXAENC.js → chunk-KH3TRWUV.js} +7 -7
- package/dist/chunk-KLY6QDA5.js +135 -0
- package/dist/chunk-KLY6QDA5.js.map +1 -0
- package/dist/{chunk-4RDAWJZY.js → chunk-KNRGVUW7.js} +3 -3
- package/dist/{chunk-TQTMLZFT.js → chunk-LKZSPHAT.js} +2 -2
- package/dist/{chunk-XWRVIEFW.js → chunk-LXU24GCM.js} +5 -5
- package/dist/{chunk-DAQCIJHW.js → chunk-M6LJ3GE3.js} +76 -10
- package/dist/chunk-M6LJ3GE3.js.map +1 -0
- package/dist/{chunk-ZM7MVV4D.js → chunk-MJGKE7XZ.js} +36 -17
- package/dist/chunk-MJGKE7XZ.js.map +1 -0
- package/dist/{chunk-35VLAPL2.js → chunk-MMFXUIQQ.js} +2 -2
- package/dist/{chunk-FSNKCSXO.js → chunk-MXA2RZBC.js} +5 -5
- package/dist/{chunk-UDRKYWQL.js → chunk-MZTPKKTO.js} +4 -4
- package/dist/{chunk-LFH74AIE.js → chunk-NMAJM3C5.js} +3 -3
- package/dist/{chunk-U7EQ2O6C.js → chunk-NPCBJV7T.js} +7 -5
- package/dist/{chunk-U7EQ2O6C.js.map → chunk-NPCBJV7T.js.map} +1 -1
- package/dist/{chunk-376P7NDW.js → chunk-OAVHTRML.js} +6 -4
- package/dist/{chunk-376P7NDW.js.map → chunk-OAVHTRML.js.map} +1 -1
- package/dist/{chunk-CRPV5YCC.js → chunk-OMIMK3LB.js} +2 -2
- package/dist/chunk-P2HOLCBF.js +34 -0
- package/dist/chunk-P2HOLCBF.js.map +1 -0
- package/dist/{chunk-56P7G2DI.js → chunk-P4EQWC5W.js} +2 -2
- package/dist/{chunk-MSZQUJZZ.js → chunk-QLAVWIDJ.js} +45 -28
- package/dist/chunk-QLAVWIDJ.js.map +1 -0
- package/dist/chunk-RCGFHJM7.js +81 -0
- package/dist/chunk-RCGFHJM7.js.map +1 -0
- package/dist/{chunk-EUAJT7FS.js → chunk-RGUSVBGN.js} +2 -2
- package/dist/{chunk-ZO6MZNLI.js → chunk-S3BAD4IR.js} +2 -2
- package/dist/{chunk-BDIAIO3H.js → chunk-SDQI3QB3.js} +3 -3
- package/dist/{chunk-Z3NQJALE.js → chunk-SG5LUMGE.js} +3 -3
- package/dist/chunk-UBOKRHNV.js +134 -0
- package/dist/chunk-UBOKRHNV.js.map +1 -0
- package/dist/chunk-UESDYZG3.js +442 -0
- package/dist/chunk-UESDYZG3.js.map +1 -0
- package/dist/{chunk-XEPH5FCH.js → chunk-WTF4CYHH.js} +7 -7
- package/dist/{chunk-TJFX5BWH.js → chunk-X4AXKO3A.js} +2 -2
- package/dist/{chunk-RYEPQLXQ.js → chunk-XNLQSW6J.js} +23 -115
- package/dist/chunk-XNLQSW6J.js.map +1 -0
- package/dist/{chunk-OUWKEJEC.js → chunk-YEXW2OCN.js} +11 -34
- package/dist/chunk-YEXW2OCN.js.map +1 -0
- package/dist/{chunk-2X5TDKGV.js → chunk-YKMURNKL.js} +11 -43
- package/dist/chunk-YKMURNKL.js.map +1 -0
- package/dist/{chunk-JSSQ3P73.js → chunk-YRW4YF4U.js} +60 -10
- package/dist/chunk-YRW4YF4U.js.map +1 -0
- package/dist/{chunk-JF72AS6T.js → chunk-YYBXQBW2.js} +3 -3
- package/dist/{chunk-TNU4PRE6.js → chunk-YZPP6354.js} +5 -5
- package/dist/chunk-ZDMJPEBO.js +31 -0
- package/dist/chunk-ZDMJPEBO.js.map +1 -0
- package/dist/chunk-ZXHMC7UO.js +106 -0
- package/dist/chunk-ZXHMC7UO.js.map +1 -0
- package/dist/{cleanup-JYKSRN2G.js → cleanup-PNTCVB2S.js} +33 -28
- package/dist/{cleanup-JYKSRN2G.js.map → cleanup-PNTCVB2S.js.map} +1 -1
- package/dist/cli-OYO6OXNK.js +19 -0
- package/dist/command-hook-installer-7Q7UD7AU.js +98 -0
- package/dist/command-hook-installer-7Q7UD7AU.js.map +1 -0
- package/dist/{config-AABHS4J2.js → config-VILJYT6P.js} +20 -15
- package/dist/{config-AABHS4J2.js.map → config-VILJYT6P.js.map} +1 -1
- package/dist/{diff-NLYS5TIG.js → diff-J6VRJYKR.js} +18 -14
- package/dist/{diff-NLYS5TIG.js.map → diff-J6VRJYKR.js.map} +1 -1
- package/dist/{digest-SSY2TNMB.js → digest-GMJLCYTF.js} +15 -11
- package/dist/{digest-SSY2TNMB.js.map → digest-GMJLCYTF.js.map} +1 -1
- package/dist/{fork-KDMSZB5E.js → fork-NNHH2BXV.js} +35 -31
- package/dist/{fork-KDMSZB5E.js.map → fork-NNHH2BXV.js.map} +1 -1
- package/dist/{history-6KGCW2WA.js → history-52MGO5V5.js} +14 -8
- package/dist/{hook-5YZBX64G.js → hook-SWX7NXJN.js} +22 -20
- package/dist/{hook-5YZBX64G.js.map → hook-SWX7NXJN.js.map} +1 -1
- package/dist/{hydrate-FL2BCC7M.js → hydrate-F5XVXZ2T.js} +14 -10
- package/dist/{hydrate-FL2BCC7M.js.map → hydrate-F5XVXZ2T.js.map} +1 -1
- package/dist/{init-5RZXYR7N.js → init-MRGRQWQM.js} +15 -11
- package/dist/{init-5RZXYR7N.js.map → init-MRGRQWQM.js.map} +1 -1
- package/dist/install-skills-QTWYVAOZ.js +20 -0
- package/dist/install-skills-bin.js +9 -3
- package/dist/install-skills-bin.js.map +1 -1
- package/dist/{list-7QPCYMVP.js → list-5MMNVGNN.js} +14 -10
- package/dist/{list-7QPCYMVP.js.map → list-5MMNVGNN.js.map} +1 -1
- package/dist/{move-QTLHMYRT.js → move-DUYNTJP2.js} +47 -22
- package/dist/move-DUYNTJP2.js.map +1 -0
- package/dist/{note-QE3VB77M.js → note-SZCVRH4D.js} +16 -12
- package/dist/{note-QE3VB77M.js.map → note-SZCVRH4D.js.map} +1 -1
- package/dist/{overlaps-6QOJU37M.js → overlaps-QANRNFZC.js} +14 -10
- package/dist/{overlaps-6QOJU37M.js.map → overlaps-QANRNFZC.js.map} +1 -1
- package/dist/{pin-LS3I7W3V.js → pin-UZGC26LU.js} +16 -12
- package/dist/{pin-LS3I7W3V.js.map → pin-UZGC26LU.js.map} +1 -1
- package/dist/{pr-ARGKUTRB.js → pr-EKNBGR6X.js} +20 -16
- package/dist/{pr-ARGKUTRB.js.map → pr-EKNBGR6X.js.map} +1 -1
- package/dist/{prune-OAWQZHHQ.js → prune-AOR4R3CT.js} +31 -27
- package/dist/{prune-OAWQZHHQ.js.map → prune-AOR4R3CT.js.map} +1 -1
- package/dist/{pty-host-DVHFTOIW.js → pty-host-LYE546KI.js} +145 -39
- package/dist/pty-host-LYE546KI.js.map +1 -0
- package/dist/{read-QSUCR7Q2.js → read-APEM6NPD.js} +15 -11
- package/dist/{read-QSUCR7Q2.js.map → read-APEM6NPD.js.map} +1 -1
- package/dist/{recent-YQTDHLRE.js → recent-N7JQCDRG.js} +23 -12
- package/dist/recent-N7JQCDRG.js.map +1 -0
- package/dist/{remove-I3RJIOVP.js → remove-QM5CRMEG.js} +30 -26
- package/dist/{remove-I3RJIOVP.js.map → remove-QM5CRMEG.js.map} +1 -1
- package/dist/{report-JEG2FKOB.js → report-J7TUQRJS.js} +3 -4
- package/dist/{restart-UDXVORL2.js → restart-O6DYGEMN.js} +16 -12
- package/dist/{restart-UDXVORL2.js.map → restart-O6DYGEMN.js.map} +1 -1
- package/dist/{resume-LMOST4UO.js → resume-P5DQOZ2R.js} +17 -12
- package/dist/resume-P5DQOZ2R.js.map +1 -0
- package/dist/{run-LS4SS4D7.js → run-PSGYELSP.js} +12 -8
- package/dist/{run-LS4SS4D7.js.map → run-PSGYELSP.js.map} +1 -1
- package/dist/{screen-QTVQDNZM.js → screen-EBITKGXW.js} +16 -12
- package/dist/{screen-QTVQDNZM.js.map → screen-EBITKGXW.js.map} +1 -1
- package/dist/{search-CJA7VHRD.js → search-MM35D6P4.js} +12 -8
- package/dist/{search-CJA7VHRD.js.map → search-MM35D6P4.js.map} +1 -1
- package/dist/{section-NOTTKMKJ.js → section-6C6N7KKF.js} +16 -12
- package/dist/{section-NOTTKMKJ.js.map → section-6C6N7KKF.js.map} +1 -1
- package/dist/{send-O3YA6SGT.js → send-ASTESOMV.js} +23 -19
- package/dist/{send-O3YA6SGT.js.map → send-ASTESOMV.js.map} +1 -1
- package/dist/{sessions-C3IUXV5G.js → sessions-JTZF776H.js} +25 -21
- package/dist/{sessions-C3IUXV5G.js.map → sessions-JTZF776H.js.map} +1 -1
- package/dist/{snooze-2RSHIHKF.js → snooze-M2IOYZSD.js} +15 -11
- package/dist/{snooze-2RSHIHKF.js.map → snooze-M2IOYZSD.js.map} +1 -1
- package/dist/{start-RWRNHJQ4.js → start-HIBG7DYS.js} +16 -12
- package/dist/{start-RWRNHJQ4.js.map → start-HIBG7DYS.js.map} +1 -1
- package/dist/{state-2J4TR7IC.js → state-DC73V5TS.js} +6 -5
- package/dist/{state-2J4TR7IC.js.map → state-DC73V5TS.js.map} +1 -1
- package/dist/{status-RI6OCK7U.js → status-JSM6FETL.js} +13 -9
- package/dist/{status-RI6OCK7U.js.map → status-JSM6FETL.js.map} +1 -1
- package/dist/statusline-A2DTGLK5.js +105 -0
- package/dist/statusline-A2DTGLK5.js.map +1 -0
- package/dist/statusline-hook-OVWHHFBV.js +63 -0
- package/dist/statusline-hook-OVWHHFBV.js.map +1 -0
- package/dist/{stop-2SCT3PEV.js → stop-IEMNFVGW.js} +16 -12
- package/dist/{stop-2SCT3PEV.js.map → stop-IEMNFVGW.js.map} +1 -1
- package/dist/{sync-VFFDCH4N.js → sync-FP4J5ODY.js} +31 -27
- package/dist/{sync-VFFDCH4N.js.map → sync-FP4J5ODY.js.map} +1 -1
- package/dist/{time-ADXHL6QP.js → time-QHLGCYPZ.js} +17 -13
- package/dist/{time-ADXHL6QP.js.map → time-QHLGCYPZ.js.map} +1 -1
- package/dist/time-actions-4YP5DZKQ.js +16 -0
- package/dist/{timesheet-RCFXIWRZ.js → timesheet-LSUOCD6V.js} +19 -15
- package/dist/{timesheet-RCFXIWRZ.js.map → timesheet-LSUOCD6V.js.map} +1 -1
- package/dist/{todo-FXPXLXXW.js → todo-4VTGOCKH.js} +7 -6
- package/dist/{todo-FXPXLXXW.js.map → todo-4VTGOCKH.js.map} +1 -1
- package/dist/{tree-EYDQUMZY.js → tree-VTQRBC7I.js} +42 -30
- package/dist/tree-VTQRBC7I.js.map +1 -0
- package/dist/{update-OVZRE7IN.js → update-VL67LR6U.js} +18 -14
- package/dist/{update-OVZRE7IN.js.map → update-VL67LR6U.js.map} +1 -1
- package/dist/usage-EMZVZZEQ.js +84 -0
- package/dist/usage-EMZVZZEQ.js.map +1 -0
- package/dist/{wait-VSDT3KFB.js → wait-HQTY7OW5.js} +16 -12
- package/dist/{wait-VSDT3KFB.js.map → wait-HQTY7OW5.js.map} +1 -1
- package/dist/wd-bin.js +10 -9
- package/dist/wd-bin.js.map +1 -1
- package/dist/web/assets/{PtyView-Cl0maIsn.js → PtyView-BMRi1NT9.js} +2 -2
- package/dist/web/assets/{PtyView-Cl0maIsn.js.map → PtyView-BMRi1NT9.js.map} +1 -1
- package/dist/web/assets/index-BCCeJjez.css +1 -0
- package/dist/web/assets/index-By_qebb-.js +119 -0
- package/dist/web/assets/index-By_qebb-.js.map +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-ZW37IV76.js → web-6QSSPH4I.js} +601 -385
- package/dist/web-6QSSPH4I.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/chunk-2X5TDKGV.js.map +0 -1
- package/dist/chunk-4VVIBQ4P.js.map +0 -1
- package/dist/chunk-5UICLGJK.js.map +0 -1
- package/dist/chunk-75MIXOUK.js.map +0 -1
- package/dist/chunk-ADGQADDE.js.map +0 -1
- package/dist/chunk-DAQCIJHW.js.map +0 -1
- package/dist/chunk-FO7B466S.js.map +0 -1
- package/dist/chunk-GQVV3EMN.js +0 -9
- package/dist/chunk-JSSQ3P73.js.map +0 -1
- package/dist/chunk-MSZQUJZZ.js.map +0 -1
- package/dist/chunk-OUWKEJEC.js.map +0 -1
- package/dist/chunk-RYEPQLXQ.js.map +0 -1
- package/dist/chunk-SMZ7W34L.js.map +0 -1
- package/dist/chunk-TQKIAQJT.js.map +0 -1
- package/dist/chunk-TUFQJXXO.js +0 -19
- package/dist/chunk-TUFQJXXO.js.map +0 -1
- package/dist/chunk-VESYLAVA.js.map +0 -1
- package/dist/chunk-ZM7MVV4D.js.map +0 -1
- package/dist/cli-OTCENNUJ.js +0 -18
- package/dist/command-hook-installer-W7IEVT6V.js +0 -204
- package/dist/command-hook-installer-W7IEVT6V.js.map +0 -1
- package/dist/install-skills-TFP6EHI3.js +0 -14
- package/dist/move-QTLHMYRT.js.map +0 -1
- package/dist/pty-host-DVHFTOIW.js.map +0 -1
- package/dist/recent-YQTDHLRE.js.map +0 -1
- package/dist/resume-LMOST4UO.js.map +0 -1
- package/dist/time-actions-LMJUFDDR.js +0 -15
- package/dist/tree-EYDQUMZY.js.map +0 -1
- package/dist/web/assets/index-DywhirOd.css +0 -1
- package/dist/web/assets/index-mP4gis5R.js +0 -119
- package/dist/web/assets/index-mP4gis5R.js.map +0 -1
- package/dist/web-ZW37IV76.js.map +0 -1
- /package/dist/{chunk-GTVQYGY3.js.map → chunk-26MWJLDS.js.map} +0 -0
- /package/dist/{chunk-2FUNUN5C.js.map → chunk-2MQWAQ2D.js.map} +0 -0
- /package/dist/{chunk-G635EV2D.js.map → chunk-3N3UQEC4.js.map} +0 -0
- /package/dist/{chunk-EYUBVLPF.js.map → chunk-5QGCF3PS.js.map} +0 -0
- /package/dist/{chunk-5ZGF2M52.js.map → chunk-7GGIVYWP.js.map} +0 -0
- /package/dist/{chunk-MJNXAAJF.js.map → chunk-7NVEGPZT.js.map} +0 -0
- /package/dist/{chunk-ZGXRWL7T.js.map → chunk-AU27USPZ.js.map} +0 -0
- /package/dist/{chunk-HNFWIJRZ.js.map → chunk-BUX66OI7.js.map} +0 -0
- /package/dist/{chunk-ZPJ5W2KB.js.map → chunk-C4T3F3XO.js.map} +0 -0
- /package/dist/{chunk-GQVV3EMN.js.map → chunk-DJ2X4LKE.js.map} +0 -0
- /package/dist/{chunk-OUUDQA7O.js.map → chunk-GNGXYXBC.js.map} +0 -0
- /package/dist/{chunk-ZYTZBGBP.js.map → chunk-HN2QQMMX.js.map} +0 -0
- /package/dist/{chunk-MYDQNX7W.js.map → chunk-ICJPVSRY.js.map} +0 -0
- /package/dist/{chunk-MHHVNQB4.js.map → chunk-IXC7JM35.js.map} +0 -0
- /package/dist/{chunk-FBJKFNKX.js.map → chunk-J2AZIO22.js.map} +0 -0
- /package/dist/{chunk-CGVYVTGF.js.map → chunk-J36ULZBO.js.map} +0 -0
- /package/dist/{chunk-24GXAENC.js.map → chunk-KH3TRWUV.js.map} +0 -0
- /package/dist/{chunk-4RDAWJZY.js.map → chunk-KNRGVUW7.js.map} +0 -0
- /package/dist/{chunk-TQTMLZFT.js.map → chunk-LKZSPHAT.js.map} +0 -0
- /package/dist/{chunk-XWRVIEFW.js.map → chunk-LXU24GCM.js.map} +0 -0
- /package/dist/{chunk-35VLAPL2.js.map → chunk-MMFXUIQQ.js.map} +0 -0
- /package/dist/{chunk-FSNKCSXO.js.map → chunk-MXA2RZBC.js.map} +0 -0
- /package/dist/{chunk-UDRKYWQL.js.map → chunk-MZTPKKTO.js.map} +0 -0
- /package/dist/{chunk-LFH74AIE.js.map → chunk-NMAJM3C5.js.map} +0 -0
- /package/dist/{chunk-CRPV5YCC.js.map → chunk-OMIMK3LB.js.map} +0 -0
- /package/dist/{chunk-56P7G2DI.js.map → chunk-P4EQWC5W.js.map} +0 -0
- /package/dist/{chunk-EUAJT7FS.js.map → chunk-RGUSVBGN.js.map} +0 -0
- /package/dist/{chunk-ZO6MZNLI.js.map → chunk-S3BAD4IR.js.map} +0 -0
- /package/dist/{chunk-BDIAIO3H.js.map → chunk-SDQI3QB3.js.map} +0 -0
- /package/dist/{chunk-Z3NQJALE.js.map → chunk-SG5LUMGE.js.map} +0 -0
- /package/dist/{chunk-XEPH5FCH.js.map → chunk-WTF4CYHH.js.map} +0 -0
- /package/dist/{chunk-TJFX5BWH.js.map → chunk-X4AXKO3A.js.map} +0 -0
- /package/dist/{chunk-JF72AS6T.js.map → chunk-YYBXQBW2.js.map} +0 -0
- /package/dist/{chunk-TNU4PRE6.js.map → chunk-YZPP6354.js.map} +0 -0
- /package/dist/{cli-OTCENNUJ.js.map → cli-OYO6OXNK.js.map} +0 -0
- /package/dist/{history-6KGCW2WA.js.map → history-52MGO5V5.js.map} +0 -0
- /package/dist/{install-skills-TFP6EHI3.js.map → install-skills-QTWYVAOZ.js.map} +0 -0
- /package/dist/{report-JEG2FKOB.js.map → report-J7TUQRJS.js.map} +0 -0
- /package/dist/{time-actions-LMJUFDDR.js.map → time-actions-4YP5DZKQ.js.map} +0 -0
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
readReadings
|
|
4
|
+
} from "./chunk-RCGFHJM7.js";
|
|
5
|
+
import {
|
|
6
|
+
accountDir,
|
|
7
|
+
accountEnv,
|
|
8
|
+
accountForbiddenRoots,
|
|
9
|
+
accountProblem,
|
|
10
|
+
claudeAccounts,
|
|
11
|
+
configDirEnv,
|
|
12
|
+
configView,
|
|
13
|
+
defaultAccountName,
|
|
14
|
+
expandAccountDir,
|
|
15
|
+
isLoggedIn,
|
|
16
|
+
sessionAccount,
|
|
17
|
+
setUpAccounts,
|
|
18
|
+
validateClaudeAccounts
|
|
19
|
+
} from "./chunk-FDKJFIUU.js";
|
|
20
|
+
import {
|
|
21
|
+
DEFAULT_ACCOUNT,
|
|
22
|
+
getConfigPath,
|
|
23
|
+
isAgentId,
|
|
24
|
+
loadConfig
|
|
25
|
+
} from "./chunk-XNLQSW6J.js";
|
|
26
|
+
import {
|
|
27
|
+
accountOf,
|
|
28
|
+
bootTime,
|
|
29
|
+
processTable,
|
|
30
|
+
savedPath
|
|
31
|
+
} from "./chunk-4NITDMDH.js";
|
|
2
32
|
import {
|
|
3
33
|
spawn_default
|
|
4
34
|
} from "./chunk-RCYI7SRA.js";
|
|
5
35
|
import {
|
|
6
36
|
atomicWriteFile,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "./chunk-RYEPQLXQ.js";
|
|
37
|
+
withFileLock
|
|
38
|
+
} from "./chunk-ZXHMC7UO.js";
|
|
10
39
|
|
|
11
40
|
// src/core/platform/ai-launcher.ts
|
|
12
41
|
import fs from "fs";
|
|
@@ -69,178 +98,6 @@ function buildAiLaunchArgs(tool, opts = {}) {
|
|
|
69
98
|
return { cmd: tool.cmd, args };
|
|
70
99
|
}
|
|
71
100
|
|
|
72
|
-
// src/core/platform/process.ts
|
|
73
|
-
import fs2 from "fs";
|
|
74
|
-
import os from "os";
|
|
75
|
-
import { execFile, spawn, spawnSync } from "child_process";
|
|
76
|
-
function detachHere(platform = process.platform) {
|
|
77
|
-
return platform !== "win32";
|
|
78
|
-
}
|
|
79
|
-
function isPidAlive(pid) {
|
|
80
|
-
try {
|
|
81
|
-
process.kill(pid, 0);
|
|
82
|
-
} catch {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
return !isZombie(pid);
|
|
86
|
-
}
|
|
87
|
-
function isZombie(pid, read = procFs, platform = process.platform) {
|
|
88
|
-
if (platform !== "linux") return false;
|
|
89
|
-
const stat = read.file(`/proc/${pid}/stat`) ?? "";
|
|
90
|
-
const close = stat.lastIndexOf(")");
|
|
91
|
-
return close >= 0 && stat[close + 2] === "Z";
|
|
92
|
-
}
|
|
93
|
-
var procFs = {
|
|
94
|
-
link: (p) => {
|
|
95
|
-
try {
|
|
96
|
-
return fs2.readlinkSync(p);
|
|
97
|
-
} catch {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
file: (p) => {
|
|
102
|
-
try {
|
|
103
|
-
return fs2.readFileSync(p, "utf-8");
|
|
104
|
-
} catch {
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
pids: () => {
|
|
109
|
-
try {
|
|
110
|
-
return fs2.readdirSync("/proc").filter((n) => /^\d+$/.test(n)).map(Number);
|
|
111
|
-
} catch {
|
|
112
|
-
return [];
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
var baseName = (p) => p.split("/").pop() || p;
|
|
117
|
-
function linuxProcessName(pid, read = procFs) {
|
|
118
|
-
const exe = read.link(`/proc/${pid}/exe`);
|
|
119
|
-
if (exe) return baseName(exe.replace(/ \(deleted\)$/, ""));
|
|
120
|
-
const argv0 = (read.file(`/proc/${pid}/cmdline`) ?? "").split("\0")[0];
|
|
121
|
-
if (argv0) return baseName(argv0.split(" ")[0]);
|
|
122
|
-
const comm = (read.file(`/proc/${pid}/comm`) ?? "").trim();
|
|
123
|
-
return comm || null;
|
|
124
|
-
}
|
|
125
|
-
function linuxProcessTable(read = procFs) {
|
|
126
|
-
const out = /* @__PURE__ */ new Map();
|
|
127
|
-
for (const pid of read.pids()) {
|
|
128
|
-
const name = linuxProcessName(pid, read);
|
|
129
|
-
if (name) out.set(pid, name);
|
|
130
|
-
}
|
|
131
|
-
return out;
|
|
132
|
-
}
|
|
133
|
-
function processName(pid) {
|
|
134
|
-
try {
|
|
135
|
-
if (process.platform === "win32") {
|
|
136
|
-
const r2 = spawnSync("tasklist", ["/FI", `PID eq ${pid}`, "/FO", "CSV", "/NH"], {
|
|
137
|
-
encoding: "utf-8",
|
|
138
|
-
windowsHide: true,
|
|
139
|
-
timeout: 5e3
|
|
140
|
-
});
|
|
141
|
-
const m = /^"([^"]+)","(\d+)"/.exec((r2.stdout ?? "").trim());
|
|
142
|
-
return m && Number(m[2]) === pid ? m[1] : null;
|
|
143
|
-
}
|
|
144
|
-
if (process.platform === "linux") return isPidAlive(pid) ? linuxProcessName(pid) : null;
|
|
145
|
-
const r = spawnSync("ps", ["-o", "comm=", "-p", String(pid)], { encoding: "utf-8", timeout: 5e3, windowsHide: true });
|
|
146
|
-
const name = (r.stdout ?? "").trim();
|
|
147
|
-
return r.status === 0 && name ? name.split("/").pop() : null;
|
|
148
|
-
} catch {
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
var recentTable = null;
|
|
153
|
-
var refreshingTable = null;
|
|
154
|
-
function recentProcessTable(maxAgeMs, now = Date.now()) {
|
|
155
|
-
if (!recentTable || now - recentTable.at >= maxAgeMs) {
|
|
156
|
-
refreshingTable ??= processTableAsync().then((table) => void (table.size > 0 && (recentTable = { at: Date.now(), table }))).finally(() => void (refreshingTable = null));
|
|
157
|
-
}
|
|
158
|
-
return recentTable?.table ?? null;
|
|
159
|
-
}
|
|
160
|
-
function processTableAsync() {
|
|
161
|
-
if (process.platform === "linux") return Promise.resolve(linuxProcessTable());
|
|
162
|
-
return new Promise((resolve) => {
|
|
163
|
-
const win = process.platform === "win32";
|
|
164
|
-
const [cmd, args] = win ? ["tasklist", ["/FO", "CSV", "/NH"]] : ["ps", ["-A", "-o", "pid=,comm="]];
|
|
165
|
-
execFile(
|
|
166
|
-
cmd,
|
|
167
|
-
args,
|
|
168
|
-
{ encoding: "utf-8", windowsHide: true, timeout: 8e3, maxBuffer: 16 * 1024 * 1024 },
|
|
169
|
-
(_err, stdout) => {
|
|
170
|
-
resolve(parseProcessTable(stdout ?? "", win));
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
function parseProcessTable(stdout, win) {
|
|
176
|
-
const out = /* @__PURE__ */ new Map();
|
|
177
|
-
for (const line of stdout.split(/\r?\n/)) {
|
|
178
|
-
if (win) {
|
|
179
|
-
const m = /^"([^"]+)","(\d+)"/.exec(line);
|
|
180
|
-
if (m) out.set(Number(m[2]), m[1]);
|
|
181
|
-
} else {
|
|
182
|
-
const m = /^\s*(\d+)\s+(.+)$/.exec(line);
|
|
183
|
-
if (m) out.set(Number(m[1]), m[2].trim().split("/").pop());
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
return out;
|
|
187
|
-
}
|
|
188
|
-
function processTable() {
|
|
189
|
-
if (process.platform === "linux") return linuxProcessTable();
|
|
190
|
-
try {
|
|
191
|
-
const win = process.platform === "win32";
|
|
192
|
-
const r = win ? spawnSync("tasklist", ["/FO", "CSV", "/NH"], { encoding: "utf-8", windowsHide: true, timeout: 8e3, maxBuffer: 16 * 1024 * 1024 }) : spawnSync("ps", ["-A", "-o", "pid=,comm="], { encoding: "utf-8", timeout: 8e3, windowsHide: true, maxBuffer: 16 * 1024 * 1024 });
|
|
193
|
-
return parseProcessTable(r.stdout ?? "", win);
|
|
194
|
-
} catch {
|
|
195
|
-
return /* @__PURE__ */ new Map();
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
function bootTime() {
|
|
199
|
-
return Date.now() - os.uptime() * 1e3;
|
|
200
|
-
}
|
|
201
|
-
function killTree(pid) {
|
|
202
|
-
if (process.platform === "win32") {
|
|
203
|
-
return spawnSync("taskkill", ["/PID", String(pid), "/T", "/F"], { stdio: "ignore", windowsHide: true }).status === 0;
|
|
204
|
-
}
|
|
205
|
-
try {
|
|
206
|
-
process.kill(pid);
|
|
207
|
-
return true;
|
|
208
|
-
} catch {
|
|
209
|
-
return false;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
function killTreeAsync(pid) {
|
|
213
|
-
if (process.platform !== "win32") return Promise.resolve(killTree(pid) || !isPidAlive(pid));
|
|
214
|
-
return new Promise(
|
|
215
|
-
(resolve) => (
|
|
216
|
-
// taskkill fails the whole call when one child had already exited or won't go; the top gone is what counts.
|
|
217
|
-
execFile(
|
|
218
|
-
"taskkill",
|
|
219
|
-
["/PID", String(pid), "/T", "/F"],
|
|
220
|
-
{ windowsHide: true, timeout: 1e4 },
|
|
221
|
-
(err) => resolve(!err || !isPidAlive(pid))
|
|
222
|
-
)
|
|
223
|
-
)
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
function spawnDetachedWork(workBin, args, logFile) {
|
|
227
|
-
const log = fs2.openSync(logFile, "a");
|
|
228
|
-
try {
|
|
229
|
-
const child = spawn(process.execPath, [workBin, ...args], {
|
|
230
|
-
detached: true,
|
|
231
|
-
stdio: ["ignore", log, log],
|
|
232
|
-
windowsHide: true,
|
|
233
|
-
// Not the caller's folder: a long-lived server working from it keeps it
|
|
234
|
-
// in use on Windows — a worktree then can't be removed, the desktop
|
|
235
|
-
// app's install folder can't be updated.
|
|
236
|
-
cwd: os.homedir()
|
|
237
|
-
});
|
|
238
|
-
child.unref();
|
|
239
|
-
} finally {
|
|
240
|
-
fs2.closeSync(log);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
101
|
// src/core/platform/internal-run.ts
|
|
245
102
|
var INTERNAL_RUN_ENV = "WORK_INTERNAL_CLAUDE";
|
|
246
103
|
function internalRunEnv() {
|
|
@@ -250,30 +107,63 @@ function isInternalRun() {
|
|
|
250
107
|
return process.env[INTERNAL_RUN_ENV] === "1";
|
|
251
108
|
}
|
|
252
109
|
|
|
110
|
+
// src/core/platform/env-delta.ts
|
|
111
|
+
function applyEnvDelta(env, delta, platform = process.platform) {
|
|
112
|
+
if (!delta) return { ...env };
|
|
113
|
+
const fold = (k) => platform === "win32" ? k.toUpperCase() : k;
|
|
114
|
+
const names = new Set(Object.keys(delta).map(fold));
|
|
115
|
+
const out = Object.fromEntries(Object.entries(env).filter(([k]) => !names.has(fold(k))));
|
|
116
|
+
for (const [k, v] of Object.entries(delta)) if (v !== null) out[k] = v;
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
var hasEnvDelta = (delta) => !!delta && Object.keys(delta).length > 0;
|
|
120
|
+
var isEnvDelta = (x) => !!x && typeof x === "object" && !Array.isArray(x) && Object.values(x).every((v) => v === null || typeof v === "string");
|
|
121
|
+
var envArgs = (delta) => hasEnvDelta(delta) ? [delta] : [];
|
|
122
|
+
|
|
123
|
+
// src/core/worktree/own-checkout.ts
|
|
124
|
+
import path from "path";
|
|
125
|
+
var key = (p) => path.resolve(p).replace(/\\/g, "/").replace(/\/+$/, "").toLowerCase();
|
|
126
|
+
function isOwnCheckout(s, repos) {
|
|
127
|
+
const own = new Set(Object.values(repos).map(key));
|
|
128
|
+
return s.paths.some((p) => own.has(key(p)));
|
|
129
|
+
}
|
|
130
|
+
function ownCheckoutNote(s) {
|
|
131
|
+
const branch = s.branch || "its branch";
|
|
132
|
+
return `[work] This folder is ${s.target}'s own checkout, which work keeps on ${branch}. Don't create, switch or check out branches here, and don't open pull requests from it \u2014 work manages branches. If the task needs a branch of its own, say so and ask the user to start a worktree for it (\`work tree ${s.target} <branch>\`).`;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// src/core/agents/types.ts
|
|
136
|
+
var AccountAdminError = class extends Error {
|
|
137
|
+
constructor(message, sessions = [], kind) {
|
|
138
|
+
super(message);
|
|
139
|
+
this.sessions = sessions;
|
|
140
|
+
this.kind = kind;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
253
144
|
// src/core/agents/index.ts
|
|
254
|
-
import
|
|
255
|
-
import path7 from "path";
|
|
145
|
+
import path11 from "path";
|
|
256
146
|
|
|
257
147
|
// src/core/agents/claude/adapter.ts
|
|
258
|
-
import
|
|
148
|
+
import path10 from "path";
|
|
259
149
|
|
|
260
150
|
// src/core/agents/claude/files.ts
|
|
261
|
-
import
|
|
262
|
-
import
|
|
151
|
+
import fs3 from "fs";
|
|
152
|
+
import path3 from "path";
|
|
263
153
|
|
|
264
154
|
// src/core/agents/claude/activity.ts
|
|
265
|
-
import
|
|
266
|
-
import
|
|
267
|
-
import
|
|
155
|
+
import fs2 from "fs";
|
|
156
|
+
import os from "os";
|
|
157
|
+
import path2 from "path";
|
|
268
158
|
function encodeProjectDir(p) {
|
|
269
|
-
return
|
|
159
|
+
return path2.resolve(p).replace(/[^A-Za-z0-9]/g, "-");
|
|
270
160
|
}
|
|
271
161
|
var listings = /* @__PURE__ */ new Map();
|
|
272
162
|
var NAMES_MAX_AGE_MS = 2e3;
|
|
273
163
|
function projectTranscripts(projectDir, now = Date.now()) {
|
|
274
164
|
let dirMtimeMs;
|
|
275
165
|
try {
|
|
276
|
-
dirMtimeMs =
|
|
166
|
+
dirMtimeMs = fs2.statSync(projectDir).mtimeMs;
|
|
277
167
|
} catch {
|
|
278
168
|
listings.delete(projectDir);
|
|
279
169
|
return [];
|
|
@@ -282,7 +172,7 @@ function projectTranscripts(projectDir, now = Date.now()) {
|
|
|
282
172
|
if (!hit || hit.dirMtimeMs !== dirMtimeMs || now - hit.at >= NAMES_MAX_AGE_MS) {
|
|
283
173
|
let names = [];
|
|
284
174
|
try {
|
|
285
|
-
names =
|
|
175
|
+
names = fs2.readdirSync(projectDir).filter((n) => n.endsWith(".jsonl"));
|
|
286
176
|
} catch {
|
|
287
177
|
}
|
|
288
178
|
hit = { at: now, dirMtimeMs, names };
|
|
@@ -291,8 +181,8 @@ function projectTranscripts(projectDir, now = Date.now()) {
|
|
|
291
181
|
const files = [];
|
|
292
182
|
for (const name of hit.names) {
|
|
293
183
|
try {
|
|
294
|
-
const file =
|
|
295
|
-
const st =
|
|
184
|
+
const file = path2.join(projectDir, name);
|
|
185
|
+
const st = fs2.statSync(file);
|
|
296
186
|
files.push({ file, mtimeMs: st.mtimeMs, size: st.size });
|
|
297
187
|
} catch {
|
|
298
188
|
}
|
|
@@ -304,28 +194,54 @@ function latestJsonlMtimeMs(projectDir) {
|
|
|
304
194
|
for (const f of projectTranscripts(projectDir)) if (f.mtimeMs > latest) latest = f.mtimeMs;
|
|
305
195
|
return latest;
|
|
306
196
|
}
|
|
307
|
-
function
|
|
308
|
-
|
|
309
|
-
return latestJsonlMtimeMs(dir);
|
|
197
|
+
function projectsRootOf(configDir) {
|
|
198
|
+
return path2.join(configDir || path2.join(os.homedir(), ".claude"), "projects");
|
|
310
199
|
}
|
|
311
|
-
function
|
|
312
|
-
|
|
200
|
+
function claudeProjectsRoots(first) {
|
|
201
|
+
const accounts = claudeAccounts();
|
|
202
|
+
const ordered = first ? [...accounts.filter((a) => a.name === first), ...accounts.filter((a) => a.name !== first)] : accounts;
|
|
203
|
+
const seen = /* @__PURE__ */ new Set();
|
|
204
|
+
const out = [];
|
|
205
|
+
for (const a of ordered) {
|
|
206
|
+
const root = projectsRootOf(a.dir);
|
|
207
|
+
const key2 = path2.resolve(root);
|
|
208
|
+
if (seen.has(key2)) continue;
|
|
209
|
+
seen.add(key2);
|
|
210
|
+
out.push(root);
|
|
211
|
+
}
|
|
212
|
+
return out;
|
|
313
213
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
const
|
|
214
|
+
var activityIn = (launchPath, configDir) => latestJsonlMtimeMs(path2.join(projectsRootOf(configDir), encodeProjectDir(launchPath)));
|
|
215
|
+
function getClaudeActivityMs(launchPath, configDir) {
|
|
216
|
+
if (configDir) return activityIn(launchPath, configDir);
|
|
217
|
+
let latest = 0;
|
|
218
|
+
for (const root of claudeProjectsRoots()) latest = Math.max(latest, latestJsonlMtimeMs(path2.join(root, encodeProjectDir(launchPath))));
|
|
219
|
+
return latest;
|
|
220
|
+
}
|
|
221
|
+
function hasClaudeConversation(dir, configDir) {
|
|
222
|
+
return activityIn(dir, configDir) > 0;
|
|
223
|
+
}
|
|
224
|
+
function sessionRunFolders(session, existing = true) {
|
|
225
|
+
const paths = existing ? session.paths.filter((p) => fs2.existsSync(p)) : session.paths;
|
|
226
|
+
const out = /* @__PURE__ */ new Set();
|
|
319
227
|
if (session.isGroup) {
|
|
320
|
-
for (const p of
|
|
321
|
-
for (const p of
|
|
228
|
+
for (const p of paths) out.add(path2.dirname(p));
|
|
229
|
+
for (const p of paths) out.add(p);
|
|
322
230
|
} else {
|
|
323
|
-
for (const p of
|
|
231
|
+
for (const p of paths) out.add(p);
|
|
324
232
|
}
|
|
233
|
+
return [...out];
|
|
234
|
+
}
|
|
235
|
+
function resolveResumeLaunch(session) {
|
|
236
|
+
const existing = session.paths.filter((p) => fs2.existsSync(p));
|
|
237
|
+
const first = existing[0] ?? session.paths[0];
|
|
238
|
+
const defaultPath = session.isGroup ? path2.dirname(first) : first;
|
|
239
|
+
const candidates = sessionRunFolders(session);
|
|
240
|
+
const configDir = configDirEnv(sessionAccount(session)).CLAUDE_CONFIG_DIR;
|
|
325
241
|
let launchPath = defaultPath;
|
|
326
242
|
let bestMs = 0;
|
|
327
243
|
for (const c of candidates) {
|
|
328
|
-
const ms =
|
|
244
|
+
const ms = activityIn(c, configDir);
|
|
329
245
|
if (ms > bestMs) {
|
|
330
246
|
bestMs = ms;
|
|
331
247
|
launchPath = c;
|
|
@@ -333,15 +249,43 @@ function resolveResumeLaunch(session) {
|
|
|
333
249
|
}
|
|
334
250
|
return { launchPath, hasConversation: bestMs > 0 };
|
|
335
251
|
}
|
|
336
|
-
function claudeProjectsRoot() {
|
|
337
|
-
return path.join(os2.homedir(), ".claude", "projects");
|
|
338
|
-
}
|
|
339
252
|
|
|
340
253
|
// src/core/agents/claude/files.ts
|
|
341
254
|
function listTranscripts(session) {
|
|
342
|
-
const dirs = session.isGroup ? [...new Set(session.paths.map((p) =>
|
|
255
|
+
const dirs = session.isGroup ? [...new Set(session.paths.map((p) => path3.dirname(p)))] : session.paths;
|
|
256
|
+
const roots = claudeProjectsRoots(sessionAccount(session));
|
|
257
|
+
const seen = /* @__PURE__ */ new Set();
|
|
343
258
|
const out = [];
|
|
344
|
-
for (const d of dirs)
|
|
259
|
+
for (const d of dirs)
|
|
260
|
+
for (const root of roots)
|
|
261
|
+
for (const f of projectTranscripts(path3.join(root, encodeProjectDir(d)))) {
|
|
262
|
+
if (seen.has(f.file)) continue;
|
|
263
|
+
seen.add(f.file);
|
|
264
|
+
out.push(f);
|
|
265
|
+
}
|
|
266
|
+
return out;
|
|
267
|
+
}
|
|
268
|
+
function listUsageFiles(session) {
|
|
269
|
+
const out = [];
|
|
270
|
+
for (const t of listTranscripts(session)) {
|
|
271
|
+
out.push(t);
|
|
272
|
+
const dir = path3.join(t.file.replace(/\.jsonl$/, ""), "subagents");
|
|
273
|
+
let names;
|
|
274
|
+
try {
|
|
275
|
+
names = fs3.readdirSync(dir);
|
|
276
|
+
} catch {
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
for (const name of names) {
|
|
280
|
+
if (!name.startsWith("agent-") || !name.endsWith(".jsonl")) continue;
|
|
281
|
+
const file = path3.join(dir, name);
|
|
282
|
+
try {
|
|
283
|
+
const st = fs3.statSync(file);
|
|
284
|
+
out.push({ file, mtimeMs: st.mtimeMs, size: st.size });
|
|
285
|
+
} catch {
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
345
289
|
return out;
|
|
346
290
|
}
|
|
347
291
|
var AROUND_TURN_MS = 6e4;
|
|
@@ -349,12 +293,12 @@ var AGENT_QUIET_MS = 60 * 6e4;
|
|
|
349
293
|
var ANSWER_FOR_MS = 2e3;
|
|
350
294
|
var answers = /* @__PURE__ */ new Map();
|
|
351
295
|
function backgroundWorkSince(session, sinceMs, now = Date.now()) {
|
|
352
|
-
const
|
|
353
|
-
const kept = answers.get(
|
|
296
|
+
const key2 = `${session.paths.join("|")}|${sinceMs}`;
|
|
297
|
+
const kept = answers.get(key2);
|
|
354
298
|
if (kept && now - kept.at >= 0 && now - kept.at < ANSWER_FOR_MS) return kept.work;
|
|
355
299
|
const work = lookForBackgroundWork(session, sinceMs, Math.max(sinceMs, now - AGENT_QUIET_MS), now - AGENT_QUIET_MS);
|
|
356
300
|
if (answers.size > 200) answers.clear();
|
|
357
|
-
answers.set(
|
|
301
|
+
answers.set(key2, { at: now, work });
|
|
358
302
|
return work;
|
|
359
303
|
}
|
|
360
304
|
function whatOf(meta) {
|
|
@@ -364,23 +308,23 @@ function whatOf(meta) {
|
|
|
364
308
|
function lookForBackgroundWork(session, sinceMs, afterMs, quietFrom = afterMs) {
|
|
365
309
|
for (const t of listTranscripts(session)) {
|
|
366
310
|
if (t.mtimeMs < sinceMs - AROUND_TURN_MS) continue;
|
|
367
|
-
const dir =
|
|
311
|
+
const dir = path3.join(t.file.replace(/\.jsonl$/, ""), "subagents");
|
|
368
312
|
let names;
|
|
369
313
|
try {
|
|
370
|
-
names =
|
|
314
|
+
names = fs3.readdirSync(dir);
|
|
371
315
|
} catch {
|
|
372
316
|
continue;
|
|
373
317
|
}
|
|
374
318
|
for (const name of names) {
|
|
375
319
|
if (!name.endsWith(".jsonl")) continue;
|
|
376
|
-
const file =
|
|
320
|
+
const file = path3.join(dir, name);
|
|
377
321
|
try {
|
|
378
|
-
const written =
|
|
322
|
+
const written = fs3.statSync(file).mtimeMs;
|
|
379
323
|
if (written <= quietFrom) continue;
|
|
380
324
|
const metaFile = file.replace(/\.jsonl$/, ".meta.json");
|
|
381
|
-
const startedForTurn =
|
|
325
|
+
const startedForTurn = fs3.statSync(metaFile).mtimeMs >= sinceMs - AROUND_TURN_MS;
|
|
382
326
|
if (written <= afterMs && !startedForTurn) continue;
|
|
383
|
-
const meta = JSON.parse(
|
|
327
|
+
const meta = JSON.parse(fs3.readFileSync(metaFile, "utf8"));
|
|
384
328
|
if (meta && typeof meta === "object" && meta.requestShape === "background")
|
|
385
329
|
return { what: whatOf(meta) };
|
|
386
330
|
} catch {
|
|
@@ -391,7 +335,7 @@ function lookForBackgroundWork(session, sinceMs, afterMs, quietFrom = afterMs) {
|
|
|
391
335
|
}
|
|
392
336
|
|
|
393
337
|
// src/core/conversations/jsonl.ts
|
|
394
|
-
import
|
|
338
|
+
import fs4 from "fs";
|
|
395
339
|
var TAIL_BYTES = 256 * 1024;
|
|
396
340
|
function parseLines(text) {
|
|
397
341
|
const out = [];
|
|
@@ -410,15 +354,15 @@ function readJsonlTail(transcriptPath, bytes = TAIL_BYTES) {
|
|
|
410
354
|
if (!transcriptPath) return [];
|
|
411
355
|
let text;
|
|
412
356
|
try {
|
|
413
|
-
const fd =
|
|
357
|
+
const fd = fs4.openSync(transcriptPath, "r");
|
|
414
358
|
try {
|
|
415
|
-
const size =
|
|
359
|
+
const size = fs4.fstatSync(fd).size;
|
|
416
360
|
const start = Math.max(0, size - bytes);
|
|
417
361
|
const buf = Buffer.alloc(size - start);
|
|
418
|
-
|
|
362
|
+
fs4.readSync(fd, buf, 0, buf.length, start);
|
|
419
363
|
text = buf.toString("utf-8");
|
|
420
364
|
} finally {
|
|
421
|
-
|
|
365
|
+
fs4.closeSync(fd);
|
|
422
366
|
}
|
|
423
367
|
} catch {
|
|
424
368
|
return [];
|
|
@@ -432,7 +376,7 @@ async function readJsonlSince(transcriptPath, sinceMs, timeOf, opts = {}) {
|
|
|
432
376
|
const max = Math.max(chunk, opts.maxBytes ?? SINCE_MAX_BYTES);
|
|
433
377
|
let fh;
|
|
434
378
|
try {
|
|
435
|
-
fh = await
|
|
379
|
+
fh = await fs4.promises.open(transcriptPath, "r");
|
|
436
380
|
} catch {
|
|
437
381
|
return { lines: [], partial: false };
|
|
438
382
|
}
|
|
@@ -543,8 +487,8 @@ function promptText(e) {
|
|
|
543
487
|
return text;
|
|
544
488
|
}
|
|
545
489
|
var MAX_TOOL_DETAIL = 400;
|
|
546
|
-
function str(input,
|
|
547
|
-
const v = input?.[
|
|
490
|
+
function str(input, key2) {
|
|
491
|
+
const v = input?.[key2];
|
|
548
492
|
return typeof v === "string" && v.trim() ? v : void 0;
|
|
549
493
|
}
|
|
550
494
|
function describeToolUse(tool, input) {
|
|
@@ -576,14 +520,20 @@ function lineEntries(e) {
|
|
|
576
520
|
const out = [];
|
|
577
521
|
const text = blocks.filter((b) => b.type === "text" && typeof b.text === "string").map((b) => b.text).join("\n").trim();
|
|
578
522
|
const u = e.message?.usage;
|
|
579
|
-
const usage = u && typeof u === "object" ? {
|
|
523
|
+
const usage = u && typeof u === "object" ? {
|
|
524
|
+
prompt: num(u.input_tokens) + num(u.cache_read_input_tokens) + num(u.cache_creation_input_tokens),
|
|
525
|
+
reply: num(u.output_tokens),
|
|
526
|
+
...num(u.cache_read_input_tokens) ? { cached: num(u.cache_read_input_tokens) } : {}
|
|
527
|
+
} : null;
|
|
580
528
|
const model = typeof e.message?.model === "string" ? e.message.model : void 0;
|
|
529
|
+
const messageId = typeof e.message?.id === "string" && e.message.id ? e.message.id : void 0;
|
|
581
530
|
out.push({
|
|
582
531
|
...base,
|
|
583
532
|
role: "agent",
|
|
584
533
|
text: meta ? "" : text,
|
|
585
534
|
...usage && usage.prompt + usage.reply > 0 ? { usage } : {},
|
|
586
|
-
...model ? { model } : {}
|
|
535
|
+
...model ? { model } : {},
|
|
536
|
+
...messageId ? { message: messageId } : {}
|
|
587
537
|
});
|
|
588
538
|
for (const b of blocks) {
|
|
589
539
|
if (b.type === "tool_use" && typeof b.name === "string")
|
|
@@ -603,8 +553,11 @@ function claudeContextWindow(model, used) {
|
|
|
603
553
|
return model && (/\[1m\]/i.test(model) || LARGE_MODELS.test(model)) || used > DEFAULT_WINDOW ? LARGE_WINDOW : DEFAULT_WINDOW;
|
|
604
554
|
}
|
|
605
555
|
|
|
556
|
+
// src/core/agents/claude/hooks.ts
|
|
557
|
+
import path5 from "path";
|
|
558
|
+
|
|
606
559
|
// src/core/agents/claude/permission.ts
|
|
607
|
-
import
|
|
560
|
+
import path4 from "path";
|
|
608
561
|
function pendingToolUse(entries) {
|
|
609
562
|
const answered = /* @__PURE__ */ new Set();
|
|
610
563
|
for (const e of entries) {
|
|
@@ -635,7 +588,7 @@ var YES_SELECTED_RE = /❯\s*1\.\s*Yes\b/;
|
|
|
635
588
|
var squash = (s) => s.replace(/[\s\u2500-\u257f]+/g, "");
|
|
636
589
|
function screenAnchor(req) {
|
|
637
590
|
if (req.tool === "Bash" || req.tool === "PowerShell") return squash(req.detail.split(" \u23CE ")[0]).slice(0, 40);
|
|
638
|
-
if (/[\\/]/.test(req.detail) && !/^https?:/.test(req.detail)) return
|
|
591
|
+
if (/[\\/]/.test(req.detail) && !/^https?:/.test(req.detail)) return path4.basename(req.detail.replace(/\\/g, "/"));
|
|
639
592
|
return "";
|
|
640
593
|
}
|
|
641
594
|
function checkDialog(screen, req) {
|
|
@@ -649,7 +602,7 @@ var ANSWER_KEYS = { allow: "\r", deny: "\x1B" };
|
|
|
649
602
|
|
|
650
603
|
// src/core/agents/claude/hooks.ts
|
|
651
604
|
var installer = null;
|
|
652
|
-
var loadInstaller = async () => installer ??= await import("./command-hook-installer-
|
|
605
|
+
var loadInstaller = async () => installer ??= await import("./command-hook-installer-7Q7UD7AU.js");
|
|
653
606
|
var CLAUDE_EVENT = {
|
|
654
607
|
"turn-start": "UserPromptSubmit",
|
|
655
608
|
"turn-end": "Stop",
|
|
@@ -681,15 +634,20 @@ function claudeStatusEvent(edge, payload) {
|
|
|
681
634
|
}
|
|
682
635
|
}
|
|
683
636
|
var toClaude = (h) => ({ owner: h.owner, event: CLAUDE_EVENT[h.edge] });
|
|
637
|
+
var settingsFiles = () => setUpAccounts().map((a) => path5.join(a.dir, "settings.json"));
|
|
684
638
|
var claudeEvents = {
|
|
685
|
-
install: async (hooks, remove = []) =>
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
639
|
+
install: async (hooks, remove = []) => {
|
|
640
|
+
const inst = await loadInstaller();
|
|
641
|
+
const add = hooks.map((h) => ({ ...toClaude(h), command: h.command, ...h.timeoutSec ? { timeoutSec: h.timeoutSec } : {} }));
|
|
642
|
+
for (const file of settingsFiles()) await inst.syncCommandHooks(add, remove.map(toClaude), file);
|
|
643
|
+
},
|
|
689
644
|
// A shutdown handler can't wait for an import: it uses the installer the
|
|
690
645
|
// start-up install loaded (work web always installs first). Nothing loaded:
|
|
691
646
|
// this process installed nothing, so there is nothing of its to remove.
|
|
692
|
-
removeSync: (hooks) =>
|
|
647
|
+
removeSync: (hooks) => {
|
|
648
|
+
if (!installer) return;
|
|
649
|
+
for (const file of settingsFiles()) installer.removeCommandHooksSync(hooks.map(toClaude), file);
|
|
650
|
+
},
|
|
693
651
|
read: (edge, payload) => ({ cwd: str2(asPayload(payload).cwd), status: claudeStatusEvent(edge, payload) }),
|
|
694
652
|
// turn-start: stdout is added to the prompt. turn-end: `decision: block`
|
|
695
653
|
// keeps Claude in the turn and feeds `reason` back to it.
|
|
@@ -697,9 +655,9 @@ var claudeEvents = {
|
|
|
697
655
|
};
|
|
698
656
|
|
|
699
657
|
// src/core/agents/claude/live.ts
|
|
700
|
-
import
|
|
701
|
-
import
|
|
702
|
-
import
|
|
658
|
+
import fs5 from "fs";
|
|
659
|
+
import os2 from "os";
|
|
660
|
+
import path6 from "path";
|
|
703
661
|
var isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
704
662
|
function parseLiveClaude(raw) {
|
|
705
663
|
if (!isObj(raw)) return null;
|
|
@@ -728,26 +686,39 @@ function aliveOnly(list, table, bootMs) {
|
|
|
728
686
|
var TTL_MS = 5e3;
|
|
729
687
|
var cache = null;
|
|
730
688
|
function claudeSessionsDir() {
|
|
731
|
-
return
|
|
689
|
+
return path6.join(process.env.CLAUDE_CONFIG_DIR || path6.join(os2.homedir(), ".claude"), "sessions");
|
|
732
690
|
}
|
|
733
|
-
function
|
|
734
|
-
|
|
691
|
+
function claudeSessionsDirs() {
|
|
692
|
+
const accounts = claudeAccounts();
|
|
693
|
+
if (accounts.length <= 1) return [claudeSessionsDir()];
|
|
694
|
+
return [...new Set(accounts.map((a) => path6.join(a.dir, "sessions")))];
|
|
695
|
+
}
|
|
696
|
+
function readDir(dir, table) {
|
|
735
697
|
let names;
|
|
736
698
|
try {
|
|
737
|
-
names =
|
|
699
|
+
names = fs5.readdirSync(dir).filter((n) => /^\d+\.json$/.test(n));
|
|
738
700
|
} catch {
|
|
739
701
|
return [];
|
|
740
702
|
}
|
|
741
703
|
const parsed = [];
|
|
742
704
|
for (const n of names) {
|
|
743
705
|
try {
|
|
744
|
-
const c = parseLiveClaude(JSON.parse(
|
|
706
|
+
const c = parseLiveClaude(JSON.parse(fs5.readFileSync(path6.join(dir, n), "utf8")));
|
|
745
707
|
if (c) parsed.push(c);
|
|
746
708
|
} catch {
|
|
747
709
|
}
|
|
748
710
|
}
|
|
749
|
-
|
|
750
|
-
|
|
711
|
+
return parsed.length ? aliveOnly(parsed, table(), bootTime()) : [];
|
|
712
|
+
}
|
|
713
|
+
function readLiveClaudes(dir, now = Date.now(), table) {
|
|
714
|
+
const dirs = dir ? [dir] : claudeSessionsDirs();
|
|
715
|
+
const key2 = dirs.join("|");
|
|
716
|
+
const cached = !table && !dir;
|
|
717
|
+
if (cached && cache && now - cache.at < TTL_MS && cache.key === key2) return cache.list;
|
|
718
|
+
let procs = table;
|
|
719
|
+
const procTable = () => procs ??= processTable();
|
|
720
|
+
const list = dirs.flatMap((d) => readDir(d, procTable));
|
|
721
|
+
if (cached) cache = { at: now, key: key2, list };
|
|
751
722
|
return list;
|
|
752
723
|
}
|
|
753
724
|
|
|
@@ -760,22 +731,22 @@ var typeThenEnter = async (write, text, wait = (ms) => new Promise((r) => setTim
|
|
|
760
731
|
};
|
|
761
732
|
|
|
762
733
|
// src/core/agents/claude/internal.ts
|
|
763
|
-
import
|
|
734
|
+
import os3 from "os";
|
|
764
735
|
function internalClaudeSpawn(opts = {}) {
|
|
765
736
|
return {
|
|
766
737
|
args: ["-p", "--tools", "", "--strict-mcp-config", ...opts.model ? ["--model", opts.model] : []],
|
|
767
|
-
cwd:
|
|
768
|
-
env: { ...process.env, ...internalRunEnv() }
|
|
738
|
+
cwd: os3.tmpdir(),
|
|
739
|
+
env: { ...applyEnvDelta(process.env, accountEnv(defaultAccountName())), ...internalRunEnv() }
|
|
769
740
|
};
|
|
770
741
|
}
|
|
771
742
|
|
|
772
743
|
// src/core/agents/claude/workspace.ts
|
|
773
|
-
import
|
|
774
|
-
import
|
|
744
|
+
import fs6 from "fs";
|
|
745
|
+
import path7 from "path";
|
|
775
746
|
var claudeAllowRule = (r) => `Bash(${r.command}${r.prefix ? ":*" : ""})`;
|
|
776
747
|
var claudeWorkspace = {
|
|
777
748
|
write(dir, { allow, hooks }) {
|
|
778
|
-
|
|
749
|
+
fs6.mkdirSync(path7.join(dir, ".claude"), { recursive: true });
|
|
779
750
|
const byEvent = {};
|
|
780
751
|
for (const h of hooks) {
|
|
781
752
|
(byEvent[CLAUDE_EVENT[h.edge]] ??= []).push({
|
|
@@ -783,8 +754,8 @@ var claudeWorkspace = {
|
|
|
783
754
|
});
|
|
784
755
|
}
|
|
785
756
|
const settings = { permissions: { allow: allow.map(claudeAllowRule) }, hooks: byEvent };
|
|
786
|
-
atomicWriteFile(
|
|
787
|
-
return [
|
|
757
|
+
atomicWriteFile(path7.join(dir, ".claude", "settings.json"), JSON.stringify(settings, null, 2) + "\n");
|
|
758
|
+
return [path7.join(".claude", "settings.json")];
|
|
788
759
|
}
|
|
789
760
|
};
|
|
790
761
|
|
|
@@ -792,8 +763,14 @@ var claudeWorkspace = {
|
|
|
792
763
|
var MARKETPLACE_REPO = "moberghr/moberg-plugins";
|
|
793
764
|
var MARKETPLACE_NAME = "moberg-plugins";
|
|
794
765
|
var PLUGIN_SPEC = "work-tree@moberg-plugins";
|
|
795
|
-
var runClaude = (args) => {
|
|
796
|
-
const r = spawn_default.sync("claude", args, {
|
|
766
|
+
var runClaude = (args, env) => {
|
|
767
|
+
const r = spawn_default.sync("claude", args, {
|
|
768
|
+
encoding: "utf8",
|
|
769
|
+
timeout: 6e4,
|
|
770
|
+
windowsHide: true,
|
|
771
|
+
stdio: "pipe",
|
|
772
|
+
...env ? { env: applyEnvDelta(process.env, env) } : {}
|
|
773
|
+
});
|
|
797
774
|
const text = (v) => typeof v === "string" ? v : "";
|
|
798
775
|
return { ok: !r.error && r.status === 0, stdout: text(r.stdout), stderr: r.error ? r.error.message : text(r.stderr) };
|
|
799
776
|
};
|
|
@@ -807,32 +784,353 @@ function isInstalled(listJson) {
|
|
|
807
784
|
return false;
|
|
808
785
|
}
|
|
809
786
|
}
|
|
810
|
-
function
|
|
811
|
-
return {
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
const add = run(["plugin", "marketplace", "add", MARKETPLACE_REPO, "--scope", "user", "--sparse", ".claude-plugin"]);
|
|
817
|
-
if (!add.ok)
|
|
818
|
-
return {
|
|
819
|
-
ok: false,
|
|
820
|
-
message: `could not register the Claude Code plugin marketplace (run \`claude plugin marketplace add ${MARKETPLACE_REPO}\`)`
|
|
821
|
-
};
|
|
822
|
-
}
|
|
823
|
-
const install = run(["plugin", "install", PLUGIN_SPEC, "--scope", "user"]);
|
|
824
|
-
if (install.ok) return { ok: true, message: `installed the Claude Code plugin ${PLUGIN_SPEC}` };
|
|
825
|
-
if (isInstalled(run(["plugin", "list", "--json"]).stdout))
|
|
826
|
-
return { ok: true, message: `the Claude Code plugin ${PLUGIN_SPEC} is installed` };
|
|
827
|
-
const why = lastLine(install);
|
|
787
|
+
function installFor(run) {
|
|
788
|
+
if (!run(["--version"]).ok) return { ok: false, message: "Claude Code (the `claude` CLI) is not installed" };
|
|
789
|
+
const list = run(["plugin", "marketplace", "list"]);
|
|
790
|
+
if (!(list.ok && list.stdout.includes(MARKETPLACE_NAME))) {
|
|
791
|
+
const add = run(["plugin", "marketplace", "add", MARKETPLACE_REPO, "--scope", "user", "--sparse", ".claude-plugin"]);
|
|
792
|
+
if (!add.ok)
|
|
828
793
|
return {
|
|
829
794
|
ok: false,
|
|
830
|
-
message: `could not
|
|
795
|
+
message: `could not register the Claude Code plugin marketplace (run \`claude plugin marketplace add ${MARKETPLACE_REPO}\`)`
|
|
831
796
|
};
|
|
797
|
+
}
|
|
798
|
+
const install = run(["plugin", "install", PLUGIN_SPEC, "--scope", "user"]);
|
|
799
|
+
if (install.ok) return { ok: true, message: `installed the Claude Code plugin ${PLUGIN_SPEC}` };
|
|
800
|
+
if (isInstalled(run(["plugin", "list", "--json"]).stdout))
|
|
801
|
+
return { ok: true, message: `the Claude Code plugin ${PLUGIN_SPEC} is installed` };
|
|
802
|
+
const why = lastLine(install);
|
|
803
|
+
return {
|
|
804
|
+
ok: false,
|
|
805
|
+
message: `could not install the Claude Code plugin${why ? ` (${why})` : ""}: run \`claude plugin install ${PLUGIN_SPEC} --scope user\``
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
function claudeSkillsWith(run, accounts = setUpAccounts) {
|
|
809
|
+
return {
|
|
810
|
+
async install() {
|
|
811
|
+
const list = accounts();
|
|
812
|
+
if (list.length <= 1) return installFor((args) => run(args));
|
|
813
|
+
const results = list.map((a) => {
|
|
814
|
+
const env = a.name === "default" ? { CLAUDE_CONFIG_DIR: null } : { CLAUDE_CONFIG_DIR: a.dir };
|
|
815
|
+
return { name: a.name, ...installFor((args) => run(args, env)) };
|
|
816
|
+
});
|
|
817
|
+
return { ok: results.every((r) => r.ok), message: results.map((r) => `${r.name}: ${r.message}`).join("; ") };
|
|
832
818
|
}
|
|
833
819
|
};
|
|
834
820
|
}
|
|
835
821
|
var claudeSkills = claudeSkillsWith(runClaude);
|
|
822
|
+
function installClaudeSkillsFor(dir, run = runClaude) {
|
|
823
|
+
return installFor((args) => run(args, { CLAUDE_CONFIG_DIR: dir }));
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
// src/core/agents/claude/usage.ts
|
|
827
|
+
var installer2;
|
|
828
|
+
var loadInstaller2 = async () => installer2 ??= await import("./statusline-A2DTGLK5.js");
|
|
829
|
+
function restoreMessage(o, saved = "~/.work/statusline.json") {
|
|
830
|
+
switch (o) {
|
|
831
|
+
case "restored":
|
|
832
|
+
return "Your own status line is back (work no longer reads the plan limits from it).";
|
|
833
|
+
case "not-ours":
|
|
834
|
+
return "Its status line isn't work's: left as it is.";
|
|
835
|
+
case "kept":
|
|
836
|
+
return `work's status line left in place: the copy of yours (${saved}) is missing or damaged. Set yours again with /statusline in Claude Code.`;
|
|
837
|
+
case "failed":
|
|
838
|
+
return "Its settings couldn't be changed (see above).";
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
function namedReadings() {
|
|
842
|
+
const accounts = claudeAccounts();
|
|
843
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
844
|
+
for (const a of accounts) if (!byKey.has(accountOf(a.dir))) byKey.set(accountOf(a.dir), { name: a.name, isDefault: a.isDefault });
|
|
845
|
+
return readReadings("claude").map((r) => {
|
|
846
|
+
const known = byKey.get(r.account);
|
|
847
|
+
return known ? { ...r, account: known.name, ...known.isDefault ? { isDefault: true } : {} } : r;
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
var claudeUsage = {
|
|
851
|
+
read: namedReadings,
|
|
852
|
+
async setup(o) {
|
|
853
|
+
const outcome = await (await loadInstaller2()).applyStatusLineSetting(o);
|
|
854
|
+
if (outcome === "wrapped") return "status line wrapped: it records the plan limits";
|
|
855
|
+
if (outcome === "restored") return "status line given back (usage.statusLine is false)";
|
|
856
|
+
return "status line left alone (lean server)";
|
|
857
|
+
},
|
|
858
|
+
async restore() {
|
|
859
|
+
const done = await (await loadInstaller2()).unwrapAllStatusLines();
|
|
860
|
+
const accounts = claudeAccounts();
|
|
861
|
+
const ok = done.every((d) => d.outcome === "restored" || d.outcome === "not-ours");
|
|
862
|
+
if (done.length === 1) return { ok, message: restoreMessage(done[0].outcome) };
|
|
863
|
+
const message = done.map((d) => {
|
|
864
|
+
const dir = accounts.find((a) => a.name === d.account)?.dir;
|
|
865
|
+
return `${d.account}: ${restoreMessage(d.outcome, dir ? savedPath(dir) : void 0)}`;
|
|
866
|
+
}).join("\n");
|
|
867
|
+
return { ok, message };
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
// src/core/agents/claude/account-move.ts
|
|
872
|
+
import fs8 from "fs";
|
|
873
|
+
import path9 from "path";
|
|
874
|
+
|
|
875
|
+
// src/core/agents/claude/account-admin.ts
|
|
876
|
+
import fs7 from "fs";
|
|
877
|
+
import os4 from "os";
|
|
878
|
+
import path8 from "path";
|
|
879
|
+
async function editConfig(fn) {
|
|
880
|
+
const file = getConfigPath();
|
|
881
|
+
if (!fs7.existsSync(file)) throw new AccountAdminError("No configuration yet: run `work init` first.");
|
|
882
|
+
return withFileLock(file, () => {
|
|
883
|
+
const raw = JSON.parse(fs7.readFileSync(file, "utf-8"));
|
|
884
|
+
const existing = raw.claudeAccounts;
|
|
885
|
+
const accounts = existing && typeof existing === "object" && !Array.isArray(existing) ? { ...existing } : {};
|
|
886
|
+
const out = fn(raw, accounts);
|
|
887
|
+
raw.claudeAccounts = accounts;
|
|
888
|
+
if (!Object.keys(accounts).length) delete raw.claudeAccounts;
|
|
889
|
+
atomicWriteFile(file, JSON.stringify(raw, null, 2));
|
|
890
|
+
return out;
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
var validIn = (raw) => validateClaudeAccounts(raw.claudeAccounts, void 0, accountForbiddenRoots(raw)).accounts ?? {};
|
|
894
|
+
async function addAccount(name, dir) {
|
|
895
|
+
const folder = expandAccountDir(dir?.trim() || path8.join(os4.homedir(), `.claude-${name}`));
|
|
896
|
+
if (!folder) throw new AccountAdminError(`${dir} is not an absolute folder`);
|
|
897
|
+
return editConfig((raw, accounts) => {
|
|
898
|
+
if (name in accounts) throw new AccountAdminError(`there is already an account \u201C${name}\u201D`);
|
|
899
|
+
const problem = accountProblem(name, folder, Object.values(validIn(raw)), accountForbiddenRoots(raw));
|
|
900
|
+
if (problem) throw new AccountAdminError(problem);
|
|
901
|
+
try {
|
|
902
|
+
fs7.mkdirSync(folder, { recursive: true });
|
|
903
|
+
} catch (e) {
|
|
904
|
+
throw new AccountAdminError(`couldn't make ${folder}: ${e instanceof Error ? e.message : String(e)}`);
|
|
905
|
+
}
|
|
906
|
+
accounts[name] = folder;
|
|
907
|
+
return folder;
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
async function setDefaultAccount(name) {
|
|
911
|
+
await editConfig((raw) => {
|
|
912
|
+
if (name !== DEFAULT_ACCOUNT && !(name in validIn(raw))) throw new AccountAdminError(`no account \u201C${name}\u201D`);
|
|
913
|
+
raw.claudeAccount = name;
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
var sessionsText = (n, what) => `${n} ${what} session${n === 1 ? "" : "s"}`;
|
|
917
|
+
async function removeAccount(name, usedBy) {
|
|
918
|
+
if (name === DEFAULT_ACCOUNT) throw new AccountAdminError("the default account (~/.claude) can not be removed");
|
|
919
|
+
await editConfig((raw, accounts) => {
|
|
920
|
+
if (!(name in accounts)) throw new AccountAdminError(`no account \u201C${name}\u201D`);
|
|
921
|
+
const { live, archived } = usedBy();
|
|
922
|
+
if (live.length) throw new AccountAdminError(`${sessionsText(live.length, "live")} on ${name}`, live, "live");
|
|
923
|
+
if (archived.length)
|
|
924
|
+
throw new AccountAdminError(
|
|
925
|
+
`${sessionsText(archived.length, "archived")} on ${name} (a Restore would start it on the default account instead)`,
|
|
926
|
+
archived,
|
|
927
|
+
"archived"
|
|
928
|
+
);
|
|
929
|
+
delete accounts[name];
|
|
930
|
+
if (raw.claudeAccount === name) raw.claudeAccount = DEFAULT_ACCOUNT;
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
function loginOn(name, run = spawn_default.sync) {
|
|
934
|
+
if (!accountDir(name)) throw new AccountAdminError(`no account \u201C${name}\u201D`);
|
|
935
|
+
const config = loadConfig();
|
|
936
|
+
const tool = getAiTool(config && getAiTool(config).cmd === "claude" ? config : {});
|
|
937
|
+
const env = applyEnvDelta(withoutParentSession(process.env), accountEnv(name));
|
|
938
|
+
run(tool.cmd, tool.baseArgs, { stdio: "inherit", windowsHide: false, env });
|
|
939
|
+
}
|
|
940
|
+
var claudeAccountAdmin = {
|
|
941
|
+
add: addAccount,
|
|
942
|
+
setDefault: setDefaultAccount,
|
|
943
|
+
remove: removeAccount,
|
|
944
|
+
login: (name) => loginOn(name),
|
|
945
|
+
installSkills: (name) => {
|
|
946
|
+
const dir = accountDir(name);
|
|
947
|
+
if (!dir) return { ok: false, message: `no account \u201C${name}\u201D` };
|
|
948
|
+
return installClaudeSkillsFor(dir);
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
|
|
952
|
+
// src/core/agents/claude/account-move.ts
|
|
953
|
+
var AccountMoveError = class extends Error {
|
|
954
|
+
constructor(message, failed, restored, stuck) {
|
|
955
|
+
super(message);
|
|
956
|
+
this.failed = failed;
|
|
957
|
+
this.restored = restored;
|
|
958
|
+
this.stuck = stuck;
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
var isDir = (p) => {
|
|
962
|
+
try {
|
|
963
|
+
return fs8.statSync(p).isDirectory();
|
|
964
|
+
} catch {
|
|
965
|
+
return false;
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
var exists = (p) => {
|
|
969
|
+
try {
|
|
970
|
+
fs8.lstatSync(p);
|
|
971
|
+
return true;
|
|
972
|
+
} catch {
|
|
973
|
+
return false;
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
var mtime = (p) => {
|
|
977
|
+
try {
|
|
978
|
+
return fs8.statSync(p).mtimeMs;
|
|
979
|
+
} catch {
|
|
980
|
+
return 0;
|
|
981
|
+
}
|
|
982
|
+
};
|
|
983
|
+
function moveEntry(from, to) {
|
|
984
|
+
fs8.mkdirSync(path9.dirname(to), { recursive: true });
|
|
985
|
+
try {
|
|
986
|
+
fs8.renameSync(from, to);
|
|
987
|
+
return;
|
|
988
|
+
} catch (err) {
|
|
989
|
+
const code = err.code;
|
|
990
|
+
if (code !== "EXDEV" && code !== "EPERM") throw err;
|
|
991
|
+
}
|
|
992
|
+
try {
|
|
993
|
+
fs8.cpSync(from, to, { recursive: true, errorOnExist: true, force: false, preserveTimestamps: true });
|
|
994
|
+
} catch (err) {
|
|
995
|
+
fs8.rmSync(to, { recursive: true, force: true });
|
|
996
|
+
throw err;
|
|
997
|
+
}
|
|
998
|
+
try {
|
|
999
|
+
fs8.rmSync(from, { recursive: true, force: true });
|
|
1000
|
+
} catch (err) {
|
|
1001
|
+
try {
|
|
1002
|
+
fs8.cpSync(to, from, { recursive: true, force: false, errorOnExist: false, preserveTimestamps: true });
|
|
1003
|
+
} catch (back) {
|
|
1004
|
+
const why = (e) => e instanceof Error ? e.message : String(e);
|
|
1005
|
+
throw new Error(`${why(err)}; what its delete took couldn't be put back (${why(back)}), so it is kept at ${to} too`, {
|
|
1006
|
+
cause: back
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
try {
|
|
1010
|
+
fs8.rmSync(to, { recursive: true, force: true });
|
|
1011
|
+
} catch {
|
|
1012
|
+
}
|
|
1013
|
+
throw err;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
function suffixed(file, tag) {
|
|
1017
|
+
const base = `${file}.from-${tag}`;
|
|
1018
|
+
if (!exists(base)) return base;
|
|
1019
|
+
for (let n = 2; ; n++) if (!exists(`${base}-${n}`)) return `${base}-${n}`;
|
|
1020
|
+
}
|
|
1021
|
+
function mergeInto(src, dst, tag, steps, moved) {
|
|
1022
|
+
if (!exists(dst)) {
|
|
1023
|
+
moveEntry(src, dst);
|
|
1024
|
+
steps.push({ from: src, to: dst });
|
|
1025
|
+
moved.push(dst);
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
if (isDir(src) && isDir(dst)) {
|
|
1029
|
+
for (const name of fs8.readdirSync(src)) mergeInto(path9.join(src, name), path9.join(dst, name), tag, steps, moved);
|
|
1030
|
+
try {
|
|
1031
|
+
fs8.rmdirSync(src);
|
|
1032
|
+
} catch {
|
|
1033
|
+
}
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
if (mtime(dst) >= mtime(src)) {
|
|
1037
|
+
const kept = suffixed(dst, tag);
|
|
1038
|
+
moveEntry(src, kept);
|
|
1039
|
+
steps.push({ from: src, to: kept });
|
|
1040
|
+
moved.push(kept);
|
|
1041
|
+
} else {
|
|
1042
|
+
const older = suffixed(dst, `${tag}-older`);
|
|
1043
|
+
moveEntry(dst, older);
|
|
1044
|
+
steps.push({ from: dst, to: older });
|
|
1045
|
+
moveEntry(src, dst);
|
|
1046
|
+
steps.push({ from: src, to: dst });
|
|
1047
|
+
moved.push(dst);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
function undo(steps) {
|
|
1051
|
+
const restored = [];
|
|
1052
|
+
const stuck = [];
|
|
1053
|
+
for (const s of [...steps].reverse()) {
|
|
1054
|
+
try {
|
|
1055
|
+
moveEntry(s.to, s.from);
|
|
1056
|
+
restored.push(s.from);
|
|
1057
|
+
} catch {
|
|
1058
|
+
stuck.push(s.to);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
return { restored, stuck };
|
|
1062
|
+
}
|
|
1063
|
+
function latestConversation(dir) {
|
|
1064
|
+
let best = null;
|
|
1065
|
+
for (const name of fs8.readdirSync(dir)) {
|
|
1066
|
+
if (!name.endsWith(".jsonl")) continue;
|
|
1067
|
+
const at = mtime(path9.join(dir, name));
|
|
1068
|
+
if (!best || at > best.at) best = { name, at };
|
|
1069
|
+
}
|
|
1070
|
+
if (!best) return [];
|
|
1071
|
+
const id = best.name.slice(0, -".jsonl".length);
|
|
1072
|
+
return [best.name, ...isDir(path9.join(dir, id)) ? [id] : []];
|
|
1073
|
+
}
|
|
1074
|
+
function moveConversations(session, fromDir, toDir, tag = "old", opts = {}) {
|
|
1075
|
+
const steps = [];
|
|
1076
|
+
const moved = [];
|
|
1077
|
+
if (path9.resolve(fromDir) === path9.resolve(toDir)) return { moved };
|
|
1078
|
+
const emptied = [];
|
|
1079
|
+
let at = "";
|
|
1080
|
+
try {
|
|
1081
|
+
for (const cwd of sessionRunFolders(session, false)) {
|
|
1082
|
+
const name = encodeProjectDir(cwd);
|
|
1083
|
+
const src = path9.join(projectsRootOf(fromDir), name);
|
|
1084
|
+
if (!isDir(src)) continue;
|
|
1085
|
+
at = src;
|
|
1086
|
+
const dst = path9.join(projectsRootOf(toDir), name);
|
|
1087
|
+
if (opts.onlyLatest) {
|
|
1088
|
+
for (const entry of latestConversation(src)) {
|
|
1089
|
+
at = path9.join(src, entry);
|
|
1090
|
+
mergeInto(path9.join(src, entry), path9.join(dst, entry), tag, steps, moved);
|
|
1091
|
+
}
|
|
1092
|
+
continue;
|
|
1093
|
+
}
|
|
1094
|
+
mergeInto(src, dst, tag, steps, moved);
|
|
1095
|
+
emptied.push(src);
|
|
1096
|
+
}
|
|
1097
|
+
} catch (err) {
|
|
1098
|
+
const { restored, stuck } = undo(steps);
|
|
1099
|
+
const why = err instanceof Error ? err.message : String(err);
|
|
1100
|
+
throw new AccountMoveError(
|
|
1101
|
+
`couldn't move its conversations (${at}): ${why}. ` + (stuck.length ? `${restored.length} put back, ${stuck.length} could not be: ${stuck.join(", ")}` : steps.length ? "what was moved is back where it was" : "nothing was moved"),
|
|
1102
|
+
at,
|
|
1103
|
+
restored,
|
|
1104
|
+
stuck
|
|
1105
|
+
);
|
|
1106
|
+
}
|
|
1107
|
+
for (const src of emptied) {
|
|
1108
|
+
try {
|
|
1109
|
+
fs8.rmdirSync(src);
|
|
1110
|
+
} catch {
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
return { moved };
|
|
1114
|
+
}
|
|
1115
|
+
var claudeAccountSwitch = {
|
|
1116
|
+
list() {
|
|
1117
|
+
return claudeAccounts().map((a) => ({ name: a.name, dir: a.dir, isDefault: a.isDefault, loggedIn: isLoggedIn(a.dir) }));
|
|
1118
|
+
},
|
|
1119
|
+
defaultName: () => defaultAccountName(),
|
|
1120
|
+
has: (name) => accountDir(name) !== null,
|
|
1121
|
+
current: (session) => sessionAccount(session),
|
|
1122
|
+
async switchFiles(session, to) {
|
|
1123
|
+
const from = sessionAccount(session);
|
|
1124
|
+
const fromDir = accountDir(from);
|
|
1125
|
+
const toDir = accountDir(to);
|
|
1126
|
+
if (!fromDir) throw new Error(`its account \u201C${from}\u201D is not in your config any more`);
|
|
1127
|
+
if (!toDir) throw new Error(`no account \u201C${to}\u201D`);
|
|
1128
|
+
const onlyLatest = isOwnCheckout(session, loadConfig()?.repos ?? {});
|
|
1129
|
+
return moveConversations(session, fromDir, toDir, from, { onlyLatest });
|
|
1130
|
+
},
|
|
1131
|
+
folders: (session) => sessionRunFolders(session, false),
|
|
1132
|
+
admin: claudeAccountAdmin
|
|
1133
|
+
};
|
|
836
1134
|
|
|
837
1135
|
// src/core/agents/claude/adapter.ts
|
|
838
1136
|
var CLAUDE_SMALL_MODEL = "haiku";
|
|
@@ -845,12 +1143,15 @@ var claudeAgent = {
|
|
|
845
1143
|
launch: {
|
|
846
1144
|
// The configured command when it is Claude (`claude --model opus`); plain `claude` otherwise.
|
|
847
1145
|
tool: (config) => getAiTool(config && getAiTool(config).cmd === "claude" ? config : {}),
|
|
848
|
-
canResume: (cwd) => hasClaudeConversation(cwd),
|
|
1146
|
+
canResume: (cwd, via) => hasClaudeConversation(cwd, via?.env ? via.env.CLAUDE_CONFIG_DIR : configDirEnv(sessionAccount(via?.session)).CLAUDE_CONFIG_DIR),
|
|
849
1147
|
resumeLaunch: (s) => resolveResumeLaunch(s),
|
|
850
|
-
cleanEnv: (env) => withoutParentSession(env)
|
|
1148
|
+
cleanEnv: (env) => withoutParentSession(env),
|
|
1149
|
+
// The session's account (null: work's own runs, on the configured default).
|
|
1150
|
+
env: (session) => accountEnv(session ? sessionAccount(session) : defaultAccountName())
|
|
851
1151
|
},
|
|
852
1152
|
conversation: {
|
|
853
1153
|
files: (s) => listTranscripts(s),
|
|
1154
|
+
usageFiles: (s) => listUsageFiles(s),
|
|
854
1155
|
entries: claudeEntries,
|
|
855
1156
|
contextWindow: claudeContextWindow,
|
|
856
1157
|
read(session, { last }) {
|
|
@@ -866,14 +1167,15 @@ var claudeAgent = {
|
|
|
866
1167
|
lastWriteMs: (cwd) => getClaudeActivityMs(cwd),
|
|
867
1168
|
backgroundWorkSince,
|
|
868
1169
|
backgroundCommands: backgroundCommandsRunning,
|
|
1170
|
+
// In the session's own account's projects folder: that is where its `--continue` looks.
|
|
869
1171
|
restoreDir: (s) => {
|
|
870
|
-
const cwd = s.isGroup && s.paths[0] ?
|
|
871
|
-
return cwd ?
|
|
1172
|
+
const cwd = s.isGroup && s.paths[0] ? path10.dirname(s.paths[0]) : s.paths[0];
|
|
1173
|
+
return cwd ? path10.join(projectsRootOf(accountDir(sessionAccount(s)) ?? void 0), encodeProjectDir(cwd)) : null;
|
|
872
1174
|
}
|
|
873
1175
|
},
|
|
874
1176
|
events: claudeEvents,
|
|
875
|
-
// Its transcripts, and the per-process state files (a Claude opened or closed in a terminal tab shows at once).
|
|
876
|
-
activityRoots: () => [
|
|
1177
|
+
// Its transcripts, and the per-process state files (a Claude opened or closed in a terminal tab shows at once), of every account.
|
|
1178
|
+
activityRoots: () => [.../* @__PURE__ */ new Set([...claudeProjectsRoots(), ...claudeSessionsDirs()])],
|
|
877
1179
|
live: { running: (table) => readLiveClaudes(void 0, void 0, table) },
|
|
878
1180
|
input: {
|
|
879
1181
|
submit: typeThenEnter,
|
|
@@ -886,34 +1188,23 @@ var claudeAgent = {
|
|
|
886
1188
|
// CLAUDE.md's own import syntax (Claude Code reads the file it names, relative to this one).
|
|
887
1189
|
instructionsImport: (relPath) => `@${relPath}`,
|
|
888
1190
|
workspace: claudeWorkspace,
|
|
889
|
-
skills: claudeSkills
|
|
1191
|
+
skills: claudeSkills,
|
|
1192
|
+
usage: claudeUsage,
|
|
1193
|
+
accounts: claudeAccountSwitch
|
|
890
1194
|
};
|
|
891
1195
|
|
|
892
1196
|
// src/core/agents/index.ts
|
|
893
|
-
var
|
|
1197
|
+
var settingsView = configView((p) => {
|
|
1198
|
+
if (!p) return {};
|
|
1199
|
+
return {
|
|
1200
|
+
...typeof p.aiCommand === "string" ? { aiCommand: p.aiCommand } : {},
|
|
1201
|
+
...p.aiCommandFlags && typeof p.aiCommandFlags === "object" ? { aiCommandFlags: p.aiCommandFlags } : {},
|
|
1202
|
+
...isAgentId(p.internalAgent) ? { internalAgent: p.internalAgent } : {},
|
|
1203
|
+
...isAgentId(p.assistantAgent) ? { assistantAgent: p.assistantAgent } : {}
|
|
1204
|
+
};
|
|
1205
|
+
});
|
|
894
1206
|
function agentSettings() {
|
|
895
|
-
|
|
896
|
-
let key;
|
|
897
|
-
try {
|
|
898
|
-
const st = fs8.statSync(file);
|
|
899
|
-
key = `${file}|${st.size}|${st.mtimeMs}`;
|
|
900
|
-
} catch {
|
|
901
|
-
return {};
|
|
902
|
-
}
|
|
903
|
-
if (settingsCache?.key === key) return settingsCache.value;
|
|
904
|
-
let value = {};
|
|
905
|
-
try {
|
|
906
|
-
const p = JSON.parse(fs8.readFileSync(file, "utf8"));
|
|
907
|
-
value = {
|
|
908
|
-
...typeof p.aiCommand === "string" ? { aiCommand: p.aiCommand } : {},
|
|
909
|
-
...p.aiCommandFlags && typeof p.aiCommandFlags === "object" ? { aiCommandFlags: p.aiCommandFlags } : {},
|
|
910
|
-
...isAgentId(p.internalAgent) ? { internalAgent: p.internalAgent } : {},
|
|
911
|
-
...isAgentId(p.assistantAgent) ? { assistantAgent: p.assistantAgent } : {}
|
|
912
|
-
};
|
|
913
|
-
} catch {
|
|
914
|
-
}
|
|
915
|
-
settingsCache = { key, value };
|
|
916
|
-
return value;
|
|
1207
|
+
return settingsView();
|
|
917
1208
|
}
|
|
918
1209
|
function agentOf(session) {
|
|
919
1210
|
return agentFor(agentSettings(), session);
|
|
@@ -929,7 +1220,7 @@ function plainAgent(id) {
|
|
|
929
1220
|
launch: {
|
|
930
1221
|
tool: (config) => getAiTool(config && getAiTool(config).cmd === id ? config : { aiCommand: id }),
|
|
931
1222
|
canResume: () => false,
|
|
932
|
-
resumeLaunch: (s) => ({ launchPath: s.isGroup ?
|
|
1223
|
+
resumeLaunch: (s) => ({ launchPath: s.isGroup ? path11.dirname(s.paths[0] ?? "") : s.paths[0] ?? "", hasConversation: false }),
|
|
933
1224
|
cleanEnv: (env) => ({ ...env })
|
|
934
1225
|
},
|
|
935
1226
|
// Text, a pause, Enter — and no dialog to answer by keystroke (its screen is unknown).
|
|
@@ -941,6 +1232,9 @@ function plainAgent(id) {
|
|
|
941
1232
|
function knownAgents() {
|
|
942
1233
|
return [...ADAPTERS.values()];
|
|
943
1234
|
}
|
|
1235
|
+
function agentAccountFolders() {
|
|
1236
|
+
return knownAgents().flatMap((a) => a.accounts?.list().map((acc) => acc.dir) ?? []);
|
|
1237
|
+
}
|
|
944
1238
|
function agentWriteMs(cwd) {
|
|
945
1239
|
return Math.max(0, ...knownAgents().map((a) => a.conversation?.lastWriteMs?.(cwd) ?? 0));
|
|
946
1240
|
}
|
|
@@ -966,7 +1260,13 @@ function agentWire(a) {
|
|
|
966
1260
|
return {
|
|
967
1261
|
id: a.id,
|
|
968
1262
|
name: a.name,
|
|
969
|
-
can: {
|
|
1263
|
+
can: {
|
|
1264
|
+
read: !!a.conversation,
|
|
1265
|
+
hooks: !!a.events,
|
|
1266
|
+
live: !!a.live,
|
|
1267
|
+
answer: !!a.input.permissionDialog,
|
|
1268
|
+
accounts: !!a.accounts
|
|
1269
|
+
}
|
|
970
1270
|
};
|
|
971
1271
|
}
|
|
972
1272
|
function agentById(id) {
|
|
@@ -985,19 +1285,19 @@ export {
|
|
|
985
1285
|
buildAiLaunchArgs,
|
|
986
1286
|
readJsonlTail,
|
|
987
1287
|
readJsonlSince,
|
|
988
|
-
detachHere,
|
|
989
|
-
isPidAlive,
|
|
990
|
-
processName,
|
|
991
|
-
recentProcessTable,
|
|
992
|
-
bootTime,
|
|
993
|
-
killTree,
|
|
994
|
-
killTreeAsync,
|
|
995
|
-
spawnDetachedWork,
|
|
996
1288
|
internalRunEnv,
|
|
997
1289
|
isInternalRun,
|
|
1290
|
+
applyEnvDelta,
|
|
1291
|
+
hasEnvDelta,
|
|
1292
|
+
isEnvDelta,
|
|
1293
|
+
envArgs,
|
|
1294
|
+
isOwnCheckout,
|
|
1295
|
+
ownCheckoutNote,
|
|
1296
|
+
AccountAdminError,
|
|
998
1297
|
agentSettings,
|
|
999
1298
|
agentOf,
|
|
1000
1299
|
knownAgents,
|
|
1300
|
+
agentAccountFolders,
|
|
1001
1301
|
agentWriteMs,
|
|
1002
1302
|
activityRoots,
|
|
1003
1303
|
lineTimeOf,
|
|
@@ -1009,4 +1309,4 @@ export {
|
|
|
1009
1309
|
agentToRecord,
|
|
1010
1310
|
agentFor
|
|
1011
1311
|
};
|
|
1012
|
-
//# sourceMappingURL=chunk-
|
|
1312
|
+
//# sourceMappingURL=chunk-F6M255O5.js.map
|