agentic-qe 3.13.10 → 3.13.12

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 (746) hide show
  1. package/.claude/helpers/.helpers-version +1 -1
  2. package/.claude/helpers/auto-memory-hook.mjs +1 -1
  3. package/.claude/helpers/helpers.manifest.json +6 -6
  4. package/.claude/helpers/hook-handler.cjs +30 -0
  5. package/.claude/helpers/intelligence.cjs +121 -10
  6. package/.claude/helpers/statusline.cjs +786 -8
  7. package/.claude/skills/skills-manifest.json +1 -1
  8. package/CHANGELOG.md +78 -0
  9. package/README.md +1 -0
  10. package/assets/skills/skills-manifest.json +1 -1
  11. package/dist/agents/claim-verifier/claim-verifier-service.js +4 -4
  12. package/dist/agents/claim-verifier/index.js +6 -6
  13. package/dist/agents/claim-verifier/verifiers/file-verifier.js +1 -1
  14. package/dist/agents/claim-verifier/verifiers/index.js +3 -3
  15. package/dist/agents/claim-verifier/verifiers/output-verifier.js +1 -1
  16. package/dist/causal-discovery/causal-graph.js +2 -2
  17. package/dist/causal-discovery/discovery-engine.js +2 -2
  18. package/dist/causal-discovery/weight-matrix.js +2 -2
  19. package/dist/cli/bundle.js +5 -5
  20. package/dist/cli/chunks/adapter-FUV6LBJT.js +2 -0
  21. package/dist/cli/chunks/{agent-booster-wasm-AWNQ6KB3.js → agent-booster-wasm-7I7LZFNC.js} +2 -2
  22. package/dist/cli/chunks/{agent-handler-RSHQZHPS.js → agent-handler-QZZT52BH.js} +2 -2
  23. package/dist/cli/chunks/{agent-memory-branch-FU7Y3TQ3.js → agent-memory-branch-MLQS5Y26.js} +2 -2
  24. package/dist/cli/chunks/aqe-learning-engine-QNFNA3J4.js +2 -0
  25. package/dist/cli/chunks/{arena-LOK2WYHC.js → arena-IM4CP6LP.js} +2 -2
  26. package/dist/cli/chunks/{arena-XQOCNKB6.js → arena-WRIY37EJ.js} +4 -4
  27. package/dist/cli/chunks/{audit-6ZS4EAD2.js → audit-BSAQ4EFN.js} +3 -3
  28. package/dist/cli/chunks/base-37W2XIXC.js +2 -0
  29. package/dist/cli/chunks/{better-sqlite3-IMBCIZK3.js → better-sqlite3-X2XZUXWZ.js} +2 -2
  30. package/dist/cli/chunks/{brain-handler-3U6BH4EO.js → brain-handler-TVTTWZGP.js} +3 -3
  31. package/dist/cli/chunks/{branch-enumerator-CJBPVBXM.js → branch-enumerator-NI4Q7DSJ.js} +2 -2
  32. package/dist/cli/chunks/{browser-M4VW3KJY.js → browser-PXBLORUZ.js} +2 -2
  33. package/dist/cli/chunks/browser-workflow-PDIUEK7B.js +2 -0
  34. package/dist/cli/chunks/{chunk-PVGOOKBF.js → chunk-2JAC57JE.js} +1 -1
  35. package/dist/cli/chunks/{chunk-JWV5ZM2S.js → chunk-2VTX4SYW.js} +2 -2
  36. package/dist/cli/chunks/{chunk-IYLSML27.js → chunk-2VY7FL6A.js} +2 -2
  37. package/dist/cli/chunks/{chunk-7QNN4GQU.js → chunk-2W3D5A4R.js} +2 -2
  38. package/dist/cli/chunks/{chunk-OZLMIEJC.js → chunk-33YZGOT6.js} +2 -2
  39. package/dist/cli/chunks/{chunk-WSPEAYPG.js → chunk-3ASVQILY.js} +2 -2
  40. package/dist/cli/chunks/{chunk-YO63NTJV.js → chunk-3XVZHJQT.js} +1 -1
  41. package/dist/cli/chunks/{chunk-H7AACUYS.js → chunk-42AS3HPO.js} +2 -2
  42. package/dist/cli/chunks/{chunk-HEY2ZRL7.js → chunk-44NPKZGI.js} +2 -2
  43. package/dist/cli/chunks/{chunk-PIV3QHGJ.js → chunk-4AITMWFZ.js} +2 -2
  44. package/dist/cli/chunks/{chunk-2SS2SSNZ.js → chunk-4ANJV6I4.js} +3 -3
  45. package/dist/cli/chunks/{chunk-CCAY7Q56.js → chunk-4FVOJBEU.js} +1 -1
  46. package/dist/cli/chunks/{chunk-EZY3DAIX.js → chunk-4M7YZ2X7.js} +4 -4
  47. package/dist/cli/chunks/{chunk-HZIT42TM.js → chunk-4THFPRFM.js} +2 -2
  48. package/dist/cli/chunks/chunk-4YFXF5AQ.js +21 -0
  49. package/dist/cli/chunks/{chunk-PUN3KZ6N.js → chunk-4Z4X2ND4.js} +2 -2
  50. package/dist/cli/chunks/{chunk-4TSLLWE7.js → chunk-52VGZJSD.js} +1 -1
  51. package/dist/cli/chunks/{chunk-NRD76M7A.js → chunk-5E76HULA.js} +2 -2
  52. package/dist/cli/chunks/{chunk-RQTXQ6C7.js → chunk-5PI75QYP.js} +2 -2
  53. package/dist/cli/chunks/{chunk-7BZUNNWC.js → chunk-5PNQNBDZ.js} +1 -1
  54. package/dist/cli/chunks/{chunk-KBJYXZI7.js → chunk-5VSS2RBD.js} +2 -2
  55. package/dist/cli/chunks/{chunk-7QSGUJE2.js → chunk-66OQ7AB3.js} +1 -1
  56. package/dist/cli/chunks/{chunk-WFEHOEYP.js → chunk-6BSZHNOC.js} +1 -1
  57. package/dist/cli/chunks/{chunk-KQVTTP2S.js → chunk-6KI6LAAZ.js} +2 -2
  58. package/dist/cli/chunks/{chunk-NZRKWUBM.js → chunk-6KKVMPPR.js} +2 -2
  59. package/dist/cli/chunks/{chunk-KITVDY4T.js → chunk-7A4WTRWI.js} +1 -1
  60. package/dist/cli/chunks/{chunk-GRTU5QOT.js → chunk-7LATB5IR.js} +2 -2
  61. package/dist/cli/chunks/{chunk-J6H2LUBM.js → chunk-7PCIN7UN.js} +2 -2
  62. package/dist/cli/chunks/{chunk-FBJUNJ2A.js → chunk-7RVLVIAI.js} +1 -1
  63. package/dist/cli/chunks/{chunk-7NDJW2DU.js → chunk-7ZVO7I4Q.js} +1 -1
  64. package/dist/cli/chunks/{chunk-EE55ALFK.js → chunk-A5RWLPVT.js} +2 -2
  65. package/dist/cli/chunks/{chunk-U6YDS37V.js → chunk-AKUDUB3O.js} +2 -2
  66. package/dist/cli/chunks/{chunk-6SM74KJI.js → chunk-AM42ROKZ.js} +1 -1
  67. package/dist/cli/chunks/{chunk-VUCCPPQ6.js → chunk-AN5CGTTJ.js} +2 -2
  68. package/dist/cli/chunks/{chunk-QZOAU2N5.js → chunk-AOOCV56W.js} +1 -1
  69. package/dist/cli/chunks/{chunk-U562TIMO.js → chunk-ASWWBNX2.js} +2 -2
  70. package/dist/cli/chunks/{chunk-C5CP66K5.js → chunk-AYH3DMW2.js} +1 -1
  71. package/dist/cli/chunks/{chunk-U5NKLMF4.js → chunk-BODFJ3DC.js} +2 -2
  72. package/dist/cli/chunks/{chunk-YHAUBZ4H.js → chunk-BZIPYXSW.js} +3 -3
  73. package/dist/cli/chunks/{chunk-JMF3FMAO.js → chunk-DCVFHVPR.js} +2 -2
  74. package/dist/cli/chunks/{chunk-H633BGA7.js → chunk-DFLASG3B.js} +1 -1
  75. package/dist/cli/chunks/{chunk-CPXZC7LF.js → chunk-DGFINXUE.js} +1 -1
  76. package/dist/cli/chunks/{chunk-54RIPGMC.js → chunk-E67ZXRG6.js} +1 -1
  77. package/dist/cli/chunks/{chunk-A233TTUX.js → chunk-EDRPTLAX.js} +1 -1
  78. package/dist/cli/chunks/{chunk-UHSIP4DJ.js → chunk-EG73WYAW.js} +2 -2
  79. package/dist/cli/chunks/{chunk-EKZNA6HW.js → chunk-FI6J3UHJ.js} +1 -1
  80. package/dist/cli/chunks/{chunk-6FIWTBR5.js → chunk-G45AOQDZ.js} +1 -1
  81. package/dist/cli/chunks/{chunk-IR7FZYPO.js → chunk-G6FJHDUG.js} +1 -1
  82. package/dist/cli/chunks/chunk-GEQWCK4F.js +2 -0
  83. package/dist/cli/chunks/{chunk-6L36EHM2.js → chunk-GJJWXRAD.js} +2 -2
  84. package/dist/cli/chunks/{chunk-MMRORLMM.js → chunk-GJUGG6UR.js} +2 -2
  85. package/dist/cli/chunks/{chunk-YC5UJVV3.js → chunk-GMLRIZ4E.js} +1 -1
  86. package/dist/cli/chunks/{chunk-UNXPBIX5.js → chunk-GQLJYTXN.js} +2 -2
  87. package/dist/cli/chunks/{chunk-IJ3HHUSD.js → chunk-H3GAR4SV.js} +2 -2
  88. package/dist/cli/chunks/{chunk-OSWAQX4G.js → chunk-HAJG44BD.js} +2 -2
  89. package/dist/cli/chunks/{chunk-GSN4QIDI.js → chunk-HQWFZQMJ.js} +2 -2
  90. package/dist/cli/chunks/{chunk-JUVW4DOU.js → chunk-HRTSYT4N.js} +2 -2
  91. package/dist/cli/chunks/{chunk-2HMBDTSI.js → chunk-I5SXLV7D.js} +2 -2
  92. package/dist/cli/chunks/{chunk-DR4V75BF.js → chunk-IOJ34SXJ.js} +2 -2
  93. package/dist/cli/chunks/{chunk-JALFKAAD.js → chunk-IPDM3CAK.js} +1 -1
  94. package/dist/cli/chunks/{chunk-NL3KX4NE.js → chunk-IPZEBALY.js} +34 -29
  95. package/dist/cli/chunks/{chunk-PSBQRTNF.js → chunk-IQH2RDN3.js} +5 -5
  96. package/dist/cli/chunks/{chunk-SWZUMHIQ.js → chunk-IT5QIUUA.js} +2 -2
  97. package/dist/cli/chunks/{chunk-2LGQNT6Q.js → chunk-JTYCOFTD.js} +1 -1
  98. package/dist/cli/chunks/{chunk-Q7QKJY6Y.js → chunk-JVFZAJ5N.js} +2 -2
  99. package/dist/cli/chunks/{chunk-F3AHUNWH.js → chunk-KRZYWVS3.js} +2 -2
  100. package/dist/cli/chunks/{chunk-7JK57AI2.js → chunk-KXSUDN46.js} +1 -1
  101. package/dist/cli/chunks/{chunk-EP2HOAEB.js → chunk-KYJBJ56M.js} +2 -2
  102. package/dist/cli/chunks/{chunk-OLETDPH2.js → chunk-L3GBNX7B.js} +2 -2
  103. package/dist/cli/chunks/{chunk-VWZ743HH.js → chunk-LRO74LPA.js} +4 -4
  104. package/dist/cli/chunks/{chunk-FC47FRFI.js → chunk-LXVT6JXO.js} +4 -4
  105. package/dist/cli/chunks/{chunk-7XWFAPPI.js → chunk-M3354CE4.js} +2 -2
  106. package/dist/cli/chunks/{chunk-37GWETSW.js → chunk-M73KM3AZ.js} +2 -2
  107. package/dist/cli/chunks/{chunk-BM5BSYPW.js → chunk-M7CPJW53.js} +2 -2
  108. package/dist/cli/chunks/{chunk-ZAEUW3Q4.js → chunk-MB2KLJ6Q.js} +1 -1
  109. package/dist/cli/chunks/{chunk-QHRMZP6J.js → chunk-MGKH4LCM.js} +1 -1
  110. package/dist/cli/chunks/{chunk-AJQGNQ3W.js → chunk-MLFELTJX.js} +2 -2
  111. package/dist/cli/chunks/{chunk-I3SBXWF2.js → chunk-MLXLGBQZ.js} +1 -1
  112. package/dist/cli/chunks/{chunk-6C5WRBGZ.js → chunk-MYVKTG55.js} +3 -3
  113. package/dist/cli/chunks/{chunk-EJRDL5W5.js → chunk-N4OQ4D4V.js} +2 -2
  114. package/dist/cli/chunks/{chunk-MMA6Q6NF.js → chunk-NDRZZSD5.js} +2 -2
  115. package/dist/cli/chunks/{chunk-HL5RC5YB.js → chunk-NG6A7LCG.js} +1 -1
  116. package/dist/cli/chunks/{chunk-JPDJARGR.js → chunk-NJ3QXJ54.js} +2 -2
  117. package/dist/cli/chunks/{chunk-DZNK4EM7.js → chunk-NJ4YVAG7.js} +3 -3
  118. package/dist/cli/chunks/chunk-NL2SCAGJ.js +12 -0
  119. package/dist/cli/chunks/chunk-NLZUGANH.js +11 -0
  120. package/dist/cli/chunks/{chunk-TIGBPVPZ.js → chunk-NNLZAVFH.js} +1 -1
  121. package/dist/cli/chunks/{chunk-7XCRPSSU.js → chunk-NTALX2YC.js} +2 -2
  122. package/dist/cli/chunks/{chunk-YALYPHSG.js → chunk-O4BWESH5.js} +2 -2
  123. package/dist/cli/chunks/{chunk-C656WHED.js → chunk-OG3DBHIV.js} +2 -2
  124. package/dist/cli/chunks/{chunk-BFX3N7KU.js → chunk-OZ53BIY5.js} +1 -1
  125. package/dist/cli/chunks/{chunk-BB4LWAAH.js → chunk-P6EFKHNI.js} +2 -2
  126. package/dist/cli/chunks/{chunk-2FFCL4BK.js → chunk-PGFCKE4G.js} +3 -3
  127. package/dist/cli/chunks/{chunk-66BUC3JG.js → chunk-PVINNJ4P.js} +2 -2
  128. package/dist/cli/chunks/{chunk-FOWBKCRK.js → chunk-QG5L2JM5.js} +10 -10
  129. package/dist/cli/chunks/{chunk-ATSVI6T4.js → chunk-QM4Z7TQH.js} +1 -1
  130. package/dist/cli/chunks/{chunk-Q26QKZYI.js → chunk-QXO35J6F.js} +2 -2
  131. package/dist/cli/chunks/{chunk-FOPLJRWL.js → chunk-R7LGVJMZ.js} +2 -2
  132. package/dist/cli/chunks/{chunk-PLJ72A3I.js → chunk-RACWX2ZX.js} +2 -2
  133. package/dist/cli/chunks/{chunk-ZH3MVVXO.js → chunk-RP2BRRLX.js} +2 -2
  134. package/dist/cli/chunks/{chunk-T7OS4CB4.js → chunk-RP5VFZJO.js} +2 -2
  135. package/dist/cli/chunks/{chunk-7GZJMPTD.js → chunk-S6WHYOWV.js} +2 -2
  136. package/dist/cli/chunks/{chunk-C5HYQTD7.js → chunk-SCQNISGS.js} +1 -1
  137. package/dist/cli/chunks/chunk-SNC73DWF.js +2 -0
  138. package/dist/cli/chunks/{chunk-WKE2FUCP.js → chunk-SOS37ECY.js} +1 -1
  139. package/dist/cli/chunks/{chunk-BTG5UFMA.js → chunk-SXFSJJZF.js} +2 -2
  140. package/dist/cli/chunks/{chunk-IHNPXNFG.js → chunk-TB2N3CAK.js} +2 -2
  141. package/dist/cli/chunks/chunk-TDVMILKO.js +2 -0
  142. package/dist/cli/chunks/{chunk-RYHOV4E3.js → chunk-TJVTV3HP.js} +2 -2
  143. package/dist/cli/chunks/{chunk-2E35LWYJ.js → chunk-TK5XLF3Z.js} +4 -4
  144. package/dist/cli/chunks/{chunk-NCX4W65B.js → chunk-TWUWLSGQ.js} +6 -6
  145. package/dist/cli/chunks/{chunk-WIB6KRFJ.js → chunk-U5G6OC2C.js} +2 -2
  146. package/dist/cli/chunks/{chunk-OZO2JUEK.js → chunk-UBOGJHWC.js} +1 -1
  147. package/dist/cli/chunks/{chunk-WK5MKY45.js → chunk-UC4EIULB.js} +13 -13
  148. package/dist/cli/chunks/{chunk-KBOGA4GA.js → chunk-UJUK6T4V.js} +2 -2
  149. package/dist/cli/chunks/chunk-UQ4UCHO7.js +2 -0
  150. package/dist/cli/chunks/{chunk-4PRQMFVO.js → chunk-UWZYXI3R.js} +2 -2
  151. package/dist/cli/chunks/{chunk-GQ6H37RN.js → chunk-VA2ORJB5.js} +2 -2
  152. package/dist/cli/chunks/{chunk-U5WFVIKL.js → chunk-VBHA4SDU.js} +2 -2
  153. package/dist/cli/chunks/{chunk-PGJHCCR6.js → chunk-VD53LBF7.js} +3 -3
  154. package/dist/cli/chunks/{chunk-UHHWEWDA.js → chunk-VNODKACB.js} +2 -2
  155. package/dist/cli/chunks/{chunk-3E3YLEHB.js → chunk-VQCLSX7T.js} +1 -1
  156. package/dist/cli/chunks/{chunk-G7YD3BR3.js → chunk-VQD2ELNL.js} +2 -2
  157. package/dist/cli/chunks/{chunk-RCXC4YGL.js → chunk-VZGP77YU.js} +1 -1
  158. package/dist/cli/chunks/chunk-WA6CSEOX.js +2 -0
  159. package/dist/cli/chunks/{chunk-JGXU5FUZ.js → chunk-WE3VKDMK.js} +3 -3
  160. package/dist/cli/chunks/{chunk-MGJPS2YV.js → chunk-WXU7FAEB.js} +2 -2
  161. package/dist/cli/chunks/{chunk-O5QZB2AP.js → chunk-WYFAPA2G.js} +2 -2
  162. package/dist/cli/chunks/{chunk-MFGKSD44.js → chunk-WYIXNHPF.js} +2 -2
  163. package/dist/cli/chunks/{chunk-2HEHM2KV.js → chunk-X2SZCVDA.js} +2 -2
  164. package/dist/cli/chunks/{chunk-2CLM53W2.js → chunk-X3JNFQW2.js} +2 -2
  165. package/dist/cli/chunks/{chunk-NBUBGYLE.js → chunk-XIKYUBIV.js} +2 -2
  166. package/dist/cli/chunks/{chunk-2FPHM356.js → chunk-XM5I7J5S.js} +2 -2
  167. package/dist/cli/chunks/{chunk-35CHBX6K.js → chunk-XT473WPO.js} +2 -2
  168. package/dist/cli/chunks/{chunk-74QKFILD.js → chunk-YL2GOJF6.js} +2 -2
  169. package/dist/cli/chunks/{chunk-K6SXDKWV.js → chunk-YQOQVSYU.js} +1 -1
  170. package/dist/cli/chunks/{chunk-G427QR5W.js → chunk-Z56BBX77.js} +2 -2
  171. package/dist/cli/chunks/{chunk-LPVHYZAE.js → chunk-Z6DSYLAG.js} +1 -1
  172. package/dist/cli/chunks/{chunk-W3DCBOLL.js → chunk-ZMYV4R32.js} +1 -1
  173. package/dist/cli/chunks/{chunk-UL6PT654.js → chunk-ZSAGRDXA.js} +2 -2
  174. package/dist/cli/chunks/{ci-7QW7234M.js → ci-QAUD62WH.js} +2 -2
  175. package/dist/cli/chunks/{ci-output-WGP4YKPQ.js → ci-output-TZDVTNE7.js} +2 -2
  176. package/dist/cli/chunks/{circuit-breaker-AOHSCJYO.js → circuit-breaker-ZWPHJ7YJ.js} +2 -2
  177. package/dist/cli/chunks/{claude-flow-setup-CIZ3TWR7.js → claude-flow-setup-SCB4EURN.js} +2 -2
  178. package/dist/cli/chunks/client-4W3KWTAU.js +2 -0
  179. package/dist/cli/chunks/{cline-installer-J2QVGPJY.js → cline-installer-EHZLMLXF.js} +2 -2
  180. package/dist/cli/chunks/{code-WH26MFMB.js → code-3N6PBJMK.js} +2 -2
  181. package/dist/cli/chunks/{code-index-extractor-DBOYEFZ4.js → code-index-extractor-6DIKHNRI.js} +2 -2
  182. package/dist/cli/chunks/{codex-installer-MWYVGZC4.js → codex-installer-P7DPQMYL.js} +2 -2
  183. package/dist/cli/chunks/{completions-LNBHGWUS.js → completions-5MKWWCCE.js} +2 -2
  184. package/dist/cli/chunks/{complexity-analyzer-AMYCTQG2.js → complexity-analyzer-TPM4IPEK.js} +2 -2
  185. package/dist/cli/chunks/{continuedev-installer-73EQPP37.js → continuedev-installer-VXODKGVX.js} +2 -2
  186. package/dist/cli/chunks/{copilot-installer-JWSY2272.js → copilot-installer-PVD5O56P.js} +2 -2
  187. package/dist/cli/chunks/core-handlers-BDU2XBLO.js +2 -0
  188. package/dist/cli/chunks/{cost-tracker-XQVIORRZ.js → cost-tracker-JOMZEQF3.js} +2 -2
  189. package/dist/cli/chunks/{coverage-HYGJIQ25.js → coverage-HTXLEV3B.js} +3 -3
  190. package/dist/cli/chunks/cross-domain-router-BPB6IHN4.js +2 -0
  191. package/dist/cli/chunks/{cursor-installer-DNPNJGZM.js → cursor-installer-SHKDTDDZ.js} +2 -2
  192. package/dist/cli/chunks/{daemon-GSOGO6L3.js → daemon-FCFEWVVJ.js} +3 -3
  193. package/dist/cli/chunks/{daemon-6JNNBU33.js → daemon-PN4FEPLE.js} +6 -6
  194. package/dist/cli/chunks/{dag-attention-scheduler-7SGPLKGI.js → dag-attention-scheduler-PLOHU5SR.js} +2 -2
  195. package/dist/cli/chunks/{detect-IXD77HG4.js → detect-F3H4ZEZY.js} +2 -2
  196. package/dist/cli/chunks/{dist-node-ARTYK2HL.js → dist-node-5TC665N6.js} +2 -2
  197. package/dist/cli/chunks/{domain-handler-X4BOFLMY.js → domain-handler-ZIWVFXCU.js} +2 -2
  198. package/dist/cli/chunks/{domain-transfer-7JBEXLFL.js → domain-transfer-7Q5JYMYR.js} +2 -2
  199. package/dist/cli/chunks/dream-WFCZGFDY.js +2 -0
  200. package/dist/cli/chunks/{embed-and-insert-pattern-VSOLKM3Y.js → embed-and-insert-pattern-VESJQSYD.js} +2 -2
  201. package/dist/cli/chunks/{eval-HS2QQW42.js → eval-E2K2T75A.js} +2 -2
  202. package/dist/cli/chunks/{experience-capture-middleware-MWEPZYBT.js → experience-capture-middleware-Z5SE2O53.js} +3 -3
  203. package/dist/cli/chunks/{fast-paths-RONNJ6AC.js → fast-paths-3H52RSUK.js} +2 -2
  204. package/dist/cli/chunks/{feature-flags-4YE5A6XG.js → feature-flags-LUHSMHPS.js} +2 -2
  205. package/dist/cli/chunks/{feature-flags-CLW4K2HN.js → feature-flags-ONIKUZVK.js} +2 -2
  206. package/dist/cli/chunks/{file-discovery-56C2FW4V.js → file-discovery-FLYSYSS4.js} +2 -2
  207. package/dist/cli/chunks/{fleet-KMB6RM3R.js → fleet-6OJUAAKV.js} +3 -3
  208. package/dist/cli/chunks/{gnn-wrapper-R2OMDND4.js → gnn-wrapper-PUL6B7KZ.js} +2 -2
  209. package/dist/cli/chunks/{heartbeat-handler-FP3CIA2V.js → heartbeat-handler-HGHHDUDY.js} +4 -4
  210. package/dist/cli/chunks/heartbeat-scheduler-HWS4SHRM.js +2 -0
  211. package/dist/cli/chunks/hnsw-adapter-7QOBHKRB.js +2 -0
  212. package/dist/cli/chunks/hnsw-index-6WUKYJH7.js +2 -0
  213. package/dist/cli/chunks/{hnsw-legacy-bridge-EQKXBLRX.js → hnsw-legacy-bridge-NDZSNMYX.js} +2 -2
  214. package/dist/cli/chunks/{hnswlib-node-JG3WOXKM.js → hnswlib-node-PISLKSO2.js} +2 -2
  215. package/dist/cli/chunks/{hooks-6QZYELUZ.js → hooks-WYG54MRI.js} +40 -40
  216. package/dist/cli/chunks/hybrid-router-525JTRA5.js +2 -0
  217. package/dist/cli/chunks/{hypergraph-engine-5HGNZFDH.js → hypergraph-engine-EDHKHZZ2.js} +2 -2
  218. package/dist/cli/chunks/{hypergraph-handler-LO2ODOYD.js → hypergraph-handler-OCHZAPPL.js} +3 -3
  219. package/dist/cli/chunks/impact-analyzer-GG6CJEOK.js +2 -0
  220. package/dist/cli/chunks/{init-handler-E346YK6H.js → init-handler-5TCJ672H.js} +6 -6
  221. package/dist/cli/chunks/init-wizard-4VFAOK4Y.js +2 -0
  222. package/dist/cli/chunks/kernel-N3FQGOST.js +2 -0
  223. package/dist/cli/chunks/{kilocode-installer-ZBJNB6N4.js → kilocode-installer-SWUQRCTZ.js} +2 -2
  224. package/dist/cli/chunks/{kiro-installer-3TWFO4QZ.js → kiro-installer-L22EBAM5.js} +2 -2
  225. package/dist/cli/chunks/knowledge-graph-I5QIHB4G.js +2 -0
  226. package/dist/cli/chunks/{learning-3MLFLTM2.js → learning-TQOGG3CR.js} +3 -3
  227. package/dist/cli/chunks/llm-router-F2L4LFT2.js +37 -0
  228. package/dist/cli/chunks/llm-router-service-NCJZYJLG.js +2 -0
  229. package/dist/cli/chunks/{load-P6XC2P74.js → load-A4ZF2KHC.js} +2 -2
  230. package/dist/cli/chunks/load-test-DCJEYIXD.js +2 -0
  231. package/dist/cli/chunks/{mcp-XEND7FPN.js → mcp-T2Z46NNK.js} +2 -2
  232. package/dist/cli/chunks/{memory-HZ2WSMWW.js → memory-PUC3J6XC.js} +5 -5
  233. package/dist/cli/chunks/memory-backend-O6KO2KTX.js +2 -0
  234. package/dist/cli/chunks/memory-handlers-4Z43WEKD.js +2 -0
  235. package/dist/cli/chunks/{multi-model-executor-IYEHZP73.js → multi-model-executor-U5L4FI4O.js} +2 -2
  236. package/dist/cli/chunks/{opencode-installer-GH3VVBM2.js → opencode-installer-UWI6KHYH.js} +2 -2
  237. package/dist/cli/chunks/{orchestrator-GOKIBTQG.js → orchestrator-3BEI7R5D.js} +5 -5
  238. package/dist/cli/chunks/pattern-null-store-5WIJKX2K.js +2 -0
  239. package/dist/cli/chunks/{pattern-usage-recorder-J2X4DD5S.js → pattern-usage-recorder-EGWUI5LU.js} +2 -2
  240. package/dist/cli/chunks/{pipeline-ELINTMVF.js → pipeline-JG6M4RHD.js} +2 -2
  241. package/dist/cli/chunks/{platform-PIPUB3LU.js → platform-F76G6RUI.js} +2 -2
  242. package/dist/cli/chunks/{plugin-DXDNI6ZV.js → plugin-EEGN3PMK.js} +2 -2
  243. package/dist/cli/chunks/{prime-radiant-advanced-wasm-K6WWURGX.js → prime-radiant-advanced-wasm-7KZAINFT.js} +2 -2
  244. package/dist/cli/chunks/protocol-executor-5TPNAZTB.js +2 -0
  245. package/dist/cli/chunks/{protocol-handler-NMO7VI64.js → protocol-handler-UCEHYK2R.js} +2 -2
  246. package/dist/cli/chunks/{prove-4BLOE4SC.js → prove-JSNG75VD.js} +2 -2
  247. package/dist/cli/chunks/provider-manager-3VMOZ6HV.js +2 -0
  248. package/dist/cli/chunks/qe-reasoning-bank-BATV4NTT.js +2 -0
  249. package/dist/cli/chunks/{quality-MYXBP3GX.js → quality-7SRM2HBM.js} +2 -2
  250. package/dist/cli/chunks/{quality-gate-AXPBK3MT.js → quality-gate-A5MPWHST.js} +3 -3
  251. package/dist/cli/chunks/queen-coordinator-EIHGYBUO.js +2 -0
  252. package/dist/cli/chunks/{real-embeddings-4AKAVZIY.js → real-embeddings-ZBF5EQOG.js} +2 -2
  253. package/dist/cli/chunks/{roocode-installer-JE36LP4T.js → roocode-installer-UYQK64BZ.js} +2 -2
  254. package/dist/cli/chunks/router-EMVGY4HU.js +2 -0
  255. package/dist/cli/chunks/routing-feedback-JUP4OFB2.js +2 -0
  256. package/dist/cli/chunks/{routing-handler-LOJUJCVV.js → routing-handler-PY3KPDTH.js} +2 -2
  257. package/dist/cli/chunks/{ruvector-commands-6PNDYF32.js → ruvector-commands-GCAOUTYS.js} +2 -2
  258. package/dist/cli/chunks/{rvf-dual-writer-GSTQPRNA.js → rvf-dual-writer-BUNP4SKD.js} +2 -2
  259. package/dist/cli/chunks/{rvf-migration-adapter-Z2DSEG3E.js → rvf-migration-adapter-VSOAPLMB.js} +2 -2
  260. package/dist/cli/chunks/{rvf-migration-coordinator-XRNODDH4.js → rvf-migration-coordinator-LSWEHAWX.js} +2 -2
  261. package/dist/cli/chunks/rvf-native-adapter-LOC42TQ6.js +2 -0
  262. package/dist/cli/chunks/{rvf-store-integrity-LVEFIUUW.js → rvf-store-integrity-HNDKOM4L.js} +2 -2
  263. package/dist/cli/chunks/safe-db-WQ62IQKV.js +2 -0
  264. package/dist/cli/chunks/schedule-XJRP57TE.js +2 -0
  265. package/dist/cli/chunks/scheduler-EZH5SDIM.js +2 -0
  266. package/dist/cli/chunks/{security-A2FK2DER.js → security-MQ2VB7PY.js} +3 -3
  267. package/dist/cli/chunks/{shared-rvf-adapter-V7IBEGQQ.js → shared-rvf-adapter-TAZEU6QK.js} +2 -2
  268. package/dist/cli/chunks/{shared-rvf-dual-writer-SMGECN2K.js → shared-rvf-dual-writer-B7N6AOCY.js} +2 -2
  269. package/dist/cli/chunks/sqlite-persistence-HPEVCTIB.js +2 -0
  270. package/dist/cli/chunks/status-handler-NZP7DFHE.js +47 -0
  271. package/dist/cli/chunks/{structural-health-6BRP74EW.js → structural-health-ALLUQ4X6.js} +2 -2
  272. package/dist/cli/chunks/{sync-4PDTGP34.js → sync-MM7OCUYD.js} +2 -2
  273. package/dist/cli/chunks/{sync-KI573HOR.js → sync-WJJG5J6V.js} +2 -2
  274. package/dist/cli/chunks/{task-handler-QQGSAK6T.js → task-handler-CAQUEEB4.js} +2 -2
  275. package/dist/cli/chunks/{task-handlers-VUPCDYTI.js → task-handlers-25BJ7D3W.js} +3 -3
  276. package/dist/cli/chunks/{test-CJLXBSRH.js → test-HW7GVGVN.js} +4 -4
  277. package/dist/cli/chunks/{test-scheduling-IKPQPQUB.js → test-scheduling-HTMFJMSP.js} +3 -3
  278. package/dist/cli/chunks/{token-bootstrap-FHLC3SHC.js → token-bootstrap-F2DCLWGW.js} +2 -2
  279. package/dist/cli/chunks/{token-usage-NCXAK7TB.js → token-usage-RJZDMBDP.js} +2 -2
  280. package/dist/cli/chunks/{transformers-SZFBEILB.js → transformers-3YFW3EUO.js} +2 -2
  281. package/dist/cli/chunks/{tree-sitter-wasm-parser-LFGJRML7.js → tree-sitter-wasm-parser-U3PQPIK7.js} +2 -2
  282. package/dist/cli/chunks/{types-NKXH7VTP.js → types-7Q762WDO.js} +2 -2
  283. package/dist/cli/chunks/unified-memory-ATILROKR.js +2 -0
  284. package/dist/cli/chunks/unified-memory-hnsw-XJXAX7DW.js +2 -0
  285. package/dist/cli/chunks/unified-persistence-3TN5PBWE.js +2 -0
  286. package/dist/cli/chunks/{upgrade-PFCFH6M5.js → upgrade-F7MKJWBQ.js} +2 -2
  287. package/dist/cli/chunks/{validate-YEBJRWQM.js → validate-B27AVRA6.js} +2 -2
  288. package/dist/cli/chunks/{validate-swarm-TD2NA6QF.js → validate-swarm-GYZR3GNL.js} +2 -2
  289. package/dist/cli/chunks/{vibium-ACC4GIOT.js → vibium-W4XQMPJP.js} +2 -2
  290. package/dist/cli/chunks/visual-security-VFWRBCNA.js +2 -0
  291. package/dist/cli/chunks/{web-tree-sitter-IWVW5FIE.js → web-tree-sitter-I7CDCFJU.js} +2 -2
  292. package/dist/cli/chunks/{windsurf-installer-5PVGLJ3T.js → windsurf-installer-UYLHFDHU.js} +2 -2
  293. package/dist/cli/chunks/{witness-chain-VZB4LJOJ.js → witness-chain-B66SYZKU.js} +2 -2
  294. package/dist/cli/chunks/witness-chain-JC5LEXRV.js +2 -0
  295. package/dist/cli/chunks/{witness-key-manager-X632AZTN.js → witness-key-manager-U4JPAHVW.js} +2 -2
  296. package/dist/cli/chunks/{workflow-VNAYFUVY.js → workflow-DYMO47FF.js} +4 -4
  297. package/dist/cli/chunks/workflow-orchestrator-TKQUF2KN.js +2 -0
  298. package/dist/cli/chunks/{wrappers-KO3QXNZP.js → wrappers-7S6DQTEA.js} +2 -2
  299. package/dist/cli/commands/daemon.js +3 -3
  300. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +2 -2
  301. package/dist/cli/commands/hooks-handlers/routing-hooks.js +7 -0
  302. package/dist/cli/commands/llm-router.js +35 -6
  303. package/dist/cli/commands/plugin.js +4 -4
  304. package/dist/cli/commands/quality-gate.js +5 -1
  305. package/dist/cli/handlers/status-handler.js +18 -2
  306. package/dist/cli/index.js +1 -1
  307. package/dist/cli/utils/index.js +2 -2
  308. package/dist/context/compaction/index.js +11 -11
  309. package/dist/context/compaction/tier1-microcompact.js +1 -1
  310. package/dist/context/compaction/tier2-session-summary.js +1 -1
  311. package/dist/context/compaction/tier3-llm-compact.js +1 -1
  312. package/dist/context/compaction/tier4-reactive.js +1 -1
  313. package/dist/coordination/claims/index.js +8 -8
  314. package/dist/coordination/consensus/consensus-engine.js +4 -4
  315. package/dist/coordination/consensus/factory.js +4 -4
  316. package/dist/coordination/consensus/index.js +8 -8
  317. package/dist/coordination/consensus/providers/claude-provider.js +1 -1
  318. package/dist/coordination/consensus/providers/gemini-provider.js +1 -1
  319. package/dist/coordination/consensus/providers/index.js +7 -7
  320. package/dist/coordination/consensus/providers/native-learning-provider.js +1 -1
  321. package/dist/coordination/consensus/providers/ollama-provider.js +1 -1
  322. package/dist/coordination/consensus/providers/openai-provider.js +1 -1
  323. package/dist/coordination/consensus/providers/openrouter-provider.js +1 -1
  324. package/dist/coordination/consensus/strategies/index.js +3 -3
  325. package/dist/coordination/cross-domain-router.js +2 -2
  326. package/dist/coordination/dynamic-scaling/dynamic-scaler.js +1 -1
  327. package/dist/coordination/dynamic-scaling/index.js +2 -2
  328. package/dist/coordination/fleet-tiers/index.js +3 -3
  329. package/dist/coordination/fleet-tiers/tier-selector.js +2 -2
  330. package/dist/coordination/handlers/code-intelligence-handlers.js +2 -2
  331. package/dist/coordination/handlers/coverage-collection.js +1 -1
  332. package/dist/coordination/handlers/coverage-handlers.js +3 -3
  333. package/dist/coordination/handlers/index.js +7 -7
  334. package/dist/coordination/handlers/misc-handlers.js +1 -1
  335. package/dist/coordination/handlers/quality-handlers.js +2 -2
  336. package/dist/coordination/handlers/requirements-handlers.js +2 -2
  337. package/dist/coordination/handlers/security-handlers.js +2 -2
  338. package/dist/coordination/handlers/test-execution-handlers.js +1 -1
  339. package/dist/coordination/index.js +20 -20
  340. package/dist/coordination/mincut/dream-integration.js +1 -1
  341. package/dist/coordination/mincut/index.js +14 -14
  342. package/dist/coordination/mincut/mincut-health-monitor.js +2 -2
  343. package/dist/coordination/mincut/mincut-persistence.js +1 -1
  344. package/dist/coordination/mincut/morphogenetic-growth.js +1 -1
  345. package/dist/coordination/mincut/neural-goap.js +1 -1
  346. package/dist/coordination/mincut/queen-integration.js +5 -5
  347. package/dist/coordination/mincut/shared-singleton.js +3 -3
  348. package/dist/coordination/mincut/strange-loop.js +1 -1
  349. package/dist/coordination/mincut/time-crystal.js +8 -8
  350. package/dist/coordination/mixins/consensus-enabled-domain.js +2 -2
  351. package/dist/coordination/mixins/index.js +3 -3
  352. package/dist/coordination/protocol-executor.js +2 -2
  353. package/dist/coordination/protocols/code-intelligence-index.js +4 -4
  354. package/dist/coordination/protocols/defect-investigation.js +2 -2
  355. package/dist/coordination/protocols/morning-sync.js +1 -1
  356. package/dist/coordination/protocols/quality-gate.js +2 -2
  357. package/dist/coordination/queen-coordinator.js +4 -4
  358. package/dist/coordination/queen-task-management.js +1 -1
  359. package/dist/coordination/services/index.js +1 -1
  360. package/dist/coordination/task-executor.js +6 -6
  361. package/dist/domains/chaos-resilience/coordinator.js +6 -6
  362. package/dist/domains/chaos-resilience/index.js +5 -5
  363. package/dist/domains/chaos-resilience/plugin.js +6 -6
  364. package/dist/domains/chaos-resilience/services/chaos-engineer.js +3 -3
  365. package/dist/domains/chaos-resilience/services/index.js +3 -3
  366. package/dist/domains/chaos-resilience/services/load-tester.js +2 -2
  367. package/dist/domains/chaos-resilience/services/performance-profiler.js +2 -2
  368. package/dist/domains/code-intelligence/coordinator-consensus.js +1 -1
  369. package/dist/domains/code-intelligence/coordinator-gnn.js +1 -1
  370. package/dist/domains/code-intelligence/coordinator-hypergraph.js +2 -2
  371. package/dist/domains/code-intelligence/coordinator.js +9 -9
  372. package/dist/domains/code-intelligence/index.js +7 -7
  373. package/dist/domains/code-intelligence/plugin.js +6 -6
  374. package/dist/domains/code-intelligence/services/c4-model/index.js +3 -3
  375. package/dist/domains/code-intelligence/services/impact-analyzer.js +2 -2
  376. package/dist/domains/code-intelligence/services/index.js +6 -6
  377. package/dist/domains/code-intelligence/services/knowledge-graph.js +4 -4
  378. package/dist/domains/code-intelligence/services/metric-collector/loc-counter.js +1 -1
  379. package/dist/domains/code-intelligence/services/metric-collector/test-counter.js +1 -1
  380. package/dist/domains/code-intelligence/services/product-factors-bridge.js +5 -5
  381. package/dist/domains/code-intelligence/services/semantic-analyzer.js +2 -2
  382. package/dist/domains/coverage-analysis/coordinator.js +9 -9
  383. package/dist/domains/coverage-analysis/index.js +10 -10
  384. package/dist/domains/coverage-analysis/plugin.js +4 -4
  385. package/dist/domains/coverage-analysis/services/coverage-analyzer.js +1 -1
  386. package/dist/domains/coverage-analysis/services/gap-detector.js +1 -1
  387. package/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.js +1 -1
  388. package/dist/domains/coverage-analysis/services/index.js +7 -7
  389. package/dist/domains/coverage-analysis/services/risk-scorer.js +1 -1
  390. package/dist/domains/coverage-analysis/services/sublinear-analyzer.js +3 -3
  391. package/dist/domains/defect-intelligence/coordinator.js +5 -5
  392. package/dist/domains/defect-intelligence/index.js +5 -5
  393. package/dist/domains/defect-intelligence/plugin.js +6 -6
  394. package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js +2 -2
  395. package/dist/domains/defect-intelligence/services/defect-predictor.js +4 -4
  396. package/dist/domains/defect-intelligence/services/index.js +4 -4
  397. package/dist/domains/defect-intelligence/services/pattern-learner.js +2 -2
  398. package/dist/domains/defect-intelligence/services/root-cause-analyzer.js +1 -1
  399. package/dist/domains/domain-interface.js +1 -1
  400. package/dist/domains/index.js +14 -14
  401. package/dist/domains/learning-optimization/coordinator.d.ts +3 -0
  402. package/dist/domains/learning-optimization/coordinator.js +6 -0
  403. package/dist/domains/learning-optimization/interfaces.d.ts +2 -0
  404. package/dist/domains/learning-optimization/plugin.d.ts +3 -0
  405. package/dist/domains/learning-optimization/plugin.js +5 -0
  406. package/dist/domains/quality-assessment/coherence/gate-controller.js +2 -2
  407. package/dist/domains/quality-assessment/coherence/lambda-calculator.js +1 -1
  408. package/dist/domains/quality-assessment/coherence/partition-detector.js +1 -1
  409. package/dist/domains/quality-assessment/coordinator-gate-evaluation.js +1 -1
  410. package/dist/domains/quality-assessment/coordinator-reports.js +1 -1
  411. package/dist/domains/quality-assessment/coordinator-rl-integration.js +2 -2
  412. package/dist/domains/quality-assessment/coordinator.js +5 -5
  413. package/dist/domains/quality-assessment/index.js +9 -9
  414. package/dist/domains/quality-assessment/plugin.js +6 -6
  415. package/dist/domains/quality-assessment/services/coherence-gate.js +6 -6
  416. package/dist/domains/quality-assessment/services/deployment-advisor.js +1 -1
  417. package/dist/domains/quality-assessment/services/index.js +4 -4
  418. package/dist/domains/quality-assessment/services/quality-analyzer.js +2 -2
  419. package/dist/domains/quality-assessment/services/quality-gate.js +1 -1
  420. package/dist/domains/requirements-validation/services/product-factors-assessment/analyzers/brutal-honesty-analyzer.js +2 -2
  421. package/dist/domains/requirements-validation/services/product-factors-assessment/analyzers/sfdipot-analyzer.js +2 -2
  422. package/dist/domains/requirements-validation/services/product-factors-assessment/code-intelligence/codebase-analyzer.js +1 -1
  423. package/dist/domains/requirements-validation/services/product-factors-assessment/formatters/gherkin-formatter.js +1 -1
  424. package/dist/domains/requirements-validation/services/product-factors-assessment/formatters/html-formatter.js +2 -2
  425. package/dist/domains/requirements-validation/services/product-factors-assessment/formatters/markdown-formatter.js +1 -1
  426. package/dist/domains/requirements-validation/services/product-factors-assessment/generators/question-generator.js +3 -3
  427. package/dist/domains/requirements-validation/services/product-factors-assessment/generators/test-idea-generator.js +3 -3
  428. package/dist/domains/requirements-validation/services/product-factors-assessment/patterns/domain-registry.js +1 -1
  429. package/dist/domains/requirements-validation/services/product-factors-assessment/patterns/index.js +1 -1
  430. package/dist/domains/requirements-validation/services/product-factors-assessment/skills/skill-integration.js +1 -1
  431. package/dist/domains/security-compliance/coordinator.js +1 -1
  432. package/dist/domains/security-compliance/index.js +1 -1
  433. package/dist/domains/security-compliance/services/compliance-validator.js +1 -1
  434. package/dist/domains/security-compliance/services/scanners/dast-helpers.js +1 -1
  435. package/dist/domains/security-compliance/services/scanners/dast-scanner.js +2 -2
  436. package/dist/domains/security-compliance/services/scanners/dependency-scanner.js +4 -4
  437. package/dist/domains/security-compliance/services/scanners/sast-scanner.js +3 -3
  438. package/dist/domains/security-compliance/services/scanners/scanner-orchestrator.js +2 -2
  439. package/dist/domains/test-execution/coordinator.js +8 -8
  440. package/dist/domains/test-execution/index.js +9 -9
  441. package/dist/domains/test-execution/interfaces.js +1 -1
  442. package/dist/domains/test-execution/plugin.js +3 -3
  443. package/dist/domains/test-execution/services/e2e/adaptive-locator-service.js +1 -1
  444. package/dist/domains/test-execution/services/e2e/assertion-handlers.js +2 -2
  445. package/dist/domains/test-execution/services/e2e/browser-orchestrator.js +3 -3
  446. package/dist/domains/test-execution/services/e2e/e2e-coordinator.js +7 -7
  447. package/dist/domains/test-execution/services/e2e/index.js +10 -10
  448. package/dist/domains/test-execution/services/e2e/step-executors.js +6 -6
  449. package/dist/domains/test-execution/services/e2e/step-retry-handler.js +3 -3
  450. package/dist/domains/test-execution/services/e2e/wait-condition-handler.js +1 -1
  451. package/dist/domains/test-execution/services/e2e-runner.js +6 -6
  452. package/dist/domains/test-execution/services/flaky-detector.js +1 -1
  453. package/dist/domains/test-execution/services/index.js +9 -9
  454. package/dist/domains/test-execution/services/retry-handler.js +1 -1
  455. package/dist/domains/test-execution/services/test-executor.js +1 -1
  456. package/dist/domains/test-execution/services/test-prioritizer.js +3 -3
  457. package/dist/domains/test-execution/services/user-flow-generator.js +3 -3
  458. package/dist/domains/test-execution/test-prioritization-types.js +1 -1
  459. package/dist/domains/test-execution/types/index.js +3 -3
  460. package/dist/domains/test-generation/coordinator.js +5 -5
  461. package/dist/domains/test-generation/factories/index.js +1 -1
  462. package/dist/domains/test-generation/factories/test-generator-factory.js +1 -1
  463. package/dist/domains/test-generation/generators/base-test-generator.js +1 -1
  464. package/dist/domains/test-generation/generators/go-test-generator.js +2 -2
  465. package/dist/domains/test-generation/generators/index.js +13 -13
  466. package/dist/domains/test-generation/generators/jest-vitest-generator.js +1 -1
  467. package/dist/domains/test-generation/generators/junit5-generator.js +2 -2
  468. package/dist/domains/test-generation/generators/kotlin-junit-generator.js +2 -2
  469. package/dist/domains/test-generation/generators/mocha-generator.js +1 -1
  470. package/dist/domains/test-generation/generators/node-test-generator.js +1 -1
  471. package/dist/domains/test-generation/generators/pytest-generator.js +2 -2
  472. package/dist/domains/test-generation/generators/rust-test-generator.js +3 -3
  473. package/dist/domains/test-generation/generators/swift-testing-generator.js +2 -2
  474. package/dist/domains/test-generation/generators/xunit-generator.js +2 -2
  475. package/dist/domains/test-generation/index.js +7 -7
  476. package/dist/domains/test-generation/interfaces/index.js +1 -1
  477. package/dist/domains/test-generation/plugin.js +5 -5
  478. package/dist/domains/test-generation/services/code-transform-integration.js +1 -1
  479. package/dist/domains/test-generation/services/index.js +10 -10
  480. package/dist/domains/test-generation/services/pattern-matcher.js +2 -2
  481. package/dist/domains/test-generation/services/test-generator.js +5 -5
  482. package/dist/domains/visual-accessibility/coordinator.js +1 -1
  483. package/dist/early-exit/early-exit-controller.js +4 -4
  484. package/dist/early-exit/early-exit-decision.js +2 -2
  485. package/dist/early-exit/index.js +5 -5
  486. package/dist/early-exit/quality-signal.js +1 -1
  487. package/dist/early-exit/speculative-executor.js +1 -1
  488. package/dist/index.js +18 -18
  489. package/dist/integrations/agentic-flow/agent-booster/adapter.js +4 -4
  490. package/dist/integrations/agentic-flow/agent-booster/index.js +10 -10
  491. package/dist/integrations/agentic-flow/index.js +6 -6
  492. package/dist/integrations/agentic-flow/metrics/index.js +3 -3
  493. package/dist/integrations/agentic-flow/metrics/metrics-tracker.js +2 -2
  494. package/dist/integrations/agentic-flow/metrics/pattern-updater.js +1 -1
  495. package/dist/integrations/agentic-flow/model-router/budget-enforcer.js +1 -1
  496. package/dist/integrations/agentic-flow/model-router/complexity-analyzer.js +7 -7
  497. package/dist/integrations/agentic-flow/model-router/example.js +1 -1
  498. package/dist/integrations/agentic-flow/model-router/index.js +16 -16
  499. package/dist/integrations/agentic-flow/model-router/router.js +6 -6
  500. package/dist/integrations/agentic-flow/model-router/signal-collector.js +1 -1
  501. package/dist/integrations/agentic-flow/model-router/tier-recommender.js +1 -1
  502. package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.js +11 -6
  503. package/dist/integrations/browser/agent-browser/client.js +4 -4
  504. package/dist/integrations/browser/agent-browser/index.js +4 -4
  505. package/dist/integrations/browser/agent-browser/session-manager.js +1 -1
  506. package/dist/integrations/browser/client-factory.js +3 -3
  507. package/dist/integrations/browser/index.js +8 -8
  508. package/dist/integrations/browser/page-pool.js +1 -1
  509. package/dist/integrations/browser/stealth/index.js +2 -2
  510. package/dist/integrations/browser/stealth/stealth-client.js +3 -3
  511. package/dist/integrations/browser/web-content-fetcher.js +1 -1
  512. package/dist/integrations/coherence/coherence-service.js +2 -2
  513. package/dist/integrations/coherence/engines/category-adapter.js +1 -1
  514. package/dist/integrations/coherence/engines/causal-adapter.js +1 -1
  515. package/dist/integrations/coherence/engines/cohomology-adapter.js +1 -1
  516. package/dist/integrations/coherence/engines/homotopy-adapter.js +1 -1
  517. package/dist/integrations/coherence/engines/index.js +6 -6
  518. package/dist/integrations/coherence/engines/spectral-adapter.js +1 -1
  519. package/dist/integrations/coherence/engines/witness-adapter.js +1 -1
  520. package/dist/integrations/coherence/index.js +7 -7
  521. package/dist/integrations/coherence/threshold-tuner.js +1 -1
  522. package/dist/integrations/coherence/wasm-loader.js +2 -2
  523. package/dist/integrations/rl-suite/algorithms/a2c.js +2 -2
  524. package/dist/integrations/rl-suite/algorithms/actor-critic.js +2 -2
  525. package/dist/integrations/rl-suite/algorithms/ddpg.js +1 -1
  526. package/dist/integrations/rl-suite/algorithms/decision-transformer.js +1 -1
  527. package/dist/integrations/rl-suite/algorithms/dqn.js +2 -2
  528. package/dist/integrations/rl-suite/algorithms/eprop.js +2 -2
  529. package/dist/integrations/rl-suite/algorithms/index.js +10 -10
  530. package/dist/integrations/rl-suite/algorithms/policy-gradient.js +2 -2
  531. package/dist/integrations/rl-suite/algorithms/ppo.js +2 -2
  532. package/dist/integrations/rl-suite/algorithms/q-learning.js +3 -3
  533. package/dist/integrations/rl-suite/algorithms/sarsa.js +2 -2
  534. package/dist/integrations/rl-suite/base-algorithm.js +1 -1
  535. package/dist/integrations/rl-suite/index.js +6 -6
  536. package/dist/integrations/rl-suite/neural/index.js +2 -2
  537. package/dist/integrations/rl-suite/orchestrator.js +11 -11
  538. package/dist/integrations/ruvector/ast-complexity.js +1 -1
  539. package/dist/integrations/ruvector/coverage-router.js +1 -1
  540. package/dist/integrations/ruvector/diff-risk-classifier.js +1 -1
  541. package/dist/integrations/ruvector/graph-boundaries.js +1 -1
  542. package/dist/integrations/ruvector/hypergraph-engine.js +1 -1
  543. package/dist/integrations/ruvector/hypergraph-schema.js +1 -1
  544. package/dist/integrations/ruvector/index.js +52 -52
  545. package/dist/integrations/ruvector/persistent-q-router.js +2 -2
  546. package/dist/integrations/ruvector/q-learning-router.js +1 -1
  547. package/dist/integrations/ruvector/solver-adapter.js +1 -1
  548. package/dist/integrations/ruvector/sona-persistence.d.ts +13 -11
  549. package/dist/integrations/ruvector/sona-persistence.js +1 -1
  550. package/dist/integrations/vibium/client.js +3 -3
  551. package/dist/integrations/vibium/fallback.js +2 -2
  552. package/dist/integrations/vibium/index.js +9 -9
  553. package/dist/kernel/agent-coordinator.js +1 -1
  554. package/dist/kernel/event-bus.js +1 -1
  555. package/dist/kernel/hybrid-backend.js +1 -1
  556. package/dist/kernel/index.js +11 -11
  557. package/dist/kernel/kernel.js +27 -27
  558. package/dist/kernel/memory-factory.js +2 -2
  559. package/dist/kernel/unified-persistence.js +1 -1
  560. package/dist/learning/aqe-learning-engine.d.ts +0 -1
  561. package/dist/learning/aqe-learning-engine.js +2 -36
  562. package/dist/learning/pattern-lifecycle.js +1 -1
  563. package/dist/learning/pattern-routing-guidance.d.ts +16 -0
  564. package/dist/learning/pattern-routing-guidance.js +34 -0
  565. package/dist/learning/qe-reasoning-bank-types.d.ts +2 -0
  566. package/dist/learning/qe-reasoning-bank.js +2 -1
  567. package/dist/learning/real-qe-reasoning-bank.d.ts +2 -0
  568. package/dist/learning/real-qe-reasoning-bank.js +4 -2
  569. package/dist/learning/token-tracker.js +1 -1
  570. package/dist/logging/index.js +1 -1
  571. package/dist/logging/logger-factory.js +1 -1
  572. package/dist/mcp/bundle.js +445 -432
  573. package/dist/mcp/entry.js +1 -1
  574. package/dist/mcp/handlers/agent-handlers.js +2 -2
  575. package/dist/mcp/handlers/core-handlers.js +9 -9
  576. package/dist/mcp/handlers/domain-handler-configs.js +2 -2
  577. package/dist/mcp/handlers/domain-handlers.js +2 -2
  578. package/dist/mcp/handlers/handler-factory.js +3 -3
  579. package/dist/mcp/handlers/index.js +7 -7
  580. package/dist/mcp/handlers/memory-handlers.js +1 -1
  581. package/dist/mcp/handlers/task-handlers.js +3 -3
  582. package/dist/mcp/handlers/team-handlers.js +1 -1
  583. package/dist/mcp/index.js +11 -11
  584. package/dist/mcp/metrics/index.js +1 -1
  585. package/dist/mcp/protocol-server.js +13 -13
  586. package/dist/mcp/security/cve-prevention.js +23 -23
  587. package/dist/mcp/security/index.js +9 -9
  588. package/dist/mcp/security/validators/index.js +6 -6
  589. package/dist/mcp/services/index.js +1 -1
  590. package/dist/mcp/services/task-router.js +1 -1
  591. package/dist/mcp/tool-registry.js +4 -4
  592. package/dist/mcp/tools/base.js +1 -1
  593. package/dist/mcp/tools/code-intelligence/analyze.js +4 -4
  594. package/dist/mcp/tools/code-intelligence/c4.js +6 -6
  595. package/dist/mcp/tools/coverage-analysis/index.js +4 -4
  596. package/dist/mcp/tools/defect-intelligence/predict.js +2 -2
  597. package/dist/mcp/tools/embeddings/embedding.js +2 -2
  598. package/dist/mcp/tools/embeddings/index.js +1 -1
  599. package/dist/mcp/tools/index.js +20 -20
  600. package/dist/mcp/tools/learning-optimization/optimize.d.ts +11 -0
  601. package/dist/mcp/tools/learning-optimization/optimize.js +21 -0
  602. package/dist/mcp/tools/mincut/index.js +2 -2
  603. package/dist/mcp/tools/quality-assessment/evaluate.js +1 -1
  604. package/dist/mcp/tools/quality-assessment/gate.js +5 -2
  605. package/dist/mcp/tools/qx-analysis/analyze.js +5 -5
  606. package/dist/mcp/tools/qx-analysis/heuristics-engine.js +1 -1
  607. package/dist/mcp/tools/qx-analysis/index.js +6 -6
  608. package/dist/mcp/tools/registry.js +25 -25
  609. package/dist/mcp/tools/requirements-validation/quality-criteria.js +1 -1
  610. package/dist/mcp/tools/requirements-validation/validate.js +1 -1
  611. package/dist/mcp/tools/security-compliance/scan.js +1 -1
  612. package/dist/mcp/tools/test-execution/e2e-execute.js +3 -3
  613. package/dist/mcp/tools/test-execution/execute.js +1 -1
  614. package/dist/mcp/tools/test-execution/index.js +2 -2
  615. package/dist/mcp/tools/test-generation/generate.js +3 -3
  616. package/dist/mcp/tools/visual-accessibility/index.js +3 -3
  617. package/dist/plugins/index.js +8 -8
  618. package/dist/plugins/lifecycle.js +5 -5
  619. package/dist/plugins/sources/github.js +1 -1
  620. package/dist/plugins/sources/local.js +1 -1
  621. package/dist/plugins/sources/npm.js +1 -1
  622. package/dist/shared/base-domain-plugin.js +1 -1
  623. package/dist/shared/c4-model/index.js +1 -1
  624. package/dist/shared/embeddings/index.js +4 -4
  625. package/dist/shared/embeddings/nomic-embedder.js +3 -3
  626. package/dist/shared/embeddings/ollama-client.js +1 -1
  627. package/dist/shared/entities/agent.js +1 -1
  628. package/dist/shared/entities/index.js +2 -2
  629. package/dist/shared/events/index.js +1 -1
  630. package/dist/shared/git/index.js +1 -1
  631. package/dist/shared/http/http-client.js +1 -1
  632. package/dist/shared/http/index.js +1 -1
  633. package/dist/shared/index.js +15 -15
  634. package/dist/shared/io/file-reader.js +1 -1
  635. package/dist/shared/io/index.js +1 -1
  636. package/dist/shared/llm/billing-modes.d.ts +5 -0
  637. package/dist/shared/llm/billing-modes.js +42 -3
  638. package/dist/shared/llm/circuit-breaker.js +1 -1
  639. package/dist/shared/llm/index.d.ts +4 -1
  640. package/dist/shared/llm/index.js +15 -11
  641. package/dist/shared/llm/interfaces.d.ts +34 -3
  642. package/dist/shared/llm/interfaces.js +17 -0
  643. package/dist/shared/llm/metrics/cost-metrics.js +2 -2
  644. package/dist/shared/llm/metrics/index.js +2 -2
  645. package/dist/shared/llm/metrics/router-metrics.js +1 -1
  646. package/dist/shared/llm/model-registry.js +1 -1
  647. package/dist/shared/llm/provider-manager.js +24 -17
  648. package/dist/shared/llm/provider-registry.d.ts +135 -0
  649. package/dist/shared/llm/provider-registry.js +227 -0
  650. package/dist/shared/llm/providers/azure-openai.js +2 -2
  651. package/dist/shared/llm/providers/bedrock.js +2 -2
  652. package/dist/shared/llm/providers/claude-code.js +1 -1
  653. package/dist/shared/llm/providers/claude.js +4 -4
  654. package/dist/shared/llm/providers/codex.js +1 -1
  655. package/dist/shared/llm/providers/cognitum.js +1 -1
  656. package/dist/shared/llm/providers/external-cli.d.ts +129 -0
  657. package/dist/shared/llm/providers/external-cli.js +385 -0
  658. package/dist/shared/llm/providers/gemini.js +1 -1
  659. package/dist/shared/llm/providers/index.js +10 -10
  660. package/dist/shared/llm/providers/ollama.js +2 -2
  661. package/dist/shared/llm/providers/openai.js +2 -2
  662. package/dist/shared/llm/providers/openrouter.js +1 -1
  663. package/dist/shared/llm/router/config-store.d.ts +14 -0
  664. package/dist/shared/llm/router/config-store.js +102 -14
  665. package/dist/shared/llm/router/external-provider-config.d.ts +47 -0
  666. package/dist/shared/llm/router/external-provider-config.js +105 -0
  667. package/dist/shared/llm/router/hybrid-router.js +7 -7
  668. package/dist/shared/llm/router/index.js +4 -4
  669. package/dist/shared/llm/router/routing-rules.js +1 -1
  670. package/dist/shared/llm/router/types.d.ts +50 -4
  671. package/dist/shared/llm/router/types.js +10 -0
  672. package/dist/shared/llm/translation/index.js +3 -3
  673. package/dist/shared/llm/translation/message-formatter.js +7 -1
  674. package/dist/shared/llm/translation/prompt-translator.js +2 -2
  675. package/dist/shared/metrics/code-metrics.js +2 -2
  676. package/dist/shared/metrics/index.js +2 -2
  677. package/dist/shared/parsers/index.js +3 -3
  678. package/dist/shared/security/compliance-patterns.js +1 -1
  679. package/dist/shared/security/index.js +8 -8
  680. package/dist/shared/security/osv-client.js +1 -1
  681. package/dist/test-scheduling/index.js +9 -9
  682. package/dist/test-scheduling/phase-scheduler.js +1 -1
  683. package/dist/test-scheduling/pipeline.js +9 -9
  684. package/dist/validation/provider-llm-executor.js +5 -5
  685. package/dist/workers/daemon.js +3 -3
  686. package/dist/workers/index.js +5 -5
  687. package/dist/workers/quality-daemon/index.js +15 -15
  688. package/dist/workers/workers/compliance-checker.js +2 -2
  689. package/dist/workers/workers/coverage-tracker.js +1 -1
  690. package/dist/workers/workers/defect-predictor.js +1 -1
  691. package/dist/workers/workers/flaky-detector.js +1 -1
  692. package/dist/workers/workers/learning-consolidation.js +4 -4
  693. package/dist/workers/workers/performance-baseline.js +1 -1
  694. package/dist/workers/workers/quality-gate.js +1 -1
  695. package/dist/workers/workers/regression-monitor.js +1 -1
  696. package/dist/workers/workers/security-scan.js +1 -1
  697. package/dist/workers/workers/test-health.js +1 -1
  698. package/dist/workflows/browser/index.js +1 -1
  699. package/package.json +8 -3
  700. package/dist/cli/chunks/adapter-6CNMDJVJ.js +0 -2
  701. package/dist/cli/chunks/aqe-learning-engine-JGHHNSFX.js +0 -2
  702. package/dist/cli/chunks/base-ND3KAA2L.js +0 -2
  703. package/dist/cli/chunks/browser-workflow-EBSNGTSH.js +0 -2
  704. package/dist/cli/chunks/chunk-3I5ZTLFY.js +0 -2
  705. package/dist/cli/chunks/chunk-4EWKERKV.js +0 -3
  706. package/dist/cli/chunks/chunk-4NXABNLF.js +0 -2
  707. package/dist/cli/chunks/chunk-A6V5NZCV.js +0 -21
  708. package/dist/cli/chunks/chunk-QR6NVCRT.js +0 -12
  709. package/dist/cli/chunks/chunk-TL5FMEKW.js +0 -2
  710. package/dist/cli/chunks/chunk-XPUPST5T.js +0 -2
  711. package/dist/cli/chunks/client-NEGGUFEM.js +0 -2
  712. package/dist/cli/chunks/core-handlers-Q2XPFYQ5.js +0 -2
  713. package/dist/cli/chunks/cross-domain-router-WNZMUQ3G.js +0 -2
  714. package/dist/cli/chunks/dream-OL5XLAYS.js +0 -2
  715. package/dist/cli/chunks/heartbeat-scheduler-XUAW3I3Q.js +0 -2
  716. package/dist/cli/chunks/hnsw-adapter-EDK2YUZJ.js +0 -2
  717. package/dist/cli/chunks/hnsw-index-RDMT66NM.js +0 -2
  718. package/dist/cli/chunks/hybrid-router-BALMPXND.js +0 -2
  719. package/dist/cli/chunks/impact-analyzer-P6XLP3QX.js +0 -2
  720. package/dist/cli/chunks/init-wizard-HMU5OPKQ.js +0 -2
  721. package/dist/cli/chunks/kernel-HMSENQ6R.js +0 -2
  722. package/dist/cli/chunks/knowledge-graph-G7W72UC5.js +0 -2
  723. package/dist/cli/chunks/llm-router-XCBGZRKA.js +0 -36
  724. package/dist/cli/chunks/llm-router-service-VCM7LAGO.js +0 -2
  725. package/dist/cli/chunks/load-test-H5FATYS2.js +0 -2
  726. package/dist/cli/chunks/memory-backend-OPHD5UCR.js +0 -2
  727. package/dist/cli/chunks/memory-handlers-EA5UFT4G.js +0 -2
  728. package/dist/cli/chunks/pattern-null-store-XJOXEDQO.js +0 -2
  729. package/dist/cli/chunks/protocol-executor-XVN7GTLL.js +0 -2
  730. package/dist/cli/chunks/provider-manager-NQICCJZZ.js +0 -2
  731. package/dist/cli/chunks/qe-reasoning-bank-SVCH233Z.js +0 -2
  732. package/dist/cli/chunks/queen-coordinator-Z3PBE4EH.js +0 -2
  733. package/dist/cli/chunks/router-HMWZW2SF.js +0 -2
  734. package/dist/cli/chunks/routing-feedback-ZZYHE2CL.js +0 -2
  735. package/dist/cli/chunks/rvf-native-adapter-ZPT4RLBE.js +0 -2
  736. package/dist/cli/chunks/safe-db-VMYUKPV6.js +0 -2
  737. package/dist/cli/chunks/schedule-DOQ4X4MH.js +0 -2
  738. package/dist/cli/chunks/scheduler-FE2DH224.js +0 -2
  739. package/dist/cli/chunks/sqlite-persistence-TKCACSFQ.js +0 -2
  740. package/dist/cli/chunks/status-handler-UHY36LOR.js +0 -47
  741. package/dist/cli/chunks/unified-memory-2PA3CIQT.js +0 -2
  742. package/dist/cli/chunks/unified-memory-hnsw-W43H4ZKY.js +0 -2
  743. package/dist/cli/chunks/unified-persistence-SOW7AAZL.js +0 -2
  744. package/dist/cli/chunks/visual-security-R6BVIOYU.js +0 -2
  745. package/dist/cli/chunks/witness-chain-GSJW7VDF.js +0 -2
  746. package/dist/cli/chunks/workflow-orchestrator-TXEMI5DD.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.13.10");process.exit(0)}
