@moberg_hr/work-tree 2.14.1 → 2.16.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-MYGAXTF6.js} +31 -30
- package/dist/account-MYGAXTF6.js.map +1 -0
- package/dist/{add-repo-PHD76M4S.js → add-repo-7PLONSB6.js} +30 -29
- package/dist/{add-repo-PHD76M4S.js.map → add-repo-7PLONSB6.js.map} +1 -1
- package/dist/{answer-HUVZ3XMW.js → answer-H3D6OLHJ.js} +19 -18
- package/dist/{answer-HUVZ3XMW.js.map → answer-H3D6OLHJ.js.map} +1 -1
- package/dist/{attach-RJ53ABQN.js → attach-Z2HEZVZW.js} +26 -26
- package/dist/bin.js +9 -7
- package/dist/bin.js.map +1 -1
- package/dist/{block-W34JH22B.js → block-BWRLOTSM.js} +24 -23
- package/dist/{block-W34JH22B.js.map → block-BWRLOTSM.js.map} +1 -1
- package/dist/{broadcast-7YTINXQF.js → broadcast-RY6NAYGN.js} +16 -15
- package/dist/{broadcast-7YTINXQF.js.map → broadcast-RY6NAYGN.js.map} +1 -1
- package/dist/{catchup-5HC52SDK.js → catchup-K5ICNWDH.js} +22 -21
- package/dist/{catchup-5HC52SDK.js.map → catchup-K5ICNWDH.js.map} +1 -1
- package/dist/{chunk-WAZCBD7Y.js → chunk-2CVBAJH7.js} +3 -3
- package/dist/{chunk-X5XVXJ4B.js → chunk-2H3H23W5.js} +2 -2
- package/dist/{chunk-7ZL3GJGY.js → chunk-2L2TNYQA.js} +4 -4
- package/dist/{chunk-6MUKE253.js → chunk-3JANKWY2.js} +4 -4
- package/dist/{chunk-VLUME72O.js → chunk-3L5VDONX.js} +4 -4
- package/dist/chunk-3OMFMSZ4.js +9 -0
- package/dist/{chunk-RUIBZ6DI.js → chunk-42WCSVBK.js} +5 -5
- package/dist/chunk-42WCSVBK.js.map +1 -0
- package/dist/{chunk-JQ42ERH3.js → chunk-44UME4JD.js} +2 -2
- package/dist/{chunk-KJY2AJQS.js → chunk-45QJQIWF.js} +12 -12
- package/dist/chunk-45QJQIWF.js.map +1 -0
- package/dist/{chunk-2K44PZRP.js → chunk-473UMEVN.js} +60 -59
- package/dist/chunk-473UMEVN.js.map +1 -0
- package/dist/{chunk-AYHDJMMJ.js → chunk-4CXUVBOD.js} +2 -2
- package/dist/{chunk-Z3T5FWM6.js → chunk-4HNMJIUZ.js} +2 -2
- package/dist/{chunk-MKJH2D4V.js → chunk-4NIOURHZ.js} +2 -2
- package/dist/{chunk-T7K276XW.js → chunk-4YO2PDUC.js} +6 -6
- package/dist/{chunk-AU27USPZ.js → chunk-5ZCCUM75.js} +2 -2
- package/dist/{chunk-UTBIZ6W5.js → chunk-63NT2NZD.js} +7 -7
- package/dist/{chunk-RRNIJ7YO.js → chunk-ALBTIOP3.js} +3 -3
- package/dist/{chunk-UIG3CTXU.js → chunk-C5F36EGT.js} +8 -8
- package/dist/{chunk-MOTKVMGL.js → chunk-C6TKUX7I.js} +30 -5
- package/dist/chunk-C6TKUX7I.js.map +1 -0
- package/dist/{chunk-DWEW7I53.js → chunk-CJQPKHDO.js} +9 -9
- package/dist/{chunk-RVSRZ57P.js → chunk-CNZV3UCM.js} +2 -2
- 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-EHUKDUNJ.js → chunk-EQJZ2GXX.js} +7 -7
- package/dist/{chunk-UI45HNNQ.js → chunk-EVZUJLZH.js} +9 -9
- package/dist/{chunk-5D5V4P7J.js → chunk-EX6ELNTN.js} +5 -5
- package/dist/chunk-F2ECTTSY.js +22 -0
- package/dist/chunk-F2ECTTSY.js.map +1 -0
- package/dist/{chunk-AGRUEZQX.js → chunk-GNIYYXQX.js} +2 -2
- package/dist/{chunk-ERXXU72V.js → chunk-GT3KUREW.js} +7 -7
- package/dist/{chunk-Y2DBNXZH.js → chunk-H3WBTKPB.js} +291 -114
- package/dist/chunk-H3WBTKPB.js.map +1 -0
- package/dist/chunk-HK6AZQ5Z.js +54 -0
- package/dist/chunk-HK6AZQ5Z.js.map +1 -0
- package/dist/{chunk-ULI3NB4J.js → chunk-HT52LVYU.js} +7 -7
- package/dist/{chunk-RCWQD32G.js → chunk-HWMQV4YD.js} +5 -5
- package/dist/{chunk-MUCUSF6Y.js → chunk-I5YQ7AC5.js} +3 -3
- 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-FLY3VR6B.js → chunk-IKGSTBTG.js} +3 -2
- package/dist/chunk-IKGSTBTG.js.map +1 -0
- package/dist/{chunk-7UXV4X2Y.js → chunk-IPHADNF5.js} +2 -2
- 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-KL7RY6UG.js +36 -0
- package/dist/chunk-KL7RY6UG.js.map +1 -0
- package/dist/{chunk-YXUVNSDM.js → chunk-LBPYBBXX.js} +2 -2
- package/dist/{chunk-6AJFOISA.js → chunk-LMD2J2JN.js} +4 -4
- package/dist/{chunk-T26N4I4E.js → chunk-LMSKMRNU.js} +11 -11
- package/dist/chunk-LMSKMRNU.js.map +1 -0
- package/dist/{chunk-2Y2ARDXI.js → chunk-MD6QMSXQ.js} +2 -2
- package/dist/{chunk-TNKBZIR5.js → chunk-MH4D37RT.js} +3 -3
- package/dist/{chunk-U2MOKVPZ.js → chunk-MHL66TIL.js} +2 -2
- package/dist/{chunk-GDR4RWF4.js → chunk-N5P2OY5O.js} +2 -2
- package/dist/{chunk-BPAV2PIE.js → chunk-NIAXRF5E.js} +2 -2
- package/dist/{chunk-NCXRMJGS.js → chunk-O2IARWVM.js} +9 -6
- package/dist/chunk-O2IARWVM.js.map +1 -0
- package/dist/{chunk-BXVBNYQT.js → chunk-OA3TYOAY.js} +4 -4
- package/dist/{chunk-DPO6I7OR.js → chunk-P5633SI2.js} +12 -12
- package/dist/{chunk-AKDTLWWD.js → chunk-PJPYRXKJ.js} +8 -8
- package/dist/{chunk-UH72CZAX.js → chunk-PZ7WTBSI.js} +2 -2
- package/dist/{chunk-ZS7ZXAXB.js → chunk-QOSAWNOU.js} +66 -2
- package/dist/chunk-QOSAWNOU.js.map +1 -0
- package/dist/{chunk-XSI4WZIX.js → chunk-QTUYNY3F.js} +5 -5
- package/dist/{chunk-UY5J2KY2.js → chunk-QUL26RYB.js} +32 -22
- package/dist/chunk-QUL26RYB.js.map +1 -0
- 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-BK73QU45.js → chunk-REPFZIPP.js} +27 -8
- package/dist/chunk-REPFZIPP.js.map +1 -0
- package/dist/{chunk-CWWWZRMN.js → chunk-RJAGFLAP.js} +3 -3
- package/dist/{chunk-PJQRSOLE.js → chunk-SMARTMBW.js} +4 -4
- package/dist/{chunk-ZLQGKBBE.js → chunk-SRE4CK6Y.js} +2 -2
- package/dist/{chunk-LKJLUSYR.js → chunk-SRGOCF73.js} +3 -3
- package/dist/{chunk-MQQADIRH.js → chunk-SSXKC635.js} +4 -4
- package/dist/{chunk-S43GVNRB.js → chunk-SWAFQ343.js} +8 -8
- 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-5SMTFIYI.js → chunk-TLXZUE4T.js} +7 -7
- package/dist/{chunk-5U3CSRV5.js → chunk-UAXKMJYA.js} +9 -9
- package/dist/{chunk-FLQOSWVR.js → chunk-UN33JXAD.js} +140 -53
- package/dist/chunk-UN33JXAD.js.map +1 -0
- package/dist/{chunk-4B2UV6JH.js → chunk-VH6EUWX7.js} +26 -24
- package/dist/chunk-VH6EUWX7.js.map +1 -0
- package/dist/{chunk-G2V2V5UC.js → chunk-VHENFC2S.js} +2 -2
- package/dist/{chunk-7XKIRMS4.js → chunk-VHYFFFZU.js} +2 -2
- package/dist/{chunk-7UIRKGY7.js → chunk-WLU7EWPD.js} +21 -16
- package/dist/chunk-WLU7EWPD.js.map +1 -0
- package/dist/{chunk-PAEWU7UC.js → chunk-WMIQOBHU.js} +8 -8
- package/dist/{chunk-GSL6ZBQX.js → chunk-WPHTWUNV.js} +23 -18
- package/dist/{chunk-GSL6ZBQX.js.map → chunk-WPHTWUNV.js.map} +1 -1
- package/dist/{chunk-MKQ7IA6U.js → chunk-XBWS77S2.js} +3 -3
- package/dist/{chunk-AAOAVXBF.js → chunk-XHUKX3HO.js} +8 -8
- package/dist/{chunk-A3R3VO6G.js → chunk-XHVRFFOY.js} +6 -6
- package/dist/{chunk-JNKFPFH6.js → chunk-XIOGNTUA.js} +3 -3
- package/dist/{chunk-S2CQ73G4.js → chunk-YLB2QGAR.js} +5 -5
- package/dist/{chunk-RE3NKV4Z.js → chunk-Z3HC36JK.js} +3 -3
- package/dist/{chunk-LCUN2I5Q.js → chunk-ZAAWSVTU.js} +11 -9
- package/dist/{chunk-LCUN2I5Q.js.map → chunk-ZAAWSVTU.js.map} +1 -1
- package/dist/{chunk-V72WJIGN.js → chunk-ZWBXRP2V.js} +10 -10
- package/dist/{chunk-SAPDMQTO.js → chunk-ZXDRQ2MV.js} +8 -8
- package/dist/{cleanup-KVZ7P6EN.js → cleanup-HXZ4S2IO.js} +48 -47
- package/dist/{cleanup-KVZ7P6EN.js.map → cleanup-HXZ4S2IO.js.map} +1 -1
- package/dist/cli-GKHHCDRV.js +20 -0
- package/dist/color-E73MIJWD.js +65 -0
- package/dist/color-E73MIJWD.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-24BNXN5C.js} +21 -20
- package/dist/{config-JEVEBD3O.js.map → config-24BNXN5C.js.map} +1 -1
- package/dist/{diff-3ZGUWMX4.js → diff-NAL5334E.js} +27 -27
- package/dist/{digest-XJYJDGVX.js → digest-NU6XNA7D.js} +18 -17
- package/dist/{digest-XJYJDGVX.js.map → digest-NU6XNA7D.js.map} +1 -1
- package/dist/{fork-AGFYDM5U.js → fork-QVFWYP2Z.js} +44 -44
- package/dist/{history-VYAGUN2X.js → history-W5DQNAY3.js} +15 -14
- package/dist/{hook-PWMF5WBD.js → hook-OIAJHLTJ.js} +27 -29
- package/dist/hook-OIAJHLTJ.js.map +1 -0
- package/dist/{hydrate-PMH6OEVU.js → hydrate-VAJO2JGT.js} +17 -16
- package/dist/{hydrate-PMH6OEVU.js.map → hydrate-VAJO2JGT.js.map} +1 -1
- package/dist/{init-A3J3OC6Y.js → init-2IHQUZ4E.js} +26 -25
- package/dist/{init-A3J3OC6Y.js.map → init-2IHQUZ4E.js.map} +1 -1
- package/dist/install-skills-RJPZOV37.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-IJDON5AL.js} +18 -17
- package/dist/{keep-VRBCD2OU.js.map → keep-IJDON5AL.js.map} +1 -1
- package/dist/{list-WT2YLARZ.js → list-6LPLVUUD.js} +17 -16
- package/dist/{list-WT2YLARZ.js.map → list-6LPLVUUD.js.map} +1 -1
- package/dist/{move-4P2X2VL2.js → move-GY5G47JO.js} +32 -31
- package/dist/{move-4P2X2VL2.js.map → move-GY5G47JO.js.map} +1 -1
- package/dist/{note-INPWMP2K.js → note-6Q3AT7W6.js} +19 -18
- package/dist/{note-INPWMP2K.js.map → note-6Q3AT7W6.js.map} +1 -1
- package/dist/{overlaps-SEMKBXBD.js → overlaps-JQVWZXEB.js} +25 -24
- package/dist/{overlaps-SEMKBXBD.js.map → overlaps-JQVWZXEB.js.map} +1 -1
- package/dist/{pin-4524YHPO.js → pin-MIWOAQ7R.js} +19 -18
- package/dist/{pin-4524YHPO.js.map → pin-MIWOAQ7R.js.map} +1 -1
- package/dist/{pr-CRLSAAGA.js → pr-3F3PJCQN.js} +39 -38
- package/dist/{pr-CRLSAAGA.js.map → pr-3F3PJCQN.js.map} +1 -1
- package/dist/{prune-3XFHACES.js → prune-RKQQWEU6.js} +46 -45
- package/dist/{prune-3XFHACES.js.map → prune-RKQQWEU6.js.map} +1 -1
- package/dist/{pty-host-4NEN3SID.js → pty-host-QTWYR5QT.js} +43 -39
- package/dist/pty-host-QTWYR5QT.js.map +1 -0
- package/dist/{read-TNPMUPCX.js → read-RFLYBHLU.js} +18 -17
- package/dist/{read-TNPMUPCX.js.map → read-RFLYBHLU.js.map} +1 -1
- package/dist/{recent-GUABGTFG.js → recent-R24GG3OG.js} +35 -27
- package/dist/recent-R24GG3OG.js.map +1 -0
- package/dist/{remove-FDXCPMGJ.js → remove-ULIYLBRK.js} +47 -46
- package/dist/{remove-FDXCPMGJ.js.map → remove-ULIYLBRK.js.map} +1 -1
- package/dist/{report-J7TUQRJS.js → report-Z36H65YG.js} +4 -3
- package/dist/{restart-OETITN5N.js → restart-VKQEQEU3.js} +22 -21
- package/dist/{restart-OETITN5N.js.map → restart-VKQEQEU3.js.map} +1 -1
- package/dist/{resume-XDUTFTWV.js → resume-LE3SXWGI.js} +35 -27
- package/dist/resume-LE3SXWGI.js.map +1 -0
- package/dist/{review-EKSF3BUM.js → review-QGBSWK2M.js} +57 -10
- package/dist/review-QGBSWK2M.js.map +1 -0
- package/dist/{review-now-XUEDTNMP.js → review-now-74ISYEFP.js} +7 -6
- package/dist/{review-now-XUEDTNMP.js.map → review-now-74ISYEFP.js.map} +1 -1
- package/dist/{run-INEROJF3.js → run-RXCZSZKP.js} +15 -14
- package/dist/{run-INEROJF3.js.map → run-RXCZSZKP.js.map} +1 -1
- package/dist/{screen-JNM536PR.js → screen-27WNAGP5.js} +19 -18
- package/dist/{screen-JNM536PR.js.map → screen-27WNAGP5.js.map} +1 -1
- package/dist/{search-FOBT55YQ.js → search-OSNZYFMI.js} +15 -14
- package/dist/{search-FOBT55YQ.js.map → search-OSNZYFMI.js.map} +1 -1
- package/dist/{section-7ZGM5YOL.js → section-HIYOC5HZ.js} +19 -18
- package/dist/{section-7ZGM5YOL.js.map → section-HIYOC5HZ.js.map} +1 -1
- package/dist/{send-6X2IKY54.js → send-BFS32VDO.js} +24 -23
- package/dist/{send-6X2IKY54.js.map → send-BFS32VDO.js.map} +1 -1
- package/dist/{sessions-6DLS2JQG.js → sessions-Q5EVPLLK.js} +42 -41
- package/dist/{sessions-6DLS2JQG.js.map → sessions-Q5EVPLLK.js.map} +1 -1
- package/dist/{show-YTJ3NVMP.js → show-JYXEQQM2.js} +18 -17
- package/dist/{show-YTJ3NVMP.js.map → show-JYXEQQM2.js.map} +1 -1
- package/dist/{snooze-7WV4NKX7.js → snooze-YDBFRJYB.js} +18 -17
- package/dist/{snooze-7WV4NKX7.js.map → snooze-YDBFRJYB.js.map} +1 -1
- package/dist/{start-3EE3H4UE.js → start-KWQLMKAL.js} +19 -18
- package/dist/{start-3EE3H4UE.js.map → start-KWQLMKAL.js.map} +1 -1
- package/dist/{state-GPEV4FHA.js → state-NXTIYKP5.js} +6 -5
- package/dist/{state-GPEV4FHA.js.map → state-NXTIYKP5.js.map} +1 -1
- package/dist/{status-DDHIRFAB.js → status-ROO4SRGQ.js} +22 -21
- package/dist/{status-DDHIRFAB.js.map → status-ROO4SRGQ.js.map} +1 -1
- package/dist/statusline-AMFMWPTV.js +67 -0
- package/dist/statusline-AMFMWPTV.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-FMBFJUXI.js} +19 -18
- package/dist/{stop-DYT5BIRN.js.map → stop-FMBFJUXI.js.map} +1 -1
- package/dist/{sync-NOLPKVWO.js → sync-2DVHV7FT.js} +46 -45
- package/dist/{sync-NOLPKVWO.js.map → sync-2DVHV7FT.js.map} +1 -1
- package/dist/{time-WANFTVEE.js → time-LMBQVMQG.js} +24 -23
- package/dist/time-LMBQVMQG.js.map +1 -0
- package/dist/{time-actions-B7YKVDVE.js → time-actions-4GZLAV4C.js} +7 -6
- package/dist/{timesheet-GG5UR2NU.js → timesheet-DWWIBU5Y.js} +27 -26
- package/dist/{timesheet-GG5UR2NU.js.map → timesheet-DWWIBU5Y.js.map} +1 -1
- package/dist/{todo-VBWHS2HU.js → todo-SECMZCGC.js} +7 -6
- package/dist/{todo-VBWHS2HU.js.map → todo-SECMZCGC.js.map} +1 -1
- package/dist/{tree-HYJHJ7HD.js → tree-NH43RR6O.js} +57 -56
- package/dist/tree-NH43RR6O.js.map +1 -0
- package/dist/{update-IMNOHV3J.js → update-THIANISA.js} +28 -27
- package/dist/{update-IMNOHV3J.js.map → update-THIANISA.js.map} +1 -1
- package/dist/{usage-FUWADDO4.js → usage-CZZOI34H.js} +17 -16
- package/dist/{usage-FUWADDO4.js.map → usage-CZZOI34H.js.map} +1 -1
- package/dist/{version-VXE4NJRN.js → version-2YUMQ4EN.js} +12 -13
- package/dist/{version-VXE4NJRN.js.map → version-2YUMQ4EN.js.map} +1 -1
- package/dist/{wait-2U7PLYRS.js → wait-QBBM7MR5.js} +19 -18
- package/dist/{wait-2U7PLYRS.js.map → wait-QBBM7MR5.js.map} +1 -1
- package/dist/wd-bin.js +9 -9
- package/dist/web/assets/{PtyView-s01AhxxX.js → PtyView-CJOk_dgn.js} +2 -2
- package/dist/web/assets/{PtyView-s01AhxxX.js.map → PtyView-CJOk_dgn.js.map} +1 -1
- package/dist/web/assets/index-1hFrx0fV.js +126 -0
- package/dist/web/assets/index-1hFrx0fV.js.map +1 -0
- package/dist/web/assets/index-DXP8G0eh.css +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-KEQI7DQO.js → web-PHQBICO5.js} +517 -341
- package/dist/web-PHQBICO5.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-4B2UV6JH.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-FLY3VR6B.js.map +0 -1
- package/dist/chunk-KI26QYWS.js +0 -9
- package/dist/chunk-KJY2AJQS.js.map +0 -1
- package/dist/chunk-MOTKVMGL.js.map +0 -1
- package/dist/chunk-NCXRMJGS.js.map +0 -1
- package/dist/chunk-RUIBZ6DI.js.map +0 -1
- package/dist/chunk-T26N4I4E.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/time-WANFTVEE.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-Z2HEZVZW.js.map} +0 -0
- /package/dist/{chunk-WAZCBD7Y.js.map → chunk-2CVBAJH7.js.map} +0 -0
- /package/dist/{chunk-X5XVXJ4B.js.map → chunk-2H3H23W5.js.map} +0 -0
- /package/dist/{chunk-7ZL3GJGY.js.map → chunk-2L2TNYQA.js.map} +0 -0
- /package/dist/{chunk-6MUKE253.js.map → chunk-3JANKWY2.js.map} +0 -0
- /package/dist/{chunk-VLUME72O.js.map → chunk-3L5VDONX.js.map} +0 -0
- /package/dist/{chunk-KI26QYWS.js.map → chunk-3OMFMSZ4.js.map} +0 -0
- /package/dist/{chunk-JQ42ERH3.js.map → chunk-44UME4JD.js.map} +0 -0
- /package/dist/{chunk-AYHDJMMJ.js.map → chunk-4CXUVBOD.js.map} +0 -0
- /package/dist/{chunk-Z3T5FWM6.js.map → chunk-4HNMJIUZ.js.map} +0 -0
- /package/dist/{chunk-MKJH2D4V.js.map → chunk-4NIOURHZ.js.map} +0 -0
- /package/dist/{chunk-T7K276XW.js.map → chunk-4YO2PDUC.js.map} +0 -0
- /package/dist/{chunk-AU27USPZ.js.map → chunk-5ZCCUM75.js.map} +0 -0
- /package/dist/{chunk-UTBIZ6W5.js.map → chunk-63NT2NZD.js.map} +0 -0
- /package/dist/{chunk-RRNIJ7YO.js.map → chunk-ALBTIOP3.js.map} +0 -0
- /package/dist/{chunk-UIG3CTXU.js.map → chunk-C5F36EGT.js.map} +0 -0
- /package/dist/{chunk-DWEW7I53.js.map → chunk-CJQPKHDO.js.map} +0 -0
- /package/dist/{chunk-RVSRZ57P.js.map → chunk-CNZV3UCM.js.map} +0 -0
- /package/dist/{chunk-LSZ6HI3U.js.map → chunk-EORL2V7P.js.map} +0 -0
- /package/dist/{chunk-EHUKDUNJ.js.map → chunk-EQJZ2GXX.js.map} +0 -0
- /package/dist/{chunk-UI45HNNQ.js.map → chunk-EVZUJLZH.js.map} +0 -0
- /package/dist/{chunk-5D5V4P7J.js.map → chunk-EX6ELNTN.js.map} +0 -0
- /package/dist/{chunk-AGRUEZQX.js.map → chunk-GNIYYXQX.js.map} +0 -0
- /package/dist/{chunk-ERXXU72V.js.map → chunk-GT3KUREW.js.map} +0 -0
- /package/dist/{chunk-ULI3NB4J.js.map → chunk-HT52LVYU.js.map} +0 -0
- /package/dist/{chunk-RCWQD32G.js.map → chunk-HWMQV4YD.js.map} +0 -0
- /package/dist/{chunk-MUCUSF6Y.js.map → chunk-I5YQ7AC5.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-YXUVNSDM.js.map → chunk-LBPYBBXX.js.map} +0 -0
- /package/dist/{chunk-6AJFOISA.js.map → chunk-LMD2J2JN.js.map} +0 -0
- /package/dist/{chunk-2Y2ARDXI.js.map → chunk-MD6QMSXQ.js.map} +0 -0
- /package/dist/{chunk-TNKBZIR5.js.map → chunk-MH4D37RT.js.map} +0 -0
- /package/dist/{chunk-U2MOKVPZ.js.map → chunk-MHL66TIL.js.map} +0 -0
- /package/dist/{chunk-GDR4RWF4.js.map → chunk-N5P2OY5O.js.map} +0 -0
- /package/dist/{chunk-BPAV2PIE.js.map → chunk-NIAXRF5E.js.map} +0 -0
- /package/dist/{chunk-BXVBNYQT.js.map → chunk-OA3TYOAY.js.map} +0 -0
- /package/dist/{chunk-DPO6I7OR.js.map → chunk-P5633SI2.js.map} +0 -0
- /package/dist/{chunk-AKDTLWWD.js.map → chunk-PJPYRXKJ.js.map} +0 -0
- /package/dist/{chunk-UH72CZAX.js.map → chunk-PZ7WTBSI.js.map} +0 -0
- /package/dist/{chunk-XSI4WZIX.js.map → chunk-QTUYNY3F.js.map} +0 -0
- /package/dist/{chunk-CWWWZRMN.js.map → chunk-RJAGFLAP.js.map} +0 -0
- /package/dist/{chunk-PJQRSOLE.js.map → chunk-SMARTMBW.js.map} +0 -0
- /package/dist/{chunk-ZLQGKBBE.js.map → chunk-SRE4CK6Y.js.map} +0 -0
- /package/dist/{chunk-LKJLUSYR.js.map → chunk-SRGOCF73.js.map} +0 -0
- /package/dist/{chunk-MQQADIRH.js.map → chunk-SSXKC635.js.map} +0 -0
- /package/dist/{chunk-S43GVNRB.js.map → chunk-SWAFQ343.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-5SMTFIYI.js.map → chunk-TLXZUE4T.js.map} +0 -0
- /package/dist/{chunk-5U3CSRV5.js.map → chunk-UAXKMJYA.js.map} +0 -0
- /package/dist/{chunk-G2V2V5UC.js.map → chunk-VHENFC2S.js.map} +0 -0
- /package/dist/{chunk-7XKIRMS4.js.map → chunk-VHYFFFZU.js.map} +0 -0
- /package/dist/{chunk-PAEWU7UC.js.map → chunk-WMIQOBHU.js.map} +0 -0
- /package/dist/{chunk-MKQ7IA6U.js.map → chunk-XBWS77S2.js.map} +0 -0
- /package/dist/{chunk-AAOAVXBF.js.map → chunk-XHUKX3HO.js.map} +0 -0
- /package/dist/{chunk-A3R3VO6G.js.map → chunk-XHVRFFOY.js.map} +0 -0
- /package/dist/{chunk-JNKFPFH6.js.map → chunk-XIOGNTUA.js.map} +0 -0
- /package/dist/{chunk-S2CQ73G4.js.map → chunk-YLB2QGAR.js.map} +0 -0
- /package/dist/{chunk-RE3NKV4Z.js.map → chunk-Z3HC36JK.js.map} +0 -0
- /package/dist/{chunk-V72WJIGN.js.map → chunk-ZWBXRP2V.js.map} +0 -0
- /package/dist/{chunk-SAPDMQTO.js.map → chunk-ZXDRQ2MV.js.map} +0 -0
- /package/dist/{cli-SGRXK4G2.js.map → cli-GKHHCDRV.js.map} +0 -0
- /package/dist/{diff-3ZGUWMX4.js.map → diff-NAL5334E.js.map} +0 -0
- /package/dist/{fork-AGFYDM5U.js.map → fork-QVFWYP2Z.js.map} +0 -0
- /package/dist/{history-VYAGUN2X.js.map → history-W5DQNAY3.js.map} +0 -0
- /package/dist/{install-skills-QX4OATOS.js.map → install-skills-RJPZOV37.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-4GZLAV4C.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/tree.ts"],"sourcesContent":["import fs from 'node:fs';\nimport { agentFor, sessionToolFor } from '../core/agents/index.js';\nimport chalk from 'chalk';\nimport type { CommandModule } from 'yargs';\nimport { ensureConfig } from '../core/platform/config.js';\nimport { resolveProjectTarget, getAllTargetNames, resolveFromCwd } from '../core/worktree/resolve.js';\nimport { openBaseCheckout, setupWorktree } from '../core/worktree/worktree.js';\nimport { ownsBranch } from '../core/worktree/own-checkout.js';\nimport { findSession, loadHistory } from '../core/sessions/history.js';\nimport { clearLaunchedUnsafeWhenIdle } from '../core/sessions/legacy-unsafe-io.js';\nimport { retiredUnsafeOption, warnRetiredUnsafe } from './shared/retired-unsafe.js';\nimport { keepingWarnings } from '../core/platform/report.js';\nimport { SETUP_WARNINGS } from '../core/worktree/setup-child.js';\nimport { leftoversOf, openInLeftovers } from '../core/archive/restore-leftovers.js';\nimport { attachSession } from './shared/attach-session.js';\nimport { openVSCode, launchAi } from '../core/platform/launch.js';\nimport { envArgs } from '../core/platform/env-delta.js';\nimport { parseBaseSpec, isEmptyBaseSpec, BaseSpecError } from '../core/git/base-spec.js';\nimport { resolvePrToStart } from '../core/pr/pr-start.js';\nimport { workOnPrPrompt } from '../core/pr/pr-ref.js';\n\nexport const treeCommand: CommandModule = {\n command: ['tree [target] [branch]', 't [target] [branch]'],\n describe: 'Create or switch to a worktree and launch the configured AI tool',\n builder: (yargs) =>\n yargs\n .showHelpOnFail(true)\n .positional('target', {\n describe: 'Project alias or group name',\n type: 'string',\n })\n .positional('branch', {\n describe: 'Branch name (e.g., feature/login). Omit to work on the base repo.',\n type: 'string',\n })\n .option('here', {\n describe: 'Infer target and branch from the current worktree directory',\n type: 'boolean',\n default: false,\n })\n .option('open', {\n describe: 'Open VS Code in the worktree after creation',\n type: 'boolean',\n default: false,\n })\n .option('unsafe', retiredUnsafeOption)\n .option('pull', {\n describe: 'Pull latest changes when switching into an existing worktree or the base repo. Use --no-pull to skip.',\n type: 'boolean',\n default: true,\n })\n .option('host', {\n describe:\n 'Run the AI session in the PTY host and attach this terminal to it (the default): it survives closing the tab, shows in `work web` — the same screen there and here — and restores after a reboot. Ctrl+] detaches. --no-host (or config `launchViaHost: false`) launches directly in this terminal instead.',\n type: 'boolean',\n })\n .option('fresh', {\n describe: 'Start a new AI conversation instead of continuing the previous one for this directory',\n type: 'boolean',\n default: false,\n })\n .option('base', {\n describe:\n 'Base branch to fork from instead of HEAD. Repeatable. Use a bare branch (--base dev) for all repos, or alias=branch (--base backend=dev --base frontend=feat/x) for per-repo bases in a group.',\n type: 'string',\n })\n .option('prompt', {\n describe: 'Initial prompt to send to the AI tool on startup',\n type: 'string',\n })\n .option('prompt-file', {\n describe: 'File containing the initial prompt (deleted after reading)',\n type: 'string',\n })\n .option('pr', {\n describe:\n \"Work on a pull request, on its branch (what you push lands in it): its link, or its number with <target>. Someone else's too; not one from a fork\",\n type: 'string',\n })\n .option('name', {\n describe: 'Name the session (shown instead of the branch; rename later with F2 in the dashboard)',\n type: 'string',\n })\n .option('account', {\n describe:\n 'The Claude account a new session runs on (a name from `work account list`; default: the configured default). An existing session keeps its own.',\n type: 'string',\n })\n .option('issue-key', {\n describe: 'Link a Jira issue key to this worktree session',\n type: 'string',\n hidden: true,\n })\n .option('repos', {\n describe: \"A new session's repos (comma-separated aliases) instead of its group's: made as a session folder (used by Fork…)\",\n type: 'string',\n hidden: true,\n })\n .option('setup-only', {\n describe: 'Create worktree without launching the AI tool (used by dashboard)',\n type: 'boolean',\n default: false,\n hidden: true,\n }),\n handler: async (argv) => {\n let targetName = argv.target as string | undefined;\n let branchName = argv.branch as string | undefined;\n const here = argv.here as boolean;\n const open = argv.open as boolean;\n warnRetiredUnsafe(argv);\n const pull = argv.pull as boolean;\n const fresh = argv.fresh as boolean;\n const setupOnly = argv['setup-only'] as boolean;\n let baseSpec;\n try {\n baseSpec = parseBaseSpec(argv.base as string | string[] | undefined);\n } catch (err) {\n if (err instanceof BaseSpecError) {\n console.error(err.message);\n process.exitCode = 1;\n return;\n }\n throw err;\n }\n const issueKey = argv['issue-key'] as string | undefined;\n const account = argv.account as string | undefined;\n const promptFile = argv['prompt-file'] as string | undefined;\n let initialPrompt = argv.prompt as string | undefined;\n\n // --prompt-file takes precedence: read and delete the temp file\n if (promptFile) {\n try {\n initialPrompt = fs.readFileSync(promptFile, 'utf-8');\n fs.unlinkSync(promptFile);\n } catch {\n // ignore — fall through to --prompt or no prompt\n }\n }\n\n const config = ensureConfig();\n // Via the host unless told otherwise: one Claude that the terminal and\n // the dashboard both show. A direct launch is invisible to work web.\n const viaHost = (argv.host as boolean | undefined) ?? config.launchViaHost ?? true;\n\n /**\n * Launch the AI tool, continuing the previous conversation for this\n * directory when there is one. `--continue` errors out (\"No conversation\n * found to continue\") in a directory the tool has never run in, so the flag\n * is gated on an existing transcript.\n */\n const launchTool = async (dir: string, port: number | undefined, sessionKey: { target: string; branch: string }): Promise<void> => {\n if (viaHost) {\n const session = findSession(loadHistory(), sessionKey.target, sessionKey.branch);\n if (session) {\n // The host decides --continue itself (the agent's own canResume\n // gate); `fresh` and the prompt ride along on the first spawn.\n process.exitCode = await attachSession(session, {\n fresh,\n initialPrompt,\n forwardEnv: true,\n });\n return;\n }\n console.log(chalk.yellow('Session not found in history — launching directly instead of via the PTY host.'));\n }\n // The session's agent: what to run, and whether it can resume here.\n const own = findSession(loadHistory(), sessionKey.target, sessionKey.branch);\n const agent = agentFor(config, own);\n const tool = agent.launch.tool(config);\n // The session's account: its conversations are in that account's folder, and the agent starts on it.\n const resume = !fresh && agent.launch.canResume(dir, { session: own });\n if (resume) {\n console.log(chalk.gray(`Continuing the previous ${tool.cmd} conversation (--fresh starts a new one).`));\n }\n // Started normally now: a launchedUnsafe from before the retirement no longer describes it — unless that agent\n // still runs in another terminal, which keeps the flag and its guards (legacy-unsafe.ts; remove next release).\n clearLaunchedUnsafeWhenIdle(sessionKey.target, sessionKey.branch);\n console.log(`Starting ${tool.cmd}...`);\n // With work's hooks for this process (--settings), never the user's settings' (agents/session-hooks.ts).\n launchAi(dir, sessionToolFor(tool), { initialPrompt, resume }, port, ...envArgs(agent.launch.env?.(own ?? null)));\n };\n\n // --pr: the PR's repo and branch, and a first prompt saying whose branch it is.\n const prArg = argv.pr as string | undefined;\n if (prArg !== undefined) {\n if (branchName || here || !isEmptyBaseSpec(baseSpec)) {\n console.error(\"--pr takes the PR's own branch: don't combine it with a branch, --here or --base.\");\n process.exitCode = 1;\n return;\n }\n const found = await resolvePrToStart(prArg, config, targetName);\n if (!found.ok) {\n console.error(found.error);\n process.exitCode = 1;\n return;\n }\n targetName = found.pr.alias;\n branchName = found.pr.branch;\n // The PR's context goes to a new session only (with your --prompt as what to do): back in\n // one, your --prompt goes as it is, and nothing re-sends the first message.\n if (!findSession(loadHistory(), targetName, branchName)) initialPrompt = workOnPrPrompt(found.pr, initialPrompt);\n console.log(\n chalk.cyan(`PR #${found.pr.number} by @${found.pr.author || '?'}: ${found.pr.title}, on its branch ${branchName} in ${targetName}`),\n );\n }\n\n // --here: infer target and branch from the current worktree directory\n if (here) {\n if (targetName) {\n console.error('Cannot combine --here with an explicit target.');\n process.exitCode = 1;\n return;\n }\n const inferred = resolveFromCwd(config, process.cwd(), loadHistory());\n if ('error' in inferred) {\n console.error(inferred.error);\n process.exitCode = 1;\n return;\n }\n targetName = inferred.target;\n branchName = inferred.isBaseRepo ? undefined : inferred.branch;\n console.log(chalk.cyan(`Resolved from current directory: ${targetName}${branchName ? ' @ ' + branchName : ' (base repo)'}`));\n } else if (!targetName) {\n console.error('Specify a target, or use --here to infer it from the current directory.');\n process.exitCode = 1;\n return;\n }\n\n // --base requires a branch name\n if (!isEmptyBaseSpec(baseSpec) && !branchName) {\n console.error('--base requires a branch name');\n console.log(chalk.yellow(`Usage: work tree ${targetName} <branch> --base <base>`));\n process.exitCode = 1;\n return;\n }\n\n // Resolve project target (for validation and base-repo handling)\n const target = resolveProjectTarget(targetName, config);\n if (!target) {\n const allNames = getAllTargetNames(config);\n console.error(`Project or group not found: ${targetName}`);\n console.log(chalk.yellow(`Available: ${allNames.join(', ')}`));\n console.log(chalk.yellow('Add a new project with: work config add <alias> <path>'));\n process.exitCode = 1;\n return;\n }\n\n // The branch the repo's own folder is on can't be checked out a second time: asking for it means that folder.\n if (branchName && isEmptyBaseSpec(baseSpec) && !target.isGroup && ownsBranch(targetName, branchName, config)) {\n console.log(chalk.gray(`${branchName} is the branch ${targetName}'s own folder is on: opening it there.`));\n branchName = undefined;\n }\n\n // No branch specified — work directly on the base repo\n if (!branchName) {\n if (target.isGroup) {\n console.error('Branch is required for group targets.');\n console.log(chalk.yellow(`Usage: work tree ${targetName} <branch>`));\n process.exitCode = 1;\n return;\n }\n\n console.log(chalk.cyan(`Working on base repo: ${targetName}`));\n const opened = await openBaseCheckout(targetName, config, {\n pull,\n issueKey,\n name: typeof argv.name === 'string' ? argv.name : undefined,\n account,\n });\n if (!opened.ok) {\n console.error(opened.error);\n process.exitCode = 1;\n return;\n }\n const { repoPath, branch: currentBranch } = opened;\n console.log(`Repo path: ${repoPath}`);\n if (opened.dropped.length) console.log(chalk.gray(`Replaced older entries for this checkout: ${opened.dropped.join(', ')}`));\n\n if (open) openVSCode(repoPath);\n if (!setupOnly) await launchTool(repoPath, undefined, { target: targetName, branch: currentBranch });\n return;\n }\n\n // Create/switch worktree via shared core logic\n const repos =\n typeof argv.repos === 'string'\n ? argv.repos\n .split(',')\n .map((a) => a.trim())\n .filter(Boolean)\n : [];\n const { value: result, warnings } = await keepingWarnings(() =>\n setupWorktree(targetName, branchName, config, baseSpec, issueKey, {\n pull,\n name: argv.name as string | undefined,\n ...(account ? { account } : {}),\n ...(repos.length ? { repos } : {}),\n }),\n );\n if (!result) {\n // Run by you (not work web's child, whose route says it): what keeps the old folder in use, by name.\n const left = setupOnly ? [] : leftoversOf(findSession(loadHistory(), targetName, branchName)?.paths ?? []);\n const open = await openInLeftovers(left);\n if (open.length) console.error(chalk.yellow(`Still open in its old folder: ${open.join(', ')}. Stop it and try again.`));\n process.exitCode = 1;\n return;\n }\n\n if (open) {\n for (const p of result.paths) {\n openVSCode(p);\n }\n }\n\n console.log(`Worktree path: ${result.launchDir}`);\n // work web's child: what it warned about, for the dashboard (it reads only this line).\n if (setupOnly) console.log(`${SETUP_WARNINGS}${JSON.stringify(warnings)}`);\n if (!setupOnly) {\n await launchTool(result.launchDir, result.port, { target: targetName, branch: branchName });\n }\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AAEf,OAAO,WAAW;AAmBX,IAAM,cAA6B;A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,MAAK,KAAK,IAAI,CAAC,0BAA0B,CAAC;AACvH,cAAQ,WAAW;AACnB;AAAA,IACF;AAEA,QAAI,MAAM;AACR,iBAAW,KAAK,OAAO,OAAO;AAC5B,mBAAW,CAAC;AAAA,MACd;AAAA,IACF;AAEA,YAAQ,IAAI,kBAAkB,OAAO,SAAS,EAAE;AAEhD,QAAI,UAAW,SAAQ,IAAI,GAAG,cAAc,GAAG,KAAK,UAAU,QAAQ,CAAC,EAAE;AACzE,QAAI,CAAC,WAAW;AACd,YAAM,WAAW,OAAO,WAAW,OAAO,MAAM,EAAE,QAAQ,YAAY,QAAQ,WAAW,CAAC;AAAA,IAC5F;AAAA,EACF;AACF;","names":["open"]}
|
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
updateSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZAAWSVTU.js";
|
|
5
|
+
import "./chunk-LMD2J2JN.js";
|
|
5
6
|
import {
|
|
6
7
|
sessionFromArgs,
|
|
7
8
|
sessionPositionals
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SMARTMBW.js";
|
|
9
10
|
import "./chunk-6AQRYLOB.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-AAOAVXBF.js";
|
|
12
|
-
import "./chunk-RVSRZ57P.js";
|
|
11
|
+
import "./chunk-XHUKX3HO.js";
|
|
13
12
|
import "./chunk-ZSHWP2VS.js";
|
|
13
|
+
import "./chunk-CNZV3UCM.js";
|
|
14
14
|
import "./chunk-HUXS3VAI.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-ZXDRQ2MV.js";
|
|
16
|
+
import "./chunk-CJQPKHDO.js";
|
|
17
|
+
import "./chunk-HT52LVYU.js";
|
|
18
18
|
import "./chunk-FGPXMAYU.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-SRGOCF73.js";
|
|
20
|
+
import "./chunk-GNIYYXQX.js";
|
|
21
|
+
import "./chunk-T5GJVUSL.js";
|
|
22
|
+
import "./chunk-XBWS77S2.js";
|
|
23
|
+
import "./chunk-4CXUVBOD.js";
|
|
24
|
+
import "./chunk-UN33JXAD.js";
|
|
24
25
|
import "./chunk-NEJVK5CF.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-ZS7ZXAXB.js";
|
|
26
|
+
import "./chunk-ALBTIOP3.js";
|
|
27
|
+
import "./chunk-H3WBTKPB.js";
|
|
28
|
+
import "./chunk-4HNMJIUZ.js";
|
|
29
|
+
import "./chunk-DOYJR2HF.js";
|
|
30
|
+
import "./chunk-HK6AZQ5Z.js";
|
|
31
|
+
import "./chunk-2L2TNYQA.js";
|
|
32
|
+
import "./chunk-IKGSTBTG.js";
|
|
33
|
+
import "./chunk-REPFZIPP.js";
|
|
34
|
+
import "./chunk-VHENFC2S.js";
|
|
35
|
+
import "./chunk-QOSAWNOU.js";
|
|
36
36
|
import "./chunk-D2J3AD6L.js";
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-5ZCCUM75.js";
|
|
38
|
+
import "./chunk-IAKOKZYW.js";
|
|
39
|
+
import "./chunk-F2ECTTSY.js";
|
|
39
40
|
|
|
40
41
|
// src/commands/update.ts
|
|
41
42
|
import chalk from "chalk";
|
|
@@ -70,4 +71,4 @@ var updateCommand = {
|
|
|
70
71
|
export {
|
|
71
72
|
updateCommand
|
|
72
73
|
};
|
|
73
|
-
//# sourceMappingURL=update-
|
|
74
|
+
//# sourceMappingURL=update-THIANISA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/update.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { CommandModule } from 'yargs';\nimport { updateSession } from '../core/stacks/session-update.js';\nimport { sessionFromArgs, sessionPositionals } from './shared/session-arg.js';\n\n/**\n * `work update` — the dashboard's Update from main / Update from <parent> /\n * Move onto main (session-update.ts): whichever the session needs.\n */\nexport const updateCommand: CommandModule = {\n command: 'update [target] [branch]',\n describe: \"Bring a session's branch up to date: from main, from the session it is stacked on, or onto main once that one merged\",\n builder: (yargs) => sessionPositionals(yargs),\n handler: async (argv) => {\n const s = sessionFromArgs(argv);\n if (!s) return;\n const r = await updateSession(s);\n if (!r.ok) {\n console.error(chalk.red(r.error));\n process.exitCode = 1;\n return;\n }\n const what = r.how === 'onto-main' ? `onto main (${r.base} merged)` : r.how === 'parent' ? `from ${r.base}` : 'from main';\n console.log(chalk.cyan(`Updating ${s.target} · ${s.branch} ${what}…`));\n for (const x of r.results) {\n if (!x.ok) console.log(chalk.red(` ${x.repo}: ${x.reason}`));\n else if (x.how === 'nothing') console.log(chalk.gray(` ${x.repo}: already up to date`));\n else\n console.log(\n chalk.green(\n ` ${x.repo}: ${x.how === 'rebase' ? 'rebased on' : 'merged'} ${x.base} (${x.commits} commit${x.commits === 1 ? '' : 's'})`,\n ),\n );\n }\n if (r.results.some((x) => !x.ok)) process.exitCode = 1;\n },\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/commands/update.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { CommandModule } from 'yargs';\nimport { updateSession } from '../core/stacks/session-update.js';\nimport { sessionFromArgs, sessionPositionals } from './shared/session-arg.js';\n\n/**\n * `work update` — the dashboard's Update from main / Update from <parent> /\n * Move onto main (session-update.ts): whichever the session needs.\n */\nexport const updateCommand: CommandModule = {\n command: 'update [target] [branch]',\n describe: \"Bring a session's branch up to date: from main, from the session it is stacked on, or onto main once that one merged\",\n builder: (yargs) => sessionPositionals(yargs),\n handler: async (argv) => {\n const s = sessionFromArgs(argv);\n if (!s) return;\n const r = await updateSession(s);\n if (!r.ok) {\n console.error(chalk.red(r.error));\n process.exitCode = 1;\n return;\n }\n const what = r.how === 'onto-main' ? `onto main (${r.base} merged)` : r.how === 'parent' ? `from ${r.base}` : 'from main';\n console.log(chalk.cyan(`Updating ${s.target} · ${s.branch} ${what}…`));\n for (const x of r.results) {\n if (!x.ok) console.log(chalk.red(` ${x.repo}: ${x.reason}`));\n else if (x.how === 'nothing') console.log(chalk.gray(` ${x.repo}: already up to date`));\n else\n console.log(\n chalk.green(\n ` ${x.repo}: ${x.how === 'rebase' ? 'rebased on' : 'merged'} ${x.base} (${x.commits} commit${x.commits === 1 ? '' : 's'})`,\n ),\n );\n }\n if (r.results.some((x) => !x.ok)) process.exitCode = 1;\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AASX,IAAM,gBAA+B;AAAA,EAC1C,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,CAAC,UAAU,mBAAmB,KAAK;AAAA,EAC5C,SAAS,OAAO,SAAS;AACvB,UAAM,IAAI,gBAAgB,IAAI;AAC9B,QAAI,CAAC,EAAG;AACR,UAAM,IAAI,MAAM,cAAc,CAAC;AAC/B,QAAI,CAAC,EAAE,IAAI;AACT,cAAQ,MAAM,MAAM,IAAI,EAAE,KAAK,CAAC;AAChC,cAAQ,WAAW;AACnB;AAAA,IACF;AACA,UAAM,OAAO,EAAE,QAAQ,cAAc,cAAc,EAAE,IAAI,aAAa,EAAE,QAAQ,WAAW,QAAQ,EAAE,IAAI,KAAK;AAC9G,YAAQ,IAAI,MAAM,KAAK,YAAY,EAAE,MAAM,SAAM,EAAE,MAAM,IAAI,IAAI,QAAG,CAAC;AACrE,eAAW,KAAK,EAAE,SAAS;AACzB,UAAI,CAAC,EAAE,GAAI,SAAQ,IAAI,MAAM,IAAI,KAAK,EAAE,IAAI,KAAK,EAAE,MAAM,EAAE,CAAC;AAAA,eACnD,EAAE,QAAQ,UAAW,SAAQ,IAAI,MAAM,KAAK,KAAK,EAAE,IAAI,sBAAsB,CAAC;AAAA;AAErF,gBAAQ;AAAA,UACN,MAAM;AAAA,YACJ,KAAK,EAAE,IAAI,KAAK,EAAE,QAAQ,WAAW,eAAe,QAAQ,IAAI,EAAE,IAAI,KAAK,EAAE,OAAO,UAAU,EAAE,YAAY,IAAI,KAAK,GAAG;AAAA,UAC1H;AAAA,QACF;AAAA,IACJ;AACA,QAAI,EAAE,QAAQ,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAG,SAAQ,WAAW;AAAA,EACvD;AACF;","names":[]}
|
|
@@ -3,29 +3,30 @@ import {
|
|
|
3
3
|
buildUsage,
|
|
4
4
|
realUsageDeps,
|
|
5
5
|
restoreAgentUsage
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-C5F36EGT.js";
|
|
7
|
+
import "./chunk-I5YQ7AC5.js";
|
|
8
8
|
import {
|
|
9
9
|
formatTokens,
|
|
10
10
|
resetPhrase
|
|
11
11
|
} from "./chunk-UVZITL47.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-UN33JXAD.js";
|
|
13
13
|
import "./chunk-NEJVK5CF.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-ALBTIOP3.js";
|
|
15
15
|
import {
|
|
16
16
|
knownAgents
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-H3WBTKPB.js";
|
|
18
|
+
import "./chunk-4HNMJIUZ.js";
|
|
19
|
+
import "./chunk-DOYJR2HF.js";
|
|
20
|
+
import "./chunk-HK6AZQ5Z.js";
|
|
21
|
+
import "./chunk-2L2TNYQA.js";
|
|
22
|
+
import "./chunk-IKGSTBTG.js";
|
|
23
|
+
import "./chunk-REPFZIPP.js";
|
|
24
|
+
import "./chunk-VHENFC2S.js";
|
|
25
|
+
import "./chunk-QOSAWNOU.js";
|
|
26
26
|
import "./chunk-D2J3AD6L.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-5ZCCUM75.js";
|
|
28
|
+
import "./chunk-IAKOKZYW.js";
|
|
29
|
+
import "./chunk-F2ECTTSY.js";
|
|
29
30
|
|
|
30
31
|
// src/commands/usage.ts
|
|
31
32
|
import chalk from "chalk";
|
|
@@ -84,4 +85,4 @@ export {
|
|
|
84
85
|
usageCommand,
|
|
85
86
|
usageLines
|
|
86
87
|
};
|
|
87
|
-
//# sourceMappingURL=usage-
|
|
88
|
+
//# sourceMappingURL=usage-CZZOI34H.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/usage.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { CommandModule } from 'yargs';\nimport { buildUsage, realUsageDeps } from '../core/usage/usage-source.js';\nimport { formatTokens, resetPhrase } from '../core/usage/usage.js';\nimport type { TokenTotals, UsageWire } from '../core/api-types.js';\nimport { knownAgents } from '../core/agents/index.js';\nimport { restoreAgentUsage } from '../core/usage/usage-setup.js';\n\n/**\n * `work usage` — each agent's plan limits (as its status line last reported\n * them) and the tokens work saw in the sessions' transcripts (core/usage/).\n */\n\nconst totals = (t: TokenTotals) => `${formatTokens(t.input)} in · ${formatTokens(t.cached)} cached · ${formatTokens(t.output)} out`;\n\n/** The wire as the lines `work usage` prints. */\nexport function usageLines(w: UsageWire, now = Date.now()): string[] {\n const lines: string[] = [];\n for (const a of w.agents) {\n lines.push(chalk.bold(a.name));\n const readings = a.accounts.filter((acc) => acc.windows.length > 0);\n if (readings.length === 0) lines.push(chalk.gray(' no reading yet — its next session records one'));\n for (const acc of readings) {\n if (a.accounts.length > 1) lines.push(chalk.gray(` account ${acc.account}${acc.isDefault ? ' (default)' : ''}`));\n for (const win of acc.windows) {\n const pct = `${Math.round(win.usedPercent)}%`;\n lines.push(` ${win.label.padEnd(14)} ${pct.padStart(4)} ${chalk.gray(resetPhrase(win.resetsAt, now))}`);\n }\n }\n }\n if (w.agents.length === 0) lines.push(chalk.gray('No agent reports its usage limits.'));\n lines.push('', chalk.bold('Tokens'), ` today ${totals(w.tokens.today)}`, ` this week ${totals(w.tokens.week)}`);\n const isZero = (t: TokenTotals) => t.input + t.cached + t.output === 0;\n for (const m of w.tokens.byModel) {\n // A model unused today shows only its week.\n const parts = [isZero(m.today) ? '' : `${totals(m.today)} today`, isZero(m.week) ? '' : `${totals(m.week)} this week`].filter(Boolean);\n if (parts.length > 0) lines.push(chalk.gray(` ${m.model}: ${parts.join(' · ')}`));\n }\n if (w.tokens.topSessions.length > 0) {\n lines.push('', chalk.bold('Top sessions this week'));\n for (const s of w.tokens.topSessions) lines.push(` ${formatTokens(s.week.input + s.week.output).padStart(7)} ${s.label}`);\n }\n return lines;\n}\n\nexport const usageCommand: CommandModule = {\n command: 'usage',\n describe: \"Plan limits (5-hour, weekly) as the agent's status line last reported them, and the tokens used today and this week\",\n builder: (yargs) =>\n yargs\n .option('json', { type: 'boolean', describe: 'Print the same data the dashboard shows, as JSON' })\n .option('restore', {\n type: 'boolean',\n describe:\n 'Give each agent back the setting work reads its limits from (Claude Code: its own status line). work web sets it up again unless config usage.statusLine is false',\n })\n // Its first name, from before it covered every agent.\n .option('restore-statusline', { type: 'boolean', hidden: true }),\n handler: async (argv) => {\n if (argv.restore || argv['restore-statusline']) {\n const done = await restoreAgentUsage(knownAgents());\n if (done.length === 0) console.log('No agent has a usage setting to give back.');\n for (const d of done) console.log(`${d.name}: ${d.message}`);\n if (done.some((d) => !d.ok)) process.exitCode = 1;\n return;\n }\n const wire = await buildUsage(realUsageDeps());\n if (argv.json) {\n console.log(JSON.stringify(wire, null, 2));\n return;\n }\n for (const l of usageLines(wire)) console.log(l);\n },\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/commands/usage.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { CommandModule } from 'yargs';\nimport { buildUsage, realUsageDeps } from '../core/usage/usage-source.js';\nimport { formatTokens, resetPhrase } from '../core/usage/usage.js';\nimport type { TokenTotals, UsageWire } from '../core/api-types.js';\nimport { knownAgents } from '../core/agents/index.js';\nimport { restoreAgentUsage } from '../core/usage/usage-setup.js';\n\n/**\n * `work usage` — each agent's plan limits (as its status line last reported\n * them) and the tokens work saw in the sessions' transcripts (core/usage/).\n */\n\nconst totals = (t: TokenTotals) => `${formatTokens(t.input)} in · ${formatTokens(t.cached)} cached · ${formatTokens(t.output)} out`;\n\n/** The wire as the lines `work usage` prints. */\nexport function usageLines(w: UsageWire, now = Date.now()): string[] {\n const lines: string[] = [];\n for (const a of w.agents) {\n lines.push(chalk.bold(a.name));\n const readings = a.accounts.filter((acc) => acc.windows.length > 0);\n if (readings.length === 0) lines.push(chalk.gray(' no reading yet — its next session records one'));\n for (const acc of readings) {\n if (a.accounts.length > 1) lines.push(chalk.gray(` account ${acc.account}${acc.isDefault ? ' (default)' : ''}`));\n for (const win of acc.windows) {\n const pct = `${Math.round(win.usedPercent)}%`;\n lines.push(` ${win.label.padEnd(14)} ${pct.padStart(4)} ${chalk.gray(resetPhrase(win.resetsAt, now))}`);\n }\n }\n }\n if (w.agents.length === 0) lines.push(chalk.gray('No agent reports its usage limits.'));\n lines.push('', chalk.bold('Tokens'), ` today ${totals(w.tokens.today)}`, ` this week ${totals(w.tokens.week)}`);\n const isZero = (t: TokenTotals) => t.input + t.cached + t.output === 0;\n for (const m of w.tokens.byModel) {\n // A model unused today shows only its week.\n const parts = [isZero(m.today) ? '' : `${totals(m.today)} today`, isZero(m.week) ? '' : `${totals(m.week)} this week`].filter(Boolean);\n if (parts.length > 0) lines.push(chalk.gray(` ${m.model}: ${parts.join(' · ')}`));\n }\n if (w.tokens.topSessions.length > 0) {\n lines.push('', chalk.bold('Top sessions this week'));\n for (const s of w.tokens.topSessions) lines.push(` ${formatTokens(s.week.input + s.week.output).padStart(7)} ${s.label}`);\n }\n return lines;\n}\n\nexport const usageCommand: CommandModule = {\n command: 'usage',\n describe: \"Plan limits (5-hour, weekly) as the agent's status line last reported them, and the tokens used today and this week\",\n builder: (yargs) =>\n yargs\n .option('json', { type: 'boolean', describe: 'Print the same data the dashboard shows, as JSON' })\n .option('restore', {\n type: 'boolean',\n describe:\n 'Give each agent back the setting work reads its limits from (Claude Code: its own status line). work web sets it up again unless config usage.statusLine is false',\n })\n // Its first name, from before it covered every agent.\n .option('restore-statusline', { type: 'boolean', hidden: true }),\n handler: async (argv) => {\n if (argv.restore || argv['restore-statusline']) {\n const done = await restoreAgentUsage(knownAgents());\n if (done.length === 0) console.log('No agent has a usage setting to give back.');\n for (const d of done) console.log(`${d.name}: ${d.message}`);\n if (done.some((d) => !d.ok)) process.exitCode = 1;\n return;\n }\n const wire = await buildUsage(realUsageDeps());\n if (argv.json) {\n console.log(JSON.stringify(wire, null, 2));\n return;\n }\n for (const l of usageLines(wire)) console.log(l);\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AAalB,IAAM,SAAS,CAAC,MAAmB,GAAG,aAAa,EAAE,KAAK,CAAC,YAAS,aAAa,EAAE,MAAM,CAAC,gBAAa,aAAa,EAAE,MAAM,CAAC;AAGtH,SAAS,WAAW,GAAc,MAAM,KAAK,IAAI,GAAa;AACnE,QAAM,QAAkB,CAAC;AACzB,aAAW,KAAK,EAAE,QAAQ;AACxB,UAAM,KAAK,MAAM,KAAK,EAAE,IAAI,CAAC;AAC7B,UAAM,WAA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";
|
|
7
7
|
import {
|
|
8
8
|
launchFor
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4CXUVBOD.js";
|
|
10
10
|
import {
|
|
11
11
|
READ_ONLY_MIN_VERSION
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-4HNMJIUZ.js";
|
|
13
|
+
import "./chunk-2L2TNYQA.js";
|
|
14
|
+
import "./chunk-IKGSTBTG.js";
|
|
15
15
|
import {
|
|
16
16
|
killTreeAsync
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-VHENFC2S.js";
|
|
18
18
|
import {
|
|
19
|
+
findOnPath,
|
|
19
20
|
spawn_default
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import {
|
|
22
|
-
findOnPath
|
|
23
|
-
} from "./chunk-ZS7ZXAXB.js";
|
|
21
|
+
} from "./chunk-QOSAWNOU.js";
|
|
24
22
|
import "./chunk-D2J3AD6L.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-5ZCCUM75.js";
|
|
24
|
+
import "./chunk-IAKOKZYW.js";
|
|
25
|
+
import "./chunk-F2ECTTSY.js";
|
|
27
26
|
|
|
28
27
|
// src/core/agents/claude/version.ts
|
|
29
28
|
import fs from "fs";
|
|
@@ -114,4 +113,4 @@ export {
|
|
|
114
113
|
parseClaudeVersion,
|
|
115
114
|
runVersion
|
|
116
115
|
};
|
|
117
|
-
//# sourceMappingURL=version-
|
|
116
|
+
//# sourceMappingURL=version-2YUMQ4EN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/agents/claude/version.ts"],"sourcesContent":["import fs from 'node:fs';\nimport os from 'node:os';\nimport { findOnPath } from '../../platform/find-on-path.js';\nimport { launchFor } from '../../platform/batch-launch.js';\nimport spawn from '../../platform/spawn.js';\nimport { killTreeAsync } from '../../platform/process.js';\nimport { installTime } from '../../pty/agent-restart.js';\nimport { READ_ONLY_MIN_VERSION } from './internal.js';\n\n/**\n * Which Claude Code is installed, for the read-only review run (internal.ts, `internalClaudeReadOnlySpawn`): its\n * isolation rests on flags measured on one version — `--restricted`, `--setting-sources user`,\n * CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD. An older Claude Code may not know them, or not keep them as measured,\n * so below that version (or one that can't be told) the checkout run is skipped and the Reviews AI step reads the diff\n * alone (review-queue.ts says why in Activity).\n */\n\n/** How long `claude --version` may take. */\nexport const VERSION_TIMEOUT_MS = 10_000;\n\n/** How long an answer is kept even when nothing about the binary seems to have changed: a backstop for an update the\n * stamp can't see. */\nexport const VERSION_TTL_MS = 10 * 60_000;\n\n/** `2.1.317 (Claude Code)` → [2, 1, 317]; null when there's no version in it. Pure. */\nexport function parseClaudeVersion(text: string): [number, number, number] | null {\n const m = /(\\d+)\\.(\\d+)\\.(\\d+)/.exec(text);\n return m ? [Number(m[1]), Number(m[2]), Number(m[3])] : null;\n}\n\n/** a ≥ b, part by part. Pure. */\nexport function atLeast(a: [number, number, number], b: [number, number, number]): boolean {\n for (let i = 0; i < 3; i++) if (a[i] !== b[i]) return a[i] > b[i];\n return true;\n}\n\nexport interface VersionIo {\n /** The file `claude` runs (null: not on PATH). */\n find: () => string | null;\n /** What identifies the installed binary (`binaryStamp`; null: can't be read — then nothing is remembered). */\n stamp: (file: string) => string | null;\n /** `claude --version`'s output (null: it failed or timed out). */\n version: (file: string) => Promise<string | null>;\n /** The clock (for the TTL). */\n now?: () => number;\n}\n\n/**\n * The file `claude` really runs (links followed: `~/.local/bin/claude` → `versions/2.1.296`), when it was installed\n * (`installTime`: npm unpacks every file dated 1985, so its mtime alone never moves on an npm update) and its size:\n * an update changes at least one. Null when it can't be read.\n */\nexport function binaryStamp(file: string): string | null {\n try {\n const real = fs.realpathSync(file);\n const st = fs.statSync(real);\n return `${real}|${installTime(st)}|${st.size}`;\n } catch {\n return null;\n }\n}\n\n/** `<file> --version`, with a timeout: what it printed, or null. */\nexport function runVersion(file: string): Promise<string | null> {\n return new Promise((resolve) => {\n const launch = launchFor(file, ['--version']);\n if ('refused' in launch) return resolve(null);\n let out = '';\n let settled = false;\n const done = (v: string | null) => {\n if (settled) return;\n settled = true;\n clearTimeout(timer);\n resolve(v);\n };\n const child = spawn(launch.cmd, launch.args, { cwd: os.tmpdir(), windowsHide: true, stdio: ['ignore', 'pipe', 'ignore'] });\n const timer = setTimeout(() => {\n // A .cmd shim runs under cmd.exe: the tree goes, not only the shell.\n if (child.pid) void killTreeAsync(child.pid);\n else child.kill();\n done(null);\n }, VERSION_TIMEOUT_MS);\n child.stdout?.on('data', (d: Buffer) => (out += d.toString()));\n child.on('error', () => done(null));\n child.on('close', (code) => done(code === 0 ? out : null));\n });\n}\n\nconst realIo: VersionIo = {\n find: () => findOnPath('claude'),\n stamp: binaryStamp,\n version: runVersion,\n};\n\n/** Asked once per binary (its stamp), for at most VERSION_TTL_MS: an update of Claude Code is asked again. */\nconst cache = new Map<string, { at: number; answer: Promise<{ ok: boolean; why?: string }> }>();\n\n/**\n * Whether the installed Claude Code may run the read-only review: at least READ_ONLY_MIN_VERSION. Unknown — not on\n * PATH, `--version` failing or saying nothing parseable — is no.\n */\nexport function claudeReadOnlyAvailable(io: VersionIo = realIo): Promise<{ ok: boolean; why?: string }> {\n const file = io.find();\n if (!file) return Promise.resolve({ ok: false, why: \"Claude Code's version can't be told (claude isn't on PATH)\" });\n const stamp = io.stamp(file);\n const now = io.now ?? Date.now;\n const key = stamp ? `${file}|${stamp}` : null;\n const known = key ? cache.get(key) : undefined;\n if (known && now() - known.at < VERSION_TTL_MS) return known.answer;\n const asked = io.version(file).then((text): { ok: boolean; why?: string } => {\n const v = text ? parseClaudeVersion(text) : null;\n if (!v) return { ok: false, why: \"Claude Code's version can't be told (claude --version gave none)\" };\n const min = parseClaudeVersion(READ_ONLY_MIN_VERSION)!;\n return atLeast(v, min)\n ? { ok: true }\n : {\n ok: false,\n why: `Claude Code ${v.join('.')} is older than ${READ_ONLY_MIN_VERSION}, the version its read-only flags were measured on`,\n };\n });\n // A binary that can't be identified isn't remembered at all, and a failure to ask not for good: the next review\n // asks again (the binary may be fine a moment later).\n if (!key) return asked;\n const entry = { at: now(), answer: asked };\n cache.set(key, entry);\n void asked.then((r) => {\n if (!r.ok && r.why?.includes(\"can't be told\") && cache.get(key) === entry) cache.delete(key);\n });\n return asked;\n}\n\n/** For tests: forget what was asked. */\nexport function forgetClaudeVersions(): void {\n cache.clear();\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/core/agents/claude/version.ts"],"sourcesContent":["import fs from 'node:fs';\nimport os from 'node:os';\nimport { findOnPath } from '../../platform/find-on-path.js';\nimport { launchFor } from '../../platform/batch-launch.js';\nimport spawn from '../../platform/spawn.js';\nimport { killTreeAsync } from '../../platform/process.js';\nimport { installTime } from '../../pty/agent-restart.js';\nimport { READ_ONLY_MIN_VERSION } from './internal.js';\n\n/**\n * Which Claude Code is installed, for the read-only review run (internal.ts, `internalClaudeReadOnlySpawn`): its\n * isolation rests on flags measured on one version — `--restricted`, `--setting-sources user`,\n * CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD. An older Claude Code may not know them, or not keep them as measured,\n * so below that version (or one that can't be told) the checkout run is skipped and the Reviews AI step reads the diff\n * alone (review-queue.ts says why in Activity).\n */\n\n/** How long `claude --version` may take. */\nexport const VERSION_TIMEOUT_MS = 10_000;\n\n/** How long an answer is kept even when nothing about the binary seems to have changed: a backstop for an update the\n * stamp can't see. */\nexport const VERSION_TTL_MS = 10 * 60_000;\n\n/** `2.1.317 (Claude Code)` → [2, 1, 317]; null when there's no version in it. Pure. */\nexport function parseClaudeVersion(text: string): [number, number, number] | null {\n const m = /(\\d+)\\.(\\d+)\\.(\\d+)/.exec(text);\n return m ? [Number(m[1]), Number(m[2]), Number(m[3])] : null;\n}\n\n/** a ≥ b, part by part. Pure. */\nexport function atLeast(a: [number, number, number], b: [number, number, number]): boolean {\n for (let i = 0; i < 3; i++) if (a[i] !== b[i]) return a[i] > b[i];\n return true;\n}\n\nexport interface VersionIo {\n /** The file `claude` runs (null: not on PATH). */\n find: () => string | null;\n /** What identifies the installed binary (`binaryStamp`; null: can't be read — then nothing is remembered). */\n stamp: (file: string) => string | null;\n /** `claude --version`'s output (null: it failed or timed out). */\n version: (file: string) => Promise<string | null>;\n /** The clock (for the TTL). */\n now?: () => number;\n}\n\n/**\n * The file `claude` really runs (links followed: `~/.local/bin/claude` → `versions/2.1.296`), when it was installed\n * (`installTime`: npm unpacks every file dated 1985, so its mtime alone never moves on an npm update) and its size:\n * an update changes at least one. Null when it can't be read.\n */\nexport function binaryStamp(file: string): string | null {\n try {\n const real = fs.realpathSync(file);\n const st = fs.statSync(real);\n return `${real}|${installTime(st)}|${st.size}`;\n } catch {\n return null;\n }\n}\n\n/** `<file> --version`, with a timeout: what it printed, or null. */\nexport function runVersion(file: string): Promise<string | null> {\n return new Promise((resolve) => {\n const launch = launchFor(file, ['--version']);\n if ('refused' in launch) return resolve(null);\n let out = '';\n let settled = false;\n const done = (v: string | null) => {\n if (settled) return;\n settled = true;\n clearTimeout(timer);\n resolve(v);\n };\n const child = spawn(launch.cmd, launch.args, { cwd: os.tmpdir(), windowsHide: true, stdio: ['ignore', 'pipe', 'ignore'] });\n const timer = setTimeout(() => {\n // A .cmd shim runs under cmd.exe: the tree goes, not only the shell.\n if (child.pid) void killTreeAsync(child.pid);\n else child.kill();\n done(null);\n }, VERSION_TIMEOUT_MS);\n child.stdout?.on('data', (d: Buffer) => (out += d.toString()));\n child.on('error', () => done(null));\n child.on('close', (code) => done(code === 0 ? out : null));\n });\n}\n\nconst realIo: VersionIo = {\n find: () => findOnPath('claude'),\n stamp: binaryStamp,\n version: runVersion,\n};\n\n/** Asked once per binary (its stamp), for at most VERSION_TTL_MS: an update of Claude Code is asked again. */\nconst cache = new Map<string, { at: number; answer: Promise<{ ok: boolean; why?: string }> }>();\n\n/**\n * Whether the installed Claude Code may run the read-only review: at least READ_ONLY_MIN_VERSION. Unknown — not on\n * PATH, `--version` failing or saying nothing parseable — is no.\n */\nexport function claudeReadOnlyAvailable(io: VersionIo = realIo): Promise<{ ok: boolean; why?: string }> {\n const file = io.find();\n if (!file) return Promise.resolve({ ok: false, why: \"Claude Code's version can't be told (claude isn't on PATH)\" });\n const stamp = io.stamp(file);\n const now = io.now ?? Date.now;\n const key = stamp ? `${file}|${stamp}` : null;\n const known = key ? cache.get(key) : undefined;\n if (known && now() - known.at < VERSION_TTL_MS) return known.answer;\n const asked = io.version(file).then((text): { ok: boolean; why?: string } => {\n const v = text ? parseClaudeVersion(text) : null;\n if (!v) return { ok: false, why: \"Claude Code's version can't be told (claude --version gave none)\" };\n const min = parseClaudeVersion(READ_ONLY_MIN_VERSION)!;\n return atLeast(v, min)\n ? { ok: true }\n : {\n ok: false,\n why: `Claude Code ${v.join('.')} is older than ${READ_ONLY_MIN_VERSION}, the version its read-only flags were measured on`,\n };\n });\n // A binary that can't be identified isn't remembered at all, and a failure to ask not for good: the next review\n // asks again (the binary may be fine a moment later).\n if (!key) return asked;\n const entry = { at: now(), answer: asked };\n cache.set(key, entry);\n void asked.then((r) => {\n if (!r.ok && r.why?.includes(\"can't be told\") && cache.get(key) === entry) cache.delete(key);\n });\n return asked;\n}\n\n/** For tests: forget what was asked. */\nexport function forgetClaudeVersions(): void {\n cache.clear();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,QAAQ;AAiBR,IAAM,qBAAqB;AAI3B,IAAM,iBAAiB,KAAK;AAG5B,SAAS,mBAAmB,MAA+C;AAChF,QAAM,IAAI,sBAAsB,KAAK,IAAI;AACzC,SAAO,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI;AAC1D;AAGO,SAAS,QAAQ,GA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!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
cliWaitDeps
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-N5P2OY5O.js";
|
|
5
5
|
import {
|
|
6
6
|
parseDuration,
|
|
7
7
|
waitForTurn
|
|
@@ -9,30 +9,31 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
sessionFromArgs,
|
|
11
11
|
sessionPositionals
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SMARTMBW.js";
|
|
13
13
|
import "./chunk-6AQRYLOB.js";
|
|
14
14
|
import "./chunk-FZHFD2AY.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-RVSRZ57P.js";
|
|
15
|
+
import "./chunk-XHUKX3HO.js";
|
|
17
16
|
import "./chunk-ZSHWP2VS.js";
|
|
17
|
+
import "./chunk-CNZV3UCM.js";
|
|
18
18
|
import "./chunk-HUXS3VAI.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-UN33JXAD.js";
|
|
20
20
|
import "./chunk-NEJVK5CF.js";
|
|
21
21
|
import {
|
|
22
22
|
sessionIdFor
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-ALBTIOP3.js";
|
|
24
|
+
import "./chunk-H3WBTKPB.js";
|
|
25
|
+
import "./chunk-4HNMJIUZ.js";
|
|
26
|
+
import "./chunk-DOYJR2HF.js";
|
|
27
|
+
import "./chunk-HK6AZQ5Z.js";
|
|
28
|
+
import "./chunk-2L2TNYQA.js";
|
|
29
|
+
import "./chunk-IKGSTBTG.js";
|
|
30
|
+
import "./chunk-REPFZIPP.js";
|
|
31
|
+
import "./chunk-VHENFC2S.js";
|
|
32
|
+
import "./chunk-QOSAWNOU.js";
|
|
33
33
|
import "./chunk-D2J3AD6L.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-5ZCCUM75.js";
|
|
35
|
+
import "./chunk-IAKOKZYW.js";
|
|
36
|
+
import "./chunk-F2ECTTSY.js";
|
|
36
37
|
|
|
37
38
|
// src/commands/wait.ts
|
|
38
39
|
import chalk from "chalk";
|
|
@@ -63,4 +64,4 @@ var waitCommand = {
|
|
|
63
64
|
export {
|
|
64
65
|
waitCommand
|
|
65
66
|
};
|
|
66
|
-
//# sourceMappingURL=wait-
|
|
67
|
+
//# sourceMappingURL=wait-QBBM7MR5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/wait.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { CommandModule } from 'yargs';\nimport { sessionIdFor } from '../core/sessions/session-id.js';\nimport { parseDuration, waitForTurn } from '../core/sessions/session-control.js';\nimport { sessionFromArgs, sessionPositionals } from './shared/session-arg.js';\nimport { cliWaitDeps } from './shared/turn-wait.js';\n\n/** `work wait` — block until a session's agent isn't working: its turn ended, or it asks you something (session-control.ts). */\nexport const waitCommand: CommandModule = {\n command: 'wait [target] [branch]',\n describe: \"Wait until a session's agent finishes its turn or asks you something (default: the session for this folder)\",\n builder: (yargs) =>\n sessionPositionals(yargs)\n .option('timeout', { type: 'string', default: '15m', describe: 'Give up after this long (90s, 15m, 1h)' })\n .option('json', { type: 'boolean', default: false, describe: 'Print { state, since, summary } as JSON' }),\n handler: async (argv) => {\n const s = sessionFromArgs(argv);\n if (!s) return;\n const timeoutMs = parseDuration(String(argv.timeout));\n if (timeoutMs === null) {\n console.error(chalk.red(`--timeout: not a duration: ${String(argv.timeout)} (try 90s, 15m, 1h)`));\n process.exitCode = 1;\n return;\n }\n const r = await waitForTurn(sessionIdFor(s), cliWaitDeps, { timeoutMs });\n if (argv.json) process.stdout.write(JSON.stringify(r.ok ? r.status : { timeout: true, ...(r.status ?? {}) }, null, 2) + '\\n');\n if (!r.ok) {\n if (!argv.json) console.error(chalk.yellow(`Still ${r.status?.state ?? 'not reporting'} after ${String(argv.timeout)}.`));\n process.exitCode = 2;\n return;\n }\n if (!argv.json)\n console.log(`${r.status.state === 'needs_input' ? 'Waiting for you' : 'Done'}${r.status.summary ? `: ${r.status.summary}` : ''}`);\n },\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/commands/wait.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { CommandModule } from 'yargs';\nimport { sessionIdFor } from '../core/sessions/session-id.js';\nimport { parseDuration, waitForTurn } from '../core/sessions/session-control.js';\nimport { sessionFromArgs, sessionPositionals } from './shared/session-arg.js';\nimport { cliWaitDeps } from './shared/turn-wait.js';\n\n/** `work wait` — block until a session's agent isn't working: its turn ended, or it asks you something (session-control.ts). */\nexport const waitCommand: CommandModule = {\n command: 'wait [target] [branch]',\n describe: \"Wait until a session's agent finishes its turn or asks you something (default: the session for this folder)\",\n builder: (yargs) =>\n sessionPositionals(yargs)\n .option('timeout', { type: 'string', default: '15m', describe: 'Give up after this long (90s, 15m, 1h)' })\n .option('json', { type: 'boolean', default: false, describe: 'Print { state, since, summary } as JSON' }),\n handler: async (argv) => {\n const s = sessionFromArgs(argv);\n if (!s) return;\n const timeoutMs = parseDuration(String(argv.timeout));\n if (timeoutMs === null) {\n console.error(chalk.red(`--timeout: not a duration: ${String(argv.timeout)} (try 90s, 15m, 1h)`));\n process.exitCode = 1;\n return;\n }\n const r = await waitForTurn(sessionIdFor(s), cliWaitDeps, { timeoutMs });\n if (argv.json) process.stdout.write(JSON.stringify(r.ok ? r.status : { timeout: true, ...(r.status ?? {}) }, null, 2) + '\\n');\n if (!r.ok) {\n if (!argv.json) console.error(chalk.yellow(`Still ${r.status?.state ?? 'not reporting'} after ${String(argv.timeout)}.`));\n process.exitCode = 2;\n return;\n }\n if (!argv.json)\n console.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AAE,EAAE;AAAA,EACpI;AACF;","names":[]}
|
package/dist/wd-bin.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
run
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-473UMEVN.js";
|
|
5
5
|
import {
|
|
6
6
|
consoleReporter
|
|
7
7
|
} from "./chunk-S5HJT7CM.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-ZS7ZXAXB.js";
|
|
8
|
+
import "./chunk-3OMFMSZ4.js";
|
|
9
|
+
import "./chunk-IPHADNF5.js";
|
|
10
|
+
import "./chunk-JYWX2N5W.js";
|
|
11
|
+
import "./chunk-IKGSTBTG.js";
|
|
12
|
+
import "./chunk-QOSAWNOU.js";
|
|
14
13
|
import "./chunk-D2J3AD6L.js";
|
|
15
14
|
import {
|
|
16
15
|
withReporter
|
|
17
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5ZCCUM75.js";
|
|
18
17
|
import {
|
|
19
18
|
debug,
|
|
20
19
|
installConsoleLogger
|
|
21
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-IAKOKZYW.js";
|
|
21
|
+
import "./chunk-F2ECTTSY.js";
|
|
22
22
|
|
|
23
23
|
// src/wd-bin.ts
|
|
24
24
|
import chalk from "chalk";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./index-
|
|
1
|
+
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./index-1hFrx0fV.js";var l=r(t(),1),u=2e3,d=20,f=class{sentAt=null;samples=[];shownSamples=[];open=null;keySent(e){let t=this.open;return this.open=null,this.sentAt===null&&(this.sentAt=e),t?{arrived:t.arrived,shown:null}:null}output(e){if(this.sentAt===null)return null;let t=e-this.sentAt,n=this.sentAt;return this.sentAt=null,t<0||t>u?null:(p(this.samples,t),this.open={sentAt:n,arrived:t},t)}rendered(e){let t=this.open;if(!t)return null;this.open=null;let n=e-t.sentAt;return n<0||n>u?{arrived:t.arrived,shown:null}:(p(this.shownSamples,n),{arrived:t.arrived,shown:n})}median(){return this.samples.length?m(this.samples).median:null}reading(){return this.samples.length?{arrived:m(this.samples),shown:this.shownSamples.length?m(this.shownSamples):null}:null}};function p(e,t){e.push(t),e.length>d&&e.shift()}function m(e){let t=[...e].sort((e,t)=>e-t),n=t.length>>1;return{median:t.length%2?t[n]:(t[n-1]+t[n])/2,worst:t[Math.min(t.length-1,Math.ceil(t.length*.9)-1)]}}function h(e,t,n=null){let r=t!==`webgl`;if(e===null&&!r)return null;let i=e=>`${Math.round(e)} ms`,a=e?.shown??e?.arrived??null;return{text:[a&&`⌁ ${i(a.median)}${a.worst>a.median*1.5?` (${i(a.worst)})`:``}`,r&&`DOM`].filter(Boolean).join(` · `),title:[e&&`A keystroke, over the last 20 (median, and in brackets the slowest of most of them): its echo arrived in ${i(e.arrived.median)} (${i(e.arrived.worst)}) — browser → PTY host → ConPTY → Claude and back`+(e.shown?`; it was on screen in ${i(e.shown.median)} (${i(e.shown.worst)}) — the frame drawn after it.`:`.`),e&&n===`direct`&&`Connected straight to the PTY host.`,e&&n===`relay`&&"Connected through work web (the PTY host gave no ticket: restart it with `work pty-host --restart`).",r&&`Drawn without the GPU, which is slower while Claude works.`,t===`retrying`&&`The GPU renderer was lost; it is tried again by itself.`,t===`dom`&&`WebGL is unavailable here, or kept getting lost; reloading the page tries it again.`,e&&`Each keystroke and every freeze of this window is written to work’s debug log (terminal-perf).`].filter(Boolean).join(` `),slow:r||(a?.median??0)>100}}var g=200,_=100,v=class{keys=[];stalls=[];key(e){e&&this.keys.length<g&&this.keys.push({arrived:Math.round(e.arrived),shown:e.shown===null?null:Math.round(e.shown)})}stall(e,t){this.stalls.length>=_||this.stalls.push({at:t,ms:Math.round(e.duration),blocking:e.blockingDuration===void 0?null:Math.round(e.blockingDuration),what:y(e)})}take(e){if(!this.keys.length&&!this.stalls.length)return null;let t={...e,keys:this.keys,stalls:this.stalls};return this.keys=[],this.stalls=[],t}};function y(e){return[...e.scripts??[]].sort((e,t)=>(t.duration??0)-(e.duration??0)).slice(0,3).map(e=>{let t=(e.sourceURL??``).split(`/`).pop()?.split(`?`)[0]??``;return[e.invoker,e.sourceFunctionName,t,e.duration===void 0?``:`${Math.round(e.duration)}ms`].filter(Boolean).join(` `).slice(0,160)}).join(`; `)}function ee(e){let t=typeof PerformanceObserver>`u`?null:PerformanceObserver,n=t?.supportedEntryTypes??[],r=n.includes(`long-animation-frame`)?`long-animation-frame`:n.includes(`longtask`)?`longtask`:null;if(!t||!r)return()=>{};let i=new t(t=>{for(let n of t.getEntries())e(n)});return i.observe({type:r,buffered:!1}),()=>i.disconnect()}async function te(e,t){try{let n=await fetch(`/api/terminals/${encodeURIComponent(e)}/ticket`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({force:t})});return n.status===404&&!(n.headers.get(`content-type`)??``).includes(`json`)?null:await n.json()}catch{return null}}function ne(e,t){let n=t.WebSocketImpl??WebSocket,r=t.askTicket??te,i=[],a=[],o=[],s=null,c=!1,l=!1,u=null,d=e=>{let t=new MessageEvent(`message`,{data:e});for(let e of i)e(t)},f=(e=new Event(`close`))=>{if(!l){l=!0;for(let t of a)t(e)}},p=(e,r)=>{if(c)return;u=r?`direct`:`relay`;let a=new n(e);a.binaryType=m.binaryType,s=a;let l=!1;a.addEventListener(`open`,()=>{l=!0;for(let e of o)a.send(e);o.length=0}),a.addEventListener(`message`,e=>{if(s===a)for(let t of i)t(e)}),a.addEventListener(`close`,e=>{if(s===a){if(r&&!l&&!c)return p(t.relayUrl,!1);f(e)}})},m={binaryType:`blob`,addEventListener(e,t){e===`message`?i.push(t):a.push(t)},send(e){s&&s.readyState===n.OPEN?s.send(e):o.push(e)},close(){c=!0,s?s.close():f()},get route(){return u}};return r(e,t.force).then(e=>{if(!c){if(e&&`url`in e)return p(e.url,!0);if(e&&`elsewhere`in e)return d(JSON.stringify(e.elsewhere)),f();if(e&&`error`in e)return d(JSON.stringify({type:`error`,message:e.error})),f();p(t.relayUrl,!1)}}),m}var re=[3,10,30,60];function ie(e){return e>=0&&e<re.length?re[e]*1e3:null}function ae(e){return e?.trim()?e.trim():`the connection closed before it started`}var b=[2e3,1e4,6e4],x=6e5,oe=class{losses=[];lost(e){return this.losses=this.losses.filter(t=>e-t<x),this.losses.push(e),b[this.losses.length-1]??null}},S=/^(\s*)([●⏺⎿])(\s)/u,se=/^(?:[-*+•]\s|\d+[.)]\s|#{1,6}\s|>\s|[│┃|┌└├╭╰─━])/u,ce=/^(?:[-*+•]|\d+[.)])\s+/u,le=e=>e.length-e.trimStart().length,C=``,w=``,T=``,ue=``,de=/[\uE000-\uE003]/gu,fe=e=>e.replace(de,``);function pe(e,t){let n=``,r=0;for(;r<e.length&&t>0;r++)if(/[\uE000-\uE003]/u.test(e[r]))n+=e[r];else if(/\s/u.test(e[r]))t--;else break;return n+e.slice(r)}var me=e=>pe(e,le(fe(e)));function he(e,t,n){let r=e.split(/\r?\n/).map(e=>{let t=e.replace(/\s+$/u,``);return S.test(fe(t))?t.replace(/[●⏺⎿]/u,` `):t}),i=e=>e===0?n:0,a=[],o=null;for(let e=0;e<r.length;e++){let n=r[e],s=fe(n),c=me(n),l=s.trimStart(),u=i(e)+le(s),d=i(e)+s.length;if(o&&l&&o.end+1+(l.split(/\s/u)[0]?.length??0)>t-2&&!se.test(l)&&u===o.cont){o.text+=` `+c,o.end=d;continue}if(o&&a.push(o.text),!l){o=null,a.push(``);continue}let f=ce.exec(l);o={text:(e===0?``:` `.repeat(le(s)))+c,cont:u+(f?f[0].length:0),end:d},/[│┃]/u.test(l)&&(a.push(o.text),o=null)}o&&a.push(o.text);let s=a.slice(1).filter(e=>fe(e).trim()),c=s.length?Math.min(...s.map(e=>le(fe(e)))):0;return a.map((e,t)=>t===0?me(e):pe(e,Math.min(c,le(fe(e))))).join(`
|
|
2
2
|
`)}function ge(e,t){let n=``;for(let r=t.start.y;r<=t.end.y;r++){let i=e.getLine(r);if(!i)break;let a=r<t.end.y&&!!e.getLine(r+1)?.isWrapped,o=[],s=r===t.end.y?Math.min(t.end.x,i.length):i.length;for(let e=r===t.start.y?t.start.x:0;e<s;e++){let t=i.getCell(e);t&&t.getWidth()!==0&&o.push({ch:t.getChars()||` `,b:!!t.isBold(),i:!!t.isItalic()})}let c=o.length;if(!a)for(;c>0&&o[c-1].ch.trim()===``;)c--;let l=!1,u=!1;for(let e of o.slice(0,c)){let t=e.ch.trim()?e.b:l,r=e.ch.trim()?e.i:u;(t!==l||r!==u)&&(u&&(n+=ue),l&&(n+=w),t&&(n+=C),r&&(n+=T),l=t,u=r),n+=e.ch}u&&(n+=ue),l&&(n+=w),r<t.end.y&&!a&&(n+=`
|
|
3
3
|
`)}return n}function _e(e){let t=e.getSelection(),n=e.getSelectionPosition();if(!n)return t;let r=ge(e.buffer.active,n),i=e=>e.replace(/\r\n/gu,`
|
|
4
4
|
`).replace(/[ \t]+$/gmu,``);return i(fe(r))===i(t)?r:t}function ve(e){let t=c(e).replaceAll(C,`<b>`).replaceAll(w,`</b>`).replaceAll(T,`<i>`).replaceAll(ue,`</i>`).replace(/<\/b>(\s*)<b>/gu,`$1`).replace(/<\/i>(\s*)<i>/gu,`$1`);for(let e=``;e!==t;)e=t,t=t.replace(/(\s+)(<\/[bi]>)/gu,`$2$1`);return t}var ye=/^\s*[│┃|].*[│┃|]\s*$/u,be=/^\s*(?:[┌├└╭╰┏┣┗┡╞][─━┬┼┴┳╋┻┐┤┘╮╯┓┫┛┩╡═╪╤╧\s]*|\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-*:?\s*\|?)$/u,xe=e=>e.trim().replace(/^[│┃|]|[│┃|]$/gu,``).split(/[│┃|]/u).map(e=>e.trim());function Se(e){let t=[[]],n=0;for(let r of e)be.test(r)?(n++,t[t.length-1].length&&t.push([])):ye.test(r)&&t[t.length-1].push(xe(r));let r=t.filter(e=>e.length);if(!r.length||!r.some(e=>e.some(e=>e.length>1)))return null;let i=r.length>2||r.length===2&&r[1].length===1,a=e=>e[0].map((t,n)=>e.map(e=>e[n]??``).filter(Boolean).join(` `)),o=i?r.map(a):[a(r[0]),...r.slice(1).flat()];return n||o.length>1?o:null}function Ce(e){let[t,...n]=e,r=(e,t)=>`<tr>${e.map(e=>`<${t}>${c(e)}</${t}>`).join(``)}</tr>`;return`<table><thead>${r(t,`th`)}</thead><tbody>${n.map(e=>r(e,`td`)).join(``)}</tbody></table>`}function we(e,t,n=0){let r=he(e,t,n).split(`
|
|
@@ -93,4 +93,4 @@ void main() {
|
|
|
93
93
|
`);be=!0});let ke=t.onData(e=>{if(be){e===`\r`&&_(e=>e+1);return}Ae(e)});function Ae(e){be||(ge?(w.send(JSON.stringify({type:`input`,data:e})),Ee.key(xe.keySent(performance.now()))):ve.push(e))}let je=t.cols,Me=t.rows,Ne=(e=!1)=>{u.current&&(n.fit(),(e||t.cols!==je||t.rows!==Me)&&(je=t.cols,Me=t.rows,ge&&w.send(JSON.stringify({type:`resize`,cols:t.cols,rows:t.rows}))))},Pe=()=>Ne(),Fe=typeof ResizeObserver<`u`?new ResizeObserver(()=>Ne()):null;Fe?Fe.observe(c.current):window.addEventListener(`resize`,Pe),d.current=()=>{Ne(!0),t.focus()};let Ie=()=>Ne(!0);return t.textarea?.addEventListener(`focus`,Ie),()=>{l=!0,clearTimeout(fe),clearTimeout(he),clearTimeout(s),t.textarea?.removeEventListener(`paste`,b,!0),t.element?.removeEventListener(`copy`,se,!0),t.textarea?.removeEventListener(`focus`,Ie),d.current=null,Fe?.disconnect(),window.removeEventListener(`resize`,Pe),ke.dispose(),De.dispose(),clearInterval(Oe),E(),D(),clearTimeout(Ce);try{w.close()}catch{}t.dispose()}},[e,g]);let me=()=>{pe(!0),_(e=>e+1)};(0,l.useEffect)(()=>{if(!b||!i)return;let e=setInterval(()=>{document.visibilityState===`visible`&&me()},wp);return()=>clearInterval(e)},[b,i]);let he=async()=>{await s(`Start this session's Claude here?
|
|
94
94
|
|
|
95
95
|
If it is still open in another terminal, both would write to the same conversation.`,{ok:`Start it here`})&&(S.current=!0,x(null),_(e=>e+1))},ge=t?`work tree ${t}${r?` ${r}`:``}`:`work tree <target> <branch>`,ve=h(se,w,le);return(0,$.jsxs)($.Fragment,{children:[b&&(0,$.jsxs)(`div`,{className:`wd-pty-elsewhere`,role:`status`,children:[(0,$.jsxs)(`p`,{className:`wd-pty-elsewhere-title`,children:[b.confirmed?`This session’s Claude is open in another terminal`:`This session’s Claude seems to be running in another terminal`,b.lastActivity!==null&&(0,$.jsxs)($.Fragment,{children:[` (last wrote `,Ep(b.lastActivity),`)`]}),b.state===`needs_input`&&(0,$.jsx)($.Fragment,{children:`, waiting for your answer there`}),`.`]}),(0,$.jsxs)(`p`,{children:[`Close it there (type `,(0,$.jsx)(`code`,{children:`/exit`}),`) and this tab attaches by itself — it checks every few seconds. To have both show the same screen instead, restart it with `,(0,$.jsx)(`code`,{children:ge}),` (Ctrl+] detaches, Claude keeps running).`]}),(0,$.jsxs)(`p`,{className:`wd-pty-elsewhere-actions`,children:[(0,$.jsx)(`button`,{type:`button`,className:`wd-btn-secondary`,onClick:me,disabled:fe,children:fe?`Checking…`:`Check again`}),!b.confirmed&&(0,$.jsx)(`button`,{type:`button`,className:`wd-link-button`,onClick:()=>void he(),children:`It's not running — start it here…`})]})]}),(0,$.jsxs)(`div`,{className:`wd-pty-frame`,style:b?{display:`none`}:void 0,children:[(0,$.jsx)(`div`,{ref:c,className:`wd-pty-host`}),ve&&(0,$.jsx)(`span`,{className:`wd-pty-latency`+(ve.slow?` wd-pty-latency-slow`:``),title:ve.title,children:ve.text}),p!==`ready`&&!b&&!y&&(0,$.jsx)(`div`,{className:`wd-pty-connecting`,role:`status`,children:p===`starting`?`Starting Claude — resuming the conversation…`:`Connecting…`}),p!==`ready`&&!b&&y&&(0,$.jsxs)(`div`,{className:`wd-pty-connecting wd-pty-failed`,role:`alert`,children:[(0,$.jsxs)(`p`,{children:[`Couldn't start Claude: `,y.reason,`.`]}),(0,$.jsxs)(`p`,{children:[y.retryAt===null?`Stopped trying on its own.`:(0,$.jsx)(Op,{at:y.retryAt}),` `,(0,$.jsx)(`button`,{type:`button`,className:`wd-btn-secondary`,onClick:()=>{re.current=0,te(null),_(e=>e+1)},children:y.retryAt===null?`Try again`:`Try now`})]})]})]})]})}function Op({at:e}){let[t,n]=(0,l.useState)(()=>Date.now());return(0,l.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,$.jsxs)($.Fragment,{children:[`Trying again in `,Math.max(1,Math.ceil((e-t)/1e3)),` s…`]})}export{wp as ELSEWHERE_RECHECK_MS,Dp as PtyView,Cp as openLink};
|
|
96
|
-
//# sourceMappingURL=PtyView-
|
|
96
|
+
//# sourceMappingURL=PtyView-CJOk_dgn.js.map
|