@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,288 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
runSearch
|
|
3
|
-
} from "./chunk-5B3X4Y22.js";
|
|
4
|
-
import "./chunk-VPLDQMW2.js";
|
|
5
|
-
import "./chunk-7EQNAZX2.js";
|
|
6
|
-
import "./chunk-R23CSHGI.js";
|
|
7
|
-
import "./chunk-RX3HQSYG.js";
|
|
8
|
-
import "./chunk-EEY54JMF.js";
|
|
9
|
-
import "./chunk-LEKT4K7I.js";
|
|
10
|
-
import "./chunk-B5KXLBSJ.js";
|
|
11
|
-
import "./chunk-3U3VEWK6.js";
|
|
12
|
-
import "./chunk-EZFKWSC7.js";
|
|
13
|
-
import "./chunk-DRBV5UC2.js";
|
|
14
|
-
import {
|
|
15
|
-
PmCliError
|
|
16
|
-
} from "./chunk-P5YORJRH.js";
|
|
17
|
-
import "./chunk-7C2O74AE.js";
|
|
18
|
-
import {
|
|
19
|
-
EXIT_CODE,
|
|
20
|
-
coercePositiveInteger,
|
|
21
|
-
getSettingsPath,
|
|
22
|
-
pathExists,
|
|
23
|
-
resolvePmRoot
|
|
24
|
-
} from "./chunk-5VVUKE3U.js";
|
|
25
|
-
|
|
26
|
-
// dist/cli/commands/eval.js
|
|
27
|
-
import fs from "node:fs/promises";
|
|
28
|
-
import path from "node:path";
|
|
29
|
-
|
|
30
|
-
// dist/core/search/eval.js
|
|
31
|
-
!(function() {
|
|
32
|
-
try {
|
|
33
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
34
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "4ed89138-1775-503e-a08f-7e94a0bd24eb");
|
|
35
|
-
} catch (e2) {
|
|
36
|
-
}
|
|
37
|
-
})();
|
|
38
|
-
var DEFAULT_EVAL_K = 10;
|
|
39
|
-
var EvalQuerySetError = class extends Error {
|
|
40
|
-
/** Construct an error describing why a golden-query set failed validation. */
|
|
41
|
-
constructor(message) {
|
|
42
|
-
super(message);
|
|
43
|
-
this.name = "EvalQuerySetError";
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
var VALID_EVAL_MODES = /* @__PURE__ */ new Set(["keyword", "semantic", "hybrid"]);
|
|
47
|
-
function dcgAtK(relevanceGains, k) {
|
|
48
|
-
let dcg = 0;
|
|
49
|
-
const limit = Math.min(k, relevanceGains.length);
|
|
50
|
-
for (let index = 0; index < limit; index += 1) {
|
|
51
|
-
dcg += relevanceGains[index] / Math.log2(index + 2);
|
|
52
|
-
}
|
|
53
|
-
return dcg;
|
|
54
|
-
}
|
|
55
|
-
function ndcgAtK(rankedIds, relevantIds, k) {
|
|
56
|
-
if (relevantIds.size === 0) {
|
|
57
|
-
return 0;
|
|
58
|
-
}
|
|
59
|
-
const gains = rankedIds.map((id) => relevantIds.has(id) ? 1 : 0);
|
|
60
|
-
const dcg = dcgAtK(gains, k);
|
|
61
|
-
const idealGains = Array.from({ length: relevantIds.size }, () => 1);
|
|
62
|
-
const idealDcg = dcgAtK(idealGains, k);
|
|
63
|
-
return idealDcg === 0 ? 0 : dcg / idealDcg;
|
|
64
|
-
}
|
|
65
|
-
function reciprocalRankAtK(rankedIds, relevantIds, k) {
|
|
66
|
-
const limit = Math.min(k, rankedIds.length);
|
|
67
|
-
for (let index = 0; index < limit; index += 1) {
|
|
68
|
-
if (relevantIds.has(rankedIds[index])) {
|
|
69
|
-
return 1 / (index + 1);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return 0;
|
|
73
|
-
}
|
|
74
|
-
function countRelevantInTopK(rankedIds, relevantIds, k) {
|
|
75
|
-
const limit = Math.min(k, rankedIds.length);
|
|
76
|
-
let hits = 0;
|
|
77
|
-
for (let index = 0; index < limit; index += 1) {
|
|
78
|
-
if (relevantIds.has(rankedIds[index])) {
|
|
79
|
-
hits += 1;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return hits;
|
|
83
|
-
}
|
|
84
|
-
function precisionAtK(rankedIds, relevantIds, k) {
|
|
85
|
-
if (k <= 0) {
|
|
86
|
-
return 0;
|
|
87
|
-
}
|
|
88
|
-
return countRelevantInTopK(rankedIds, relevantIds, k) / k;
|
|
89
|
-
}
|
|
90
|
-
function recallAtK(rankedIds, relevantIds, k) {
|
|
91
|
-
if (relevantIds.size === 0) {
|
|
92
|
-
return 0;
|
|
93
|
-
}
|
|
94
|
-
return countRelevantInTopK(rankedIds, relevantIds, k) / relevantIds.size;
|
|
95
|
-
}
|
|
96
|
-
function evaluateRanking(rankedIds, relevantIds, k) {
|
|
97
|
-
return {
|
|
98
|
-
ndcg: ndcgAtK(rankedIds, relevantIds, k),
|
|
99
|
-
mrr: reciprocalRankAtK(rankedIds, relevantIds, k),
|
|
100
|
-
precision: precisionAtK(rankedIds, relevantIds, k),
|
|
101
|
-
recall: recallAtK(rankedIds, relevantIds, k),
|
|
102
|
-
relevant_total: relevantIds.size,
|
|
103
|
-
retrieved_relevant: countRelevantInTopK(rankedIds, relevantIds, k)
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
function aggregateEvalMetrics(perQuery) {
|
|
107
|
-
const queryCount = perQuery.length;
|
|
108
|
-
if (queryCount === 0) {
|
|
109
|
-
return { ndcg: 0, mrr: 0, precision: 0, recall: 0, query_count: 0 };
|
|
110
|
-
}
|
|
111
|
-
const sum = perQuery.reduce((accumulator, metrics) => ({
|
|
112
|
-
ndcg: accumulator.ndcg + metrics.ndcg,
|
|
113
|
-
mrr: accumulator.mrr + metrics.mrr,
|
|
114
|
-
precision: accumulator.precision + metrics.precision,
|
|
115
|
-
recall: accumulator.recall + metrics.recall
|
|
116
|
-
}), { ndcg: 0, mrr: 0, precision: 0, recall: 0 });
|
|
117
|
-
return {
|
|
118
|
-
ndcg: sum.ndcg / queryCount,
|
|
119
|
-
mrr: sum.mrr / queryCount,
|
|
120
|
-
precision: sum.precision / queryCount,
|
|
121
|
-
recall: sum.recall / queryCount,
|
|
122
|
-
query_count: queryCount
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
function parseEvalQueryEntry(raw, index) {
|
|
126
|
-
if (typeof raw !== "object" || raw === null) {
|
|
127
|
-
throw new EvalQuerySetError(`Eval query at index ${index} must be an object`);
|
|
128
|
-
}
|
|
129
|
-
const entry = raw;
|
|
130
|
-
const query = typeof entry.query === "string" ? entry.query.trim() : "";
|
|
131
|
-
if (query.length === 0) {
|
|
132
|
-
throw new EvalQuerySetError(`Eval query at index ${index} must have a non-empty "query" string`);
|
|
133
|
-
}
|
|
134
|
-
if (!Array.isArray(entry.relevant_ids)) {
|
|
135
|
-
throw new EvalQuerySetError(`Eval query at index ${index} must have a "relevant_ids" array`);
|
|
136
|
-
}
|
|
137
|
-
if (entry.relevant_ids.some((value) => typeof value !== "string")) {
|
|
138
|
-
throw new EvalQuerySetError(`Eval query at index ${index} must have a "relevant_ids" array of strings`);
|
|
139
|
-
}
|
|
140
|
-
const relevantIds = [
|
|
141
|
-
...new Set(entry.relevant_ids.map((value) => value.trim()).filter((value) => value.length > 0))
|
|
142
|
-
];
|
|
143
|
-
if (relevantIds.length === 0) {
|
|
144
|
-
throw new EvalQuerySetError(`Eval query at index ${index} must list at least one relevant id`);
|
|
145
|
-
}
|
|
146
|
-
if (entry.mode !== void 0 && (typeof entry.mode !== "string" || !VALID_EVAL_MODES.has(entry.mode))) {
|
|
147
|
-
throw new EvalQuerySetError(`Eval query at index ${index} has an invalid mode (expected keyword|semantic|hybrid)`);
|
|
148
|
-
}
|
|
149
|
-
return {
|
|
150
|
-
query,
|
|
151
|
-
relevant_ids: relevantIds,
|
|
152
|
-
...entry.mode !== void 0 ? { mode: entry.mode } : {},
|
|
153
|
-
...typeof entry.description === "string" && entry.description.trim().length > 0 ? { description: entry.description.trim() } : {}
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
function parseEvalQuerySet(raw) {
|
|
157
|
-
const rawQueries = Array.isArray(raw) ? raw : typeof raw === "object" && raw !== null ? raw.queries : void 0;
|
|
158
|
-
if (!Array.isArray(rawQueries)) {
|
|
159
|
-
throw new EvalQuerySetError('Eval query set must be an array of queries or an object with a "queries" array');
|
|
160
|
-
}
|
|
161
|
-
if (rawQueries.length === 0) {
|
|
162
|
-
throw new EvalQuerySetError("Eval query set must contain at least one query");
|
|
163
|
-
}
|
|
164
|
-
return {
|
|
165
|
-
queries: rawQueries.map((entry, index) => parseEvalQueryEntry(entry, index))
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// dist/cli/commands/eval.js
|
|
170
|
-
!(function() {
|
|
171
|
-
try {
|
|
172
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
173
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "fa1fece2-ddfb-537d-af39-fcd4ab8b5972");
|
|
174
|
-
} catch (e2) {
|
|
175
|
-
}
|
|
176
|
-
})();
|
|
177
|
-
var DEFAULT_EVAL_QUERIES_RELATIVE_PATH = path.join("search", "eval-queries.json");
|
|
178
|
-
var VALID_EVAL_MODES2 = /* @__PURE__ */ new Set(["keyword", "semantic", "hybrid"]);
|
|
179
|
-
function parseEvalMode(raw) {
|
|
180
|
-
if (raw === void 0) {
|
|
181
|
-
return "keyword";
|
|
182
|
-
}
|
|
183
|
-
const normalized = raw.trim().toLowerCase();
|
|
184
|
-
if (!VALID_EVAL_MODES2.has(normalized)) {
|
|
185
|
-
throw new PmCliError("Eval --mode must be one of keyword|semantic|hybrid", EXIT_CODE.USAGE);
|
|
186
|
-
}
|
|
187
|
-
return normalized;
|
|
188
|
-
}
|
|
189
|
-
function parseEvalK(raw) {
|
|
190
|
-
if (raw === void 0 || raw === "") {
|
|
191
|
-
return DEFAULT_EVAL_K;
|
|
192
|
-
}
|
|
193
|
-
const parsed = coercePositiveInteger(raw);
|
|
194
|
-
if (parsed === null) {
|
|
195
|
-
throw new PmCliError("Eval --k must be a positive integer", EXIT_CODE.USAGE);
|
|
196
|
-
}
|
|
197
|
-
return parsed;
|
|
198
|
-
}
|
|
199
|
-
function parseFailUnder(raw) {
|
|
200
|
-
if (raw === void 0 || raw === "") {
|
|
201
|
-
return void 0;
|
|
202
|
-
}
|
|
203
|
-
const parsed = typeof raw === "number" ? raw : Number(String(raw).trim());
|
|
204
|
-
if (!Number.isFinite(parsed) || parsed < 0 || parsed > 1) {
|
|
205
|
-
throw new PmCliError("Eval --fail-under must be a number in the range [0, 1]", EXIT_CODE.USAGE);
|
|
206
|
-
}
|
|
207
|
-
return parsed;
|
|
208
|
-
}
|
|
209
|
-
function roundMetric(value) {
|
|
210
|
-
return Math.round(value * 1e4) / 1e4;
|
|
211
|
-
}
|
|
212
|
-
async function loadEvalQuerySet(queriesPath) {
|
|
213
|
-
let raw;
|
|
214
|
-
try {
|
|
215
|
-
raw = await fs.readFile(queriesPath, "utf8");
|
|
216
|
-
} catch {
|
|
217
|
-
throw new PmCliError(`Eval query set not found at ${queriesPath}`, EXIT_CODE.NOT_FOUND, {
|
|
218
|
-
examples: [
|
|
219
|
-
`echo '[{"query":"offline search","relevant_ids":["pm-75k9"]}]' > ` + queriesPath,
|
|
220
|
-
"pm eval --queries ./my-eval.json"
|
|
221
|
-
],
|
|
222
|
-
nextSteps: [
|
|
223
|
-
"Create a git-tracked golden-query JSON file (an array of {query, relevant_ids, mode?} objects), then re-run pm eval."
|
|
224
|
-
]
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
let parsed;
|
|
228
|
-
try {
|
|
229
|
-
parsed = JSON.parse(raw);
|
|
230
|
-
} catch (error) {
|
|
231
|
-
throw new PmCliError(`Eval query set at ${queriesPath} is not valid JSON: ${error.message}`, EXIT_CODE.USAGE);
|
|
232
|
-
}
|
|
233
|
-
try {
|
|
234
|
-
return parseEvalQuerySet(parsed);
|
|
235
|
-
} catch (error) {
|
|
236
|
-
throw new PmCliError(error.message, EXIT_CODE.USAGE);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
async function runEval(options, global2) {
|
|
240
|
-
const pmRoot = resolvePmRoot(process.cwd(), global2.path);
|
|
241
|
-
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
242
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
243
|
-
}
|
|
244
|
-
const k = parseEvalK(options.k);
|
|
245
|
-
const defaultMode = parseEvalMode(options.mode);
|
|
246
|
-
const failUnder = parseFailUnder(options.failUnder);
|
|
247
|
-
const queriesPath = options.queries ? path.resolve(process.cwd(), options.queries) : path.join(pmRoot, DEFAULT_EVAL_QUERIES_RELATIVE_PATH);
|
|
248
|
-
const querySet = await loadEvalQuerySet(queriesPath);
|
|
249
|
-
const reports = [];
|
|
250
|
-
const rawMetrics = [];
|
|
251
|
-
for (const evalQuery of querySet.queries) {
|
|
252
|
-
const mode = evalQuery.mode ?? defaultMode;
|
|
253
|
-
const searchResult = await runSearch(evalQuery.query, { mode, limit: String(k), fields: "id" }, global2);
|
|
254
|
-
const rankedIds = searchResult.items.map((item) => item.id).filter((id) => typeof id === "string");
|
|
255
|
-
const metrics = evaluateRanking(rankedIds, new Set(evalQuery.relevant_ids), k);
|
|
256
|
-
rawMetrics.push(metrics);
|
|
257
|
-
reports.push({
|
|
258
|
-
query: evalQuery.query,
|
|
259
|
-
mode,
|
|
260
|
-
relevant_total: metrics.relevant_total,
|
|
261
|
-
retrieved_relevant: metrics.retrieved_relevant,
|
|
262
|
-
ndcg: roundMetric(metrics.ndcg),
|
|
263
|
-
mrr: roundMetric(metrics.mrr),
|
|
264
|
-
precision: roundMetric(metrics.precision),
|
|
265
|
-
recall: roundMetric(metrics.recall)
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
const aggregate = aggregateEvalMetrics(rawMetrics);
|
|
269
|
-
const passed = failUnder === void 0 || aggregate.ndcg >= failUnder;
|
|
270
|
-
return {
|
|
271
|
-
k,
|
|
272
|
-
query_count: querySet.queries.length,
|
|
273
|
-
aggregate: {
|
|
274
|
-
ndcg: roundMetric(aggregate.ndcg),
|
|
275
|
-
mrr: roundMetric(aggregate.mrr),
|
|
276
|
-
precision: roundMetric(aggregate.precision),
|
|
277
|
-
recall: roundMetric(aggregate.recall)
|
|
278
|
-
},
|
|
279
|
-
queries: reports,
|
|
280
|
-
...failUnder !== void 0 ? { fail_under: failUnder } : {},
|
|
281
|
-
passed
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
export {
|
|
285
|
-
DEFAULT_EVAL_QUERIES_RELATIVE_PATH,
|
|
286
|
-
runEval
|
|
287
|
-
};
|
|
288
|
-
//# sourceMappingURL=eval-N6UHFWVO.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../../cli/commands/eval.ts", "../../../../../../../../core/search/eval.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @module cli/commands/eval\n *\n * Implements the `pm eval` command surface (pm-u8n5): a search-relevance\n * evaluation runner that scores a human-curated golden-query set against the\n * live retrieval path and reports nDCG@k, MRR@k, precision@k, and recall@k per\n * query plus the macro average. With `--fail-under` it doubles as a CI gate so\n * relevance regressions — from corpus changes, hybrid-weight changes, or\n * provider swaps (including the offline BM25 provider, pm-75k9) — fail the build\n * instead of silently degrading retrieval quality.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n aggregateEvalMetrics,\n DEFAULT_EVAL_K,\n evaluateRanking,\n parseEvalQuerySet,\n type EvalSearchMode,\n type QueryEvalMetrics,\n} from \"../../core/search/eval.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { coercePositiveInteger } from \"../../core/shared/primitives.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { runSearch } from \"./search.js\";\n\n/**\n * Relative location (under the pm root) of the default golden-query set. A\n * git-tracked, human-curated file so relevance ground truth lives alongside the\n * tracker it evaluates.\n */\nexport const DEFAULT_EVAL_QUERIES_RELATIVE_PATH = path.join(\"search\", \"eval-queries.json\");\n\n/**\n * Documents the eval command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface EvalOptions {\n /** Default retrieval mode for queries that do not set their own (keyword|semantic|hybrid). */\n mode?: string;\n /** Metric cutoff (`@k`); positive integer, defaults to {@link DEFAULT_EVAL_K}. */\n k?: string | number;\n /** Gate threshold: exit non-zero when the aggregate nDCG@k falls below this `[0,1]` value. */\n failUnder?: string | number;\n /** Override path to the golden-query JSON file (defaults to `<pmRoot>/search/eval-queries.json`). */\n queries?: string;\n /** Output format override: json|toon. */\n format?: string;\n}\n\n/** Per-query relevance report row emitted by {@link runEval}. */\nexport interface EvalQueryReport {\n query: string;\n mode: EvalSearchMode;\n relevant_total: number;\n retrieved_relevant: number;\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n}\n\n/**\n * Documents the eval result payload exchanged by command, SDK, and package integrations.\n */\nexport interface EvalResult {\n k: number;\n query_count: number;\n aggregate: {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n };\n queries: EvalQueryReport[];\n /** Present only when `--fail-under` was supplied. */\n fail_under?: number;\n /** Whether the aggregate nDCG met the gate (always true when no gate is set). */\n passed: boolean;\n}\n\nconst VALID_EVAL_MODES: ReadonlySet<string> = new Set<EvalSearchMode>([\"keyword\", \"semantic\", \"hybrid\"]);\n\nfunction parseEvalMode(raw: string | undefined): EvalSearchMode {\n if (raw === undefined) {\n return \"keyword\";\n }\n const normalized = raw.trim().toLowerCase();\n if (!VALID_EVAL_MODES.has(normalized)) {\n throw new PmCliError(\"Eval --mode must be one of keyword|semantic|hybrid\", EXIT_CODE.USAGE);\n }\n return normalized as EvalSearchMode;\n}\n\nfunction parseEvalK(raw: string | number | undefined): number {\n if (raw === undefined || raw === \"\") {\n return DEFAULT_EVAL_K;\n }\n const parsed = coercePositiveInteger(raw);\n if (parsed === null) {\n throw new PmCliError(\"Eval --k must be a positive integer\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\nfunction parseFailUnder(raw: string | number | undefined): number | undefined {\n if (raw === undefined || raw === \"\") {\n return undefined;\n }\n const parsed = typeof raw === \"number\" ? raw : Number(String(raw).trim());\n if (!Number.isFinite(parsed) || parsed < 0 || parsed > 1) {\n throw new PmCliError(\"Eval --fail-under must be a number in the range [0, 1]\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\n/** Round a metric to four decimals to keep the JSON output compact and stable. */\nfunction roundMetric(value: number): number {\n return Math.round(value * 10_000) / 10_000;\n}\n\nasync function loadEvalQuerySet(queriesPath: string): Promise<ReturnType<typeof parseEvalQuerySet>> {\n let raw: string;\n try {\n raw = await fs.readFile(queriesPath, \"utf8\");\n } catch {\n throw new PmCliError(`Eval query set not found at ${queriesPath}`, EXIT_CODE.NOT_FOUND, {\n examples: [\n 'echo \\'[{\"query\":\"offline search\",\"relevant_ids\":[\"pm-75k9\"]}]\\' > ' + queriesPath,\n \"pm eval --queries ./my-eval.json\",\n ],\n nextSteps: [\n \"Create a git-tracked golden-query JSON file (an array of {query, relevant_ids, mode?} objects), then re-run pm eval.\",\n ],\n });\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch (error: unknown) {\n // JSON.parse only ever throws a SyntaxError (an Error subclass).\n throw new PmCliError(\n `Eval query set at ${queriesPath} is not valid JSON: ${(error as Error).message}`,\n EXIT_CODE.USAGE,\n );\n }\n try {\n return parseEvalQuerySet(parsed);\n } catch (error: unknown) {\n // parseEvalQuerySet only ever throws EvalQuerySetError (an Error subclass\n // with a precise, author-actionable message) — surface it as a usage error.\n throw new PmCliError((error as Error).message, EXIT_CODE.USAGE);\n }\n}\n\n/**\n * Run the search-relevance evaluation (pm-u8n5). Loads the golden-query set\n * (default `<pmRoot>/search/eval-queries.json`, overridable via `--queries`),\n * runs each query through {@link runSearch} at the resolved mode, scores the\n * returned ranking with the nDCG/MRR/precision/recall metrics, and macro-averages\n * across queries. When `--fail-under` is supplied, `passed` reflects whether the\n * aggregate nDCG@k cleared the threshold; the CLI layer maps a failed gate to a\n * non-zero exit code.\n */\nexport async function runEval(options: EvalOptions, global: GlobalOptions): Promise<EvalResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const k = parseEvalK(options.k);\n const defaultMode = parseEvalMode(options.mode);\n const failUnder = parseFailUnder(options.failUnder);\n const queriesPath = options.queries\n ? path.resolve(process.cwd(), options.queries)\n : path.join(pmRoot, DEFAULT_EVAL_QUERIES_RELATIVE_PATH);\n const querySet = await loadEvalQuerySet(queriesPath);\n\n const reports: EvalQueryReport[] = [];\n // Aggregate and gate on the UNROUNDED metrics; rounding is applied only to the\n // emitted report values so display precision never flips a --fail-under decision.\n const rawMetrics: QueryEvalMetrics[] = [];\n for (const evalQuery of querySet.queries) {\n const mode = evalQuery.mode ?? defaultMode;\n const searchResult = await runSearch(\n evalQuery.query,\n { mode, limit: String(k), fields: \"id\" },\n global,\n );\n const rankedIds = searchResult.items\n .map((item) => (item as { id?: unknown }).id)\n .filter((id): id is string => typeof id === \"string\");\n const metrics = evaluateRanking(rankedIds, new Set(evalQuery.relevant_ids), k);\n rawMetrics.push(metrics);\n reports.push({\n query: evalQuery.query,\n mode,\n relevant_total: metrics.relevant_total,\n retrieved_relevant: metrics.retrieved_relevant,\n ndcg: roundMetric(metrics.ndcg),\n mrr: roundMetric(metrics.mrr),\n precision: roundMetric(metrics.precision),\n recall: roundMetric(metrics.recall),\n });\n }\n\n const aggregate = aggregateEvalMetrics(rawMetrics);\n const passed = failUnder === undefined || aggregate.ndcg >= failUnder;\n return {\n k,\n query_count: querySet.queries.length,\n aggregate: {\n ndcg: roundMetric(aggregate.ndcg),\n mrr: roundMetric(aggregate.mrr),\n precision: roundMetric(aggregate.precision),\n recall: roundMetric(aggregate.recall),\n },\n queries: reports,\n ...(failUnder !== undefined ? { fail_under: failUnder } : {}),\n passed,\n };\n}\n", "/**\n * @module core/search/eval\n *\n * Search relevance evaluation primitives (pm-u8n5). Implements the standard\n * offline ranking metrics — nDCG@k, MRR@k, precision@k, recall@k — over a\n * human-curated golden-query set, plus the loader/validator for that set. The\n * `pm eval` command (src/cli/commands/eval.ts) runs each golden query through\n * the live retrieval path and feeds the ranked ids here, so relevance\n * regressions from corpus changes, hybrid-weight changes, or provider swaps are\n * measurable and gateable in CI.\n *\n * Relevance is binary: an id is either in a query's `relevant_ids` set or it is\n * not. This keeps the golden set cheap to curate while still supporting the\n * graded-discount behavior of DCG (earlier hits are worth more).\n */\n\n/**\n * Retrieval mode a golden query is evaluated under. Mirrors the `pm search`\n * mode surface; omitting it on a query defers to the eval run's default mode.\n */\nexport type EvalSearchMode = \"keyword\" | \"semantic\" | \"hybrid\";\n\n/** Default cutoff (`@k`) used for every metric when the caller does not override it. */\nexport const DEFAULT_EVAL_K = 10;\n\n/**\n * One curated golden query: the query text, the set of item ids considered\n * relevant, an optional per-query retrieval mode override, and an optional\n * human-readable description of the relevance intent.\n */\nexport interface EvalQuery {\n query: string;\n relevant_ids: string[];\n mode?: EvalSearchMode;\n description?: string;\n}\n\n/** A parsed, validated golden-query set. */\nexport interface EvalQuerySet {\n queries: EvalQuery[];\n}\n\n/**\n * Thrown by {@link parseEvalQuerySet} when the raw golden-query payload is\n * structurally invalid. Carries a precise, human-actionable message naming the\n * offending query index/field so an author can fix the JSON directly.\n */\nexport class EvalQuerySetError extends Error {\n /** Construct an error describing why a golden-query set failed validation. */\n constructor(message: string) {\n super(message);\n this.name = \"EvalQuerySetError\";\n }\n}\n\nconst VALID_EVAL_MODES: ReadonlySet<string> = new Set<EvalSearchMode>([\"keyword\", \"semantic\", \"hybrid\"]);\n\n/**\n * Compute Discounted Cumulative Gain at cutoff `k` for an ordered list of binary\n * relevance gains (`1` relevant, `0` not). Position `i` (1-based) contributes\n * `gain / log2(i + 1)`, so a relevant hit ranked first is worth `1` and later\n * hits are progressively discounted. Gains beyond `k` are ignored.\n */\nexport function dcgAtK(relevanceGains: number[], k: number): number {\n let dcg = 0;\n const limit = Math.min(k, relevanceGains.length);\n for (let index = 0; index < limit; index += 1) {\n dcg += relevanceGains[index] / Math.log2(index + 2);\n }\n return dcg;\n}\n\n/**\n * Normalized DCG at cutoff `k`: the ranking's DCG divided by the DCG of the\n * ideal ranking (all relevant ids first). Returns `0` when the query has no\n * relevant ids (the ideal DCG is `0` and the score is undefined), giving a\n * stable lower bound for aggregation. Result is in `[0, 1]`.\n */\nexport function ndcgAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (relevantIds.size === 0) {\n return 0;\n }\n const gains = rankedIds.map((id) => (relevantIds.has(id) ? 1 : 0));\n const dcg = dcgAtK(gains, k);\n const idealGains = Array.from({ length: relevantIds.size }, () => 1);\n const idealDcg = dcgAtK(idealGains, k);\n return idealDcg === 0 ? 0 : dcg / idealDcg;\n}\n\n/**\n * Reciprocal rank of the first relevant id within the top `k` results: `1/rank`\n * (rank is 1-based), or `0` when no relevant id appears in the cutoff. Averaged\n * across queries this is Mean Reciprocal Rank (MRR@k).\n */\nexport function reciprocalRankAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n const limit = Math.min(k, rankedIds.length);\n for (let index = 0; index < limit; index += 1) {\n if (relevantIds.has(rankedIds[index])) {\n return 1 / (index + 1);\n }\n }\n return 0;\n}\n\n/**\n * Count relevant ids within the top `k` results (shared by precision and\n * recall).\n */\nfunction countRelevantInTopK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n const limit = Math.min(k, rankedIds.length);\n let hits = 0;\n for (let index = 0; index < limit; index += 1) {\n if (relevantIds.has(rankedIds[index])) {\n hits += 1;\n }\n }\n return hits;\n}\n\n/**\n * Precision at cutoff `k`: relevant ids retrieved in the top `k` divided by `k`.\n * Returns `0` for a non-positive `k`.\n */\nexport function precisionAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (k <= 0) {\n return 0;\n }\n return countRelevantInTopK(rankedIds, relevantIds, k) / k;\n}\n\n/**\n * Recall at cutoff `k`: relevant ids retrieved in the top `k` divided by the\n * total number of relevant ids. Returns `0` when the query has no relevant ids.\n */\nexport function recallAtK(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): number {\n if (relevantIds.size === 0) {\n return 0;\n }\n return countRelevantInTopK(rankedIds, relevantIds, k) / relevantIds.size;\n}\n\n/** The four ranking metrics computed for a single query, plus match counts. */\nexport interface QueryEvalMetrics {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n relevant_total: number;\n retrieved_relevant: number;\n}\n\n/**\n * Evaluate one ranking against its relevant-id set at cutoff `k`, returning all\n * four metrics together so callers compute the document ranking once and read\n * every score off the result.\n */\nexport function evaluateRanking(rankedIds: string[], relevantIds: ReadonlySet<string>, k: number): QueryEvalMetrics {\n return {\n ndcg: ndcgAtK(rankedIds, relevantIds, k),\n mrr: reciprocalRankAtK(rankedIds, relevantIds, k),\n precision: precisionAtK(rankedIds, relevantIds, k),\n recall: recallAtK(rankedIds, relevantIds, k),\n relevant_total: relevantIds.size,\n retrieved_relevant: countRelevantInTopK(rankedIds, relevantIds, k),\n };\n}\n\n/** Macro-averaged metrics across all evaluated queries. */\nexport interface AggregateEvalMetrics {\n ndcg: number;\n mrr: number;\n precision: number;\n recall: number;\n query_count: number;\n}\n\n/**\n * Macro-average per-query metrics (each query weighted equally). Returns all\n * zeros with `query_count: 0` for an empty input so the gate path has a stable\n * shape to compare against.\n */\nexport function aggregateEvalMetrics(perQuery: QueryEvalMetrics[]): AggregateEvalMetrics {\n const queryCount = perQuery.length;\n if (queryCount === 0) {\n return { ndcg: 0, mrr: 0, precision: 0, recall: 0, query_count: 0 };\n }\n const sum = perQuery.reduce(\n (accumulator, metrics) => ({\n ndcg: accumulator.ndcg + metrics.ndcg,\n mrr: accumulator.mrr + metrics.mrr,\n precision: accumulator.precision + metrics.precision,\n recall: accumulator.recall + metrics.recall,\n }),\n { ndcg: 0, mrr: 0, precision: 0, recall: 0 },\n );\n return {\n ndcg: sum.ndcg / queryCount,\n mrr: sum.mrr / queryCount,\n precision: sum.precision / queryCount,\n recall: sum.recall / queryCount,\n query_count: queryCount,\n };\n}\n\n/**\n * Validate one raw golden-query entry, returning a typed {@link EvalQuery}.\n * Throws {@link EvalQuerySetError} (with the entry index) for a missing/empty\n * `query`, a `relevant_ids` that is not a non-empty string array, or an invalid\n * `mode`. `relevant_ids` are trimmed and de-duplicated; `description` is kept\n * only when it is a non-empty string.\n */\nfunction parseEvalQueryEntry(raw: unknown, index: number): EvalQuery {\n if (typeof raw !== \"object\" || raw === null) {\n throw new EvalQuerySetError(`Eval query at index ${index} must be an object`);\n }\n const entry = raw as { query?: unknown; relevant_ids?: unknown; mode?: unknown; description?: unknown };\n const query = typeof entry.query === \"string\" ? entry.query.trim() : \"\";\n if (query.length === 0) {\n throw new EvalQuerySetError(`Eval query at index ${index} must have a non-empty \"query\" string`);\n }\n if (!Array.isArray(entry.relevant_ids)) {\n throw new EvalQuerySetError(`Eval query at index ${index} must have a \"relevant_ids\" array`);\n }\n if (entry.relevant_ids.some((value) => typeof value !== \"string\")) {\n // Reject (rather than silently drop) non-string members: malformed golden\n // data must fail loudly so it can never quietly change relevance judgments.\n throw new EvalQuerySetError(`Eval query at index ${index} must have a \"relevant_ids\" array of strings`);\n }\n const relevantIds = [\n ...new Set((entry.relevant_ids as string[]).map((value) => value.trim()).filter((value) => value.length > 0)),\n ];\n if (relevantIds.length === 0) {\n throw new EvalQuerySetError(`Eval query at index ${index} must list at least one relevant id`);\n }\n if (entry.mode !== undefined && (typeof entry.mode !== \"string\" || !VALID_EVAL_MODES.has(entry.mode))) {\n throw new EvalQuerySetError(`Eval query at index ${index} has an invalid mode (expected keyword|semantic|hybrid)`);\n }\n return {\n query,\n relevant_ids: relevantIds,\n ...(entry.mode !== undefined ? { mode: entry.mode as EvalSearchMode } : {}),\n ...(typeof entry.description === \"string\" && entry.description.trim().length > 0\n ? { description: entry.description.trim() }\n : {}),\n };\n}\n\n/**\n * Parse and validate a raw golden-query payload (typically `JSON.parse` of\n * `.agents/pm/search/eval-queries.json`). Accepts either a bare array of query\n * entries or an object with a `queries` array. Throws {@link EvalQuerySetError}\n * with a precise message when the payload is not an array/object, when\n * `queries` is missing/not an array, when the set is empty, or when any entry\n * fails {@link parseEvalQueryEntry}.\n */\nexport function parseEvalQuerySet(raw: unknown): EvalQuerySet {\n const rawQueries = Array.isArray(raw)\n ? raw\n : typeof raw === \"object\" && raw !== null\n ? (raw as { queries?: unknown }).queries\n : undefined;\n if (!Array.isArray(rawQueries)) {\n throw new EvalQuerySetError('Eval query set must be an array of queries or an object with a \"queries\" array');\n }\n if (rawQueries.length === 0) {\n throw new EvalQuerySetError(\"Eval query set must contain at least one query\");\n }\n return {\n queries: rawQueries.map((entry, index) => parseEvalQueryEntry(entry, index)),\n };\n}\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["VALID_EVAL_MODES", "global"]
|
|
7
|
-
}
|
|
@@ -1,278 +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]="2c8d5c7c-cb86-5093-b2d7-5ea51af4a122")}catch(e){}}();
|
|
3
|
-
import {
|
|
4
|
-
runSearch
|
|
5
|
-
} from "./chunk-ZJB3UV5U.js";
|
|
6
|
-
import "./chunk-ROGZTCCB.js";
|
|
7
|
-
import "./chunk-YSAH5FY5.js";
|
|
8
|
-
import "./chunk-QB7XMHJW.js";
|
|
9
|
-
import "./chunk-5JE6SMYS.js";
|
|
10
|
-
import "./chunk-YFIE7YK6.js";
|
|
11
|
-
import "./chunk-7QH7DHUB.js";
|
|
12
|
-
import "./chunk-KGHH652T.js";
|
|
13
|
-
import "./chunk-57C2RLW5.js";
|
|
14
|
-
import "./chunk-HK72NWAD.js";
|
|
15
|
-
import "./chunk-FJRKQREY.js";
|
|
16
|
-
import {
|
|
17
|
-
PmCliError
|
|
18
|
-
} from "./chunk-US3T3W5J.js";
|
|
19
|
-
import "./chunk-NNHHXJB2.js";
|
|
20
|
-
import {
|
|
21
|
-
EXIT_CODE,
|
|
22
|
-
coercePositiveInteger,
|
|
23
|
-
getSettingsPath,
|
|
24
|
-
pathExists,
|
|
25
|
-
resolvePmRoot
|
|
26
|
-
} from "./chunk-YD5FML7K.js";
|
|
27
|
-
|
|
28
|
-
// dist/cli/commands/eval.js
|
|
29
|
-
import fs from "node:fs/promises";
|
|
30
|
-
import path from "node:path";
|
|
31
|
-
|
|
32
|
-
// dist/core/search/eval.js
|
|
33
|
-
var DEFAULT_EVAL_K = 10;
|
|
34
|
-
var EvalQuerySetError = class extends Error {
|
|
35
|
-
/** Construct an error describing why a golden-query set failed validation. */
|
|
36
|
-
constructor(message) {
|
|
37
|
-
super(message);
|
|
38
|
-
this.name = "EvalQuerySetError";
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var VALID_EVAL_MODES = /* @__PURE__ */ new Set(["keyword", "semantic", "hybrid"]);
|
|
42
|
-
function dcgAtK(relevanceGains, k) {
|
|
43
|
-
let dcg = 0;
|
|
44
|
-
const limit = Math.min(k, relevanceGains.length);
|
|
45
|
-
for (let index = 0; index < limit; index += 1) {
|
|
46
|
-
dcg += relevanceGains[index] / Math.log2(index + 2);
|
|
47
|
-
}
|
|
48
|
-
return dcg;
|
|
49
|
-
}
|
|
50
|
-
function ndcgAtK(rankedIds, relevantIds, k) {
|
|
51
|
-
if (relevantIds.size === 0) {
|
|
52
|
-
return 0;
|
|
53
|
-
}
|
|
54
|
-
const gains = rankedIds.map((id) => relevantIds.has(id) ? 1 : 0);
|
|
55
|
-
const dcg = dcgAtK(gains, k);
|
|
56
|
-
const idealGains = Array.from({ length: relevantIds.size }, () => 1);
|
|
57
|
-
const idealDcg = dcgAtK(idealGains, k);
|
|
58
|
-
return idealDcg === 0 ? 0 : dcg / idealDcg;
|
|
59
|
-
}
|
|
60
|
-
function reciprocalRankAtK(rankedIds, relevantIds, k) {
|
|
61
|
-
const limit = Math.min(k, rankedIds.length);
|
|
62
|
-
for (let index = 0; index < limit; index += 1) {
|
|
63
|
-
if (relevantIds.has(rankedIds[index])) {
|
|
64
|
-
return 1 / (index + 1);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return 0;
|
|
68
|
-
}
|
|
69
|
-
function countRelevantInTopK(rankedIds, relevantIds, k) {
|
|
70
|
-
const limit = Math.min(k, rankedIds.length);
|
|
71
|
-
let hits = 0;
|
|
72
|
-
for (let index = 0; index < limit; index += 1) {
|
|
73
|
-
if (relevantIds.has(rankedIds[index])) {
|
|
74
|
-
hits += 1;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return hits;
|
|
78
|
-
}
|
|
79
|
-
function precisionAtK(rankedIds, relevantIds, k) {
|
|
80
|
-
if (k <= 0) {
|
|
81
|
-
return 0;
|
|
82
|
-
}
|
|
83
|
-
return countRelevantInTopK(rankedIds, relevantIds, k) / k;
|
|
84
|
-
}
|
|
85
|
-
function recallAtK(rankedIds, relevantIds, k) {
|
|
86
|
-
if (relevantIds.size === 0) {
|
|
87
|
-
return 0;
|
|
88
|
-
}
|
|
89
|
-
return countRelevantInTopK(rankedIds, relevantIds, k) / relevantIds.size;
|
|
90
|
-
}
|
|
91
|
-
function evaluateRanking(rankedIds, relevantIds, k) {
|
|
92
|
-
return {
|
|
93
|
-
ndcg: ndcgAtK(rankedIds, relevantIds, k),
|
|
94
|
-
mrr: reciprocalRankAtK(rankedIds, relevantIds, k),
|
|
95
|
-
precision: precisionAtK(rankedIds, relevantIds, k),
|
|
96
|
-
recall: recallAtK(rankedIds, relevantIds, k),
|
|
97
|
-
relevant_total: relevantIds.size,
|
|
98
|
-
retrieved_relevant: countRelevantInTopK(rankedIds, relevantIds, k)
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function aggregateEvalMetrics(perQuery) {
|
|
102
|
-
const queryCount = perQuery.length;
|
|
103
|
-
if (queryCount === 0) {
|
|
104
|
-
return { ndcg: 0, mrr: 0, precision: 0, recall: 0, query_count: 0 };
|
|
105
|
-
}
|
|
106
|
-
const sum = perQuery.reduce((accumulator, metrics) => ({
|
|
107
|
-
ndcg: accumulator.ndcg + metrics.ndcg,
|
|
108
|
-
mrr: accumulator.mrr + metrics.mrr,
|
|
109
|
-
precision: accumulator.precision + metrics.precision,
|
|
110
|
-
recall: accumulator.recall + metrics.recall
|
|
111
|
-
}), { ndcg: 0, mrr: 0, precision: 0, recall: 0 });
|
|
112
|
-
return {
|
|
113
|
-
ndcg: sum.ndcg / queryCount,
|
|
114
|
-
mrr: sum.mrr / queryCount,
|
|
115
|
-
precision: sum.precision / queryCount,
|
|
116
|
-
recall: sum.recall / queryCount,
|
|
117
|
-
query_count: queryCount
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
function parseEvalQueryEntry(raw, index) {
|
|
121
|
-
if (typeof raw !== "object" || raw === null) {
|
|
122
|
-
throw new EvalQuerySetError(`Eval query at index ${index} must be an object`);
|
|
123
|
-
}
|
|
124
|
-
const entry = raw;
|
|
125
|
-
const query = typeof entry.query === "string" ? entry.query.trim() : "";
|
|
126
|
-
if (query.length === 0) {
|
|
127
|
-
throw new EvalQuerySetError(`Eval query at index ${index} must have a non-empty "query" string`);
|
|
128
|
-
}
|
|
129
|
-
if (!Array.isArray(entry.relevant_ids)) {
|
|
130
|
-
throw new EvalQuerySetError(`Eval query at index ${index} must have a "relevant_ids" array`);
|
|
131
|
-
}
|
|
132
|
-
if (entry.relevant_ids.some((value) => typeof value !== "string")) {
|
|
133
|
-
throw new EvalQuerySetError(`Eval query at index ${index} must have a "relevant_ids" array of strings`);
|
|
134
|
-
}
|
|
135
|
-
const relevantIds = [
|
|
136
|
-
...new Set(entry.relevant_ids.map((value) => value.trim()).filter((value) => value.length > 0))
|
|
137
|
-
];
|
|
138
|
-
if (relevantIds.length === 0) {
|
|
139
|
-
throw new EvalQuerySetError(`Eval query at index ${index} must list at least one relevant id`);
|
|
140
|
-
}
|
|
141
|
-
if (entry.mode !== void 0 && (typeof entry.mode !== "string" || !VALID_EVAL_MODES.has(entry.mode))) {
|
|
142
|
-
throw new EvalQuerySetError(`Eval query at index ${index} has an invalid mode (expected keyword|semantic|hybrid)`);
|
|
143
|
-
}
|
|
144
|
-
return {
|
|
145
|
-
query,
|
|
146
|
-
relevant_ids: relevantIds,
|
|
147
|
-
...entry.mode !== void 0 ? { mode: entry.mode } : {},
|
|
148
|
-
...typeof entry.description === "string" && entry.description.trim().length > 0 ? { description: entry.description.trim() } : {}
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
function parseEvalQuerySet(raw) {
|
|
152
|
-
const rawQueries = Array.isArray(raw) ? raw : typeof raw === "object" && raw !== null ? raw.queries : void 0;
|
|
153
|
-
if (!Array.isArray(rawQueries)) {
|
|
154
|
-
throw new EvalQuerySetError('Eval query set must be an array of queries or an object with a "queries" array');
|
|
155
|
-
}
|
|
156
|
-
if (rawQueries.length === 0) {
|
|
157
|
-
throw new EvalQuerySetError("Eval query set must contain at least one query");
|
|
158
|
-
}
|
|
159
|
-
return {
|
|
160
|
-
queries: rawQueries.map((entry, index) => parseEvalQueryEntry(entry, index))
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// dist/cli/commands/eval.js
|
|
165
|
-
var DEFAULT_EVAL_QUERIES_RELATIVE_PATH = path.join("search", "eval-queries.json");
|
|
166
|
-
var VALID_EVAL_MODES2 = /* @__PURE__ */ new Set(["keyword", "semantic", "hybrid"]);
|
|
167
|
-
function parseEvalMode(raw) {
|
|
168
|
-
if (raw === void 0) {
|
|
169
|
-
return "keyword";
|
|
170
|
-
}
|
|
171
|
-
const normalized = raw.trim().toLowerCase();
|
|
172
|
-
if (!VALID_EVAL_MODES2.has(normalized)) {
|
|
173
|
-
throw new PmCliError("Eval --mode must be one of keyword|semantic|hybrid", EXIT_CODE.USAGE);
|
|
174
|
-
}
|
|
175
|
-
return normalized;
|
|
176
|
-
}
|
|
177
|
-
function parseEvalK(raw) {
|
|
178
|
-
if (raw === void 0 || raw === "") {
|
|
179
|
-
return DEFAULT_EVAL_K;
|
|
180
|
-
}
|
|
181
|
-
const parsed = coercePositiveInteger(raw);
|
|
182
|
-
if (parsed === null) {
|
|
183
|
-
throw new PmCliError("Eval --k must be a positive integer", EXIT_CODE.USAGE);
|
|
184
|
-
}
|
|
185
|
-
return parsed;
|
|
186
|
-
}
|
|
187
|
-
function parseFailUnder(raw) {
|
|
188
|
-
if (raw === void 0 || raw === "") {
|
|
189
|
-
return void 0;
|
|
190
|
-
}
|
|
191
|
-
const parsed = typeof raw === "number" ? raw : Number(String(raw).trim());
|
|
192
|
-
if (!Number.isFinite(parsed) || parsed < 0 || parsed > 1) {
|
|
193
|
-
throw new PmCliError("Eval --fail-under must be a number in the range [0, 1]", EXIT_CODE.USAGE);
|
|
194
|
-
}
|
|
195
|
-
return parsed;
|
|
196
|
-
}
|
|
197
|
-
function roundMetric(value) {
|
|
198
|
-
return Math.round(value * 1e4) / 1e4;
|
|
199
|
-
}
|
|
200
|
-
async function loadEvalQuerySet(queriesPath) {
|
|
201
|
-
let raw;
|
|
202
|
-
try {
|
|
203
|
-
raw = await fs.readFile(queriesPath, "utf8");
|
|
204
|
-
} catch {
|
|
205
|
-
throw new PmCliError(`Eval query set not found at ${queriesPath}`, EXIT_CODE.NOT_FOUND, {
|
|
206
|
-
examples: [
|
|
207
|
-
`echo '[{"query":"offline search","relevant_ids":["pm-75k9"]}]' > ` + queriesPath,
|
|
208
|
-
"pm eval --queries ./my-eval.json"
|
|
209
|
-
],
|
|
210
|
-
nextSteps: [
|
|
211
|
-
"Create a git-tracked golden-query JSON file (an array of {query, relevant_ids, mode?} objects), then re-run pm eval."
|
|
212
|
-
]
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
let parsed;
|
|
216
|
-
try {
|
|
217
|
-
parsed = JSON.parse(raw);
|
|
218
|
-
} catch (error) {
|
|
219
|
-
throw new PmCliError(`Eval query set at ${queriesPath} is not valid JSON: ${error.message}`, EXIT_CODE.USAGE);
|
|
220
|
-
}
|
|
221
|
-
try {
|
|
222
|
-
return parseEvalQuerySet(parsed);
|
|
223
|
-
} catch (error) {
|
|
224
|
-
throw new PmCliError(error.message, EXIT_CODE.USAGE);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
async function runEval(options, global) {
|
|
228
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
229
|
-
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
230
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
231
|
-
}
|
|
232
|
-
const k = parseEvalK(options.k);
|
|
233
|
-
const defaultMode = parseEvalMode(options.mode);
|
|
234
|
-
const failUnder = parseFailUnder(options.failUnder);
|
|
235
|
-
const queriesPath = options.queries ? path.resolve(process.cwd(), options.queries) : path.join(pmRoot, DEFAULT_EVAL_QUERIES_RELATIVE_PATH);
|
|
236
|
-
const querySet = await loadEvalQuerySet(queriesPath);
|
|
237
|
-
const reports = [];
|
|
238
|
-
const rawMetrics = [];
|
|
239
|
-
for (const evalQuery of querySet.queries) {
|
|
240
|
-
const mode = evalQuery.mode ?? defaultMode;
|
|
241
|
-
const searchResult = await runSearch(evalQuery.query, { mode, limit: String(k), fields: "id" }, global);
|
|
242
|
-
const rankedIds = searchResult.items.map((item) => item.id).filter((id) => typeof id === "string");
|
|
243
|
-
const metrics = evaluateRanking(rankedIds, new Set(evalQuery.relevant_ids), k);
|
|
244
|
-
rawMetrics.push(metrics);
|
|
245
|
-
reports.push({
|
|
246
|
-
query: evalQuery.query,
|
|
247
|
-
mode,
|
|
248
|
-
relevant_total: metrics.relevant_total,
|
|
249
|
-
retrieved_relevant: metrics.retrieved_relevant,
|
|
250
|
-
ndcg: roundMetric(metrics.ndcg),
|
|
251
|
-
mrr: roundMetric(metrics.mrr),
|
|
252
|
-
precision: roundMetric(metrics.precision),
|
|
253
|
-
recall: roundMetric(metrics.recall)
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
const aggregate = aggregateEvalMetrics(rawMetrics);
|
|
257
|
-
const passed = failUnder === void 0 || aggregate.ndcg >= failUnder;
|
|
258
|
-
return {
|
|
259
|
-
k,
|
|
260
|
-
query_count: querySet.queries.length,
|
|
261
|
-
aggregate: {
|
|
262
|
-
ndcg: roundMetric(aggregate.ndcg),
|
|
263
|
-
mrr: roundMetric(aggregate.mrr),
|
|
264
|
-
precision: roundMetric(aggregate.precision),
|
|
265
|
-
recall: roundMetric(aggregate.recall)
|
|
266
|
-
},
|
|
267
|
-
queries: reports,
|
|
268
|
-
...failUnder !== void 0 ? { fail_under: failUnder } : {},
|
|
269
|
-
passed
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
export {
|
|
273
|
-
DEFAULT_EVAL_QUERIES_RELATIVE_PATH,
|
|
274
|
-
runEval
|
|
275
|
-
};
|
|
276
|
-
//# sourceMappingURL=eval-PHOTWYHI.js.map
|
|
277
|
-
|
|
278
|
-
//# debugId=2c8d5c7c-cb86-5093-b2d7-5ea51af4a122
|