2
- import{a as n}from"./chunk-SWZUMHIQ.js";import{a as o}from"./chunk-2FPHM356.js";import{a,e as c}from"./chunk-WIB6KRFJ.js";c();var M=a.CLEANUP_INTERVAL_MS,y=".agentic-qe/memory.db";async function d(r,t=!0){let e;switch(r.type){case"memory":e=new o;break;case"sqlite":e=new n({sqlite:r.sqlite,enableFallback:!0});break;case"agentdb":e=new n({sqlite:{path:r.agentdb?.path??y},enableFallback:!0});break;case"hybrid":e=new n(r.hybrid);break;default:throw new Error(`Unknown memory backend type: ${r.type}`)}return t&&await e.initialize(),{backend:e,type:r.type,initialized:t}}async function u(r=!0){let t=process.env.AQE_MEMORY_BACKEND??"memory",e=process.env.AQE_MEMORY_PATH??".agentic-qe",i={type:t,sqlite:{path:`${e}/memory.db`,walMode:!0},agentdb:{path:`${e}/memory.db`},hybrid:{enableFallback:!0,sqlite:{path:`${e}/memory.db`}}};return d(i,r)}export{d as a,u as b};
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.13.12");process.exit(0)}
2
+ import{a as n}from"./chunk-IT5QIUUA.js";import{a as o}from"./chunk-XM5I7J5S.js";import{a,e as c}from"./chunk-U5G6OC2C.js";c();var M=a.CLEANUP_INTERVAL_MS,y=".agentic-qe/memory.db";async function d(r,t=!0){let e;switch(r.type){case"memory":e=new o;break;case"sqlite":e=new n({sqlite:r.sqlite,enableFallback:!0});break;case"agentdb":e=new n({sqlite:{path:r.agentdb?.path??y},enableFallback:!0});break;case"hybrid":e=new n(r.hybrid);break;default:throw new Error(`Unknown memory backend type: ${r.type}`)}return t&&await e.initialize(),{backend:e,type:r.type,initialized:t}}async function u(r=!0){let t=process.env.AQE_MEMORY_BACKEND??"memory",e=process.env.AQE_MEMORY_PATH??".agentic-qe",i={type:t,sqlite:{path:`${e}/memory.db`,walMode:!0},agentdb:{path:`${e}/memory.db`},hybrid:{enableFallback:!0,sqlite:{path:`${e}/memory.db`}}};return d(i,r)}export{d as a,u as b};
@@ -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.13.10");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.13.12");process.exit(0)}
2
2
  function r(e,f){if(e==null)return e;let n={...e};for(let t of f){let o=n[t];typeof o=="string"&&(n[t]=new Date(o))}return n}export{r as a};
