@unbrained/pm-cli 2026.6.5 → 2026.6.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 +77 -0
- package/CONTRIBUTING.md +1 -0
- package/README.md +17 -5
- 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 +13 -10
- 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 +20 -10
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/completion.js +87 -18
- 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 +6 -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.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.d.ts +8 -1
- package/dist/cli/commands/gc.js +26 -3
- 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 +15 -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/history.d.ts +4 -1
- package/dist/cli/commands/history.js +12 -24
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -0
- package/dist/cli/commands/index.js +5 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/list.d.ts +2 -0
- package/dist/cli/commands/list.js +87 -9
- package/dist/cli/commands/list.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/search.d.ts +1 -0
- package/dist/cli/commands/search.js +232 -35
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +8 -1
- package/dist/cli/commands/stats.js +18 -17
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/telemetry.d.ts +8 -0
- package/dist/cli/commands/telemetry.js +253 -0
- package/dist/cli/commands/telemetry.js.map +1 -0
- 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 +19 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +13 -21
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +24 -6
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +52 -17
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +55 -8
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +5 -5
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +21 -3
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-5UROHJ3D.js +16 -0
- package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js → activity-YVB3QRTE.js} +11 -11
- package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js → aggregate-LH66F75F.js} +87 -17
- package/dist/cli-bundle/chunks/aggregate-LH66F75F.js.map +7 -0
- package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js → aggregate-OHSWFQJM.js} +88 -18
- package/dist/cli-bundle/chunks/aggregate-OHSWFQJM.js.map +1 -0
- package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js → append-2PPYFAG5.js} +8 -8
- package/dist/cli-bundle/chunks/{append-5JE3YGXU.js → append-AUGT5W6J.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js → chunk-2IF7WLB7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KA24HME7.js → chunk-2IXCHCLM.js} +5 -6
- package/dist/cli-bundle/chunks/chunk-2IXCHCLM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js → chunk-2OJHLWBZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js → chunk-3A2CMEM7.js} +5 -4
- package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js → chunk-3EOBJOF4.js} +5 -4
- package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js → chunk-42LOFGJS.js} +91 -16
- package/dist/cli-bundle/chunks/chunk-42LOFGJS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WIKR7KFL.js → chunk-4CHEG6UK.js} +108 -21
- package/dist/cli-bundle/chunks/chunk-4CHEG6UK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js → chunk-4GHZR3BA.js} +56 -28
- package/dist/cli-bundle/chunks/chunk-4GHZR3BA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js → chunk-5AXMRKN5.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js → chunk-6J4K6JLA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-V3JQ4IPL.js → chunk-6RZXO5M2.js} +102 -22
- package/dist/cli-bundle/chunks/chunk-6RZXO5M2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js → chunk-AVJD6VTA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js → chunk-B2KZGPM2.js} +39 -8
- package/dist/cli-bundle/chunks/chunk-B2KZGPM2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js → chunk-B5RF3IP7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js → chunk-C5W2UH56.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js → chunk-CKLBZHS7.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-GNHVV4SY.js → chunk-CLD3XNCH.js} +124 -20
- package/dist/cli-bundle/chunks/chunk-CLD3XNCH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RANZIID5.js → chunk-FHHBD7PN.js} +38 -7
- package/dist/cli-bundle/chunks/chunk-FHHBD7PN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js → chunk-FY6Z3FYY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js → chunk-GNIUOLZ2.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js → chunk-GPXQBR3H.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js → chunk-GUZBNB3G.js} +27 -5
- package/dist/cli-bundle/chunks/chunk-GUZBNB3G.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js → chunk-H7EO3QA3.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js → chunk-HLC3KTLP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js → chunk-HMMMWBK2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js → chunk-HRMHZ4RV.js} +26 -4
- package/dist/cli-bundle/chunks/chunk-HRMHZ4RV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js → chunk-HV5SSZXF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js → chunk-IMCJBN2Q.js} +23 -14
- package/dist/cli-bundle/chunks/chunk-IMCJBN2Q.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js → chunk-KNGVP5WJ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js → chunk-KR6R465K.js} +304 -215
- package/dist/cli-bundle/chunks/chunk-KR6R465K.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js → chunk-LI65XLJR.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js → chunk-LIN2BPJ7.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-LMTOY5HE.js +112 -0
- package/dist/cli-bundle/chunks/chunk-LMTOY5HE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js → chunk-LQHBENVW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js → chunk-LXO6V66E.js} +14 -14
- package/dist/cli-bundle/chunks/{chunk-TK633IVD.js → chunk-M2PW7EZU.js} +26 -7
- package/dist/cli-bundle/chunks/chunk-M2PW7EZU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js → chunk-MOYM2C3J.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-ZQ4F6EC4.js → chunk-MWRS7Z4P.js} +127 -23
- package/dist/cli-bundle/chunks/chunk-MWRS7Z4P.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js → chunk-NHR2QXXZ.js} +24 -15
- package/dist/cli-bundle/chunks/chunk-NHR2QXXZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js → chunk-NQL32HQ5.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js → chunk-O7HSSFCC.js} +65 -16
- package/dist/cli-bundle/chunks/chunk-O7HSSFCC.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js → chunk-OKSKJKHX.js} +9 -9
- package/dist/cli-bundle/chunks/chunk-QQL5QSTZ.js +1572 -0
- package/dist/cli-bundle/chunks/chunk-QQL5QSTZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js → chunk-R3V3YCMH.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js → chunk-RVPTZKBC.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js → chunk-SFFVGNHC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js → chunk-SQPKRA54.js} +14 -14
- package/dist/cli-bundle/chunks/chunk-THDEID2Z.js +115 -0
- package/dist/cli-bundle/chunks/chunk-THDEID2Z.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js → chunk-TINUJMWN.js} +92 -17
- package/dist/cli-bundle/chunks/chunk-TINUJMWN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js → chunk-TNPBPNII.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js → chunk-TP4DDY27.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js → chunk-TYJJOTUA.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js → chunk-UAQOQ7IE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js → chunk-UEWA73ZZ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js → chunk-UIIQC5YO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js → chunk-UJUT6AHZ.js} +314 -39
- package/dist/cli-bundle/chunks/chunk-UJUT6AHZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js → chunk-UT6WFXW2.js} +6 -7
- package/dist/cli-bundle/chunks/chunk-UT6WFXW2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js → chunk-UYQ7HXH4.js} +10 -6
- package/dist/cli-bundle/chunks/chunk-UYQ7HXH4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js → chunk-V6EYFTRL.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js → chunk-WAA7UI6M.js} +58 -30
- package/dist/cli-bundle/chunks/chunk-WAA7UI6M.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js → chunk-WCQZBDDH.js} +10 -6
- package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js.map → chunk-WCQZBDDH.js.map} +2 -2
- package/dist/cli-bundle/chunks/chunk-WR5567FH.js +1582 -0
- package/dist/cli-bundle/chunks/chunk-WR5567FH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js → chunk-WYEXLDDY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js → chunk-X4IZKYHP.js} +307 -32
- package/dist/cli-bundle/chunks/chunk-X4IZKYHP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js → chunk-X7UHMKPE.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-7K24QB23.js → chunk-XS3O2TFJ.js} +27 -8
- package/dist/cli-bundle/chunks/chunk-XS3O2TFJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js → chunk-XYNT7UFP.js} +303 -207
- package/dist/cli-bundle/chunks/chunk-XYNT7UFP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js → chunk-YBZW2QQ7.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js → chunk-YO3THIJF.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js → chunk-YPH4ESA2.js} +66 -17
- package/dist/cli-bundle/chunks/chunk-YPH4ESA2.js.map +1 -0
- package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js → claim-BJ4QMPJC.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js → claim-KW743OSW.js} +10 -10
- package/dist/cli-bundle/chunks/close-P4ZBKODL.js +13 -0
- package/dist/cli-bundle/chunks/{close-65DFYAVS.js → close-SYHSRZDC.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js → close-many-DBLEYFOY.js} +29 -26
- package/dist/cli-bundle/chunks/close-many-DBLEYFOY.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js → close-many-LAC5VR4G.js} +30 -27
- package/dist/cli-bundle/chunks/close-many-LAC5VR4G.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js → comments-JEO6HHVM.js} +10 -10
- package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js → comments-YT2PQ5DD.js} +10 -10
- package/dist/cli-bundle/chunks/{config-DDPYIA6J.js → config-RZRVS3ZV.js} +127 -11
- package/dist/cli-bundle/chunks/config-RZRVS3ZV.js.map +1 -0
- package/dist/cli-bundle/chunks/{config-5ON3ADRH.js → config-YJSAAADD.js} +128 -12
- package/dist/cli-bundle/chunks/config-YJSAAADD.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-E6U3DWVM.js → context-LGYEEKAW.js} +14 -14
- package/dist/cli-bundle/chunks/{context-E6U3DWVM.js.map → context-LGYEEKAW.js.map} +2 -2
- package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js → context-ZUH5IOOI.js} +15 -15
- package/dist/cli-bundle/chunks/context-ZUH5IOOI.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-CXSFM45B.js → contracts-YXJ6NXKH.js} +11 -5
- package/dist/cli-bundle/chunks/contracts-YXJ6NXKH.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js → contracts-ZIBXROPE.js} +12 -6
- package/dist/cli-bundle/chunks/contracts-ZIBXROPE.js.map +1 -0
- package/dist/cli-bundle/chunks/copy-BZALX5MQ.js +182 -0
- package/dist/cli-bundle/chunks/copy-BZALX5MQ.js.map +1 -0
- package/dist/cli-bundle/chunks/copy-YPWEIAPD.js +185 -0
- package/dist/cli-bundle/chunks/copy-YPWEIAPD.js.map +7 -0
- package/dist/cli-bundle/chunks/create-4DS2QWQC.js +27 -0
- package/dist/cli-bundle/chunks/{create-WYFKN2U4.js → create-CF7EVRX7.js} +13 -13
- package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js → delete-KR4VBWVE.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-RONNH4F4.js → delete-XLZRTRKR.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-WII3O4HB.js → deps-2YTXD3VM.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js → deps-GZMFMTGS.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-PDREIMLS.js → docs-SLROFEQ4.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js → docs-ZHISRR2D.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js → extension-3C7OOI4F.js} +8 -6
- package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js → extension-XYCUXICD.js} +8 -6
- package/dist/cli-bundle/chunks/{files-2PN7UM2D.js → files-FUWF2FYJ.js} +9 -9
- package/dist/cli-bundle/chunks/{files-MXYS5W4M.js → files-J4I5IU4O.js} +9 -9
- package/dist/cli-bundle/chunks/gc-34NXSNSN.js +362 -0
- package/dist/cli-bundle/chunks/gc-34NXSNSN.js.map +1 -0
- package/dist/cli-bundle/chunks/gc-SPIIZX3A.js +372 -0
- package/dist/cli-bundle/chunks/gc-SPIIZX3A.js.map +7 -0
- package/dist/cli-bundle/chunks/{get-WXMLRG7M.js → get-SZKNRHMA.js} +34 -12
- package/dist/cli-bundle/chunks/get-SZKNRHMA.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-CINFEUIY.js → get-VITKYP6S.js} +33 -11
- package/dist/cli-bundle/chunks/get-VITKYP6S.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-IT5DBPRJ.js → health-4SNTA2TF.js} +27 -13
- package/dist/cli-bundle/chunks/health-4SNTA2TF.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-5VPOJQ53.js → health-7G3EPM57.js} +28 -14
- package/dist/cli-bundle/chunks/health-7G3EPM57.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-FLZIP7PM.js → history-SDAWYZR3.js} +10 -10
- package/dist/cli-bundle/chunks/history-YDUEILKP.js +20 -0
- package/dist/cli-bundle/chunks/history-compact-DMW536VH.js +287 -0
- package/dist/cli-bundle/chunks/history-compact-DMW536VH.js.map +1 -0
- package/dist/cli-bundle/chunks/history-compact-POTZGG7K.js +290 -0
- package/dist/cli-bundle/chunks/history-compact-POTZGG7K.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js → history-redact-EPJ7GENL.js} +11 -11
- package/dist/cli-bundle/chunks/history-redact-KASLLPE7.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js → history-repair-IJ7LLBET.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js → history-repair-YNESJRT6.js} +11 -11
- package/dist/cli-bundle/chunks/init-IGSS4GNH.js +17 -0
- package/dist/cli-bundle/chunks/{init-6MRFVOLH.js → init-YHVBTEET.js} +9 -8
- package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js → learnings-4YBMIVCZ.js} +10 -10
- package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js → learnings-T4PF24YN.js} +10 -10
- package/dist/cli-bundle/chunks/{list-DBRECOG4.js → list-3KEVBOYW.js} +10 -10
- package/dist/cli-bundle/chunks/list-E44O2K64.js +20 -0
- package/dist/cli-bundle/chunks/{notes-42LIC3UE.js → notes-FLUCNJSH.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js → notes-GJKALVZM.js} +10 -10
- package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js → plan-T5MMZLI3.js} +13 -13
- package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js → plan-YYMIL3HV.js} +13 -13
- package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js → register-list-query-I65EZ3HB.js} +33 -27
- package/dist/cli-bundle/chunks/register-list-query-I65EZ3HB.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js → register-list-query-OECMHO4G.js} +32 -26
- package/dist/cli-bundle/chunks/register-list-query-OECMHO4G.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js → register-mutation-2FLXORLR.js} +65 -47
- package/dist/cli-bundle/chunks/register-mutation-2FLXORLR.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js → register-mutation-5GPDEKHR.js} +64 -46
- package/dist/cli-bundle/chunks/register-mutation-5GPDEKHR.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-KYUOOOOD.js → register-operations-BNGAUMGK.js} +71 -35
- package/dist/cli-bundle/chunks/register-operations-BNGAUMGK.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js → register-operations-GQKT35H5.js} +70 -34
- package/dist/cli-bundle/chunks/register-operations-GQKT35H5.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js → register-setup-DNDCGZ4O.js} +18 -18
- package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js.map → register-setup-DNDCGZ4O.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js → register-setup-EJY44FPH.js} +17 -17
- package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js.map → register-setup-EJY44FPH.js.map} +2 -2
- package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js → restore-DDJGVZIN.js} +11 -11
- package/dist/cli-bundle/chunks/restore-SJSASGZP.js +17 -0
- package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js → schema-B7NQ6XVP.js} +8 -8
- package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js → schema-HEGYH6CE.js} +8 -8
- package/dist/cli-bundle/chunks/{search-C7NPB7G7.js → search-DVVQ4UO2.js} +421 -42
- package/dist/cli-bundle/chunks/search-DVVQ4UO2.js.map +1 -0
- package/dist/cli-bundle/chunks/{search-5A3BMFA7.js → search-JNEZJV7H.js} +427 -41
- package/dist/cli-bundle/chunks/search-JNEZJV7H.js.map +7 -0
- package/dist/cli-bundle/chunks/stats-7JDIJRDH.js +202 -0
- package/dist/cli-bundle/chunks/stats-7JDIJRDH.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-SYTJRR4Z.js +212 -0
- package/dist/cli-bundle/chunks/stats-SYTJRR4Z.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-4HHWD5Y7.js +251 -0
- package/dist/cli-bundle/chunks/telemetry-4HHWD5Y7.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-EGWP7ZUX.js +248 -0
- package/dist/cli-bundle/chunks/telemetry-EGWP7ZUX.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-OFYONO3C.js → test-IIELLSZX.js} +14 -13
- package/dist/cli-bundle/chunks/test-ML5RLWXE.js +32 -0
- package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js → test-all-7DNCMML7.js} +14 -13
- package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js.map → test-all-7DNCMML7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js → test-all-IHTUJRRC.js} +16 -15
- package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js.map → test-all-IHTUJRRC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js → test-runs-5FEMBV3A.js} +5 -5
- package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js → test-runs-RNKZ37PS.js} +5 -5
- package/dist/cli-bundle/chunks/update-6C67X4KS.js +21 -0
- package/dist/cli-bundle/chunks/update-VF26YPT3.js +25 -0
- package/dist/cli-bundle/chunks/{update-many-322CCH2L.js → update-many-BSZZZYXY.js} +22 -22
- package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js → update-many-BWKJJEBF.js} +22 -22
- package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js → upgrade-RSE5PC44.js} +7 -6
- package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js.map → upgrade-RSE5PC44.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js → upgrade-YWI5DJFA.js} +5 -4
- package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js.map → upgrade-YWI5DJFA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js → validate-NK3WKB7C.js} +18 -17
- package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js.map → validate-NK3WKB7C.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js → validate-UCEOB7S6.js} +20 -19
- package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js.map → validate-UCEOB7S6.js.map} +1 -1
- package/dist/cli-bundle/main.js +198 -1523
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/config/nested-settings.d.ts +8 -6
- package/dist/core/config/nested-settings.js +71 -5
- 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/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/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/history/history-diff.d.ts +47 -0
- package/dist/core/history/history-diff.js +152 -0
- package/dist/core/history/history-diff.js.map +1 -0
- package/dist/core/history/history-storage-stats.d.ts +31 -0
- package/dist/core/history/history-storage-stats.js +101 -0
- package/dist/core/history/history-storage-stats.js.map +1 -0
- 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/lock/lock-gc.d.ts +46 -0
- package/dist/core/lock/lock-gc.js +194 -0
- package/dist/core/lock/lock-gc.js.map +1 -0
- 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 +23 -10
- package/dist/core/search/vector-stores.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/serial-queue.d.ts +12 -0
- package/dist/core/shared/serial-queue.js +43 -0
- package/dist/core/shared/serial-queue.js.map +1 -0
- package/dist/core/shared/time.js +42 -6
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/paths.js +25 -7
- 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.d.ts +19 -1
- package/dist/core/store/settings.js +199 -17
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/observability.js +3 -3
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.js +99 -6
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +187 -42
- 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 +13 -2
- 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 +8 -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 +39 -7
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +26 -1
- package/dist/sdk/cli-contracts.js +75 -11
- 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 +1 -1
- package/docs/ARCHITECTURE.md +11 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +4 -4
- package/docs/CODEX_PLUGIN.md +1 -1
- package/docs/COMMANDS.md +42 -4
- package/docs/CONFIGURATION.md +31 -2
- package/docs/EXTENSIONS.md +28 -8
- package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
- package/docs/ONBOARDING.md +165 -0
- package/docs/QUICKSTART.md +2 -2
- package/docs/README.md +12 -4
- package/docs/RELEASING.md +36 -1
- package/docs/SDK.md +66 -0
- package/docs/TESTING.md +33 -1
- package/package.json +6 -2
- 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 +11 -8
- package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-codex/README.md +1 -1
- package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +0 -1
- package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KA24HME7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RANZIID5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +0 -7
- package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +0 -13
- package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +0 -1
- package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +0 -7
- package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +0 -7
- package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +0 -1
- package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +0 -1
- package/dist/cli-bundle/chunks/create-ATONSAZW.js +0 -27
- package/dist/cli-bundle/chunks/gc-GT552UJH.js +0 -178
- package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +0 -1
- package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +0 -181
- package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +0 -7
- package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +0 -7
- package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +0 -1
- package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +0 -1
- package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-6FC4H6HI.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +0 -19
- package/dist/cli-bundle/chunks/init-KHX3FEEM.js +0 -16
- package/dist/cli-bundle/chunks/list-53LZ2AEO.js +0 -20
- package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +0 -17
- package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +0 -7
- package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +0 -120
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +0 -123
- package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +0 -7
- package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +0 -31
- package/dist/cli-bundle/chunks/update-6YEHPVXH.js +0 -25
- package/dist/cli-bundle/chunks/update-PYLVHMRD.js +0 -21
- /package/dist/cli-bundle/chunks/{activity-P5BUMWP3.js.map → activity-5UROHJ3D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js.map → activity-YVB3QRTE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js.map → append-2PPYFAG5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-5JE3YGXU.js.map → append-AUGT5W6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js.map → chunk-2IF7WLB7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js.map → chunk-2OJHLWBZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js.map → chunk-3A2CMEM7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js.map → chunk-3EOBJOF4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js.map → chunk-5AXMRKN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js.map → chunk-6J4K6JLA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js.map → chunk-AVJD6VTA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js.map → chunk-B5RF3IP7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js.map → chunk-C5W2UH56.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js.map → chunk-CKLBZHS7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js.map → chunk-FY6Z3FYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js.map → chunk-GNIUOLZ2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js.map → chunk-GPXQBR3H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js.map → chunk-H7EO3QA3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js.map → chunk-HLC3KTLP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js.map → chunk-HMMMWBK2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js.map → chunk-HV5SSZXF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js.map → chunk-KNGVP5WJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js.map → chunk-LI65XLJR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js.map → chunk-LIN2BPJ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js.map → chunk-LQHBENVW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js.map → chunk-LXO6V66E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js.map → chunk-MOYM2C3J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js.map → chunk-NQL32HQ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js.map → chunk-OKSKJKHX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js.map → chunk-R3V3YCMH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js.map → chunk-RVPTZKBC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js.map → chunk-SFFVGNHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js.map → chunk-SQPKRA54.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js.map → chunk-TNPBPNII.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js.map → chunk-TP4DDY27.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js.map → chunk-TYJJOTUA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js.map → chunk-UAQOQ7IE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js.map → chunk-UEWA73ZZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js.map → chunk-UIIQC5YO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js.map → chunk-V6EYFTRL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js.map → chunk-WYEXLDDY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js.map → chunk-X7UHMKPE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js.map → chunk-YBZW2QQ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js.map → chunk-YO3THIJF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js.map → claim-BJ4QMPJC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js.map → claim-KW743OSW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-RMHQ3KWH.js.map → close-P4ZBKODL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-65DFYAVS.js.map → close-SYHSRZDC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js.map → comments-JEO6HHVM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js.map → comments-YT2PQ5DD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-ATONSAZW.js.map → create-4DS2QWQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-WYFKN2U4.js.map → create-CF7EVRX7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js.map → delete-KR4VBWVE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-RONNH4F4.js.map → delete-XLZRTRKR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-WII3O4HB.js.map → deps-2YTXD3VM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js.map → deps-GZMFMTGS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-PDREIMLS.js.map → docs-SLROFEQ4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js.map → docs-ZHISRR2D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js.map → extension-3C7OOI4F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js.map → extension-XYCUXICD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-2PN7UM2D.js.map → files-FUWF2FYJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-MXYS5W4M.js.map → files-J4I5IU4O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-FLZIP7PM.js.map → history-SDAWYZR3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-6FC4H6HI.js.map → history-YDUEILKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js.map → history-redact-EPJ7GENL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-XKYEZDBL.js.map → history-redact-KASLLPE7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js.map → history-repair-IJ7LLBET.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js.map → history-repair-YNESJRT6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-KHX3FEEM.js.map → init-IGSS4GNH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-6MRFVOLH.js.map → init-YHVBTEET.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js.map → learnings-4YBMIVCZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js.map → learnings-T4PF24YN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-DBRECOG4.js.map → list-3KEVBOYW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-53LZ2AEO.js.map → list-E44O2K64.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-42LIC3UE.js.map → notes-FLUCNJSH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js.map → notes-GJKALVZM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js.map → plan-T5MMZLI3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js.map → plan-YYMIL3HV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js.map → restore-DDJGVZIN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-JL5QIH7H.js.map → restore-SJSASGZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js.map → schema-B7NQ6XVP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js.map → schema-HEGYH6CE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-OFYONO3C.js.map → test-IIELLSZX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js.map → test-ML5RLWXE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js.map → test-runs-5FEMBV3A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js.map → test-runs-RNKZ37PS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-PYLVHMRD.js.map → update-6C67X4KS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-6YEHPVXH.js.map → update-VF26YPT3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-322CCH2L.js.map → update-many-BSZZZYXY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js.map → update-many-BWKJJEBF.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,C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C;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,19 @@
|
|
|
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]="
|
|
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]="aa5558e1-7599-5645-b5e6-02dad2937f2c")}catch(e){}}();
|
|
3
3
|
import { mkdir, readFile, rename, stat, unlink, writeFile } from "node:fs/promises";
|
|
4
4
|
import { basename, 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
7
|
const DEFAULT_COLLECTION = "pm_items";
|
|
8
|
+
const COLLECTION_SANITIZE_PATTERN = /[^a-zA-Z0-9_-]/g;
|
|
9
|
+
const MAX_COLLECTION_NAME_LENGTH = 128;
|
|
8
10
|
const LANCE_DB_LOCAL_SNAPSHOT_DIR = ".pm-cli-local-vectors";
|
|
9
11
|
const LANCE_DB_LOCAL_SNAPSHOT_VERSION = 1;
|
|
10
12
|
const lanceDbLocalTables = new Map();
|
|
13
|
+
function resolveStoreCollectionName(store) {
|
|
14
|
+
const candidate = toNonEmptyString(store.collection_name) ?? DEFAULT_COLLECTION;
|
|
15
|
+
return candidate.replaceAll(COLLECTION_SANITIZE_PATTERN, "_").slice(0, MAX_COLLECTION_NAME_LENGTH);
|
|
16
|
+
}
|
|
11
17
|
function normalizeVector(value) {
|
|
12
18
|
if (!isFiniteNumberArray(value) || value.length === 0) {
|
|
13
19
|
throw new Error("Vector values must be a non-empty numeric array");
|
|
@@ -83,10 +89,12 @@ function resolveQdrantStore(settings) {
|
|
|
83
89
|
if (!url) {
|
|
84
90
|
return null;
|
|
85
91
|
}
|
|
92
|
+
const collectionName = toNonEmptyString(settings.vector_store?.collection_name);
|
|
86
93
|
const apiKey = toNonEmptyString(settings.vector_store?.qdrant?.api_key);
|
|
87
94
|
return {
|
|
88
95
|
name: "qdrant",
|
|
89
96
|
url,
|
|
97
|
+
...(collectionName && collectionName !== DEFAULT_COLLECTION ? { collection_name: collectionName } : {}),
|
|
90
98
|
...(apiKey ? { api_key: apiKey } : {}),
|
|
91
99
|
};
|
|
92
100
|
}
|
|
@@ -95,9 +103,11 @@ function resolveLanceDbStore(settings) {
|
|
|
95
103
|
if (!lancedbPath) {
|
|
96
104
|
return null;
|
|
97
105
|
}
|
|
106
|
+
const collectionName = toNonEmptyString(settings.vector_store?.collection_name);
|
|
98
107
|
return {
|
|
99
108
|
name: "lancedb",
|
|
100
109
|
path: lancedbPath,
|
|
110
|
+
...(collectionName && collectionName !== DEFAULT_COLLECTION ? { collection_name: collectionName } : {}),
|
|
101
111
|
};
|
|
102
112
|
}
|
|
103
113
|
function normalizeVectorRecords(records) {
|
|
@@ -352,19 +362,22 @@ export function resolveVectorStores(settings) {
|
|
|
352
362
|
};
|
|
353
363
|
}
|
|
354
364
|
export function resolveVectorStoreRequestTarget(store) {
|
|
365
|
+
const collectionName = resolveStoreCollectionName(store);
|
|
355
366
|
if (store.name === "qdrant") {
|
|
356
367
|
const baseUrl = trimTrailingSlashes(store.url);
|
|
368
|
+
const encodedCollection = encodeURIComponent(collectionName);
|
|
357
369
|
return {
|
|
358
370
|
store: "qdrant",
|
|
359
|
-
query_target: `${baseUrl}/collections/${
|
|
360
|
-
upsert_target: `${baseUrl}/collections/${
|
|
371
|
+
query_target: `${baseUrl}/collections/${encodedCollection}/points/search`,
|
|
372
|
+
upsert_target: `${baseUrl}/collections/${encodedCollection}/points?wait=true`,
|
|
361
373
|
};
|
|
362
374
|
}
|
|
363
375
|
const encodedPath = encodeURIComponent(store.path);
|
|
376
|
+
const encodedCollection = encodeURIComponent(collectionName);
|
|
364
377
|
return {
|
|
365
378
|
store: "lancedb",
|
|
366
|
-
query_target: `lancedb://${encodedPath}#${
|
|
367
|
-
upsert_target: `lancedb://${encodedPath}#${
|
|
379
|
+
query_target: `lancedb://${encodedPath}#${encodedCollection}`,
|
|
380
|
+
upsert_target: `lancedb://${encodedPath}#${encodedCollection}`,
|
|
368
381
|
};
|
|
369
382
|
}
|
|
370
383
|
export function buildVectorQueryPlan(store, vector, limit) {
|
|
@@ -388,7 +401,7 @@ export function buildVectorQueryPlan(store, vector, limit) {
|
|
|
388
401
|
method: "LOCAL",
|
|
389
402
|
headers: {},
|
|
390
403
|
body: {
|
|
391
|
-
table:
|
|
404
|
+
table: resolveStoreCollectionName(store),
|
|
392
405
|
vector: normalizedVector,
|
|
393
406
|
limit: normalizedLimit,
|
|
394
407
|
},
|
|
@@ -412,7 +425,7 @@ export function buildVectorUpsertPlan(store, records) {
|
|
|
412
425
|
method: "LOCAL",
|
|
413
426
|
headers: {},
|
|
414
427
|
body: {
|
|
415
|
-
table:
|
|
428
|
+
table: resolveStoreCollectionName(store),
|
|
416
429
|
records: normalizedRecords,
|
|
417
430
|
},
|
|
418
431
|
};
|
|
@@ -435,7 +448,7 @@ export function buildVectorDeletePlan(store, ids) {
|
|
|
435
448
|
method: "LOCAL",
|
|
436
449
|
headers: {},
|
|
437
450
|
body: {
|
|
438
|
-
table:
|
|
451
|
+
table: resolveStoreCollectionName(store),
|
|
439
452
|
ids: normalizedIds,
|
|
440
453
|
},
|
|
441
454
|
};
|
|
@@ -552,7 +565,7 @@ export async function executeVectorDelete(store, ids, options = {}) {
|
|
|
552
565
|
}
|
|
553
566
|
export async function executeVectorReset(store, knownIds = [], options = {}, vectorDimension) {
|
|
554
567
|
if (store.name === "lancedb") {
|
|
555
|
-
await resetLanceDbLocalTable(store.path,
|
|
568
|
+
await resetLanceDbLocalTable(store.path, resolveStoreCollectionName(store));
|
|
556
569
|
return { status: "ok" };
|
|
557
570
|
}
|
|
558
571
|
if (vectorDimension !== undefined) {
|
|
@@ -595,4 +608,4 @@ export async function executeVectorReset(store, knownIds = [], options = {}, vec
|
|
|
595
608
|
return await executeVectorDelete(store, idsToDelete, options);
|
|
596
609
|
}
|
|
597
610
|
//# sourceMappingURL=vector-stores.js.map
|
|
598
|
-
//# debugId=
|
|
611
|
+
//# debugId=aa5558e1-7599-5645-b5e6-02dad2937f2c
|