@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.
Files changed (600) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/AGENTS.md +1 -1
  3. package/CHANGELOG.md +79 -0
  4. package/CONTRIBUTING.md +1 -1
  5. package/README.md +6 -2
  6. package/dist/cli/bootstrap-args.js +30 -13
  7. package/dist/cli/bootstrap-args.js.map +1 -1
  8. package/dist/cli/commander-usage.js +74 -4
  9. package/dist/cli/commander-usage.js.map +1 -1
  10. package/dist/cli/commands/aggregate.d.ts +8 -0
  11. package/dist/cli/commands/aggregate.js +84 -7
  12. package/dist/cli/commands/aggregate.js.map +1 -1
  13. package/dist/cli/commands/calendar.js +10 -3
  14. package/dist/cli/commands/calendar.js.map +1 -1
  15. package/dist/cli/commands/close-many.js +20 -11
  16. package/dist/cli/commands/close-many.js.map +1 -1
  17. package/dist/cli/commands/close.d.ts +1 -1
  18. package/dist/cli/commands/close.js +32 -10
  19. package/dist/cli/commands/close.js.map +1 -1
  20. package/dist/cli/commands/comments-audit.js +4 -3
  21. package/dist/cli/commands/comments-audit.js.map +1 -1
  22. package/dist/cli/commands/completion.js +105 -43
  23. package/dist/cli/commands/completion.js.map +1 -1
  24. package/dist/cli/commands/config.d.ts +5 -4
  25. package/dist/cli/commands/config.js +50 -2
  26. package/dist/cli/commands/config.js.map +1 -1
  27. package/dist/cli/commands/contracts.js +4 -3
  28. package/dist/cli/commands/contracts.js.map +1 -1
  29. package/dist/cli/commands/copy.d.ts +14 -0
  30. package/dist/cli/commands/copy.js +153 -0
  31. package/dist/cli/commands/copy.js.map +1 -0
  32. package/dist/cli/commands/extension/doctor.js +62 -2
  33. package/dist/cli/commands/extension/doctor.js.map +1 -1
  34. package/dist/cli/commands/extension/install-sources.d.ts +8 -0
  35. package/dist/cli/commands/extension/install-sources.js +82 -2
  36. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  37. package/dist/cli/commands/extension/scaffold.js +6 -14
  38. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  39. package/dist/cli/commands/extension.d.ts +29 -0
  40. package/dist/cli/commands/extension.js +61 -2
  41. package/dist/cli/commands/extension.js.map +1 -1
  42. package/dist/cli/commands/gc.js +10 -2
  43. package/dist/cli/commands/gc.js.map +1 -1
  44. package/dist/cli/commands/get.d.ts +9 -0
  45. package/dist/cli/commands/get.js +23 -2
  46. package/dist/cli/commands/get.js.map +1 -1
  47. package/dist/cli/commands/health.js +10 -2
  48. package/dist/cli/commands/health.js.map +1 -1
  49. package/dist/cli/commands/history-compact.d.ts +39 -0
  50. package/dist/cli/commands/history-compact.js +262 -0
  51. package/dist/cli/commands/history-compact.js.map +1 -0
  52. package/dist/cli/commands/index.d.ts +3 -1
  53. package/dist/cli/commands/index.js +5 -3
  54. package/dist/cli/commands/index.js.map +1 -1
  55. package/dist/cli/commands/init.d.ts +1 -0
  56. package/dist/cli/commands/init.js +48 -2
  57. package/dist/cli/commands/init.js.map +1 -1
  58. package/dist/cli/commands/list.d.ts +13 -2
  59. package/dist/cli/commands/list.js +189 -9
  60. package/dist/cli/commands/list.js.map +1 -1
  61. package/dist/cli/commands/normalize.js +6 -4
  62. package/dist/cli/commands/normalize.js.map +1 -1
  63. package/dist/cli/commands/reindex.js +8 -4
  64. package/dist/cli/commands/reindex.js.map +1 -1
  65. package/dist/cli/commands/schema.d.ts +13 -2
  66. package/dist/cli/commands/schema.js +66 -12
  67. package/dist/cli/commands/schema.js.map +1 -1
  68. package/dist/cli/commands/search.d.ts +11 -2
  69. package/dist/cli/commands/search.js +321 -35
  70. package/dist/cli/commands/search.js.map +1 -1
  71. package/dist/cli/commands/upgrade.js +4 -12
  72. package/dist/cli/commands/upgrade.js.map +1 -1
  73. package/dist/cli/error-guidance.js +26 -2
  74. package/dist/cli/error-guidance.js.map +1 -1
  75. package/dist/cli/extension-command-help.d.ts +1 -0
  76. package/dist/cli/extension-command-help.js +3 -2
  77. package/dist/cli/extension-command-help.js.map +1 -1
  78. package/dist/cli/help-content.js +10 -2
  79. package/dist/cli/help-content.js.map +1 -1
  80. package/dist/cli/main.d.ts +3 -0
  81. package/dist/cli/main.js +18 -37
  82. package/dist/cli/main.js.map +1 -1
  83. package/dist/cli/register-list-query.js +22 -5
  84. package/dist/cli/register-list-query.js.map +1 -1
  85. package/dist/cli/register-mutation.js +83 -39
  86. package/dist/cli/register-mutation.js.map +1 -1
  87. package/dist/cli/register-operations.js +31 -7
  88. package/dist/cli/register-operations.js.map +1 -1
  89. package/dist/cli/register-setup.js +7 -5
  90. package/dist/cli/register-setup.js.map +1 -1
  91. package/dist/cli/registration-helpers.js +26 -4
  92. package/dist/cli/registration-helpers.js.map +1 -1
  93. package/dist/cli-bundle/chunks/activity-A3QKFSSF.js +16 -0
  94. package/dist/cli-bundle/chunks/{activity-JM6DTDND.js → activity-Q7XMIZIH.js} +11 -11
  95. package/dist/cli-bundle/chunks/{aggregate-VNAHUNNF.js → aggregate-GBSHSXOB.js} +87 -17
  96. package/dist/cli-bundle/chunks/aggregate-GBSHSXOB.js.map +7 -0
  97. package/dist/cli-bundle/chunks/{aggregate-GI7WSZPH.js → aggregate-HKQJZUBG.js} +88 -18
  98. package/dist/cli-bundle/chunks/aggregate-HKQJZUBG.js.map +1 -0
  99. package/dist/cli-bundle/chunks/{append-WMKRXKCE.js → append-3RFOU7P5.js} +8 -8
  100. package/dist/cli-bundle/chunks/{append-7H5N64R2.js → append-OM74OJVT.js} +8 -8
  101. package/dist/cli-bundle/chunks/{chunk-KJE2FOS4.js → chunk-2BYKYPWY.js} +26 -4
  102. package/dist/cli-bundle/chunks/chunk-2BYKYPWY.js.map +7 -0
  103. package/dist/cli-bundle/chunks/{chunk-XTGLRY2Y.js → chunk-2HMD3JM2.js} +6 -6
  104. package/dist/cli-bundle/chunks/{chunk-PRJCELV4.js → chunk-2YPVCD7T.js} +8 -8
  105. package/dist/cli-bundle/chunks/{chunk-3FI4SEFT.js → chunk-3E3MDBTB.js} +62 -38
  106. package/dist/cli-bundle/chunks/chunk-3E3MDBTB.js.map +7 -0
  107. package/dist/cli-bundle/chunks/{chunk-U5SXYXSY.js → chunk-3TXWDGPU.js} +287 -45
  108. package/dist/cli-bundle/chunks/chunk-3TXWDGPU.js.map +7 -0
  109. package/dist/cli-bundle/chunks/{chunk-HZGUAH22.js → chunk-4TI3532H.js} +6 -7
  110. package/dist/cli-bundle/chunks/chunk-4TI3532H.js.map +1 -0
  111. package/dist/cli-bundle/chunks/{chunk-2HVRUSQA.js → chunk-4WYBLB6J.js} +3 -3
  112. package/dist/cli-bundle/chunks/{chunk-R6UFP2GE.js → chunk-5NVJA7IW.js} +7 -7
  113. package/dist/cli-bundle/chunks/{chunk-Q7SPNHLW.js → chunk-5WO2VKFA.js} +190 -16
  114. package/dist/cli-bundle/chunks/chunk-5WO2VKFA.js.map +7 -0
  115. package/dist/cli-bundle/chunks/{chunk-IOR7LGF4.js → chunk-7NQIY7Z6.js} +89 -7
  116. package/dist/cli-bundle/chunks/chunk-7NQIY7Z6.js.map +1 -0
  117. package/dist/cli-bundle/chunks/{chunk-ECCMVXGM.js → chunk-7WXGR44E.js} +305 -216
  118. package/dist/cli-bundle/chunks/chunk-7WXGR44E.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-XSJCLN2R.js → chunk-AEMKH5WQ.js} +3 -3
  120. package/dist/cli-bundle/chunks/{chunk-WOPXVEZP.js → chunk-ALSRBNYB.js} +28 -9
  121. package/dist/cli-bundle/chunks/chunk-ALSRBNYB.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-6ER6DXH5.js → chunk-AXBUHLW7.js} +9 -9
  123. package/dist/cli-bundle/chunks/{chunk-BQHUILZS.js → chunk-BFJPMUF5.js} +5 -5
  124. package/dist/cli-bundle/chunks/{chunk-I6BNFU5X.js → chunk-BKQMJXWY.js} +3 -3
  125. package/dist/cli-bundle/chunks/{chunk-XLTD2HN3.js → chunk-CBJXWXI5.js} +2 -2
  126. package/dist/cli-bundle/chunks/{chunk-FRAUKRU2.js → chunk-D7WK2PKB.js} +36 -15
  127. package/dist/cli-bundle/chunks/chunk-D7WK2PKB.js.map +1 -0
  128. package/dist/cli-bundle/chunks/{chunk-PROOHX4K.js → chunk-DV27WDA7.js} +104 -21
  129. package/dist/cli-bundle/chunks/chunk-DV27WDA7.js.map +7 -0
  130. package/dist/cli-bundle/chunks/{chunk-3BWOVLTH.js → chunk-EPWT7BEA.js} +8 -8
  131. package/dist/cli-bundle/chunks/chunk-ETZZU5QF.js +112 -0
  132. package/dist/cli-bundle/chunks/chunk-ETZZU5QF.js.map +1 -0
  133. package/dist/cli-bundle/chunks/{chunk-TPH5XEVD.js → chunk-F33AQIB4.js} +303 -207
  134. package/dist/cli-bundle/chunks/chunk-F33AQIB4.js.map +1 -0
  135. package/dist/cli-bundle/chunks/{chunk-NUZ5HKR4.js → chunk-F33VC5EX.js} +2 -2
  136. package/dist/cli-bundle/chunks/{chunk-WKY2IBOQ.js → chunk-FGRJZVXD.js} +3 -3
  137. package/dist/cli-bundle/chunks/{chunk-77GFDHGF.js → chunk-FO2TYSQZ.js} +2 -2
  138. package/dist/cli-bundle/chunks/{chunk-GXSUPCBV.js → chunk-HOA3GMB6.js} +4 -4
  139. package/dist/cli-bundle/chunks/{chunk-OVQCEJPG.js → chunk-HP35AVFS.js} +2 -2
  140. package/dist/cli-bundle/chunks/{chunk-KJ33AOCY.js → chunk-J4DKAGTM.js} +3 -3
  141. package/dist/cli-bundle/chunks/{chunk-ME2YH6FN.js → chunk-JS47EKLP.js} +7 -7
  142. package/dist/cli-bundle/chunks/{chunk-T3LC5LKB.js → chunk-K62SNVVE.js} +5 -6
  143. package/dist/cli-bundle/chunks/chunk-K62SNVVE.js.map +7 -0
  144. package/dist/cli-bundle/chunks/{chunk-GU2ZJ2VV.js → chunk-KBKJVXUS.js} +35 -14
  145. package/dist/cli-bundle/chunks/chunk-KBKJVXUS.js.map +7 -0
  146. package/dist/cli-bundle/chunks/{chunk-KWU6HG75.js → chunk-KCGMABHM.js} +101 -18
  147. package/dist/cli-bundle/chunks/chunk-KCGMABHM.js.map +1 -0
  148. package/dist/cli-bundle/chunks/{chunk-I2HSTRJF.js → chunk-KN4WSESY.js} +5 -5
  149. package/dist/cli-bundle/chunks/{chunk-RZN6VURO.js → chunk-KP4KIUQT.js} +3 -3
  150. package/dist/cli-bundle/chunks/{chunk-5FDATVEZ.js → chunk-KS2U7BZ3.js} +71 -17
  151. package/dist/cli-bundle/chunks/chunk-KS2U7BZ3.js.map +1 -0
  152. package/dist/cli-bundle/chunks/{chunk-MITFDD35.js → chunk-KVXIQDJG.js} +12 -12
  153. package/dist/cli-bundle/chunks/{chunk-IJGCZSIQ.js → chunk-L3LYL3ID.js} +12 -12
  154. package/dist/cli-bundle/chunks/{chunk-AO442XLN.js → chunk-M7UBTVFT.js} +10 -6
  155. package/dist/cli-bundle/chunks/{chunk-AO442XLN.js.map → chunk-M7UBTVFT.js.map} +2 -2
  156. package/dist/cli-bundle/chunks/{chunk-UM2GBHS4.js → chunk-MSH23UWO.js} +4 -4
  157. package/dist/cli-bundle/chunks/{chunk-LCM63IXU.js → chunk-N4SQZ7L3.js} +2 -2
  158. package/dist/cli-bundle/chunks/{chunk-3VAM3NNM.js → chunk-NDSMKB2I.js} +3 -3
  159. package/dist/cli-bundle/chunks/{chunk-6P6GGMOG.js → chunk-NGEEXR2R.js} +2 -2
  160. package/dist/cli-bundle/chunks/{chunk-PO3GSVFV.js → chunk-NLVCMVC7.js} +2 -2
  161. package/dist/cli-bundle/chunks/{chunk-N7ACFE26.js → chunk-NUKHZZNM.js} +3 -3
  162. package/dist/cli-bundle/chunks/{chunk-GGYWB3Y2.js → chunk-ODN53S6H.js} +6 -6
  163. package/dist/cli-bundle/chunks/{chunk-23YFZ3IG.js → chunk-OTY2YEH5.js} +14 -14
  164. package/dist/cli-bundle/chunks/{chunk-2RSPZI5H.js → chunk-OVSSE2JP.js} +8 -8
  165. package/dist/cli-bundle/chunks/{chunk-4LL6TK5B.js → chunk-PQDH3S54.js} +59 -35
  166. package/dist/cli-bundle/chunks/chunk-PQDH3S54.js.map +1 -0
  167. package/dist/cli-bundle/chunks/{chunk-2VVCGBNV.js → chunk-QF4OPBAG.js} +9 -9
  168. package/dist/cli-bundle/chunks/{chunk-QO7EBBOM.js → chunk-QFVASU44.js} +38 -7
  169. package/dist/cli-bundle/chunks/chunk-QFVASU44.js.map +7 -0
  170. package/dist/cli-bundle/chunks/{chunk-WSMOSYRD.js → chunk-QQPZYP73.js} +14 -14
  171. package/dist/cli-bundle/chunks/{chunk-OZ7NSQHL.js → chunk-QWNUDGFQ.js} +8 -8
  172. package/dist/cli-bundle/chunks/{chunk-AY43SBIN.js → chunk-R4XIE7NQ.js} +54 -8
  173. package/dist/cli-bundle/chunks/chunk-R4XIE7NQ.js.map +1 -0
  174. package/dist/cli-bundle/chunks/{chunk-52MAOQ6J.js → chunk-RISLL7XH.js} +71 -17
  175. package/dist/cli-bundle/chunks/chunk-RISLL7XH.js.map +7 -0
  176. package/dist/cli-bundle/chunks/{chunk-GCOQW437.js → chunk-SDLEYY6A.js} +3 -3
  177. package/dist/cli-bundle/chunks/{chunk-W7XABV4H.js → chunk-SM3RMWGO.js} +191 -17
  178. package/dist/cli-bundle/chunks/chunk-SM3RMWGO.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{chunk-PIU6RSL3.js → chunk-TBLBEOEX.js} +9 -9
  180. package/dist/cli-bundle/chunks/{chunk-SKJWX3QB.js → chunk-TXKENAQP.js} +88 -6
  181. package/dist/cli-bundle/chunks/chunk-TXKENAQP.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{chunk-YL2DJGYS.js → chunk-UEXNNF3K.js} +7 -7
  183. package/dist/cli-bundle/chunks/{chunk-UBOPJT3S.js → chunk-UMMJAJB2.js} +9 -9
  184. package/dist/cli-bundle/chunks/chunk-URJEZOLB.js +115 -0
  185. package/dist/cli-bundle/chunks/chunk-URJEZOLB.js.map +7 -0
  186. package/dist/cli-bundle/chunks/{chunk-PDDFYW4X.js → chunk-VXBUXLVD.js} +27 -8
  187. package/dist/cli-bundle/chunks/chunk-VXBUXLVD.js.map +7 -0
  188. package/dist/cli-bundle/chunks/{chunk-LB3RUL2N.js → chunk-XEKZCBCS.js} +10 -6
  189. package/dist/cli-bundle/chunks/chunk-XEKZCBCS.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{chunk-KAG77BY3.js → chunk-XLSQ3QLT.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-E5FJNAZA.js → chunk-XNGMIVQY.js} +3 -3
  192. package/dist/cli-bundle/chunks/{chunk-TCD3R2PF.js → chunk-XZS4MV37.js} +39 -8
  193. package/dist/cli-bundle/chunks/chunk-XZS4MV37.js.map +1 -0
  194. package/dist/cli-bundle/chunks/{chunk-RWPSOIEE.js → chunk-YEFOCDIK.js} +7 -7
  195. package/dist/cli-bundle/chunks/{chunk-5SFCOO6B.js → chunk-YJAKN2N2.js} +277 -35
  196. package/dist/cli-bundle/chunks/chunk-YJAKN2N2.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{chunk-2VBQ6ZXS.js → chunk-Z2HXAFFH.js} +27 -5
  198. package/dist/cli-bundle/chunks/chunk-Z2HXAFFH.js.map +1 -0
  199. package/dist/cli-bundle/chunks/{chunk-3LB74A67.js → chunk-Z55JACL2.js} +53 -7
  200. package/dist/cli-bundle/chunks/chunk-Z55JACL2.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{claim-4DBF6RVG.js → claim-NHBIIBOW.js} +10 -10
  202. package/dist/cli-bundle/chunks/{claim-X2P4IB7J.js → claim-RNEBQCOO.js} +10 -10
  203. package/dist/cli-bundle/chunks/close-UNTFXVM3.js +13 -0
  204. package/dist/cli-bundle/chunks/{close-PTYFA45H.js → close-ZMXL2WDS.js} +8 -8
  205. package/dist/cli-bundle/chunks/{close-many-ERFO6LHR.js → close-many-CDPQGQUB.js} +37 -28
  206. package/dist/cli-bundle/chunks/close-many-CDPQGQUB.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{close-many-7CGIDPTJ.js → close-many-IQV5C2SI.js} +36 -27
  208. package/dist/cli-bundle/chunks/close-many-IQV5C2SI.js.map +7 -0
  209. package/dist/cli-bundle/chunks/{comments-QKBYCWKD.js → comments-EFVBHWPT.js} +10 -10
  210. package/dist/cli-bundle/chunks/{comments-OONGABK5.js → comments-J5Q4IJPH.js} +10 -10
  211. package/dist/cli-bundle/chunks/{config-6FXCQKIF.js → config-72253M2O.js} +127 -12
  212. package/dist/cli-bundle/chunks/config-72253M2O.js.map +1 -0
  213. package/dist/cli-bundle/chunks/{config-U4RZ4CQB.js → config-VFYA6BMI.js} +128 -13
  214. package/dist/cli-bundle/chunks/config-VFYA6BMI.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{context-FYYJGFWS.js → context-AVLO4IFH.js} +14 -14
  216. package/dist/cli-bundle/chunks/{context-FYYJGFWS.js.map → context-AVLO4IFH.js.map} +2 -2
  217. package/dist/cli-bundle/chunks/{context-YMJ3Z2HQ.js → context-WMSI2D65.js} +15 -15
  218. package/dist/cli-bundle/chunks/context-WMSI2D65.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{contracts-RFSPGVVJ.js → contracts-D4BN3VSQ.js} +7 -5
  220. package/dist/cli-bundle/chunks/contracts-D4BN3VSQ.js.map +7 -0
  221. package/dist/cli-bundle/chunks/{contracts-QDB6OMLQ.js → contracts-RGPOBLPL.js} +8 -6
  222. package/dist/cli-bundle/chunks/contracts-RGPOBLPL.js.map +1 -0
  223. package/dist/cli-bundle/chunks/copy-H6TXHK7S.js +185 -0
  224. package/dist/cli-bundle/chunks/copy-H6TXHK7S.js.map +7 -0
  225. package/dist/cli-bundle/chunks/copy-WXE3OOLZ.js +182 -0
  226. package/dist/cli-bundle/chunks/copy-WXE3OOLZ.js.map +1 -0
  227. package/dist/cli-bundle/chunks/create-EZWAMUKR.js +27 -0
  228. package/dist/cli-bundle/chunks/{create-I5L4EYYZ.js → create-PUAIJEZ7.js} +13 -13
  229. package/dist/cli-bundle/chunks/{delete-7HPGI4GZ.js → delete-PKR2JHLH.js} +7 -7
  230. package/dist/cli-bundle/chunks/{delete-VXUPH5RS.js → delete-WBME6WG5.js} +7 -7
  231. package/dist/cli-bundle/chunks/{deps-JSRRWC3Z.js → deps-4BQEDV4L.js} +7 -7
  232. package/dist/cli-bundle/chunks/{deps-SCZIFK2Z.js → deps-KWHQRO75.js} +7 -7
  233. package/dist/cli-bundle/chunks/{docs-GJK6K4VP.js → docs-364GT3ZR.js} +9 -9
  234. package/dist/cli-bundle/chunks/{docs-WW4N3MBM.js → docs-SCNBUGSV.js} +9 -9
  235. package/dist/cli-bundle/chunks/{extension-VDY2U33M.js → extension-CRE7JM47.js} +8 -6
  236. package/dist/cli-bundle/chunks/{extension-J7IBMFTD.js → extension-KK2UPXJD.js} +8 -6
  237. package/dist/cli-bundle/chunks/{files-ISZJGILQ.js → files-3GESQAWL.js} +9 -9
  238. package/dist/cli-bundle/chunks/{files-WKOD326U.js → files-66EHM5ZR.js} +9 -9
  239. package/dist/cli-bundle/chunks/{gc-JDVJ6OQ2.js → gc-D5IWOKQH.js} +13 -5
  240. package/dist/cli-bundle/chunks/gc-D5IWOKQH.js.map +1 -0
  241. package/dist/cli-bundle/chunks/{gc-ULPVWMTN.js → gc-MOQDND5J.js} +12 -4
  242. package/dist/cli-bundle/chunks/gc-MOQDND5J.js.map +7 -0
  243. package/dist/cli-bundle/chunks/{get-RV37HT3G.js → get-7J2ZCBV5.js} +34 -12
  244. package/dist/cli-bundle/chunks/get-7J2ZCBV5.js.map +1 -0
  245. package/dist/cli-bundle/chunks/{get-WXU6WI5P.js → get-WXSLXV3K.js} +33 -11
  246. package/dist/cli-bundle/chunks/get-WXSLXV3K.js.map +7 -0
  247. package/dist/cli-bundle/chunks/{health-LOI2HHKB.js → health-B6AEM7BV.js} +21 -13
  248. package/dist/cli-bundle/chunks/health-B6AEM7BV.js.map +1 -0
  249. package/dist/cli-bundle/chunks/{health-6L6EH4WR.js → health-YMZGOMVX.js} +20 -12
  250. package/dist/cli-bundle/chunks/health-YMZGOMVX.js.map +7 -0
  251. package/dist/cli-bundle/chunks/{history-PKN67D5O.js → history-TJTO5GCR.js} +10 -10
  252. package/dist/cli-bundle/chunks/history-ZERISU2L.js +20 -0
  253. package/dist/cli-bundle/chunks/history-compact-CKNN6UKW.js +290 -0
  254. package/dist/cli-bundle/chunks/history-compact-CKNN6UKW.js.map +7 -0
  255. package/dist/cli-bundle/chunks/history-compact-N2Q7IR3T.js +287 -0
  256. package/dist/cli-bundle/chunks/history-compact-N2Q7IR3T.js.map +1 -0
  257. package/dist/cli-bundle/chunks/history-redact-GODBYT5A.js +19 -0
  258. package/dist/cli-bundle/chunks/{history-redact-V4FOJGS7.js → history-redact-JUXUOH54.js} +11 -11
  259. package/dist/cli-bundle/chunks/{history-repair-HIBCBIKK.js → history-repair-CCCPBNTF.js} +11 -11
  260. package/dist/cli-bundle/chunks/{history-repair-SDMHR7JT.js → history-repair-TDBBSRVK.js} +11 -11
  261. package/dist/cli-bundle/chunks/{init-P56QYWJF.js → init-6ZPKD3YN.js} +9 -8
  262. package/dist/cli-bundle/chunks/init-CBZHXBR3.js +17 -0
  263. package/dist/cli-bundle/chunks/{learnings-MIXSESLK.js → learnings-U7U2FNIO.js} +10 -10
  264. package/dist/cli-bundle/chunks/{learnings-GDFRG5J7.js → learnings-WYNTYQ5T.js} +10 -10
  265. package/dist/cli-bundle/chunks/list-7MTPPZHC.js +20 -0
  266. package/dist/cli-bundle/chunks/{list-FGOWQMSM.js → list-JGP7ODML.js} +10 -10
  267. package/dist/cli-bundle/chunks/{notes-5UK3GEH2.js → notes-P25YVTEG.js} +10 -10
  268. package/dist/cli-bundle/chunks/{notes-4XVSH2AZ.js → notes-QIF6A7XS.js} +10 -10
  269. package/dist/cli-bundle/chunks/{plan-DUMBV3QB.js → plan-RACB5PI6.js} +13 -13
  270. package/dist/cli-bundle/chunks/{plan-SLMODHWX.js → plan-SSBJFWXA.js} +13 -13
  271. package/dist/cli-bundle/chunks/{register-list-query-POCFZ5JW.js → register-list-query-5IXDPUZ6.js} +31 -25
  272. package/dist/cli-bundle/chunks/register-list-query-5IXDPUZ6.js.map +1 -0
  273. package/dist/cli-bundle/chunks/{register-list-query-WST76HSQ.js → register-list-query-GQAEIG4K.js} +30 -24
  274. package/dist/cli-bundle/chunks/register-list-query-GQAEIG4K.js.map +7 -0
  275. package/dist/cli-bundle/chunks/{register-mutation-N5GSUZJV.js → register-mutation-FAS4YG63.js} +72 -50
  276. package/dist/cli-bundle/chunks/register-mutation-FAS4YG63.js.map +1 -0
  277. package/dist/cli-bundle/chunks/{register-mutation-OA675SOU.js → register-mutation-YZCUILGO.js} +71 -49
  278. package/dist/cli-bundle/chunks/register-mutation-YZCUILGO.js.map +7 -0
  279. package/dist/cli-bundle/chunks/{register-operations-N3PMHXH5.js → register-operations-IBYWNJN5.js} +57 -34
  280. package/dist/cli-bundle/chunks/register-operations-IBYWNJN5.js.map +7 -0
  281. package/dist/cli-bundle/chunks/{register-operations-GNHBE5I3.js → register-operations-S2BOLUPF.js} +58 -35
  282. package/dist/cli-bundle/chunks/register-operations-S2BOLUPF.js.map +1 -0
  283. package/dist/cli-bundle/chunks/{register-setup-ZHJI2DI3.js → register-setup-ABA2JPWO.js} +20 -19
  284. package/dist/cli-bundle/chunks/{register-setup-ZHJI2DI3.js.map → register-setup-ABA2JPWO.js.map} +2 -2
  285. package/dist/cli-bundle/chunks/{register-setup-JIMPKJKV.js → register-setup-JRZ4UMWZ.js} +21 -20
  286. package/dist/cli-bundle/chunks/register-setup-JRZ4UMWZ.js.map +1 -0
  287. package/dist/cli-bundle/chunks/restore-3JRX27QW.js +17 -0
  288. package/dist/cli-bundle/chunks/{restore-PBL6T5TW.js → restore-K72ZNPEP.js} +11 -11
  289. package/dist/cli-bundle/chunks/{schema-2NOO6NGB.js → schema-3VKRDBLC.js} +76 -20
  290. package/dist/cli-bundle/chunks/schema-3VKRDBLC.js.map +7 -0
  291. package/dist/cli-bundle/chunks/{schema-EBI4NLUO.js → schema-UL4B2JX5.js} +77 -21
  292. package/dist/cli-bundle/chunks/schema-UL4B2JX5.js.map +1 -0
  293. package/dist/cli-bundle/chunks/{search-OA6JX27A.js → search-632WJ7GO.js} +516 -41
  294. package/dist/cli-bundle/chunks/search-632WJ7GO.js.map +7 -0
  295. package/dist/cli-bundle/chunks/{search-JPUQTVCY.js → search-EQDHSE4G.js} +510 -42
  296. package/dist/cli-bundle/chunks/search-EQDHSE4G.js.map +1 -0
  297. package/dist/cli-bundle/chunks/{stats-XYB6KTFG.js → stats-O4UTMJMC.js} +7 -7
  298. package/dist/cli-bundle/chunks/{stats-CV54BAWY.js → stats-WLJ3XBF5.js} +7 -7
  299. package/dist/cli-bundle/chunks/{telemetry-LMJ7PFUO.js → telemetry-EUVHFSQU.js} +4 -4
  300. package/dist/cli-bundle/chunks/{telemetry-NCMEPJNR.js → telemetry-NRVWX25E.js} +4 -4
  301. package/dist/cli-bundle/chunks/{test-WBROAJIE.js → test-GXUBQNUC.js} +14 -13
  302. package/dist/cli-bundle/chunks/test-XN7RJL5Z.js +32 -0
  303. package/dist/cli-bundle/chunks/{test-all-N6NSRDTV.js → test-all-UTFXC7S2.js} +16 -15
  304. package/dist/cli-bundle/chunks/{test-all-N6NSRDTV.js.map → test-all-UTFXC7S2.js.map} +1 -1
  305. package/dist/cli-bundle/chunks/{test-all-NTOZ7C3M.js → test-all-XM6OKI3L.js} +14 -13
  306. package/dist/cli-bundle/chunks/{test-all-NTOZ7C3M.js.map → test-all-XM6OKI3L.js.map} +1 -1
  307. package/dist/cli-bundle/chunks/{test-runs-V6A7LPWZ.js → test-runs-7FHCPEA3.js} +5 -5
  308. package/dist/cli-bundle/chunks/{test-runs-WMVTQU3Y.js → test-runs-IK6E2HNX.js} +5 -5
  309. package/dist/cli-bundle/chunks/update-LFBSEW3N.js +21 -0
  310. package/dist/cli-bundle/chunks/update-U4B4OMHZ.js +25 -0
  311. package/dist/cli-bundle/chunks/{update-many-KGGEYABR.js → update-many-5KD33MKY.js} +22 -22
  312. package/dist/cli-bundle/chunks/{update-many-EM6OXYGO.js → update-many-N3YTM7K4.js} +22 -22
  313. package/dist/cli-bundle/chunks/{upgrade-BLI7XBAJ.js → upgrade-5SRFLUNW.js} +8 -14
  314. package/dist/cli-bundle/chunks/upgrade-5SRFLUNW.js.map +7 -0
  315. package/dist/cli-bundle/chunks/{upgrade-LXPOQKFV.js → upgrade-FFXGO43H.js} +9 -15
  316. package/dist/cli-bundle/chunks/upgrade-FFXGO43H.js.map +1 -0
  317. package/dist/cli-bundle/chunks/{validate-L5J6A7YO.js → validate-CRWXZILW.js} +20 -19
  318. package/dist/cli-bundle/chunks/{validate-L5J6A7YO.js.map → validate-CRWXZILW.js.map} +1 -1
  319. package/dist/cli-bundle/chunks/{validate-AGOAUOVW.js → validate-T3LPWSZG.js} +18 -17
  320. package/dist/cli-bundle/chunks/{validate-AGOAUOVW.js.map → validate-T3LPWSZG.js.map} +1 -1
  321. package/dist/cli-bundle/main.js +160 -87
  322. package/dist/cli-bundle/main.js.map +3 -3
  323. package/dist/core/config/nested-settings.d.ts +8 -8
  324. package/dist/core/config/nested-settings.js +71 -7
  325. package/dist/core/config/nested-settings.js.map +1 -1
  326. package/dist/core/config/positional-value.js +4 -2
  327. package/dist/core/config/positional-value.js.map +1 -1
  328. package/dist/core/diagnostics/remediation.js +7 -2
  329. package/dist/core/diagnostics/remediation.js.map +1 -1
  330. package/dist/core/extensions/extension-types.d.ts +36 -0
  331. package/dist/core/extensions/extension-types.js +2 -2
  332. package/dist/core/extensions/extension-types.js.map +1 -1
  333. package/dist/core/extensions/loader.js +46 -5
  334. package/dist/core/extensions/loader.js.map +1 -1
  335. package/dist/core/fs/fs-utils.js +29 -4
  336. package/dist/core/fs/fs-utils.js.map +1 -1
  337. package/dist/core/history/drift-scan.d.ts +3 -4
  338. package/dist/core/history/drift-scan.js +71 -18
  339. package/dist/core/history/drift-scan.js.map +1 -1
  340. package/dist/core/item/id.js +4 -5
  341. package/dist/core/item/id.js.map +1 -1
  342. package/dist/core/item/item-format.js +7 -3
  343. package/dist/core/item/item-format.js.map +1 -1
  344. package/dist/core/item/toon-decode.d.ts +7 -0
  345. package/dist/core/item/toon-decode.js +11 -2
  346. package/dist/core/item/toon-decode.js.map +1 -1
  347. package/dist/core/item/type-registry.js +25 -7
  348. package/dist/core/item/type-registry.js.map +1 -1
  349. package/dist/core/packages/root.d.ts +10 -0
  350. package/dist/core/packages/root.js +24 -2
  351. package/dist/core/packages/root.js.map +1 -1
  352. package/dist/core/schema/runtime-schema.js +3 -6
  353. package/dist/core/schema/runtime-schema.js.map +1 -1
  354. package/dist/core/search/background-refresh.d.ts +0 -8
  355. package/dist/core/search/background-refresh.js +2 -9
  356. package/dist/core/search/background-refresh.js.map +1 -1
  357. package/dist/core/search/cache.js +5 -3
  358. package/dist/core/search/cache.js.map +1 -1
  359. package/dist/core/search/corpus.d.ts +6 -0
  360. package/dist/core/search/corpus.js +22 -9
  361. package/dist/core/search/corpus.js.map +1 -1
  362. package/dist/core/search/embedding-batches.js +10 -7
  363. package/dist/core/search/embedding-batches.js.map +1 -1
  364. package/dist/core/search/relevance.d.ts +29 -0
  365. package/dist/core/search/relevance.js +226 -0
  366. package/dist/core/search/relevance.js.map +1 -0
  367. package/dist/core/search/vector-stores.d.ts +3 -0
  368. package/dist/core/search/vector-stores.js +27 -16
  369. package/dist/core/search/vector-stores.js.map +1 -1
  370. package/dist/core/sentry/instrument.js +4 -17
  371. package/dist/core/sentry/instrument.js.map +1 -1
  372. package/dist/core/shared/constants.js +15 -2
  373. package/dist/core/shared/constants.js.map +1 -1
  374. package/dist/core/shared/errors.d.ts +6 -0
  375. package/dist/core/shared/errors.js +2 -2
  376. package/dist/core/shared/errors.js.map +1 -1
  377. package/dist/core/shared/primitives.d.ts +8 -0
  378. package/dist/core/shared/primitives.js +29 -2
  379. package/dist/core/shared/primitives.js.map +1 -1
  380. package/dist/core/shared/time.js +42 -6
  381. package/dist/core/shared/time.js.map +1 -1
  382. package/dist/core/store/paths.js +40 -8
  383. package/dist/core/store/paths.js.map +1 -1
  384. package/dist/core/store/settings-validator.d.ts +11 -0
  385. package/dist/core/store/settings-validator.js +14 -2
  386. package/dist/core/store/settings-validator.js.map +1 -1
  387. package/dist/core/store/settings.js +109 -12
  388. package/dist/core/store/settings.js.map +1 -1
  389. package/dist/core/telemetry/runtime.d.ts +1 -0
  390. package/dist/core/telemetry/runtime.js +86 -5
  391. package/dist/core/telemetry/runtime.js.map +1 -1
  392. package/dist/mcp/server.js +109 -19
  393. package/dist/mcp/server.js.map +1 -1
  394. package/dist/sdk/cli-contracts/commander-types.d.ts +1 -0
  395. package/dist/sdk/cli-contracts/commander-types.js +15 -4
  396. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  397. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  398. package/dist/sdk/cli-contracts/enum-contracts.js +6 -2
  399. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  400. package/dist/sdk/cli-contracts/tool-option-contracts.js +7 -2
  401. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  402. package/dist/sdk/cli-contracts/tool-parameter-tables.js +32 -3
  403. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  404. package/dist/sdk/cli-contracts.d.ts +3 -1
  405. package/dist/sdk/cli-contracts.js +44 -12
  406. package/dist/sdk/cli-contracts.js.map +1 -1
  407. package/dist/sdk/index.d.ts +2 -2
  408. package/dist/sdk/index.js +3 -3
  409. package/dist/sdk/index.js.map +1 -1
  410. package/dist/sdk/testing.d.ts +51 -1
  411. package/dist/sdk/testing.js +93 -2
  412. package/dist/sdk/testing.js.map +1 -1
  413. package/dist/types.d.ts +14 -0
  414. package/dist/types.js +2 -2
  415. package/dist/types.js.map +1 -1
  416. package/docs/AGENT_GUIDE.md +3 -1
  417. package/docs/CLAUDE_CODE_PLUGIN.md +4 -4
  418. package/docs/CODEX_PLUGIN.md +1 -1
  419. package/docs/COMMANDS.md +14 -5
  420. package/docs/CONFIGURATION.md +28 -1
  421. package/docs/EXTENSIONS.md +17 -9
  422. package/docs/QUICKSTART.md +1 -1
  423. package/docs/RELEASING.md +17 -0
  424. package/docs/SDK.md +66 -0
  425. package/docs/TESTING.md +14 -0
  426. package/marketplace.json +1 -1
  427. package/package.json +2 -1
  428. package/packages/pm-governance-audit/README.md +14 -0
  429. package/packages/pm-governance-audit/extensions/governance-audit/index.js +39 -1
  430. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +40 -2
  431. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +1 -1
  432. package/packages/pm-governance-audit/package.json +4 -2
  433. package/packages/pm-lifecycle-hooks/README.md +21 -0
  434. package/packages/pm-search-advanced/README.md +38 -0
  435. package/packages/pm-search-advanced/extensions/search-advanced/index.js +17 -0
  436. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +17 -0
  437. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +216 -1
  438. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +271 -2
  439. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  440. package/plugins/pm-claude/README.md +7 -7
  441. package/plugins/pm-claude/commands/pm-init.md +1 -1
  442. package/plugins/pm-codex/README.md +1 -1
  443. package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +0 -16
  444. package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js.map +0 -1
  445. package/dist/cli-bundle/chunks/aggregate-VNAHUNNF.js.map +0 -7
  446. package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js.map +0 -1
  447. package/dist/cli-bundle/chunks/chunk-3FI4SEFT.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-3LB74A67.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js.map +0 -7
  451. package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-AY43SBIN.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-ECCMVXGM.js.map +0 -7
  455. package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js.map +0 -1
  456. package/dist/cli-bundle/chunks/chunk-GU2ZJ2VV.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-HZGUAH22.js.map +0 -1
  458. package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +0 -1
  459. package/dist/cli-bundle/chunks/chunk-KJE2FOS4.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js.map +0 -1
  462. package/dist/cli-bundle/chunks/chunk-PDDFYW4X.js.map +0 -7
  463. package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +0 -7
  464. package/dist/cli-bundle/chunks/chunk-Q7SPNHLW.js.map +0 -7
  465. package/dist/cli-bundle/chunks/chunk-QO7EBBOM.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-T3LC5LKB.js.map +0 -7
  468. package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js.map +0 -1
  470. package/dist/cli-bundle/chunks/chunk-U5SXYXSY.js.map +0 -7
  471. package/dist/cli-bundle/chunks/chunk-W7XABV4H.js.map +0 -1
  472. package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js.map +0 -1
  473. package/dist/cli-bundle/chunks/close-3HDWDA3L.js +0 -13
  474. package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js.map +0 -7
  475. package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js.map +0 -1
  476. package/dist/cli-bundle/chunks/config-6FXCQKIF.js.map +0 -1
  477. package/dist/cli-bundle/chunks/config-U4RZ4CQB.js.map +0 -7
  478. package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js.map +0 -1
  479. package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +0 -1
  480. package/dist/cli-bundle/chunks/contracts-RFSPGVVJ.js.map +0 -7
  481. package/dist/cli-bundle/chunks/create-JTZNCTQC.js +0 -27
  482. package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +0 -1
  483. package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +0 -7
  484. package/dist/cli-bundle/chunks/get-RV37HT3G.js.map +0 -1
  485. package/dist/cli-bundle/chunks/get-WXU6WI5P.js.map +0 -7
  486. package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +0 -7
  487. package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +0 -1
  488. package/dist/cli-bundle/chunks/history-2BA3T5AE.js +0 -20
  489. package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +0 -19
  490. package/dist/cli-bundle/chunks/init-HIVSNX3O.js +0 -16
  491. package/dist/cli-bundle/chunks/list-MUSQNMTD.js +0 -20
  492. package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js.map +0 -1
  493. package/dist/cli-bundle/chunks/register-list-query-WST76HSQ.js.map +0 -7
  494. package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js.map +0 -1
  495. package/dist/cli-bundle/chunks/register-mutation-OA675SOU.js.map +0 -7
  496. package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +0 -1
  497. package/dist/cli-bundle/chunks/register-operations-N3PMHXH5.js.map +0 -7
  498. package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js.map +0 -1
  499. package/dist/cli-bundle/chunks/restore-D4RGNX33.js +0 -17
  500. package/dist/cli-bundle/chunks/schema-2NOO6NGB.js.map +0 -7
  501. package/dist/cli-bundle/chunks/schema-EBI4NLUO.js.map +0 -1
  502. package/dist/cli-bundle/chunks/search-JPUQTVCY.js.map +0 -1
  503. package/dist/cli-bundle/chunks/search-OA6JX27A.js.map +0 -7
  504. package/dist/cli-bundle/chunks/test-MXX3E5JL.js +0 -31
  505. package/dist/cli-bundle/chunks/update-OSV3NAQB.js +0 -25
  506. package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +0 -21
  507. package/dist/cli-bundle/chunks/upgrade-BLI7XBAJ.js.map +0 -7
  508. package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js.map +0 -1
  509. /package/dist/cli-bundle/chunks/{activity-CVXTCHYY.js.map → activity-A3QKFSSF.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{activity-JM6DTDND.js.map → activity-Q7XMIZIH.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{append-WMKRXKCE.js.map → append-3RFOU7P5.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{append-7H5N64R2.js.map → append-OM74OJVT.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{chunk-XTGLRY2Y.js.map → chunk-2HMD3JM2.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{chunk-PRJCELV4.js.map → chunk-2YPVCD7T.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{chunk-2HVRUSQA.js.map → chunk-4WYBLB6J.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{chunk-R6UFP2GE.js.map → chunk-5NVJA7IW.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{chunk-XSJCLN2R.js.map → chunk-AEMKH5WQ.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{chunk-6ER6DXH5.js.map → chunk-AXBUHLW7.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{chunk-BQHUILZS.js.map → chunk-BFJPMUF5.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{chunk-I6BNFU5X.js.map → chunk-BKQMJXWY.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{chunk-XLTD2HN3.js.map → chunk-CBJXWXI5.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{chunk-3BWOVLTH.js.map → chunk-EPWT7BEA.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{chunk-NUZ5HKR4.js.map → chunk-F33VC5EX.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{chunk-WKY2IBOQ.js.map → chunk-FGRJZVXD.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{chunk-77GFDHGF.js.map → chunk-FO2TYSQZ.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{chunk-GXSUPCBV.js.map → chunk-HOA3GMB6.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{chunk-OVQCEJPG.js.map → chunk-HP35AVFS.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{chunk-KJ33AOCY.js.map → chunk-J4DKAGTM.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{chunk-ME2YH6FN.js.map → chunk-JS47EKLP.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{chunk-I2HSTRJF.js.map → chunk-KN4WSESY.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{chunk-RZN6VURO.js.map → chunk-KP4KIUQT.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{chunk-MITFDD35.js.map → chunk-KVXIQDJG.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{chunk-IJGCZSIQ.js.map → chunk-L3LYL3ID.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{chunk-UM2GBHS4.js.map → chunk-MSH23UWO.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{chunk-LCM63IXU.js.map → chunk-N4SQZ7L3.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{chunk-3VAM3NNM.js.map → chunk-NDSMKB2I.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{chunk-6P6GGMOG.js.map → chunk-NGEEXR2R.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-PO3GSVFV.js.map → chunk-NLVCMVC7.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-N7ACFE26.js.map → chunk-NUKHZZNM.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-GGYWB3Y2.js.map → chunk-ODN53S6H.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-23YFZ3IG.js.map → chunk-OTY2YEH5.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-2RSPZI5H.js.map → chunk-OVSSE2JP.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-2VVCGBNV.js.map → chunk-QF4OPBAG.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-WSMOSYRD.js.map → chunk-QQPZYP73.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-OZ7NSQHL.js.map → chunk-QWNUDGFQ.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-GCOQW437.js.map → chunk-SDLEYY6A.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-PIU6RSL3.js.map → chunk-TBLBEOEX.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-YL2DJGYS.js.map → chunk-UEXNNF3K.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-UBOPJT3S.js.map → chunk-UMMJAJB2.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-KAG77BY3.js.map → chunk-XLSQ3QLT.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-E5FJNAZA.js.map → chunk-XNGMIVQY.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-RWPSOIEE.js.map → chunk-YEFOCDIK.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{claim-4DBF6RVG.js.map → claim-NHBIIBOW.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{claim-X2P4IB7J.js.map → claim-RNEBQCOO.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{close-3HDWDA3L.js.map → close-UNTFXVM3.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{close-PTYFA45H.js.map → close-ZMXL2WDS.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{comments-QKBYCWKD.js.map → comments-EFVBHWPT.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{comments-OONGABK5.js.map → comments-J5Q4IJPH.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{create-JTZNCTQC.js.map → create-EZWAMUKR.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{create-I5L4EYYZ.js.map → create-PUAIJEZ7.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{delete-7HPGI4GZ.js.map → delete-PKR2JHLH.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{delete-VXUPH5RS.js.map → delete-WBME6WG5.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{deps-JSRRWC3Z.js.map → deps-4BQEDV4L.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{deps-SCZIFK2Z.js.map → deps-KWHQRO75.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{docs-GJK6K4VP.js.map → docs-364GT3ZR.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{docs-WW4N3MBM.js.map → docs-SCNBUGSV.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{extension-VDY2U33M.js.map → extension-CRE7JM47.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{extension-J7IBMFTD.js.map → extension-KK2UPXJD.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{files-ISZJGILQ.js.map → files-3GESQAWL.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{files-WKOD326U.js.map → files-66EHM5ZR.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{history-PKN67D5O.js.map → history-TJTO5GCR.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{history-2BA3T5AE.js.map → history-ZERISU2L.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{history-redact-JBZNXHGR.js.map → history-redact-GODBYT5A.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{history-redact-V4FOJGS7.js.map → history-redact-JUXUOH54.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{history-repair-HIBCBIKK.js.map → history-repair-CCCPBNTF.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{history-repair-SDMHR7JT.js.map → history-repair-TDBBSRVK.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{init-P56QYWJF.js.map → init-6ZPKD3YN.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{init-HIVSNX3O.js.map → init-CBZHXBR3.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{learnings-MIXSESLK.js.map → learnings-U7U2FNIO.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{learnings-GDFRG5J7.js.map → learnings-WYNTYQ5T.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{list-MUSQNMTD.js.map → list-7MTPPZHC.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{list-FGOWQMSM.js.map → list-JGP7ODML.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{notes-5UK3GEH2.js.map → notes-P25YVTEG.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{notes-4XVSH2AZ.js.map → notes-QIF6A7XS.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{plan-DUMBV3QB.js.map → plan-RACB5PI6.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{plan-SLMODHWX.js.map → plan-SSBJFWXA.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{restore-D4RGNX33.js.map → restore-3JRX27QW.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{restore-PBL6T5TW.js.map → restore-K72ZNPEP.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{stats-XYB6KTFG.js.map → stats-O4UTMJMC.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{stats-CV54BAWY.js.map → stats-WLJ3XBF5.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{telemetry-LMJ7PFUO.js.map → telemetry-EUVHFSQU.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{telemetry-NCMEPJNR.js.map → telemetry-NRVWX25E.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{test-WBROAJIE.js.map → test-GXUBQNUC.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{test-MXX3E5JL.js.map → test-XN7RJL5Z.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{test-runs-V6A7LPWZ.js.map → test-runs-7FHCPEA3.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{test-runs-WMVTQU3Y.js.map → test-runs-IK6E2HNX.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{update-YRXSUGYQ.js.map → update-LFBSEW3N.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{update-OSV3NAQB.js.map → update-U4B4OMHZ.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{update-many-KGGEYABR.js.map → update-many-5KD33MKY.js.map} +0 -0
  600. /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,gB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AAK,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]="d7830a17-8330-53f9-8d7b-b978e22febf8")}catch(e){}}();
3
- import { mkdir, readFile, rename, stat, unlink, writeFile } from "node:fs/promises";
4
- import { basename, dirname, join, resolve } from "node:path";
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 writeFile(tempPath, serialized, "utf8");
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/${DEFAULT_COLLECTION}/points/search`,
360
- upsert_target: `${baseUrl}/collections/${DEFAULT_COLLECTION}/points?wait=true`,
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}#${DEFAULT_COLLECTION}`,
367
- upsert_target: `lancedb://${encodedPath}#${DEFAULT_COLLECTION}`,
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: DEFAULT_COLLECTION,
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: DEFAULT_COLLECTION,
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: DEFAULT_COLLECTION,
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, DEFAULT_COLLECTION);
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=d7830a17-8330-53f9-8d7b-b978e22febf8
609
+ //# debugId=eb209648-8ca2-5f93-91f2-3165e28da920