@@ -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.13.10");process.exit(0)}
2
- import{a as N,d as P}from"./chunk-PUN3KZ6N.js";import{b,e as k}from"./chunk-WIB6KRFJ.js";import{a as p,d as F}from"./chunk-Q7QKJY6Y.js";import{a as T,b as E}from"./chunk-JWV5ZM2S.js";import{a as H,b as O}from"./chunk-EJRDL5W5.js";import{c as z,g as S}from"./chunk-W3DCBOLL.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.13.12");process.exit(0)}
2
+ import{a as N,d as P}from"./chunk-4Z4X2ND4.js";import{b,e as k}from"./chunk-U5G6OC2C.js";import{a as p,d as F}from"./chunk-JVFZAJ5N.js";import{a as T,b as E}from"./chunk-2VTX4SYW.js";import{a as H,b as O}from"./chunk-N4OQ4D4V.js";import{c as z,g as S}from"./chunk-ZMYV4R32.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.13.10");process.exit(0)}
2
- import{i as K,m as ot}from"./chunk-37GWETSW.js";import{a as rt}from"./chunk-TL5FMEKW.js";import{c as U}from"./chunk-DR4V75BF.js";import{a as j,c as et}from"./chunk-OLETDPH2.js";import{a as G,d as at}from"./chunk-PUN3KZ6N.js";import{a as nt,b as it}from"./chunk-EJRDL5W5.js";import{c as H,e as V,g as w}from"./chunk-W3DCBOLL.js";var Z={};V(Z,{DotProductAttention:()=>yt,FlashAttention:()=>ft,HyperbolicAttention:()=>At,LinearAttention:()=>vt,MoEAttention:()=>Et,MultiHeadAttention:()=>bt,RuvectorLayer:()=>ut,SonaEngine:()=>P,TensorCompress:()=>mt,default:()=>ct,differentiableSearch:()=>ht,getCompressionLevel:()=>pt,hierarchicalForward:()=>dt,init:()=>gt,pipeline:()=>Ft});import{createRequire as st}from"module";var lt,$,ct,ut,mt,ht,dt,pt,gt,ft,yt,bt,At,vt,Et,P,Ft,k=H(()=>{lt=st(import.meta.url),$=lt("@ruvector/sona"),ct=$,{RuvectorLayer:ut,TensorCompress:mt,differentiableSearch:ht,hierarchicalForward:dt,getCompressionLevel:pt,init:gt,FlashAttention:ft,DotProductAttention:yt,MultiHeadAttention:bt,HyperbolicAttention:At,LinearAttention:vt,MoEAttention:Et,SonaEngine:P,pipeline:Ft}=$||{}});var N={};V(N,{DotProductAttention:()=>It,FlashAttention:()=>zt,HyperbolicAttention:()=>_t,LinearAttention:()=>Ht,MoEAttention:()=>Vt,MultiHeadAttention:()=>qt,RuvectorLayer:()=>Qt,SonaEngine:()=>jt,TensorCompress:()=>Nt,default:()=>xt,differentiableSearch:()=>Ot,getCompressionLevel:()=>Wt,hierarchicalForward:()=>Dt,init:()=>Bt,pipeline:()=>Ut});import{createRequire as kt}from"module";var Rt,X,xt,Qt,Nt,Ot,Dt,Wt,Bt,zt,It,qt,_t,Ht,Vt,jt,Ut,O=H(()=>{Rt=kt(import.meta.url),X=Rt("@ruvector/attention"),xt=X,{RuvectorLayer:Qt,TensorCompress:Nt,differentiableSearch:Ot,hierarchicalForward:Dt,getCompressionLevel:Wt,init:Bt,FlashAttention:zt,DotProductAttention:It,MultiHeadAttention:qt,HyperbolicAttention:_t,LinearAttention:Ht,MoEAttention:Vt,SonaEngine:jt,pipeline:Ut}=X||{}});k();at();import{randomUUID as Ct}from"crypto";rt();import{createRequire as wt}from"module";var f=U.create("sona-three-loop"),S=wt(import.meta.url),M=null,J=!1;function St(){if(J)return M;J=!0;try{let l=S("@ruvector/learning-wasm"),t=S("fs"),e=S("path"),r=e.join(e.dirname(S.resolve("@ruvector/learning-wasm")),"ruvector_learning_wasm_bg.wasm");l.initSync({module:t.readFileSync(r)}),M=l,f.info("WASM MicroLoRA loaded from @ruvector/learning-wasm (6.4x faster than TS)")}catch{M=null,f.debug("@ruvector/learning-wasm not available, using TypeScript MicroLoRA")}return M}var Mt={dimension:384,microLoraLr:.001,consolidationInterval:100,ewcLambda:1e3,taskBoundaryZScoreThreshold:2.5,fisherDecay:.9,fisherSampleSize:200,importanceThreshold:.01},R=class{adaptationVector;baseWeights;lr;adaptationCount=0;constructor(t,e=.001){this.adaptationVector=new Float32Array(t),this.baseWeights=new Float32Array(t),this.lr=e}adapt(t){let e=this.baseWeights.length,r=new Float32Array(e),a=Math.min(t.length,e);for(let n=0;n<e;n++){let o=n<a?t[n]:0;r[n]=this.baseWeights[n]+this.adaptationVector[n]+this.lr*o}for(let n=0;n<a;n++)this.adaptationVector[n]+=this.lr*t[n];return this.adaptationCount++,r}consolidate(){let t=this.adaptationCount,e=this.baseWeights.length;for(let r=0;r<e;r++)this.baseWeights[r]+=this.adaptationVector[r],this.adaptationVector[r]=0;return this.adaptationCount=0,t}getAdaptationCount(){return this.adaptationCount}getEffectiveWeights(){let t=this.baseWeights.length,e=new Float32Array(t);for(let r=0;r<t;r++)e[r]=this.baseWeights[r]+this.adaptationVector[r];return e}getAdaptationMagnitude(){let t=0;for(let e=0;e<this.adaptationVector.length;e++)t+=this.adaptationVector[e]*this.adaptationVector[e];return Math.sqrt(t)}resetAdaptation(){this.adaptationVector.fill(0),this.adaptationCount=0}},x=class{fisherMatrix;optimalParams;lambda;fisherDecay;zScoreThreshold;importanceThreshold;gradientHistory=[];gradientMean=0;gradientVariance=0;taskBoundaryCount=0;consolidationCount=0;constructor(t,e=1e3,r=.9,a=2.5,n=.01){this.fisherMatrix=new Float32Array(t),this.optimalParams=new Float32Array(t),this.lambda=e,this.fisherDecay=r,this.zScoreThreshold=a,this.importanceThreshold=n}detectTaskBoundary(t){let e=0;for(let i=0;i<t.length;i++)e+=t[i]*t[i];if(e=Math.sqrt(e),this.gradientHistory.length<5)return this.gradientHistory.push(e),this.updateGradientStats(),!1;let r=Math.sqrt(this.gradientVariance),a=0,n=Math.abs(e-this.gradientMean);return r>1e-10?a=n/r:n>1e-10&&this.gradientMean>1e-10&&(a=n/(this.gradientMean*.01+1e-10)),this.gradientHistory.push(e),this.gradientHistory.length>100&&this.gradientHistory.shift(),this.updateGradientStats(),a>this.zScoreThreshold?(this.taskBoundaryCount++,!0):!1}computeLoss(t){let e=0,r=Math.min(t.length,this.fisherMatrix.length,this.optimalParams.length);for(let a=0;a<r;a++){let n=t[a]-this.optimalParams[a];e+=this.fisherMatrix[a]*n*n}return this.lambda/2*e}updateFisher(t,e){if(t.length===0)return;let r=this.fisherMatrix.length,a=new Float32Array(r);for(let s of t){let u=Math.min(s.length,r);for(let c=0;c<u;c++)a[c]+=s[c]*s[c]}let n=t.length;for(let s=0;s<r;s++)a[s]/=n;let o=this.fisherDecay;for(let s=0;s<r;s++)this.fisherMatrix[s]=o*this.fisherMatrix[s]+(1-o)*a[s];let i=Math.min(e.length,r);for(let s=0;s<i;s++)this.optimalParams[s]=e[s];this.consolidationCount++}getMetrics(){let t=this.fisherMatrix.length,e=0,r=0,a=0;for(let n=0;n<t;n++)e+=this.fisherMatrix[n],this.fisherMatrix[n]>r&&(r=this.fisherMatrix[n]),this.fisherMatrix[n]>this.importanceThreshold&&a++;return{regularizationLoss:0,taskBoundariesDetected:this.taskBoundaryCount,fisherTrace:e,avgFisherImportance:t>0?e/t:0,maxFisherImportance:r,protectedParams:a,consolidationCycles:this.consolidationCount,lambda:this.lambda}}getTaskBoundaryCount(){return this.taskBoundaryCount}getFisherDiagonal(){return new Float32Array(this.fisherMatrix)}getOptimalParams(){return new Float32Array(this.optimalParams)}loadFisher(t,e){let r=this.fisherMatrix.length,a=Math.min(t.length,r),n=Math.min(e.length,r);for(let o=0;o<a;o++)this.fisherMatrix[o]=t[o];for(let o=0;o<n;o++)this.optimalParams[o]=e[o]}updateGradientStats(){let t=this.gradientHistory.length;if(t===0)return;let e=0;for(let a of this.gradientHistory)e+=a;e/=t;let r=0;for(let a of this.gradientHistory){let n=a-e;r+=n*n}r=t>1?r/(t-1):0,this.gradientMean=e,this.gradientVariance=r}},C=class{config;microLora;ewc;nativeEngine;wasmLora=null;requestCount=0;lastConsolidationRequest=0;peerStates=new Map;gradientBuffer=[];lastFeatures=null;constructor(t={},e){this.config={...Mt,...t},this.nativeEngine=e??null,this.microLora=new R(this.config.dimension,this.config.microLoraLr),this.ewc=new x(this.config.dimension,this.config.ewcLambda,this.config.fisherDecay,this.config.taskBoundaryZScoreThreshold,this.config.importanceThreshold);let r=St();if(r)try{this.wasmLora=new r.WasmMicroLoRA(this.config.dimension,1,this.config.microLoraLr),f.info("SONA Three-Loop using WASM MicroLoRA (0.07us/adapt)")}catch(a){f.debug("WASM MicroLoRA creation failed, falling back",{error:String(a)}),this.wasmLora=null}!this.wasmLora&&this.nativeEngine&&f.info("SONA Three-Loop using native @ruvector/sona engine for MicroLoRA delegation")}instantAdapt(t){let e=performance.now(),r;if(this.wasmLora)try{let o=new Float32Array(t),i=this.wasmLora.adapt(o);i&&i.length>0?(r=i,this.microLora.adapt(t)):r=this.microLora.adapt(t)}catch{r=this.microLora.adapt(t)}else if(this.nativeEngine)try{let o=this.nativeEngine.applyMicroLora(t);r=new Float32Array(o),this.microLora.adapt(t)}catch{r=this.microLora.adapt(t)}else r=this.microLora.adapt(t);let a=this.microLora.getAdaptationMagnitude();this.requestCount++,this.lastFeatures=[...t];let n=(performance.now()-e)*1e3;return{adaptedWeights:r,latencyUs:n,applied:!0,magnitude:a,requestIndex:this.requestCount}}recordOutcome(t,e){if(this.lastFeatures===null){f.warn("recordOutcome called without a preceding instantAdapt()");return}let r=this.lastFeatures.length,a=new Float32Array(r);for(let n=0;n<r;n++)a[n]=t*this.lastFeatures[n];this.gradientBuffer.push(a),this.gradientBuffer.length>this.config.fisherSampleSize&&this.gradientBuffer.shift(),this.lastFeatures=null}backgroundConsolidate(){let t=performance.now();if(this.nativeEngine)try{this.nativeEngine.forceLearn(),this.nativeEngine.tick()}catch(i){f.warn("Native SONA background learning failed, continuing with TypeScript",{error:String(i)})}let e=this.ewc.computeLoss(this.microLora.getEffectiveWeights()),r=!1;if(this.gradientBuffer.length>0){let i=this.gradientBuffer[this.gradientBuffer.length-1];r=this.ewc.detectTaskBoundary(i)}if(r&&this.gradientBuffer.length>0&&(this.ewc.updateFisher(this.gradientBuffer,this.microLora.getEffectiveWeights()),f.info("Task boundary detected, Fisher updated",{boundaries:this.ewc.getTaskBoundaryCount(),requestCount:this.requestCount})),this.gradientBuffer.length>1){let i=!1,s=this.gradientBuffer[0];for(let u=1;u<this.gradientBuffer.length&&!i;u++)for(let c=0;c<s.length;c++)if(Math.abs(this.gradientBuffer[u][c]-s[c])>1e-8){i=!0;break}i||f.warn("All gradient samples identical \u2014 Fisher estimate may be poor. Ensure recordOutcome() is called with diverse rewards.")}let a=this.microLora.consolidate();this.applyEWCRegularization();let n=this.ewc.computeLoss(this.microLora.getEffectiveWeights());this.lastConsolidationRequest=this.requestCount,this.gradientBuffer=[];let o=performance.now()-t;return{consolidated:a>0||r,adaptationsMerged:a,ewcLossBefore:e,ewcLossAfter:n,taskBoundaryDetected:r,durationMs:o}}shouldConsolidate(){return this.requestCount-this.lastConsolidationRequest>=this.config.consolidationInterval}syncWithPeers(t){if(t.length===0)return;for(let i of t)this.peerStates.set(i.peerId,i);let e=this.config.dimension,r=new Float32Array(e),a=new Float32Array(e),n=this.ewc.getFisherDiagonal(),o=this.microLora.adaptationVector;for(let i=0;i<e;i++){let s=n[i]+1e-10;r[i]+=s*o[i],a[i]+=s}for(let i of t){let s=Math.min(i.adaptationVector.length,e);for(let u=0;u<s;u++){let c=(u<i.fisherDiagonal.length?i.fisherDiagonal[u]:0)+1e-10;r[u]+=c*i.adaptationVector[u],a[u]+=c}}for(let i=0;i<e;i++)this.microLora.adaptationVector[i]=r[i]/a[i];f.debug("Synced with peers",{peerCount:t.length,peersStored:this.peerStates.size})}getLocalPeerState(t,e){return{peerId:t,domain:e,adaptationVector:new Float32Array(this.microLora.adaptationVector),fisherDiagonal:this.ewc.getFisherDiagonal(),requestCount:this.requestCount,lastUpdateMs:Date.now()}}getEWCMetrics(){let t=this.ewc.getMetrics();return t.regularizationLoss=this.ewc.computeLoss(this.microLora.getEffectiveWeights()),t}getFisherDiagonal(){return this.ewc.getFisherDiagonal()}getOptimalParams(){return this.ewc.getOptimalParams()}loadFisher(t,e){this.ewc.loadFisher(t,e)}getBaseWeights(){return new Float32Array(this.microLora.baseWeights)}setBaseWeights(t){let e=Math.min(t.length,this.microLora.baseWeights.length);for(let r=0;r<e;r++)this.microLora.baseWeights[r]=t[r]}getEffectiveWeights(){return this.microLora.getEffectiveWeights()}getRequestCount(){return this.requestCount}restoreRequestCount(t){this.requestCount=t}getConfig(){return{...this.config}}getPeerStates(){return new Map(this.peerStates)}getMicroLoRA(){return this.microLora}getEWC(){return this.ewc}applyEWCRegularization(){let t=this.config.dimension,e=this.ewc.fisherMatrix,r=this.ewc.optimalParams,a=this.microLora.baseWeights,n=.01;for(let o=0;o<t;o++)if(e[o]>this.config.importanceThreshold){let i=a[o]-r[o];a[o]-=n*e[o]*i}}persistFisher(t,e){let r=this.ewc.getMetrics();t(e,this.ewc.getFisherDiagonal(),this.ewc.getOptimalParams(),this.getBaseWeights(),{taskBoundaries:r.taskBoundariesDetected,consolidationCycles:r.consolidationCycles,requestCount:this.requestCount,ewcLambda:r.lambda}),f.info("Fisher matrix persisted to SQLite",{domain:e,requestCount:this.requestCount,taskBoundaries:r.taskBoundariesDetected})}restoreFisher(t){this.ewc.loadFisher(t.fisherDiagonal,t.optimalParams),t.baseWeights&&this.setBaseWeights(t.baseWeights),this.requestCount=t.requestCount,f.info("Fisher matrix restored from SQLite",{requestCount:t.requestCount,dimension:t.fisherDiagonal.length})}};var Lt={hiddenDim:256,embeddingDim:384,microLoraRank:1,baseLoraRank:8,microLoraLr:.001,baseLoraLr:1e-4,ewcLambda:1e3,patternClusters:50,trajectoryCapacity:1e4,backgroundIntervalMs:36e5,qualityThreshold:.5,enableSimd:!0,minConfidence:.5,maxPatterns:1e4},Q=class{patterns;trajectoryMap;maxPatterns;constructor(t=1e4){this.patterns=new Map,this.trajectoryMap=new Map,this.maxPatterns=t}register(t){if(this.patterns.size>=this.maxPatterns&&!this.patterns.has(t.id)){let e=Array.from(this.patterns.entries()).sort(([,r],[,a])=>(r.lastUsedAt?.getTime()??r.createdAt.getTime())-(a.lastUsedAt?.getTime()??a.createdAt.getTime()))[0];e&&this.patterns.delete(e[0])}this.patterns.set(t.id,t)}get(t){return this.patterns.get(t)}getByTrajectory(t){let e=this.trajectoryMap.get(t);return e?this.patterns.get(e):void 0}associateTrajectory(t,e){this.trajectoryMap.set(t,e)}update(t,e){let r=this.patterns.get(t);return r?(this.patterns.set(t,{...r,...e}),!0):!1}getAll(){return Array.from(this.patterns.values())}getByType(t){return Array.from(this.patterns.values()).filter(e=>e.type===t)}getByDomain(t){return Array.from(this.patterns.values()).filter(e=>e.domain===t)}clear(){this.patterns.clear(),this.trajectoryMap.clear()}size(){return this.patterns.size}},v=class{engine;registry;config;adaptationTimes=[];cacheHits=0;totalAdaptations=0;threeLoopEngine=null;fisherPersistFn=null;fisherDomain="default";constructor(t={}){this.config={...Lt,...t};let e={hiddenDim:this.config.hiddenDim,embeddingDim:this.config.embeddingDim,microLoraRank:this.config.microLoraRank,baseLoraRank:this.config.baseLoraRank,microLoraLr:this.config.microLoraLr,baseLoraLr:this.config.baseLoraLr,ewcLambda:this.config.ewcLambda,patternClusters:this.config.patternClusters,trajectoryCapacity:this.config.trajectoryCapacity,backgroundIntervalMs:this.config.backgroundIntervalMs,qualityThreshold:this.config.qualityThreshold,enableSimd:this.config.enableSimd};this.engine=P.withConfig(e),this.registry=new Q(this.config.maxPatterns??1e4)}async adaptPattern(t,e,r){let a=performance.now();try{let n=this.createStateEmbedding(t),o=this.engine.findPatterns(n,5),i=[];for(let m of o){let g=this.findByRawPattern(m);if(g||(g=this.createQEPatternFromRaw(m,e,r)),g.type===e&&g.domain===r&&g.confidence>=(this.config.minConfidence??.5)){let h=this.calculateSimilarity(n,m.centroid);i.push({pattern:g,similarity:h})}}if(i.length===0){let m=performance.now()-a;return this.recordAdaptation(m),{success:!1,pattern:null,adaptationTimeMs:m,similarity:0,reasoning:"No suitable pattern found"}}let s=i[0],u={...s.pattern,usageCount:s.pattern.usageCount+1,lastUsedAt:new Date};this.registry.update(u.id,u);let c=performance.now()-a;return this.recordAdaptation(c),{success:!0,pattern:u,adaptationTimeMs:c,similarity:s.similarity,reasoning:`Pattern adapted from @ruvector/sona with ${s.similarity.toFixed(3)} similarity`}}catch(n){let o=performance.now()-a;return this.recordAdaptation(o),{success:!1,pattern:null,adaptationTimeMs:o,similarity:0,reasoning:`Adaptation failed: ${n.message}`}}}recallPattern(t,e,r){let a=this.createStateEmbedding(t),n=this.engine.findPatterns(a,1);for(let o of n){let i=this.findByRawPattern(o);if(i&&i.type===e&&i.domain===r)return i}return null}storePattern(t){this.registry.register(t);let e=this.engine.beginTrajectory(t.stateEmbedding),r=this.createActionEmbedding(t.action),a=new Array(r.length).fill(1),n=t.outcome.success?t.outcome.quality:-t.outcome.quality;this.engine.addTrajectoryStep(e,r,a,n),this.engine.endTrajectory(e,t.outcome.quality),this.registry.associateTrajectory(e,t.id)}storePatternsBatch(t){for(let e of t)this.storePattern(e)}createPattern(t,e,r,a,n,o){let i={id:`qesona-${Date.now()}-${Ct().slice(0,7)}`,type:a,domain:n,stateEmbedding:this.createStateEmbedding(t),action:e,outcome:r,confidence:.5,usageCount:0,createdAt:new Date,metadata:o};return this.storePattern(i),i}updatePattern(t,e,r){let a=this.registry.get(t);if(!a)return!1;let n=e?r:-r,i=a.confidence+.1*(n-a.confidence),s={...a,confidence:Math.max(0,Math.min(1,i)),usageCount:a.usageCount+1,lastUsedAt:new Date};return this.registry.update(t,s)}applyMicroLora(t){return this.engine.applyMicroLora(t)}applyBaseLora(t,e){return this.engine.applyBaseLora(t,e)}forceLearn(){return this.engine.forceLearn()}tick(){return this.engine.tick()}getAllPatterns(){return this.registry.getAll()}getPatternsByType(t){return this.registry.getByType(t)}getPatternsByDomain(t){return this.registry.getByDomain(t)}getStats(){let t=this.registry.getAll(),e=this.engine.getStats(),r={"test-generation":0,"defect-prediction":0,"coverage-optimization":0,"quality-assessment":0,"resource-allocation":0};for(let a of t)r[a.type]++;return{totalPatterns:t.length,patternsByType:r,avgAdaptationTimeMs:this.avgAdaptationTime(),minAdaptationTimeMs:this.minAdaptationTime(),maxAdaptationTimeMs:this.maxAdaptationTime(),totalAdaptations:this.totalAdaptations,cacheHitRate:this.totalAdaptations>0?this.cacheHits/this.totalAdaptations:0,engineStats:e}}clear(){this.registry.clear(),this.adaptationTimes=[],this.cacheHits=0,this.totalAdaptations=0}exportPatterns(){return this.registry.getAll()}importPatterns(t){this.clear(),this.storePatternsBatch(t)}getConfig(){return{...this.config}}setEnabled(t){this.engine.setEnabled(t)}isEnabled(){return this.engine.isEnabled()}createStateEmbedding(t){let e=t.features;if(e.length===0)return new Array(this.config.embeddingDim??384).fill(0);let r=Math.max(...e.map(Math.abs));if(r===0)return[...e];let a=e.map(o=>o/r),n=this.config.embeddingDim??384;return a.length>=n?a.slice(0,n):[...a,...new Array(n-a.length).fill(0)]}createActionEmbedding(t){let e=[],r=this.hashCode(t.type);if(e.push(r%1e3/1e3),typeof t.value=="number")e.push(Math.min(1,Math.max(-1,t.value)));else if(typeof t.value=="string"){let n=this.hashCode(t.value);e.push(n%1e3/1e3)}else if(Array.isArray(t.value))for(let n of t.value.slice(0,10))typeof n=="number"&&e.push(Math.min(1,Math.max(-1,n)));let a=this.config.embeddingDim??384;for(;e.length<a;)e.push(0);return e.slice(0,a)}findByRawPattern(t){let e=this.registry.getAll();for(let r of e)if(r.rawPattern?.patternType===t.id)return r}createQEPatternFromRaw(t,e,r){let a={centroid:t.centroid,clusterSize:1,totalWeight:1,avgQuality:t.avgQuality,createdAt:new Date().toISOString(),lastAccessed:new Date().toISOString(),accessCount:0,patternType:t.patternType};return{id:`qesona-${t.id}`,type:e,domain:r,stateEmbedding:t.centroid,action:{type:"learned",value:t.patternType},outcome:{reward:t.avgQuality,success:t.avgQuality>.5,quality:t.avgQuality},confidence:t.avgQuality,usageCount:0,createdAt:new Date,rawPattern:a}}calculateSimilarity(t,e){let r=Math.min(t.length,e.length),a=0,n=0,o=0;for(let s=0;s<r;s++)a+=t[s]*e[s],n+=t[s]*t[s],o+=e[s]*e[s];return(a/(Math.sqrt(n)*Math.sqrt(o)+1e-10)+1)/2}hashCode(t){let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e=e|0;return Math.abs(e)}recordAdaptation(t){this.adaptationTimes.push(t),this.totalAdaptations++,this.adaptationTimes.length>1e3&&this.adaptationTimes.shift()}avgAdaptationTime(){return this.adaptationTimes.length===0?0:this.adaptationTimes.reduce((e,r)=>e+r,0)/this.adaptationTimes.length}minAdaptationTime(){return this.adaptationTimes.length===0?0:Math.min(...this.adaptationTimes)}maxAdaptationTime(){return this.adaptationTimes.length===0?0:Math.max(...this.adaptationTimes)}initThreeLoopEngine(t){this.threeLoopEngine=new C({dimension:this.config.embeddingDim??384,microLoraLr:this.config.microLoraLr??.001,ewcLambda:this.config.ewcLambda??1e3,...t},this.engine)}getThreeLoopEngine(){return this.threeLoopEngine}instantAdapt(t){return this.threeLoopEngine?this.threeLoopEngine.instantAdapt(t):null}recordOutcome(t,e){this.threeLoopEngine&&this.threeLoopEngine.recordOutcome(t,e)}backgroundConsolidate(){if(!this.threeLoopEngine)return null;let t=this.threeLoopEngine.backgroundConsolidate();if(t&&(t.consolidated||t.taskBoundaryDetected)&&this.fisherPersistFn)try{this.threeLoopEngine.persistFisher(this.fisherPersistFn,this.fisherDomain)}catch(e){console.warn("[QESONA] Fisher persistence failed:",e instanceof Error?e.message:e)}return t}setFisherPersistence(t,e){this.fisherPersistFn=t,this.fisherDomain=e}syncWithPeers(t){this.threeLoopEngine&&this.threeLoopEngine.syncWithPeers(t)}getEWCMetrics(){return this.threeLoopEngine?this.threeLoopEngine.getEWCMetrics():null}shouldConsolidate(){return this.threeLoopEngine?this.threeLoopEngine.shouldConsolidate():!1}getLocalPeerState(t,e){return this.threeLoopEngine?this.threeLoopEngine.getLocalPeerState(t,e):null}isThreeLoopEnabled(){return this.threeLoopEngine!==null}async verifyPerformance(t=1e3){let e=[],r={id:"test-state",features:new Array(384).fill(0).map(()=>G())};for(let s=0;s<t;s++){let u=performance.now();await this.adaptPattern(r,"test-generation","test-generation");let c=performance.now();e.push({iteration:s,timeMs:c-u})}let a=e.map(s=>s.timeMs),n=a.reduce((s,u)=>s+u,0)/a.length,o=Math.min(...a),i=Math.max(...a);return{targetMet:n<.05,avgTimeMs:n,minTimeMs:o,maxTimeMs:i,details:e}}};function Tt(l){return new v(l)}function Pt(l,t){return new v({...t,maxPatterns:t?.maxPatterns||5e3})}ot();et();var F=null,D=null,W=null,B=null,z=null,I=null,q=!1;try{let l=(O(),w(N));F=l.FlashAttention,D=l.DotProductAttention,W=l.MultiHeadAttention,B=l.HyperbolicAttention,z=l.LinearAttention,I=l.MoEAttention,q=!0}catch{}function Gt(){return q}function b(){if(!q)throw new Error("@ruvector/attention 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 T={"test-similarity":{dim:384,strategy:"flash",blockSize:64},"code-embedding":{dim:512,strategy:"flash",blockSize:128},"defect-matching":{dim:384,strategy:"flash",blockSize:64},"coverage-analysis":{dim:384,strategy:"flash",blockSize:256},"pattern-adaptation":{dim:256,strategy:"flash",blockSize:32}},Kt={"test-similarity":{enabled:!0,microLoRARank:4,targetAdaptationMs:.05,patternCacheSize:1e3},"code-embedding":{enabled:!0,microLoRARank:2,targetAdaptationMs:.03,patternCacheSize:5e3},"defect-matching":{enabled:!0,microLoRARank:8,targetAdaptationMs:.05,patternCacheSize:2e3},"coverage-analysis":{enabled:!1,microLoRARank:2,targetAdaptationMs:.01,patternCacheSize:100},"pattern-adaptation":{enabled:!0,microLoRARank:2,targetAdaptationMs:.05,patternCacheSize:1e4}},$t={"test-similarity":{latency:{before:50,after:15},memory:{before:200,after:80},throughput:{min:1e3}},"code-embedding":{latency:{before:50,after:15},memory:{before:200,after:80},throughput:{min:2e3}},"defect-matching":{latency:{before:20,after:5},memory:{before:150,after:50},throughput:{min:500}},"coverage-analysis":{latency:{before:100,after:1},memory:{before:100,after:30},throughput:{min:1e4}},"pattern-adaptation":{latency:{before:2,after:.05},memory:{before:50,after:20},throughput:{min:2e4}}};function Zt(l){return l<=128?{queryChunkSize:128,kvChunkSize:128}:l<=256?{queryChunkSize:256,kvChunkSize:256}:l<=512?{queryChunkSize:512,kvChunkSize:512}:l<=1024?{queryChunkSize:1024,kvChunkSize:1024}:{queryChunkSize:1024,kvChunkSize:2048}}var E=class{static create(t){switch(b(),t.strategy){case"flash":return new F(t.dim,t.blockSize);case"dot-product":return new D(t.dim);case"multi-head":return new W(t.dim,t.numHeads??8);case"hyperbolic":return new B(t.dim,t.curvature);case"linear":return new z(t.dim,t.features);case"moe":return I.simple(t.dim,t.moeConfig?.numExperts??8,t.moeConfig?.topK??2);default:return new F(t.dim,t.blockSize)}}},L=class l{attention;config;workload;metrics=[];db=null;persistCount=0;static KV_NAMESPACE="attention-metrics";static KV_TTL=3600;static PERSIST_INTERVAL=10;constructor(t,e){this.workload=t;let r=T[t];this.config={...r,...e},this.attention=E.create(this.config)}async initialize(){try{this.db=K(),this.db.isInitialized()||await this.db.initialize(),await this.loadFromKv()}catch(t){console.warn("[QEFlashAttention] DB init failed, using memory-only:",j(t)),this.db=null}}async computeFlashAttention(t,e,r,a,n){let o=performance.now(),i=process.memoryUsage().heapUsed/1024/1024,s=this.toFloat32Array(t,a,n),u=this.splitMatrix(e,a,n),c=this.splitMatrix(r,a,n),m,g=this.attention;typeof g.compute=="function"?m=g.compute(s,u,c):(b(),m=new F(this.config.dim).compute(s,u,c));let h=performance.now(),d=process.memoryUsage().heapUsed/1024/1024;return this.metrics.push({timeMs:h-o,memoryMB:d-i,speedup:1,throughput:a*a/((h-o)/1e3),peakMemoryMB:d}),this.maybePersistToKv(),m}async computeBaselineAttention(t,e,r,a,n){let o=performance.now(),i=process.memoryUsage().heapUsed/1024/1024,s=new Float32Array(a*a),u=1/Math.sqrt(n);for(let h=0;h<a;h++)for(let d=0;d<a;d++){let A=0;for(let p=0;p<n;p++)A+=t[h*n+p]*e[d*n+p];s[h*a+d]=A*u}for(let h=0;h<a;h++){let d=h*a,A=d+a,p=s.subarray(d,A),tt=Math.max(...p),_=0;for(let y=0;y<a;y++)p[y]=Math.exp(p[y]-tt),_+=p[y];for(let y=0;y<a;y++)p[y]/=_}let c=new Float32Array(a*n);for(let h=0;h<a;h++)for(let d=0;d<a;d++){let A=s[h*a+d];for(let p=0;p<n;p++)c[h*n+p]+=A*r[d*n+p]}let m=performance.now(),g=process.memoryUsage().heapUsed/1024/1024;return c}async computeTestSimilarity(t,e,r=5){let a=e.length,n=t.length,o=new Float32Array(a*n),i=new Float32Array(a*n);for(let m=0;m<a;m++)o.set(t,m*n),i.set(e[m],m*n);let s=new Float32Array(a*n),u=await this.computeFlashAttention(o,i,s,a,n),c=[];for(let m=0;m<a;m++)c.push({index:m,similarity:u[m*n]});return c.sort((m,g)=>g.similarity-m.similarity),c.slice(0,r)}async generateCodeEmbedding(t,e){let r=t.length/e.length,a=e.length;return await this.computeFlashAttention(t,e,t,r,a)}async matchDefectPattern(t,e){let r=e.length,a=t.length,n=new Float32Array(r*a),o=new Float32Array(r*a);for(let c=0;c<r;c++)n.set(t,c*a),o.set(e[c],c*a);let i=new Float32Array(r*a),s=await this.computeFlashAttention(n,o,i,r,a),u=[];for(let c=0;c<r;c++)u.push({pattern:c,score:s[c*a]});return u.sort((c,m)=>m.score-c.score),u}getMetrics(){return[...this.metrics]}getAverageSpeedup(){return this.metrics.length===0?1:this.metrics.reduce((t,e)=>t+e.speedup,0)/this.metrics.length}getConfig(){return{...this.config}}updateConfig(t){this.config={...this.config,...t},this.attention=E.create(this.config)}changeStrategy(t){this.config.strategy=t,this.attention=E.create(this.config)}resetMetrics(){this.metrics=[]}getWorkload(){return this.workload}dispose(){this.metrics=[]}async persistToKv(){if(!this.db)return;let t=`attention-metrics-${this.workload}`,e={workload:this.workload,metrics:this.metrics.slice(-50),savedAt:Date.now()};await this.db.kvSet(t,e,l.KV_NAMESPACE,l.KV_TTL)}async loadFromKv(){if(!this.db)return;let t=`attention-metrics-${this.workload}`,e=await this.db.kvGet(t,l.KV_NAMESPACE);e?.metrics?.length&&(this.metrics=e.metrics)}maybePersistToKv(){this.persistCount++,this.persistCount>=l.PERSIST_INTERVAL&&(this.persistCount=0,this.persistToKv().catch(()=>{}))}toFloat32Array(t,e,r){return t.slice(0,r)}splitMatrix(t,e,r){let a=[];for(let n=0;n<e;n++)a.push(t.slice(n*r,(n+1)*r));return a}};async function Y(l,t){let e=new L(l,t);return await e.initialize(),e}function Jt(l){return{...T[l]}}function Xt(){return Object.keys(T)}function Yt(){return b(),F}function te(){return b(),D}function ee(){return b(),W}function re(){return b(),B}function ae(){return b(),z}function ne(){return b(),I}function ie(l){return l instanceof Float32Array?l:new Float32Array(l)}function oe(l){return Array.from(l)}async function se(l,t,e,r){let a=await Y(l),n=[],o=t[0].length,i=e.length;for(let s of t){let u=new Float32Array(i*o),c=new Float32Array(i*o),m=new Float32Array(i*o);u.set(s,0);for(let h=0;h<i;h++)c.set(e[h],h*o),m.set(r[h],h*o);let g=await a.computeFlashAttention(u,c,m,i,o);n.push(g.slice(0,o))}return a.dispose(),n}function We(){return{"@ruvector/sona":"^0.1.5","@ruvector/attention":"^0.1.4","@ruvector/gnn":"^0.1.22"}}function Be(){let l={sona:!1,attention:!1,gnn:!1,all:!1};try{k(),l.sona=!0}catch{}try{O(),l.attention=!0}catch{}try{let t=(it(),w(nt));t.init();let e=new Float32Array([.1,.2,.3]),r=[new Float32Array([.1,.2,.3]),new Float32Array([.4,.5,.6])],a=t.differentiableSearch(e,r,1,1);a&&Array.isArray(a.indices)&&Array.isArray(a.weights)&&(l.gnn=!0)}catch{}return l.all=l.sona&&l.attention&&l.gnn,l}async function ze(){let{initGNN:l}=await import("./gnn-wrapper-R2OMDND4.js");return[l(),"SONA: Ready (no initialization required)","Attention: Ready (no initialization required)"]}export{v as a,Tt as b,Pt as c,Gt as d,T as e,Kt as f,$t as g,Zt as h,L as i,Y as j,Jt as k,Xt as l,Yt as m,te as n,ee as o,re as p,ae as q,ne as r,ie as s,oe as t,se as u,We as v,Be as w,ze as x};
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.13.12");process.exit(0)}
2
+ import{i as K,m as ot}from"./chunk-M73KM3AZ.js";import{a as rt}from"./chunk-GEQWCK4F.js";import{c as U}from"./chunk-IOJ34SXJ.js";import{a as j,c as et}from"./chunk-L3GBNX7B.js";import{a as G,d as at}from"./chunk-4Z4X2ND4.js";import{a as nt,b as it}from"./chunk-N4OQ4D4V.js";import{c as H,e as V,g as w}from"./chunk-ZMYV4R32.js";var Z={};V(Z,{DotProductAttention:()=>yt,FlashAttention:()=>ft,HyperbolicAttention:()=>At,LinearAttention:()=>vt,MoEAttention:()=>Et,MultiHeadAttention:()=>bt,RuvectorLayer:()=>ut,SonaEngine:()=>P,TensorCompress:()=>mt,default:()=>ct,differentiableSearch:()=>ht,getCompressionLevel:()=>pt,hierarchicalForward:()=>dt,init:()=>gt,pipeline:()=>Ft});import{createRequire as st}from"module";var lt,$,ct,ut,mt,ht,dt,pt,gt,ft,yt,bt,At,vt,Et,P,Ft,k=H(()=>{lt=st(import.meta.url),$=lt("@ruvector/sona"),ct=$,{RuvectorLayer:ut,TensorCompress:mt,differentiableSearch:ht,hierarchicalForward:dt,getCompressionLevel:pt,init:gt,FlashAttention:ft,DotProductAttention:yt,MultiHeadAttention:bt,HyperbolicAttention:At,LinearAttention:vt,MoEAttention:Et,SonaEngine:P,pipeline:Ft}=$||{}});var N={};V(N,{DotProductAttention:()=>It,FlashAttention:()=>zt,HyperbolicAttention:()=>_t,LinearAttention:()=>Ht,MoEAttention:()=>Vt,MultiHeadAttention:()=>qt,RuvectorLayer:()=>Qt,SonaEngine:()=>jt,TensorCompress:()=>Nt,default:()=>xt,differentiableSearch:()=>Ot,getCompressionLevel:()=>Wt,hierarchicalForward:()=>Dt,init:()=>Bt,pipeline:()=>Ut});import{createRequire as kt}from"module";var Rt,X,xt,Qt,Nt,Ot,Dt,Wt,Bt,zt,It,qt,_t,Ht,Vt,jt,Ut,O=H(()=>{Rt=kt(import.meta.url),X=Rt("@ruvector/attention"),xt=X,{RuvectorLayer:Qt,TensorCompress:Nt,differentiableSearch:Ot,hierarchicalForward:Dt,getCompressionLevel:Wt,init:Bt,FlashAttention:zt,DotProductAttention:It,MultiHeadAttention:qt,HyperbolicAttention:_t,LinearAttention:Ht,MoEAttention:Vt,SonaEngine:jt,pipeline:Ut}=X||{}});k();at();import{randomUUID as Ct}from"crypto";rt();import{createRequire as wt}from"module";var f=U.create("sona-three-loop"),S=wt(import.meta.url),M=null,J=!1;function St(){if(J)return M;J=!0;try{let l=S("@ruvector/learning-wasm"),t=S("fs"),e=S("path"),r=e.join(e.dirname(S.resolve("@ruvector/learning-wasm")),"ruvector_learning_wasm_bg.wasm");l.initSync({module:t.readFileSync(r)}),M=l,f.info("WASM MicroLoRA loaded from @ruvector/learning-wasm (6.4x faster than TS)")}catch{M=null,f.debug("@ruvector/learning-wasm not available, using TypeScript MicroLoRA")}return M}var Mt={dimension:384,microLoraLr:.001,consolidationInterval:100,ewcLambda:1e3,taskBoundaryZScoreThreshold:2.5,fisherDecay:.9,fisherSampleSize:200,importanceThreshold:.01},R=class{adaptationVector;baseWeights;lr;adaptationCount=0;constructor(t,e=.001){this.adaptationVector=new Float32Array(t),this.baseWeights=new Float32Array(t),this.lr=e}adapt(t){let e=this.baseWeights.length,r=new Float32Array(e),a=Math.min(t.length,e);for(let n=0;n<e;n++){let o=n<a?t[n]:0;r[n]=this.baseWeights[n]+this.adaptationVector[n]+this.lr*o}for(let n=0;n<a;n++)this.adaptationVector[n]+=this.lr*t[n];return this.adaptationCount++,r}consolidate(){let t=this.adaptationCount,e=this.baseWeights.length;for(let r=0;r<e;r++)this.baseWeights[r]+=this.adaptationVector[r],this.adaptationVector[r]=0;return this.adaptationCount=0,t}getAdaptationCount(){return this.adaptationCount}getEffectiveWeights(){let t=this.baseWeights.length,e=new Float32Array(t);for(let r=0;r<t;r++)e[r]=this.baseWeights[r]+this.adaptationVector[r];return e}getAdaptationMagnitude(){let t=0;for(let e=0;e<this.adaptationVector.length;e++)t+=this.adaptationVector[e]*this.adaptationVector[e];return Math.sqrt(t)}resetAdaptation(){this.adaptationVector.fill(0),this.adaptationCount=0}},x=class{fisherMatrix;optimalParams;lambda;fisherDecay;zScoreThreshold;importanceThreshold;gradientHistory=[];gradientMean=0;gradientVariance=0;taskBoundaryCount=0;consolidationCount=0;constructor(t,e=1e3,r=.9,a=2.5,n=.01){this.fisherMatrix=new Float32Array(t),this.optimalParams=new Float32Array(t),this.lambda=e,this.fisherDecay=r,this.zScoreThreshold=a,this.importanceThreshold=n}detectTaskBoundary(t){let e=0;for(let i=0;i<t.length;i++)e+=t[i]*t[i];if(e=Math.sqrt(e),this.gradientHistory.length<5)return this.gradientHistory.push(e),this.updateGradientStats(),!1;let r=Math.sqrt(this.gradientVariance),a=0,n=Math.abs(e-this.gradientMean);return r>1e-10?a=n/r:n>1e-10&&this.gradientMean>1e-10&&(a=n/(this.gradientMean*.01+1e-10)),this.gradientHistory.push(e),this.gradientHistory.length>100&&this.gradientHistory.shift(),this.updateGradientStats(),a>this.zScoreThreshold?(this.taskBoundaryCount++,!0):!1}computeLoss(t){let e=0,r=Math.min(t.length,this.fisherMatrix.length,this.optimalParams.length);for(let a=0;a<r;a++){let n=t[a]-this.optimalParams[a];e+=this.fisherMatrix[a]*n*n}return this.lambda/2*e}updateFisher(t,e){if(t.length===0)return;let r=this.fisherMatrix.length,a=new Float32Array(r);for(let s of t){let u=Math.min(s.length,r);for(let c=0;c<u;c++)a[c]+=s[c]*s[c]}let n=t.length;for(let s=0;s<r;s++)a[s]/=n;let o=this.fisherDecay;for(let s=0;s<r;s++)this.fisherMatrix[s]=o*this.fisherMatrix[s]+(1-o)*a[s];let i=Math.min(e.length,r);for(let s=0;s<i;s++)this.optimalParams[s]=e[s];this.consolidationCount++}getMetrics(){let t=this.fisherMatrix.length,e=0,r=0,a=0;for(let n=0;n<t;n++)e+=this.fisherMatrix[n],this.fisherMatrix[n]>r&&(r=this.fisherMatrix[n]),this.fisherMatrix[n]>this.importanceThreshold&&a++;return{regularizationLoss:0,taskBoundariesDetected:this.taskBoundaryCount,fisherTrace:e,avgFisherImportance:t>0?e/t:0,maxFisherImportance:r,protectedParams:a,consolidationCycles:this.consolidationCount,lambda:this.lambda}}getTaskBoundaryCount(){return this.taskBoundaryCount}getFisherDiagonal(){return new Float32Array(this.fisherMatrix)}getOptimalParams(){return new Float32Array(this.optimalParams)}loadFisher(t,e){let r=this.fisherMatrix.length,a=Math.min(t.length,r),n=Math.min(e.length,r);for(let o=0;o<a;o++)this.fisherMatrix[o]=t[o];for(let o=0;o<n;o++)this.optimalParams[o]=e[o]}updateGradientStats(){let t=this.gradientHistory.length;if(t===0)return;let e=0;for(let a of this.gradientHistory)e+=a;e/=t;let r=0;for(let a of this.gradientHistory){let n=a-e;r+=n*n}r=t>1?r/(t-1):0,this.gradientMean=e,this.gradientVariance=r}},C=class{config;microLora;ewc;nativeEngine;wasmLora=null;requestCount=0;lastConsolidationRequest=0;peerStates=new Map;gradientBuffer=[];lastFeatures=null;constructor(t={},e){this.config={...Mt,...t},this.nativeEngine=e??null,this.microLora=new R(this.config.dimension,this.config.microLoraLr),this.ewc=new x(this.config.dimension,this.config.ewcLambda,this.config.fisherDecay,this.config.taskBoundaryZScoreThreshold,this.config.importanceThreshold);let r=St();if(r)try{this.wasmLora=new r.WasmMicroLoRA(this.config.dimension,1,this.config.microLoraLr),f.info("SONA Three-Loop using WASM MicroLoRA (0.07us/adapt)")}catch(a){f.debug("WASM MicroLoRA creation failed, falling back",{error:String(a)}),this.wasmLora=null}!this.wasmLora&&this.nativeEngine&&f.info("SONA Three-Loop using native @ruvector/sona engine for MicroLoRA delegation")}instantAdapt(t){let e=performance.now(),r;if(this.wasmLora)try{let o=new Float32Array(t),i=this.wasmLora.adapt(o);i&&i.length>0?(r=i,this.microLora.adapt(t)):r=this.microLora.adapt(t)}catch{r=this.microLora.adapt(t)}else if(this.nativeEngine)try{let o=this.nativeEngine.applyMicroLora(t);r=new Float32Array(o),this.microLora.adapt(t)}catch{r=this.microLora.adapt(t)}else r=this.microLora.adapt(t);let a=this.microLora.getAdaptationMagnitude();this.requestCount++,this.lastFeatures=[...t];let n=(performance.now()-e)*1e3;return{adaptedWeights:r,latencyUs:n,applied:!0,magnitude:a,requestIndex:this.requestCount}}recordOutcome(t,e){if(this.lastFeatures===null){f.warn("recordOutcome called without a preceding instantAdapt()");return}let r=this.lastFeatures.length,a=new Float32Array(r);for(let n=0;n<r;n++)a[n]=t*this.lastFeatures[n];this.gradientBuffer.push(a),this.gradientBuffer.length>this.config.fisherSampleSize&&this.gradientBuffer.shift(),this.lastFeatures=null}backgroundConsolidate(){let t=performance.now();if(this.nativeEngine)try{this.nativeEngine.forceLearn(),this.nativeEngine.tick()}catch(i){f.warn("Native SONA background learning failed, continuing with TypeScript",{error:String(i)})}let e=this.ewc.computeLoss(this.microLora.getEffectiveWeights()),r=!1;if(this.gradientBuffer.length>0){let i=this.gradientBuffer[this.gradientBuffer.length-1];r=this.ewc.detectTaskBoundary(i)}if(r&&this.gradientBuffer.length>0&&(this.ewc.updateFisher(this.gradientBuffer,this.microLora.getEffectiveWeights()),f.info("Task boundary detected, Fisher updated",{boundaries:this.ewc.getTaskBoundaryCount(),requestCount:this.requestCount})),this.gradientBuffer.length>1){let i=!1,s=this.gradientBuffer[0];for(let u=1;u<this.gradientBuffer.length&&!i;u++)for(let c=0;c<s.length;c++)if(Math.abs(this.gradientBuffer[u][c]-s[c])>1e-8){i=!0;break}i||f.warn("All gradient samples identical \u2014 Fisher estimate may be poor. Ensure recordOutcome() is called with diverse rewards.")}let a=this.microLora.consolidate();this.applyEWCRegularization();let n=this.ewc.computeLoss(this.microLora.getEffectiveWeights());this.lastConsolidationRequest=this.requestCount,this.gradientBuffer=[];let o=performance.now()-t;return{consolidated:a>0||r,adaptationsMerged:a,ewcLossBefore:e,ewcLossAfter:n,taskBoundaryDetected:r,durationMs:o}}shouldConsolidate(){return this.requestCount-this.lastConsolidationRequest>=this.config.consolidationInterval}syncWithPeers(t){if(t.length===0)return;for(let i of t)this.peerStates.set(i.peerId,i);let e=this.config.dimension,r=new Float32Array(e),a=new Float32Array(e),n=this.ewc.getFisherDiagonal(),o=this.microLora.adaptationVector;for(let i=0;i<e;i++){let s=n[i]+1e-10;r[i]+=s*o[i],a[i]+=s}for(let i of t){let s=Math.min(i.adaptationVector.length,e);for(let u=0;u<s;u++){let c=(u<i.fisherDiagonal.length?i.fisherDiagonal[u]:0)+1e-10;r[u]+=c*i.adaptationVector[u],a[u]+=c}}for(let i=0;i<e;i++)this.microLora.adaptationVector[i]=r[i]/a[i];f.debug("Synced with peers",{peerCount:t.length,peersStored:this.peerStates.size})}getLocalPeerState(t,e){return{peerId:t,domain:e,adaptationVector:new Float32Array(this.microLora.adaptationVector),fisherDiagonal:this.ewc.getFisherDiagonal(),requestCount:this.requestCount,lastUpdateMs:Date.now()}}getEWCMetrics(){let t=this.ewc.getMetrics();return t.regularizationLoss=this.ewc.computeLoss(this.microLora.getEffectiveWeights()),t}getFisherDiagonal(){return this.ewc.getFisherDiagonal()}getOptimalParams(){return this.ewc.getOptimalParams()}loadFisher(t,e){this.ewc.loadFisher(t,e)}getBaseWeights(){return new Float32Array(this.microLora.baseWeights)}setBaseWeights(t){let e=Math.min(t.length,this.microLora.baseWeights.length);for(let r=0;r<e;r++)this.microLora.baseWeights[r]=t[r]}getEffectiveWeights(){return this.microLora.getEffectiveWeights()}getRequestCount(){return this.requestCount}restoreRequestCount(t){this.requestCount=t}getConfig(){return{...this.config}}getPeerStates(){return new Map(this.peerStates)}getMicroLoRA(){return this.microLora}getEWC(){return this.ewc}applyEWCRegularization(){let t=this.config.dimension,e=this.ewc.fisherMatrix,r=this.ewc.optimalParams,a=this.microLora.baseWeights,n=.01;for(let o=0;o<t;o++)if(e[o]>this.config.importanceThreshold){let i=a[o]-r[o];a[o]-=n*e[o]*i}}persistFisher(t,e){let r=this.ewc.getMetrics();t(e,this.ewc.getFisherDiagonal(),this.ewc.getOptimalParams(),this.getBaseWeights(),{taskBoundaries:r.taskBoundariesDetected,consolidationCycles:r.consolidationCycles,requestCount:this.requestCount,ewcLambda:r.lambda}),f.info("Fisher matrix persisted to SQLite",{domain:e,requestCount:this.requestCount,taskBoundaries:r.taskBoundariesDetected})}restoreFisher(t){this.ewc.loadFisher(t.fisherDiagonal,t.optimalParams),t.baseWeights&&this.setBaseWeights(t.baseWeights),this.requestCount=t.requestCount,f.info("Fisher matrix restored from SQLite",{requestCount:t.requestCount,dimension:t.fisherDiagonal.length})}};var Lt={hiddenDim:256,embeddingDim:384,microLoraRank:1,baseLoraRank:8,microLoraLr:.001,baseLoraLr:1e-4,ewcLambda:1e3,patternClusters:50,trajectoryCapacity:1e4,backgroundIntervalMs:36e5,qualityThreshold:.5,enableSimd:!0,minConfidence:.5,maxPatterns:1e4},Q=class{patterns;trajectoryMap;maxPatterns;constructor(t=1e4){this.patterns=new Map,this.trajectoryMap=new Map,this.maxPatterns=t}register(t){if(this.patterns.size>=this.maxPatterns&&!this.patterns.has(t.id)){let e=Array.from(this.patterns.entries()).sort(([,r],[,a])=>(r.lastUsedAt?.getTime()??r.createdAt.getTime())-(a.lastUsedAt?.getTime()??a.createdAt.getTime()))[0];e&&this.patterns.delete(e[0])}this.patterns.set(t.id,t)}get(t){return this.patterns.get(t)}getByTrajectory(t){let e=this.trajectoryMap.get(t);return e?this.patterns.get(e):void 0}associateTrajectory(t,e){this.trajectoryMap.set(t,e)}update(t,e){let r=this.patterns.get(t);return r?(this.patterns.set(t,{...r,...e}),!0):!1}getAll(){return Array.from(this.patterns.values())}getByType(t){return Array.from(this.patterns.values()).filter(e=>e.type===t)}getByDomain(t){return Array.from(this.patterns.values()).filter(e=>e.domain===t)}clear(){this.patterns.clear(),this.trajectoryMap.clear()}size(){return this.patterns.size}},v=class{engine;registry;config;adaptationTimes=[];cacheHits=0;totalAdaptations=0;threeLoopEngine=null;fisherPersistFn=null;fisherDomain="default";constructor(t={}){this.config={...Lt,...t};let e={hiddenDim:this.config.hiddenDim,embeddingDim:this.config.embeddingDim,microLoraRank:this.config.microLoraRank,baseLoraRank:this.config.baseLoraRank,microLoraLr:this.config.microLoraLr,baseLoraLr:this.config.baseLoraLr,ewcLambda:this.config.ewcLambda,patternClusters:this.config.patternClusters,trajectoryCapacity:this.config.trajectoryCapacity,backgroundIntervalMs:this.config.backgroundIntervalMs,qualityThreshold:this.config.qualityThreshold,enableSimd:this.config.enableSimd};this.engine=P.withConfig(e),this.registry=new Q(this.config.maxPatterns??1e4)}async adaptPattern(t,e,r){let a=performance.now();try{let n=this.createStateEmbedding(t),o=this.engine.findPatterns(n,5),i=[];for(let m of o){let g=this.findByRawPattern(m);if(g||(g=this.createQEPatternFromRaw(m,e,r)),g.type===e&&g.domain===r&&g.confidence>=(this.config.minConfidence??.5)){let h=this.calculateSimilarity(n,m.centroid);i.push({pattern:g,similarity:h})}}if(i.length===0){let m=performance.now()-a;return this.recordAdaptation(m),{success:!1,pattern:null,adaptationTimeMs:m,similarity:0,reasoning:"No suitable pattern found"}}let s=i[0],u={...s.pattern,usageCount:s.pattern.usageCount+1,lastUsedAt:new Date};this.registry.update(u.id,u);let c=performance.now()-a;return this.recordAdaptation(c),{success:!0,pattern:u,adaptationTimeMs:c,similarity:s.similarity,reasoning:`Pattern adapted from @ruvector/sona with ${s.similarity.toFixed(3)} similarity`}}catch(n){let o=performance.now()-a;return this.recordAdaptation(o),{success:!1,pattern:null,adaptationTimeMs:o,similarity:0,reasoning:`Adaptation failed: ${n.message}`}}}recallPattern(t,e,r){let a=this.createStateEmbedding(t),n=this.engine.findPatterns(a,1);for(let o of n){let i=this.findByRawPattern(o);if(i&&i.type===e&&i.domain===r)return i}return null}storePattern(t){this.registry.register(t);let e=this.engine.beginTrajectory(t.stateEmbedding),r=this.createActionEmbedding(t.action),a=new Array(r.length).fill(1),n=t.outcome.success?t.outcome.quality:-t.outcome.quality;this.engine.addTrajectoryStep(e,r,a,n),this.engine.endTrajectory(e,t.outcome.quality),this.registry.associateTrajectory(e,t.id)}storePatternsBatch(t){for(let e of t)this.storePattern(e)}createPattern(t,e,r,a,n,o){let i={id:`qesona-${Date.now()}-${Ct().slice(0,7)}`,type:a,domain:n,stateEmbedding:this.createStateEmbedding(t),action:e,outcome:r,confidence:.5,usageCount:0,createdAt:new Date,metadata:o};return this.storePattern(i),i}updatePattern(t,e,r){let a=this.registry.get(t);if(!a)return!1;let n=e?r:-r,i=a.confidence+.1*(n-a.confidence),s={...a,confidence:Math.max(0,Math.min(1,i)),usageCount:a.usageCount+1,lastUsedAt:new Date};return this.registry.update(t,s)}applyMicroLora(t){return this.engine.applyMicroLora(t)}applyBaseLora(t,e){return this.engine.applyBaseLora(t,e)}forceLearn(){return this.engine.forceLearn()}tick(){return this.engine.tick()}getAllPatterns(){return this.registry.getAll()}getPatternsByType(t){return this.registry.getByType(t)}getPatternsByDomain(t){return this.registry.getByDomain(t)}getStats(){let t=this.registry.getAll(),e=this.engine.getStats(),r={"test-generation":0,"defect-prediction":0,"coverage-optimization":0,"quality-assessment":0,"resource-allocation":0};for(let a of t)r[a.type]++;return{totalPatterns:t.length,patternsByType:r,avgAdaptationTimeMs:this.avgAdaptationTime(),minAdaptationTimeMs:this.minAdaptationTime(),maxAdaptationTimeMs:this.maxAdaptationTime(),totalAdaptations:this.totalAdaptations,cacheHitRate:this.totalAdaptations>0?this.cacheHits/this.totalAdaptations:0,engineStats:e}}clear(){this.registry.clear(),this.adaptationTimes=[],this.cacheHits=0,this.totalAdaptations=0}exportPatterns(){return this.registry.getAll()}importPatterns(t){this.clear(),this.storePatternsBatch(t)}getConfig(){return{...this.config}}setEnabled(t){this.engine.setEnabled(t)}isEnabled(){return this.engine.isEnabled()}createStateEmbedding(t){let e=t.features;if(e.length===0)return new Array(this.config.embeddingDim??384).fill(0);let r=Math.max(...e.map(Math.abs));if(r===0)return[...e];let a=e.map(o=>o/r),n=this.config.embeddingDim??384;return a.length>=n?a.slice(0,n):[...a,...new Array(n-a.length).fill(0)]}createActionEmbedding(t){let e=[],r=this.hashCode(t.type);if(e.push(r%1e3/1e3),typeof t.value=="number")e.push(Math.min(1,Math.max(-1,t.value)));else if(typeof t.value=="string"){let n=this.hashCode(t.value);e.push(n%1e3/1e3)}else if(Array.isArray(t.value))for(let n of t.value.slice(0,10))typeof n=="number"&&e.push(Math.min(1,Math.max(-1,n)));let a=this.config.embeddingDim??384;for(;e.length<a;)e.push(0);return e.slice(0,a)}findByRawPattern(t){let e=this.registry.getAll();for(let r of e)if(r.rawPattern?.patternType===t.id)return r}createQEPatternFromRaw(t,e,r){let a={centroid:t.centroid,clusterSize:1,totalWeight:1,avgQuality:t.avgQuality,createdAt:new Date().toISOString(),lastAccessed:new Date().toISOString(),accessCount:0,patternType:t.patternType};return{id:`qesona-${t.id}`,type:e,domain:r,stateEmbedding:t.centroid,action:{type:"learned",value:t.patternType},outcome:{reward:t.avgQuality,success:t.avgQuality>.5,quality:t.avgQuality},confidence:t.avgQuality,usageCount:0,createdAt:new Date,rawPattern:a}}calculateSimilarity(t,e){let r=Math.min(t.length,e.length),a=0,n=0,o=0;for(let s=0;s<r;s++)a+=t[s]*e[s],n+=t[s]*t[s],o+=e[s]*e[s];return(a/(Math.sqrt(n)*Math.sqrt(o)+1e-10)+1)/2}hashCode(t){let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e=e|0;return Math.abs(e)}recordAdaptation(t){this.adaptationTimes.push(t),this.totalAdaptations++,this.adaptationTimes.length>1e3&&this.adaptationTimes.shift()}avgAdaptationTime(){return this.adaptationTimes.length===0?0:this.adaptationTimes.reduce((e,r)=>e+r,0)/this.adaptationTimes.length}minAdaptationTime(){return this.adaptationTimes.length===0?0:Math.min(...this.adaptationTimes)}maxAdaptationTime(){return this.adaptationTimes.length===0?0:Math.max(...this.adaptationTimes)}initThreeLoopEngine(t){this.threeLoopEngine=new C({dimension:this.config.embeddingDim??384,microLoraLr:this.config.microLoraLr??.001,ewcLambda:this.config.ewcLambda??1e3,...t},this.engine)}getThreeLoopEngine(){return this.threeLoopEngine}instantAdapt(t){return this.threeLoopEngine?this.threeLoopEngine.instantAdapt(t):null}recordOutcome(t,e){this.threeLoopEngine&&this.threeLoopEngine.recordOutcome(t,e)}backgroundConsolidate(){if(!this.threeLoopEngine)return null;let t=this.threeLoopEngine.backgroundConsolidate();if(t&&(t.consolidated||t.taskBoundaryDetected)&&this.fisherPersistFn)try{this.threeLoopEngine.persistFisher(this.fisherPersistFn,this.fisherDomain)}catch(e){console.warn("[QESONA] Fisher persistence failed:",e instanceof Error?e.message:e)}return t}setFisherPersistence(t,e){this.fisherPersistFn=t,this.fisherDomain=e}syncWithPeers(t){this.threeLoopEngine&&this.threeLoopEngine.syncWithPeers(t)}getEWCMetrics(){return this.threeLoopEngine?this.threeLoopEngine.getEWCMetrics():null}shouldConsolidate(){return this.threeLoopEngine?this.threeLoopEngine.shouldConsolidate():!1}getLocalPeerState(t,e){return this.threeLoopEngine?this.threeLoopEngine.getLocalPeerState(t,e):null}isThreeLoopEnabled(){return this.threeLoopEngine!==null}async verifyPerformance(t=1e3){let e=[],r={id:"test-state",features:new Array(384).fill(0).map(()=>G())};for(let s=0;s<t;s++){let u=performance.now();await this.adaptPattern(r,"test-generation","test-generation");let c=performance.now();e.push({iteration:s,timeMs:c-u})}let a=e.map(s=>s.timeMs),n=a.reduce((s,u)=>s+u,0)/a.length,o=Math.min(...a),i=Math.max(...a);return{targetMet:n<.05,avgTimeMs:n,minTimeMs:o,maxTimeMs:i,details:e}}};function Tt(l){return new v(l)}function Pt(l,t){return new v({...t,maxPatterns:t?.maxPatterns||5e3})}ot();et();var F=null,D=null,W=null,B=null,z=null,I=null,q=!1;try{let l=(O(),w(N));F=l.FlashAttention,D=l.DotProductAttention,W=l.MultiHeadAttention,B=l.HyperbolicAttention,z=l.LinearAttention,I=l.MoEAttention,q=!0}catch{}function Gt(){return q}function b(){if(!q)throw new Error("@ruvector/attention 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 T={"test-similarity":{dim:384,strategy:"flash",blockSize:64},"code-embedding":{dim:512,strategy:"flash",blockSize:128},"defect-matching":{dim:384,strategy:"flash",blockSize:64},"coverage-analysis":{dim:384,strategy:"flash",blockSize:256},"pattern-adaptation":{dim:256,strategy:"flash",blockSize:32}},Kt={"test-similarity":{enabled:!0,microLoRARank:4,targetAdaptationMs:.05,patternCacheSize:1e3},"code-embedding":{enabled:!0,microLoRARank:2,targetAdaptationMs:.03,patternCacheSize:5e3},"defect-matching":{enabled:!0,microLoRARank:8,targetAdaptationMs:.05,patternCacheSize:2e3},"coverage-analysis":{enabled:!1,microLoRARank:2,targetAdaptationMs:.01,patternCacheSize:100},"pattern-adaptation":{enabled:!0,microLoRARank:2,targetAdaptationMs:.05,patternCacheSize:1e4}},$t={"test-similarity":{latency:{before:50,after:15},memory:{before:200,after:80},throughput:{min:1e3}},"code-embedding":{latency:{before:50,after:15},memory:{before:200,after:80},throughput:{min:2e3}},"defect-matching":{latency:{before:20,after:5},memory:{before:150,after:50},throughput:{min:500}},"coverage-analysis":{latency:{before:100,after:1},memory:{before:100,after:30},throughput:{min:1e4}},"pattern-adaptation":{latency:{before:2,after:.05},memory:{before:50,after:20},throughput:{min:2e4}}};function Zt(l){return l<=128?{queryChunkSize:128,kvChunkSize:128}:l<=256?{queryChunkSize:256,kvChunkSize:256}:l<=512?{queryChunkSize:512,kvChunkSize:512}:l<=1024?{queryChunkSize:1024,kvChunkSize:1024}:{queryChunkSize:1024,kvChunkSize:2048}}var E=class{static create(t){switch(b(),t.strategy){case"flash":return new F(t.dim,t.blockSize);case"dot-product":return new D(t.dim);case"multi-head":return new W(t.dim,t.numHeads??8);case"hyperbolic":return new B(t.dim,t.curvature);case"linear":return new z(t.dim,t.features);case"moe":return I.simple(t.dim,t.moeConfig?.numExperts??8,t.moeConfig?.topK??2);default:return new F(t.dim,t.blockSize)}}},L=class l{attention;config;workload;metrics=[];db=null;persistCount=0;static KV_NAMESPACE="attention-metrics";static KV_TTL=3600;static PERSIST_INTERVAL=10;constructor(t,e){this.workload=t;let r=T[t];this.config={...r,...e},this.attention=E.create(this.config)}async initialize(){try{this.db=K(),this.db.isInitialized()||await this.db.initialize(),await this.loadFromKv()}catch(t){console.warn("[QEFlashAttention] DB init failed, using memory-only:",j(t)),this.db=null}}async computeFlashAttention(t,e,r,a,n){let o=performance.now(),i=process.memoryUsage().heapUsed/1024/1024,s=this.toFloat32Array(t,a,n),u=this.splitMatrix(e,a,n),c=this.splitMatrix(r,a,n),m,g=this.attention;typeof g.compute=="function"?m=g.compute(s,u,c):(b(),m=new F(this.config.dim).compute(s,u,c));let h=performance.now(),d=process.memoryUsage().heapUsed/1024/1024;return this.metrics.push({timeMs:h-o,memoryMB:d-i,speedup:1,throughput:a*a/((h-o)/1e3),peakMemoryMB:d}),this.maybePersistToKv(),m}async computeBaselineAttention(t,e,r,a,n){let o=performance.now(),i=process.memoryUsage().heapUsed/1024/1024,s=new Float32Array(a*a),u=1/Math.sqrt(n);for(let h=0;h<a;h++)for(let d=0;d<a;d++){let A=0;for(let p=0;p<n;p++)A+=t[h*n+p]*e[d*n+p];s[h*a+d]=A*u}for(let h=0;h<a;h++){let d=h*a,A=d+a,p=s.subarray(d,A),tt=Math.max(...p),_=0;for(let y=0;y<a;y++)p[y]=Math.exp(p[y]-tt),_+=p[y];for(let y=0;y<a;y++)p[y]/=_}let c=new Float32Array(a*n);for(let h=0;h<a;h++)for(let d=0;d<a;d++){let A=s[h*a+d];for(let p=0;p<n;p++)c[h*n+p]+=A*r[d*n+p]}let m=performance.now(),g=process.memoryUsage().heapUsed/1024/1024;return c}async computeTestSimilarity(t,e,r=5){let a=e.length,n=t.length,o=new Float32Array(a*n),i=new Float32Array(a*n);for(let m=0;m<a;m++)o.set(t,m*n),i.set(e[m],m*n);let s=new Float32Array(a*n),u=await this.computeFlashAttention(o,i,s,a,n),c=[];for(let m=0;m<a;m++)c.push({index:m,similarity:u[m*n]});return c.sort((m,g)=>g.similarity-m.similarity),c.slice(0,r)}async generateCodeEmbedding(t,e){let r=t.length/e.length,a=e.length;return await this.computeFlashAttention(t,e,t,r,a)}async matchDefectPattern(t,e){let r=e.length,a=t.length,n=new Float32Array(r*a),o=new Float32Array(r*a);for(let c=0;c<r;c++)n.set(t,c*a),o.set(e[c],c*a);let i=new Float32Array(r*a),s=await this.computeFlashAttention(n,o,i,r,a),u=[];for(let c=0;c<r;c++)u.push({pattern:c,score:s[c*a]});return u.sort((c,m)=>m.score-c.score),u}getMetrics(){return[...this.metrics]}getAverageSpeedup(){return this.metrics.length===0?1:this.metrics.reduce((t,e)=>t+e.speedup,0)/this.metrics.length}getConfig(){return{...this.config}}updateConfig(t){this.config={...this.config,...t},this.attention=E.create(this.config)}changeStrategy(t){this.config.strategy=t,this.attention=E.create(this.config)}resetMetrics(){this.metrics=[]}getWorkload(){return this.workload}dispose(){this.metrics=[]}async persistToKv(){if(!this.db)return;let t=`attention-metrics-${this.workload}`,e={workload:this.workload,metrics:this.metrics.slice(-50),savedAt:Date.now()};await this.db.kvSet(t,e,l.KV_NAMESPACE,l.KV_TTL)}async loadFromKv(){if(!this.db)return;let t=`attention-metrics-${this.workload}`,e=await this.db.kvGet(t,l.KV_NAMESPACE);e?.metrics?.length&&(this.metrics=e.metrics)}maybePersistToKv(){this.persistCount++,this.persistCount>=l.PERSIST_INTERVAL&&(this.persistCount=0,this.persistToKv().catch(()=>{}))}toFloat32Array(t,e,r){return t.slice(0,r)}splitMatrix(t,e,r){let a=[];for(let n=0;n<e;n++)a.push(t.slice(n*r,(n+1)*r));return a}};async function Y(l,t){let e=new L(l,t);return await e.initialize(),e}function Jt(l){return{...T[l]}}function Xt(){return Object.keys(T)}function Yt(){return b(),F}function te(){return b(),D}function ee(){return b(),W}function re(){return b(),B}function ae(){return b(),z}function ne(){return b(),I}function ie(l){return l instanceof Float32Array?l:new Float32Array(l)}function oe(l){return Array.from(l)}async function se(l,t,e,r){let a=await Y(l),n=[],o=t[0].length,i=e.length;for(let s of t){let u=new Float32Array(i*o),c=new Float32Array(i*o),m=new Float32Array(i*o);u.set(s,0);for(let h=0;h<i;h++)c.set(e[h],h*o),m.set(r[h],h*o);let g=await a.computeFlashAttention(u,c,m,i,o);n.push(g.slice(0,o))}return a.dispose(),n}function We(){return{"@ruvector/sona":"^0.1.5","@ruvector/attention":"^0.1.4","@ruvector/gnn":"^0.1.22"}}function Be(){let l={sona:!1,attention:!1,gnn:!1,all:!1};try{k(),l.sona=!0}catch{}try{O(),l.attention=!0}catch{}try{let t=(it(),w(nt));t.init();let e=new Float32Array([.1,.2,.3]),r=[new Float32Array([.1,.2,.3]),new Float32Array([.4,.5,.6])],a=t.differentiableSearch(e,r,1,1);a&&Array.isArray(a.indices)&&Array.isArray(a.weights)&&(l.gnn=!0)}catch{}return l.all=l.sona&&l.attention&&l.gnn,l}async function ze(){let{initGNN:l}=await import("./gnn-wrapper-PUL6B7KZ.js");return[l(),"SONA: Ready (no initialization required)","Attention: Ready (no initialization required)"]}export{v as a,Tt as b,Pt as c,Gt as d,T as e,Kt as f,$t as g,Zt as h,L as i,Y as j,Jt as k,Xt as l,Yt as m,te as n,ee as o,re as p,ae as q,ne as r,ie as s,oe as t,se as u,We as v,Be as w,ze as x};
@@ -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.13.10");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.13.12");process.exit(0)}
2
2
  import r from"chalk";function s(e){switch(e){case"healthy":case"completed":return r.green(e);case"idle":return r.cyan(e);case"degraded":case"running":return r.yellow(e);case"unhealthy":case"failed":return r.red(e);default:return r.gray(e)}}function a(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}m`:`${(e/36e5).toFixed(1)}h`}function l(e){let t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4),o=Math.floor(e%6e4/1e3);return`${t}h ${n}m ${o}s`}export{s as a,a as b,l as c};
@@ -1,4 +1,4 @@
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.13.10");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.13.12");process.exit(0)}
2
2
  function l(s,e){let t=s.prepare("SELECT confidence, usage_count, successful_uses FROM qe_patterns WHERE id = ?").get(e.patternId);if(!t)return{updated:!1};let u=e.success?1:0,n=t.usage_count+1,a=t.successful_uses+u,c=a/n,r=Math.min(1,n/100),o=t.confidence*.3+r*.2+c*.5,i=s.prepare(`
3
3
  INSERT INTO qe_pattern_usage (pattern_id, success, metrics_json, feedback)
4
4
  VALUES (?, ?, ?, ?)
@@ -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.13.10");process.exit(0)}
2
- import{l as d}from"./chunk-NBUBGYLE.js";import{a as u,c as g}from"./chunk-OLETDPH2.js";g();var m=[{type:"email",pattern:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,mask:n=>n[0]+"***@"+n.split("@")[1]},{type:"ssn",pattern:/\b\d{3}-\d{2}-\d{4}\b/g,mask:()=>"***-**-****"},{type:"credit-card",pattern:/\b(?:\d[ -]*?){13,19}\b/g,mask:n=>"****-****-****-"+n.replace(/\D/g,"").slice(-4)},{type:"phone",pattern:/\b(?:\+?1[-.\s]?)?(?:\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4}\b/g,mask:n=>n.slice(0,3)+"***"+n.slice(-2)},{type:"api-key",pattern:/(?:key|token|api_key|apikey|secret|password|passwd|auth)=([A-Za-z0-9_\-]{16,})/gi,mask:()=>"***REDACTED***"}],y=class extends d{config={name:"qe/security/url-validate",description:"Validate URL security: checks for XSS/injection patterns, unsafe protocols, and scans URL query parameters for PII exposure (emails, SSNs, credit cards, API keys).",domain:"security-compliance",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{url:{type:"string",description:"URL to validate for security threats and PII exposure"},enablePII:{type:"boolean",description:"Enable PII exposure scanning in URL and query parameters",default:!0}},required:["url"]}}async execute(s,r){try{let e=this.validateURLSecurity(s.url),t=s.enablePII!==!1?this.scanForPII(s.url):{scanned:!1,found:!1,types:[],details:[]},c=e.issues.length+(t.found?t.types.length:0)===0?`URL passed all checks (security: clean, PII: ${t.scanned?"none found":"not scanned"})`:`URL has ${e.issues.length} security issue(s)${t.found?` and ${t.types.length} PII type(s) exposed in URL`:""}`;return{success:!0,data:{url:s.url,urlSecurity:e,piiExposure:t,summary:c}}}catch(e){return{success:!1,error:u(e)}}}validateURLSecurity(s){let r=[],e="none";try{let t=new URL(s);["http:","https:"].includes(t.protocol)||(r.push({type:"unsafe-protocol",description:`Protocol ${t.protocol} is not allowed`,severity:"high"}),e="high");let o=[/<script/i,/javascript:/i,/on\w+=/i,/data:text\/html/i];for(let i of o)if(i.test(s)){r.push({type:"xss",description:"Potential XSS pattern detected in URL",severity:"critical"}),e="critical";break}let c=[/'.*or.*'/i,/union.*select/i,/drop.*table/i,/;\s*--/i];for(let i of c)if(i.test(s)){r.push({type:"sql-injection",description:"Potential SQL injection pattern detected in URL",severity:"critical"}),e="critical";break}/\.\.[/\\]/.test(s)&&(r.push({type:"path-traversal",description:"Potential path traversal pattern (../) detected",severity:"high"}),e!=="critical"&&(e="high"));let a=["redirect","url","next","return","returnUrl","goto"];for(let i of a){let l=t.searchParams.get(i);l&&/^https?:\/\//.test(l)&&(r.push({type:"open-redirect",description:`Query parameter "${i}" contains an external URL \u2014 potential open redirect`,severity:"medium"}),e==="none"&&(e="medium"))}}catch{r.push({type:"invalid-url",description:"URL could not be parsed",severity:"critical"}),e="critical"}return{valid:r.length===0,riskLevel:e,issues:r}}scanForPII(s){let r=[],e=new Set,t;try{t=decodeURIComponent(s)}catch{t=s}let o="",c="";try{let a=new URL(t);o=a.search,c=a.pathname}catch{o=t}for(let{type:a,pattern:i,mask:l}of m){i.lastIndex=0;let p;for(;(p=i.exec(t))!==null;){e.add(a);let h=o.includes(p[0])?"query-parameter":c.includes(p[0])?"path":"url";r.push({type:a,location:h,masked:l(p[0])})}}return{scanned:!0,found:e.size>0,types:Array.from(e),details:r}}};export{y as a};
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.13.12");process.exit(0)}
2
+ import{l as d}from"./chunk-XIKYUBIV.js";import{a as u,c as g}from"./chunk-L3GBNX7B.js";g();var m=[{type:"email",pattern:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,mask:n=>n[0]+"***@"+n.split("@")[1]},{type:"ssn",pattern:/\b\d{3}-\d{2}-\d{4}\b/g,mask:()=>"***-**-****"},{type:"credit-card",pattern:/\b(?:\d[ -]*?){13,19}\b/g,mask:n=>"****-****-****-"+n.replace(/\D/g,"").slice(-4)},{type:"phone",pattern:/\b(?:\+?1[-.\s]?)?(?:\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4}\b/g,mask:n=>n.slice(0,3)+"***"+n.slice(-2)},{type:"api-key",pattern:/(?:key|token|api_key|apikey|secret|password|passwd|auth)=([A-Za-z0-9_\-]{16,})/gi,mask:()=>"***REDACTED***"}],y=class extends d{config={name:"qe/security/url-validate",description:"Validate URL security: checks for XSS/injection patterns, unsafe protocols, and scans URL query parameters for PII exposure (emails, SSNs, credit cards, API keys).",domain:"security-compliance",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{url:{type:"string",description:"URL to validate for security threats and PII exposure"},enablePII:{type:"boolean",description:"Enable PII exposure scanning in URL and query parameters",default:!0}},required:["url"]}}async execute(s,r){try{let e=this.validateURLSecurity(s.url),t=s.enablePII!==!1?this.scanForPII(s.url):{scanned:!1,found:!1,types:[],details:[]},c=e.issues.length+(t.found?t.types.length:0)===0?`URL passed all checks (security: clean, PII: ${t.scanned?"none found":"not scanned"})`:`URL has ${e.issues.length} security issue(s)${t.found?` and ${t.types.length} PII type(s) exposed in URL`:""}`;return{success:!0,data:{url:s.url,urlSecurity:e,piiExposure:t,summary:c}}}catch(e){return{success:!1,error:u(e)}}}validateURLSecurity(s){let r=[],e="none";try{let t=new URL(s);["http:","https:"].includes(t.protocol)||(r.push({type:"unsafe-protocol",description:`Protocol ${t.protocol} is not allowed`,severity:"high"}),e="high");let o=[/<script/i,/javascript:/i,/on\w+=/i,/data:text\/html/i];for(let i of o)if(i.test(s)){r.push({type:"xss",description:"Potential XSS pattern detected in URL",severity:"critical"}),e="critical";break}let c=[/'.*or.*'/i,/union.*select/i,/drop.*table/i,/;\s*--/i];for(let i of c)if(i.test(s)){r.push({type:"sql-injection",description:"Potential SQL injection pattern detected in URL",severity:"critical"}),e="critical";break}/\.\.[/\\]/.test(s)&&(r.push({type:"path-traversal",description:"Potential path traversal pattern (../) detected",severity:"high"}),e!=="critical"&&(e="high"));let a=["redirect","url","next","return","returnUrl","goto"];for(let i of a){let l=t.searchParams.get(i);l&&/^https?:\/\//.test(l)&&(r.push({type:"open-redirect",description:`Query parameter "${i}" contains an external URL \u2014 potential open redirect`,severity:"medium"}),e==="none"&&(e="medium"))}}catch{r.push({type:"invalid-url",description:"URL could not be parsed",severity:"critical"}),e="critical"}return{valid:r.length===0,riskLevel:e,issues:r}}scanForPII(s){let r=[],e=new Set,t;try{t=decodeURIComponent(s)}catch{t=s}let o="",c="";try{let a=new URL(t);o=a.search,c=a.pathname}catch{o=t}for(let{type:a,pattern:i,mask:l}of m){i.lastIndex=0;let p;for(;(p=i.exec(t))!==null;){e.add(a);let h=o.includes(p[0])?"query-parameter":c.includes(p[0])?"path":"url";r.push({type:a,location:h,masked:l(p[0])})}}return{scanned:!0,found:e.size>0,types:Array.from(e),details:r}}};export{y as a};
@@ -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.13.10");process.exit(0)}
2
- import{b as d,d as c}from"./chunk-GQ6H37RN.js";import{a as l,c as g}from"./chunk-OLETDPH2.js";g();c();import{existsSync as y,readFileSync as p}from"node:fs";import{join as o,dirname as u}from"node:path";import{fileURLToPath as m}from"node:url";var i=class extends Error{constructor(t,n,r){super(t);this.code=n;this.cause=r;this.name="PatternLoaderError"}code;cause},s=class a{static instance=null;config;patterns;isLoading=!1;constructor(e={}){this.config={basePath:e.basePath??this.getDefaultBasePath(),throwOnMissing:e.throwOnMissing??!1,validatePatterns:e.validatePatterns??!0},this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]}}static getInstance(e){return a.instance||(a.instance=new a(e)),a.instance}static resetInstance(){a.instance=null}getDefaultBasePath(){try{let e=import.meta.url,t=m(e),n=u(t),r=o(n,"..","..","..");return o(r,"assets","patterns")}catch{return o(process.cwd(),"assets","patterns")}}async loadPatterns(){if(!this.isLoading){this.isLoading=!0,this.patterns.errors=[];try{this.patterns.index=this.loadJsonFile("index.json");let[e,t,n,r]=await Promise.all([Promise.resolve(this.loadJsonFile("adr-051-booster-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-router-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-embedding-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-reasoning-patterns.json"))]);this.patterns.booster=e,this.patterns.router=t,this.patterns.embedding=n,this.patterns.reasoning=r,this.patterns.loadedAt=new Date,this.config.validatePatterns&&this.validateLoadedPatterns()}finally{this.isLoading=!1}}}loadJsonFile(e){let t=o(this.config.basePath,e);try{if(!y(t)){let r=`Pattern file not found: ${t}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"FILE_NOT_FOUND");return null}let n=p(t,"utf-8");return d(n)}catch(n){if(n instanceof i)throw n;let r=`Failed to load pattern file ${e}: ${l(n)}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"PARSE_ERROR",n instanceof Error?n:void 0);return null}}validateLoadedPatterns(){this.patterns.booster&&(Array.isArray(this.patterns.booster.patterns)||this.patterns.errors.push("Booster patterns file missing patterns array")),this.patterns.router&&(Array.isArray(this.patterns.router.patterns)||this.patterns.errors.push("Router patterns file missing patterns array")),this.patterns.embedding&&(Array.isArray(this.patterns.embedding.patterns)||this.patterns.errors.push("Embedding patterns file missing patterns array")),this.patterns.reasoning&&(Array.isArray(this.patterns.reasoning.patterns)||this.patterns.errors.push("Reasoning patterns file missing patterns array"))}async ensureLoaded(){this.patterns.loadedAt||await this.loadPatterns()}async getIndex(){return await this.ensureLoaded(),this.patterns.index}async getBoosterPatterns(){return await this.ensureLoaded(),this.patterns.booster}async getRouterPatterns(){return await this.ensureLoaded(),this.patterns.router}async getEmbeddingPatterns(){return await this.ensureLoaded(),this.patterns.embedding}async getReasoningPatterns(){return await this.ensureLoaded(),this.patterns.reasoning}async getBoosterPatternByKey(e){let t=await this.getBoosterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getRouterPatternByKey(e){let t=await this.getRouterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEmbeddingPatternByKey(e){let t=await this.getEmbeddingPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getReasoningPatternByKey(e){let t=await this.getReasoningPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEligibleBoosterTransforms(){let e=await this.getBoosterPatternByKey("booster-transform-eligibility");return e?e.eligibility_criteria.simple_transforms:[]}async getTierHierarchy(){let e=await this.getRouterPatternByKey("router-5tier-complexity");return e?e.tier_hierarchy:null}async getQualityGateThresholds(){let e=await this.getReasoningPatternByKey("reasoning-pattern-quality-gates");return e?e.gate_thresholds:null}isLoaded(){return this.patterns.loadedAt!==null}getLoadedAt(){return this.patterns.loadedAt}getErrors(){return[...this.patterns.errors]}async getStatistics(){let e=await this.getIndex();return e?e.pattern_statistics:null}async reload(){this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]},await this.loadPatterns()}async getAllPatterns(){return await this.ensureLoaded(),{...this.patterns}}};function x(){return s.getInstance()}export{x as a};
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.13.12");process.exit(0)}
2
+ import{b as d,d as c}from"./chunk-VA2ORJB5.js";import{a as l,c as g}from"./chunk-L3GBNX7B.js";g();c();import{existsSync as y,readFileSync as p}from"node:fs";import{join as o,dirname as u}from"node:path";import{fileURLToPath as m}from"node:url";var i=class extends Error{constructor(t,n,r){super(t);this.code=n;this.cause=r;this.name="PatternLoaderError"}code;cause},s=class a{static instance=null;config;patterns;isLoading=!1;constructor(e={}){this.config={basePath:e.basePath??this.getDefaultBasePath(),throwOnMissing:e.throwOnMissing??!1,validatePatterns:e.validatePatterns??!0},this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]}}static getInstance(e){return a.instance||(a.instance=new a(e)),a.instance}static resetInstance(){a.instance=null}getDefaultBasePath(){try{let e=import.meta.url,t=m(e),n=u(t),r=o(n,"..","..","..");return o(r,"assets","patterns")}catch{return o(process.cwd(),"assets","patterns")}}async loadPatterns(){if(!this.isLoading){this.isLoading=!0,this.patterns.errors=[];try{this.patterns.index=this.loadJsonFile("index.json");let[e,t,n,r]=await Promise.all([Promise.resolve(this.loadJsonFile("adr-051-booster-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-router-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-embedding-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-reasoning-patterns.json"))]);this.patterns.booster=e,this.patterns.router=t,this.patterns.embedding=n,this.patterns.reasoning=r,this.patterns.loadedAt=new Date,this.config.validatePatterns&&this.validateLoadedPatterns()}finally{this.isLoading=!1}}}loadJsonFile(e){let t=o(this.config.basePath,e);try{if(!y(t)){let r=`Pattern file not found: ${t}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"FILE_NOT_FOUND");return null}let n=p(t,"utf-8");return d(n)}catch(n){if(n instanceof i)throw n;let r=`Failed to load pattern file ${e}: ${l(n)}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"PARSE_ERROR",n instanceof Error?n:void 0);return null}}validateLoadedPatterns(){this.patterns.booster&&(Array.isArray(this.patterns.booster.patterns)||this.patterns.errors.push("Booster patterns file missing patterns array")),this.patterns.router&&(Array.isArray(this.patterns.router.patterns)||this.patterns.errors.push("Router patterns file missing patterns array")),this.patterns.embedding&&(Array.isArray(this.patterns.embedding.patterns)||this.patterns.errors.push("Embedding patterns file missing patterns array")),this.patterns.reasoning&&(Array.isArray(this.patterns.reasoning.patterns)||this.patterns.errors.push("Reasoning patterns file missing patterns array"))}async ensureLoaded(){this.patterns.loadedAt||await this.loadPatterns()}async getIndex(){return await this.ensureLoaded(),this.patterns.index}async getBoosterPatterns(){return await this.ensureLoaded(),this.patterns.booster}async getRouterPatterns(){return await this.ensureLoaded(),this.patterns.router}async getEmbeddingPatterns(){return await this.ensureLoaded(),this.patterns.embedding}async getReasoningPatterns(){return await this.ensureLoaded(),this.patterns.reasoning}async getBoosterPatternByKey(e){let t=await this.getBoosterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getRouterPatternByKey(e){let t=await this.getRouterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEmbeddingPatternByKey(e){let t=await this.getEmbeddingPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getReasoningPatternByKey(e){let t=await this.getReasoningPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEligibleBoosterTransforms(){let e=await this.getBoosterPatternByKey("booster-transform-eligibility");return e?e.eligibility_criteria.simple_transforms:[]}async getTierHierarchy(){let e=await this.getRouterPatternByKey("router-5tier-complexity");return e?e.tier_hierarchy:null}async getQualityGateThresholds(){let e=await this.getReasoningPatternByKey("reasoning-pattern-quality-gates");return e?e.gate_thresholds:null}isLoaded(){return this.patterns.loadedAt!==null}getLoadedAt(){return this.patterns.loadedAt}getErrors(){return[...this.patterns.errors]}async getStatistics(){let e=await this.getIndex();return e?e.pattern_statistics:null}async reload(){this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]},await this.loadPatterns()}async getAllPatterns(){return await this.ensureLoaded(),{...this.patterns}}};function x(){return s.getInstance()}export{x as a};
@@ -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.13.10");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.13.12");process.exit(0)}
2
2
  import{existsSync as c,readFileSync as f}from"fs";import{join as p,dirname as i}from"path";import{fileURLToPath as s}from"url";function u(o,a=10){let t=i(s(o));for(let r=0;r<a;r++){let n=p(t,"package.json");if(c(n))try{if(JSON.parse(f(n,"utf-8")).name==="agentic-qe")return t}catch{}let e=i(t);if(e===t)break;t=e}return null}export{u as a};
@@ -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.13.10");process.exit(0)}
2
- import{c as s,e as t}from"./chunk-W3DCBOLL.js";var K={};t(K,{DEFAULT_FEATURE_FLAGS:()=>r,getRuVectorFeatureFlags:()=>u,getRvfMigrationStage:()=>H,initFeatureFlagsFromEnv:()=>z,isAgentMemoryBranchingEnabled:()=>I,isCNNVisualRegressionEnabled:()=>b,isCognitiveRoutingEnabled:()=>Y,isCoherenceActionGateEnabled:()=>A,isCoherenceGateEnabled:()=>f,isColdTierGNNEnabled:()=>P,isCrossDomainTransferEnabled:()=>N,isCusumDriftDetectionEnabled:()=>F,isDAGAttentionEnabled:()=>g,isDeltaEventSourcingEnabled:()=>M,isDeterministicDitherEnabled:()=>T,isEpropOnlineLearningEnabled:()=>Q,isEwcPlusPlusEnabled:()=>L,isFlashAttentionEnabled:()=>E,isGNNIndexEnabled:()=>R,isGrangerCausalityEnabled:()=>B,isGraphMAEEnabled:()=>x,isHDCFingerprintingEnabled:()=>D,isHnswHealthMonitorEnabled:()=>U,isHopfieldMemoryEnabled:()=>h,isHyperbolicHnswEnabled:()=>k,isMetaLearningEnabled:()=>m,isMetadataFilteringEnabled:()=>S,isNativeHNSWEnabled:()=>_,isNeuralRoutingEnabled:()=>C,isRVFPatternStoreEnabled:()=>V,isReasoningQECEnabled:()=>v,isRegretTrackingEnabled:()=>O,isReservoirReplayEnabled:()=>w,isSONAEnabled:()=>a,isSONAThreeLoopEnabled:()=>p,isSpectralSparsificationEnabled:()=>W,isSublinearSolverEnabled:()=>y,isTemporalCompressionEnabled:()=>c,isUnifiedHnswEnabled:()=>G,isWitnessChainEnabled:()=>d,resetRuVectorFeatureFlags:()=>i,setRuVectorFeatureFlags:()=>o,shouldLogMigrationMetrics:()=>l});function u(){return{...e}}function o(n){e={...e,...n}}function i(){e={...r}}function a(){return e.useQESONA}function E(){return e.useQEFlashAttention}function R(){return e.useQEGNNIndex}function l(){return e.logMigrationMetrics}function _(){return e.useNativeHNSW}function c(){return e.useTemporalCompression}function S(){return e.useMetadataFiltering}function T(){return e.useDeterministicDither}function C(){return e.useNeuralRouting}function p(){return e.useSONAThreeLoop}function N(){return e.useCrossDomainTransfer}function U(){return e.useHnswHealthMonitor}function O(){return e.useRegretTracking}function f(){return e.useCoherenceGate}function d(){return e.useWitnessChain}function b(){return e.useCNNVisualRegression}function g(){return e.useDAGAttention}function A(){return e.useCoherenceActionGate}function v(){return e.useReasoningQEC}function V(){return e.useRVFPatternStore}function I(){return e.useAgentMemoryBranching}function G(){return e.useUnifiedHnsw}function H(){return e.rvfMigrationStage}function D(){return e.useHDCFingerprinting}function F(){return e.useCusumDriftDetection}function M(){return e.useDeltaEventSourcing}function L(){return e.useEwcPlusPlusRegularization}function x(){return e.useGraphMAEEmbeddings}function h(){return e.useHopfieldMemory}function P(){return e.useColdTierGNN}function m(){return e.useMetaLearningEnhancements}function y(){return e.useSublinearSolver}function W(){return e.useSpectralSparsification}function w(){return e.useReservoirReplay}function Q(){return e.useEpropOnlineLearning}function B(){return e.useGrangerCausality}function Y(){return e.useCognitiveRouting}function k(){return e.useHyperbolicHnsw}function z(){let n={};process.env.RUVECTOR_USE_RVF_PATTERN_STORE!==void 0&&(n.useRVFPatternStore=process.env.RUVECTOR_USE_RVF_PATTERN_STORE==="true"),process.env.RUVECTOR_USE_SONA!==void 0&&(n.useQESONA=process.env.RUVECTOR_USE_SONA==="true"),process.env.RUVECTOR_USE_FLASH_ATTENTION!==void 0&&(n.useQEFlashAttention=process.env.RUVECTOR_USE_FLASH_ATTENTION==="true"),process.env.RUVECTOR_USE_GNN_INDEX!==void 0&&(n.useQEGNNIndex=process.env.RUVECTOR_USE_GNN_INDEX==="true"),process.env.RUVECTOR_LOG_MIGRATION_METRICS!==void 0&&(n.logMigrationMetrics=process.env.RUVECTOR_LOG_MIGRATION_METRICS==="true"),process.env.RUVECTOR_USE_NATIVE_HNSW!==void 0&&(n.useNativeHNSW=process.env.RUVECTOR_USE_NATIVE_HNSW==="true"),process.env.RUVECTOR_USE_TEMPORAL_COMPRESSION!==void 0&&(n.useTemporalCompression=process.env.RUVECTOR_USE_TEMPORAL_COMPRESSION==="true"),process.env.RUVECTOR_USE_METADATA_FILTERING!==void 0&&(n.useMetadataFiltering=process.env.RUVECTOR_USE_METADATA_FILTERING==="true"),process.env.RUVECTOR_USE_DETERMINISTIC_DITHER!==void 0&&(n.useDeterministicDither=process.env.RUVECTOR_USE_DETERMINISTIC_DITHER==="true"),process.env.RUVECTOR_USE_NEURAL_ROUTING!==void 0&&(n.useNeuralRouting=process.env.RUVECTOR_USE_NEURAL_ROUTING==="true"),process.env.RUVECTOR_USE_SONA_THREE_LOOP!==void 0&&(n.useSONAThreeLoop=process.env.RUVECTOR_USE_SONA_THREE_LOOP==="true"),process.env.RUVECTOR_USE_CROSS_DOMAIN_TRANSFER!==void 0&&(n.useCrossDomainTransfer=process.env.RUVECTOR_USE_CROSS_DOMAIN_TRANSFER==="true"),process.env.RUVECTOR_USE_HNSW_HEALTH_MONITOR!==void 0&&(n.useHnswHealthMonitor=process.env.RUVECTOR_USE_HNSW_HEALTH_MONITOR==="true"),process.env.RUVECTOR_USE_REGRET_TRACKING!==void 0&&(n.useRegretTracking=process.env.RUVECTOR_USE_REGRET_TRACKING==="true"),process.env.RUVECTOR_USE_COHERENCE_GATE!==void 0&&(n.useCoherenceGate=process.env.RUVECTOR_USE_COHERENCE_GATE==="true"),process.env.RUVECTOR_USE_WITNESS_CHAIN!==void 0&&(n.useWitnessChain=process.env.RUVECTOR_USE_WITNESS_CHAIN==="true"),process.env.RUVECTOR_USE_CNN_VISUAL_REGRESSION!==void 0&&(n.useCNNVisualRegression=process.env.RUVECTOR_USE_CNN_VISUAL_REGRESSION==="true"),process.env.RUVECTOR_USE_DAG_ATTENTION!==void 0&&(n.useDAGAttention=process.env.RUVECTOR_USE_DAG_ATTENTION==="true"),process.env.RUVECTOR_USE_COHERENCE_ACTION_GATE!==void 0&&(n.useCoherenceActionGate=process.env.RUVECTOR_USE_COHERENCE_ACTION_GATE==="true"),process.env.RUVECTOR_USE_REASONING_QEC!==void 0&&(n.useReasoningQEC=process.env.RUVECTOR_USE_REASONING_QEC==="true"),process.env.RUVECTOR_USE_HDC_FINGERPRINTING!==void 0&&(n.useHDCFingerprinting=process.env.RUVECTOR_USE_HDC_FINGERPRINTING==="true"),process.env.RUVECTOR_USE_CUSUM_DRIFT_DETECTION!==void 0&&(n.useCusumDriftDetection=process.env.RUVECTOR_USE_CUSUM_DRIFT_DETECTION==="true"),process.env.RUVECTOR_USE_DELTA_EVENT_SOURCING!==void 0&&(n.useDeltaEventSourcing=process.env.RUVECTOR_USE_DELTA_EVENT_SOURCING==="true"),process.env.RUVECTOR_USE_EWC_PLUS_PLUS!==void 0&&(n.useEwcPlusPlusRegularization=process.env.RUVECTOR_USE_EWC_PLUS_PLUS==="true"),process.env.RUVECTOR_USE_META_LEARNING!==void 0&&(n.useMetaLearningEnhancements=process.env.RUVECTOR_USE_META_LEARNING==="true"),process.env.RUVECTOR_USE_SUBLINEAR_SOLVER!==void 0&&(n.useSublinearSolver=process.env.RUVECTOR_USE_SUBLINEAR_SOLVER==="true"),process.env.RUVECTOR_USE_SPECTRAL_SPARSIFICATION!==void 0&&(n.useSpectralSparsification=process.env.RUVECTOR_USE_SPECTRAL_SPARSIFICATION==="true"),process.env.RUVECTOR_USE_RESERVOIR_REPLAY!==void 0&&(n.useReservoirReplay=process.env.RUVECTOR_USE_RESERVOIR_REPLAY==="true"),process.env.RUVECTOR_USE_EPROP_ONLINE_LEARNING!==void 0&&(n.useEpropOnlineLearning=process.env.RUVECTOR_USE_EPROP_ONLINE_LEARNING==="true"),process.env.RUVECTOR_USE_GRANGER_CAUSALITY!==void 0&&(n.useGrangerCausality=process.env.RUVECTOR_USE_GRANGER_CAUSALITY==="true"),process.env.RUVECTOR_USE_COGNITIVE_ROUTING!==void 0&&(n.useCognitiveRouting=process.env.RUVECTOR_USE_COGNITIVE_ROUTING==="true"),process.env.RUVECTOR_USE_HYPERBOLIC_HNSW!==void 0&&(n.useHyperbolicHnsw=process.env.RUVECTOR_USE_HYPERBOLIC_HNSW==="true"),o(n)}var r,e,X=s(()=>{r={useQESONA:!0,useQEFlashAttention:!0,useQEGNNIndex:!0,logMigrationMetrics:!0,useNativeHNSW:!0,useTemporalCompression:!0,useMetadataFiltering:!0,useDeterministicDither:!0,useNeuralRouting:!0,useSONAThreeLoop:!0,useCrossDomainTransfer:!0,useHnswHealthMonitor:!0,useRegretTracking:!0,useCoherenceGate:!0,useWitnessChain:!0,useCNNVisualRegression:!0,useDAGAttention:!0,useCoherenceActionGate:!0,useReasoningQEC:!0,useRVFPatternStore:!0,useAgentMemoryBranching:!0,useUnifiedHnsw:!0,rvfMigrationStage:2,useHDCFingerprinting:!0,useCusumDriftDetection:!0,useDeltaEventSourcing:!0,useEwcPlusPlusRegularization:!0,useGraphMAEEmbeddings:!0,useHopfieldMemory:!0,useColdTierGNN:!0,useMetaLearningEnhancements:!0,useSublinearSolver:!0,useSpectralSparsification:!0,useReservoirReplay:!0,useEpropOnlineLearning:!0,useGrangerCausality:!0,useCognitiveRouting:!1,useHyperbolicHnsw:!1},e={...r}});export{r as a,u as b,o as c,i as d,a as e,E as f,R as g,l as h,_ as i,c as j,S as k,T as l,C as m,p as n,N as o,U as p,O as q,f as r,d as s,b as t,g as u,A as v,v as w,V as x,I as y,G as z,H as A,D as B,F as C,M as D,L as E,x as F,h as G,P as H,m as I,y as J,W as K,w as L,Q as M,B as N,Y as O,k as P,z as Q,K as R,X as S};
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.13.12");process.exit(0)}
2
+ import{c as s,e as t}from"./chunk-ZMYV4R32.js";var K={};t(K,{DEFAULT_FEATURE_FLAGS:()=>r,getRuVectorFeatureFlags:()=>u,getRvfMigrationStage:()=>H,initFeatureFlagsFromEnv:()=>z,isAgentMemoryBranchingEnabled:()=>I,isCNNVisualRegressionEnabled:()=>b,isCognitiveRoutingEnabled:()=>Y,isCoherenceActionGateEnabled:()=>A,isCoherenceGateEnabled:()=>f,isColdTierGNNEnabled:()=>P,isCrossDomainTransferEnabled:()=>N,isCusumDriftDetectionEnabled:()=>F,isDAGAttentionEnabled:()=>g,isDeltaEventSourcingEnabled:()=>M,isDeterministicDitherEnabled:()=>T,isEpropOnlineLearningEnabled:()=>Q,isEwcPlusPlusEnabled:()=>L,isFlashAttentionEnabled:()=>E,isGNNIndexEnabled:()=>R,isGrangerCausalityEnabled:()=>B,isGraphMAEEnabled:()=>x,isHDCFingerprintingEnabled:()=>D,isHnswHealthMonitorEnabled:()=>U,isHopfieldMemoryEnabled:()=>h,isHyperbolicHnswEnabled:()=>k,isMetaLearningEnabled:()=>m,isMetadataFilteringEnabled:()=>S,isNativeHNSWEnabled:()=>_,isNeuralRoutingEnabled:()=>C,isRVFPatternStoreEnabled:()=>V,isReasoningQECEnabled:()=>v,isRegretTrackingEnabled:()=>O,isReservoirReplayEnabled:()=>w,isSONAEnabled:()=>a,isSONAThreeLoopEnabled:()=>p,isSpectralSparsificationEnabled:()=>W,isSublinearSolverEnabled:()=>y,isTemporalCompressionEnabled:()=>c,isUnifiedHnswEnabled:()=>G,isWitnessChainEnabled:()=>d,resetRuVectorFeatureFlags:()=>i,setRuVectorFeatureFlags:()=>o,shouldLogMigrationMetrics:()=>l});function u(){return{...e}}function o(n){e={...e,...n}}function i(){e={...r}}function a(){return e.useQESONA}function E(){return e.useQEFlashAttention}function R(){return e.useQEGNNIndex}function l(){return e.logMigrationMetrics}function _(){return e.useNativeHNSW}function c(){return e.useTemporalCompression}function S(){return e.useMetadataFiltering}function T(){return e.useDeterministicDither}function C(){return e.useNeuralRouting}function p(){return e.useSONAThreeLoop}function N(){return e.useCrossDomainTransfer}function U(){return e.useHnswHealthMonitor}function O(){return e.useRegretTracking}function f(){return e.useCoherenceGate}function d(){return e.useWitnessChain}function b(){return e.useCNNVisualRegression}function g(){return e.useDAGAttention}function A(){return e.useCoherenceActionGate}function v(){return e.useReasoningQEC}function V(){return e.useRVFPatternStore}function I(){return e.useAgentMemoryBranching}function G(){return e.useUnifiedHnsw}function H(){return e.rvfMigrationStage}function D(){return e.useHDCFingerprinting}function F(){return e.useCusumDriftDetection}function M(){return e.useDeltaEventSourcing}function L(){return e.useEwcPlusPlusRegularization}function x(){return e.useGraphMAEEmbeddings}function h(){return e.useHopfieldMemory}function P(){return e.useColdTierGNN}function m(){return e.useMetaLearningEnhancements}function y(){return e.useSublinearSolver}function W(){return e.useSpectralSparsification}function w(){return e.useReservoirReplay}function Q(){return e.useEpropOnlineLearning}function B(){return e.useGrangerCausality}function Y(){return e.useCognitiveRouting}function k(){return e.useHyperbolicHnsw}function z(){let n={};process.env.RUVECTOR_USE_RVF_PATTERN_STORE!==void 0&&(n.useRVFPatternStore=process.env.RUVECTOR_USE_RVF_PATTERN_STORE==="true"),process.env.RUVECTOR_USE_SONA!==void 0&&(n.useQESONA=process.env.RUVECTOR_USE_SONA==="true"),process.env.RUVECTOR_USE_FLASH_ATTENTION!==void 0&&(n.useQEFlashAttention=process.env.RUVECTOR_USE_FLASH_ATTENTION==="true"),process.env.RUVECTOR_USE_GNN_INDEX!==void 0&&(n.useQEGNNIndex=process.env.RUVECTOR_USE_GNN_INDEX==="true"),process.env.RUVECTOR_LOG_MIGRATION_METRICS!==void 0&&(n.logMigrationMetrics=process.env.RUVECTOR_LOG_MIGRATION_METRICS==="true"),process.env.RUVECTOR_USE_NATIVE_HNSW!==void 0&&(n.useNativeHNSW=process.env.RUVECTOR_USE_NATIVE_HNSW==="true"),process.env.RUVECTOR_USE_TEMPORAL_COMPRESSION!==void 0&&(n.useTemporalCompression=process.env.RUVECTOR_USE_TEMPORAL_COMPRESSION==="true"),process.env.RUVECTOR_USE_METADATA_FILTERING!==void 0&&(n.useMetadataFiltering=process.env.RUVECTOR_USE_METADATA_FILTERING==="true"),process.env.RUVECTOR_USE_DETERMINISTIC_DITHER!==void 0&&(n.useDeterministicDither=process.env.RUVECTOR_USE_DETERMINISTIC_DITHER==="true"),process.env.RUVECTOR_USE_NEURAL_ROUTING!==void 0&&(n.useNeuralRouting=process.env.RUVECTOR_USE_NEURAL_ROUTING==="true"),process.env.RUVECTOR_USE_SONA_THREE_LOOP!==void 0&&(n.useSONAThreeLoop=process.env.RUVECTOR_USE_SONA_THREE_LOOP==="true"),process.env.RUVECTOR_USE_CROSS_DOMAIN_TRANSFER!==void 0&&(n.useCrossDomainTransfer=process.env.RUVECTOR_USE_CROSS_DOMAIN_TRANSFER==="true"),process.env.RUVECTOR_USE_HNSW_HEALTH_MONITOR!==void 0&&(n.useHnswHealthMonitor=process.env.RUVECTOR_USE_HNSW_HEALTH_MONITOR==="true"),process.env.RUVECTOR_USE_REGRET_TRACKING!==void 0&&(n.useRegretTracking=process.env.RUVECTOR_USE_REGRET_TRACKING==="true"),process.env.RUVECTOR_USE_COHERENCE_GATE!==void 0&&(n.useCoherenceGate=process.env.RUVECTOR_USE_COHERENCE_GATE==="true"),process.env.RUVECTOR_USE_WITNESS_CHAIN!==void 0&&(n.useWitnessChain=process.env.RUVECTOR_USE_WITNESS_CHAIN==="true"),process.env.RUVECTOR_USE_CNN_VISUAL_REGRESSION!==void 0&&(n.useCNNVisualRegression=process.env.RUVECTOR_USE_CNN_VISUAL_REGRESSION==="true"),process.env.RUVECTOR_USE_DAG_ATTENTION!==void 0&&(n.useDAGAttention=process.env.RUVECTOR_USE_DAG_ATTENTION==="true"),process.env.RUVECTOR_USE_COHERENCE_ACTION_GATE!==void 0&&(n.useCoherenceActionGate=process.env.RUVECTOR_USE_COHERENCE_ACTION_GATE==="true"),process.env.RUVECTOR_USE_REASONING_QEC!==void 0&&(n.useReasoningQEC=process.env.RUVECTOR_USE_REASONING_QEC==="true"),process.env.RUVECTOR_USE_HDC_FINGERPRINTING!==void 0&&(n.useHDCFingerprinting=process.env.RUVECTOR_USE_HDC_FINGERPRINTING==="true"),process.env.RUVECTOR_USE_CUSUM_DRIFT_DETECTION!==void 0&&(n.useCusumDriftDetection=process.env.RUVECTOR_USE_CUSUM_DRIFT_DETECTION==="true"),process.env.RUVECTOR_USE_DELTA_EVENT_SOURCING!==void 0&&(n.useDeltaEventSourcing=process.env.RUVECTOR_USE_DELTA_EVENT_SOURCING==="true"),process.env.RUVECTOR_USE_EWC_PLUS_PLUS!==void 0&&(n.useEwcPlusPlusRegularization=process.env.RUVECTOR_USE_EWC_PLUS_PLUS==="true"),process.env.RUVECTOR_USE_META_LEARNING!==void 0&&(n.useMetaLearningEnhancements=process.env.RUVECTOR_USE_META_LEARNING==="true"),process.env.RUVECTOR_USE_SUBLINEAR_SOLVER!==void 0&&(n.useSublinearSolver=process.env.RUVECTOR_USE_SUBLINEAR_SOLVER==="true"),process.env.RUVECTOR_USE_SPECTRAL_SPARSIFICATION!==void 0&&(n.useSpectralSparsification=process.env.RUVECTOR_USE_SPECTRAL_SPARSIFICATION==="true"),process.env.RUVECTOR_USE_RESERVOIR_REPLAY!==void 0&&(n.useReservoirReplay=process.env.RUVECTOR_USE_RESERVOIR_REPLAY==="true"),process.env.RUVECTOR_USE_EPROP_ONLINE_LEARNING!==void 0&&(n.useEpropOnlineLearning=process.env.RUVECTOR_USE_EPROP_ONLINE_LEARNING==="true"),process.env.RUVECTOR_USE_GRANGER_CAUSALITY!==void 0&&(n.useGrangerCausality=process.env.RUVECTOR_USE_GRANGER_CAUSALITY==="true"),process.env.RUVECTOR_USE_COGNITIVE_ROUTING!==void 0&&(n.useCognitiveRouting=process.env.RUVECTOR_USE_COGNITIVE_ROUTING==="true"),process.env.RUVECTOR_USE_HYPERBOLIC_HNSW!==void 0&&(n.useHyperbolicHnsw=process.env.RUVECTOR_USE_HYPERBOLIC_HNSW==="true"),o(n)}var r,e,X=s(()=>{r={useQESONA:!0,useQEFlashAttention:!0,useQEGNNIndex:!0,logMigrationMetrics:!0,useNativeHNSW:!0,useTemporalCompression:!0,useMetadataFiltering:!0,useDeterministicDither:!0,useNeuralRouting:!0,useSONAThreeLoop:!0,useCrossDomainTransfer:!0,useHnswHealthMonitor:!0,useRegretTracking:!0,useCoherenceGate:!0,useWitnessChain:!0,useCNNVisualRegression:!0,useDAGAttention:!0,useCoherenceActionGate:!0,useReasoningQEC:!0,useRVFPatternStore:!0,useAgentMemoryBranching:!0,useUnifiedHnsw:!0,rvfMigrationStage:2,useHDCFingerprinting:!0,useCusumDriftDetection:!0,useDeltaEventSourcing:!0,useEwcPlusPlusRegularization:!0,useGraphMAEEmbeddings:!0,useHopfieldMemory:!0,useColdTierGNN:!0,useMetaLearningEnhancements:!0,useSublinearSolver:!0,useSpectralSparsification:!0,useReservoirReplay:!0,useEpropOnlineLearning:!0,useGrangerCausality:!0,useCognitiveRouting:!1,useHyperbolicHnsw:!1},e={...r}});export{r as a,u as b,o as c,i as d,a as e,E as f,R as g,l as h,_ as i,c as j,S as k,T as l,C as m,p as n,N as o,U as p,O as q,f as r,d as s,b as t,g as u,A as v,v as w,V as x,I as y,G as z,H as A,D as B,F as C,M as D,L as E,x as F,h as G,P as H,m as I,y as J,W as K,w as L,Q as M,B as N,Y as O,k as P,z as Q,K as R,X as S};
@@ -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.13.10");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.13.12");process.exit(0)}
2
2
  import a from"chalk";import{existsSync as m,statSync as S}from"fs";import{join as p,relative as P}from"path";var l=class{static prompt(t,e){return new Promise(r=>{t.question(e,s=>{r(s)})})}static printStepHeader(t,e,r){console.log(""),console.log(a.cyan(`Step ${t}: ${e}`)),r&&console.log(a.gray(r)),console.log("")}static printWizardHeader(t,e){console.log(""),console.log(a.blue("========================================")),console.log(a.blue.bold(` ${t}`)),console.log(a.blue("========================================")),e&&console.log(a.gray(e)),console.log(a.gray("Press Ctrl+C to cancel at any time")),console.log("")}static printSummaryHeader(){console.log(""),console.log(a.blue("========================================")),console.log(a.blue.bold(" Configuration Summary")),console.log(a.blue("========================================")),console.log("")}static printSummaryField(t,e,r){let s=r?.indent??" ",i=r?.maxItems??5,c=r?.formatValue??(o=>a.cyan(o));if(Array.isArray(e))e.length===0?console.log(a.white(`${s}${t}: ${a.gray("(none)")}`)):e.length<=i?console.log(a.white(`${s}${t}: ${c(e.join(", "))}`)):(console.log(a.white(`${s}${t}:`)),e.slice(0,i).forEach(o=>{console.log(a.gray(`${s} - ${o}`))}),console.log(a.gray(`${s} ... and ${e.length-i} more`)));else{let o=t.padEnd(16);console.log(a.white(`${s}${o}${c(e)}`))}}static printDerivedSettings(t,e=" "){console.log(""),console.log(a.gray(`${e}Derived settings:`));for(let[r,s]of Object.entries(t))console.log(a.gray(`${e} ${r}: ${s}`));console.log("")}};var h=class u{static getSourceDirectories(t){let e=[],r=["src","lib","app","packages","api"];for(let s of r){let i=p(t,s);m(i)&&S(i).isDirectory()&&e.push(s)}return e}static getCoverageTargets(t){let e=u.getSourceDirectories(t),r=["coverage","coverage/lcov.info","coverage/coverage-final.json",".nyc_output"];for(let s of r){let i=p(t,s);m(i)&&e.push(s)}return e}static getSecurityTargets(t){let e=u.getSourceDirectories(t),r=["package.json","package-lock.json","yarn.lock","pnpm-lock.yaml",".env",".env.example","docker-compose.yml","Dockerfile"];for(let s of r){let i=p(t,s);m(i)&&e.push(s)}return e}static getTestSourceFiles(t){let e=[],r=["src","lib","app","packages"];for(let s of r){let i=p(t,s);m(i)&&S(i).isDirectory()&&(e.push(`${s}/**/*.ts`),e.push(s))}return m(p(t,"src"))&&(e.push("src/services/**/*.ts"),e.push("src/utils/**/*.ts"),e.push("src/components/**/*.tsx")),e}static checkPatternsExist(t){return[p(t,".agentic-qe","patterns"),p(t,".agentic-qe","memory.db"),p(t,".aqe","patterns"),p(t,"data","patterns")].some(r=>m(r))}},f=class{static relativePath(t,e){return P(e,t)||"."}static yesNo(t){return t?"Yes":"No"}static enabledDisabled(t){return t?"Enabled":"Disabled"}static percentage(t){return`${t}%`}static truncatedList(t,e=5){return t.length===0?"(none)":t.length<=e?t.join(", "):`${t.slice(0,e).join(", ")}... and ${t.length-e} more`}};import n from"chalk";import{existsSync as w}from"fs";import{resolve as I}from"path";var d=class{constructor(t){this.defaultValue=t}defaultValue;description;getDefaultValue(){return this.defaultValue}success(t){return{value:t,continue:!0}}cancelled(){return{value:this.defaultValue,continue:!1}}error(t){return{value:this.defaultValue,continue:!1,error:t}}};var y=class extends d{id;stepNumber;title;description;options;validValues;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.options=t.options,this.validValues=t.validValues}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.options.forEach(i=>{let c=[];i.isRecommended?c.push(n.green(" (recommended)")):(i.isDefault||i.value===this.defaultValue)&&c.push(n.green(" (default)")),console.log(n.white(` ${i.key}. ${i.label||i.value}${c.join("")}`)),i.description&&console.log(n.gray(` ${i.description}`))}),console.log("");let r=(await l.prompt(t.rl,`Select ${this.title.toLowerCase()} [${n.gray(String(this.defaultValue))}]: `)).trim();if(!r)return this.success(this.defaultValue);let s=parseInt(r,10);return s>=1&&s<=this.options.length?this.success(this.options[s-1].value):this.validValues.includes(r)?this.success(r):(console.log(n.yellow(` Invalid input, using default: ${this.defaultValue}`)),this.success(this.defaultValue))}},b=class extends d{id;stepNumber;title;description;options;validValues;instructions;allowEmpty;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.options=t.options,this.validValues=t.validValues,this.instructions=t.instructions,this.allowEmpty=t.allowEmpty??!1}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.instructions&&(console.log(n.gray(this.instructions)),console.log("")),this.options.forEach(o=>{let N=o.isDefaultSelected||this.defaultValue.includes(o.value)?n.green(" *"):"";console.log(n.white(` ${o.key}. ${o.label||o.value}${N}`)),o.description&&console.log(n.gray(` ${o.description}`))}),console.log(""),console.log(n.gray(" * = included in default selection")),console.log("");let e=this.defaultValue.join(","),s=(await l.prompt(t.rl,`Select options [${n.gray(e)}]: `)).trim();if(!s)return this.success(this.defaultValue);let i=s.split(",").map(o=>o.trim().toLowerCase()).filter(o=>o.length>0),c=[];for(let o of i){let g=parseInt(o,10);g>=1&&g<=this.options.length?c.push(this.options[g-1].value):this.validValues.includes(o)&&c.push(o)}return c.length===0?this.allowEmpty?this.success([]):(console.log(n.yellow(` Invalid input, using default: ${e}`)),this.success(this.defaultValue)):this.success([...new Set(c)])}},v=class extends d{id;stepNumber;title;description;additionalInfo;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.additionalInfo=t.additionalInfo}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.additionalInfo&&(console.log(n.gray(this.additionalInfo)),console.log(""));let e=this.defaultValue?"Y/n":"y/N",s=(await l.prompt(t.rl,`${this.title}? [${n.gray(e)}]: `)).trim().toLowerCase();return s===""?this.success(this.defaultValue):s==="n"||s==="no"?this.success(!1):s==="y"||s==="yes"?this.success(!0):this.success(this.defaultValue)}},x=class extends d{id;stepNumber;title;description;presets;min;max;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.presets=t.presets,this.min=t.min,this.max=t.max}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.presets&&this.presets.length>0&&(this.presets.forEach(i=>{let c=i.value===this.defaultValue?n.green(" (default)"):"";console.log(n.gray(` ${i.key}. ${i.label}${c}`))}),this.min!==void 0&&this.max!==void 0&&console.log(n.gray(` Or enter a custom number (${this.min}-${this.max})`)),console.log(""));let r=(await l.prompt(t.rl,`${this.title} [${n.gray(String(this.defaultValue))}]: `)).trim();if(!r)return this.success(this.defaultValue);let s=parseInt(r,10);if(this.presets){let i=s;if(i>=1&&i<=this.presets.length)return this.success(this.presets[i-1].value)}return isNaN(s)?(console.log(n.yellow(` Invalid input, using default: ${this.defaultValue}`)),this.success(this.defaultValue)):this.min!==void 0&&s<this.min?(console.log(n.yellow(` Value too low, using minimum: ${this.min}`)),this.success(this.min)):this.max!==void 0&&s>this.max?(console.log(n.yellow(` Value too high, using maximum: ${this.max}`)),this.success(this.max)):this.success(s)}},C=class extends d{id;stepNumber;title;description;examples;suggestionsProvider;validatePath;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.examples=t.examples,this.suggestionsProvider=t.suggestionsProvider,this.validatePath=t.validatePath??!0}async execute(t){if(t.nonInteractive){let i=I(t.cwd,this.defaultValue);return this.success(w(i)?i:t.cwd)}if(l.printStepHeader(this.stepNumber,this.title,this.description),this.examples&&(console.log(n.gray(`Examples: ${this.examples}`)),console.log("")),this.suggestionsProvider){let i=this.suggestionsProvider(t.cwd);i.length>0&&(console.log(n.yellow("Detected directories:")),i.slice(0,5).forEach((c,o)=>{console.log(n.gray(` ${o+1}. ${c}`))}),console.log(""))}let r=(await l.prompt(t.rl,`${this.title} [${n.gray(this.defaultValue)}]: `)).trim()||this.defaultValue,s=I(t.cwd,r);return this.validatePath&&!w(s)?(console.log(n.yellow(` Warning: '${r}' does not exist, using current directory.`)),this.success(t.cwd)):this.success(s)}};var T=class extends d{id;stepNumber;title;description;constructor(t){super({}),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description}async execute(t){if(t.nonInteractive)return this.success({});l.printStepHeader(this.stepNumber,this.title,this.description);let e=await l.prompt(t.rl,`Include patterns [${n.gray("e.g., src/**/*.ts")}]: `),r=await l.prompt(t.rl,`Exclude patterns [${n.gray("e.g., **/*.test.ts,dist/**")}]: `),s={};return e.trim()&&(s.include=e.split(",").map(i=>i.trim()).filter(i=>i.length>0)),r.trim()&&(s.exclude=r.split(",").map(i=>i.trim()).filter(i=>i.length>0)),this.success(s)}};import{createInterface as R}from"readline";import $ from"chalk";var V=class{options;cwd;constructor(t){this.options=t,this.cwd=process.cwd()}async run(){if(this.isNonInteractive())return this.getDefaults();let t=R({input:process.stdin,output:process.stdout});try{this.printHeader();let e={},r=this.getCommands();for(let c of r){let o={rl:t,cwd:this.cwd,results:e,nonInteractive:!1},g=await c.execute(o);if(!g.continue)return this.getCancelled();e[c.id]=g.value}let s=this.buildResult(e);return this.printSummary(s),await this.promptConfirmation(t)?s:this.getCancelled()}finally{t.close()}}printHeader(){l.printWizardHeader(this.getTitle(),this.getSubtitle())}async promptConfirmation(t){console.log("");let r=(await l.prompt(t,`${$.green(this.getConfirmationPrompt())} [${$.gray("Y/n")}]: `)).trim().toLowerCase();return r==="n"||r==="no"?(console.log($.yellow(`
3
3
  Wizard cancelled.`)),!1):!0}};export{l as a,h as b,f as c,y as d,b as e,v as f,x as g,C as h,T as i,V as j};
