@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,372 +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]="95ef21cc-1a68-576f-8241-660cffa2efa6")}catch(e){}}();
|
|
3
|
-
import {
|
|
4
|
-
buildListQueryFilters
|
|
5
|
-
} from "./chunk-VY3VQ22F.js";
|
|
6
|
-
import {
|
|
7
|
-
parseStatusFilterCsv,
|
|
8
|
-
runList
|
|
9
|
-
} from "./chunk-YSAH5FY5.js";
|
|
10
|
-
import "./chunk-QB7XMHJW.js";
|
|
11
|
-
import "./chunk-5JE6SMYS.js";
|
|
12
|
-
import "./chunk-YFIE7YK6.js";
|
|
13
|
-
import {
|
|
14
|
-
splitCommaList
|
|
15
|
-
} from "./chunk-P4SESZGT.js";
|
|
16
|
-
import "./chunk-57C2RLW5.js";
|
|
17
|
-
import {
|
|
18
|
-
normalizeStatusInput
|
|
19
|
-
} from "./chunk-HK72NWAD.js";
|
|
20
|
-
import {
|
|
21
|
-
nowIso
|
|
22
|
-
} from "./chunk-FJRKQREY.js";
|
|
23
|
-
import {
|
|
24
|
-
PmCliError,
|
|
25
|
-
readSettings
|
|
26
|
-
} from "./chunk-US3T3W5J.js";
|
|
27
|
-
import "./chunk-NNHHXJB2.js";
|
|
28
|
-
import {
|
|
29
|
-
EXIT_CODE,
|
|
30
|
-
resolvePmRoot,
|
|
31
|
-
resolveRuntimeStatusRegistry
|
|
32
|
-
} from "./chunk-YD5FML7K.js";
|
|
33
|
-
|
|
34
|
-
// dist/cli/commands/aggregate.js
|
|
35
|
-
var AGGREGATE_GROUP_FIELDS = [
|
|
36
|
-
"parent",
|
|
37
|
-
"type",
|
|
38
|
-
"priority",
|
|
39
|
-
"status",
|
|
40
|
-
"assignee",
|
|
41
|
-
"tags",
|
|
42
|
-
"sprint",
|
|
43
|
-
"release"
|
|
44
|
-
];
|
|
45
|
-
function parseStatus(raw, statusRegistry) {
|
|
46
|
-
const statuses = parseStatusFilterCsv(raw, statusRegistry, { strict: true, flagLabel: "--status" });
|
|
47
|
-
if (!statuses || statuses.length === 0) {
|
|
48
|
-
return void 0;
|
|
49
|
-
}
|
|
50
|
-
if (statuses.length > 1) {
|
|
51
|
-
throw new PmCliError('Aggregate --status accepts one status, or the standalone "all" sentinel.', EXIT_CODE.USAGE);
|
|
52
|
-
}
|
|
53
|
-
return statuses[0];
|
|
54
|
-
}
|
|
55
|
-
function parseNumericAggregation(options) {
|
|
56
|
-
const sumField = options.sum?.trim();
|
|
57
|
-
const avgField = options.avg?.trim();
|
|
58
|
-
const normalizedSum = sumField && sumField.length > 0 ? sumField : void 0;
|
|
59
|
-
const normalizedAvg = avgField && avgField.length > 0 ? avgField : void 0;
|
|
60
|
-
if (!normalizedSum && !normalizedAvg) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
if (normalizedSum && normalizedAvg && normalizedSum !== normalizedAvg) {
|
|
64
|
-
throw new PmCliError("Aggregate --sum and --avg must target the same numeric field", EXIT_CODE.USAGE);
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
field: normalizedSum ?? normalizedAvg,
|
|
68
|
-
sum: normalizedSum !== void 0,
|
|
69
|
-
avg: normalizedAvg !== void 0
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function parseGroupBy(raw) {
|
|
73
|
-
const value = raw?.trim() ?? "status";
|
|
74
|
-
if (value.length === 0) {
|
|
75
|
-
throw new PmCliError("--group-by requires at least one field name", EXIT_CODE.USAGE);
|
|
76
|
-
}
|
|
77
|
-
const requested = splitCommaList(value);
|
|
78
|
-
if (requested.length === 0) {
|
|
79
|
-
throw new PmCliError("--group-by requires a comma-separated list of fields", EXIT_CODE.USAGE);
|
|
80
|
-
}
|
|
81
|
-
for (const field of requested) {
|
|
82
|
-
if (!AGGREGATE_GROUP_FIELDS.includes(field)) {
|
|
83
|
-
throw new PmCliError(`Aggregate group fields must be one of ${AGGREGATE_GROUP_FIELDS.join("|")}; received "${field}"`, EXIT_CODE.USAGE);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return requested;
|
|
87
|
-
}
|
|
88
|
-
function normalizeTagGroupValue(tags) {
|
|
89
|
-
const normalized = [...new Set(tags.map((tag) => tag.trim().toLowerCase()).filter((tag) => tag.length > 0))].sort((left, right) => left.localeCompare(right));
|
|
90
|
-
if (normalized.length === 0) {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
return normalized.join(",");
|
|
94
|
-
}
|
|
95
|
-
function resolveGroupValue(field, item) {
|
|
96
|
-
switch (field) {
|
|
97
|
-
case "parent":
|
|
98
|
-
return item.parent ?? null;
|
|
99
|
-
case "type":
|
|
100
|
-
return item.type;
|
|
101
|
-
case "priority":
|
|
102
|
-
return item.priority;
|
|
103
|
-
case "status":
|
|
104
|
-
return item.status;
|
|
105
|
-
case "assignee":
|
|
106
|
-
return item.assignee ?? null;
|
|
107
|
-
case "tags":
|
|
108
|
-
return normalizeTagGroupValue(item.tags);
|
|
109
|
-
case "sprint":
|
|
110
|
-
return item.sprint ?? null;
|
|
111
|
-
case "release":
|
|
112
|
-
return item.release ?? null;
|
|
113
|
-
default:
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
function compareNullableGroupValue(left, right) {
|
|
118
|
-
const leftValue = left ?? null;
|
|
119
|
-
const rightValue = right ?? null;
|
|
120
|
-
if (leftValue === rightValue) {
|
|
121
|
-
return 0;
|
|
122
|
-
}
|
|
123
|
-
if (leftValue === null) {
|
|
124
|
-
return 1;
|
|
125
|
-
}
|
|
126
|
-
if (rightValue === null) {
|
|
127
|
-
return -1;
|
|
128
|
-
}
|
|
129
|
-
if (typeof leftValue === "number" && typeof rightValue === "number") {
|
|
130
|
-
return leftValue - rightValue;
|
|
131
|
-
}
|
|
132
|
-
return String(leftValue).localeCompare(String(rightValue));
|
|
133
|
-
}
|
|
134
|
-
function buildGroupKey(groupBy, group) {
|
|
135
|
-
return groupBy.map((field) => `${field}:${JSON.stringify(group[field] ?? null)}`).join("|");
|
|
136
|
-
}
|
|
137
|
-
var EMPTY_AGGREGATE_GROUP_LABELS = {
|
|
138
|
-
parent: "(unparented)",
|
|
139
|
-
type: "(untyped)",
|
|
140
|
-
priority: "(no priority)",
|
|
141
|
-
status: "(no status)",
|
|
142
|
-
assignee: "(unassigned)",
|
|
143
|
-
tags: "(untagged)",
|
|
144
|
-
sprint: "(no sprint)",
|
|
145
|
-
release: "(no release)"
|
|
146
|
-
};
|
|
147
|
-
function formatGroupFieldLabel(field, value) {
|
|
148
|
-
if (value === null || value === void 0 || value === "") {
|
|
149
|
-
return EMPTY_AGGREGATE_GROUP_LABELS[field];
|
|
150
|
-
}
|
|
151
|
-
return String(value);
|
|
152
|
-
}
|
|
153
|
-
function buildGroupLabel(groupBy, group) {
|
|
154
|
-
if (groupBy.length === 1) {
|
|
155
|
-
return formatGroupFieldLabel(groupBy[0], group[groupBy[0]]);
|
|
156
|
-
}
|
|
157
|
-
return groupBy.map((field) => `${field}=${formatGroupFieldLabel(field, group[field])}`).join(" | ");
|
|
158
|
-
}
|
|
159
|
-
function compareAggregateRows(left, right, groupBy) {
|
|
160
|
-
for (const field of groupBy) {
|
|
161
|
-
const byField = compareNullableGroupValue(left.group[field], right.group[field]);
|
|
162
|
-
if (byField !== 0) {
|
|
163
|
-
return byField;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return 0;
|
|
167
|
-
}
|
|
168
|
-
function readNumericAggregateValue(item, field) {
|
|
169
|
-
const source = item;
|
|
170
|
-
const raw = source[field];
|
|
171
|
-
if (typeof raw === "number" && Number.isFinite(raw)) {
|
|
172
|
-
return raw;
|
|
173
|
-
}
|
|
174
|
-
if (typeof raw === "string") {
|
|
175
|
-
const trimmed = raw.trim();
|
|
176
|
-
if (trimmed.length === 0) {
|
|
177
|
-
return null;
|
|
178
|
-
}
|
|
179
|
-
const parsed = Number(trimmed);
|
|
180
|
-
if (Number.isFinite(parsed)) {
|
|
181
|
-
return parsed;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return null;
|
|
185
|
-
}
|
|
186
|
-
function completionPct(closed, total) {
|
|
187
|
-
if (total <= 0) {
|
|
188
|
-
return 0;
|
|
189
|
-
}
|
|
190
|
-
return Math.round(closed / total * 1e4) / 100;
|
|
191
|
-
}
|
|
192
|
-
function updateCompletionCounts(accumulator, status, statusRegistry) {
|
|
193
|
-
const normalizedStatus = normalizeStatusInput(String(status), statusRegistry) ?? status;
|
|
194
|
-
if (normalizedStatus === statusRegistry.open_status) {
|
|
195
|
-
accumulator.open_count += 1;
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
if (normalizedStatus === "in_progress" || statusRegistry.active_statuses.has(normalizedStatus) && normalizedStatus !== statusRegistry.open_status) {
|
|
199
|
-
accumulator.in_progress_count += 1;
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
if (statusRegistry.terminal_done_statuses.has(normalizedStatus) || normalizedStatus === statusRegistry.close_status) {
|
|
203
|
-
accumulator.closed_count += 1;
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
accumulator.other_count += 1;
|
|
207
|
-
}
|
|
208
|
-
function createAggregateAccumulator(group, numericValue) {
|
|
209
|
-
return {
|
|
210
|
-
row: {
|
|
211
|
-
group,
|
|
212
|
-
count: 1
|
|
213
|
-
},
|
|
214
|
-
numeric_count: numericValue === null ? 0 : 1,
|
|
215
|
-
numeric_sum: numericValue ?? 0,
|
|
216
|
-
null_count: numericValue === null ? 1 : 0,
|
|
217
|
-
open_count: 0,
|
|
218
|
-
in_progress_count: 0,
|
|
219
|
-
closed_count: 0,
|
|
220
|
-
other_count: 0
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
function updateNumericAggregation(accumulator, numericValue) {
|
|
224
|
-
if (numericValue === null) {
|
|
225
|
-
accumulator.null_count += 1;
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
accumulator.numeric_count += 1;
|
|
229
|
-
accumulator.numeric_sum += numericValue;
|
|
230
|
-
}
|
|
231
|
-
function updateAggregateAccumulator(params) {
|
|
232
|
-
params.accumulator.row.count += 1;
|
|
233
|
-
if (params.includeCompletion) {
|
|
234
|
-
updateCompletionCounts(params.accumulator, params.item.status, params.statusRegistry);
|
|
235
|
-
}
|
|
236
|
-
if (params.numericAggregation !== null) {
|
|
237
|
-
updateNumericAggregation(params.accumulator, params.numericValue);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
function buildAggregateGroup(groupBy, item) {
|
|
241
|
-
const group = {};
|
|
242
|
-
for (const field of groupBy) {
|
|
243
|
-
group[field] = resolveGroupValue(field, item);
|
|
244
|
-
}
|
|
245
|
-
return group;
|
|
246
|
-
}
|
|
247
|
-
function finalizeAggregateRow(entry, groupBy, includeCompletion, numericAggregation) {
|
|
248
|
-
const row = {
|
|
249
|
-
...entry.row,
|
|
250
|
-
group_label: buildGroupLabel(groupBy, entry.row.group)
|
|
251
|
-
};
|
|
252
|
-
if (includeCompletion) {
|
|
253
|
-
row.open = entry.open_count;
|
|
254
|
-
row.in_progress = entry.in_progress_count;
|
|
255
|
-
row.closed = entry.closed_count;
|
|
256
|
-
row.other = entry.other_count;
|
|
257
|
-
row.completion_pct = completionPct(entry.closed_count, entry.row.count);
|
|
258
|
-
}
|
|
259
|
-
if (numericAggregation !== null) {
|
|
260
|
-
row.null_count = entry.null_count;
|
|
261
|
-
if (numericAggregation.sum) {
|
|
262
|
-
row.sum = entry.numeric_sum;
|
|
263
|
-
}
|
|
264
|
-
if (numericAggregation.avg) {
|
|
265
|
-
row.avg = entry.numeric_count === 0 ? null : entry.numeric_sum / entry.numeric_count;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return row;
|
|
269
|
-
}
|
|
270
|
-
function buildAggregateFilters(params) {
|
|
271
|
-
return {
|
|
272
|
-
group_by: params.groupBy,
|
|
273
|
-
count: true,
|
|
274
|
-
completion: params.includeCompletion,
|
|
275
|
-
include_unparented: params.includeUnparented,
|
|
276
|
-
status: params.status ?? null,
|
|
277
|
-
type: params.options.type ?? null,
|
|
278
|
-
tag: params.options.tag ?? null,
|
|
279
|
-
priority: params.options.priority ?? null,
|
|
280
|
-
deadline_before: params.options.deadlineBefore ?? null,
|
|
281
|
-
deadline_after: params.options.deadlineAfter ?? null,
|
|
282
|
-
assignee: params.options.assignee ?? null,
|
|
283
|
-
assignee_filter: params.options.assigneeFilter ?? null,
|
|
284
|
-
parent: params.options.parent ?? null,
|
|
285
|
-
sprint: params.options.sprint ?? null,
|
|
286
|
-
release: params.options.release ?? null,
|
|
287
|
-
...params.numericAggregation !== null ? {
|
|
288
|
-
sum: params.options.sum ?? null,
|
|
289
|
-
avg: params.options.avg ?? null,
|
|
290
|
-
numeric_field: params.numericAggregation.field
|
|
291
|
-
} : {}
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
async function runAggregate(options, global) {
|
|
295
|
-
if (options.count === false) {
|
|
296
|
-
throw new PmCliError("Aggregate grouped counts are always enabled; omit count=false.", EXIT_CODE.USAGE);
|
|
297
|
-
}
|
|
298
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
299
|
-
const settings = await readSettings(pmRoot);
|
|
300
|
-
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
301
|
-
const groupBy = parseGroupBy(options.groupBy);
|
|
302
|
-
const status = parseStatus(options.status, statusRegistry);
|
|
303
|
-
const numericAggregation = parseNumericAggregation(options);
|
|
304
|
-
const includeCompletion = options.completion === true;
|
|
305
|
-
const includeUnparented = options.includeUnparented === true;
|
|
306
|
-
const listed = await runList(status, buildListQueryFilters(options), global);
|
|
307
|
-
const grouped = /* @__PURE__ */ new Map();
|
|
308
|
-
let skippedUnparented = 0;
|
|
309
|
-
let groupedItemCount = 0;
|
|
310
|
-
for (const listedItem of listed.items) {
|
|
311
|
-
const item = listedItem;
|
|
312
|
-
const group = buildAggregateGroup(groupBy, item);
|
|
313
|
-
if (groupBy.includes("parent") && group.parent === null && !includeUnparented) {
|
|
314
|
-
skippedUnparented += 1;
|
|
315
|
-
continue;
|
|
316
|
-
}
|
|
317
|
-
const key = buildGroupKey(groupBy, group);
|
|
318
|
-
const existing = grouped.get(key);
|
|
319
|
-
const numericValue = numericAggregation === null ? null : readNumericAggregateValue(item, numericAggregation.field);
|
|
320
|
-
if (existing) {
|
|
321
|
-
updateAggregateAccumulator({
|
|
322
|
-
accumulator: existing,
|
|
323
|
-
item,
|
|
324
|
-
statusRegistry,
|
|
325
|
-
includeCompletion,
|
|
326
|
-
numericAggregation,
|
|
327
|
-
numericValue
|
|
328
|
-
});
|
|
329
|
-
} else {
|
|
330
|
-
const accumulator = createAggregateAccumulator(group, numericValue);
|
|
331
|
-
if (includeCompletion) {
|
|
332
|
-
updateCompletionCounts(accumulator, item.status, statusRegistry);
|
|
333
|
-
}
|
|
334
|
-
grouped.set(key, accumulator);
|
|
335
|
-
}
|
|
336
|
-
groupedItemCount += 1;
|
|
337
|
-
}
|
|
338
|
-
const groups = [...grouped.values()].map((entry) => finalizeAggregateRow(entry, groupBy, includeCompletion, numericAggregation)).sort((left, right) => compareAggregateRows(left, right, groupBy));
|
|
339
|
-
const warnings = listed.warnings && listed.warnings.length > 0 ? listed.warnings : void 0;
|
|
340
|
-
return {
|
|
341
|
-
groups,
|
|
342
|
-
count: groups.length,
|
|
343
|
-
totals: {
|
|
344
|
-
items_considered: listed.items.length,
|
|
345
|
-
items_grouped: groupedItemCount,
|
|
346
|
-
items_skipped_unparented: skippedUnparented
|
|
347
|
-
},
|
|
348
|
-
filters: buildAggregateFilters({ groupBy, includeCompletion, includeUnparented, status, options, numericAggregation }),
|
|
349
|
-
now: nowIso(),
|
|
350
|
-
...warnings ? { warnings } : {}
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
var _testOnlyAggregateCommand = {
|
|
354
|
-
buildGroupKey,
|
|
355
|
-
compareAggregateRows,
|
|
356
|
-
compareNullableGroupValue,
|
|
357
|
-
completionPct,
|
|
358
|
-
normalizeTagGroupValue,
|
|
359
|
-
parseGroupBy,
|
|
360
|
-
parseNumericAggregation,
|
|
361
|
-
parseStatus,
|
|
362
|
-
readNumericAggregateValue,
|
|
363
|
-
resolveGroupValue,
|
|
364
|
-
updateCompletionCounts
|
|
365
|
-
};
|
|
366
|
-
export {
|
|
367
|
-
_testOnlyAggregateCommand,
|
|
368
|
-
runAggregate
|
|
369
|
-
};
|
|
370
|
-
//# sourceMappingURL=aggregate-PEGZGJXD.js.map
|
|
371
|
-
|
|
372
|
-
//# debugId=95ef21cc-1a68-576f-8241-660cffa2efa6
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/aggregate.ts"],"sourcesContent":["/**\n * @module cli/commands/aggregate\n *\n * Implements the pm aggregate command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { splitCommaList } from \"../../core/shared/split-comma-list.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport { parseStatusFilterCsv } from \"../../core/item/status-filter.js\";\nimport { resolveRuntimeStatusRegistry, type RuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { type ItemStatus } from \"../../types/index.js\";\nimport { buildListQueryFilters } from \"./list-filter-shared.js\";\nimport { runList } from \"./list.js\";\n\ntype AggregateGroupField = \"parent\" | \"type\" | \"priority\" | \"status\" | \"assignee\" | \"tags\" | \"sprint\" | \"release\";\ntype AggregateGroupValue = string | number | null;\ntype AggregateGroupRecord = Partial<Record<AggregateGroupField, AggregateGroupValue>>;\ntype AggregateListedItem = {\n type: string;\n status: ItemStatus;\n priority: number;\n parent?: string;\n assignee?: string;\n tags: string[];\n sprint?: string;\n release?: string;\n};\n\nconst AGGREGATE_GROUP_FIELDS: AggregateGroupField[] = [\n \"parent\",\n \"type\",\n \"priority\",\n \"status\",\n \"assignee\",\n \"tags\",\n \"sprint\",\n \"release\",\n];\n\n/**\n * Documents the aggregate options payload exchanged by command, SDK, and package integrations.\n */\nexport interface AggregateOptions {\n groupBy?: string;\n count?: boolean;\n completion?: boolean;\n sum?: string;\n avg?: string;\n includeUnparented?: boolean;\n status?: string;\n type?: string;\n tag?: string;\n priority?: string;\n deadlineBefore?: string;\n deadlineAfter?: string;\n assignee?: string;\n assigneeFilter?: string;\n parent?: string;\n sprint?: string;\n release?: string;\n}\n\n/**\n * Documents the aggregate row payload exchanged by command, SDK, and package integrations.\n */\nexport interface AggregateRow {\n group: AggregateGroupRecord;\n /**\n * Human-readable display label for this group. Blank/null group values render\n * with an explicit \"(unassigned)\"-style label (per dimension) so terminal and\n * grep-based consumers are never faced with an ambiguous empty key. The\n * structured `group` record keeps the raw null for machine consumers.\n */\n group_label: string;\n count: number;\n open?: number;\n in_progress?: number;\n closed?: number;\n other?: number;\n completion_pct?: number;\n null_count?: number;\n sum?: number | null;\n avg?: number | null;\n}\n\n/**\n * Documents the aggregate result payload exchanged by command, SDK, and package integrations.\n */\nexport interface AggregateResult {\n groups: AggregateRow[];\n count: number;\n totals: {\n items_considered: number;\n items_grouped: number;\n items_skipped_unparented: number;\n };\n filters: {\n group_by: AggregateGroupField[];\n count: boolean;\n completion: boolean;\n sum?: string | null;\n avg?: string | null;\n numeric_field?: string | null;\n include_unparented: boolean;\n status: ItemStatus | null;\n type: string | null;\n tag: string | null;\n priority: string | null;\n deadline_before: string | null;\n deadline_after: string | null;\n assignee: string | null;\n assignee_filter: string | null;\n parent: string | null;\n sprint: string | null;\n release: string | null;\n };\n now: string;\n warnings?: string[];\n}\n\nfunction parseStatus(raw: string | undefined, statusRegistry: RuntimeStatusRegistry): ItemStatus | undefined {\n const statuses = parseStatusFilterCsv(raw, statusRegistry, { strict: true, flagLabel: \"--status\" });\n if (!statuses || statuses.length === 0) {\n return undefined;\n }\n if (statuses.length > 1) {\n throw new PmCliError(\n 'Aggregate --status accepts one status, or the standalone \"all\" sentinel.',\n EXIT_CODE.USAGE,\n );\n }\n return statuses[0];\n}\n\ninterface NumericAggregation {\n field: string;\n sum: boolean;\n avg: boolean;\n}\n\nfunction parseNumericAggregation(options: AggregateOptions): NumericAggregation | null {\n const sumField = options.sum?.trim();\n const avgField = options.avg?.trim();\n const normalizedSum = sumField && sumField.length > 0 ? sumField : undefined;\n const normalizedAvg = avgField && avgField.length > 0 ? avgField : undefined;\n if (!normalizedSum && !normalizedAvg) {\n return null;\n }\n if (normalizedSum && normalizedAvg && normalizedSum !== normalizedAvg) {\n throw new PmCliError(\"Aggregate --sum and --avg must target the same numeric field\", EXIT_CODE.USAGE);\n }\n return {\n field: normalizedSum ?? normalizedAvg!,\n sum: normalizedSum !== undefined,\n avg: normalizedAvg !== undefined,\n };\n}\n\nfunction parseGroupBy(raw: string | undefined): AggregateGroupField[] {\n const value = raw?.trim() ?? \"status\";\n if (value.length === 0) {\n throw new PmCliError(\"--group-by requires at least one field name\", EXIT_CODE.USAGE);\n }\n const requested = splitCommaList(value);\n if (requested.length === 0) {\n throw new PmCliError(\"--group-by requires a comma-separated list of fields\", EXIT_CODE.USAGE);\n }\n for (const field of requested) {\n if (!AGGREGATE_GROUP_FIELDS.includes(field as AggregateGroupField)) {\n throw new PmCliError(\n `Aggregate group fields must be one of ${AGGREGATE_GROUP_FIELDS.join(\"|\")}; received \"${field}\"`,\n EXIT_CODE.USAGE,\n );\n }\n }\n return requested as AggregateGroupField[];\n}\n\nfunction normalizeTagGroupValue(tags: string[]): string | null {\n const normalized = [...new Set(tags.map((tag) => tag.trim().toLowerCase()).filter((tag) => tag.length > 0))].sort((left, right) =>\n left.localeCompare(right),\n );\n if (normalized.length === 0) {\n return null;\n }\n return normalized.join(\",\");\n}\n\nfunction resolveGroupValue(field: AggregateGroupField, item: AggregateListedItem): AggregateGroupValue {\n switch (field) {\n case \"parent\":\n return item.parent ?? null;\n case \"type\":\n return item.type;\n case \"priority\":\n return item.priority;\n case \"status\":\n return item.status;\n case \"assignee\":\n return item.assignee ?? null;\n case \"tags\":\n return normalizeTagGroupValue(item.tags);\n case \"sprint\":\n return item.sprint ?? null;\n case \"release\":\n return item.release ?? null;\n default:\n return null;\n }\n}\n\nfunction compareNullableGroupValue(left: AggregateGroupValue | undefined, right: AggregateGroupValue | undefined): number {\n const leftValue = left ?? null;\n const rightValue = right ?? null;\n if (leftValue === rightValue) {\n return 0;\n }\n if (leftValue === null) {\n return 1;\n }\n if (rightValue === null) {\n return -1;\n }\n if (typeof leftValue === \"number\" && typeof rightValue === \"number\") {\n return leftValue - rightValue;\n }\n return String(leftValue).localeCompare(String(rightValue));\n}\n\nfunction buildGroupKey(groupBy: AggregateGroupField[], group: AggregateGroupRecord): string {\n return groupBy.map((field) => `${field}:${JSON.stringify(group[field] ?? null)}`).join(\"|\");\n}\n\n/** Explicit display label for an empty/blank group value, keyed by dimension. */\nconst EMPTY_AGGREGATE_GROUP_LABELS: Record<AggregateGroupField, string> = {\n parent: \"(unparented)\",\n type: \"(untyped)\",\n priority: \"(no priority)\",\n status: \"(no status)\",\n assignee: \"(unassigned)\",\n tags: \"(untagged)\",\n sprint: \"(no sprint)\",\n release: \"(no release)\",\n};\n\n/** Render a single group field's value, substituting an explicit label for null. */\nfunction formatGroupFieldLabel(field: AggregateGroupField, value: AggregateGroupValue | undefined): string {\n if (value === null || value === undefined || value === \"\") {\n return EMPTY_AGGREGATE_GROUP_LABELS[field];\n }\n return String(value);\n}\n\n/**\n * Build the human-readable label for an aggregate row. Single-field grouping\n * yields the bare (possibly substituted) value; multi-field grouping joins each\n * \"field=value\" pair so composite groups stay unambiguous.\n */\nfunction buildGroupLabel(groupBy: AggregateGroupField[], group: AggregateGroupRecord): string {\n if (groupBy.length === 1) {\n return formatGroupFieldLabel(groupBy[0], group[groupBy[0]]);\n }\n return groupBy.map((field) => `${field}=${formatGroupFieldLabel(field, group[field])}`).join(\" | \");\n}\n\nfunction compareAggregateRows(\n left: AggregateRow,\n right: AggregateRow,\n groupBy: AggregateGroupField[],\n): number {\n for (const field of groupBy) {\n const byField = compareNullableGroupValue(left.group[field], right.group[field]);\n if (byField !== 0) {\n return byField;\n }\n }\n return 0;\n}\n\nfunction readNumericAggregateValue(item: AggregateListedItem, field: string): number | null {\n const source = item as unknown as Record<string, unknown>;\n const raw = source[field];\n if (typeof raw === \"number\" && Number.isFinite(raw)) {\n return raw;\n }\n if (typeof raw === \"string\") {\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n return null;\n }\n const parsed = Number(trimmed);\n if (Number.isFinite(parsed)) {\n return parsed;\n }\n }\n return null;\n}\n\ninterface AggregateAccumulator {\n /** group_label is derived once at finalization, so the accumulator omits it. */\n row: Omit<AggregateRow, \"group_label\">;\n numeric_count: number;\n numeric_sum: number;\n null_count: number;\n open_count: number;\n in_progress_count: number;\n closed_count: number;\n other_count: number;\n}\n\nfunction completionPct(closed: number, total: number): number {\n if (total <= 0) {\n return 0;\n }\n return Math.round((closed / total) * 10000) / 100;\n}\n\nfunction updateCompletionCounts(accumulator: AggregateAccumulator, status: ItemStatus, statusRegistry: RuntimeStatusRegistry): void {\n const normalizedStatus = normalizeStatusInput(String(status), statusRegistry) ?? status;\n if (normalizedStatus === statusRegistry.open_status) {\n accumulator.open_count += 1;\n return;\n }\n if (normalizedStatus === \"in_progress\" || (statusRegistry.active_statuses.has(normalizedStatus) && normalizedStatus !== statusRegistry.open_status)) {\n accumulator.in_progress_count += 1;\n return;\n }\n if (statusRegistry.terminal_done_statuses.has(normalizedStatus) || normalizedStatus === statusRegistry.close_status) {\n accumulator.closed_count += 1;\n return;\n }\n accumulator.other_count += 1;\n}\n\nfunction createAggregateAccumulator(\n group: AggregateGroupRecord,\n numericValue: number | null,\n): AggregateAccumulator {\n return {\n row: {\n group,\n count: 1,\n },\n numeric_count: numericValue === null ? 0 : 1,\n numeric_sum: numericValue ?? 0,\n null_count: numericValue === null ? 1 : 0,\n open_count: 0,\n in_progress_count: 0,\n closed_count: 0,\n other_count: 0,\n };\n}\n\nfunction updateNumericAggregation(accumulator: AggregateAccumulator, numericValue: number | null): void {\n if (numericValue === null) {\n accumulator.null_count += 1;\n return;\n }\n accumulator.numeric_count += 1;\n accumulator.numeric_sum += numericValue;\n}\n\nfunction updateAggregateAccumulator(params: {\n accumulator: AggregateAccumulator;\n item: AggregateListedItem;\n statusRegistry: RuntimeStatusRegistry;\n includeCompletion: boolean;\n numericAggregation: NumericAggregation | null;\n numericValue: number | null;\n}): void {\n params.accumulator.row.count += 1;\n if (params.includeCompletion) {\n updateCompletionCounts(params.accumulator, params.item.status, params.statusRegistry);\n }\n if (params.numericAggregation !== null) {\n updateNumericAggregation(params.accumulator, params.numericValue);\n }\n}\n\nfunction buildAggregateGroup(groupBy: AggregateGroupField[], item: AggregateListedItem): AggregateGroupRecord {\n const group: AggregateGroupRecord = {};\n for (const field of groupBy) {\n group[field] = resolveGroupValue(field, item);\n }\n return group;\n}\n\nfunction finalizeAggregateRow(\n entry: AggregateAccumulator,\n groupBy: AggregateGroupField[],\n includeCompletion: boolean,\n numericAggregation: NumericAggregation | null,\n): AggregateRow {\n const row: AggregateRow = {\n ...entry.row,\n group_label: buildGroupLabel(groupBy, entry.row.group),\n };\n if (includeCompletion) {\n row.open = entry.open_count;\n row.in_progress = entry.in_progress_count;\n row.closed = entry.closed_count;\n row.other = entry.other_count;\n row.completion_pct = completionPct(entry.closed_count, entry.row.count);\n }\n if (numericAggregation !== null) {\n row.null_count = entry.null_count;\n if (numericAggregation.sum) {\n row.sum = entry.numeric_sum;\n }\n if (numericAggregation.avg) {\n row.avg = entry.numeric_count === 0 ? null : entry.numeric_sum / entry.numeric_count;\n }\n }\n return row;\n}\n\nfunction buildAggregateFilters(params: {\n groupBy: AggregateGroupField[];\n includeCompletion: boolean;\n includeUnparented: boolean;\n status: ItemStatus | undefined;\n options: AggregateOptions;\n numericAggregation: NumericAggregation | null;\n}): AggregateResult[\"filters\"] {\n return {\n group_by: params.groupBy,\n count: true,\n completion: params.includeCompletion,\n include_unparented: params.includeUnparented,\n status: params.status ?? null,\n type: params.options.type ?? null,\n tag: params.options.tag ?? null,\n priority: params.options.priority ?? null,\n deadline_before: params.options.deadlineBefore ?? null,\n deadline_after: params.options.deadlineAfter ?? null,\n assignee: params.options.assignee ?? null,\n assignee_filter: params.options.assigneeFilter ?? null,\n parent: params.options.parent ?? null,\n sprint: params.options.sprint ?? null,\n release: params.options.release ?? null,\n ...(params.numericAggregation !== null\n ? {\n sum: params.options.sum ?? null,\n avg: params.options.avg ?? null,\n numeric_field: params.numericAggregation.field,\n }\n : {}),\n };\n}\n\n/**\n * Implements run aggregate for the public runtime surface of this module.\n */\nexport async function runAggregate(options: AggregateOptions, global: GlobalOptions): Promise<AggregateResult> {\n if (options.count === false) {\n throw new PmCliError(\"Aggregate grouped counts are always enabled; omit count=false.\", EXIT_CODE.USAGE);\n }\n\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const groupBy = parseGroupBy(options.groupBy);\n const status = parseStatus(options.status, statusRegistry);\n const numericAggregation = parseNumericAggregation(options);\n const includeCompletion = options.completion === true;\n const includeUnparented = options.includeUnparented === true;\n\n const listed = await runList(\n status,\n buildListQueryFilters(options),\n global,\n );\n\n const grouped = new Map<string, AggregateAccumulator>();\n let skippedUnparented = 0;\n let groupedItemCount = 0;\n\n for (const listedItem of listed.items) {\n const item = listedItem as AggregateListedItem;\n const group = buildAggregateGroup(groupBy, item);\n if (groupBy.includes(\"parent\") && group.parent === null && !includeUnparented) {\n skippedUnparented += 1;\n continue;\n }\n const key = buildGroupKey(groupBy, group);\n const existing = grouped.get(key);\n const numericValue =\n numericAggregation === null\n ? null\n : readNumericAggregateValue(item, numericAggregation.field);\n if (existing) {\n updateAggregateAccumulator({\n accumulator: existing,\n item,\n statusRegistry,\n includeCompletion,\n numericAggregation,\n numericValue,\n });\n } else {\n const accumulator = createAggregateAccumulator(group, numericValue);\n if (includeCompletion) {\n updateCompletionCounts(accumulator, item.status, statusRegistry);\n }\n grouped.set(key, accumulator);\n }\n groupedItemCount += 1;\n }\n\n const groups = [...grouped.values()]\n .map((entry) => finalizeAggregateRow(entry, groupBy, includeCompletion, numericAggregation))\n .sort((left, right) => compareAggregateRows(left, right, groupBy));\n const warnings = listed.warnings && listed.warnings.length > 0 ? listed.warnings : undefined;\n\n return {\n groups,\n count: groups.length,\n totals: {\n items_considered: listed.items.length,\n items_grouped: groupedItemCount,\n items_skipped_unparented: skippedUnparented,\n },\n filters: buildAggregateFilters({ groupBy, includeCompletion, includeUnparented, status, options, numericAggregation }),\n now: nowIso(),\n ...(warnings ? { warnings } : {}),\n };\n}\n\nexport const _testOnlyAggregateCommand = {\n buildGroupKey,\n compareAggregateRows,\n compareNullableGroupValue,\n completionPct,\n normalizeTagGroupValue,\n parseGroupBy,\n parseNumericAggregation,\n parseStatus,\n readNumericAggregateValue,\n resolveGroupValue,\n updateCompletionCounts,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAM,yBAAgD;EACpD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAoFF,SAAS,YAAY,KAAyB,gBAAqC;AACjF,QAAM,WAAW,qBAAqB,KAAK,gBAAgB,EAAE,QAAQ,MAAM,WAAW,WAAU,CAAE;AAClG,MAAI,CAAC,YAAY,SAAS,WAAW,GAAG;AACtC,WAAO;EACT;AACA,MAAI,SAAS,SAAS,GAAG;AACvB,UAAM,IAAI,WACR,4EACA,UAAU,KAAK;EAEnB;AACA,SAAO,SAAS,CAAC;AACnB;AAQA,SAAS,wBAAwB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AAQ,oBAAoB,SAAS,IAAI;AAC/C,QAAI,QAAQ,SAAS,QAAQ,KAAK,MAAM,WAAW,QAAQ,CAAC,mBAAmB;AAC7E,2BAAqB;AACrB;IACF;AACA,UAAM,MAAM,cAAc,SAAS,KAAK;AACxC,UAAM,WAAW,QAAQ,IAAI,GAAG;AAChC,UAAM,eACJ,uBAAuB,OACnB,OACA,0BAA0B,MAAM,mBAAmB,KAAK;AAC9D,QAAI,UAAU;AACZ,iCAA2B;QACzB,aAAa;QACb;QACA;QACA;QACA;QACA;OACD;IACH,OAAO;AACL,YAAM,cAAc,2BAA2B,OAAO,YAAY;AAClE,UAAI,mBAAmB;AACrB,+BAAuB,aAAa,KAAK,QAAQ,cAAc;MACjE;AACA,cAAQ,IAAI,KAAK,WAAW;IAC9B;AACA,wBAAoB;EACtB;AAEA,QAAM,SAAS,CAAC,GAAG,QAAQ,OAAM,CAAE,EAChC,IAAI,CAAC,UAAU,qBAAqB,OAAO,SAAS,mBAAmB,kBAAkB,CAAC,EAC1F,KAAK,CAAC,MAAM,UAAU,qBAAqB,MAAM,OAAO,OAAO,CAAC;AACnE,QAAM,WAAW,OAAO,YAAY,OAAO,SAAS,SAAS,IAAI,OAAO,WAAW;AAEnF,SAAO;IACL;IACA,OAAO,OAAO;IACd,QAAQ;MACN,kBAAkB,OAAO,MAAM;MAC/B,eAAe;MACf,0BAA0B;;IAE5B,SAAS,sBAAsB,EAAE,SAAS,mBAAmB,mBAAmB,QAAQ,SAAS,mBAAkB,CAAE;IACrH,KAAK,OAAM;IACX,GAAI,WAAW,EAAE,SAAQ,IAAK,CAAA;;AAElC;AAEO,IAAM,4BAA4B;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","debugId":"95ef21cc-1a68-576f-8241-660cffa2efa6"}
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
// dist/core/lock/lock-gc.js
|
|
2
|
-
|
|
3
|
-
!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]="14efd147-017d-5bb5-9f15-6c3d12dda473")}catch(e){}}();
|
|
4
|
-
import fs from "node:fs/promises";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
function parseLock(raw) {
|
|
7
|
-
let parsed;
|
|
8
|
-
try {
|
|
9
|
-
parsed = JSON.parse(raw);
|
|
10
|
-
} catch {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
const candidate = parsed;
|
|
17
|
-
const { id, owner, created_at, ttl_seconds } = candidate;
|
|
18
|
-
if (typeof id !== "string" || typeof owner !== "string" || typeof created_at !== "string" || typeof ttl_seconds !== "number" || !Number.isFinite(ttl_seconds)) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
return { id, owner, created_at, ttl_seconds };
|
|
22
|
-
}
|
|
23
|
-
function isErrno(error, code) {
|
|
24
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
25
|
-
}
|
|
26
|
-
function classifyLockContent(file, raw, nowMs) {
|
|
27
|
-
const lock = parseLock(raw);
|
|
28
|
-
if (lock === null) {
|
|
29
|
-
return {
|
|
30
|
-
detail: "unparseable_json",
|
|
31
|
-
entry: {
|
|
32
|
-
file,
|
|
33
|
-
id: null,
|
|
34
|
-
owner: null,
|
|
35
|
-
created_at: null,
|
|
36
|
-
ttl_seconds: null,
|
|
37
|
-
age_seconds: null,
|
|
38
|
-
stale: false,
|
|
39
|
-
reason: "unparseable"
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const createdAtMs = Date.parse(lock.created_at);
|
|
44
|
-
if (!Number.isFinite(createdAtMs)) {
|
|
45
|
-
return {
|
|
46
|
-
detail: "invalid_timestamp",
|
|
47
|
-
entry: {
|
|
48
|
-
file,
|
|
49
|
-
id: lock.id,
|
|
50
|
-
owner: lock.owner,
|
|
51
|
-
created_at: lock.created_at,
|
|
52
|
-
ttl_seconds: lock.ttl_seconds,
|
|
53
|
-
age_seconds: null,
|
|
54
|
-
stale: false,
|
|
55
|
-
reason: "unparseable"
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
const ageMs = nowMs - createdAtMs;
|
|
60
|
-
const age_seconds = Math.floor(ageMs / 1e3);
|
|
61
|
-
const stale = ageMs > lock.ttl_seconds * 1e3;
|
|
62
|
-
return {
|
|
63
|
-
detail: stale ? "expired" : "active",
|
|
64
|
-
entry: {
|
|
65
|
-
file,
|
|
66
|
-
id: lock.id,
|
|
67
|
-
owner: lock.owner,
|
|
68
|
-
created_at: lock.created_at,
|
|
69
|
-
ttl_seconds: lock.ttl_seconds,
|
|
70
|
-
age_seconds,
|
|
71
|
-
stale,
|
|
72
|
-
reason: stale ? "expired" : "active"
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
async function scanLockHealth(pmRoot, now) {
|
|
77
|
-
const nowMs = now ?? Date.now();
|
|
78
|
-
const locksDir = path.join(pmRoot, "locks");
|
|
79
|
-
const scan = {
|
|
80
|
-
scanned: 0,
|
|
81
|
-
active_lock_count: 0,
|
|
82
|
-
stale_lock_count: 0,
|
|
83
|
-
unreadable_lock_count: 0,
|
|
84
|
-
unparseable_lock_count: 0
|
|
85
|
-
};
|
|
86
|
-
let dirEntries;
|
|
87
|
-
try {
|
|
88
|
-
const rawDir = await fs.readdir(locksDir);
|
|
89
|
-
dirEntries = rawDir.filter((f) => f.endsWith(".lock")).sort();
|
|
90
|
-
} catch (error) {
|
|
91
|
-
if (isErrno(error, "ENOENT")) {
|
|
92
|
-
return scan;
|
|
93
|
-
}
|
|
94
|
-
throw error;
|
|
95
|
-
}
|
|
96
|
-
for (const file of dirEntries) {
|
|
97
|
-
let raw;
|
|
98
|
-
try {
|
|
99
|
-
raw = await fs.readFile(path.join(locksDir, file), "utf8");
|
|
100
|
-
} catch (readError) {
|
|
101
|
-
if (isErrno(readError, "ENOENT")) {
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
scan.scanned += 1;
|
|
105
|
-
scan.unreadable_lock_count += 1;
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
scan.scanned += 1;
|
|
109
|
-
const { detail } = classifyLockContent(file, raw, nowMs);
|
|
110
|
-
if (detail === "active") {
|
|
111
|
-
scan.active_lock_count += 1;
|
|
112
|
-
} else if (detail === "expired") {
|
|
113
|
-
scan.stale_lock_count += 1;
|
|
114
|
-
} else {
|
|
115
|
-
scan.unparseable_lock_count += 1;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return scan;
|
|
119
|
-
}
|
|
120
|
-
async function runLockGc(pmRoot, options) {
|
|
121
|
-
const { dryRun, hooks } = options;
|
|
122
|
-
const nowMs = options.now ?? Date.now();
|
|
123
|
-
const locksDir = path.join(pmRoot, "locks");
|
|
124
|
-
const result = {
|
|
125
|
-
scanned: 0,
|
|
126
|
-
removed: [],
|
|
127
|
-
retained: [],
|
|
128
|
-
warnings: [],
|
|
129
|
-
entries: []
|
|
130
|
-
};
|
|
131
|
-
let dirEntries;
|
|
132
|
-
try {
|
|
133
|
-
const raw = await fs.readdir(locksDir);
|
|
134
|
-
dirEntries = raw.filter((f) => f.endsWith(".lock")).sort();
|
|
135
|
-
} catch (error) {
|
|
136
|
-
if (isErrno(error, "ENOENT")) {
|
|
137
|
-
return result;
|
|
138
|
-
}
|
|
139
|
-
throw error;
|
|
140
|
-
}
|
|
141
|
-
for (const file of dirEntries) {
|
|
142
|
-
result.scanned += 1;
|
|
143
|
-
const absPath = path.join(locksDir, file);
|
|
144
|
-
const relPath = `locks/${file}`;
|
|
145
|
-
if (hooks?.onRead) {
|
|
146
|
-
const hookWarnings = await hooks.onRead(absPath);
|
|
147
|
-
result.warnings.push(...hookWarnings);
|
|
148
|
-
}
|
|
149
|
-
let raw;
|
|
150
|
-
try {
|
|
151
|
-
raw = await fs.readFile(absPath, "utf8");
|
|
152
|
-
} catch (readError) {
|
|
153
|
-
if (isErrno(readError, "ENOENT")) {
|
|
154
|
-
result.scanned -= 1;
|
|
155
|
-
continue;
|
|
156
|
-
}
|
|
157
|
-
result.warnings.push(`lock_unreadable:${file}`);
|
|
158
|
-
result.retained.push(relPath);
|
|
159
|
-
result.entries.push({
|
|
160
|
-
file,
|
|
161
|
-
id: null,
|
|
162
|
-
owner: null,
|
|
163
|
-
created_at: null,
|
|
164
|
-
ttl_seconds: null,
|
|
165
|
-
age_seconds: null,
|
|
166
|
-
stale: false,
|
|
167
|
-
reason: "unparseable"
|
|
168
|
-
});
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
const classified = classifyLockContent(file, raw, nowMs);
|
|
172
|
-
if (classified.detail === "unparseable_json") {
|
|
173
|
-
result.warnings.push(`lock_unparseable:${file}`);
|
|
174
|
-
result.retained.push(relPath);
|
|
175
|
-
result.entries.push(classified.entry);
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
if (classified.detail === "invalid_timestamp") {
|
|
179
|
-
result.warnings.push(`lock_invalid_timestamp:${file}`);
|
|
180
|
-
result.retained.push(relPath);
|
|
181
|
-
result.entries.push(classified.entry);
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
if (classified.detail === "active") {
|
|
185
|
-
result.retained.push(relPath);
|
|
186
|
-
result.entries.push(classified.entry);
|
|
187
|
-
continue;
|
|
188
|
-
}
|
|
189
|
-
if (!dryRun) {
|
|
190
|
-
try {
|
|
191
|
-
await fs.unlink(absPath);
|
|
192
|
-
} catch (unlinkError) {
|
|
193
|
-
if (!isErrno(unlinkError, "ENOENT")) {
|
|
194
|
-
result.warnings.push(`lock_remove_failed:${file}`);
|
|
195
|
-
result.retained.push(relPath);
|
|
196
|
-
result.entries.push(classified.entry);
|
|
197
|
-
continue;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
if (hooks?.onWrite) {
|
|
201
|
-
const hookWarnings = await hooks.onWrite(absPath);
|
|
202
|
-
result.warnings.push(...hookWarnings);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
result.removed.push(relPath);
|
|
206
|
-
result.entries.push(classified.entry);
|
|
207
|
-
}
|
|
208
|
-
return result;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export {
|
|
212
|
-
scanLockHealth,
|
|
213
|
-
runLockGc
|
|
214
|
-
};
|
|
215
|
-
//# sourceMappingURL=chunk-37E72CNS.js.map
|
|
216
|
-
|
|
217
|
-
//# debugId=14efd147-017d-5bb5-9f15-6c3d12dda473
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../core/lock/lock-gc.ts"],"sourcesContent":["/**\n * lock-gc.ts — Stale lock file garbage collector.\n *\n * Safety-first policy: if a lock file cannot be read or parsed, it is RETAINED\n * rather than deleted. We only remove locks whose staleness can be conclusively\n * determined from the lock's own embedded `ttl_seconds` field.\n *\n * Staleness formula: (now_ms - Date.parse(created_at)) > ttl_seconds * 1000\n * Zero ttl means any lock older than 0 ms is stale. Negative ttl means always stale.\n */\n\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\n\n/**\n * Documents the stale lock scan entry payload exchanged by command, SDK, and package integrations.\n */\nexport interface StaleLockScanEntry {\n /** e.g. \"pm-abc1.lock\" */\n file: string;\n /** parsed id, or null if unparseable */\n id: string | null;\n owner: string | null;\n created_at: string | null;\n ttl_seconds: number | null;\n /** floor((now - created_at)/1000), null if unparseable */\n age_seconds: number | null;\n /** true only when classified expired */\n stale: boolean;\n reason: \"expired\" | \"active\" | \"unparseable\";\n}\n\n/**\n * Documents the lock gc hooks payload exchanged by command, SDK, and package integrations.\n */\nexport interface LockGcHooks {\n onRead?: (lockPath: string) => Promise<string[]> | string[];\n onWrite?: (lockPath: string) => Promise<string[]> | string[];\n}\n\n/**\n * Documents the lock gc options payload exchanged by command, SDK, and package integrations.\n */\nexport interface LockGcOptions {\n dryRun: boolean;\n /** epoch ms; defaults to Date.now() — injectable for deterministic tests */\n now?: number;\n hooks?: LockGcHooks;\n}\n\n/**\n * Documents the lock gc result payload exchanged by command, SDK, and package integrations.\n */\nexport interface LockGcResult {\n /** number of *.lock files examined */\n scanned: number;\n /** relative paths like \"locks/pm-abc1.lock\" (removed, or would-remove under dryRun) */\n removed: string[];\n /** relative paths retained (active OR unparseable — never delete what we can't reason about) */\n retained: string[];\n warnings: string[];\n /** one per scanned *.lock file, sorted by file name asc */\n entries: StaleLockScanEntry[];\n}\n\ninterface ParsedLock {\n id: string;\n owner: string;\n created_at: string;\n ttl_seconds: number;\n}\n\nfunction parseLock(raw: string): ParsedLock | null {\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n return null;\n }\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return null;\n }\n const candidate = parsed as Record<string, unknown>;\n const { id, owner, created_at, ttl_seconds } = candidate;\n if (\n typeof id !== \"string\" ||\n typeof owner !== \"string\" ||\n typeof created_at !== \"string\" ||\n typeof ttl_seconds !== \"number\" ||\n !Number.isFinite(ttl_seconds)\n ) {\n return null;\n }\n return { id, owner, created_at, ttl_seconds };\n}\n\nfunction isErrno(error: unknown, code: string): boolean {\n return (\n typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n (error as { code?: string }).code === code\n );\n}\n\n/**\n * Fine-grained classification outcome for one readable lock file's content.\n * `unparseable_json` and `invalid_timestamp` both surface as the coarse\n * `reason: \"unparseable\"` on the scan entry (gc retains both), but stay\n * distinct here so callers can emit precise warnings.\n */\nexport type LockClassificationDetail = \"active\" | \"expired\" | \"unparseable_json\" | \"invalid_timestamp\";\n\n/**\n * Documents the lock content classification payload exchanged by command, SDK, and package integrations.\n */\nexport interface LockContentClassification {\n detail: LockClassificationDetail;\n entry: StaleLockScanEntry;\n}\n\n/**\n * Pure classification of one lock file's raw content against `nowMs`. This is\n * the single staleness/parse policy shared by `pm gc --scope locks` (which acts\n * on it) and the `pm health` locks check (which only reports it).\n */\nexport function classifyLockContent(file: string, raw: string, nowMs: number): LockContentClassification {\n const lock = parseLock(raw);\n if (lock === null) {\n return {\n detail: \"unparseable_json\",\n entry: {\n file,\n id: null,\n owner: null,\n created_at: null,\n ttl_seconds: null,\n age_seconds: null,\n stale: false,\n reason: \"unparseable\",\n },\n };\n }\n const createdAtMs = Date.parse(lock.created_at);\n if (!Number.isFinite(createdAtMs)) {\n return {\n detail: \"invalid_timestamp\",\n entry: {\n file,\n id: lock.id,\n owner: lock.owner,\n created_at: lock.created_at,\n ttl_seconds: lock.ttl_seconds,\n age_seconds: null,\n stale: false,\n reason: \"unparseable\",\n },\n };\n }\n const ageMs = nowMs - createdAtMs;\n const age_seconds = Math.floor(ageMs / 1000);\n const stale = ageMs > lock.ttl_seconds * 1000;\n return {\n detail: stale ? \"expired\" : \"active\",\n entry: {\n file,\n id: lock.id,\n owner: lock.owner,\n created_at: lock.created_at,\n ttl_seconds: lock.ttl_seconds,\n age_seconds,\n stale,\n reason: stale ? \"expired\" : \"active\",\n },\n };\n}\n\n/**\n * Documents the lock health scan payload exchanged by command, SDK, and package integrations.\n */\nexport interface LockHealthScan {\n /** number of *.lock files examined (ghost files that vanish mid-scan are skipped) */\n scanned: number;\n active_lock_count: number;\n stale_lock_count: number;\n unreadable_lock_count: number;\n /** invalid JSON, wrong shape, or an unparseable created_at timestamp */\n unparseable_lock_count: number;\n}\n\n/**\n * Read-only locks scan for `pm health`: classifies every lock file with the\n * same policy `pm gc --scope locks` uses but never removes anything.\n */\nexport async function scanLockHealth(pmRoot: string, now?: number): Promise<LockHealthScan> {\n const nowMs = now ?? Date.now();\n const locksDir = path.join(pmRoot, \"locks\");\n const scan: LockHealthScan = {\n scanned: 0,\n active_lock_count: 0,\n stale_lock_count: 0,\n unreadable_lock_count: 0,\n unparseable_lock_count: 0,\n };\n\n let dirEntries: string[];\n try {\n const rawDir = await fs.readdir(locksDir);\n dirEntries = rawDir.filter((f) => f.endsWith(\".lock\")).sort();\n } catch (error: unknown) {\n if (isErrno(error, \"ENOENT\")) {\n return scan;\n }\n throw error;\n }\n\n for (const file of dirEntries) {\n let raw: string;\n try {\n raw = await fs.readFile(path.join(locksDir, file), \"utf8\");\n } catch (readError: unknown) {\n if (isErrno(readError, \"ENOENT\")) {\n // Disappeared between readdir and readFile — treat as a ghost; skip quietly.\n continue;\n }\n scan.scanned += 1;\n scan.unreadable_lock_count += 1;\n continue;\n }\n scan.scanned += 1;\n const { detail } = classifyLockContent(file, raw, nowMs);\n if (detail === \"active\") {\n scan.active_lock_count += 1;\n } else if (detail === \"expired\") {\n scan.stale_lock_count += 1;\n } else {\n scan.unparseable_lock_count += 1;\n }\n }\n\n return scan;\n}\n\n/**\n * Implements run lock gc for the public runtime surface of this module.\n */\nexport async function runLockGc(pmRoot: string, options: LockGcOptions): Promise<LockGcResult> {\n const { dryRun, hooks } = options;\n const nowMs = options.now ?? Date.now();\n const locksDir = path.join(pmRoot, \"locks\");\n\n const result: LockGcResult = {\n scanned: 0,\n removed: [],\n retained: [],\n warnings: [],\n entries: [],\n };\n\n let dirEntries: string[];\n try {\n const raw = await fs.readdir(locksDir);\n dirEntries = raw.filter((f) => f.endsWith(\".lock\")).sort();\n } catch (error: unknown) {\n if (isErrno(error, \"ENOENT\")) {\n return result;\n }\n throw error;\n }\n\n for (const file of dirEntries) {\n result.scanned += 1;\n const absPath = path.join(locksDir, file);\n const relPath = `locks/${file}`;\n\n // --- onRead hook ---\n if (hooks?.onRead) {\n const hookWarnings = await hooks.onRead(absPath);\n result.warnings.push(...hookWarnings);\n }\n\n // --- read file ---\n let raw: string;\n try {\n raw = await fs.readFile(absPath, \"utf8\");\n } catch (readError: unknown) {\n if (isErrno(readError, \"ENOENT\")) {\n // Disappeared between readdir and readFile — treat as a ghost; skip quietly.\n result.scanned -= 1;\n continue;\n }\n result.warnings.push(`lock_unreadable:${file}`);\n result.retained.push(relPath);\n result.entries.push({\n file,\n id: null,\n owner: null,\n created_at: null,\n ttl_seconds: null,\n age_seconds: null,\n stale: false,\n reason: \"unparseable\",\n });\n continue;\n }\n\n // --- classify (shared with the read-only pm health locks scan) ---\n const classified = classifyLockContent(file, raw, nowMs);\n if (classified.detail === \"unparseable_json\") {\n result.warnings.push(`lock_unparseable:${file}`);\n result.retained.push(relPath);\n result.entries.push(classified.entry);\n continue;\n }\n if (classified.detail === \"invalid_timestamp\") {\n result.warnings.push(`lock_invalid_timestamp:${file}`);\n result.retained.push(relPath);\n result.entries.push(classified.entry);\n continue;\n }\n if (classified.detail === \"active\") {\n result.retained.push(relPath);\n result.entries.push(classified.entry);\n continue;\n }\n\n // --- stale: remove or preview ---\n if (!dryRun) {\n try {\n await fs.unlink(absPath);\n } catch (unlinkError: unknown) {\n if (!isErrno(unlinkError, \"ENOENT\")) {\n result.warnings.push(`lock_remove_failed:${file}`);\n result.retained.push(relPath);\n result.entries.push(classified.entry);\n continue;\n }\n // ENOENT on unlink = already gone (race); treat as removed\n }\n // onWrite hook after successful removal\n if (hooks?.onWrite) {\n const hookWarnings = await hooks.onWrite(absPath);\n result.warnings.push(...hookWarnings);\n }\n }\n\n result.removed.push(relPath);\n result.entries.push(classified.entry);\n }\n\n return result;\n}\n"],"names":[],"mappings":";;;AAWA,OAAO,QAAQ;AACf,OAAO,UAAU;AA4DjB,SAAS,UAAU,KAAW;AAC5B,MAAI;AACJ,MAAI;AACF,aAAS,KAAK,MAAM,GAAG;EACzB,QAAQ;AACN,WAAO;EACT;AACA,MAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,MAAM,QAAQ,MAAM,GAAG;AAC1E,WAAO;EACT;AACA,QAAM,YAAY;AAClB,QAAM,EAAE,IAAI,OAAO,YAAY,YAAW,IAAK;AAC/C,MACE,OAAO,OAAO,YACd,OAAO,UAAU,YACjB,OAAO,eAAe,YAC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