@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
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
atomicWriteFile
|
|
4
|
+
} from "./chunk-ZXHMC7UO.js";
|
|
5
|
+
import {
|
|
6
|
+
debugLog,
|
|
7
|
+
getConfigDir
|
|
8
|
+
} from "./chunk-6THUVP6T.js";
|
|
9
|
+
|
|
10
|
+
// src/core/usage/usage-store.ts
|
|
11
|
+
import fs from "fs";
|
|
12
|
+
import path from "path";
|
|
13
|
+
var REFRESH_MS = 6e4;
|
|
14
|
+
var usageDir = () => path.join(getConfigDir(), "usage");
|
|
15
|
+
var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
16
|
+
function isWindow(v) {
|
|
17
|
+
return isRecord(v) && typeof v.id === "string" && typeof v.label === "string" && typeof v.usedPercent === "number" && (v.resetsAt === null || typeof v.resetsAt === "string") && (v.reset === void 0 || v.reset === true);
|
|
18
|
+
}
|
|
19
|
+
function parseStored(text) {
|
|
20
|
+
let v;
|
|
21
|
+
try {
|
|
22
|
+
v = JSON.parse(text);
|
|
23
|
+
} catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
if (!isRecord(v) || typeof v.at !== "string" || !Array.isArray(v.windows) || !v.windows.every(isWindow)) return null;
|
|
27
|
+
return { at: v.at, windows: v.windows };
|
|
28
|
+
}
|
|
29
|
+
var fileFor = (agent, account) => path.join(usageDir(), `${agent}-${account}.json`);
|
|
30
|
+
function keepHigher(stored, fresh) {
|
|
31
|
+
return fresh.map((w) => {
|
|
32
|
+
const was = w.resetsAt === null ? void 0 : stored.find((s) => s.id === w.id && s.resetsAt === w.resetsAt);
|
|
33
|
+
return was && was.usedPercent > w.usedPercent ? { ...w, usedPercent: was.usedPercent } : w;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function recordReading(agent, account, windows, now = Date.now()) {
|
|
37
|
+
if (windows.length === 0) return false;
|
|
38
|
+
try {
|
|
39
|
+
const file = fileFor(agent, account);
|
|
40
|
+
let stored = null;
|
|
41
|
+
try {
|
|
42
|
+
stored = parseStored(fs.readFileSync(file, "utf-8"));
|
|
43
|
+
} catch {
|
|
44
|
+
}
|
|
45
|
+
const kept = stored ? keepHigher(stored.windows, windows) : windows;
|
|
46
|
+
if (stored && JSON.stringify(stored.windows) === JSON.stringify(kept) && now - Date.parse(stored.at) < REFRESH_MS) return false;
|
|
47
|
+
fs.mkdirSync(usageDir(), { recursive: true });
|
|
48
|
+
atomicWriteFile(file, JSON.stringify({ at: new Date(now).toISOString(), windows: kept }));
|
|
49
|
+
return true;
|
|
50
|
+
} catch (e) {
|
|
51
|
+
const err = e;
|
|
52
|
+
debugLog("WARN", `[usage] reading not kept: ${err.code ? `${err.code} ` : ""}${err.message ?? String(e)}`);
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function readReadings(agent) {
|
|
57
|
+
let names;
|
|
58
|
+
try {
|
|
59
|
+
names = fs.readdirSync(usageDir());
|
|
60
|
+
} catch {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
const prefix = `${agent}-`;
|
|
64
|
+
const out = [];
|
|
65
|
+
for (const name of names) {
|
|
66
|
+
if (!name.startsWith(prefix) || !name.endsWith(".json")) continue;
|
|
67
|
+
try {
|
|
68
|
+
const stored = parseStored(fs.readFileSync(path.join(usageDir(), name), "utf-8"));
|
|
69
|
+
if (stored) out.push({ account: name.slice(prefix.length, -".json".length), ...stored });
|
|
70
|
+
} catch {
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return out.sort((a, b) => a.account.localeCompare(b.account));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
usageDir,
|
|
78
|
+
recordReading,
|
|
79
|
+
readReadings
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=chunk-RCGFHJM7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/usage/usage-store.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { getConfigDir } from '../platform/config-dir.js';\nimport { atomicWriteFile } from '../platform/fs-safe.js';\nimport { debugLog } from '../platform/logger.js';\nimport type { UsageAccount, UsageWindow } from './usage.js';\n\n// Readings the agents' hooks leave behind, one file per agent and account. The status-line hook calls recordReading on every refresh, so it stays cheap.\n\n/** A reading that hasn't changed is rewritten only when its time is this old: the age stays honest without a write per refresh. */\nconst REFRESH_MS = 60_000;\n\ntype Stored = Omit<UsageAccount, 'account'>;\n\nexport const usageDir = () => path.join(getConfigDir(), 'usage');\n\nconst isRecord = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null && !Array.isArray(v);\n\nfunction isWindow(v: unknown): v is UsageWindow {\n return (\n isRecord(v) &&\n typeof v.id === 'string' &&\n typeof v.label === 'string' &&\n typeof v.usedPercent === 'number' &&\n (v.resetsAt === null || typeof v.resetsAt === 'string') &&\n (v.reset === undefined || v.reset === true)\n );\n}\n\nfunction parseStored(text: string): Stored | null {\n let v: unknown;\n try {\n v = JSON.parse(text);\n } catch {\n return null;\n }\n if (!isRecord(v) || typeof v.at !== 'string' || !Array.isArray(v.windows) || !v.windows.every(isWindow)) return null;\n return { at: v.at, windows: v.windows };\n}\n\nconst fileFor = (agent: string, account: string) => path.join(usageDir(), `${agent}-${account}.json`);\n\n/**\n * Within one window (same id, same known reset) usage only grows: an idle agent's redraw can carry an older, lower figure\n * than another session just reported, and it mustn't win.\n */\nfunction keepHigher(stored: UsageWindow[], fresh: UsageWindow[]): UsageWindow[] {\n return fresh.map((w) => {\n const was = w.resetsAt === null ? undefined : stored.find((s) => s.id === w.id && s.resetsAt === w.resetsAt);\n return was && was.usedPercent > w.usedPercent ? { ...w, usedPercent: was.usedPercent } : w;\n });\n}\n\n/** Keep a reading. Writes only when it changed (or the stored time is over a minute old); returns whether it wrote. Never throws. */\nexport function recordReading(agent: string, account: string, windows: UsageWindow[], now = Date.now()): boolean {\n if (windows.length === 0) return false;\n try {\n const file = fileFor(agent, account);\n let stored: Stored | null = null;\n try {\n stored = parseStored(fs.readFileSync(file, 'utf-8'));\n } catch {\n /* nothing stored yet */\n }\n const kept = stored ? keepHigher(stored.windows, windows) : windows;\n if (stored && JSON.stringify(stored.windows) === JSON.stringify(kept) && now - Date.parse(stored.at) < REFRESH_MS) return false;\n fs.mkdirSync(usageDir(), { recursive: true });\n atomicWriteFile(file, JSON.stringify({ at: new Date(now).toISOString(), windows: kept }));\n return true;\n } catch (e) {\n // Only the log: this runs in an agent's hook (Claude's status line), which shows nothing of ours.\n const err = e as NodeJS.ErrnoException;\n debugLog('WARN', `[usage] reading not kept: ${err.code ? `${err.code} ` : ''}${err.message ?? String(e)}`);\n return false;\n }\n}\n\n/** Every account's last reading for an agent, by account name. A file that isn't a reading is skipped. */\nexport function readReadings(agent: string): UsageAccount[] {\n let names: string[];\n try {\n names = fs.readdirSync(usageDir());\n } catch {\n return [];\n }\n const prefix = `${agent}-`;\n const out: UsageAccount[] = [];\n for (const name of names) {\n if (!name.startsWith(prefix) || !name.endsWith('.json')) continue;\n try {\n const stored = parseStored(fs.readFileSync(path.join(usageDir(), name), 'utf-8'));\n if (stored) out.push({ account: name.slice(prefix.length, -'.json'.length), ...stored });\n } catch {\n /* unreadable: skipped */\n }\n }\n return out.sort((a, b) => a.account.localeCompare(b.account));\n}\n"],"mappings":";;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AASjB,IAAM,aAAa;AAIZ,IAAM,WAAW,MAAM,KAAK,KAAK,aAAa,GAAG,OAAO;AAE/D,IAAM,WAAW,CAAC,MAA6C,OAAO,MAAM,YAAY,MAAM,QAAQ,CAAC,MAAM,QAAQ,CAAC;AAEtH,SAAS,SAAS,GAA8B;AAC9C,SACE,SAAS,CAAC,KACV,OAAO,EAAE,OAAO,YAChB,OAAO,EAAE,UAAU,YACnB,OAAO,EAAE,gBAAgB,aACxB,EAAE,aAAa,QAAQ,OAAO,EAAE,aAAa,cAC7C,EAAE,UAAU,UAAa,EAAE,UAAU;AAE1C;AAEA,SAAS,YAAY,MAA6B;AAChD,MAAI;AACJ,MAAI;AACF,QAAI,KAAK,MAAM,IAAI;AAAA,EACrB,QAAQ;AACN,WAAO;AAAA,EACT;AACA,MAAI,CAAC,SAAS,CAAC,KAAK,OAAO,EAAE,OAAO,YAAY,CAAC,MAAM,QAAQ,EAAE,OAAO,KAAK,CAAC,EAAE,QAAQ,MAAM,QAAQ,EAAG,QAAO;AAChH,SAAO,EAAE,IAAI,EAAE,IAAI,SAAS,EAAE,QAAQ;AACxC;AAEA,IAAM,UAAU,CAAC,OAAe,YA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A,EACnC,QAAQ;AACN,WAAO,CAAC;AAAA,EACV;AACA,QAAM,SAAS,GAAG,KAAK;AACvB,QAAM,MAAsB,CAAC;AAC7B,aAAW,QAAQ,OAAO;AACxB,QAAI,CAAC,KAAK,WAAW,MAAM,KAAK,CAAC,KAAK,SAAS,OAAO,EAAG;AACzD,QAAI;AACF,YAAM,SAAS,YAAY,GAAG,aAAa,KAAK,KAAK,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC;AAChF,UAAI,OAAQ,KAAI,KAAK,EAAE,SAAS,KAAK,MAAM,OAAO,QAAQ,CAAC,QAAQ,MAAM,GAAG,GAAG,OAAO,CAAC;AAAA,IACzF,QAAQ;AAAA,IAER;AAAA,EACF;AACA,SAAO,IAAI,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,cAAc,EAAE,OAAO,CAAC;AAC9D;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
sessionIdFor
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YYBXQBW2.js";
|
|
5
5
|
|
|
6
6
|
// src/core/worktree/session-folder.ts
|
|
7
7
|
import path from "path";
|
|
@@ -30,4 +30,4 @@ export {
|
|
|
30
30
|
sessionFolderPath,
|
|
31
31
|
flatFolderOwner
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-RGUSVBGN.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
json,
|
|
4
4
|
tx,
|
|
5
5
|
withDb
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YYBXQBW2.js";
|
|
7
7
|
|
|
8
8
|
// src/core/rail/rail-layout.ts
|
|
9
9
|
var MAX_SECTIONS = 30;
|
|
@@ -144,4 +144,4 @@ export {
|
|
|
144
144
|
changeRailSections,
|
|
145
145
|
placeSession
|
|
146
146
|
};
|
|
147
|
-
//# sourceMappingURL=chunk-
|
|
147
|
+
//# sourceMappingURL=chunk-S3BAD4IR.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
loadHistory
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QLAVWIDJ.js";
|
|
5
5
|
import {
|
|
6
6
|
json,
|
|
7
7
|
sessionIdFor,
|
|
8
8
|
tx,
|
|
9
9
|
withDb
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YYBXQBW2.js";
|
|
11
11
|
|
|
12
12
|
// src/core/rail/blocks.ts
|
|
13
13
|
var MAX_BLOCKERS = 10;
|
|
@@ -148,4 +148,4 @@ export {
|
|
|
148
148
|
sweepBlocks,
|
|
149
149
|
blockRefFrom
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=chunk-
|
|
151
|
+
//# sourceMappingURL=chunk-SDQI3QB3.js.map
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
isPidAlive,
|
|
7
7
|
killTreeAsync
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4NITDMDH.js";
|
|
9
9
|
import {
|
|
10
10
|
getConfigDir
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6THUVP6T.js";
|
|
12
12
|
|
|
13
13
|
// src/core/platform/running-from.ts
|
|
14
14
|
import fs from "fs";
|
|
@@ -247,4 +247,4 @@ export {
|
|
|
247
247
|
runningFromNames,
|
|
248
248
|
stopRunningFrom
|
|
249
249
|
};
|
|
250
|
-
//# sourceMappingURL=chunk-
|
|
250
|
+
//# sourceMappingURL=chunk-SG5LUMGE.js.map
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
atomicWriteFile,
|
|
4
|
+
ensureFile,
|
|
5
|
+
resolveLinkTarget,
|
|
6
|
+
withFileLock,
|
|
7
|
+
withFileLockSync
|
|
8
|
+
} from "./chunk-ZXHMC7UO.js";
|
|
9
|
+
import {
|
|
10
|
+
report
|
|
11
|
+
} from "./chunk-AU27USPZ.js";
|
|
12
|
+
|
|
13
|
+
// src/core/platform/settings-editor.ts
|
|
14
|
+
import fs from "fs";
|
|
15
|
+
import path from "path";
|
|
16
|
+
import os from "os";
|
|
17
|
+
function settingsPath() {
|
|
18
|
+
return path.join(os.homedir(), ".claude", "settings.json");
|
|
19
|
+
}
|
|
20
|
+
var OWNER_TAG = "_workHookOwner";
|
|
21
|
+
var PID_TAG = "_workHookPid";
|
|
22
|
+
var HOOK_TAGS = {
|
|
23
|
+
OWNER_TAG,
|
|
24
|
+
PID_TAG
|
|
25
|
+
};
|
|
26
|
+
function readSettings(file) {
|
|
27
|
+
let text;
|
|
28
|
+
try {
|
|
29
|
+
text = fs.readFileSync(file, "utf8");
|
|
30
|
+
} catch (err) {
|
|
31
|
+
return err.code === "ENOENT" ? { kind: "missing" } : { kind: "unreadable", error: err.message };
|
|
32
|
+
}
|
|
33
|
+
if (!text.trim()) return { kind: "missing" };
|
|
34
|
+
try {
|
|
35
|
+
const parsed = JSON.parse(text);
|
|
36
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return { kind: "unreadable", error: "not a JSON object" };
|
|
37
|
+
return { kind: "ok", settings: parsed };
|
|
38
|
+
} catch (err) {
|
|
39
|
+
return { kind: "unreadable", error: err.message };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
var backedUp = /* @__PURE__ */ new Set();
|
|
43
|
+
function backupOnce(file) {
|
|
44
|
+
if (backedUp.has(file) || !fs.existsSync(file)) return;
|
|
45
|
+
try {
|
|
46
|
+
fs.copyFileSync(file, `${file}.work-backup`);
|
|
47
|
+
backedUp.add(file);
|
|
48
|
+
} catch {
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function applyEdit(file, mutate) {
|
|
52
|
+
const read = readSettings(file);
|
|
53
|
+
if (read.kind === "unreadable") {
|
|
54
|
+
report(
|
|
55
|
+
"error",
|
|
56
|
+
`[work] ${file} is not valid JSON (${read.error}) \u2014 left it alone; work's Claude hooks were not updated. Fix the file and restart work web.`
|
|
57
|
+
);
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
const s = read.kind === "ok" ? read.settings : {};
|
|
61
|
+
const before = JSON.stringify(s);
|
|
62
|
+
if (!s.hooks) s.hooks = {};
|
|
63
|
+
mutate(s);
|
|
64
|
+
if (s.hooks && Object.keys(s.hooks).length === 0) delete s.hooks;
|
|
65
|
+
if (JSON.stringify(s) === before) return true;
|
|
66
|
+
backupOnce(file);
|
|
67
|
+
atomicWriteFile(file, `${JSON.stringify(s, null, 2)}
|
|
68
|
+
`);
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
function target(file) {
|
|
72
|
+
const t = resolveLinkTarget(file ?? settingsPath());
|
|
73
|
+
fs.mkdirSync(path.dirname(t), { recursive: true });
|
|
74
|
+
return t;
|
|
75
|
+
}
|
|
76
|
+
var editQueue = Promise.resolve();
|
|
77
|
+
function editSettings(mutate, settingsFile) {
|
|
78
|
+
const run = editQueue.then(async () => {
|
|
79
|
+
try {
|
|
80
|
+
const file = target(settingsFile);
|
|
81
|
+
if (!fs.existsSync(file)) ensureFile(file, "{}\n");
|
|
82
|
+
await withFileLock(file, () => applyEdit(file, mutate));
|
|
83
|
+
} catch (err) {
|
|
84
|
+
report("error", `[work] could not update Claude settings: ${err.message}`);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
editQueue = run;
|
|
88
|
+
return run;
|
|
89
|
+
}
|
|
90
|
+
function editSettingsSync(mutate, settingsFile) {
|
|
91
|
+
try {
|
|
92
|
+
const file = target(settingsFile);
|
|
93
|
+
if (!fs.existsSync(file)) ensureFile(file, "{}\n");
|
|
94
|
+
withFileLockSync(file, () => applyEdit(file, mutate));
|
|
95
|
+
} catch (err) {
|
|
96
|
+
report("error", `[work] could not update Claude settings: ${err.message}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function readSettingsFile(settingsFile) {
|
|
100
|
+
const read = readSettings(resolveLinkTarget(settingsFile ?? settingsPath()));
|
|
101
|
+
return read.kind === "ok" ? read.settings : read.kind === "missing" ? {} : null;
|
|
102
|
+
}
|
|
103
|
+
function isOwnerEntry(h, owner) {
|
|
104
|
+
return h[OWNER_TAG] === owner;
|
|
105
|
+
}
|
|
106
|
+
function isStaleEntry(h) {
|
|
107
|
+
if (typeof h[OWNER_TAG] !== "string") return false;
|
|
108
|
+
const pid = h[PID_TAG];
|
|
109
|
+
if (typeof pid !== "number") return false;
|
|
110
|
+
try {
|
|
111
|
+
process.kill(pid, 0);
|
|
112
|
+
return false;
|
|
113
|
+
} catch {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function tag(entry, owner) {
|
|
118
|
+
return {
|
|
119
|
+
...entry,
|
|
120
|
+
[OWNER_TAG]: owner,
|
|
121
|
+
[PID_TAG]: process.pid
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
HOOK_TAGS,
|
|
127
|
+
editSettings,
|
|
128
|
+
editSettingsSync,
|
|
129
|
+
readSettingsFile,
|
|
130
|
+
isOwnerEntry,
|
|
131
|
+
isStaleEntry,
|
|
132
|
+
tag
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=chunk-UBOKRHNV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/platform/settings-editor.ts"],"sourcesContent":["/**\n * Atomic read/edit/write helpers for `~/.claude/settings.json` — the user's\n * global Claude Code settings (or another account's `<config dir>/settings.json`).\n *\n * `installCommandHook` mutates this file at `work web` startup/shutdown.\n * (The retired `work dash` also installed http-type hooks here; any it left\n * behind are tagged with a dead PID and pruned as stale on the next\n * install.) Writes used to be a plain `fs.writeFileSync`. If two `work` processes started concurrently —\n * or one was killed mid-write — the user's global hooks would be silently\n * truncated. That breaks hooks for every project, not just `work`.\n *\n * Everything here writes through `editSettings`: a tmp-file + rename atomic\n * write, under an in-process queue and a cross-process file lock (§5.2).\n * The rename follows symlinks (`atomicWriteFile`) so a settings.json\n * symlinked into a dotfiles repo keeps being a symlink. A file that exists\n * but doesn't parse is never replaced, and the first edit keeps a\n * `settings.json.work-backup`.\n */\n\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport os from 'node:os';\nimport { atomicWriteFile, ensureFile, resolveLinkTarget, withFileLock, withFileLockSync } from './fs-safe.js';\nimport { report } from './report.js';\n\n/** Resolved lazily (not at module load) so tests can stub `os.homedir`. */\nfunction settingsPath(): string {\n return path.join(os.homedir(), '.claude', 'settings.json');\n}\nconst OWNER_TAG = '_workHookOwner';\nconst PID_TAG = '_workHookPid';\n\nexport interface SettingsFile {\n hooks?: Record<string, HookEntry[] | undefined>;\n [k: string]: unknown;\n}\nexport interface HookEntry {\n hooks?: { type: string; url?: string; command?: string; timeout?: number }[];\n matcher?: string;\n [k: string]: unknown;\n}\n\nexport const HOOK_TAGS = {\n OWNER_TAG,\n PID_TAG,\n} as const;\n\ntype Read =\n | { kind: 'ok'; settings: SettingsFile }\n /** No file yet: start from an empty one. */\n | { kind: 'missing' }\n /** The file exists but isn't valid JSON (a hand edit in progress, another\n * tool mid-write). NOT the same as empty: writing now would replace the\n * user's permissions, env, model… with just our hooks. */\n | { kind: 'unreadable'; error: string };\n\nfunction readSettings(file: string): Read {\n let text: string;\n try {\n text = fs.readFileSync(file, 'utf8');\n } catch (err) {\n return (err as NodeJS.ErrnoException).code === 'ENOENT' ? { kind: 'missing' } : { kind: 'unreadable', error: (err as Error).message };\n }\n if (!text.trim()) return { kind: 'missing' };\n try {\n const parsed = JSON.parse(text) as unknown;\n if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) return { kind: 'unreadable', error: 'not a JSON object' };\n return { kind: 'ok', settings: parsed as SettingsFile };\n } catch (err) {\n return { kind: 'unreadable', error: (err as Error).message };\n }\n}\n\n/** One backup per file per process, of the file as it was before this\n * process first edited it. */\nconst backedUp = new Set<string>();\nfunction backupOnce(file: string): void {\n if (backedUp.has(file) || !fs.existsSync(file)) return;\n try {\n fs.copyFileSync(file, `${file}.work-backup`);\n backedUp.add(file);\n } catch {\n /* best-effort */\n }\n}\n\n/**\n * The read-modify-write, under a cross-process lock on the real file (the\n * symlink target): Claude Code saving settings, a lean `work web` autostarted\n * by `wd` installing hooks and a full one shutting down can all edit this\n * file at once, and an unlocked rewrite drops one side's edit. Returns\n * false when the file couldn't be read and was left untouched.\n */\nfunction applyEdit(file: string, mutate: (s: SettingsFile) => void): boolean {\n const read = readSettings(file);\n if (read.kind === 'unreadable') {\n report(\n 'error',\n `[work] ${file} is not valid JSON (${read.error}) — left it alone; work's Claude hooks were not updated. Fix the file and restart work web.`,\n );\n return false;\n }\n const s = read.kind === 'ok' ? read.settings : {};\n const before = JSON.stringify(s);\n if (!s.hooks) s.hooks = {};\n mutate(s);\n if (s.hooks && Object.keys(s.hooks).length === 0) delete s.hooks;\n // Nothing changed (hooks already in, status line already wrapped): no write and no backup — the file is often synced\n // or in a dotfiles repo, and every work web start would otherwise touch it.\n if (JSON.stringify(s) === before) return true;\n backupOnce(file);\n // Trailing newline: this file is commonly symlinked into a dotfiles repo,\n // and a missing one shows up as a diff artefact on every edit.\n atomicWriteFile(file, `${JSON.stringify(s, null, 2)}\\n`);\n return true;\n}\n\nfunction target(file?: string): string {\n const t = resolveLinkTarget(file ?? settingsPath());\n fs.mkdirSync(path.dirname(t), { recursive: true });\n return t;\n}\n\n/**\n * Edit the settings file: atomic (tmp + rename, through a symlink to the\n * real file), serialised within this process AND locked across processes.\n * An unparsable file is never replaced.\n */\nlet editQueue: Promise<unknown> = Promise.resolve();\nexport function editSettings(mutate: (s: SettingsFile) => void, settingsFile?: string): Promise<void> {\n const run = editQueue.then(async () => {\n try {\n const file = target(settingsFile);\n if (!fs.existsSync(file)) ensureFile(file, '{}\\n');\n await withFileLock(file, () => applyEdit(file, mutate));\n } catch (err) {\n report('error', `[work] could not update Claude settings: ${(err as Error).message}`);\n }\n });\n editQueue = run;\n return run;\n}\n\n/** Synchronous variant — shutdown handlers, where there's no time to await.\n * Same lock and the same refusal to overwrite an unparsable file. */\nexport function editSettingsSync(mutate: (s: SettingsFile) => void, settingsFile?: string): void {\n try {\n const file = target(settingsFile);\n if (!fs.existsSync(file)) ensureFile(file, '{}\\n');\n withFileLockSync(file, () => applyEdit(file, mutate));\n } catch (err) {\n report('error', `[work] could not update Claude settings: ${(err as Error).message}`);\n }\n}\n\n/**\n * The settings as they are now, read only: `{}` when there is no file, null when it doesn't parse. `settingsFile`: another\n * Claude account's settings.json (default: ~/.claude/settings.json — every edit function takes it the same way).\n */\nexport function readSettingsFile(settingsFile?: string): SettingsFile | null {\n const read = readSettings(resolveLinkTarget(settingsFile ?? settingsPath()));\n return read.kind === 'ok' ? read.settings : read.kind === 'missing' ? {} : null;\n}\n\n/** Common predicate: is this entry tagged with our owner? */\nexport function isOwnerEntry(h: HookEntry, owner: string): boolean {\n return h[OWNER_TAG] === owner;\n}\n\n/** Common predicate: was this entry tagged by a `work` process that's no\n * longer running? Stale entries get pruned on every install. */\nexport function isStaleEntry(h: HookEntry): boolean {\n if (typeof h[OWNER_TAG] !== 'string') return false;\n const pid = h[PID_TAG];\n if (typeof pid !== 'number') return false;\n try {\n process.kill(pid, 0);\n return false;\n } catch {\n return true;\n }\n}\n\n/** Tag an entry so future installs can find/remove it. */\nexport function tag(entry: HookEntry, owner: string): HookEntry {\n return {\n ...entry,\n [OWNER_TAG]: owner,\n [PID_TAG]: process.pid,\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAmBA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,QAAQ;AAKf,SAAS,eAAuB;AAC9B,SAAO,KAAK,KAAK,GAAG,QAAQ,GAAG,WAAW,eAAe;AAC3D;AACA,IAAM,YAAY;AAClB,IAAM,UAAU;A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