@@ -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.13.10");process.exit(0)}
2
- import{a as v,b as k}from"./chunk-FC47FRFI.js";import{i as g,m as P}from"./chunk-37GWETSW.js";import{a as d,b as y,c as R}from"./chunk-OLETDPH2.js";R();import{randomUUID as M}from"crypto";var p=class{constructor(e){this.config=e}config;_status="idle";_lastResult;_lastRunAt;_nextRunAt;_totalExecutions=0;_successfulExecutions=0;_failedExecutions=0;_executionDurations=[];_recentResults=[];get status(){return this._status}get lastResult(){return this._lastResult}get lastRunAt(){return this._lastRunAt}get nextRunAt(){return this._nextRunAt}async initialize(){this._status="idle",this._nextRunAt=new Date(Date.now()+this.config.intervalMs)}async execute(e){let r=Date.now();this._status="running",this._lastRunAt=new Date,this._totalExecutions++;let n,t;for(let a=0;a<=this.config.retryCount;a++)try{if(e.signal.aborted)throw new Error("Worker execution aborted");t=await this.executeWithTimeout(()=>this.doExecute(e),this.config.timeoutMs,e.signal);break}catch(u){n=y(u),e.logger.warn(`Worker ${this.config.id} attempt ${a+1} failed: ${n.message}`),a<this.config.retryCount&&await this.delay(this.config.retryDelayMs)}let o=Date.now()-r;return t?(this._successfulExecutions++,this._lastResult=t):(this._failedExecutions++,t=this.createErrorResult(n,o),this._lastResult=t),this._executionDurations.push(o),this._executionDurations.length>100&&this._executionDurations.shift(),this._recentResults.push({timestamp:new Date,success:t.success,durationMs:o}),this._recentResults.length>5&&this._recentResults.shift(),this._nextRunAt=new Date(Date.now()+this.config.intervalMs),this._status=t.success?"idle":"error",await e.eventBus.publish({type:"worker.executed",workerId:this.config.id,timestamp:new Date,payload:{success:t.success,durationMs:o,findingsCount:t.findings.length,healthScore:t.metrics.healthScore}}),t}pause(){this._status!=="stopped"&&(this._status="paused")}resume(){this._status==="paused"&&(this._status="idle")}async stop(){this._status="stopped"}getHealth(){let e=this._executionDurations.length>0?this._executionDurations.reduce((n,t)=>n+t,0)/this._executionDurations.length:0,r=this._totalExecutions>0?this._successfulExecutions/this._totalExecutions:1;return{status:this._status,healthScore:Math.round(r*100),totalExecutions:this._totalExecutions,successfulExecutions:this._successfulExecutions,failedExecutions:this._failedExecutions,avgDurationMs:Math.round(e),recentResults:[...this._recentResults]}}async executeWithTimeout(e,r,n){return new Promise((t,o)=>{let a=setTimeout(()=>{o(new Error(`Worker execution timed out after ${r}ms`))},r),u=()=>{clearTimeout(a),o(new Error("Worker execution aborted"))};n.addEventListener("abort",u,{once:!0}),e().then(c=>{clearTimeout(a),n.removeEventListener("abort",u),t(c)}).catch(c=>{clearTimeout(a),n.removeEventListener("abort",u),o(c)})})}createErrorResult(e,r){return{workerId:this.config.id,timestamp:new Date,durationMs:r,success:!1,error:e.message,metrics:{itemsAnalyzed:0,issuesFound:0,healthScore:0,trend:"degrading",domainMetrics:{}},findings:[],recommendations:[]}}createResult(e,r,n,t){return{workerId:this.config.id,timestamp:new Date,durationMs:e,success:!0,metrics:r,findings:n,recommendations:t}}delay(e){return new Promise(r=>setTimeout(r,e))}generateId(){return`${Date.now()}-${M().slice(0,9)}`}};P();R();var W={id:"heartbeat-scheduler",name:"Heartbeat Scheduler",description:"Token-free maintenance: pattern promotion, stale detection, experience buffer monitoring",intervalMs:1800*1e3,priority:"normal",targetDomains:["learning-optimization"],enabled:!0,timeoutMs:6e4,retryCount:1,retryDelayMs:5e3},b=class extends p{lifecycleManager=null;dailyLogger;lastRunTimestamp=0;constructor(){super(W),this.dailyLogger=new k}async getLifecycleManager(){if(this.lifecycleManager)return this.lifecycleManager;try{let e=g();await e.initialize();let r=e.getDatabase();return this.lifecycleManager=v(r,{promotionRewardThreshold:.7,promotionMinOccurrences:2,promotionMinSuccessRate:.7,deprecationFailureThreshold:3,staleDaysThreshold:30,confidenceDecayRate:.01,minActiveConfidence:.3}),this.lifecycleManager}catch{return null}}getPendingExperienceCount(){try{return g().getDatabase().prepare("SELECT COUNT(*) as pending FROM qe_pattern_usage WHERE created_at > datetime('now', '-1 day')").get()?.pending??0}catch{return 0}}async doExecute(e){let r=Date.now();e.logger.info("Heartbeat scheduler running (token-free maintenance)");let n=[],t=[],o=await this.getLifecycleManager();if(!o)return e.logger.warn("Unified memory unavailable \u2014 returning zero-metric heartbeat"),this.createResult(Date.now()-r,{itemsAnalyzed:0,issuesFound:0,healthScore:50,trend:"stable",domainMetrics:{promoted:0,deprecated:0,decayed:0,stalePatterns:0,pendingExperiences:0,avgConfidence:0,avgSuccessRate:0}},[],[]);let a=0,u=0;try{let s=o.promoteEligiblePatterns();a=s.promoted,u=s.checked,a>0&&n.push({type:"heartbeat-promotion",severity:"info",domain:"learning-optimization",title:"Patterns Promoted",description:`${a} of ${u} short-term patterns promoted to long-term`})}catch(s){e.logger.warn("Pattern promotion failed",{error:d(s)})}let c=0,h=0;try{let s=o.deprecateStalePatterns();c=s.deprecated,h=s.checked,c>0&&n.push({type:"heartbeat-deprecation",severity:"low",domain:"learning-optimization",title:"Stale Patterns Deprecated",description:`${c} of ${h} patterns deprecated (stale, failed, or low confidence)`})}catch(s){e.logger.warn("Stale pattern detection failed",{error:d(s)})}let l=0;try{let s=this.lastRunTimestamp>0?(Date.now()-this.lastRunTimestamp)/864e5:1;l=o.applyConfidenceDecay(Math.min(s,7)).decayed}catch(s){e.logger.warn("Confidence decay failed",{error:d(s)})}let m=this.getPendingExperienceCount(),i={totalPatterns:0,activePatterns:0,deprecatedPatterns:0,promotedPatterns:0,shortTermPatterns:0,longTermPatterns:0,avgConfidence:0,avgSuccessRate:0,patternsNearDeprecation:0};try{i=o.getStats()}catch(s){e.logger.warn("Stats retrieval failed",{error:d(s)})}try{this.dailyLogger.log({timestamp:new Date,type:"pattern-promoted",summary:`Heartbeat: ${a} promoted, ${c} deprecated, ${l} decayed, ${m} pending exp, ${i.activePatterns} active patterns (avg conf: ${i.avgConfidence.toFixed(2)})`,details:{promoted:a,deprecated:c,decayed:l,pendingExperiences:m,totalPatterns:i.totalPatterns,activePatterns:i.activePatterns,avgConfidence:i.avgConfidence,avgSuccessRate:i.avgSuccessRate}}),this.dailyLogger.flush()}catch(s){e.logger.warn("Daily log write failed",{error:d(s)})}this.lastRunTimestamp=Date.now(),i.activePatterns>0&&i.patternsNearDeprecation/i.activePatterns>.5&&t.push({priority:"p2",domain:"learning-optimization",action:"Review At-Risk Patterns",description:`${i.patternsNearDeprecation} of ${i.activePatterns} active patterns are near deprecation. Manual review recommended.`,estimatedImpact:"medium",effort:"low",autoFixable:!1});let f=this.calculateHealthScore(i,a,c),D=this.determineTrend(a,c,i.activePatterns),_=Math.max(u,h),x=a+c+i.patternsNearDeprecation;return e.logger.info("Heartbeat complete",{promoted:a,deprecated:c,decayed:l,pendingExperiences:m,healthScore:f}),this.createResult(Date.now()-r,{itemsAnalyzed:_,issuesFound:x,healthScore:f,trend:D,domainMetrics:{promoted:a,deprecated:c,decayed:l,stalePatterns:i.patternsNearDeprecation,pendingExperiences:m,avgConfidence:Number(i.avgConfidence.toFixed(3)),avgSuccessRate:Number(i.avgSuccessRate.toFixed(3))}},n,t)}calculateHealthScore(e,r,n){let t=70;if(t+=Math.min(15,r*5),e.avgConfidence>0&&(t+=Math.round((e.avgConfidence-.5)*30)),e.activePatterns>0){let o=n/e.activePatterns;t-=Math.round(o*20)}return e.activePatterns>0&&e.patternsNearDeprecation/e.activePatterns>.5&&(t-=10),Math.max(0,Math.min(100,Math.round(t)))}determineTrend(e,r,n){return n===0?"stable":e>r?"improving":r>e&&r/n>.1?"degrading":"stable"}};export{p as a,b};
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.13.12");process.exit(0)}
2
+ import{a as v,b as k}from"./chunk-LXVT6JXO.js";import{i as g,m as P}from"./chunk-M73KM3AZ.js";import{a as d,b as y,c as R}from"./chunk-L3GBNX7B.js";R();import{randomUUID as M}from"crypto";var p=class{constructor(e){this.config=e}config;_status="idle";_lastResult;_lastRunAt;_nextRunAt;_totalExecutions=0;_successfulExecutions=0;_failedExecutions=0;_executionDurations=[];_recentResults=[];get status(){return this._status}get lastResult(){return this._lastResult}get lastRunAt(){return this._lastRunAt}get nextRunAt(){return this._nextRunAt}async initialize(){this._status="idle",this._nextRunAt=new Date(Date.now()+this.config.intervalMs)}async execute(e){let r=Date.now();this._status="running",this._lastRunAt=new Date,this._totalExecutions++;let n,t;for(let a=0;a<=this.config.retryCount;a++)try{if(e.signal.aborted)throw new Error("Worker execution aborted");t=await this.executeWithTimeout(()=>this.doExecute(e),this.config.timeoutMs,e.signal);break}catch(u){n=y(u),e.logger.warn(`Worker ${this.config.id} attempt ${a+1} failed: ${n.message}`),a<this.config.retryCount&&await this.delay(this.config.retryDelayMs)}let o=Date.now()-r;return t?(this._successfulExecutions++,this._lastResult=t):(this._failedExecutions++,t=this.createErrorResult(n,o),this._lastResult=t),this._executionDurations.push(o),this._executionDurations.length>100&&this._executionDurations.shift(),this._recentResults.push({timestamp:new Date,success:t.success,durationMs:o}),this._recentResults.length>5&&this._recentResults.shift(),this._nextRunAt=new Date(Date.now()+this.config.intervalMs),this._status=t.success?"idle":"error",await e.eventBus.publish({type:"worker.executed",workerId:this.config.id,timestamp:new Date,payload:{success:t.success,durationMs:o,findingsCount:t.findings.length,healthScore:t.metrics.healthScore}}),t}pause(){this._status!=="stopped"&&(this._status="paused")}resume(){this._status==="paused"&&(this._status="idle")}async stop(){this._status="stopped"}getHealth(){let e=this._executionDurations.length>0?this._executionDurations.reduce((n,t)=>n+t,0)/this._executionDurations.length:0,r=this._totalExecutions>0?this._successfulExecutions/this._totalExecutions:1;return{status:this._status,healthScore:Math.round(r*100),totalExecutions:this._totalExecutions,successfulExecutions:this._successfulExecutions,failedExecutions:this._failedExecutions,avgDurationMs:Math.round(e),recentResults:[...this._recentResults]}}async executeWithTimeout(e,r,n){return new Promise((t,o)=>{let a=setTimeout(()=>{o(new Error(`Worker execution timed out after ${r}ms`))},r),u=()=>{clearTimeout(a),o(new Error("Worker execution aborted"))};n.addEventListener("abort",u,{once:!0}),e().then(c=>{clearTimeout(a),n.removeEventListener("abort",u),t(c)}).catch(c=>{clearTimeout(a),n.removeEventListener("abort",u),o(c)})})}createErrorResult(e,r){return{workerId:this.config.id,timestamp:new Date,durationMs:r,success:!1,error:e.message,metrics:{itemsAnalyzed:0,issuesFound:0,healthScore:0,trend:"degrading",domainMetrics:{}},findings:[],recommendations:[]}}createResult(e,r,n,t){return{workerId:this.config.id,timestamp:new Date,durationMs:e,success:!0,metrics:r,findings:n,recommendations:t}}delay(e){return new Promise(r=>setTimeout(r,e))}generateId(){return`${Date.now()}-${M().slice(0,9)}`}};P();R();var W={id:"heartbeat-scheduler",name:"Heartbeat Scheduler",description:"Token-free maintenance: pattern promotion, stale detection, experience buffer monitoring",intervalMs:1800*1e3,priority:"normal",targetDomains:["learning-optimization"],enabled:!0,timeoutMs:6e4,retryCount:1,retryDelayMs:5e3},b=class extends p{lifecycleManager=null;dailyLogger;lastRunTimestamp=0;constructor(){super(W),this.dailyLogger=new k}async getLifecycleManager(){if(this.lifecycleManager)return this.lifecycleManager;try{let e=g();await e.initialize();let r=e.getDatabase();return this.lifecycleManager=v(r,{promotionRewardThreshold:.7,promotionMinOccurrences:2,promotionMinSuccessRate:.7,deprecationFailureThreshold:3,staleDaysThreshold:30,confidenceDecayRate:.01,minActiveConfidence:.3}),this.lifecycleManager}catch{return null}}getPendingExperienceCount(){try{return g().getDatabase().prepare("SELECT COUNT(*) as pending FROM qe_pattern_usage WHERE created_at > datetime('now', '-1 day')").get()?.pending??0}catch{return 0}}async doExecute(e){let r=Date.now();e.logger.info("Heartbeat scheduler running (token-free maintenance)");let n=[],t=[],o=await this.getLifecycleManager();if(!o)return e.logger.warn("Unified memory unavailable \u2014 returning zero-metric heartbeat"),this.createResult(Date.now()-r,{itemsAnalyzed:0,issuesFound:0,healthScore:50,trend:"stable",domainMetrics:{promoted:0,deprecated:0,decayed:0,stalePatterns:0,pendingExperiences:0,avgConfidence:0,avgSuccessRate:0}},[],[]);let a=0,u=0;try{let s=o.promoteEligiblePatterns();a=s.promoted,u=s.checked,a>0&&n.push({type:"heartbeat-promotion",severity:"info",domain:"learning-optimization",title:"Patterns Promoted",description:`${a} of ${u} short-term patterns promoted to long-term`})}catch(s){e.logger.warn("Pattern promotion failed",{error:d(s)})}let c=0,h=0;try{let s=o.deprecateStalePatterns();c=s.deprecated,h=s.checked,c>0&&n.push({type:"heartbeat-deprecation",severity:"low",domain:"learning-optimization",title:"Stale Patterns Deprecated",description:`${c} of ${h} patterns deprecated (stale, failed, or low confidence)`})}catch(s){e.logger.warn("Stale pattern detection failed",{error:d(s)})}let l=0;try{let s=this.lastRunTimestamp>0?(Date.now()-this.lastRunTimestamp)/864e5:1;l=o.applyConfidenceDecay(Math.min(s,7)).decayed}catch(s){e.logger.warn("Confidence decay failed",{error:d(s)})}let m=this.getPendingExperienceCount(),i={totalPatterns:0,activePatterns:0,deprecatedPatterns:0,promotedPatterns:0,shortTermPatterns:0,longTermPatterns:0,avgConfidence:0,avgSuccessRate:0,patternsNearDeprecation:0};try{i=o.getStats()}catch(s){e.logger.warn("Stats retrieval failed",{error:d(s)})}try{this.dailyLogger.log({timestamp:new Date,type:"pattern-promoted",summary:`Heartbeat: ${a} promoted, ${c} deprecated, ${l} decayed, ${m} pending exp, ${i.activePatterns} active patterns (avg conf: ${i.avgConfidence.toFixed(2)})`,details:{promoted:a,deprecated:c,decayed:l,pendingExperiences:m,totalPatterns:i.totalPatterns,activePatterns:i.activePatterns,avgConfidence:i.avgConfidence,avgSuccessRate:i.avgSuccessRate}}),this.dailyLogger.flush()}catch(s){e.logger.warn("Daily log write failed",{error:d(s)})}this.lastRunTimestamp=Date.now(),i.activePatterns>0&&i.patternsNearDeprecation/i.activePatterns>.5&&t.push({priority:"p2",domain:"learning-optimization",action:"Review At-Risk Patterns",description:`${i.patternsNearDeprecation} of ${i.activePatterns} active patterns are near deprecation. Manual review recommended.`,estimatedImpact:"medium",effort:"low",autoFixable:!1});let f=this.calculateHealthScore(i,a,c),D=this.determineTrend(a,c,i.activePatterns),_=Math.max(u,h),x=a+c+i.patternsNearDeprecation;return e.logger.info("Heartbeat complete",{promoted:a,deprecated:c,decayed:l,pendingExperiences:m,healthScore:f}),this.createResult(Date.now()-r,{itemsAnalyzed:_,issuesFound:x,healthScore:f,trend:D,domainMetrics:{promoted:a,deprecated:c,decayed:l,stalePatterns:i.patternsNearDeprecation,pendingExperiences:m,avgConfidence:Number(i.avgConfidence.toFixed(3)),avgSuccessRate:Number(i.avgSuccessRate.toFixed(3))}},n,t)}calculateHealthScore(e,r,n){let t=70;if(t+=Math.min(15,r*5),e.avgConfidence>0&&(t+=Math.round((e.avgConfidence-.5)*30)),e.activePatterns>0){let o=n/e.activePatterns;t-=Math.round(o*20)}return e.activePatterns>0&&e.patternsNearDeprecation/e.activePatterns>.5&&(t-=10),Math.max(0,Math.min(100,Math.round(t)))}determineTrend(e,r,n){return n===0?"stable":e>r?"improving":r>e&&r/n>.1?"degrading":"stable"}};export{p as a,b};
@@ -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.13.10");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.13.12");process.exit(0)}
2
2
  var p={"||":1,"&&":2,"===":3,"!==":3,"==":3,"!=":3,"<":4,">":4,"<=":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6},l=new Set(Object.keys(p)),w=new Set(["!","-","+"]);function h(r){let n=[],e=0;for(;e<r.length;){let t=r[e];if(/\s/.test(t)){e++;continue}if(/\d/.test(t)||t==="."&&/\d/.test(r[e+1])){let s="";for(;e<r.length&&/[\d.]/.test(r[e]);)s+=r[e++];n.push({type:"NUMBER",value:parseFloat(s),raw:s});continue}if(t==='"'||t==="'"){let s=t,u="";for(e++;e<r.length&&r[e]!==s;){if(r[e]==="\\"&&e+1<r.length){e++;let c=r[e];switch(c){case"n":u+=`
3
3
  `;break;case"t":u+=" ";break;case"r":u+="\r";break;default:u+=c}}else u+=r[e];e++}e++,n.push({type:"STRING",value:u,raw:`${s}${u}${s}`});continue}if(/[a-zA-Z_$]/.test(t)){let s="";for(;e<r.length&&/[a-zA-Z0-9_$]/.test(r[e]);)s+=r[e++];s==="true"?n.push({type:"BOOLEAN",value:!0,raw:s}):s==="false"?n.push({type:"BOOLEAN",value:!1,raw:s}):s==="null"?n.push({type:"NULL",value:null,raw:s}):s==="undefined"?n.push({type:"UNDEFINED",value:void 0,raw:s}):n.push({type:"IDENTIFIER",value:s,raw:s});continue}let a=r.slice(e,e+2),o=r.slice(e,e+3);if(o==="==="||o==="!=="){n.push({type:"OPERATOR",value:o,raw:o}),e+=3;continue}if(a==="=="||a==="!="||a==="<="||a===">="||a==="&&"||a==="||"){n.push({type:"OPERATOR",value:a,raw:a}),e+=2;continue}if(t==="("){n.push({type:"LPAREN",value:"(",raw:"("}),e++;continue}if(t===")"){n.push({type:"RPAREN",value:")",raw:")"}),e++;continue}if(t==="."){n.push({type:"DOT",value:".",raw:"."}),e++;continue}if("+-*/%<>!".includes(t)){n.push({type:"OPERATOR",value:t,raw:t}),e++;continue}throw new Error(`Unexpected character at position ${e}: ${t}`)}return n.push({type:"EOF",value:"",raw:""}),n}var i=class{tokens;pos=0;context;constructor(n,e){this.tokens=n,this.context=e}current(){return this.tokens[this.pos]}advance(){return this.tokens[this.pos++]}expect(n){let e=this.current();if(e.type!==n)throw new Error(`Expected ${n}, got ${e.type}`);return this.advance()}parse(){let n=this.parseExpression(0);if(this.current().type!=="EOF")throw new Error(`Unexpected token: ${this.current().raw}`);return n}parseExpression(n){let e=this.parseUnary();for(;;){let t=this.current();if(t.type!=="OPERATOR"||!l.has(t.value))break;let a=p[t.value];if(a<n)break;let o=this.advance().value,s=this.parseExpression(a+1);e=this.applyBinaryOperator(o,e,s)}return e}parseUnary(){let n=this.current();if(n.type==="OPERATOR"&&w.has(n.value)){let e=this.advance().value,t=this.parseUnary();return this.applyUnaryOperator(e,t)}return this.parsePrimary()}parsePrimary(){let n=this.current();switch(n.type){case"NUMBER":case"STRING":case"BOOLEAN":case"NULL":case"UNDEFINED":return this.advance(),n.value;case"IDENTIFIER":return this.parseIdentifier();case"LPAREN":{this.advance();let e=this.parseExpression(0);return this.expect("RPAREN"),e}default:throw new Error(`Unexpected token: ${n.raw}`)}}parseIdentifier(){let n=this.context,e=this.advance().value;for(typeof n=="object"&&n!==null&&(e in n)?n=n[e]:n=void 0;this.current().type==="DOT";){this.advance();let t=this.expect("IDENTIFIER").value;n!=null&&typeof n=="object"?n=n[t]:n=void 0}return n}applyBinaryOperator(n,e,t){switch(n){case"===":return e===t;case"!==":return e!==t;case"==":return e==t;case"!=":return e!=t;case"<":return e<t;case">":return e>t;case"<=":return e<=t;case">=":return e>=t;case"&&":return e&&t;case"||":return e||t;case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return e/t;case"%":return e%t;default:throw new Error(`Unknown operator: ${n}`)}}applyUnaryOperator(n,e){switch(n){case"!":return!e;case"-":return-e;case"+":return+e;default:throw new Error(`Unknown unary operator: ${n}`)}}};function E(r,n={}){if(!r||typeof r!="string")throw new Error("Expression must be a non-empty string");let e=[/\beval\b/i,/\bFunction\b/,/\bconstructor\b/,/\b__proto__\b/,/\bprototype\b/,/\bimport\b/,/\brequire\b/,/\bprocess\b/,/\bglobal\b/,/\bwindow\b/,/\bdocument\b/,/\[\s*['"`]/,/\[.*\]/];for(let o of e)if(o.test(r))throw new Error(`Expression contains potentially dangerous pattern: ${r}`);let t=h(r.trim());return new i(t,n).parse()}function b(r,n={},e=!1){try{return!!E(r,n)}catch(t){return console.warn(`[SafeEvaluator] Failed to evaluate expression: ${r}`,t),e}}export{b as a};