@unbrained/pm-cli 2026.6.6 → 2026.6.8
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/.claude-plugin/marketplace.json +1 -1
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +79 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +6 -2
- package/dist/cli/bootstrap-args.js +30 -13
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +74 -4
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/aggregate.d.ts +8 -0
- package/dist/cli/commands/aggregate.js +84 -7
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/calendar.js +10 -3
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.js +20 -11
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/close.d.ts +1 -1
- package/dist/cli/commands/close.js +32 -10
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +4 -3
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/completion.js +105 -43
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +5 -4
- package/dist/cli/commands/config.js +50 -2
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/contracts.js +4 -3
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/copy.d.ts +14 -0
- package/dist/cli/commands/copy.js +153 -0
- package/dist/cli/commands/copy.js.map +1 -0
- package/dist/cli/commands/extension/doctor.js +62 -2
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.d.ts +8 -0
- package/dist/cli/commands/extension/install-sources.js +82 -2
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +6 -14
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +29 -0
- package/dist/cli/commands/extension.js +61 -2
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/gc.js +10 -2
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +9 -0
- package/dist/cli/commands/get.js +23 -2
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.js +10 -2
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.d.ts +39 -0
- package/dist/cli/commands/history-compact.js +262 -0
- package/dist/cli/commands/history-compact.js.map +1 -0
- package/dist/cli/commands/index.d.ts +3 -1
- package/dist/cli/commands/index.js +5 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +1 -0
- package/dist/cli/commands/init.js +48 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list.d.ts +13 -2
- package/dist/cli/commands/list.js +189 -9
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.js +6 -4
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/reindex.js +8 -4
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +13 -2
- package/dist/cli/commands/schema.js +66 -12
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +11 -2
- package/dist/cli/commands/search.js +321 -35
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/upgrade.js +4 -12
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/error-guidance.js +26 -2
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +1 -0
- package/dist/cli/extension-command-help.js +3 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/help-content.js +10 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +18 -37
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +22 -5
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +83 -39
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +31 -7
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +7 -5
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +26 -4
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-A3QKFSSF.js +16 -0
- package/dist/cli-bundle/chunks/{activity-JM6DTDND.js → activity-Q7XMIZIH.js} +11 -11
- package/dist/cli-bundle/chunks/{aggregate-VNAHUNNF.js → aggregate-GBSHSXOB.js} +87 -17
- package/dist/cli-bundle/chunks/aggregate-GBSHSXOB.js.map +7 -0
- package/dist/cli-bundle/chunks/{aggregate-GI7WSZPH.js → aggregate-HKQJZUBG.js} +88 -18
- package/dist/cli-bundle/chunks/aggregate-HKQJZUBG.js.map +1 -0
- package/dist/cli-bundle/chunks/{append-WMKRXKCE.js → append-3RFOU7P5.js} +8 -8
- package/dist/cli-bundle/chunks/{append-7H5N64R2.js → append-OM74OJVT.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-KJE2FOS4.js → chunk-2BYKYPWY.js} +26 -4
- package/dist/cli-bundle/chunks/chunk-2BYKYPWY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XTGLRY2Y.js → chunk-2HMD3JM2.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-PRJCELV4.js → chunk-2YPVCD7T.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-3FI4SEFT.js → chunk-3E3MDBTB.js} +62 -38
- package/dist/cli-bundle/chunks/chunk-3E3MDBTB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-U5SXYXSY.js → chunk-3TXWDGPU.js} +287 -45
- package/dist/cli-bundle/chunks/chunk-3TXWDGPU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HZGUAH22.js → chunk-4TI3532H.js} +6 -7
- package/dist/cli-bundle/chunks/chunk-4TI3532H.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2HVRUSQA.js → chunk-4WYBLB6J.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-R6UFP2GE.js → chunk-5NVJA7IW.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-Q7SPNHLW.js → chunk-5WO2VKFA.js} +190 -16
- package/dist/cli-bundle/chunks/chunk-5WO2VKFA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IOR7LGF4.js → chunk-7NQIY7Z6.js} +89 -7
- package/dist/cli-bundle/chunks/chunk-7NQIY7Z6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ECCMVXGM.js → chunk-7WXGR44E.js} +305 -216
- package/dist/cli-bundle/chunks/chunk-7WXGR44E.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XSJCLN2R.js → chunk-AEMKH5WQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WOPXVEZP.js → chunk-ALSRBNYB.js} +28 -9
- package/dist/cli-bundle/chunks/chunk-ALSRBNYB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6ER6DXH5.js → chunk-AXBUHLW7.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-BQHUILZS.js → chunk-BFJPMUF5.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-I6BNFU5X.js → chunk-BKQMJXWY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XLTD2HN3.js → chunk-CBJXWXI5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FRAUKRU2.js → chunk-D7WK2PKB.js} +36 -15
- package/dist/cli-bundle/chunks/chunk-D7WK2PKB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PROOHX4K.js → chunk-DV27WDA7.js} +104 -21
- package/dist/cli-bundle/chunks/chunk-DV27WDA7.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3BWOVLTH.js → chunk-EPWT7BEA.js} +8 -8
- package/dist/cli-bundle/chunks/chunk-ETZZU5QF.js +112 -0
- package/dist/cli-bundle/chunks/chunk-ETZZU5QF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TPH5XEVD.js → chunk-F33AQIB4.js} +303 -207
- package/dist/cli-bundle/chunks/chunk-F33AQIB4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NUZ5HKR4.js → chunk-F33VC5EX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WKY2IBOQ.js → chunk-FGRJZVXD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-77GFDHGF.js → chunk-FO2TYSQZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GXSUPCBV.js → chunk-HOA3GMB6.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-OVQCEJPG.js → chunk-HP35AVFS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KJ33AOCY.js → chunk-J4DKAGTM.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ME2YH6FN.js → chunk-JS47EKLP.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-T3LC5LKB.js → chunk-K62SNVVE.js} +5 -6
- package/dist/cli-bundle/chunks/chunk-K62SNVVE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GU2ZJ2VV.js → chunk-KBKJVXUS.js} +35 -14
- package/dist/cli-bundle/chunks/chunk-KBKJVXUS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KWU6HG75.js → chunk-KCGMABHM.js} +101 -18
- package/dist/cli-bundle/chunks/chunk-KCGMABHM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-I2HSTRJF.js → chunk-KN4WSESY.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-RZN6VURO.js → chunk-KP4KIUQT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-5FDATVEZ.js → chunk-KS2U7BZ3.js} +71 -17
- package/dist/cli-bundle/chunks/chunk-KS2U7BZ3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MITFDD35.js → chunk-KVXIQDJG.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-IJGCZSIQ.js → chunk-L3LYL3ID.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-AO442XLN.js → chunk-M7UBTVFT.js} +10 -6
- package/dist/cli-bundle/chunks/{chunk-AO442XLN.js.map → chunk-M7UBTVFT.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UM2GBHS4.js → chunk-MSH23UWO.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LCM63IXU.js → chunk-N4SQZ7L3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3VAM3NNM.js → chunk-NDSMKB2I.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-6P6GGMOG.js → chunk-NGEEXR2R.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PO3GSVFV.js → chunk-NLVCMVC7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-N7ACFE26.js → chunk-NUKHZZNM.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GGYWB3Y2.js → chunk-ODN53S6H.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-23YFZ3IG.js → chunk-OTY2YEH5.js} +14 -14
- package/dist/cli-bundle/chunks/{chunk-2RSPZI5H.js → chunk-OVSSE2JP.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-4LL6TK5B.js → chunk-PQDH3S54.js} +59 -35
- package/dist/cli-bundle/chunks/chunk-PQDH3S54.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2VVCGBNV.js → chunk-QF4OPBAG.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-QO7EBBOM.js → chunk-QFVASU44.js} +38 -7
- package/dist/cli-bundle/chunks/chunk-QFVASU44.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WSMOSYRD.js → chunk-QQPZYP73.js} +14 -14
- package/dist/cli-bundle/chunks/{chunk-OZ7NSQHL.js → chunk-QWNUDGFQ.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-AY43SBIN.js → chunk-R4XIE7NQ.js} +54 -8
- package/dist/cli-bundle/chunks/chunk-R4XIE7NQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-52MAOQ6J.js → chunk-RISLL7XH.js} +71 -17
- package/dist/cli-bundle/chunks/chunk-RISLL7XH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GCOQW437.js → chunk-SDLEYY6A.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-W7XABV4H.js → chunk-SM3RMWGO.js} +191 -17
- package/dist/cli-bundle/chunks/chunk-SM3RMWGO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PIU6RSL3.js → chunk-TBLBEOEX.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-SKJWX3QB.js → chunk-TXKENAQP.js} +88 -6
- package/dist/cli-bundle/chunks/chunk-TXKENAQP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YL2DJGYS.js → chunk-UEXNNF3K.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-UBOPJT3S.js → chunk-UMMJAJB2.js} +9 -9
- package/dist/cli-bundle/chunks/chunk-URJEZOLB.js +115 -0
- package/dist/cli-bundle/chunks/chunk-URJEZOLB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PDDFYW4X.js → chunk-VXBUXLVD.js} +27 -8
- package/dist/cli-bundle/chunks/chunk-VXBUXLVD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LB3RUL2N.js → chunk-XEKZCBCS.js} +10 -6
- package/dist/cli-bundle/chunks/chunk-XEKZCBCS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KAG77BY3.js → chunk-XLSQ3QLT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-E5FJNAZA.js → chunk-XNGMIVQY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TCD3R2PF.js → chunk-XZS4MV37.js} +39 -8
- package/dist/cli-bundle/chunks/chunk-XZS4MV37.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RWPSOIEE.js → chunk-YEFOCDIK.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-5SFCOO6B.js → chunk-YJAKN2N2.js} +277 -35
- package/dist/cli-bundle/chunks/chunk-YJAKN2N2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2VBQ6ZXS.js → chunk-Z2HXAFFH.js} +27 -5
- package/dist/cli-bundle/chunks/chunk-Z2HXAFFH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3LB74A67.js → chunk-Z55JACL2.js} +53 -7
- package/dist/cli-bundle/chunks/chunk-Z55JACL2.js.map +7 -0
- package/dist/cli-bundle/chunks/{claim-4DBF6RVG.js → claim-NHBIIBOW.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-X2P4IB7J.js → claim-RNEBQCOO.js} +10 -10
- package/dist/cli-bundle/chunks/close-UNTFXVM3.js +13 -0
- package/dist/cli-bundle/chunks/{close-PTYFA45H.js → close-ZMXL2WDS.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-ERFO6LHR.js → close-many-CDPQGQUB.js} +37 -28
- package/dist/cli-bundle/chunks/close-many-CDPQGQUB.js.map +1 -0
- package/dist/cli-bundle/chunks/{close-many-7CGIDPTJ.js → close-many-IQV5C2SI.js} +36 -27
- package/dist/cli-bundle/chunks/close-many-IQV5C2SI.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-QKBYCWKD.js → comments-EFVBHWPT.js} +10 -10
- package/dist/cli-bundle/chunks/{comments-OONGABK5.js → comments-J5Q4IJPH.js} +10 -10
- package/dist/cli-bundle/chunks/{config-6FXCQKIF.js → config-72253M2O.js} +127 -12
- package/dist/cli-bundle/chunks/config-72253M2O.js.map +1 -0
- package/dist/cli-bundle/chunks/{config-U4RZ4CQB.js → config-VFYA6BMI.js} +128 -13
- package/dist/cli-bundle/chunks/config-VFYA6BMI.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-FYYJGFWS.js → context-AVLO4IFH.js} +14 -14
- package/dist/cli-bundle/chunks/{context-FYYJGFWS.js.map → context-AVLO4IFH.js.map} +2 -2
- package/dist/cli-bundle/chunks/{context-YMJ3Z2HQ.js → context-WMSI2D65.js} +15 -15
- package/dist/cli-bundle/chunks/context-WMSI2D65.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-RFSPGVVJ.js → contracts-D4BN3VSQ.js} +7 -5
- package/dist/cli-bundle/chunks/contracts-D4BN3VSQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-QDB6OMLQ.js → contracts-RGPOBLPL.js} +8 -6
- package/dist/cli-bundle/chunks/contracts-RGPOBLPL.js.map +1 -0
- package/dist/cli-bundle/chunks/copy-H6TXHK7S.js +185 -0
- package/dist/cli-bundle/chunks/copy-H6TXHK7S.js.map +7 -0
- package/dist/cli-bundle/chunks/copy-WXE3OOLZ.js +182 -0
- package/dist/cli-bundle/chunks/copy-WXE3OOLZ.js.map +1 -0
- package/dist/cli-bundle/chunks/create-EZWAMUKR.js +27 -0
- package/dist/cli-bundle/chunks/{create-I5L4EYYZ.js → create-PUAIJEZ7.js} +13 -13
- package/dist/cli-bundle/chunks/{delete-7HPGI4GZ.js → delete-PKR2JHLH.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-VXUPH5RS.js → delete-WBME6WG5.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-JSRRWC3Z.js → deps-4BQEDV4L.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-SCZIFK2Z.js → deps-KWHQRO75.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-GJK6K4VP.js → docs-364GT3ZR.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-WW4N3MBM.js → docs-SCNBUGSV.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-VDY2U33M.js → extension-CRE7JM47.js} +8 -6
- package/dist/cli-bundle/chunks/{extension-J7IBMFTD.js → extension-KK2UPXJD.js} +8 -6
- package/dist/cli-bundle/chunks/{files-ISZJGILQ.js → files-3GESQAWL.js} +9 -9
- package/dist/cli-bundle/chunks/{files-WKOD326U.js → files-66EHM5ZR.js} +9 -9
- package/dist/cli-bundle/chunks/{gc-JDVJ6OQ2.js → gc-D5IWOKQH.js} +13 -5
- package/dist/cli-bundle/chunks/gc-D5IWOKQH.js.map +1 -0
- package/dist/cli-bundle/chunks/{gc-ULPVWMTN.js → gc-MOQDND5J.js} +12 -4
- package/dist/cli-bundle/chunks/gc-MOQDND5J.js.map +7 -0
- package/dist/cli-bundle/chunks/{get-RV37HT3G.js → get-7J2ZCBV5.js} +34 -12
- package/dist/cli-bundle/chunks/get-7J2ZCBV5.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-WXU6WI5P.js → get-WXSLXV3K.js} +33 -11
- package/dist/cli-bundle/chunks/get-WXSLXV3K.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-LOI2HHKB.js → health-B6AEM7BV.js} +21 -13
- package/dist/cli-bundle/chunks/health-B6AEM7BV.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-6L6EH4WR.js → health-YMZGOMVX.js} +20 -12
- package/dist/cli-bundle/chunks/health-YMZGOMVX.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-PKN67D5O.js → history-TJTO5GCR.js} +10 -10
- package/dist/cli-bundle/chunks/history-ZERISU2L.js +20 -0
- package/dist/cli-bundle/chunks/history-compact-CKNN6UKW.js +290 -0
- package/dist/cli-bundle/chunks/history-compact-CKNN6UKW.js.map +7 -0
- package/dist/cli-bundle/chunks/history-compact-N2Q7IR3T.js +287 -0
- package/dist/cli-bundle/chunks/history-compact-N2Q7IR3T.js.map +1 -0
- package/dist/cli-bundle/chunks/history-redact-GODBYT5A.js +19 -0
- package/dist/cli-bundle/chunks/{history-redact-V4FOJGS7.js → history-redact-JUXUOH54.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-HIBCBIKK.js → history-repair-CCCPBNTF.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-SDMHR7JT.js → history-repair-TDBBSRVK.js} +11 -11
- package/dist/cli-bundle/chunks/{init-P56QYWJF.js → init-6ZPKD3YN.js} +9 -8
- package/dist/cli-bundle/chunks/init-CBZHXBR3.js +17 -0
- package/dist/cli-bundle/chunks/{learnings-MIXSESLK.js → learnings-U7U2FNIO.js} +10 -10
- package/dist/cli-bundle/chunks/{learnings-GDFRG5J7.js → learnings-WYNTYQ5T.js} +10 -10
- package/dist/cli-bundle/chunks/list-7MTPPZHC.js +20 -0
- package/dist/cli-bundle/chunks/{list-FGOWQMSM.js → list-JGP7ODML.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-5UK3GEH2.js → notes-P25YVTEG.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-4XVSH2AZ.js → notes-QIF6A7XS.js} +10 -10
- package/dist/cli-bundle/chunks/{plan-DUMBV3QB.js → plan-RACB5PI6.js} +13 -13
- package/dist/cli-bundle/chunks/{plan-SLMODHWX.js → plan-SSBJFWXA.js} +13 -13
- package/dist/cli-bundle/chunks/{register-list-query-POCFZ5JW.js → register-list-query-5IXDPUZ6.js} +31 -25
- package/dist/cli-bundle/chunks/register-list-query-5IXDPUZ6.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-WST76HSQ.js → register-list-query-GQAEIG4K.js} +30 -24
- package/dist/cli-bundle/chunks/register-list-query-GQAEIG4K.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-N5GSUZJV.js → register-mutation-FAS4YG63.js} +72 -50
- package/dist/cli-bundle/chunks/register-mutation-FAS4YG63.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-OA675SOU.js → register-mutation-YZCUILGO.js} +71 -49
- package/dist/cli-bundle/chunks/register-mutation-YZCUILGO.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-N3PMHXH5.js → register-operations-IBYWNJN5.js} +57 -34
- package/dist/cli-bundle/chunks/register-operations-IBYWNJN5.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-GNHBE5I3.js → register-operations-S2BOLUPF.js} +58 -35
- package/dist/cli-bundle/chunks/register-operations-S2BOLUPF.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-ZHJI2DI3.js → register-setup-ABA2JPWO.js} +20 -19
- package/dist/cli-bundle/chunks/{register-setup-ZHJI2DI3.js.map → register-setup-ABA2JPWO.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-JIMPKJKV.js → register-setup-JRZ4UMWZ.js} +21 -20
- package/dist/cli-bundle/chunks/register-setup-JRZ4UMWZ.js.map +1 -0
- package/dist/cli-bundle/chunks/restore-3JRX27QW.js +17 -0
- package/dist/cli-bundle/chunks/{restore-PBL6T5TW.js → restore-K72ZNPEP.js} +11 -11
- package/dist/cli-bundle/chunks/{schema-2NOO6NGB.js → schema-3VKRDBLC.js} +76 -20
- package/dist/cli-bundle/chunks/schema-3VKRDBLC.js.map +7 -0
- package/dist/cli-bundle/chunks/{schema-EBI4NLUO.js → schema-UL4B2JX5.js} +77 -21
- package/dist/cli-bundle/chunks/schema-UL4B2JX5.js.map +1 -0
- package/dist/cli-bundle/chunks/{search-OA6JX27A.js → search-632WJ7GO.js} +516 -41
- package/dist/cli-bundle/chunks/search-632WJ7GO.js.map +7 -0
- package/dist/cli-bundle/chunks/{search-JPUQTVCY.js → search-EQDHSE4G.js} +510 -42
- package/dist/cli-bundle/chunks/search-EQDHSE4G.js.map +1 -0
- package/dist/cli-bundle/chunks/{stats-XYB6KTFG.js → stats-O4UTMJMC.js} +7 -7
- package/dist/cli-bundle/chunks/{stats-CV54BAWY.js → stats-WLJ3XBF5.js} +7 -7
- package/dist/cli-bundle/chunks/{telemetry-LMJ7PFUO.js → telemetry-EUVHFSQU.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-NCMEPJNR.js → telemetry-NRVWX25E.js} +4 -4
- package/dist/cli-bundle/chunks/{test-WBROAJIE.js → test-GXUBQNUC.js} +14 -13
- package/dist/cli-bundle/chunks/test-XN7RJL5Z.js +32 -0
- package/dist/cli-bundle/chunks/{test-all-N6NSRDTV.js → test-all-UTFXC7S2.js} +16 -15
- package/dist/cli-bundle/chunks/{test-all-N6NSRDTV.js.map → test-all-UTFXC7S2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-all-NTOZ7C3M.js → test-all-XM6OKI3L.js} +14 -13
- package/dist/cli-bundle/chunks/{test-all-NTOZ7C3M.js.map → test-all-XM6OKI3L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-runs-V6A7LPWZ.js → test-runs-7FHCPEA3.js} +5 -5
- package/dist/cli-bundle/chunks/{test-runs-WMVTQU3Y.js → test-runs-IK6E2HNX.js} +5 -5
- package/dist/cli-bundle/chunks/update-LFBSEW3N.js +21 -0
- package/dist/cli-bundle/chunks/update-U4B4OMHZ.js +25 -0
- package/dist/cli-bundle/chunks/{update-many-KGGEYABR.js → update-many-5KD33MKY.js} +22 -22
- package/dist/cli-bundle/chunks/{update-many-EM6OXYGO.js → update-many-N3YTM7K4.js} +22 -22
- package/dist/cli-bundle/chunks/{upgrade-BLI7XBAJ.js → upgrade-5SRFLUNW.js} +8 -14
- package/dist/cli-bundle/chunks/upgrade-5SRFLUNW.js.map +7 -0
- package/dist/cli-bundle/chunks/{upgrade-LXPOQKFV.js → upgrade-FFXGO43H.js} +9 -15
- package/dist/cli-bundle/chunks/upgrade-FFXGO43H.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-L5J6A7YO.js → validate-CRWXZILW.js} +20 -19
- package/dist/cli-bundle/chunks/{validate-L5J6A7YO.js.map → validate-CRWXZILW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-AGOAUOVW.js → validate-T3LPWSZG.js} +18 -17
- package/dist/cli-bundle/chunks/{validate-AGOAUOVW.js.map → validate-T3LPWSZG.js.map} +1 -1
- package/dist/cli-bundle/main.js +160 -87
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/core/config/nested-settings.d.ts +8 -8
- package/dist/core/config/nested-settings.js +71 -7
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/config/positional-value.js +4 -2
- package/dist/core/config/positional-value.js.map +1 -1
- package/dist/core/diagnostics/remediation.js +7 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +36 -0
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.js +46 -5
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/fs/fs-utils.js +29 -4
- package/dist/core/fs/fs-utils.js.map +1 -1
- package/dist/core/history/drift-scan.d.ts +3 -4
- package/dist/core/history/drift-scan.js +71 -18
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/item/id.js +4 -5
- package/dist/core/item/id.js.map +1 -1
- package/dist/core/item/item-format.js +7 -3
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/toon-decode.d.ts +7 -0
- package/dist/core/item/toon-decode.js +11 -2
- package/dist/core/item/toon-decode.js.map +1 -1
- package/dist/core/item/type-registry.js +25 -7
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/packages/root.d.ts +10 -0
- package/dist/core/packages/root.js +24 -2
- package/dist/core/packages/root.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +3 -6
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/background-refresh.d.ts +0 -8
- package/dist/core/search/background-refresh.js +2 -9
- package/dist/core/search/background-refresh.js.map +1 -1
- package/dist/core/search/cache.js +5 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/corpus.d.ts +6 -0
- package/dist/core/search/corpus.js +22 -9
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/search/embedding-batches.js +10 -7
- package/dist/core/search/embedding-batches.js.map +1 -1
- package/dist/core/search/relevance.d.ts +29 -0
- package/dist/core/search/relevance.js +226 -0
- package/dist/core/search/relevance.js.map +1 -0
- package/dist/core/search/vector-stores.d.ts +3 -0
- package/dist/core/search/vector-stores.js +27 -16
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/instrument.js +4 -17
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/shared/constants.js +15 -2
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.d.ts +6 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/primitives.d.ts +8 -0
- package/dist/core/shared/primitives.js +29 -2
- package/dist/core/shared/primitives.js.map +1 -1
- package/dist/core/shared/time.js +42 -6
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/paths.js +40 -8
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +11 -0
- package/dist/core/store/settings-validator.js +14 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.js +109 -12
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +1 -0
- package/dist/core/telemetry/runtime.js +86 -5
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.js +109 -19
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.d.ts +1 -0
- package/dist/sdk/cli-contracts/commander-types.js +15 -4
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +6 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +7 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +32 -3
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +3 -1
- package/dist/sdk/cli-contracts.js +44 -12
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/testing.d.ts +51 -1
- package/dist/sdk/testing.js +93 -2
- package/dist/sdk/testing.js.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +3 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +4 -4
- package/docs/CODEX_PLUGIN.md +1 -1
- package/docs/COMMANDS.md +14 -5
- package/docs/CONFIGURATION.md +28 -1
- package/docs/EXTENSIONS.md +17 -9
- package/docs/QUICKSTART.md +1 -1
- package/docs/RELEASING.md +17 -0
- package/docs/SDK.md +66 -0
- package/docs/TESTING.md +14 -0
- package/marketplace.json +1 -1
- package/package.json +2 -1
- package/packages/pm-governance-audit/README.md +14 -0
- package/packages/pm-governance-audit/extensions/governance-audit/index.js +39 -1
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +40 -2
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +1 -1
- package/packages/pm-governance-audit/package.json +4 -2
- package/packages/pm-lifecycle-hooks/README.md +21 -0
- package/packages/pm-search-advanced/README.md +38 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +17 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +17 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +216 -1
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +271 -2
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +7 -7
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-codex/README.md +1 -1
- package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js.map +0 -1
- package/dist/cli-bundle/chunks/aggregate-VNAHUNNF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3FI4SEFT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3LB74A67.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AY43SBIN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ECCMVXGM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GU2ZJ2VV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HZGUAH22.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KJE2FOS4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PDDFYW4X.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Q7SPNHLW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QO7EBBOM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-T3LC5LKB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-U5SXYXSY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-W7XABV4H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js.map +0 -1
- package/dist/cli-bundle/chunks/close-3HDWDA3L.js +0 -13
- package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js.map +0 -7
- package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js.map +0 -1
- package/dist/cli-bundle/chunks/config-6FXCQKIF.js.map +0 -1
- package/dist/cli-bundle/chunks/config-U4RZ4CQB.js.map +0 -7
- package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-RFSPGVVJ.js.map +0 -7
- package/dist/cli-bundle/chunks/create-JTZNCTQC.js +0 -27
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +0 -1
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +0 -7
- package/dist/cli-bundle/chunks/get-RV37HT3G.js.map +0 -1
- package/dist/cli-bundle/chunks/get-WXU6WI5P.js.map +0 -7
- package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +0 -7
- package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +0 -1
- package/dist/cli-bundle/chunks/history-2BA3T5AE.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +0 -19
- package/dist/cli-bundle/chunks/init-HIVSNX3O.js +0 -16
- package/dist/cli-bundle/chunks/list-MUSQNMTD.js +0 -20
- package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-WST76HSQ.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-OA675SOU.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-N3PMHXH5.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-D4RGNX33.js +0 -17
- package/dist/cli-bundle/chunks/schema-2NOO6NGB.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-EBI4NLUO.js.map +0 -1
- package/dist/cli-bundle/chunks/search-JPUQTVCY.js.map +0 -1
- package/dist/cli-bundle/chunks/search-OA6JX27A.js.map +0 -7
- package/dist/cli-bundle/chunks/test-MXX3E5JL.js +0 -31
- package/dist/cli-bundle/chunks/update-OSV3NAQB.js +0 -25
- package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +0 -21
- package/dist/cli-bundle/chunks/upgrade-BLI7XBAJ.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-CVXTCHYY.js.map → activity-A3QKFSSF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-JM6DTDND.js.map → activity-Q7XMIZIH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-WMKRXKCE.js.map → append-3RFOU7P5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-7H5N64R2.js.map → append-OM74OJVT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XTGLRY2Y.js.map → chunk-2HMD3JM2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PRJCELV4.js.map → chunk-2YPVCD7T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2HVRUSQA.js.map → chunk-4WYBLB6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R6UFP2GE.js.map → chunk-5NVJA7IW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XSJCLN2R.js.map → chunk-AEMKH5WQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6ER6DXH5.js.map → chunk-AXBUHLW7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BQHUILZS.js.map → chunk-BFJPMUF5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I6BNFU5X.js.map → chunk-BKQMJXWY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XLTD2HN3.js.map → chunk-CBJXWXI5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3BWOVLTH.js.map → chunk-EPWT7BEA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NUZ5HKR4.js.map → chunk-F33VC5EX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WKY2IBOQ.js.map → chunk-FGRJZVXD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-77GFDHGF.js.map → chunk-FO2TYSQZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GXSUPCBV.js.map → chunk-HOA3GMB6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OVQCEJPG.js.map → chunk-HP35AVFS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KJ33AOCY.js.map → chunk-J4DKAGTM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ME2YH6FN.js.map → chunk-JS47EKLP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I2HSTRJF.js.map → chunk-KN4WSESY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RZN6VURO.js.map → chunk-KP4KIUQT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MITFDD35.js.map → chunk-KVXIQDJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IJGCZSIQ.js.map → chunk-L3LYL3ID.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UM2GBHS4.js.map → chunk-MSH23UWO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LCM63IXU.js.map → chunk-N4SQZ7L3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3VAM3NNM.js.map → chunk-NDSMKB2I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6P6GGMOG.js.map → chunk-NGEEXR2R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PO3GSVFV.js.map → chunk-NLVCMVC7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N7ACFE26.js.map → chunk-NUKHZZNM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GGYWB3Y2.js.map → chunk-ODN53S6H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-23YFZ3IG.js.map → chunk-OTY2YEH5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2RSPZI5H.js.map → chunk-OVSSE2JP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2VVCGBNV.js.map → chunk-QF4OPBAG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WSMOSYRD.js.map → chunk-QQPZYP73.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OZ7NSQHL.js.map → chunk-QWNUDGFQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GCOQW437.js.map → chunk-SDLEYY6A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PIU6RSL3.js.map → chunk-TBLBEOEX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YL2DJGYS.js.map → chunk-UEXNNF3K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UBOPJT3S.js.map → chunk-UMMJAJB2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KAG77BY3.js.map → chunk-XLSQ3QLT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E5FJNAZA.js.map → chunk-XNGMIVQY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RWPSOIEE.js.map → chunk-YEFOCDIK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-4DBF6RVG.js.map → claim-NHBIIBOW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-X2P4IB7J.js.map → claim-RNEBQCOO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-3HDWDA3L.js.map → close-UNTFXVM3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-PTYFA45H.js.map → close-ZMXL2WDS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-QKBYCWKD.js.map → comments-EFVBHWPT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-OONGABK5.js.map → comments-J5Q4IJPH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-JTZNCTQC.js.map → create-EZWAMUKR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-I5L4EYYZ.js.map → create-PUAIJEZ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-7HPGI4GZ.js.map → delete-PKR2JHLH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-VXUPH5RS.js.map → delete-WBME6WG5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-JSRRWC3Z.js.map → deps-4BQEDV4L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-SCZIFK2Z.js.map → deps-KWHQRO75.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-GJK6K4VP.js.map → docs-364GT3ZR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-WW4N3MBM.js.map → docs-SCNBUGSV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-VDY2U33M.js.map → extension-CRE7JM47.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-J7IBMFTD.js.map → extension-KK2UPXJD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-ISZJGILQ.js.map → files-3GESQAWL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-WKOD326U.js.map → files-66EHM5ZR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-PKN67D5O.js.map → history-TJTO5GCR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-2BA3T5AE.js.map → history-ZERISU2L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-JBZNXHGR.js.map → history-redact-GODBYT5A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-V4FOJGS7.js.map → history-redact-JUXUOH54.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-HIBCBIKK.js.map → history-repair-CCCPBNTF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-SDMHR7JT.js.map → history-repair-TDBBSRVK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-P56QYWJF.js.map → init-6ZPKD3YN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-HIVSNX3O.js.map → init-CBZHXBR3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-MIXSESLK.js.map → learnings-U7U2FNIO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-GDFRG5J7.js.map → learnings-WYNTYQ5T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-MUSQNMTD.js.map → list-7MTPPZHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-FGOWQMSM.js.map → list-JGP7ODML.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-5UK3GEH2.js.map → notes-P25YVTEG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-4XVSH2AZ.js.map → notes-QIF6A7XS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-DUMBV3QB.js.map → plan-RACB5PI6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-SLMODHWX.js.map → plan-SSBJFWXA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-D4RGNX33.js.map → restore-3JRX27QW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-PBL6T5TW.js.map → restore-K72ZNPEP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-XYB6KTFG.js.map → stats-O4UTMJMC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-CV54BAWY.js.map → stats-WLJ3XBF5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-LMJ7PFUO.js.map → telemetry-EUVHFSQU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-NCMEPJNR.js.map → telemetry-NRVWX25E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-WBROAJIE.js.map → test-GXUBQNUC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-MXX3E5JL.js.map → test-XN7RJL5Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-V6A7LPWZ.js.map → test-runs-7FHCPEA3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-WMVTQU3Y.js.map → test-runs-IK6E2HNX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-YRXSUGYQ.js.map → update-LFBSEW3N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-OSV3NAQB.js.map → update-U4B4OMHZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-KGGEYABR.js.map → update-many-5KD33MKY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-EM6OXYGO.js.map → update-many-N3YTM7K4.js.map} +0 -0
|
@@ -0,0 +1,226 @@
|
|
|
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]="62bb2377-76f4-515c-b4ce-9b046f112b79")}catch(e){}}();
|
|
3
|
+
import { coercePositiveInteger, toNonEmptyString } from "../shared/primitives.js";
|
|
4
|
+
import { tokenizeAlphaNumeric } from "../shared/text-normalization.js";
|
|
5
|
+
import { executeEmbeddingRequest } from "./providers.js";
|
|
6
|
+
export const DEFAULT_QUERY_EXPANSION_MAX_QUERIES = 4;
|
|
7
|
+
export const DEFAULT_RERANK_TOP_K = 20;
|
|
8
|
+
const MAX_RERANK_TOP_K = 200;
|
|
9
|
+
const QUERY_EXPANSION_STOP_WORDS = new Set([
|
|
10
|
+
"a",
|
|
11
|
+
"an",
|
|
12
|
+
"and",
|
|
13
|
+
"for",
|
|
14
|
+
"from",
|
|
15
|
+
"in",
|
|
16
|
+
"into",
|
|
17
|
+
"of",
|
|
18
|
+
"on",
|
|
19
|
+
"or",
|
|
20
|
+
"the",
|
|
21
|
+
"to",
|
|
22
|
+
"with",
|
|
23
|
+
]);
|
|
24
|
+
function dedupeQueries(values, limit) {
|
|
25
|
+
const deduped = [];
|
|
26
|
+
const seen = new Set();
|
|
27
|
+
for (const entry of values) {
|
|
28
|
+
const normalized = entry.trim().replaceAll(/\s+/g, " ");
|
|
29
|
+
if (normalized.length === 0) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const dedupeKey = normalized.toLowerCase();
|
|
33
|
+
if (seen.has(dedupeKey)) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
seen.add(dedupeKey);
|
|
37
|
+
deduped.push(normalized);
|
|
38
|
+
if (deduped.length >= limit) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return deduped;
|
|
43
|
+
}
|
|
44
|
+
function singularizeSimple(token) {
|
|
45
|
+
const normalizedToken = token.toLowerCase();
|
|
46
|
+
if (normalizedToken.length > 4 && normalizedToken.endsWith("ies")) {
|
|
47
|
+
return `${normalizedToken.slice(0, -3)}y`;
|
|
48
|
+
}
|
|
49
|
+
if (normalizedToken.length > 4 &&
|
|
50
|
+
(normalizedToken.endsWith("ches") ||
|
|
51
|
+
normalizedToken.endsWith("shes") ||
|
|
52
|
+
normalizedToken.endsWith("xes") ||
|
|
53
|
+
normalizedToken.endsWith("zes") ||
|
|
54
|
+
normalizedToken.endsWith("sses"))) {
|
|
55
|
+
return normalizedToken.slice(0, -2);
|
|
56
|
+
}
|
|
57
|
+
if (normalizedToken.length > 3 &&
|
|
58
|
+
normalizedToken.endsWith("s") &&
|
|
59
|
+
!normalizedToken.endsWith("ss") &&
|
|
60
|
+
!normalizedToken.endsWith("us") &&
|
|
61
|
+
!normalizedToken.endsWith("is") &&
|
|
62
|
+
!normalizedToken.endsWith("as")) {
|
|
63
|
+
return normalizedToken.slice(0, -1);
|
|
64
|
+
}
|
|
65
|
+
return normalizedToken;
|
|
66
|
+
}
|
|
67
|
+
function pluralizeSimple(token) {
|
|
68
|
+
const normalizedToken = token.toLowerCase();
|
|
69
|
+
if (normalizedToken.length > 2 && (!normalizedToken.endsWith("s") || normalizedToken.endsWith("ss"))) {
|
|
70
|
+
if (normalizedToken.endsWith("y") && !/[aeiou]y$/u.test(normalizedToken)) {
|
|
71
|
+
return `${normalizedToken.slice(0, -1)}ies`;
|
|
72
|
+
}
|
|
73
|
+
if (normalizedToken.endsWith("ch") ||
|
|
74
|
+
normalizedToken.endsWith("sh") ||
|
|
75
|
+
normalizedToken.endsWith("x") ||
|
|
76
|
+
normalizedToken.endsWith("z") ||
|
|
77
|
+
normalizedToken.endsWith("ss")) {
|
|
78
|
+
return `${normalizedToken}es`;
|
|
79
|
+
}
|
|
80
|
+
return `${normalizedToken}s`;
|
|
81
|
+
}
|
|
82
|
+
return normalizedToken;
|
|
83
|
+
}
|
|
84
|
+
export function buildDeterministicQueryExpansions(query, maxQueries = DEFAULT_QUERY_EXPANSION_MAX_QUERIES) {
|
|
85
|
+
const normalizedQuery = query.trim().replaceAll(/\s+/g, " ");
|
|
86
|
+
if (normalizedQuery.length === 0) {
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
const tokens = tokenizeAlphaNumeric(normalizedQuery);
|
|
90
|
+
if (tokens.length === 0) {
|
|
91
|
+
return [normalizedQuery];
|
|
92
|
+
}
|
|
93
|
+
const contentTokens = tokens.filter((token) => !QUERY_EXPANSION_STOP_WORDS.has(token.toLowerCase()));
|
|
94
|
+
const singularized = tokens.map((token) => singularizeSimple(token));
|
|
95
|
+
const pluralized = contentTokens.map((token) => pluralizeSimple(token));
|
|
96
|
+
return dedupeQueries([
|
|
97
|
+
normalizedQuery,
|
|
98
|
+
tokens.join(" "),
|
|
99
|
+
contentTokens.join(" "),
|
|
100
|
+
singularized.join(" "),
|
|
101
|
+
pluralized.join(" "),
|
|
102
|
+
], Math.max(1, maxQueries));
|
|
103
|
+
}
|
|
104
|
+
export function normalizeQueryExpansionOutput(raw) {
|
|
105
|
+
const rawQueries = Array.isArray(raw)
|
|
106
|
+
? raw
|
|
107
|
+
: raw?.queries;
|
|
108
|
+
if (!Array.isArray(rawQueries)) {
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
return dedupeQueries(rawQueries.filter((entry) => typeof entry === "string"), DEFAULT_QUERY_EXPANSION_MAX_QUERIES);
|
|
112
|
+
}
|
|
113
|
+
export function mergeQueryExpansions(base, extra, maxQueries) {
|
|
114
|
+
return dedupeQueries([...base, ...extra], Math.max(1, maxQueries));
|
|
115
|
+
}
|
|
116
|
+
export function resolveQueryExpansionConfig(settings, fallbackProviderName) {
|
|
117
|
+
const search = settings.search;
|
|
118
|
+
const queryExpansion = search?.query_expansion;
|
|
119
|
+
const configuredProvider = toNonEmptyString(queryExpansion?.provider);
|
|
120
|
+
return {
|
|
121
|
+
enabled: queryExpansion?.enabled === true,
|
|
122
|
+
provider: configuredProvider ?? fallbackProviderName,
|
|
123
|
+
max_queries: DEFAULT_QUERY_EXPANSION_MAX_QUERIES,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export function resolveRerankConfig(settings, fallbackModel) {
|
|
127
|
+
const search = settings.search;
|
|
128
|
+
const rerank = search?.rerank;
|
|
129
|
+
const configuredModel = toNonEmptyString(rerank?.model);
|
|
130
|
+
const configuredTopK = coercePositiveInteger(rerank?.top_k);
|
|
131
|
+
const normalizedTopK = configuredTopK ?? DEFAULT_RERANK_TOP_K;
|
|
132
|
+
return {
|
|
133
|
+
enabled: rerank?.enabled === true,
|
|
134
|
+
model: configuredModel ?? fallbackModel,
|
|
135
|
+
top_k: Math.min(MAX_RERANK_TOP_K, normalizedTopK),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export function normalizeRerankOutput(raw) {
|
|
139
|
+
const rawHits = Array.isArray(raw)
|
|
140
|
+
? raw
|
|
141
|
+
: raw?.hits;
|
|
142
|
+
if (!Array.isArray(rawHits)) {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
const bestById = new Map();
|
|
146
|
+
for (const entry of rawHits) {
|
|
147
|
+
if (typeof entry !== "object" || entry === null) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
const id = toNonEmptyString(entry.id);
|
|
151
|
+
const score = entry.score;
|
|
152
|
+
if (!id || typeof score !== "number" || !Number.isFinite(score)) {
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
const existing = bestById.get(id);
|
|
156
|
+
if (existing === undefined || score > existing) {
|
|
157
|
+
bestById.set(id, score);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const normalized = [...bestById.entries()].map(([id, score]) => ({ id, score }));
|
|
161
|
+
normalized.sort((left, right) => {
|
|
162
|
+
if (left.score !== right.score) {
|
|
163
|
+
return right.score - left.score;
|
|
164
|
+
}
|
|
165
|
+
return left.id.localeCompare(right.id);
|
|
166
|
+
});
|
|
167
|
+
return normalized;
|
|
168
|
+
}
|
|
169
|
+
function dotProduct(left, right) {
|
|
170
|
+
const size = left.length;
|
|
171
|
+
let result = 0;
|
|
172
|
+
for (let index = 0; index < size; index += 1) {
|
|
173
|
+
result += left[index] * right[index];
|
|
174
|
+
}
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
function l2Norm(vector) {
|
|
178
|
+
let sumSquares = 0;
|
|
179
|
+
for (let index = 0; index < vector.length; index += 1) {
|
|
180
|
+
sumSquares += vector[index] * vector[index];
|
|
181
|
+
}
|
|
182
|
+
return Math.sqrt(sumSquares);
|
|
183
|
+
}
|
|
184
|
+
function cosineSimilarityWithKnownLeftNorm(left, right, leftNorm) {
|
|
185
|
+
if (!left || !right || left.length === 0 || right.length === 0 || left.length !== right.length) {
|
|
186
|
+
return 0;
|
|
187
|
+
}
|
|
188
|
+
const numerator = dotProduct(left, right);
|
|
189
|
+
const rightNorm = l2Norm(right);
|
|
190
|
+
const denominator = leftNorm * rightNorm;
|
|
191
|
+
if (!Number.isFinite(numerator) ||
|
|
192
|
+
!Number.isFinite(leftNorm) ||
|
|
193
|
+
!Number.isFinite(rightNorm) ||
|
|
194
|
+
!Number.isFinite(denominator) ||
|
|
195
|
+
denominator === 0) {
|
|
196
|
+
return 0;
|
|
197
|
+
}
|
|
198
|
+
return Math.max(-1, Math.min(1, numerator / denominator));
|
|
199
|
+
}
|
|
200
|
+
export async function rerankCandidatesWithEmbeddings(provider, model, query, candidates, timeoutMs) {
|
|
201
|
+
if (candidates.length === 0) {
|
|
202
|
+
return new Map();
|
|
203
|
+
}
|
|
204
|
+
const effectiveModel = toNonEmptyString(model) ?? provider.model;
|
|
205
|
+
const rerankProvider = effectiveModel === provider.model ? provider : { ...provider, model: effectiveModel };
|
|
206
|
+
const payload = [query.trim(), ...candidates.map((entry) => entry.text)];
|
|
207
|
+
const vectors = await executeEmbeddingRequest(rerankProvider, payload, timeoutMs ? { timeout_ms: timeoutMs } : {});
|
|
208
|
+
const queryVector = vectors[0];
|
|
209
|
+
if (!queryVector) {
|
|
210
|
+
return new Map();
|
|
211
|
+
}
|
|
212
|
+
const queryNorm = l2Norm(queryVector);
|
|
213
|
+
const scoreById = new Map();
|
|
214
|
+
for (let index = 0; index < candidates.length; index += 1) {
|
|
215
|
+
const candidate = candidates[index];
|
|
216
|
+
const candidateVector = vectors[index + 1];
|
|
217
|
+
if (!candidateVector) {
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
const similarity = cosineSimilarityWithKnownLeftNorm(queryVector, candidateVector, queryNorm);
|
|
221
|
+
scoreById.set(candidate.id, Math.max(0, Math.min(1, (similarity + 1) / 2)));
|
|
222
|
+
}
|
|
223
|
+
return scoreById;
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=relevance.js.map
|
|
226
|
+
//# debugId=62bb2377-76f4-515c-b4ce-9b046f112b79
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relevance.js","sources":["core/search/relevance.ts"],"sourceRoot":"/","sourcesContent":["import type { PmSettings } from \"../../types.js\";\nimport { coercePositiveInteger, toNonEmptyString } from \"../shared/primitives.js\";\nimport { tokenizeAlphaNumeric } from \"../shared/text-normalization.js\";\nimport { executeEmbeddingRequest, type EmbeddingProviderConfig } from \"./providers.js\";\n\nexport const DEFAULT_QUERY_EXPANSION_MAX_QUERIES = 4;\nexport const DEFAULT_RERANK_TOP_K = 20;\nconst MAX_RERANK_TOP_K = 200;\n\nconst QUERY_EXPANSION_STOP_WORDS = new Set([\n \"a\",\n \"an\",\n \"and\",\n \"for\",\n \"from\",\n \"in\",\n \"into\",\n \"of\",\n \"on\",\n \"or\",\n \"the\",\n \"to\",\n \"with\",\n]);\n\nexport interface QueryExpansionConfig {\n enabled: boolean;\n provider: string | null;\n max_queries: number;\n}\n\nexport interface RerankConfig {\n enabled: boolean;\n model: string;\n top_k: number;\n}\n\nexport interface RerankCandidate {\n id: string;\n text: string;\n}\n\nexport interface RerankScoredHit {\n id: string;\n score: number;\n}\n\nfunction dedupeQueries(values: string[], limit: number): string[] {\n const deduped: string[] = [];\n const seen = new Set<string>();\n for (const entry of values) {\n const normalized = entry.trim().replaceAll(/\\s+/g, \" \");\n if (normalized.length === 0) {\n continue;\n }\n const dedupeKey = normalized.toLowerCase();\n if (seen.has(dedupeKey)) {\n continue;\n }\n seen.add(dedupeKey);\n deduped.push(normalized);\n if (deduped.length >= limit) {\n break;\n }\n }\n return deduped;\n}\n\nfunction singularizeSimple(token: string): string {\n const normalizedToken = token.toLowerCase();\n if (normalizedToken.length > 4 && normalizedToken.endsWith(\"ies\")) {\n return `${normalizedToken.slice(0, -3)}y`;\n }\n if (\n normalizedToken.length > 4 &&\n (normalizedToken.endsWith(\"ches\") ||\n normalizedToken.endsWith(\"shes\") ||\n normalizedToken.endsWith(\"xes\") ||\n normalizedToken.endsWith(\"zes\") ||\n normalizedToken.endsWith(\"sses\"))\n ) {\n return normalizedToken.slice(0, -2);\n }\n if (\n normalizedToken.length > 3 &&\n normalizedToken.endsWith(\"s\") &&\n !normalizedToken.endsWith(\"ss\") &&\n !normalizedToken.endsWith(\"us\") &&\n !normalizedToken.endsWith(\"is\") &&\n !normalizedToken.endsWith(\"as\")\n ) {\n return normalizedToken.slice(0, -1);\n }\n return normalizedToken;\n}\n\nfunction pluralizeSimple(token: string): string {\n const normalizedToken = token.toLowerCase();\n if (normalizedToken.length > 2 && (!normalizedToken.endsWith(\"s\") || normalizedToken.endsWith(\"ss\"))) {\n if (normalizedToken.endsWith(\"y\") && !/[aeiou]y$/u.test(normalizedToken)) {\n return `${normalizedToken.slice(0, -1)}ies`;\n }\n if (\n normalizedToken.endsWith(\"ch\") ||\n normalizedToken.endsWith(\"sh\") ||\n normalizedToken.endsWith(\"x\") ||\n normalizedToken.endsWith(\"z\") ||\n normalizedToken.endsWith(\"ss\")\n ) {\n return `${normalizedToken}es`;\n }\n return `${normalizedToken}s`;\n }\n return normalizedToken;\n}\n\nexport function buildDeterministicQueryExpansions(\n query: string,\n maxQueries = DEFAULT_QUERY_EXPANSION_MAX_QUERIES,\n): string[] {\n const normalizedQuery = query.trim().replaceAll(/\\s+/g, \" \");\n if (normalizedQuery.length === 0) {\n return [];\n }\n const tokens = tokenizeAlphaNumeric(normalizedQuery);\n if (tokens.length === 0) {\n return [normalizedQuery];\n }\n const contentTokens = tokens.filter((token) => !QUERY_EXPANSION_STOP_WORDS.has(token.toLowerCase()));\n const singularized = tokens.map((token) => singularizeSimple(token));\n const pluralized = contentTokens.map((token) => pluralizeSimple(token));\n return dedupeQueries(\n [\n normalizedQuery,\n tokens.join(\" \"),\n contentTokens.join(\" \"),\n singularized.join(\" \"),\n pluralized.join(\" \"),\n ],\n Math.max(1, maxQueries),\n );\n}\n\nexport function normalizeQueryExpansionOutput(raw: unknown): string[] {\n const rawQueries = Array.isArray(raw)\n ? raw\n : (raw as { queries?: unknown } | null | undefined)?.queries;\n if (!Array.isArray(rawQueries)) {\n return [];\n }\n return dedupeQueries(\n rawQueries.filter((entry): entry is string => typeof entry === \"string\"),\n DEFAULT_QUERY_EXPANSION_MAX_QUERIES,\n );\n}\n\nexport function mergeQueryExpansions(base: string[], extra: string[], maxQueries: number): string[] {\n return dedupeQueries([...base, ...extra], Math.max(1, maxQueries));\n}\n\nexport function resolveQueryExpansionConfig(\n settings: PmSettings,\n fallbackProviderName: string | null,\n): QueryExpansionConfig {\n const search = (settings as { search?: { query_expansion?: { enabled?: unknown; provider?: unknown } } }).search;\n const queryExpansion = search?.query_expansion;\n const configuredProvider = toNonEmptyString(queryExpansion?.provider);\n return {\n enabled: queryExpansion?.enabled === true,\n provider: configuredProvider ?? fallbackProviderName,\n max_queries: DEFAULT_QUERY_EXPANSION_MAX_QUERIES,\n };\n}\n\nexport function resolveRerankConfig(settings: PmSettings, fallbackModel: string): RerankConfig {\n const search = (settings as { search?: { rerank?: { enabled?: unknown; model?: unknown; top_k?: unknown } } }).search;\n const rerank = search?.rerank;\n const configuredModel = toNonEmptyString(rerank?.model);\n const configuredTopK = coercePositiveInteger(rerank?.top_k);\n const normalizedTopK = configuredTopK ?? DEFAULT_RERANK_TOP_K;\n return {\n enabled: rerank?.enabled === true,\n model: configuredModel ?? fallbackModel,\n top_k: Math.min(MAX_RERANK_TOP_K, normalizedTopK),\n };\n}\n\nexport function normalizeRerankOutput(raw: unknown): RerankScoredHit[] {\n const rawHits = Array.isArray(raw)\n ? raw\n : (raw as { hits?: unknown } | null | undefined)?.hits;\n if (!Array.isArray(rawHits)) {\n return [];\n }\n const bestById = new Map<string, number>();\n for (const entry of rawHits) {\n if (typeof entry !== \"object\" || entry === null) {\n continue;\n }\n const id = toNonEmptyString((entry as { id?: unknown }).id);\n const score = (entry as { score?: unknown }).score;\n if (!id || typeof score !== \"number\" || !Number.isFinite(score)) {\n continue;\n }\n const existing = bestById.get(id);\n if (existing === undefined || score > existing) {\n bestById.set(id, score);\n }\n }\n const normalized = [...bestById.entries()].map(([id, score]) => ({ id, score }));\n normalized.sort((left, right) => {\n if (left.score !== right.score) {\n return right.score - left.score;\n }\n return left.id.localeCompare(right.id);\n });\n return normalized;\n}\n\nfunction dotProduct(left: number[], right: number[]): number {\n const size = left.length;\n let result = 0;\n for (let index = 0; index < size; index += 1) {\n result += left[index] * right[index];\n }\n return result;\n}\n\nfunction l2Norm(vector: number[]): number {\n let sumSquares = 0;\n for (let index = 0; index < vector.length; index += 1) {\n sumSquares += vector[index] * vector[index];\n }\n return Math.sqrt(sumSquares);\n}\n\nfunction cosineSimilarityWithKnownLeftNorm(\n left: number[] | null | undefined,\n right: number[] | null | undefined,\n leftNorm: number,\n): number {\n if (!left || !right || left.length === 0 || right.length === 0 || left.length !== right.length) {\n return 0;\n }\n const numerator = dotProduct(left, right);\n const rightNorm = l2Norm(right);\n const denominator = leftNorm * rightNorm;\n if (\n !Number.isFinite(numerator) ||\n !Number.isFinite(leftNorm) ||\n !Number.isFinite(rightNorm) ||\n !Number.isFinite(denominator) ||\n denominator === 0\n ) {\n return 0;\n }\n return Math.max(-1, Math.min(1, numerator / denominator));\n}\n\nexport async function rerankCandidatesWithEmbeddings(\n provider: EmbeddingProviderConfig,\n model: string,\n query: string,\n candidates: RerankCandidate[],\n timeoutMs?: number,\n): Promise<Map<string, number>> {\n if (candidates.length === 0) {\n return new Map();\n }\n const effectiveModel = toNonEmptyString(model) ?? provider.model;\n const rerankProvider: EmbeddingProviderConfig =\n effectiveModel === provider.model ? provider : { ...provider, model: effectiveModel };\n const payload = [query.trim(), ...candidates.map((entry) => entry.text)];\n const vectors = await executeEmbeddingRequest(rerankProvider, payload, timeoutMs ? { timeout_ms: timeoutMs } : {});\n const queryVector = vectors[0];\n if (!queryVector) {\n return new Map();\n }\n const queryNorm = l2Norm(queryVector);\n const scoreById = new Map<string, number>();\n for (let index = 0; index < candidates.length; index += 1) {\n const candidate = candidates[index];\n const candidateVector = vectors[index + 1];\n if (!candidateVector) {\n continue;\n }\n const similarity = cosineSimilarityWithKnownLeftNorm(queryVector, candidateVector, queryNorm);\n scoreById.set(candidate.id, Math.max(0, Math.min(1, (similarity + 1) / 2)));\n }\n return scoreById;\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAgC,MAAM,gBAAgB,CAAC;AAEvF,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC;IACzC,GAAG;IACH,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,MAAM;CACP,CAAC,CAAC;AAwBH,SAAS,aAAa,CAAC,MAAgB,EAAE,KAAa;IACpD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACxD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,SAAS;QACX,CAAC;QACD,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;QAC3C,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YACxB,SAAS;QACX,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpB,OAAO,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AM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC5C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1D,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,SAAS;QACX,CAAC;QACD,MAAM,UAAU,GAAG,iCAAiC,CAAC,WAAW,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;QAC9F,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","debugId":"62bb2377-76f4-515c-b4ce-9b046f112b79"}
|
|
@@ -4,11 +4,13 @@ export type VectorStoreName = "qdrant" | "lancedb";
|
|
|
4
4
|
export interface QdrantVectorStoreConfig {
|
|
5
5
|
name: "qdrant";
|
|
6
6
|
url: string;
|
|
7
|
+
collection_name?: string;
|
|
7
8
|
api_key?: string;
|
|
8
9
|
}
|
|
9
10
|
export interface LanceDbVectorStoreConfig {
|
|
10
11
|
name: "lancedb";
|
|
11
12
|
path: string;
|
|
13
|
+
collection_name?: string;
|
|
12
14
|
}
|
|
13
15
|
export type VectorStoreConfig = QdrantVectorStoreConfig | LanceDbVectorStoreConfig;
|
|
14
16
|
export interface VectorStoreResolution {
|
|
@@ -60,6 +62,7 @@ export interface ExecuteVectorRequestOptions {
|
|
|
60
62
|
}
|
|
61
63
|
type VectorSettingsInput = {
|
|
62
64
|
vector_store?: {
|
|
65
|
+
collection_name?: string;
|
|
63
66
|
qdrant?: {
|
|
64
67
|
url?: string;
|
|
65
68
|
api_key?: string;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
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]="
|
|
3
|
-
import { mkdir, readFile,
|
|
4
|
-
import {
|
|
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]="eb209648-8ca2-5f93-91f2-3165e28da920")}catch(e){}}();
|
|
3
|
+
import { mkdir, readFile, stat, unlink } from "node:fs/promises";
|
|
4
|
+
import { dirname, join, resolve } from "node:path";
|
|
5
5
|
import { executeSearchJsonRequest, normalizeSearchHttpTimeoutMs, resolveSearchHttpFetcher, } from "./http-client.js";
|
|
6
6
|
import { isFiniteNumberArray, toErrorMessage, toNonEmptyString, trimTrailingSlashes, } from "../shared/primitives.js";
|
|
7
|
+
import { writeFileAtomic } from "../fs/fs-utils.js";
|
|
7
8
|
const DEFAULT_COLLECTION = "pm_items";
|
|
9
|
+
const COLLECTION_SANITIZE_PATTERN = /[^a-zA-Z0-9_-]/g;
|
|
10
|
+
const MAX_COLLECTION_NAME_LENGTH = 128;
|
|
8
11
|
const LANCE_DB_LOCAL_SNAPSHOT_DIR = ".pm-cli-local-vectors";
|
|
9
12
|
const LANCE_DB_LOCAL_SNAPSHOT_VERSION = 1;
|
|
10
13
|
const lanceDbLocalTables = new Map();
|
|
14
|
+
function resolveStoreCollectionName(store) {
|
|
15
|
+
const candidate = toNonEmptyString(store.collection_name) ?? DEFAULT_COLLECTION;
|
|
16
|
+
return candidate.replaceAll(COLLECTION_SANITIZE_PATTERN, "_").slice(0, MAX_COLLECTION_NAME_LENGTH);
|
|
17
|
+
}
|
|
11
18
|
function normalizeVector(value) {
|
|
12
19
|
if (!isFiniteNumberArray(value) || value.length === 0) {
|
|
13
20
|
throw new Error("Vector values must be a non-empty numeric array");
|
|
@@ -83,10 +90,12 @@ function resolveQdrantStore(settings) {
|
|
|
83
90
|
if (!url) {
|
|
84
91
|
return null;
|
|
85
92
|
}
|
|
93
|
+
const collectionName = toNonEmptyString(settings.vector_store?.collection_name);
|
|
86
94
|
const apiKey = toNonEmptyString(settings.vector_store?.qdrant?.api_key);
|
|
87
95
|
return {
|
|
88
96
|
name: "qdrant",
|
|
89
97
|
url,
|
|
98
|
+
...(collectionName && collectionName !== DEFAULT_COLLECTION ? { collection_name: collectionName } : {}),
|
|
90
99
|
...(apiKey ? { api_key: apiKey } : {}),
|
|
91
100
|
};
|
|
92
101
|
}
|
|
@@ -95,9 +104,11 @@ function resolveLanceDbStore(settings) {
|
|
|
95
104
|
if (!lancedbPath) {
|
|
96
105
|
return null;
|
|
97
106
|
}
|
|
107
|
+
const collectionName = toNonEmptyString(settings.vector_store?.collection_name);
|
|
98
108
|
return {
|
|
99
109
|
name: "lancedb",
|
|
100
110
|
path: lancedbPath,
|
|
111
|
+
...(collectionName && collectionName !== DEFAULT_COLLECTION ? { collection_name: collectionName } : {}),
|
|
101
112
|
};
|
|
102
113
|
}
|
|
103
114
|
function normalizeVectorRecords(records) {
|
|
@@ -289,7 +300,6 @@ async function persistLanceDbLocalTable(storePath, tableName, table) {
|
|
|
289
300
|
catch (error) {
|
|
290
301
|
throw new Error(`LanceDB local snapshot directory create failed at '${snapshotDir}': ${toErrorMessage(error)}`);
|
|
291
302
|
}
|
|
292
|
-
const tempPath = join(snapshotDir, `${basename(snapshotPath)}.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`);
|
|
293
303
|
// Serialize compactly: the snapshot is an internal, gitignored cache re-read via
|
|
294
304
|
// JSON.parse (whitespace-agnostic). Pretty-printing put every embedding float on its
|
|
295
305
|
// own indented line, roughly doubling file size and parse/serialize cost — a real
|
|
@@ -300,11 +310,9 @@ async function persistLanceDbLocalTable(storePath, tableName, table) {
|
|
|
300
310
|
records: buildSnapshotRecords(table),
|
|
301
311
|
})}\n`;
|
|
302
312
|
try {
|
|
303
|
-
await
|
|
304
|
-
await rename(tempPath, snapshotPath);
|
|
313
|
+
await writeFileAtomic(snapshotPath, serialized);
|
|
305
314
|
}
|
|
306
315
|
catch (error) {
|
|
307
|
-
await unlink(tempPath).catch(() => { });
|
|
308
316
|
throw new Error(`LanceDB local snapshot write failed at '${snapshotPath}': ${toErrorMessage(error)}`);
|
|
309
317
|
}
|
|
310
318
|
}
|
|
@@ -352,19 +360,22 @@ export function resolveVectorStores(settings) {
|
|
|
352
360
|
};
|
|
353
361
|
}
|
|
354
362
|
export function resolveVectorStoreRequestTarget(store) {
|
|
363
|
+
const collectionName = resolveStoreCollectionName(store);
|
|
355
364
|
if (store.name === "qdrant") {
|
|
356
365
|
const baseUrl = trimTrailingSlashes(store.url);
|
|
366
|
+
const encodedCollection = encodeURIComponent(collectionName);
|
|
357
367
|
return {
|
|
358
368
|
store: "qdrant",
|
|
359
|
-
query_target: `${baseUrl}/collections/${
|
|
360
|
-
upsert_target: `${baseUrl}/collections/${
|
|
369
|
+
query_target: `${baseUrl}/collections/${encodedCollection}/points/search`,
|
|
370
|
+
upsert_target: `${baseUrl}/collections/${encodedCollection}/points?wait=true`,
|
|
361
371
|
};
|
|
362
372
|
}
|
|
363
373
|
const encodedPath = encodeURIComponent(store.path);
|
|
374
|
+
const encodedCollection = encodeURIComponent(collectionName);
|
|
364
375
|
return {
|
|
365
376
|
store: "lancedb",
|
|
366
|
-
query_target: `lancedb://${encodedPath}#${
|
|
367
|
-
upsert_target: `lancedb://${encodedPath}#${
|
|
377
|
+
query_target: `lancedb://${encodedPath}#${encodedCollection}`,
|
|
378
|
+
upsert_target: `lancedb://${encodedPath}#${encodedCollection}`,
|
|
368
379
|
};
|
|
369
380
|
}
|
|
370
381
|
export function buildVectorQueryPlan(store, vector, limit) {
|
|
@@ -388,7 +399,7 @@ export function buildVectorQueryPlan(store, vector, limit) {
|
|
|
388
399
|
method: "LOCAL",
|
|
389
400
|
headers: {},
|
|
390
401
|
body: {
|
|
391
|
-
table:
|
|
402
|
+
table: resolveStoreCollectionName(store),
|
|
392
403
|
vector: normalizedVector,
|
|
393
404
|
limit: normalizedLimit,
|
|
394
405
|
},
|
|
@@ -412,7 +423,7 @@ export function buildVectorUpsertPlan(store, records) {
|
|
|
412
423
|
method: "LOCAL",
|
|
413
424
|
headers: {},
|
|
414
425
|
body: {
|
|
415
|
-
table:
|
|
426
|
+
table: resolveStoreCollectionName(store),
|
|
416
427
|
records: normalizedRecords,
|
|
417
428
|
},
|
|
418
429
|
};
|
|
@@ -435,7 +446,7 @@ export function buildVectorDeletePlan(store, ids) {
|
|
|
435
446
|
method: "LOCAL",
|
|
436
447
|
headers: {},
|
|
437
448
|
body: {
|
|
438
|
-
table:
|
|
449
|
+
table: resolveStoreCollectionName(store),
|
|
439
450
|
ids: normalizedIds,
|
|
440
451
|
},
|
|
441
452
|
};
|
|
@@ -552,7 +563,7 @@ export async function executeVectorDelete(store, ids, options = {}) {
|
|
|
552
563
|
}
|
|
553
564
|
export async function executeVectorReset(store, knownIds = [], options = {}, vectorDimension) {
|
|
554
565
|
if (store.name === "lancedb") {
|
|
555
|
-
await resetLanceDbLocalTable(store.path,
|
|
566
|
+
await resetLanceDbLocalTable(store.path, resolveStoreCollectionName(store));
|
|
556
567
|
return { status: "ok" };
|
|
557
568
|
}
|
|
558
569
|
if (vectorDimension !== undefined) {
|
|
@@ -595,4 +606,4 @@ export async function executeVectorReset(store, knownIds = [], options = {}, vec
|
|
|
595
606
|
return await executeVectorDelete(store, idsToDelete, options);
|
|
596
607
|
}
|
|
597
608
|
//# sourceMappingURL=vector-stores.js.map
|
|
598
|
-
//# debugId=
|
|
609
|
+
//# debugId=eb209648-8ca2-5f93-91f2-3165e28da920
|