@moberg_hr/work-tree 2.9.3 → 2.11.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-NG75VLRU.js → account-Q5Y3YKI7.js} +83 -100
- package/dist/account-Q5Y3YKI7.js.map +1 -0
- package/dist/{add-repo-EDU3QEYI.js → add-repo-L4ZTGBLO.js} +35 -31
- package/dist/{add-repo-EDU3QEYI.js.map → add-repo-L4ZTGBLO.js.map} +1 -1
- package/dist/{answer-MHOJ2J6S.js → answer-GNR4ZBWV.js} +18 -15
- package/dist/{answer-MHOJ2J6S.js.map → answer-GNR4ZBWV.js.map} +1 -1
- package/dist/{attach-37JOJ4C3.js → attach-QNSDKRW7.js} +27 -21
- package/dist/{attach-37JOJ4C3.js.map → attach-QNSDKRW7.js.map} +1 -1
- package/dist/bin.js +5 -5
- package/dist/{block-D5CAR53T.js → block-3YUIMA62.js} +23 -15
- package/dist/block-3YUIMA62.js.map +1 -0
- package/dist/{broadcast-LLYHUWXA.js → broadcast-DR3JFINO.js} +13 -11
- package/dist/{broadcast-LLYHUWXA.js.map → broadcast-DR3JFINO.js.map} +1 -1
- package/dist/{catchup-2SL3JGA7.js → catchup-YG2UOZBL.js} +19 -17
- package/dist/{catchup-2SL3JGA7.js.map → catchup-YG2UOZBL.js.map} +1 -1
- package/dist/{chunk-P6BHOAQG.js → chunk-246OTVRR.js} +2 -2
- package/dist/{chunk-KSUOVFO3.js → chunk-26YZYL77.js} +16 -9
- package/dist/chunk-26YZYL77.js.map +1 -0
- package/dist/{chunk-TPSFJSO7.js → chunk-2KN5ECHJ.js} +13 -10
- package/dist/chunk-2KN5ECHJ.js.map +1 -0
- package/dist/chunk-2QLLPZ2L.js +59 -0
- package/dist/chunk-2QLLPZ2L.js.map +1 -0
- package/dist/chunk-2ZQRD73B.js +376 -0
- package/dist/chunk-2ZQRD73B.js.map +1 -0
- package/dist/{chunk-GNGXYXBC.js → chunk-33XSEAHO.js} +2 -2
- package/dist/{chunk-IPGH7TXJ.js → chunk-4CNBSPNL.js} +2 -2
- package/dist/{chunk-J36ULZBO.js → chunk-4K4S53KX.js} +2 -2
- package/dist/chunk-5PAMO6OG.js +9 -0
- package/dist/{chunk-NWIVXGSL.js.map → chunk-5PAMO6OG.js.map} +1 -1
- package/dist/chunk-63ZLPXRL.js +199 -0
- package/dist/chunk-63ZLPXRL.js.map +1 -0
- package/dist/{chunk-P2HOLCBF.js → chunk-6UTH3A76.js} +18 -2
- package/dist/{chunk-P2HOLCBF.js.map → chunk-6UTH3A76.js.map} +1 -1
- package/dist/{chunk-5QGCF3PS.js → chunk-7DUGVGUZ.js} +2 -2
- package/dist/chunk-7E5XPDKX.js +22 -0
- package/dist/chunk-7E5XPDKX.js.map +1 -0
- package/dist/{chunk-6FVYSW3E.js → chunk-7NNGYM3G.js} +21 -6
- package/dist/chunk-7NNGYM3G.js.map +1 -0
- package/dist/{chunk-DQCUYCMX.js → chunk-7NNOGTMC.js} +3 -3
- package/dist/{chunk-OMIMK3LB.js → chunk-7OFVXQSM.js} +2 -2
- package/dist/chunk-7QNVFVG6.js +196 -0
- package/dist/chunk-7QNVFVG6.js.map +1 -0
- package/dist/chunk-7RHC5U7X.js +1578 -0
- package/dist/chunk-7RHC5U7X.js.map +1 -0
- package/dist/{chunk-KUCMJHQW.js → chunk-AHYCZUPI.js} +2 -2
- package/dist/chunk-B6MWNZCN.js +415 -0
- package/dist/chunk-B6MWNZCN.js.map +1 -0
- package/dist/{chunk-CCTALU3C.js → chunk-BLGCU4HT.js} +2 -2
- package/dist/{chunk-RCGFHJM7.js → chunk-CBCOVIXZ.js} +2 -2
- package/dist/{chunk-WTQ2QCAG.js → chunk-CDYCZ3PR.js} +4 -5
- package/dist/chunk-CDYCZ3PR.js.map +1 -0
- package/dist/{chunk-HCVONKJI.js → chunk-CR4LUAP4.js} +15 -17
- package/dist/{chunk-HCVONKJI.js.map → chunk-CR4LUAP4.js.map} +1 -1
- package/dist/{chunk-ZXHMC7UO.js → chunk-D2J3AD6L.js} +3 -5
- package/dist/chunk-D2J3AD6L.js.map +1 -0
- package/dist/chunk-DAKJTB6N.js +76 -0
- package/dist/chunk-DAKJTB6N.js.map +1 -0
- package/dist/{chunk-3N3UQEC4.js → chunk-DCCC7LEP.js} +4 -3
- package/dist/chunk-DCCC7LEP.js.map +1 -0
- package/dist/{chunk-S3BAD4IR.js → chunk-DGVCN7HB.js} +2 -2
- package/dist/chunk-DMGNJ73M.js +84 -0
- package/dist/chunk-DMGNJ73M.js.map +1 -0
- package/dist/{chunk-QL36KN7X.js → chunk-DYQQLUSB.js} +3 -3
- package/dist/{chunk-IWJXFNM4.js → chunk-DZ4LX2EK.js} +16 -24
- package/dist/chunk-DZ4LX2EK.js.map +1 -0
- package/dist/{chunk-3C3BKZ3H.js → chunk-EDIHBLZY.js} +51 -29
- package/dist/chunk-EDIHBLZY.js.map +1 -0
- package/dist/chunk-EL3XL2OC.js +150 -0
- package/dist/chunk-EL3XL2OC.js.map +1 -0
- package/dist/{chunk-T7AFYEQ7.js → chunk-F2CDUWZU.js} +5 -5
- package/dist/chunk-F2NOCGMA.js +243 -0
- package/dist/chunk-F2NOCGMA.js.map +1 -0
- package/dist/chunk-FGPXMAYU.js +25 -0
- package/dist/chunk-FGPXMAYU.js.map +1 -0
- package/dist/{chunk-ICJPVSRY.js → chunk-FLHMFRZB.js} +51 -51
- package/dist/chunk-FLHMFRZB.js.map +1 -0
- package/dist/{chunk-CLBQ7ZC4.js → chunk-FR7B7QH6.js} +3 -3
- package/dist/chunk-FZHFD2AY.js +27 -0
- package/dist/chunk-FZHFD2AY.js.map +1 -0
- package/dist/{chunk-7OUIZ2YQ.js → chunk-G4QUJO7W.js} +56 -58
- package/dist/chunk-G4QUJO7W.js.map +1 -0
- package/dist/{chunk-26OVU2AE.js → chunk-G4ZR5YZL.js} +8 -8
- package/dist/{chunk-P4EQWC5W.js → chunk-GG4VKPAX.js} +2 -2
- package/dist/{chunk-INQQGV2G.js → chunk-GZNF6762.js} +4 -4
- package/dist/{chunk-QHTXLCG7.js → chunk-H3LP3Z4U.js} +19 -13
- package/dist/chunk-H3LP3Z4U.js.map +1 -0
- package/dist/{chunk-6E2I2FBJ.js → chunk-HJKYE57I.js} +22 -22
- package/dist/{chunk-CYWI3ZW7.js → chunk-I5FZXDCO.js} +4 -4
- package/dist/{chunk-5WM24P5N.js → chunk-I6MILNM5.js} +2 -2
- package/dist/chunk-I6MILNM5.js.map +1 -0
- package/dist/{chunk-BSP2Z7B7.js → chunk-IQ4MITHC.js} +6 -6
- package/dist/chunk-J3GEINBH.js +307 -0
- package/dist/chunk-J3GEINBH.js.map +1 -0
- package/dist/{chunk-WXE7D44E.js → chunk-JCFCEJ2D.js} +8 -8
- package/dist/chunk-JCFCEJ2D.js.map +1 -0
- package/dist/{chunk-WXMWZRBH.js → chunk-JF25PSYF.js} +24 -8
- package/dist/chunk-JF25PSYF.js.map +1 -0
- package/dist/{chunk-SG5LUMGE.js → chunk-JNBMANFM.js} +6 -3
- package/dist/chunk-JNBMANFM.js.map +1 -0
- package/dist/chunk-JVE2JFLV.js +15 -0
- package/dist/chunk-JVE2JFLV.js.map +1 -0
- package/dist/{chunk-RGUSVBGN.js → chunk-JVHHSKBJ.js} +2 -2
- package/dist/chunk-KSVYR4G2.js +47 -0
- package/dist/chunk-KSVYR4G2.js.map +1 -0
- package/dist/{chunk-RYNBBSLY.js → chunk-KWHHB737.js} +6 -8
- package/dist/chunk-KWHHB737.js.map +1 -0
- package/dist/{chunk-MG5TTLYZ.js → chunk-LHM3GB5K.js} +3 -3
- package/dist/{chunk-PSUJZUYX.js → chunk-LM2T5OR3.js} +3 -2
- package/dist/{chunk-GRLKPVTP.js → chunk-LQNHIMJM.js} +56 -81
- package/dist/chunk-LQNHIMJM.js.map +1 -0
- package/dist/{chunk-UBOKRHNV.js → chunk-MKJH2D4V.js} +2 -2
- package/dist/{chunk-HMK3INUS.js → chunk-MQCDFSVF.js} +2 -2
- package/dist/{chunk-VJ7SVDED.js → chunk-MSJWQC7H.js} +6 -4
- package/dist/chunk-MSJWQC7H.js.map +1 -0
- package/dist/chunk-MXOHW4U2.js +187 -0
- package/dist/chunk-MXOHW4U2.js.map +1 -0
- package/dist/{chunk-VUAVPBFR.js → chunk-N4W34U3I.js} +78 -60
- package/dist/chunk-N4W34U3I.js.map +1 -0
- package/dist/{chunk-72IBYKIY.js → chunk-NFWSJFYY.js} +16 -5
- package/dist/chunk-NFWSJFYY.js.map +1 -0
- package/dist/{chunk-2JNW2AQ2.js → chunk-O5ZJY5BT.js} +32 -4
- package/dist/chunk-O5ZJY5BT.js.map +1 -0
- package/dist/{chunk-CMO5YUZR.js → chunk-OY46QHLX.js} +4 -4
- package/dist/{chunk-OTAZOIXK.js → chunk-PKQROEFP.js} +2 -2
- package/dist/{chunk-4NITDMDH.js → chunk-PPZP7CA7.js} +9 -186
- package/dist/chunk-PPZP7CA7.js.map +1 -0
- package/dist/chunk-QBI6K23L.js +50 -0
- package/dist/chunk-QBI6K23L.js.map +1 -0
- package/dist/{chunk-AAYWHIIT.js → chunk-QLFJNYBV.js} +9 -56
- package/dist/chunk-QLFJNYBV.js.map +1 -0
- package/dist/{chunk-PRDRRU2B.js → chunk-R5JCCRGD.js} +5 -5
- package/dist/{chunk-X4AXKO3A.js → chunk-RGLIW45S.js} +2 -2
- package/dist/{chunk-YYBXQBW2.js → chunk-RUYTU2WJ.js} +17 -3
- package/dist/chunk-RUYTU2WJ.js.map +1 -0
- package/dist/chunk-S3CTXKSN.js +17 -0
- package/dist/chunk-S3CTXKSN.js.map +1 -0
- package/dist/chunk-SJBEIYLK.js +16 -0
- package/dist/chunk-SJBEIYLK.js.map +1 -0
- package/dist/{chunk-WC534PXU.js → chunk-SPP7MA3D.js} +36 -25
- package/dist/chunk-SPP7MA3D.js.map +1 -0
- package/dist/{chunk-RFINYWID.js → chunk-TEL27NRC.js} +16 -6
- package/dist/chunk-TEL27NRC.js.map +1 -0
- package/dist/{chunk-ATED7SAH.js → chunk-TEVCBUEN.js} +36 -25
- package/dist/chunk-TEVCBUEN.js.map +1 -0
- package/dist/{chunk-QSOEMCWQ.js → chunk-URGHBFB3.js} +18 -11
- package/dist/chunk-URGHBFB3.js.map +1 -0
- package/dist/{chunk-S3FMTEFR.js → chunk-VAMLU5VH.js} +13 -6
- package/dist/chunk-VAMLU5VH.js.map +1 -0
- package/dist/{chunk-ZI2KXTKM.js → chunk-VJ5XMYXE.js} +6 -10
- package/dist/chunk-VJ5XMYXE.js.map +1 -0
- package/dist/{chunk-QEVYCCKD.js → chunk-VRQKIIC2.js} +12 -34
- package/dist/chunk-VRQKIIC2.js.map +1 -0
- package/dist/{chunk-63VY4YJM.js → chunk-W7MGB3Q2.js} +34 -9
- package/dist/chunk-W7MGB3Q2.js.map +1 -0
- package/dist/{chunk-HEPBANFJ.js → chunk-X3RHLYGI.js} +93 -196
- package/dist/chunk-X3RHLYGI.js.map +1 -0
- package/dist/chunk-YKQLHFY4.js +1478 -0
- package/dist/chunk-YKQLHFY4.js.map +1 -0
- package/dist/chunk-YPXFDJ76.js +71 -0
- package/dist/chunk-YPXFDJ76.js.map +1 -0
- package/dist/{chunk-XVNRP7XE.js → chunk-YQBBFX7D.js} +11 -11
- package/dist/{chunk-37XQIG7F.js → chunk-ZG2M4ECW.js} +569 -55
- package/dist/chunk-ZG2M4ECW.js.map +1 -0
- package/dist/{cleanup-5PSLKZLF.js → cleanup-X7G66SPY.js} +49 -37
- package/dist/{cleanup-5PSLKZLF.js.map → cleanup-X7G66SPY.js.map} +1 -1
- package/dist/cli-RJVX6HVT.js +19 -0
- package/dist/{command-hook-installer-7Q7UD7AU.js → command-hook-installer-GMQ4IVDE.js} +3 -3
- package/dist/{completion-MXX5TRIV.js → completion-IAH7WRKJ.js} +3 -2
- package/dist/{completion-MXX5TRIV.js.map → completion-IAH7WRKJ.js.map} +1 -1
- package/dist/{config-6MSITKGB.js → config-ZBU5PHMG.js} +18 -15
- package/dist/{config-6MSITKGB.js.map → config-ZBU5PHMG.js.map} +1 -1
- package/dist/{diff-Q7MV6YGJ.js → diff-ADSD4SNQ.js} +25 -22
- package/dist/{diff-Q7MV6YGJ.js.map → diff-ADSD4SNQ.js.map} +1 -1
- package/dist/{digest-KUMVYXKZ.js → digest-ORN6JFNE.js} +15 -13
- package/dist/{digest-KUMVYXKZ.js.map → digest-ORN6JFNE.js.map} +1 -1
- package/dist/{fork-OFENISEM.js → fork-VWHAU76U.js} +44 -31
- package/dist/{fork-OFENISEM.js.map → fork-VWHAU76U.js.map} +1 -1
- package/dist/{history-5WKRWARZ.js → history-PP7RHA2V.js} +14 -12
- package/dist/{hook-ARS32DG2.js → hook-6AL5LIQO.js} +56 -22
- package/dist/hook-6AL5LIQO.js.map +1 -0
- package/dist/{hydrate-LCT6DVB3.js → hydrate-JW5MIWLZ.js} +16 -14
- package/dist/{hydrate-LCT6DVB3.js.map → hydrate-JW5MIWLZ.js.map} +1 -1
- package/dist/{init-FJKPEY5N.js → init-SIIKJF3K.js} +29 -21
- package/dist/{init-FJKPEY5N.js.map → init-SIIKJF3K.js.map} +1 -1
- package/dist/install-skills-KS6N4U6L.js +22 -0
- package/dist/install-skills-bin.js +10 -8
- package/dist/install-skills-bin.js.map +1 -1
- package/dist/{list-GTKP5FAW.js → list-UTQF7KHP.js} +17 -15
- package/dist/{list-GTKP5FAW.js.map → list-UTQF7KHP.js.map} +1 -1
- package/dist/{move-GOCLEFGZ.js → move-P6WOVUGF.js} +35 -26
- package/dist/{move-GOCLEFGZ.js.map → move-P6WOVUGF.js.map} +1 -1
- package/dist/{note-B7TQBXQF.js → note-GEFCZKMT.js} +16 -14
- package/dist/{note-B7TQBXQF.js.map → note-GEFCZKMT.js.map} +1 -1
- package/dist/{overlaps-UKQHIJMU.js → overlaps-QMI2RJSG.js} +23 -13
- package/dist/{overlaps-UKQHIJMU.js.map → overlaps-QMI2RJSG.js.map} +1 -1
- package/dist/{pin-UZZCDK7M.js → pin-ZALBX2XK.js} +16 -14
- package/dist/{pin-UZZCDK7M.js.map → pin-ZALBX2XK.js.map} +1 -1
- package/dist/{pr-NU2ME2XW.js → pr-D3EZ7C5H.js} +48 -23
- package/dist/pr-D3EZ7C5H.js.map +1 -0
- package/dist/{prune-IZGEYTSB.js → prune-ZCOBL7IB.js} +47 -35
- package/dist/{prune-IZGEYTSB.js.map → prune-ZCOBL7IB.js.map} +1 -1
- package/dist/{pty-host-AWDIKPQN.js → pty-host-UCM6GV42.js} +104 -40
- package/dist/pty-host-UCM6GV42.js.map +1 -0
- package/dist/{read-U6GBGA5E.js → read-NHRSGZI4.js} +15 -13
- package/dist/{read-U6GBGA5E.js.map → read-NHRSGZI4.js.map} +1 -1
- package/dist/{recent-2DUMLUDG.js → recent-V4JVL4Y2.js} +36 -27
- package/dist/recent-V4JVL4Y2.js.map +1 -0
- package/dist/{remove-OXUP4O33.js → remove-YNO2I3HR.js} +51 -39
- package/dist/{remove-OXUP4O33.js.map → remove-YNO2I3HR.js.map} +1 -1
- package/dist/{restart-QEW4DJC3.js → restart-6YKAD7QQ.js} +19 -17
- package/dist/{restart-QEW4DJC3.js.map → restart-6YKAD7QQ.js.map} +1 -1
- package/dist/{resume-K45IT4QO.js → resume-PNZ7BRXJ.js} +36 -21
- package/dist/resume-PNZ7BRXJ.js.map +1 -0
- package/dist/review-now-HHQIBVUS.js +22 -0
- package/dist/review-now-HHQIBVUS.js.map +1 -0
- package/dist/{run-42LORGPS.js → run-3QYP7GBN.js} +23 -17
- package/dist/run-3QYP7GBN.js.map +1 -0
- package/dist/{screen-2TLIUH3G.js → screen-I6N6FKMF.js} +16 -14
- package/dist/{screen-2TLIUH3G.js.map → screen-I6N6FKMF.js.map} +1 -1
- package/dist/{search-7E4B2KX6.js → search-MLLK3ZCW.js} +12 -10
- package/dist/{search-7E4B2KX6.js.map → search-MLLK3ZCW.js.map} +1 -1
- package/dist/{section-OVA5VD7L.js → section-EQOZ36FS.js} +16 -14
- package/dist/{section-OVA5VD7L.js.map → section-EQOZ36FS.js.map} +1 -1
- package/dist/{send-BJY5CYLO.js → send-LET73FB6.js} +21 -18
- package/dist/send-LET73FB6.js.map +1 -0
- package/dist/{sessions-4A24ZORW.js → sessions-MDOJJZCK.js} +60 -25
- package/dist/sessions-MDOJJZCK.js.map +1 -0
- package/dist/{snooze-WIVKB3GH.js → snooze-TNA7QTXS.js} +15 -13
- package/dist/{snooze-WIVKB3GH.js.map → snooze-TNA7QTXS.js.map} +1 -1
- package/dist/{start-G6GR533S.js → start-OV6LZJ2V.js} +16 -14
- package/dist/{start-G6GR533S.js.map → start-OV6LZJ2V.js.map} +1 -1
- package/dist/{state-S3DGLT4J.js → state-BR43ONIH.js} +18 -6
- package/dist/state-BR43ONIH.js.map +1 -0
- package/dist/{status-BTAWY6JQ.js → status-HDDGCX4J.js} +40 -15
- package/dist/status-HDDGCX4J.js.map +1 -0
- package/dist/{statusline-WLXEU5DM.js → statusline-WKKYCH7O.js} +13 -12
- package/dist/{statusline-WLXEU5DM.js.map → statusline-WKKYCH7O.js.map} +1 -1
- package/dist/{statusline-hook-OVWHHFBV.js → statusline-hook-K7KPN2H6.js} +6 -5
- package/dist/{statusline-hook-OVWHHFBV.js.map → statusline-hook-K7KPN2H6.js.map} +1 -1
- package/dist/{stop-FN6EPFJ4.js → stop-3TJWZBJB.js} +16 -14
- package/dist/{stop-FN6EPFJ4.js.map → stop-3TJWZBJB.js.map} +1 -1
- package/dist/{sync-T3BSHX6Q.js → sync-67AOBEYR.js} +47 -35
- package/dist/{sync-T3BSHX6Q.js.map → sync-67AOBEYR.js.map} +1 -1
- package/dist/{time-5CH5O5MZ.js → time-F6SLY6HR.js} +17 -15
- package/dist/{time-5CH5O5MZ.js.map → time-F6SLY6HR.js.map} +1 -1
- package/dist/{time-actions-XEUQ3UF7.js → time-actions-YOXF5WC7.js} +6 -5
- package/dist/{timesheet-FMQKPS5S.js → timesheet-QUEDQSJ2.js} +26 -17
- package/dist/{timesheet-FMQKPS5S.js.map → timesheet-QUEDQSJ2.js.map} +1 -1
- package/dist/{todo-23COLGR2.js → todo-TALKJYK6.js} +5 -5
- package/dist/{tree-T33VU473.js → tree-FOOQBNVW.js} +66 -47
- package/dist/tree-FOOQBNVW.js.map +1 -0
- package/dist/{update-PJRSKQZ2.js → update-5O3I5P4N.js} +26 -16
- package/dist/{update-PJRSKQZ2.js.map → update-5O3I5P4N.js.map} +1 -1
- package/dist/{usage-TL66LWO4.js → usage-DVKHDT5J.js} +15 -13
- package/dist/{usage-TL66LWO4.js.map → usage-DVKHDT5J.js.map} +1 -1
- package/dist/version-TVT6GSRF.js +115 -0
- package/dist/version-TVT6GSRF.js.map +1 -0
- package/dist/{wait-YIEJO6YM.js → wait-5HZZPKNM.js} +18 -15
- package/dist/{wait-YIEJO6YM.js.map → wait-5HZZPKNM.js.map} +1 -1
- package/dist/wd-bin.js +7 -7
- package/dist/web/assets/{PtyView-DnDd6jLI.js → PtyView-DIGlBtjg.js} +2 -2
- package/dist/web/assets/{PtyView-DnDd6jLI.js.map → PtyView-DIGlBtjg.js.map} +1 -1
- package/dist/web/assets/index-CpqiTeqj.css +1 -0
- package/dist/web/assets/index-Cx0PMo6D.js +126 -0
- package/dist/web/assets/index-Cx0PMo6D.js.map +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-IYUNJMQD.js → web-T7UPV3QY.js} +5158 -1822
- package/dist/web-T7UPV3QY.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/plugins/work-tree/skills/wd-review/SKILL.md +1 -1
- package/plugins/work-tree/skills/work-sessions/SKILL.md +2 -2
- package/dist/account-NG75VLRU.js.map +0 -1
- package/dist/block-D5CAR53T.js.map +0 -1
- package/dist/chunk-2JNW2AQ2.js.map +0 -1
- package/dist/chunk-37XQIG7F.js.map +0 -1
- package/dist/chunk-3C3BKZ3H.js.map +0 -1
- package/dist/chunk-3GIH4WTA.js +0 -314
- package/dist/chunk-3GIH4WTA.js.map +0 -1
- package/dist/chunk-3N3UQEC4.js.map +0 -1
- package/dist/chunk-4NITDMDH.js.map +0 -1
- package/dist/chunk-5WM24P5N.js.map +0 -1
- package/dist/chunk-63VY4YJM.js.map +0 -1
- package/dist/chunk-6FVYSW3E.js.map +0 -1
- package/dist/chunk-72IBYKIY.js.map +0 -1
- package/dist/chunk-7OUIZ2YQ.js.map +0 -1
- package/dist/chunk-AAYWHIIT.js.map +0 -1
- package/dist/chunk-ATED7SAH.js.map +0 -1
- package/dist/chunk-GRLKPVTP.js.map +0 -1
- package/dist/chunk-HEPBANFJ.js.map +0 -1
- package/dist/chunk-ICJPVSRY.js.map +0 -1
- package/dist/chunk-IWJXFNM4.js.map +0 -1
- package/dist/chunk-KSUOVFO3.js.map +0 -1
- package/dist/chunk-NWIVXGSL.js +0 -9
- package/dist/chunk-PTWVOT7A.js +0 -551
- package/dist/chunk-PTWVOT7A.js.map +0 -1
- package/dist/chunk-QEVYCCKD.js.map +0 -1
- package/dist/chunk-QHTXLCG7.js.map +0 -1
- package/dist/chunk-QSOEMCWQ.js.map +0 -1
- package/dist/chunk-RCYI7SRA.js +0 -15
- package/dist/chunk-RCYI7SRA.js.map +0 -1
- package/dist/chunk-RFINYWID.js.map +0 -1
- package/dist/chunk-RYNBBSLY.js.map +0 -1
- package/dist/chunk-S3FMTEFR.js.map +0 -1
- package/dist/chunk-SG5LUMGE.js.map +0 -1
- package/dist/chunk-TPSFJSO7.js.map +0 -1
- package/dist/chunk-VJ7SVDED.js.map +0 -1
- package/dist/chunk-VTLDYH3C.js +0 -227
- package/dist/chunk-VTLDYH3C.js.map +0 -1
- package/dist/chunk-VUAVPBFR.js.map +0 -1
- package/dist/chunk-WC534PXU.js.map +0 -1
- package/dist/chunk-WTQ2QCAG.js.map +0 -1
- package/dist/chunk-WXE7D44E.js.map +0 -1
- package/dist/chunk-WXMWZRBH.js.map +0 -1
- package/dist/chunk-YYBXQBW2.js.map +0 -1
- package/dist/chunk-ZDMJPEBO.js +0 -31
- package/dist/chunk-ZDMJPEBO.js.map +0 -1
- package/dist/chunk-ZI2KXTKM.js.map +0 -1
- package/dist/chunk-ZXHMC7UO.js.map +0 -1
- package/dist/cli-AF7636FA.js +0 -19
- package/dist/hook-ARS32DG2.js.map +0 -1
- package/dist/install-skills-UYAFVJBA.js +0 -20
- package/dist/pr-NU2ME2XW.js.map +0 -1
- package/dist/pty-host-AWDIKPQN.js.map +0 -1
- package/dist/recent-2DUMLUDG.js.map +0 -1
- package/dist/resume-K45IT4QO.js.map +0 -1
- package/dist/run-42LORGPS.js.map +0 -1
- package/dist/send-BJY5CYLO.js.map +0 -1
- package/dist/sessions-4A24ZORW.js.map +0 -1
- package/dist/state-S3DGLT4J.js.map +0 -1
- package/dist/status-BTAWY6JQ.js.map +0 -1
- package/dist/tree-T33VU473.js.map +0 -1
- package/dist/web/assets/index-DxozAoUO.css +0 -1
- package/dist/web/assets/index-InmdAx6g.js +0 -120
- package/dist/web/assets/index-InmdAx6g.js.map +0 -1
- package/dist/web-IYUNJMQD.js.map +0 -1
- /package/dist/{chunk-P6BHOAQG.js.map → chunk-246OTVRR.js.map} +0 -0
- /package/dist/{chunk-GNGXYXBC.js.map → chunk-33XSEAHO.js.map} +0 -0
- /package/dist/{chunk-IPGH7TXJ.js.map → chunk-4CNBSPNL.js.map} +0 -0
- /package/dist/{chunk-J36ULZBO.js.map → chunk-4K4S53KX.js.map} +0 -0
- /package/dist/{chunk-5QGCF3PS.js.map → chunk-7DUGVGUZ.js.map} +0 -0
- /package/dist/{chunk-DQCUYCMX.js.map → chunk-7NNOGTMC.js.map} +0 -0
- /package/dist/{chunk-OMIMK3LB.js.map → chunk-7OFVXQSM.js.map} +0 -0
- /package/dist/{chunk-KUCMJHQW.js.map → chunk-AHYCZUPI.js.map} +0 -0
- /package/dist/{chunk-CCTALU3C.js.map → chunk-BLGCU4HT.js.map} +0 -0
- /package/dist/{chunk-RCGFHJM7.js.map → chunk-CBCOVIXZ.js.map} +0 -0
- /package/dist/{chunk-S3BAD4IR.js.map → chunk-DGVCN7HB.js.map} +0 -0
- /package/dist/{chunk-QL36KN7X.js.map → chunk-DYQQLUSB.js.map} +0 -0
- /package/dist/{chunk-T7AFYEQ7.js.map → chunk-F2CDUWZU.js.map} +0 -0
- /package/dist/{chunk-CLBQ7ZC4.js.map → chunk-FR7B7QH6.js.map} +0 -0
- /package/dist/{chunk-26OVU2AE.js.map → chunk-G4ZR5YZL.js.map} +0 -0
- /package/dist/{chunk-P4EQWC5W.js.map → chunk-GG4VKPAX.js.map} +0 -0
- /package/dist/{chunk-INQQGV2G.js.map → chunk-GZNF6762.js.map} +0 -0
- /package/dist/{chunk-6E2I2FBJ.js.map → chunk-HJKYE57I.js.map} +0 -0
- /package/dist/{chunk-CYWI3ZW7.js.map → chunk-I5FZXDCO.js.map} +0 -0
- /package/dist/{chunk-BSP2Z7B7.js.map → chunk-IQ4MITHC.js.map} +0 -0
- /package/dist/{chunk-RGUSVBGN.js.map → chunk-JVHHSKBJ.js.map} +0 -0
- /package/dist/{chunk-MG5TTLYZ.js.map → chunk-LHM3GB5K.js.map} +0 -0
- /package/dist/{chunk-PSUJZUYX.js.map → chunk-LM2T5OR3.js.map} +0 -0
- /package/dist/{chunk-UBOKRHNV.js.map → chunk-MKJH2D4V.js.map} +0 -0
- /package/dist/{chunk-HMK3INUS.js.map → chunk-MQCDFSVF.js.map} +0 -0
- /package/dist/{chunk-CMO5YUZR.js.map → chunk-OY46QHLX.js.map} +0 -0
- /package/dist/{chunk-OTAZOIXK.js.map → chunk-PKQROEFP.js.map} +0 -0
- /package/dist/{chunk-PRDRRU2B.js.map → chunk-R5JCCRGD.js.map} +0 -0
- /package/dist/{chunk-X4AXKO3A.js.map → chunk-RGLIW45S.js.map} +0 -0
- /package/dist/{chunk-XVNRP7XE.js.map → chunk-YQBBFX7D.js.map} +0 -0
- /package/dist/{cli-AF7636FA.js.map → cli-RJVX6HVT.js.map} +0 -0
- /package/dist/{command-hook-installer-7Q7UD7AU.js.map → command-hook-installer-GMQ4IVDE.js.map} +0 -0
- /package/dist/{history-5WKRWARZ.js.map → history-PP7RHA2V.js.map} +0 -0
- /package/dist/{install-skills-UYAFVJBA.js.map → install-skills-KS6N4U6L.js.map} +0 -0
- /package/dist/{time-actions-XEUQ3UF7.js.map → time-actions-YOXF5WC7.js.map} +0 -0
- /package/dist/{todo-23COLGR2.js.map → todo-TALKJYK6.js.map} +0 -0
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
import {
|
|
3
3
|
computeDiff,
|
|
4
4
|
isInsideRoot
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IQ4MITHC.js";
|
|
6
|
+
import {
|
|
7
|
+
createFsWatcher,
|
|
8
|
+
loadHistory
|
|
9
|
+
} from "./chunk-ZG2M4ECW.js";
|
|
6
10
|
import {
|
|
7
11
|
packageRoot
|
|
8
12
|
} from "./chunk-LNHSBM4L.js";
|
|
9
13
|
import {
|
|
10
14
|
git
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
createFsWatcher,
|
|
14
|
-
loadHistory
|
|
15
|
-
} from "./chunk-37XQIG7F.js";
|
|
15
|
+
} from "./chunk-DCCC7LEP.js";
|
|
16
16
|
import {
|
|
17
17
|
spawn_default
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-EL3XL2OC.js";
|
|
19
19
|
import {
|
|
20
20
|
report
|
|
21
21
|
} from "./chunk-AU27USPZ.js";
|
|
@@ -84,42 +84,57 @@ function resolveScope(cwd) {
|
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
function findAnyParentBranch(cwd) {
|
|
87
|
-
return findParent(
|
|
87
|
+
return runSync(findParent(false), cwd);
|
|
88
88
|
}
|
|
89
89
|
function detectParentBranch(cwd) {
|
|
90
|
-
return findParent(
|
|
90
|
+
return runSync(findParent(true), cwd);
|
|
91
91
|
}
|
|
92
92
|
var PARENT_CANDIDATES = ["main", "master", "dev", "develop"].flatMap((name) => [name, `origin/${name}`]);
|
|
93
|
-
function
|
|
94
|
-
|
|
93
|
+
function runSync(steps, cwd) {
|
|
94
|
+
let next = steps.next();
|
|
95
|
+
while (!next.done) {
|
|
96
|
+
const r = git(next.value, cwd);
|
|
97
|
+
next = steps.next({ exitCode: r.exitCode, stdout: r.stdout });
|
|
98
|
+
}
|
|
99
|
+
return next.value;
|
|
100
|
+
}
|
|
101
|
+
async function runAsync(steps, run) {
|
|
102
|
+
let next = steps.next();
|
|
103
|
+
while (!next.done) next = steps.next(await run(next.value));
|
|
104
|
+
return next.value;
|
|
105
|
+
}
|
|
106
|
+
function* findParent(requireAheadOfParent) {
|
|
107
|
+
const currentResult = yield ["rev-parse", "--abbrev-ref", "HEAD"];
|
|
95
108
|
const currentBranch = currentResult.exitCode === 0 ? currentResult.stdout : "";
|
|
96
|
-
const candidates = PARENT_CANDIDATES;
|
|
97
109
|
let best = null;
|
|
98
110
|
let fresh;
|
|
99
|
-
for (const ref of
|
|
111
|
+
for (const ref of PARENT_CANDIDATES) {
|
|
100
112
|
if (ref === currentBranch) continue;
|
|
101
|
-
const exists =
|
|
113
|
+
const exists = yield ["rev-parse", "--verify", "--quiet", ref];
|
|
102
114
|
if (exists.exitCode !== 0 || !exists.stdout) continue;
|
|
103
|
-
const mb =
|
|
115
|
+
const mb = yield ["merge-base", ref, "HEAD"];
|
|
104
116
|
if (mb.exitCode !== 0 || !mb.stdout) continue;
|
|
105
117
|
if (requireAheadOfParent) {
|
|
106
|
-
const headSha =
|
|
107
|
-
if (mb.stdout === headSha
|
|
118
|
+
const headSha = (yield ["rev-parse", "HEAD"]).stdout;
|
|
119
|
+
if (mb.stdout === headSha) {
|
|
120
|
+
fresh ??= yield* stillAtCreation(currentBranch, headSha);
|
|
121
|
+
if (!fresh) continue;
|
|
122
|
+
}
|
|
108
123
|
}
|
|
109
|
-
const timeResult =
|
|
124
|
+
const timeResult = yield ["show", "-s", "--format=%ct", mb.stdout];
|
|
110
125
|
if (timeResult.exitCode !== 0) continue;
|
|
111
126
|
const time = Number(timeResult.stdout);
|
|
112
127
|
if (!Number.isFinite(time)) continue;
|
|
113
|
-
const later = !!best && time === best.time && mb.stdout !== best.sha &&
|
|
128
|
+
const later = !!best && time === best.time && mb.stdout !== best.sha && (yield ["merge-base", "--is-ancestor", best.sha, mb.stdout]).exitCode === 0;
|
|
114
129
|
if (!best || time > best.time || later) {
|
|
115
130
|
best = { ref, sha: mb.stdout, time };
|
|
116
131
|
}
|
|
117
132
|
}
|
|
118
133
|
return best?.ref ?? null;
|
|
119
134
|
}
|
|
120
|
-
function stillAtCreation(
|
|
135
|
+
function* stillAtCreation(branch, headSha) {
|
|
121
136
|
if (!branch || branch === "HEAD") return false;
|
|
122
|
-
const log =
|
|
137
|
+
const log = yield ["reflog", "show", "--format=%H %gs", `refs/heads/${branch}`, "--"];
|
|
123
138
|
if (log.exitCode !== 0 || !log.stdout) return false;
|
|
124
139
|
const lines = log.stdout.split("\n").filter(Boolean);
|
|
125
140
|
const m = /^(\S+) branch: Created from (\S+)$/.exec(lines[lines.length - 1] ?? "");
|
|
@@ -127,14 +142,14 @@ function stillAtCreation(cwd, branch, headSha) {
|
|
|
127
142
|
const from = m[2].replace(/^refs\/(heads|remotes)\//, "");
|
|
128
143
|
return from === "HEAD" || PARENT_CANDIDATES.includes(from);
|
|
129
144
|
}
|
|
130
|
-
function recordedBase(
|
|
145
|
+
function* recordedBase(name) {
|
|
131
146
|
const refs = name.startsWith("origin/") ? [name] : [name, `origin/${name}`];
|
|
132
147
|
let best = null;
|
|
133
148
|
for (const ref of refs) {
|
|
134
|
-
if (
|
|
135
|
-
const mb =
|
|
149
|
+
if ((yield ["rev-parse", "--verify", "--quiet", ref]).exitCode !== 0) continue;
|
|
150
|
+
const mb = yield ["merge-base", ref, "HEAD"];
|
|
136
151
|
if (mb.exitCode !== 0 || !mb.stdout) continue;
|
|
137
|
-
if (!best || mb.stdout !== best.mb &&
|
|
152
|
+
if (!best || mb.stdout !== best.mb && (yield ["merge-base", "--is-ancestor", best.mb, mb.stdout]).exitCode === 0) {
|
|
138
153
|
best = { ref, mb: mb.stdout };
|
|
139
154
|
}
|
|
140
155
|
}
|
|
@@ -167,15 +182,21 @@ function buildRepoSpecs(scope, base, perRepoBase) {
|
|
|
167
182
|
});
|
|
168
183
|
}
|
|
169
184
|
function resolveRepoDiff(root, base, sessionBaseBranch) {
|
|
185
|
+
return runSync(repoDiffSteps(base, sessionBaseBranch), root);
|
|
186
|
+
}
|
|
187
|
+
function resolveRepoDiffAsync(base, sessionBaseBranch, run) {
|
|
188
|
+
return runAsync(repoDiffSteps(base, sessionBaseBranch), run);
|
|
189
|
+
}
|
|
190
|
+
function* repoDiffSteps(base, sessionBaseBranch) {
|
|
170
191
|
if (base === "uncommitted") {
|
|
171
192
|
return { resolvedBase: "HEAD", diffArg: "HEAD" };
|
|
172
193
|
}
|
|
173
|
-
const recorded = sessionBaseBranch ? recordedBase(
|
|
194
|
+
const recorded = sessionBaseBranch ? yield* recordedBase(sessionBaseBranch) : null;
|
|
174
195
|
if (recorded) return { resolvedBase: recorded.ref, diffArg: recorded.mb };
|
|
175
|
-
const parent =
|
|
196
|
+
const parent = (yield* findParent(true)) ?? (yield* findParent(false));
|
|
176
197
|
if (!parent) return { resolvedBase: "HEAD", diffArg: "HEAD" };
|
|
177
198
|
let diffArg = "HEAD";
|
|
178
|
-
const mb =
|
|
199
|
+
const mb = yield ["merge-base", parent, "HEAD"];
|
|
179
200
|
if (mb.exitCode === 0 && mb.stdout) diffArg = mb.stdout;
|
|
180
201
|
return { resolvedBase: parent, diffArg };
|
|
181
202
|
}
|
|
@@ -501,6 +522,7 @@ export {
|
|
|
501
522
|
resolveBase,
|
|
502
523
|
buildRepoSpecs,
|
|
503
524
|
resolveRepoDiff,
|
|
525
|
+
resolveRepoDiffAsync,
|
|
504
526
|
sessionBaseForPath,
|
|
505
527
|
refuseReason,
|
|
506
528
|
launch,
|
|
@@ -512,4 +534,4 @@ export {
|
|
|
512
534
|
submitReviewSchema,
|
|
513
535
|
resolveSchema
|
|
514
536
|
};
|
|
515
|
-
//# sourceMappingURL=chunk-
|
|
537
|
+
//# sourceMappingURL=chunk-EDIHBLZY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/diff/diff-scope.ts","../src/core/platform/web-static.ts","../src/server/local-origin.ts","../src/server/local-server.ts","../src/server/spa-handler.ts","../src/server/diff-server.ts","../src/core/diff/file-context.ts","../src/core/comments/comment-schemas.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { git } from '../git/git.js';\nimport { loadHistory, type WorktreeSession } from '../sessions/history.js';\nimport type { RepoSpec } from './repo-spec.js';\nimport { report } from '../platform/report.js';\n\nexport interface DiffScope {\n isGroup: boolean;\n session: WorktreeSession | null;\n /** Repos to diff (1 for single, N for group). */\n repos: { name: string; root: string }[];\n /** Name of the repo whose subtree the user is in (initial active tab). */\n activeRepoName: string | null;\n}\n\nexport interface ResolvedBase {\n base: string;\n source: 'arg' | 'session' | 'auto-detected' | 'default';\n}\n\nfunction normPath(p: string): string {\n return path.resolve(p).replace(/\\\\/g, '/').toLowerCase();\n}\n\n/**\n * Like {@link normPath} but resolves to the OS-canonical real path.\n * `git rev-parse --show-toplevel` returns the realpath (e.g. macOS `/var` →\n * `/private/var`, and on Windows the long-form name), so comparing it to a\n * stored session path must canonicalize both sides the same way.\n *\n * Uses `realpathSync.native`: the plain `realpathSync` does NOT expand Windows\n * 8.3 short names (`SAMDEV~1` → `SamDev`), so a session path under a\n * short-name parent would never match git's long-form toplevel. `.native`\n * resolves both 8.3 and symlinks. Falls back to {@link normPath} for paths\n * that don't exist (e.g. unit-test fixtures).\n */\nfunction realNorm(p: string): string {\n try {\n return normPath(fs.realpathSync.native(p));\n } catch {\n return normPath(p);\n }\n}\n\n/**\n * Resolve what scope to diff based on cwd. Handles single-repo worktrees,\n * group worktrees (cwd at group root or anywhere inside a sub-repo), and\n * \"random\" git repos not managed by `work`.\n */\nexport function resolveScope(cwd: string): DiffScope | null {\n const normCwd = normPath(cwd);\n const sessions = loadHistory();\n\n // cwd's own git worktree root. Used to reject session-path matches that are\n // really a *parent* repo: linked worktrees often live physically inside\n // another repo (e.g. `<repo>/.claude/worktrees/<branch>`), so a naive prefix\n // match collapses every nested worktree onto the parent's scope — they'd\n // share one daemon and show each other's diff.\n const top = git(['rev-parse', '--show-toplevel'], cwd);\n const toplevel = top.exitCode === 0 && top.stdout ? top.stdout : null;\n const realTop = toplevel ? realNorm(toplevel) : null;\n\n // 1. cwd is at or inside one of a session's repo paths.\n for (const s of sessions) {\n for (const p of s.paths) {\n const np = normPath(p);\n if (normCwd === np || normCwd.startsWith(np + '/')) {\n // Only honour the match if this session path is cwd's actual worktree\n // root. When cwd is in a nested worktree, its toplevel is deeper than\n // `np` — skip so we resolve the real (nested) worktree below.\n if (realTop && realNorm(p) !== realTop) continue;\n if (s.isGroup) {\n return {\n isGroup: true,\n session: s,\n repos: s.paths.map((rp) => ({ name: path.basename(rp), root: rp })),\n activeRepoName: path.basename(p),\n };\n }\n return {\n isGroup: false,\n session: s,\n repos: [{ name: path.basename(p), root: p }],\n activeRepoName: path.basename(p),\n };\n }\n }\n }\n\n // 2. cwd is at the group root (parent of all of a group's repo paths).\n for (const s of sessions) {\n if (!s.isGroup || s.paths.length === 0) continue;\n const parents = s.paths.map((p) => normPath(path.dirname(p)));\n const groupRoot = parents[0];\n if (!parents.every((par) => par === groupRoot)) continue;\n if (normCwd === groupRoot || normCwd.startsWith(groupRoot + '/')) {\n return {\n isGroup: true,\n session: s,\n repos: s.paths.map((rp) => ({ name: path.basename(rp), root: rp })),\n activeRepoName: null,\n };\n }\n }\n\n // 3. Fall back to git rev-parse for repos not managed by `work`.\n if (!toplevel) return null;\n return {\n isGroup: false,\n session: null,\n repos: [{ name: path.basename(toplevel), root: toplevel }],\n activeRepoName: path.basename(toplevel),\n };\n}\n\n/**\n * Find any plausible parent branch — same candidate list as\n * `detectParentBranch`, but DOESN'T require the parent to have commits\n * past HEAD. Returns the candidate with the most-recent merge-base (or\n * null only if no candidates exist at all).\n *\n * Used by the static renderer and the diff server's `?base=branch`\n * route to decide whether to offer the \"Since branch\" tab. `detectParentBranch`\n * skips parents where merge-base == HEAD (correct for the CLI's \"show\n * me what I added past parent\" semantic — empty diff), but the toggle\n * should still appear in that case so the user can confirm \"no, there's\n * nothing committed yet\".\n */\nexport function findAnyParentBranch(cwd: string): string | null {\n return runSync(findParent(false), cwd);\n}\n\n/** Walk candidate base branches and pick the one with the most recent merge-base. */\nexport function detectParentBranch(cwd: string): string | null {\n return runSync(findParent(true), cwd);\n}\n\nconst PARENT_CANDIDATES = ['main', 'master', 'dev', 'develop'].flatMap((name) => [name, `origin/${name}`]);\n\n/**\n * The git a lookup asks, one command at a time: it yields a command's arguments and is handed back its answer\n * (stdout trimmed). One implementation, run synchronously for the CLI and the diff routes (`runSync`) or off the\n * event loop for the session's history (`runAsync`).\n */\ntype GitSteps<T> = Generator<string[], T, { exitCode: number; stdout: string }>;\n\nfunction runSync<T>(steps: GitSteps<T>, cwd: string): T {\n let next = steps.next();\n while (!next.done) {\n const r = git(next.value, cwd);\n next = steps.next({ exitCode: r.exitCode, stdout: r.stdout });\n }\n return next.value;\n}\n\nasync function runAsync<T>(steps: GitSteps<T>, run: (args: string[]) => Promise<{ exitCode: number; stdout: string }>): Promise<T> {\n let next = steps.next();\n while (!next.done) next = steps.next(await run(next.value));\n return next.value;\n}\n\nfunction* findParent(requireAheadOfParent: boolean): GitSteps<string | null> {\n const currentResult = yield ['rev-parse', '--abbrev-ref', 'HEAD'];\n const currentBranch = currentResult.exitCode === 0 ? currentResult.stdout : '';\n\n let best: { ref: string; sha: string; time: number } | null = null;\n let fresh: boolean | undefined;\n\n for (const ref of PARENT_CANDIDATES) {\n if (ref === currentBranch) continue;\n const exists = yield ['rev-parse', '--verify', '--quiet', ref];\n if (exists.exitCode !== 0 || !exists.stdout) continue;\n\n const mb = yield ['merge-base', ref, 'HEAD'];\n if (mb.exitCode !== 0 || !mb.stdout) continue;\n\n // Skip parents where the merge-base IS HEAD only when the caller\n // asked us to (CLI \"show me what I added\" semantics): a `dev` that\n // already contains this branch's commits isn't where it came from. When\n // called for the toggle UI, we want to surface the parent even though\n // the diff will be empty. A branch with no commits of its own yet is\n // the exception: there every parent it was made from contains HEAD, and\n // skipping them picked an older mainline — a branch just made from dev\n // showed all of dev's commits since main.\n if (requireAheadOfParent) {\n const headSha = (yield ['rev-parse', 'HEAD']).stdout;\n if (mb.stdout === headSha) {\n fresh ??= yield* stillAtCreation(currentBranch, headSha);\n if (!fresh) continue;\n }\n }\n\n const timeResult = yield ['show', '-s', '--format=%ct', mb.stdout];\n if (timeResult.exitCode !== 0) continue;\n const time = Number(timeResult.stdout);\n if (!Number.isFinite(time)) continue;\n\n // A tie in time (commits made in the same second): the later of the two, the one the other is an ancestor of.\n const later =\n !!best && time === best.time && mb.stdout !== best.sha && (yield ['merge-base', '--is-ancestor', best.sha, mb.stdout]).exitCode === 0;\n if (!best || time > best.time || later) {\n best = { ref, sha: mb.stdout, time };\n }\n }\n\n return best?.ref ?? null;\n}\n\n/**\n * The branch has no commits of its own: it was made here from HEAD or a\n * mainline (its reflog's oldest entry, \"branch: Created from dev\") and HEAD is\n * still that commit. One made from its own `origin/<branch>` (a PR, someone's\n * branch) or at a commit (Restore) carries commits that are its own, though\n * they weren't made here. No reflog (expired, a detached HEAD) says no.\n */\nfunction* stillAtCreation(branch: string, headSha: string): GitSteps<boolean> {\n if (!branch || branch === 'HEAD') return false;\n const log = yield ['reflog', 'show', '--format=%H %gs', `refs/heads/${branch}`, '--'];\n if (log.exitCode !== 0 || !log.stdout) return false;\n const lines = log.stdout.split('\\n').filter(Boolean);\n const m = /^(\\S+) branch: Created from (\\S+)$/.exec(lines[lines.length - 1] ?? '');\n if (!m || m[1] !== headSha) return false;\n const from = m[2].replace(/^refs\\/(heads|remotes)\\//, '');\n return from === 'HEAD' || PARENT_CANDIDATES.includes(from);\n}\n\n/**\n * A recorded base, as fresh as this clone has it: the branch or its\n * `origin/` copy, whichever shares the later commit with HEAD (the local one\n * is pulled only when a worktree is made from it, so it falls behind a branch\n * that merged origin's since). Null when neither exists (deleted since).\n */\nfunction* recordedBase(name: string): GitSteps<{ ref: string; mb: string } | null> {\n const refs = name.startsWith('origin/') ? [name] : [name, `origin/${name}`];\n let best: { ref: string; mb: string } | null = null;\n for (const ref of refs) {\n if ((yield ['rev-parse', '--verify', '--quiet', ref]).exitCode !== 0) continue;\n const mb = yield ['merge-base', ref, 'HEAD'];\n if (mb.exitCode !== 0 || !mb.stdout) continue;\n if (!best || (mb.stdout !== best.mb && (yield ['merge-base', '--is-ancestor', best.mb, mb.stdout]).exitCode === 0)) {\n best = { ref, mb: mb.stdout };\n }\n }\n return best;\n}\n\nexport function resolveBase(scope: DiffScope, argv: { base?: string; branch?: boolean }): ResolvedBase {\n if (argv.base) return { base: argv.base, source: 'arg' };\n\n if (argv.branch) {\n if (scope.session?.baseBranch) {\n return { base: scope.session.baseBranch, source: 'session' };\n }\n const primaryRoot = scope.repos.find((r) => r.name === scope.activeRepoName)?.root ?? scope.repos[0].root;\n const detected = detectParentBranch(primaryRoot);\n if (detected) return { base: detected, source: 'auto-detected' };\n\n report('error', 'Could not determine a parent branch for this worktree.');\n report('detail', 'Pass one explicitly: diff <ref>');\n process.exit(1);\n }\n\n return { base: 'HEAD', source: 'default' };\n}\n\n/**\n * Compute per-repo merge-base when comparing against a non-HEAD ref.\n *\n * `perRepoBase` (keyed by repo root) overrides `base` for individual repos —\n * used by group worktrees forked with different bases per repo\n * (`work tree --base backend=dev --base frontend=feat/x`). A repo without an\n * override falls back to the shared `base`.\n */\nexport function buildRepoSpecs(scope: DiffScope, base: string, perRepoBase?: Record<string, string>): RepoSpec[] {\n return scope.repos.map((r) => {\n const repoBase = perRepoBase?.[r.root] ?? base;\n let diffArg = repoBase;\n if (repoBase !== 'HEAD') {\n const mb = git(['merge-base', repoBase, 'HEAD'], r.root);\n if (mb.exitCode === 0 && mb.stdout) diffArg = mb.stdout;\n }\n return { name: r.name, root: r.root, diffArg };\n });\n}\n\nexport interface ResolvedRepoDiff {\n /** The git ref the diff was computed against. `HEAD` for uncommitted,\n * the resolved parent (e.g. `origin/main`) for branch mode. */\n resolvedBase: string;\n /** The actual argument passed to `git diff` — typically the merge-base\n * sha for branch mode, or `HEAD` for uncommitted. */\n diffArg: string;\n}\n\n/**\n * Resolve the diff target for a single repo. Centralises the\n * \"find-parent → merge-base → fall back to HEAD\" dance that previously\n * lived in three places (scope-routes, web-server, the static renderer).\n *\n * For `base === 'uncommitted'` this is trivially `HEAD`. For\n * `base === 'branch'` it prefers an explicit `sessionBaseBranch` (the\n * value the user recorded with `work tree --base`), falling back to\n * `findAnyParentBranch` (so the toggle stays available even when the\n * branch has no commits past parent yet — diff just renders empty).\n */\nexport function resolveRepoDiff(root: string, base: 'uncommitted' | 'branch', sessionBaseBranch?: string | null): ResolvedRepoDiff {\n return runSync(repoDiffSteps(base, sessionBaseBranch), root);\n}\n\n/** resolveRepoDiff off the event loop (`run`: git in the repo, stdout trimmed): the session history's route. */\nexport function resolveRepoDiffAsync(\n base: 'uncommitted' | 'branch',\n sessionBaseBranch: string | null | undefined,\n run: (args: string[]) => Promise<{ exitCode: number; stdout: string }>,\n): Promise<ResolvedRepoDiff> {\n return runAsync(repoDiffSteps(base, sessionBaseBranch), run);\n}\n\nfunction* repoDiffSteps(base: 'uncommitted' | 'branch', sessionBaseBranch?: string | null): GitSteps<ResolvedRepoDiff> {\n if (base === 'uncommitted') {\n return { resolvedBase: 'HEAD', diffArg: 'HEAD' };\n }\n // Prefer a parent we're actually *ahead of* (`detectParentBranch` skips\n // candidates whose merge-base is HEAD, e.g. a `dev` that already contains\n // this branch — unless the branch has no commits yet, when the one it was\n // made from is right). `findAnyParentBranch` would pick the most-recent merge-base\n // even when it's HEAD — yielding a useless 0-commit \"since branch\" diff.\n // Fall back to it only so the toggle still resolves to *something*.\n // A recorded base wins, at its freshest; one that's gone (merged and deleted) leaves it to detection.\n const recorded = sessionBaseBranch ? yield* recordedBase(sessionBaseBranch) : null;\n if (recorded) return { resolvedBase: recorded.ref, diffArg: recorded.mb };\n const parent = (yield* findParent(true)) ?? (yield* findParent(false));\n if (!parent) return { resolvedBase: 'HEAD', diffArg: 'HEAD' };\n let diffArg = 'HEAD';\n const mb = yield ['merge-base', parent, 'HEAD'];\n if (mb.exitCode === 0 && mb.stdout) diffArg = mb.stdout;\n return { resolvedBase: parent, diffArg };\n}\n\n/**\n * Look up the recorded fork point for a worktree path from session history.\n * Prefers the per-repo base (`baseBranches`) for that exact path, falling\n * back to the session's representative `baseBranch`. Returns undefined when\n * the path isn't a known worktree — callers then auto-detect.\n *\n * Used by the scope diff route, which only carries repo paths (no session),\n * so a `wd` forked with `--base feat/x` still diffs against `feat/x` even\n * though auto-detection wouldn't find a non-mainline parent.\n */\nexport function sessionBaseForPath(root: string): string | undefined {\n const norm = normPath(root);\n for (const s of loadHistory()) {\n for (const p of s.paths) {\n if (normPath(p) === norm) {\n return s.baseBranches?.[p] ?? s.baseBranch;\n }\n }\n }\n return undefined;\n}\n","import fs from 'node:fs';\nimport { packageRoot } from './package-root.js';\nimport http from 'node:http';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst MIME: Record<string, string> = {\n '.html': 'text/html; charset=utf-8',\n '.js': 'application/javascript; charset=utf-8',\n '.mjs': 'application/javascript; charset=utf-8',\n '.css': 'text/css; charset=utf-8',\n '.json': 'application/json; charset=utf-8',\n '.svg': 'image/svg+xml',\n '.ico': 'image/x-icon',\n '.map': 'application/json; charset=utf-8',\n};\n\n/** Resolve the directory shipped by the Vite build. */\nexport function resolveWebRoot(): string | null {\n const entryDir = path.dirname(process.argv[1] ?? '');\n const moduleDir = path.dirname(fileURLToPath(import.meta.url));\n const candidates = [\n path.join(entryDir, 'web'),\n // bundled: this module is inlined into dist/<bin>.js, so dist/web is a\n // sibling of the bundle. Works even when argv[1] is an npm bin symlink\n // (which is not realpath'd, so the entryDir candidate above misses).\n path.join(moduleDir, 'web'),\n // dev/tsx: the package's dist/web (wherever under src/ this module sits).\n ...(packageRoot() ? [path.join(packageRoot()!, 'dist', 'web')] : []),\n ];\n for (const c of candidates) {\n if (fs.existsSync(path.join(c, 'index.html'))) return c;\n }\n return null;\n}\n\n/**\n * Serve a static file under `root`. Returns true if it served a file. Does\n * NOT do SPA fallback — caller decides whether to re-try with /index.html\n * on miss.\n */\nexport function serveStatic(root: string, urlPath: string, res: http.ServerResponse): boolean {\n const clean = urlPath.split('?')[0];\n const requested = clean === '/' ? '/index.html' : clean;\n const filePath = path.join(root, requested);\n const norm = path.normalize(filePath);\n const base = path.normalize(root);\n if (norm !== base && !norm.startsWith(base + path.sep)) return false;\n let stat: fs.Stats;\n try {\n stat = fs.statSync(norm);\n } catch {\n return false;\n }\n if (!stat.isFile()) return false;\n const ext = path.extname(norm).toLowerCase();\n res.writeHead(200, {\n 'Content-Type': MIME[ext] ?? 'application/octet-stream',\n 'Cache-Control': 'no-cache',\n });\n fs.createReadStream(norm).pipe(res);\n return true;\n}\n\n/** Convenience: serve the file if it exists, else fall back to index.html. */\nexport function serveStaticOrShell(root: string, urlPath: string, res: http.ServerResponse): boolean {\n if (serveStatic(root, urlPath, res)) return true;\n if (serveStatic(root, '/index.html', res)) return true;\n return false;\n}\n","/**\n * Who may talk to our localhost servers (work web / wd / comment server).\n *\n * Binding to 127.0.0.1 keeps the network out, and the Host check stops DNS\n * rebinding — but neither stops a web page you have open from making YOUR\n * browser send requests to 127.0.0.1:<port> (cross-site request forgery).\n * The port is predictable and session ids are guessable, and the terminal\n * WebSocket types straight into Claude — so every request that changes\n * something, and every WebSocket upgrade, must come from our own origin.\n *\n * Rules:\n * - Host must be 127.0.0.1:<port> or localhost:<port> (DNS rebinding).\n * - A browser marking the request `Sec-Fetch-Site: cross-site` (or\n * `same-site`: another localhost port) is refused,\n * except a top-level page load (GET/HEAD, `Sec-Fetch-Mode: navigate`,\n * `Sec-Fetch-Dest: document`): clicking a dashboard or diff link in\n * GitHub, Jira or Slack must open it. The opening site can't read the\n * response and a GET changes nothing; frames stay refused, so no other\n * page can embed the dashboard.\n * - Mutating requests (anything but GET/HEAD/OPTIONS) and WebSocket\n * upgrades: `Origin` must be absent (non-browser callers — the Claude\n * hooks, `wd`, the CLI — send none) or exactly our own origin. Browsers\n * always send Origin on cross-origin POSTs and on every WebSocket, and a\n * page can't forge it. `Origin: null` (sandboxed frames, file://) is\n * refused.\n */\n\nexport function allowedHost(host: string | undefined, port: number): boolean {\n return host === `127.0.0.1:${port}` || host === `localhost:${port}`;\n}\n\nexport function allowedOrigin(origin: string | undefined, port: number): boolean {\n if (origin === undefined || origin === '') return true;\n return origin === `http://127.0.0.1:${port}` || origin === `http://localhost:${port}`;\n}\n\nconst SAFE_METHODS = new Set(['GET', 'HEAD', 'OPTIONS']);\n\nexport interface RequestFacts {\n method: string;\n host?: string;\n origin?: string;\n secFetchSite?: string;\n secFetchMode?: string;\n secFetchDest?: string;\n /** A WebSocket upgrade — always checked like a mutating request. */\n upgrade?: boolean;\n}\n\n/** Null when allowed, else a short reason (for the 403 body / logs). */\nexport function refuseReason(req: RequestFacts, port: number): string | null {\n if (!allowedHost(req.host, port)) return 'bad host';\n const mutating = req.upgrade || !SAFE_METHODS.has(req.method.toUpperCase());\n const pageLoad =\n !req.upgrade &&\n ['GET', 'HEAD'].includes(req.method.toUpperCase()) &&\n req.secFetchMode === 'navigate' &&\n req.secFetchDest === 'document';\n // same-site = another localhost port (your dev servers, say): the\n // dashboard itself is always same-origin, so treat it like cross-site.\n if ((req.secFetchSite === 'cross-site' || req.secFetchSite === 'same-site') && !pageLoad) return 'cross-site request';\n if (mutating && !allowedOrigin(req.origin, port)) return 'foreign origin';\n return null;\n}\n","import { report } from '../core/platform/report.js';\nimport { Hono } from 'hono';\nimport { serve, type ServerType } from '@hono/node-server';\nimport { refuseReason } from './local-origin.js';\n\n// The one way to start a local HTTP server (work web, wd, the comment\n// server, the demo): 127.0.0.1 only, random port, behind the Host/Origin\n// guard. Its own module so a server that needs no git/fs — the demo — can\n// use it without importing the diff server.\n\nexport interface DiffServerHandle {\n url: string;\n port: number;\n stop(): Promise<void>;\n}\n\n/** Start a Hono app on a random port; resolve when it's listening. The\n * raw Node server is exposed via `httpServer` so callers can attach\n * WebSocket upgrade handlers (the terminal bridge).\n *\n * Installs a guard (core/local-origin.ts): Host must be ours (DNS\n * rebinding), and mutating requests must not come from another origin\n * (cross-site request forgery from any page open in the browser). The SPA\n * is served same-origin, and Node callers send no Origin, so both pass.\n */\nexport function launch(app: Hono): Promise<DiffServerHandle & { httpServer: ServerType }> {\n return new Promise((resolve) => {\n // Captured before serve() resolves; first guarded request runs after\n // this is set because serve() doesn't accept connections until it's\n // bound, and bind precedes the info-callback.\n let listenPort = 0;\n const guard = new Hono();\n guard.use('*', async (c, next) => {\n // Host (DNS rebinding) + Origin / Sec-Fetch-Site (cross-site request\n // forgery from any page open in the browser) — see local-origin.ts.\n const reason = refuseReason(\n {\n method: c.req.method,\n host: c.req.header('host'),\n origin: c.req.header('origin'),\n secFetchSite: c.req.header('sec-fetch-site'),\n secFetchMode: c.req.header('sec-fetch-mode'),\n secFetchDest: c.req.header('sec-fetch-dest'),\n },\n listenPort,\n );\n if (reason) return c.text(`Forbidden (${reason})`, 403);\n await next();\n });\n guard.route('/', app);\n\n const server: ServerType = serve({ fetch: guard.fetch, port: 0, hostname: '127.0.0.1' }, (info) => {\n listenPort = info.port;\n const url = `http://127.0.0.1:${info.port}/`;\n report('detail', `[server] listening at ${url}`);\n resolve({\n url,\n port: info.port,\n httpServer: server,\n stop: () =>\n new Promise<void>((res) => {\n server.close(() => res());\n }),\n });\n });\n });\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport type { Context } from 'hono';\n\nconst MIME: Record<string, string> = {\n '.html': 'text/html; charset=utf-8',\n '.js': 'application/javascript; charset=utf-8',\n '.mjs': 'application/javascript; charset=utf-8',\n '.css': 'text/css; charset=utf-8',\n '.json': 'application/json; charset=utf-8',\n '.svg': 'image/svg+xml',\n '.ico': 'image/x-icon',\n '.map': 'application/json; charset=utf-8',\n};\n\nfunction readFile(root: string, relPath: string): { body: Buffer; ext: string } | null {\n const clean = relPath.split('?')[0];\n const requested = clean === '/' ? '/index.html' : clean;\n const filePath = path.join(root, requested);\n const norm = path.normalize(filePath);\n if (!norm.startsWith(path.normalize(root))) return null;\n let stat: fs.Stats;\n try {\n stat = fs.statSync(norm);\n } catch {\n return null;\n }\n if (!stat.isFile()) return null;\n const ext = path.extname(norm).toLowerCase();\n return { body: fs.readFileSync(norm), ext };\n}\n\n/**\n * Hono handler for the bundled SPA. Tries to serve the requested file; if it\n * doesn't exist, falls back to index.html so client-side routing works on\n * deep links. Skips /api/* paths entirely (those should be handled by\n * earlier routes; if we reach here it's a 404).\n */\nexport function serveSpa(c: Context, webRoot: string): Response {\n const url = new URL(c.req.url);\n if (url.pathname.startsWith('/api/')) {\n return c.json({ error: 'not found' }, 404);\n }\n const hit = readFile(webRoot, url.pathname) ?? readFile(webRoot, '/index.html');\n if (!hit) return c.json({ error: 'not found' }, 404);\n return new Response(new Uint8Array(hit.body), {\n status: 200,\n headers: {\n 'Content-Type': MIME[hit.ext] ?? 'application/octet-stream',\n 'Cache-Control': 'no-cache',\n },\n });\n}\n","import { launch, type DiffServerHandle } from './local-server.js';\n\nexport { launch, type DiffServerHandle } from './local-server.js';\nimport { Hono, type Context } from 'hono';\nimport { streamSSE } from 'hono/streaming';\nimport { computeDiff } from '../core/diff/diff-pipeline.js';\nimport { readContextLines } from '../core/diff/file-context.js';\nimport { createFsWatcher } from '../core/platform/fs-watcher.js';\nimport { resolveRepoDiff } from '../core/diff/diff-scope.js';\nimport { git } from '../core/git/git.js';\nimport { resolveWebRoot } from '../core/platform/web-static.js';\nimport { serveSpa } from './spa-handler.js';\nimport type { RepoSpec } from '../core/diff/repo-spec.js';\n\nexport interface DiffServerOptions {\n /** Repos this server scopes to. */\n repos: RepoSpec[];\n /** Short human-readable label for /api/context. */\n scopeLabel: string;\n /** Optional session baseBranch (the value captured at `work tree --base`).\n * When set, the `?base=branch` route uses it instead of auto-detection,\n * so the diff matches what the user actually declared. */\n sessionBaseBranch?: string;\n /** Per-repo fork points keyed by repo root. Overrides `sessionBaseBranch`\n * for individual repos in a group forked with different bases per repo. */\n sessionBaseBranches?: Record<string, string>;\n /** Debounce for fs.watch events before broadcasting diff-changed. */\n watchDebounceMs?: number;\n /** When true, /api/context advertises readOnly=true and the SPA hides\n * the comment UI. Default false. */\n readOnly?: boolean;\n /** Called once the base app is built so feature apps (e.g. comments) can\n * mount themselves and emit events via the SSE hub. */\n attachRoutes?: (api: DiffServerApi) => void;\n}\n\n/** A typed SSE event broadcast to every connected client. */\nexport interface SseEvent {\n event: string;\n data: unknown;\n}\n\nexport interface DiffServerApi {\n /** Mount a Hono sub-app at the given path prefix. */\n route(prefix: string, app: Hono): void;\n /** Broadcast on the shared SSE hub. Fan-out is one-shot per client. */\n broadcast(event: string, data: unknown): void;\n}\n\n/**\n * The shared local HTTP server used by both `wd` (read-only) and `wd -c`\n * (comments). Owns the fs watcher, the SSE hub, and the three routes every\n * mode needs: GET /api/context, GET /api/diff, GET /events. Comment routes\n * register themselves via `attachRoutes`.\n */\nexport async function startDiffServer(opts: DiffServerOptions): Promise<DiffServerHandle> {\n const webRoot = resolveWebRoot();\n if (!webRoot) {\n throw new Error('Could not find dist/web/. Run `npm run build` first.');\n }\n\n const sseListeners = new Set<(e: SseEvent) => void>();\n const watcher = createFsWatcher({\n roots: opts.repos.map((r) => r.root),\n debounceMs: opts.watchDebounceMs,\n onChange: () => broadcast('diff-changed', { ts: Date.now() }),\n });\n\n function broadcast(event: string, data: unknown): void {\n const payload: SseEvent = { event, data };\n for (const cb of sseListeners) cb(payload);\n }\n\n const app = new Hono();\n // No CORS headers and no OPTIONS preflight handler — the SPA is served\n // same-origin so its requests don't trigger preflight. The Host guard in\n // `launch` rejects cross-origin requests before they reach any handler.\n\n app.get('/api/context', (c) => {\n // Current branch of the primary repo, for the \"<branch> vs <base>\" title.\n const primaryRoot = opts.repos[0]?.root;\n let headBranch: string | undefined;\n if (primaryRoot) {\n const head = git(['rev-parse', '--abbrev-ref', 'HEAD'], primaryRoot);\n if (head.exitCode === 0 && head.stdout && head.stdout !== 'HEAD') {\n headBranch = head.stdout;\n }\n }\n return c.json({\n mode: 'review',\n scopeLabel: opts.scopeLabel,\n repos: opts.repos.map((r) => ({ name: r.name })),\n readOnly: !!opts.readOnly,\n headBranch,\n });\n });\n\n app.get('/api/diff', (c) => {\n const base = c.req.query('base') === 'branch' ? 'branch' : 'uncommitted';\n try {\n // For 'uncommitted' we honour the configured `diffArg` (typically\n // HEAD) so single-repo callers preserve whatever ref they\n // configured. For 'branch' we delegate to `resolveRepoDiff` per\n // repo — each one resolves its own parent and merge-base. The\n // top-level `resolvedBase` is the primary repo's value (matches\n // scope-routes and web-server behavior for the badge label).\n const resolved = opts.repos.map((r) =>\n base === 'uncommitted'\n ? { resolvedBase: 'HEAD', diffArg: r.diffArg }\n : resolveRepoDiff(r.root, 'branch', opts.sessionBaseBranches?.[r.root] ?? opts.sessionBaseBranch),\n );\n const repos = opts.repos.map((r, i) => ({\n name: r.name,\n root: r.root,\n resolvedBase: resolved[i].resolvedBase,\n files: computeDiff({ root: r.root, diffArg: resolved[i].diffArg }),\n }));\n const resolvedBase = resolved[0]?.resolvedBase ?? 'HEAD';\n return c.json({ repos, base, resolvedBase });\n } catch (err) {\n return c.json({ error: (err as Error).message }, 500);\n }\n });\n\n // Reveal unchanged context lines around a hunk (\"expand lines\"). Maps the\n // SPA's repo name back to its RepoSpec root; single-repo scopes (the\n // common standalone case) skip the lookup.\n app.get('/api/file-lines', (c) => {\n const repoName = c.req.query('repo') ?? '';\n const relPath = c.req.query('path') ?? '';\n const start = Number(c.req.query('start'));\n const end = Number(c.req.query('end'));\n const ref = c.req.query('ref') || undefined;\n if (!relPath || !Number.isInteger(start) || !Number.isInteger(end)) {\n return c.json({ error: 'bad path/start/end' }, 400);\n }\n const root = opts.repos.length === 1 ? opts.repos[0].root : opts.repos.find((r) => r.name === repoName)?.root;\n if (!root) return c.json({ error: 'unknown repo' }, 404);\n const result = readContextLines({ root, relPath, start, end, ref });\n if (!result) return c.json({ error: 'cannot read file' }, 400);\n return c.json(result);\n });\n\n app.get('/events', (c) =>\n streamSSE(c, async (stream) => {\n const listener = (e: SseEvent) => {\n stream.writeSSE({ event: e.event, data: JSON.stringify(e.data) }).catch(() => {\n /* client gone */\n });\n };\n sseListeners.add(listener);\n await stream.writeSSE({ event: 'connected', data: '' });\n // Keep the stream open until the client disconnects.\n await new Promise<void>((resolve) => {\n stream.onAbort(() => {\n sseListeners.delete(listener);\n resolve();\n });\n });\n }),\n );\n\n // attachRoutes can mount Hono sub-apps with their own routes.\n if (opts.attachRoutes) {\n opts.attachRoutes({\n route: (prefix, sub) => app.route(prefix, sub),\n broadcast,\n });\n }\n\n // SPA fallback for the bundled web assets.\n app.get('*', (c: Context) => serveSpa(c, webRoot));\n\n // Wrap the handle so server shutdown also tears down our chokidar watcher.\n // Without this the watcher keeps Node's event loop open after `stop()` —\n // a real test/teardown leak (vitest hangs after a suite that exercises\n // the server) and a wasteful long-running ghost in dev.\n const handle = await launch(app);\n const baseStop = handle.stop;\n return {\n ...handle,\n stop: async () => {\n try {\n watcher.stop();\n } catch {\n /* */\n }\n await baseStop();\n },\n };\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport spawn from '../platform/spawn.js';\nimport { isInsideRoot } from './diff-pipeline.js';\n\nexport interface ContextLinesOptions {\n /** Git toplevel (repo root) the file lives under. */\n root: string;\n /** Repo-relative path of the file. */\n relPath: string;\n /** 1-based inclusive first line to return. */\n start: number;\n /** 1-based inclusive last line to return. */\n end: number;\n /** When omitted or `'working'`, read the working-tree file. Otherwise the\n * content comes from `git show <ref>:<relPath>` — used when the diff's\n * \"new\" side is a committed snapshot (checkpoint range) rather than the\n * live tree. */\n ref?: string;\n}\n\nexport interface ContextLinesResult {\n /** The requested slice. Shorter than `end - start + 1` when the file ends\n * before `end`. */\n lines: string[];\n /** Echoed 1-based first line of `lines` (clamped to >= 1). */\n start: number;\n /** Total line count of the file at this ref. */\n totalLines: number;\n /** True when `end` reached (or passed) the last line — there is nothing\n * further below to expand. */\n eof: boolean;\n}\n\n/**\n * Read a contiguous range of lines from a file so the diff viewer can\n * reveal the unchanged context around hunks (\"expand lines\" in GitHub's\n * UI). The expandable region is, by definition, identical on both diff\n * sides, so a single read of the appropriate side is enough — the caller\n * maps the old line numbers via the constant gap offset.\n *\n * Path safety mirrors `readMarkdownContent` in diff-pipeline: the textual\n * `relPath` is rejected if it escapes `root`, and the working-tree read is\n * symlink-canonicalised so a `notes.md -> /etc/passwd` symlink can't\n * exfiltrate an out-of-tree file into the payload.\n *\n * Returns `null` when the path is rejected or the content can't be read\n * (missing file, unknown ref, binary). Callers surface that as a 404/400.\n */\nexport function readContextLines(opts: ContextLinesOptions): ContextLinesResult | null {\n const { root, relPath, ref } = opts;\n if (!relPath || !isInsideRoot(root, relPath)) return null;\n\n const start = Math.max(1, Math.floor(opts.start));\n const end = Math.max(start, Math.floor(opts.end));\n\n const content = !ref || ref === 'working' ? readWorkingTree(root, relPath) : readAtRef(root, ref, relPath);\n if (content === null) return null;\n\n // Split on either line ending; drop the trailing empty element a final\n // newline produces so `totalLines` matches the line count git/editors\n // report. Matches how `parseGitDiff` strips line endings from hunk text,\n // so revealed context lines render identically to diff context lines.\n const all = content.split(/\\r?\\n/);\n if (all.length > 0 && all[all.length - 1] === '') all.pop();\n\n const totalLines = all.length;\n // start past EOF → empty slice, eof true.\n const slice = all.slice(start - 1, end);\n return {\n lines: slice,\n start,\n totalLines,\n eof: end >= totalLines,\n };\n}\n\n/** Symlink-safe working-tree read. Returns null on any failure. */\nfunction readWorkingTree(root: string, relPath: string): string | null {\n try {\n const absPath = path.join(root, relPath);\n const realRoot = fs.realpathSync(path.resolve(root));\n const realPath = fs.realpathSync(absPath);\n const sep = path.sep;\n if (realPath !== realRoot && !realPath.startsWith(realRoot + sep)) {\n return null;\n }\n return fs.readFileSync(absPath, 'utf-8');\n } catch {\n return null;\n }\n}\n\n/**\n * A ref we may hand to `git show`: a commit id, or a plain ref name. It\n * comes from a query string, and `git show` takes options — a ref of\n * `--output=/some/file` would make it WRITE a file. So nothing that starts\n * with `-`, and only characters refs actually use.\n */\nexport function isSafeRef(ref: string): boolean {\n return /^[A-Za-z0-9_][A-Za-z0-9._/~^@{}+-]{0,199}$/.test(ref) && !ref.includes('..');\n}\n\n/** `git show <ref>:<relPath>`. Uses cross-spawn directly (not the trimming\n * `git()` helper) so trailing newlines survive. Returns null on failure\n * (including a ref that isn't safe to pass — see isSafeRef). */\nfunction readAtRef(root: string, ref: string, relPath: string): string | null {\n if (!isSafeRef(ref)) return null;\n const r = spawn.sync('git', ['show', '--end-of-options', `${ref}:${relPath}`], {\n cwd: root,\n encoding: 'utf-8',\n maxBuffer: 64 * 1024 * 1024,\n windowsHide: true,\n });\n if (r.status === 0 && typeof r.stdout === 'string') return r.stdout;\n return null;\n}\n","/**\n * Shared zod schemas for the comment HTTP surface. Kept separate from\n * `comment-types.ts` because the SPA imports `comment-types.ts` for the\n * type-only exports and pulling zod into the SPA bundle is wasteful —\n * the schemas are server-side validation only.\n */\n\nimport { z } from 'zod';\n\nexport const commentInputSchema = z.object({\n repo: z.string().optional(),\n file: z.string().optional(),\n line: z.number().int().optional(),\n side: z.enum(['left', 'right', 'general', 'file']).optional(),\n body: z.string().min(1),\n status: z.enum(['published', 'draft']).optional(),\n lineContent: z.string().optional(),\n parentId: z.string().optional(),\n author: z.enum(['user', 'claude']).optional(),\n});\n\nexport const submitReviewSchema = z.object({\n summary: z.string().optional(),\n});\n\nexport const resolveSchema = z.object({\n resolved: z.boolean(),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAoBjB,SAAS,SAAS,GAAmB;AACnC,SAAO,KAAK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 -0,0 +1,150 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/core/platform/find-on-path.ts
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
function isProgramFile(p, platform = process.platform) {
|
|
7
|
+
const win = platform === "win32";
|
|
8
|
+
try {
|
|
9
|
+
const st = fs.statSync(p);
|
|
10
|
+
return st.isFile() && (win || (st.mode & 73) !== 0);
|
|
11
|
+
} catch {
|
|
12
|
+
if (!win) return false;
|
|
13
|
+
try {
|
|
14
|
+
return !fs.lstatSync(p).isDirectory();
|
|
15
|
+
} catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function pathExtOf(env) {
|
|
21
|
+
return (env.PATHEXT ?? env.Pathext ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean).map((e) => e.toLowerCase());
|
|
22
|
+
}
|
|
23
|
+
function findOnPath(cmd, env = process.env, platform = process.platform) {
|
|
24
|
+
const win = platform === "win32";
|
|
25
|
+
const isFile = (p) => isProgramFile(p, platform);
|
|
26
|
+
const pathExt = pathExtOf(env);
|
|
27
|
+
const hasExt = pathExt.includes(path.extname(cmd).toLowerCase());
|
|
28
|
+
const candidates = (base) => !win || hasExt ? [base] : pathExt.map((e) => base + e);
|
|
29
|
+
if (cmd.includes("/") || win && cmd.includes("\\")) return candidates(cmd).find(isFile) ?? null;
|
|
30
|
+
const dirs = (env.PATH ?? env.Path ?? "").split(win ? ";" : path.delimiter).filter(Boolean);
|
|
31
|
+
for (const dir of dirs) {
|
|
32
|
+
const hit = candidates(path.join(dir, cmd)).find(isFile);
|
|
33
|
+
if (hit) return hit;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/core/platform/shell-env.ts
|
|
39
|
+
var NO_CWD_LOOKUP = "NoDefaultCurrentDirectoryInExePath";
|
|
40
|
+
function shellEnv(env = process.env, platform = process.platform) {
|
|
41
|
+
if (platform !== "win32") return env;
|
|
42
|
+
const out = {};
|
|
43
|
+
for (const [k, v] of Object.entries(env)) if (k.toLowerCase() !== NO_CWD_LOOKUP.toLowerCase()) out[k] = v;
|
|
44
|
+
out[NO_CWD_LOOKUP] = "1";
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// src/core/platform/spawn.ts
|
|
49
|
+
import { createRequire } from "module";
|
|
50
|
+
|
|
51
|
+
// src/core/platform/program-path.ts
|
|
52
|
+
import path2 from "path";
|
|
53
|
+
var hits = /* @__PURE__ */ new Map();
|
|
54
|
+
var isPathLike = (cmd) => /[\\/]/.test(cmd) || path2.win32.isAbsolute(cmd) || /^[A-Za-z]:/.test(cmd);
|
|
55
|
+
function whereOnPath(cmd, env = process.env, platform = process.platform, cwd) {
|
|
56
|
+
if (platform !== "win32") return cmd;
|
|
57
|
+
const pathExt = env.PATHEXT ?? env.Pathext;
|
|
58
|
+
const extEnv = pathExt !== void 0 ? { PATHEXT: pathExt } : {};
|
|
59
|
+
if (isPathLike(cmd)) {
|
|
60
|
+
const full = path2.win32.resolve(cwd ?? process.cwd(), cmd);
|
|
61
|
+
return findOnPath(full, extEnv, "win32") ?? cmd;
|
|
62
|
+
}
|
|
63
|
+
const rawPath = env.PATH ?? env.Path ?? "";
|
|
64
|
+
const key = `${cmd.toLowerCase()}\0${rawPath}\0${pathExt ?? ""}`;
|
|
65
|
+
const cached = hits.get(key);
|
|
66
|
+
if (cached && isProgramFile(cached, "win32")) return cached;
|
|
67
|
+
hits.delete(key);
|
|
68
|
+
const absolute = rawPath.split(";").map((d) => d.trim().replace(/^"(.*)"$/, "$1")).filter((d) => d && path2.win32.isAbsolute(d) && !/^[\\/](?![\\/])/.test(d)).join(";");
|
|
69
|
+
const found = findOnPath(cmd, { PATH: absolute, ...extEnv }, "win32");
|
|
70
|
+
if (found) hits.set(key, found);
|
|
71
|
+
return found;
|
|
72
|
+
}
|
|
73
|
+
var STAND_IN_DIR = "work-not-on-path";
|
|
74
|
+
function notOnPath(cmd, env = process.env) {
|
|
75
|
+
return path2.win32.join(env.SystemRoot ?? env.SYSTEMROOT ?? "C:\\Windows", STAND_IN_DIR, cmd);
|
|
76
|
+
}
|
|
77
|
+
function standInFor(file) {
|
|
78
|
+
const m = /[\\/]work-not-on-path[\\/]([^\\/]+)$/i.exec(file);
|
|
79
|
+
return m ? m[1] : null;
|
|
80
|
+
}
|
|
81
|
+
function explainNotOnPath(err) {
|
|
82
|
+
if (!(err instanceof Error)) return err;
|
|
83
|
+
const e = err;
|
|
84
|
+
const name = (typeof e.path === "string" ? standInFor(e.path) : null) ?? /[\\/]work-not-on-path[\\/]([^\s\\/]+)/i.exec(e.message)?.[1];
|
|
85
|
+
if (!name) return err;
|
|
86
|
+
e.message = `${name} not found on PATH`;
|
|
87
|
+
e.path = name;
|
|
88
|
+
return err;
|
|
89
|
+
}
|
|
90
|
+
function programPath(cmd, env = process.env, platform = process.platform, cwd) {
|
|
91
|
+
return whereOnPath(cmd, env, platform, cwd) ?? notOnPath(cmd, env);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// src/core/platform/spawn.ts
|
|
95
|
+
var loaded = null;
|
|
96
|
+
var load = () => loaded ??= createRequire(import.meta.url)("cross-spawn");
|
|
97
|
+
var BATCH_FILE = /\.(cmd|bat)$/i;
|
|
98
|
+
function onPathOnly(args, platform = process.platform) {
|
|
99
|
+
const [cmd, second, third] = args;
|
|
100
|
+
const at = Array.isArray(second) ? 2 : 1;
|
|
101
|
+
const given = at === 2 ? third : second;
|
|
102
|
+
if (given && "keepCwdLookup" in given) {
|
|
103
|
+
const { keepCwdLookup, ...rest } = given;
|
|
104
|
+
args = [...args];
|
|
105
|
+
args[at] = rest;
|
|
106
|
+
if (keepCwdLookup === true) {
|
|
107
|
+
if (platform !== "win32" || typeof cmd !== "string") return args;
|
|
108
|
+
const cwd2 = typeof rest.cwd === "string" ? rest.cwd : void 0;
|
|
109
|
+
return [programPath(cmd, rest.env ?? process.env, platform, cwd2), ...args.slice(1)];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (platform !== "win32" || typeof cmd !== "string") return args;
|
|
113
|
+
const options = at === 2 ? args[2] : args[1];
|
|
114
|
+
if (options?.shell) {
|
|
115
|
+
const out2 = [...args];
|
|
116
|
+
out2[at] = { ...options, env: shellEnv(options.env ?? process.env, platform) };
|
|
117
|
+
return out2;
|
|
118
|
+
}
|
|
119
|
+
const cwd = typeof options?.cwd === "string" ? options.cwd : void 0;
|
|
120
|
+
const file = programPath(cmd, options?.env ?? process.env, platform, cwd);
|
|
121
|
+
const out = [file, ...args.slice(1)];
|
|
122
|
+
if (BATCH_FILE.test(file)) out[at] = { ...options ?? {}, env: shellEnv(options?.env ?? process.env, platform) };
|
|
123
|
+
return out;
|
|
124
|
+
}
|
|
125
|
+
var spawn = Object.assign(
|
|
126
|
+
(...args) => {
|
|
127
|
+
const child = load()(...onPathOnly(args));
|
|
128
|
+
child.prependListener?.("error", (err) => explainNotOnPath(err));
|
|
129
|
+
return child;
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
sync: (...args) => {
|
|
133
|
+
const r = load().sync(...onPathOnly(args));
|
|
134
|
+
if (r?.error) explainNotOnPath(r.error);
|
|
135
|
+
return r;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
var spawn_default = spawn;
|
|
140
|
+
|
|
141
|
+
export {
|
|
142
|
+
findOnPath,
|
|
143
|
+
whereOnPath,
|
|
144
|
+
notOnPath,
|
|
145
|
+
explainNotOnPath,
|
|
146
|
+
programPath,
|
|
147
|
+
shellEnv,
|
|
148
|
+
spawn_default
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=chunk-EL3XL2OC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/platform/find-on-path.ts","../src/core/platform/shell-env.ts","../src/core/platform/spawn.ts","../src/core/platform/program-path.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\n/**\n * Whether `p` is a program file. Elsewhere than Windows: a file with an executable bit. On Windows: a file — or\n * an App Execution Alias, which `stat` can't read: the stubs in `%LOCALAPPDATA%\\Microsoft\\WindowsApps` (`wt.exe`,\n * `winget.exe`, the Store's `python.exe` and `pwsh.exe`) are reparse points that `stat` answers EACCES for, while\n * `lstat` sees them (as a link). Windows starts them; counting them missing made Windows Terminal look not\n * installed. So on Windows a hit whose `stat` fails but whose `lstat` is there and not a folder counts.\n */\nexport function isProgramFile(p: string, platform: NodeJS.Platform = process.platform): boolean {\n const win = platform === 'win32';\n try {\n const st = fs.statSync(p);\n return st.isFile() && (win || (st.mode & 0o111) !== 0);\n } catch {\n if (!win) return false;\n try {\n return !fs.lstatSync(p).isDirectory();\n } catch {\n return false;\n }\n }\n}\n\n/** PATHEXT's extensions, lower-cased (Windows' default when unset). */\nexport function pathExtOf(env: NodeJS.ProcessEnv): string[] {\n return (env.PATHEXT ?? env.Pathext ?? '.COM;.EXE;.BAT;.CMD')\n .split(';')\n .filter(Boolean)\n .map((e) => e.toLowerCase());\n}\n\n/**\n * The file a command name runs, as a shell finds it: a path is itself, else the\n * first match in PATH. On Windows a name without one of PATHEXT's extensions is\n * tried with each (`claude` is `claude.exe` or `claude.cmd`; npm's extension-less\n * `claude` sh shim beside them is never run) — a path too (`C:\\npm\\claude` starts\n * `C:\\npm\\claude.cmd`, as Windows and cross-spawn would); elsewhere only an\n * executable file counts. Null when there's none.\n */\nexport function findOnPath(cmd: string, env: NodeJS.ProcessEnv = process.env, platform: NodeJS.Platform = process.platform): string | null {\n const win = platform === 'win32';\n const isFile = (p: string) => isProgramFile(p, platform);\n const pathExt = pathExtOf(env);\n const hasExt = pathExt.includes(path.extname(cmd).toLowerCase());\n const candidates = (base: string) => (!win || hasExt ? [base] : pathExt.map((e) => base + e));\n if (cmd.includes('/') || (win && cmd.includes('\\\\'))) return candidates(cmd).find(isFile) ?? null;\n const dirs = (env.PATH ?? env.Path ?? '').split(win ? ';' : path.delimiter).filter(Boolean);\n for (const dir of dirs) {\n const hit = candidates(path.join(dir, cmd)).find(isFile);\n if (hit) return hit;\n }\n return null;\n}\n","/**\n * The environment for a command line a shell runs (`shell: true`, `cmd.exe /c …`): the user's own commands —\n * status hooks, `work run`, a dev server — run with a worktree as the working folder, and on Windows cmd.exe looks\n * a bare program name up in the working folder before PATH, so a `node.bat` or `git.cmd` committed at a branch's\n * root ran in place of the program the command names (measured with an echo-only file). Windows' own switch,\n * `NoDefaultCurrentDirectoryInExePath`, turns that lookup off for the shell and what it starts. A command that\n * means a file of the branch names it by its path (`.\\scripts\\dev.cmd`), which still runs. Off Windows: the\n * environment as given (a POSIX shell never looks in the working folder unless PATH says so).\n *\n * Only for tool runs — the CommandRunner, agents in the PTY host and `launchAi`, status hooks, `work run`, a dev\n * server. Not for long-lived interactive programs work opens for you (the editor, a URL, a terminal): their own\n * terminals and tasks would inherit the switch, changing how your shells there behave. Those calls pass\n * `keepCwdLookup: true` to the spawn wrapper (spawn.ts).\n */\nexport const NO_CWD_LOOKUP = 'NoDefaultCurrentDirectoryInExePath';\n\nexport function shellEnv(env: NodeJS.ProcessEnv = process.env, platform: NodeJS.Platform = process.platform): NodeJS.ProcessEnv {\n if (platform !== 'win32') return env;\n // Windows' variable names are case-blind: drop any other spelling (one saying 0 would win or clash).\n const out: NodeJS.ProcessEnv = {};\n for (const [k, v] of Object.entries(env)) if (k.toLowerCase() !== NO_CWD_LOOKUP.toLowerCase()) out[k] = v;\n out[NO_CWD_LOOKUP] = '1';\n return out;\n}\n","import { createRequire } from 'node:module';\nimport type { ChildProcess, SpawnOptions, SpawnSyncOptions, SpawnSyncReturns } from 'node:child_process';\nimport type CrossSpawnModule from 'cross-spawn';\nimport { explainNotOnPath, programPath } from './program-path.js';\nimport { shellEnv } from './shell-env.js';\n\n/**\n * cross-spawn, loaded on first use. core's modules all spawn through it, and\n * importing it up front put it (and its dependencies) on every `work hook`\n * — which runs twice per turn of every Claude — whether the hook spawned\n * anything or not. Same function, same `.sync`.\n *\n * On Windows a bare program name is started by its absolute path on PATH, never from the working\n * folder (`programPath`, program-path.ts): cross-spawn's lookup checks the spawn's cwd first, and a\n * `git.cmd` at a worktree's root would run in place of git. A path is resolved against the call's\n * cwd, as cross-spawn would. A program that resolves to a batch file runs in cmd.exe, so it gets `shellEnv` too\n * (a bare name inside it isn't looked up in the working folder). A `shell: true` command line is the caller's own: left as it is, run\n * with cmd.exe's lookup in the working folder turned off (`shellEnv`, shell-env.ts). A program\n * that isn't on PATH fails as \"<name> not found on PATH\" (`explainNotOnPath`).\n *\n * `keepCwdLookup: true` (work's own option, taken off before cross-spawn sees the call) leaves `shellEnv` out: for\n * long-lived interactive programs the user works in — an editor, a terminal, the browser — whose own terminals and\n * tasks would otherwise inherit the switch (shell-env.ts). Tool runs (the CommandRunner, agents, hooks, `work run`,\n * a dev server) never pass it.\n */\ntype CrossSpawn = typeof CrossSpawnModule;\n\nlet loaded: CrossSpawn | null = null;\nconst load = (): CrossSpawn => (loaded ??= createRequire(import.meta.url)('cross-spawn') as CrossSpawn);\n\ntype Options = { env?: NodeJS.ProcessEnv; shell?: unknown; cwd?: unknown; keepCwdLookup?: unknown };\n\n/** The spawn wrapper's own option (see above). */\nexport interface KeepCwdLookup {\n keepCwdLookup?: boolean;\n}\n\n/** What Windows starts through cmd.exe: a `.cmd` or `.bat` file. */\nexport const BATCH_FILE = /\\.(cmd|bat)$/i;\n\n/** The call's arguments with its program resolved from PATH (Windows; see above). */\nexport function onPathOnly(args: unknown[], platform: NodeJS.Platform = process.platform): unknown[] {\n const [cmd, second, third] = args;\n const at = Array.isArray(second) ? 2 : 1;\n const given = (at === 2 ? third : second) as Options | undefined;\n if (given && 'keepCwdLookup' in given) {\n // Taken off on every platform: cross-spawn and node never see it.\n const { keepCwdLookup, ...rest } = given;\n args = [...args];\n args[at] = rest;\n if (keepCwdLookup === true) {\n if (platform !== 'win32' || typeof cmd !== 'string') return args;\n const cwd = typeof rest.cwd === 'string' ? rest.cwd : undefined;\n return [programPath(cmd, rest.env ?? process.env, platform, cwd), ...args.slice(1)];\n }\n }\n if (platform !== 'win32' || typeof cmd !== 'string') return args;\n const options = (at === 2 ? args[2] : args[1]) as Options | undefined;\n if (options?.shell) {\n const out = [...args];\n out[at] = { ...options, env: shellEnv(options.env ?? process.env, platform) };\n return out;\n }\n const cwd = typeof options?.cwd === 'string' ? options.cwd : undefined;\n const file = programPath(cmd, options?.env ?? process.env, platform, cwd);\n const out = [file, ...args.slice(1)];\n // A batch file is run by cmd.exe (cross-spawn's `cmd.exe /d /s /c`), and a bare name inside it would be looked up\n // in the working folder first — a worktree's own `probex.bat` in place of the program the batch file means.\n if (BATCH_FILE.test(file)) out[at] = { ...(options ?? {}), env: shellEnv(options?.env ?? process.env, platform) };\n return out;\n}\n\nconst spawn = Object.assign(\n (...args: unknown[]) => {\n const child = (load() as unknown as (...a: unknown[]) => ChildProcess)(...onPathOnly(args));\n // First, so every listener sees the program's name rather than the stand-in path.\n child.prependListener?.('error', (err) => explainNotOnPath(err));\n return child;\n },\n {\n sync: (...args: unknown[]) => {\n const r = (load().sync as unknown as (...a: unknown[]) => SpawnSyncReturns<unknown>)(...onPathOnly(args));\n if (r?.error) explainNotOnPath(r.error);\n return r;\n },\n },\n) as unknown as WorkSpawn;\n\n/** cross-spawn's type, plus `keepCwdLookup` on a call with options. */\ntype WorkSpawn = CrossSpawn & {\n (command: string, args: readonly string[], options: SpawnOptions & KeepCwdLookup): ChildProcess;\n sync: CrossSpawn['sync'] &\n ((command: string, args: readonly string[], options: SpawnSyncOptions & KeepCwdLookup) => SpawnSyncReturns<Buffer>);\n};\n\nexport default spawn;\n","import path from 'node:path';\nimport { findOnPath, isProgramFile } from './find-on-path.js';\n\n/**\n * The program a bare command name starts, from PATH only — never the working folder.\n *\n * On Windows every way of starting a program by its bare name looks in the working folder first:\n * cross-spawn's lookup (node-which \"always checks the cwd first\", after a `chdir` into the spawn's\n * cwd), libuv's own (`execFile('git', …, {cwd})`) and cmd.exe's. work runs git, gh, az and acli with\n * the cwd in a worktree — someone else's branch too (Review, Work on it) — so a `git.cmd`, `gh.cmd` or\n * `git.exe` committed at its root ran in place of the real tool (measured with an echo-only file).\n * So on Windows a bare name is resolved here to the absolute file on PATH (absolute PATH entries\n * only: a relative one is the working folder again) and that path is what's started. App Execution\n * Aliases (`wt.exe`, `winget`, the Store's `python`) count: `stat` can't read them, Windows starts\n * them (`isProgramFile`). Not found: a path that doesn't exist, so the start fails as \"not installed\"\n * (ENOENT, said as \"<name> not found on PATH\": `explainNotOnPath`) and nothing from the working folder\n * runs. A name with a path in it (`./x`, `C:\\npm\\claude`) is resolved as Windows itself would — against\n * the start's working folder, with PATHEXT's extensions when it has none (`C:\\npm\\claude` is\n * `claude.cmd` beside it) — so what is judged (a batch file or not) is the file that really starts.\n * Off Windows everything is left as given (a POSIX lookup never takes the working folder unless PATH\n * says so).\n */\n\n/** Hits per name + PATH + PATHEXT, checked to still be there on use; a miss is never kept (a tool installed later is found). */\nconst hits = new Map<string, string>();\n\n/** Whether `cmd` names a path rather than a program to look up. */\nconst isPathLike = (cmd: string) => /[\\\\/]/.test(cmd) || path.win32.isAbsolute(cmd) || /^[A-Za-z]:/.test(cmd);\n\n/**\n * The absolute file PATH gives `cmd` on Windows (absolute PATH entries only), or null; `cmd` as given anywhere else.\n * A path is resolved against `cwd` (the start's working folder; this process's when not given) with PATHEXT's\n * extensions; one that doesn't resolve is returned as given (its start fails as not found by itself).\n */\nexport function whereOnPath(\n cmd: string,\n env: NodeJS.ProcessEnv = process.env,\n platform: NodeJS.Platform = process.platform,\n cwd?: string,\n): string | null {\n if (platform !== 'win32') return cmd;\n const pathExt = env.PATHEXT ?? env.Pathext;\n const extEnv = pathExt !== undefined ? { PATHEXT: pathExt } : {};\n if (isPathLike(cmd)) {\n const full = path.win32.resolve(cwd ?? process.cwd(), cmd);\n return findOnPath(full, extEnv, 'win32') ?? cmd;\n }\n const rawPath = env.PATH ?? env.Path ?? '';\n const key = `${cmd.toLowerCase()}\\0${rawPath}\\0${pathExt ?? ''}`;\n const cached = hits.get(key);\n if (cached && isProgramFile(cached, 'win32')) return cached;\n hits.delete(key);\n const absolute = rawPath\n .split(';')\n .map((d) => d.trim().replace(/^\"(.*)\"$/, '$1'))\n .filter((d) => d && path.win32.isAbsolute(d) && !/^[\\\\/](?![\\\\/])/.test(d))\n .join(';');\n const found = findOnPath(cmd, { PATH: absolute, ...extEnv }, 'win32');\n if (found) hits.set(key, found);\n return found;\n}\n\n/** The folder the stand-in for a program that isn't on PATH is in (never created). */\nconst STAND_IN_DIR = 'work-not-on-path';\n\n/** Where a program that isn't on PATH is \"started\" from: a folder that isn't there, so the start fails as not found. */\nexport function notOnPath(cmd: string, env: NodeJS.ProcessEnv = process.env): string {\n return path.win32.join(env.SystemRoot ?? env.SYSTEMROOT ?? 'C:\\\\Windows', STAND_IN_DIR, cmd);\n}\n\n/** The program name a `notOnPath` stand-in stands for, or null when `file` isn't one. */\nexport function standInFor(file: string): string | null {\n const m = /[\\\\/]work-not-on-path[\\\\/]([^\\\\/]+)$/i.exec(file);\n return m ? m[1] : null;\n}\n\n/**\n * A start's error that came from a `notOnPath` stand-in, said in the program's own name: \"winget not found on PATH\"\n * rather than \"spawn C:\\Windows\\work-not-on-path\\winget ENOENT\" (the stand-in is work's device, not a place to\n * look). The code stays ENOENT, so callers that tell \"not installed\" by it still do. Changes the error in place;\n * returns it.\n */\nexport function explainNotOnPath<T>(err: T): T {\n if (!(err instanceof Error)) return err;\n const e = err as NodeJS.ErrnoException;\n const name = (typeof e.path === 'string' ? standInFor(e.path) : null) ?? /[\\\\/]work-not-on-path[\\\\/]([^\\s\\\\/]+)/i.exec(e.message)?.[1];\n if (!name) return err;\n e.message = `${name} not found on PATH`;\n e.path = name;\n return err;\n}\n\n/** What to start for `cmd`: its absolute file on PATH (Windows), a path that fails as not found when it isn't there, `cmd` elsewhere. */\nexport function programPath(\n cmd: string,\n env: NodeJS.ProcessEnv = process.env,\n platform: NodeJS.Platform = process.platform,\n cwd?: string,\n): string {\n return whereOnPath(cmd, env, platform, cwd) ?? notOnPath(cmd, env);\n}\n"],"mappings":";;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AASV,SAAS,cAAc,GAAW,WAA4B,QAAQ,UAAmB;AAC9F,QAAM,MAAM,aAAa;AACzB,MAAI;AACF,UAAM,KAAK,GAAG,SAAS,CAAC;AACxB,WAAO,GAAG,OAAO,MAAM,QAAQ,GAAG,OAAO,QAAW;AAAA,EACtD,QAAQ;AACN,QAAI,CAAC,IAAK,QAAO;AACjB,QAAI;AACF,aAAO,CAAC,GAAG,UAAU,CAAC,EAAE,YAAY;AAAA,IACtC,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAGO,SAAS,UAAU,KAAkC;AAC1D,UAAQ,IAAI,WAAW,IAAI,WAAW,uBACnC,MAAM,GAAG,EACT,OAAO,OAAO,EACd,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC;AAC/B;AAUO,SAAS,WAAW,KAAa,MAAyB,QAAQ,KAAK,WAA4B,QAAQ,UAAyB;AACzI,QAAM,MAAM,aAAa;AACzB,QAAM,SAAS,CAAC,MAAc,cAAc,GAAG,QAAQ;AACvD,QAAM,UAAU,UAAU,GAAG;AAC7B,QAAM,SAAS,QAAQ,SAAS,KAAK,QAAQ,GAAG,EAAE,YAAY,CAAC;AAC/D,QAAM,aAAa,CAAC,SAAkB,CAAC,OAAO,SAAS,CAAC,IAAI,IAAI,QAAQ,IAAI,CAAC,MAAM,OAAO,CAAC;AAC3F,MAAI,IAAI,SAAS,GAAG,KAAM,OAAO,IAAI,SAAS,IAAI,EAAI,QAAO,WAAW,GAAG,EAAE,KAAK,MAAM,KAAK;AAC7F,QAAM,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,MAAM,MAAM,MAAM,KAAK,SAAS,EAAE,OAAO,OAAO;AAC1F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AAiB,GAAG,CAAC;AAC/D,WAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM,IAAI,SAAoB;AAC5B,YAAM,IAAK,KAAK,EAAE,KAAmE,GAAG,WAAW,IAAI,CAAC;AACxG,UAAI,GAAG,MAAO,kBAAiB,EAAE,KAAK;AACtC,aAAO;AAAA,IACT;AAAA,EACF;AACF;AASA,IAAO,gBAAQ;","names":["path","path","cwd","out"]}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runInternal
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-W7MGB3Q2.js";
|
|
5
5
|
import {
|
|
6
6
|
messageOf,
|
|
7
7
|
readStatus
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZG2M4ECW.js";
|
|
9
9
|
import {
|
|
10
10
|
sessionIdFor
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RUYTU2WJ.js";
|
|
12
12
|
import {
|
|
13
13
|
agentOf,
|
|
14
14
|
lineTimeOf,
|
|
15
15
|
readJsonlSince
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-N4W34U3I.js";
|
|
17
17
|
|
|
18
18
|
// src/core/conversations/catch-up-deps.ts
|
|
19
19
|
var askCatchUp = (prompt) => runInternal(prompt, 9e4);
|
|
@@ -100,4 +100,4 @@ export {
|
|
|
100
100
|
cachedCatchUp,
|
|
101
101
|
catchUp
|
|
102
102
|
};
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
103
|
+
//# sourceMappingURL=chunk-F2CDUWZU.js.map
|