@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,1612 +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]="62634d0f-673a-5003-a921-d9c65bc0a872")}catch(e){}}();
|
|
3
|
-
import {
|
|
4
|
-
buildRemediationMap
|
|
5
|
-
} from "./chunk-R2EMWY7Q.js";
|
|
6
|
-
import {
|
|
7
|
-
scanLockHealth
|
|
8
|
-
} from "./chunk-37E72CNS.js";
|
|
9
|
-
import {
|
|
10
|
-
scanHistoryDrift
|
|
11
|
-
} from "./chunk-TT42JUMF.js";
|
|
12
|
-
import "./chunk-BFVHCAOO.js";
|
|
13
|
-
import {
|
|
14
|
-
PM_TELEMETRY_SOURCE_CONTEXT_VALUES,
|
|
15
|
-
TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS,
|
|
16
|
-
TELEMETRY_SCHEMA_VERSION
|
|
17
|
-
} from "./chunk-P3VRG72Q.js";
|
|
18
|
-
import {
|
|
19
|
-
collectStaleVectorizationIds
|
|
20
|
-
} from "./chunk-ROGZTCCB.js";
|
|
21
|
-
import {
|
|
22
|
-
buildVectorizationEmbeddingIdentity,
|
|
23
|
-
hasVectorizationEmbeddingIdentityChanged,
|
|
24
|
-
readVectorizationStatusLedger,
|
|
25
|
-
refreshSemanticEmbeddingsForMutatedItems,
|
|
26
|
-
resolveEmbeddingProviders,
|
|
27
|
-
resolveProviderConfigSource,
|
|
28
|
-
resolveSettingsWithSemanticRuntimeDefaults,
|
|
29
|
-
resolveVectorStores
|
|
30
|
-
} from "./chunk-7QH7DHUB.js";
|
|
31
|
-
import {
|
|
32
|
-
buildCapabilityContractMetadata,
|
|
33
|
-
buildRegistrationCollisionRemediation,
|
|
34
|
-
collectUnknownCapabilityGuidance,
|
|
35
|
-
readManagedExtensionState
|
|
36
|
-
} from "./chunk-JFCVQXZX.js";
|
|
37
|
-
import "./chunk-K32L7HZO.js";
|
|
38
|
-
import "./chunk-OK5NXCZB.js";
|
|
39
|
-
import "./chunk-53BTLLAF.js";
|
|
40
|
-
import "./chunk-P4SESZGT.js";
|
|
41
|
-
import "./chunk-FUM6UMY4.js";
|
|
42
|
-
import "./chunk-PPE4YUQM.js";
|
|
43
|
-
import "./chunk-AAEQMOC6.js";
|
|
44
|
-
import "./chunk-PJ3A56YF.js";
|
|
45
|
-
import {
|
|
46
|
-
collectRegisteredItemFieldNames,
|
|
47
|
-
enforceHistoryStreamPolicyForItems,
|
|
48
|
-
listAllFrontMatter,
|
|
49
|
-
listAllFrontMatterWithBody
|
|
50
|
-
} from "./chunk-57C2RLW5.js";
|
|
51
|
-
import "./chunk-ZAHXPXVY.js";
|
|
52
|
-
import {
|
|
53
|
-
effectiveItemFormatVersion,
|
|
54
|
-
findFirstMergeConflictMarker,
|
|
55
|
-
parseItemDocument,
|
|
56
|
-
scanItemFormatVersions
|
|
57
|
-
} from "./chunk-HK72NWAD.js";
|
|
58
|
-
import {
|
|
59
|
-
nowIso
|
|
60
|
-
} from "./chunk-FJRKQREY.js";
|
|
61
|
-
import {
|
|
62
|
-
PmCliError,
|
|
63
|
-
getActiveExtensionRegistrations,
|
|
64
|
-
readSettingsWithMetadata,
|
|
65
|
-
runActiveOnReadHooks
|
|
66
|
-
} from "./chunk-US3T3W5J.js";
|
|
67
|
-
import "./chunk-NER3KUUS.js";
|
|
68
|
-
import "./chunk-NNHHXJB2.js";
|
|
69
|
-
import {
|
|
70
|
-
EXIT_CODE,
|
|
71
|
-
ITEM_FILE_EXTENSIONS,
|
|
72
|
-
KNOWN_EXTENSION_CAPABILITIES,
|
|
73
|
-
PM_CORE_REQUIRED_SUBDIRS,
|
|
74
|
-
PM_OPTIONAL_TYPE_SUBDIRS,
|
|
75
|
-
activateExtensions,
|
|
76
|
-
getItemFormatFromPath,
|
|
77
|
-
getSettingsPath,
|
|
78
|
-
loadExtensions,
|
|
79
|
-
pathExists,
|
|
80
|
-
readFileIfExists,
|
|
81
|
-
resolveGlobalPmRoot,
|
|
82
|
-
resolveItemTypeRegistry,
|
|
83
|
-
resolvePmRoot,
|
|
84
|
-
toNonEmptyStringOrUndefined
|
|
85
|
-
} from "./chunk-YD5FML7K.js";
|
|
86
|
-
|
|
87
|
-
// dist/cli/commands/health.js
|
|
88
|
-
import fs from "node:fs/promises";
|
|
89
|
-
import path from "node:path";
|
|
90
|
-
var PM_TELEMETRY_SOURCE_CONTEXT_SET = new Set(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);
|
|
91
|
-
var STALE_VECTORIZATION_SUMMARY_LIMIT = 25;
|
|
92
|
-
var BRIEF_HEALTH_DETAIL_LIMIT = 8;
|
|
93
|
-
var TELEMETRY_QUEUE_RELATIVE_PATH = path.join("runtime", "telemetry", "events.jsonl");
|
|
94
|
-
var TELEMETRY_STATE_RELATIVE_PATH = path.join("runtime", "telemetry", "state.json");
|
|
95
|
-
var TELEMETRY_ENDPOINT_PROBE_TIMEOUT_MS = 2500;
|
|
96
|
-
var TELEMETRY_QUEUE_HIGH_WATER_MARK = 500;
|
|
97
|
-
var TELEMETRY_QUEUE_HIGH_RETRY_THRESHOLD = TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS - 3;
|
|
98
|
-
var TELEMETRY_SERVER_MAX_SCHEMA_VERSION_HEADERS = [
|
|
99
|
-
"x-pm-telemetry-max-schema-version",
|
|
100
|
-
"x-pm-telemetry-max-version"
|
|
101
|
-
];
|
|
102
|
-
function isAdvisoryHealthWarning(warning) {
|
|
103
|
-
return warning.startsWith("telemetry_") || warning.startsWith("history_stream_over_compact_threshold:");
|
|
104
|
-
}
|
|
105
|
-
function warningCode(value) {
|
|
106
|
-
const normalized = value.trim();
|
|
107
|
-
const separator = normalized.indexOf(":");
|
|
108
|
-
if (separator === -1) {
|
|
109
|
-
return normalized;
|
|
110
|
-
}
|
|
111
|
-
return normalized.slice(0, separator);
|
|
112
|
-
}
|
|
113
|
-
function normalizeExtensionNameForMatch(value) {
|
|
114
|
-
return value.trim().toLowerCase();
|
|
115
|
-
}
|
|
116
|
-
function isExpectedUnmanagedExtension(name, directory) {
|
|
117
|
-
const normalizedName = normalizeExtensionNameForMatch(name);
|
|
118
|
-
const normalizedDirectory = normalizeExtensionNameForMatch(directory);
|
|
119
|
-
if (normalizedName.startsWith("builtin-")) {
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
return normalizedDirectory === "beads" || normalizedDirectory === "todos";
|
|
123
|
-
}
|
|
124
|
-
async function isDirectory(targetPath) {
|
|
125
|
-
try {
|
|
126
|
-
const stats = await fs.stat(targetPath);
|
|
127
|
-
return stats.isDirectory();
|
|
128
|
-
} catch {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
async function countHistoryStreams(pmRoot, compactPolicy) {
|
|
133
|
-
const historyDir = path.join(pmRoot, "history");
|
|
134
|
-
if (!await isDirectory(historyDir)) {
|
|
135
|
-
return { count: 0, warnings: [], over_threshold: [], max_entries: null };
|
|
136
|
-
}
|
|
137
|
-
const historyFiles = (await fs.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((left, right) => left.localeCompare(right));
|
|
138
|
-
const policyActive = compactPolicy.enabled;
|
|
139
|
-
const maxEntries = policyActive ? compactPolicy.max_entries : null;
|
|
140
|
-
const warnings = [];
|
|
141
|
-
const overThreshold = [];
|
|
142
|
-
for (const fileName of historyFiles) {
|
|
143
|
-
const streamPath = path.join(historyDir, fileName);
|
|
144
|
-
warnings.push(...await runActiveOnReadHooks({ path: streamPath, scope: "project" }));
|
|
145
|
-
if (!policyActive) {
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
const raw = await fs.readFile(streamPath, "utf8");
|
|
149
|
-
let entries = 0;
|
|
150
|
-
for (const line of raw.split(/\r?\n/)) {
|
|
151
|
-
if (line.trim().length > 0) {
|
|
152
|
-
entries += 1;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (entries > compactPolicy.max_entries) {
|
|
156
|
-
overThreshold.push(fileName.slice(0, -".jsonl".length));
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return {
|
|
160
|
-
count: historyFiles.length,
|
|
161
|
-
warnings: [...warnings, ...overThreshold.map((id) => `history_stream_over_compact_threshold:${id}`)],
|
|
162
|
-
over_threshold: overThreshold,
|
|
163
|
-
max_entries: maxEntries
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
function normalizeRelativePath(pmRoot, targetPath) {
|
|
167
|
-
return path.relative(pmRoot, targetPath).replaceAll("\\", "/");
|
|
168
|
-
}
|
|
169
|
-
async function listItemDocumentPaths(pmRoot, typeToFolder) {
|
|
170
|
-
const folders = [...new Set(Object.values(typeToFolder))].sort((left, right) => left.localeCompare(right));
|
|
171
|
-
const itemPaths = [];
|
|
172
|
-
for (const folder of folders) {
|
|
173
|
-
const directoryPath = path.join(pmRoot, folder);
|
|
174
|
-
let entries = [];
|
|
175
|
-
try {
|
|
176
|
-
entries = await fs.readdir(directoryPath);
|
|
177
|
-
} catch (error) {
|
|
178
|
-
if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
for (const entry of entries) {
|
|
184
|
-
if (!ITEM_FILE_EXTENSIONS.some((extension) => entry.toLowerCase().endsWith(extension))) {
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
|
-
itemPaths.push(path.join(directoryPath, entry));
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
itemPaths.sort((left, right) => normalizeRelativePath(pmRoot, left).localeCompare(normalizeRelativePath(pmRoot, right)));
|
|
191
|
-
return itemPaths;
|
|
192
|
-
}
|
|
193
|
-
function shouldReportHistoryDirectoryUnreadable(error) {
|
|
194
|
-
return !(typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT");
|
|
195
|
-
}
|
|
196
|
-
async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
|
|
197
|
-
const itemPaths = await listItemDocumentPaths(pmRoot, typeToFolder);
|
|
198
|
-
const itemUnreadable = [];
|
|
199
|
-
const itemConflictMarkers = [];
|
|
200
|
-
const itemParseFailures = [];
|
|
201
|
-
const formatVersionEntries = [];
|
|
202
|
-
const extensionFieldNames = collectRegisteredItemFieldNames(getActiveExtensionRegistrations());
|
|
203
|
-
for (const itemPath of itemPaths) {
|
|
204
|
-
const relativePath = normalizeRelativePath(pmRoot, itemPath);
|
|
205
|
-
let raw = "";
|
|
206
|
-
try {
|
|
207
|
-
raw = await fs.readFile(itemPath, "utf8");
|
|
208
|
-
} catch {
|
|
209
|
-
itemUnreadable.push(relativePath);
|
|
210
|
-
continue;
|
|
211
|
-
}
|
|
212
|
-
const conflictMarker = findFirstMergeConflictMarker(raw);
|
|
213
|
-
if (conflictMarker) {
|
|
214
|
-
itemConflictMarkers.push({
|
|
215
|
-
path: relativePath,
|
|
216
|
-
line: conflictMarker.line,
|
|
217
|
-
marker: conflictMarker.marker
|
|
218
|
-
});
|
|
219
|
-
continue;
|
|
220
|
-
}
|
|
221
|
-
try {
|
|
222
|
-
const parsed = parseItemDocument(raw, { format: getItemFormatFromPath(itemPath), schema, extensionFieldNames });
|
|
223
|
-
formatVersionEntries.push({ ref: relativePath, version: effectiveItemFormatVersion(parsed.metadata) });
|
|
224
|
-
} catch {
|
|
225
|
-
itemParseFailures.push(relativePath);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
const formatVersionScan = scanItemFormatVersions(formatVersionEntries);
|
|
229
|
-
const historyDir = path.join(pmRoot, "history");
|
|
230
|
-
const historyUnreadable = [];
|
|
231
|
-
const historyConflictMarkers = [];
|
|
232
|
-
const historyInvalidJson = [];
|
|
233
|
-
let historyFiles = [];
|
|
234
|
-
try {
|
|
235
|
-
historyFiles = (await fs.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((left, right) => left.localeCompare(right));
|
|
236
|
-
} catch (error) {
|
|
237
|
-
if (shouldReportHistoryDirectoryUnreadable(error)) {
|
|
238
|
-
historyUnreadable.push("history");
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
for (const fileName of historyFiles) {
|
|
242
|
-
const itemId = fileName.slice(0, -".jsonl".length);
|
|
243
|
-
const historyPath = path.join(historyDir, fileName);
|
|
244
|
-
let raw = "";
|
|
245
|
-
try {
|
|
246
|
-
raw = await fs.readFile(historyPath, "utf8");
|
|
247
|
-
} catch {
|
|
248
|
-
historyUnreadable.push(itemId);
|
|
249
|
-
continue;
|
|
250
|
-
}
|
|
251
|
-
const conflictMarker = findFirstMergeConflictMarker(raw);
|
|
252
|
-
if (conflictMarker) {
|
|
253
|
-
historyConflictMarkers.push({
|
|
254
|
-
id: itemId,
|
|
255
|
-
line: conflictMarker.line,
|
|
256
|
-
marker: conflictMarker.marker
|
|
257
|
-
});
|
|
258
|
-
continue;
|
|
259
|
-
}
|
|
260
|
-
const lines = raw.split(/\r?\n/);
|
|
261
|
-
for (let index = 0; index < lines.length; index += 1) {
|
|
262
|
-
const line = lines[index]?.trim();
|
|
263
|
-
if (!line) {
|
|
264
|
-
continue;
|
|
265
|
-
}
|
|
266
|
-
try {
|
|
267
|
-
JSON.parse(line);
|
|
268
|
-
} catch {
|
|
269
|
-
historyInvalidJson.push({
|
|
270
|
-
id: itemId,
|
|
271
|
-
line: index + 1
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
const warnings = [
|
|
277
|
-
...itemUnreadable.map((entry) => `integrity_item_unreadable:${entry}`),
|
|
278
|
-
...itemConflictMarkers.map((entry) => `integrity_item_conflict_marker:${entry.path}:L${entry.line}`),
|
|
279
|
-
...itemParseFailures.map((entry) => `integrity_item_parse_failed:${entry}`),
|
|
280
|
-
...historyUnreadable.map((entry) => `integrity_history_unreadable:${entry}`),
|
|
281
|
-
...historyConflictMarkers.map((entry) => `integrity_history_conflict_marker:${entry.id}:L${entry.line}`),
|
|
282
|
-
...historyInvalidJson.map((entry) => `integrity_history_invalid_json:${entry.id}:L${entry.line}`),
|
|
283
|
-
/* c8 ignore start -- outdated-version items are unreachable until CURRENT_ITEM_FORMAT_VERSION advances past the baseline (an effective version below 1 cannot occur); the per-item mapping is covered in item-format-version.spec, and the ahead path below is covered by health-command.spec */
|
|
284
|
-
...formatVersionScan.outdated.map((entry) => `integrity_item_outdated_format_version:${entry}`),
|
|
285
|
-
/* c8 ignore stop */
|
|
286
|
-
...formatVersionScan.ahead.map((entry) => `integrity_item_ahead_format_version:${entry}`)
|
|
287
|
-
];
|
|
288
|
-
const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
289
|
-
return {
|
|
290
|
-
check: {
|
|
291
|
-
name: "integrity",
|
|
292
|
-
status: normalizedWarnings.length === 0 ? "ok" : "warn",
|
|
293
|
-
details: {
|
|
294
|
-
checked_item_files: itemPaths.length,
|
|
295
|
-
checked_history_streams: historyFiles.length,
|
|
296
|
-
counts: {
|
|
297
|
-
item_unreadable: itemUnreadable.length,
|
|
298
|
-
item_conflict_markers: itemConflictMarkers.length,
|
|
299
|
-
item_parse_failures: itemParseFailures.length,
|
|
300
|
-
history_unreadable: historyUnreadable.length,
|
|
301
|
-
history_conflict_markers: historyConflictMarkers.length,
|
|
302
|
-
history_invalid_json: historyInvalidJson.length,
|
|
303
|
-
item_outdated_format_version: formatVersionScan.outdated.length,
|
|
304
|
-
item_ahead_format_version: formatVersionScan.ahead.length
|
|
305
|
-
},
|
|
306
|
-
item_unreadable: itemUnreadable,
|
|
307
|
-
item_conflict_markers: itemConflictMarkers,
|
|
308
|
-
item_parse_failures: itemParseFailures,
|
|
309
|
-
item_outdated_format_version: formatVersionScan.outdated,
|
|
310
|
-
item_ahead_format_version: formatVersionScan.ahead,
|
|
311
|
-
history_unreadable: historyUnreadable,
|
|
312
|
-
history_conflict_markers: historyConflictMarkers,
|
|
313
|
-
history_invalid_json: historyInvalidJson
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
warnings: normalizedWarnings
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
function hasActivateExport(moduleRecord) {
|
|
320
|
-
if (typeof moduleRecord.activate === "function") {
|
|
321
|
-
return true;
|
|
322
|
-
}
|
|
323
|
-
const defaultExport = moduleRecord.default;
|
|
324
|
-
if (typeof defaultExport !== "object" || defaultExport === null) {
|
|
325
|
-
return false;
|
|
326
|
-
}
|
|
327
|
-
return typeof defaultExport.activate === "function";
|
|
328
|
-
}
|
|
329
|
-
function summarizeLoadedExtension(extension) {
|
|
330
|
-
const summary = {
|
|
331
|
-
layer: extension.layer,
|
|
332
|
-
directory: extension.directory,
|
|
333
|
-
manifest_path: extension.manifest_path,
|
|
334
|
-
name: extension.name,
|
|
335
|
-
version: extension.version,
|
|
336
|
-
entry: extension.entry,
|
|
337
|
-
priority: extension.priority,
|
|
338
|
-
entry_path: extension.entry_path,
|
|
339
|
-
has_activate: hasActivateExport(extension.module)
|
|
340
|
-
};
|
|
341
|
-
if (Array.isArray(extension.capabilities)) {
|
|
342
|
-
summary.capabilities = [...extension.capabilities];
|
|
343
|
-
}
|
|
344
|
-
return summary;
|
|
345
|
-
}
|
|
346
|
-
function resolveMigrationId(definition, fallbackIndex) {
|
|
347
|
-
const explicitId = toNonEmptyStringOrUndefined(definition.id);
|
|
348
|
-
if (explicitId) {
|
|
349
|
-
return explicitId;
|
|
350
|
-
}
|
|
351
|
-
return `migration-${String(fallbackIndex + 1).padStart(3, "0")}`;
|
|
352
|
-
}
|
|
353
|
-
function resolveMigrationStatus(definition) {
|
|
354
|
-
const rawStatus = toNonEmptyStringOrUndefined(definition.status);
|
|
355
|
-
const normalized = rawStatus?.toLowerCase();
|
|
356
|
-
if (normalized === "failed") {
|
|
357
|
-
return "failed";
|
|
358
|
-
}
|
|
359
|
-
if (normalized === "applied") {
|
|
360
|
-
return "applied";
|
|
361
|
-
}
|
|
362
|
-
return "pending";
|
|
363
|
-
}
|
|
364
|
-
function resolveMigrationFailureReason(definition) {
|
|
365
|
-
return toNonEmptyStringOrUndefined(definition.reason) ?? toNonEmptyStringOrUndefined(definition.error) ?? toNonEmptyStringOrUndefined(definition.message);
|
|
366
|
-
}
|
|
367
|
-
function compareMigrationEntries(left, right) {
|
|
368
|
-
const byLayer = (left.layer ?? "").localeCompare(right.layer ?? "");
|
|
369
|
-
if (byLayer !== 0) {
|
|
370
|
-
return byLayer;
|
|
371
|
-
}
|
|
372
|
-
const byName = (left.name ?? "").localeCompare(right.name ?? "");
|
|
373
|
-
if (byName !== 0) {
|
|
374
|
-
return byName;
|
|
375
|
-
}
|
|
376
|
-
return (left.id ?? "").localeCompare(right.id ?? "");
|
|
377
|
-
}
|
|
378
|
-
function summarizeMigrationStatuses(migrations) {
|
|
379
|
-
const applied = [];
|
|
380
|
-
const pending = [];
|
|
381
|
-
const failed = [];
|
|
382
|
-
migrations.forEach((migration, index) => {
|
|
383
|
-
const id = resolveMigrationId(migration.definition, index);
|
|
384
|
-
const status = resolveMigrationStatus(migration.definition);
|
|
385
|
-
if (status === "applied") {
|
|
386
|
-
applied.push({
|
|
387
|
-
layer: migration.layer,
|
|
388
|
-
name: migration.name,
|
|
389
|
-
id,
|
|
390
|
-
status
|
|
391
|
-
});
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
if (status === "failed") {
|
|
395
|
-
failed.push({
|
|
396
|
-
layer: migration.layer,
|
|
397
|
-
name: migration.name,
|
|
398
|
-
id,
|
|
399
|
-
status,
|
|
400
|
-
reason: resolveMigrationFailureReason(migration.definition)
|
|
401
|
-
});
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
pending.push({
|
|
405
|
-
layer: migration.layer,
|
|
406
|
-
name: migration.name,
|
|
407
|
-
id,
|
|
408
|
-
status
|
|
409
|
-
});
|
|
410
|
-
});
|
|
411
|
-
applied.sort(compareMigrationEntries);
|
|
412
|
-
pending.sort(compareMigrationEntries);
|
|
413
|
-
failed.sort(compareMigrationEntries);
|
|
414
|
-
const warnings = [
|
|
415
|
-
...failed.map((entry) => `extension_migration_failed:${entry.layer}:${entry.name}:${entry.id}`),
|
|
416
|
-
...pending.map((entry) => `extension_migration_pending:${entry.layer}:${entry.name}:${entry.id}`)
|
|
417
|
-
];
|
|
418
|
-
return {
|
|
419
|
-
summary: {
|
|
420
|
-
applied,
|
|
421
|
-
pending,
|
|
422
|
-
failed,
|
|
423
|
-
applied_count: applied.length,
|
|
424
|
-
pending_count: pending.length,
|
|
425
|
-
failed_count: failed.length
|
|
426
|
-
},
|
|
427
|
-
warnings
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
function buildExtensionHealthTriageSummary(warnings, loadFailureCount, activationFailureCount, migrationStatus, managedStateWarningCount, managedExtensionEntriesCount, unmanagedLoadedExtensions, unmanagedExpectedExtensions, unmanagedActionRequiredExtensions) {
|
|
431
|
-
const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
432
|
-
const warningCodes = [...new Set(normalizedWarnings.map((value) => warningCode(value)))].sort((left, right) => left.localeCompare(right));
|
|
433
|
-
const unknownCapabilityCount = normalizedWarnings.filter((warning) => warning.startsWith("extension_capability_unknown:")).length;
|
|
434
|
-
const updateHealthPartial = unmanagedActionRequiredExtensions.length > 0;
|
|
435
|
-
const updateHealthCoverage = updateHealthPartial ? "partial" : "full";
|
|
436
|
-
const remediation = [];
|
|
437
|
-
const registrationCollisionRemediation = buildRegistrationCollisionRemediation(normalizedWarnings, {
|
|
438
|
-
deactivate: "pm extension --deactivate <name> --project/--global",
|
|
439
|
-
doctor: "pm extension --doctor --project/--global --detail deep --trace"
|
|
440
|
-
});
|
|
441
|
-
if (registrationCollisionRemediation) {
|
|
442
|
-
remediation.push(registrationCollisionRemediation);
|
|
443
|
-
}
|
|
444
|
-
if (loadFailureCount > 0) {
|
|
445
|
-
remediation.push("Run pm extension --explore --project and pm extension --explore --global to inspect load failures.");
|
|
446
|
-
}
|
|
447
|
-
if (activationFailureCount > 0) {
|
|
448
|
-
remediation.push("Review checks[name=extensions].details.activation.failed in pm health --json for activation error details.");
|
|
449
|
-
}
|
|
450
|
-
if (migrationStatus.failed_count > 0 || migrationStatus.pending_count > 0) {
|
|
451
|
-
remediation.push("Resolve pending/failed extension migrations before write commands; use --force only when policy allows.");
|
|
452
|
-
}
|
|
453
|
-
if (managedStateWarningCount > 0) {
|
|
454
|
-
remediation.push("Run pm extension --manage --project and pm extension --manage --global to refresh managed-state diagnostics.");
|
|
455
|
-
}
|
|
456
|
-
if (unknownCapabilityCount > 0) {
|
|
457
|
-
remediation.push(`Unknown extension capabilities detected. Allowed capabilities: ${KNOWN_EXTENSION_CAPABILITIES.join(", ")}. Review extension_capability_unknown warning details for suggested replacements.`);
|
|
458
|
-
}
|
|
459
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_legacy_alias:"))) {
|
|
460
|
-
remediation.push("Legacy extension capability aliases were auto-remapped to canonical capabilities. Update manifests to canonical names (migration/validation -> schema).");
|
|
461
|
-
}
|
|
462
|
-
if (normalizedWarnings.some((warning) => warning.startsWith("extension_command_definition_legacy_handler_alias:"))) {
|
|
463
|
-
remediation.push("Extension command definitions using legacy handler were auto-remapped. Update command definitions to use run: (context) => ... for forward compatibility.");
|
|
464
|
-
}
|
|
465
|
-
if (updateHealthPartial) {
|
|
466
|
-
remediation.push("Update-check coverage is partial because unmanaged extensions need adoption. Adopt existing installs via pm extension --manage --project/--global --fix-managed-state, pm extension --adopt-all --project/--global, or pm extension --adopt <name>.");
|
|
467
|
-
} else if (unmanagedLoadedExtensions.length > 0) {
|
|
468
|
-
remediation.push("Loaded unmanaged extensions are currently treated as informational. Use pm extension --manage --project/--global --fix-managed-state to adopt them for update checks.");
|
|
469
|
-
}
|
|
470
|
-
if (remediation.length === 0) {
|
|
471
|
-
remediation.push("No immediate action required. Re-run pm health after extension configuration changes.");
|
|
472
|
-
}
|
|
473
|
-
return {
|
|
474
|
-
status: normalizedWarnings.length === 0 ? "ok" : "warn",
|
|
475
|
-
warning_count: normalizedWarnings.length,
|
|
476
|
-
warning_codes: warningCodes,
|
|
477
|
-
load_failure_count: loadFailureCount,
|
|
478
|
-
activation_failure_count: activationFailureCount,
|
|
479
|
-
migration_failed_count: migrationStatus.failed_count,
|
|
480
|
-
migration_pending_count: migrationStatus.pending_count,
|
|
481
|
-
managed_state_warning_count: managedStateWarningCount,
|
|
482
|
-
managed_extension_entries_count: managedExtensionEntriesCount,
|
|
483
|
-
unmanaged_loaded_extension_count: unmanagedLoadedExtensions.length,
|
|
484
|
-
unmanaged_loaded_extensions: unmanagedLoadedExtensions,
|
|
485
|
-
unmanaged_expected_extension_count: unmanagedExpectedExtensions.length,
|
|
486
|
-
unmanaged_expected_extensions: unmanagedExpectedExtensions,
|
|
487
|
-
unmanaged_action_required_extension_count: unmanagedActionRequiredExtensions.length,
|
|
488
|
-
unmanaged_action_required_extensions: unmanagedActionRequiredExtensions,
|
|
489
|
-
update_health_coverage: updateHealthCoverage,
|
|
490
|
-
update_health_partial: updateHealthPartial,
|
|
491
|
-
unknown_capability_count: unknownCapabilityCount,
|
|
492
|
-
top_warnings: normalizedWarnings.slice(0, 8),
|
|
493
|
-
remediation
|
|
494
|
-
};
|
|
495
|
-
}
|
|
496
|
-
async function buildExtensionCheck(pmRoot, settings, noExtensionsFlag) {
|
|
497
|
-
const loadResult = await loadExtensions({
|
|
498
|
-
pmRoot,
|
|
499
|
-
settings,
|
|
500
|
-
cwd: process.cwd(),
|
|
501
|
-
noExtensions: noExtensionsFlag
|
|
502
|
-
});
|
|
503
|
-
const loadedSummaries = loadResult.loaded.map((extension) => summarizeLoadedExtension(extension));
|
|
504
|
-
const activationResult = await activateExtensions({
|
|
505
|
-
...loadResult,
|
|
506
|
-
loaded: loadResult.loaded
|
|
507
|
-
});
|
|
508
|
-
const [projectManagedState, globalManagedState] = await Promise.all([
|
|
509
|
-
readManagedExtensionState(loadResult.roots.project),
|
|
510
|
-
readManagedExtensionState(loadResult.roots.global)
|
|
511
|
-
]);
|
|
512
|
-
const migrationStatus = summarizeMigrationStatuses(activationResult.registrations.migrations);
|
|
513
|
-
const activationDetails = {
|
|
514
|
-
failed: activationResult.failed,
|
|
515
|
-
warnings: activationResult.warnings,
|
|
516
|
-
hook_counts: activationResult.hook_counts,
|
|
517
|
-
command_override_count: activationResult.command_override_count,
|
|
518
|
-
command_handler_count: activationResult.command_handler_count,
|
|
519
|
-
parser_override_count: activationResult.parser_override_count,
|
|
520
|
-
preflight_override_count: activationResult.preflight_override_count,
|
|
521
|
-
service_override_count: activationResult.service_override_count,
|
|
522
|
-
renderer_override_count: activationResult.renderer_override_count,
|
|
523
|
-
registration_counts: activationResult.registration_counts,
|
|
524
|
-
registrations: activationResult.registrations,
|
|
525
|
-
migration_status: migrationStatus.summary,
|
|
526
|
-
managed_extensions: {
|
|
527
|
-
project: {
|
|
528
|
-
path: projectManagedState.path,
|
|
529
|
-
count: projectManagedState.state.entries.length,
|
|
530
|
-
entries: projectManagedState.state.entries
|
|
531
|
-
},
|
|
532
|
-
global: {
|
|
533
|
-
path: globalManagedState.path,
|
|
534
|
-
count: globalManagedState.state.entries.length,
|
|
535
|
-
entries: globalManagedState.state.entries
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
};
|
|
539
|
-
const managedProjectNames = new Set(projectManagedState.state.entries.map((entry) => normalizeExtensionNameForMatch(entry.name)));
|
|
540
|
-
const managedGlobalNames = new Set(globalManagedState.state.entries.map((entry) => normalizeExtensionNameForMatch(entry.name)));
|
|
541
|
-
const unmanagedLoadedEntries = [
|
|
542
|
-
...new Map(loadResult.loaded.filter((entry) => {
|
|
543
|
-
const managedNames = entry.layer === "project" ? managedProjectNames : managedGlobalNames;
|
|
544
|
-
return !managedNames.has(normalizeExtensionNameForMatch(entry.name));
|
|
545
|
-
}).map((entry) => [
|
|
546
|
-
`${entry.layer}:${entry.name}`,
|
|
547
|
-
{
|
|
548
|
-
layer: entry.layer,
|
|
549
|
-
name: entry.name,
|
|
550
|
-
directory: entry.directory
|
|
551
|
-
}
|
|
552
|
-
])).values()
|
|
553
|
-
].sort((left, right) => {
|
|
554
|
-
const leftKey = `${left.layer}:${left.name}`;
|
|
555
|
-
const rightKey = `${right.layer}:${right.name}`;
|
|
556
|
-
return leftKey.localeCompare(rightKey);
|
|
557
|
-
});
|
|
558
|
-
const unmanagedLoadedExtensions = unmanagedLoadedEntries.map((entry) => `${entry.layer}:${entry.name}`).sort((left, right) => left.localeCompare(right));
|
|
559
|
-
const unmanagedExpectedExtensions = unmanagedLoadedEntries.filter((entry) => isExpectedUnmanagedExtension(entry.name, entry.directory)).map((entry) => `${entry.layer}:${entry.name}`).sort((left, right) => left.localeCompare(right));
|
|
560
|
-
const unmanagedActionRequiredExtensions = unmanagedLoadedEntries.filter((entry) => !isExpectedUnmanagedExtension(entry.name, entry.directory)).map((entry) => `${entry.layer}:${entry.name}`).sort((left, right) => left.localeCompare(right));
|
|
561
|
-
const updateCoverageWarnings = unmanagedActionRequiredExtensions.length > 0 ? [`extension_update_health_partial_coverage:skipped_unmanaged:${unmanagedActionRequiredExtensions.length}`] : [];
|
|
562
|
-
const extensionWarnings = [
|
|
563
|
-
...loadResult.warnings,
|
|
564
|
-
...activationDetails.warnings,
|
|
565
|
-
...migrationStatus.warnings,
|
|
566
|
-
...projectManagedState.warnings,
|
|
567
|
-
...globalManagedState.warnings,
|
|
568
|
-
...updateCoverageWarnings
|
|
569
|
-
];
|
|
570
|
-
const capabilityGuidance = collectUnknownCapabilityGuidance(extensionWarnings);
|
|
571
|
-
const capabilityContract = buildCapabilityContractMetadata();
|
|
572
|
-
const extensionTriage = buildExtensionHealthTriageSummary(extensionWarnings, loadResult.failed.length, activationResult.failed.length, migrationStatus.summary, projectManagedState.warnings.length + globalManagedState.warnings.length, projectManagedState.state.entries.length + globalManagedState.state.entries.length, unmanagedLoadedExtensions, unmanagedExpectedExtensions, unmanagedActionRequiredExtensions);
|
|
573
|
-
return {
|
|
574
|
-
check: {
|
|
575
|
-
name: "extensions",
|
|
576
|
-
status: extensionWarnings.length === 0 ? "ok" : "warn",
|
|
577
|
-
details: {
|
|
578
|
-
...loadResult,
|
|
579
|
-
loaded: loadedSummaries,
|
|
580
|
-
warnings: extensionWarnings,
|
|
581
|
-
activation: activationDetails,
|
|
582
|
-
triage: extensionTriage,
|
|
583
|
-
capability_contract: capabilityContract,
|
|
584
|
-
capability_guidance: capabilityGuidance
|
|
585
|
-
}
|
|
586
|
-
},
|
|
587
|
-
warnings: extensionWarnings
|
|
588
|
-
};
|
|
589
|
-
}
|
|
590
|
-
function summarizeList(values, limit) {
|
|
591
|
-
if (values.length <= limit) {
|
|
592
|
-
return { values, truncated: false };
|
|
593
|
-
}
|
|
594
|
-
return {
|
|
595
|
-
values: values.slice(0, limit),
|
|
596
|
-
truncated: true
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
function summarizeRecordList(value, limit) {
|
|
600
|
-
if (!Array.isArray(value)) {
|
|
601
|
-
return {
|
|
602
|
-
count: 0,
|
|
603
|
-
sample: [],
|
|
604
|
-
truncated: false
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
return {
|
|
608
|
-
count: value.length,
|
|
609
|
-
sample: value.slice(0, limit),
|
|
610
|
-
truncated: value.length > limit
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
function summarizeExtensionRecord(value) {
|
|
614
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
615
|
-
return {};
|
|
616
|
-
}
|
|
617
|
-
const record = value;
|
|
618
|
-
return {
|
|
619
|
-
layer: record.layer,
|
|
620
|
-
directory: record.directory,
|
|
621
|
-
name: record.name,
|
|
622
|
-
version: record.version,
|
|
623
|
-
enabled: record.enabled,
|
|
624
|
-
status: record.status,
|
|
625
|
-
has_activate: record.has_activate,
|
|
626
|
-
capabilities: record.capabilities
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
function summarizeExtensionList(value, limit) {
|
|
630
|
-
const summary = summarizeRecordList(value, limit);
|
|
631
|
-
return {
|
|
632
|
-
...summary,
|
|
633
|
-
sample: summary.sample.map((entry) => summarizeExtensionRecord(entry))
|
|
634
|
-
};
|
|
635
|
-
}
|
|
636
|
-
function summarizeStringList(value, limit) {
|
|
637
|
-
if (!Array.isArray(value)) {
|
|
638
|
-
return {
|
|
639
|
-
count: 0,
|
|
640
|
-
sample: [],
|
|
641
|
-
truncated: false
|
|
642
|
-
};
|
|
643
|
-
}
|
|
644
|
-
const strings = value.filter((entry) => typeof entry === "string");
|
|
645
|
-
return {
|
|
646
|
-
count: strings.length,
|
|
647
|
-
sample: strings.slice(0, limit),
|
|
648
|
-
truncated: strings.length > limit
|
|
649
|
-
};
|
|
650
|
-
}
|
|
651
|
-
function summarizeActivationMigrationStatus(value) {
|
|
652
|
-
if (typeof value !== "object" || value === null) {
|
|
653
|
-
return null;
|
|
654
|
-
}
|
|
655
|
-
const status = value;
|
|
656
|
-
return {
|
|
657
|
-
applied_count: status.applied_count,
|
|
658
|
-
pending_count: status.pending_count,
|
|
659
|
-
failed_count: status.failed_count
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
var HEALTH_DETAIL_SUMMARIZERS = {
|
|
663
|
-
settings: (details, limit) => ({
|
|
664
|
-
version: details.version,
|
|
665
|
-
id_prefix: details.id_prefix,
|
|
666
|
-
locks_ttl_seconds: details.locks_ttl_seconds,
|
|
667
|
-
warnings: summarizeStringList(details.warnings, limit)
|
|
668
|
-
}),
|
|
669
|
-
directories: (details, limit) => ({
|
|
670
|
-
required_count: Array.isArray(details.required) ? details.required.length : 0,
|
|
671
|
-
optional_count: Array.isArray(details.optional) ? details.optional.length : 0,
|
|
672
|
-
missing_required: summarizeStringList(details.missing_required, limit),
|
|
673
|
-
missing_optional: summarizeStringList(details.missing_optional, limit),
|
|
674
|
-
missing: summarizeStringList(details.missing, limit),
|
|
675
|
-
strict_directories: details.strict_directories
|
|
676
|
-
}),
|
|
677
|
-
settings_values: (details, limit) => ({
|
|
678
|
-
warnings: summarizeStringList(details.warnings, limit)
|
|
679
|
-
}),
|
|
680
|
-
telemetry: (details) => ({
|
|
681
|
-
enabled: details.enabled,
|
|
682
|
-
capture_level: details.capture_level,
|
|
683
|
-
endpoint: details.endpoint,
|
|
684
|
-
queue_exists: details.queue_exists,
|
|
685
|
-
queue_entries: details.queue_entries,
|
|
686
|
-
queue_draining: details.queue_draining,
|
|
687
|
-
queue_invalid_rows: details.queue_invalid_rows,
|
|
688
|
-
queue_rows_total: details.queue_rows_total,
|
|
689
|
-
last_successful_flush_at: details.last_successful_flush_at,
|
|
690
|
-
last_failed_flush_at: details.last_failed_flush_at,
|
|
691
|
-
endpoint_probe: details.endpoint_probe,
|
|
692
|
-
env_overrides: details.env_overrides
|
|
693
|
-
}),
|
|
694
|
-
extensions: (details, limit) => {
|
|
695
|
-
const activation = typeof details.activation === "object" && details.activation !== null ? details.activation : {};
|
|
696
|
-
return {
|
|
697
|
-
disabled_by_flag: details.disabled_by_flag,
|
|
698
|
-
discovered: summarizeExtensionList(details.discovered, limit),
|
|
699
|
-
effective: summarizeExtensionList(details.effective, limit),
|
|
700
|
-
loaded: summarizeExtensionList(details.loaded, limit),
|
|
701
|
-
failed: summarizeRecordList(details.failed, limit),
|
|
702
|
-
warnings: summarizeStringList(details.warnings, limit),
|
|
703
|
-
activation: {
|
|
704
|
-
failed: summarizeRecordList(activation.failed, limit),
|
|
705
|
-
warnings: summarizeStringList(activation.warnings, limit),
|
|
706
|
-
hook_counts: activation.hook_counts,
|
|
707
|
-
command_handler_count: activation.command_handler_count,
|
|
708
|
-
service_override_count: activation.service_override_count,
|
|
709
|
-
renderer_override_count: activation.renderer_override_count,
|
|
710
|
-
registration_counts: activation.registration_counts,
|
|
711
|
-
migration_status: summarizeActivationMigrationStatus(activation.migration_status)
|
|
712
|
-
},
|
|
713
|
-
triage: details.triage,
|
|
714
|
-
capability_contract: details.capability_contract,
|
|
715
|
-
capability_guidance: summarizeRecordList(details.capability_guidance, limit)
|
|
716
|
-
};
|
|
717
|
-
},
|
|
718
|
-
// Storage details are already compact counters; keep the pre-refactor pass-through shape.
|
|
719
|
-
storage: (details) => details,
|
|
720
|
-
locks: (details) => ({
|
|
721
|
-
active_lock_count: details.active_lock_count,
|
|
722
|
-
stale_lock_count: details.stale_lock_count,
|
|
723
|
-
unreadable_lock_count: details.unreadable_lock_count,
|
|
724
|
-
unparseable_lock_count: details.unparseable_lock_count
|
|
725
|
-
}),
|
|
726
|
-
integrity: (details, limit) => ({
|
|
727
|
-
checked_item_files: details.checked_item_files,
|
|
728
|
-
checked_history_streams: details.checked_history_streams,
|
|
729
|
-
counts: details.counts,
|
|
730
|
-
item_unreadable: summarizeStringList(details.item_unreadable, limit),
|
|
731
|
-
item_conflict_markers: summarizeRecordList(details.item_conflict_markers, limit),
|
|
732
|
-
item_parse_failures: summarizeStringList(details.item_parse_failures, limit),
|
|
733
|
-
history_unreadable: summarizeStringList(details.history_unreadable, limit),
|
|
734
|
-
history_conflict_markers: summarizeRecordList(details.history_conflict_markers, limit),
|
|
735
|
-
history_invalid_json: summarizeRecordList(details.history_invalid_json, limit),
|
|
736
|
-
skipped: details.skipped
|
|
737
|
-
}),
|
|
738
|
-
history_drift: (details, limit) => ({
|
|
739
|
-
checked_items: details.checked_items,
|
|
740
|
-
counts: details.counts,
|
|
741
|
-
drifted_items: summarizeStringList(details.drifted_items, limit),
|
|
742
|
-
missing_streams: summarizeStringList(details.missing_streams, limit),
|
|
743
|
-
unreadable_streams: summarizeStringList(details.unreadable_streams, limit),
|
|
744
|
-
hash_mismatches: summarizeStringList(details.hash_mismatches, limit),
|
|
745
|
-
chain_mismatches: summarizeStringList(details.chain_mismatches, limit),
|
|
746
|
-
skipped: details.skipped
|
|
747
|
-
}),
|
|
748
|
-
vectorization: (details, limit) => ({
|
|
749
|
-
semantic_runtime_available: details.semantic_runtime_available,
|
|
750
|
-
compatibility_mode_auto_defaults: details.compatibility_mode_auto_defaults,
|
|
751
|
-
auto_ollama_defaults_applied: details.auto_ollama_defaults_applied,
|
|
752
|
-
refresh_policy: details.refresh_policy,
|
|
753
|
-
provider_active: details.provider_active,
|
|
754
|
-
vector_store_active: details.vector_store_active,
|
|
755
|
-
items: details.items,
|
|
756
|
-
ledger_entries_before: details.ledger_entries_before,
|
|
757
|
-
stale_items_before_total: details.stale_items_before_total,
|
|
758
|
-
stale_items_before: summarizeStringList(details.stale_items_before, limit),
|
|
759
|
-
refresh_attempted: details.refresh_attempted,
|
|
760
|
-
refresh_skipped_reason: details.refresh_skipped_reason,
|
|
761
|
-
refresh_result: details.refresh_result,
|
|
762
|
-
ledger_entries_after: details.ledger_entries_after,
|
|
763
|
-
stale_items_after_total: details.stale_items_after_total,
|
|
764
|
-
stale_items_after: summarizeStringList(details.stale_items_after, limit),
|
|
765
|
-
skipped: details.skipped
|
|
766
|
-
})
|
|
767
|
-
};
|
|
768
|
-
function summarizeHealthCheckDetails(check, limit) {
|
|
769
|
-
const summarize = HEALTH_DETAIL_SUMMARIZERS[check.name];
|
|
770
|
-
return summarize ? summarize(check.details, limit) : check.details;
|
|
771
|
-
}
|
|
772
|
-
function applyBriefHealthProjection(result) {
|
|
773
|
-
const warningsSummary = summarizeStringList(result.warnings, BRIEF_HEALTH_DETAIL_LIMIT);
|
|
774
|
-
return {
|
|
775
|
-
ok: result.ok,
|
|
776
|
-
checks: result.checks.map((check) => ({
|
|
777
|
-
name: check.name,
|
|
778
|
-
status: check.status,
|
|
779
|
-
details: summarizeHealthCheckDetails(check, BRIEF_HEALTH_DETAIL_LIMIT)
|
|
780
|
-
})),
|
|
781
|
-
warnings: warningsSummary.sample,
|
|
782
|
-
projection: {
|
|
783
|
-
mode: "brief",
|
|
784
|
-
warning_count: warningsSummary.count,
|
|
785
|
-
warnings_truncated: warningsSummary.truncated,
|
|
786
|
-
detail_limit: BRIEF_HEALTH_DETAIL_LIMIT
|
|
787
|
-
},
|
|
788
|
-
generated_at: result.generated_at
|
|
789
|
-
};
|
|
790
|
-
}
|
|
791
|
-
function isSkippedHealthCheck(check) {
|
|
792
|
-
return check.details.skipped === true;
|
|
793
|
-
}
|
|
794
|
-
function applySummaryHealthProjection(result) {
|
|
795
|
-
const warningsSummary = summarizeStringList(result.warnings, BRIEF_HEALTH_DETAIL_LIMIT);
|
|
796
|
-
const omittedChecks = result.checks.filter(isSkippedHealthCheck).map((check) => check.name);
|
|
797
|
-
return {
|
|
798
|
-
ok: result.ok,
|
|
799
|
-
checks: result.checks.filter((check) => !isSkippedHealthCheck(check)).map((check) => ({
|
|
800
|
-
name: check.name,
|
|
801
|
-
status: check.status,
|
|
802
|
-
details: {}
|
|
803
|
-
})),
|
|
804
|
-
warning_count: warningsSummary.count,
|
|
805
|
-
warnings: warningsSummary.sample,
|
|
806
|
-
projection: {
|
|
807
|
-
mode: "summary",
|
|
808
|
-
warning_count: warningsSummary.count,
|
|
809
|
-
warnings_truncated: warningsSummary.truncated,
|
|
810
|
-
detail_limit: BRIEF_HEALTH_DETAIL_LIMIT,
|
|
811
|
-
omitted_checks: omittedChecks
|
|
812
|
-
},
|
|
813
|
-
generated_at: result.generated_at
|
|
814
|
-
};
|
|
815
|
-
}
|
|
816
|
-
function selectStaleItemDetail(values, verboseStaleItems) {
|
|
817
|
-
if (verboseStaleItems) {
|
|
818
|
-
return {
|
|
819
|
-
values,
|
|
820
|
-
truncated: false,
|
|
821
|
-
total: values.length
|
|
822
|
-
};
|
|
823
|
-
}
|
|
824
|
-
const summary = summarizeList(values, STALE_VECTORIZATION_SUMMARY_LIMIT);
|
|
825
|
-
return {
|
|
826
|
-
values: summary.values,
|
|
827
|
-
truncated: summary.truncated,
|
|
828
|
-
total: values.length
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
function telemetryEnvFlagEnabled(envKey) {
|
|
832
|
-
const value = (process.env[envKey] ?? "").trim().toLowerCase();
|
|
833
|
-
return value === "1" || value === "true" || value === "yes" || value === "on";
|
|
834
|
-
}
|
|
835
|
-
function telemetrySourceContextOverride() {
|
|
836
|
-
const value = (process.env.PM_TELEMETRY_SOURCE_CONTEXT ?? "").trim().toLowerCase();
|
|
837
|
-
return PM_TELEMETRY_SOURCE_CONTEXT_SET.has(value) ? value : null;
|
|
838
|
-
}
|
|
839
|
-
function normalizeEndpointForDisplay(rawEndpoint) {
|
|
840
|
-
const trimmed = rawEndpoint.trim();
|
|
841
|
-
if (trimmed.length === 0) {
|
|
842
|
-
return "";
|
|
843
|
-
}
|
|
844
|
-
try {
|
|
845
|
-
const parsed = new URL(trimmed);
|
|
846
|
-
parsed.username = "";
|
|
847
|
-
parsed.password = "";
|
|
848
|
-
parsed.search = "";
|
|
849
|
-
parsed.hash = "";
|
|
850
|
-
return parsed.toString();
|
|
851
|
-
} catch {
|
|
852
|
-
return trimmed;
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
function parseTelemetryQueue(raw) {
|
|
856
|
-
let validEntries = 0;
|
|
857
|
-
let invalidRows = 0;
|
|
858
|
-
let totalRows = 0;
|
|
859
|
-
let highRetryEntries = 0;
|
|
860
|
-
let maxAttempts = 0;
|
|
861
|
-
for (const line of raw.split("\n")) {
|
|
862
|
-
const trimmed = line.trim();
|
|
863
|
-
if (trimmed.length === 0) {
|
|
864
|
-
continue;
|
|
865
|
-
}
|
|
866
|
-
totalRows += 1;
|
|
867
|
-
try {
|
|
868
|
-
const parsed = JSON.parse(trimmed);
|
|
869
|
-
if (typeof parsed === "object" && parsed !== null && typeof parsed.attempts === "number" && Number.isFinite(parsed.attempts)) {
|
|
870
|
-
const attempts = Math.max(0, Math.trunc(parsed.attempts));
|
|
871
|
-
validEntries += 1;
|
|
872
|
-
maxAttempts = Math.max(maxAttempts, attempts);
|
|
873
|
-
if (attempts >= TELEMETRY_QUEUE_HIGH_RETRY_THRESHOLD) {
|
|
874
|
-
highRetryEntries += 1;
|
|
875
|
-
}
|
|
876
|
-
} else {
|
|
877
|
-
invalidRows += 1;
|
|
878
|
-
}
|
|
879
|
-
} catch {
|
|
880
|
-
invalidRows += 1;
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
return {
|
|
884
|
-
validEntries,
|
|
885
|
-
invalidRows,
|
|
886
|
-
totalRows,
|
|
887
|
-
highRetryEntries,
|
|
888
|
-
maxAttempts
|
|
889
|
-
};
|
|
890
|
-
}
|
|
891
|
-
function emptyTelemetryQueueSummary() {
|
|
892
|
-
return { validEntries: 0, invalidRows: 0, totalRows: 0, highRetryEntries: 0, maxAttempts: 0 };
|
|
893
|
-
}
|
|
894
|
-
function parseTelemetryRuntimeState(stateRaw) {
|
|
895
|
-
if (!stateRaw || stateRaw.trim().length === 0) {
|
|
896
|
-
return { runtimeState: {}, stateParseFailed: false };
|
|
897
|
-
}
|
|
898
|
-
try {
|
|
899
|
-
const parsed = JSON.parse(stateRaw);
|
|
900
|
-
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
901
|
-
return { runtimeState: parsed, stateParseFailed: false };
|
|
902
|
-
}
|
|
903
|
-
return { runtimeState: {}, stateParseFailed: true };
|
|
904
|
-
} catch {
|
|
905
|
-
return { runtimeState: {}, stateParseFailed: true };
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
async function maybeProbeTelemetryEndpoint(settings, checkTelemetry) {
|
|
909
|
-
const endpoint = settings.telemetry.endpoint.trim();
|
|
910
|
-
if (!checkTelemetry || !settings.telemetry.enabled || endpoint.length === 0) {
|
|
911
|
-
return void 0;
|
|
912
|
-
}
|
|
913
|
-
const probe = await probeTelemetryEndpointHealth(endpoint);
|
|
914
|
-
return {
|
|
915
|
-
attempted: true,
|
|
916
|
-
...probe
|
|
917
|
-
};
|
|
918
|
-
}
|
|
919
|
-
function collectTelemetryQueueWarnings(settings, queueSummary, runtimeState) {
|
|
920
|
-
const warnings = [];
|
|
921
|
-
if (queueSummary.invalidRows > 0) {
|
|
922
|
-
warnings.push(`telemetry_queue_invalid_rows:${queueSummary.invalidRows}`);
|
|
923
|
-
}
|
|
924
|
-
if (!settings.telemetry.enabled || queueSummary.validEntries === 0) {
|
|
925
|
-
return warnings;
|
|
926
|
-
}
|
|
927
|
-
const lastSuccess = runtimeState.last_successful_flush_at;
|
|
928
|
-
const lastFailure = runtimeState.last_failed_flush_at;
|
|
929
|
-
const activeFailure = lastFailure && (!lastSuccess || lastFailure > lastSuccess);
|
|
930
|
-
const neverFlushed = !lastSuccess;
|
|
931
|
-
const highWater = queueSummary.validEntries >= TELEMETRY_QUEUE_HIGH_WATER_MARK;
|
|
932
|
-
if (activeFailure || neverFlushed || highWater) {
|
|
933
|
-
warnings.push(`telemetry_queue_pending:${queueSummary.validEntries}`);
|
|
934
|
-
}
|
|
935
|
-
if (queueSummary.highRetryEntries > 0) {
|
|
936
|
-
warnings.push(`telemetry_queue_high_retries:${queueSummary.highRetryEntries}`);
|
|
937
|
-
}
|
|
938
|
-
return warnings;
|
|
939
|
-
}
|
|
940
|
-
function collectTelemetryEndpointWarnings(endpointProbe) {
|
|
941
|
-
if (!endpointProbe || endpointProbe.ok !== false) {
|
|
942
|
-
return [];
|
|
943
|
-
}
|
|
944
|
-
return typeof endpointProbe.status === "number" ? [`telemetry_endpoint_probe_http_status:${endpointProbe.status}`] : ["telemetry_endpoint_probe_failed"];
|
|
945
|
-
}
|
|
946
|
-
function collectTelemetrySchemaWarnings(endpointProbe) {
|
|
947
|
-
const parsedMaxSchemaVersion = Number.parseInt(endpointProbe?.max_schema_version ?? "", 10);
|
|
948
|
-
if (endpointProbe?.ok === true && Number.isInteger(parsedMaxSchemaVersion) && parsedMaxSchemaVersion > TELEMETRY_SCHEMA_VERSION) {
|
|
949
|
-
return [`telemetry_schema_version_behind:${parsedMaxSchemaVersion}`];
|
|
950
|
-
}
|
|
951
|
-
return [];
|
|
952
|
-
}
|
|
953
|
-
function collectTelemetryOtelWarnings(settings, runtimeState) {
|
|
954
|
-
const pendingOtelSpans = typeof runtimeState.pending_otel_spans === "number" ? runtimeState.pending_otel_spans : 0;
|
|
955
|
-
const lastOtelSuccess = runtimeState.last_otel_success_at;
|
|
956
|
-
const lastOtelFailure = runtimeState.last_otel_failure_at;
|
|
957
|
-
const otelExportFailing = settings.telemetry.enabled && pendingOtelSpans > 0 && Boolean(lastOtelFailure) && // >= so a mixed-outcome batch (success + failure share the same attempt
|
|
958
|
-
// timestamp) still surfaces the warning rather than being masked by the tie.
|
|
959
|
-
(!lastOtelSuccess || lastOtelFailure >= lastOtelSuccess);
|
|
960
|
-
return otelExportFailing ? [`telemetry_otel_export_failing:${pendingOtelSpans}`] : [];
|
|
961
|
-
}
|
|
962
|
-
function buildTelemetryEnvOverrideDetails() {
|
|
963
|
-
return {
|
|
964
|
-
telemetry_disabled: telemetryEnvFlagEnabled("PM_TELEMETRY_DISABLED") || telemetryEnvFlagEnabled("PM_NO_TELEMETRY"),
|
|
965
|
-
pm_no_telemetry: telemetryEnvFlagEnabled("PM_NO_TELEMETRY"),
|
|
966
|
-
telemetry_otel_disabled: telemetryEnvFlagEnabled("PM_TELEMETRY_OTEL_DISABLED"),
|
|
967
|
-
telemetry_inline_flush: telemetryEnvFlagEnabled("PM_TELEMETRY_INLINE_FLUSH"),
|
|
968
|
-
telemetry_source_context: telemetrySourceContextOverride()
|
|
969
|
-
};
|
|
970
|
-
}
|
|
971
|
-
function telemetryQueueHasEntries(settings, queueSummary) {
|
|
972
|
-
return settings.telemetry.enabled && queueSummary.validEntries > 0;
|
|
973
|
-
}
|
|
974
|
-
function isTelemetryQueueDraining(queueHasEntries, warnings) {
|
|
975
|
-
return queueHasEntries && warnings.every((warning) => !warning.startsWith("telemetry_queue_pending:") && !warning.startsWith("telemetry_queue_high_retries:"));
|
|
976
|
-
}
|
|
977
|
-
async function probeTelemetryEndpointHealth(endpoint) {
|
|
978
|
-
let probeUrl = endpoint;
|
|
979
|
-
try {
|
|
980
|
-
const parsed = new URL(endpoint);
|
|
981
|
-
parsed.pathname = "/healthz";
|
|
982
|
-
parsed.search = "";
|
|
983
|
-
parsed.hash = "";
|
|
984
|
-
probeUrl = parsed.toString();
|
|
985
|
-
} catch {
|
|
986
|
-
}
|
|
987
|
-
try {
|
|
988
|
-
const response = await fetch(probeUrl, {
|
|
989
|
-
method: "GET",
|
|
990
|
-
signal: AbortSignal.timeout(TELEMETRY_ENDPOINT_PROBE_TIMEOUT_MS)
|
|
991
|
-
});
|
|
992
|
-
return {
|
|
993
|
-
probe_url: normalizeEndpointForDisplay(probeUrl),
|
|
994
|
-
ok: response.ok,
|
|
995
|
-
status: response.status,
|
|
996
|
-
max_schema_version: (() => {
|
|
997
|
-
for (const headerName of TELEMETRY_SERVER_MAX_SCHEMA_VERSION_HEADERS) {
|
|
998
|
-
const value = response.headers.get(headerName)?.trim();
|
|
999
|
-
if (value && value.length > 0) {
|
|
1000
|
-
return value;
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
return void 0;
|
|
1004
|
-
})()
|
|
1005
|
-
};
|
|
1006
|
-
} catch (error) {
|
|
1007
|
-
return {
|
|
1008
|
-
probe_url: normalizeEndpointForDisplay(probeUrl),
|
|
1009
|
-
ok: false,
|
|
1010
|
-
/* c8 ignore next -- non-Error throwables require transport-layer fault injection */
|
|
1011
|
-
error: error instanceof Error ? error.message : "probe_failed"
|
|
1012
|
-
};
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
async function buildTelemetryCheck(settings, options) {
|
|
1016
|
-
const globalPmRoot = resolveGlobalPmRoot(process.cwd());
|
|
1017
|
-
const queuePath = path.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH);
|
|
1018
|
-
const statePath = path.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH);
|
|
1019
|
-
const queueRaw = await readFileIfExists(queuePath);
|
|
1020
|
-
const queueExists = queueRaw !== null;
|
|
1021
|
-
const queueSizeBytes = queueRaw ? Buffer.byteLength(queueRaw, "utf8") : 0;
|
|
1022
|
-
const queueSummary = queueRaw ? parseTelemetryQueue(queueRaw) : emptyTelemetryQueueSummary();
|
|
1023
|
-
const stateRaw = await readFileIfExists(statePath);
|
|
1024
|
-
const { runtimeState, stateParseFailed } = parseTelemetryRuntimeState(stateRaw);
|
|
1025
|
-
const endpoint = settings.telemetry.endpoint.trim();
|
|
1026
|
-
const endpointDisplay = normalizeEndpointForDisplay(endpoint);
|
|
1027
|
-
const endpointProbe = await maybeProbeTelemetryEndpoint(settings, options.checkTelemetry);
|
|
1028
|
-
const warnings = [];
|
|
1029
|
-
if (stateParseFailed) {
|
|
1030
|
-
warnings.push("telemetry_state_invalid_json");
|
|
1031
|
-
}
|
|
1032
|
-
warnings.push(...collectTelemetryQueueWarnings(settings, queueSummary, runtimeState), ...collectTelemetryEndpointWarnings(endpointProbe), ...collectTelemetrySchemaWarnings(endpointProbe), ...collectTelemetryOtelWarnings(settings, runtimeState));
|
|
1033
|
-
const queueHasEntries = telemetryQueueHasEntries(settings, queueSummary);
|
|
1034
|
-
const pendingOtelSpans = typeof runtimeState.pending_otel_spans === "number" ? runtimeState.pending_otel_spans : 0;
|
|
1035
|
-
return {
|
|
1036
|
-
check: {
|
|
1037
|
-
name: "telemetry",
|
|
1038
|
-
status: warnings.length === 0 ? "ok" : "warn",
|
|
1039
|
-
details: {
|
|
1040
|
-
enabled: settings.telemetry.enabled,
|
|
1041
|
-
capture_level: settings.telemetry.capture_level,
|
|
1042
|
-
endpoint: endpointDisplay,
|
|
1043
|
-
global_pm_root: globalPmRoot,
|
|
1044
|
-
queue_path: queuePath,
|
|
1045
|
-
queue_exists: queueExists,
|
|
1046
|
-
queue_entries: queueSummary.validEntries,
|
|
1047
|
-
queue_draining: isTelemetryQueueDraining(queueHasEntries, warnings),
|
|
1048
|
-
queue_invalid_rows: queueSummary.invalidRows,
|
|
1049
|
-
queue_rows_total: queueSummary.totalRows,
|
|
1050
|
-
queue_size_bytes: queueSizeBytes,
|
|
1051
|
-
queue_high_retry_entries: queueSummary.highRetryEntries,
|
|
1052
|
-
queue_high_retry_threshold: TELEMETRY_QUEUE_HIGH_RETRY_THRESHOLD,
|
|
1053
|
-
queue_max_attempts: queueSummary.maxAttempts,
|
|
1054
|
-
runtime_state_path: statePath,
|
|
1055
|
-
last_attempted_flush_at: runtimeState.last_attempted_flush_at ?? null,
|
|
1056
|
-
last_successful_flush_at: runtimeState.last_successful_flush_at ?? null,
|
|
1057
|
-
last_failed_flush_at: runtimeState.last_failed_flush_at ?? null,
|
|
1058
|
-
last_failed_flush_error: runtimeState.last_failed_flush_error ?? null,
|
|
1059
|
-
pending_otel_spans: pendingOtelSpans,
|
|
1060
|
-
last_otel_attempt_at: runtimeState.last_otel_attempt_at ?? null,
|
|
1061
|
-
last_otel_success_at: runtimeState.last_otel_success_at ?? null,
|
|
1062
|
-
last_otel_failure_at: runtimeState.last_otel_failure_at ?? null,
|
|
1063
|
-
last_otel_failure_error: runtimeState.last_otel_failure_error ?? null,
|
|
1064
|
-
endpoint_probe: endpointProbe ?? { attempted: false },
|
|
1065
|
-
env_overrides: buildTelemetryEnvOverrideDetails()
|
|
1066
|
-
}
|
|
1067
|
-
},
|
|
1068
|
-
warnings
|
|
1069
|
-
};
|
|
1070
|
-
}
|
|
1071
|
-
async function buildLocksCheck(pmRoot) {
|
|
1072
|
-
let scan;
|
|
1073
|
-
try {
|
|
1074
|
-
scan = await scanLockHealth(pmRoot);
|
|
1075
|
-
} catch (error) {
|
|
1076
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1077
|
-
return {
|
|
1078
|
-
check: {
|
|
1079
|
-
name: "locks",
|
|
1080
|
-
status: "warn",
|
|
1081
|
-
details: {
|
|
1082
|
-
active_lock_count: 0,
|
|
1083
|
-
stale_lock_count: 0,
|
|
1084
|
-
unreadable_lock_count: 0,
|
|
1085
|
-
unparseable_lock_count: 0,
|
|
1086
|
-
scan_failed: true,
|
|
1087
|
-
error: message,
|
|
1088
|
-
pm_root: pmRoot
|
|
1089
|
-
}
|
|
1090
|
-
},
|
|
1091
|
-
warnings: [`locks_scan_failed:${message}`]
|
|
1092
|
-
};
|
|
1093
|
-
}
|
|
1094
|
-
const warnings = [];
|
|
1095
|
-
if (scan.stale_lock_count > 0) {
|
|
1096
|
-
warnings.push(`locks_stale_count:${scan.stale_lock_count}`);
|
|
1097
|
-
}
|
|
1098
|
-
if (scan.unreadable_lock_count > 0) {
|
|
1099
|
-
warnings.push(`locks_unreadable:${scan.unreadable_lock_count}`);
|
|
1100
|
-
}
|
|
1101
|
-
return {
|
|
1102
|
-
check: {
|
|
1103
|
-
name: "locks",
|
|
1104
|
-
status: warnings.length === 0 ? "ok" : "warn",
|
|
1105
|
-
details: {
|
|
1106
|
-
active_lock_count: scan.active_lock_count,
|
|
1107
|
-
stale_lock_count: scan.stale_lock_count,
|
|
1108
|
-
unreadable_lock_count: scan.unreadable_lock_count,
|
|
1109
|
-
unparseable_lock_count: scan.unparseable_lock_count
|
|
1110
|
-
}
|
|
1111
|
-
},
|
|
1112
|
-
warnings
|
|
1113
|
-
};
|
|
1114
|
-
}
|
|
1115
|
-
async function buildHistoryDriftCheck(pmRoot, items) {
|
|
1116
|
-
const cacheHitVerification = "metadata";
|
|
1117
|
-
const { missingStreams, unreadableStreams, hashMismatches, chainMismatches, driftedItems } = await scanHistoryDrift(pmRoot, items, { cacheHitVerification });
|
|
1118
|
-
const warnings = [
|
|
1119
|
-
...missingStreams.map((id) => `history_drift_missing_stream:${id}`),
|
|
1120
|
-
...unreadableStreams.map((id) => `history_drift_unreadable_stream:${id}`),
|
|
1121
|
-
...hashMismatches.map((id) => `history_drift_hash_mismatch:${id}`),
|
|
1122
|
-
...chainMismatches.map((id) => `history_drift_chain_mismatch:${id}`)
|
|
1123
|
-
];
|
|
1124
|
-
return {
|
|
1125
|
-
check: {
|
|
1126
|
-
name: "history_drift",
|
|
1127
|
-
status: warnings.length === 0 ? "ok" : "warn",
|
|
1128
|
-
details: {
|
|
1129
|
-
checked_items: items.length,
|
|
1130
|
-
cache_hit_verification: cacheHitVerification,
|
|
1131
|
-
drifted_items: driftedItems,
|
|
1132
|
-
counts: {
|
|
1133
|
-
drifted: driftedItems.length,
|
|
1134
|
-
missing_streams: missingStreams.length,
|
|
1135
|
-
unreadable_streams: unreadableStreams.length,
|
|
1136
|
-
hash_mismatches: hashMismatches.length,
|
|
1137
|
-
chain_mismatches: chainMismatches.length
|
|
1138
|
-
},
|
|
1139
|
-
missing_streams: missingStreams,
|
|
1140
|
-
unreadable_streams: unreadableStreams,
|
|
1141
|
-
hash_mismatches: hashMismatches,
|
|
1142
|
-
chain_mismatches: chainMismatches
|
|
1143
|
-
}
|
|
1144
|
-
},
|
|
1145
|
-
warnings
|
|
1146
|
-
};
|
|
1147
|
-
}
|
|
1148
|
-
function buildVectorizationRuntimeSnapshot(settings) {
|
|
1149
|
-
const runtimeDefaults = resolveSettingsWithSemanticRuntimeDefaults(settings);
|
|
1150
|
-
const providerResolution = resolveEmbeddingProviders(runtimeDefaults.settings);
|
|
1151
|
-
const vectorStoreResolution = resolveVectorStores(runtimeDefaults.settings);
|
|
1152
|
-
const runtimeEmbeddingIdentity = providerResolution.active ? buildVectorizationEmbeddingIdentity(providerResolution.active.name, providerResolution.active.model) : null;
|
|
1153
|
-
return {
|
|
1154
|
-
runtimeDefaults,
|
|
1155
|
-
providerResolution,
|
|
1156
|
-
vectorStoreResolution,
|
|
1157
|
-
runtimeEmbeddingIdentity,
|
|
1158
|
-
semanticRuntimeAvailable: Boolean(providerResolution.active && vectorStoreResolution.active)
|
|
1159
|
-
};
|
|
1160
|
-
}
|
|
1161
|
-
function emptyVectorizationRefreshResult() {
|
|
1162
|
-
return {
|
|
1163
|
-
refreshed: [],
|
|
1164
|
-
skipped: [],
|
|
1165
|
-
warnings: []
|
|
1166
|
-
};
|
|
1167
|
-
}
|
|
1168
|
-
async function refreshStaleVectorizationItems(params) {
|
|
1169
|
-
if (!params.refreshPolicy.enabled || !params.snapshot.semanticRuntimeAvailable || params.staleBefore.length === 0) {
|
|
1170
|
-
return emptyVectorizationRefreshResult();
|
|
1171
|
-
}
|
|
1172
|
-
return refreshSemanticEmbeddingsForMutatedItems(params.pmRoot, params.staleBefore, {
|
|
1173
|
-
settings: params.snapshot.runtimeDefaults.settings,
|
|
1174
|
-
apply_runtime_defaults: false
|
|
1175
|
-
});
|
|
1176
|
-
}
|
|
1177
|
-
function vectorizationEmbeddingIdentityChanged(params) {
|
|
1178
|
-
return params.strictVectorizationWarnings && params.semanticRuntimeAvailable && Boolean(params.ledgerBefore.embedding && params.runtimeEmbeddingIdentity && hasVectorizationEmbeddingIdentityChanged(params.ledgerBefore.embedding, params.runtimeEmbeddingIdentity));
|
|
1179
|
-
}
|
|
1180
|
-
function collectVectorizationWarnings(params) {
|
|
1181
|
-
const warningSet = /* @__PURE__ */ new Set([...params.ledgerBefore.warnings, ...params.ledgerAfter.warnings]);
|
|
1182
|
-
if (params.strictVectorizationWarnings) {
|
|
1183
|
-
for (const warning of params.refreshResult.warnings) {
|
|
1184
|
-
warningSet.add(warning);
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
if (params.embeddingIdentityChanged) {
|
|
1188
|
-
warningSet.add("vectorization_embedding_identity_changed");
|
|
1189
|
-
}
|
|
1190
|
-
if (params.strictVectorizationWarnings && params.semanticRuntimeAvailable && params.staleAfter.length > 0) {
|
|
1191
|
-
warningSet.add(`vectorization_stale_items_remaining:${params.staleAfter.length}`);
|
|
1192
|
-
}
|
|
1193
|
-
return [...warningSet].sort((left, right) => left.localeCompare(right));
|
|
1194
|
-
}
|
|
1195
|
-
function resolveVectorizationRefreshSkippedReason(refreshPolicy, semanticRuntimeAvailable, staleBefore) {
|
|
1196
|
-
if (refreshPolicy.enabled && semanticRuntimeAvailable && staleBefore.length > 0) {
|
|
1197
|
-
return null;
|
|
1198
|
-
}
|
|
1199
|
-
if (!refreshPolicy.enabled) {
|
|
1200
|
-
return "refresh_disabled";
|
|
1201
|
-
}
|
|
1202
|
-
return semanticRuntimeAvailable ? "no_stale_items" : "semantic_runtime_unavailable";
|
|
1203
|
-
}
|
|
1204
|
-
function buildVectorizationProviderDetails(settings, snapshot) {
|
|
1205
|
-
const activeProvider = snapshot.providerResolution.active?.name ?? null;
|
|
1206
|
-
const activeVectorStore = snapshot.vectorStoreResolution.active?.name ?? null;
|
|
1207
|
-
return {
|
|
1208
|
-
provider_active: activeProvider,
|
|
1209
|
-
// GH-244: surface the persisted (possibly empty) configured value and
|
|
1210
|
-
// how the active resolution was sourced, so a config audit can tell
|
|
1211
|
-
// "auto-detected" apart from a genuine misconfiguration when
|
|
1212
|
-
// settings.search.provider / vector_store.adapter are empty strings.
|
|
1213
|
-
provider_configured: typeof settings.search?.provider === "string" ? settings.search.provider : null,
|
|
1214
|
-
provider_source: resolveProviderConfigSource(activeProvider, settings.search?.provider ?? null),
|
|
1215
|
-
vector_store_active: activeVectorStore,
|
|
1216
|
-
vector_store_configured: typeof settings.vector_store?.adapter === "string" ? settings.vector_store.adapter : null,
|
|
1217
|
-
vector_store_source: resolveProviderConfigSource(activeVectorStore, settings.vector_store?.adapter ?? null)
|
|
1218
|
-
};
|
|
1219
|
-
}
|
|
1220
|
-
function buildVectorizationRefreshPolicyDetails(refreshPolicy) {
|
|
1221
|
-
return {
|
|
1222
|
-
enabled: refreshPolicy.enabled,
|
|
1223
|
-
check_only: refreshPolicy.checkOnly,
|
|
1224
|
-
no_refresh: refreshPolicy.noRefresh,
|
|
1225
|
-
refresh_vectors: refreshPolicy.refreshVectors
|
|
1226
|
-
};
|
|
1227
|
-
}
|
|
1228
|
-
function vectorizationRefreshAttempted(refreshPolicy, semanticRuntimeAvailable, staleBefore) {
|
|
1229
|
-
return refreshPolicy.enabled && staleBefore.length > 0 && semanticRuntimeAvailable;
|
|
1230
|
-
}
|
|
1231
|
-
async function buildVectorizationCheck(pmRoot, settings, items, refreshPolicy, verboseStaleItems) {
|
|
1232
|
-
const snapshot = buildVectorizationRuntimeSnapshot(settings);
|
|
1233
|
-
const ledgerBefore = await readVectorizationStatusLedger(pmRoot);
|
|
1234
|
-
const staleBefore = snapshot.semanticRuntimeAvailable ? collectStaleVectorizationIds(items, ledgerBefore.entries) : [];
|
|
1235
|
-
const refreshResult = await refreshStaleVectorizationItems({ pmRoot, snapshot, refreshPolicy, staleBefore });
|
|
1236
|
-
const ledgerAfter = await readVectorizationStatusLedger(pmRoot);
|
|
1237
|
-
const staleAfter = snapshot.semanticRuntimeAvailable ? collectStaleVectorizationIds(items, ledgerAfter.entries) : [];
|
|
1238
|
-
const strictVectorizationWarnings = !snapshot.runtimeDefaults.auto_ollama_defaults_applied;
|
|
1239
|
-
const embeddingIdentityChanged = vectorizationEmbeddingIdentityChanged({
|
|
1240
|
-
strictVectorizationWarnings,
|
|
1241
|
-
semanticRuntimeAvailable: snapshot.semanticRuntimeAvailable,
|
|
1242
|
-
ledgerBefore,
|
|
1243
|
-
runtimeEmbeddingIdentity: snapshot.runtimeEmbeddingIdentity
|
|
1244
|
-
});
|
|
1245
|
-
const warnings = collectVectorizationWarnings({
|
|
1246
|
-
ledgerBefore,
|
|
1247
|
-
ledgerAfter,
|
|
1248
|
-
refreshResult,
|
|
1249
|
-
strictVectorizationWarnings,
|
|
1250
|
-
semanticRuntimeAvailable: snapshot.semanticRuntimeAvailable,
|
|
1251
|
-
embeddingIdentityChanged,
|
|
1252
|
-
staleAfter
|
|
1253
|
-
});
|
|
1254
|
-
const staleBeforeDetail = selectStaleItemDetail(staleBefore, verboseStaleItems);
|
|
1255
|
-
const staleAfterDetail = selectStaleItemDetail(staleAfter, verboseStaleItems);
|
|
1256
|
-
const refreshAttempted = vectorizationRefreshAttempted(refreshPolicy, snapshot.semanticRuntimeAvailable, staleBefore);
|
|
1257
|
-
return {
|
|
1258
|
-
check: {
|
|
1259
|
-
name: "vectorization",
|
|
1260
|
-
status: warnings.length === 0 ? "ok" : "warn",
|
|
1261
|
-
details: {
|
|
1262
|
-
semantic_runtime_available: snapshot.semanticRuntimeAvailable,
|
|
1263
|
-
compatibility_mode_auto_defaults: snapshot.runtimeDefaults.auto_ollama_defaults_applied,
|
|
1264
|
-
auto_ollama_defaults_applied: snapshot.runtimeDefaults.auto_ollama_defaults_applied,
|
|
1265
|
-
refresh_policy: buildVectorizationRefreshPolicyDetails(refreshPolicy),
|
|
1266
|
-
...buildVectorizationProviderDetails(settings, snapshot),
|
|
1267
|
-
embedding_identity_changed: embeddingIdentityChanged,
|
|
1268
|
-
embedding_identity_before: ledgerBefore.embedding ?? null,
|
|
1269
|
-
embedding_identity_runtime: snapshot.runtimeEmbeddingIdentity ?? null,
|
|
1270
|
-
items: items.length,
|
|
1271
|
-
ledger_entries_before: Object.keys(ledgerBefore.entries).length,
|
|
1272
|
-
stale_items_detail_mode: verboseStaleItems ? "full" : "summary",
|
|
1273
|
-
stale_items_summary_limit: STALE_VECTORIZATION_SUMMARY_LIMIT,
|
|
1274
|
-
stale_items_before_total: staleBeforeDetail.total,
|
|
1275
|
-
stale_items_before: staleBeforeDetail.values,
|
|
1276
|
-
stale_items_before_truncated: staleBeforeDetail.truncated,
|
|
1277
|
-
refresh_attempted: refreshAttempted,
|
|
1278
|
-
refresh_skipped_reason: resolveVectorizationRefreshSkippedReason(refreshPolicy, snapshot.semanticRuntimeAvailable, staleBefore),
|
|
1279
|
-
refresh_result: refreshResult,
|
|
1280
|
-
ledger_entries_after: Object.keys(ledgerAfter.entries).length,
|
|
1281
|
-
stale_items_after_total: staleAfterDetail.total,
|
|
1282
|
-
stale_items_after: staleAfterDetail.values,
|
|
1283
|
-
stale_items_after_truncated: staleAfterDetail.truncated
|
|
1284
|
-
}
|
|
1285
|
-
},
|
|
1286
|
-
warnings
|
|
1287
|
-
};
|
|
1288
|
-
}
|
|
1289
|
-
function validateSettingsValues(settings) {
|
|
1290
|
-
const warnings = [];
|
|
1291
|
-
if (settings.id_prefix.trim().length === 0) {
|
|
1292
|
-
warnings.push("settings:id_prefix_empty");
|
|
1293
|
-
}
|
|
1294
|
-
if (settings.locks.ttl_seconds <= 0) {
|
|
1295
|
-
warnings.push("settings:locks_ttl_non_positive");
|
|
1296
|
-
}
|
|
1297
|
-
return warnings;
|
|
1298
|
-
}
|
|
1299
|
-
function resolveVectorRefreshPolicy(options) {
|
|
1300
|
-
const checkOnly = options.checkOnly === true;
|
|
1301
|
-
const noRefresh = options.noRefresh === true || checkOnly;
|
|
1302
|
-
const refreshVectors = options.refreshVectors === true;
|
|
1303
|
-
if (refreshVectors && checkOnly) {
|
|
1304
|
-
throw new PmCliError("--check-only cannot be combined with --refresh-vectors", EXIT_CODE.USAGE);
|
|
1305
|
-
}
|
|
1306
|
-
if (refreshVectors && options.noRefresh === true) {
|
|
1307
|
-
throw new PmCliError("--no-refresh cannot be combined with --refresh-vectors", EXIT_CODE.USAGE);
|
|
1308
|
-
}
|
|
1309
|
-
return {
|
|
1310
|
-
enabled: refreshVectors || !noRefresh,
|
|
1311
|
-
checkOnly,
|
|
1312
|
-
noRefresh,
|
|
1313
|
-
refreshVectors
|
|
1314
|
-
};
|
|
1315
|
-
}
|
|
1316
|
-
function resolveHealthDirectoryLists(typeRegistry) {
|
|
1317
|
-
const optionalBuiltinDirs = new Set(PM_OPTIONAL_TYPE_SUBDIRS.filter((entry) => entry.length > 0));
|
|
1318
|
-
const requiredDirSet = new Set(PM_CORE_REQUIRED_SUBDIRS.filter((entry) => entry.length > 0));
|
|
1319
|
-
const optionalDirSet = /* @__PURE__ */ new Set();
|
|
1320
|
-
for (const folder of typeRegistry.folders) {
|
|
1321
|
-
if (optionalBuiltinDirs.has(folder)) {
|
|
1322
|
-
optionalDirSet.add(folder);
|
|
1323
|
-
continue;
|
|
1324
|
-
}
|
|
1325
|
-
requiredDirSet.add(folder);
|
|
1326
|
-
}
|
|
1327
|
-
return {
|
|
1328
|
-
requiredDirs: [...requiredDirSet].sort((left, right) => left.localeCompare(right)),
|
|
1329
|
-
optionalDirs: [...optionalDirSet].sort((left, right) => left.localeCompare(right)),
|
|
1330
|
-
optionalDirSet
|
|
1331
|
-
};
|
|
1332
|
-
}
|
|
1333
|
-
async function scanHealthDirectories(pmRoot, typeRegistry, strictDirectories) {
|
|
1334
|
-
const { requiredDirs, optionalDirs, optionalDirSet } = resolveHealthDirectoryLists(typeRegistry);
|
|
1335
|
-
const missingRequiredDirs = [];
|
|
1336
|
-
const missingOptionalDirs = [];
|
|
1337
|
-
const hookWarnings = [];
|
|
1338
|
-
for (const relativeDir of [...requiredDirs, ...optionalDirs]) {
|
|
1339
|
-
const directoryPath = path.join(pmRoot, relativeDir);
|
|
1340
|
-
hookWarnings.push(...await runActiveOnReadHooks({ path: directoryPath, scope: "project" }));
|
|
1341
|
-
if (await isDirectory(directoryPath)) {
|
|
1342
|
-
continue;
|
|
1343
|
-
}
|
|
1344
|
-
if (optionalDirSet.has(relativeDir)) {
|
|
1345
|
-
missingOptionalDirs.push(relativeDir);
|
|
1346
|
-
} else {
|
|
1347
|
-
missingRequiredDirs.push(relativeDir);
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
return {
|
|
1351
|
-
requiredDirs,
|
|
1352
|
-
optionalDirs,
|
|
1353
|
-
missingRequiredDirs,
|
|
1354
|
-
missingOptionalDirs,
|
|
1355
|
-
missingDirs: strictDirectories ? [...missingRequiredDirs, ...missingOptionalDirs] : [...missingRequiredDirs],
|
|
1356
|
-
hookWarnings
|
|
1357
|
-
};
|
|
1358
|
-
}
|
|
1359
|
-
function resolveHealthSkipPolicy(options) {
|
|
1360
|
-
const summaryMode = options.summary === true && options.full !== true;
|
|
1361
|
-
const fastProjectionCheckOnly = options.checkOnly === true && (options.brief === true || options.summary === true) && options.full !== true;
|
|
1362
|
-
return {
|
|
1363
|
-
summaryMode,
|
|
1364
|
-
skipIntegrity: (options.skipIntegrity === true || fastProjectionCheckOnly) && options.full !== true,
|
|
1365
|
-
skipDrift: (options.skipDrift === true || fastProjectionCheckOnly) && options.full !== true,
|
|
1366
|
-
skipVectors: (options.skipVectors === true || fastProjectionCheckOnly) && options.full !== true
|
|
1367
|
-
};
|
|
1368
|
-
}
|
|
1369
|
-
async function readHealthItems(params) {
|
|
1370
|
-
if (params.skipPolicy.skipDrift && params.skipPolicy.skipVectors) {
|
|
1371
|
-
return listAllFrontMatter(params.pmRoot, params.settings.item_format, params.typeRegistry.type_to_folder, params.itemReadWarnings, params.settings.schema);
|
|
1372
|
-
}
|
|
1373
|
-
return listAllFrontMatterWithBody(params.pmRoot, params.settings.item_format, params.typeRegistry.type_to_folder, params.itemReadWarnings, params.settings.schema);
|
|
1374
|
-
}
|
|
1375
|
-
function buildSkippedHealthCheck(name) {
|
|
1376
|
-
return { check: { name, status: "ok", details: { skipped: true } }, warnings: [] };
|
|
1377
|
-
}
|
|
1378
|
-
function buildSettingsHealthCheck(settingsPath, settings, normalizedSettingsReadWarnings) {
|
|
1379
|
-
return {
|
|
1380
|
-
name: "settings",
|
|
1381
|
-
/* c8 ignore next -- settings read-warning status split is covered in broader read-settings integration tests */
|
|
1382
|
-
status: normalizedSettingsReadWarnings.length === 0 ? "ok" : "warn",
|
|
1383
|
-
details: {
|
|
1384
|
-
path: settingsPath,
|
|
1385
|
-
version: settings.version,
|
|
1386
|
-
id_prefix: settings.id_prefix,
|
|
1387
|
-
locks_ttl_seconds: settings.locks.ttl_seconds,
|
|
1388
|
-
warnings: normalizedSettingsReadWarnings
|
|
1389
|
-
}
|
|
1390
|
-
};
|
|
1391
|
-
}
|
|
1392
|
-
function buildDirectoriesHealthCheck(directoryState, strictDirectories) {
|
|
1393
|
-
return {
|
|
1394
|
-
name: "directories",
|
|
1395
|
-
status: directoryState.missingDirs.length === 0 ? "ok" : "warn",
|
|
1396
|
-
details: {
|
|
1397
|
-
required: directoryState.requiredDirs,
|
|
1398
|
-
optional: directoryState.optionalDirs,
|
|
1399
|
-
missing_required: directoryState.missingRequiredDirs,
|
|
1400
|
-
missing_optional: directoryState.missingOptionalDirs,
|
|
1401
|
-
missing: directoryState.missingDirs,
|
|
1402
|
-
strict_directories: strictDirectories
|
|
1403
|
-
}
|
|
1404
|
-
};
|
|
1405
|
-
}
|
|
1406
|
-
function buildSettingsValuesHealthCheck(settingWarnings) {
|
|
1407
|
-
return {
|
|
1408
|
-
name: "settings_values",
|
|
1409
|
-
status: settingWarnings.length === 0 ? "ok" : "warn",
|
|
1410
|
-
details: { warnings: settingWarnings }
|
|
1411
|
-
};
|
|
1412
|
-
}
|
|
1413
|
-
function buildStorageHealthCheck(items, settings, historySummary) {
|
|
1414
|
-
return {
|
|
1415
|
-
name: "storage",
|
|
1416
|
-
status: historySummary.over_threshold.length === 0 ? "ok" : "warn",
|
|
1417
|
-
details: {
|
|
1418
|
-
items: items.length,
|
|
1419
|
-
history_streams: historySummary.count,
|
|
1420
|
-
...historySummary.max_entries !== null ? {
|
|
1421
|
-
compact_policy: {
|
|
1422
|
-
enabled: settings.history.compact_policy.enabled,
|
|
1423
|
-
max_entries: historySummary.max_entries,
|
|
1424
|
-
trigger: settings.history.compact_policy.trigger,
|
|
1425
|
-
over_threshold_count: historySummary.over_threshold.length,
|
|
1426
|
-
over_threshold: historySummary.over_threshold
|
|
1427
|
-
}
|
|
1428
|
-
} : {}
|
|
1429
|
-
}
|
|
1430
|
-
};
|
|
1431
|
-
}
|
|
1432
|
-
function collectHealthWarnings(params) {
|
|
1433
|
-
const warnings = [
|
|
1434
|
-
...params.directoryState.missingDirs.map((dir) => `missing_directory:${dir}`),
|
|
1435
|
-
...params.normalizedSettingsReadWarnings,
|
|
1436
|
-
...params.settingWarnings,
|
|
1437
|
-
...params.normalizedItemReadWarnings,
|
|
1438
|
-
...params.telemetryCheck.warnings,
|
|
1439
|
-
...params.extensionCheck.warnings,
|
|
1440
|
-
...params.historyPolicyWarnings,
|
|
1441
|
-
...params.historySummary.warnings,
|
|
1442
|
-
...params.locksCheck.warnings,
|
|
1443
|
-
...params.integrityCheck.warnings,
|
|
1444
|
-
...params.historyDriftCheck.warnings,
|
|
1445
|
-
...params.vectorizationCheck.warnings,
|
|
1446
|
-
...params.directoryState.hookWarnings
|
|
1447
|
-
];
|
|
1448
|
-
return [...new Set(warnings)];
|
|
1449
|
-
}
|
|
1450
|
-
function extractHistoryDriftedCount(historyDriftCheck) {
|
|
1451
|
-
const counts = historyDriftCheck.check.details.counts;
|
|
1452
|
-
return typeof counts?.drifted === "number" ? counts.drifted : 0;
|
|
1453
|
-
}
|
|
1454
|
-
function buildHealthRemediationSources(params) {
|
|
1455
|
-
return {
|
|
1456
|
-
settings: params.normalizedSettingsReadWarnings,
|
|
1457
|
-
directories: params.directoryState.missingDirs.map((dir) => `missing_directory:${dir}`),
|
|
1458
|
-
settings_values: params.settingWarnings,
|
|
1459
|
-
telemetry: params.telemetryCheck.warnings,
|
|
1460
|
-
extensions: params.extensionCheck.warnings,
|
|
1461
|
-
storage: params.historySummary.over_threshold.map((id) => `history_stream_over_compact_threshold:${id}`),
|
|
1462
|
-
locks: params.locksCheck.warnings,
|
|
1463
|
-
integrity: params.integrityCheck.warnings,
|
|
1464
|
-
history_drift: params.historyDriftCheck.warnings,
|
|
1465
|
-
vectorization: params.vectorizationCheck.warnings
|
|
1466
|
-
};
|
|
1467
|
-
}
|
|
1468
|
-
function rewriteBulkHealthRemediation(params) {
|
|
1469
|
-
if (params.check.name === "history_drift" && params.historyDriftedCount > 1) {
|
|
1470
|
-
for (const code of Object.keys(params.remediationMap)) {
|
|
1471
|
-
params.remediationMap[code] = "pm history-repair --all";
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
if (params.check.name === "storage" && params.overThresholdCount > 1) {
|
|
1475
|
-
for (const code of Object.keys(params.remediationMap)) {
|
|
1476
|
-
params.remediationMap[code] = "pm history-compact --all-streams";
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
function attachHealthRemediationMaps(params) {
|
|
1481
|
-
for (const check of params.checks) {
|
|
1482
|
-
const remediationMap = buildRemediationMap(params.remediationSources[check.name]);
|
|
1483
|
-
rewriteBulkHealthRemediation({
|
|
1484
|
-
check,
|
|
1485
|
-
remediationMap,
|
|
1486
|
-
historyDriftedCount: params.historyDriftedCount,
|
|
1487
|
-
overThresholdCount: params.overThresholdCount
|
|
1488
|
-
});
|
|
1489
|
-
if (Object.keys(remediationMap).length > 0) {
|
|
1490
|
-
check.details = { ...check.details, remediation_map: remediationMap };
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
function projectHealthResult(result, options, summaryMode) {
|
|
1495
|
-
if (summaryMode) {
|
|
1496
|
-
return applySummaryHealthProjection(result);
|
|
1497
|
-
}
|
|
1498
|
-
return options.brief === true ? applyBriefHealthProjection(result) : result;
|
|
1499
|
-
}
|
|
1500
|
-
async function runHealth(global, options = {}) {
|
|
1501
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
1502
|
-
const settingsPath = getSettingsPath(pmRoot);
|
|
1503
|
-
if (!await pathExists(settingsPath)) {
|
|
1504
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
1505
|
-
}
|
|
1506
|
-
const { settings, warnings: settingsReadWarnings } = await readSettingsWithMetadata(pmRoot);
|
|
1507
|
-
const normalizedSettingsReadWarnings = [...new Set(settingsReadWarnings)];
|
|
1508
|
-
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
1509
|
-
const strictDirectories = options.strictDirectories === true;
|
|
1510
|
-
const refreshPolicy = resolveVectorRefreshPolicy(options);
|
|
1511
|
-
const directoryState = await scanHealthDirectories(pmRoot, typeRegistry, strictDirectories);
|
|
1512
|
-
const settingWarnings = validateSettingsValues(settings);
|
|
1513
|
-
const telemetryCheck = await buildTelemetryCheck(settings, {
|
|
1514
|
-
checkTelemetry: options.checkTelemetry === true
|
|
1515
|
-
});
|
|
1516
|
-
const extensionCheck = await buildExtensionCheck(pmRoot, settings, Boolean(global.noExtensions));
|
|
1517
|
-
const skipPolicy = resolveHealthSkipPolicy(options);
|
|
1518
|
-
const itemReadWarnings = [];
|
|
1519
|
-
const items = await readHealthItems({ pmRoot, settings, typeRegistry, skipPolicy, itemReadWarnings });
|
|
1520
|
-
const itemsWithBody = items;
|
|
1521
|
-
const normalizedItemReadWarnings = [...new Set(itemReadWarnings)];
|
|
1522
|
-
const historyPolicy = skipPolicy.skipDrift ? { warnings: [] } : await enforceHistoryStreamPolicyForItems({
|
|
1523
|
-
pmRoot,
|
|
1524
|
-
settings,
|
|
1525
|
-
itemIds: items.map((item) => item.id),
|
|
1526
|
-
commandLabel: "health"
|
|
1527
|
-
});
|
|
1528
|
-
const historySummary = await countHistoryStreams(pmRoot, settings.history.compact_policy);
|
|
1529
|
-
const locksCheck = await buildLocksCheck(pmRoot);
|
|
1530
|
-
const integrityCheck = skipPolicy.skipIntegrity ? buildSkippedHealthCheck("integrity") : await buildIntegrityCheck(pmRoot, typeRegistry.type_to_folder, settings.schema);
|
|
1531
|
-
const historyDriftCheck = skipPolicy.skipDrift ? buildSkippedHealthCheck("history_drift") : await buildHistoryDriftCheck(pmRoot, itemsWithBody);
|
|
1532
|
-
const vectorizationCheck = skipPolicy.skipVectors ? buildSkippedHealthCheck("vectorization") : await buildVectorizationCheck(pmRoot, settings, itemsWithBody, refreshPolicy, options.verboseStaleItems === true);
|
|
1533
|
-
const checks = [
|
|
1534
|
-
buildSettingsHealthCheck(settingsPath, settings, normalizedSettingsReadWarnings),
|
|
1535
|
-
buildDirectoriesHealthCheck(directoryState, strictDirectories),
|
|
1536
|
-
buildSettingsValuesHealthCheck(settingWarnings),
|
|
1537
|
-
telemetryCheck.check,
|
|
1538
|
-
extensionCheck.check,
|
|
1539
|
-
buildStorageHealthCheck(items, settings, historySummary),
|
|
1540
|
-
locksCheck.check,
|
|
1541
|
-
integrityCheck.check,
|
|
1542
|
-
historyDriftCheck.check,
|
|
1543
|
-
vectorizationCheck.check
|
|
1544
|
-
];
|
|
1545
|
-
const normalizedWarnings = collectHealthWarnings({
|
|
1546
|
-
directoryState,
|
|
1547
|
-
normalizedSettingsReadWarnings,
|
|
1548
|
-
settingWarnings,
|
|
1549
|
-
normalizedItemReadWarnings,
|
|
1550
|
-
telemetryCheck,
|
|
1551
|
-
extensionCheck,
|
|
1552
|
-
historyPolicyWarnings: historyPolicy.warnings,
|
|
1553
|
-
historySummary,
|
|
1554
|
-
locksCheck,
|
|
1555
|
-
integrityCheck,
|
|
1556
|
-
historyDriftCheck,
|
|
1557
|
-
vectorizationCheck
|
|
1558
|
-
});
|
|
1559
|
-
attachHealthRemediationMaps({
|
|
1560
|
-
checks,
|
|
1561
|
-
remediationSources: buildHealthRemediationSources({
|
|
1562
|
-
directoryState,
|
|
1563
|
-
normalizedSettingsReadWarnings,
|
|
1564
|
-
settingWarnings,
|
|
1565
|
-
telemetryCheck,
|
|
1566
|
-
extensionCheck,
|
|
1567
|
-
historySummary,
|
|
1568
|
-
locksCheck,
|
|
1569
|
-
integrityCheck,
|
|
1570
|
-
historyDriftCheck,
|
|
1571
|
-
vectorizationCheck
|
|
1572
|
-
}),
|
|
1573
|
-
historyDriftedCount: extractHistoryDriftedCount(historyDriftCheck),
|
|
1574
|
-
overThresholdCount: historySummary.over_threshold.length
|
|
1575
|
-
});
|
|
1576
|
-
const blockingWarnings = normalizedWarnings.filter((warning) => !isAdvisoryHealthWarning(warning));
|
|
1577
|
-
const result = {
|
|
1578
|
-
ok: blockingWarnings.length === 0,
|
|
1579
|
-
checks,
|
|
1580
|
-
warnings: normalizedWarnings,
|
|
1581
|
-
generated_at: nowIso()
|
|
1582
|
-
};
|
|
1583
|
-
return projectHealthResult(result, options, skipPolicy.summaryMode);
|
|
1584
|
-
}
|
|
1585
|
-
var _testOnlyHealthCommand = {
|
|
1586
|
-
buildExtensionHealthTriageSummary,
|
|
1587
|
-
buildCapabilityContractMetadata,
|
|
1588
|
-
buildVectorizationProviderDetails,
|
|
1589
|
-
collectUnknownCapabilityGuidance,
|
|
1590
|
-
isAdvisoryHealthWarning,
|
|
1591
|
-
isDirectory,
|
|
1592
|
-
isExpectedUnmanagedExtension,
|
|
1593
|
-
listItemDocumentPaths,
|
|
1594
|
-
normalizeEndpointForDisplay,
|
|
1595
|
-
normalizeExtensionNameForMatch,
|
|
1596
|
-
parseTelemetryQueue,
|
|
1597
|
-
probeTelemetryEndpointHealth,
|
|
1598
|
-
selectStaleItemDetail,
|
|
1599
|
-
summarizeHealthCheckDetails,
|
|
1600
|
-
summarizeExtensionList,
|
|
1601
|
-
summarizeRecordList,
|
|
1602
|
-
summarizeStringList,
|
|
1603
|
-
telemetryEnvFlagEnabled,
|
|
1604
|
-
warningCode
|
|
1605
|
-
};
|
|
1606
|
-
export {
|
|
1607
|
-
_testOnlyHealthCommand,
|
|
1608
|
-
runHealth
|
|
1609
|
-
};
|
|
1610
|
-
//# sourceMappingURL=health-3GVPMQBL.js.map
|
|
1611
|
-
|
|
1612
|
-
//# debugId=62634d0f-673a-5003-a921-d9c65bc0a872
|