@moberg_hr/work-tree 2.14.1 → 2.15.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-GOU2FC56.js → account-X42JQCYT.js} +31 -30
- package/dist/account-X42JQCYT.js.map +1 -0
- package/dist/{add-repo-PHD76M4S.js → add-repo-UZHIG6LN.js} +30 -29
- package/dist/{add-repo-PHD76M4S.js.map → add-repo-UZHIG6LN.js.map} +1 -1
- package/dist/{answer-HUVZ3XMW.js → answer-NDX2DNXK.js} +19 -18
- package/dist/{answer-HUVZ3XMW.js.map → answer-NDX2DNXK.js.map} +1 -1
- package/dist/{attach-RJ53ABQN.js → attach-ETPEGXYM.js} +26 -26
- package/dist/bin.js +9 -7
- package/dist/bin.js.map +1 -1
- package/dist/{block-W34JH22B.js → block-5HJQWQNX.js} +24 -23
- package/dist/{block-W34JH22B.js.map → block-5HJQWQNX.js.map} +1 -1
- package/dist/{broadcast-7YTINXQF.js → broadcast-TMCWRTIY.js} +16 -15
- package/dist/{broadcast-7YTINXQF.js.map → broadcast-TMCWRTIY.js.map} +1 -1
- package/dist/{catchup-5HC52SDK.js → catchup-BBJ43GWY.js} +22 -21
- package/dist/{catchup-5HC52SDK.js.map → catchup-BBJ43GWY.js.map} +1 -1
- package/dist/{chunk-ULI3NB4J.js → chunk-2IDWQ5NO.js} +7 -7
- package/dist/{chunk-UTBIZ6W5.js → chunk-2PAHTJ3B.js} +7 -7
- package/dist/{chunk-RCWQD32G.js → chunk-3YON263F.js} +5 -5
- package/dist/{chunk-JQ42ERH3.js → chunk-44UME4JD.js} +2 -2
- package/dist/{chunk-PAEWU7UC.js → chunk-46WW3Z6C.js} +8 -8
- package/dist/{chunk-AYHDJMMJ.js → chunk-4CXUVBOD.js} +2 -2
- package/dist/{chunk-MKJH2D4V.js → chunk-4NIOURHZ.js} +2 -2
- package/dist/{chunk-EHUKDUNJ.js → chunk-4WTY3SFZ.js} +7 -7
- package/dist/{chunk-4B2UV6JH.js → chunk-4ZP6NN2X.js} +18 -16
- package/dist/{chunk-4B2UV6JH.js.map → chunk-4ZP6NN2X.js.map} +1 -1
- package/dist/{chunk-T26N4I4E.js → chunk-5LAFHPNB.js} +8 -8
- package/dist/{chunk-AU27USPZ.js → chunk-5ZCCUM75.js} +2 -2
- package/dist/{chunk-UY5J2KY2.js → chunk-6SYQQXPQ.js} +32 -22
- package/dist/chunk-6SYQQXPQ.js.map +1 -0
- package/dist/{chunk-MQQADIRH.js → chunk-7QDZGVIT.js} +4 -4
- package/dist/{chunk-A3R3VO6G.js → chunk-7S3NPGVM.js} +6 -6
- package/dist/{chunk-BPAV2PIE.js → chunk-AHGMXBY3.js} +2 -2
- package/dist/{chunk-RRNIJ7YO.js → chunk-ALBTIOP3.js} +3 -3
- package/dist/{chunk-NCXRMJGS.js → chunk-BRUYXYO2.js} +9 -6
- package/dist/chunk-BRUYXYO2.js.map +1 -0
- package/dist/{chunk-LCUN2I5Q.js → chunk-BWUN33QN.js} +11 -9
- package/dist/{chunk-LCUN2I5Q.js.map → chunk-BWUN33QN.js.map} +1 -1
- package/dist/{chunk-FLY3VR6B.js → chunk-BZGIKO6I.js} +2 -2
- package/dist/{chunk-UIG3CTXU.js → chunk-C6OEPSH2.js} +8 -8
- package/dist/{chunk-MOTKVMGL.js → chunk-C6TKUX7I.js} +30 -5
- package/dist/chunk-C6TKUX7I.js.map +1 -0
- package/dist/{chunk-RVSRZ57P.js → chunk-CNZV3UCM.js} +2 -2
- package/dist/{chunk-ERXXU72V.js → chunk-CVTM4TCZ.js} +7 -7
- package/dist/{chunk-Y2DBNXZH.js → chunk-CYUSOVO5.js} +291 -114
- package/dist/chunk-CYUSOVO5.js.map +1 -0
- package/dist/{chunk-KJY2AJQS.js → chunk-DBGHDWM7.js} +12 -12
- package/dist/{chunk-CBCOVIXZ.js → chunk-DOYJR2HF.js} +5 -3
- package/dist/{chunk-CBCOVIXZ.js.map → chunk-DOYJR2HF.js.map} +1 -1
- package/dist/{chunk-LSZ6HI3U.js → chunk-EORL2V7P.js} +2 -2
- package/dist/{chunk-DPO6I7OR.js → chunk-EQD3YBGA.js} +12 -12
- package/dist/{chunk-RE3NKV4Z.js → chunk-EQFDUC6F.js} +3 -3
- package/dist/chunk-F2ECTTSY.js +22 -0
- package/dist/chunk-F2ECTTSY.js.map +1 -0
- package/dist/{chunk-CWWWZRMN.js → chunk-FIEBI3UB.js} +3 -3
- package/dist/{chunk-FLQOSWVR.js → chunk-FNWPOM4B.js} +9 -42
- package/dist/chunk-FNWPOM4B.js.map +1 -0
- package/dist/{chunk-GSL6ZBQX.js → chunk-GGE55DO3.js} +17 -17
- package/dist/{chunk-AGRUEZQX.js → chunk-GNIYYXQX.js} +2 -2
- package/dist/{chunk-DWEW7I53.js → chunk-GPLCT5TZ.js} +9 -9
- package/dist/chunk-HK6AZQ5Z.js +54 -0
- package/dist/chunk-HK6AZQ5Z.js.map +1 -0
- package/dist/{chunk-6THUVP6T.js → chunk-IAKOKZYW.js} +13 -27
- package/dist/chunk-IAKOKZYW.js.map +1 -0
- package/dist/{chunk-TUDDISCX.js → chunk-ICEP4WAK.js} +4 -4
- package/dist/{chunk-7UXV4X2Y.js → chunk-IPHADNF5.js} +2 -2
- package/dist/{chunk-5D5V4P7J.js → chunk-ITY6R2LC.js} +5 -5
- package/dist/{chunk-VLUME72O.js → chunk-JVJ5IJSF.js} +4 -4
- package/dist/{chunk-K5EAVRXX.js → chunk-JYWX2N5W.js} +4 -6
- package/dist/{chunk-K5EAVRXX.js.map → chunk-JYWX2N5W.js.map} +1 -1
- package/dist/{chunk-6MUKE253.js → chunk-K2OOUNXH.js} +4 -4
- package/dist/{chunk-YXUVNSDM.js → chunk-KCYYIUUQ.js} +2 -2
- package/dist/chunk-KL7RY6UG.js +36 -0
- package/dist/chunk-KL7RY6UG.js.map +1 -0
- package/dist/{chunk-TNKBZIR5.js → chunk-LMP3WGRW.js} +3 -3
- package/dist/{chunk-2Y2ARDXI.js → chunk-MD6QMSXQ.js} +2 -2
- package/dist/{chunk-U2MOKVPZ.js → chunk-MHL66TIL.js} +2 -2
- package/dist/{chunk-SAPDMQTO.js → chunk-MVME4LH7.js} +8 -8
- package/dist/{chunk-S43GVNRB.js → chunk-MXH7DV4Q.js} +8 -8
- package/dist/{chunk-UI45HNNQ.js → chunk-MZY557LZ.js} +9 -9
- package/dist/{chunk-X5XVXJ4B.js → chunk-O32OINY3.js} +2 -2
- package/dist/{chunk-2K44PZRP.js → chunk-OL7S2KFH.js} +60 -59
- package/dist/chunk-OL7S2KFH.js.map +1 -0
- package/dist/chunk-OX33X3NH.js +9 -0
- package/dist/{chunk-5U3CSRV5.js → chunk-PSFOA7P6.js} +9 -9
- package/dist/{chunk-UH72CZAX.js → chunk-PZ7WTBSI.js} +2 -2
- package/dist/{chunk-MUCUSF6Y.js → chunk-QHA4VF4B.js} +3 -3
- package/dist/{chunk-7UIRKGY7.js → chunk-QMHFXIMX.js} +16 -14
- package/dist/chunk-QMHFXIMX.js.map +1 -0
- package/dist/{chunk-ZS7ZXAXB.js → chunk-QOSAWNOU.js} +66 -2
- package/dist/chunk-QOSAWNOU.js.map +1 -0
- package/dist/{chunk-XSI4WZIX.js → chunk-QP7VLMFJ.js} +5 -5
- package/dist/{chunk-RCBDG7CW.js → chunk-R5DHVUA2.js} +4 -3
- package/dist/{chunk-RCBDG7CW.js.map → chunk-R5DHVUA2.js.map} +1 -1
- package/dist/{chunk-T7K276XW.js → chunk-R5HG665I.js} +6 -6
- package/dist/{chunk-RUIBZ6DI.js → chunk-R6KQDWHC.js} +3 -3
- package/dist/{chunk-V72WJIGN.js → chunk-REAZAE5C.js} +10 -10
- package/dist/{chunk-BK73QU45.js → chunk-REPFZIPP.js} +27 -8
- package/dist/chunk-REPFZIPP.js.map +1 -0
- package/dist/{chunk-AAOAVXBF.js → chunk-RXORNKSJ.js} +8 -8
- package/dist/{chunk-BXVBNYQT.js → chunk-S2MOK3CT.js} +4 -4
- package/dist/{chunk-ZLQGKBBE.js → chunk-SRE4CK6Y.js} +2 -2
- package/dist/{chunk-TMBO55MM.js → chunk-SZAD5U3J.js} +2 -2
- package/dist/{chunk-ZIFWZJ7X.js → chunk-T5GJVUSL.js} +2 -2
- package/dist/{chunk-DZ6SLAIZ.js → chunk-TC3H7I6O.js} +2 -2
- package/dist/{chunk-S2CQ73G4.js → chunk-TI6AR4QF.js} +5 -5
- package/dist/{chunk-7ZL3GJGY.js → chunk-TZLCBDJZ.js} +4 -4
- package/dist/{chunk-LKJLUSYR.js → chunk-U64SNFIZ.js} +3 -3
- package/dist/{chunk-Z3T5FWM6.js → chunk-UCNYEHQY.js} +2 -2
- package/dist/{chunk-GDR4RWF4.js → chunk-UIIEP6VP.js} +2 -2
- package/dist/{chunk-7XKIRMS4.js → chunk-UJWYQVXI.js} +2 -2
- package/dist/{chunk-G2V2V5UC.js → chunk-VHENFC2S.js} +2 -2
- package/dist/{chunk-AKDTLWWD.js → chunk-WNWSO4VO.js} +8 -8
- package/dist/{chunk-PJQRSOLE.js → chunk-X6EMCJ2L.js} +4 -4
- package/dist/{chunk-MKQ7IA6U.js → chunk-XBWS77S2.js} +3 -3
- package/dist/{chunk-WAZCBD7Y.js → chunk-XMKYQVJU.js} +3 -3
- package/dist/{chunk-JNKFPFH6.js → chunk-XPWWOR7Z.js} +3 -3
- package/dist/{chunk-5SMTFIYI.js → chunk-Z3OHGPIN.js} +7 -7
- package/dist/{chunk-6AJFOISA.js → chunk-ZNGR2CB6.js} +4 -4
- package/dist/{cleanup-KVZ7P6EN.js → cleanup-BD44PDRE.js} +48 -47
- package/dist/{cleanup-KVZ7P6EN.js.map → cleanup-BD44PDRE.js.map} +1 -1
- package/dist/cli-OMADLGGY.js +20 -0
- package/dist/color-IZ2J3CT2.js +65 -0
- package/dist/color-IZ2J3CT2.js.map +1 -0
- package/dist/{command-hook-installer-GMQ4IVDE.js → command-hook-installer-TRLJ4QFP.js} +13 -4
- package/dist/{command-hook-installer-GMQ4IVDE.js.map → command-hook-installer-TRLJ4QFP.js.map} +1 -1
- package/dist/{completion-OEU4UZEA.js → completion-SV446DXJ.js} +3 -4
- package/dist/{completion-OEU4UZEA.js.map → completion-SV446DXJ.js.map} +1 -1
- package/dist/{config-JEVEBD3O.js → config-65HXBCMW.js} +21 -20
- package/dist/{config-JEVEBD3O.js.map → config-65HXBCMW.js.map} +1 -1
- package/dist/{diff-3ZGUWMX4.js → diff-CJNSUX25.js} +27 -27
- package/dist/{digest-XJYJDGVX.js → digest-FH3JBHSO.js} +18 -17
- package/dist/{digest-XJYJDGVX.js.map → digest-FH3JBHSO.js.map} +1 -1
- package/dist/{fork-AGFYDM5U.js → fork-O6NS34MV.js} +44 -44
- package/dist/{history-VYAGUN2X.js → history-URHFR4MO.js} +15 -14
- package/dist/{hook-PWMF5WBD.js → hook-6PWP3JVL.js} +27 -29
- package/dist/hook-6PWP3JVL.js.map +1 -0
- package/dist/{hydrate-PMH6OEVU.js → hydrate-V6PVQ6OO.js} +17 -16
- package/dist/{hydrate-PMH6OEVU.js.map → hydrate-V6PVQ6OO.js.map} +1 -1
- package/dist/{init-A3J3OC6Y.js → init-SENRHJ4R.js} +26 -25
- package/dist/{init-A3J3OC6Y.js.map → init-SENRHJ4R.js.map} +1 -1
- package/dist/install-skills-DJE7LU66.js +24 -0
- package/dist/install-skills-bin.js +13 -12
- package/dist/install-skills-bin.js.map +1 -1
- package/dist/{keep-VRBCD2OU.js → keep-M7E7UMRL.js} +18 -17
- package/dist/{keep-VRBCD2OU.js.map → keep-M7E7UMRL.js.map} +1 -1
- package/dist/{list-WT2YLARZ.js → list-YPKCU3GB.js} +17 -16
- package/dist/{list-WT2YLARZ.js.map → list-YPKCU3GB.js.map} +1 -1
- package/dist/{move-4P2X2VL2.js → move-ME7JMNJI.js} +32 -31
- package/dist/{move-4P2X2VL2.js.map → move-ME7JMNJI.js.map} +1 -1
- package/dist/{note-INPWMP2K.js → note-JFZ3F7UY.js} +19 -18
- package/dist/{note-INPWMP2K.js.map → note-JFZ3F7UY.js.map} +1 -1
- package/dist/{overlaps-SEMKBXBD.js → overlaps-ZN3WA35A.js} +25 -24
- package/dist/{overlaps-SEMKBXBD.js.map → overlaps-ZN3WA35A.js.map} +1 -1
- package/dist/{pin-4524YHPO.js → pin-3S2MQQPM.js} +19 -18
- package/dist/{pin-4524YHPO.js.map → pin-3S2MQQPM.js.map} +1 -1
- package/dist/{pr-CRLSAAGA.js → pr-KNJ2TVC3.js} +39 -38
- package/dist/{pr-CRLSAAGA.js.map → pr-KNJ2TVC3.js.map} +1 -1
- package/dist/{prune-3XFHACES.js → prune-2GAXXNPM.js} +46 -45
- package/dist/{prune-3XFHACES.js.map → prune-2GAXXNPM.js.map} +1 -1
- package/dist/{pty-host-4NEN3SID.js → pty-host-WZZIQIKX.js} +43 -39
- package/dist/pty-host-WZZIQIKX.js.map +1 -0
- package/dist/{read-TNPMUPCX.js → read-UIV42F5D.js} +18 -17
- package/dist/{read-TNPMUPCX.js.map → read-UIV42F5D.js.map} +1 -1
- package/dist/{recent-GUABGTFG.js → recent-SJPAIY2T.js} +35 -27
- package/dist/recent-SJPAIY2T.js.map +1 -0
- package/dist/{remove-FDXCPMGJ.js → remove-KQW35I5D.js} +47 -46
- package/dist/{remove-FDXCPMGJ.js.map → remove-KQW35I5D.js.map} +1 -1
- package/dist/{report-J7TUQRJS.js → report-Z36H65YG.js} +4 -3
- package/dist/{restart-OETITN5N.js → restart-7VTSNTZ3.js} +22 -21
- package/dist/{restart-OETITN5N.js.map → restart-7VTSNTZ3.js.map} +1 -1
- package/dist/{resume-XDUTFTWV.js → resume-MPBXIF7C.js} +35 -27
- package/dist/resume-MPBXIF7C.js.map +1 -0
- package/dist/{review-EKSF3BUM.js → review-IRVOI4ZK.js} +57 -10
- package/dist/review-IRVOI4ZK.js.map +1 -0
- package/dist/{review-now-XUEDTNMP.js → review-now-QAAL5C6N.js} +7 -6
- package/dist/{review-now-XUEDTNMP.js.map → review-now-QAAL5C6N.js.map} +1 -1
- package/dist/{run-INEROJF3.js → run-2EKY2R5R.js} +15 -14
- package/dist/{run-INEROJF3.js.map → run-2EKY2R5R.js.map} +1 -1
- package/dist/{screen-JNM536PR.js → screen-GQTKTUTD.js} +19 -18
- package/dist/{screen-JNM536PR.js.map → screen-GQTKTUTD.js.map} +1 -1
- package/dist/{search-FOBT55YQ.js → search-N7XUYKYV.js} +15 -14
- package/dist/{search-FOBT55YQ.js.map → search-N7XUYKYV.js.map} +1 -1
- package/dist/{section-7ZGM5YOL.js → section-6MDCSJS5.js} +19 -18
- package/dist/{section-7ZGM5YOL.js.map → section-6MDCSJS5.js.map} +1 -1
- package/dist/{send-6X2IKY54.js → send-32U465SB.js} +24 -23
- package/dist/{send-6X2IKY54.js.map → send-32U465SB.js.map} +1 -1
- package/dist/{sessions-6DLS2JQG.js → sessions-E5OEZF2C.js} +42 -41
- package/dist/{sessions-6DLS2JQG.js.map → sessions-E5OEZF2C.js.map} +1 -1
- package/dist/{show-YTJ3NVMP.js → show-AQQDICKX.js} +18 -17
- package/dist/{show-YTJ3NVMP.js.map → show-AQQDICKX.js.map} +1 -1
- package/dist/{snooze-7WV4NKX7.js → snooze-LXHYYV5G.js} +18 -17
- package/dist/{snooze-7WV4NKX7.js.map → snooze-LXHYYV5G.js.map} +1 -1
- package/dist/{start-3EE3H4UE.js → start-OCGLP6N6.js} +19 -18
- package/dist/{start-3EE3H4UE.js.map → start-OCGLP6N6.js.map} +1 -1
- package/dist/{state-GPEV4FHA.js → state-FSZ6TIYE.js} +6 -5
- package/dist/{state-GPEV4FHA.js.map → state-FSZ6TIYE.js.map} +1 -1
- package/dist/{status-DDHIRFAB.js → status-35FEMHVO.js} +22 -21
- package/dist/{status-DDHIRFAB.js.map → status-35FEMHVO.js.map} +1 -1
- package/dist/statusline-WEZSDGOU.js +67 -0
- package/dist/statusline-WEZSDGOU.js.map +1 -0
- package/dist/{statusline-hook-W7KWKWAC.js → statusline-hook-H5MM2PA2.js} +16 -11
- package/dist/statusline-hook-H5MM2PA2.js.map +1 -0
- package/dist/{stop-DYT5BIRN.js → stop-6QOVDV2A.js} +19 -18
- package/dist/{stop-DYT5BIRN.js.map → stop-6QOVDV2A.js.map} +1 -1
- package/dist/{sync-NOLPKVWO.js → sync-GEG3O54C.js} +46 -45
- package/dist/{sync-NOLPKVWO.js.map → sync-GEG3O54C.js.map} +1 -1
- package/dist/{time-WANFTVEE.js → time-UXSYQHN4.js} +20 -19
- package/dist/{time-WANFTVEE.js.map → time-UXSYQHN4.js.map} +1 -1
- package/dist/{time-actions-B7YKVDVE.js → time-actions-3KLS5WGD.js} +7 -6
- package/dist/{timesheet-GG5UR2NU.js → timesheet-RNUTAWR4.js} +27 -26
- package/dist/{timesheet-GG5UR2NU.js.map → timesheet-RNUTAWR4.js.map} +1 -1
- package/dist/{todo-VBWHS2HU.js → todo-MP4WUDMW.js} +7 -6
- package/dist/{todo-VBWHS2HU.js.map → todo-MP4WUDMW.js.map} +1 -1
- package/dist/{tree-HYJHJ7HD.js → tree-U2LS4NHP.js} +53 -52
- package/dist/tree-U2LS4NHP.js.map +1 -0
- package/dist/{update-IMNOHV3J.js → update-PHTB3AB5.js} +28 -27
- package/dist/{update-IMNOHV3J.js.map → update-PHTB3AB5.js.map} +1 -1
- package/dist/{usage-FUWADDO4.js → usage-2Z7354NZ.js} +17 -16
- package/dist/{usage-FUWADDO4.js.map → usage-2Z7354NZ.js.map} +1 -1
- package/dist/{version-VXE4NJRN.js → version-G2HN4GTL.js} +12 -13
- package/dist/{version-VXE4NJRN.js.map → version-G2HN4GTL.js.map} +1 -1
- package/dist/{wait-2U7PLYRS.js → wait-MEMUQGDV.js} +19 -18
- package/dist/{wait-2U7PLYRS.js.map → wait-MEMUQGDV.js.map} +1 -1
- package/dist/wd-bin.js +9 -9
- package/dist/web/assets/{PtyView-s01AhxxX.js → PtyView-CyqsvkBt.js} +2 -2
- package/dist/web/assets/{PtyView-s01AhxxX.js.map → PtyView-CyqsvkBt.js.map} +1 -1
- package/dist/web/assets/index-DXP8G0eh.css +1 -0
- package/dist/web/assets/index-DjFmAhbY.js +126 -0
- package/dist/web/assets/index-DjFmAhbY.js.map +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-KEQI7DQO.js → web-P7TKPZFB.js} +366 -305
- package/dist/web-P7TKPZFB.js.map +1 -0
- package/dist/work-command-JHNC4JZK.js +13 -0
- package/dist/work-command-JHNC4JZK.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/plugins/work-tree/skills/work-sessions/SKILL.md +3 -1
- package/dist/account-GOU2FC56.js.map +0 -1
- package/dist/chunk-2K44PZRP.js.map +0 -1
- package/dist/chunk-6THUVP6T.js.map +0 -1
- package/dist/chunk-7UIRKGY7.js.map +0 -1
- package/dist/chunk-AH5TM3NB.js +0 -21
- package/dist/chunk-AH5TM3NB.js.map +0 -1
- package/dist/chunk-BK73QU45.js.map +0 -1
- package/dist/chunk-DW245WK4.js +0 -74
- package/dist/chunk-DW245WK4.js.map +0 -1
- package/dist/chunk-FLQOSWVR.js.map +0 -1
- package/dist/chunk-KI26QYWS.js +0 -9
- package/dist/chunk-MOTKVMGL.js.map +0 -1
- package/dist/chunk-NCXRMJGS.js.map +0 -1
- package/dist/chunk-UY5J2KY2.js.map +0 -1
- package/dist/chunk-Y2DBNXZH.js.map +0 -1
- package/dist/chunk-ZS7ZXAXB.js.map +0 -1
- package/dist/cli-SGRXK4G2.js +0 -20
- package/dist/hook-PWMF5WBD.js.map +0 -1
- package/dist/install-skills-QX4OATOS.js +0 -23
- package/dist/pty-host-4NEN3SID.js.map +0 -1
- package/dist/recent-GUABGTFG.js.map +0 -1
- package/dist/resume-XDUTFTWV.js.map +0 -1
- package/dist/review-EKSF3BUM.js.map +0 -1
- package/dist/statusline-QN4AERZC.js +0 -107
- package/dist/statusline-QN4AERZC.js.map +0 -1
- package/dist/statusline-hook-W7KWKWAC.js.map +0 -1
- package/dist/tree-HYJHJ7HD.js.map +0 -1
- package/dist/web/assets/index-BNHgDFNt.css +0 -1
- package/dist/web/assets/index-DWb77ss2.js +0 -126
- package/dist/web/assets/index-DWb77ss2.js.map +0 -1
- package/dist/web-KEQI7DQO.js.map +0 -1
- /package/dist/{attach-RJ53ABQN.js.map → attach-ETPEGXYM.js.map} +0 -0
- /package/dist/{chunk-ULI3NB4J.js.map → chunk-2IDWQ5NO.js.map} +0 -0
- /package/dist/{chunk-UTBIZ6W5.js.map → chunk-2PAHTJ3B.js.map} +0 -0
- /package/dist/{chunk-RCWQD32G.js.map → chunk-3YON263F.js.map} +0 -0
- /package/dist/{chunk-JQ42ERH3.js.map → chunk-44UME4JD.js.map} +0 -0
- /package/dist/{chunk-PAEWU7UC.js.map → chunk-46WW3Z6C.js.map} +0 -0
- /package/dist/{chunk-AYHDJMMJ.js.map → chunk-4CXUVBOD.js.map} +0 -0
- /package/dist/{chunk-MKJH2D4V.js.map → chunk-4NIOURHZ.js.map} +0 -0
- /package/dist/{chunk-EHUKDUNJ.js.map → chunk-4WTY3SFZ.js.map} +0 -0
- /package/dist/{chunk-T26N4I4E.js.map → chunk-5LAFHPNB.js.map} +0 -0
- /package/dist/{chunk-AU27USPZ.js.map → chunk-5ZCCUM75.js.map} +0 -0
- /package/dist/{chunk-MQQADIRH.js.map → chunk-7QDZGVIT.js.map} +0 -0
- /package/dist/{chunk-A3R3VO6G.js.map → chunk-7S3NPGVM.js.map} +0 -0
- /package/dist/{chunk-BPAV2PIE.js.map → chunk-AHGMXBY3.js.map} +0 -0
- /package/dist/{chunk-RRNIJ7YO.js.map → chunk-ALBTIOP3.js.map} +0 -0
- /package/dist/{chunk-FLY3VR6B.js.map → chunk-BZGIKO6I.js.map} +0 -0
- /package/dist/{chunk-UIG3CTXU.js.map → chunk-C6OEPSH2.js.map} +0 -0
- /package/dist/{chunk-RVSRZ57P.js.map → chunk-CNZV3UCM.js.map} +0 -0
- /package/dist/{chunk-ERXXU72V.js.map → chunk-CVTM4TCZ.js.map} +0 -0
- /package/dist/{chunk-KJY2AJQS.js.map → chunk-DBGHDWM7.js.map} +0 -0
- /package/dist/{chunk-LSZ6HI3U.js.map → chunk-EORL2V7P.js.map} +0 -0
- /package/dist/{chunk-DPO6I7OR.js.map → chunk-EQD3YBGA.js.map} +0 -0
- /package/dist/{chunk-RE3NKV4Z.js.map → chunk-EQFDUC6F.js.map} +0 -0
- /package/dist/{chunk-CWWWZRMN.js.map → chunk-FIEBI3UB.js.map} +0 -0
- /package/dist/{chunk-GSL6ZBQX.js.map → chunk-GGE55DO3.js.map} +0 -0
- /package/dist/{chunk-AGRUEZQX.js.map → chunk-GNIYYXQX.js.map} +0 -0
- /package/dist/{chunk-DWEW7I53.js.map → chunk-GPLCT5TZ.js.map} +0 -0
- /package/dist/{chunk-TUDDISCX.js.map → chunk-ICEP4WAK.js.map} +0 -0
- /package/dist/{chunk-7UXV4X2Y.js.map → chunk-IPHADNF5.js.map} +0 -0
- /package/dist/{chunk-5D5V4P7J.js.map → chunk-ITY6R2LC.js.map} +0 -0
- /package/dist/{chunk-VLUME72O.js.map → chunk-JVJ5IJSF.js.map} +0 -0
- /package/dist/{chunk-6MUKE253.js.map → chunk-K2OOUNXH.js.map} +0 -0
- /package/dist/{chunk-YXUVNSDM.js.map → chunk-KCYYIUUQ.js.map} +0 -0
- /package/dist/{chunk-TNKBZIR5.js.map → chunk-LMP3WGRW.js.map} +0 -0
- /package/dist/{chunk-2Y2ARDXI.js.map → chunk-MD6QMSXQ.js.map} +0 -0
- /package/dist/{chunk-U2MOKVPZ.js.map → chunk-MHL66TIL.js.map} +0 -0
- /package/dist/{chunk-SAPDMQTO.js.map → chunk-MVME4LH7.js.map} +0 -0
- /package/dist/{chunk-S43GVNRB.js.map → chunk-MXH7DV4Q.js.map} +0 -0
- /package/dist/{chunk-UI45HNNQ.js.map → chunk-MZY557LZ.js.map} +0 -0
- /package/dist/{chunk-X5XVXJ4B.js.map → chunk-O32OINY3.js.map} +0 -0
- /package/dist/{chunk-KI26QYWS.js.map → chunk-OX33X3NH.js.map} +0 -0
- /package/dist/{chunk-5U3CSRV5.js.map → chunk-PSFOA7P6.js.map} +0 -0
- /package/dist/{chunk-UH72CZAX.js.map → chunk-PZ7WTBSI.js.map} +0 -0
- /package/dist/{chunk-MUCUSF6Y.js.map → chunk-QHA4VF4B.js.map} +0 -0
- /package/dist/{chunk-XSI4WZIX.js.map → chunk-QP7VLMFJ.js.map} +0 -0
- /package/dist/{chunk-T7K276XW.js.map → chunk-R5HG665I.js.map} +0 -0
- /package/dist/{chunk-RUIBZ6DI.js.map → chunk-R6KQDWHC.js.map} +0 -0
- /package/dist/{chunk-V72WJIGN.js.map → chunk-REAZAE5C.js.map} +0 -0
- /package/dist/{chunk-AAOAVXBF.js.map → chunk-RXORNKSJ.js.map} +0 -0
- /package/dist/{chunk-BXVBNYQT.js.map → chunk-S2MOK3CT.js.map} +0 -0
- /package/dist/{chunk-ZLQGKBBE.js.map → chunk-SRE4CK6Y.js.map} +0 -0
- /package/dist/{chunk-TMBO55MM.js.map → chunk-SZAD5U3J.js.map} +0 -0
- /package/dist/{chunk-ZIFWZJ7X.js.map → chunk-T5GJVUSL.js.map} +0 -0
- /package/dist/{chunk-DZ6SLAIZ.js.map → chunk-TC3H7I6O.js.map} +0 -0
- /package/dist/{chunk-S2CQ73G4.js.map → chunk-TI6AR4QF.js.map} +0 -0
- /package/dist/{chunk-7ZL3GJGY.js.map → chunk-TZLCBDJZ.js.map} +0 -0
- /package/dist/{chunk-LKJLUSYR.js.map → chunk-U64SNFIZ.js.map} +0 -0
- /package/dist/{chunk-Z3T5FWM6.js.map → chunk-UCNYEHQY.js.map} +0 -0
- /package/dist/{chunk-GDR4RWF4.js.map → chunk-UIIEP6VP.js.map} +0 -0
- /package/dist/{chunk-7XKIRMS4.js.map → chunk-UJWYQVXI.js.map} +0 -0
- /package/dist/{chunk-G2V2V5UC.js.map → chunk-VHENFC2S.js.map} +0 -0
- /package/dist/{chunk-AKDTLWWD.js.map → chunk-WNWSO4VO.js.map} +0 -0
- /package/dist/{chunk-PJQRSOLE.js.map → chunk-X6EMCJ2L.js.map} +0 -0
- /package/dist/{chunk-MKQ7IA6U.js.map → chunk-XBWS77S2.js.map} +0 -0
- /package/dist/{chunk-WAZCBD7Y.js.map → chunk-XMKYQVJU.js.map} +0 -0
- /package/dist/{chunk-JNKFPFH6.js.map → chunk-XPWWOR7Z.js.map} +0 -0
- /package/dist/{chunk-5SMTFIYI.js.map → chunk-Z3OHGPIN.js.map} +0 -0
- /package/dist/{chunk-6AJFOISA.js.map → chunk-ZNGR2CB6.js.map} +0 -0
- /package/dist/{cli-SGRXK4G2.js.map → cli-OMADLGGY.js.map} +0 -0
- /package/dist/{diff-3ZGUWMX4.js.map → diff-CJNSUX25.js.map} +0 -0
- /package/dist/{fork-AGFYDM5U.js.map → fork-O6NS34MV.js.map} +0 -0
- /package/dist/{history-VYAGUN2X.js.map → history-URHFR4MO.js.map} +0 -0
- /package/dist/{install-skills-QX4OATOS.js.map → install-skills-DJE7LU66.js.map} +0 -0
- /package/dist/{report-J7TUQRJS.js.map → report-Z36H65YG.js.map} +0 -0
- /package/dist/{time-actions-B7YKVDVE.js.map → time-actions-3KLS5WGD.js.map} +0 -0
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
listReplies
|
|
4
|
+
} from "./chunk-WNWSO4VO.js";
|
|
2
5
|
import {
|
|
3
6
|
examineWorktree,
|
|
4
7
|
normPath
|
|
5
8
|
} from "./chunk-AKMPF72Y.js";
|
|
6
|
-
import {
|
|
7
|
-
listReplies
|
|
8
|
-
} from "./chunk-AKDTLWWD.js";
|
|
9
9
|
import {
|
|
10
10
|
shownState
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZNGR2CB6.js";
|
|
12
12
|
import {
|
|
13
13
|
runInternal
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CVTM4TCZ.js";
|
|
15
15
|
import {
|
|
16
16
|
runningFromNames,
|
|
17
17
|
stopRunningFrom
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ICEP4WAK.js";
|
|
19
19
|
import {
|
|
20
20
|
disposePty
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-6SYQQXPQ.js";
|
|
22
22
|
import {
|
|
23
23
|
saveIgnored,
|
|
24
24
|
teardownWorktree,
|
|
25
25
|
worktreeFor
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4ZP6NN2X.js";
|
|
27
27
|
import {
|
|
28
28
|
isLeftover
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-EORL2V7P.js";
|
|
30
30
|
import {
|
|
31
31
|
readPendingForSession
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-RXORNKSJ.js";
|
|
33
33
|
import {
|
|
34
34
|
buildFoldersOf,
|
|
35
35
|
clearBuildFolders
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-T5GJVUSL.js";
|
|
37
37
|
import {
|
|
38
38
|
defaultRunner
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-XBWS77S2.js";
|
|
40
40
|
import {
|
|
41
41
|
archiveRefFor,
|
|
42
42
|
archiveSession,
|
|
@@ -49,17 +49,17 @@ import {
|
|
|
49
49
|
setSessionArchived,
|
|
50
50
|
stopDev,
|
|
51
51
|
turnInProgress
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-FNWPOM4B.js";
|
|
53
53
|
import {
|
|
54
54
|
sessionIdFor
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-ALBTIOP3.js";
|
|
56
56
|
import {
|
|
57
57
|
agentOf,
|
|
58
58
|
checkedOutBranch
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-CYUSOVO5.js";
|
|
60
60
|
import {
|
|
61
61
|
loadConfig
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-BZGIKO6I.js";
|
|
63
63
|
|
|
64
64
|
// src/core/archive/session-archive-deps.ts
|
|
65
65
|
import fs from "fs";
|
|
@@ -283,4 +283,4 @@ export {
|
|
|
283
283
|
archiveMergedSession,
|
|
284
284
|
defaultArchiveDeps
|
|
285
285
|
};
|
|
286
|
-
//# sourceMappingURL=chunk-
|
|
286
|
+
//# sourceMappingURL=chunk-GGE55DO3.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
BUILD_DIR_NAMES
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-T5GJVUSL.js";
|
|
5
5
|
|
|
6
6
|
// src/core/worktree/repo-rules.ts
|
|
7
7
|
var baseName = (p) => p.replace(/[\\/]+$/, "").split(/[\\/]/).pop() ?? p;
|
|
@@ -143,4 +143,4 @@ export {
|
|
|
143
143
|
readGitConfig,
|
|
144
144
|
scanForRepos
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-GNIYYXQX.js.map
|
|
@@ -6,21 +6,21 @@ import {
|
|
|
6
6
|
noteBranchFacts,
|
|
7
7
|
readSessionBranches,
|
|
8
8
|
repoNameOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-U64SNFIZ.js";
|
|
10
10
|
import {
|
|
11
11
|
defaultRunner
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-XBWS77S2.js";
|
|
13
13
|
import {
|
|
14
|
-
bestEffort,
|
|
15
|
-
logSwallowed,
|
|
16
14
|
stageOfPr
|
|
17
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FNWPOM4B.js";
|
|
18
16
|
import {
|
|
19
17
|
sessionIdFor
|
|
20
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ALBTIOP3.js";
|
|
21
19
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
bestEffort,
|
|
21
|
+
checkedOutBranch,
|
|
22
|
+
logSwallowed
|
|
23
|
+
} from "./chunk-CYUSOVO5.js";
|
|
24
24
|
|
|
25
25
|
// src/core/stacks/branch-facts.ts
|
|
26
26
|
async function repoBase(repo, run = defaultRunner) {
|
|
@@ -242,4 +242,4 @@ export {
|
|
|
242
242
|
createSessionBranches,
|
|
243
243
|
sessionBranchesNow
|
|
244
244
|
};
|
|
245
|
-
//# sourceMappingURL=chunk-
|
|
245
|
+
//# sourceMappingURL=chunk-GPLCT5TZ.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
getConfigDir
|
|
4
|
+
} from "./chunk-F2ECTTSY.js";
|
|
5
|
+
|
|
6
|
+
// src/core/platform/work-command.ts
|
|
7
|
+
import fs2 from "fs";
|
|
8
|
+
import path2 from "path";
|
|
9
|
+
|
|
10
|
+
// src/core/platform/work-bin.ts
|
|
11
|
+
import fs from "fs";
|
|
12
|
+
import path from "path";
|
|
13
|
+
function resolveWorkBinPath(selfArgv1) {
|
|
14
|
+
let real = selfArgv1;
|
|
15
|
+
try {
|
|
16
|
+
real = fs.realpathSync(selfArgv1);
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
if (real.endsWith("wd-bin.js")) {
|
|
20
|
+
return path.join(path.dirname(real), "bin.js");
|
|
21
|
+
}
|
|
22
|
+
return real;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// src/core/platform/work-command.ts
|
|
26
|
+
function workInvocation(d = {}) {
|
|
27
|
+
const platform = d.platform ?? process.platform;
|
|
28
|
+
const configDir = d.configDir ?? getConfigDir();
|
|
29
|
+
const exists = d.exists ?? fs2.existsSync;
|
|
30
|
+
const bin = resolveWorkBinPath(d.argv1 ?? process.argv[1] ?? "");
|
|
31
|
+
const pathMod = platform === "win32" ? path2.win32 : path2.posix;
|
|
32
|
+
const runtime = pathMod.join(configDir, "runtime") + pathMod.sep;
|
|
33
|
+
if (platform !== "win32" && bin.startsWith(runtime)) {
|
|
34
|
+
const launcher = pathMod.join(configDir, "bin", "work");
|
|
35
|
+
if (exists(launcher)) return [launcher];
|
|
36
|
+
}
|
|
37
|
+
return [d.execPath ?? process.execPath, bin];
|
|
38
|
+
}
|
|
39
|
+
function shQuote(word, platform = process.platform) {
|
|
40
|
+
const w = platform === "win32" ? word.replace(/\\/g, "/") : word;
|
|
41
|
+
return /^[\w@%+=:,./-]+$/.test(w) ? w : `'${w.replace(/'/g, `'\\''`)}'`;
|
|
42
|
+
}
|
|
43
|
+
function workCommand(args, d = {}) {
|
|
44
|
+
const platform = d.platform ?? process.platform;
|
|
45
|
+
return [...workInvocation(d), ...args].map((w) => shQuote(w, platform)).join(" ");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
resolveWorkBinPath,
|
|
50
|
+
workInvocation,
|
|
51
|
+
shQuote,
|
|
52
|
+
workCommand
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-HK6AZQ5Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/platform/work-command.ts","../src/core/platform/work-bin.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { getConfigDir } from './config-dir.js';\nimport { resolveWorkBinPath } from './work-bin.js';\n\n/**\n * How another program (Claude Code, for a hook or its status line) runs THIS work: never a bare `work`, which is\n * whatever the agent's PATH finds first. Reported: the desktop app's 2.11.3 wrote `work hook turn-end`, and a Claude\n * whose PATH had an old `npm link` first ran that build, which knew no `turn-end` and printed its usage as a hook error\n * on every turn.\n *\n * The desktop app runs work from a copy under `~/.work/runtime/<version>/`, which goes after an update: its launcher\n * (`~/.work/bin/work`, which runs `runtime/current`) is named instead on POSIX. Windows gets node and the script\n * (Claude Code runs hooks through Git Bash, which doesn't start a `.cmd`); the runtime the PTY host runs from stays\n * while it runs, and the file naming it is written again at each spawn.\n */\nexport interface WorkInvocationDeps {\n argv1?: string;\n execPath?: string;\n configDir?: string;\n platform?: NodeJS.Platform;\n exists?: (p: string) => boolean;\n}\n\n/** The argv that runs this work: its launcher, or node and its `bin.js`. */\nexport function workInvocation(d: WorkInvocationDeps = {}): string[] {\n const platform = d.platform ?? process.platform;\n const configDir = d.configDir ?? getConfigDir();\n const exists = d.exists ?? fs.existsSync;\n const bin = resolveWorkBinPath(d.argv1 ?? process.argv[1] ?? '');\n const pathMod = platform === 'win32' ? path.win32 : path.posix;\n const runtime = pathMod.join(configDir, 'runtime') + pathMod.sep;\n if (platform !== 'win32' && bin.startsWith(runtime)) {\n const launcher = pathMod.join(configDir, 'bin', 'work');\n if (exists(launcher)) return [launcher];\n }\n return [d.execPath ?? process.execPath, bin];\n}\n\n/** One word for sh (and Git Bash): single-quoted, forward slashes on Windows (a backslash is an escape there). */\nexport function shQuote(word: string, platform: NodeJS.Platform = process.platform): string {\n const w = platform === 'win32' ? word.replace(/\\\\/g, '/') : word;\n return /^[\\w@%+=:,./-]+$/.test(w) ? w : `'${w.replace(/'/g, `'\\\\''`)}'`;\n}\n\n/** `work <args…>` as a shell command line that runs this work, whatever PATH says. */\nexport function workCommand(args: readonly string[], d: WorkInvocationDeps = {}): string {\n const platform = d.platform ?? process.platform;\n return [...workInvocation(d), ...args].map((w) => shQuote(w, platform)).join(' ');\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\n\n/**\n * Resolve the path to the `work` binary given the path of whichever\n * binary `wd`/`work` is currently running as. The `web` subcommand\n * only lives on the `work` binary (`dist/bin.js`); when we're running\n * as the `wd` shim (`dist/wd-bin.js`) we swap to the sibling. Tsup\n * ships both into the same dir so the sibling-swap is always valid.\n *\n * Used wherever we spawn `work` itself (work web autostart, the PTY host,\n * login autostart) — never pass `web`/`pty-host` args to the `wd` shim.\n */\nexport function resolveWorkBinPath(selfArgv1: string): string {\n // argv[1] may be a bin symlink, not the real file: a global npm install\n // exposes `wd` as e.g. ~/.../bin/wd -> ../lib/.../dist/wd-bin.js. Resolve\n // it so the wd-bin.js -> bin.js sibling-swap fires for global installs too;\n // otherwise we'd spawn the `wd` shim with `web` args and it'd fail.\n let real = selfArgv1;\n try {\n real = fs.realpathSync(selfArgv1);\n } catch {\n /* synthetic/non-existent path (e.g. unit tests) — use as given */\n }\n if (real.endsWith('wd-bin.js')) {\n return path.join(path.dirname(real), 'bin.js');\n }\n return real;\n}\n"],"mappings":";;;;;;AAAA,OAAOA,SAAQ;AACf,OAAOC,WAAU;;;ACDjB,OAAO,QAAQ;AACf,OAAO,UAAU;AAYV,SAAS,mBAAmB,WAA2B;AAK5D,MAAI,OAAO;AACX,MAAI;AACF,WAAO,GAAG,aAAa,SAAS;AAAA,EAClC,QAAQ;AAAA,EAER;AACA,MAAI,KAAK,SAAS,WAAW,GAAG;AAC9B,WAAO,KAAK,KAAK,KAAK,QAAQ,IAAI,GAAG,QAAQ;AAAA,EAC/C;AACA,SAAO;AACT;;;ADHO,SAAS,eAAe,IAAwB,CAAC,GAAa;AACnE,QAAM,WAAW,EAAE,YAAY,QAAQ;AACvC,QAAM,YAAY,EAAE,aAAa,aAAa;AAC9C,QAAM,SAAS,EAAE,UAAUC,IAAG;AAC9B,QAAM,MAAM,mBAAmB,EAAE,SAAS,QAAQ,KAAK,CAAC,KAAK,EAAE;AAC/D,QAAM,UAAU,aAAa,UAAUC,MAAK,QAAQA,MAAK;AACzD,QAAM,UAAU,QAAQ,KAAK,WAAW,SAAS,IAAI,QAAQ;AAC7D,MAAI,aAAa,WAAW,IAAI,WAAW,OAAO,GAAG;AACnD,UAAM,WAAW,QAAQ,KAAK,WAAW,OAAO,MAAM;AACtD,QAAI,OAAO,QAAQ,EAAG,QAAO,CAAC,QAAQ;AAAA,EACxC;AACA,SAAO,CAAC,EAAE,YAAY,QAAQ,UAAU,GAAG;AAC7C;AAGO,SAAS,QAAQ,MAAc,WAA4B,QAAQ,UAAkB;AAC1F,QAAM,IAAI,aAAa,UAAU,KAAK,QAAQ,OAAO,GAAG,IAAI;AAC5D,SAAO,mBAAmB,KAAK,CAAC,IAAI,IAAI,IAAI,EAAE,QAAQ,MAAM,OAAO,CAAC;AACtE;AAGO,SAAS,YAAY,MAAyB,IAAwB,CAAC,GAAW;AACvF,QAAM,WAAW,EAAE,YAAY,QAAQ;AACvC,SAAO,CAAC,GAAG,eAAe,CAAC,GAAG,GAAG,IAAI,EAAE,IAAI,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,EAAE,KAAK,GAAG;AAClF;","names":["fs","path","fs","path"]}
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
getConfigDir
|
|
4
|
+
} from "./chunk-F2ECTTSY.js";
|
|
2
5
|
|
|
3
|
-
// src/core/platform/
|
|
6
|
+
// src/core/platform/logger.ts
|
|
4
7
|
import fs from "fs";
|
|
5
8
|
import path from "path";
|
|
6
|
-
import os from "os";
|
|
7
|
-
function configDirPath() {
|
|
8
|
-
return path.join(os.homedir(), ".work");
|
|
9
|
-
}
|
|
10
|
-
function getConfigDir() {
|
|
11
|
-
const dir = path.join(os.homedir(), ".work");
|
|
12
|
-
if (!fs.existsSync(dir)) {
|
|
13
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
14
|
-
}
|
|
15
|
-
return dir;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// src/core/platform/logger.ts
|
|
19
|
-
import fs2 from "fs";
|
|
20
|
-
import path2 from "path";
|
|
21
9
|
var maxLogSize = 5 * 1024 * 1024;
|
|
22
10
|
var logPath = null;
|
|
23
11
|
var logFd = null;
|
|
@@ -25,11 +13,11 @@ var logBytes = 0;
|
|
|
25
13
|
function rotate(file) {
|
|
26
14
|
const prev = file + ".1";
|
|
27
15
|
try {
|
|
28
|
-
|
|
16
|
+
fs.unlinkSync(prev);
|
|
29
17
|
} catch {
|
|
30
18
|
}
|
|
31
19
|
try {
|
|
32
|
-
|
|
20
|
+
fs.renameSync(file, prev);
|
|
33
21
|
} catch {
|
|
34
22
|
}
|
|
35
23
|
}
|
|
@@ -37,18 +25,18 @@ function ensureLog() {
|
|
|
37
25
|
if (logFd !== null) return logFd;
|
|
38
26
|
try {
|
|
39
27
|
const dir = getConfigDir();
|
|
40
|
-
|
|
41
|
-
logPath =
|
|
28
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
29
|
+
logPath = path.join(dir, "debug.log");
|
|
42
30
|
let size = 0;
|
|
43
31
|
try {
|
|
44
|
-
size =
|
|
32
|
+
size = fs.statSync(logPath).size;
|
|
45
33
|
} catch {
|
|
46
34
|
}
|
|
47
35
|
if (size > maxLogSize) {
|
|
48
36
|
rotate(logPath);
|
|
49
37
|
size = 0;
|
|
50
38
|
}
|
|
51
|
-
logFd =
|
|
39
|
+
logFd = fs.openSync(logPath, "a");
|
|
52
40
|
logBytes = size;
|
|
53
41
|
return logFd;
|
|
54
42
|
} catch {
|
|
@@ -68,7 +56,7 @@ function debugLog(level, ...args) {
|
|
|
68
56
|
const line = `${timestamp()} [${level}] ${msg}
|
|
69
57
|
`;
|
|
70
58
|
try {
|
|
71
|
-
|
|
59
|
+
fs.writeSync(fd, line);
|
|
72
60
|
} catch {
|
|
73
61
|
return;
|
|
74
62
|
}
|
|
@@ -101,7 +89,7 @@ function debug(...args) {
|
|
|
101
89
|
function closeLog() {
|
|
102
90
|
if (logFd !== null) {
|
|
103
91
|
try {
|
|
104
|
-
|
|
92
|
+
fs.closeSync(logFd);
|
|
105
93
|
} catch {
|
|
106
94
|
}
|
|
107
95
|
logFd = null;
|
|
@@ -109,10 +97,8 @@ function closeLog() {
|
|
|
109
97
|
}
|
|
110
98
|
|
|
111
99
|
export {
|
|
112
|
-
configDirPath,
|
|
113
|
-
getConfigDir,
|
|
114
100
|
debugLog,
|
|
115
101
|
installConsoleLogger,
|
|
116
102
|
debug
|
|
117
103
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
104
|
+
//# sourceMappingURL=chunk-IAKOKZYW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/platform/logger.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { getConfigDir } from './config-dir.js';\n\nlet maxLogSize = 5 * 1024 * 1024; // 5MB, then debug.log → debug.log.1\n\nlet logPath: string | null = null;\n/** A plain file descriptor, written synchronously: a line is on disk when\n * debugLog returns (a buffered stream lost the last lines on exit), and\n * rotation can close the file before renaming it — Windows refuses to\n * rename a file that is still open. */\nlet logFd: number | null = null;\n/** Bytes in the current file: its size at open plus what we wrote since. */\nlet logBytes = 0;\n\n/** Tests shrink the cap to exercise rotation. */\nexport function setMaxLogSizeForTests(bytes: number): void {\n maxLogSize = bytes;\n}\n\nfunction rotate(file: string): void {\n const prev = file + '.1';\n try {\n fs.unlinkSync(prev);\n } catch {\n /* */\n }\n try {\n fs.renameSync(file, prev);\n } catch {\n /* another process has it open; next time */\n }\n}\n\nfunction ensureLog(): number | null {\n if (logFd !== null) return logFd;\n try {\n const dir = getConfigDir();\n fs.mkdirSync(dir, { recursive: true });\n logPath = path.join(dir, 'debug.log');\n let size = 0;\n try {\n size = fs.statSync(logPath).size;\n } catch {\n /* file doesn't exist yet */\n }\n if (size > maxLogSize) {\n rotate(logPath);\n size = 0;\n }\n logFd = fs.openSync(logPath, 'a');\n logBytes = size;\n return logFd;\n } catch {\n return null;\n }\n}\n\nfunction timestamp(): string {\n return new Date().toISOString();\n}\n\n// Strip ANSI escape codes for clean log output\nfunction stripAnsi(str: string): string {\n return str.replace(/\\x1b\\[[0-9;]*m/g, '');\n}\n\nexport function debugLog(level: 'INFO' | 'ERROR' | 'DEBUG' | 'WARN', ...args: unknown[]): void {\n const fd = ensureLog();\n if (fd === null) return;\n const msg = args.map((a) => (typeof a === 'string' ? stripAnsi(a) : JSON.stringify(a))).join(' ');\n const line = `${timestamp()} [${level}] ${msg}\\n`;\n try {\n fs.writeSync(fd, line);\n } catch {\n return; // best effort: logging must never break the host\n }\n logBytes += Buffer.byteLength(line);\n // Rotate while running too: work web and the PTY host run for days, and\n // the cap used to be checked only when a process opened the log.\n if (logBytes > maxLogSize && logPath) {\n closeLog();\n rotate(logPath);\n }\n}\n\n/**\n * Patch console.log and console.error to also write to the debug log.\n * Call once at startup.\n */\nexport function installConsoleLogger(): void {\n const origLog = console.log.bind(console);\n const origError = console.error.bind(console);\n const origWarn = console.warn.bind(console);\n\n console.log = (...args: unknown[]) => {\n origLog(...args);\n debugLog('INFO', ...args);\n };\n\n console.error = (...args: unknown[]) => {\n origError(...args);\n debugLog('ERROR', ...args);\n };\n\n console.warn = (...args: unknown[]) => {\n origWarn(...args);\n debugLog('WARN', ...args);\n };\n}\n\n/** Write a debug-only message (not shown to user). */\nexport function debug(...args: unknown[]): void {\n debugLog('DEBUG', ...args);\n}\n\n/** Get the log file path. */\nexport function getLogPath(): string {\n ensureLog();\n return logPath ?? path.join(getConfigDir(), 'debug.log');\n}\n\n/** Flush and close the log stream. */\nexport function closeLog(): void {\n if (logFd !== null) {\n try {\n fs.closeSync(logFd);\n } catch {\n /* */\n }\n logFd = null;\n }\n}\n"],"mappings":";;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAGjB,IAAI,aAAa,IAAI,OAAO;AAE5B,IAAI,UAAyB;AAK7B,IAAI,QAAuB;AAE3B,IAAI,WAAW;AAOf,SAAS,OAAO,MAAoB;AAClC,QAAM,OAAO,OAAO;AACpB,MAAI;AACF,OAAG,WAAW,IAAI;AAAA,EACpB,QAAQ;AAAA,EAER;AACA,MAAI;AACF,OAAG,WAAW,MAAM,IAAI;AAAA,EAC1B,QAAQ;AAAA,EAER;AACF;AAEA,SAAS,YAA2B;AAClC,MAAI,UAAU,KAAM,QAAO;AAC3B,MAAI;AACF,UAAM,MAAM,aAAa;AACzB,OAAG,UAAU,KAAK,EAAE,WAAW,KAAK,CAAC;AACrC,cAAU,KAAK,KAAK,KAAK,WAAW;AACpC,QAAI,OAAO;AACX,QAAI;AACF,aAAO,GAAG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Q,GAAG,IAAI;AAAA,EAC1B;AACF;AAGO,SAAS,SAAS,MAAuB;AAC9C,WAAS,SAAS,GAAG,IAAI;AAC3B;AASO,SAAS,WAAiB;AAC/B,MAAI,UAAU,MAAM;AAClB,QAAI;AACF,SAAG,UAAU,KAAK;AAAA,IACpB,QAAQ;AAAA,IAER;AACA,YAAQ;AAAA,EACV;AACF;","names":[]}
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
isPidAlive,
|
|
7
7
|
killTreeAsync
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VHENFC2S.js";
|
|
9
9
|
import {
|
|
10
10
|
programPath
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QOSAWNOU.js";
|
|
12
12
|
import {
|
|
13
13
|
getConfigDir
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-F2ECTTSY.js";
|
|
15
15
|
|
|
16
16
|
// src/core/platform/running-from.ts
|
|
17
17
|
import fs from "fs";
|
|
@@ -253,4 +253,4 @@ export {
|
|
|
253
253
|
runningFromNames,
|
|
254
254
|
stopRunningFrom
|
|
255
255
|
};
|
|
256
|
-
//# sourceMappingURL=chunk-
|
|
256
|
+
//# sourceMappingURL=chunk-ICEP4WAK.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getCurrentBranch,
|
|
4
4
|
getMainRepoRoot,
|
|
5
5
|
getWorktreeRoot
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JYWX2N5W.js";
|
|
7
7
|
|
|
8
8
|
// src/core/worktree/resolve.ts
|
|
9
9
|
import fs from "fs";
|
|
@@ -120,4 +120,4 @@ export {
|
|
|
120
120
|
getAllTargetNames,
|
|
121
121
|
resolveFromCwd
|
|
122
122
|
};
|
|
123
|
-
//# sourceMappingURL=chunk-
|
|
123
|
+
//# sourceMappingURL=chunk-IPHADNF5.js.map
|
|
@@ -5,20 +5,20 @@ import {
|
|
|
5
5
|
samePathKey,
|
|
6
6
|
scanForRepos,
|
|
7
7
|
suggestAlias
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GNIYYXQX.js";
|
|
9
9
|
import {
|
|
10
10
|
recordedRepos
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FNWPOM4B.js";
|
|
12
12
|
import {
|
|
13
13
|
getConfigPath
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BZGIKO6I.js";
|
|
15
15
|
import {
|
|
16
16
|
atomicWriteFile,
|
|
17
17
|
withFileLock
|
|
18
18
|
} from "./chunk-D2J3AD6L.js";
|
|
19
19
|
import {
|
|
20
20
|
getConfigDir
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-F2ECTTSY.js";
|
|
22
22
|
|
|
23
23
|
// src/core/worktree/repo-admin.ts
|
|
24
24
|
import fs from "fs";
|
|
@@ -180,4 +180,4 @@ export {
|
|
|
180
180
|
deleteGroup,
|
|
181
181
|
setReviewMode
|
|
182
182
|
};
|
|
183
|
-
//# sourceMappingURL=chunk-
|
|
183
|
+
//# sourceMappingURL=chunk-ITY6R2LC.js.map
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PROTOCOL_VERSION,
|
|
4
4
|
readHostInfo
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XPWWOR7Z.js";
|
|
6
6
|
import {
|
|
7
7
|
isPidAlive,
|
|
8
8
|
spawnDetachedWork
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VHENFC2S.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureFile,
|
|
12
12
|
withFileLock
|
|
13
13
|
} from "./chunk-D2J3AD6L.js";
|
|
14
14
|
import {
|
|
15
15
|
getConfigDir
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-F2ECTTSY.js";
|
|
17
17
|
|
|
18
18
|
// src/core/pty/pty-host-client.ts
|
|
19
19
|
import path from "path";
|
|
@@ -280,4 +280,4 @@ export {
|
|
|
280
280
|
ensureHost,
|
|
281
281
|
PtyHostClient
|
|
282
282
|
};
|
|
283
|
-
//# sourceMappingURL=chunk-
|
|
283
|
+
//# sourceMappingURL=chunk-JVJ5IJSF.js.map
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
programPath,
|
|
3
4
|
spawn_default
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
programPath
|
|
7
|
-
} from "./chunk-ZS7ZXAXB.js";
|
|
5
|
+
} from "./chunk-QOSAWNOU.js";
|
|
8
6
|
import {
|
|
9
7
|
debug
|
|
10
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IAKOKZYW.js";
|
|
11
9
|
|
|
12
10
|
// src/core/git/git.ts
|
|
13
11
|
import { execFile } from "child_process";
|
|
@@ -206,4 +204,4 @@ export {
|
|
|
206
204
|
fetchRemoteAsync,
|
|
207
205
|
getUnpushedCommits
|
|
208
206
|
};
|
|
209
|
-
//# sourceMappingURL=chunk-
|
|
207
|
+
//# sourceMappingURL=chunk-JYWX2N5W.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/git/git.ts"],"sourcesContent":["import spawn from '../platform/spawn.js';\nimport { execFile } from 'node:child_process';\nimport { programPath } from '../platform/program-path.js';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { debug } from '../platform/logger.js';\n\nexport interface GitResult {\n stdout: string;\n stderr: string;\n exitCode: number;\n}\n\n/** Run a git command synchronously in the given cwd. */\nexport function git(args: string[], cwd: string): GitResult {\n debug('git', args.join(' '), `cwd=${cwd}`);\n const result = spawn.sync('git', args, {\n cwd,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n // Avoid flashing a console window on Windows for every git call —\n // matters most when this runs inside the detached `wd --watch` daemon.\n windowsHide: true,\n });\n\n const r = {\n stdout: (result.stdout ?? '').toString().trim(),\n stderr: (result.stderr ?? '').toString().trim(),\n exitCode: result.status ?? 1,\n };\n if (r.exitCode !== 0) {\n debug('git failed', { args, exitCode: r.exitCode, stderr: r.stderr });\n }\n return r;\n}\n\nexport interface WorktreeEntry {\n path: string;\n branch: string;\n head: string;\n}\n\n/** Parse `git worktree list --porcelain` output into structured entries. */\nexport function parseWorktreeList(cwd: string): WorktreeEntry[] {\n const result = git(['worktree', 'list', '--porcelain'], cwd);\n if (result.exitCode !== 0) return [];\n\n const entries: WorktreeEntry[] = [];\n let current: Partial<WorktreeEntry> = {};\n\n for (const line of result.stdout.split('\\n')) {\n const worktreeMatch = line.match(/^worktree (.+)$/);\n if (worktreeMatch) {\n if (current.path) {\n entries.push({\n path: current.path,\n branch: current.branch ?? '',\n head: current.head ?? '',\n });\n }\n current = { path: worktreeMatch[1] };\n continue;\n }\n\n const headMatch = line.match(/^HEAD (.+)$/);\n if (headMatch) {\n current.head = headMatch[1].substring(0, 7);\n continue;\n }\n\n const branchMatch = line.match(/^branch (.+)$/);\n if (branchMatch) {\n current.branch = branchMatch[1].replace(/^refs\\/heads\\//, '');\n }\n }\n\n // Push last entry\n if (current.path) {\n entries.push({\n path: current.path,\n branch: current.branch ?? '',\n head: current.head ?? '',\n });\n }\n\n return entries;\n}\n\n/** Check if a local branch exists. */\nexport function localBranchExists(branch: string, cwd: string): boolean {\n const result = git(['rev-parse', '--verify', branch], cwd);\n return result.exitCode === 0;\n}\n\n/** Check if a remote tracking branch exists. */\nexport function remoteBranchExists(branch: string, cwd: string): boolean {\n const result = git(['rev-parse', '--verify', `origin/${branch}`], cwd);\n return result.exitCode === 0;\n}\n\n/** Check if path is a valid git worktree/repo. */\nexport function isGitRepo(cwd: string): boolean {\n const result = git(['rev-parse', '--is-inside-work-tree'], cwd);\n return result.exitCode === 0 && result.stdout === 'true';\n}\n\n/** Get the absolute toplevel of the worktree containing cwd, or null if not a repo. */\nexport function getWorktreeRoot(cwd: string): string | null {\n const result = git(['rev-parse', '--show-toplevel'], cwd);\n if (result.exitCode !== 0 || !result.stdout) return null;\n return result.stdout;\n}\n\n/**\n * Get the MAIN repo working directory for a (possibly linked) worktree.\n * `--git-common-dir` points at the main repo's `.git` dir; the main repo root\n * is its parent when the basename is `.git`, otherwise the path itself.\n * Returns null on failure.\n */\nexport function getMainRepoRoot(cwd: string): string | null {\n const result = git(['rev-parse', '--path-format=absolute', '--git-common-dir'], cwd);\n if (result.exitCode !== 0 || !result.stdout) return null;\n const commonDir = result.stdout;\n if (path.basename(commonDir) === '.git') {\n return path.dirname(commonDir);\n }\n return commonDir;\n}\n\n/** Get current branch name. */\nexport function getCurrentBranch(cwd: string): string {\n const result = git(['branch', '--show-current'], cwd);\n return result.stdout;\n}\n\n/** Check for uncommitted changes (returns porcelain status). */\nexport function getStatus(cwd: string): string {\n const result = git(['status', '--porcelain'], cwd);\n return result.stdout;\n}\n\n/**\n * Porcelain status, or null when git could not tell (it errored). Anything\n * deciding whether work may be deleted must use this and treat null as\n * \"maybe dirty\": an empty string from a FAILED `git status` is not clean.\n */\nexport function getStatusChecked(cwd: string): string | null {\n const result = git(['status', '--porcelain'], cwd);\n return result.exitCode === 0 ? result.stdout : null;\n}\n\nexport type RepoState = 'repo' | 'not-a-repo' | 'unknown';\n\n/**\n * Whether a directory is a git checkout — with \"can't tell\" kept apart\n * from \"no\". A failing git (dubious ownership on a network share, git\n * missing from a detached process's PATH, a worktree whose main repo was\n * moved) is NOT proof the folder is disposable: 'not-a-repo' needs git to\n * say so AND no `.git` entry in the folder.\n */\nexport function repoState(cwd: string): RepoState {\n const result = git(['rev-parse', '--is-inside-work-tree'], cwd);\n if (result.exitCode === 0 && result.stdout === 'true') return 'repo';\n if (fs.existsSync(path.join(cwd, '.git'))) return 'unknown';\n return /not a git repository/i.test(result.stderr) ? 'not-a-repo' : 'unknown';\n}\n\n/** Get the default branch from origin/HEAD (e.g. \"main\" or \"master\"). */\nexport function getDefaultBranch(cwd: string): string | null {\n const result = git(['symbolic-ref', 'refs/remotes/origin/HEAD'], cwd);\n if (result.exitCode === 0 && result.stdout) {\n // Output is like \"refs/remotes/origin/main\"\n return result.stdout.replace(/^refs\\/remotes\\/origin\\//, '');\n }\n return null;\n}\n\n/**\n * Result of checking a branch against a single base ref.\n *\n * 'merged' is a high-confidence true merge (the branch tip is reachable from\n * base via a merge/fast-forward). 'squash-merged' is the lower-confidence\n * heuristic match from {@link checkSquashMerged} — the branch's squashed patch\n * already appears in base, but there is no real merge commit linking the two.\n * Callers that prune unattended should treat 'squash-merged' as opt-in only.\n */\ntype MergeCheck = 'merged' | 'squash-merged' | 'stale' | 'unrelated';\n\n/**\n * Check if a branch is truly merged into a base ref (not just a stale branch\n * sitting behind base with no unique commits).\n *\n * Returns 'stale' if the branch tip is on the base's first-parent chain\n * (no unique work). Returns 'merged' if the branch has unique commits that\n * are all reachable from base. Returns 'squash-merged' if only the squash\n * heuristic matched. Returns 'unrelated' otherwise.\n */\nfunction checkMergeStatus(branch: string, baseRef: string, cwd: string): MergeCheck {\n // 1. Branch must be an ancestor of base (all its commits are in base)\n const branchInBase = git(['merge-base', '--is-ancestor', branch, baseRef], cwd);\n if (branchInBase.exitCode !== 0) {\n // Not a regular merge — check for squash merge (low-confidence heuristic).\n if (checkSquashMerged(branch, baseRef, cwd)) return 'squash-merged';\n return 'unrelated';\n }\n\n // 2. If base is also ancestor of branch, they're at the same commit\n // (fast-forward merge or empty branch) — nothing left to merge.\n const baseInBranch = git(['merge-base', '--is-ancestor', baseRef, branch], cwd);\n if (baseInBranch.exitCode === 0) return 'merged';\n\n // 3. Branch is ancestor of base — but is it on the main line (stale) or\n // only reachable via a merge commit (truly merged)?\n // A stale branch's tip sits directly on the first-parent chain.\n const tip = git(['rev-parse', branch], cwd);\n if (tip.exitCode !== 0) return 'unrelated';\n const mainLine = git(['rev-list', '--first-parent', '-n', '500', baseRef], cwd);\n if (mainLine.exitCode === 0 && mainLine.stdout.includes(tip.stdout)) {\n return 'stale';\n }\n\n return 'merged';\n}\n\n/**\n * Detect squash merges by creating a temporary dangling commit that represents\n * the branch's tree squashed onto the merge-base, then checking if that patch\n * is already present in the base ref via `git cherry`.\n */\nfunction checkSquashMerged(branch: string, baseRef: string, cwd: string): boolean {\n const mb = git(['merge-base', baseRef, branch], cwd);\n if (mb.exitCode !== 0) return false;\n\n const tree = git(['rev-parse', `${branch}^{tree}`], cwd);\n if (tree.exitCode !== 0) return false;\n\n const dangling = git(['commit-tree', tree.stdout, '-p', mb.stdout, '-m', ''], cwd);\n if (dangling.exitCode !== 0) return false;\n\n const cherry = git(['cherry', baseRef, dangling.stdout], cwd);\n if (cherry.exitCode !== 0) return false;\n\n // If the output starts with \"-\", the patch is already in baseRef (squash-merged)\n return cherry.stdout.startsWith('-');\n}\n\n/** Confidence level for a positive merge result. */\nexport type MergeConfidence = 'merged' | 'squash-merged';\n\nexport interface MergeCheckResult {\n merged: boolean;\n /** The base ref it matched against (e.g. \"origin/main\"), or null if not merged. */\n into: string | null;\n /**\n * How the match was determined when `merged` is true: 'merged' is a\n * high-confidence true merge; 'squash-merged' is the lower-confidence\n * squash heuristic. Null when not merged.\n */\n confidence: MergeConfidence | null;\n}\n\nexport function isBranchMerged(branch: string, cwd: string, baseBranch?: string): MergeCheckResult {\n const defaultBranch = getDefaultBranch(cwd);\n const bases = baseBranch ? [baseBranch] : [defaultBranch, 'main', 'master'].filter((b): b is string => b !== null);\n\n // Deduplicate (e.g. default branch is \"main\" which is already in the list)\n const uniqueBases = [...new Set(bases)];\n\n for (const base of uniqueBases) {\n // Check remote base branch first (most up-to-date after fetch)\n if (remoteBranchExists(base, cwd)) {\n const baseRef = `origin/${base}`;\n const status = checkMergeStatus(branch, baseRef, cwd);\n if (status === 'merged') return { merged: true, into: baseRef, confidence: 'merged' };\n if (status === 'squash-merged') return { merged: true, into: baseRef, confidence: 'squash-merged' };\n if (status === 'stale') return { merged: false, into: null, confidence: null };\n }\n\n // Fall back to local base branch\n if (localBranchExists(base, cwd)) {\n const status = checkMergeStatus(branch, base, cwd);\n if (status === 'merged') return { merged: true, into: base, confidence: 'merged' };\n if (status === 'squash-merged') return { merged: true, into: base, confidence: 'squash-merged' };\n if (status === 'stale') return { merged: false, into: null, confidence: null };\n }\n }\n\n return { merged: false, into: null, confidence: null };\n}\n\n/** Fetch latest remote refs for a repo and ensure origin/HEAD is set. */\nexport function fetchRemote(cwd: string): void {\n git(['fetch', '--quiet'], cwd);\n\n // Ensure origin/HEAD is set so getDefaultBranch works\n if (!getDefaultBranch(cwd)) {\n git(['remote', 'set-head', 'origin', '--auto'], cwd);\n }\n}\n\n/** Async version of fetchRemote — non-blocking. */\nexport async function fetchRemoteAsync(cwd: string): Promise<void> {\n await new Promise<void>((resolve, reject) => {\n execFile(programPath('git'), ['fetch', '--quiet'], { cwd, timeout: 30000, windowsHide: true }, (err) => {\n if (err) reject(err);\n else resolve();\n });\n });\n if (!getDefaultBranch(cwd)) {\n git(['remote', 'set-head', 'origin', '--auto'], cwd);\n }\n}\n\n/** Rebase a branch onto the default branch. Returns error message or null on success. */\nexport function rebaseOntoMain(branch: string, cwd: string): string | null {\n const defaultBranch = getDefaultBranch(cwd) ?? 'main';\n // Fetch latest first\n git(['fetch', '--quiet'], cwd);\n const base = remoteBranchExists(defaultBranch, cwd) ? `origin/${defaultBranch}` : defaultBranch;\n const result = git(['rebase', base, branch], cwd);\n if (result.exitCode !== 0) {\n // Abort the failed rebase\n git(['rebase', '--abort'], cwd);\n return result.stderr || 'Rebase failed';\n }\n return null;\n}\n\n/** Count merge conflicts between a branch and the default branch. Returns 0 if clean. */\nexport function countConflicts(branch: string, cwd: string): number {\n const defaultBranch = getDefaultBranch(cwd) ?? 'main';\n const base = remoteBranchExists(defaultBranch, cwd) ? `origin/${defaultBranch}` : defaultBranch;\n\n // Use merge-tree to simulate merge without changing worktree\n const mergeBase = git(['merge-base', base, branch], cwd);\n if (mergeBase.exitCode !== 0) return 0;\n\n const result = git(['merge-tree', mergeBase.stdout, base, branch], cwd);\n // Count conflict markers in merge-tree output\n const conflicts = (result.stdout.match(/^<<<<<<< /gm) || []).length;\n return conflicts;\n}\n\n/** Check for unpushed commits. Returns the log output or empty string. */\nexport function getUnpushedCommits(cwd: string): string {\n const branch = getCurrentBranch(cwd);\n if (!branch) return '';\n\n const upstreamResult = git(['rev-parse', '--abbrev-ref', `${branch}@{upstream}`], cwd);\n if (upstreamResult.exitCode !== 0) return '';\n\n const upstream = upstreamResult.stdout;\n const logResult = git(['log', '--oneline', `${upstream}..HEAD`], cwd);\n return logResult.stdout;\n}\n"],"mappings":";;;;;;;;;;;;AACA,SAAS,gBAAgB;AAEzB,OAAO,QAAQ;AACf,OAAO,UAAU;AAUV,SAAS,IAAI,MAAgB,KAAwB;AAC1D,QAAM,OAAO,KAAK,KAAK,GAAG,GAAG,OAAO,GAAG,EAAE;AACzC,QAAM,SAAS,cAAM,KAAK,OAAO,MAAM;AAAA,IACrC;AAAA,IACA,UAAU;AAAA,IACV,OAAO,CAAC,QAAQ,QAAQ,MAAM;AAAA;AAAA;AAAA,IAG9B,aAAa;AAAA,EACf,CAAC;AAED,QAAM,IAAI;AAAA,IACR,SAAS,OAAO,UAAU,IAAI,SAAS,EAAE,KAAK;AAAA,IAC9C,SAAS,OAAO,UAAU,IAAI,SAAS,EAAE,KAAK;AAAA,IAC9C,UAAU,OAAO,UAAU;AAAA,EAC7B;AACA,MAAI,EAAE,aAAa,GAAG;AACpB,UAAM,cAAc,EAAE,MAAM,UAAU,EAAE,UAAU,QAAQ,EAAE,OAAO,CAAC;AAAA,EACtE;AACA,SAAO;AACT;AASO,SAAS,kBAAkB,KAA8B;AAC9D,QAAM,SAAS,IAAI,CAAC,YAAY,QAAQ,aAAa,GAAG,GAAG;AAC3D,MAAI,OAAO,aAAa,EAAG,QAAO,CAAC;AAEnC,QAAM,UAA2B,CAAC;AAClC,MAAI,UAAkC,CAAC;AAEvC,aAAW,QAAQ,OAAO,OAAO,MAAM,IAAI,GAA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AAM,SAAS,iBAAiB,GAAG;AACnC,MAAI,CAAC,OAAQ,QAAO;AAEpB,QAAM,iBAAiB,IAAI,CAAC,aAAa,gBAAgB,GAAG,MAAM,aAAa,GAAG,GAAG;AACrF,MAAI,eAAe,aAAa,EAAG,QAAO;AAE1C,QAAM,WAAW,eAAe;AAChC,QAAM,YAAY,IAAI,CAAC,OAAO,aAAa,GAAG,QAAQ,QAAQ,GAAG,GAAG;AACpE,SAAO,UAAU;AACnB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/core/git/git.ts"],"sourcesContent":["import spawn from '../platform/spawn.js';\nimport { execFile } from 'node:child_process';\nimport { programPath } from '../platform/program-path.js';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { debug } from '../platform/logger.js';\n\nexport interface GitResult {\n stdout: string;\n stderr: string;\n exitCode: number;\n}\n\n/** Run a git command synchronously in the given cwd. */\nexport function git(args: string[], cwd: string): GitResult {\n debug('git', args.join(' '), `cwd=${cwd}`);\n const result = spawn.sync('git', args, {\n cwd,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n // Avoid flashing a console window on Windows for every git call —\n // matters most when this runs inside the detached `wd --watch` daemon.\n windowsHide: true,\n });\n\n const r = {\n stdout: (result.stdout ?? '').toString().trim(),\n stderr: (result.stderr ?? '').toString().trim(),\n exitCode: result.status ?? 1,\n };\n if (r.exitCode !== 0) {\n debug('git failed', { args, exitCode: r.exitCode, stderr: r.stderr });\n }\n return r;\n}\n\nexport interface WorktreeEntry {\n path: string;\n branch: string;\n head: string;\n}\n\n/** Parse `git worktree list --porcelain` output into structured entries. */\nexport function parseWorktreeList(cwd: string): WorktreeEntry[] {\n const result = git(['worktree', 'list', '--porcelain'], cwd);\n if (result.exitCode !== 0) return [];\n\n const entries: WorktreeEntry[] = [];\n let current: Partial<WorktreeEntry> = {};\n\n for (const line of result.stdout.split('\\n')) {\n const worktreeMatch = line.match(/^worktree (.+)$/);\n if (worktreeMatch) {\n if (current.path) {\n entries.push({\n path: current.path,\n branch: current.branch ?? '',\n head: current.head ?? '',\n });\n }\n current = { path: worktreeMatch[1] };\n continue;\n }\n\n const headMatch = line.match(/^HEAD (.+)$/);\n if (headMatch) {\n current.head = headMatch[1].substring(0, 7);\n continue;\n }\n\n const branchMatch = line.match(/^branch (.+)$/);\n if (branchMatch) {\n current.branch = branchMatch[1].replace(/^refs\\/heads\\//, '');\n }\n }\n\n // Push last entry\n if (current.path) {\n entries.push({\n path: current.path,\n branch: current.branch ?? '',\n head: current.head ?? '',\n });\n }\n\n return entries;\n}\n\n/** Check if a local branch exists. */\nexport function localBranchExists(branch: string, cwd: string): boolean {\n const result = git(['rev-parse', '--verify', branch], cwd);\n return result.exitCode === 0;\n}\n\n/** Check if a remote tracking branch exists. */\nexport function remoteBranchExists(branch: string, cwd: string): boolean {\n const result = git(['rev-parse', '--verify', `origin/${branch}`], cwd);\n return result.exitCode === 0;\n}\n\n/** Check if path is a valid git worktree/repo. */\nexport function isGitRepo(cwd: string): boolean {\n const result = git(['rev-parse', '--is-inside-work-tree'], cwd);\n return result.exitCode === 0 && result.stdout === 'true';\n}\n\n/** Get the absolute toplevel of the worktree containing cwd, or null if not a repo. */\nexport function getWorktreeRoot(cwd: string): string | null {\n const result = git(['rev-parse', '--show-toplevel'], cwd);\n if (result.exitCode !== 0 || !result.stdout) return null;\n return result.stdout;\n}\n\n/**\n * Get the MAIN repo working directory for a (possibly linked) worktree.\n * `--git-common-dir` points at the main repo's `.git` dir; the main repo root\n * is its parent when the basename is `.git`, otherwise the path itself.\n * Returns null on failure.\n */\nexport function getMainRepoRoot(cwd: string): string | null {\n const result = git(['rev-parse', '--path-format=absolute', '--git-common-dir'], cwd);\n if (result.exitCode !== 0 || !result.stdout) return null;\n const commonDir = result.stdout;\n if (path.basename(commonDir) === '.git') {\n return path.dirname(commonDir);\n }\n return commonDir;\n}\n\n/** Get current branch name. */\nexport function getCurrentBranch(cwd: string): string {\n const result = git(['branch', '--show-current'], cwd);\n return result.stdout;\n}\n\n/** Check for uncommitted changes (returns porcelain status). */\nexport function getStatus(cwd: string): string {\n const result = git(['status', '--porcelain'], cwd);\n return result.stdout;\n}\n\n/**\n * Porcelain status, or null when git could not tell (it errored). Anything\n * deciding whether work may be deleted must use this and treat null as\n * \"maybe dirty\": an empty string from a FAILED `git status` is not clean.\n */\nexport function getStatusChecked(cwd: string): string | null {\n const result = git(['status', '--porcelain'], cwd);\n return result.exitCode === 0 ? result.stdout : null;\n}\n\nexport type RepoState = 'repo' | 'not-a-repo' | 'unknown';\n\n/**\n * Whether a directory is a git checkout — with \"can't tell\" kept apart\n * from \"no\". A failing git (dubious ownership on a network share, git\n * missing from a detached process's PATH, a worktree whose main repo was\n * moved) is NOT proof the folder is disposable: 'not-a-repo' needs git to\n * say so AND no `.git` entry in the folder.\n */\nexport function repoState(cwd: string): RepoState {\n const result = git(['rev-parse', '--is-inside-work-tree'], cwd);\n if (result.exitCode === 0 && result.stdout === 'true') return 'repo';\n if (fs.existsSync(path.join(cwd, '.git'))) return 'unknown';\n return /not a git repository/i.test(result.stderr) ? 'not-a-repo' : 'unknown';\n}\n\n/** Get the default branch from origin/HEAD (e.g. \"main\" or \"master\"). */\nexport function getDefaultBranch(cwd: string): string | null {\n const result = git(['symbolic-ref', 'refs/remotes/origin/HEAD'], cwd);\n if (result.exitCode === 0 && result.stdout) {\n // Output is like \"refs/remotes/origin/main\"\n return result.stdout.replace(/^refs\\/remotes\\/origin\\//, '');\n }\n return null;\n}\n\n/**\n * Result of checking a branch against a single base ref.\n *\n * 'merged' is a high-confidence true merge (the branch tip is reachable from\n * base via a merge/fast-forward). 'squash-merged' is the lower-confidence\n * heuristic match from {@link checkSquashMerged} — the branch's squashed patch\n * already appears in base, but there is no real merge commit linking the two.\n * Callers that prune unattended should treat 'squash-merged' as opt-in only.\n */\ntype MergeCheck = 'merged' | 'squash-merged' | 'stale' | 'unrelated';\n\n/**\n * Check if a branch is truly merged into a base ref (not just a stale branch\n * sitting behind base with no unique commits).\n *\n * Returns 'stale' if the branch tip is on the base's first-parent chain\n * (no unique work). Returns 'merged' if the branch has unique commits that\n * are all reachable from base. Returns 'squash-merged' if only the squash\n * heuristic matched. Returns 'unrelated' otherwise.\n */\nfunction checkMergeStatus(branch: string, baseRef: string, cwd: string): MergeCheck {\n // 1. Branch must be an ancestor of base (all its commits are in base)\n const branchInBase = git(['merge-base', '--is-ancestor', branch, baseRef], cwd);\n if (branchInBase.exitCode !== 0) {\n // Not a regular merge — check for squash merge (low-confidence heuristic).\n if (checkSquashMerged(branch, baseRef, cwd)) return 'squash-merged';\n return 'unrelated';\n }\n\n // 2. If base is also ancestor of branch, they're at the same commit\n // (fast-forward merge or empty branch) — nothing left to merge.\n const baseInBranch = git(['merge-base', '--is-ancestor', baseRef, branch], cwd);\n if (baseInBranch.exitCode === 0) return 'merged';\n\n // 3. Branch is ancestor of base — but is it on the main line (stale) or\n // only reachable via a merge commit (truly merged)?\n // A stale branch's tip sits directly on the first-parent chain.\n const tip = git(['rev-parse', branch], cwd);\n if (tip.exitCode !== 0) return 'unrelated';\n const mainLine = git(['rev-list', '--first-parent', '-n', '500', baseRef], cwd);\n if (mainLine.exitCode === 0 && mainLine.stdout.includes(tip.stdout)) {\n return 'stale';\n }\n\n return 'merged';\n}\n\n/**\n * Detect squash merges by creating a temporary dangling commit that represents\n * the branch's tree squashed onto the merge-base, then checking if that patch\n * is already present in the base ref via `git cherry`.\n */\nfunction checkSquashMerged(branch: string, baseRef: string, cwd: string): boolean {\n const mb = git(['merge-base', baseRef, branch], cwd);\n if (mb.exitCode !== 0) return false;\n\n const tree = git(['rev-parse', `${branch}^{tree}`], cwd);\n if (tree.exitCode !== 0) return false;\n\n const dangling = git(['commit-tree', tree.stdout, '-p', mb.stdout, '-m', ''], cwd);\n if (dangling.exitCode !== 0) return false;\n\n const cherry = git(['cherry', baseRef, dangling.stdout], cwd);\n if (cherry.exitCode !== 0) return false;\n\n // If the output starts with \"-\", the patch is already in baseRef (squash-merged)\n return cherry.stdout.startsWith('-');\n}\n\n/** Confidence level for a positive merge result. */\nexport type MergeConfidence = 'merged' | 'squash-merged';\n\nexport interface MergeCheckResult {\n merged: boolean;\n /** The base ref it matched against (e.g. \"origin/main\"), or null if not merged. */\n into: string | null;\n /**\n * How the match was determined when `merged` is true: 'merged' is a\n * high-confidence true merge; 'squash-merged' is the lower-confidence\n * squash heuristic. Null when not merged.\n */\n confidence: MergeConfidence | null;\n}\n\nexport function isBranchMerged(branch: string, cwd: string, baseBranch?: string): MergeCheckResult {\n const defaultBranch = getDefaultBranch(cwd);\n const bases = baseBranch ? [baseBranch] : [defaultBranch, 'main', 'master'].filter((b): b is string => b !== null);\n\n // Deduplicate (e.g. default branch is \"main\" which is already in the list)\n const uniqueBases = [...new Set(bases)];\n\n for (const base of uniqueBases) {\n // Check remote base branch first (most up-to-date after fetch)\n if (remoteBranchExists(base, cwd)) {\n const baseRef = `origin/${base}`;\n const status = checkMergeStatus(branch, baseRef, cwd);\n if (status === 'merged') return { merged: true, into: baseRef, confidence: 'merged' };\n if (status === 'squash-merged') return { merged: true, into: baseRef, confidence: 'squash-merged' };\n if (status === 'stale') return { merged: false, into: null, confidence: null };\n }\n\n // Fall back to local base branch\n if (localBranchExists(base, cwd)) {\n const status = checkMergeStatus(branch, base, cwd);\n if (status === 'merged') return { merged: true, into: base, confidence: 'merged' };\n if (status === 'squash-merged') return { merged: true, into: base, confidence: 'squash-merged' };\n if (status === 'stale') return { merged: false, into: null, confidence: null };\n }\n }\n\n return { merged: false, into: null, confidence: null };\n}\n\n/** Fetch latest remote refs for a repo and ensure origin/HEAD is set. */\nexport function fetchRemote(cwd: string): void {\n git(['fetch', '--quiet'], cwd);\n\n // Ensure origin/HEAD is set so getDefaultBranch works\n if (!getDefaultBranch(cwd)) {\n git(['remote', 'set-head', 'origin', '--auto'], cwd);\n }\n}\n\n/** Async version of fetchRemote — non-blocking. */\nexport async function fetchRemoteAsync(cwd: string): Promise<void> {\n await new Promise<void>((resolve, reject) => {\n execFile(programPath('git'), ['fetch', '--quiet'], { cwd, timeout: 30000, windowsHide: true }, (err) => {\n if (err) reject(err);\n else resolve();\n });\n });\n if (!getDefaultBranch(cwd)) {\n git(['remote', 'set-head', 'origin', '--auto'], cwd);\n }\n}\n\n/** Rebase a branch onto the default branch. Returns error message or null on success. */\nexport function rebaseOntoMain(branch: string, cwd: string): string | null {\n const defaultBranch = getDefaultBranch(cwd) ?? 'main';\n // Fetch latest first\n git(['fetch', '--quiet'], cwd);\n const base = remoteBranchExists(defaultBranch, cwd) ? `origin/${defaultBranch}` : defaultBranch;\n const result = git(['rebase', base, branch], cwd);\n if (result.exitCode !== 0) {\n // Abort the failed rebase\n git(['rebase', '--abort'], cwd);\n return result.stderr || 'Rebase failed';\n }\n return null;\n}\n\n/** Count merge conflicts between a branch and the default branch. Returns 0 if clean. */\nexport function countConflicts(branch: string, cwd: string): number {\n const defaultBranch = getDefaultBranch(cwd) ?? 'main';\n const base = remoteBranchExists(defaultBranch, cwd) ? `origin/${defaultBranch}` : defaultBranch;\n\n // Use merge-tree to simulate merge without changing worktree\n const mergeBase = git(['merge-base', base, branch], cwd);\n if (mergeBase.exitCode !== 0) return 0;\n\n const result = git(['merge-tree', mergeBase.stdout, base, branch], cwd);\n // Count conflict markers in merge-tree output\n const conflicts = (result.stdout.match(/^<<<<<<< /gm) || []).length;\n return conflicts;\n}\n\n/** Check for unpushed commits. Returns the log output or empty string. */\nexport function getUnpushedCommits(cwd: string): string {\n const branch = getCurrentBranch(cwd);\n if (!branch) return '';\n\n const upstreamResult = git(['rev-parse', '--abbrev-ref', `${branch}@{upstream}`], cwd);\n if (upstreamResult.exitCode !== 0) return '';\n\n const upstream = upstreamResult.stdout;\n const logResult = git(['log', '--oneline', `${upstream}..HEAD`], cwd);\n return logResult.stdout;\n}\n"],"mappings":";;;;;;;;;;AACA,SAAS,gBAAgB;AAEzB,OAAO,QAAQ;AACf,OAAO,UAAU;AAUV,SAAS,IAAI,MAAgB,KAAwB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|
8
8
|
pool
|
|
9
9
|
} from "./chunk-AKMPF72Y.js";
|
|
10
10
|
import {
|
|
11
11
|
defaultRunner
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-XBWS77S2.js";
|
|
13
13
|
import {
|
|
14
14
|
sessionIdFor
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ALBTIOP3.js";
|
|
16
16
|
|
|
17
17
|
// src/core/diff/overlap-scan.ts
|
|
18
18
|
import path from "path";
|
|
@@ -34,4 +34,4 @@ async function scanChanges(sessions, opts = {}) {
|
|
|
34
34
|
export {
|
|
35
35
|
scanChanges
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-K2OOUNXH.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isFolderSession,
|
|
4
4
|
sessionRepos
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FNWPOM4B.js";
|
|
6
6
|
|
|
7
7
|
// src/core/worktree/add-repo-rules.ts
|
|
8
8
|
import path from "path";
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
addRepoRefusal,
|
|
37
37
|
addedRepoNote
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-KCYYIUUQ.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
json,
|
|
4
|
+
withDb
|
|
5
|
+
} from "./chunk-ALBTIOP3.js";
|
|
6
|
+
|
|
7
|
+
// src/core/review/local-review-store.ts
|
|
8
|
+
var strings = (v) => Array.isArray(v) && v.every((x) => typeof x === "string");
|
|
9
|
+
function isStoredLocalReview(v) {
|
|
10
|
+
const o = v;
|
|
11
|
+
if (!o || typeof o !== "object") return false;
|
|
12
|
+
const p = o.prepared;
|
|
13
|
+
return (o.repo === null || typeof o.repo === "string") && strings(o.repos) && typeof o.at === "string" && strings(o.sent) && strings(o.dismissed) && !!p && typeof p === "object" && Array.isArray(p.files) && strings(p.repos) && !!p.review && typeof p.review === "object" && typeof p.review.headSha === "string" && Array.isArray(p.review.drafts) && Array.isArray(p.review.stories) && Array.isArray(p.review.files);
|
|
14
|
+
}
|
|
15
|
+
function readLocalReview(sessionId) {
|
|
16
|
+
const row = withDb(
|
|
17
|
+
(d) => d.prepare("SELECT data FROM session_reviews WHERE session_id = ?").get(sessionId)
|
|
18
|
+
);
|
|
19
|
+
const v = row ? json.parse(row.data) : null;
|
|
20
|
+
return isStoredLocalReview(v) ? v : null;
|
|
21
|
+
}
|
|
22
|
+
function saveLocalReview(sessionId, review) {
|
|
23
|
+
withDb(
|
|
24
|
+
(d) => d.prepare("INSERT OR REPLACE INTO session_reviews (session_id, data) VALUES (?, ?)").run(sessionId, JSON.stringify(review))
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function dropLocalReview(sessionId) {
|
|
28
|
+
withDb((d) => d.prepare("DELETE FROM session_reviews WHERE session_id = ?").run(sessionId));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
readLocalReview,
|
|
33
|
+
saveLocalReview,
|
|
34
|
+
dropLocalReview
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-KL7RY6UG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/review/local-review-store.ts"],"sourcesContent":["import { json, withDb } from '../platform/db.js';\nimport type { PreparedLocal, StoredLocalReview } from './local-review.js';\n\n/**\n * A session's own review, kept across restarts (reported: it lived in work web's memory, so a restart lost it and\n * cost minutes to prepare again): the last one prepared, with which of its notes you sent to the agent and which you\n * dismissed. One per session in state.db `session_reviews` (schema v14, gone with the session: purgeSessionRows).\n */\n\nconst strings = (v: unknown): v is string[] => Array.isArray(v) && v.every((x) => typeof x === 'string');\n\n/** A stored row is read as `unknown` and shape-checked (§5.5): one that isn't a review is no review. */\nexport function isStoredLocalReview(v: unknown): v is StoredLocalReview {\n const o = v as StoredLocalReview | null;\n if (!o || typeof o !== 'object') return false;\n const p = o.prepared as PreparedLocal | undefined;\n return (\n (o.repo === null || typeof o.repo === 'string') &&\n strings(o.repos) &&\n typeof o.at === 'string' &&\n strings(o.sent) &&\n strings(o.dismissed) &&\n !!p &&\n typeof p === 'object' &&\n Array.isArray(p.files) &&\n strings(p.repos) &&\n !!p.review &&\n typeof p.review === 'object' &&\n typeof p.review.headSha === 'string' &&\n Array.isArray(p.review.drafts) &&\n Array.isArray(p.review.stories) &&\n Array.isArray(p.review.files)\n );\n}\n\nexport function readLocalReview(sessionId: string): StoredLocalReview | null {\n const row = withDb(\n (d) => d.prepare('SELECT data FROM session_reviews WHERE session_id = ?').get(sessionId) as { data: string } | undefined,\n );\n const v = row ? json.parse(row.data) : null;\n return isStoredLocalReview(v) ? v : null;\n}\n\nexport function saveLocalReview(sessionId: string, review: StoredLocalReview): void {\n withDb((d) =>\n d.prepare('INSERT OR REPLACE INTO session_reviews (session_id, data) VALUES (?, ?)').run(sessionId, JSON.stringify(review)),\n );\n}\n\nexport function dropLocalReview(sessionId: string): void {\n withDb((d) => d.prepare('DELETE FROM session_reviews WHERE session_id = ?').run(sessionId));\n}\n"],"mappings":";;;;;;;AASA,IAAM,UAAU,CAAC,MAA8B,MAAM,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,OAAO,MAAM,QAAQ;AAGhG,SAAS,oBAAoB,GAAoC;AACtE,QAAM,IAAI;AACV,MAAI,CAAC,KAAK,OAAO,MAAM,SAAU,QAAO;AACxC,QAAM,IAAI,EAAE;AACZ,UACG,EAAE,SAAS,QAAQ,OAAO,EAAE,SAAS,aACtC,QAAQ,EAAE,KAAK,KACf,OAAO,EAAE,OAAO,YAChB,QAAQ,EAAE,IAAI,KACd,QAAQ,EAAE,SAAS,KACnB,CAAC,CAAC,KACF,OAAO,MAAM,YACb,MAAM,QAAQ,EAAE,KAAK,KACrB,QAAQ,EAAE,KAAK,KACf,CAAC,CAAC,EAAE,UACJ,OAAO,EAAE,WAAW,YACpB,OAAO,EAAE,OAAO,YAAY,YAC5B,MAAM,QAAQ,EAAE,OAAO,MAAM,KAC7B,MAAM,QAAQ,EAAE,OAAO,OAAO,KAC9B,MAAM,QAAQ,EAAE,OAAO,KAAK;AAEhC;AAEO,SAAS,gBAAgB,WAA6C;AAC3E,QAAM,MAAM;AAAA,IACV,CAAC,MAAM,EAAE,QAAQ,uDAAuD,EAAE,IAAI,SAAS;AAAA,EACzF;AACA,QAAM,IAAI,MAAM,KAAK,MAAM,IAAI,IAAI,IAAI;AACvC,SAAO,oBAAoB,CAAC,IAAI,IAAI;AACtC;AAEO,SAAS,gBAAgB,WAAmB,QAAiC;AAClF;AAAA,IAAO,CAAC,MACN,EAAE,QAAQ,yEAAyE,EAAE,IAAI,WAAW,KAAK,UAAU,MAAM,CAAC;AAAA,EAC5H;AACF;AAEO,SAAS,gBAAgB,WAAyB;AACvD,SAAO,CAAC,MAAM,EAAE,QAAQ,kDAAkD,EAAE,IAAI,SAAS,CAAC;AAC5F;","names":[]}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
childText,
|
|
4
4
|
runWorkChild
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5LAFHPNB.js";
|
|
6
6
|
import {
|
|
7
7
|
report
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5ZCCUM75.js";
|
|
9
9
|
|
|
10
10
|
// src/core/worktree/remove-child.ts
|
|
11
11
|
var WORKTREE_REMOVED = "work-worktree-removed ";
|
|
@@ -34,4 +34,4 @@ export {
|
|
|
34
34
|
WORKTREE_REMOVED,
|
|
35
35
|
removeWorktreeInChild
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-LMP3WGRW.js.map
|