@unbrained/pm-cli 2026.7.5 → 2026.7.7
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/CHANGELOG.md +42 -0
- package/dist/cli/commands/annotation-command.d.ts +1 -0
- package/dist/cli/commands/annotation-command.js +29 -2
- package/dist/cli/commands/annotation-command.js.map +1 -1
- package/dist/cli/commands/comments.js +3 -4
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
- package/dist/cli/commands/extension/bundled-catalog.js +38 -28
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.js +81 -18
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/health.js +9 -5
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/learnings.js +5 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/notes.js +5 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +4 -3
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +3 -3
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.d.ts +9 -0
- package/dist/cli/commands/test.js +144 -105
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/extension-command-help.js +10 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +18 -27
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-operations.d.ts +0 -8
- package/dist/cli/register-operations.js +41 -46
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +113 -13
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +5 -1
- package/dist/cli/registration-helpers.js +14 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/append-F7WPGIQL.js +11 -0
- package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js → append-PVCTBVJG.js} +8 -9
- package/dist/cli-bundle/chunks/{chunk-PPE4YUQM.js → chunk-2APXX4TZ.js} +17 -28
- package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js → chunk-2LEJGRQ7.js} +3 -12
- package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js.map → chunk-2LEJGRQ7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js → chunk-2TILG6F2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js → chunk-3G6UMXT3.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js.map → chunk-3G6UMXT3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js → chunk-3TYOW6RR.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js → chunk-3X542TEY.js} +7 -7
- package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js → chunk-42LXP4VO.js} +14 -21
- package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js.map → chunk-42LXP4VO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5J2XPTAD.js → chunk-43SIHQND.js} +36 -15
- package/dist/cli-bundle/chunks/chunk-43SIHQND.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js → chunk-43UQN754.js} +12 -19
- package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js.map → chunk-43UQN754.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js → chunk-43YSKY75.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js.map → chunk-43YSKY75.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-72YXN5JX.js → chunk-4BKDAEDF.js} +6 -13
- package/dist/cli-bundle/chunks/{notes-72YXN5JX.js.map → chunk-4BKDAEDF.js.map} +2 -2
- package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js → chunk-4IQKDKGE.js} +18 -32
- package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js.map → chunk-4IQKDKGE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js → chunk-4MZOKTI2.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js.map → chunk-4MZOKTI2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js → chunk-52NS7JDP.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js.map → chunk-52NS7JDP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js → chunk-565WYS5W.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js.map → chunk-565WYS5W.js.map} +1 -1
- package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js → chunk-5FIQ4EX3.js} +13 -19
- package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js.map → chunk-5FIQ4EX3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{config-V57QD47V.js → chunk-6G6O3OPQ.js} +259 -41
- package/dist/cli-bundle/chunks/chunk-6G6O3OPQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js → chunk-6LCJRGPD.js} +9 -13
- package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js.map → chunk-6LCJRGPD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js → chunk-6UQCNWFV.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js.map → chunk-6UQCNWFV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-LEKT4K7I.js → chunk-6XTSYPPO.js} +1216 -387
- package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js +5434 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js → chunk-7PNQA24K.js} +30 -36
- package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js.map → chunk-7PNQA24K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js → chunk-7VQ3JJN5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js → chunk-7Y5N34HX.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js.map → chunk-7Y5N34HX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js → chunk-AGAVEDIE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js → chunk-AJUON7E6.js} +3 -3
- package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js → chunk-ARKHKYYS.js} +16 -30
- package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js.map → chunk-ARKHKYYS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7EQNAZX2.js → chunk-C5ACVMOI.js} +99 -51
- package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js → chunk-CJQM7O7R.js} +16 -20
- package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js.map → chunk-CJQM7O7R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js → chunk-D2DCTFTL.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js.map → chunk-D2DCTFTL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js → chunk-DDDWVPID.js} +7 -11
- package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js.map → chunk-DDDWVPID.js.map} +1 -1
- package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js → chunk-DG6BSXZ7.js} +6 -13
- package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js.map → chunk-DG6BSXZ7.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js → chunk-DR2V5OIV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js → chunk-E3LWJUGF.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js.map → chunk-E3LWJUGF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js → chunk-E3YQFSFE.js} +6 -10
- package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js.map → chunk-E3YQFSFE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js → chunk-EDO7VXSO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FDBARR33.js → chunk-EIUBK2LT.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-FDBARR33.js.map → chunk-EIUBK2LT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js → chunk-EMXPI36L.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js.map → chunk-EMXPI36L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4OFLJHX6.js → chunk-EOUVR7JN.js} +13 -8
- package/dist/cli-bundle/chunks/chunk-EOUVR7JN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js → chunk-EVEPHNXJ.js} +4 -4
- package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js → chunk-F6MT7KKE.js} +6 -10
- package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js.map → chunk-F6MT7KKE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js → chunk-F6YC2A6X.js} +7 -11
- package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js.map → chunk-F6YC2A6X.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js +5514 -0
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js → chunk-FN6SB4HU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js +5359 -0
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JLA7EVYV.js → chunk-GLS6VMWI.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-GLS6VMWI.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js → chunk-GPIDUMMN.js} +10 -17
- package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js.map → chunk-GPIDUMMN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js → chunk-GTM5HQL4.js} +15 -21
- package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js.map → chunk-GTM5HQL4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js → chunk-H2SMKL2N.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-S4APD35C.js → chunk-HHEWQXPD.js} +6 -6
- package/dist/cli-bundle/chunks/chunk-HHEWQXPD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js → chunk-HX6QXV5P.js} +2 -2
- package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js → chunk-I74FMIWA.js} +11 -17
- package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js.map → chunk-I74FMIWA.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js +804 -0
- package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js → chunk-II7R6KD4.js} +9 -13
- package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js.map → chunk-II7R6KD4.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js +10320 -0
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js → chunk-J7BOLHAV.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js.map → chunk-J7BOLHAV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js → chunk-KTGJ2CBU.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js.map → chunk-KTGJ2CBU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js → chunk-LCFJ7XAM.js} +32 -2
- package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js.map → chunk-LCFJ7XAM.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js → chunk-LZQU6XJG.js} +28 -34
- package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js.map → chunk-LZQU6XJG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js → chunk-M62RO3XK.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js.map → chunk-M62RO3XK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js → chunk-MCEUKJKW.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js.map → chunk-MCEUKJKW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-T5Y3QSNF.js → chunk-MHNMCDWR.js} +1447 -86
- package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js → chunk-MRFWUSVA.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js.map → chunk-MRFWUSVA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js → chunk-N6ZHDLUY.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js.map → chunk-N6ZHDLUY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js → chunk-NWWL22C7.js} +8 -12
- package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js.map → chunk-NWWL22C7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js → chunk-P3MJJW7P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js → chunk-PDXJXEZJ.js} +2 -2
- package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js → chunk-Q64AYQYW.js} +9 -13
- package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js.map → chunk-Q64AYQYW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js → chunk-QDABF2RB.js} +26 -47
- package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js.map → chunk-QDABF2RB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NBFCNJ7Q.js → chunk-QFBSP3NI.js} +529 -46
- package/dist/cli-bundle/chunks/chunk-QFBSP3NI.js.map +1 -0
- package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js → chunk-RB3KLPAH.js} +11 -16
- package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js.map → chunk-RB3KLPAH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YSAH5FY5.js → chunk-RY7PTTUB.js} +94 -53
- package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WVSGSZ6J.js → chunk-S547WBYG.js} +1477 -86
- package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js → chunk-S5BNGFN5.js} +24 -45
- package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js.map → chunk-S5BNGFN5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js → chunk-S6VC2A2K.js} +9 -14
- package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js.map → chunk-S6VC2A2K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js → chunk-SIM5JDON.js} +7 -14
- package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js.map → chunk-SIM5JDON.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZD34OFFQ.js → chunk-SY75LYXR.js} +12 -7
- package/dist/cli-bundle/chunks/chunk-SY75LYXR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TT42JUMF.js → chunk-TEISGNSH.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-TEISGNSH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js → chunk-TEKZOS7M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js → chunk-TGUK6XN6.js} +14 -18
- package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js.map → chunk-TGUK6XN6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js → chunk-TNC6MZUD.js} +10 -21
- package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js.map → chunk-TNC6MZUD.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js +10498 -0
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YD5FML7K.js → chunk-UO7XAZK6.js} +27 -4
- package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js → chunk-V5ZWKJNY.js} +5 -14
- package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js.map → chunk-V5ZWKJNY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js → chunk-VGO73OCK.js} +7 -14
- package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js.map → chunk-VGO73OCK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js → chunk-VLEA2UTQ.js} +2 -2
- package/dist/cli-bundle/chunks/{files-6P57MRKL.js → chunk-W5HXHC7C.js} +8 -15
- package/dist/cli-bundle/chunks/{files-6P57MRKL.js.map → chunk-W5HXHC7C.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js → chunk-WCWVEXGA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js +6690 -0
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +7 -0
- package/dist/cli-bundle/chunks/{delete-62JQTYT4.js → chunk-XBX5CBRQ.js} +6 -10
- package/dist/cli-bundle/chunks/{delete-62JQTYT4.js.map → chunk-XBX5CBRQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MTTXDAK4.js → chunk-XC3X7BQR.js} +541 -44
- package/dist/cli-bundle/chunks/chunk-XC3X7BQR.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js → chunk-XHCVAZGM.js} +17 -23
- package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js.map → chunk-XHCVAZGM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js → chunk-XPMXPR7K.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js.map → chunk-XPMXPR7K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js → chunk-XS2TMNXR.js} +8 -12
- package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js.map → chunk-XS2TMNXR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-XWY5T67S.js → chunk-XXIYUTLK.js} +12 -23
- package/dist/cli-bundle/chunks/{plan-XWY5T67S.js.map → chunk-XXIYUTLK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7QH7DHUB.js → chunk-XZWL7VNE.js} +1220 -398
- package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js +6624 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js → chunk-Y7KYVCZM.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js.map → chunk-Y7KYVCZM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-UI5BJ6DO.js → chunk-YCVWWIKY.js} +17 -28
- package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js +780 -0
- package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js +5509 -0
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js → chunk-YPD7SQ5P.js} +8 -12
- package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js.map → chunk-YPD7SQ5P.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js → chunk-YPMZMKN7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js → chunk-YTD5GICJ.js} +4 -4
- package/dist/cli-bundle/chunks/{config-DJJKZB5R.js → chunk-ZNEG2UDO.js} +264 -39
- package/dist/cli-bundle/chunks/{config-DJJKZB5R.js.map → chunk-ZNEG2UDO.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js → chunk-ZO7CLOY2.js} +3 -3
- package/dist/cli-bundle/chunks/{close-3YRR3XY6.js → close-3YYQ5OG2.js} +5 -9
- package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +12 -0
- package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +22 -0
- package/dist/cli-bundle/chunks/close-many-D366FTIG.js +26 -0
- package/dist/cli-bundle/chunks/comments-54XDJNFE.js +17 -0
- package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +13 -0
- package/dist/cli-bundle/chunks/copy-44RT5GDW.js +13 -0
- package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +9 -0
- package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js → create-4GWJWPXG.js} +9 -14
- package/dist/cli-bundle/chunks/create-AZXCUYKP.js +25 -0
- package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +10 -0
- package/dist/cli-bundle/chunks/delete-YQ2VPXNF.js +14 -0
- package/dist/cli-bundle/chunks/deps-BU5EBJDU.js +17 -0
- package/dist/cli-bundle/chunks/deps-FMANWFRP.js +13 -0
- package/dist/cli-bundle/chunks/docs-OQBSJNIA.js +18 -0
- package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +14 -0
- package/dist/cli-bundle/chunks/files-72HZEBOE.js +18 -0
- package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js → files-HTSB2KJG.js} +13 -13
- package/dist/cli-bundle/chunks/focus-FOG4ALC2.js +14 -0
- package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +10 -0
- package/dist/cli-bundle/chunks/history-compact-M6IFAMBP.js +25 -0
- package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +21 -0
- package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js → history-redact-NQX3OGZP.js} +7 -11
- package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +17 -0
- package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +19 -0
- package/dist/cli-bundle/chunks/history-repair-NHOJG7WO.js +23 -0
- package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +13 -0
- package/dist/cli-bundle/chunks/learnings-T63JGKKN.js +17 -0
- package/dist/cli-bundle/chunks/notes-73WE2UV2.js +13 -0
- package/dist/cli-bundle/chunks/notes-U7L6HQQ2.js +17 -0
- package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +24 -0
- package/dist/cli-bundle/chunks/plan-OSCNYFGC.js.map +7 -0
- package/dist/cli-bundle/chunks/plan-TN537L24.js +28 -0
- package/dist/cli-bundle/chunks/plan-TN537L24.js.map +1 -0
- package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js +37 -0
- package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js.map +1 -0
- package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js +33 -0
- package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-5H66WFYF.js → register-list-query-OHXD7G5N.js} +41 -33
- package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-FB3FNDLZ.js → register-list-query-ZCRABAPN.js} +42 -34
- package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js → register-mutation-P3G4XP6Q.js} +36 -41
- package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js.map → register-mutation-P3G4XP6Q.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js → register-mutation-XX4H56PE.js} +34 -39
- package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js.map → register-mutation-XX4H56PE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-A3XAM5J7.js → register-operations-V6PIYEDU.js} +80 -52
- package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-SG7HBSUP.js → register-operations-V6VKTG54.js} +79 -51
- package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-K6U3NVY5.js → register-setup-6RVAWT6W.js} +129 -31
- package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-I45OGJUV.js → register-setup-6YVUSQYD.js} +130 -32
- package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +1 -0
- package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js → restore-HC3YSWF7.js} +7 -11
- package/dist/cli-bundle/chunks/restore-HC3YSWF7.js.map +1 -0
- package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +15 -0
- package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js → schema-DAGSYO6E.js} +6 -10
- package/dist/cli-bundle/chunks/schema-DAGSYO6E.js.map +7 -0
- package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js → schema-UBXJCQAC.js} +6 -10
- package/dist/cli-bundle/chunks/schema-UBXJCQAC.js.map +1 -0
- package/dist/cli-bundle/chunks/update-CJGG5WMV.js +21 -0
- package/dist/cli-bundle/chunks/update-CJGG5WMV.js.map +7 -0
- package/dist/cli-bundle/chunks/update-LKD64AFP.js +25 -0
- package/dist/cli-bundle/chunks/update-LKD64AFP.js.map +1 -0
- package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +31 -0
- package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +35 -0
- package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js.map +1 -0
- package/dist/cli-bundle/main.js +29 -31
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +136 -54
- package/dist/cli-bundle/sdk-testing.js +7 -8
- package/dist/cli-bundle/sdk.js +132 -84
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/core/history/drift-scan.js +3 -8
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/output/mutation-projection.js +11 -5
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/search/cache.js +3 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/semantic-defaults.d.ts +2 -0
- package/dist/core/search/semantic-defaults.js +11 -4
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -1
- package/dist/core/search/vector-stores.js +33 -7
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/mcp/server.d.ts +22 -50
- package/dist/mcp/server.js +62 -916
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +7 -7
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +9 -7
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/index.d.ts +4 -2
- package/dist/sdk/index.js +4 -4
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +312 -5
- package/dist/sdk/runtime.js +1391 -26
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/start-task-status.d.ts +13 -0
- package/dist/sdk/start-task-status.js +19 -0
- package/dist/sdk/start-task-status.js.map +1 -0
- package/dist/sdk/workspace-contracts-cache.d.ts +17 -0
- package/dist/sdk/workspace-contracts-cache.js +36 -0
- package/dist/sdk/workspace-contracts-cache.js.map +1 -0
- package/docs/COMMANDS.md +10 -1
- package/docs/RELEASING.md +3 -1
- package/docs/SDK.md +81 -0
- package/docs/TESTING.md +3 -0
- package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +16 -2
- package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +16 -1
- package/package.json +1 -1
- package/dist/cli-bundle/chunks/activity-4XQIDNM5.js +0 -18
- package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js +0 -375
- package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js.map +0 -7
- package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js +0 -372
- package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js +0 -1961
- package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js +0 -1749
- package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js +0 -822
- package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4OFLJHX6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-53BTLLAF.js +0 -2181
- package/dist/cli-bundle/chunks/chunk-53BTLLAF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-57C2RLW5.js +0 -1704
- package/dist/cli-bundle/chunks/chunk-57C2RLW5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js +0 -2330
- package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5J2XPTAD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js +0 -995
- package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js +0 -819
- package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7EQNAZX2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7QH7DHUB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js +0 -530
- package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js +0 -275
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js +0 -231
- package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js +0 -2184
- package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js +0 -1615
- package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FJRKQREY.js +0 -228
- package/dist/cli-bundle/chunks/chunk-FJRKQREY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js +0 -3237
- package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HK72NWAD.js +0 -1570
- package/dist/cli-bundle/chunks/chunk-HK72NWAD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js +0 -3206
- package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JLA7EVYV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js +0 -76
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js +0 -79
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js +0 -915
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js +0 -218
- package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LEKT4K7I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js +0 -1858
- package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MTTXDAK4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js +0 -520
- package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js +0 -1041
- package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NBFCNJ7Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js +0 -918
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js +0 -1985
- package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js +0 -238
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-P5YORJRH.js +0 -1977
- package/dist/cli-bundle/chunks/chunk-P5YORJRH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js +0 -1031
- package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-S4APD35C.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js +0 -1149
- package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js +0 -272
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TT42JUMF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js +0 -165
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-US3T3W5J.js +0 -1932
- package/dist/cli-bundle/chunks/chunk-US3T3W5J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js +0 -175
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js +0 -1868
- package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js +0 -1152
- package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YD5FML7K.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YSAH5FY5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js +0 -1005
- package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js +0 -215
- package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZD34OFFQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js +0 -2306
- package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js +0 -241
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js.map +0 -7
- package/dist/cli-bundle/chunks/claim-4DROPSIS.js +0 -144
- package/dist/cli-bundle/chunks/claim-4DROPSIS.js.map +0 -1
- package/dist/cli-bundle/chunks/claim-VX54TV5U.js +0 -147
- package/dist/cli-bundle/chunks/claim-VX54TV5U.js.map +0 -7
- package/dist/cli-bundle/chunks/close-OB2Y4QP5.js +0 -16
- package/dist/cli-bundle/chunks/config-V57QD47V.js.map +0 -1
- package/dist/cli-bundle/chunks/context-4OQGIPSO.js +0 -45
- package/dist/cli-bundle/chunks/context-WLA6IAWE.js +0 -49
- package/dist/cli-bundle/chunks/contracts-HXJLKCRI.js +0 -12
- package/dist/cli-bundle/chunks/create-WKOZKPQR.js +0 -30
- package/dist/cli-bundle/chunks/eval-N6UHFWVO.js +0 -288
- package/dist/cli-bundle/chunks/eval-N6UHFWVO.js.map +0 -7
- package/dist/cli-bundle/chunks/eval-PHOTWYHI.js +0 -278
- package/dist/cli-bundle/chunks/eval-PHOTWYHI.js.map +0 -1
- package/dist/cli-bundle/chunks/extension-NBAH62ML.js +0 -40
- package/dist/cli-bundle/chunks/extension-ZF6ZZPOU.js +0 -44
- package/dist/cli-bundle/chunks/gc-AETFKZ44.js +0 -398
- package/dist/cli-bundle/chunks/gc-AETFKZ44.js.map +0 -7
- package/dist/cli-bundle/chunks/gc-RLBP4QVN.js +0 -388
- package/dist/cli-bundle/chunks/gc-RLBP4QVN.js.map +0 -1
- package/dist/cli-bundle/chunks/get-NH2MPBCI.js +0 -283
- package/dist/cli-bundle/chunks/get-NH2MPBCI.js.map +0 -1
- package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js +0 -286
- package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js.map +0 -7
- package/dist/cli-bundle/chunks/health-3GVPMQBL.js +0 -1612
- package/dist/cli-bundle/chunks/health-3GVPMQBL.js.map +0 -1
- package/dist/cli-bundle/chunks/health-DNTM72GJ.js +0 -1615
- package/dist/cli-bundle/chunks/health-DNTM72GJ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-RYKLC72X.js +0 -20
- package/dist/cli-bundle/chunks/history-SGPYRAFT.js +0 -24
- package/dist/cli-bundle/chunks/history-redact-4H3FCKF3.js +0 -21
- package/dist/cli-bundle/chunks/init-RPIPQUNV.js +0 -32
- package/dist/cli-bundle/chunks/init-SKQAESQS.js +0 -28
- package/dist/cli-bundle/chunks/list-64LHZ3HM.js +0 -32
- package/dist/cli-bundle/chunks/list-7LXBTEKI.js +0 -36
- package/dist/cli-bundle/chunks/next-7ODPAQ4U.js +0 -306
- package/dist/cli-bundle/chunks/next-7ODPAQ4U.js.map +0 -7
- package/dist/cli-bundle/chunks/next-ODJUM4ZM.js +0 -303
- package/dist/cli-bundle/chunks/next-ODJUM4ZM.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js +0 -397
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js +0 -400
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-5H66WFYF.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-FB3FNDLZ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-A3XAM5J7.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-SG7HBSUP.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-I45OGJUV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-K6U3NVY5.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-PXOFL6AM.js +0 -19
- package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js +0 -91
- package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js.map +0 -7
- package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js +0 -88
- package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js.map +0 -1
- package/dist/cli-bundle/chunks/search-3S72CTD6.js +0 -38
- package/dist/cli-bundle/chunks/search-WNUNBQXO.js +0 -34
- package/dist/cli-bundle/chunks/stats-IJYTRQGV.js +0 -250
- package/dist/cli-bundle/chunks/stats-IJYTRQGV.js.map +0 -7
- package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js +0 -240
- package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js.map +0 -1
- package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js +0 -309
- package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js +0 -306
- package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js.map +0 -1
- package/dist/cli-bundle/chunks/test-DQ2QFJ7W.js +0 -45
- package/dist/cli-bundle/chunks/test-W7QBLVJS.js +0 -41
- package/dist/cli-bundle/chunks/test-all-636NTRTT.js +0 -434
- package/dist/cli-bundle/chunks/test-all-636NTRTT.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js +0 -437
- package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-245OINZR.js +0 -28
- package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js +0 -24
- package/dist/cli-bundle/chunks/update-SFLZPJXX.js +0 -30
- package/dist/cli-bundle/chunks/update-SJZ6S77U.js +0 -26
- package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js +0 -290
- package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js +0 -287
- package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-PA4FDTOV.js +0 -2143
- package/dist/cli-bundle/chunks/validate-PA4FDTOV.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js +0 -2105
- package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-4XQIDNM5.js.map → append-F7WPGIQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js.map → append-PVCTBVJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js.map → chunk-2TILG6F2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js.map → chunk-3TYOW6RR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js.map → chunk-3X542TEY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js.map → chunk-7VQ3JJN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js.map → chunk-AGAVEDIE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js.map → chunk-AJUON7E6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js.map → chunk-DR2V5OIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js.map → chunk-EDO7VXSO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js.map → chunk-EVEPHNXJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js.map → chunk-FN6SB4HU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js.map → chunk-H2SMKL2N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js.map → chunk-HX6QXV5P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js.map → chunk-P3MJJW7P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js.map → chunk-PDXJXEZJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js.map → chunk-TEKZOS7M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js.map → chunk-VLEA2UTQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js.map → chunk-WCWVEXGA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js.map → chunk-YPMZMKN7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js.map → chunk-YTD5GICJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js.map → chunk-ZO7CLOY2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-3YRR3XY6.js.map → close-3YYQ5OG2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-OB2Y4QP5.js.map → close-Z3Q4U7TS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-4OQGIPSO.js.map → close-many-3L2RXH3M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-WLA6IAWE.js.map → close-many-D366FTIG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js.map → comments-54XDJNFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-HXJLKCRI.js.map → comments-HGHC2PN6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js.map → copy-44RT5GDW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-WKOZKPQR.js.map → copy-UGMUGHZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-ZF6ZZPOU.js.map → create-4GWJWPXG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-NBAH62ML.js.map → create-AZXCUYKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-RYKLC72X.js.map → delete-Y6SXIQ4X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-SGPYRAFT.js.map → delete-YQ2VPXNF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js.map → deps-BU5EBJDU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-4H3FCKF3.js.map → deps-FMANWFRP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-RPIPQUNV.js.map → docs-OQBSJNIA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-SKQAESQS.js.map → docs-VNPBZXEL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-64LHZ3HM.js.map → files-72HZEBOE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-7LXBTEKI.js.map → files-HTSB2KJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js.map → focus-FOG4ALC2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-PXOFL6AM.js.map → focus-SUTMKXGX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js.map → history-compact-M6IFAMBP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js.map → history-compact-NEXRPP2O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-3S72CTD6.js.map → history-redact-NQX3OGZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-WNUNBQXO.js.map → history-redact-WQJBZ3PX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-W7QBLVJS.js.map → history-repair-CBHMHAJO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-DQ2QFJ7W.js.map → history-repair-NHOJG7WO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-ZRD4GCTT.js.map → learnings-M64NTSOR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-245OINZR.js.map → learnings-T63JGKKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-SJZ6S77U.js.map → notes-73WE2UV2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-SFLZPJXX.js.map → notes-U7L6HQQ2.js.map} +0 -0
|
@@ -1,1031 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="06f25e42-4a55-5490-b7f5-780bc79db731")}catch(e){}}();
|
|
3
|
-
import {
|
|
4
|
-
parseLimit
|
|
5
|
-
} from "./chunk-YFIE7YK6.js";
|
|
6
|
-
import {
|
|
7
|
-
nowIso
|
|
8
|
-
} from "./chunk-FJRKQREY.js";
|
|
9
|
-
import {
|
|
10
|
-
PmCliError,
|
|
11
|
-
readSettings
|
|
12
|
-
} from "./chunk-US3T3W5J.js";
|
|
13
|
-
import {
|
|
14
|
-
EXIT_CODE,
|
|
15
|
-
ensureDir,
|
|
16
|
-
getSettingsPath,
|
|
17
|
-
getTestRunRecordPath,
|
|
18
|
-
getTestRunResultPath,
|
|
19
|
-
getTestRunStderrPath,
|
|
20
|
-
getTestRunStdoutPath,
|
|
21
|
-
getTestRunsPath,
|
|
22
|
-
getTestRunsRecordsPath,
|
|
23
|
-
getTestRunsResultsPath,
|
|
24
|
-
getTestRunsStderrPath,
|
|
25
|
-
getTestRunsStdoutPath,
|
|
26
|
-
pathExists,
|
|
27
|
-
readFileIfExists,
|
|
28
|
-
resolveGlobalPmRoot,
|
|
29
|
-
resolvePmRoot,
|
|
30
|
-
writeFileAtomic
|
|
31
|
-
} from "./chunk-YD5FML7K.js";
|
|
32
|
-
|
|
33
|
-
// dist/cli/commands/test-runs.js
|
|
34
|
-
import os from "node:os";
|
|
35
|
-
|
|
36
|
-
// dist/core/test/background-runs.js
|
|
37
|
-
import fs from "node:fs/promises";
|
|
38
|
-
import { spawn } from "node:child_process";
|
|
39
|
-
import { createHash, randomBytes } from "node:crypto";
|
|
40
|
-
import path from "node:path";
|
|
41
|
-
var BACKGROUND_RUN_ACTIVE_STATUSES = /* @__PURE__ */ new Set(["queued", "running"]);
|
|
42
|
-
var BACKGROUND_RUN_TERMINAL_STATUSES = /* @__PURE__ */ new Set(["passed", "failed", "stopped", "canceled"]);
|
|
43
|
-
var DEFAULT_BACKGROUND_RUN_RESOURCE_SNAPSHOT_INTERVAL_MS = 3e3;
|
|
44
|
-
var DEFAULT_BACKGROUND_RUN_FORCE_KILL_DELAY_MS = 3e3;
|
|
45
|
-
var DEFAULT_BACKGROUND_RUN_HEARTBEAT_STALE_MS = 3e4;
|
|
46
|
-
var DEFAULT_BACKGROUND_RUN_LOG_TAIL_LINES = 100;
|
|
47
|
-
var PROC_STAT_TICKS_PER_SECOND = 100;
|
|
48
|
-
function nowMs() {
|
|
49
|
-
return Date.now();
|
|
50
|
-
}
|
|
51
|
-
function normalizeCommandArgs(args) {
|
|
52
|
-
return args.map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
53
|
-
}
|
|
54
|
-
function summarizeCommandLabel(args) {
|
|
55
|
-
const joined = args.join(" ").replaceAll(/\s+/g, " ").trim();
|
|
56
|
-
if (joined.length <= 180) {
|
|
57
|
-
return joined;
|
|
58
|
-
}
|
|
59
|
-
return `${joined.slice(0, 177)}...`;
|
|
60
|
-
}
|
|
61
|
-
function buildRunId() {
|
|
62
|
-
const timePart = Date.now().toString(36);
|
|
63
|
-
const randomPart = randomBytes(3).toString("hex");
|
|
64
|
-
return `tr-${timePart}-${randomPart}`;
|
|
65
|
-
}
|
|
66
|
-
function buildBackgroundTestRunFingerprint(kind, commandArgs, pmRoot) {
|
|
67
|
-
const payload = {
|
|
68
|
-
kind,
|
|
69
|
-
command: normalizeCommandArgs(commandArgs),
|
|
70
|
-
pm_root: path.resolve(pmRoot)
|
|
71
|
-
};
|
|
72
|
-
return createHash("sha256").update(JSON.stringify(payload)).digest("hex");
|
|
73
|
-
}
|
|
74
|
-
function isPidRunning(pid) {
|
|
75
|
-
if (!Number.isInteger(pid) || !pid || pid <= 0) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
try {
|
|
79
|
-
process.kill(pid, 0);
|
|
80
|
-
return true;
|
|
81
|
-
} catch (error) {
|
|
82
|
-
const code = typeof error === "object" && error !== null && "code" in error ? error.code : void 0;
|
|
83
|
-
return code === "EPERM";
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
async function ensureBackgroundRunStorage(pmRoot) {
|
|
87
|
-
await ensureDir(getTestRunsPath(pmRoot));
|
|
88
|
-
await ensureDir(getTestRunsRecordsPath(pmRoot));
|
|
89
|
-
await ensureDir(getTestRunsStdoutPath(pmRoot));
|
|
90
|
-
await ensureDir(getTestRunsStderrPath(pmRoot));
|
|
91
|
-
await ensureDir(getTestRunsResultsPath(pmRoot));
|
|
92
|
-
}
|
|
93
|
-
async function parseBackgroundRunRecord(raw, recordPath) {
|
|
94
|
-
try {
|
|
95
|
-
const parsed = JSON.parse(raw);
|
|
96
|
-
if (!parsed || typeof parsed !== "object" || typeof parsed.id !== "string") {
|
|
97
|
-
throw new Error("invalid run record payload");
|
|
98
|
-
}
|
|
99
|
-
return parsed;
|
|
100
|
-
} catch (error) {
|
|
101
|
-
throw new PmCliError(`Failed to parse background test run record at ${recordPath}: ${error instanceof Error ? error.message : String(error)}`, EXIT_CODE.GENERIC_FAILURE);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
async function writeBackgroundRunRecord(pmRoot, record) {
|
|
105
|
-
const next = {
|
|
106
|
-
...record,
|
|
107
|
-
updated_at: nowIso()
|
|
108
|
-
};
|
|
109
|
-
await writeFileAtomic(getTestRunRecordPath(pmRoot, record.id), `${JSON.stringify(next, null, 2)}
|
|
110
|
-
`);
|
|
111
|
-
}
|
|
112
|
-
async function readBackgroundTestRunRecord(pmRoot, runId) {
|
|
113
|
-
const recordPath = getTestRunRecordPath(pmRoot, runId);
|
|
114
|
-
const raw = await readFileIfExists(recordPath);
|
|
115
|
-
if (!raw) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
return parseBackgroundRunRecord(raw, recordPath);
|
|
119
|
-
}
|
|
120
|
-
async function listBackgroundRunRecordPaths(pmRoot) {
|
|
121
|
-
const recordsRoot = getTestRunsRecordsPath(pmRoot);
|
|
122
|
-
if (!await pathExists(recordsRoot)) {
|
|
123
|
-
return [];
|
|
124
|
-
}
|
|
125
|
-
const entries = await fs.readdir(recordsRoot, { withFileTypes: true });
|
|
126
|
-
return entries.filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => path.join(recordsRoot, entry.name)).sort((left, right) => right.localeCompare(left));
|
|
127
|
-
}
|
|
128
|
-
function parseLinuxRssStatus(raw) {
|
|
129
|
-
const match = raw.match(/^VmRSS:\s+(\d+)\s+kB$/m);
|
|
130
|
-
if (!match) {
|
|
131
|
-
return void 0;
|
|
132
|
-
}
|
|
133
|
-
return Number.parseInt(match[1], 10) * 1024;
|
|
134
|
-
}
|
|
135
|
-
async function readLinuxRssBytes(pid) {
|
|
136
|
-
if (process.platform !== "linux") {
|
|
137
|
-
return void 0;
|
|
138
|
-
}
|
|
139
|
-
try {
|
|
140
|
-
const raw = await fs.readFile(`/proc/${pid}/status`, "utf8");
|
|
141
|
-
return parseLinuxRssStatus(raw);
|
|
142
|
-
} catch {
|
|
143
|
-
return void 0;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
function parseLinuxCpuStat(raw) {
|
|
147
|
-
const closeParenIndex = raw.lastIndexOf(")");
|
|
148
|
-
if (closeParenIndex < 0) {
|
|
149
|
-
return {};
|
|
150
|
-
}
|
|
151
|
-
const remainder = raw.slice(closeParenIndex + 2).trim();
|
|
152
|
-
const parts = remainder.split(/\s+/);
|
|
153
|
-
const utimeTicks = Number.parseInt(parts[11], 10);
|
|
154
|
-
const stimeTicks = Number.parseInt(parts[12], 10);
|
|
155
|
-
if (!Number.isFinite(utimeTicks) || !Number.isFinite(stimeTicks)) {
|
|
156
|
-
return {};
|
|
157
|
-
}
|
|
158
|
-
return {
|
|
159
|
-
cpu_user_seconds: utimeTicks / PROC_STAT_TICKS_PER_SECOND,
|
|
160
|
-
cpu_system_seconds: stimeTicks / PROC_STAT_TICKS_PER_SECOND
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
async function readLinuxCpuSeconds(pid) {
|
|
164
|
-
if (process.platform !== "linux") {
|
|
165
|
-
return {};
|
|
166
|
-
}
|
|
167
|
-
try {
|
|
168
|
-
const raw = await fs.readFile(`/proc/${pid}/stat`, "utf8");
|
|
169
|
-
return parseLinuxCpuStat(raw);
|
|
170
|
-
} catch {
|
|
171
|
-
return {};
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
async function buildResourceSnapshot(record) {
|
|
175
|
-
const pid = record.child_pid ?? record.worker_pid;
|
|
176
|
-
if (!isPidRunning(pid)) {
|
|
177
|
-
return void 0;
|
|
178
|
-
}
|
|
179
|
-
const rssBytes = await readLinuxRssBytes(pid);
|
|
180
|
-
const cpu = await readLinuxCpuSeconds(pid);
|
|
181
|
-
const startedAtMs = record.started_at ? Date.parse(record.started_at) : Number.NaN;
|
|
182
|
-
const uptimeSeconds = Number.isFinite(startedAtMs) ? Math.max(0, (nowMs() - startedAtMs) / 1e3) : void 0;
|
|
183
|
-
return {
|
|
184
|
-
recorded_at: nowIso(),
|
|
185
|
-
rss_bytes: rssBytes,
|
|
186
|
-
cpu_user_seconds: cpu.cpu_user_seconds,
|
|
187
|
-
cpu_system_seconds: cpu.cpu_system_seconds,
|
|
188
|
-
uptime_seconds: uptimeSeconds
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
function readCount(value) {
|
|
192
|
-
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
193
|
-
}
|
|
194
|
-
function evaluateWorkerResult(kind, payload) {
|
|
195
|
-
if (!payload || typeof payload !== "object") {
|
|
196
|
-
return {
|
|
197
|
-
summary: {
|
|
198
|
-
passed: 0,
|
|
199
|
-
failed: 1,
|
|
200
|
-
skipped: 0
|
|
201
|
-
},
|
|
202
|
-
parsedResult: null
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
const record = payload;
|
|
206
|
-
if (kind === "test-all") {
|
|
207
|
-
const totals = record.totals ?? {};
|
|
208
|
-
return {
|
|
209
|
-
summary: {
|
|
210
|
-
items: typeof totals.items === "number" ? totals.items : void 0,
|
|
211
|
-
linked_tests: typeof totals.linked_tests === "number" ? totals.linked_tests : void 0,
|
|
212
|
-
passed: readCount(totals.passed),
|
|
213
|
-
failed: readCount(totals.failed),
|
|
214
|
-
skipped: readCount(totals.skipped),
|
|
215
|
-
fail_on_skipped_triggered: record.fail_on_skipped_triggered === true ? true : void 0
|
|
216
|
-
},
|
|
217
|
-
parsedResult: payload
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
const runResults = Array.isArray(record.run_results) ? record.run_results : [];
|
|
221
|
-
let passed = 0;
|
|
222
|
-
let failed = 0;
|
|
223
|
-
let skipped = 0;
|
|
224
|
-
for (const entry of runResults) {
|
|
225
|
-
if (!entry || typeof entry !== "object") {
|
|
226
|
-
continue;
|
|
227
|
-
}
|
|
228
|
-
const status = entry.status;
|
|
229
|
-
if (status === "passed") {
|
|
230
|
-
passed += 1;
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
if (status === "failed") {
|
|
234
|
-
failed += 1;
|
|
235
|
-
continue;
|
|
236
|
-
}
|
|
237
|
-
skipped += 1;
|
|
238
|
-
}
|
|
239
|
-
return {
|
|
240
|
-
summary: {
|
|
241
|
-
passed,
|
|
242
|
-
failed,
|
|
243
|
-
skipped,
|
|
244
|
-
fail_on_skipped_triggered: record.fail_on_skipped_triggered === true ? true : void 0
|
|
245
|
-
},
|
|
246
|
-
parsedResult: payload
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
function parseProgressLine(stderrLine) {
|
|
250
|
-
const line = stderrLine.trim();
|
|
251
|
-
if (line.length === 0) {
|
|
252
|
-
return null;
|
|
253
|
-
}
|
|
254
|
-
const testAllMatch = line.match(/\[pm test-all\]\s+item\s+(\d+)\/(\d+)\s+(start|end)\s+id=([^\s]+)/i);
|
|
255
|
-
if (testAllMatch) {
|
|
256
|
-
const itemIndex = Number.parseInt(testAllMatch[1], 10);
|
|
257
|
-
const itemTotal = Number.parseInt(testAllMatch[2], 10);
|
|
258
|
-
return {
|
|
259
|
-
item_index: itemIndex,
|
|
260
|
-
item_total: itemTotal,
|
|
261
|
-
item_id: testAllMatch[4],
|
|
262
|
-
linked_test_index: void 0,
|
|
263
|
-
linked_test_total: void 0,
|
|
264
|
-
current_command: void 0,
|
|
265
|
-
elapsed_ms: void 0,
|
|
266
|
-
heartbeat_at: nowIso(),
|
|
267
|
-
phase: testAllMatch[3]?.toLowerCase() === "end" ? "finished" : "running"
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
const linkedTestMatch = line.match(/\[pm test\]\s+linked-test\s+(\d+)\/(\d+)\s+(start|running|end)(?:.*elapsed_ms=(\d+))?/i);
|
|
271
|
-
if (!linkedTestMatch) {
|
|
272
|
-
return null;
|
|
273
|
-
}
|
|
274
|
-
const index = Number.parseInt(linkedTestMatch[1], 10);
|
|
275
|
-
const total = Number.parseInt(linkedTestMatch[2], 10);
|
|
276
|
-
const elapsed = linkedTestMatch[4] ? Number.parseInt(linkedTestMatch[4], 10) : void 0;
|
|
277
|
-
const commandMatch = line.match(/\scommand="((?:\\.|[^"\\])*)"/);
|
|
278
|
-
const currentCommand = commandMatch ? commandMatch[1].replaceAll('\\"', '"').replaceAll("\\\\", "\\") : void 0;
|
|
279
|
-
return {
|
|
280
|
-
linked_test_index: index,
|
|
281
|
-
linked_test_total: total,
|
|
282
|
-
current_command: currentCommand,
|
|
283
|
-
elapsed_ms: Number.isFinite(elapsed) ? elapsed : void 0,
|
|
284
|
-
heartbeat_at: nowIso(),
|
|
285
|
-
phase: linkedTestMatch[3]?.toLowerCase() === "end" ? "finished" : "running"
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
function splitLines(value) {
|
|
289
|
-
return value.split(/\r?\n/).map((entry) => entry.trimEnd()).filter((entry) => entry.length > 0);
|
|
290
|
-
}
|
|
291
|
-
function tailLines(value, limit) {
|
|
292
|
-
if (limit <= 0) {
|
|
293
|
-
return [];
|
|
294
|
-
}
|
|
295
|
-
const lines = splitLines(value);
|
|
296
|
-
if (lines.length <= limit) {
|
|
297
|
-
return lines;
|
|
298
|
-
}
|
|
299
|
-
return lines.slice(lines.length - limit);
|
|
300
|
-
}
|
|
301
|
-
async function resolveBackgroundCliEntry(cwd) {
|
|
302
|
-
const configured = process.env.PM_BACKGROUND_CLI_ENTRY?.trim();
|
|
303
|
-
if (configured && configured.length > 0) {
|
|
304
|
-
const resolvedConfigured = path.resolve(cwd, configured);
|
|
305
|
-
if (await pathExists(resolvedConfigured)) {
|
|
306
|
-
return resolvedConfigured;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
const distEntry = path.resolve(cwd, "dist", "cli.js");
|
|
310
|
-
if (await pathExists(distEntry)) {
|
|
311
|
-
return distEntry;
|
|
312
|
-
}
|
|
313
|
-
const argvEntry = process.argv[1]?.trim();
|
|
314
|
-
if (argvEntry && argvEntry.length > 0) {
|
|
315
|
-
const resolvedArgvEntry = path.resolve(cwd, argvEntry);
|
|
316
|
-
if (await pathExists(resolvedArgvEntry)) {
|
|
317
|
-
return resolvedArgvEntry;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
throw new PmCliError("Unable to resolve a CLI entrypoint for background test runs. Build the project or set PM_BACKGROUND_CLI_ENTRY.", EXIT_CODE.GENERIC_FAILURE);
|
|
321
|
-
}
|
|
322
|
-
async function refreshRunIfStale(pmRoot, record) {
|
|
323
|
-
if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(record.status)) {
|
|
324
|
-
return record;
|
|
325
|
-
}
|
|
326
|
-
const workerAlive = isPidRunning(record.worker_pid);
|
|
327
|
-
if (workerAlive) {
|
|
328
|
-
return record;
|
|
329
|
-
}
|
|
330
|
-
if (record.finished_at) {
|
|
331
|
-
return record;
|
|
332
|
-
}
|
|
333
|
-
const next = {
|
|
334
|
-
...record,
|
|
335
|
-
status: "failed",
|
|
336
|
-
finished_at: nowIso(),
|
|
337
|
-
error: record.error ?? "Background test run worker exited before writing terminal status."
|
|
338
|
-
};
|
|
339
|
-
await writeBackgroundRunRecord(pmRoot, next);
|
|
340
|
-
return next;
|
|
341
|
-
}
|
|
342
|
-
async function startBackgroundTestRun(options) {
|
|
343
|
-
await ensureBackgroundRunStorage(options.pmRoot);
|
|
344
|
-
const normalizedArgs = normalizeCommandArgs(options.commandArgs);
|
|
345
|
-
if (normalizedArgs.length === 0) {
|
|
346
|
-
throw new PmCliError("Background test run requires command arguments.", EXIT_CODE.USAGE);
|
|
347
|
-
}
|
|
348
|
-
const fingerprint = buildBackgroundTestRunFingerprint(options.kind, normalizedArgs, options.pmRoot);
|
|
349
|
-
const existingRuns = await listBackgroundTestRuns(options.pmRoot, {});
|
|
350
|
-
for (const existing of existingRuns) {
|
|
351
|
-
const refreshed = await refreshRunIfStale(options.pmRoot, existing);
|
|
352
|
-
if (refreshed.fingerprint !== fingerprint) {
|
|
353
|
-
continue;
|
|
354
|
-
}
|
|
355
|
-
if (!BACKGROUND_RUN_ACTIVE_STATUSES.has(refreshed.status) || !isPidRunning(refreshed.worker_pid)) {
|
|
356
|
-
continue;
|
|
357
|
-
}
|
|
358
|
-
return {
|
|
359
|
-
started: false,
|
|
360
|
-
run: {
|
|
361
|
-
...refreshed,
|
|
362
|
-
duplicate_of: refreshed.id
|
|
363
|
-
},
|
|
364
|
-
duplicate_of: refreshed.id
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
const runId = buildRunId();
|
|
368
|
-
const createdAt = nowIso();
|
|
369
|
-
const stdoutPath = getTestRunStdoutPath(options.pmRoot, runId);
|
|
370
|
-
const stderrPath = getTestRunStderrPath(options.pmRoot, runId);
|
|
371
|
-
const resultPath = getTestRunResultPath(options.pmRoot, runId);
|
|
372
|
-
await fs.writeFile(stdoutPath, "", "utf8");
|
|
373
|
-
await fs.writeFile(stderrPath, "", "utf8");
|
|
374
|
-
const record = {
|
|
375
|
-
id: runId,
|
|
376
|
-
kind: options.kind,
|
|
377
|
-
status: "queued",
|
|
378
|
-
created_at: createdAt,
|
|
379
|
-
updated_at: createdAt,
|
|
380
|
-
requested_by: options.requestedBy,
|
|
381
|
-
fingerprint,
|
|
382
|
-
command_args: normalizedArgs,
|
|
383
|
-
command_label: summarizeCommandLabel(normalizedArgs),
|
|
384
|
-
pm_root: options.pmRoot,
|
|
385
|
-
global_pm_root: options.globalPmRoot,
|
|
386
|
-
target_id: options.targetId,
|
|
387
|
-
status_filter: options.statusFilter,
|
|
388
|
-
attempt: typeof options.attempt === "number" && Number.isFinite(options.attempt) && options.attempt >= 1 ? Math.floor(options.attempt) : 1,
|
|
389
|
-
resumed_from: options.resumedFrom,
|
|
390
|
-
resumed_by: options.resumedBy,
|
|
391
|
-
stdout_path: stdoutPath,
|
|
392
|
-
stderr_path: stderrPath,
|
|
393
|
-
result_path: resultPath,
|
|
394
|
-
progress: {
|
|
395
|
-
phase: "queued",
|
|
396
|
-
message: "Queued for background execution.",
|
|
397
|
-
heartbeat_at: createdAt
|
|
398
|
-
}
|
|
399
|
-
};
|
|
400
|
-
await writeBackgroundRunRecord(options.pmRoot, record);
|
|
401
|
-
return {
|
|
402
|
-
started: true,
|
|
403
|
-
run: record
|
|
404
|
-
};
|
|
405
|
-
}
|
|
406
|
-
async function spawnBackgroundTestRunWorker(options) {
|
|
407
|
-
const record = await readBackgroundTestRunRecord(options.pmRoot, options.runId);
|
|
408
|
-
if (!record) {
|
|
409
|
-
throw new PmCliError(`Background test run ${options.runId} not found`, EXIT_CODE.NOT_FOUND);
|
|
410
|
-
}
|
|
411
|
-
if (BACKGROUND_RUN_TERMINAL_STATUSES.has(record.status)) {
|
|
412
|
-
throw new PmCliError(`Background test run ${record.id} is already terminal (${record.status}).`, EXIT_CODE.CONFLICT);
|
|
413
|
-
}
|
|
414
|
-
const cliEntry = await resolveBackgroundCliEntry(process.cwd());
|
|
415
|
-
const args = [];
|
|
416
|
-
if (options.noExtensions === true) {
|
|
417
|
-
args.push("--no-extensions");
|
|
418
|
-
}
|
|
419
|
-
args.push("--path", record.pm_root, "test-runs-worker", record.id);
|
|
420
|
-
const env = {
|
|
421
|
-
...process.env,
|
|
422
|
-
PM_PATH: record.pm_root,
|
|
423
|
-
PM_GLOBAL_PATH: record.global_pm_root,
|
|
424
|
-
PM_BACKGROUND_TEST_RUN_ID: record.id,
|
|
425
|
-
PM_BACKGROUND_TEST_RUN_ATTEMPT: String(record.attempt),
|
|
426
|
-
PM_BACKGROUND_TEST_RUN_RESUMED_FROM: record.resumed_from ?? "",
|
|
427
|
-
FORCE_COLOR: "0"
|
|
428
|
-
};
|
|
429
|
-
const child = spawn(process.execPath, [cliEntry, ...args], {
|
|
430
|
-
cwd: process.cwd(),
|
|
431
|
-
env,
|
|
432
|
-
detached: true,
|
|
433
|
-
stdio: "ignore",
|
|
434
|
-
windowsHide: true
|
|
435
|
-
});
|
|
436
|
-
child.unref();
|
|
437
|
-
const next = {
|
|
438
|
-
...record,
|
|
439
|
-
status: "queued",
|
|
440
|
-
worker_pid: child.pid,
|
|
441
|
-
progress: {
|
|
442
|
-
phase: "queued",
|
|
443
|
-
message: "Worker process started.",
|
|
444
|
-
heartbeat_at: nowIso()
|
|
445
|
-
}
|
|
446
|
-
};
|
|
447
|
-
await writeBackgroundRunRecord(options.pmRoot, next);
|
|
448
|
-
return next;
|
|
449
|
-
}
|
|
450
|
-
async function appendFileOrdered(queue, filePath, text) {
|
|
451
|
-
await queue;
|
|
452
|
-
await fs.appendFile(filePath, text, "utf8");
|
|
453
|
-
}
|
|
454
|
-
function resolvePositiveEnvInteger(name, fallback) {
|
|
455
|
-
const parsed = Number.parseInt(process.env[name] ?? "", 10);
|
|
456
|
-
return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
|
|
457
|
-
}
|
|
458
|
-
function buildBackgroundWorkerEnv(record) {
|
|
459
|
-
return {
|
|
460
|
-
...process.env,
|
|
461
|
-
PM_PATH: record.pm_root,
|
|
462
|
-
PM_GLOBAL_PATH: record.global_pm_root,
|
|
463
|
-
FORCE_COLOR: "0"
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
function buildBackgroundWorkerChildArgs(record, noExtensions) {
|
|
467
|
-
return noExtensions ? ["--no-extensions", ...record.command_args] : [...record.command_args];
|
|
468
|
-
}
|
|
469
|
-
function createBackgroundRunRecordWriteScheduler(pmRoot, record) {
|
|
470
|
-
let writeQueue = Promise.resolve();
|
|
471
|
-
return {
|
|
472
|
-
schedule() {
|
|
473
|
-
writeQueue = writeQueue.then(async () => {
|
|
474
|
-
try {
|
|
475
|
-
await writeBackgroundRunRecord(pmRoot, record);
|
|
476
|
-
} catch {
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
},
|
|
480
|
-
async flush() {
|
|
481
|
-
await writeQueue;
|
|
482
|
-
}
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
function requestChildSignal(child, signal) {
|
|
486
|
-
try {
|
|
487
|
-
child.kill(signal);
|
|
488
|
-
} catch {
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
async function requestBackgroundWorkerStop(record, child, state, scheduleRecordWrite) {
|
|
492
|
-
if (state.stopRequested) {
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
state.stopRequested = true;
|
|
496
|
-
record.stop_requested_at = nowIso();
|
|
497
|
-
record.progress = {
|
|
498
|
-
...record.progress,
|
|
499
|
-
phase: "stopping",
|
|
500
|
-
message: "Stop requested for background run.",
|
|
501
|
-
heartbeat_at: nowIso()
|
|
502
|
-
};
|
|
503
|
-
scheduleRecordWrite();
|
|
504
|
-
requestChildSignal(child, "SIGTERM");
|
|
505
|
-
const forceTimer = setTimeout(() => requestChildSignal(child, "SIGKILL"), resolvePositiveEnvInteger("PM_BACKGROUND_RUN_FORCE_KILL_DELAY_MS", DEFAULT_BACKGROUND_RUN_FORCE_KILL_DELAY_MS));
|
|
506
|
-
forceTimer.unref?.();
|
|
507
|
-
}
|
|
508
|
-
function buildItemBackgroundProgress(line, progressPatch, phase) {
|
|
509
|
-
return {
|
|
510
|
-
phase,
|
|
511
|
-
message: line,
|
|
512
|
-
heartbeat_at: nowIso(),
|
|
513
|
-
item_index: progressPatch.item_index,
|
|
514
|
-
item_total: progressPatch.item_total,
|
|
515
|
-
item_id: progressPatch.item_id,
|
|
516
|
-
linked_test_index: void 0,
|
|
517
|
-
linked_test_total: void 0,
|
|
518
|
-
current_command: void 0,
|
|
519
|
-
elapsed_ms: void 0
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
function buildLinkedTestBackgroundProgress(line, record, progressPatch, phase) {
|
|
523
|
-
return {
|
|
524
|
-
phase,
|
|
525
|
-
message: line,
|
|
526
|
-
heartbeat_at: nowIso(),
|
|
527
|
-
item_index: progressPatch.item_index ?? record.progress?.item_index,
|
|
528
|
-
item_total: progressPatch.item_total ?? record.progress?.item_total,
|
|
529
|
-
item_id: progressPatch.item_id ?? record.progress?.item_id,
|
|
530
|
-
linked_test_index: progressPatch.linked_test_index,
|
|
531
|
-
linked_test_total: progressPatch.linked_test_total,
|
|
532
|
-
current_command: progressPatch.current_command,
|
|
533
|
-
elapsed_ms: progressPatch.elapsed_ms
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
function applyBackgroundWorkerProgressLine(record, line, stopRequested) {
|
|
537
|
-
const progressPatch = parseProgressLine(line);
|
|
538
|
-
if (!progressPatch) {
|
|
539
|
-
return false;
|
|
540
|
-
}
|
|
541
|
-
const phase = record.progress?.phase === "stopping" ? "stopping" : "running";
|
|
542
|
-
record.progress = progressPatch.item_id ? buildItemBackgroundProgress(line, progressPatch, phase) : buildLinkedTestBackgroundProgress(line, record, progressPatch, phase);
|
|
543
|
-
if (progressPatch.phase === "finished" && !stopRequested) {
|
|
544
|
-
record.progress.phase = "running";
|
|
545
|
-
}
|
|
546
|
-
return true;
|
|
547
|
-
}
|
|
548
|
-
function parseBackgroundWorkerStdout(stdoutBuffer) {
|
|
549
|
-
if (stdoutBuffer.trim().length === 0) {
|
|
550
|
-
return null;
|
|
551
|
-
}
|
|
552
|
-
try {
|
|
553
|
-
return JSON.parse(stdoutBuffer);
|
|
554
|
-
} catch {
|
|
555
|
-
return null;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
function resolveBackgroundWorkerFinalStatus(record, stopRequested) {
|
|
559
|
-
if (stopRequested) {
|
|
560
|
-
return "stopped";
|
|
561
|
-
}
|
|
562
|
-
const passed = record.exit_code === 0 && (record.summary?.failed ?? 0) === 0 && record.summary?.fail_on_skipped_triggered !== true;
|
|
563
|
-
return passed ? "passed" : "failed";
|
|
564
|
-
}
|
|
565
|
-
function buildFinishedBackgroundProgress(record, stopRequested) {
|
|
566
|
-
return {
|
|
567
|
-
phase: "finished",
|
|
568
|
-
message: stopRequested ? "Background run stopped." : `Background run finished with status=${record.status}.`,
|
|
569
|
-
heartbeat_at: nowIso(),
|
|
570
|
-
item_index: record.progress?.item_index,
|
|
571
|
-
item_total: record.progress?.item_total,
|
|
572
|
-
item_id: record.progress?.item_id,
|
|
573
|
-
linked_test_index: record.progress?.linked_test_index,
|
|
574
|
-
linked_test_total: record.progress?.linked_test_total,
|
|
575
|
-
current_command: record.progress?.current_command,
|
|
576
|
-
elapsed_ms: record.progress?.elapsed_ms
|
|
577
|
-
};
|
|
578
|
-
}
|
|
579
|
-
async function writeBackgroundWorkerResult(record, parsedResult, stdoutBuffer) {
|
|
580
|
-
if (parsedResult !== null) {
|
|
581
|
-
await writeFileAtomic(record.result_path, `${JSON.stringify(parsedResult, null, 2)}
|
|
582
|
-
`);
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
await writeFileAtomic(record.result_path, `${JSON.stringify({
|
|
586
|
-
parse_error: "Background run output was not valid JSON.",
|
|
587
|
-
stdout_excerpt: tailLines(stdoutBuffer, DEFAULT_BACKGROUND_RUN_LOG_TAIL_LINES)
|
|
588
|
-
}, null, 2)}
|
|
589
|
-
`);
|
|
590
|
-
}
|
|
591
|
-
async function runBackgroundTestRunWorker(pmRoot, runId, noExtensions = false) {
|
|
592
|
-
const loaded = await readBackgroundTestRunRecord(pmRoot, runId);
|
|
593
|
-
if (!loaded) {
|
|
594
|
-
throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);
|
|
595
|
-
}
|
|
596
|
-
const record = {
|
|
597
|
-
...loaded,
|
|
598
|
-
status: "running",
|
|
599
|
-
started_at: loaded.started_at ?? nowIso(),
|
|
600
|
-
worker_pid: process.pid,
|
|
601
|
-
progress: {
|
|
602
|
-
phase: "running",
|
|
603
|
-
message: "Worker started.",
|
|
604
|
-
heartbeat_at: nowIso()
|
|
605
|
-
}
|
|
606
|
-
};
|
|
607
|
-
const cliEntry = await resolveBackgroundCliEntry(process.cwd());
|
|
608
|
-
const env = buildBackgroundWorkerEnv(record);
|
|
609
|
-
await writeBackgroundRunRecord(pmRoot, record);
|
|
610
|
-
const childArgs = buildBackgroundWorkerChildArgs(record, noExtensions);
|
|
611
|
-
const child = spawn(process.execPath, [cliEntry, ...childArgs], {
|
|
612
|
-
cwd: process.cwd(),
|
|
613
|
-
env,
|
|
614
|
-
detached: false,
|
|
615
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
616
|
-
windowsHide: true
|
|
617
|
-
});
|
|
618
|
-
record.child_pid = child.pid;
|
|
619
|
-
const recordWriteScheduler = createBackgroundRunRecordWriteScheduler(pmRoot, record);
|
|
620
|
-
const scheduleRecordWrite = recordWriteScheduler.schedule;
|
|
621
|
-
let stdoutWriteQueue = Promise.resolve();
|
|
622
|
-
let stderrWriteQueue = Promise.resolve();
|
|
623
|
-
let stdoutBuffer = "";
|
|
624
|
-
let stderrBuffer = "";
|
|
625
|
-
const stopState = { stopRequested: false };
|
|
626
|
-
const onSignal = () => {
|
|
627
|
-
void requestBackgroundWorkerStop(record, child, stopState, scheduleRecordWrite);
|
|
628
|
-
};
|
|
629
|
-
process.on("SIGTERM", onSignal);
|
|
630
|
-
process.on("SIGINT", onSignal);
|
|
631
|
-
const resourceTimer = setInterval(() => {
|
|
632
|
-
void (async () => {
|
|
633
|
-
record.resource = await buildResourceSnapshot(record);
|
|
634
|
-
record.progress.heartbeat_at = nowIso();
|
|
635
|
-
scheduleRecordWrite();
|
|
636
|
-
})();
|
|
637
|
-
}, resolvePositiveEnvInteger("PM_BACKGROUND_RUN_RESOURCE_INTERVAL_MS", DEFAULT_BACKGROUND_RUN_RESOURCE_SNAPSHOT_INTERVAL_MS));
|
|
638
|
-
resourceTimer.unref?.();
|
|
639
|
-
child.stdout?.on("data", (chunk) => {
|
|
640
|
-
const text = chunk.toString("utf8");
|
|
641
|
-
stdoutBuffer += text;
|
|
642
|
-
stdoutWriteQueue = appendFileOrdered(stdoutWriteQueue, record.stdout_path, text);
|
|
643
|
-
});
|
|
644
|
-
child.stderr?.on("data", (chunk) => {
|
|
645
|
-
const text = chunk.toString("utf8");
|
|
646
|
-
stderrWriteQueue = appendFileOrdered(stderrWriteQueue, record.stderr_path, text);
|
|
647
|
-
stderrBuffer += text;
|
|
648
|
-
const parts = stderrBuffer.split(/\r?\n/);
|
|
649
|
-
stderrBuffer = parts.pop();
|
|
650
|
-
let progressChanged = false;
|
|
651
|
-
for (const part of parts) {
|
|
652
|
-
const line = part.trimEnd();
|
|
653
|
-
if (line.length > 0 && applyBackgroundWorkerProgressLine(record, line, stopState.stopRequested)) {
|
|
654
|
-
progressChanged = true;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
if (progressChanged) {
|
|
658
|
-
scheduleRecordWrite();
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
let exitCode = null;
|
|
662
|
-
let signal = null;
|
|
663
|
-
try {
|
|
664
|
-
({ code: exitCode, signal } = await new Promise((resolve) => {
|
|
665
|
-
child.on("close", (code, closeSignal) => {
|
|
666
|
-
resolve({ code, signal: closeSignal });
|
|
667
|
-
});
|
|
668
|
-
}));
|
|
669
|
-
} finally {
|
|
670
|
-
clearInterval(resourceTimer);
|
|
671
|
-
process.off("SIGTERM", onSignal);
|
|
672
|
-
process.off("SIGINT", onSignal);
|
|
673
|
-
}
|
|
674
|
-
await stdoutWriteQueue;
|
|
675
|
-
await stderrWriteQueue;
|
|
676
|
-
const trailingStderrLine = stderrBuffer.trimEnd();
|
|
677
|
-
if (trailingStderrLine.length > 0 && applyBackgroundWorkerProgressLine(record, trailingStderrLine, stopState.stopRequested)) {
|
|
678
|
-
scheduleRecordWrite();
|
|
679
|
-
}
|
|
680
|
-
stderrBuffer = "";
|
|
681
|
-
const parsedResult = parseBackgroundWorkerStdout(stdoutBuffer);
|
|
682
|
-
const evaluated = evaluateWorkerResult(record.kind, parsedResult);
|
|
683
|
-
record.summary = evaluated.summary;
|
|
684
|
-
record.exit_code = typeof exitCode === "number" ? exitCode : void 0;
|
|
685
|
-
record.signal = signal ?? void 0;
|
|
686
|
-
record.finished_at = nowIso();
|
|
687
|
-
record.status = resolveBackgroundWorkerFinalStatus(record, stopState.stopRequested);
|
|
688
|
-
record.progress = buildFinishedBackgroundProgress(record, stopState.stopRequested);
|
|
689
|
-
record.resource = await buildResourceSnapshot(record);
|
|
690
|
-
await writeBackgroundWorkerResult(record, parsedResult, stdoutBuffer);
|
|
691
|
-
await writeBackgroundRunRecord(pmRoot, record);
|
|
692
|
-
await recordWriteScheduler.flush();
|
|
693
|
-
return record;
|
|
694
|
-
}
|
|
695
|
-
async function listBackgroundTestRuns(pmRoot, options) {
|
|
696
|
-
const recordPaths = await listBackgroundRunRecordPaths(pmRoot);
|
|
697
|
-
const runs = [];
|
|
698
|
-
for (const recordPath of recordPaths) {
|
|
699
|
-
const raw = await readFileIfExists(recordPath);
|
|
700
|
-
if (!raw) {
|
|
701
|
-
continue;
|
|
702
|
-
}
|
|
703
|
-
const parsed = await parseBackgroundRunRecord(raw, recordPath);
|
|
704
|
-
runs.push(parsed);
|
|
705
|
-
}
|
|
706
|
-
const refreshed = [];
|
|
707
|
-
for (const run of runs) {
|
|
708
|
-
refreshed.push(await refreshRunIfStale(pmRoot, run));
|
|
709
|
-
}
|
|
710
|
-
const filtered = options.status ? refreshed.filter((entry) => entry.status === options.status) : refreshed;
|
|
711
|
-
const sorted = filtered.sort((left, right) => {
|
|
712
|
-
const byUpdated = Date.parse(right.updated_at) - Date.parse(left.updated_at);
|
|
713
|
-
if (Number.isFinite(byUpdated) && byUpdated !== 0) {
|
|
714
|
-
return byUpdated;
|
|
715
|
-
}
|
|
716
|
-
return right.id.localeCompare(left.id);
|
|
717
|
-
});
|
|
718
|
-
const limit = typeof options.limit === "number" && options.limit >= 0 ? options.limit : void 0;
|
|
719
|
-
return limit === void 0 ? sorted : sorted.slice(0, limit);
|
|
720
|
-
}
|
|
721
|
-
async function getBackgroundTestRunStatus(pmRoot, runId) {
|
|
722
|
-
const loaded = await readBackgroundTestRunRecord(pmRoot, runId);
|
|
723
|
-
if (!loaded) {
|
|
724
|
-
throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);
|
|
725
|
-
}
|
|
726
|
-
const refreshed = await refreshRunIfStale(pmRoot, loaded);
|
|
727
|
-
const workerAlive = isPidRunning(refreshed.worker_pid);
|
|
728
|
-
const childAlive = isPidRunning(refreshed.child_pid);
|
|
729
|
-
if (refreshed.status === "running" && !childAlive && !refreshed.finished_at && !workerAlive) {
|
|
730
|
-
refreshed.status = "failed";
|
|
731
|
-
refreshed.finished_at = nowIso();
|
|
732
|
-
refreshed.error = refreshed.error ?? "Background run process exited unexpectedly.";
|
|
733
|
-
await writeBackgroundRunRecord(pmRoot, refreshed);
|
|
734
|
-
}
|
|
735
|
-
if (refreshed.status === "running") {
|
|
736
|
-
refreshed.resource = await buildResourceSnapshot(refreshed);
|
|
737
|
-
await writeBackgroundRunRecord(pmRoot, refreshed);
|
|
738
|
-
}
|
|
739
|
-
const heartbeatAt = refreshed.progress?.heartbeat_at;
|
|
740
|
-
const heartbeatAtMs = heartbeatAt ? Date.parse(heartbeatAt) : Number.NaN;
|
|
741
|
-
const lagMs = Number.isFinite(heartbeatAtMs) ? Math.max(0, nowMs() - heartbeatAtMs) : void 0;
|
|
742
|
-
const staleMs = Number.parseInt(process.env.PM_BACKGROUND_RUN_HEARTBEAT_STALE_MS ?? "", 10);
|
|
743
|
-
const staleThresholdMs = Number.isFinite(staleMs) && staleMs > 0 ? staleMs : DEFAULT_BACKGROUND_RUN_HEARTBEAT_STALE_MS;
|
|
744
|
-
const healthState = refreshed.status === "running" ? lagMs !== void 0 && lagMs > staleThresholdMs ? "stale" : "healthy" : "inactive";
|
|
745
|
-
return {
|
|
746
|
-
run: refreshed,
|
|
747
|
-
health: {
|
|
748
|
-
state: healthState,
|
|
749
|
-
last_heartbeat_at: heartbeatAt,
|
|
750
|
-
heartbeat_lag_ms: lagMs,
|
|
751
|
-
worker_alive: workerAlive,
|
|
752
|
-
child_alive: childAlive
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
}
|
|
756
|
-
function sendBackgroundRunStopSignal(record, force) {
|
|
757
|
-
const signal = force ? "SIGKILL" : "SIGTERM";
|
|
758
|
-
if (!isPidRunning(record.worker_pid) || !record.worker_pid) {
|
|
759
|
-
return "none";
|
|
760
|
-
}
|
|
761
|
-
try {
|
|
762
|
-
process.kill(record.worker_pid, signal);
|
|
763
|
-
return signal;
|
|
764
|
-
} catch {
|
|
765
|
-
return "none";
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
function buildStoppingBackgroundProgress(record, signalSent) {
|
|
769
|
-
return {
|
|
770
|
-
phase: "stopping",
|
|
771
|
-
message: signalSent === "none" ? "Run marked stopped." : `Stop requested via ${signalSent}.`,
|
|
772
|
-
heartbeat_at: nowIso(),
|
|
773
|
-
item_index: record.progress?.item_index,
|
|
774
|
-
item_total: record.progress?.item_total,
|
|
775
|
-
item_id: record.progress?.item_id,
|
|
776
|
-
linked_test_index: record.progress?.linked_test_index,
|
|
777
|
-
linked_test_total: record.progress?.linked_test_total,
|
|
778
|
-
current_command: record.progress?.current_command,
|
|
779
|
-
elapsed_ms: record.progress?.elapsed_ms
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
async function stopBackgroundTestRun(pmRoot, runId, force = false) {
|
|
783
|
-
const loaded = await readBackgroundTestRunRecord(pmRoot, runId);
|
|
784
|
-
if (!loaded) {
|
|
785
|
-
throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);
|
|
786
|
-
}
|
|
787
|
-
const refreshed = await refreshRunIfStale(pmRoot, loaded);
|
|
788
|
-
if (BACKGROUND_RUN_TERMINAL_STATUSES.has(refreshed.status)) {
|
|
789
|
-
return {
|
|
790
|
-
run: refreshed,
|
|
791
|
-
signal_sent: "none"
|
|
792
|
-
};
|
|
793
|
-
}
|
|
794
|
-
const signalSent = sendBackgroundRunStopSignal(refreshed, force);
|
|
795
|
-
if (signalSent === "none") {
|
|
796
|
-
refreshed.status = "stopped";
|
|
797
|
-
refreshed.finished_at = refreshed.finished_at ?? nowIso();
|
|
798
|
-
}
|
|
799
|
-
refreshed.stop_requested_at = nowIso();
|
|
800
|
-
refreshed.progress = buildStoppingBackgroundProgress(refreshed, signalSent);
|
|
801
|
-
await writeBackgroundRunRecord(pmRoot, refreshed);
|
|
802
|
-
return {
|
|
803
|
-
run: refreshed,
|
|
804
|
-
signal_sent: signalSent
|
|
805
|
-
};
|
|
806
|
-
}
|
|
807
|
-
async function resumeBackgroundTestRun(pmRoot, runId, requestedBy, noExtensions = false) {
|
|
808
|
-
const loaded = await readBackgroundTestRunRecord(pmRoot, runId);
|
|
809
|
-
if (!loaded) {
|
|
810
|
-
throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);
|
|
811
|
-
}
|
|
812
|
-
const refreshed = await refreshRunIfStale(pmRoot, loaded);
|
|
813
|
-
if (!BACKGROUND_RUN_TERMINAL_STATUSES.has(refreshed.status)) {
|
|
814
|
-
throw new PmCliError(`Background test run ${runId} is not terminal and cannot be resumed.`, EXIT_CODE.CONFLICT);
|
|
815
|
-
}
|
|
816
|
-
const started = await startBackgroundTestRun({
|
|
817
|
-
pmRoot: refreshed.pm_root,
|
|
818
|
-
globalPmRoot: refreshed.global_pm_root,
|
|
819
|
-
kind: refreshed.kind,
|
|
820
|
-
commandArgs: refreshed.command_args,
|
|
821
|
-
requestedBy,
|
|
822
|
-
targetId: refreshed.target_id,
|
|
823
|
-
statusFilter: refreshed.status_filter,
|
|
824
|
-
resumedFrom: refreshed.id,
|
|
825
|
-
resumedBy: requestedBy,
|
|
826
|
-
attempt: refreshed.attempt + 1
|
|
827
|
-
});
|
|
828
|
-
if (!started.started) {
|
|
829
|
-
return started.run;
|
|
830
|
-
}
|
|
831
|
-
const spawned = await spawnBackgroundTestRunWorker({
|
|
832
|
-
pmRoot,
|
|
833
|
-
runId: started.run.id,
|
|
834
|
-
noExtensions
|
|
835
|
-
});
|
|
836
|
-
const prior = {
|
|
837
|
-
...refreshed,
|
|
838
|
-
resumed_by: spawned.id
|
|
839
|
-
};
|
|
840
|
-
await writeBackgroundRunRecord(pmRoot, prior);
|
|
841
|
-
return spawned;
|
|
842
|
-
}
|
|
843
|
-
async function readBackgroundTestRunLogs(pmRoot, runId, stream, tail) {
|
|
844
|
-
const loaded = await readBackgroundTestRunRecord(pmRoot, runId);
|
|
845
|
-
if (!loaded) {
|
|
846
|
-
throw new PmCliError(`Background test run ${runId} not found`, EXIT_CODE.NOT_FOUND);
|
|
847
|
-
}
|
|
848
|
-
const resolvedTail = typeof tail === "number" && Number.isFinite(tail) && tail >= 0 ? Math.floor(tail) : DEFAULT_BACKGROUND_RUN_LOG_TAIL_LINES;
|
|
849
|
-
const stdoutRaw = stream === "stdout" || stream === "both" ? await readFileIfExists(loaded.stdout_path) ?? "" : "";
|
|
850
|
-
const stderrRaw = stream === "stderr" || stream === "both" ? await readFileIfExists(loaded.stderr_path) ?? "" : "";
|
|
851
|
-
return {
|
|
852
|
-
run: loaded,
|
|
853
|
-
stream,
|
|
854
|
-
tail: resolvedTail,
|
|
855
|
-
stdout: stream === "stdout" || stream === "both" ? tailLines(stdoutRaw, resolvedTail) : [],
|
|
856
|
-
stderr: stream === "stderr" || stream === "both" ? tailLines(stderrRaw, resolvedTail) : []
|
|
857
|
-
};
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
// dist/cli/commands/test-runs.js
|
|
861
|
-
var BACKGROUND_STATUS_VALUES = ["queued", "running", "passed", "failed", "stopped", "canceled"];
|
|
862
|
-
var BACKGROUND_STREAM_VALUES = ["stdout", "stderr", "both"];
|
|
863
|
-
function normalizeStatus(value) {
|
|
864
|
-
if (value === void 0) {
|
|
865
|
-
return void 0;
|
|
866
|
-
}
|
|
867
|
-
const normalized = value.trim().toLowerCase();
|
|
868
|
-
if (BACKGROUND_STATUS_VALUES.includes(normalized)) {
|
|
869
|
-
return normalized;
|
|
870
|
-
}
|
|
871
|
-
throw new PmCliError(`Invalid --status value "${value}"`, EXIT_CODE.USAGE);
|
|
872
|
-
}
|
|
873
|
-
function normalizeStream(value) {
|
|
874
|
-
if (value === void 0 || value.trim().length === 0) {
|
|
875
|
-
return "stderr";
|
|
876
|
-
}
|
|
877
|
-
const normalized = value.trim().toLowerCase();
|
|
878
|
-
if (BACKGROUND_STREAM_VALUES.includes(normalized)) {
|
|
879
|
-
return normalized;
|
|
880
|
-
}
|
|
881
|
-
throw new PmCliError(`Invalid --stream value "${value}"`, EXIT_CODE.USAGE);
|
|
882
|
-
}
|
|
883
|
-
function resolveWhoamiFallback() {
|
|
884
|
-
try {
|
|
885
|
-
const username = os.userInfo().username.trim();
|
|
886
|
-
if (username.length > 0) {
|
|
887
|
-
return username;
|
|
888
|
-
}
|
|
889
|
-
} catch {
|
|
890
|
-
}
|
|
891
|
-
return void 0;
|
|
892
|
-
}
|
|
893
|
-
function resolveRequestedBy(author, fallback) {
|
|
894
|
-
const candidates = [
|
|
895
|
-
author,
|
|
896
|
-
process.env.PM_AUTHOR,
|
|
897
|
-
fallback,
|
|
898
|
-
process.env.USER,
|
|
899
|
-
process.env.LOGNAME,
|
|
900
|
-
process.env.USERNAME,
|
|
901
|
-
resolveWhoamiFallback()
|
|
902
|
-
];
|
|
903
|
-
for (const candidate of candidates) {
|
|
904
|
-
if (typeof candidate !== "string") {
|
|
905
|
-
continue;
|
|
906
|
-
}
|
|
907
|
-
const trimmed = candidate.trim();
|
|
908
|
-
if (trimmed.length > 0) {
|
|
909
|
-
return trimmed;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
return "unknown";
|
|
913
|
-
}
|
|
914
|
-
async function ensureInitialized(pmRoot) {
|
|
915
|
-
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
916
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
async function runStartBackgroundRun(options, global) {
|
|
920
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
921
|
-
const globalPmRoot = resolveGlobalPmRoot(process.cwd());
|
|
922
|
-
await ensureInitialized(pmRoot);
|
|
923
|
-
const settings = await readSettings(pmRoot);
|
|
924
|
-
const requestedBy = resolveRequestedBy(options.author, settings.author_default);
|
|
925
|
-
const started = await startBackgroundTestRun({
|
|
926
|
-
pmRoot,
|
|
927
|
-
globalPmRoot,
|
|
928
|
-
kind: options.kind,
|
|
929
|
-
commandArgs: options.commandArgs,
|
|
930
|
-
requestedBy,
|
|
931
|
-
targetId: options.targetId,
|
|
932
|
-
statusFilter: options.statusFilter
|
|
933
|
-
});
|
|
934
|
-
if (!started.started) {
|
|
935
|
-
return {
|
|
936
|
-
started: false,
|
|
937
|
-
duplicate_of: started.duplicate_of,
|
|
938
|
-
run: started.run
|
|
939
|
-
};
|
|
940
|
-
}
|
|
941
|
-
const spawned = await spawnBackgroundTestRunWorker({
|
|
942
|
-
pmRoot,
|
|
943
|
-
runId: started.run.id,
|
|
944
|
-
noExtensions: options.noExtensions === true
|
|
945
|
-
});
|
|
946
|
-
return {
|
|
947
|
-
started: true,
|
|
948
|
-
run: spawned
|
|
949
|
-
};
|
|
950
|
-
}
|
|
951
|
-
async function runTestRunsList(options, global) {
|
|
952
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
953
|
-
await ensureInitialized(pmRoot);
|
|
954
|
-
const status = normalizeStatus(options.status);
|
|
955
|
-
const limit = parseLimit(options.limit, "limit");
|
|
956
|
-
const runs = await listBackgroundTestRuns(pmRoot, { status, limit });
|
|
957
|
-
return {
|
|
958
|
-
runs,
|
|
959
|
-
count: runs.length,
|
|
960
|
-
filters: {
|
|
961
|
-
status,
|
|
962
|
-
limit
|
|
963
|
-
}
|
|
964
|
-
};
|
|
965
|
-
}
|
|
966
|
-
async function runTestRunsStatus(runId, global) {
|
|
967
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
968
|
-
await ensureInitialized(pmRoot);
|
|
969
|
-
const status = await getBackgroundTestRunStatus(pmRoot, runId);
|
|
970
|
-
return {
|
|
971
|
-
run: status.run,
|
|
972
|
-
health: status.health
|
|
973
|
-
};
|
|
974
|
-
}
|
|
975
|
-
async function runTestRunsLogs(runId, options, global) {
|
|
976
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
977
|
-
await ensureInitialized(pmRoot);
|
|
978
|
-
const stream = normalizeStream(options.stream);
|
|
979
|
-
const tail = parseLimit(options.tail, "tail");
|
|
980
|
-
const logs = await readBackgroundTestRunLogs(pmRoot, runId, stream, tail);
|
|
981
|
-
return {
|
|
982
|
-
run: logs.run,
|
|
983
|
-
stream: logs.stream,
|
|
984
|
-
tail: logs.tail,
|
|
985
|
-
stdout: logs.stdout,
|
|
986
|
-
stderr: logs.stderr
|
|
987
|
-
};
|
|
988
|
-
}
|
|
989
|
-
async function runTestRunsStop(runId, options, global) {
|
|
990
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
991
|
-
await ensureInitialized(pmRoot);
|
|
992
|
-
const stopped = await stopBackgroundTestRun(pmRoot, runId, options.force === true);
|
|
993
|
-
return {
|
|
994
|
-
run: stopped.run,
|
|
995
|
-
signal_sent: stopped.signal_sent
|
|
996
|
-
};
|
|
997
|
-
}
|
|
998
|
-
async function runTestRunsResume(runId, options, global) {
|
|
999
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
1000
|
-
await ensureInitialized(pmRoot);
|
|
1001
|
-
const settings = await readSettings(pmRoot);
|
|
1002
|
-
const requestedBy = resolveRequestedBy(options.author, settings.author_default);
|
|
1003
|
-
const resumed = await resumeBackgroundTestRun(pmRoot, runId, requestedBy, options.noExtensions === true);
|
|
1004
|
-
return {
|
|
1005
|
-
resumed_from: runId,
|
|
1006
|
-
run: resumed
|
|
1007
|
-
};
|
|
1008
|
-
}
|
|
1009
|
-
async function runTestRunsWorker(runId, global) {
|
|
1010
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
1011
|
-
await ensureInitialized(pmRoot);
|
|
1012
|
-
const finished = await runBackgroundTestRunWorker(pmRoot, runId, global.noExtensions === true);
|
|
1013
|
-
return {
|
|
1014
|
-
id: finished.id,
|
|
1015
|
-
status: finished.status,
|
|
1016
|
-
exit_code: finished.exit_code
|
|
1017
|
-
};
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
export {
|
|
1021
|
-
runStartBackgroundRun,
|
|
1022
|
-
runTestRunsList,
|
|
1023
|
-
runTestRunsStatus,
|
|
1024
|
-
runTestRunsLogs,
|
|
1025
|
-
runTestRunsStop,
|
|
1026
|
-
runTestRunsResume,
|
|
1027
|
-
runTestRunsWorker
|
|
1028
|
-
};
|
|
1029
|
-
//# sourceMappingURL=chunk-PPAJG4GB.js.map
|
|
1030
|
-
|
|
1031
|
-
//# debugId=06f25e42-4a55-5490-b7f5-780bc79db731
|