agentic-qe 3.9.29 → 3.9.31

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 (341) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +176 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/bridge/captured-experience-bridge.js +31 -2
  5. package/dist/cli/bundle.js +5 -5
  6. package/dist/cli/chunks/adapter-CI2GZYME.js +2 -0
  7. package/dist/cli/chunks/{agent-booster-wasm-EPRGXS5D.js → agent-booster-wasm-AQXZYWZY.js} +2 -2
  8. package/dist/cli/chunks/{agent-handler-LF6D64UE.js → agent-handler-7N4ZPXCY.js} +2 -2
  9. package/dist/cli/chunks/{agent-memory-branch-XD3UQD6Y.js → agent-memory-branch-FLKF2JVX.js} +2 -2
  10. package/dist/cli/chunks/aqe-learning-engine-KNQKALLI.js +2 -0
  11. package/dist/cli/chunks/{audit-MNJONFOL.js → audit-B4V4IKTA.js} +2 -2
  12. package/dist/cli/chunks/base-P7PRMQWY.js +2 -0
  13. package/dist/cli/chunks/{hnswlib-node-PSQJ3C65.js → better-sqlite3-NYOVLWBG.js} +2 -2
  14. package/dist/cli/chunks/{brain-handler-SA2G3FDO.js → brain-handler-OOXJ2KYY.js} +4 -4
  15. package/dist/cli/chunks/{branch-enumerator-T7SZZTMH.js → branch-enumerator-LFKFW3A4.js} +2 -2
  16. package/dist/cli/chunks/{browser-OH5HUVOG.js → browser-F72IES2I.js} +3 -3
  17. package/dist/cli/chunks/browser-workflow-QUP4A763.js +2 -0
  18. package/dist/cli/chunks/{chunk-K7CFDRVW.js → chunk-2NLZXG6V.js} +1 -1
  19. package/dist/cli/chunks/{chunk-5Q26UGSU.js → chunk-35SFAIXE.js} +2 -2
  20. package/dist/cli/chunks/{chunk-UI6KM5PK.js → chunk-3VKB4HVT.js} +2 -2
  21. package/dist/cli/chunks/{chunk-UKYPDNQR.js → chunk-462MZLJB.js} +1 -1
  22. package/dist/cli/chunks/{chunk-WUKSEOUO.js → chunk-47QIAHUJ.js} +2 -2
  23. package/dist/cli/chunks/{chunk-R55RXPHB.js → chunk-4N736EES.js} +2 -2
  24. package/dist/cli/chunks/{chunk-5XRNUFEG.js → chunk-52D3CYE5.js} +2 -2
  25. package/dist/cli/chunks/{chunk-5MUYYPPW.js → chunk-5AMAJCZS.js} +3 -3
  26. package/dist/cli/chunks/{chunk-2JK43GR4.js → chunk-5G2L4XRU.js} +2 -2
  27. package/dist/cli/chunks/{chunk-C7MWQ4BI.js → chunk-5M4F3PAL.js} +1 -1
  28. package/dist/cli/chunks/{chunk-PYAITX6B.js → chunk-5WWQLPB4.js} +2 -2
  29. package/dist/cli/chunks/chunk-5Z6PYYWK.js +2 -0
  30. package/dist/cli/chunks/{chunk-VHJRWMZ5.js → chunk-62KYX5NH.js} +2 -2
  31. package/dist/cli/chunks/{chunk-667A24A4.js → chunk-7MXQV7RB.js} +12 -6
  32. package/dist/cli/chunks/{chunk-N5SS5YIS.js → chunk-7OVVBBOZ.js} +2 -2
  33. package/dist/cli/chunks/{chunk-TESFXE2W.js → chunk-7RPEBKQZ.js} +2 -2
  34. package/dist/cli/chunks/{chunk-3T4Q5V4B.js → chunk-7UHRT5AX.js} +2 -2
  35. package/dist/cli/chunks/{chunk-7PYHCYLJ.js → chunk-7V7TP242.js} +1 -1
  36. package/dist/cli/chunks/{chunk-IBSTVSKT.js → chunk-A424Z7LA.js} +1 -1
  37. package/dist/cli/chunks/{chunk-IX5LUHCN.js → chunk-AKFRM4IO.js} +2 -2
  38. package/dist/cli/chunks/{chunk-UGXYKPM4.js → chunk-AKJWBJDK.js} +2 -2
  39. package/dist/cli/chunks/{chunk-MBNFD2C3.js → chunk-AQN6PDHI.js} +1 -1
  40. package/dist/cli/chunks/{chunk-YCK464TF.js → chunk-BMS7WFDB.js} +1 -1
  41. package/dist/cli/chunks/{chunk-C7G7TA2H.js → chunk-BYHUGO73.js} +3 -3
  42. package/dist/cli/chunks/{chunk-ZZAZQKOA.js → chunk-CFLA2GBS.js} +2 -2
  43. package/dist/cli/chunks/{chunk-7AIVTUMM.js → chunk-CNKOIHF6.js} +2 -2
  44. package/dist/cli/chunks/{chunk-23B7TDPN.js → chunk-CQWZNVIM.js} +2 -2
  45. package/dist/cli/chunks/{chunk-REFFJUYT.js → chunk-CUSLB7MB.js} +2 -2
  46. package/dist/cli/chunks/chunk-CYUGE5ZQ.js +2 -0
  47. package/dist/cli/chunks/{chunk-BZ4OMPVJ.js → chunk-DMF4Z2M6.js} +2 -2
  48. package/dist/cli/chunks/{chunk-HEUAPPKE.js → chunk-DUF733Z7.js} +1 -1
  49. package/dist/cli/chunks/{chunk-VKJLHKLY.js → chunk-EAIPJSKH.js} +2 -2
  50. package/dist/cli/chunks/{chunk-GHBQVPJT.js → chunk-EJXRBAQF.js} +2 -2
  51. package/dist/cli/chunks/{chunk-N6A4XFUM.js → chunk-EKYPQ5DX.js} +1 -1
  52. package/dist/cli/chunks/{chunk-ZPFBEZV5.js → chunk-ENCFLC44.js} +2 -2
  53. package/dist/cli/chunks/{chunk-WQX2Q42U.js → chunk-FOAWHNOP.js} +2 -2
  54. package/dist/cli/chunks/{chunk-GBLW4QDV.js → chunk-FUHPLXJX.js} +1 -1
  55. package/dist/cli/chunks/{chunk-3E4VPGNW.js → chunk-G2U7Q6V6.js} +2 -2
  56. package/dist/cli/chunks/{chunk-7WRIYQG7.js → chunk-G3YKCZWQ.js} +3 -3
  57. package/dist/cli/chunks/{chunk-OLJLSLCY.js → chunk-GJSH4UZ3.js} +3 -3
  58. package/dist/cli/chunks/{chunk-XP5OUB2X.js → chunk-GN7FUCJH.js} +1 -1
  59. package/dist/cli/chunks/{chunk-UO3QSXYD.js → chunk-GQFAVT2I.js} +1 -1
  60. package/dist/cli/chunks/{chunk-AUE4QOT7.js → chunk-HHEIQHLQ.js} +2 -2
  61. package/dist/cli/chunks/{chunk-LRWREDZU.js → chunk-I3TFGMOQ.js} +1 -1
  62. package/dist/cli/chunks/{chunk-BUMNLVMC.js → chunk-IRRGUXAU.js} +1 -1
  63. package/dist/cli/chunks/{chunk-ZMZS6NKQ.js → chunk-IY4P35N3.js} +2 -2
  64. package/dist/cli/chunks/{chunk-SKIG6EOQ.js → chunk-JF3U456G.js} +2 -2
  65. package/dist/cli/chunks/{chunk-YEXQMYOM.js → chunk-JJRZOLDY.js} +2 -2
  66. package/dist/cli/chunks/{chunk-G426VZ5K.js → chunk-JKKV5KKS.js} +2 -2
  67. package/dist/cli/chunks/{chunk-I6PVI7R5.js → chunk-JMLOEW7Y.js} +2 -2
  68. package/dist/cli/chunks/chunk-JRIDPOEZ.js +95 -0
  69. package/dist/cli/chunks/{chunk-MCJRIW7M.js → chunk-K37CNLQZ.js} +1 -1
  70. package/dist/cli/chunks/{chunk-LIEKDXTS.js → chunk-K6MFAVXK.js} +2 -2
  71. package/dist/cli/chunks/{chunk-OPPASGEB.js → chunk-KJAIE7SL.js} +4 -4
  72. package/dist/cli/chunks/{chunk-ZWI5Z2SI.js → chunk-KXRDQQGN.js} +2 -2
  73. package/dist/cli/chunks/{chunk-Y7VPSAWH.js → chunk-L4JTTPU7.js} +2 -2
  74. package/dist/cli/chunks/{chunk-RXAJBMM7.js → chunk-L63KB63A.js} +2 -2
  75. package/dist/cli/chunks/{chunk-KX3XTWNR.js → chunk-L7DNPOAQ.js} +2 -2
  76. package/dist/cli/chunks/{chunk-LJDPZC6Q.js → chunk-LF5RO6WO.js} +1 -1
  77. package/dist/cli/chunks/{chunk-GWBI5IMK.js → chunk-LRWRFKQH.js} +1 -1
  78. package/dist/cli/chunks/{chunk-JXWZZTPN.js → chunk-M6RVKGIP.js} +2 -2
  79. package/dist/cli/chunks/{chunk-IQXDL7BX.js → chunk-MAJ5QFVY.js} +1 -1
  80. package/dist/cli/chunks/chunk-MYCVU3D3.js +14 -0
  81. package/dist/cli/chunks/{chunk-C7SJS5E4.js → chunk-N6P7ENG7.js} +2 -2
  82. package/dist/cli/chunks/{chunk-KQYKPEY6.js → chunk-N6SIKSCO.js} +2 -2
  83. package/dist/cli/chunks/{chunk-BP3KVVEM.js → chunk-NBKM7NKX.js} +2 -2
  84. package/dist/cli/chunks/{chunk-TZG7TJD5.js → chunk-NLUBN642.js} +2 -2
  85. package/dist/cli/chunks/{chunk-HCVIUAF2.js → chunk-NNF3GCGF.js} +2 -2
  86. package/dist/cli/chunks/{chunk-AYESXBSX.js → chunk-NTVJKQ5S.js} +2 -2
  87. package/dist/cli/chunks/{chunk-LPSIKIE2.js → chunk-NZQYNUGM.js} +2 -2
  88. package/dist/cli/chunks/{chunk-JX2AS6QZ.js → chunk-ONMJJ2C3.js} +1 -1
  89. package/dist/cli/chunks/{chunk-AOZ3JGJQ.js → chunk-OXOXNAEZ.js} +2 -2
  90. package/dist/cli/chunks/chunk-PSF6YQQM.js +180 -0
  91. package/dist/cli/chunks/{chunk-OW47RQEW.js → chunk-PTOTOBOU.js} +1 -1
  92. package/dist/cli/chunks/{chunk-FIMBLHR5.js → chunk-PUSZ4NBY.js} +2 -2
  93. package/dist/cli/chunks/chunk-PYYNY7RJ.js +2 -0
  94. package/dist/cli/chunks/{chunk-JXWJ6BLR.js → chunk-QEJBJST4.js} +1 -1
  95. package/dist/cli/chunks/{chunk-AQ4ZSM4D.js → chunk-QGLWFZVQ.js} +2 -2
  96. package/dist/cli/chunks/{chunk-ONFODTGV.js → chunk-QITO7E7Y.js} +1 -1
  97. package/dist/cli/chunks/{chunk-YWW6YPT5.js → chunk-QMSDKKYG.js} +1 -1
  98. package/dist/cli/chunks/{chunk-DCZV4QTP.js → chunk-RBDAHW2M.js} +2 -2
  99. package/dist/cli/chunks/{chunk-TLPIUYN3.js → chunk-RDJWUKIR.js} +2 -2
  100. package/dist/cli/chunks/{chunk-FDETLFX4.js → chunk-REJEFTWX.js} +1 -1
  101. package/dist/cli/chunks/{chunk-BVHLZ3TP.js → chunk-ROEIR3OD.js} +1 -1
  102. package/dist/cli/chunks/{chunk-GTJNB5B4.js → chunk-RTGNWRQI.js} +2 -2
  103. package/dist/cli/chunks/{chunk-XJJQZULZ.js → chunk-SL4TAJOE.js} +2 -2
  104. package/dist/cli/chunks/{chunk-ENJBAK7Y.js → chunk-T4DDCMKG.js} +113 -113
  105. package/dist/cli/chunks/{chunk-ZIX5MU4Q.js → chunk-TJGIIGKL.js} +2 -2
  106. package/dist/cli/chunks/{chunk-ZOORGOLY.js → chunk-TLCCM2AF.js} +1 -1
  107. package/dist/cli/chunks/{chunk-RBHWBTKA.js → chunk-TVHWI77X.js} +1 -1
  108. package/dist/cli/chunks/{chunk-P7HWW3VH.js → chunk-TYUIQSSF.js} +2 -2
  109. package/dist/cli/chunks/{chunk-YXMKMUQX.js → chunk-UIIEZMSM.js} +1 -1
  110. package/dist/cli/chunks/{chunk-VWDVQFEV.js → chunk-UIRTXM7C.js} +71 -71
  111. package/dist/cli/chunks/{chunk-2HUYG6Q6.js → chunk-UNXUSYRL.js} +3 -3
  112. package/dist/cli/chunks/chunk-VA45HLBF.js +2 -0
  113. package/dist/cli/chunks/{chunk-BMMXCDTH.js → chunk-VAIOZDG5.js} +1 -1
  114. package/dist/cli/chunks/{chunk-3YS4ZLL2.js → chunk-VLAGWLHF.js} +2 -2
  115. package/dist/cli/chunks/{chunk-SCXRYZ3U.js → chunk-VOOJDHLI.js} +14 -8
  116. package/dist/cli/chunks/{chunk-RRQH5BMQ.js → chunk-VSKABN3B.js} +29 -17
  117. package/dist/cli/chunks/{chunk-HHDPHHTX.js → chunk-VUL5HIKR.js} +2 -2
  118. package/dist/cli/chunks/{chunk-ZXWHKLZN.js → chunk-W7XVEWKQ.js} +1 -1
  119. package/dist/cli/chunks/{chunk-CZEQFAKE.js → chunk-WB6TI6Q3.js} +2 -2
  120. package/dist/cli/chunks/{chunk-YDBBXRH7.js → chunk-X2FLWV5C.js} +2 -2
  121. package/dist/cli/chunks/{chunk-G7LVJXZR.js → chunk-XE4YKDIM.js} +2 -2
  122. package/dist/cli/chunks/{chunk-A7ZCJ2XN.js → chunk-XGBIXRKD.js} +2 -2
  123. package/dist/cli/chunks/{chunk-B23E53WF.js → chunk-XMMWYQJK.js} +2 -2
  124. package/dist/cli/chunks/{chunk-3MFAU2JA.js → chunk-XNJ6DIEW.js} +2 -2
  125. package/dist/cli/chunks/{chunk-VJR2JIYP.js → chunk-XTWYCMAM.js} +2 -2
  126. package/dist/cli/chunks/{chunk-POV6V35B.js → chunk-XY3WUGD3.js} +2 -2
  127. package/dist/cli/chunks/{chunk-OU2FFOML.js → chunk-YEZJE2ZW.js} +4 -4
  128. package/dist/cli/chunks/{chunk-HDKXJMRS.js → chunk-YLEMSN46.js} +1 -1
  129. package/dist/cli/chunks/{chunk-SH7N3Y63.js → chunk-YMN4C32S.js} +3 -3
  130. package/dist/cli/chunks/{chunk-KIUJ4EI5.js → chunk-YN7HCVUP.js} +2 -2
  131. package/dist/cli/chunks/{chunk-WYSM5565.js → chunk-YQJBE6NX.js} +2 -2
  132. package/dist/cli/chunks/{chunk-QNIOQ4AR.js → chunk-ZBJRNCWX.js} +2 -2
  133. package/dist/cli/chunks/{chunk-NZIU2SEI.js → chunk-ZG4EKPGV.js} +1 -1
  134. package/dist/cli/chunks/{chunk-4ZAX5A6E.js → chunk-ZWSRIJ2T.js} +2 -2
  135. package/dist/cli/chunks/{ci-5BS5ALBZ.js → ci-LRTJSZHT.js} +2 -2
  136. package/dist/cli/chunks/{ci-output-I7CGW62R.js → ci-output-LISCHUKD.js} +2 -2
  137. package/dist/cli/chunks/{circuit-breaker-7P2V65XX.js → circuit-breaker-7PMP25KZ.js} +2 -2
  138. package/dist/cli/chunks/{claude-flow-setup-EKRLBRCE.js → claude-flow-setup-DOW4QVMC.js} +2 -2
  139. package/dist/cli/chunks/client-XF6SJO2C.js +2 -0
  140. package/dist/cli/chunks/{cline-installer-U6KRJJHQ.js → cline-installer-2NXQGW73.js} +2 -2
  141. package/dist/cli/chunks/{code-I6PB6YM7.js → code-3X6RWAS7.js} +2 -2
  142. package/dist/cli/chunks/{code-index-extractor-NP7JW32L.js → code-index-extractor-4ABP5WCP.js} +2 -2
  143. package/dist/cli/chunks/{codex-installer-52W4TK27.js → codex-installer-V7PII6GL.js} +2 -2
  144. package/dist/cli/chunks/{completions-LTOAC3Y5.js → completions-Y7LNQ63I.js} +2 -2
  145. package/dist/cli/chunks/{complexity-analyzer-RXAF5SX3.js → complexity-analyzer-XLYMAM6I.js} +2 -2
  146. package/dist/cli/chunks/{continuedev-installer-BNUOLW2M.js → continuedev-installer-GOT4TKNT.js} +2 -2
  147. package/dist/cli/chunks/{copilot-installer-YXANWEVX.js → copilot-installer-D6BAQVIO.js} +2 -2
  148. package/dist/cli/chunks/{cost-tracker-EBAHKAGL.js → cost-tracker-VT7C5Q52.js} +2 -2
  149. package/dist/cli/chunks/{coverage-SWVKYJ6V.js → coverage-C62MRP4M.js} +3 -3
  150. package/dist/cli/chunks/cross-domain-router-J2OFPM6R.js +2 -0
  151. package/dist/cli/chunks/{cursor-installer-QIZPJ5YQ.js → cursor-installer-WAWSS2K2.js} +2 -2
  152. package/dist/cli/chunks/{daemon-YPL4BMZX.js → daemon-CP2ETHRF.js} +3 -3
  153. package/dist/cli/chunks/{dag-attention-scheduler-6XXECMF2.js → dag-attention-scheduler-SZIZWPV7.js} +2 -2
  154. package/dist/cli/chunks/{detect-GGTJLBM6.js → detect-AJX6NJEP.js} +2 -2
  155. package/dist/cli/chunks/{dist-node-B6P2AD27.js → dist-node-E5X47QTY.js} +2 -2
  156. package/dist/cli/chunks/{domain-handler-TSZJEND7.js → domain-handler-FN3PIP45.js} +2 -2
  157. package/dist/cli/chunks/{domain-transfer-EBKK2ZKV.js → domain-transfer-N3TOJEMT.js} +2 -2
  158. package/dist/cli/chunks/dream-D5LD5SOZ.js +2 -0
  159. package/dist/cli/chunks/{embed-and-insert-pattern-OMRWRS6V.js → embed-and-insert-pattern-PJI5TZKR.js} +2 -2
  160. package/dist/cli/chunks/{eval-Q5PAQA5O.js → eval-OS54TDQU.js} +2 -2
  161. package/dist/cli/chunks/{experience-capture-middleware-5MOUWAON.js → experience-capture-middleware-FBM4ANZW.js} +3 -3
  162. package/dist/cli/chunks/{fast-paths-32E3N4KU.js → fast-paths-2CVAAPQO.js} +2 -2
  163. package/dist/cli/chunks/{feature-flags-WRIWP5VL.js → feature-flags-A5KFWVFC.js} +2 -2
  164. package/dist/cli/chunks/{feature-flags-VERJA5SQ.js → feature-flags-GEXTW6OT.js} +2 -2
  165. package/dist/cli/chunks/{file-discovery-2X6CZSTB.js → file-discovery-KWLVC7KN.js} +2 -2
  166. package/dist/cli/chunks/{fleet-VB2JTP7P.js → fleet-MNKH356S.js} +3 -3
  167. package/dist/cli/chunks/{gnn-wrapper-HNKBFKUD.js → gnn-wrapper-ALTWYFVZ.js} +2 -2
  168. package/dist/cli/chunks/{heartbeat-handler-Y5GIRQNS.js → heartbeat-handler-MBMEPEGW.js} +4 -4
  169. package/dist/cli/chunks/{heartbeat-scheduler-UGB57DTJ.js → heartbeat-scheduler-OH3SS7MH.js} +2 -2
  170. package/dist/cli/chunks/hnsw-adapter-M2MMM3N6.js +2 -0
  171. package/dist/cli/chunks/hnsw-index-JO7KNF7M.js +2 -0
  172. package/dist/cli/chunks/{hnsw-legacy-bridge-A6G6GPMS.js → hnsw-legacy-bridge-WTD5PR5V.js} +2 -2
  173. package/dist/cli/chunks/{better-sqlite3-XT27JRMH.js → hnswlib-node-WENGW3YX.js} +2 -2
  174. package/dist/cli/chunks/hooks-ELHGEBFK.js +248 -0
  175. package/dist/cli/chunks/{hybrid-router-LTAQGTNR.js → hybrid-router-D6ZMIZCE.js} +2 -2
  176. package/dist/cli/chunks/{hypergraph-engine-IRTPRX6K.js → hypergraph-engine-JOQ6TERZ.js} +2 -2
  177. package/dist/cli/chunks/{hypergraph-handler-6IVDHP2K.js → hypergraph-handler-HX45YWWN.js} +3 -3
  178. package/dist/cli/chunks/impact-analyzer-ROQL4J7P.js +2 -0
  179. package/dist/cli/chunks/{init-handler-NNLOQN2F.js → init-handler-TNVU6NQ6.js} +6 -6
  180. package/dist/cli/chunks/init-wizard-4BDFZX4M.js +2 -0
  181. package/dist/cli/chunks/kernel-37Y63WKR.js +2 -0
  182. package/dist/cli/chunks/{kilocode-installer-Q5A6WBX2.js → kilocode-installer-YC5RJIY4.js} +2 -2
  183. package/dist/cli/chunks/{kiro-installer-ZVOLX6AX.js → kiro-installer-EAB26M55.js} +2 -2
  184. package/dist/cli/chunks/knowledge-graph-V3DX6ZCX.js +2 -0
  185. package/dist/cli/chunks/learning-A2OB7D2B.js +117 -0
  186. package/dist/cli/chunks/{llm-router-EFIOXD3E.js → llm-router-KEG6PA7C.js} +4 -4
  187. package/dist/cli/chunks/{load-7HYD5K5T.js → load-D6ZDLVA3.js} +2 -2
  188. package/dist/cli/chunks/load-test-HPBA2CMT.js +2 -0
  189. package/dist/cli/chunks/{mcp-TQEPJY5L.js → mcp-ERJHZ6FN.js} +2 -2
  190. package/dist/cli/chunks/{memory-2P5KRDUP.js → memory-GSRIJIVR.js} +5 -5
  191. package/dist/cli/chunks/memory-backend-DODDBB46.js +2 -0
  192. package/dist/cli/chunks/memory-handlers-MFLCRS7V.js +2 -0
  193. package/dist/cli/chunks/{multi-model-executor-Z74ALKIH.js → multi-model-executor-GK3V7ERC.js} +2 -2
  194. package/dist/cli/chunks/{opencode-installer-2NICPXQZ.js → opencode-installer-6TTN26RG.js} +2 -2
  195. package/dist/cli/chunks/{orchestrator-ZPVU3M4M.js → orchestrator-YVTSM6QW.js} +37 -18
  196. package/dist/cli/chunks/{pipeline-B55E7S5P.js → pipeline-EWLJCY5G.js} +2 -2
  197. package/dist/cli/chunks/{platform-6FY6335Y.js → platform-2ULHQQME.js} +2 -2
  198. package/dist/cli/chunks/{plugin-F23VOSIL.js → plugin-PYN2KOXA.js} +2 -2
  199. package/dist/cli/chunks/{prime-radiant-advanced-wasm-LL7WPCNW.js → prime-radiant-advanced-wasm-IULCTOGZ.js} +2 -2
  200. package/dist/cli/chunks/protocol-executor-D56OYMCJ.js +2 -0
  201. package/dist/cli/chunks/{protocol-handler-JWPPGEUR.js → protocol-handler-FZYI2SBP.js} +2 -2
  202. package/dist/cli/chunks/{prove-S4PD63BK.js → prove-DN7S74SP.js} +2 -2
  203. package/dist/cli/chunks/{provider-manager-R7YYUTO3.js → provider-manager-FT3MCROB.js} +2 -2
  204. package/dist/cli/chunks/qe-reasoning-bank-KXROIEK7.js +2 -0
  205. package/dist/cli/chunks/{quality-UIG6G2BR.js → quality-ITBU6LGC.js} +2 -2
  206. package/dist/cli/chunks/queen-coordinator-XOGATERL.js +2 -0
  207. package/dist/cli/chunks/{real-embeddings-7GJEWY4C.js → real-embeddings-PZUZ5RXJ.js} +2 -2
  208. package/dist/cli/chunks/{roocode-installer-Y5YVCVVS.js → roocode-installer-2LMVZOUZ.js} +2 -2
  209. package/dist/cli/chunks/router-3EHNUCOM.js +2 -0
  210. package/dist/cli/chunks/routing-feedback-ZHKGET22.js +2 -0
  211. package/dist/cli/chunks/{routing-handler-YFBT7LZH.js → routing-handler-5RB73UCF.js} +2 -2
  212. package/dist/cli/chunks/{ruvector-commands-7WCRMBWZ.js → ruvector-commands-VBN4APMG.js} +2 -2
  213. package/dist/cli/chunks/{rvf-dual-writer-PPZ5AVFW.js → rvf-dual-writer-BNY4AUWT.js} +2 -2
  214. package/dist/cli/chunks/{rvf-migration-adapter-SVW4AKVC.js → rvf-migration-adapter-73MKPBGV.js} +2 -2
  215. package/dist/cli/chunks/{rvf-migration-coordinator-TNCPU743.js → rvf-migration-coordinator-SGVB7ZAZ.js} +2 -2
  216. package/dist/cli/chunks/rvf-native-adapter-4YC5IQUW.js +2 -0
  217. package/dist/cli/chunks/safe-db-PLJRHQIC.js +2 -0
  218. package/dist/cli/chunks/schedule-7DGELVJE.js +2 -0
  219. package/dist/cli/chunks/scheduler-VWASEC2J.js +2 -0
  220. package/dist/cli/chunks/{security-22YXZGU3.js → security-XUH4H7R3.js} +3 -3
  221. package/dist/cli/chunks/shared-rvf-adapter-DCVDY2XW.js +2 -0
  222. package/dist/cli/chunks/{shared-rvf-dual-writer-Q5OSQNW5.js → shared-rvf-dual-writer-GML4EDYF.js} +2 -2
  223. package/dist/cli/chunks/sqlite-persistence-CTEBGVOW.js +2 -0
  224. package/dist/cli/chunks/{status-handler-CTEEZTVQ.js → status-handler-XI7GJF6Z.js} +2 -2
  225. package/dist/cli/chunks/{structural-health-S72DLFPZ.js → structural-health-WPCYKOXV.js} +2 -2
  226. package/dist/cli/chunks/{sync-2AJ5S27F.js → sync-SFKTCRZC.js} +10 -10
  227. package/dist/cli/chunks/{task-handler-XQCQAUM3.js → task-handler-FZB55IEG.js} +2 -2
  228. package/dist/cli/chunks/{task-handlers-U6DXLSYJ.js → task-handlers-EXZGFH7F.js} +3 -3
  229. package/dist/cli/chunks/{test-K7C4CWFH.js → test-XYRN4OVU.js} +4 -4
  230. package/dist/cli/chunks/{test-scheduling-WQBR6C3V.js → test-scheduling-FLVOPGOT.js} +5 -5
  231. package/dist/cli/chunks/{token-bootstrap-IRZHAD7N.js → token-bootstrap-FDCFVRHM.js} +2 -2
  232. package/dist/cli/chunks/{token-usage-DIK6QRD5.js → token-usage-MHNZF3DM.js} +2 -2
  233. package/dist/cli/chunks/{transformers-RPUPJLSR.js → transformers-4CRVTMWY.js} +2 -2
  234. package/dist/cli/chunks/{tree-sitter-wasm-parser-A45KH4YZ.js → tree-sitter-wasm-parser-CI3V4AND.js} +2 -2
  235. package/dist/cli/chunks/{types-LO5DGIJC.js → types-RKCD4BNL.js} +2 -2
  236. package/dist/cli/chunks/unified-memory-YDKXKW3D.js +2 -0
  237. package/dist/cli/chunks/unified-memory-hnsw-6N7YZCLR.js +2 -0
  238. package/dist/cli/chunks/unified-persistence-UTWLPUQI.js +2 -0
  239. package/dist/cli/chunks/{upgrade-QZNMQOBY.js → upgrade-463W7VKH.js} +2 -2
  240. package/dist/cli/chunks/{validate-675K5FDZ.js → validate-LENSMEAY.js} +2 -2
  241. package/dist/cli/chunks/{validate-swarm-TJXJFTT4.js → validate-swarm-4FEBNAWA.js} +2 -2
  242. package/dist/cli/chunks/{vibium-2FFU5KPE.js → vibium-TXNVIVWJ.js} +2 -2
  243. package/dist/cli/chunks/visual-security-DGXSOFKD.js +2 -0
  244. package/dist/cli/chunks/{web-tree-sitter-VX55VO25.js → web-tree-sitter-BZEGWID4.js} +2 -2
  245. package/dist/cli/chunks/{windsurf-installer-A7FNN7RB.js → windsurf-installer-7AFXJTPU.js} +2 -2
  246. package/dist/cli/chunks/{witness-chain-QLIBCLCH.js → witness-chain-G6SUZOZG.js} +2 -2
  247. package/dist/cli/chunks/witness-chain-VP4MF6EU.js +2 -0
  248. package/dist/cli/chunks/{workflow-LQDA5VYM.js → workflow-EVQPO6FH.js} +4 -4
  249. package/dist/cli/chunks/workflow-orchestrator-VXSYAKQY.js +2 -0
  250. package/dist/cli/chunks/{wrappers-KE6AZMO6.js → wrappers-HR6RUDI2.js} +2 -2
  251. package/dist/cli/commands/hooks-handlers/editing-hooks.js +9 -3
  252. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +16 -24
  253. package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +1 -1
  254. package/dist/cli/commands/hooks-handlers/hooks-shared.js +8 -1
  255. package/dist/cli/commands/hooks-handlers/routing-hooks.js +15 -3
  256. package/dist/cli/commands/hooks-handlers/task-hooks.js +37 -46
  257. package/dist/cli/commands/learning.js +194 -0
  258. package/dist/cli/commands/sync.js +3 -0
  259. package/dist/domains/requirements-validation/services/quality-criteria/quality-criteria-service.js +4 -1
  260. package/dist/init/phases/07-hooks.js +4 -1
  261. package/dist/init/phases/10-workers.js +24 -2
  262. package/dist/integrations/agentic-flow/onnx-embeddings/embedding-generator.js +15 -12
  263. package/dist/integrations/n8n/agent-factory.js +4 -1
  264. package/dist/integrations/n8n/n8n-adapter.js +4 -1
  265. package/dist/kernel/interfaces.d.ts +12 -0
  266. package/dist/kernel/kernel.d.ts +1 -0
  267. package/dist/kernel/kernel.js +57 -0
  268. package/dist/kernel/unified-memory-schemas.d.ts +1 -1
  269. package/dist/kernel/unified-memory-schemas.js +7 -1
  270. package/dist/learning/agent-routing.d.ts +134 -1
  271. package/dist/learning/agent-routing.js +185 -2
  272. package/dist/learning/dream/dream-insights-pruner.d.ts +49 -0
  273. package/dist/learning/dream/dream-insights-pruner.js +53 -0
  274. package/dist/learning/dream/dream-scheduler.js +17 -0
  275. package/dist/learning/loop-health.d.ts +84 -0
  276. package/dist/learning/loop-health.js +91 -0
  277. package/dist/learning/pattern-usage-recorder.d.ts +58 -0
  278. package/dist/learning/pattern-usage-recorder.js +72 -0
  279. package/dist/learning/qe-reasoning-bank-types.d.ts +11 -0
  280. package/dist/learning/qe-reasoning-bank.d.ts +11 -0
  281. package/dist/learning/qe-reasoning-bank.js +86 -3
  282. package/dist/learning/routing-topology-gate.d.ts +40 -0
  283. package/dist/learning/routing-topology-gate.js +55 -0
  284. package/dist/learning/sqlite-persistence.d.ts +6 -1
  285. package/dist/learning/sqlite-persistence.js +14 -20
  286. package/dist/mcp/bundle.js +3833 -3807
  287. package/dist/mcp/handlers/domain-handler-configs.js +72 -13
  288. package/dist/mcp/protocol-server.d.ts +6 -0
  289. package/dist/mcp/protocol-server.js +91 -2
  290. package/dist/mcp/tools/coherence/collapse.d.ts +4 -0
  291. package/dist/mcp/tools/coherence/collapse.js +48 -21
  292. package/dist/mcp/tools/embeddings/embedding.js +5 -2
  293. package/dist/routing/routing-feedback.js +7 -3
  294. package/dist/routing/routing-outcomes-migration.d.ts +31 -0
  295. package/dist/routing/routing-outcomes-migration.js +60 -0
  296. package/dist/test-scheduling/pipeline.d.ts +1 -1
  297. package/dist/test-scheduling/pipeline.js +8 -2
  298. package/dist/workers/workers/learning-consolidation.d.ts +28 -0
  299. package/dist/workers/workers/learning-consolidation.js +204 -0
  300. package/dist/workflows/browser/workflow-loader.js +4 -1
  301. package/package.json +1 -1
  302. package/dist/cli/chunks/adapter-4NVP2SYD.js +0 -2
  303. package/dist/cli/chunks/aqe-learning-engine-ZTR5KIGB.js +0 -2
  304. package/dist/cli/chunks/base-2M65XYDE.js +0 -2
  305. package/dist/cli/chunks/browser-workflow-7EXB6DUF.js +0 -2
  306. package/dist/cli/chunks/chunk-6ZJROHI3.js +0 -2
  307. package/dist/cli/chunks/chunk-J3CLEYJP.js +0 -14
  308. package/dist/cli/chunks/chunk-SRSL5OFF.js +0 -180
  309. package/dist/cli/chunks/chunk-WLPP7V3W.js +0 -95
  310. package/dist/cli/chunks/chunk-YXS6SHB2.js +0 -2
  311. package/dist/cli/chunks/client-KTEVHNVO.js +0 -2
  312. package/dist/cli/chunks/cross-domain-router-23RTLMQL.js +0 -2
  313. package/dist/cli/chunks/dream-KNO2ZF24.js +0 -2
  314. package/dist/cli/chunks/hnsw-adapter-JQHOAYXA.js +0 -2
  315. package/dist/cli/chunks/hnsw-index-AIUQDZLY.js +0 -2
  316. package/dist/cli/chunks/hooks-Z4U7DCTP.js +0 -259
  317. package/dist/cli/chunks/impact-analyzer-ULJRGNBM.js +0 -2
  318. package/dist/cli/chunks/init-wizard-R2WC5V2W.js +0 -2
  319. package/dist/cli/chunks/kernel-ZDQG4UWQ.js +0 -2
  320. package/dist/cli/chunks/knowledge-graph-RLCAQW6I.js +0 -2
  321. package/dist/cli/chunks/learning-NZLHSX4F.js +0 -107
  322. package/dist/cli/chunks/load-test-KH35UZSW.js +0 -2
  323. package/dist/cli/chunks/memory-backend-NOYRJTBH.js +0 -2
  324. package/dist/cli/chunks/memory-handlers-YEQ4LSIX.js +0 -2
  325. package/dist/cli/chunks/protocol-executor-OL36TRHK.js +0 -2
  326. package/dist/cli/chunks/qe-reasoning-bank-C4QW56VE.js +0 -2
  327. package/dist/cli/chunks/queen-coordinator-FDDIA6BW.js +0 -2
  328. package/dist/cli/chunks/router-RRKX62UE.js +0 -2
  329. package/dist/cli/chunks/routing-feedback-NRJJVC35.js +0 -2
  330. package/dist/cli/chunks/rvf-native-adapter-TQLQYN7Y.js +0 -2
  331. package/dist/cli/chunks/safe-db-COFZGOYL.js +0 -2
  332. package/dist/cli/chunks/schedule-QAMKOCVJ.js +0 -2
  333. package/dist/cli/chunks/scheduler-RFETEEGY.js +0 -2
  334. package/dist/cli/chunks/shared-rvf-adapter-QNA66NKB.js +0 -2
  335. package/dist/cli/chunks/sqlite-persistence-43TV2RI3.js +0 -2
  336. package/dist/cli/chunks/unified-memory-VSSMXGHP.js +0 -2
  337. package/dist/cli/chunks/unified-memory-hnsw-ZV324XYA.js +0 -2
  338. package/dist/cli/chunks/unified-persistence-EE2UVIXW.js +0 -2
  339. package/dist/cli/chunks/visual-security-LWH7LME7.js +0 -2
  340. package/dist/cli/chunks/witness-chain-3YAV5SLZ.js +0 -2
  341. package/dist/cli/chunks/workflow-orchestrator-4UG2CNYN.js +0 -2
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import{a as N,d as P}from"./chunk-PYAITX6B.js";import{b,e as k}from"./chunk-N5SS5YIS.js";import{a as p,d as F}from"./chunk-3E4VPGNW.js";import{a as T,c as E}from"./chunk-REFFJUYT.js";import{a as H,b as O}from"./chunk-BZ4OMPVJ.js";import{c as z,g as S}from"./chunk-YCK464TF.js";function x(l){let e=0;for(let t=0;t<l.length;t++)e+=l[t]*l[t];return Math.sqrt(e)}function C(l,e,t,s){let n=t*s;if(n===0)return 0;let o=0;for(let r=0;r<l.length;r++)o+=l[r]*e[r];return o/n}function U(l={}){let{name:e="default",...t}=l;return new M(e,t)}var f,w,v,I,A,M,D=z(()=>{F();P();k();E();f=null,w=null;try{let l=(O(),S(H));f=l.differentiableSearch,w=l.init}catch{}v=class{data=[];compareFn;constructor(e){this.compareFn=e}push(e){this.data.push(e),this.bubbleUp(this.data.length-1)}pop(){if(this.data.length===0)return;let e=this.data[0],t=this.data.pop();return this.data.length>0&&(this.data[0]=t,this.sinkDown(0)),e}peek(){return this.data[0]}size(){return this.data.length}bubbleUp(e){for(;e>0;){let t=e-1>>1;if(this.compareFn(this.data[e],this.data[t])<0)[this.data[e],this.data[t]]=[this.data[t],this.data[e]],e=t;else break}}sinkDown(e){let t=this.data.length;for(;;){let s=e,n=2*e+1,o=2*e+2;if(n<t&&this.compareFn(this.data[n],this.data[s])<0&&(s=n),o<t&&this.compareFn(this.data[o],this.data[s])<0&&(s=o),s!==e)[this.data[e],this.data[s]]=[this.data[s],this.data[e]],e=s;else break}}},I=class{nodes=new Map;M=b.M_CONNECTIONS;Mmax0=b.M_CONNECTIONS*2;efConstruction=b.EF_CONSTRUCTION;efSearch=b.EF_SEARCH;mL=1/Math.log(b.M_CONNECTIONS);maxLevel=16;entryPoint=null;currentMaxLevel=-1;randomLevel(){return Math.min(Math.floor(-Math.log(N())*this.mL),this.maxLevel)}similarity(e,t){let s=this.nodes.get(t);return s?p(e,s.embedding):-1}searchLayer(e,t,s){let n=t,o=this.similarity(e,n),r=!0;for(;r;){r=!1;let a=this.nodes.get(n);if(!a)break;let h=a.neighbors.get(s)??[];for(let d of h){if(!this.nodes.has(d))continue;let i=this.similarity(e,d);i>o&&(n=d,o=i,r=!0)}}return n}searchLayerBeam(e,t,s,n){let o=new Set(t),r=t.filter(i=>this.nodes.has(i)).map(i=>({id:i,score:this.similarity(e,i)})),a=new v((i,c)=>c.score-i.score),h=new v((i,c)=>i.score-c.score);for(let i of r)a.push(i),h.push(i);for(;a.size()>0;){let i=a.pop();if(h.size()>=n&&i.score<h.peek().score)break;let c=this.nodes.get(i.id);if(!c)continue;let u=c.neighbors.get(s)??[];for(let m of u){if(o.has(m)||(o.add(m),!this.nodes.has(m)))continue;let g=this.similarity(e,m),y=h.size()>=n?h.peek().score:-1/0;if(h.size()<n||g>y){let L={id:m,score:g};a.push(L),h.push(L),h.size()>n&&h.pop()}}}let d=[];for(;h.size()>0;)d.push(h.pop());return d.reverse(),d}selectNeighbors(e,t,s){return t.sort((n,o)=>o.score-n.score).slice(0,s).map(n=>n.id)}getMaxConnections(e){return e===0?this.Mmax0:this.M}add(e,t){this.nodes.has(e)&&this.remove(e);let s=this.randomLevel(),n={id:e,embedding:t,neighbors:new Map};for(let r=0;r<=s;r++)n.neighbors.set(r,[]);if(this.nodes.set(e,n),this.entryPoint===null){this.entryPoint=e,this.currentMaxLevel=s;return}let o=this.entryPoint;for(let r=this.currentMaxLevel;r>s;r--)o=this.searchLayer(t,o,r);for(let r=Math.min(s,this.currentMaxLevel);r>=0;r--){let a=this.getMaxConnections(r),h=this.searchLayerBeam(t,[o],r,this.efConstruction),d=this.selectNeighbors(t,h,a);n.neighbors.set(r,[...d]);for(let i of d){let c=this.nodes.get(i);if(!c)continue;let u=c.neighbors.get(r)??[];if(u.push(e),u.length>a){let m=u.filter(g=>this.nodes.has(g)).map(g=>({id:g,score:p(c.embedding,this.nodes.get(g).embedding)}));m.sort((g,y)=>y.score-g.score),c.neighbors.set(r,m.slice(0,a).map(g=>g.id))}else c.neighbors.set(r,u)}h.length>0&&(o=h[0].id)}s>this.currentMaxLevel&&(this.entryPoint=e,this.currentMaxLevel=s)}remove(e){let t=this.nodes.get(e);if(!t)return!1;for(let[s,n]of t.neighbors.entries())for(let o of n){let r=this.nodes.get(o);if(!r)continue;let a=r.neighbors.get(s);if(!a)continue;let h=a.indexOf(e);h!==-1&&a.splice(h,1);let d=this.getMaxConnections(s);if(a.length<d){for(let i of n)if(i!==o&&i!==e&&this.nodes.has(i)&&!a.includes(i)){a.push(i);let c=this.nodes.get(i);if(c){let u=c.neighbors.get(s)??[];!u.includes(o)&&u.length<d&&(u.push(o),c.neighbors.set(s,u))}if(a.length>=d)break}}r.neighbors.set(s,a)}if(this.nodes.delete(e),this.entryPoint===e)if(this.nodes.size===0)this.entryPoint=null,this.currentMaxLevel=-1;else{let s=null,n=-1;for(let[o,r]of this.nodes.entries()){let a=-1;for(let h of r.neighbors.keys())h>a&&(a=h);a>n&&(n=a,s=o)}this.entryPoint=s,this.currentMaxLevel=n}return!0}search(e,t){if(this.nodes.size===0||this.entryPoint===null)return[];if(this.nodes.size===1){let r=this.nodes.get(this.entryPoint);return[{id:r.id,score:p(e,r.embedding)}]}let s=this.entryPoint;for(let r=this.currentMaxLevel;r>0;r--)s=this.searchLayer(e,s,r);let n=Math.max(this.efSearch,t);return this.searchLayerBeam(e,[s],0,n).slice(0,t)}size(){return this.nodes.size}clear(){this.nodes.clear(),this.entryPoint=null,this.currentMaxLevel=-1}};A=class{ids=[];vectors=[];norms=[];idToIndex=new Map;initialized=!1;constructor(){if(w&&!this.initialized)try{w(),this.initialized=!0}catch{this.initialized=f!==null}}add(e,t){let s=new Float32Array(t),n=x(s);if(this.idToIndex.has(e)){let r=this.idToIndex.get(e);this.vectors[r]=s,this.norms[r]=n;return}let o=this.ids.length;this.ids.push(e),this.vectors.push(s),this.norms.push(n),this.idToIndex.set(e,o)}search(e,t){if(this.ids.length===0)return[];let s=Math.min(t,this.ids.length),n=this.vectors.length>0?this.vectors[0].length:0,o=e.length,r=n===o;if(f&&this.vectors.length>0&&r){let i=new Float32Array(e),c=x(i);return f(i,this.vectors,s,1).indices.map(m=>({id:this.ids[m],score:C(i,this.vectors[m],c,this.norms[m])}))}let a=new Float32Array(e),h=x(a),d=[];for(let i=0;i<this.ids.length;i++){let c=this.vectors[i];if(c.length!==a.length){i===0&&console.warn(`[RuvectorFlatIndex] Dimension mismatch: query=${a.length}, stored=${c.length}. Skipping ${this.ids.length} mismatched vectors. Re-index with correct dimensions.`);continue}else d.push({id:this.ids[i],score:C(a,c,h,this.norms[i])})}return d.sort((i,c)=>c.score-i.score),d.slice(0,s)}remove(e){let t=this.idToIndex.get(e);if(t===void 0)return!1;let s=this.ids.length-1;if(t!==s){let n=this.ids[s];this.ids[t]=n,this.vectors[t]=this.vectors[s],this.norms[t]=this.norms[s],this.idToIndex.set(n,t)}return this.ids.pop(),this.vectors.pop(),this.norms.pop(),this.idToIndex.delete(e),!0}clear(){this.ids=[],this.vectors=[],this.norms=[],this.idToIndex.clear()}size(){return this.ids.length}},M=class{adapter;constructor(e,t){this.adapter=T.create(e,t)}add(e,t){this.adapter.addByStringId(e,t)}search(e,t){return this.adapter.searchByArray(e,t)}remove(e){return this.adapter.removeByStringId(e)}clear(){this.adapter.clear()}size(){return this.adapter.size()}recall(){return this.adapter.recall()}getProvider(){return this.adapter}}});export{v as a,I as b,A as c,M as d,U as e,D as f};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import{a as N,d as P}from"./chunk-5WWQLPB4.js";import{b,e as k}from"./chunk-7OVVBBOZ.js";import{a as p,d as F}from"./chunk-G2U7Q6V6.js";import{a as T,c as E}from"./chunk-CUSLB7MB.js";import{a as H,b as O}from"./chunk-DMF4Z2M6.js";import{c as z,g as S}from"./chunk-BMS7WFDB.js";function x(l){let e=0;for(let t=0;t<l.length;t++)e+=l[t]*l[t];return Math.sqrt(e)}function C(l,e,t,s){let n=t*s;if(n===0)return 0;let o=0;for(let r=0;r<l.length;r++)o+=l[r]*e[r];return o/n}function U(l={}){let{name:e="default",...t}=l;return new M(e,t)}var f,w,v,I,A,M,D=z(()=>{F();P();k();E();f=null,w=null;try{let l=(O(),S(H));f=l.differentiableSearch,w=l.init}catch{}v=class{data=[];compareFn;constructor(e){this.compareFn=e}push(e){this.data.push(e),this.bubbleUp(this.data.length-1)}pop(){if(this.data.length===0)return;let e=this.data[0],t=this.data.pop();return this.data.length>0&&(this.data[0]=t,this.sinkDown(0)),e}peek(){return this.data[0]}size(){return this.data.length}bubbleUp(e){for(;e>0;){let t=e-1>>1;if(this.compareFn(this.data[e],this.data[t])<0)[this.data[e],this.data[t]]=[this.data[t],this.data[e]],e=t;else break}}sinkDown(e){let t=this.data.length;for(;;){let s=e,n=2*e+1,o=2*e+2;if(n<t&&this.compareFn(this.data[n],this.data[s])<0&&(s=n),o<t&&this.compareFn(this.data[o],this.data[s])<0&&(s=o),s!==e)[this.data[e],this.data[s]]=[this.data[s],this.data[e]],e=s;else break}}},I=class{nodes=new Map;M=b.M_CONNECTIONS;Mmax0=b.M_CONNECTIONS*2;efConstruction=b.EF_CONSTRUCTION;efSearch=b.EF_SEARCH;mL=1/Math.log(b.M_CONNECTIONS);maxLevel=16;entryPoint=null;currentMaxLevel=-1;randomLevel(){return Math.min(Math.floor(-Math.log(N())*this.mL),this.maxLevel)}similarity(e,t){let s=this.nodes.get(t);return s?p(e,s.embedding):-1}searchLayer(e,t,s){let n=t,o=this.similarity(e,n),r=!0;for(;r;){r=!1;let a=this.nodes.get(n);if(!a)break;let h=a.neighbors.get(s)??[];for(let d of h){if(!this.nodes.has(d))continue;let i=this.similarity(e,d);i>o&&(n=d,o=i,r=!0)}}return n}searchLayerBeam(e,t,s,n){let o=new Set(t),r=t.filter(i=>this.nodes.has(i)).map(i=>({id:i,score:this.similarity(e,i)})),a=new v((i,c)=>c.score-i.score),h=new v((i,c)=>i.score-c.score);for(let i of r)a.push(i),h.push(i);for(;a.size()>0;){let i=a.pop();if(h.size()>=n&&i.score<h.peek().score)break;let c=this.nodes.get(i.id);if(!c)continue;let u=c.neighbors.get(s)??[];for(let m of u){if(o.has(m)||(o.add(m),!this.nodes.has(m)))continue;let g=this.similarity(e,m),y=h.size()>=n?h.peek().score:-1/0;if(h.size()<n||g>y){let L={id:m,score:g};a.push(L),h.push(L),h.size()>n&&h.pop()}}}let d=[];for(;h.size()>0;)d.push(h.pop());return d.reverse(),d}selectNeighbors(e,t,s){return t.sort((n,o)=>o.score-n.score).slice(0,s).map(n=>n.id)}getMaxConnections(e){return e===0?this.Mmax0:this.M}add(e,t){this.nodes.has(e)&&this.remove(e);let s=this.randomLevel(),n={id:e,embedding:t,neighbors:new Map};for(let r=0;r<=s;r++)n.neighbors.set(r,[]);if(this.nodes.set(e,n),this.entryPoint===null){this.entryPoint=e,this.currentMaxLevel=s;return}let o=this.entryPoint;for(let r=this.currentMaxLevel;r>s;r--)o=this.searchLayer(t,o,r);for(let r=Math.min(s,this.currentMaxLevel);r>=0;r--){let a=this.getMaxConnections(r),h=this.searchLayerBeam(t,[o],r,this.efConstruction),d=this.selectNeighbors(t,h,a);n.neighbors.set(r,[...d]);for(let i of d){let c=this.nodes.get(i);if(!c)continue;let u=c.neighbors.get(r)??[];if(u.push(e),u.length>a){let m=u.filter(g=>this.nodes.has(g)).map(g=>({id:g,score:p(c.embedding,this.nodes.get(g).embedding)}));m.sort((g,y)=>y.score-g.score),c.neighbors.set(r,m.slice(0,a).map(g=>g.id))}else c.neighbors.set(r,u)}h.length>0&&(o=h[0].id)}s>this.currentMaxLevel&&(this.entryPoint=e,this.currentMaxLevel=s)}remove(e){let t=this.nodes.get(e);if(!t)return!1;for(let[s,n]of t.neighbors.entries())for(let o of n){let r=this.nodes.get(o);if(!r)continue;let a=r.neighbors.get(s);if(!a)continue;let h=a.indexOf(e);h!==-1&&a.splice(h,1);let d=this.getMaxConnections(s);if(a.length<d){for(let i of n)if(i!==o&&i!==e&&this.nodes.has(i)&&!a.includes(i)){a.push(i);let c=this.nodes.get(i);if(c){let u=c.neighbors.get(s)??[];!u.includes(o)&&u.length<d&&(u.push(o),c.neighbors.set(s,u))}if(a.length>=d)break}}r.neighbors.set(s,a)}if(this.nodes.delete(e),this.entryPoint===e)if(this.nodes.size===0)this.entryPoint=null,this.currentMaxLevel=-1;else{let s=null,n=-1;for(let[o,r]of this.nodes.entries()){let a=-1;for(let h of r.neighbors.keys())h>a&&(a=h);a>n&&(n=a,s=o)}this.entryPoint=s,this.currentMaxLevel=n}return!0}search(e,t){if(this.nodes.size===0||this.entryPoint===null)return[];if(this.nodes.size===1){let r=this.nodes.get(this.entryPoint);return[{id:r.id,score:p(e,r.embedding)}]}let s=this.entryPoint;for(let r=this.currentMaxLevel;r>0;r--)s=this.searchLayer(e,s,r);let n=Math.max(this.efSearch,t);return this.searchLayerBeam(e,[s],0,n).slice(0,t)}size(){return this.nodes.size}clear(){this.nodes.clear(),this.entryPoint=null,this.currentMaxLevel=-1}};A=class{ids=[];vectors=[];norms=[];idToIndex=new Map;initialized=!1;constructor(){if(w&&!this.initialized)try{w(),this.initialized=!0}catch{this.initialized=f!==null}}add(e,t){let s=new Float32Array(t),n=x(s);if(this.idToIndex.has(e)){let r=this.idToIndex.get(e);this.vectors[r]=s,this.norms[r]=n;return}let o=this.ids.length;this.ids.push(e),this.vectors.push(s),this.norms.push(n),this.idToIndex.set(e,o)}search(e,t){if(this.ids.length===0)return[];let s=Math.min(t,this.ids.length),n=this.vectors.length>0?this.vectors[0].length:0,o=e.length,r=n===o;if(f&&this.vectors.length>0&&r){let i=new Float32Array(e),c=x(i);return f(i,this.vectors,s,1).indices.map(m=>({id:this.ids[m],score:C(i,this.vectors[m],c,this.norms[m])}))}let a=new Float32Array(e),h=x(a),d=[];for(let i=0;i<this.ids.length;i++){let c=this.vectors[i];if(c.length!==a.length){i===0&&console.warn(`[RuvectorFlatIndex] Dimension mismatch: query=${a.length}, stored=${c.length}. Skipping ${this.ids.length} mismatched vectors. Re-index with correct dimensions.`);continue}else d.push({id:this.ids[i],score:C(a,c,h,this.norms[i])})}return d.sort((i,c)=>c.score-i.score),d.slice(0,s)}remove(e){let t=this.idToIndex.get(e);if(t===void 0)return!1;let s=this.ids.length-1;if(t!==s){let n=this.ids[s];this.ids[t]=n,this.vectors[t]=this.vectors[s],this.norms[t]=this.norms[s],this.idToIndex.set(n,t)}return this.ids.pop(),this.vectors.pop(),this.norms.pop(),this.idToIndex.delete(e),!0}clear(){this.ids=[],this.vectors=[],this.norms=[],this.idToIndex.clear()}size(){return this.ids.length}},M=class{adapter;constructor(e,t){this.adapter=T.create(e,t)}add(e,t){this.adapter.addByStringId(e,t)}search(e,t){return this.adapter.searchByArray(e,t)}remove(e){return this.adapter.removeByStringId(e)}clear(){this.adapter.clear()}size(){return this.adapter.size()}recall(){return this.adapter.recall()}getProvider(){return this.adapter}}});export{v as a,I as b,A as c,M as d,U as e,D as f};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import{c as u}from"./chunk-YCK464TF.js";function t(){return{...e}}function o(r){e={...e,...r}}function i(){e={...s}}function a(){return e.useBrowserMode}function E(){return e.useScreenshotCapture}function l(){return e.useVisualRegression}function c(){return e.useE2EExecution}function f(){return e.defaultHeadless}function d(){return e.useAutoRetry}function _(){return e.logPerformanceMetrics}function I(){return e.useAxeCore}function p(){let r={};process.env.VIBIUM_USE_BROWSER_MODE!==void 0&&(r.useBrowserMode=process.env.VIBIUM_USE_BROWSER_MODE==="true"),process.env.VIBIUM_USE_SCREENSHOT_CAPTURE!==void 0&&(r.useScreenshotCapture=process.env.VIBIUM_USE_SCREENSHOT_CAPTURE==="true"),process.env.VIBIUM_USE_VISUAL_REGRESSION!==void 0&&(r.useVisualRegression=process.env.VIBIUM_USE_VISUAL_REGRESSION==="true"),process.env.VIBIUM_USE_E2E_EXECUTION!==void 0&&(r.useE2EExecution=process.env.VIBIUM_USE_E2E_EXECUTION==="true"),process.env.VIBIUM_DEFAULT_HEADLESS!==void 0&&(r.defaultHeadless=process.env.VIBIUM_DEFAULT_HEADLESS==="true"),process.env.VIBIUM_USE_AUTO_RETRY!==void 0&&(r.useAutoRetry=process.env.VIBIUM_USE_AUTO_RETRY==="true"),process.env.VIBIUM_LOG_PERFORMANCE_METRICS!==void 0&&(r.logPerformanceMetrics=process.env.VIBIUM_LOG_PERFORMANCE_METRICS==="true"),process.env.VIBIUM_USE_AXE_CORE!==void 0&&(r.useAxeCore=process.env.VIBIUM_USE_AXE_CORE==="true"),o(r)}function U(){o({defaultHeadless:!0,useAutoRetry:!0,logPerformanceMetrics:!0})}function R(){o({defaultHeadless:!1,logPerformanceMetrics:!0})}function S(){o({useBrowserMode:!1,useScreenshotCapture:!1,useVisualRegression:!1,useE2EExecution:!1,useAxeCore:!1})}var s,e,n=u(()=>{s={useBrowserMode:!0,useScreenshotCapture:!0,useVisualRegression:!0,useE2EExecution:!0,defaultHeadless:!1,useAutoRetry:!0,logPerformanceMetrics:!0,useAxeCore:!0},e={...s}});export{s as a,t as b,o as c,i as d,a as e,E as f,l as g,c as h,f as i,d as j,_ as k,I as l,p as m,U as n,R as o,S as p,n as q};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import{c as u}from"./chunk-BMS7WFDB.js";function t(){return{...e}}function o(r){e={...e,...r}}function i(){e={...s}}function a(){return e.useBrowserMode}function E(){return e.useScreenshotCapture}function l(){return e.useVisualRegression}function c(){return e.useE2EExecution}function f(){return e.defaultHeadless}function d(){return e.useAutoRetry}function _(){return e.logPerformanceMetrics}function I(){return e.useAxeCore}function p(){let r={};process.env.VIBIUM_USE_BROWSER_MODE!==void 0&&(r.useBrowserMode=process.env.VIBIUM_USE_BROWSER_MODE==="true"),process.env.VIBIUM_USE_SCREENSHOT_CAPTURE!==void 0&&(r.useScreenshotCapture=process.env.VIBIUM_USE_SCREENSHOT_CAPTURE==="true"),process.env.VIBIUM_USE_VISUAL_REGRESSION!==void 0&&(r.useVisualRegression=process.env.VIBIUM_USE_VISUAL_REGRESSION==="true"),process.env.VIBIUM_USE_E2E_EXECUTION!==void 0&&(r.useE2EExecution=process.env.VIBIUM_USE_E2E_EXECUTION==="true"),process.env.VIBIUM_DEFAULT_HEADLESS!==void 0&&(r.defaultHeadless=process.env.VIBIUM_DEFAULT_HEADLESS==="true"),process.env.VIBIUM_USE_AUTO_RETRY!==void 0&&(r.useAutoRetry=process.env.VIBIUM_USE_AUTO_RETRY==="true"),process.env.VIBIUM_LOG_PERFORMANCE_METRICS!==void 0&&(r.logPerformanceMetrics=process.env.VIBIUM_LOG_PERFORMANCE_METRICS==="true"),process.env.VIBIUM_USE_AXE_CORE!==void 0&&(r.useAxeCore=process.env.VIBIUM_USE_AXE_CORE==="true"),o(r)}function U(){o({defaultHeadless:!0,useAutoRetry:!0,logPerformanceMetrics:!0})}function R(){o({defaultHeadless:!1,logPerformanceMetrics:!0})}function S(){o({useBrowserMode:!1,useScreenshotCapture:!1,useVisualRegression:!1,useE2EExecution:!1,useAxeCore:!1})}var s,e,n=u(()=>{s={useBrowserMode:!0,useScreenshotCapture:!0,useVisualRegression:!0,useE2EExecution:!0,defaultHeadless:!1,useAutoRetry:!0,logPerformanceMetrics:!0,useAxeCore:!0},e={...s}});export{s as a,t as b,o as c,i as d,a as e,E as f,l as g,c as h,f as i,d as j,_ as k,I as l,p as m,U as n,R as o,S as p,n as q};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import{a as C,b as E}from"./chunk-XJJQZULZ.js";import{a as T}from"./chunk-OU2FFOML.js";import{a as _}from"./chunk-NZIU2SEI.js";import{n as D,o as F}from"./chunk-667A24A4.js";import{a as R,c as A}from"./chunk-LIEKDXTS.js";import{g as O}from"./chunk-YCK464TF.js";import{createHash as M}from"crypto";var $={enabled:!0,maxEntries:500,ttlMs:3600*1e3,persistToDb:!0};function S(o){if(o==null||typeof o!="object")return JSON.stringify(o);if(Array.isArray(o))return"["+o.map(i=>S(i)).join(",")+"]";let e=o;return"{"+Object.keys(e).sort().map(i=>JSON.stringify(i)+":"+S(e[i])).join(",")+"}"}var x=class{cache=new Map;config;hits=0;misses=0;constructor(e){this.config={...$,...e}}computeFingerprint(e,t,r){let i=S({action:t,domain:e,input:r});return M("sha256").update(i).digest("hex").slice(0,16)}get(e){if(!this.config.enabled)return null;let t=this.cache.get(e);return t?Date.now()-t.cachedAt>this.config.ttlMs?(this.cache.delete(e),this.misses++,null):(t.hitCount++,t.lastHitAt=Date.now(),this.hits++,t):(this.misses++,null)}set(e,t,r,i,n){if(!this.config.enabled)return;this.cache.size>=this.config.maxEntries&&this.evictOldest();let s={fingerprint:e,domain:t,action:r,result:i,tokensSaved:n,cachedAt:Date.now(),hitCount:0,lastHitAt:0};this.cache.set(e,s),this.config.persistToDb&&this.persistEntry(s)}loadFromDb(){try{let e=w();if(!e)return;let t=Date.now()-this.config.ttlMs,r=e.prepare(`SELECT key, value FROM kv_store
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import{a as C,b as E}from"./chunk-SL4TAJOE.js";import{a as T}from"./chunk-YEZJE2ZW.js";import{a as _}from"./chunk-ZG4EKPGV.js";import{n as D,o as F}from"./chunk-7MXQV7RB.js";import{a as R,c as A}from"./chunk-K6MFAVXK.js";import{g as O}from"./chunk-BMS7WFDB.js";import{createHash as M}from"crypto";var $={enabled:!0,maxEntries:500,ttlMs:3600*1e3,persistToDb:!0};function S(o){if(o==null||typeof o!="object")return JSON.stringify(o);if(Array.isArray(o))return"["+o.map(i=>S(i)).join(",")+"]";let e=o;return"{"+Object.keys(e).sort().map(i=>JSON.stringify(i)+":"+S(e[i])).join(",")+"}"}var x=class{cache=new Map;config;hits=0;misses=0;constructor(e){this.config={...$,...e}}computeFingerprint(e,t,r){let i=S({action:t,domain:e,input:r});return M("sha256").update(i).digest("hex").slice(0,16)}get(e){if(!this.config.enabled)return null;let t=this.cache.get(e);return t?Date.now()-t.cachedAt>this.config.ttlMs?(this.cache.delete(e),this.misses++,null):(t.hitCount++,t.lastHitAt=Date.now(),this.hits++,t):(this.misses++,null)}set(e,t,r,i,n){if(!this.config.enabled)return;this.cache.size>=this.config.maxEntries&&this.evictOldest();let s={fingerprint:e,domain:t,action:r,result:i,tokensSaved:n,cachedAt:Date.now(),hitCount:0,lastHitAt:0};this.cache.set(e,s),this.config.persistToDb&&this.persistEntry(s)}loadFromDb(){try{let e=w();if(!e)return;let t=Date.now()-this.config.ttlMs,r=e.prepare(`SELECT key, value FROM kv_store
3
3
  WHERE namespace = 'session_cache'
4
4
  AND created_at > ?
5
5
  ORDER BY created_at DESC LIMIT ?`).all(t,this.config.maxEntries);for(let i of r)try{let n=JSON.parse(i.value);Date.now()-n.cachedAt<=this.config.ttlMs&&this.cache.set(n.fingerprint,n)}catch{}}catch{}}getStats(){let e=this.hits+this.misses,t=0;for(let r of this.cache.values())t+=r.tokensSaved*r.hitCount;return{size:this.cache.size,hits:this.hits,misses:this.misses,hitRate:e>0?this.hits/e:0,estimatedTokensSaved:t}}clear(){this.cache.clear(),this.hits=0,this.misses=0}evictOldest(){let e=null,t=1/0;for(let[r,i]of this.cache)i.cachedAt<t&&(t=i.cachedAt,e=r);e&&this.cache.delete(e)}persistEntry(e){try{let t=w();if(!t)return;t.prepare(`INSERT OR REPLACE INTO kv_store (key, namespace, value, created_at)
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import{b as A,d as M}from"./chunk-CZEQFAKE.js";import{a as S,b as D}from"./chunk-BZ4OMPVJ.js";import{S as Q,l as E}from"./chunk-IX5LUHCN.js";import{g as C}from"./chunk-YCK464TF.js";M();Q();var v=(1+Math.sqrt(5))/2,R=1/v;function k(t,e=0){if(t<0||!Number.isFinite(t))throw new Error(`Invalid dither sequence length: ${t}`);if(!Number.isFinite(e))throw new Error(`Invalid dither seed: ${e}`);let n=new Float32Array(t),r=(e*R%1+1)%1;for(let i=0;i<t;i++)n[i]=((r+(i+1)*v)%1+1)%1;return n}function I(t,e,n=0){if(!(t instanceof Float32Array))throw new Error("Input vector must be a Float32Array");if(t.length===0)return{quantized:new Int32Array(0),dequantized:new Float32Array(0),bitDepth:e,seed:n,stepSize:0,minValue:0,maxValue:0};if(e<1||e>32||!Number.isInteger(e))throw new Error(`Invalid bit depth: ${e}. Must be an integer in [1, 32].`);let r=t[0],i=t[0];for(let d=1;d<t.length;d++)t[d]<r&&(r=t[d]),t[d]>i&&(i=t[d]);let s=(1<<e)-1,a=i-r,o=a===0?1:a/s,m=k(t.length,n),l=new Int32Array(t.length),u=new Float32Array(t.length);for(let d=0;d<t.length;d++){if(a===0)l[d]=Math.round(s/2);else{let L=(t[d]-r)/o+(m[d]-.5);l[d]=Math.max(0,Math.min(s,Math.round(L)))}u[d]=l[d]*o+r}return{quantized:l,dequantized:u,bitDepth:e,seed:n,stepSize:o,minValue:r,maxValue:i}}var h=null,b=null,p=null,g=null,f=null,w=null,x=!1;try{let t=(D(),C(S));h=t.RuvectorLayer,b=t.TensorCompress,p=t.differentiableSearch,g=t.hierarchicalForward,f=t.getCompressionLevel,w=t.init,x=!0}catch{}function H(){return x}function c(){if(!x)throw new Error("@ruvector/gnn native module is not available on this platform. Install the appropriate optional dependency for your platform, or use a platform where pre-built binaries are available.")}var F=!1;function V(){if(!F){c();let t=w();return F=!0,t}return"@ruvector/gnn already initialized"}var y=class{indexes;config;nextId;gnnLayers;compressor;constructor(e={}){this.config={M:e.M||16,efConstruction:e.efConstruction||200,efSearch:e.efSearch||50,dimension:e.dimension||384,metric:e.metric||"cosine",quantization:e.quantization||"none"},this.indexes=new Map,this.nextId=new Map,this.gnnLayers=new Map,c(),this.compressor=new b,V()}initializeIndex(e){this.indexes.has(e)||(this.indexes.set(e,new Map),this.nextId.set(e,0))}addEmbedding(e,n){let r=e.namespace;this.indexes.has(r)||this.initializeIndex(r);let i=this.indexes.get(r),s=n??this.nextId.get(r);return n===void 0&&this.nextId.set(r,s+1),i.set(s,e),s}addEmbeddingsBatch(e){let n=[];for(let r of e){let i=this.addEmbedding(r.embedding,r.id);n.push(i)}return n}search(e,n={}){let r=n.namespace||e.namespace;if(!this.indexes.has(r))return[];let i=this.indexes.get(r),s=n.limit||10,a=[];for(let[u,d]of i.entries())a.push({id:u,vector:Array.from(d.vector)});if(a.length===0)return[];let o=new Float32Array(e.vector),m=a.map(u=>new Float32Array(u.vector)),l=p(o,m,Math.min(s,a.length),1);return l.indices.map((u,d)=>({id:a[u]?.id??u,distance:1-l.weights[d]}))}differentiableSearchWithWeights(e,n,r,i=1){let s=new Float32Array(e.vector),a=n.map(m=>new Float32Array(m.embedding.vector)),o=p(s,a,Math.min(r,n.length),i);return{indices:o.indices.map(m=>n[m]?.id??m),weights:o.weights}}hierarchicalForward(e,n,r){let i=r.map(l=>`${l.inputDim}-${l.hiddenDim}`).join(",");if(!this.gnnLayers.has(i)){let l=[];for(let u of r){let d=new h(u.inputDim,u.hiddenDim,u.heads,u.dropout);l.push(d)}this.gnnLayers.set(i,l[0])}let a=this.gnnLayers.get(i).toJson(),o=new Float32Array(e),m=n.map(l=>l.map(u=>new Float32Array(u)));return Array.from(g(o,m,[a]))}compressEmbedding(e,n){let r=f(n),s={none:"none",half:"half",pq8:"pq8",pq4:"pq4",binary:"binary"}[r]??"none",a=new Float32Array(e.vector),o=this.compressor.compress(a,n);return{dimension:Array.from(e.vector).length,level:s,data:o,accessFreq:n}}decompressEmbedding(e){let n=this.compressor.decompress(e.data),r={none:"none",half:"fp16",pq8:"int8",pq4:"int8",binary:"binary"};return{vector:n,dimension:e.dimension,namespace:"code",text:"",timestamp:Date.now(),quantization:r[e.level]??"none"}}getCompressionLevelForFrequency(e){return c(),f(e)}getIndexStats(e){return this.indexes.has(e)?{size:this.indexes.get(e).size,maxElements:1e4,dimension:this.config.dimension,metric:this.config.metric}:null}clearIndex(e){this.indexes.delete(e),this.nextId.delete(e)}clearAll(){this.indexes.clear(),this.nextId.clear()}resizeIndex(e){}setEfSearch(e){this.config.efSearch=e}getConfig(){return{...this.config}}isInitialized(e){return this.indexes.has(e)}getInitializedNamespaces(){return Array.from(this.indexes.keys())}getSize(e){return this.indexes.get(e)?.size??0}async saveIndex(e,n){let r=this.indexes.get(e);if(!r)throw new Error(`Namespace ${e} not initialized`);let i=Array.from(r.entries()).map(([a,o])=>({id:a,vector:Array.from(o.vector),metadata:o.metadata}));await(await import("fs/promises")).writeFile(n,JSON.stringify(i,null,2))}async loadIndex(e,n){let i=await(await import("fs/promises")).readFile(n,"utf-8"),s=A(i);this.initializeIndex(e);for(let a of s){let o={vector:a.vector,dimension:a.vector.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none",metadata:a.metadata};this.addEmbedding(o,a.id)}}},q=class{static instances=new Map;static getInstance(e,n){return this.instances.has(e)||this.instances.set(e,new y(n)),this.instances.get(e)}static closeInstance(e){let n=this.instances.get(e);n&&(n.clearAll(),this.instances.delete(e))}static closeAll(){for(let e of this.instances.values())e.clearAll();this.instances.clear()}},z=class{static layers=new Map;static getLayer(e){let n=`${e.inputDim}-${e.hiddenDim}-${e.heads}-${e.dropout}`;if(!this.layers.has(n)){c();let r=new h(e.inputDim,e.hiddenDim,e.heads,e.dropout);this.layers.set(n,r)}return this.layers.get(n)}static layerFromJson(e){return c(),h.fromJson(e)}static clearCache(){this.layers.clear()}},N=class{static _compressor=null;static get compressor(){return this._compressor||(c(),this._compressor=new b),this._compressor}static compressWithLevel(e,n){let r={levelType:n,scale:1,subvectors:n==="pq8"?8:n==="pq4"?16:void 0,centroids:n==="pq8"?256:void 0,outlierThreshold:n==="pq4"?3:void 0,threshold:n==="binary"?0:void 0},i=e instanceof Float32Array?e:new Float32Array(e);return this.compressor.compressWithLevel(i,r)}static decompress(e){return this.compressor.decompress(e)}static getLevel(e){return c(),f(e)}static compressWithDither(e,n,r){let i=e instanceof Float32Array?e:new Float32Array(e),s;if(E()){let o={none:32,half:16,pq8:8,pq4:4,binary:1},m=r?.bitDepth??o[n]??8,l=r?.seed??0;s=I(i,m,l)}return{compressed:this.compressWithLevel(s?s.dequantized:e,n),ditherResult:s}}};function G(){return c(),h}function J(){return c(),b}function O(){return c(),p}function j(){return c(),g}function B(){return c(),f}function K(){return c(),w}function U(t){return t instanceof Float32Array?t:"vector"in t?t.vector instanceof Float32Array?t.vector:new Float32Array(t.vector):new Float32Array(t)}function X(t){return"vector"in t?Array.from(t.vector):Array.from(t)}function Y(t,e="code"){return{vector:t,dimension:t.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none"}}function Z(t,e,n,r=1){let i=[],s=e.map(a=>a instanceof Float32Array?a:new Float32Array(a));for(let a of t){let o=a instanceof Float32Array?a:new Float32Array(a),m=p(o,s,n,r);i.push({indices:m.indices,weights:m.weights})}return i}export{H as a,V as b,y as c,q as d,z as e,N as f,G as g,J as h,O as i,j,B as k,K as l,U as m,X as n,Y as o,Z as p};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import{b as A,d as M}from"./chunk-WB6TI6Q3.js";import{a as S,b as D}from"./chunk-DMF4Z2M6.js";import{S as Q,l as E}from"./chunk-AKFRM4IO.js";import{g as C}from"./chunk-BMS7WFDB.js";M();Q();var v=(1+Math.sqrt(5))/2,R=1/v;function k(t,e=0){if(t<0||!Number.isFinite(t))throw new Error(`Invalid dither sequence length: ${t}`);if(!Number.isFinite(e))throw new Error(`Invalid dither seed: ${e}`);let n=new Float32Array(t),r=(e*R%1+1)%1;for(let i=0;i<t;i++)n[i]=((r+(i+1)*v)%1+1)%1;return n}function I(t,e,n=0){if(!(t instanceof Float32Array))throw new Error("Input vector must be a Float32Array");if(t.length===0)return{quantized:new Int32Array(0),dequantized:new Float32Array(0),bitDepth:e,seed:n,stepSize:0,minValue:0,maxValue:0};if(e<1||e>32||!Number.isInteger(e))throw new Error(`Invalid bit depth: ${e}. Must be an integer in [1, 32].`);let r=t[0],i=t[0];for(let d=1;d<t.length;d++)t[d]<r&&(r=t[d]),t[d]>i&&(i=t[d]);let s=(1<<e)-1,a=i-r,o=a===0?1:a/s,m=k(t.length,n),l=new Int32Array(t.length),u=new Float32Array(t.length);for(let d=0;d<t.length;d++){if(a===0)l[d]=Math.round(s/2);else{let L=(t[d]-r)/o+(m[d]-.5);l[d]=Math.max(0,Math.min(s,Math.round(L)))}u[d]=l[d]*o+r}return{quantized:l,dequantized:u,bitDepth:e,seed:n,stepSize:o,minValue:r,maxValue:i}}var h=null,b=null,p=null,g=null,f=null,w=null,x=!1;try{let t=(D(),C(S));h=t.RuvectorLayer,b=t.TensorCompress,p=t.differentiableSearch,g=t.hierarchicalForward,f=t.getCompressionLevel,w=t.init,x=!0}catch{}function H(){return x}function c(){if(!x)throw new Error("@ruvector/gnn native module is not available on this platform. Install the appropriate optional dependency for your platform, or use a platform where pre-built binaries are available.")}var F=!1;function V(){if(!F){c();let t=w();return F=!0,t}return"@ruvector/gnn already initialized"}var y=class{indexes;config;nextId;gnnLayers;compressor;constructor(e={}){this.config={M:e.M||16,efConstruction:e.efConstruction||200,efSearch:e.efSearch||50,dimension:e.dimension||384,metric:e.metric||"cosine",quantization:e.quantization||"none"},this.indexes=new Map,this.nextId=new Map,this.gnnLayers=new Map,c(),this.compressor=new b,V()}initializeIndex(e){this.indexes.has(e)||(this.indexes.set(e,new Map),this.nextId.set(e,0))}addEmbedding(e,n){let r=e.namespace;this.indexes.has(r)||this.initializeIndex(r);let i=this.indexes.get(r),s=n??this.nextId.get(r);return n===void 0&&this.nextId.set(r,s+1),i.set(s,e),s}addEmbeddingsBatch(e){let n=[];for(let r of e){let i=this.addEmbedding(r.embedding,r.id);n.push(i)}return n}search(e,n={}){let r=n.namespace||e.namespace;if(!this.indexes.has(r))return[];let i=this.indexes.get(r),s=n.limit||10,a=[];for(let[u,d]of i.entries())a.push({id:u,vector:Array.from(d.vector)});if(a.length===0)return[];let o=new Float32Array(e.vector),m=a.map(u=>new Float32Array(u.vector)),l=p(o,m,Math.min(s,a.length),1);return l.indices.map((u,d)=>({id:a[u]?.id??u,distance:1-l.weights[d]}))}differentiableSearchWithWeights(e,n,r,i=1){let s=new Float32Array(e.vector),a=n.map(m=>new Float32Array(m.embedding.vector)),o=p(s,a,Math.min(r,n.length),i);return{indices:o.indices.map(m=>n[m]?.id??m),weights:o.weights}}hierarchicalForward(e,n,r){let i=r.map(l=>`${l.inputDim}-${l.hiddenDim}`).join(",");if(!this.gnnLayers.has(i)){let l=[];for(let u of r){let d=new h(u.inputDim,u.hiddenDim,u.heads,u.dropout);l.push(d)}this.gnnLayers.set(i,l[0])}let a=this.gnnLayers.get(i).toJson(),o=new Float32Array(e),m=n.map(l=>l.map(u=>new Float32Array(u)));return Array.from(g(o,m,[a]))}compressEmbedding(e,n){let r=f(n),s={none:"none",half:"half",pq8:"pq8",pq4:"pq4",binary:"binary"}[r]??"none",a=new Float32Array(e.vector),o=this.compressor.compress(a,n);return{dimension:Array.from(e.vector).length,level:s,data:o,accessFreq:n}}decompressEmbedding(e){let n=this.compressor.decompress(e.data),r={none:"none",half:"fp16",pq8:"int8",pq4:"int8",binary:"binary"};return{vector:n,dimension:e.dimension,namespace:"code",text:"",timestamp:Date.now(),quantization:r[e.level]??"none"}}getCompressionLevelForFrequency(e){return c(),f(e)}getIndexStats(e){return this.indexes.has(e)?{size:this.indexes.get(e).size,maxElements:1e4,dimension:this.config.dimension,metric:this.config.metric}:null}clearIndex(e){this.indexes.delete(e),this.nextId.delete(e)}clearAll(){this.indexes.clear(),this.nextId.clear()}resizeIndex(e){}setEfSearch(e){this.config.efSearch=e}getConfig(){return{...this.config}}isInitialized(e){return this.indexes.has(e)}getInitializedNamespaces(){return Array.from(this.indexes.keys())}getSize(e){return this.indexes.get(e)?.size??0}async saveIndex(e,n){let r=this.indexes.get(e);if(!r)throw new Error(`Namespace ${e} not initialized`);let i=Array.from(r.entries()).map(([a,o])=>({id:a,vector:Array.from(o.vector),metadata:o.metadata}));await(await import("fs/promises")).writeFile(n,JSON.stringify(i,null,2))}async loadIndex(e,n){let i=await(await import("fs/promises")).readFile(n,"utf-8"),s=A(i);this.initializeIndex(e);for(let a of s){let o={vector:a.vector,dimension:a.vector.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none",metadata:a.metadata};this.addEmbedding(o,a.id)}}},q=class{static instances=new Map;static getInstance(e,n){return this.instances.has(e)||this.instances.set(e,new y(n)),this.instances.get(e)}static closeInstance(e){let n=this.instances.get(e);n&&(n.clearAll(),this.instances.delete(e))}static closeAll(){for(let e of this.instances.values())e.clearAll();this.instances.clear()}},z=class{static layers=new Map;static getLayer(e){let n=`${e.inputDim}-${e.hiddenDim}-${e.heads}-${e.dropout}`;if(!this.layers.has(n)){c();let r=new h(e.inputDim,e.hiddenDim,e.heads,e.dropout);this.layers.set(n,r)}return this.layers.get(n)}static layerFromJson(e){return c(),h.fromJson(e)}static clearCache(){this.layers.clear()}},N=class{static _compressor=null;static get compressor(){return this._compressor||(c(),this._compressor=new b),this._compressor}static compressWithLevel(e,n){let r={levelType:n,scale:1,subvectors:n==="pq8"?8:n==="pq4"?16:void 0,centroids:n==="pq8"?256:void 0,outlierThreshold:n==="pq4"?3:void 0,threshold:n==="binary"?0:void 0},i=e instanceof Float32Array?e:new Float32Array(e);return this.compressor.compressWithLevel(i,r)}static decompress(e){return this.compressor.decompress(e)}static getLevel(e){return c(),f(e)}static compressWithDither(e,n,r){let i=e instanceof Float32Array?e:new Float32Array(e),s;if(E()){let o={none:32,half:16,pq8:8,pq4:4,binary:1},m=r?.bitDepth??o[n]??8,l=r?.seed??0;s=I(i,m,l)}return{compressed:this.compressWithLevel(s?s.dequantized:e,n),ditherResult:s}}};function G(){return c(),h}function J(){return c(),b}function O(){return c(),p}function j(){return c(),g}function B(){return c(),f}function K(){return c(),w}function U(t){return t instanceof Float32Array?t:"vector"in t?t.vector instanceof Float32Array?t.vector:new Float32Array(t.vector):new Float32Array(t)}function X(t){return"vector"in t?Array.from(t.vector):Array.from(t)}function Y(t,e="code"){return{vector:t,dimension:t.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none"}}function Z(t,e,n,r=1){let i=[],s=e.map(a=>a instanceof Float32Array?a:new Float32Array(a));for(let a of t){let o=a instanceof Float32Array?a:new Float32Array(a),m=p(o,s,n,r);i.push({indices:m.indices,weights:m.weights})}return i}export{H as a,V as b,y as c,q as d,z as e,N as f,G as g,J as h,O as i,j,B as k,K as l,U as m,X as n,Y as o,Z as p};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import{c as b,e as v,g as T}from"./chunk-YCK464TF.js";var y={};v(y,{DotProductAttention:()=>z,FlashAttention:()=>k,HyperbolicAttention:()=>W,LinearAttention:()=>j,MoEAttention:()=>K,MultiHeadAttention:()=>F,RuvectorLayer:()=>_,SonaEngine:()=>q,TensorCompress:()=>E,default:()=>O,differentiableSearch:()=>L,getCompressionLevel:()=>B,hierarchicalForward:()=>V,init:()=>D,pipeline:()=>J});import{createRequire as A}from"module";var I,g,O,_,E,L,V,B,D,k,z,F,W,j,K,q,J,S=b(()=>{I=A(import.meta.url),g=I("@ruvector/rvf-node"),O=g,{RuvectorLayer:_,TensorCompress:E,differentiableSearch:L,hierarchicalForward:V,getCompressionLevel:B,init:D,FlashAttention:k,DotProductAttention:z,MultiHeadAttention:F,HyperbolicAttention:W,LinearAttention:j,MoEAttention:K,SonaEngine:q,pipeline:J}=g||{}});var Z={};v(Z,{createRvfStore:()=>Q,isRvfNativeAvailable:()=>Y,openRvfStore:()=>U,openRvfStoreReadonly:()=>X});import{readFileSync as C,writeFileSync as H,copyFileSync as $,existsSync as G}from"fs";function l(){if(R)return f;R=!0;try{let i=(S(),T(y));!i.RvfDatabase&&i.default&&i.default.RvfDatabase&&(i=i.default),f=i}catch{f=null}return f}function w(i){return`${i}.idmap.json`}function N(i){let e=w(i),t=new Map,n=new Map,s=1;if(G(e))try{let r=JSON.parse(C(e,"utf-8"));s=r.nextLabel;for(let[a,m]of r.entries)t.set(a,m),n.set(m,a)}catch{}return{strToNum:t,numToStr:n,nextLabel:s}}function h(i,e,t){let n={nextLabel:t,entries:Array.from(e.entries())};H(w(i),JSON.stringify(n),"utf-8")}function Q(i,e){let t=l();if(!t)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let n=t.RvfDatabase.create(i,{dimension:e}),s=n.dimension();return new d(n,i,s,new Map,new Map,1)}function U(i){let e=l();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.open(i),n=t.dimension(),{strToNum:s,numToStr:r,nextLabel:a}=N(i);return new d(t,i,n,s,r,a)}function X(i){let e=l();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.openReadonly(i),n=t.dimension(),{strToNum:s,numToStr:r,nextLabel:a}=N(i);return new d(t,i,n,s,r,a)}function Y(){return l()!==null}var f,R,d,P=b(()=>{f=null,R=!1;d=class i{db;_path;_dimension;strToNum;numToStr;nextLabel;_open;constructor(e,t,n,s,r,a){this.db=e,this._path=t,this._dimension=n,this.strToNum=s,this.numToStr=r,this.nextLabel=a,this._open=!0}ingest(e){if(this.ensureOpen(),e.length===0)return{accepted:0,rejected:0};let t=this._dimension,n=new Float32Array(e.length*t),s=[],r=[];for(let o=0;o<e.length;o++){let{id:u,vector:p,metadata:x}=e[o],c=this.strToNum.get(u);c===void 0&&(c=this.nextLabel++,this.strToNum.set(u,c),this.numToStr.set(c,u)),s.push(c),r.push(x);let M=p instanceof Float32Array?p:new Float32Array(p);n.set(M.subarray(0,t),o*t)}let a;if(r.some(o=>o!==void 0)&&typeof this.db.ingestBatchWithMetadata=="function"){let o=r.map(u=>u?JSON.stringify(u):"");a=this.db.ingestBatchWithMetadata(n,s,o)}else a=this.db.ingestBatch(n,s);return this.persistIdMap(),{accepted:a.accepted,rejected:a.rejected}}search(e,t){this.ensureOpen();let n=e instanceof Float32Array?e:new Float32Array(e);return this.db.query(n,t).map(r=>{let a=this.numToStr.get(r.id);return a===void 0?null:{id:a,distance:r.distance,score:1/(1+r.distance)}}).filter(r=>r!==null)}delete(e){this.ensureOpen();let t=[];for(let s of e){let r=this.strToNum.get(s);r!==void 0&&t.push(r)}if(t.length===0)return 0;let n=this.db.delete(t);for(let s of e){let r=this.strToNum.get(s);r!==void 0&&(this.strToNum.delete(s),this.numToStr.delete(r))}return this.persistIdMap(),n.deleted}fork(e){this.ensureOpen(),$(this._path,e);let t=new Map(this.strToNum),n=new Map(this.numToStr);h(e,t,this.nextLabel);let r=l().RvfDatabase.open(e);return new i(r,e,this._dimension,t,n,this.nextLabel)}status(){this.ensureOpen();let e=this.db.status(),n=this.db.segments().filter(s=>s.segType==="witness");return{totalVectors:e.totalVectors,totalSegments:e.totalSegments,fileSizeBytes:e.fileSize,epoch:e.currentEpoch,witnessValid:n.length>0,witnessEntries:n.length}}dimension(){return this._dimension}size(){return this.ensureOpen(),this.db.status().totalVectors}compact(){this.ensureOpen(),this.db.compact()}close(){this._open&&(this.db.close(),this._open=!1)}isOpen(){return this._open}path(){return this._path}embedKernel(e){return this.ensureOpen(),this.db.embedKernel(0,99,0,e,0,"")}extractKernel(){return this.ensureOpen(),this.db.extractKernel()}verifyWitness(){this.ensureOpen();let e=this.tryNative("verifyWitness");return e?{valid:e.valid??!0,totalEntries:e.totalEntries??0,errors:Array.isArray(e.errors)?e.errors:[]}:{valid:!0,totalEntries:0,errors:[]}}sign(e){this.ensureOpen();let t=this.tryNative("sign",e);return typeof t=="string"?t:null}fileId(){this.ensureOpen();let e=this.tryNative("fileId");return typeof e=="string"?e:null}parentId(){this.ensureOpen();let e=this.tryNative("parentId");return typeof e=="string"?e:null}lineageDepth(){this.ensureOpen();let e=this.tryNative("lineageDepth");return typeof e=="number"?e:0}indexStats(){let e=this.status();return{totalVectors:e.totalVectors,dimension:this._dimension,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries,idMapSize:this.strToNum.size}}freeze(){this.ensureOpen();let e=this.tryNative("freeze");return typeof e=="number"?e:0}derive(e){this.ensureOpen();let t=l();if(typeof this.db.derive=="function")try{let n=this.db.derive(e),s=new Map(this.strToNum),r=new Map(this.numToStr);return h(e,s,this.nextLabel),new i(n,e,this._dimension,s,r,this.nextLabel)}catch{}return this.fork(e)}ensureOpen(){if(!this._open)throw new Error("RVF database is closed")}tryNative(e,...t){if(typeof this.db[e]!="function")return null;try{return this.db[e](...t)}catch{return null}}persistIdMap(){h(this._path,this.strToNum,this.nextLabel)}}});export{Q as a,U as b,X as c,Y as d,Z as e,P as f};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import{c as b,e as v,g as T}from"./chunk-BMS7WFDB.js";var y={};v(y,{DotProductAttention:()=>z,FlashAttention:()=>k,HyperbolicAttention:()=>W,LinearAttention:()=>j,MoEAttention:()=>K,MultiHeadAttention:()=>F,RuvectorLayer:()=>_,SonaEngine:()=>q,TensorCompress:()=>E,default:()=>O,differentiableSearch:()=>L,getCompressionLevel:()=>B,hierarchicalForward:()=>V,init:()=>D,pipeline:()=>J});import{createRequire as A}from"module";var I,g,O,_,E,L,V,B,D,k,z,F,W,j,K,q,J,S=b(()=>{I=A(import.meta.url),g=I("@ruvector/rvf-node"),O=g,{RuvectorLayer:_,TensorCompress:E,differentiableSearch:L,hierarchicalForward:V,getCompressionLevel:B,init:D,FlashAttention:k,DotProductAttention:z,MultiHeadAttention:F,HyperbolicAttention:W,LinearAttention:j,MoEAttention:K,SonaEngine:q,pipeline:J}=g||{}});var Z={};v(Z,{createRvfStore:()=>Q,isRvfNativeAvailable:()=>Y,openRvfStore:()=>U,openRvfStoreReadonly:()=>X});import{readFileSync as C,writeFileSync as H,copyFileSync as $,existsSync as G}from"fs";function l(){if(R)return f;R=!0;try{let i=(S(),T(y));!i.RvfDatabase&&i.default&&i.default.RvfDatabase&&(i=i.default),f=i}catch{f=null}return f}function w(i){return`${i}.idmap.json`}function N(i){let e=w(i),t=new Map,n=new Map,s=1;if(G(e))try{let r=JSON.parse(C(e,"utf-8"));s=r.nextLabel;for(let[a,m]of r.entries)t.set(a,m),n.set(m,a)}catch{}return{strToNum:t,numToStr:n,nextLabel:s}}function h(i,e,t){let n={nextLabel:t,entries:Array.from(e.entries())};H(w(i),JSON.stringify(n),"utf-8")}function Q(i,e){let t=l();if(!t)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let n=t.RvfDatabase.create(i,{dimension:e}),s=n.dimension();return new d(n,i,s,new Map,new Map,1)}function U(i){let e=l();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.open(i),n=t.dimension(),{strToNum:s,numToStr:r,nextLabel:a}=N(i);return new d(t,i,n,s,r,a)}function X(i){let e=l();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.openReadonly(i),n=t.dimension(),{strToNum:s,numToStr:r,nextLabel:a}=N(i);return new d(t,i,n,s,r,a)}function Y(){return l()!==null}var f,R,d,P=b(()=>{f=null,R=!1;d=class i{db;_path;_dimension;strToNum;numToStr;nextLabel;_open;constructor(e,t,n,s,r,a){this.db=e,this._path=t,this._dimension=n,this.strToNum=s,this.numToStr=r,this.nextLabel=a,this._open=!0}ingest(e){if(this.ensureOpen(),e.length===0)return{accepted:0,rejected:0};let t=this._dimension,n=new Float32Array(e.length*t),s=[],r=[];for(let o=0;o<e.length;o++){let{id:u,vector:p,metadata:x}=e[o],c=this.strToNum.get(u);c===void 0&&(c=this.nextLabel++,this.strToNum.set(u,c),this.numToStr.set(c,u)),s.push(c),r.push(x);let M=p instanceof Float32Array?p:new Float32Array(p);n.set(M.subarray(0,t),o*t)}let a;if(r.some(o=>o!==void 0)&&typeof this.db.ingestBatchWithMetadata=="function"){let o=r.map(u=>u?JSON.stringify(u):"");a=this.db.ingestBatchWithMetadata(n,s,o)}else a=this.db.ingestBatch(n,s);return this.persistIdMap(),{accepted:a.accepted,rejected:a.rejected}}search(e,t){this.ensureOpen();let n=e instanceof Float32Array?e:new Float32Array(e);return this.db.query(n,t).map(r=>{let a=this.numToStr.get(r.id);return a===void 0?null:{id:a,distance:r.distance,score:1/(1+r.distance)}}).filter(r=>r!==null)}delete(e){this.ensureOpen();let t=[];for(let s of e){let r=this.strToNum.get(s);r!==void 0&&t.push(r)}if(t.length===0)return 0;let n=this.db.delete(t);for(let s of e){let r=this.strToNum.get(s);r!==void 0&&(this.strToNum.delete(s),this.numToStr.delete(r))}return this.persistIdMap(),n.deleted}fork(e){this.ensureOpen(),$(this._path,e);let t=new Map(this.strToNum),n=new Map(this.numToStr);h(e,t,this.nextLabel);let r=l().RvfDatabase.open(e);return new i(r,e,this._dimension,t,n,this.nextLabel)}status(){this.ensureOpen();let e=this.db.status(),n=this.db.segments().filter(s=>s.segType==="witness");return{totalVectors:e.totalVectors,totalSegments:e.totalSegments,fileSizeBytes:e.fileSize,epoch:e.currentEpoch,witnessValid:n.length>0,witnessEntries:n.length}}dimension(){return this._dimension}size(){return this.ensureOpen(),this.db.status().totalVectors}compact(){this.ensureOpen(),this.db.compact()}close(){this._open&&(this.db.close(),this._open=!1)}isOpen(){return this._open}path(){return this._path}embedKernel(e){return this.ensureOpen(),this.db.embedKernel(0,99,0,e,0,"")}extractKernel(){return this.ensureOpen(),this.db.extractKernel()}verifyWitness(){this.ensureOpen();let e=this.tryNative("verifyWitness");return e?{valid:e.valid??!0,totalEntries:e.totalEntries??0,errors:Array.isArray(e.errors)?e.errors:[]}:{valid:!0,totalEntries:0,errors:[]}}sign(e){this.ensureOpen();let t=this.tryNative("sign",e);return typeof t=="string"?t:null}fileId(){this.ensureOpen();let e=this.tryNative("fileId");return typeof e=="string"?e:null}parentId(){this.ensureOpen();let e=this.tryNative("parentId");return typeof e=="string"?e:null}lineageDepth(){this.ensureOpen();let e=this.tryNative("lineageDepth");return typeof e=="number"?e:0}indexStats(){let e=this.status();return{totalVectors:e.totalVectors,dimension:this._dimension,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries,idMapSize:this.strToNum.size}}freeze(){this.ensureOpen();let e=this.tryNative("freeze");return typeof e=="number"?e:0}derive(e){this.ensureOpen();let t=l();if(typeof this.db.derive=="function")try{let n=this.db.derive(e),s=new Map(this.strToNum),r=new Map(this.numToStr);return h(e,s,this.nextLabel),new i(n,e,this._dimension,s,r,this.nextLabel)}catch{}return this.fork(e)}ensureOpen(){if(!this._open)throw new Error("RVF database is closed")}tryNative(e,...t){if(typeof this.db[e]!="function")return null;try{return this.db[e](...t)}catch{return null}}persistIdMap(){h(this._path,this.strToNum,this.nextLabel)}}});export{Q as a,U as b,X as c,Y as d,Z as e,P as f};
@@ -1,3 +1,3 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import{c}from"./chunk-YCK464TF.js";function u(r){switch(r.toUpperCase()){case"DEBUG":return 0;case"INFO":return 1;case"WARN":case"WARNING":return 2;case"ERROR":return 3;case"SILENT":case"NONE":case"OFF":return 4;default:return 1}}var f,l=c(()=>{"use strict";f={0:"DEBUG",1:"INFO",2:"WARN",3:"ERROR",4:"SILENT"}});var a,s,g,d=c(()=>{"use strict";l();a={includeTimestamp:!0,includeLevel:!0,timestampFormat:"short",prettyPrint:!1,maxContextDepth:3},s=class r{domain;level;config;inheritedContext;constructor(e,n=1,o={},t={}){this.domain=e,this.level=n,this.config={...a,...o},this.inheritedContext=t}debug(e,n){this.level<=0&&this.output(0,e,n)}info(e,n){this.level<=1&&this.output(1,e,n)}warn(e,n){this.level<=2&&this.output(2,e,n)}error(e,n,o){if(this.level<=3){let t={...o};if(n){t.errorName=n.name,t.errorMessage=n.message,n.stack&&(t.stack=n.stack);let i=n;i.cause!==void 0&&(t.cause=String(i.cause))}this.output(3,e,t)}}isEnabled(e){return this.level<=e}getDomain(){return this.domain}child(e){return new r(this.domain,this.level,this.config,{...this.inheritedContext,...e})}output(e,n,o){let t=this.format(e,n,o);switch(e){case 0:console.debug(t);break;case 1:console.info(t);break;case 2:console.warn(t);break;case 3:console.error(t);break}}format(e,n,o){let t=[];this.config.includeTimestamp&&t.push(this.formatTimestamp()),this.config.includeLevel&&t.push(this.formatLevel(e)),t.push(`[${this.domain}]`),t.push(n);let i=this.mergeContext(o);return i&&Object.keys(i).length>0&&t.push(this.formatContext(i)),t.join(" ")}formatTimestamp(){let e=new Date;if(this.config.timestampFormat==="iso")return`[${e.toISOString()}]`;let n=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),t=String(e.getSeconds()).padStart(2,"0"),i=String(e.getMilliseconds()).padStart(3,"0");return`[${n}:${o}:${t}.${i}]`}formatLevel(e){return`[${f[e].padEnd(5)}]`}mergeContext(e){if(!(!e&&Object.keys(this.inheritedContext).length===0))return{...this.inheritedContext,...e}}formatContext(e){try{return this.config.prettyPrint?`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import{c}from"./chunk-BMS7WFDB.js";function u(r){switch(r.toUpperCase()){case"DEBUG":return 0;case"INFO":return 1;case"WARN":case"WARNING":return 2;case"ERROR":return 3;case"SILENT":case"NONE":case"OFF":return 4;default:return 1}}var f,l=c(()=>{"use strict";f={0:"DEBUG",1:"INFO",2:"WARN",3:"ERROR",4:"SILENT"}});var a,s,g,d=c(()=>{"use strict";l();a={includeTimestamp:!0,includeLevel:!0,timestampFormat:"short",prettyPrint:!1,maxContextDepth:3},s=class r{domain;level;config;inheritedContext;constructor(e,n=1,o={},t={}){this.domain=e,this.level=n,this.config={...a,...o},this.inheritedContext=t}debug(e,n){this.level<=0&&this.output(0,e,n)}info(e,n){this.level<=1&&this.output(1,e,n)}warn(e,n){this.level<=2&&this.output(2,e,n)}error(e,n,o){if(this.level<=3){let t={...o};if(n){t.errorName=n.name,t.errorMessage=n.message,n.stack&&(t.stack=n.stack);let i=n;i.cause!==void 0&&(t.cause=String(i.cause))}this.output(3,e,t)}}isEnabled(e){return this.level<=e}getDomain(){return this.domain}child(e){return new r(this.domain,this.level,this.config,{...this.inheritedContext,...e})}output(e,n,o){let t=this.format(e,n,o);switch(e){case 0:console.debug(t);break;case 1:console.info(t);break;case 2:console.warn(t);break;case 3:console.error(t);break}}format(e,n,o){let t=[];this.config.includeTimestamp&&t.push(this.formatTimestamp()),this.config.includeLevel&&t.push(this.formatLevel(e)),t.push(`[${this.domain}]`),t.push(n);let i=this.mergeContext(o);return i&&Object.keys(i).length>0&&t.push(this.formatContext(i)),t.join(" ")}formatTimestamp(){let e=new Date;if(this.config.timestampFormat==="iso")return`[${e.toISOString()}]`;let n=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),t=String(e.getSeconds()).padStart(2,"0"),i=String(e.getMilliseconds()).padStart(3,"0");return`[${n}:${o}:${t}.${i}]`}formatLevel(e){return`[${f[e].padEnd(5)}]`}mergeContext(e){if(!(!e&&Object.keys(this.inheritedContext).length===0))return{...this.inheritedContext,...e}}formatContext(e){try{return this.config.prettyPrint?`
3
3
  `+JSON.stringify(e,this.createReplacer(),2):JSON.stringify(e,this.createReplacer())}catch{return"[unserializable context]"}}createReplacer(){let e=new WeakSet,n=0;return(o,t)=>{if(typeof t=="object"&&t!==null){if(n>=this.config.maxContextDepth)return"[object]";if(e.has(t))return"[circular]";e.add(t),n++}return t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:typeof t=="bigint"?t.toString():typeof t=="function"?"[function]":typeof t=="symbol"?t.toString():t}}},g=class{domain;constructor(e="null"){this.domain=e}debug(e,n){}info(e,n){}warn(e,n){}error(e,n,o){}isEnabled(e){return!1}getDomain(){return this.domain}child(e){return this}}});function F(r,e){return L.create(r,e)}var v,L,m=c(()=>{"use strict";l();d();v={defaultLevel:1,domainLevels:new Map,consoleConfig:a,silent:!1},L=class{static config={...v};static customProvider=null;static instances=new Map;static setLevel(e){this.config.defaultLevel=e,this.instances.clear()}static setLevelFromString(e){this.setLevel(u(e))}static getLevel(){return this.config.defaultLevel}static setDomainLevel(e,n){this.config.domainLevels.set(e,n),this.instances.delete(e)}static getDomainLevel(e){return this.config.domainLevels.get(e)??this.config.defaultLevel}static clearDomainLevel(e){this.config.domainLevels.delete(e),this.instances.delete(e)}static configure(e){this.config.consoleConfig={...this.config.consoleConfig,...e},this.instances.clear()}static setSilent(e){this.config.silent=e,this.instances.clear()}static isSilent(){return this.config.silent}static setProvider(e){this.customProvider=e,this.instances.clear()}static create(e,n){if(!n&&this.instances.has(e))return this.instances.get(e);let o=this.getDomainLevel(e),t;return this.config.silent?t=new g(e):this.customProvider?t=this.customProvider(e,o,n):t=new s(e,o,this.config.consoleConfig,n),n||this.instances.set(e,t),t}static getLogger(e,n){return this.create(e,n)}static reset(){this.config={defaultLevel:1,domainLevels:new Map,consoleConfig:{...a},silent:!1},this.customProvider=null,this.instances.clear()}static initFromEnv(){let e=process.env.LOG_LEVEL;e&&this.setLevelFromString(e);let n=process.env.LOG_TIMESTAMP;n!==void 0&&this.configure({includeTimestamp:n.toLowerCase()==="true"});let o=process.env.LOG_PRETTY;o!==void 0&&this.configure({prettyPrint:o.toLowerCase()==="true"})}static getStats(){return{cachedLoggers:this.instances.size,domains:Array.from(this.instances.keys()),domainOverrides:this.config.domainLevels.size,currentLevel:this.config.defaultLevel,silent:this.config.silent}}}});export{l as a,d as b,L as c,F as d,m as e};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
2
  import{randomUUID as v}from"crypto";var m={"claude-opus-4-7":{input:5,output:25,provider:"claude"},"claude-sonnet-4-6":{input:3,output:15,provider:"claude"},"claude-haiku-4-5-20251001":{input:1,output:5,provider:"claude"},"claude-opus-4-5-20251101":{input:15,output:75,provider:"claude"},"claude-sonnet-4-20250514":{input:3,output:15,provider:"claude"},"claude-3-5-haiku-20241022":{input:1,output:5,provider:"claude"},"claude-3-opus-20240229":{input:15,output:75,provider:"claude"},"claude-3-sonnet-20240229":{input:3,output:15,provider:"claude"},"claude-3-haiku-20240307":{input:.25,output:1.25,provider:"claude"},"gpt-4o":{input:5,output:15,provider:"openai"},"gpt-4o-mini":{input:.15,output:.6,provider:"openai"},"gpt-4-turbo":{input:10,output:30,provider:"openai"},"gpt-4":{input:30,output:60,provider:"openai"},"gpt-3.5-turbo":{input:.5,output:1.5,provider:"openai"},llama3:{input:0,output:0,provider:"ollama"},"llama3.1":{input:0,output:0,provider:"ollama"},codellama:{input:0,output:0,provider:"ollama"},mistral:{input:0,output:0,provider:"ollama"},mixtral:{input:0,output:0,provider:"ollama"},phi3:{input:0,output:0,provider:"ollama"},qwen2:{input:0,output:0,provider:"ollama"},"anthropic/claude-3.5-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3.5-sonnet:beta":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-opus":{input:15,output:75,provider:"openrouter"},"anthropic/claude-3-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-haiku":{input:.25,output:1.25,provider:"openrouter"},"openai/gpt-4o":{input:5,output:15,provider:"openrouter"},"openai/gpt-4o-mini":{input:.15,output:.6,provider:"openrouter"},"openai/gpt-4-turbo":{input:10,output:30,provider:"openrouter"},"openai/gpt-3.5-turbo":{input:.5,output:1.5,provider:"openrouter"},"google/gemini-pro":{input:.125,output:.375,provider:"openrouter"},"google/gemini-pro-1.5":{input:3.5,output:10.5,provider:"openrouter"},"meta-llama/llama-3.1-70b-instruct":{input:.59,output:.79,provider:"openrouter"},"meta-llama/llama-3.1-8b-instruct":{input:.06,output:.06,provider:"openrouter"},"mistralai/mistral-large":{input:2,output:6,provider:"openrouter"},"mistralai/mixtral-8x7b-instruct":{input:.24,output:.24,provider:"openrouter"},"mistralai/mistral-7b-instruct":{input:.06,output:.06,provider:"openrouter"},"anthropic.claude-opus-4-5-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-opus-4-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-sonnet-4-5-v2:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-sonnet-4-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-5-haiku-v1:0":{input:1,output:5,provider:"bedrock"},"anthropic.claude-3-opus-20240229-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-3-sonnet-20240229-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-haiku-20240307-v1:0":{input:.25,output:1.25,provider:"bedrock"},"anthropic.claude-3-5-sonnet-20241022-v2:0":{input:3,output:15,provider:"bedrock"},"azure/gpt-4o":{input:5,output:15,provider:"azure-openai"},"azure/gpt-4o-mini":{input:.15,output:.6,provider:"azure-openai"},"azure/gpt-4-turbo":{input:10,output:30,provider:"azure-openai"},"azure/gpt-4":{input:30,output:60,provider:"azure-openai"},"azure/gpt-35-turbo":{input:.5,output:1.5,provider:"azure-openai"},"azure/text-embedding-ada-002":{input:.1,output:0,provider:"azure-openai"},"azure/text-embedding-3-small":{input:.02,output:0,provider:"azure-openai"},"azure/text-embedding-3-large":{input:.13,output:0,provider:"azure-openai"},"gemini-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.0-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.5-pro":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-pro-latest":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-flash":{input:.075,output:.3,provider:"gemini"},"gemini-1.5-flash-latest":{input:.075,output:.3,provider:"gemini"},"gemini-2.0-flash-exp":{input:.075,output:.3,provider:"gemini"},"gemini-ultra":{input:7,output:21,provider:"gemini"},"gemini-1.0-ultra":{input:7,output:21,provider:"gemini"},"text-embedding-004":{input:.025,output:0,provider:"gemini"}},d=class c{records=[];alerts=[];maxRecords;alertCheckInterval;constructor(t=1e4){this.maxRecords=t}static calculateCost(t,r){let e=m[t];if(!e)return{inputCost:0,outputCost:0,totalCost:0,currency:"USD"};let i=r.promptTokens/1e6*e.input,o=r.completionTokens/1e6*e.output;return{inputCost:i,outputCost:o,totalCost:i+o,currency:"USD"}}static getCostPerToken(t){let r=m[t];return r?{input:r.input/1e6,output:r.output/1e6}:{input:0,output:0}}recordUsage(t,r,e,i,o){let n=c.calculateCost(r,e),p={timestamp:new Date,provider:t,model:r,usage:e,cost:n,requestId:i,metadata:o};return this.records.push(p),this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords)),this.checkAlerts(),n}getSummary(t){let r=new Date,e=this.getPeriodStart(r,t),i=r,o=this.records.filter(s=>s.timestamp>=e&&s.timestamp<=i),n={claude:0,openai:0,ollama:0,openrouter:0,bedrock:0,"azure-openai":0,gemini:0},p={},u=0,l=0;for(let s of o)u+=s.cost.totalCost,l+=s.usage.totalTokens,n[s.provider]+=s.cost.totalCost,p[s.model]=(p[s.model]||0)+s.cost.totalCost;return{period:t,periodStart:e,periodEnd:i,totalCost:u,byProvider:n,byModel:p,totalTokens:l,totalRequests:o.length}}getCurrentCost(t){return this.getSummary(t).totalCost}getTotalTokens(t){return this.getSummary(t).totalTokens}getUsageByProvider(t,r="all"){let e=this.getPeriodStart(new Date,r),i=this.records.filter(u=>u.provider===t&&u.timestamp>=e),o={},n=0,p=0;for(let u of i)n+=u.cost.totalCost,p+=u.usage.totalTokens,o[u.model]||(o[u.model]={cost:0,tokens:0,requests:0}),o[u.model].cost+=u.cost.totalCost,o[u.model].tokens+=u.usage.totalTokens,o[u.model].requests+=1;return{totalCost:n,totalTokens:p,totalRequests:i.length,models:o}}addAlert(t,r,e){let i=`alert-${Date.now()}-${v().slice(0,12)}`;return this.alerts.push({threshold:t,period:r,onThreshold:e,active:!0}),this.alertCheckInterval||(this.alertCheckInterval=setInterval(()=>this.checkAlerts(),6e4)),i}removeAlert(t){return t>=0&&t<this.alerts.length?(this.alerts.splice(t,1),this.alerts.length===0&&this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0),!0):!1}getRecords(){return[...this.records]}importRecords(t){for(let r of t)r.timestamp=new Date(r.timestamp),this.records.push(r);this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords))}clear(){this.records=[]}getRecentRequests(t=10){return this.records.slice(-t)}estimateCost(t,r,e){return c.calculateCost(t,{promptTokens:r,completionTokens:e,totalTokens:r+e})}wouldExceedLimit(t,r,e,i,o){let n=this.getCurrentCost(o),p=this.estimateCost(t,r,e);return n+p.totalCost>i}dispose(){this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}getPeriodStart(t,r){let e=new Date(t);switch(r){case"minute":e.setSeconds(0,0),e.setMinutes(e.getMinutes()-1);break;case"hour":e.setMinutes(0,0,0),e.setHours(e.getHours()-1);break;case"day":e.setHours(0,0,0,0);break;case"week":e.setHours(0,0,0,0),e.setDate(e.getDate()-7);break;case"month":e.setHours(0,0,0,0),e.setDate(1);break;case"all":return new Date(0)}return e}checkAlerts(){for(let t of this.alerts){if(!t.active)continue;let r=this.getSummary(t.period);if(r.totalCost>=t.threshold){t.active=!1;try{t.onThreshold(r)}catch(e){console.error("Cost alert callback error:",e)}}}}},a;function h(){return a||(a=new d),a}function b(){a&&(a.dispose(),a=void 0)}export{m as a,d as b,h as c,b as d};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- function b(i,t){return{ingest(e){i.ingest(e)},search(e,r){return i.search(e,r).map(s=>({id:s.id,score:s.score}))},delete(e){i.delete(e)},status(){let e=i.status();return{totalVectors:e.totalVectors,dimensions:t,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries}},close(){i.close()}}}function c(i,t){return(i.prepare("SELECT COUNT(*) as cnt FROM sqlite_master WHERE type='table' AND name=?").get(t)?.cnt??0)>0}var d=class{db;config;rvfStore=null;rvfAvailable=!1;constructor(t,e){this.db=t,this.config={...e,dimensions:e.dimensions??384}}async initialize(){if(this.config.mode==="sqlite-only"){this.rvfAvailable=!1;return}try{let t=await import("./rvf-native-adapter-TQLQYN7Y.js");if(!t.isRvfNativeAvailable()){this.rvfAvailable=!1;return}let e;try{e=t.openRvfStore(this.config.rvfPath)}catch{e=t.createRvfStore(this.config.rvfPath,this.config.dimensions)}this.rvfStore=b(e,this.config.dimensions),this.rvfAvailable=!0}catch{this.rvfAvailable=!1}}setRvfStore(t){this.rvfStore=t,this.rvfAvailable=!0}writePattern(t,e){let r={sqliteSuccess:!1,rvfSuccess:!1};try{this.writeSqliteEmbedding(t,e),r.sqliteSuccess=!0}catch{r.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.ingest([{id:t,vector:e instanceof Float32Array?Array.from(e):e}]),r.rvfSuccess=!0}catch{r.rvfSuccess=!1,r.divergence="rvf-write-failed"}return r}deletePattern(t){let e={sqliteSuccess:!1,rvfSuccess:!1};try{this.deleteSqliteEmbedding(t),e.sqliteSuccess=!0}catch{e.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.delete([t]),e.rvfSuccess=!0}catch{e.rvfSuccess=!1,e.divergence="rvf-delete-failed"}return e}search(t,e){if(this.config.mode==="rvf-primary"&&this.rvfAvailable&&this.rvfStore)try{return this.rvfStore.search(t,e)}catch{}return this.searchSqlite(t,e)}getDivergenceReport(){let t={totalChecked:0,divergences:0,details:[]},e=this.getSqliteEmbeddingCount();if(t.totalChecked=e,!this.rvfAvailable||!this.rvfStore)return this.config.mode!=="sqlite-only"&&e>0&&(t.divergences=1,t.details.push({patternId:"*",issue:"count-mismatch"})),t;let s=this.rvfStore.status().totalVectors;return e!==s&&(t.divergences=1,t.details.push({patternId:"*",issue:"count-mismatch"})),t}isPromotionSafe(){return this.getDivergenceReport().divergences===0}status(){let t=this.getSqlitePatternCount(),e=this.getSqliteEmbeddingCount(),r=null;if(this.rvfAvailable&&this.rvfStore)try{r=this.rvfStore.status()}catch{r=null}return{sqlite:{patternCount:t,vectorCount:e},rvf:r,mode:this.config.mode}}close(){if(this.rvfStore){try{this.rvfStore.close()}catch{}this.rvfStore=null,this.rvfAvailable=!1}}shouldWriteRvf(){return(this.config.mode==="dual-write"||this.config.mode==="rvf-primary")&&this.rvfAvailable&&this.rvfStore!==null}writeSqliteEmbedding(t,e){let r=Buffer.from(e instanceof Float32Array?e.buffer:new Float32Array(e).buffer),s=e.length;c(this.db,"qe_pattern_embeddings")&&this.db.prepare(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ function b(i,t){return{ingest(e){i.ingest(e)},search(e,r){return i.search(e,r).map(s=>({id:s.id,score:s.score}))},delete(e){i.delete(e)},status(){let e=i.status();return{totalVectors:e.totalVectors,dimensions:t,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries}},close(){i.close()}}}function c(i,t){return(i.prepare("SELECT COUNT(*) as cnt FROM sqlite_master WHERE type='table' AND name=?").get(t)?.cnt??0)>0}var d=class{db;config;rvfStore=null;rvfAvailable=!1;constructor(t,e){this.db=t,this.config={...e,dimensions:e.dimensions??384}}async initialize(){if(this.config.mode==="sqlite-only"){this.rvfAvailable=!1;return}try{let t=await import("./rvf-native-adapter-4YC5IQUW.js");if(!t.isRvfNativeAvailable()){this.rvfAvailable=!1;return}let e;try{e=t.openRvfStore(this.config.rvfPath)}catch{e=t.createRvfStore(this.config.rvfPath,this.config.dimensions)}this.rvfStore=b(e,this.config.dimensions),this.rvfAvailable=!0}catch{this.rvfAvailable=!1}}setRvfStore(t){this.rvfStore=t,this.rvfAvailable=!0}writePattern(t,e){let r={sqliteSuccess:!1,rvfSuccess:!1};try{this.writeSqliteEmbedding(t,e),r.sqliteSuccess=!0}catch{r.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.ingest([{id:t,vector:e instanceof Float32Array?Array.from(e):e}]),r.rvfSuccess=!0}catch{r.rvfSuccess=!1,r.divergence="rvf-write-failed"}return r}deletePattern(t){let e={sqliteSuccess:!1,rvfSuccess:!1};try{this.deleteSqliteEmbedding(t),e.sqliteSuccess=!0}catch{e.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.delete([t]),e.rvfSuccess=!0}catch{e.rvfSuccess=!1,e.divergence="rvf-delete-failed"}return e}search(t,e){if(this.config.mode==="rvf-primary"&&this.rvfAvailable&&this.rvfStore)try{return this.rvfStore.search(t,e)}catch{}return this.searchSqlite(t,e)}getDivergenceReport(){let t={totalChecked:0,divergences:0,details:[]},e=this.getSqliteEmbeddingCount();if(t.totalChecked=e,!this.rvfAvailable||!this.rvfStore)return this.config.mode!=="sqlite-only"&&e>0&&(t.divergences=1,t.details.push({patternId:"*",issue:"count-mismatch"})),t;let s=this.rvfStore.status().totalVectors;return e!==s&&(t.divergences=1,t.details.push({patternId:"*",issue:"count-mismatch"})),t}isPromotionSafe(){return this.getDivergenceReport().divergences===0}status(){let t=this.getSqlitePatternCount(),e=this.getSqliteEmbeddingCount(),r=null;if(this.rvfAvailable&&this.rvfStore)try{r=this.rvfStore.status()}catch{r=null}return{sqlite:{patternCount:t,vectorCount:e},rvf:r,mode:this.config.mode}}close(){if(this.rvfStore){try{this.rvfStore.close()}catch{}this.rvfStore=null,this.rvfAvailable=!1}}shouldWriteRvf(){return(this.config.mode==="dual-write"||this.config.mode==="rvf-primary")&&this.rvfAvailable&&this.rvfStore!==null}writeSqliteEmbedding(t,e){let r=Buffer.from(e instanceof Float32Array?e.buffer:new Float32Array(e).buffer),s=e.length;c(this.db,"qe_pattern_embeddings")&&this.db.prepare(`
3
3
  INSERT INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model, created_at)
4
4
  VALUES (?, ?, ?, 'all-MiniLM-L6-v2', datetime('now'))
5
5
  ON CONFLICT(pattern_id) DO UPDATE SET