@moberg_hr/work-tree 2.9.2 → 2.10.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-3A7RQSUC.js → account-QSNXX5YV.js} +81 -98
- package/dist/account-QSNXX5YV.js.map +1 -0
- package/dist/{add-repo-YGDJZ6HG.js → add-repo-YZ32MLZG.js} +32 -28
- package/dist/{add-repo-YGDJZ6HG.js.map → add-repo-YZ32MLZG.js.map} +1 -1
- package/dist/{answer-GHVFFKNF.js → answer-Y4T5X446.js} +16 -13
- package/dist/{answer-GHVFFKNF.js.map → answer-Y4T5X446.js.map} +1 -1
- package/dist/{attach-LWOZKLTF.js → attach-XPYWYHDP.js} +25 -19
- package/dist/{attach-LWOZKLTF.js.map → attach-XPYWYHDP.js.map} +1 -1
- package/dist/bin.js +4 -4
- package/dist/{block-WVUT63QY.js → block-JVAGG5QA.js} +22 -13
- package/dist/block-JVAGG5QA.js.map +1 -0
- package/dist/{broadcast-WM423JGR.js → broadcast-FATIANHX.js} +11 -9
- package/dist/{broadcast-WM423JGR.js.map → broadcast-FATIANHX.js.map} +1 -1
- package/dist/{catchup-KJZTLHN7.js → catchup-OTI2KZG5.js} +17 -15
- package/dist/{catchup-KJZTLHN7.js.map → catchup-OTI2KZG5.js.map} +1 -1
- package/dist/{chunk-SBLK524A.js → chunk-27LWL6QE.js} +171 -143
- package/dist/chunk-27LWL6QE.js.map +1 -0
- package/dist/chunk-2HHIDWHH.js +50 -0
- package/dist/chunk-2HHIDWHH.js.map +1 -0
- package/dist/{chunk-KVQNJCXH.js → chunk-2K5TDJ7M.js} +5 -5
- package/dist/{chunk-PDWEPIL6.js → chunk-2MAZV5KS.js} +18 -2
- package/dist/chunk-2MAZV5KS.js.map +1 -0
- package/dist/{chunk-XEAFWIN6.js → chunk-2VRZVUM7.js} +13 -6
- package/dist/chunk-2VRZVUM7.js.map +1 -0
- package/dist/{chunk-UB3DOOPB.js → chunk-34E2LA3M.js} +34 -9
- package/dist/chunk-34E2LA3M.js.map +1 -0
- package/dist/{chunk-BV2PPIKP.js → chunk-353ZINJ2.js} +3 -3
- package/dist/{chunk-5QGCF3PS.js → chunk-3BSFVKMK.js} +2 -2
- package/dist/{chunk-XTDTM6JI.js → chunk-3S6L437Q.js} +4 -5
- package/dist/chunk-3S6L437Q.js.map +1 -0
- package/dist/{chunk-3NXRBRRJ.js → chunk-3XG23PLG.js} +17 -57
- package/dist/chunk-3XG23PLG.js.map +1 -0
- package/dist/{chunk-YHSB7IVZ.js → chunk-46XSWHCQ.js} +14 -5
- package/dist/{chunk-YHSB7IVZ.js.map → chunk-46XSWHCQ.js.map} +1 -1
- package/dist/{chunk-J36ULZBO.js → chunk-4K4S53KX.js} +2 -2
- package/dist/{chunk-2Z2O5LEA.js → chunk-4O4VQQEA.js} +6 -10
- package/dist/chunk-4O4VQQEA.js.map +1 -0
- package/dist/chunk-4TTYEMOY.js +180 -0
- package/dist/chunk-4TTYEMOY.js.map +1 -0
- package/dist/{chunk-TR7CTHJA.js → chunk-5R5JEQW7.js} +59 -81
- package/dist/chunk-5R5JEQW7.js.map +1 -0
- package/dist/chunk-63ZLPXRL.js +199 -0
- package/dist/chunk-63ZLPXRL.js.map +1 -0
- package/dist/{chunk-2YXY6S7G.js → chunk-66VPQOVZ.js} +17 -14
- package/dist/chunk-66VPQOVZ.js.map +1 -0
- package/dist/{chunk-F4EWBHTA.js → chunk-6J6U7JXN.js} +20 -5
- package/dist/chunk-6J6U7JXN.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-LIE5GVDG.js → chunk-6YMLYU5G.js} +15 -17
- package/dist/{chunk-LIE5GVDG.js.map → chunk-6YMLYU5G.js.map} +1 -1
- package/dist/chunk-7E5XPDKX.js +22 -0
- package/dist/chunk-7E5XPDKX.js.map +1 -0
- package/dist/chunk-7QNVFVG6.js +196 -0
- package/dist/chunk-7QNVFVG6.js.map +1 -0
- package/dist/chunk-7S2NQRWL.js +9 -0
- package/dist/{chunk-4MVT7QPZ.js.map → chunk-7S2NQRWL.js.map} +1 -1
- package/dist/{chunk-P4EQWC5W.js → chunk-ADIN3DTD.js} +2 -2
- package/dist/{chunk-JB6LU6JV.js → chunk-AHI2WVWP.js} +16 -24
- package/dist/chunk-AHI2WVWP.js.map +1 -0
- package/dist/{chunk-KUCMJHQW.js → chunk-AHYCZUPI.js} +2 -2
- package/dist/chunk-AQP6SCCJ.js +66 -0
- package/dist/chunk-AQP6SCCJ.js.map +1 -0
- package/dist/chunk-B5WDN63X.js +84 -0
- package/dist/chunk-B5WDN63X.js.map +1 -0
- package/dist/{chunk-SWKTDMLL.js → chunk-BNKVENDF.js} +8 -8
- 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-E67DOUVU.js +289 -0
- package/dist/chunk-E67DOUVU.js.map +1 -0
- package/dist/{chunk-5NKXGQX4.js → chunk-E7WPTSHQ.js} +22 -22
- package/dist/chunk-EL3XL2OC.js +150 -0
- package/dist/chunk-EL3XL2OC.js.map +1 -0
- package/dist/{chunk-5WEBLABB.js → chunk-F3PEUOTP.js} +3 -3
- package/dist/{chunk-ICJPVSRY.js → chunk-FKM67CZZ.js} +53 -51
- package/dist/chunk-FKM67CZZ.js.map +1 -0
- package/dist/{chunk-VUNJVF6C.js → chunk-FMLE2WSN.js} +2 -2
- package/dist/{chunk-HP2QVRSQ.js → chunk-FSQJOZS4.js} +17 -10
- package/dist/chunk-FSQJOZS4.js.map +1 -0
- package/dist/chunk-FZHFD2AY.js +27 -0
- package/dist/chunk-FZHFD2AY.js.map +1 -0
- package/dist/{chunk-K2MOQVTJ.js → chunk-GZGJQKQT.js} +2 -2
- package/dist/{chunk-5WM24P5N.js → chunk-I6MILNM5.js} +2 -2
- package/dist/chunk-I6MILNM5.js.map +1 -0
- package/dist/{chunk-S3BAD4IR.js → chunk-ICXUTMGH.js} +2 -2
- package/dist/{chunk-BWD24JIP.js → chunk-IDQVTWLX.js} +5 -5
- package/dist/{chunk-Z2XY3PLX.js → chunk-IFQOOCT7.js} +8 -8
- package/dist/{chunk-JT5AR7PO.js → chunk-IKX3B26P.js} +78 -6
- package/dist/chunk-IKX3B26P.js.map +1 -0
- package/dist/{chunk-OMIMK3LB.js → chunk-IOHK45WE.js} +2 -2
- package/dist/{chunk-SG5LUMGE.js → chunk-JNBMANFM.js} +6 -3
- package/dist/chunk-JNBMANFM.js.map +1 -0
- package/dist/{chunk-XMWVBLMJ.js → chunk-JNCKZ3OF.js} +12 -34
- package/dist/chunk-JNCKZ3OF.js.map +1 -0
- package/dist/{chunk-6IUFNTBQ.js → chunk-JVBIWU7S.js} +4 -4
- package/dist/chunk-JVE2JFLV.js +15 -0
- package/dist/chunk-JVE2JFLV.js.map +1 -0
- package/dist/{chunk-7NSQVIIK.js → chunk-KDO7D46L.js} +3 -3
- package/dist/{chunk-GJ5V357G.js → chunk-KL4YYV37.js} +4 -4
- 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-L22AWXWA.js +29 -0
- package/dist/chunk-L22AWXWA.js.map +1 -0
- package/dist/{chunk-ZGT4ZDGG.js → chunk-LJKF73JB.js} +8 -8
- package/dist/chunk-LJKF73JB.js.map +1 -0
- package/dist/{chunk-JWWG624P.js → chunk-LKESANVD.js} +6 -6
- package/dist/{chunk-RG7NJEN7.js → chunk-LZZCJAJQ.js} +11 -11
- package/dist/{chunk-AQJSY4CI.js → chunk-MM7344RC.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-NWOCQVSL.js +307 -0
- package/dist/chunk-NWOCQVSL.js.map +1 -0
- package/dist/{chunk-RGUSVBGN.js → chunk-OCMNBOPX.js} +2 -2
- package/dist/{chunk-BNGX2JGD.js → chunk-PCNNW63Z.js} +16 -5
- package/dist/chunk-PCNNW63Z.js.map +1 -0
- package/dist/chunk-PHGVVFTF.js +1603 -0
- package/dist/chunk-PHGVVFTF.js.map +1 -0
- package/dist/{chunk-4NITDMDH.js → chunk-PPZP7CA7.js} +9 -186
- package/dist/chunk-PPZP7CA7.js.map +1 -0
- package/dist/{chunk-X4AXKO3A.js → chunk-RGLIW45S.js} +2 -2
- package/dist/{chunk-TQOHPNDW.js → chunk-RHDZPV6C.js} +2 -2
- package/dist/{chunk-3GIH4WTA.js → chunk-RJUMLWXP.js} +109 -104
- package/dist/chunk-RJUMLWXP.js.map +1 -0
- package/dist/chunk-RQFHA5BM.js +1443 -0
- package/dist/chunk-RQFHA5BM.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-TIG7NHVO.js +231 -0
- package/dist/chunk-TIG7NHVO.js.map +1 -0
- package/dist/{chunk-4BZGUMP7.js → chunk-TKWUSJNQ.js} +36 -23
- package/dist/chunk-TKWUSJNQ.js.map +1 -0
- package/dist/{chunk-VGRZKBUK.js → chunk-UP2JTDBI.js} +3 -3
- package/dist/chunk-V4U5RGEG.js +59 -0
- package/dist/chunk-V4U5RGEG.js.map +1 -0
- package/dist/{chunk-V4IHZJD4.js → chunk-V7GCYL6A.js} +93 -196
- package/dist/chunk-V7GCYL6A.js.map +1 -0
- package/dist/{chunk-GBMY7IMP.js → chunk-VFH4SU3M.js} +34 -23
- package/dist/chunk-VFH4SU3M.js.map +1 -0
- package/dist/{chunk-JFN67PRA.js → chunk-VV3NFLLP.js} +16 -9
- package/dist/chunk-VV3NFLLP.js.map +1 -0
- package/dist/{chunk-AGTVDF4O.js → chunk-WKOJ7NXD.js} +4 -4
- package/dist/{chunk-4SZ7YW7N.js → chunk-WVV54JP3.js} +56 -58
- package/dist/chunk-WVV54JP3.js.map +1 -0
- package/dist/chunk-WY7QZ2P7.js +71 -0
- package/dist/chunk-WY7QZ2P7.js.map +1 -0
- package/dist/{chunk-YYBXQBW2.js → chunk-Y7T73SAP.js} +13 -3
- package/dist/chunk-Y7T73SAP.js.map +1 -0
- package/dist/{chunk-PKXHK5CJ.js → chunk-Z6ZMWFNV.js} +25 -7
- package/dist/chunk-Z6ZMWFNV.js.map +1 -0
- package/dist/{chunk-MPY2ZQBL.js → chunk-Z7I6DQAR.js} +42 -57
- package/dist/chunk-Z7I6DQAR.js.map +1 -0
- package/dist/{chunk-GNGXYXBC.js → chunk-ZRATYLBB.js} +2 -2
- package/dist/{cleanup-7E3YWQUC.js → cleanup-M5TY4FQS.js} +46 -34
- package/dist/{cleanup-7E3YWQUC.js.map → cleanup-M5TY4FQS.js.map} +1 -1
- package/dist/cli-446A536X.js +19 -0
- 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-TUJNIUIO.js → config-JLORGUXN.js} +16 -13
- package/dist/{config-TUJNIUIO.js.map → config-JLORGUXN.js.map} +1 -1
- package/dist/{diff-PZKOXAU3.js → diff-4O5HXNZ7.js} +23 -20
- package/dist/{diff-PZKOXAU3.js.map → diff-4O5HXNZ7.js.map} +1 -1
- package/dist/{digest-XHDDBXA6.js → digest-IAAZXJCC.js} +13 -11
- package/dist/{digest-XHDDBXA6.js.map → digest-IAAZXJCC.js.map} +1 -1
- package/dist/{fork-HYWZW72R.js → fork-ULJYPEKY.js} +41 -28
- package/dist/{fork-HYWZW72R.js.map → fork-ULJYPEKY.js.map} +1 -1
- package/dist/{history-MRRY2VTS.js → history-JFZF22M7.js} +12 -10
- package/dist/{hook-OWP4H2MT.js → hook-UYOIQVJ7.js} +54 -20
- package/dist/hook-UYOIQVJ7.js.map +1 -0
- package/dist/{hydrate-ZTGARW3U.js → hydrate-DROI4RJ7.js} +14 -12
- package/dist/{hydrate-ZTGARW3U.js.map → hydrate-DROI4RJ7.js.map} +1 -1
- package/dist/{init-7VISW3JJ.js → init-FF75CQM7.js} +27 -19
- package/dist/{init-7VISW3JJ.js.map → init-FF75CQM7.js.map} +1 -1
- package/dist/install-skills-XSAHNBYD.js +22 -0
- package/dist/install-skills-bin.js +8 -6
- package/dist/install-skills-bin.js.map +1 -1
- package/dist/{list-5XWYT37A.js → list-5FEHBP6N.js} +15 -13
- package/dist/{list-5XWYT37A.js.map → list-5FEHBP6N.js.map} +1 -1
- package/dist/{move-PSAODKRK.js → move-422L6PPI.js} +33 -24
- package/dist/{move-PSAODKRK.js.map → move-422L6PPI.js.map} +1 -1
- package/dist/{note-7WQ2YC2F.js → note-AAXPD5VA.js} +14 -12
- package/dist/{note-7WQ2YC2F.js.map → note-AAXPD5VA.js.map} +1 -1
- package/dist/{overlaps-R27DEX36.js → overlaps-WPNUYOFF.js} +21 -11
- package/dist/{overlaps-R27DEX36.js.map → overlaps-WPNUYOFF.js.map} +1 -1
- package/dist/{pin-LS4WPLOE.js → pin-QXPF23BB.js} +14 -12
- package/dist/{pin-LS4WPLOE.js.map → pin-QXPF23BB.js.map} +1 -1
- package/dist/{pr-SMEC5O7O.js → pr-QLGXPKPQ.js} +46 -21
- package/dist/pr-QLGXPKPQ.js.map +1 -0
- package/dist/{prune-VA3V5B2I.js → prune-GRHKRRVT.js} +44 -32
- package/dist/{prune-VA3V5B2I.js.map → prune-GRHKRRVT.js.map} +1 -1
- package/dist/{pty-host-PN4A3X2Y.js → pty-host-XDDXA4SL.js} +135 -67
- package/dist/pty-host-XDDXA4SL.js.map +1 -0
- package/dist/{read-75DP75TI.js → read-YWKD2DGP.js} +13 -11
- package/dist/{read-75DP75TI.js.map → read-YWKD2DGP.js.map} +1 -1
- package/dist/{recent-YDSLMD6Y.js → recent-SI5BDVVH.js} +35 -26
- package/dist/recent-SI5BDVVH.js.map +1 -0
- package/dist/{remove-XPSU2VTR.js → remove-RXXCHY44.js} +48 -36
- package/dist/{remove-XPSU2VTR.js.map → remove-RXXCHY44.js.map} +1 -1
- package/dist/{restart-7EPW5VDV.js → restart-CPNDEXU6.js} +17 -15
- package/dist/{restart-7EPW5VDV.js.map → restart-CPNDEXU6.js.map} +1 -1
- package/dist/{resume-26Y6G4UT.js → resume-BLP4TTJK.js} +35 -20
- package/dist/resume-BLP4TTJK.js.map +1 -0
- package/dist/review-now-ADWZPELT.js +22 -0
- package/dist/review-now-ADWZPELT.js.map +1 -0
- package/dist/{run-IIURYUD2.js → run-JFCDJ3EV.js} +21 -15
- package/dist/run-JFCDJ3EV.js.map +1 -0
- package/dist/{screen-AORRCOZQ.js → screen-LBOPAUXV.js} +14 -12
- package/dist/{screen-AORRCOZQ.js.map → screen-LBOPAUXV.js.map} +1 -1
- package/dist/{search-Z3XD7ZNQ.js → search-AMEGRH24.js} +10 -8
- package/dist/{search-Z3XD7ZNQ.js.map → search-AMEGRH24.js.map} +1 -1
- package/dist/{section-6N7J4Y6J.js → section-73Z34PVE.js} +14 -12
- package/dist/{section-6N7J4Y6J.js.map → section-73Z34PVE.js.map} +1 -1
- package/dist/{send-SHHXHICL.js → send-IZBSEET5.js} +19 -16
- package/dist/send-IZBSEET5.js.map +1 -0
- package/dist/{sessions-AD5HPY2L.js → sessions-WVQ2U2W4.js} +58 -23
- package/dist/sessions-WVQ2U2W4.js.map +1 -0
- package/dist/{snooze-JZMIVMNS.js → snooze-7IBHY5MY.js} +13 -11
- package/dist/{snooze-JZMIVMNS.js.map → snooze-7IBHY5MY.js.map} +1 -1
- package/dist/{start-6VNWRLPK.js → start-AU62TW6M.js} +14 -12
- package/dist/{start-6VNWRLPK.js.map → start-AU62TW6M.js.map} +1 -1
- package/dist/{state-OZF4S7PG.js → state-IZV7DAPL.js} +8 -5
- package/dist/state-IZV7DAPL.js.map +1 -0
- package/dist/{status-YRBJR4YB.js → status-Z7OMNYZX.js} +38 -13
- package/dist/status-Z7OMNYZX.js.map +1 -0
- package/dist/{statusline-RSQMMCRN.js → statusline-VJFY7ZAB.js} +12 -11
- package/dist/{statusline-RSQMMCRN.js.map → statusline-VJFY7ZAB.js.map} +1 -1
- package/dist/{statusline-hook-OVWHHFBV.js → statusline-hook-JA7MNE5H.js} +4 -3
- package/dist/{statusline-hook-OVWHHFBV.js.map → statusline-hook-JA7MNE5H.js.map} +1 -1
- package/dist/{stop-A2Q4CO6Z.js → stop-PWNXSFBD.js} +14 -12
- package/dist/{stop-A2Q4CO6Z.js.map → stop-PWNXSFBD.js.map} +1 -1
- package/dist/{sync-GXXBOQ4W.js → sync-2BTZVDDG.js} +44 -32
- package/dist/{sync-GXXBOQ4W.js.map → sync-2BTZVDDG.js.map} +1 -1
- package/dist/{time-XKEMSDMN.js → time-CTCIAXIY.js} +15 -13
- package/dist/{time-XKEMSDMN.js.map → time-CTCIAXIY.js.map} +1 -1
- package/dist/{time-actions-DB7OQ2IS.js → time-actions-UYBOXET6.js} +5 -4
- package/dist/{timesheet-ZAZXN6LK.js → timesheet-BUFQ34FC.js} +24 -15
- package/dist/{timesheet-ZAZXN6LK.js.map → timesheet-BUFQ34FC.js.map} +1 -1
- package/dist/{todo-ODF7RI27.js → todo-2R7VID57.js} +4 -4
- package/dist/{tree-HJGFWO6G.js → tree-LQDPAXQA.js} +65 -45
- package/dist/tree-LQDPAXQA.js.map +1 -0
- package/dist/{update-6427PE7F.js → update-2IYJHY7H.js} +24 -14
- package/dist/{update-6427PE7F.js.map → update-2IYJHY7H.js.map} +1 -1
- package/dist/{usage-HIXH42ZH.js → usage-IR5GNF4R.js} +13 -11
- package/dist/{usage-HIXH42ZH.js.map → usage-IR5GNF4R.js.map} +1 -1
- package/dist/version-ONEI52TI.js +115 -0
- package/dist/version-ONEI52TI.js.map +1 -0
- package/dist/{wait-VHPP2B7P.js → wait-6DH34L53.js} +16 -13
- package/dist/{wait-VHPP2B7P.js.map → wait-6DH34L53.js.map} +1 -1
- package/dist/wd-bin.js +6 -6
- package/dist/web/assets/PtyView-kBcAOwHr.js +96 -0
- package/dist/web/assets/PtyView-kBcAOwHr.js.map +1 -0
- package/dist/web/assets/index-BgfR3N99.js +124 -0
- package/dist/web/assets/index-BgfR3N99.js.map +1 -0
- package/dist/web/assets/index-CKpHjII8.css +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-QTXU66K5.js → web-RIHGV7YY.js} +2893 -444
- package/dist/web-RIHGV7YY.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-3A7RQSUC.js.map +0 -1
- package/dist/block-WVUT63QY.js.map +0 -1
- package/dist/chunk-2YXY6S7G.js.map +0 -1
- package/dist/chunk-2Z2O5LEA.js.map +0 -1
- package/dist/chunk-3GIH4WTA.js.map +0 -1
- package/dist/chunk-3N3UQEC4.js.map +0 -1
- package/dist/chunk-3NXRBRRJ.js.map +0 -1
- package/dist/chunk-4BZGUMP7.js.map +0 -1
- package/dist/chunk-4MVT7QPZ.js +0 -9
- package/dist/chunk-4NITDMDH.js.map +0 -1
- package/dist/chunk-4SZ7YW7N.js.map +0 -1
- package/dist/chunk-5WM24P5N.js.map +0 -1
- package/dist/chunk-BNGX2JGD.js.map +0 -1
- package/dist/chunk-F4EWBHTA.js.map +0 -1
- package/dist/chunk-GBMY7IMP.js.map +0 -1
- package/dist/chunk-H7GHJ3CR.js +0 -551
- package/dist/chunk-H7GHJ3CR.js.map +0 -1
- package/dist/chunk-HP2QVRSQ.js.map +0 -1
- package/dist/chunk-ICJPVSRY.js.map +0 -1
- package/dist/chunk-JB6LU6JV.js.map +0 -1
- package/dist/chunk-JFN67PRA.js.map +0 -1
- package/dist/chunk-JT5AR7PO.js.map +0 -1
- package/dist/chunk-MPY2ZQBL.js.map +0 -1
- package/dist/chunk-PDWEPIL6.js.map +0 -1
- package/dist/chunk-PKXHK5CJ.js.map +0 -1
- package/dist/chunk-RCYI7SRA.js +0 -15
- package/dist/chunk-RCYI7SRA.js.map +0 -1
- package/dist/chunk-RYNBBSLY.js.map +0 -1
- package/dist/chunk-SBLK524A.js.map +0 -1
- package/dist/chunk-SG5LUMGE.js.map +0 -1
- package/dist/chunk-TR7CTHJA.js.map +0 -1
- package/dist/chunk-UB3DOOPB.js.map +0 -1
- package/dist/chunk-V4IHZJD4.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-XEAFWIN6.js.map +0 -1
- package/dist/chunk-XMWVBLMJ.js.map +0 -1
- package/dist/chunk-XTDTM6JI.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-ZGT4ZDGG.js.map +0 -1
- package/dist/cli-BHIBPUQG.js +0 -19
- package/dist/hook-OWP4H2MT.js.map +0 -1
- package/dist/install-skills-IIMTRQ4K.js +0 -20
- package/dist/pr-SMEC5O7O.js.map +0 -1
- package/dist/pty-host-PN4A3X2Y.js.map +0 -1
- package/dist/recent-YDSLMD6Y.js.map +0 -1
- package/dist/resume-26Y6G4UT.js.map +0 -1
- package/dist/run-IIURYUD2.js.map +0 -1
- package/dist/send-SHHXHICL.js.map +0 -1
- package/dist/sessions-AD5HPY2L.js.map +0 -1
- package/dist/state-OZF4S7PG.js.map +0 -1
- package/dist/status-YRBJR4YB.js.map +0 -1
- package/dist/tree-HJGFWO6G.js.map +0 -1
- package/dist/web/assets/PtyView-B7zFUh_M.js +0 -96
- package/dist/web/assets/PtyView-B7zFUh_M.js.map +0 -1
- package/dist/web/assets/index-BAxeogV4.css +0 -1
- package/dist/web/assets/index-C4cR3Hwy.js +0 -120
- package/dist/web/assets/index-C4cR3Hwy.js.map +0 -1
- package/dist/web-QTXU66K5.js.map +0 -1
- /package/dist/{chunk-KVQNJCXH.js.map → chunk-2K5TDJ7M.js.map} +0 -0
- /package/dist/{chunk-BV2PPIKP.js.map → chunk-353ZINJ2.js.map} +0 -0
- /package/dist/{chunk-5QGCF3PS.js.map → chunk-3BSFVKMK.js.map} +0 -0
- /package/dist/{chunk-J36ULZBO.js.map → chunk-4K4S53KX.js.map} +0 -0
- /package/dist/{chunk-P4EQWC5W.js.map → chunk-ADIN3DTD.js.map} +0 -0
- /package/dist/{chunk-KUCMJHQW.js.map → chunk-AHYCZUPI.js.map} +0 -0
- /package/dist/{chunk-SWKTDMLL.js.map → chunk-BNKVENDF.js.map} +0 -0
- /package/dist/{chunk-5NKXGQX4.js.map → chunk-E7WPTSHQ.js.map} +0 -0
- /package/dist/{chunk-5WEBLABB.js.map → chunk-F3PEUOTP.js.map} +0 -0
- /package/dist/{chunk-VUNJVF6C.js.map → chunk-FMLE2WSN.js.map} +0 -0
- /package/dist/{chunk-K2MOQVTJ.js.map → chunk-GZGJQKQT.js.map} +0 -0
- /package/dist/{chunk-S3BAD4IR.js.map → chunk-ICXUTMGH.js.map} +0 -0
- /package/dist/{chunk-BWD24JIP.js.map → chunk-IDQVTWLX.js.map} +0 -0
- /package/dist/{chunk-Z2XY3PLX.js.map → chunk-IFQOOCT7.js.map} +0 -0
- /package/dist/{chunk-OMIMK3LB.js.map → chunk-IOHK45WE.js.map} +0 -0
- /package/dist/{chunk-6IUFNTBQ.js.map → chunk-JVBIWU7S.js.map} +0 -0
- /package/dist/{chunk-7NSQVIIK.js.map → chunk-KDO7D46L.js.map} +0 -0
- /package/dist/{chunk-GJ5V357G.js.map → chunk-KL4YYV37.js.map} +0 -0
- /package/dist/{chunk-JWWG624P.js.map → chunk-LKESANVD.js.map} +0 -0
- /package/dist/{chunk-RG7NJEN7.js.map → chunk-LZZCJAJQ.js.map} +0 -0
- /package/dist/{chunk-AQJSY4CI.js.map → chunk-MM7344RC.js.map} +0 -0
- /package/dist/{chunk-HMK3INUS.js.map → chunk-MQCDFSVF.js.map} +0 -0
- /package/dist/{chunk-RGUSVBGN.js.map → chunk-OCMNBOPX.js.map} +0 -0
- /package/dist/{chunk-X4AXKO3A.js.map → chunk-RGLIW45S.js.map} +0 -0
- /package/dist/{chunk-TQOHPNDW.js.map → chunk-RHDZPV6C.js.map} +0 -0
- /package/dist/{chunk-VGRZKBUK.js.map → chunk-UP2JTDBI.js.map} +0 -0
- /package/dist/{chunk-AGTVDF4O.js.map → chunk-WKOJ7NXD.js.map} +0 -0
- /package/dist/{chunk-GNGXYXBC.js.map → chunk-ZRATYLBB.js.map} +0 -0
- /package/dist/{cli-BHIBPUQG.js.map → cli-446A536X.js.map} +0 -0
- /package/dist/{history-MRRY2VTS.js.map → history-JFZF22M7.js.map} +0 -0
- /package/dist/{install-skills-IIMTRQ4K.js.map → install-skills-XSAHNBYD.js.map} +0 -0
- /package/dist/{time-actions-DB7OQ2IS.js.map → time-actions-UYBOXET6.js.map} +0 -0
- /package/dist/{todo-ODF7RI27.js.map → todo-2R7VID57.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/agents/claude/rate-limits.ts","../src/core/agents/claude/statusline-run.ts"],"sourcesContent":["import os from 'node:os';\nimport path from 'node:path';\nimport { createHash } from 'node:crypto';\nimport type { UsageWindow } from '../../usage/usage.js';\n\n// What Claude Code's status line says about its plan limits, and whose they are. Light on purpose: the status-line hook imports it on every refresh.\n\nconst isRecord = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null && !Array.isArray(v);\n\nconst clampPercent = (n: number) => Math.round(Math.min(100, Math.max(0, n)) * 10) / 10;\n\n/** Epoch seconds below 1e12, milliseconds above; a string is parsed as a date. */\nfunction resetIso(v: unknown): string | null {\n let ms: number;\n if (typeof v === 'number' && Number.isFinite(v)) ms = v < 1e12 ? v * 1000 : v;\n else if (typeof v === 'string' && v.trim() !== '') ms = Date.parse(v);\n else return null;\n return Number.isFinite(ms) ? new Date(ms).toISOString() : null;\n}\n\nconst capitalise = (s: string) => s.charAt(0).toUpperCase() + s.slice(1);\n\nfunction labelOf(key: string): string {\n if (key === 'five_hour') return '5-hour limit';\n if (key === 'seven_day') return 'Weekly limit';\n const named = /^seven_day_(.+)$/.exec(key);\n if (named) return `Weekly ${capitalise(named[1]!.replace(/_/g, ' '))} limit`;\n const span = /^(\\d+)_(hour|day)$/.exec(key);\n if (span) return `${span[1]}-${span[2]} limit`;\n return `${capitalise(key.replace(/_/g, ' '))} limit`;\n}\n\nconst rank = (key: string) => (key === 'five_hour' ? 0 : key === 'seven_day' ? 1 : 2);\n\n/** Claude Code's status-line `rate_limits`; whatever doesn't fit is skipped. */\nexport function parseClaudeRateLimits(raw: unknown): UsageWindow[] {\n if (!isRecord(raw)) return [];\n const windows: UsageWindow[] = [];\n const keys = Object.keys(raw)\n .filter((k) => k !== 'spend_limit')\n .sort((a, b) => rank(a) - rank(b) || a.localeCompare(b));\n for (const key of keys) {\n const w = raw[key];\n if (!isRecord(w) || typeof w.used_percentage !== 'number' || !Number.isFinite(w.used_percentage)) continue;\n windows.push({ id: key, label: labelOf(key), usedPercent: clampPercent(w.used_percentage), resetsAt: resetIso(w.resets_at) });\n }\n const spend = raw.spend_limit;\n if (isRecord(spend)) {\n const { used_percentage: pct, used_usd: used, limit_usd: limit } = spend;\n let percent: number | null = null;\n if (typeof pct === 'number' && Number.isFinite(pct)) percent = pct;\n else if (typeof used === 'number' && typeof limit === 'number' && Number.isFinite(used) && Number.isFinite(limit) && limit > 0)\n percent = (used / limit) * 100;\n if (percent !== null) {\n windows.push({ id: 'spend_limit', label: 'Spend limit', usedPercent: clampPercent(percent), resetsAt: resetIso(spend.resets_at) });\n }\n }\n return windows;\n}\n\n/** The account a Claude runs as: `default` for its normal config folder (~/.claude), else a short stable name for its CLAUDE_CONFIG_DIR. */\nexport function accountOf(configDir: string | undefined): string {\n if (!configDir) return 'default';\n const norm = (p: string) => (process.platform === 'win32' ? path.resolve(p).toLowerCase() : path.resolve(p));\n const resolved = norm(configDir);\n // CLAUDE_CONFIG_DIR set to the folder Claude uses anyway is the same account.\n if (resolved === norm(path.join(os.homedir(), '.claude'))) return 'default';\n const hash = createHash('sha1').update(resolved).digest('hex');\n return `cfg-${hash.slice(0, 8)}`;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { getConfigDir } from '../../platform/config-dir.js';\nimport { detachHere, killTree } from '../../platform/process.js';\nimport spawn from '../../platform/spawn.js';\nimport { accountOf } from './rate-limits.js';\n\n// The status-line hook's half of statusline.ts: what runs on every refresh of every Claude. Light on purpose — no\n// settings editor, no locks, no registry; installing and removing the wrapper is statusline.ts.\n\nexport const WORK_STATUSLINE = 'work hook statusline';\n/** Set on the user's own command: a status line that runs work's hook again (it called `work hook statusline` itself) records, and runs nothing more. */\nexport const NESTED_ENV = 'WORK_STATUSLINE_NESTED';\n\nexport type StatusLine = Record<string, unknown>;\n\nexport const isRecord = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null && !Array.isArray(v);\n/**\n * Where the user's own status line is saved: `statusline.json` for the default account, `statusline-<account>.json` for\n * another — named by `accountOf(CLAUDE_CONFIG_DIR)`, a short hash of the folder, the same name the hook computes from its\n * environment (it knows the folder, not the registry's name for it, and loads no config to find out; a renamed account\n * keeps its saved line).\n */\nexport const savedPath = (configDir?: string) => {\n const account = accountOf(configDir);\n return path.join(getConfigDir(), account === 'default' ? 'statusline.json' : `statusline-${account}.json`);\n};\n\n/**\n * work's hook under any path (`/usr/bin/work hook statusline`, `node …/bin.js hook statusline`), with or without the\n * user's line after `||` as its fallback: saved as \"the original\", it would run itself.\n */\nexport const isOurs = (v: unknown) => isRecord(v) && typeof v.command === 'string' && /\\bhook\\s+statusline\\b/.test(v.command);\n\n/** What ~/.work/statusline.json says: an original (null: there was none), nothing saved, or a file that can't be read. */\nexport type Saved = { kind: 'ok'; original: StatusLine | null } | { kind: 'missing' } | { kind: 'unreadable'; why: string };\n\nexport function readSaved(configDir?: string): Saved {\n let text: string;\n try {\n text = fs.readFileSync(savedPath(configDir), 'utf-8');\n } catch (e) {\n const code = (e as NodeJS.ErrnoException).code;\n return code === 'ENOENT' ? { kind: 'missing' } : { kind: 'unreadable', why: code ?? String(e) };\n }\n let v: unknown;\n try {\n v = JSON.parse(text);\n } catch (e) {\n return { kind: 'unreadable', why: e instanceof Error ? e.message : String(e) };\n }\n if (!isRecord(v) || !('original' in v)) return { kind: 'unreadable', why: 'no original in it' };\n if (v.original === null) return { kind: 'ok', original: null };\n return isRecord(v.original) ? { kind: 'ok', original: v.original } : { kind: 'unreadable', why: 'original is not an object' };\n}\n\n/**\n * The user's own status line command, when they had one — the one saved for the account of the Claude that runs it\n * (`configDir`: its `CLAUDE_CONFIG_DIR`). `onDamage` hears why a saved file couldn't be read.\n *\n * An account with nothing saved whose settings run work's line anyway — a settings.json copied from the default\n * account's, or a folder shared with it — falls back to the default account's saved original: that is the line its\n * settings came with, and without it the user's own line would show nowhere on that account.\n */\nexport function originalStatusLine(onDamage?: (why: string) => void, configDir?: string): { command: string } | null {\n let saved = readSaved(configDir);\n if (saved.kind === 'missing' && accountOf(configDir) !== 'default') saved = readSaved();\n if (saved.kind === 'unreadable') onDamage?.(saved.why);\n const o = saved.kind === 'ok' ? saved.original : null;\n return o && typeof o.command === 'string' && o.command ? { command: o.command } : null;\n}\n\n/** The shell Claude Code runs a status line in: sh on POSIX, Git Bash on Windows. */\nexport function shellFor(\n platform: NodeJS.Platform = process.platform,\n env: NodeJS.ProcessEnv = process.env,\n exists: (p: string) => boolean = fs.existsSync,\n): { file: string; args: (cmd: string) => string[] } {\n const args = (cmd: string) => ['-c', cmd];\n if (platform !== 'win32') return { file: '/bin/sh', args };\n const configured = env.CLAUDE_CODE_GIT_BASH_PATH;\n if (configured && exists(configured)) return { file: configured, args };\n for (const dir of (env.PATH ?? env.Path ?? '').split(';').filter(Boolean)) {\n if (!exists(path.win32.join(dir, 'git.exe'))) continue;\n for (const bash of [path.win32.join(dir, '..', 'bin', 'bash.exe'), path.win32.join(dir, 'bash.exe')])\n if (exists(bash)) return { file: bash, args };\n }\n const standard = 'C:\\\\Program Files\\\\Git\\\\bin\\\\bash.exe';\n return { file: exists(standard) ? standard : 'bash', args };\n}\n\nconst OUTPUT_CAP = 64 * 1024;\n/** After the command exits, how long what it printed may still be on its way: its stdout can stay open past its exit. */\nconst EXIT_GRACE_MS = 100;\n\n/** Stop the command and whatever it started: its process group on POSIX (a `cmd &` holding stdout keeps no hook alive), taskkill /T on Windows. */\nfunction killCommand(pid: number): void {\n if (detachHere()) {\n try {\n process.kill(-pid, 'SIGKILL');\n return;\n } catch {\n /* no group (it wasn't detached, or has gone): the process alone */\n }\n }\n killTree(pid);\n}\n\n/** Run the user's own status line with Claude's JSON on stdin. Its output, or '' when it fails or takes too long: never rejects. */\nexport function runStatusLineCommand(cmd: string, stdin: string, o: { timeoutMs?: number; cwd?: string } = {}): Promise<string> {\n return new Promise((resolve) => {\n let done = false;\n const out: Buffer[] = [];\n let outBytes = 0;\n let timer: NodeJS.Timeout | undefined;\n let grace: NodeJS.Timeout | undefined;\n let child: ReturnType<typeof spawn> | undefined;\n const finish = (ok: boolean) => {\n if (done) return;\n done = true;\n clearTimeout(timer);\n clearTimeout(grace);\n // Let go of it: a pipe still held by something it started would keep this process (Claude's hook) alive past its cap.\n child?.stdout?.destroy();\n child?.stdin?.destroy();\n child?.unref();\n resolve(ok ? Buffer.concat(out).subarray(0, OUTPUT_CAP).toString('utf-8') : '');\n };\n try {\n const sh = shellFor();\n child = spawn(sh.file, sh.args(cmd), {\n stdio: ['pipe', 'pipe', 'ignore'],\n windowsHide: true,\n cwd: o.cwd,\n // Its own process group on POSIX, so a timeout stops what it started too.\n detached: detachHere(),\n // Marked, so a command that runs work's hook again doesn't run itself (runStatusLineHook).\n env: { ...process.env, [NESTED_ENV]: '1' },\n });\n const c = child;\n timer = setTimeout(() => {\n if (c.pid) killCommand(c.pid);\n finish(false);\n }, o.timeoutMs ?? 5000);\n c.on('error', () => finish(false));\n c.stdout?.on('data', (d: Buffer) => {\n if (outBytes >= OUTPUT_CAP) return;\n out.push(d);\n outBytes += d.length;\n });\n // 'close' waits for stdout to end, and something the command left running (`cmd &`) holds it: the line would wait\n // for the cap, and be lost. Its exit decides; what it printed is read until stdout ends, or a moment more.\n c.on('exit', (code) => {\n if (code !== 0) finish(false);\n else grace ??= setTimeout(() => finish(true), EXIT_GRACE_MS);\n });\n c.on('close', (code) => finish(code === 0));\n c.stdin?.on('error', () => {\n /* it exited before reading: its exit code decides */\n });\n c.stdin?.end(stdin);\n } catch {\n finish(false);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,kBAAkB;AAK3B,IAAM,WAAW,CAAC,MAA6C,OAAO,MAAM,YAAY,MAAM,QAAQ,CAAC,MAAM,QAAQ,CAAC;AAEtH,IAAM,eAAe,CAAC,MAAc,KAAK,MAAM,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI;AAGrF,SAAS,SAAS,GAA2B;AAC3C,MAAI;AACJ,MAAI,OAAO,MAAM,YAAY,OAAO,SAAS,CAAC,EAAG,MAAK,IAAI,OAAO,IAAI,MAAO;AAAA,WACnE,OAAO,MAAM,YAAY,EAAE,KAAK,MAAM,GAAI,MAAK,KAAK,MAAM,CAAC;AAAA,MAC/D,QAAO;AACZ,SAAO,OAAO,SAAS,EAAE,IAAI,IAAI,KAAK,EAAE,EAAE,YAAY,IAAI;AAC5D;AAEA,IAAM,aAAa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AAQ;AAAA,QAChC,aAAa;AAAA,QACb,KAAK,EAAE;AAAA;AAAA,QAEP,UAAU,WAAW;AAAA;AAAA,QAErB,KAAK,EAAE,GAAG,QAAQ,KAAK,CAAC,UAAU,GAAG,IAAI;AAAA,MAC3C,CAAC;AACD,YAAM,IAAI;AACV,cAAQ,WAAW,MAAM;AACvB,YAAI,EAAE,IAAK,aAAY,EAAE,GAAG;AAC5B,eAAO,KAAK;AAAA,MACd,GAAG,EAAE,aAAa,GAAI;AACtB,QAAE,GAAG,SAAS,MAAM,OAAO,KAAK,CAAC;AACjC,QAAE,QAAQ,GAAG,QAAQ,CAAC,MAAc;AAClC,YAAI,YAAY,WAAY;AAC5B,YAAI,KAAK,CAAC;AACV,oBAAY,EAAE;AAAA,MAChB,CAAC;AAGD,QAAE,GAAG,QAAQ,CAAC,SAAS;AACrB,YAAI,SAAS,EAAG,QAAO,KAAK;AAAA,YACvB,WAAU,WAAW,MAAM,OAAO,IAAI,GAAG,aAAa;AAAA,MAC7D,CAAC;AACD,QAAE,GAAG,SAAS,CAAC,SAAS,OAAO,SAAS,CAAC,CAAC;AAC1C,QAAE,OAAO,GAAG,SAAS,MAAM;AAAA,MAE3B,CAAC;AACD,QAAE,OAAO,IAAI,KAAK;AAAA,IACpB,QAAQ;AACN,aAAO,KAAK;AAAA,IACd;AAAA,EACF,CAAC;AACH;","names":["path","isRecord","path"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
isPidAlive
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-63ZLPXRL.js";
|
|
5
5
|
|
|
6
6
|
// src/core/platform/web-discovery.ts
|
|
7
7
|
import fs from "fs";
|
|
@@ -158,4 +158,4 @@ export {
|
|
|
158
158
|
askWorkWeb,
|
|
159
159
|
callWorkWeb
|
|
160
160
|
};
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
161
|
+
//# sourceMappingURL=chunk-RGLIW45S.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isFolderSession,
|
|
4
4
|
sessionRepos
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-27LWL6QE.js";
|
|
6
6
|
|
|
7
7
|
// src/core/worktree/add-repo-rules.ts
|
|
8
8
|
import path from "path";
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
addRepoRefusal,
|
|
37
37
|
addedRepoNote
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-RHDZPV6C.js.map
|
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
branchFacts,
|
|
4
|
+
repoBase
|
|
5
|
+
} from "./chunk-TIG7NHVO.js";
|
|
6
|
+
import {
|
|
7
|
+
hostForRepo
|
|
8
|
+
} from "./chunk-PHGVVFTF.js";
|
|
9
|
+
import {
|
|
10
|
+
DEFAULT_HOST
|
|
11
|
+
} from "./chunk-AQP6SCCJ.js";
|
|
12
|
+
import {
|
|
13
|
+
BRANCH_WATCH_MS,
|
|
14
|
+
otherBranchesToWatch,
|
|
15
|
+
readSessionBranches,
|
|
16
|
+
wasPushed
|
|
17
|
+
} from "./chunk-E67DOUVU.js";
|
|
18
|
+
import {
|
|
19
|
+
defaultRunner
|
|
20
|
+
} from "./chunk-KSVYR4G2.js";
|
|
21
|
+
import {
|
|
22
|
+
sessionIdFor
|
|
23
|
+
} from "./chunk-Y7T73SAP.js";
|
|
5
24
|
|
|
6
25
|
// src/core/pr/ship.ts
|
|
7
26
|
import path from "path";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
child.on("close", (code) => done({ code: code ?? 1, stdout, stderr }));
|
|
33
|
-
});
|
|
27
|
+
|
|
28
|
+
// src/core/pr/branch-work.ts
|
|
29
|
+
function workElsewhere(pre) {
|
|
30
|
+
const out = [];
|
|
31
|
+
for (const r of pre.repos) {
|
|
32
|
+
for (const b of r.otherBranches ?? []) {
|
|
33
|
+
const parts = [];
|
|
34
|
+
const mergedAtTip = b.pr?.state === "MERGED" && !!b.sha && b.pr.headSha === b.sha;
|
|
35
|
+
if (!mergedAtTip) {
|
|
36
|
+
if (b.exists && b.unpushed === null && !b.merged) parts.push("its commits unknown");
|
|
37
|
+
if (b.exists && b.unpushed && b.unpushed > 0) parts.push(`${b.unpushed} commit${b.unpushed === 1 ? "" : "s"} not pushed`);
|
|
38
|
+
}
|
|
39
|
+
if (b.pr?.state === "OPEN") parts.push(`PR #${b.pr.number} open`);
|
|
40
|
+
if (b.ghError && b.pushed) parts.push(`its PR unknown (${b.ghError})`);
|
|
41
|
+
if (parts.length) out.push(`${r.name}: ${b.name} \u2014 ${parts.join(", ")}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
function otherPrsOf(r) {
|
|
47
|
+
return (r.otherBranches ?? []).filter((b) => !!b.pr).map((b) => ({ branch: b.name, pr: b.pr })).sort((a, b) => b.pr.number - a.pr.number);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/core/pr/ship.ts
|
|
34
51
|
function shipRepos(session) {
|
|
35
52
|
return session.paths.map((p) => ({
|
|
36
53
|
name: session.isGroup ? path.basename(p) : session.target,
|
|
37
54
|
path: p
|
|
38
55
|
}));
|
|
39
56
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return (rollup ?? []).filter((c) => FAILED.includes((c.conclusion ?? c.state ?? "").toUpperCase())).map((c) => {
|
|
43
|
-
const url = c.detailsUrl ?? c.targetUrl ?? void 0;
|
|
44
|
-
return { name: c.name ?? c.context ?? "check", ...url ? { url } : {} };
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function checksFromRollup(rollup) {
|
|
48
|
-
if (!rollup || rollup.length === 0) return "none";
|
|
49
|
-
let pending = false;
|
|
50
|
-
for (const c of rollup) {
|
|
51
|
-
const v = (c.conclusion ?? c.state ?? "").toUpperCase();
|
|
52
|
-
if (FAILED.includes(v)) {
|
|
53
|
-
return "fail";
|
|
54
|
-
}
|
|
55
|
-
const status = (c.status ?? "").toUpperCase();
|
|
56
|
-
if (!v || v === "PENDING" || v === "EXPECTED" || status && status !== "COMPLETED") pending = true;
|
|
57
|
-
}
|
|
58
|
-
return pending ? "pending" : "pass";
|
|
57
|
+
function checkedOutMerged(r) {
|
|
58
|
+
return !r.localSha || r.localSha === r.pr?.headSha || r.behindMergedHead === true;
|
|
59
59
|
}
|
|
60
60
|
function repoDone(r) {
|
|
61
61
|
if (r.gitError) return { done: false };
|
|
62
62
|
if (r.pr?.state === "MERGED") {
|
|
63
|
-
const nothingSince = r.dirtyFiles === 0 && !r.ahead && (
|
|
63
|
+
const nothingSince = r.dirtyFiles === 0 && !r.ahead && checkedOutMerged(r);
|
|
64
64
|
return nothingSince ? { done: true, reason: "merged" } : { done: false };
|
|
65
65
|
}
|
|
66
66
|
if (!r.pr && !r.ghError && r.dirtyFiles === 0 && r.commitsVsBase === 0) return { done: true, reason: "untouched" };
|
|
@@ -108,7 +108,32 @@ function mergeBlockers(r) {
|
|
|
108
108
|
function oneLineErr(s) {
|
|
109
109
|
return s.split(/\r?\n/).map((l) => l.trim()).find(Boolean) ?? "";
|
|
110
110
|
}
|
|
111
|
-
|
|
111
|
+
function recordedOtherBranches(session, now = Date.now()) {
|
|
112
|
+
const rec = readSessionBranches(sessionIdFor(session));
|
|
113
|
+
return {
|
|
114
|
+
names: (repo, current) => otherBranchesToWatch(rec, repo.name, current, now, BRANCH_WATCH_MS),
|
|
115
|
+
// Pushed now, or once (origin's copy deleted after its PR merged): it may have a PR.
|
|
116
|
+
askBranch: (repo, b) => b.pushed || wasPushed(rec, repo.name, b.name)
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
async function inspectOtherBranches(repo, names, run, host, askBranch) {
|
|
120
|
+
if (!names.length) return [];
|
|
121
|
+
const base = await repoBase(repo.path, run);
|
|
122
|
+
const out = [];
|
|
123
|
+
for (const name of names) {
|
|
124
|
+
const f = await branchFacts(repo.path, name, run, base);
|
|
125
|
+
let pr = null;
|
|
126
|
+
let ghError;
|
|
127
|
+
if (askBranch({ name: repo.name, ...host.id === DEFAULT_HOST ? {} : { host: host.id } }, { name, pushed: f.pushed })) {
|
|
128
|
+
const found = await host.prForBranch(run, repo.path, name);
|
|
129
|
+
if (found.kind === "pr") pr = found.pr;
|
|
130
|
+
else if (found.kind === "error") ghError = found.error;
|
|
131
|
+
}
|
|
132
|
+
out.push({ name, ...f, merged: f.merged || pr?.state === "MERGED", pr, ...ghError ? { ghError } : {} });
|
|
133
|
+
}
|
|
134
|
+
return out;
|
|
135
|
+
}
|
|
136
|
+
async function inspectRepo(repo, run, askGh, others) {
|
|
112
137
|
const git = (...args) => run("git", args, repo.path);
|
|
113
138
|
const branch = (await git("rev-parse", "--abbrev-ref", "HEAD")).stdout.trim();
|
|
114
139
|
const localSha = (await git("rev-parse", "HEAD")).stdout.trim();
|
|
@@ -137,50 +162,21 @@ async function inspectRepo(repo, run, askGh) {
|
|
|
137
162
|
}
|
|
138
163
|
let pr = null;
|
|
139
164
|
let ghError;
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"number,url,state,isDraft,mergeStateStatus,headRefOid,mergedAt,updatedAt,statusCheckRollup,reviewDecision,author,baseRefName"
|
|
149
|
-
],
|
|
150
|
-
repo.path
|
|
151
|
-
);
|
|
152
|
-
if (view.code === 0) {
|
|
153
|
-
try {
|
|
154
|
-
const j = JSON.parse(view.stdout);
|
|
155
|
-
pr = {
|
|
156
|
-
number: j.number,
|
|
157
|
-
url: j.url,
|
|
158
|
-
state: j.state,
|
|
159
|
-
isDraft: j.isDraft,
|
|
160
|
-
mergeStateStatus: j.mergeStateStatus ?? "UNKNOWN",
|
|
161
|
-
checks: checksFromRollup(j.statusCheckRollup),
|
|
162
|
-
headSha: j.headRefOid,
|
|
163
|
-
...j.mergedAt ? { mergedAt: j.mergedAt } : {},
|
|
164
|
-
...j.updatedAt ? { updatedAt: j.updatedAt } : {},
|
|
165
|
-
...typeof j.reviewDecision === "string" ? { reviewDecision: j.reviewDecision } : {},
|
|
166
|
-
// gh pr view names an app `app/dependabot`; the search API, `dependabot`.
|
|
167
|
-
...j.author?.login ? { author: j.author.login.replace(/^app\//, "") } : {},
|
|
168
|
-
...j.baseRefName ? { baseBranch: j.baseRefName } : {},
|
|
169
|
-
...checksFromRollup(j.statusCheckRollup) === "fail" ? { failing: failingFromRollup(j.statusCheckRollup) } : {}
|
|
170
|
-
};
|
|
171
|
-
} catch {
|
|
172
|
-
ghError = "could not read `gh pr view` output";
|
|
173
|
-
}
|
|
174
|
-
} else if (view.code === 127) {
|
|
175
|
-
ghError = "GitHub CLI (gh) not found \u2014 install it to open and merge PRs";
|
|
176
|
-
} else if (!/no pull requests found/i.test(view.stderr)) {
|
|
177
|
-
ghError = oneLineErr(view.stderr) || "gh pr view failed";
|
|
165
|
+
const { host } = hostForRepo(repo.path);
|
|
166
|
+
const skipGh = askGh ? !askGh({ name: repo.name, hasUpstream, commitsVsBase, ...host.id === DEFAULT_HOST ? {} : { host: host.id } }) : false;
|
|
167
|
+
const found = skipGh ? { kind: "none" } : await host.prForBranch(run, repo.path, branch);
|
|
168
|
+
if (found.kind === "pr") pr = found.pr;
|
|
169
|
+
else if (found.kind === "error") ghError = found.error;
|
|
170
|
+
let behindMergedHead = false;
|
|
171
|
+
if (pr?.state === "MERGED" && localSha && pr.headSha && localSha !== pr.headSha && /^[0-9a-f]{7,64}$/i.test(pr.headSha)) {
|
|
172
|
+
behindMergedHead = (await git("merge-base", "--is-ancestor", "HEAD", pr.headSha)).code === 0;
|
|
178
173
|
}
|
|
179
174
|
const facts = {
|
|
180
175
|
name: repo.name,
|
|
181
176
|
path: repo.path,
|
|
182
177
|
branch,
|
|
183
178
|
localSha,
|
|
179
|
+
...behindMergedHead ? { behindMergedHead } : {},
|
|
184
180
|
dirtyFiles,
|
|
185
181
|
hasUpstream,
|
|
186
182
|
tracksRemote,
|
|
@@ -188,14 +184,28 @@ async function inspectRepo(repo, run, askGh) {
|
|
|
188
184
|
behind,
|
|
189
185
|
pr,
|
|
190
186
|
ghError,
|
|
187
|
+
...host.id === DEFAULT_HOST ? {} : { host: host.id },
|
|
191
188
|
commitsVsBase,
|
|
192
189
|
...gitError ? { gitError } : {}
|
|
193
190
|
};
|
|
194
191
|
const { done, reason } = repoDone(facts);
|
|
195
|
-
|
|
192
|
+
const names = others && branch ? others.names(branch === "HEAD" ? "" : branch) : [];
|
|
193
|
+
const otherBranches = names.length ? await inspectOtherBranches(repo, names, run, host, others.askBranch) : [];
|
|
194
|
+
return {
|
|
195
|
+
...facts,
|
|
196
|
+
done,
|
|
197
|
+
doneReason: reason,
|
|
198
|
+
mergeBlockers: mergeBlockers(facts),
|
|
199
|
+
...otherBranches.length ? { otherBranches } : {}
|
|
200
|
+
};
|
|
196
201
|
}
|
|
197
202
|
async function shipPreflight(session, run = defaultRunner, opts = {}) {
|
|
198
|
-
const
|
|
203
|
+
const recorded = opts.branches && opts.askBranch ? null : recordedOtherBranches(session);
|
|
204
|
+
const branches = opts.branches ?? recorded.names;
|
|
205
|
+
const askBranch = opts.askBranch ?? recorded?.askBranch ?? ((_repo, b) => b.pushed);
|
|
206
|
+
const repos = await Promise.all(
|
|
207
|
+
shipRepos(session).map((r) => inspectRepo(r, run, opts.askGh, { names: (current) => branches(r, current), askBranch }))
|
|
208
|
+
);
|
|
199
209
|
return { repos };
|
|
200
210
|
}
|
|
201
211
|
async function push(r, run) {
|
|
@@ -238,15 +248,9 @@ async function runShipAction(session, action, opts = {}, run = defaultRunner) {
|
|
|
238
248
|
continue;
|
|
239
249
|
}
|
|
240
250
|
}
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
|
|
244
|
-
if (res.code === 0) {
|
|
245
|
-
const url = res.stdout.trim().split(/\s+/).find((t) => t.startsWith("http"));
|
|
246
|
-
results.push({ repo: r.name, ok: true, message: opts.draft ? "draft PR opened" : "PR opened", url });
|
|
247
|
-
} else {
|
|
248
|
-
results.push({ repo: r.name, ok: false, message: oneLineErr(res.stderr) || "gh pr create failed" });
|
|
249
|
-
}
|
|
251
|
+
const made = await hostForRepo(r.path).host.createPr(run, r.path, r.branch, { draft: !!opts.draft });
|
|
252
|
+
if (made.ok) results.push({ repo: r.name, ok: true, message: opts.draft ? "draft PR opened" : "PR opened", url: made.url });
|
|
253
|
+
else results.push({ repo: r.name, ok: false, message: made.error });
|
|
250
254
|
}
|
|
251
255
|
return results;
|
|
252
256
|
}
|
|
@@ -286,12 +290,12 @@ async function mergeSelected(session, selection, method, run = defaultRunner) {
|
|
|
286
290
|
const mergedNow = /* @__PURE__ */ new Set();
|
|
287
291
|
for (const sel of selection) {
|
|
288
292
|
const r = byName.get(sel.name);
|
|
289
|
-
const res = await run
|
|
290
|
-
if (res.
|
|
293
|
+
const res = await hostForRepo(r.path).host.mergePr(run, r.path, r.pr.number, method, sel.headSha);
|
|
294
|
+
if (res.ok) {
|
|
291
295
|
mergedNow.add(r.name);
|
|
292
296
|
results.push({ repo: r.name, ok: true, merged: true, message: `PR #${r.pr.number} merged (${method})`, url: r.pr.url });
|
|
293
297
|
} else {
|
|
294
|
-
results.push({ repo: r.name, ok: false, message:
|
|
298
|
+
results.push({ repo: r.name, ok: false, message: res.error });
|
|
295
299
|
break;
|
|
296
300
|
}
|
|
297
301
|
}
|
|
@@ -301,14 +305,15 @@ async function mergeSelected(session, selection, method, run = defaultRunner) {
|
|
|
301
305
|
results.push({ repo: sel.name, ok: false, message: "not merged: stopped after an earlier failure" });
|
|
302
306
|
}
|
|
303
307
|
}
|
|
304
|
-
const allDone = repos.every((r) => r.done || mergedNow.has(r.name));
|
|
308
|
+
const allDone = repos.every((r) => r.done || mergedNow.has(r.name)) && workElsewhere({ repos }).length === 0;
|
|
305
309
|
return { results, mergedAny: mergedNow.size > 0, allDone };
|
|
306
310
|
}
|
|
307
311
|
|
|
308
312
|
export {
|
|
309
|
-
|
|
313
|
+
workElsewhere,
|
|
314
|
+
otherPrsOf,
|
|
310
315
|
shipPreflight,
|
|
311
316
|
runShipAction,
|
|
312
317
|
mergeSelected
|
|
313
318
|
};
|
|
314
|
-
//# sourceMappingURL=chunk-
|
|
319
|
+
//# sourceMappingURL=chunk-RJUMLWXP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/pr/ship.ts","../src/core/pr/branch-work.ts"],"sourcesContent":["import path from 'node:path';\nimport { defaultRunner, type CommandRunner } from '../platform/command-runner.js';\nimport type { WorktreeSession } from '../sessions/history.js';\nimport { DEFAULT_HOST, hostForRepo } from '../hosts/index.js';\nimport type { MergeMethod, MergeSelection, OtherBranchState, RepoShipState, ShipPr, ShipPreflight, ShipResult } from '../api-types.js';\nimport { branchFacts, repoBase } from '../stacks/branch-facts.js';\nimport { BRANCH_WATCH_MS, otherBranchesToWatch, readSessionBranches, wasPushed } from '../sessions/session-branches.js';\nimport { sessionIdFor } from '../sessions/session-id.js';\nimport { workElsewhere } from './branch-work.js';\n\nexport { workElsewhere } from './branch-work.js';\n\nexport { defaultRunner, type CommandRunner, type RunResult } from '../platform/command-runner.js';\nexport type {\n ChecksState,\n OtherBranchState,\n MergeMethod,\n MergeSelection,\n RepoShipState,\n ShipAction,\n ShipPr,\n ShipPreflight,\n ShipResult,\n} from '../api-types.js';\n\n/**\n * Ship a session's work: push, open a PR, merge it — per repo, because a\n * group's repos ship independently: backend can be merged and done while\n * frontend still waits for review.\n *\n * Group rules (the careful part):\n * - A repo whose PR is MERGED, or that was never touched (no commits vs\n * the base, clean, no PR), is `done` — never a blocker for the others.\n * - Merge takes an explicit list of repos, each with the PR head SHA the\n * user was shown. The server re-checks every one of them and merges\n * NONE if any is blocked or its PR moved; repos not listed are left\n * alone. So a group can be shipped in parts, deliberately.\n * - The session is archived only when a merge actually merged something\n * AND every repo is done afterwards.\n *\n * Every git/gh call goes through a `CommandRunner` with an argv array — no\n * shell (§1.1) — injectable so the decision logic is unit-testable.\n */\n\n/** The repos a session ships: each worktree path, named by its folder. */\nexport function shipRepos(session: WorktreeSession): Array<{ name: string; path: string }> {\n return session.paths.map((p) => ({\n name: session.isGroup ? path.basename(p) : session.target,\n path: p,\n }));\n}\n\ntype RepoFacts = Omit<RepoShipState, 'mergeBlockers' | 'done' | 'doneReason' | 'otherBranches'>;\n\n/**\n * The checked-out commit is in its merged PR: the PR's head, or behind it on\n * the same line (the PR got commits on GitHub the worktree never pulled). A\n * commit after the head, or on another line, is work the merge didn't take.\n */\nexport function checkedOutMerged(r: Pick<RepoFacts, 'localSha' | 'behindMergedHead' | 'pr'>): boolean {\n return !r.localSha || r.localSha === r.pr?.headSha || r.behindMergedHead === true;\n}\n\n/** Done = nothing left to ship from this repo. */\nexport function repoDone(r: RepoFacts): { done: boolean; reason?: 'merged' | 'untouched' } {\n // Merged AND nothing since: a follow-up commit (pushed or not) or an\n // edit after the merge is new work — it must stay visible, get pushed,\n // and block archiving until it's shipped too.\n // A tree git couldn't read may hold anything: never done on a guess.\n if (r.gitError) return { done: false };\n if (r.pr?.state === 'MERGED') {\n const nothingSince = r.dirtyFiles === 0 && !r.ahead && checkedOutMerged(r);\n return nothingSince ? { done: true, reason: 'merged' } : { done: false };\n }\n // Untouched only when every fact was read: a gh that failed (no network right after a\n // wake) is not \"no PR\", and a git that failed is not \"0 commits\" — reading them so once\n // archived a group whose other PR was still open.\n if (!r.pr && !r.ghError && r.dirtyFiles === 0 && r.commitsVsBase === 0) return { done: true, reason: 'untouched' };\n return { done: false };\n}\n\n/** Why \"merge\" isn't available for this repo right now ([] = go). */\nexport function mergeBlockers(r: RepoFacts): string[] {\n if (repoDone(r).done) return [];\n const out: string[] = [];\n if (r.gitError) out.push(r.gitError);\n if (r.ghError) out.push(r.ghError);\n if (r.dirtyFiles > 0) out.push(`${r.dirtyFiles} uncommitted file${r.dirtyFiles === 1 ? '' : 's'} — commit or stash first`);\n if (!r.hasUpstream) out.push('branch not pushed yet');\n if (r.ahead && r.ahead > 0) out.push(`${r.ahead} unpushed commit${r.ahead === 1 ? '' : 's'}`);\n if (r.behind && r.behind > 0) out.push(`origin has ${r.behind} commit${r.behind === 1 ? '' : 's'} you don't have locally — pull first`);\n if (!r.pr) {\n if (!r.ghError) out.push('no pull request');\n return out;\n }\n if (r.pr.state === 'CLOSED') out.push('pull request is closed');\n if (r.pr.state === 'MERGED') {\n // Not done (repoDone), so there's work after the merge.\n out.push(`PR #${r.pr.number} is already merged — the new work needs a new PR`);\n return out;\n }\n if (r.pr.isDraft) out.push('pull request is a draft');\n // The PR must be exactly what you have locally: otherwise merging lands\n // commits you haven't seen (or leaves out ones you have).\n if (r.localSha && r.pr.headSha && r.pr.headSha !== r.localSha && !(r.ahead || r.behind)) {\n out.push(\"the PR's head isn't your local HEAD — push or pull first\");\n }\n switch (r.pr.mergeStateStatus) {\n case 'DIRTY':\n out.push('merge conflicts with the base branch');\n break;\n case 'BEHIND':\n out.push('branch is behind the base branch');\n break;\n case 'BLOCKED':\n out.push('blocked by branch protection (reviews or required checks)');\n break;\n default:\n break;\n }\n if (r.pr.checks === 'fail') out.push('checks failing');\n else if (r.pr.checks === 'pending') out.push('checks still running');\n return out;\n}\n\nfunction oneLineErr(s: string): string {\n return (\n s\n .split(/\\r?\\n/)\n .map((l) => l.trim())\n .find(Boolean) ?? ''\n );\n}\n\n/** Whether to ask GitHub about a repo's PR at all (the PR watch skips\n * branches that were never pushed and have no PR it knows of). */\nexport type AskGh = (repo: { name: string; hasUpstream: boolean; commitsVsBase: number | null; host?: string }) => boolean;\n\n/** Whether to ask the host about another branch's PR (default: it was pushed — a branch never pushed has none). */\nexport type AskBranch = (repo: { name: string; host?: string }, branch: { name: string; pushed: boolean }) => boolean;\n\nexport interface PreflightOptions {\n askGh?: AskGh;\n /** A repo's other branches to look at (session-branches.ts); default: the session's record, recent ones. */\n branches?: (repo: { name: string; path: string }, current: string) => string[];\n askBranch?: AskBranch;\n}\n\n/** The session's recorded branches other than the one checked out, recent ones, per repo (the preflight's default). */\nexport function recordedOtherBranches(\n session: WorktreeSession,\n now = Date.now(),\n): { names: (repo: { name: string; path: string }, current: string) => string[]; askBranch: AskBranch } {\n const rec = readSessionBranches(sessionIdFor(session));\n return {\n names: (repo, current) => otherBranchesToWatch(rec, repo.name, current, now, BRANCH_WATCH_MS),\n // Pushed now, or once (origin's copy deleted after its PR merged): it may have a PR.\n askBranch: (repo, b) => b.pushed || wasPushed(rec, repo.name, b.name),\n };\n}\n\n/** The facts and PR of each of a repo's other branches. */\nasync function inspectOtherBranches(\n repo: { name: string; path: string },\n names: string[],\n run: CommandRunner,\n host: ReturnType<typeof hostForRepo>['host'],\n askBranch: AskBranch,\n): Promise<OtherBranchState[]> {\n if (!names.length) return [];\n const base = await repoBase(repo.path, run);\n const out: OtherBranchState[] = [];\n for (const name of names) {\n const f = await branchFacts(repo.path, name, run, base);\n let pr: ShipPr | null = null;\n let ghError: string | undefined;\n if (askBranch({ name: repo.name, ...(host.id === DEFAULT_HOST ? {} : { host: host.id }) }, { name, pushed: f.pushed })) {\n const found = await host.prForBranch(run, repo.path, name);\n if (found.kind === 'pr') pr = found.pr;\n else if (found.kind === 'error') ghError = found.error;\n }\n out.push({ name, ...f, merged: f.merged || pr?.state === 'MERGED', pr, ...(ghError ? { ghError } : {}) });\n }\n return out;\n}\n\nasync function inspectRepo(\n repo: { name: string; path: string },\n run: CommandRunner,\n askGh?: AskGh,\n others?: { names: (current: string) => string[]; askBranch: AskBranch },\n): Promise<RepoShipState> {\n const git = (...args: string[]) => run('git', args, repo.path);\n const branch = (await git('rev-parse', '--abbrev-ref', 'HEAD')).stdout.trim();\n const localSha = (await git('rev-parse', 'HEAD')).stdout.trim();\n const status = await git('status', '--porcelain');\n const dirtyFiles = status.stdout.split('\\n').filter((l) => l.trim()).length;\n const gitError =\n status.code === 0 ? undefined : `git couldn't read the working tree (${oneLineErr(status.stderr) || `exit ${status.code}`})`;\n\n // \"Published\" = origin/<branch> exists — NOT whatever @{u} points at.\n // `work tree` forks branches tracking origin/main, so @{u} is often the\n // base: measuring against it hides unpushed commits, and a plain push\n // fails (\"upstream branch ... does not match the name of your current\n // branch\").\n const remoteRef = `refs/remotes/origin/${branch}`;\n const hasUpstream = (await git('rev-parse', '--verify', '--quiet', remoteRef)).code === 0;\n const upstream = await git('rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{u}');\n const tracksRemote = upstream.code === 0 && upstream.stdout.trim() === `origin/${branch}`;\n let ahead: number | null = null;\n let behind: number | null = null;\n if (hasUpstream) {\n const counts = await git('rev-list', '--left-right', '--count', `${remoteRef}...HEAD`);\n const [b, a] = counts.stdout.trim().split(/\\s+/).map(Number);\n if (Number.isFinite(a) && Number.isFinite(b)) {\n ahead = a;\n behind = b;\n }\n }\n\n let commitsVsBase: number | null = null;\n const baseRef = (await git('rev-parse', '--abbrev-ref', 'origin/HEAD')).stdout.trim();\n // A git that failed (a timeout under load) tells nothing: no count, so never \"untouched\".\n if (status.code === 0 && baseRef && baseRef !== 'origin/HEAD') {\n // Only a count git gave: `Number('')` is 0, which read a failed git as \"no commits\".\n const count = await git('rev-list', '--count', `${baseRef}..HEAD`);\n if (count.code === 0 && /^\\d+$/.test(count.stdout.trim())) commitsVsBase = Number(count.stdout.trim());\n }\n\n let pr: ShipPr | null = null;\n let ghError: string | undefined;\n // The repo's host (its origin's; GitHub when none claims it): a group's repos may be on different ones.\n const { host } = hostForRepo(repo.path);\n const skipGh = askGh\n ? !askGh({ name: repo.name, hasUpstream, commitsVsBase, ...(host.id === DEFAULT_HOST ? {} : { host: host.id }) })\n : false;\n const found = skipGh ? ({ kind: 'none' } as const) : await host.prForBranch(run, repo.path, branch);\n if (found.kind === 'pr') pr = found.pr;\n else if (found.kind === 'error') ghError = found.error;\n\n // Merged at another commit: is HEAD inside it? Exit 0 = yes, 1 = no; anything else (the\n // head was never fetched here) is unknown, and unknown is no — never done on a guess.\n let behindMergedHead = false;\n if (pr?.state === 'MERGED' && localSha && pr.headSha && localSha !== pr.headSha && /^[0-9a-f]{7,64}$/i.test(pr.headSha)) {\n behindMergedHead = (await git('merge-base', '--is-ancestor', 'HEAD', pr.headSha)).code === 0;\n }\n\n const facts: RepoFacts = {\n name: repo.name,\n path: repo.path,\n branch,\n localSha,\n ...(behindMergedHead ? { behindMergedHead } : {}),\n dirtyFiles,\n hasUpstream,\n tracksRemote,\n ahead,\n behind,\n pr,\n ghError,\n ...(host.id === DEFAULT_HOST ? {} : { host: host.id }),\n commitsVsBase,\n ...(gitError ? { gitError } : {}),\n };\n const { done, reason } = repoDone(facts);\n // A detached HEAD is on no branch: every recorded one is another.\n const names = others && branch ? others.names(branch === 'HEAD' ? '' : branch) : [];\n const otherBranches = names.length ? await inspectOtherBranches(repo, names, run, host, others!.askBranch) : [];\n return {\n ...facts,\n done,\n doneReason: reason,\n mergeBlockers: mergeBlockers(facts),\n ...(otherBranches.length ? { otherBranches } : {}),\n };\n}\n\nexport async function shipPreflight(\n session: WorktreeSession,\n run: CommandRunner = defaultRunner,\n opts: PreflightOptions = {},\n): Promise<ShipPreflight> {\n const recorded = opts.branches && opts.askBranch ? null : recordedOtherBranches(session);\n const branches = opts.branches ?? recorded!.names;\n const askBranch = opts.askBranch ?? recorded?.askBranch ?? ((_repo, b) => b.pushed);\n const repos = await Promise.all(\n shipRepos(session).map((r) => inspectRepo(r, run, opts.askGh, { names: (current) => branches(r, current), askBranch })),\n );\n return { repos };\n}\n\nasync function push(r: RepoShipState, run: CommandRunner): Promise<ShipResult> {\n // Set tracking to origin/<branch> unless it already is; a plain push\n // with tracking on the base branch is refused by git.\n const args = r.tracksRemote ? ['push'] : ['push', '-u', 'origin', r.branch];\n const res = await run('git', args, r.path);\n return res.code === 0\n ? { repo: r.name, ok: true, message: r.hasUpstream ? 'pushed' : `published ${r.branch}` }\n : { repo: r.name, ok: false, message: oneLineErr(res.stderr) || 'git push failed' };\n}\n\n/**\n * push / create-pr across the session's repos. Done repos and repos with\n * no commits vs the base are skipped (reported ok), never failed.\n */\nexport async function runShipAction(\n session: WorktreeSession,\n action: 'push' | 'create-pr',\n opts: { draft?: boolean } = {},\n run: CommandRunner = defaultRunner,\n): Promise<ShipResult[]> {\n const { repos } = await shipPreflight(session, run);\n const results: ShipResult[] = [];\n for (const r of repos) {\n if (r.done) {\n results.push({ repo: r.name, ok: true, message: r.doneReason === 'merged' ? 'already merged' : 'untouched — skipped' });\n continue;\n }\n if (r.commitsVsBase === 0 && !r.pr) {\n results.push({ repo: r.name, ok: true, message: 'no commits vs the base branch — skipped' });\n continue;\n }\n if (action === 'push') {\n if (r.hasUpstream && !r.ahead && r.tracksRemote) {\n results.push({ repo: r.name, ok: true, message: 'nothing to push' });\n continue;\n }\n results.push(await push(r, run));\n continue;\n }\n // create-pr (a MERGED PR that isn't done means new work → new PR)\n if (r.pr && r.pr.state === 'OPEN') {\n results.push({ repo: r.name, ok: true, message: `PR #${r.pr.number} already open`, url: r.pr.url });\n continue;\n }\n if (r.ghError) {\n results.push({ repo: r.name, ok: false, message: r.ghError });\n continue;\n }\n if (!r.hasUpstream || (r.ahead ?? 0) > 0 || !r.tracksRemote) {\n const pushed = await push(r, run);\n if (!pushed.ok) {\n results.push(pushed);\n continue;\n }\n }\n const made = await hostForRepo(r.path).host.createPr(run, r.path, r.branch, { draft: !!opts.draft });\n if (made.ok) results.push({ repo: r.name, ok: true, message: opts.draft ? 'draft PR opened' : 'PR opened', url: made.url });\n else results.push({ repo: r.name, ok: false, message: made.error });\n }\n return results;\n}\n\nexport interface MergeOutcome {\n results: ShipResult[];\n /** Something was merged by this call. */\n mergedAny: boolean;\n /** After this call, every repo in the session is done. */\n allDone: boolean;\n}\n\n/**\n * Merge exactly the selected repos, at exactly the PR heads the user saw.\n *\n * Validation happens for ALL selected repos before ANY merge: an unknown\n * repo, a PR that moved (someone pushed after the user looked), or any\n * blocker refuses the whole call — no half-applied selection. Repos not\n * selected are never touched, so shipping a group in parts is a deliberate\n * choice, not an accident.\n */\nexport async function mergeSelected(\n session: WorktreeSession,\n selection: MergeSelection[],\n method: MergeMethod,\n run: CommandRunner = defaultRunner,\n): Promise<MergeOutcome> {\n const { repos } = await shipPreflight(session, run);\n const byName = new Map(repos.map((r) => [r.name, r]));\n if (selection.length === 0) {\n return {\n results: [{ repo: '-', ok: false, message: 'no repositories selected' }],\n mergedAny: false,\n allDone: repos.every((r) => r.done),\n };\n }\n\n const problems: ShipResult[] = [];\n for (const sel of selection) {\n const r = byName.get(sel.name);\n if (!r) {\n problems.push({ repo: sel.name, ok: false, message: 'not a repository of this session' });\n } else if (r.done) {\n problems.push({ repo: r.name, ok: false, message: r.doneReason === 'merged' ? 'already merged' : 'nothing to merge' });\n } else if (!r.pr || r.pr.headSha !== sel.headSha) {\n problems.push({\n repo: r.name,\n ok: false,\n message: 'the pull request changed since you looked — review it again before merging',\n });\n } else if (r.mergeBlockers.length > 0) {\n problems.push({ repo: r.name, ok: false, message: `not merged: ${r.mergeBlockers.join('; ')}` });\n }\n }\n if (problems.length > 0) {\n const failed = new Set(problems.map((p) => p.repo));\n const held = selection\n .filter((s) => !failed.has(s.name))\n .map((s) => ({ repo: s.name, ok: false, message: 'not merged: another selected repo is blocked' }));\n return { results: [...problems, ...held], mergedAny: false, allDone: repos.every((r) => r.done) };\n }\n\n const results: ShipResult[] = [];\n const mergedNow = new Set<string>();\n for (const sel of selection) {\n const r = byName.get(sel.name)!;\n const res = await hostForRepo(r.path).host.mergePr(run, r.path, r.pr!.number, method, sel.headSha);\n if (res.ok) {\n mergedNow.add(r.name);\n results.push({ repo: r.name, ok: true, merged: true, message: `PR #${r.pr!.number} merged (${method})`, url: r.pr!.url });\n } else {\n // Stop at the first failure rather than keep merging a partially\n // failing selection; what's merged is reported as merged.\n results.push({ repo: r.name, ok: false, message: res.error });\n break;\n }\n }\n const attempted = new Set(results.map((x) => x.repo));\n for (const sel of selection) {\n if (!attempted.has(sel.name)) {\n results.push({ repo: sel.name, ok: false, message: 'not merged: stopped after an earlier failure' });\n }\n }\n // Work on another branch it worked on (commits not pushed, a PR open) keeps it from being done.\n const allDone = repos.every((r) => r.done || mergedNow.has(r.name)) && workElsewhere({ repos }).length === 0;\n return { results, mergedAny: mergedNow.size > 0, allDone };\n}\n","import type { ShipPr, ShipPreflight } from '../api-types.js';\n\n/**\n * A session's other branches (session-branches.ts) in Ship's and the PR watch's decisions. Pure and\n * import-free but for types: the PR watch is pure policy, and the demo imports it.\n */\n\n/**\n * Work on a session's other branches that isn't finished (session-branches.ts): commits not pushed, a PR still\n * open, or one the host couldn't tell of. A session with any is never done — not archived by Ship's merge nor by\n * the PR watch — however its checked-out branch stands. Pure.\n */\nexport function workElsewhere(pre: ShipPreflight): string[] {\n const out: string[] = [];\n for (const r of pre.repos) {\n for (const b of r.otherBranches ?? []) {\n const parts: string[] = [];\n // Its PR merged at its tip: nothing on it is left behind, whether origin still has the branch or not.\n const mergedAtTip = b.pr?.state === 'MERGED' && !!b.sha && b.pr.headSha === b.sha;\n if (!mergedAtTip) {\n if (b.exists && b.unpushed === null && !b.merged) parts.push('its commits unknown');\n if (b.exists && b.unpushed && b.unpushed > 0) parts.push(`${b.unpushed} commit${b.unpushed === 1 ? '' : 's'} not pushed`);\n }\n if (b.pr?.state === 'OPEN') parts.push(`PR #${b.pr.number} open`);\n if (b.ghError && b.pushed) parts.push(`its PR unknown (${b.ghError})`);\n if (parts.length) out.push(`${r.name}: ${b.name} — ${parts.join(', ')}`);\n }\n }\n return out;\n}\n\n/**\n * A repo's other branches' PRs, newest first (by number): what the stage picks the newest open one from. A\n * branch whose PR couldn't be read this time keeps none here — `workElsewhere` holds the archive meanwhile.\n */\nexport function otherPrsOf(r: Pick<ShipPreflight['repos'][number], 'otherBranches'>): Array<{ branch: string; pr: ShipPr }> {\n return (r.otherBranches ?? [])\n .filter((b): b is typeof b & { pr: ShipPr } => !!b.pr)\n .map((b) => ({ branch: b.name, pr: b.pr }))\n .sort((a, b) => b.pr.number - a.pr.number);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,UAAU;;;ACYV,SAAS,cAAc,KAA8B;AAC1D,QAAM,MAAgB,CAAC;AACvB,aAAW,KAAK,IAAI,OAAO;AACzB,eAAW,KAAK,EAAE,iBAAiB,CAAC,GAAG;AACrC,YAAM,QAAkB,CAAC;AAEzB,YAAM,cAAc,EAAE,IAAI,UAAU,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,YAAY,EAAE;AAC9E,UAAI,CAAC,aAAa;AAChB,YAAI,EAAE,UAAU,EAAE,aAAa,QAAQ,CAAC,EAAE,OAAQ,OAAM,KAAK,qBAAqB;AAClF,YAAI,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAG,OAAM,KAAK,GAAG,EAAE,QAAQ,UAAU,EAAE,aAAa,IAAI,KAAK,GAAG,aAAa;AAAA,MAC1H;AACA,UAAI,EAAE,IAAI,UAAU,OAAQ,OAAM,KAAK,OAAO,EAAE,GAAG,MAAM,OAAO;AAChE,UAAI,EAAE,WAAW,EAAE,OAAQ,OAAM,KAAK,mBAAmB,EAAE,OAAO,GAAG;AACrE,UAAI,MAAM,OAAQ,KAAI,KAAK,GAAG,EAAE,IAAI,KAAK,EAAE,IAAI,WAAM,MAAM,KAAK,IAAI,CAAC,EAAE;AAAA,IACzE;AAAA,EACF;AACA,SAAO;AACT;AAMO,SAAS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