@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,250 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computeContentFieldUtilization
|
|
3
|
-
} from "./chunk-R23CSHGI.js";
|
|
4
|
-
import {
|
|
5
|
-
computeMetadataCoverage,
|
|
6
|
-
groupItemsByDimension,
|
|
7
|
-
lifecycleClassifierFromStatusRegistry
|
|
8
|
-
} from "./chunk-RX3HQSYG.js";
|
|
9
|
-
import {
|
|
10
|
-
enforceHistoryStreamPolicyForItems,
|
|
11
|
-
listAllFrontMatterLight,
|
|
12
|
-
listAllFrontMatterWithBody
|
|
13
|
-
} from "./chunk-3U3VEWK6.js";
|
|
14
|
-
import "./chunk-EZFKWSC7.js";
|
|
15
|
-
import {
|
|
16
|
-
nowIso
|
|
17
|
-
} from "./chunk-DRBV5UC2.js";
|
|
18
|
-
import {
|
|
19
|
-
PmCliError,
|
|
20
|
-
getActiveExtensionRegistrations,
|
|
21
|
-
readSettings,
|
|
22
|
-
runActiveOnReadHooks
|
|
23
|
-
} from "./chunk-P5YORJRH.js";
|
|
24
|
-
import "./chunk-7C2O74AE.js";
|
|
25
|
-
import {
|
|
26
|
-
EXIT_CODE,
|
|
27
|
-
getSettingsPath,
|
|
28
|
-
pathExists,
|
|
29
|
-
resolveItemTypeRegistry,
|
|
30
|
-
resolvePmRoot,
|
|
31
|
-
resolveRuntimeStatusRegistry
|
|
32
|
-
} from "./chunk-5VVUKE3U.js";
|
|
33
|
-
|
|
34
|
-
// dist/cli/commands/stats.js
|
|
35
|
-
import fs from "node:fs/promises";
|
|
36
|
-
import path from "node:path";
|
|
37
|
-
|
|
38
|
-
// dist/core/history/history-storage-stats.js
|
|
39
|
-
!(function() {
|
|
40
|
-
try {
|
|
41
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
42
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "7c6dc357-0d9e-5ea3-add4-1c441f70d41c");
|
|
43
|
-
} catch (e2) {
|
|
44
|
-
}
|
|
45
|
-
})();
|
|
46
|
-
function parseStreamStat(id, raw) {
|
|
47
|
-
const bytes = Buffer.byteLength(raw, "utf8");
|
|
48
|
-
let lines = 0;
|
|
49
|
-
let oldestTs = null;
|
|
50
|
-
let newestTs = null;
|
|
51
|
-
let oldestMs = Number.POSITIVE_INFINITY;
|
|
52
|
-
let newestMs = Number.NEGATIVE_INFINITY;
|
|
53
|
-
for (const rawLine of raw.split(/\r?\n/)) {
|
|
54
|
-
const trimmed = rawLine.trim();
|
|
55
|
-
if (trimmed === "") {
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
lines += 1;
|
|
59
|
-
let parsed;
|
|
60
|
-
try {
|
|
61
|
-
parsed = JSON.parse(trimmed);
|
|
62
|
-
} catch {
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
if (parsed === null || typeof parsed !== "object" || !("ts" in parsed) || typeof parsed["ts"] !== "string") {
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
const ts = parsed["ts"];
|
|
69
|
-
const ms = Date.parse(ts);
|
|
70
|
-
if (Number.isNaN(ms)) {
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
if (ms < oldestMs || ms === oldestMs && oldestTs !== null && ts < oldestTs) {
|
|
74
|
-
oldestMs = ms;
|
|
75
|
-
oldestTs = ts;
|
|
76
|
-
}
|
|
77
|
-
if (ms > newestMs || ms === newestMs && newestTs !== null && ts > newestTs) {
|
|
78
|
-
newestMs = ms;
|
|
79
|
-
newestTs = ts;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return { id, bytes, lines, oldest_ts: oldestTs, newest_ts: newestTs };
|
|
83
|
-
}
|
|
84
|
-
function computeHistoryStorageStats(streams, options) {
|
|
85
|
-
const rawTopN = options?.topN ?? 5;
|
|
86
|
-
const topN = Math.max(0, Math.floor(rawTopN));
|
|
87
|
-
const stats = streams.map(({ id, raw }) => parseStreamStat(id, raw));
|
|
88
|
-
let totalLines = 0;
|
|
89
|
-
let totalBytes = 0;
|
|
90
|
-
let oldestEntry = null;
|
|
91
|
-
let newestEntry = null;
|
|
92
|
-
let globalOldestMs = Number.POSITIVE_INFINITY;
|
|
93
|
-
let globalNewestMs = Number.NEGATIVE_INFINITY;
|
|
94
|
-
for (const stat of stats) {
|
|
95
|
-
totalLines += stat.lines;
|
|
96
|
-
totalBytes += stat.bytes;
|
|
97
|
-
if (stat.oldest_ts !== null) {
|
|
98
|
-
const ms = Date.parse(stat.oldest_ts);
|
|
99
|
-
if (ms < globalOldestMs || ms === globalOldestMs && oldestEntry !== null && stat.id < oldestEntry.id) {
|
|
100
|
-
globalOldestMs = ms;
|
|
101
|
-
oldestEntry = { id: stat.id, ts: stat.oldest_ts };
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
if (stat.newest_ts !== null) {
|
|
105
|
-
const ms = Date.parse(stat.newest_ts);
|
|
106
|
-
if (ms > globalNewestMs || ms === globalNewestMs && newestEntry !== null && stat.id < newestEntry.id) {
|
|
107
|
-
globalNewestMs = ms;
|
|
108
|
-
newestEntry = { id: stat.id, ts: stat.newest_ts };
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
const largestByBytes = topN === 0 ? [] : [...stats].sort((a, b) => b.bytes - a.bytes || a.id.localeCompare(b.id)).slice(0, topN);
|
|
113
|
-
const deepestByLines = topN === 0 ? [] : [...stats].sort((a, b) => b.lines - a.lines || a.id.localeCompare(b.id)).slice(0, topN);
|
|
114
|
-
return {
|
|
115
|
-
total_streams: streams.length,
|
|
116
|
-
total_lines: totalLines,
|
|
117
|
-
total_bytes: totalBytes,
|
|
118
|
-
largest_by_bytes: largestByBytes,
|
|
119
|
-
deepest_by_lines: deepestByLines,
|
|
120
|
-
oldest_entry: oldestEntry,
|
|
121
|
-
newest_entry: newestEntry
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// dist/cli/commands/stats.js
|
|
126
|
-
!(function() {
|
|
127
|
-
try {
|
|
128
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
129
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "ecc1d6fc-2fa3-5989-8649-e86649220299");
|
|
130
|
-
} catch (e2) {
|
|
131
|
-
}
|
|
132
|
-
})();
|
|
133
|
-
function zeroByType(itemTypes) {
|
|
134
|
-
return itemTypes.reduce((acc, value) => {
|
|
135
|
-
acc[value] = 0;
|
|
136
|
-
return acc;
|
|
137
|
-
}, {});
|
|
138
|
-
}
|
|
139
|
-
function zeroByStatus(statuses) {
|
|
140
|
-
return statuses.reduce((acc, value) => {
|
|
141
|
-
acc[value] = 0;
|
|
142
|
-
return acc;
|
|
143
|
-
}, {});
|
|
144
|
-
}
|
|
145
|
-
function countNonEmptyLines(raw) {
|
|
146
|
-
if (raw.trim().length === 0) {
|
|
147
|
-
return 0;
|
|
148
|
-
}
|
|
149
|
-
return raw.split(/\r?\n/u).filter((line) => line.trim().length > 0).length;
|
|
150
|
-
}
|
|
151
|
-
function isNotFoundError(error) {
|
|
152
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
153
|
-
}
|
|
154
|
-
async function readHistoryStreamContents(pmRoot) {
|
|
155
|
-
const historyDir = path.join(pmRoot, "history");
|
|
156
|
-
if (!await pathExists(historyDir)) {
|
|
157
|
-
return [];
|
|
158
|
-
}
|
|
159
|
-
await runActiveOnReadHooks({
|
|
160
|
-
path: historyDir,
|
|
161
|
-
scope: "project"
|
|
162
|
-
});
|
|
163
|
-
const historyFiles = (await fs.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((a, b) => a.localeCompare(b));
|
|
164
|
-
const streams = [];
|
|
165
|
-
for (const file of historyFiles) {
|
|
166
|
-
const historyPath = path.join(historyDir, file);
|
|
167
|
-
let raw;
|
|
168
|
-
try {
|
|
169
|
-
raw = await fs.readFile(historyPath, "utf8");
|
|
170
|
-
} catch (error) {
|
|
171
|
-
if (isNotFoundError(error)) {
|
|
172
|
-
continue;
|
|
173
|
-
}
|
|
174
|
-
throw error;
|
|
175
|
-
}
|
|
176
|
-
await runActiveOnReadHooks({
|
|
177
|
-
path: historyPath,
|
|
178
|
-
scope: "project"
|
|
179
|
-
});
|
|
180
|
-
streams.push({ id: file.slice(0, -".jsonl".length), raw });
|
|
181
|
-
}
|
|
182
|
-
return streams;
|
|
183
|
-
}
|
|
184
|
-
var _testOnly = {
|
|
185
|
-
zeroByType,
|
|
186
|
-
zeroByStatus,
|
|
187
|
-
countNonEmptyLines,
|
|
188
|
-
readHistoryStreamContents
|
|
189
|
-
};
|
|
190
|
-
async function runStats(global2, options = {}) {
|
|
191
|
-
const pmRoot = resolvePmRoot(process.cwd(), global2.path);
|
|
192
|
-
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
193
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
194
|
-
}
|
|
195
|
-
const settings = await readSettings(pmRoot);
|
|
196
|
-
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
197
|
-
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
198
|
-
const items = options.fieldUtilization ? await listAllFrontMatterWithBody(pmRoot, settings.item_format, typeRegistry.type_to_folder, void 0, settings.schema) : await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, void 0, settings.schema);
|
|
199
|
-
await enforceHistoryStreamPolicyForItems({
|
|
200
|
-
pmRoot,
|
|
201
|
-
settings,
|
|
202
|
-
itemIds: items.map((item) => item.id),
|
|
203
|
-
commandLabel: "stats"
|
|
204
|
-
});
|
|
205
|
-
const byType = zeroByType(typeRegistry.types);
|
|
206
|
-
const byStatus = zeroByStatus(statusRegistry.definitions.map((definition) => definition.id));
|
|
207
|
-
for (const item of items) {
|
|
208
|
-
byType[item.type] += 1;
|
|
209
|
-
byStatus[item.status] += 1;
|
|
210
|
-
}
|
|
211
|
-
const streams = await readHistoryStreamContents(pmRoot);
|
|
212
|
-
let historyEntries = 0;
|
|
213
|
-
for (const stream of streams) {
|
|
214
|
-
historyEntries += countNonEmptyLines(stream.raw);
|
|
215
|
-
}
|
|
216
|
-
const storage = options.storage ? computeHistoryStorageStats(streams) : void 0;
|
|
217
|
-
const classifier = lifecycleClassifierFromStatusRegistry(statusRegistry);
|
|
218
|
-
const metadataCoverage = options.metadataCoverage ? computeMetadataCoverage(items, classifier) : void 0;
|
|
219
|
-
const breakdowns = {};
|
|
220
|
-
if (options.byAssignee) {
|
|
221
|
-
breakdowns.assignee = groupItemsByDimension(items, "assignee", classifier);
|
|
222
|
-
}
|
|
223
|
-
if (options.byTag) {
|
|
224
|
-
breakdowns.tag = groupItemsByDimension(items, "tag", classifier, { tagPrefix: options.tagPrefix });
|
|
225
|
-
}
|
|
226
|
-
if (options.byPriority) {
|
|
227
|
-
breakdowns.priority = groupItemsByDimension(items, "priority", classifier);
|
|
228
|
-
}
|
|
229
|
-
const hasBreakdowns = Object.keys(breakdowns).length > 0;
|
|
230
|
-
const fieldUtilization = options.fieldUtilization ? computeContentFieldUtilization(items) : void 0;
|
|
231
|
-
return {
|
|
232
|
-
totals: {
|
|
233
|
-
items: items.length,
|
|
234
|
-
history_streams: streams.length,
|
|
235
|
-
history_entries: historyEntries
|
|
236
|
-
},
|
|
237
|
-
by_type: byType,
|
|
238
|
-
by_status: byStatus,
|
|
239
|
-
...metadataCoverage ? { metadata_coverage: metadataCoverage } : {},
|
|
240
|
-
...hasBreakdowns ? { breakdowns } : {},
|
|
241
|
-
...storage ? { storage } : {},
|
|
242
|
-
...fieldUtilization ? { field_utilization: fieldUtilization } : {},
|
|
243
|
-
generated_at: nowIso()
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
export {
|
|
247
|
-
_testOnly,
|
|
248
|
-
runStats
|
|
249
|
-
};
|
|
250
|
-
//# sourceMappingURL=stats-IJYTRQGV.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../../cli/commands/stats.ts", "../../../../../../../../core/history/history-storage-stats.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @module cli/commands/stats\n *\n * Implements the pm stats command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { getActiveExtensionRegistrations, runActiveOnReadHooks } from \"../../core/extensions/index.js\";\nimport {\n computeContentFieldUtilization,\n type ContentFieldUtilizationReport,\n} from \"../../core/governance/content-fields.js\";\nimport {\n computeMetadataCoverage,\n groupItemsByDimension,\n lifecycleClassifierFromStatusRegistry,\n type GroupedBreakdown,\n type MetadataCoverageReport,\n} from \"../../core/governance/metadata-coverage.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { enforceHistoryStreamPolicyForItems } from \"../../core/history/history-stream-policy.js\";\nimport { computeHistoryStorageStats, type HistoryStorageStats } from \"../../core/history/history-storage-stats.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\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 { nowIso } from \"../../core/shared/time.js\";\nimport { listAllFrontMatterLight, listAllFrontMatterWithBody } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemStatus, ItemType } from \"../../types/index.js\";\n\n/**\n * Documents the stats command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface StatsCommandOptions {\n /** Include aggregate per-stream history storage metrics (sizes, depth, oldest/newest). */\n storage?: boolean;\n /** Include metadata coverage percentages (AC, estimates, resolution, tags, parent) overall and by type. */\n metadataCoverage?: boolean;\n /** Include a lifecycle-bucketed breakdown grouped by assignee. */\n byAssignee?: boolean;\n /** Include a lifecycle-bucketed breakdown grouped by tag (optionally filtered by --tag-prefix). */\n byTag?: boolean;\n /** Include a lifecycle-bucketed breakdown grouped by priority. */\n byPriority?: boolean;\n /** With --by-tag: only consider tags starting with this prefix (e.g. \"domain:\"). */\n tagPrefix?: string;\n /** Include a content-field utilization breakdown (notes/learnings/files/docs/tests/comments/deps/body usage rates). */\n fieldUtilization?: boolean;\n}\n\n/**\n * Documents the stats result payload exchanged by command, SDK, and package integrations.\n */\nexport interface StatsResult {\n totals: {\n items: number;\n history_streams: number;\n history_entries: number;\n };\n by_type: Record<ItemType, number>;\n by_status: Record<ItemStatus, number>;\n /** Present only with --metadata-coverage: per-field coverage overall and by type. */\n metadata_coverage?: MetadataCoverageReport;\n /** Present only with --by-assignee/--by-tag/--by-priority: lifecycle-bucketed group breakdowns. */\n breakdowns?: {\n assignee?: GroupedBreakdown;\n tag?: GroupedBreakdown;\n priority?: GroupedBreakdown;\n };\n /** Present only with --storage: aggregate history-stream metrics for compaction/planning. */\n storage?: HistoryStorageStats;\n /** Present only with --field-utilization: content-field utilization rates across all items. */\n field_utilization?: ContentFieldUtilizationReport;\n generated_at: string;\n}\n\nfunction zeroByType(itemTypes: string[]): Record<ItemType, number> {\n return itemTypes.reduce(\n (acc, value) => {\n acc[value] = 0;\n return acc;\n },\n {} as Record<ItemType, number>,\n );\n}\n\nfunction zeroByStatus(statuses: string[]): Record<ItemStatus, number> {\n return statuses.reduce(\n (acc, value) => {\n acc[value] = 0;\n return acc;\n },\n {} as Record<ItemStatus, number>,\n );\n}\n\nfunction countNonEmptyLines(raw: string): number {\n if (raw.trim().length === 0) {\n return 0;\n }\n return raw\n .split(/\\r?\\n/u)\n .filter((line) => line.trim().length > 0)\n .length;\n}\n\nfunction isNotFoundError(error: unknown): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: unknown }).code === \"ENOENT\";\n}\n\nasync function readHistoryStreamContents(pmRoot: string): Promise<Array<{ id: string; raw: string }>> {\n const historyDir = path.join(pmRoot, \"history\");\n if (!(await pathExists(historyDir))) {\n return [];\n }\n\n await runActiveOnReadHooks({\n path: historyDir,\n scope: \"project\",\n });\n const historyFiles = (await fs.readdir(historyDir))\n .filter((entry) => entry.endsWith(\".jsonl\"))\n .sort((a, b) => a.localeCompare(b));\n\n const streams: Array<{ id: string; raw: string }> = [];\n for (const file of historyFiles) {\n const historyPath = path.join(historyDir, file);\n let raw: string;\n try {\n raw = await fs.readFile(historyPath, \"utf8\");\n } catch (error) {\n if (isNotFoundError(error)) {\n continue;\n }\n throw error;\n }\n await runActiveOnReadHooks({\n path: historyPath,\n scope: \"project\",\n });\n streams.push({ id: file.slice(0, -\".jsonl\".length), raw });\n }\n\n return streams;\n}\n\nexport const _testOnly = {\n zeroByType,\n zeroByStatus,\n countNonEmptyLines,\n readHistoryStreamContents,\n};\n\n/**\n * Implements run stats for the public runtime surface of this module.\n */\nexport async function runStats(global: GlobalOptions, options: StatsCommandOptions = {}): Promise<StatsResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n // Field utilization needs the heavy collections (notes/learnings/files/docs/\n // tests/comments/deps) AND the body, which the light reader drops — so when it\n // is requested we read the WithBody rows and use them for every section.\n const items = options.fieldUtilization\n ? await listAllFrontMatterWithBody(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema)\n : await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);\n await enforceHistoryStreamPolicyForItems({\n pmRoot,\n settings,\n itemIds: items.map((item) => item.id),\n commandLabel: \"stats\",\n });\n\n const byType = zeroByType(typeRegistry.types);\n const byStatus = zeroByStatus(statusRegistry.definitions.map((definition) => definition.id));\n // zeroByType/zeroByStatus pre-seed a bucket for every registry type/status, and\n // the light front-matter reader drops any item whose type/status falls outside\n // the active registry (parse rejects them) — so every item's bucket is already\n // present here and no on-the-fly initialization is reachable.\n for (const item of items) {\n byType[item.type] += 1;\n byStatus[item.status] += 1;\n }\n\n const streams = await readHistoryStreamContents(pmRoot);\n let historyEntries = 0;\n for (const stream of streams) {\n historyEntries += countNonEmptyLines(stream.raw);\n }\n const storage = options.storage ? computeHistoryStorageStats(streams) : undefined;\n\n const classifier = lifecycleClassifierFromStatusRegistry(statusRegistry);\n const metadataCoverage = options.metadataCoverage ? computeMetadataCoverage(items, classifier) : undefined;\n const breakdowns: NonNullable<StatsResult[\"breakdowns\"]> = {};\n if (options.byAssignee) {\n breakdowns.assignee = groupItemsByDimension(items, \"assignee\", classifier);\n }\n if (options.byTag) {\n breakdowns.tag = groupItemsByDimension(items, \"tag\", classifier, { tagPrefix: options.tagPrefix });\n }\n if (options.byPriority) {\n breakdowns.priority = groupItemsByDimension(items, \"priority\", classifier);\n }\n const hasBreakdowns = Object.keys(breakdowns).length > 0;\n const fieldUtilization = options.fieldUtilization ? computeContentFieldUtilization(items) : undefined;\n\n return {\n totals: {\n items: items.length,\n history_streams: streams.length,\n history_entries: historyEntries,\n },\n by_type: byType,\n by_status: byStatus,\n ...(metadataCoverage ? { metadata_coverage: metadataCoverage } : {}),\n ...(hasBreakdowns ? { breakdowns } : {}),\n ...(storage ? { storage } : {}),\n ...(fieldUtilization ? { field_utilization: fieldUtilization } : {}),\n generated_at: nowIso(),\n };\n}\n", "/**\n * Pure aggregate metrics for history streams (JSONL files).\n * No filesystem access — callers read raw stream contents and pass them in.\n * This module has no Node imports; Buffer is available as a global.\n */\n\n/** Per-history-stream size and timestamp summary used by storage diagnostics. */\nexport interface HistoryStreamStat {\n id: string;\n bytes: number;\n lines: number; // non-empty JSONL entry count\n oldest_ts: string | null; // min parseable ts in this stream, else null\n newest_ts: string | null; // max parseable ts in this stream, else null\n}\n\n/**\n * Documents the history storage entry ref payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryStorageEntryRef {\n id: string;\n ts: string;\n}\n\n/**\n * Documents the history storage stats payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryStorageStats {\n total_streams: number;\n total_lines: number;\n total_bytes: number;\n largest_by_bytes: HistoryStreamStat[]; // top-N desc by bytes, tie-break id asc\n deepest_by_lines: HistoryStreamStat[]; // top-N desc by lines, tie-break id asc\n oldest_entry: HistoryStorageEntryRef | null; // global min ts across all streams\n newest_entry: HistoryStorageEntryRef | null; // global max ts across all streams\n}\n\nfunction parseStreamStat(id: string, raw: string): HistoryStreamStat {\n const bytes = Buffer.byteLength(raw, \"utf8\");\n\n let lines = 0;\n let oldestTs: string | null = null;\n let newestTs: string | null = null;\n let oldestMs = Number.POSITIVE_INFINITY;\n let newestMs = Number.NEGATIVE_INFINITY;\n\n for (const rawLine of raw.split(/\\r?\\n/)) {\n const trimmed = rawLine.trim();\n if (trimmed === \"\") {\n continue;\n }\n lines += 1;\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed);\n } catch {\n continue;\n }\n\n if (\n parsed === null ||\n typeof parsed !== \"object\" ||\n !(\"ts\" in (parsed as object)) ||\n typeof (parsed as Record<string, unknown>)[\"ts\"] !== \"string\"\n ) {\n continue;\n }\n\n const ts = (parsed as Record<string, unknown>)[\"ts\"] as string;\n const ms = Date.parse(ts);\n if (Number.isNaN(ms)) {\n continue;\n }\n\n if (ms < oldestMs || (ms === oldestMs && oldestTs !== null && ts < oldestTs)) {\n oldestMs = ms;\n oldestTs = ts;\n }\n if (ms > newestMs || (ms === newestMs && newestTs !== null && ts > newestTs)) {\n newestMs = ms;\n newestTs = ts;\n }\n }\n\n return { id, bytes, lines, oldest_ts: oldestTs, newest_ts: newestTs };\n}\n\n/**\n * Implements compute history storage stats for the public runtime surface of this module.\n */\nexport function computeHistoryStorageStats(\n streams: Array<{ id: string; raw: string }>,\n options?: { topN?: number },\n): HistoryStorageStats {\n const rawTopN = options?.topN ?? 5;\n const topN = Math.max(0, Math.floor(rawTopN));\n\n const stats: HistoryStreamStat[] = streams.map(({ id, raw }) => parseStreamStat(id, raw));\n\n let totalLines = 0;\n let totalBytes = 0;\n let oldestEntry: HistoryStorageEntryRef | null = null;\n let newestEntry: HistoryStorageEntryRef | null = null;\n let globalOldestMs = Number.POSITIVE_INFINITY;\n let globalNewestMs = Number.NEGATIVE_INFINITY;\n\n for (const stat of stats) {\n totalLines += stat.lines;\n totalBytes += stat.bytes;\n\n if (stat.oldest_ts !== null) {\n const ms = Date.parse(stat.oldest_ts);\n if (\n ms < globalOldestMs ||\n (ms === globalOldestMs && oldestEntry !== null && stat.id < oldestEntry.id)\n ) {\n globalOldestMs = ms;\n oldestEntry = { id: stat.id, ts: stat.oldest_ts };\n }\n }\n\n if (stat.newest_ts !== null) {\n const ms = Date.parse(stat.newest_ts);\n if (\n ms > globalNewestMs ||\n (ms === globalNewestMs && newestEntry !== null && stat.id < newestEntry.id)\n ) {\n globalNewestMs = ms;\n newestEntry = { id: stat.id, ts: stat.newest_ts };\n }\n }\n }\n\n const largestByBytes =\n topN === 0\n ? []\n : [...stats]\n .sort((a, b) => b.bytes - a.bytes || a.id.localeCompare(b.id))\n .slice(0, topN);\n\n const deepestByLines =\n topN === 0\n ? []\n : [...stats]\n .sort((a, b) => b.lines - a.lines || a.id.localeCompare(b.id))\n .slice(0, topN);\n\n return {\n total_streams: streams.length,\n total_lines: totalLines,\n total_bytes: totalBytes,\n largest_by_bytes: largestByBytes,\n deepest_by_lines: deepestByLines,\n oldest_entry: oldestEntry,\n newest_entry: newestEntry,\n };\n}\n"],
|
|
5
|
-
"mappings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tB,eAAW,WAAW,sBAAsB,OAAO,YAAY,UAAU;EAC3E;AACA,QAAM,gBAAgB,OAAO,KAAK,UAAU,EAAE,SAAS;AACvD,QAAM,mBAAmB,QAAQ,mBAAmB,+BAA+B,KAAK,IAAI;AAE5F,SAAO;IACL,QAAQ;MACN,OAAO,MAAM;MACb,iBAAiB,QAAQ;MACzB,iBAAiB;;IAEnB,SAAS;IACT,WAAW;IACX,GAAI,mBAAmB,EAAE,mBAAmB,iBAAgB,IAAK,CAAA;IACjE,GAAI,gBAAgB,EAAE,WAAU,IAAK,CAAA;IACrC,GAAI,UAAU,EAAE,QAAO,IAAK,CAAA;IAC5B,GAAI,mBAAmB,EAAE,mBAAmB,iBAAgB,IAAK,CAAA;IACjE,cAAc,OAAM;;AAExB;",
|
|
6
|
-
"names": ["global"]
|
|
7
|
-
}
|
|
@@ -1,240 +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]="fb69c821-7bb6-5b15-8cd2-319f496f077e")}catch(e){}}();
|
|
3
|
-
import {
|
|
4
|
-
computeContentFieldUtilization
|
|
5
|
-
} from "./chunk-QB7XMHJW.js";
|
|
6
|
-
import {
|
|
7
|
-
computeMetadataCoverage,
|
|
8
|
-
groupItemsByDimension,
|
|
9
|
-
lifecycleClassifierFromStatusRegistry
|
|
10
|
-
} from "./chunk-5JE6SMYS.js";
|
|
11
|
-
import {
|
|
12
|
-
enforceHistoryStreamPolicyForItems,
|
|
13
|
-
listAllFrontMatterLight,
|
|
14
|
-
listAllFrontMatterWithBody
|
|
15
|
-
} from "./chunk-57C2RLW5.js";
|
|
16
|
-
import "./chunk-HK72NWAD.js";
|
|
17
|
-
import {
|
|
18
|
-
nowIso
|
|
19
|
-
} from "./chunk-FJRKQREY.js";
|
|
20
|
-
import {
|
|
21
|
-
PmCliError,
|
|
22
|
-
getActiveExtensionRegistrations,
|
|
23
|
-
readSettings,
|
|
24
|
-
runActiveOnReadHooks
|
|
25
|
-
} from "./chunk-US3T3W5J.js";
|
|
26
|
-
import "./chunk-NNHHXJB2.js";
|
|
27
|
-
import {
|
|
28
|
-
EXIT_CODE,
|
|
29
|
-
getSettingsPath,
|
|
30
|
-
pathExists,
|
|
31
|
-
resolveItemTypeRegistry,
|
|
32
|
-
resolvePmRoot,
|
|
33
|
-
resolveRuntimeStatusRegistry
|
|
34
|
-
} from "./chunk-YD5FML7K.js";
|
|
35
|
-
|
|
36
|
-
// dist/cli/commands/stats.js
|
|
37
|
-
import fs from "node:fs/promises";
|
|
38
|
-
import path from "node:path";
|
|
39
|
-
|
|
40
|
-
// dist/core/history/history-storage-stats.js
|
|
41
|
-
function parseStreamStat(id, raw) {
|
|
42
|
-
const bytes = Buffer.byteLength(raw, "utf8");
|
|
43
|
-
let lines = 0;
|
|
44
|
-
let oldestTs = null;
|
|
45
|
-
let newestTs = null;
|
|
46
|
-
let oldestMs = Number.POSITIVE_INFINITY;
|
|
47
|
-
let newestMs = Number.NEGATIVE_INFINITY;
|
|
48
|
-
for (const rawLine of raw.split(/\r?\n/)) {
|
|
49
|
-
const trimmed = rawLine.trim();
|
|
50
|
-
if (trimmed === "") {
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
lines += 1;
|
|
54
|
-
let parsed;
|
|
55
|
-
try {
|
|
56
|
-
parsed = JSON.parse(trimmed);
|
|
57
|
-
} catch {
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
if (parsed === null || typeof parsed !== "object" || !("ts" in parsed) || typeof parsed["ts"] !== "string") {
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
const ts = parsed["ts"];
|
|
64
|
-
const ms = Date.parse(ts);
|
|
65
|
-
if (Number.isNaN(ms)) {
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
if (ms < oldestMs || ms === oldestMs && oldestTs !== null && ts < oldestTs) {
|
|
69
|
-
oldestMs = ms;
|
|
70
|
-
oldestTs = ts;
|
|
71
|
-
}
|
|
72
|
-
if (ms > newestMs || ms === newestMs && newestTs !== null && ts > newestTs) {
|
|
73
|
-
newestMs = ms;
|
|
74
|
-
newestTs = ts;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return { id, bytes, lines, oldest_ts: oldestTs, newest_ts: newestTs };
|
|
78
|
-
}
|
|
79
|
-
function computeHistoryStorageStats(streams, options) {
|
|
80
|
-
const rawTopN = options?.topN ?? 5;
|
|
81
|
-
const topN = Math.max(0, Math.floor(rawTopN));
|
|
82
|
-
const stats = streams.map(({ id, raw }) => parseStreamStat(id, raw));
|
|
83
|
-
let totalLines = 0;
|
|
84
|
-
let totalBytes = 0;
|
|
85
|
-
let oldestEntry = null;
|
|
86
|
-
let newestEntry = null;
|
|
87
|
-
let globalOldestMs = Number.POSITIVE_INFINITY;
|
|
88
|
-
let globalNewestMs = Number.NEGATIVE_INFINITY;
|
|
89
|
-
for (const stat of stats) {
|
|
90
|
-
totalLines += stat.lines;
|
|
91
|
-
totalBytes += stat.bytes;
|
|
92
|
-
if (stat.oldest_ts !== null) {
|
|
93
|
-
const ms = Date.parse(stat.oldest_ts);
|
|
94
|
-
if (ms < globalOldestMs || ms === globalOldestMs && oldestEntry !== null && stat.id < oldestEntry.id) {
|
|
95
|
-
globalOldestMs = ms;
|
|
96
|
-
oldestEntry = { id: stat.id, ts: stat.oldest_ts };
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
if (stat.newest_ts !== null) {
|
|
100
|
-
const ms = Date.parse(stat.newest_ts);
|
|
101
|
-
if (ms > globalNewestMs || ms === globalNewestMs && newestEntry !== null && stat.id < newestEntry.id) {
|
|
102
|
-
globalNewestMs = ms;
|
|
103
|
-
newestEntry = { id: stat.id, ts: stat.newest_ts };
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
const largestByBytes = topN === 0 ? [] : [...stats].sort((a, b) => b.bytes - a.bytes || a.id.localeCompare(b.id)).slice(0, topN);
|
|
108
|
-
const deepestByLines = topN === 0 ? [] : [...stats].sort((a, b) => b.lines - a.lines || a.id.localeCompare(b.id)).slice(0, topN);
|
|
109
|
-
return {
|
|
110
|
-
total_streams: streams.length,
|
|
111
|
-
total_lines: totalLines,
|
|
112
|
-
total_bytes: totalBytes,
|
|
113
|
-
largest_by_bytes: largestByBytes,
|
|
114
|
-
deepest_by_lines: deepestByLines,
|
|
115
|
-
oldest_entry: oldestEntry,
|
|
116
|
-
newest_entry: newestEntry
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// dist/cli/commands/stats.js
|
|
121
|
-
function zeroByType(itemTypes) {
|
|
122
|
-
return itemTypes.reduce((acc, value) => {
|
|
123
|
-
acc[value] = 0;
|
|
124
|
-
return acc;
|
|
125
|
-
}, {});
|
|
126
|
-
}
|
|
127
|
-
function zeroByStatus(statuses) {
|
|
128
|
-
return statuses.reduce((acc, value) => {
|
|
129
|
-
acc[value] = 0;
|
|
130
|
-
return acc;
|
|
131
|
-
}, {});
|
|
132
|
-
}
|
|
133
|
-
function countNonEmptyLines(raw) {
|
|
134
|
-
if (raw.trim().length === 0) {
|
|
135
|
-
return 0;
|
|
136
|
-
}
|
|
137
|
-
return raw.split(/\r?\n/u).filter((line) => line.trim().length > 0).length;
|
|
138
|
-
}
|
|
139
|
-
function isNotFoundError(error) {
|
|
140
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
141
|
-
}
|
|
142
|
-
async function readHistoryStreamContents(pmRoot) {
|
|
143
|
-
const historyDir = path.join(pmRoot, "history");
|
|
144
|
-
if (!await pathExists(historyDir)) {
|
|
145
|
-
return [];
|
|
146
|
-
}
|
|
147
|
-
await runActiveOnReadHooks({
|
|
148
|
-
path: historyDir,
|
|
149
|
-
scope: "project"
|
|
150
|
-
});
|
|
151
|
-
const historyFiles = (await fs.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((a, b) => a.localeCompare(b));
|
|
152
|
-
const streams = [];
|
|
153
|
-
for (const file of historyFiles) {
|
|
154
|
-
const historyPath = path.join(historyDir, file);
|
|
155
|
-
let raw;
|
|
156
|
-
try {
|
|
157
|
-
raw = await fs.readFile(historyPath, "utf8");
|
|
158
|
-
} catch (error) {
|
|
159
|
-
if (isNotFoundError(error)) {
|
|
160
|
-
continue;
|
|
161
|
-
}
|
|
162
|
-
throw error;
|
|
163
|
-
}
|
|
164
|
-
await runActiveOnReadHooks({
|
|
165
|
-
path: historyPath,
|
|
166
|
-
scope: "project"
|
|
167
|
-
});
|
|
168
|
-
streams.push({ id: file.slice(0, -".jsonl".length), raw });
|
|
169
|
-
}
|
|
170
|
-
return streams;
|
|
171
|
-
}
|
|
172
|
-
var _testOnly = {
|
|
173
|
-
zeroByType,
|
|
174
|
-
zeroByStatus,
|
|
175
|
-
countNonEmptyLines,
|
|
176
|
-
readHistoryStreamContents
|
|
177
|
-
};
|
|
178
|
-
async function runStats(global, options = {}) {
|
|
179
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
180
|
-
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
181
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
182
|
-
}
|
|
183
|
-
const settings = await readSettings(pmRoot);
|
|
184
|
-
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
185
|
-
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
186
|
-
const items = options.fieldUtilization ? await listAllFrontMatterWithBody(pmRoot, settings.item_format, typeRegistry.type_to_folder, void 0, settings.schema) : await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, void 0, settings.schema);
|
|
187
|
-
await enforceHistoryStreamPolicyForItems({
|
|
188
|
-
pmRoot,
|
|
189
|
-
settings,
|
|
190
|
-
itemIds: items.map((item) => item.id),
|
|
191
|
-
commandLabel: "stats"
|
|
192
|
-
});
|
|
193
|
-
const byType = zeroByType(typeRegistry.types);
|
|
194
|
-
const byStatus = zeroByStatus(statusRegistry.definitions.map((definition) => definition.id));
|
|
195
|
-
for (const item of items) {
|
|
196
|
-
byType[item.type] += 1;
|
|
197
|
-
byStatus[item.status] += 1;
|
|
198
|
-
}
|
|
199
|
-
const streams = await readHistoryStreamContents(pmRoot);
|
|
200
|
-
let historyEntries = 0;
|
|
201
|
-
for (const stream of streams) {
|
|
202
|
-
historyEntries += countNonEmptyLines(stream.raw);
|
|
203
|
-
}
|
|
204
|
-
const storage = options.storage ? computeHistoryStorageStats(streams) : void 0;
|
|
205
|
-
const classifier = lifecycleClassifierFromStatusRegistry(statusRegistry);
|
|
206
|
-
const metadataCoverage = options.metadataCoverage ? computeMetadataCoverage(items, classifier) : void 0;
|
|
207
|
-
const breakdowns = {};
|
|
208
|
-
if (options.byAssignee) {
|
|
209
|
-
breakdowns.assignee = groupItemsByDimension(items, "assignee", classifier);
|
|
210
|
-
}
|
|
211
|
-
if (options.byTag) {
|
|
212
|
-
breakdowns.tag = groupItemsByDimension(items, "tag", classifier, { tagPrefix: options.tagPrefix });
|
|
213
|
-
}
|
|
214
|
-
if (options.byPriority) {
|
|
215
|
-
breakdowns.priority = groupItemsByDimension(items, "priority", classifier);
|
|
216
|
-
}
|
|
217
|
-
const hasBreakdowns = Object.keys(breakdowns).length > 0;
|
|
218
|
-
const fieldUtilization = options.fieldUtilization ? computeContentFieldUtilization(items) : void 0;
|
|
219
|
-
return {
|
|
220
|
-
totals: {
|
|
221
|
-
items: items.length,
|
|
222
|
-
history_streams: streams.length,
|
|
223
|
-
history_entries: historyEntries
|
|
224
|
-
},
|
|
225
|
-
by_type: byType,
|
|
226
|
-
by_status: byStatus,
|
|
227
|
-
...metadataCoverage ? { metadata_coverage: metadataCoverage } : {},
|
|
228
|
-
...hasBreakdowns ? { breakdowns } : {},
|
|
229
|
-
...storage ? { storage } : {},
|
|
230
|
-
...fieldUtilization ? { field_utilization: fieldUtilization } : {},
|
|
231
|
-
generated_at: nowIso()
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
export {
|
|
235
|
-
_testOnly,
|
|
236
|
-
runStats
|
|
237
|
-
};
|
|
238
|
-
//# sourceMappingURL=stats-L2D5Y2O5.js.map
|
|
239
|
-
|
|
240
|
-
//# debugId=fb69c821-7bb6-5b15-8cd2-319f496f077e
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/stats.ts","../../../../../../../../core/history/history-storage-stats.ts"],"sourcesContent":["/**\n * @module cli/commands/stats\n *\n * Implements the pm stats command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { getActiveExtensionRegistrations, runActiveOnReadHooks } from \"../../core/extensions/index.js\";\nimport {\n computeContentFieldUtilization,\n type ContentFieldUtilizationReport,\n} from \"../../core/governance/content-fields.js\";\nimport {\n computeMetadataCoverage,\n groupItemsByDimension,\n lifecycleClassifierFromStatusRegistry,\n type GroupedBreakdown,\n type MetadataCoverageReport,\n} from \"../../core/governance/metadata-coverage.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { enforceHistoryStreamPolicyForItems } from \"../../core/history/history-stream-policy.js\";\nimport { computeHistoryStorageStats, type HistoryStorageStats } from \"../../core/history/history-storage-stats.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\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 { nowIso } from \"../../core/shared/time.js\";\nimport { listAllFrontMatterLight, listAllFrontMatterWithBody } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemStatus, ItemType } from \"../../types/index.js\";\n\n/**\n * Documents the stats command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface StatsCommandOptions {\n /** Include aggregate per-stream history storage metrics (sizes, depth, oldest/newest). */\n storage?: boolean;\n /** Include metadata coverage percentages (AC, estimates, resolution, tags, parent) overall and by type. */\n metadataCoverage?: boolean;\n /** Include a lifecycle-bucketed breakdown grouped by assignee. */\n byAssignee?: boolean;\n /** Include a lifecycle-bucketed breakdown grouped by tag (optionally filtered by --tag-prefix). */\n byTag?: boolean;\n /** Include a lifecycle-bucketed breakdown grouped by priority. */\n byPriority?: boolean;\n /** With --by-tag: only consider tags starting with this prefix (e.g. \"domain:\"). */\n tagPrefix?: string;\n /** Include a content-field utilization breakdown (notes/learnings/files/docs/tests/comments/deps/body usage rates). */\n fieldUtilization?: boolean;\n}\n\n/**\n * Documents the stats result payload exchanged by command, SDK, and package integrations.\n */\nexport interface StatsResult {\n totals: {\n items: number;\n history_streams: number;\n history_entries: number;\n };\n by_type: Record<ItemType, number>;\n by_status: Record<ItemStatus, number>;\n /** Present only with --metadata-coverage: per-field coverage overall and by type. */\n metadata_coverage?: MetadataCoverageReport;\n /** Present only with --by-assignee/--by-tag/--by-priority: lifecycle-bucketed group breakdowns. */\n breakdowns?: {\n assignee?: GroupedBreakdown;\n tag?: GroupedBreakdown;\n priority?: GroupedBreakdown;\n };\n /** Present only with --storage: aggregate history-stream metrics for compaction/planning. */\n storage?: HistoryStorageStats;\n /** Present only with --field-utilization: content-field utilization rates across all items. */\n field_utilization?: ContentFieldUtilizationReport;\n generated_at: string;\n}\n\nfunction zeroByType(itemTypes: string[]): Record<ItemType, number> {\n return itemTypes.reduce(\n (acc, value) => {\n acc[value] = 0;\n return acc;\n },\n {} as Record<ItemType, number>,\n );\n}\n\nfunction zeroByStatus(statuses: string[]): Record<ItemStatus, number> {\n return statuses.reduce(\n (acc, value) => {\n acc[value] = 0;\n return acc;\n },\n {} as Record<ItemStatus, number>,\n );\n}\n\nfunction countNonEmptyLines(raw: string): number {\n if (raw.trim().length === 0) {\n return 0;\n }\n return raw\n .split(/\\r?\\n/u)\n .filter((line) => line.trim().length > 0)\n .length;\n}\n\nfunction isNotFoundError(error: unknown): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: unknown }).code === \"ENOENT\";\n}\n\nasync function readHistoryStreamContents(pmRoot: string): Promise<Array<{ id: string; raw: string }>> {\n const historyDir = path.join(pmRoot, \"history\");\n if (!(await pathExists(historyDir))) {\n return [];\n }\n\n await runActiveOnReadHooks({\n path: historyDir,\n scope: \"project\",\n });\n const historyFiles = (await fs.readdir(historyDir))\n .filter((entry) => entry.endsWith(\".jsonl\"))\n .sort((a, b) => a.localeCompare(b));\n\n const streams: Array<{ id: string; raw: string }> = [];\n for (const file of historyFiles) {\n const historyPath = path.join(historyDir, file);\n let raw: string;\n try {\n raw = await fs.readFile(historyPath, \"utf8\");\n } catch (error) {\n if (isNotFoundError(error)) {\n continue;\n }\n throw error;\n }\n await runActiveOnReadHooks({\n path: historyPath,\n scope: \"project\",\n });\n streams.push({ id: file.slice(0, -\".jsonl\".length), raw });\n }\n\n return streams;\n}\n\nexport const _testOnly = {\n zeroByType,\n zeroByStatus,\n countNonEmptyLines,\n readHistoryStreamContents,\n};\n\n/**\n * Implements run stats for the public runtime surface of this module.\n */\nexport async function runStats(global: GlobalOptions, options: StatsCommandOptions = {}): Promise<StatsResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n // Field utilization needs the heavy collections (notes/learnings/files/docs/\n // tests/comments/deps) AND the body, which the light reader drops — so when it\n // is requested we read the WithBody rows and use them for every section.\n const items = options.fieldUtilization\n ? await listAllFrontMatterWithBody(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema)\n : await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);\n await enforceHistoryStreamPolicyForItems({\n pmRoot,\n settings,\n itemIds: items.map((item) => item.id),\n commandLabel: \"stats\",\n });\n\n const byType = zeroByType(typeRegistry.types);\n const byStatus = zeroByStatus(statusRegistry.definitions.map((definition) => definition.id));\n // zeroByType/zeroByStatus pre-seed a bucket for every registry type/status, and\n // the light front-matter reader drops any item whose type/status falls outside\n // the active registry (parse rejects them) — so every item's bucket is already\n // present here and no on-the-fly initialization is reachable.\n for (const item of items) {\n byType[item.type] += 1;\n byStatus[item.status] += 1;\n }\n\n const streams = await readHistoryStreamContents(pmRoot);\n let historyEntries = 0;\n for (const stream of streams) {\n historyEntries += countNonEmptyLines(stream.raw);\n }\n const storage = options.storage ? computeHistoryStorageStats(streams) : undefined;\n\n const classifier = lifecycleClassifierFromStatusRegistry(statusRegistry);\n const metadataCoverage = options.metadataCoverage ? computeMetadataCoverage(items, classifier) : undefined;\n const breakdowns: NonNullable<StatsResult[\"breakdowns\"]> = {};\n if (options.byAssignee) {\n breakdowns.assignee = groupItemsByDimension(items, \"assignee\", classifier);\n }\n if (options.byTag) {\n breakdowns.tag = groupItemsByDimension(items, \"tag\", classifier, { tagPrefix: options.tagPrefix });\n }\n if (options.byPriority) {\n breakdowns.priority = groupItemsByDimension(items, \"priority\", classifier);\n }\n const hasBreakdowns = Object.keys(breakdowns).length > 0;\n const fieldUtilization = options.fieldUtilization ? computeContentFieldUtilization(items) : undefined;\n\n return {\n totals: {\n items: items.length,\n history_streams: streams.length,\n history_entries: historyEntries,\n },\n by_type: byType,\n by_status: byStatus,\n ...(metadataCoverage ? { metadata_coverage: metadataCoverage } : {}),\n ...(hasBreakdowns ? { breakdowns } : {}),\n ...(storage ? { storage } : {}),\n ...(fieldUtilization ? { field_utilization: fieldUtilization } : {}),\n generated_at: nowIso(),\n };\n}\n","/**\n * Pure aggregate metrics for history streams (JSONL files).\n * No filesystem access — callers read raw stream contents and pass them in.\n * This module has no Node imports; Buffer is available as a global.\n */\n\n/** Per-history-stream size and timestamp summary used by storage diagnostics. */\nexport interface HistoryStreamStat {\n id: string;\n bytes: number;\n lines: number; // non-empty JSONL entry count\n oldest_ts: string | null; // min parseable ts in this stream, else null\n newest_ts: string | null; // max parseable ts in this stream, else null\n}\n\n/**\n * Documents the history storage entry ref payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryStorageEntryRef {\n id: string;\n ts: string;\n}\n\n/**\n * Documents the history storage stats payload exchanged by command, SDK, and package integrations.\n */\nexport interface HistoryStorageStats {\n total_streams: number;\n total_lines: number;\n total_bytes: number;\n largest_by_bytes: HistoryStreamStat[]; // top-N desc by bytes, tie-break id asc\n deepest_by_lines: HistoryStreamStat[]; // top-N desc by lines, tie-break id asc\n oldest_entry: HistoryStorageEntryRef | null; // global min ts across all streams\n newest_entry: HistoryStorageEntryRef | null; // global max ts across all streams\n}\n\nfunction parseStreamStat(id: string, raw: string): HistoryStreamStat {\n const bytes = Buffer.byteLength(raw, \"utf8\");\n\n let lines = 0;\n let oldestTs: string | null = null;\n let newestTs: string | null = null;\n let oldestMs = Number.POSITIVE_INFINITY;\n let newestMs = Number.NEGATIVE_INFINITY;\n\n for (const rawLine of raw.split(/\\r?\\n/)) {\n const trimmed = rawLine.trim();\n if (trimmed === \"\") {\n continue;\n }\n lines += 1;\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed);\n } catch {\n continue;\n }\n\n if (\n parsed === null ||\n typeof parsed !== \"object\" ||\n !(\"ts\" in (parsed as object)) ||\n typeof (parsed as Record<string, unknown>)[\"ts\"] !== \"string\"\n ) {\n continue;\n }\n\n const ts = (parsed as Record<string, unknown>)[\"ts\"] as string;\n const ms = Date.parse(ts);\n if (Number.isNaN(ms)) {\n continue;\n }\n\n if (ms < oldestMs || (ms === oldestMs && oldestTs !== null && ts < oldestTs)) {\n oldestMs = ms;\n oldestTs = ts;\n }\n if (ms > newestMs || (ms === newestMs && newestTs !== null && ts > newestTs)) {\n newestMs = ms;\n newestTs = ts;\n }\n }\n\n return { id, bytes, lines, oldest_ts: oldestTs, newest_ts: newestTs };\n}\n\n/**\n * Implements compute history storage stats for the public runtime surface of this module.\n */\nexport function computeHistoryStorageStats(\n streams: Array<{ id: string; raw: string }>,\n options?: { topN?: number },\n): HistoryStorageStats {\n const rawTopN = options?.topN ?? 5;\n const topN = Math.max(0, Math.floor(rawTopN));\n\n const stats: HistoryStreamStat[] = streams.map(({ id, raw }) => parseStreamStat(id, raw));\n\n let totalLines = 0;\n let totalBytes = 0;\n let oldestEntry: HistoryStorageEntryRef | null = null;\n let newestEntry: HistoryStorageEntryRef | null = null;\n let globalOldestMs = Number.POSITIVE_INFINITY;\n let globalNewestMs = Number.NEGATIVE_INFINITY;\n\n for (const stat of stats) {\n totalLines += stat.lines;\n totalBytes += stat.bytes;\n\n if (stat.oldest_ts !== null) {\n const ms = Date.parse(stat.oldest_ts);\n if (\n ms < globalOldestMs ||\n (ms === globalOldestMs && oldestEntry !== null && stat.id < oldestEntry.id)\n ) {\n globalOldestMs = ms;\n oldestEntry = { id: stat.id, ts: stat.oldest_ts };\n }\n }\n\n if (stat.newest_ts !== null) {\n const ms = Date.parse(stat.newest_ts);\n if (\n ms > globalNewestMs ||\n (ms === globalNewestMs && newestEntry !== null && stat.id < newestEntry.id)\n ) {\n globalNewestMs = ms;\n newestEntry = { id: stat.id, ts: stat.newest_ts };\n }\n }\n }\n\n const largestByBytes =\n topN === 0\n ? []\n : [...stats]\n .sort((a, b) => b.bytes - a.bytes || a.id.localeCompare(b.id))\n .slice(0, topN);\n\n const deepestByLines =\n topN === 0\n ? []\n : [...stats]\n .sort((a, b) => b.lines - a.lines || a.id.localeCompare(b.id))\n .slice(0, topN);\n\n return {\n total_streams: streams.length,\n total_lines: totalLines,\n total_bytes: totalBytes,\n largest_by_bytes: largestByBytes,\n deepest_by_lines: deepestByLines,\n oldest_entry: oldestEntry,\n newest_entry: newestEntry,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,QAAQ;AACf,OAAO,UAAU;;;AC8BjB,SAAS,gBAAgB,IAAY,KAAW;AAC9C,QAAM,QAAQ,OAAO,WAAW,KAAK,MAAM;AAE3C,MAAI,QAAQ;AACZ,MAAI,WAA0B;AAC9B,MAAI,WAA0B;AAC9B,MAAI,WAAW,OAAO;AACtB,MAAI,WAAW,OAAO;AAEtB,aAAW,WAAW,IAAI,MAAM,OAAO,GAAG;AACxC,UAAM,UAAU,QAAQ,KAAI;AAC5B,QAAI,YAAY,IAAI;AAClB;IACF;AACA,aAAS;AAET,QAAI;AACJ,QAAI;AACF,eAAS,KAAK,MAAM,OAAO;IAC7B,QAAQ;AACN;IACF;AAEA,QACE,WAAW,QACX,OAAO,WAAW,YAClB,EAAE,QAAS,WACX,OAAQ,OAAmC,IAAI,MAAM,UACrD;AACA;IACF;AAEA,UAAM,KAAM,OAAmC,IAAI;AACnD,UAAM,KAAK,KAAK,MAAM,EAAE;AACxB,QAAI,OAAO,MAAM,EAAE,GAAG;AACpB;IACF;AAEA,QAAI,KAAK,YAAa,OAAO,YAAY,aAAa,QAAQ,KAAK,UAAW;AAC5E,iBAAW;AACX,iBAAW;IACb;AACA,QAAI,KAAK,YAAa,OAAO,YAAY,aAAa,QAAQ,KAAK,UAAW;AAC5E,iBAAW;AACX,iBAAW;IACb;EACF;AAEA,SAAO,EAAE,IAAI,OAAO,OAAO,WAAW,UAAU,WAAW,SAAQ;AACrE;AAKM,SAAU,2BACd,SACA,SAA2B;AAE3B,QAAM,UAAU,SAAS,QAAQ;AACjC,QAAM,OAAO,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,CAAC;AAE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