agentic-qe 3.13.9 → 3.13.11

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 (739) 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 +737 -8
  7. package/.claude/skills/skills-manifest.json +1 -1
  8. package/CHANGELOG.md +79 -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-YBSKQFQ4.js +2 -0
  21. package/dist/cli/chunks/{agent-booster-wasm-UVFQL2YN.js → agent-booster-wasm-5ARDZYNO.js} +2 -2
  22. package/dist/cli/chunks/{agent-handler-OOIYA6HY.js → agent-handler-SVKEPF7B.js} +2 -2
  23. package/dist/cli/chunks/{agent-memory-branch-JP657M2X.js → agent-memory-branch-QDL7OVHC.js} +2 -2
  24. package/dist/cli/chunks/aqe-learning-engine-3H7DRDD4.js +2 -0
  25. package/dist/cli/chunks/{arena-YQQGPT3A.js → arena-7OCKBN6O.js} +2 -2
  26. package/dist/cli/chunks/{arena-3TEQR4Z5.js → arena-HQLSNQZ3.js} +4 -4
  27. package/dist/cli/chunks/{audit-2ZNYXWUH.js → audit-2EQJW5UE.js} +3 -3
  28. package/dist/cli/chunks/base-ZTD6PFD7.js +2 -0
  29. package/dist/cli/chunks/{better-sqlite3-MIHBCO3K.js → better-sqlite3-OBFNNE4T.js} +2 -2
  30. package/dist/cli/chunks/{brain-handler-ROJZOXD3.js → brain-handler-FV2AJZ4A.js} +3 -3
  31. package/dist/cli/chunks/{branch-enumerator-LYOBZQYN.js → branch-enumerator-6B4L5O3D.js} +2 -2
  32. package/dist/cli/chunks/{browser-MYZ22Z22.js → browser-VDMGBWNK.js} +2 -2
  33. package/dist/cli/chunks/browser-workflow-GKWDM25H.js +2 -0
  34. package/dist/cli/chunks/{chunk-HUF4AONC.js → chunk-23E37MDA.js} +2 -2
  35. package/dist/cli/chunks/{chunk-3FUI4SKR.js → chunk-24XW7KUX.js} +2 -2
  36. package/dist/cli/chunks/{chunk-6HBULOTM.js → chunk-2BDTZYQN.js} +3 -3
  37. package/dist/cli/chunks/{chunk-ZSUBWGL3.js → chunk-2CBEQV6R.js} +2 -2
  38. package/dist/cli/chunks/{chunk-STFUARVH.js → chunk-2D7SBOZ4.js} +2 -2
  39. package/dist/cli/chunks/chunk-2E2QCIGR.js +12 -0
  40. package/dist/cli/chunks/{chunk-VGDQQVJI.js → chunk-2E3PRDEX.js} +2 -2
  41. package/dist/cli/chunks/{chunk-3Z44HZRV.js → chunk-2HT5HRAA.js} +2 -2
  42. package/dist/cli/chunks/{chunk-UNAAAXI2.js → chunk-2Y3PW5EJ.js} +2 -2
  43. package/dist/cli/chunks/{chunk-SMNHQK6U.js → chunk-36ONUM43.js} +1 -1
  44. package/dist/cli/chunks/{chunk-AET5ETY2.js → chunk-3SPYI7TS.js} +1 -1
  45. package/dist/cli/chunks/{chunk-FV2YHX26.js → chunk-4CTKRLRX.js} +2 -2
  46. package/dist/cli/chunks/{chunk-RQ3JWFH7.js → chunk-4DTBGQWA.js} +2 -2
  47. package/dist/cli/chunks/{chunk-OJ5FT22A.js → chunk-4TJJU5Y2.js} +3 -3
  48. package/dist/cli/chunks/{chunk-L5SV6NNH.js → chunk-4TUGQESL.js} +2 -2
  49. package/dist/cli/chunks/{chunk-WQT5WSDA.js → chunk-4X4GTEQY.js} +1 -1
  50. package/dist/cli/chunks/{chunk-KJKA35Q5.js → chunk-4ZQOJ7Q2.js} +2 -2
  51. package/dist/cli/chunks/{chunk-N4CORNKN.js → chunk-5364DBZG.js} +2 -2
  52. package/dist/cli/chunks/{chunk-65Q64QCC.js → chunk-76NSSNB3.js} +2 -2
  53. package/dist/cli/chunks/{chunk-NDO6NIB3.js → chunk-7HTYM6XY.js} +2 -2
  54. package/dist/cli/chunks/{chunk-CGVB4XBJ.js → chunk-7YL7P5XG.js} +2 -2
  55. package/dist/cli/chunks/{chunk-ZG25CHVY.js → chunk-AAPJG3WI.js} +2 -2
  56. package/dist/cli/chunks/{chunk-4FNDI3M2.js → chunk-AFXMTSO3.js} +1 -1
  57. package/dist/cli/chunks/{chunk-LCVKHWW2.js → chunk-AHG2O5HT.js} +2 -2
  58. package/dist/cli/chunks/{chunk-JA5WSDDW.js → chunk-ATRUE6CT.js} +2 -2
  59. package/dist/cli/chunks/{chunk-AKXLZ7CW.js → chunk-AZVV7POX.js} +3 -3
  60. package/dist/cli/chunks/{chunk-NUWMKDQH.js → chunk-B646CE3C.js} +2 -2
  61. package/dist/cli/chunks/{chunk-DSVSZPI3.js → chunk-BL5BHBXR.js} +1 -1
  62. package/dist/cli/chunks/{chunk-A546FJQP.js → chunk-BPPEN7SS.js} +2 -2
  63. package/dist/cli/chunks/{chunk-LNPXRGCM.js → chunk-BVKFBJX6.js} +4 -4
  64. package/dist/cli/chunks/{chunk-BSBYYUT5.js → chunk-CK7ZLMD2.js} +1 -1
  65. package/dist/cli/chunks/{chunk-UPCKORAJ.js → chunk-CTS545BF.js} +1 -1
  66. package/dist/cli/chunks/chunk-CYQRZ645.js +2 -0
  67. package/dist/cli/chunks/{chunk-ZKYKW4CH.js → chunk-DLL3AJH7.js} +1 -1
  68. package/dist/cli/chunks/{chunk-O6RY2MKE.js → chunk-DMHQ4ZUZ.js} +2 -2
  69. package/dist/cli/chunks/{chunk-HTVDDFRI.js → chunk-DPZ4AU6W.js} +2 -2
  70. package/dist/cli/chunks/{chunk-7NOX3Y6P.js → chunk-DXQMVATY.js} +2 -2
  71. package/dist/cli/chunks/{chunk-WC3WHPUW.js → chunk-E54QUKAD.js} +2 -2
  72. package/dist/cli/chunks/{chunk-JWS2G6PO.js → chunk-EHZQIXH6.js} +3 -3
  73. package/dist/cli/chunks/{chunk-TGFOEDBY.js → chunk-EI4KYBNI.js} +2 -2
  74. package/dist/cli/chunks/{chunk-EZITEQMG.js → chunk-EKFKQGIT.js} +1 -1
  75. package/dist/cli/chunks/{chunk-PG2ERIJE.js → chunk-EN36AFRJ.js} +1 -1
  76. package/dist/cli/chunks/{chunk-CKRIQVMB.js → chunk-EWH7PFV6.js} +1 -1
  77. package/dist/cli/chunks/{chunk-RWR5G4Q2.js → chunk-FBASWZ7G.js} +1 -1
  78. package/dist/cli/chunks/{chunk-72ALY5JJ.js → chunk-FPX4JSFH.js} +2 -2
  79. package/dist/cli/chunks/{chunk-C6HU5SIU.js → chunk-FXKOHZBN.js} +1 -1
  80. package/dist/cli/chunks/{chunk-RH2VLBDQ.js → chunk-GJTGHVAX.js} +4 -4
  81. package/dist/cli/chunks/{chunk-BJNQ4H5G.js → chunk-GP5QBJVO.js} +2 -2
  82. package/dist/cli/chunks/{chunk-X4OKGVV2.js → chunk-GPJDZFFV.js} +2 -2
  83. package/dist/cli/chunks/{chunk-LZF2HITR.js → chunk-GWTGBQ6X.js} +2 -2
  84. package/dist/cli/chunks/{chunk-IB6YCQDH.js → chunk-H3AKF2HS.js} +10 -10
  85. package/dist/cli/chunks/{chunk-4NJZLASI.js → chunk-H3BHOIT6.js} +3 -3
  86. package/dist/cli/chunks/{chunk-LN7FJGP7.js → chunk-H5DS7S4B.js} +2 -2
  87. package/dist/cli/chunks/{chunk-OOVCVFUF.js → chunk-H7QWOJF2.js} +2 -2
  88. package/dist/cli/chunks/{chunk-YDWDU45I.js → chunk-HGPMS6JL.js} +2 -2
  89. package/dist/cli/chunks/{chunk-NIRZ7WJ6.js → chunk-HHEWINDL.js} +1 -1
  90. package/dist/cli/chunks/{chunk-ZBLJYWUE.js → chunk-HV6LJ57R.js} +1 -1
  91. package/dist/cli/chunks/{chunk-OYVUVHNV.js → chunk-HZR4G6I3.js} +1 -1
  92. package/dist/cli/chunks/{chunk-E5SUSYYD.js → chunk-IGW5L7YM.js} +1 -1
  93. package/dist/cli/chunks/{chunk-TZ67G37C.js → chunk-IYMV4CU5.js} +2 -2
  94. package/dist/cli/chunks/{chunk-EFAH6NUD.js → chunk-IZF3VLNW.js} +1 -1
  95. package/dist/cli/chunks/{chunk-QWSAEJSB.js → chunk-IZOWGVTU.js} +2 -2
  96. package/dist/cli/chunks/{chunk-T56N64OC.js → chunk-JGXP67BP.js} +1 -1
  97. package/dist/cli/chunks/{chunk-K55DZSEB.js → chunk-JK6ENS3J.js} +2 -2
  98. package/dist/cli/chunks/{chunk-C3D6X6NJ.js → chunk-JKP2BUF5.js} +2 -2
  99. package/dist/cli/chunks/{chunk-JKIVHK36.js → chunk-JKPMV5VB.js} +5 -5
  100. package/dist/cli/chunks/{chunk-TON5HYQM.js → chunk-JTQSXU6V.js} +6 -6
  101. package/dist/cli/chunks/{chunk-DT4ZMOFZ.js → chunk-JWT675RM.js} +2 -2
  102. package/dist/cli/chunks/{chunk-6EKA2SCV.js → chunk-K652SCBA.js} +2 -2
  103. package/dist/cli/chunks/{chunk-2G5ALMG4.js → chunk-LIGDJP6H.js} +1 -1
  104. package/dist/cli/chunks/{chunk-6VX2X4V5.js → chunk-LLP3UW62.js} +2 -2
  105. package/dist/cli/chunks/{chunk-ATIP66H7.js → chunk-LM727BVL.js} +4 -4
  106. package/dist/cli/chunks/{chunk-NWIO7QC2.js → chunk-LPDT27EC.js} +2 -2
  107. package/dist/cli/chunks/{chunk-N46VHXWO.js → chunk-LREIHR2A.js} +2 -2
  108. package/dist/cli/chunks/{chunk-HZLDCCUG.js → chunk-LUAXQB57.js} +1 -1
  109. package/dist/cli/chunks/{chunk-2IZTUE6F.js → chunk-M3MRFZKD.js} +1 -1
  110. package/dist/cli/chunks/{chunk-RCWHZB3R.js → chunk-MS5CAEPA.js} +2 -2
  111. package/dist/cli/chunks/chunk-MUAW4AJ6.js +21 -0
  112. package/dist/cli/chunks/{chunk-3CJOOHYG.js → chunk-MWTFFGU3.js} +2 -2
  113. package/dist/cli/chunks/{chunk-X2337R6M.js → chunk-NC7HTDH5.js} +2 -2
  114. package/dist/cli/chunks/{chunk-MTDKYFTA.js → chunk-NHL37QAZ.js} +2 -2
  115. package/dist/cli/chunks/{chunk-YTSBGM2P.js → chunk-OJUI65TR.js} +2 -2
  116. package/dist/cli/chunks/{chunk-VS77GAT4.js → chunk-OLPJGYO5.js} +2 -2
  117. package/dist/cli/chunks/{chunk-54IXQXIS.js → chunk-OQWG7GOD.js} +2 -2
  118. package/dist/cli/chunks/{chunk-RBXHFTQ5.js → chunk-P736OKQN.js} +1 -1
  119. package/dist/cli/chunks/{chunk-LUWMJZ7E.js → chunk-PADCR4LY.js} +2 -2
  120. package/dist/cli/chunks/{chunk-L7XNBJHV.js → chunk-PBJ5I2NS.js} +2 -2
  121. package/dist/cli/chunks/{chunk-A5AE5UPZ.js → chunk-PJNIDDER.js} +1 -1
  122. package/dist/cli/chunks/{chunk-ZXXUIYCB.js → chunk-PT6U3IIK.js} +2 -2
  123. package/dist/cli/chunks/{chunk-JHVEZHOK.js → chunk-PZHAPI47.js} +3 -3
  124. package/dist/cli/chunks/{chunk-IYG6DTCX.js → chunk-QYHRDBKI.js} +2 -2
  125. package/dist/cli/chunks/{chunk-EJK3MI3R.js → chunk-RAV2NJNX.js} +1 -1
  126. package/dist/cli/chunks/{chunk-GBYAKR2N.js → chunk-RGUKQXKL.js} +2 -2
  127. package/dist/cli/chunks/{chunk-SXZQT2FZ.js → chunk-S3FNAHNC.js} +2 -2
  128. package/dist/cli/chunks/{chunk-B6XFUYR5.js → chunk-SJJFU7KK.js} +2 -2
  129. package/dist/cli/chunks/{chunk-A3DXONS3.js → chunk-SW56PB22.js} +2 -2
  130. package/dist/cli/chunks/{chunk-W6GI7MUQ.js → chunk-T5M4TZRB.js} +3 -3
  131. package/dist/cli/chunks/{chunk-GX6CO3D6.js → chunk-TBO64O56.js} +1 -1
  132. package/dist/cli/chunks/{chunk-MOI2ZRZO.js → chunk-TCVEXQLL.js} +2 -2
  133. package/dist/cli/chunks/{chunk-4QMDA37H.js → chunk-TJ67B7S7.js} +2 -2
  134. package/dist/cli/chunks/{chunk-4GQ5VVOT.js → chunk-TMY2Y7SC.js} +4 -4
  135. package/dist/cli/chunks/{chunk-PESU633W.js → chunk-TU4BYSXR.js} +2 -2
  136. package/dist/cli/chunks/{chunk-JOCSV4LF.js → chunk-TZA45FI7.js} +2 -2
  137. package/dist/cli/chunks/{chunk-7XX27XNP.js → chunk-U6G6RUFI.js} +1 -1
  138. package/dist/cli/chunks/{chunk-FWKC7LT4.js → chunk-UDFTDQ6C.js} +34 -29
  139. package/dist/cli/chunks/{chunk-UYTIAJYR.js → chunk-UDSNWQQI.js} +1 -1
  140. package/dist/cli/chunks/{chunk-RKW2QJOO.js → chunk-UGFHEVG4.js} +2 -2
  141. package/dist/cli/chunks/{chunk-LX6NH7H6.js → chunk-UJ2NRIAS.js} +2 -2
  142. package/dist/cli/chunks/chunk-UPMQHCC2.js +22 -0
  143. package/dist/cli/chunks/{chunk-Q3TRNLVW.js → chunk-UX5SM2PW.js} +1 -1
  144. package/dist/cli/chunks/{chunk-AWS57CRP.js → chunk-UZ7OWJ75.js} +1 -1
  145. package/dist/cli/chunks/{chunk-WCXFSJRL.js → chunk-V7QZMOG3.js} +2 -2
  146. package/dist/cli/chunks/{chunk-FOFNV7BX.js → chunk-VC77SDNH.js} +2 -2
  147. package/dist/cli/chunks/{chunk-LIGWEFMX.js → chunk-VHNAN7E2.js} +1 -1
  148. package/dist/cli/chunks/{chunk-ZFMJT3W3.js → chunk-VLW63UA2.js} +2 -2
  149. package/dist/cli/chunks/{chunk-DSIBLIBT.js → chunk-VNVGCJCS.js} +1 -1
  150. package/dist/cli/chunks/{chunk-D33E5HHN.js → chunk-VU3ARH4S.js} +1 -1
  151. package/dist/cli/chunks/{chunk-QLZARNJZ.js → chunk-W2NQDAJZ.js} +2 -2
  152. package/dist/cli/chunks/{chunk-CXE4PRSD.js → chunk-W2T36CS5.js} +1 -1
  153. package/dist/cli/chunks/{chunk-63MYZ3M7.js → chunk-W7BB4XLP.js} +2 -2
  154. package/dist/cli/chunks/{chunk-GTODN5Y4.js → chunk-WINYWMQP.js} +1 -1
  155. package/dist/cli/chunks/{chunk-IAETFGEU.js → chunk-WJB6YYMJ.js} +2 -2
  156. package/dist/cli/chunks/{chunk-HG72GVB7.js → chunk-WRMJWQUI.js} +1 -1
  157. package/dist/cli/chunks/{chunk-IPEZNH4I.js → chunk-WRZ5WZG3.js} +2 -2
  158. package/dist/cli/chunks/{chunk-JQOCV2J6.js → chunk-WVNLNXXI.js} +2 -2
  159. package/dist/cli/chunks/{chunk-DUTNDBCG.js → chunk-WYQM7GXW.js} +2 -2
  160. package/dist/cli/chunks/{chunk-GM2PCHSQ.js → chunk-XDK2TPI5.js} +1 -1
  161. package/dist/cli/chunks/{chunk-THFXHXI5.js → chunk-XEUUWOSS.js} +3 -3
  162. package/dist/cli/chunks/{chunk-OF6KNZTQ.js → chunk-XVFSZLRS.js} +1 -1
  163. package/dist/cli/chunks/{chunk-CHI37YGC.js → chunk-XZI4QXJJ.js} +2 -2
  164. package/dist/cli/chunks/{chunk-3ZE2SY34.js → chunk-Y2S6SS7M.js} +2 -2
  165. package/dist/cli/chunks/{chunk-6VYUCWXP.js → chunk-YDEYB6Z2.js} +1 -1
  166. package/dist/cli/chunks/{chunk-KMXLPREX.js → chunk-YEPJS4AM.js} +2 -2
  167. package/dist/cli/chunks/{chunk-YQJ2OXDO.js → chunk-YRCNWQBO.js} +2 -2
  168. package/dist/cli/chunks/{chunk-VAXIHPO5.js → chunk-YRV45WDT.js} +2 -2
  169. package/dist/cli/chunks/{chunk-XIPRR7GY.js → chunk-YXUFGDGS.js} +1 -1
  170. package/dist/cli/chunks/{chunk-IQ56TA3L.js → chunk-YYAJEPRD.js} +1 -1
  171. package/dist/cli/chunks/{chunk-IQVO6WPK.js → chunk-Z5ARI4XT.js} +2 -2
  172. package/dist/cli/chunks/{chunk-UHEBXKTE.js → chunk-ZNGFSR5M.js} +2 -2
  173. package/dist/cli/chunks/{ci-IMU2IXPA.js → ci-M6WYL2XY.js} +2 -2
  174. package/dist/cli/chunks/{ci-output-LGKIJVS5.js → ci-output-JFC3WOHX.js} +2 -2
  175. package/dist/cli/chunks/{circuit-breaker-FZ7TGAHZ.js → circuit-breaker-IMVBU6WP.js} +2 -2
  176. package/dist/cli/chunks/{claude-flow-setup-W3XJ4FJ2.js → claude-flow-setup-M5T5ZUXX.js} +2 -2
  177. package/dist/cli/chunks/client-4Q5JE7RY.js +2 -0
  178. package/dist/cli/chunks/{cline-installer-TI3Y6JJR.js → cline-installer-LSFAUHXC.js} +2 -2
  179. package/dist/cli/chunks/{code-NX6PWOUZ.js → code-N3SWJ3XL.js} +2 -2
  180. package/dist/cli/chunks/{code-index-extractor-GQDB5XMF.js → code-index-extractor-WPGRG36B.js} +2 -2
  181. package/dist/cli/chunks/{codex-installer-EZZFZ5VD.js → codex-installer-LKRCSDU5.js} +2 -2
  182. package/dist/cli/chunks/{completions-X4ASXBRI.js → completions-E5TBZ5AB.js} +2 -2
  183. package/dist/cli/chunks/{complexity-analyzer-PYG3DINO.js → complexity-analyzer-3FOSOELK.js} +2 -2
  184. package/dist/cli/chunks/{continuedev-installer-IR3Y2BQQ.js → continuedev-installer-ZSVFWMQB.js} +2 -2
  185. package/dist/cli/chunks/{copilot-installer-JCTLA6PG.js → copilot-installer-POSKHPZM.js} +2 -2
  186. package/dist/cli/chunks/core-handlers-4GKEYGPS.js +2 -0
  187. package/dist/cli/chunks/{cost-tracker-BYW7MIWY.js → cost-tracker-3UWDCNGC.js} +2 -2
  188. package/dist/cli/chunks/{coverage-NY5GJHHO.js → coverage-HPBO67JF.js} +3 -3
  189. package/dist/cli/chunks/cross-domain-router-PBJ2ZGPJ.js +2 -0
  190. package/dist/cli/chunks/{cursor-installer-LY2DK5ME.js → cursor-installer-DSW3L62X.js} +2 -2
  191. package/dist/cli/chunks/{daemon-LUSUET7S.js → daemon-2622ZCMJ.js} +3 -3
  192. package/dist/cli/chunks/{daemon-6BBTE3WA.js → daemon-33KTKDUM.js} +6 -6
  193. package/dist/cli/chunks/{dag-attention-scheduler-ETVDRH42.js → dag-attention-scheduler-YFT5JMM6.js} +2 -2
  194. package/dist/cli/chunks/{detect-5TDALRZ4.js → detect-COR3Q6BE.js} +2 -2
  195. package/dist/cli/chunks/{dist-node-ITA3A7NT.js → dist-node-5TRNTNWI.js} +2 -2
  196. package/dist/cli/chunks/{domain-handler-MMK44XEP.js → domain-handler-TZC4GCF6.js} +2 -2
  197. package/dist/cli/chunks/{domain-transfer-XUYQQUDR.js → domain-transfer-D2TENM3Y.js} +2 -2
  198. package/dist/cli/chunks/dream-4EXVFHUJ.js +2 -0
  199. package/dist/cli/chunks/{embed-and-insert-pattern-QVICUJUQ.js → embed-and-insert-pattern-COAZZGS6.js} +2 -2
  200. package/dist/cli/chunks/{eval-SXTOGYM3.js → eval-5ID5D77H.js} +2 -2
  201. package/dist/cli/chunks/{experience-capture-middleware-4HPAJFR6.js → experience-capture-middleware-MT4Z74TD.js} +3 -3
  202. package/dist/cli/chunks/{fast-paths-YBKHXUDN.js → fast-paths-MACRZGSE.js} +2 -2
  203. package/dist/cli/chunks/{feature-flags-Z5FQBEV4.js → feature-flags-JZX6ZBUX.js} +2 -2
  204. package/dist/cli/chunks/{feature-flags-S5Z3ULWK.js → feature-flags-LFNL6BHS.js} +2 -2
  205. package/dist/cli/chunks/{file-discovery-XZW5LKN3.js → file-discovery-DA5BEAO2.js} +2 -2
  206. package/dist/cli/chunks/{fleet-O75AZK4L.js → fleet-35I4F7D2.js} +3 -3
  207. package/dist/cli/chunks/{gnn-wrapper-U4DJTYGF.js → gnn-wrapper-2W3HM3ZI.js} +2 -2
  208. package/dist/cli/chunks/{heartbeat-handler-OWA45EGK.js → heartbeat-handler-6O2D2FU2.js} +4 -4
  209. package/dist/cli/chunks/heartbeat-scheduler-UNEYR3WR.js +2 -0
  210. package/dist/cli/chunks/hnsw-adapter-JQG66H4L.js +2 -0
  211. package/dist/cli/chunks/hnsw-index-2NOROILM.js +2 -0
  212. package/dist/cli/chunks/{hnsw-legacy-bridge-7TOTV3ZL.js → hnsw-legacy-bridge-GWBXEMQR.js} +2 -2
  213. package/dist/cli/chunks/{hnswlib-node-IZMOJZUS.js → hnswlib-node-TZ4VLARU.js} +2 -2
  214. package/dist/cli/chunks/{hooks-PE5LSJKB.js → hooks-723GPTQ4.js} +46 -45
  215. package/dist/cli/chunks/hybrid-router-FXTAJATE.js +2 -0
  216. package/dist/cli/chunks/{hypergraph-engine-D35OOHVQ.js → hypergraph-engine-ILRYFJM5.js} +2 -2
  217. package/dist/cli/chunks/{hypergraph-handler-DK3LHKQH.js → hypergraph-handler-523TSK4P.js} +3 -3
  218. package/dist/cli/chunks/impact-analyzer-VHZSBWMT.js +2 -0
  219. package/dist/cli/chunks/{init-handler-IRDWSHCT.js → init-handler-RBDYIXNV.js} +6 -6
  220. package/dist/cli/chunks/init-wizard-EML4OET2.js +2 -0
  221. package/dist/cli/chunks/kernel-TMRJOEO2.js +2 -0
  222. package/dist/cli/chunks/{kilocode-installer-USR3YEL6.js → kilocode-installer-E2QSX7Z7.js} +2 -2
  223. package/dist/cli/chunks/{kiro-installer-HYY224T6.js → kiro-installer-EZZLT2R5.js} +2 -2
  224. package/dist/cli/chunks/knowledge-graph-FMKVCMJQ.js +2 -0
  225. package/dist/cli/chunks/{learning-IHMVNPBE.js → learning-II2U3EV2.js} +44 -44
  226. package/dist/cli/chunks/{llm-router-J56WPWPM.js → llm-router-WC66OXZH.js} +4 -4
  227. package/dist/cli/chunks/llm-router-service-GOSVGMKM.js +2 -0
  228. package/dist/cli/chunks/{load-FXXVWFL6.js → load-QFQ3YOBQ.js} +2 -2
  229. package/dist/cli/chunks/load-test-WIRGDZIA.js +2 -0
  230. package/dist/cli/chunks/{mcp-KU5KYQTD.js → mcp-FPBBJJFY.js} +2 -2
  231. package/dist/cli/chunks/{memory-J2IAQPDA.js → memory-RKN6KV75.js} +5 -5
  232. package/dist/cli/chunks/memory-backend-XBBIXDZU.js +2 -0
  233. package/dist/cli/chunks/{memory-handlers-7ABPOY43.js → memory-handlers-SQHNK3DK.js} +2 -2
  234. package/dist/cli/chunks/{multi-model-executor-6PUQXMYY.js → multi-model-executor-OUNW3JM5.js} +2 -2
  235. package/dist/cli/chunks/{opencode-installer-WMIV5I7Y.js → opencode-installer-FXETYGGY.js} +2 -2
  236. package/dist/cli/chunks/{orchestrator-5IT7SH3J.js → orchestrator-35UTVXSP.js} +8 -8
  237. package/dist/cli/chunks/pattern-null-store-PFLKHRVU.js +2 -0
  238. package/dist/cli/chunks/pattern-usage-recorder-YEQDS7DN.js +2 -0
  239. package/dist/cli/chunks/{pipeline-E2IRDQWS.js → pipeline-YDJMWCAR.js} +2 -2
  240. package/dist/cli/chunks/{platform-2VT7N4FW.js → platform-L3LPNVKT.js} +2 -2
  241. package/dist/cli/chunks/{plugin-LCDA6EH7.js → plugin-55EYFJH5.js} +2 -2
  242. package/dist/cli/chunks/{prime-radiant-advanced-wasm-ROJL25C7.js → prime-radiant-advanced-wasm-SUZT6RTM.js} +2 -2
  243. package/dist/cli/chunks/protocol-executor-GAMNY2JB.js +2 -0
  244. package/dist/cli/chunks/{protocol-handler-VFJIPR3Z.js → protocol-handler-QNBFRJNY.js} +2 -2
  245. package/dist/cli/chunks/{prove-7FUSRIPO.js → prove-3X5NQP4L.js} +2 -2
  246. package/dist/cli/chunks/provider-manager-VTIG5AKU.js +2 -0
  247. package/dist/cli/chunks/qe-reasoning-bank-KAX63PXV.js +2 -0
  248. package/dist/cli/chunks/{quality-ZH7UVAOX.js → quality-5ZONTNA6.js} +2 -2
  249. package/dist/cli/chunks/{quality-gate-AMEWYWGC.js → quality-gate-JPNREEVR.js} +3 -3
  250. package/dist/cli/chunks/queen-coordinator-UYW2MDKI.js +2 -0
  251. package/dist/cli/chunks/{real-embeddings-IZVFG3L7.js → real-embeddings-HHR75AR5.js} +2 -2
  252. package/dist/cli/chunks/{roocode-installer-HAYQZOWR.js → roocode-installer-ZK73O2GD.js} +2 -2
  253. package/dist/cli/chunks/router-NVDU7IIA.js +2 -0
  254. package/dist/cli/chunks/routing-feedback-KHR3J2J3.js +2 -0
  255. package/dist/cli/chunks/{routing-handler-7BQ4DGTC.js → routing-handler-2UN5GRHJ.js} +2 -2
  256. package/dist/cli/chunks/ruvector-commands-EQQUEVWN.js +8 -0
  257. package/dist/cli/chunks/{rvf-dual-writer-FWKV5K2X.js → rvf-dual-writer-43L75WLF.js} +2 -2
  258. package/dist/cli/chunks/{rvf-migration-adapter-PI5KBWJU.js → rvf-migration-adapter-Y5OVCYTO.js} +2 -2
  259. package/dist/cli/chunks/{rvf-migration-coordinator-JHXYB46O.js → rvf-migration-coordinator-NEPDFB3N.js} +2 -2
  260. package/dist/cli/chunks/rvf-native-adapter-PQ4IOTZU.js +2 -0
  261. package/dist/cli/chunks/{rvf-store-integrity-DUM657DL.js → rvf-store-integrity-66FEC3MD.js} +2 -2
  262. package/dist/cli/chunks/safe-db-QHSFV63M.js +2 -0
  263. package/dist/cli/chunks/schedule-JGZFHJGM.js +2 -0
  264. package/dist/cli/chunks/scheduler-NGCDQIW5.js +2 -0
  265. package/dist/cli/chunks/{security-T5DTMZC6.js → security-H7PEUUCV.js} +3 -3
  266. package/dist/cli/chunks/{shared-rvf-adapter-H5DBPOKP.js → shared-rvf-adapter-XETNK4ID.js} +2 -2
  267. package/dist/cli/chunks/{shared-rvf-dual-writer-RNX4ZPSI.js → shared-rvf-dual-writer-PXD54BWJ.js} +2 -2
  268. package/dist/cli/chunks/sqlite-persistence-3JSNWL6I.js +2 -0
  269. package/dist/cli/chunks/{status-handler-FRFUWMNX.js → status-handler-CTXOH3FX.js} +2 -2
  270. package/dist/cli/chunks/{structural-health-HGI5BVK5.js → structural-health-EIFBDCRI.js} +2 -2
  271. package/dist/cli/chunks/{sync-SM74LPGW.js → sync-3SU4H6R3.js} +2 -2
  272. package/dist/cli/chunks/{sync-BZXPUFID.js → sync-PECWQ64K.js} +2 -2
  273. package/dist/cli/chunks/{task-handler-JSNI3UUU.js → task-handler-ZTUAT6YF.js} +2 -2
  274. package/dist/cli/chunks/{task-handlers-3GX6FAIK.js → task-handlers-4RIO7LJJ.js} +3 -3
  275. package/dist/cli/chunks/{test-GJKIE5YP.js → test-EV7BSUTI.js} +4 -4
  276. package/dist/cli/chunks/{test-scheduling-GNQNODVJ.js → test-scheduling-4WVI5DLE.js} +3 -3
  277. package/dist/cli/chunks/{token-bootstrap-Y7M4MA5T.js → token-bootstrap-3P22AYZ4.js} +2 -2
  278. package/dist/cli/chunks/{token-usage-MJFATDHC.js → token-usage-FR3JOWYB.js} +2 -2
  279. package/dist/cli/chunks/{transformers-4KPBAG5X.js → transformers-FENO33LA.js} +2 -2
  280. package/dist/cli/chunks/{tree-sitter-wasm-parser-DH7LQEKB.js → tree-sitter-wasm-parser-YFGJLSMB.js} +2 -2
  281. package/dist/cli/chunks/{types-LMEHA7DB.js → types-N3Y565RZ.js} +2 -2
  282. package/dist/cli/chunks/unified-memory-4VO5KSHP.js +2 -0
  283. package/dist/cli/chunks/unified-memory-hnsw-ZR2FZXOB.js +2 -0
  284. package/dist/cli/chunks/unified-persistence-VFPW5MFM.js +2 -0
  285. package/dist/cli/chunks/upgrade-33ZVVZFW.js +5 -0
  286. package/dist/cli/chunks/{validate-MLIAYGQB.js → validate-CS5PXGDF.js} +2 -2
  287. package/dist/cli/chunks/{validate-swarm-35YPIDUP.js → validate-swarm-GRZPWYNM.js} +2 -2
  288. package/dist/cli/chunks/{vibium-6SVRNFHR.js → vibium-IO7N4VEE.js} +2 -2
  289. package/dist/cli/chunks/visual-security-SNADRUPR.js +2 -0
  290. package/dist/cli/chunks/{web-tree-sitter-QYZYEGUN.js → web-tree-sitter-UQXR5HHR.js} +2 -2
  291. package/dist/cli/chunks/{windsurf-installer-XUFBPW4P.js → windsurf-installer-BCKLSLZT.js} +2 -2
  292. package/dist/cli/chunks/witness-chain-2TXUTEJE.js +2 -0
  293. package/dist/cli/chunks/{witness-chain-33NEUT4H.js → witness-chain-R3V26QWL.js} +2 -2
  294. package/dist/cli/chunks/{witness-key-manager-SVCIWNWV.js → witness-key-manager-Y36HMPEM.js} +2 -2
  295. package/dist/cli/chunks/{workflow-GFR6CHMB.js → workflow-4TCIUUFQ.js} +4 -4
  296. package/dist/cli/chunks/workflow-orchestrator-ON6UYRVE.js +2 -0
  297. package/dist/cli/chunks/{wrappers-IBS4IWV4.js → wrappers-MD4JRHJH.js} +2 -2
  298. package/dist/cli/commands/daemon.js +3 -3
  299. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +20 -10
  300. package/dist/cli/commands/hooks-handlers/routing-hooks.js +7 -0
  301. package/dist/cli/commands/learning.js +55 -17
  302. package/dist/cli/commands/plugin.js +4 -4
  303. package/dist/cli/commands/quality-gate.js +5 -1
  304. package/dist/cli/commands/ruvector-commands.js +1 -1
  305. package/dist/cli/commands/upgrade.d.ts +5 -1
  306. package/dist/cli/commands/upgrade.js +34 -6
  307. package/dist/cli/index.js +1 -1
  308. package/dist/cli/utils/index.js +2 -2
  309. package/dist/context/compaction/index.js +11 -11
  310. package/dist/context/compaction/tier1-microcompact.js +1 -1
  311. package/dist/context/compaction/tier2-session-summary.js +1 -1
  312. package/dist/context/compaction/tier3-llm-compact.js +1 -1
  313. package/dist/context/compaction/tier4-reactive.js +1 -1
  314. package/dist/coordination/claims/index.js +8 -8
  315. package/dist/coordination/consensus/consensus-engine.js +4 -4
  316. package/dist/coordination/consensus/factory.js +4 -4
  317. package/dist/coordination/consensus/index.js +8 -8
  318. package/dist/coordination/consensus/providers/claude-provider.js +1 -1
  319. package/dist/coordination/consensus/providers/gemini-provider.js +1 -1
  320. package/dist/coordination/consensus/providers/index.js +7 -7
  321. package/dist/coordination/consensus/providers/native-learning-provider.js +1 -1
  322. package/dist/coordination/consensus/providers/ollama-provider.js +1 -1
  323. package/dist/coordination/consensus/providers/openai-provider.js +1 -1
  324. package/dist/coordination/consensus/providers/openrouter-provider.js +1 -1
  325. package/dist/coordination/consensus/strategies/index.js +3 -3
  326. package/dist/coordination/cross-domain-router.js +2 -2
  327. package/dist/coordination/dynamic-scaling/dynamic-scaler.js +1 -1
  328. package/dist/coordination/dynamic-scaling/index.js +2 -2
  329. package/dist/coordination/fleet-tiers/index.js +3 -3
  330. package/dist/coordination/fleet-tiers/tier-selector.js +2 -2
  331. package/dist/coordination/handlers/code-intelligence-handlers.js +2 -2
  332. package/dist/coordination/handlers/coverage-collection.js +1 -1
  333. package/dist/coordination/handlers/coverage-handlers.js +3 -3
  334. package/dist/coordination/handlers/index.js +7 -7
  335. package/dist/coordination/handlers/misc-handlers.js +1 -1
  336. package/dist/coordination/handlers/quality-handlers.js +2 -2
  337. package/dist/coordination/handlers/requirements-handlers.js +2 -2
  338. package/dist/coordination/handlers/security-handlers.js +2 -2
  339. package/dist/coordination/handlers/test-execution-handlers.js +1 -1
  340. package/dist/coordination/index.js +20 -20
  341. package/dist/coordination/mincut/dream-integration.js +1 -1
  342. package/dist/coordination/mincut/index.js +14 -14
  343. package/dist/coordination/mincut/mincut-health-monitor.js +2 -2
  344. package/dist/coordination/mincut/mincut-persistence.js +1 -1
  345. package/dist/coordination/mincut/morphogenetic-growth.js +1 -1
  346. package/dist/coordination/mincut/neural-goap.js +1 -1
  347. package/dist/coordination/mincut/queen-integration.js +5 -5
  348. package/dist/coordination/mincut/shared-singleton.js +3 -3
  349. package/dist/coordination/mincut/strange-loop.js +1 -1
  350. package/dist/coordination/mincut/time-crystal.js +8 -8
  351. package/dist/coordination/mixins/consensus-enabled-domain.js +2 -2
  352. package/dist/coordination/mixins/index.js +3 -3
  353. package/dist/coordination/protocol-executor.js +2 -2
  354. package/dist/coordination/protocols/code-intelligence-index.js +4 -4
  355. package/dist/coordination/protocols/defect-investigation.js +2 -2
  356. package/dist/coordination/protocols/morning-sync.js +1 -1
  357. package/dist/coordination/protocols/quality-gate.js +2 -2
  358. package/dist/coordination/queen-coordinator.js +4 -4
  359. package/dist/coordination/queen-task-management.js +1 -1
  360. package/dist/coordination/services/index.js +1 -1
  361. package/dist/coordination/task-executor.js +6 -6
  362. package/dist/domains/chaos-resilience/coordinator.js +6 -6
  363. package/dist/domains/chaos-resilience/index.js +5 -5
  364. package/dist/domains/chaos-resilience/plugin.js +6 -6
  365. package/dist/domains/chaos-resilience/services/chaos-engineer.js +3 -3
  366. package/dist/domains/chaos-resilience/services/index.js +3 -3
  367. package/dist/domains/chaos-resilience/services/load-tester.js +2 -2
  368. package/dist/domains/chaos-resilience/services/performance-profiler.js +2 -2
  369. package/dist/domains/code-intelligence/coordinator-consensus.js +1 -1
  370. package/dist/domains/code-intelligence/coordinator-gnn.js +1 -1
  371. package/dist/domains/code-intelligence/coordinator-hypergraph.js +2 -2
  372. package/dist/domains/code-intelligence/coordinator.js +9 -9
  373. package/dist/domains/code-intelligence/index.js +7 -7
  374. package/dist/domains/code-intelligence/plugin.js +6 -6
  375. package/dist/domains/code-intelligence/services/c4-model/index.js +3 -3
  376. package/dist/domains/code-intelligence/services/impact-analyzer.js +2 -2
  377. package/dist/domains/code-intelligence/services/index.js +6 -6
  378. package/dist/domains/code-intelligence/services/knowledge-graph.js +4 -4
  379. package/dist/domains/code-intelligence/services/metric-collector/loc-counter.js +1 -1
  380. package/dist/domains/code-intelligence/services/metric-collector/test-counter.js +1 -1
  381. package/dist/domains/code-intelligence/services/product-factors-bridge.js +5 -5
  382. package/dist/domains/code-intelligence/services/semantic-analyzer.js +2 -2
  383. package/dist/domains/coverage-analysis/coordinator.js +9 -9
  384. package/dist/domains/coverage-analysis/index.js +10 -10
  385. package/dist/domains/coverage-analysis/plugin.js +4 -4
  386. package/dist/domains/coverage-analysis/services/coverage-analyzer.js +1 -1
  387. package/dist/domains/coverage-analysis/services/gap-detector.js +1 -1
  388. package/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.js +1 -1
  389. package/dist/domains/coverage-analysis/services/index.js +7 -7
  390. package/dist/domains/coverage-analysis/services/risk-scorer.js +1 -1
  391. package/dist/domains/coverage-analysis/services/sublinear-analyzer.js +3 -3
  392. package/dist/domains/defect-intelligence/coordinator.js +5 -5
  393. package/dist/domains/defect-intelligence/index.js +5 -5
  394. package/dist/domains/defect-intelligence/plugin.js +6 -6
  395. package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js +2 -2
  396. package/dist/domains/defect-intelligence/services/defect-predictor.js +4 -4
  397. package/dist/domains/defect-intelligence/services/index.js +4 -4
  398. package/dist/domains/defect-intelligence/services/pattern-learner.js +2 -2
  399. package/dist/domains/defect-intelligence/services/root-cause-analyzer.js +1 -1
  400. package/dist/domains/domain-interface.js +1 -1
  401. package/dist/domains/index.js +14 -14
  402. package/dist/domains/learning-optimization/coordinator.d.ts +3 -0
  403. package/dist/domains/learning-optimization/coordinator.js +6 -0
  404. package/dist/domains/learning-optimization/interfaces.d.ts +2 -0
  405. package/dist/domains/learning-optimization/plugin.d.ts +3 -0
  406. package/dist/domains/learning-optimization/plugin.js +5 -0
  407. package/dist/domains/quality-assessment/coherence/gate-controller.js +2 -2
  408. package/dist/domains/quality-assessment/coherence/lambda-calculator.js +1 -1
  409. package/dist/domains/quality-assessment/coherence/partition-detector.js +1 -1
  410. package/dist/domains/quality-assessment/coordinator-gate-evaluation.js +1 -1
  411. package/dist/domains/quality-assessment/coordinator-reports.js +1 -1
  412. package/dist/domains/quality-assessment/coordinator-rl-integration.js +2 -2
  413. package/dist/domains/quality-assessment/coordinator.js +5 -5
  414. package/dist/domains/quality-assessment/index.js +9 -9
  415. package/dist/domains/quality-assessment/plugin.js +6 -6
  416. package/dist/domains/quality-assessment/services/coherence-gate.js +6 -6
  417. package/dist/domains/quality-assessment/services/deployment-advisor.js +1 -1
  418. package/dist/domains/quality-assessment/services/index.js +4 -4
  419. package/dist/domains/quality-assessment/services/quality-analyzer.js +2 -2
  420. package/dist/domains/quality-assessment/services/quality-gate.js +1 -1
  421. package/dist/domains/requirements-validation/services/product-factors-assessment/analyzers/brutal-honesty-analyzer.js +2 -2
  422. package/dist/domains/requirements-validation/services/product-factors-assessment/analyzers/sfdipot-analyzer.js +2 -2
  423. package/dist/domains/requirements-validation/services/product-factors-assessment/code-intelligence/codebase-analyzer.js +1 -1
  424. package/dist/domains/requirements-validation/services/product-factors-assessment/formatters/gherkin-formatter.js +1 -1
  425. package/dist/domains/requirements-validation/services/product-factors-assessment/formatters/html-formatter.js +2 -2
  426. package/dist/domains/requirements-validation/services/product-factors-assessment/formatters/markdown-formatter.js +1 -1
  427. package/dist/domains/requirements-validation/services/product-factors-assessment/generators/question-generator.js +3 -3
  428. package/dist/domains/requirements-validation/services/product-factors-assessment/generators/test-idea-generator.js +3 -3
  429. package/dist/domains/requirements-validation/services/product-factors-assessment/patterns/domain-registry.js +1 -1
  430. package/dist/domains/requirements-validation/services/product-factors-assessment/patterns/index.js +1 -1
  431. package/dist/domains/requirements-validation/services/product-factors-assessment/skills/skill-integration.js +1 -1
  432. package/dist/domains/security-compliance/coordinator.js +1 -1
  433. package/dist/domains/security-compliance/index.js +1 -1
  434. package/dist/domains/security-compliance/services/compliance-validator.js +1 -1
  435. package/dist/domains/security-compliance/services/scanners/dast-helpers.js +1 -1
  436. package/dist/domains/security-compliance/services/scanners/dast-scanner.js +2 -2
  437. package/dist/domains/security-compliance/services/scanners/dependency-scanner.js +4 -4
  438. package/dist/domains/security-compliance/services/scanners/sast-scanner.js +3 -3
  439. package/dist/domains/security-compliance/services/scanners/scanner-orchestrator.js +2 -2
  440. package/dist/domains/test-execution/coordinator.js +8 -8
  441. package/dist/domains/test-execution/index.js +9 -9
  442. package/dist/domains/test-execution/interfaces.js +1 -1
  443. package/dist/domains/test-execution/plugin.js +3 -3
  444. package/dist/domains/test-execution/services/e2e/adaptive-locator-service.js +1 -1
  445. package/dist/domains/test-execution/services/e2e/assertion-handlers.js +2 -2
  446. package/dist/domains/test-execution/services/e2e/browser-orchestrator.js +3 -3
  447. package/dist/domains/test-execution/services/e2e/e2e-coordinator.js +7 -7
  448. package/dist/domains/test-execution/services/e2e/index.js +10 -10
  449. package/dist/domains/test-execution/services/e2e/step-executors.js +6 -6
  450. package/dist/domains/test-execution/services/e2e/step-retry-handler.js +3 -3
  451. package/dist/domains/test-execution/services/e2e/wait-condition-handler.js +1 -1
  452. package/dist/domains/test-execution/services/e2e-runner.js +6 -6
  453. package/dist/domains/test-execution/services/flaky-detector.js +1 -1
  454. package/dist/domains/test-execution/services/index.js +9 -9
  455. package/dist/domains/test-execution/services/retry-handler.js +1 -1
  456. package/dist/domains/test-execution/services/test-executor.js +1 -1
  457. package/dist/domains/test-execution/services/test-prioritizer.js +3 -3
  458. package/dist/domains/test-execution/services/user-flow-generator.js +3 -3
  459. package/dist/domains/test-execution/test-prioritization-types.js +1 -1
  460. package/dist/domains/test-execution/types/index.js +3 -3
  461. package/dist/domains/test-generation/coordinator.js +5 -5
  462. package/dist/domains/test-generation/factories/index.js +1 -1
  463. package/dist/domains/test-generation/factories/test-generator-factory.js +1 -1
  464. package/dist/domains/test-generation/generators/base-test-generator.js +1 -1
  465. package/dist/domains/test-generation/generators/go-test-generator.js +2 -2
  466. package/dist/domains/test-generation/generators/index.js +13 -13
  467. package/dist/domains/test-generation/generators/jest-vitest-generator.js +1 -1
  468. package/dist/domains/test-generation/generators/junit5-generator.js +2 -2
  469. package/dist/domains/test-generation/generators/kotlin-junit-generator.js +2 -2
  470. package/dist/domains/test-generation/generators/mocha-generator.js +1 -1
  471. package/dist/domains/test-generation/generators/node-test-generator.js +1 -1
  472. package/dist/domains/test-generation/generators/pytest-generator.js +2 -2
  473. package/dist/domains/test-generation/generators/rust-test-generator.js +3 -3
  474. package/dist/domains/test-generation/generators/swift-testing-generator.js +2 -2
  475. package/dist/domains/test-generation/generators/xunit-generator.js +2 -2
  476. package/dist/domains/test-generation/index.js +7 -7
  477. package/dist/domains/test-generation/interfaces/index.js +1 -1
  478. package/dist/domains/test-generation/plugin.js +5 -5
  479. package/dist/domains/test-generation/services/code-transform-integration.js +1 -1
  480. package/dist/domains/test-generation/services/index.js +10 -10
  481. package/dist/domains/test-generation/services/pattern-matcher.js +2 -2
  482. package/dist/domains/test-generation/services/test-generator.js +5 -5
  483. package/dist/domains/visual-accessibility/coordinator.js +1 -1
  484. package/dist/early-exit/early-exit-controller.js +4 -4
  485. package/dist/early-exit/early-exit-decision.js +2 -2
  486. package/dist/early-exit/index.js +5 -5
  487. package/dist/early-exit/quality-signal.js +1 -1
  488. package/dist/early-exit/speculative-executor.js +1 -1
  489. package/dist/index.js +18 -18
  490. package/dist/init/phases/12-verification.js +8 -2
  491. package/dist/integrations/agentic-flow/agent-booster/adapter.js +4 -4
  492. package/dist/integrations/agentic-flow/agent-booster/index.js +10 -10
  493. package/dist/integrations/agentic-flow/index.js +6 -6
  494. package/dist/integrations/agentic-flow/metrics/index.js +3 -3
  495. package/dist/integrations/agentic-flow/metrics/metrics-tracker.js +2 -2
  496. package/dist/integrations/agentic-flow/metrics/pattern-updater.js +1 -1
  497. package/dist/integrations/agentic-flow/model-router/budget-enforcer.js +1 -1
  498. package/dist/integrations/agentic-flow/model-router/complexity-analyzer.js +7 -7
  499. package/dist/integrations/agentic-flow/model-router/example.js +1 -1
  500. package/dist/integrations/agentic-flow/model-router/index.js +16 -16
  501. package/dist/integrations/agentic-flow/model-router/router.js +6 -6
  502. package/dist/integrations/agentic-flow/model-router/signal-collector.js +1 -1
  503. package/dist/integrations/agentic-flow/model-router/tier-recommender.js +1 -1
  504. package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.js +11 -6
  505. package/dist/integrations/browser/agent-browser/client.js +4 -4
  506. package/dist/integrations/browser/agent-browser/index.js +4 -4
  507. package/dist/integrations/browser/agent-browser/session-manager.js +1 -1
  508. package/dist/integrations/browser/client-factory.js +3 -3
  509. package/dist/integrations/browser/index.js +8 -8
  510. package/dist/integrations/browser/page-pool.js +1 -1
  511. package/dist/integrations/browser/stealth/index.js +2 -2
  512. package/dist/integrations/browser/stealth/stealth-client.js +3 -3
  513. package/dist/integrations/browser/web-content-fetcher.js +1 -1
  514. package/dist/integrations/coherence/coherence-service.js +2 -2
  515. package/dist/integrations/coherence/engines/category-adapter.js +1 -1
  516. package/dist/integrations/coherence/engines/causal-adapter.js +1 -1
  517. package/dist/integrations/coherence/engines/cohomology-adapter.js +1 -1
  518. package/dist/integrations/coherence/engines/homotopy-adapter.js +1 -1
  519. package/dist/integrations/coherence/engines/index.js +6 -6
  520. package/dist/integrations/coherence/engines/spectral-adapter.js +1 -1
  521. package/dist/integrations/coherence/engines/witness-adapter.js +1 -1
  522. package/dist/integrations/coherence/index.js +7 -7
  523. package/dist/integrations/coherence/threshold-tuner.js +1 -1
  524. package/dist/integrations/coherence/wasm-loader.js +2 -2
  525. package/dist/integrations/rl-suite/algorithms/a2c.js +2 -2
  526. package/dist/integrations/rl-suite/algorithms/actor-critic.js +2 -2
  527. package/dist/integrations/rl-suite/algorithms/ddpg.js +1 -1
  528. package/dist/integrations/rl-suite/algorithms/decision-transformer.js +1 -1
  529. package/dist/integrations/rl-suite/algorithms/dqn.js +2 -2
  530. package/dist/integrations/rl-suite/algorithms/eprop.js +2 -2
  531. package/dist/integrations/rl-suite/algorithms/index.js +10 -10
  532. package/dist/integrations/rl-suite/algorithms/policy-gradient.js +2 -2
  533. package/dist/integrations/rl-suite/algorithms/ppo.js +2 -2
  534. package/dist/integrations/rl-suite/algorithms/q-learning.js +3 -3
  535. package/dist/integrations/rl-suite/algorithms/sarsa.js +2 -2
  536. package/dist/integrations/rl-suite/base-algorithm.js +1 -1
  537. package/dist/integrations/rl-suite/index.js +6 -6
  538. package/dist/integrations/rl-suite/neural/index.js +2 -2
  539. package/dist/integrations/rl-suite/orchestrator.js +11 -11
  540. package/dist/integrations/ruvector/ast-complexity.js +1 -1
  541. package/dist/integrations/ruvector/coverage-router.js +1 -1
  542. package/dist/integrations/ruvector/diff-risk-classifier.js +1 -1
  543. package/dist/integrations/ruvector/feature-flags.d.ts +2 -2
  544. package/dist/integrations/ruvector/graph-boundaries.js +1 -1
  545. package/dist/integrations/ruvector/hypergraph-engine.js +1 -1
  546. package/dist/integrations/ruvector/hypergraph-schema.js +1 -1
  547. package/dist/integrations/ruvector/index.d.ts +1 -1
  548. package/dist/integrations/ruvector/index.js +52 -52
  549. package/dist/integrations/ruvector/page-rank-backends.d.ts +41 -0
  550. package/dist/integrations/ruvector/page-rank-backends.js +154 -0
  551. package/dist/integrations/ruvector/persistent-q-router.js +2 -2
  552. package/dist/integrations/ruvector/q-learning-router.js +1 -1
  553. package/dist/integrations/ruvector/solver-adapter.d.ts +26 -29
  554. package/dist/integrations/ruvector/solver-adapter.js +57 -164
  555. package/dist/integrations/ruvector/sona-persistence.d.ts +13 -11
  556. package/dist/integrations/ruvector/sona-persistence.js +1 -1
  557. package/dist/integrations/vibium/client.js +3 -3
  558. package/dist/integrations/vibium/fallback.js +2 -2
  559. package/dist/integrations/vibium/index.js +9 -9
  560. package/dist/kernel/agent-coordinator.js +1 -1
  561. package/dist/kernel/event-bus.js +1 -1
  562. package/dist/kernel/hybrid-backend.js +1 -1
  563. package/dist/kernel/index.js +11 -11
  564. package/dist/kernel/kernel.js +27 -27
  565. package/dist/kernel/memory-factory.js +2 -2
  566. package/dist/kernel/unified-persistence.js +1 -1
  567. package/dist/learning/aqe-learning-engine.d.ts +0 -1
  568. package/dist/learning/aqe-learning-engine.js +2 -36
  569. package/dist/learning/pattern-lifecycle.js +1 -1
  570. package/dist/learning/pattern-promotion.d.ts +11 -1
  571. package/dist/learning/pattern-promotion.js +27 -0
  572. package/dist/learning/pattern-routing-guidance.d.ts +16 -0
  573. package/dist/learning/pattern-routing-guidance.js +34 -0
  574. package/dist/learning/pattern-usage-recorder.d.ts +10 -0
  575. package/dist/learning/pattern-usage-recorder.js +47 -0
  576. package/dist/learning/qe-reasoning-bank-types.d.ts +4 -0
  577. package/dist/learning/qe-reasoning-bank.d.ts +6 -0
  578. package/dist/learning/qe-reasoning-bank.js +16 -1
  579. package/dist/learning/real-qe-reasoning-bank.d.ts +2 -0
  580. package/dist/learning/real-qe-reasoning-bank.js +4 -2
  581. package/dist/learning/token-tracker.js +1 -1
  582. package/dist/logging/index.js +1 -1
  583. package/dist/logging/logger-factory.js +1 -1
  584. package/dist/mcp/bundle.js +402 -389
  585. package/dist/mcp/entry.js +1 -1
  586. package/dist/mcp/handlers/agent-handlers.js +2 -2
  587. package/dist/mcp/handlers/core-handlers.js +9 -9
  588. package/dist/mcp/handlers/domain-handler-configs.js +2 -2
  589. package/dist/mcp/handlers/domain-handlers.js +2 -2
  590. package/dist/mcp/handlers/handler-factory.js +3 -3
  591. package/dist/mcp/handlers/index.js +7 -7
  592. package/dist/mcp/handlers/memory-handlers.js +1 -1
  593. package/dist/mcp/handlers/task-handlers.js +3 -3
  594. package/dist/mcp/handlers/team-handlers.js +1 -1
  595. package/dist/mcp/index.js +11 -11
  596. package/dist/mcp/metrics/index.js +1 -1
  597. package/dist/mcp/protocol-server.js +13 -13
  598. package/dist/mcp/security/cve-prevention.js +23 -23
  599. package/dist/mcp/security/index.js +9 -9
  600. package/dist/mcp/security/validators/index.js +6 -6
  601. package/dist/mcp/services/index.js +1 -1
  602. package/dist/mcp/services/task-router.js +1 -1
  603. package/dist/mcp/tool-registry.js +4 -4
  604. package/dist/mcp/tools/base.js +1 -1
  605. package/dist/mcp/tools/code-intelligence/analyze.js +4 -4
  606. package/dist/mcp/tools/code-intelligence/c4.js +6 -6
  607. package/dist/mcp/tools/coverage-analysis/index.js +4 -4
  608. package/dist/mcp/tools/defect-intelligence/predict.js +2 -2
  609. package/dist/mcp/tools/embeddings/embedding.js +2 -2
  610. package/dist/mcp/tools/embeddings/index.js +1 -1
  611. package/dist/mcp/tools/index.js +20 -20
  612. package/dist/mcp/tools/learning-optimization/optimize.d.ts +11 -0
  613. package/dist/mcp/tools/learning-optimization/optimize.js +21 -0
  614. package/dist/mcp/tools/mincut/index.js +2 -2
  615. package/dist/mcp/tools/quality-assessment/evaluate.js +1 -1
  616. package/dist/mcp/tools/quality-assessment/gate.js +5 -2
  617. package/dist/mcp/tools/qx-analysis/analyze.js +5 -5
  618. package/dist/mcp/tools/qx-analysis/heuristics-engine.js +1 -1
  619. package/dist/mcp/tools/qx-analysis/index.js +6 -6
  620. package/dist/mcp/tools/registry.js +25 -25
  621. package/dist/mcp/tools/requirements-validation/quality-criteria.js +1 -1
  622. package/dist/mcp/tools/requirements-validation/validate.js +1 -1
  623. package/dist/mcp/tools/security-compliance/scan.js +1 -1
  624. package/dist/mcp/tools/test-execution/e2e-execute.js +3 -3
  625. package/dist/mcp/tools/test-execution/execute.js +1 -1
  626. package/dist/mcp/tools/test-execution/index.js +2 -2
  627. package/dist/mcp/tools/test-generation/generate.js +3 -3
  628. package/dist/mcp/tools/visual-accessibility/index.js +3 -3
  629. package/dist/plugins/index.js +8 -8
  630. package/dist/plugins/lifecycle.js +5 -5
  631. package/dist/plugins/sources/github.js +1 -1
  632. package/dist/plugins/sources/local.js +1 -1
  633. package/dist/plugins/sources/npm.js +1 -1
  634. package/dist/shared/base-domain-plugin.js +1 -1
  635. package/dist/shared/c4-model/index.js +1 -1
  636. package/dist/shared/embeddings/index.js +4 -4
  637. package/dist/shared/embeddings/nomic-embedder.js +3 -3
  638. package/dist/shared/embeddings/ollama-client.js +1 -1
  639. package/dist/shared/entities/agent.js +1 -1
  640. package/dist/shared/entities/index.js +2 -2
  641. package/dist/shared/events/index.js +1 -1
  642. package/dist/shared/git/index.js +1 -1
  643. package/dist/shared/http/http-client.js +1 -1
  644. package/dist/shared/http/index.js +1 -1
  645. package/dist/shared/index.js +15 -15
  646. package/dist/shared/io/file-reader.js +1 -1
  647. package/dist/shared/io/index.js +1 -1
  648. package/dist/shared/llm/circuit-breaker.js +1 -1
  649. package/dist/shared/llm/index.js +11 -11
  650. package/dist/shared/llm/metrics/cost-metrics.js +2 -2
  651. package/dist/shared/llm/metrics/index.js +2 -2
  652. package/dist/shared/llm/metrics/router-metrics.js +1 -1
  653. package/dist/shared/llm/model-registry.js +1 -1
  654. package/dist/shared/llm/provider-manager.js +16 -16
  655. package/dist/shared/llm/providers/azure-openai.js +2 -2
  656. package/dist/shared/llm/providers/bedrock.js +2 -2
  657. package/dist/shared/llm/providers/claude-code.js +1 -1
  658. package/dist/shared/llm/providers/claude.js +4 -4
  659. package/dist/shared/llm/providers/codex.js +1 -1
  660. package/dist/shared/llm/providers/cognitum.js +1 -1
  661. package/dist/shared/llm/providers/gemini.js +1 -1
  662. package/dist/shared/llm/providers/index.js +10 -10
  663. package/dist/shared/llm/providers/ollama.js +2 -2
  664. package/dist/shared/llm/providers/openai.js +2 -2
  665. package/dist/shared/llm/providers/openrouter.js +1 -1
  666. package/dist/shared/llm/router/hybrid-router.js +7 -7
  667. package/dist/shared/llm/router/index.js +4 -4
  668. package/dist/shared/llm/router/routing-rules.js +1 -1
  669. package/dist/shared/llm/translation/index.js +3 -3
  670. package/dist/shared/llm/translation/prompt-translator.js +2 -2
  671. package/dist/shared/metrics/code-metrics.js +2 -2
  672. package/dist/shared/metrics/index.js +2 -2
  673. package/dist/shared/parsers/index.js +3 -3
  674. package/dist/shared/security/compliance-patterns.js +1 -1
  675. package/dist/shared/security/index.js +8 -8
  676. package/dist/shared/security/osv-client.js +1 -1
  677. package/dist/test-scheduling/index.js +9 -9
  678. package/dist/test-scheduling/phase-scheduler.js +1 -1
  679. package/dist/test-scheduling/pipeline.js +9 -9
  680. package/dist/validation/provider-llm-executor.js +5 -5
  681. package/dist/workers/daemon.js +3 -3
  682. package/dist/workers/index.js +5 -5
  683. package/dist/workers/quality-daemon/index.js +15 -15
  684. package/dist/workers/workers/compliance-checker.js +2 -2
  685. package/dist/workers/workers/coverage-tracker.js +1 -1
  686. package/dist/workers/workers/defect-predictor.js +1 -1
  687. package/dist/workers/workers/flaky-detector.js +1 -1
  688. package/dist/workers/workers/learning-consolidation.js +4 -4
  689. package/dist/workers/workers/performance-baseline.js +1 -1
  690. package/dist/workers/workers/quality-gate.js +1 -1
  691. package/dist/workers/workers/regression-monitor.js +1 -1
  692. package/dist/workers/workers/security-scan.js +1 -1
  693. package/dist/workers/workers/test-health.js +1 -1
  694. package/dist/workflows/browser/index.js +1 -1
  695. package/package.json +4 -3
  696. package/dist/cli/chunks/adapter-RFMUKKTU.js +0 -2
  697. package/dist/cli/chunks/aqe-learning-engine-YX4ZUVGL.js +0 -2
  698. package/dist/cli/chunks/base-BSRCRB56.js +0 -2
  699. package/dist/cli/chunks/browser-workflow-MDJBG6CZ.js +0 -2
  700. package/dist/cli/chunks/chunk-2FZW44YF.js +0 -21
  701. package/dist/cli/chunks/chunk-EEKIJM5G.js +0 -2
  702. package/dist/cli/chunks/chunk-G733R72C.js +0 -12
  703. package/dist/cli/chunks/chunk-Y5K3U5TI.js +0 -14
  704. package/dist/cli/chunks/client-N4UGKZ2N.js +0 -2
  705. package/dist/cli/chunks/core-handlers-AGVNKIM6.js +0 -2
  706. package/dist/cli/chunks/cross-domain-router-OKWDNCGK.js +0 -2
  707. package/dist/cli/chunks/dream-ET6PS24D.js +0 -2
  708. package/dist/cli/chunks/heartbeat-scheduler-MORGAHPF.js +0 -2
  709. package/dist/cli/chunks/hnsw-adapter-ZGMA3JMM.js +0 -2
  710. package/dist/cli/chunks/hnsw-index-SOQKFDD4.js +0 -2
  711. package/dist/cli/chunks/hybrid-router-DUOPXCME.js +0 -2
  712. package/dist/cli/chunks/impact-analyzer-7VPH2ILD.js +0 -2
  713. package/dist/cli/chunks/init-wizard-DEVYG7A6.js +0 -2
  714. package/dist/cli/chunks/kernel-QXRVO4OT.js +0 -2
  715. package/dist/cli/chunks/knowledge-graph-DJNX5GHZ.js +0 -2
  716. package/dist/cli/chunks/llm-router-service-LGB7IXQN.js +0 -2
  717. package/dist/cli/chunks/load-test-4UPWRKNK.js +0 -2
  718. package/dist/cli/chunks/memory-backend-7GNWUUTD.js +0 -2
  719. package/dist/cli/chunks/pattern-null-store-VIN6WCCD.js +0 -2
  720. package/dist/cli/chunks/pattern-usage-recorder-BSTPCNTW.js +0 -2
  721. package/dist/cli/chunks/protocol-executor-LZRFQ3LC.js +0 -2
  722. package/dist/cli/chunks/provider-manager-776QJ45P.js +0 -2
  723. package/dist/cli/chunks/qe-reasoning-bank-ZA47GW6I.js +0 -2
  724. package/dist/cli/chunks/queen-coordinator-6YQWKOKJ.js +0 -2
  725. package/dist/cli/chunks/router-XILTD4YX.js +0 -2
  726. package/dist/cli/chunks/routing-feedback-D6NPEQ7P.js +0 -2
  727. package/dist/cli/chunks/ruvector-commands-QPSAC3JN.js +0 -8
  728. package/dist/cli/chunks/rvf-native-adapter-TPQTEI42.js +0 -2
  729. package/dist/cli/chunks/safe-db-PRWZLYKS.js +0 -2
  730. package/dist/cli/chunks/schedule-NPNJ2XSF.js +0 -2
  731. package/dist/cli/chunks/scheduler-IS3IM2KD.js +0 -2
  732. package/dist/cli/chunks/sqlite-persistence-Q2JMMJ4C.js +0 -2
  733. package/dist/cli/chunks/unified-memory-VH2UVAIN.js +0 -2
  734. package/dist/cli/chunks/unified-memory-hnsw-WRGZCJLD.js +0 -2
  735. package/dist/cli/chunks/unified-persistence-LLARTGPG.js +0 -2
  736. package/dist/cli/chunks/upgrade-TZQKTKEE.js +0 -5
  737. package/dist/cli/chunks/visual-security-AR645425.js +0 -2
  738. package/dist/cli/chunks/witness-chain-DCFTYGUF.js +0 -2
  739. package/dist/cli/chunks/workflow-orchestrator-PDPORL64.js +0 -2
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.9");process.exit(0)}
2
- import{a as _}from"./chunk-WQT5WSDA.js";import{a as w}from"./chunk-UHEBXKTE.js";import{c as k}from"./chunk-AET5ETY2.js";import{i as M,m as U}from"./chunk-UNAAAXI2.js";import{b as f,d as P}from"./chunk-JOCSV4LF.js";import{a as g,c as F}from"./chunk-MOI2ZRZO.js";import{a as R}from"./chunk-HZLDCCUG.js";import{randomUUID as N}from"crypto";U();P();F();var x={alpha:.1,minOutcomes:10,weightFloor:.2,weightCeiling:2},p=class{records=new Map;config;constructor(e){this.config={...x,...e}}recordOutcome(e,t,o){let{alpha:i,minOutcomes:r,weightFloor:s,weightCeiling:n}=this.config,c=this.records.get(e),d=t?1:0,a=Math.max(0,Math.min(1,o)),l,u;c?(l=i*d+(1-i)*c.emaAccuracy,u=i*a+(1-i)*c.emaQuality):(l=d,u=a);let h=(c?.totalOutcomes??0)+1,C;h>=r?C=Math.max(s,Math.min(n,l*2)):C=1;let S={agentId:e,emaAccuracy:l,emaQuality:u,calibratedWeight:C,totalOutcomes:h,lastUpdated:new Date};return this.records.set(e,S),S}getCalibration(e){return this.records.get(e)??null}getCalibratedWeight(e){let t=this.records.get(e);return!t||t.totalOutcomes<this.config.minOutcomes?1:t.calibratedWeight}getAllCalibrations(){return Array.from(this.records.values())}reset(e){e!==void 0?this.records.delete(e):this.records.clear()}serialize(){let e={};for(let[t,o]of this.records)e[t]={...o};return e}deserialize(e){this.records.clear();for(let[t,o]of Object.entries(e))this.records.set(t,{...o,lastUpdated:new Date(o.lastUpdated)})}};var D={escalateAfterFailures:2,deEscalateAfterSuccesses:5,maxTier:"opus",minTier:"haiku"},q=["booster","haiku","sonnet","opus"],b=class{config;tierOrder;states=new Map;constructor(e){this.config={...D,...e},this.tierOrder=this.config.tierOrder??q}tierIndex(e){return this.tierOrder.indexOf(e)}recordOutcome(e,t,o){let i=this.states.get(e);i||(i={agentId:e,currentTier:o,baseTier:o,consecutiveFailures:0,consecutiveSuccesses:0,escalationCount:0,deEscalationCount:0,lastAction:"none",lastActionTimestamp:new Date},this.states.set(e,i));let r=i.currentTier;if(t){if(i.consecutiveSuccesses++,i.consecutiveFailures=0,i.consecutiveSuccesses>=this.config.deEscalateAfterSuccesses){let s=this.tierIndex(i.currentTier),n=this.tierIndex(this.config.minTier);if(s>n)return i.currentTier=this.tierOrder[s-1],i.deEscalationCount++,i.consecutiveSuccesses=0,i.lastAction="de-escalate",i.lastActionTimestamp=new Date,{action:"de-escalate",previousTier:r,newTier:i.currentTier}}}else if(i.consecutiveFailures++,i.consecutiveSuccesses=0,i.consecutiveFailures>=this.config.escalateAfterFailures){let s=this.tierIndex(i.currentTier),n=this.tierIndex(this.config.maxTier);if(s>=0&&s<n)return i.currentTier=this.tierOrder[s+1],i.escalationCount++,i.consecutiveFailures=0,i.lastAction="escalate",i.lastActionTimestamp=new Date,{action:"escalate",previousTier:r,newTier:i.currentTier}}return{action:"none",previousTier:r,newTier:i.currentTier}}getCurrentTier(e){return this.states.get(e)?.currentTier??null}getState(e){return this.states.get(e)??null}getAllStates(){return Array.from(this.states.values())}reset(e){e?this.states.delete(e):this.states.clear()}};var T={booster:{avgInputTokens:0,avgOutputTokens:0,costPerTask:0},haiku:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.0035},sonnet:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.021},opus:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.105}},v=["booster","haiku","sonnet","opus"],y=T.opus.costPerTask,I={qualityWeight:.6,costWeight:.4,budgetPerHourUsd:0,budgetPerDayUsd:0,minQualityThreshold:.5,enabled:!0},L=.15,E=class{config;costTracker;tierQualityEstimates=new Map;tierOutcomeCounts=new Map;constructor(e,t){let o={...I,...t};o.qualityWeight=Math.max(0,Math.min(1,o.qualityWeight)),o.costWeight=Math.max(0,Math.min(1,o.costWeight)),o.minQualityThreshold=Math.max(0,Math.min(1,o.minQualityThreshold)),o.budgetPerHourUsd=Math.max(0,o.budgetPerHourUsd),o.budgetPerDayUsd=Math.max(0,o.budgetPerDayUsd);let i=o.qualityWeight+o.costWeight;i>0&&i!==1&&(o.qualityWeight/=i,o.costWeight/=i),this.config=o,this.costTracker=e,this.tierQualityEstimates.set("booster",.3),this.tierQualityEstimates.set("haiku",.55),this.tierQualityEstimates.set("sonnet",.75),this.tierQualityEstimates.set("opus",.9)}scoreTiers(e){let t=v.map(o=>{let i=this.getQualityEstimate(o,e),r=T[o].costPerTask,s=r>0?i/r:i>0?1/0:0,n=y>0?1-r/y:1,c=this.config.qualityWeight*i+this.config.costWeight*n;return{tier:o,qualityScore:i,estimatedCostUsd:r,qualityPerDollar:s,economicScore:c}});return t.sort((o,i)=>i.economicScore-o.economicScore),t}selectTier(e){let t=this.scoreTiers(e);for(let r of t)if(!(r.qualityScore<this.config.minQualityThreshold)&&!this.wouldExceedBudget(r.tier))return{tier:r.tier,reason:`Best economic score (${r.economicScore.toFixed(3)}): quality=${r.qualityScore.toFixed(2)}, cost=$${r.estimatedCostUsd.toFixed(4)}`,scores:t};let o=t.filter(r=>r.qualityScore>=this.config.minQualityThreshold);if(o.length>0){let r=[...o].sort((s,n)=>s.estimatedCostUsd-n.estimatedCostUsd)[0];return{tier:r.tier,reason:`Budget constrained fallback to ${r.tier}`,scores:t}}let i=[...t].sort((r,s)=>s.qualityScore-r.qualityScore)[0];return{tier:i.tier,reason:`No tier meets quality threshold ${this.config.minQualityThreshold}; using best quality: ${i.tier}`,scores:t}}wouldExceedBudget(e){let t=T[e].costPerTask;if(t===0)return!1;let o=this.costTracker.getCurrentCost("hour"),i=this.costTracker.getCurrentCost("day");return this.config.budgetPerHourUsd>0&&o+t>this.config.budgetPerHourUsd||this.config.budgetPerDayUsd>0&&i+t>this.config.budgetPerDayUsd}updateFromOutcome(e,t){let o=e.outcome.qualityScore,i=this.tierQualityEstimates.get(t)??.5,r=this.tierOutcomeCounts.get(t)??0,s=r<5?.4:L,n=i*(1-s)+o*s;this.tierQualityEstimates.set(t,n),this.tierOutcomeCounts.set(t,r+1)}getEconomicReport(){let e=this.scoreTiers(.5),t=this.costTracker.getCurrentCost("hour"),o=this.costTracker.getCurrentCost("day"),i={hourly:this.config.budgetPerHourUsd>0?Math.max(0,this.config.budgetPerHourUsd-t):null,daily:this.config.budgetPerDayUsd>0?Math.max(0,this.config.budgetPerDayUsd-o):null},r=null,s=[...e].sort((a,l)=>l.qualityPerDollar-a.qualityPerDollar),n=s.find(a=>a.estimatedCostUsd>0&&isFinite(a.qualityPerDollar)),c=[...s].reverse().find(a=>a.estimatedCostUsd>0&&isFinite(a.qualityPerDollar));if(n&&c&&n.tier!==c.tier){let a=c.estimatedCostUsd-n.estimatedCostUsd;a>0&&(r={usd:a,description:`Switch from ${c.tier} ($${c.estimatedCostUsd.toFixed(4)}/task) to ${n.tier} ($${n.estimatedCostUsd.toFixed(4)}/task) for comparable tasks to save ~$${a.toFixed(4)}/task`})}let d=this.generateRecommendation(e,i);return{tierEfficiency:e,currentHourlyCostUsd:t,currentDailyCostUsd:o,budgetRemaining:i,recommendation:d,savingsOpportunity:r}}computeCostAdjustedReward(e,t,o){let i=T[t].costPerTask;if(y===0)return e;let r=i/y,s=Math.max(0,o-this.config.minQualityThreshold),n=r*(1-s),c=e-n*this.config.costWeight;return Math.max(-1,Math.min(1,c))}serializeEstimates(){let e={};for(let t of v)e[t]={quality:this.tierQualityEstimates.get(t)??.5,count:this.tierOutcomeCounts.get(t)??0};return e}deserializeEstimates(e){for(let t of v)e[t]&&(this.tierQualityEstimates.set(t,e[t].quality),this.tierOutcomeCounts.set(t,e[t].count))}getConfig(){return{...this.config}}getQualityEstimate(e,t){let o=this.tierQualityEstimates.get(e)??.5,i=e==="booster"?t*.4:e==="haiku"?t*.2:0;return Math.max(0,Math.min(1,o-i))}generateRecommendation(e,t){if(t.hourly!==null&&t.hourly<.01)return"Hourly budget nearly exhausted. Consider increasing budget or routing to cheaper tiers.";if(t.daily!==null&&t.daily<.1)return"Daily budget nearly exhausted. Only critical tasks should use expensive tiers.";let o=e[0];return o?`Most cost-efficient tier: ${o.tier} (score=${o.economicScore.toFixed(3)}, quality=${o.qualityScore.toFixed(2)})`:"No economic data available yet."}};var A=class{outcomes=[];maxOutcomes;constructor(e=1e4){this.maxOutcomes=e}add(e){this.outcomes.push(e),this.outcomes.length>this.maxOutcomes&&(this.outcomes=this.outcomes.slice(-this.maxOutcomes))}getByAgent(e,t=100){return this.outcomes.filter(o=>o.usedAgent===e).slice(-t)}getAll(e=1e3){return this.outcomes.slice(-e)}getRecentOverrides(e=50){return this.outcomes.filter(t=>!t.followedRecommendation).slice(-e)}clear(){this.outcomes=[]}get size(){return this.outcomes.length}},O=class m{static schemaMigrated=!1;outcomeStore;router=null;db=null;calibrator=null;escalationTracker=null;economicModel=null;economicPersistCounter=0;static ECONOMIC_PERSIST_INTERVAL=10;persistCount=0;maxOutcomes;static RETENTION_CLEANUP_INTERVAL=100;constructor(e=1e4,t){this.maxOutcomes=e,this.outcomeStore=new A(e),t?.enableEMACalibration&&this.enableCalibration(),t?.enableAutoEscalation&&this.enableAutoEscalation()}async initialize(){try{this.db=M(),this.db.isInitialized()||await this.db.initialize(),await this.loadFromDb(),this.loadCalibratorState()}catch(e){console.warn("[RoutingFeedbackCollector] DB init failed, using memory-only:",g(e)),this.db=null}}async loadFromDb(){if(!this.db)return;let t=this.db.getDatabase().prepare(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.11");process.exit(0)}
2
+ import{a as _}from"./chunk-4X4GTEQY.js";import{a as w}from"./chunk-ZNGFSR5M.js";import{c as k}from"./chunk-3SPYI7TS.js";import{i as M,m as U}from"./chunk-2Y3PW5EJ.js";import{b as f,d as P}from"./chunk-TZA45FI7.js";import{a as g,c as F}from"./chunk-TCVEXQLL.js";import{a as R}from"./chunk-LUAXQB57.js";import{randomUUID as N}from"crypto";U();P();F();var x={alpha:.1,minOutcomes:10,weightFloor:.2,weightCeiling:2},p=class{records=new Map;config;constructor(e){this.config={...x,...e}}recordOutcome(e,t,o){let{alpha:i,minOutcomes:r,weightFloor:s,weightCeiling:n}=this.config,c=this.records.get(e),d=t?1:0,a=Math.max(0,Math.min(1,o)),l,u;c?(l=i*d+(1-i)*c.emaAccuracy,u=i*a+(1-i)*c.emaQuality):(l=d,u=a);let h=(c?.totalOutcomes??0)+1,C;h>=r?C=Math.max(s,Math.min(n,l*2)):C=1;let S={agentId:e,emaAccuracy:l,emaQuality:u,calibratedWeight:C,totalOutcomes:h,lastUpdated:new Date};return this.records.set(e,S),S}getCalibration(e){return this.records.get(e)??null}getCalibratedWeight(e){let t=this.records.get(e);return!t||t.totalOutcomes<this.config.minOutcomes?1:t.calibratedWeight}getAllCalibrations(){return Array.from(this.records.values())}reset(e){e!==void 0?this.records.delete(e):this.records.clear()}serialize(){let e={};for(let[t,o]of this.records)e[t]={...o};return e}deserialize(e){this.records.clear();for(let[t,o]of Object.entries(e))this.records.set(t,{...o,lastUpdated:new Date(o.lastUpdated)})}};var D={escalateAfterFailures:2,deEscalateAfterSuccesses:5,maxTier:"opus",minTier:"haiku"},q=["booster","haiku","sonnet","opus"],b=class{config;tierOrder;states=new Map;constructor(e){this.config={...D,...e},this.tierOrder=this.config.tierOrder??q}tierIndex(e){return this.tierOrder.indexOf(e)}recordOutcome(e,t,o){let i=this.states.get(e);i||(i={agentId:e,currentTier:o,baseTier:o,consecutiveFailures:0,consecutiveSuccesses:0,escalationCount:0,deEscalationCount:0,lastAction:"none",lastActionTimestamp:new Date},this.states.set(e,i));let r=i.currentTier;if(t){if(i.consecutiveSuccesses++,i.consecutiveFailures=0,i.consecutiveSuccesses>=this.config.deEscalateAfterSuccesses){let s=this.tierIndex(i.currentTier),n=this.tierIndex(this.config.minTier);if(s>n)return i.currentTier=this.tierOrder[s-1],i.deEscalationCount++,i.consecutiveSuccesses=0,i.lastAction="de-escalate",i.lastActionTimestamp=new Date,{action:"de-escalate",previousTier:r,newTier:i.currentTier}}}else if(i.consecutiveFailures++,i.consecutiveSuccesses=0,i.consecutiveFailures>=this.config.escalateAfterFailures){let s=this.tierIndex(i.currentTier),n=this.tierIndex(this.config.maxTier);if(s>=0&&s<n)return i.currentTier=this.tierOrder[s+1],i.escalationCount++,i.consecutiveFailures=0,i.lastAction="escalate",i.lastActionTimestamp=new Date,{action:"escalate",previousTier:r,newTier:i.currentTier}}return{action:"none",previousTier:r,newTier:i.currentTier}}getCurrentTier(e){return this.states.get(e)?.currentTier??null}getState(e){return this.states.get(e)??null}getAllStates(){return Array.from(this.states.values())}reset(e){e?this.states.delete(e):this.states.clear()}};var T={booster:{avgInputTokens:0,avgOutputTokens:0,costPerTask:0},haiku:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.0035},sonnet:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.021},opus:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.105}},v=["booster","haiku","sonnet","opus"],y=T.opus.costPerTask,I={qualityWeight:.6,costWeight:.4,budgetPerHourUsd:0,budgetPerDayUsd:0,minQualityThreshold:.5,enabled:!0},L=.15,E=class{config;costTracker;tierQualityEstimates=new Map;tierOutcomeCounts=new Map;constructor(e,t){let o={...I,...t};o.qualityWeight=Math.max(0,Math.min(1,o.qualityWeight)),o.costWeight=Math.max(0,Math.min(1,o.costWeight)),o.minQualityThreshold=Math.max(0,Math.min(1,o.minQualityThreshold)),o.budgetPerHourUsd=Math.max(0,o.budgetPerHourUsd),o.budgetPerDayUsd=Math.max(0,o.budgetPerDayUsd);let i=o.qualityWeight+o.costWeight;i>0&&i!==1&&(o.qualityWeight/=i,o.costWeight/=i),this.config=o,this.costTracker=e,this.tierQualityEstimates.set("booster",.3),this.tierQualityEstimates.set("haiku",.55),this.tierQualityEstimates.set("sonnet",.75),this.tierQualityEstimates.set("opus",.9)}scoreTiers(e){let t=v.map(o=>{let i=this.getQualityEstimate(o,e),r=T[o].costPerTask,s=r>0?i/r:i>0?1/0:0,n=y>0?1-r/y:1,c=this.config.qualityWeight*i+this.config.costWeight*n;return{tier:o,qualityScore:i,estimatedCostUsd:r,qualityPerDollar:s,economicScore:c}});return t.sort((o,i)=>i.economicScore-o.economicScore),t}selectTier(e){let t=this.scoreTiers(e);for(let r of t)if(!(r.qualityScore<this.config.minQualityThreshold)&&!this.wouldExceedBudget(r.tier))return{tier:r.tier,reason:`Best economic score (${r.economicScore.toFixed(3)}): quality=${r.qualityScore.toFixed(2)}, cost=$${r.estimatedCostUsd.toFixed(4)}`,scores:t};let o=t.filter(r=>r.qualityScore>=this.config.minQualityThreshold);if(o.length>0){let r=[...o].sort((s,n)=>s.estimatedCostUsd-n.estimatedCostUsd)[0];return{tier:r.tier,reason:`Budget constrained fallback to ${r.tier}`,scores:t}}let i=[...t].sort((r,s)=>s.qualityScore-r.qualityScore)[0];return{tier:i.tier,reason:`No tier meets quality threshold ${this.config.minQualityThreshold}; using best quality: ${i.tier}`,scores:t}}wouldExceedBudget(e){let t=T[e].costPerTask;if(t===0)return!1;let o=this.costTracker.getCurrentCost("hour"),i=this.costTracker.getCurrentCost("day");return this.config.budgetPerHourUsd>0&&o+t>this.config.budgetPerHourUsd||this.config.budgetPerDayUsd>0&&i+t>this.config.budgetPerDayUsd}updateFromOutcome(e,t){let o=e.outcome.qualityScore,i=this.tierQualityEstimates.get(t)??.5,r=this.tierOutcomeCounts.get(t)??0,s=r<5?.4:L,n=i*(1-s)+o*s;this.tierQualityEstimates.set(t,n),this.tierOutcomeCounts.set(t,r+1)}getEconomicReport(){let e=this.scoreTiers(.5),t=this.costTracker.getCurrentCost("hour"),o=this.costTracker.getCurrentCost("day"),i={hourly:this.config.budgetPerHourUsd>0?Math.max(0,this.config.budgetPerHourUsd-t):null,daily:this.config.budgetPerDayUsd>0?Math.max(0,this.config.budgetPerDayUsd-o):null},r=null,s=[...e].sort((a,l)=>l.qualityPerDollar-a.qualityPerDollar),n=s.find(a=>a.estimatedCostUsd>0&&isFinite(a.qualityPerDollar)),c=[...s].reverse().find(a=>a.estimatedCostUsd>0&&isFinite(a.qualityPerDollar));if(n&&c&&n.tier!==c.tier){let a=c.estimatedCostUsd-n.estimatedCostUsd;a>0&&(r={usd:a,description:`Switch from ${c.tier} ($${c.estimatedCostUsd.toFixed(4)}/task) to ${n.tier} ($${n.estimatedCostUsd.toFixed(4)}/task) for comparable tasks to save ~$${a.toFixed(4)}/task`})}let d=this.generateRecommendation(e,i);return{tierEfficiency:e,currentHourlyCostUsd:t,currentDailyCostUsd:o,budgetRemaining:i,recommendation:d,savingsOpportunity:r}}computeCostAdjustedReward(e,t,o){let i=T[t].costPerTask;if(y===0)return e;let r=i/y,s=Math.max(0,o-this.config.minQualityThreshold),n=r*(1-s),c=e-n*this.config.costWeight;return Math.max(-1,Math.min(1,c))}serializeEstimates(){let e={};for(let t of v)e[t]={quality:this.tierQualityEstimates.get(t)??.5,count:this.tierOutcomeCounts.get(t)??0};return e}deserializeEstimates(e){for(let t of v)e[t]&&(this.tierQualityEstimates.set(t,e[t].quality),this.tierOutcomeCounts.set(t,e[t].count))}getConfig(){return{...this.config}}getQualityEstimate(e,t){let o=this.tierQualityEstimates.get(e)??.5,i=e==="booster"?t*.4:e==="haiku"?t*.2:0;return Math.max(0,Math.min(1,o-i))}generateRecommendation(e,t){if(t.hourly!==null&&t.hourly<.01)return"Hourly budget nearly exhausted. Consider increasing budget or routing to cheaper tiers.";if(t.daily!==null&&t.daily<.1)return"Daily budget nearly exhausted. Only critical tasks should use expensive tiers.";let o=e[0];return o?`Most cost-efficient tier: ${o.tier} (score=${o.economicScore.toFixed(3)}, quality=${o.qualityScore.toFixed(2)})`:"No economic data available yet."}};var A=class{outcomes=[];maxOutcomes;constructor(e=1e4){this.maxOutcomes=e}add(e){this.outcomes.push(e),this.outcomes.length>this.maxOutcomes&&(this.outcomes=this.outcomes.slice(-this.maxOutcomes))}getByAgent(e,t=100){return this.outcomes.filter(o=>o.usedAgent===e).slice(-t)}getAll(e=1e3){return this.outcomes.slice(-e)}getRecentOverrides(e=50){return this.outcomes.filter(t=>!t.followedRecommendation).slice(-e)}clear(){this.outcomes=[]}get size(){return this.outcomes.length}},O=class m{static schemaMigrated=!1;outcomeStore;router=null;db=null;calibrator=null;escalationTracker=null;economicModel=null;economicPersistCounter=0;static ECONOMIC_PERSIST_INTERVAL=10;persistCount=0;maxOutcomes;static RETENTION_CLEANUP_INTERVAL=100;constructor(e=1e4,t){this.maxOutcomes=e,this.outcomeStore=new A(e),t?.enableEMACalibration&&this.enableCalibration(),t?.enableAutoEscalation&&this.enableAutoEscalation()}async initialize(){try{this.db=M(),this.db.isInitialized()||await this.db.initialize(),await this.loadFromDb(),this.loadCalibratorState()}catch(e){console.warn("[RoutingFeedbackCollector] DB init failed, using memory-only:",g(e)),this.db=null}}async loadFromDb(){if(!this.db)return;let t=this.db.getDatabase().prepare(`
3
3
  SELECT * FROM routing_outcomes ORDER BY created_at DESC LIMIT ?
4
4
  `).all(this.maxOutcomes);for(let o of t.reverse()){let i={id:o.id,task:f(o.task_json),decision:f(o.decision_json),usedAgent:o.used_agent,followedRecommendation:!!o.followed_recommendation,outcome:{success:!!o.success,qualityScore:o.quality_score,durationMs:o.duration_ms,error:o.error||void 0},timestamp:new Date(o.created_at),advisorConsultation:o.advisor_consultation_json?f(o.advisor_consultation_json):void 0};this.outcomeStore.add(i)}t.length>0&&console.log(`[RoutingFeedbackCollector] Loaded ${t.length} outcomes from DB`)}persistOutcome(e){if(this.db)try{let t=this.db.getDatabase();if(!m.schemaMigrated){for(let r of["ALTER TABLE routing_outcomes ADD COLUMN model_tier TEXT","ALTER TABLE routing_outcomes ADD COLUMN advisor_consultation_json TEXT"])try{t.prepare(r).run()}catch{}_(t),m.schemaMigrated=!0}let o=this.inferTier(e.usedAgent),i=e.advisorConsultation?JSON.stringify(e.advisorConsultation):null;t.prepare(`
5
5
  INSERT OR REPLACE INTO routing_outcomes (
@@ -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.9");process.exit(0)}
2
- import{c as f}from"./chunk-HZLDCCUG.js";import*as o from"fs";import*as n from"path";function u(){t=null}function g(c=process.cwd()){if(t)return t;if(process.env.AQE_PROJECT_ROOT)return t=process.env.AQE_PROJECT_ROOT,t;let l=c,a=n.parse(l).root,e=l,i=null,s=null,r=null;for(;e!==a;)o.existsSync(n.join(e,".agentic-qe"))&&i===null&&(i=e),o.existsSync(n.join(e,".git"))&&s===null&&(s=e),o.existsSync(n.join(e,"package.json"))&&(r=e),e=n.dirname(e);return i?t=i:s?t=s:r?t=r:t=process.cwd(),t}var t,p=f(()=>{"use strict";t=null});export{u as a,g as b,p as c};
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.11");process.exit(0)}
2
+ import{c as f}from"./chunk-LUAXQB57.js";import*as o from"fs";import*as n from"path";function u(){t=null}function g(c=process.cwd()){if(t)return t;if(process.env.AQE_PROJECT_ROOT)return t=process.env.AQE_PROJECT_ROOT,t;let l=c,a=n.parse(l).root,e=l,i=null,s=null,r=null;for(;e!==a;)o.existsSync(n.join(e,".agentic-qe"))&&i===null&&(i=e),o.existsSync(n.join(e,".git"))&&s===null&&(s=e),o.existsSync(n.join(e,"package.json"))&&(r=e),e=n.dirname(e);return i?t=i:s?t=s:r?t=r:t=process.cwd(),t}var t,p=f(()=>{"use strict";t=null});export{u as a,g as b,p as c};
@@ -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.9");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.11");process.exit(0)}
2
2
  var h=Object.create;var f=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')}),n=a=>b=>{var c=a[b];if(c)return c();throw new Error("Module not found in bundle: "+b)};var o=(a,b,c)=>()=>{if(c)throw c[0];try{return a&&(b=a(a=0)),b}catch(d){throw c=[d],d}};var p=(a,b)=>()=>{try{return b||a((b={exports:{}}).exports,b),b.exports}catch(c){throw b=0,c}},q=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0})},g=(a,b,c,d)=>{if(b&&typeof b=="object"||typeof b=="function")for(let e of j(b))!l.call(a,e)&&e!==c&&f(a,e,{get:()=>b[e],enumerable:!(d=i(b,e))||d.enumerable});return a};var r=(a,b,c)=>(c=a!=null?h(k(a)):{},g(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c,a)),s=a=>g(f({},"__esModule",{value:!0}),a);export{m as a,n as b,o as c,p as d,q as e,r as f,s as g};
@@ -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.9");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.11");process.exit(0)}
2
2
  var i=class r{constructor(e){this._value=e;if(!e||e.trim()==="")throw new Error("FilePath cannot be empty")}_value;get value(){return this._value}get extension(){let e=this._value.split(".");return e.length>1?e[e.length-1]:""}get directory(){let e=this._value.lastIndexOf("/");return e>0?this._value.substring(0,e):""}get filename(){let e=this._value.lastIndexOf("/");return e>=0?this._value.substring(e+1):this._value}equals(e){return this._value===e._value}static create(e){return new r(e)}};var s=class r{constructor(e){this._value=e;if(e<0||e>1)throw new Error("RiskScore must be between 0 and 1")}_value;get value(){return this._value}get percentage(){return this._value*100}get level(){return this._value>=.8?"critical":this._value>=.6?"high":this._value>=.3?"medium":"low"}isHigherThan(e){return this._value>e._value}equals(e){return this._value===e._value}static create(e){return new r(e)}static fromPercentage(e){return new r(e/100)}},u=class r{constructor(e,t){this._start=e;this._end=t;if(e>t)throw new Error("Start date cannot be after end date")}_start;_end;get start(){return this._start}get end(){return this._end}get durationMs(){return this._end.getTime()-this._start.getTime()}get durationSeconds(){return this.durationMs/1e3}contains(e){return e>=this._start&&e<=this._end}overlaps(e){return this._start<=e._end&&e._start<=this._end}equals(e){return this._start.getTime()===e._start.getTime()&&this._end.getTime()===e._end.getTime()}static create(e,t){return new r(e,t)}static lastNDays(e){let t=new Date,n=new Date(t.getTime()-e*24*60*60*1e3);return new r(n,t)}},o=class r{constructor(e,t,n,a){this._major=e;this._minor=t;this._patch=n;this._prerelease=a}_major;_minor;_patch;_prerelease;get major(){return this._major}get minor(){return this._minor}get patch(){return this._patch}get prerelease(){return this._prerelease}toString(){let e=`${this._major}.${this._minor}.${this._patch}`;return this._prerelease?`${e}-${this._prerelease}`:e}isNewerThan(e){return this._major!==e._major?this._major>e._major:this._minor!==e._minor?this._minor>e._minor:this._patch>e._patch}equals(e){return this._major===e._major&&this._minor===e._minor&&this._patch===e._patch&&this._prerelease===e._prerelease}static create(e,t,n,a){return new r(e,t,n,a)}static parse(e){let t=e.match(/^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/);if(!t)throw new Error(`Invalid version format: ${e}`);return new r(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),t[4])}};export{i as a,s as b,u as c,o as d};
@@ -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.9");process.exit(0)}
2
- import{a as m}from"./chunk-OYVUVHNV.js";import{f as c}from"./chunk-OF6KNZTQ.js";import{m as R}from"./chunk-UNAAAXI2.js";import{b as f}from"./chunk-N46VHXWO.js";import h from"node:path";async function p(e){if(e.checklist.requirements.length===0)throw new Error("RequirementChecklist must have a non-empty, constant denominator (ADR-117).");if(!(e.oracle!=null&&e.oracle.baselinePassed&&e.oracle.passed)){let u=e.oracle==null?"oracle did not run":e.oracle.baselinePassed?"mutation score below threshold":"tests did not execute against the reference implementation";return{verdict:"fail",mechanical:"fail",specCoverage:null,unmet:[],attempts:0,reason:`mechanical gate failed: ${u}`}}if(!await e.judge.preflight())return{verdict:"inconclusive",mechanical:"pass",specCoverage:null,unmet:[],attempts:0,reason:"judge preflight failed: judge tooling did not run \u2014 refusing to report success"};let s=[],i=null,r=[],o=0;for(let u=0;u<2;u++){o++;let a=await e.judge.grade(e.artifact,e.checklist);if(a.ran&&(s.push(a),(i==null||a.coverage>i)&&(i=a.coverage,r=a.unmet),a.coverage>=1))return{verdict:"pass",mechanical:"pass",specCoverage:a.coverage,unmet:[],attempts:o,reason:`spec gate passed at coverage ${a.coverage.toFixed(3)} on attempt ${o}`}}return s.length>=2?{verdict:"fail",mechanical:"pass",specCoverage:i,unmet:r,attempts:o,reason:`spec gate failed: ${s.length} real opinions, best coverage ${(i??0).toFixed(3)} < 1 (${r.length} unmet)`}:{verdict:"inconclusive",mechanical:"pass",specCoverage:i,unmet:r,attempts:o,reason:`spec gate inconclusive: only ${s.length} real opinion(s) obtainable (need 2 to fail) \u2014 retry later, record neither pass nor fail`}}R();var T="verification/anchors/qe-anchor-v1.json";async function I(e){let t=A(e.checklistId,e.anchorPath);return p({oracle:e.oracleResult,artifact:e.artifact,checklist:t,judge:e.judge})}function A(e,t){let n=y(t),s=m(n),i=s.items.find(r=>r.id===e);if(!i){let r=s.items.map(o=>o.id).join(", ");throw new Error(`Unknown checklist id "${e}" in anchor ${n}. Available: ${r}`)}return{id:i.id,requirements:i.requirements}}function U(e){return m(y(e)).items.map(n=>n.id)}function y(e){if(e&&h.isAbsolute(e))return e;let t=f();return h.resolve(t,e??T)}var C=6e4,k=15e3;function E(e){let t=e.timeoutMs??C,n=e.logger??(()=>{}),s=e.model??"frontier",i=e.ping??(async()=>{let r=await v(e.complete("Reply with exactly: OK"),Math.min(k,t),"judge preflight ping");return typeof r=="string"&&r.trim().length>0});return{async preflight(){try{let r=await i();return r||n(`frontier-judge preflight: provider (${s}) returned empty \u2014 not ready`),r}catch(r){return n(`frontier-judge preflight failed (${s}): ${b(r)}`),!1}},async grade(r,o){let u=o.requirements.length;try{let a=j(r,o),x=await v(e.complete(a),t,"judge grade"),d=q(x,u);if(d==null)return n(`frontier-judge grade: could not parse response for ${o.id}`),{ran:!1,coverage:0,unmet:[]};let g=[...d].sort((l,P)=>l-P).map(l=>o.requirements[l]);return{ran:!0,coverage:(u-g.length)/u,unmet:g}}catch(a){return n(`frontier-judge grade failed for ${o.id} (${s}): ${b(a)}`),{ran:!1,coverage:0,unmet:[]}}}}}function O(e,t={}){let n=t.model??c;return async s=>(await e.chat({messages:[{role:"user",content:s}],model:n,preferredProvider:t.preferredProvider,temperature:t.temperature??0,maxTokens:t.maxTokens??1024,timeoutMs:t.timeoutMs,skipCache:!0})).content??""}function Q(e,t={}){let n=t.model??c;return E({complete:O(e,{...t,model:n}),model:n,timeoutMs:t.timeoutMs,logger:t.logger})}function D(e){return{preflight:()=>!1,grade:()=>({ran:!1,coverage:0,unmet:[]})}}function j(e,t){let n=t.requirements.map((s,i)=>`${i+1}. ${s}`).join(`
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.11");process.exit(0)}
2
+ import{a as m}from"./chunk-HZR4G6I3.js";import{f as c}from"./chunk-XVFSZLRS.js";import{m as R}from"./chunk-2Y3PW5EJ.js";import{b as f}from"./chunk-LREIHR2A.js";import h from"node:path";async function p(e){if(e.checklist.requirements.length===0)throw new Error("RequirementChecklist must have a non-empty, constant denominator (ADR-117).");if(!(e.oracle!=null&&e.oracle.baselinePassed&&e.oracle.passed)){let u=e.oracle==null?"oracle did not run":e.oracle.baselinePassed?"mutation score below threshold":"tests did not execute against the reference implementation";return{verdict:"fail",mechanical:"fail",specCoverage:null,unmet:[],attempts:0,reason:`mechanical gate failed: ${u}`}}if(!await e.judge.preflight())return{verdict:"inconclusive",mechanical:"pass",specCoverage:null,unmet:[],attempts:0,reason:"judge preflight failed: judge tooling did not run \u2014 refusing to report success"};let s=[],i=null,r=[],o=0;for(let u=0;u<2;u++){o++;let a=await e.judge.grade(e.artifact,e.checklist);if(a.ran&&(s.push(a),(i==null||a.coverage>i)&&(i=a.coverage,r=a.unmet),a.coverage>=1))return{verdict:"pass",mechanical:"pass",specCoverage:a.coverage,unmet:[],attempts:o,reason:`spec gate passed at coverage ${a.coverage.toFixed(3)} on attempt ${o}`}}return s.length>=2?{verdict:"fail",mechanical:"pass",specCoverage:i,unmet:r,attempts:o,reason:`spec gate failed: ${s.length} real opinions, best coverage ${(i??0).toFixed(3)} < 1 (${r.length} unmet)`}:{verdict:"inconclusive",mechanical:"pass",specCoverage:i,unmet:r,attempts:o,reason:`spec gate inconclusive: only ${s.length} real opinion(s) obtainable (need 2 to fail) \u2014 retry later, record neither pass nor fail`}}R();var T="verification/anchors/qe-anchor-v1.json";async function I(e){let t=A(e.checklistId,e.anchorPath);return p({oracle:e.oracleResult,artifact:e.artifact,checklist:t,judge:e.judge})}function A(e,t){let n=y(t),s=m(n),i=s.items.find(r=>r.id===e);if(!i){let r=s.items.map(o=>o.id).join(", ");throw new Error(`Unknown checklist id "${e}" in anchor ${n}. Available: ${r}`)}return{id:i.id,requirements:i.requirements}}function U(e){return m(y(e)).items.map(n=>n.id)}function y(e){if(e&&h.isAbsolute(e))return e;let t=f();return h.resolve(t,e??T)}var C=6e4,k=15e3;function E(e){let t=e.timeoutMs??C,n=e.logger??(()=>{}),s=e.model??"frontier",i=e.ping??(async()=>{let r=await v(e.complete("Reply with exactly: OK"),Math.min(k,t),"judge preflight ping");return typeof r=="string"&&r.trim().length>0});return{async preflight(){try{let r=await i();return r||n(`frontier-judge preflight: provider (${s}) returned empty \u2014 not ready`),r}catch(r){return n(`frontier-judge preflight failed (${s}): ${b(r)}`),!1}},async grade(r,o){let u=o.requirements.length;try{let a=j(r,o),x=await v(e.complete(a),t,"judge grade"),d=q(x,u);if(d==null)return n(`frontier-judge grade: could not parse response for ${o.id}`),{ran:!1,coverage:0,unmet:[]};let g=[...d].sort((l,P)=>l-P).map(l=>o.requirements[l]);return{ran:!0,coverage:(u-g.length)/u,unmet:g}}catch(a){return n(`frontier-judge grade failed for ${o.id} (${s}): ${b(a)}`),{ran:!1,coverage:0,unmet:[]}}}}}function O(e,t={}){let n=t.model??c;return async s=>(await e.chat({messages:[{role:"user",content:s}],model:n,preferredProvider:t.preferredProvider,temperature:t.temperature??0,maxTokens:t.maxTokens??1024,timeoutMs:t.timeoutMs,skipCache:!0})).content??""}function Q(e,t={}){let n=t.model??c;return E({complete:O(e,{...t,model:n}),model:n,timeoutMs:t.timeoutMs,logger:t.logger})}function D(e){return{preflight:()=>!1,grade:()=>({ran:!1,coverage:0,unmet:[]})}}function j(e,t){let n=t.requirements.map((s,i)=>`${i+1}. ${s}`).join(`
3
3
  `);return["You are a rigorous, frontier-tier quality oracle grading a software artifact","against a FIXED requirement checklist. Judge only what the artifact actually","verifies \u2014 do not give credit for requirements it merely mentions or leaves",'implicit. A requirement is "met" only if the artifact demonstrably covers it.',"",`Checklist id: ${t.id}`,"Requirements (the denominator is fixed \u2014 grade ALL of them):",n,"","--- ARTIFACT UNDER JUDGEMENT ---",e,"--- END ARTIFACT ---","","Return ONLY a single JSON object, no prose, no markdown fences, of the form:",'{"unmet": [<numbers of requirements NOT met>]}','Use the requirement numbers above. If every requirement is met, return {"unmet": []}.'].join(`
4
4
  `)}function q(e,t){let n=J(e);if(n==null||!Array.isArray(n.unmet))return null;let s=new Set;for(let i of n.unmet){let r=typeof i=="number"?i:typeof i=="string"?Number(i.trim()):NaN;if(!Number.isInteger(r))continue;let o=r-1;o>=0&&o<t&&s.add(o)}return s}function J(e){if(typeof e!="string")return null;let t=e.indexOf("{");if(t===-1)return null;let n=0,s=!1,i=!1;for(let r=t;r<e.length;r++){let o=e[r];if(s){i?i=!1:o==="\\"?i=!0:o==='"'&&(s=!1);continue}if(o==='"')s=!0;else if(o==="{")n++;else if(o==="}"&&(n--,n===0))try{return JSON.parse(e.slice(t,r+1))}catch{return null}}return null}function v(e,t,n){return new Promise((s,i)=>{let r=setTimeout(()=>i(new Error(`${n} timed out after ${t}ms`)),t);e.then(o=>{clearTimeout(r),s(o)},o=>{clearTimeout(r),i(o)})})}function b(e){return e instanceof Error?e.message:String(e)}export{I as a,U as b,Q as c,D as d};
@@ -0,0 +1,21 @@
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.11");process.exit(0)}
2
+ import{a as $}from"./chunk-IZF3VLNW.js";import{a as q,e as C,f as F}from"./chunk-FPX4JSFH.js";import{a as T}from"./chunk-WINYWMQP.js";import{a as H,b as _,c as U,d as j,f as B}from"./chunk-TMY2Y7SC.js";import{a as W,b as N,f as O,i as z}from"./chunk-36ONUM43.js";import{d as G}from"./chunk-TU4BYSXR.js";import{b as v,d as M,f as A,g as P}from"./chunk-T5M4TZRB.js";import{a as V}from"./chunk-CYQRZ645.js";import{c as L}from"./chunk-QYHRDBKI.js";import{b as w,d as X}from"./chunk-TZA45FI7.js";import{b as p,c as h}from"./chunk-XDK2TPI5.js";import{a as I,b as f,c as Y}from"./chunk-TCVEXQLL.js";import{i as D}from"./chunk-PJNIDDER.js";V();Y();X();var o=L.create("RealQEReasoningBank"),Z={sqlite:{dbPath:".agentic-qe/memory.db",walMode:!0,useUnified:!0},embeddings:{modelName:"Xenova/all-MiniLM-L6-v2",quantized:!0,enableCache:!0},enableLearning:!0,enableRouting:!0,enableGuidance:!0,hnsw:{M:16,efConstruction:200,efSearch:100},routingWeights:{similarity:.3,performance:.4,capabilities:.3},coherenceThreshold:.4},R=class{constructor(e={},t){this.coherenceService=t;this.qeConfig={...Z,...e},this.sqliteStore=G(this.qeConfig.sqlite),this.asymmetricEngine=new $}coherenceService;qeConfig;sqliteStore;hnswIndex=null;patternIdMap=new Map;initialized=!1;stats={routingRequests:0,totalRoutingLatency:0,learningOutcomes:0,successfulOutcomes:0};routingLatencies=new T(1e3);asymmetricEngine;agentCapabilities={"qe-test-generator":{domains:["test-generation"],capabilities:["test-generation","tdd","bdd","unit-test","integration-test"],performanceScore:.85},"qe-coverage-analyzer":{domains:["coverage-analysis"],capabilities:["coverage-analysis","gap-detection","risk-scoring"],performanceScore:.92},"qe-coverage-specialist":{domains:["coverage-analysis"],capabilities:["sublinear-analysis","branch-coverage","mutation-testing"],performanceScore:.88},"qe-test-architect":{domains:["test-generation","coverage-analysis"],capabilities:["test-strategy","test-pyramid","architecture"],performanceScore:.9},"qe-api-contract-validator":{domains:["contract-testing"],capabilities:["contract-testing","openapi","graphql","pact"],performanceScore:.87},"qe-security-auditor":{domains:["security-compliance"],capabilities:["sast","dast","vulnerability","owasp"],performanceScore:.82},"qe-visual-tester":{domains:["visual-accessibility"],capabilities:["screenshot","visual-regression","percy","chromatic"],performanceScore:.8},"qe-a11y-ally":{domains:["visual-accessibility"],capabilities:["wcag","aria","screen-reader","contrast"],performanceScore:.85},"qe-performance-tester":{domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","k6","artillery"],performanceScore:.83},"qe-flaky-investigator":{domains:["test-execution"],capabilities:["flaky-detection","test-stability","retry"],performanceScore:.78},"qe-chaos-engineer":{domains:["chaos-resilience"],capabilities:["chaos-testing","resilience","fault-injection"],performanceScore:.75}};async initialize(){if(this.initialized)return;let e=performance.now();await this.sqliteStore.initialize(),o.info("SQLite persistence initialized"),await this.initializeHNSW(),o.info("HNSW index initialized"),await this.loadPatternsIntoHNSW(),this.sqliteStore.getStats().totalPatterns===0&&(this.sqliteStore.hasAnyHistoricalData?.()??!1?o.error("qe_patterns table is EMPTY but historical data exists \u2014 possible data loss! Restore from backup instead of loading seed patterns. Skipping foundational pattern load to avoid masking data loss."):await this.loadFoundationalPatterns()),this.initialized=!0;let i=performance.now()-e;o.info("Fully initialized",{durationMs:Math.round(i)})}async initializeHNSW(){try{let e=await import("./hnswlib-node-TZ4VLARU.js"),i=e.default?.HierarchicalNSW||e.HierarchicalNSW;if(typeof i!="function")throw new Error("HierarchicalNSW not found in hnswlib-node module");let n=i,a=P();this.hnswIndex=new n("cosine",a),this.hnswIndex.initIndex(1e5,this.qeConfig.hnsw.M,this.qeConfig.hnsw.efConstruction),this.hnswIndex.setEf(this.qeConfig.hnsw.efSearch),o.info("HNSW initialized",{dimension:a,M:this.qeConfig.hnsw.M})}catch(e){throw o.error("HNSW initialization failed",e instanceof Error?e:void 0),e}}async loadPatternsIntoHNSW(){if(!this.hnswIndex)return;let e=this.sqliteStore.getAllEmbeddings(),t=P(),i=0,n=0;for(let{patternId:a,embedding:s}of e){if(!s||!Array.isArray(s)||s.length!==t){n++;continue}let r=this.hnswIndex.getCurrentCount();this.hnswIndex.addPoint(s,r),this.patternIdMap.set(r,a),i++}n>0&&o.warn("Skipped invalid embeddings",{skipped:n,expectedDim:t}),o.info("Loaded patterns into HNSW index",{count:i})}async loadFoundationalPatterns(){let e=[{patternType:"test-template",name:"AAA Unit Test",description:"Arrange-Act-Assert pattern for clear, maintainable unit tests",template:{type:"code",content:`describe('{{className}}', () => {
3
+ describe('{{methodName}}', () => {
4
+ it('should {{expectedBehavior}}', {{async}} () => {
5
+ // Arrange
6
+ {{arrangeCode}}
7
+
8
+ // Act
9
+ {{actCode}}
10
+
11
+ // Assert
12
+ {{assertCode}}
13
+ });
14
+ });
15
+ });`,variables:[{name:"className",type:"string",required:!0},{name:"methodName",type:"string",required:!0},{name:"expectedBehavior",type:"string",required:!0}]},context:{testType:"unit",tags:["unit-test","aaa","best-practice"]}},{patternType:"coverage-strategy",name:"Risk-Based Coverage",description:"Prioritize coverage by code risk and complexity",template:{type:"prompt",content:"Analyze coverage gaps focusing on critical business logic, error handling, and high-complexity functions.",variables:[]},context:{tags:["coverage","risk-based"]}}];for(let t of e)try{await this.storeQEPattern(t)}catch(i){o.warn("Failed to load foundational pattern",{name:t.name,error:i})}o.info("Loaded foundational patterns",{count:e.length})}async storeQEPattern(e){try{let t=`${e.name} ${e.description||""} ${e.context?.tags?.join(" ")||""}`,i=await v(t,this.qeConfig.embeddings),n=W(t)||"test-generation";if(q())try{let r=F(e.name,{description:e.description,template:e.template,patternType:e.patternType},n,{tags:e.context?.tags}),c=await C.evaluateWrite(r);if(!c.allowed&&(o.warn("Pattern blocked by MemoryWriteGate",{name:e.name,reason:c.reason,conflicts:c.conflictingPatterns?.join(", ")||"none"}),c.reason?.includes("strict")))return h(new Error(`Pattern blocked by governance: ${c.reason}`))}catch(r){o.warn("MemoryWriteGate check error (continuing)",{error:r})}let a=D(),s={id:a,patternType:e.patternType,qeDomain:n,domain:n,name:e.name,description:e.description||"",confidence:.5,usageCount:0,successRate:0,qualityScore:0,tier:"short-term",template:e.template,context:{tags:[],...e.context},createdAt:new Date,lastUsedAt:new Date,successfulUses:0,embedding:i,reusable:!1,reuseCount:0,averageTokenSavings:0};if(this.sqliteStore.storePattern(s,i),this.hnswIndex){let r=this.hnswIndex.getCurrentCount();this.hnswIndex.addPoint(i,r),this.patternIdMap.set(r,a)}if(q())try{C.registerPattern({key:a,value:{name:s.name,description:s.description,patternType:s.patternType},domain:s.domain})}catch(r){o.warn("Pattern registration with MemoryWriteGate failed",{error:r})}return p(s)}catch(t){return h(f(t))}}async searchQEPatterns(e,t={}){let i=performance.now();try{if(!this.hnswIndex)return h(new Error("HNSW index not available"));let n=await v(e,this.qeConfig.embeddings),a=t.limit||10,s=this.hnswIndex.searchKnn(n,a*2),r=[];for(let m=0;m<s.neighbors.length&&r.length<a;m++){let g=s.neighbors[m],l=1-s.distances[m];if(t.minSimilarity&&l<t.minSimilarity)continue;let d=this.patternIdMap.get(g);if(!d)continue;let u=this.sqliteStore.getPattern(d);u&&(t.domain&&u.qeDomain!==t.domain||r.push({pattern:u,similarity:l}))}let c=performance.now()-i;return c>10&&o.warn("Slow search",{searchTimeMs:Number(c.toFixed(1))}),p(r)}catch(n){return h(f(n))}}async routeTask(e){let t=performance.now();this.stats.routingRequests++;try{let i=e.domain?[e.domain]:N(e.task);i.length===0&&i.push("test-generation");let n=await this.searchQEPatterns(e.task,{limit:10,domain:i[0]}),a=n.success?n.value.map(l=>l.pattern):[],s=[];for(let[l,d]of Object.entries(this.agentCapabilities)){let u=0,b=[],Q=i.filter(y=>d.domains.includes(y)).length,S=Q>0?Q/i.length*.4:0;if(u+=S*this.qeConfig.routingWeights.similarity,S>0&&b.push(`Domain: ${(S*100).toFixed(0)}%`),e.capabilities&&e.capabilities.length>0){let y=e.capabilities.filter(J=>d.capabilities.some(K=>K.toLowerCase().includes(J.toLowerCase()))).length,E=y>0?y/e.capabilities.length*.3:0;u+=E*this.qeConfig.routingWeights.capabilities,E>0&&b.push(`Caps: ${(E*100).toFixed(0)}%`)}else u+=.15*this.qeConfig.routingWeights.capabilities;u+=d.performanceScore*.3*this.qeConfig.routingWeights.performance,b.push(`Perf: ${(d.performanceScore*100).toFixed(0)}%`),s.push({agent:l,score:u,reasoning:b})}s.sort((l,d)=>d.score-l.score);let r=s[0],c=s.slice(1,4),m=[];if(this.qeConfig.enableGuidance&&i.length>0){let l=_(i[0],{framework:e.context?.framework,language:e.context?.language,includeAntiPatterns:!0});m.push(...l.slice(0,5))}let g=performance.now()-t;this.stats.totalRoutingLatency+=g,this.routingLatencies.push(g);let x={recommendedAgent:r.agent,confidence:r.score,alternatives:c.map(l=>({agent:l.agent,score:l.score})),domains:i,patterns:a,guidance:m,reasoning:r.reasoning.join("; "),latencyMs:g};return p(B(e.includePatternGuidance,x,n.success?n.value:[]))}catch(i){return h(f(i))}}async recordOutcome(e){if(!this.qeConfig.enableLearning)return p(void 0);try{this.sqliteStore.recordUsage(e.patternId,e.success,e.metrics,e.feedback),this.stats.learningOutcomes++,e.success&&this.stats.successfulOutcomes++;let t=this.sqliteStore.getPattern(e.patternId);if(t){let i=t.qeDomain,n=this.asymmetricEngine.computeConfidenceUpdate(t.confidence,e.success?"success":"failure",i);this.asymmetricEngine.shouldQuarantine(n,i).shouldQuarantine&&o.info("Pattern quarantined (asymmetric drop)",{name:t.name}),this.sqliteStore.updatePattern(e.patternId,{confidence:n}),await this.checkPatternPromotionWithCoherence(t)&&(this.sqliteStore.promotePattern(e.patternId),o.info("Pattern promoted to long-term",{name:t.name}))}return p(void 0)}catch(t){return h(f(t))}}async checkPatternPromotionWithCoherence(e){let t=O(e);if(!t.meetsUsageCriteria||!t.meetsQualityCriteria)return!1;if(this.coherenceService&&this.coherenceService.isInitialized()){let a=[...await this.getLongTermPatterns(),e].map(r=>({id:r.id,embedding:r.embedding||[],weight:r.confidence,metadata:{name:r.name,domain:r.qeDomain}})),s=await this.coherenceService.checkCoherence(a);if(s.energy>=(this.qeConfig.coherenceThreshold||.4))return o.info("Pattern promotion blocked due to coherence violation",{name:e.name,energy:s.energy}),s.contradictions&&s.contradictions.length>0&&o.info("Conflicts with existing patterns",{conflictingNodeIds:s.contradictions.map(r=>r.nodeIds).flat()}),!1}return!0}async getLongTermPatterns(){return this.sqliteStore.getPatterns({limit:1e3}).filter(t=>t.tier==="long-term")}shouldPromote(e){return e.tier==="short-term"&&e.successfulUses>=3&&e.successRate>=.7&&e.confidence>=.6}getQEGuidance(e){return H(e)}generateQEContext(e,t){return j(e,t||{})}checkQEAntiPatterns(e,t){return U(e,t)}async getQEStats(){let e=this.sqliteStore.getStats(),t=this.routingLatencies.percentile(95)||0,i={};for(let n of z)i[n]=e.byDomain[n]||0;return{totalPatterns:e.totalPatterns,byDomain:i,byTier:e.byTier,routingRequests:this.stats.routingRequests,avgRoutingLatencyMs:this.stats.routingRequests>0?this.stats.totalRoutingLatency/this.stats.routingRequests:0,p95RoutingLatencyMs:t,learningOutcomes:this.stats.learningOutcomes,patternSuccessRate:this.stats.learningOutcomes>0?this.stats.successfulOutcomes/this.stats.learningOutcomes:0,embeddingCacheSize:0,transformerAvailable:A(),embeddingDimension:P(),sqliteDbPath:this.qeConfig.sqlite.dbPath||".agentic-qe/memory.db",asymmetricLearning:{failurePenaltyRatio:"10:1",quarantinedPatterns:this.sqliteStore.getPatterns({limit:1e4}).filter(n=>n.quarantined===!0).length,rehabilitatedPatterns:this.sqliteStore.getPatterns({limit:1e4}).filter(n=>n.quarantined===!1&&n.quarantinedAt).length,avgConfidenceDelta:this.stats.learningOutcomes>0?this.stats.successfulOutcomes/this.stats.learningOutcomes-.5:0}}}async storeLoopPattern(e){try{let t=await this.storeQEPattern({patternType:"anti-pattern",name:`loop-detection:${e.toolCallSignature}`,description:`Tool call loop detected for agent ${e.agentId} during ${e.taskType}. Steering: ${e.steeringUsed}. Resolved: ${e.resolved}`,template:{type:"prompt",content:e.steeringUsed,variables:[]},context:{tags:["anti-pattern","loop-detection","learning-optimization",e.taskType]}});return t.success?{success:!0,patternId:t.value.id}:{success:!1,error:t.error?.message??"Unknown error"}}catch(t){return{success:!1,error:I(t)}}}async recordPatternOutcome(e,t,i){let n=this.sqliteStore.getPattern(e);if(!n)return;let a=n.usageCount+1,s=t?n.successfulUses+1:n.successfulUses,r=s/a,c=.3,m=(1-c)*n.qualityScore+c*i,g=Math.min(1,.5+a*.05+r*.3);this.sqliteStore.updatePattern(e,{usageCount:a,successfulUses:s,successRate:r,qualityScore:m,confidence:g})}async checkPatternPromotion(e,t,i,n){let a=this.sqliteStore.getPattern(e);return a?a.tier==="short-term"?t>=3&&i>=.6&&n>=.5:a.tier==="long-term"?t>=10&&i>=.75&&n>=.7:!1:!1}async promotePattern(e){this.sqliteStore.promotePattern(e)}async demotePattern(e){let t=this.sqliteStore.getPattern(e);if(!t)return;let i=["short-term","working","long-term"],n=i.indexOf(t.tier);if(n>0){let a=i[n-1];this.sqliteStore.updatePattern(e,{tier:a}),o.info("Pattern demoted",{name:t.name,newTier:a})}}cleanupPatternIdMap(){if(!this.initialized)return 0;let e=0,t=this.sqliteStore.getPatterns({limit:1e5}),i=new Set(t.map(n=>n.id));for(let[n,a]of Array.from(this.patternIdMap.entries()))i.has(a)||(this.patternIdMap.delete(n),e++);return e>0&&o.info("Cleaned stale patternIdMap entries",{count:e}),e}removePatternFromHNSW(e){for(let[t,i]of Array.from(this.patternIdMap.entries()))if(i===e)return this.patternIdMap.delete(t),o.info("Removed pattern from HNSW mapping",{patternId:e}),!0;return!1}getMemoryStats(){return{patternIdMapSize:this.patternIdMap.size,routingLatenciesSize:this.routingLatencies.length,hnswIndexCount:this.hnswIndex?.getCurrentCount()??0}}async storeTrajectory(e){return this.sqliteStore.getDb().prepare(`
16
+ INSERT OR REPLACE INTO qe_trajectories (
17
+ id, task, agent, domain, started_at, ended_at, success, steps_json, metadata_json
18
+ ) VALUES (?, ?, ?, ?, datetime('now'), datetime('now'), ?, ?, ?)
19
+ `).run(e.id,e.task,e.agent??null,e.domain??null,e.success?1:0,JSON.stringify(e.steps),JSON.stringify(e.metrics??{})),e.id}async getTrajectories(e,t=50){let i=this.sqliteStore.getDb(),n="SELECT * FROM qe_trajectories",a=[];return e&&(n+=" WHERE domain = ?",a.push(e)),n+=" ORDER BY ended_at DESC LIMIT ?",a.push(t),i.prepare(n).all(...a).map(r=>({id:r.id,task:r.task,agent:r.agent??void 0,domain:r.domain,success:r.success===1,steps:w(r.steps_json||"[]"),metrics:r.metadata_json?w(r.metadata_json):void 0}))}async linkPatternToTrajectory(e,t){let i=this.sqliteStore.getDb(),n=this.sqliteStore.getPattern(e);if(n){let a={...n.context,sourceTrajectoryId:t};i.prepare(`
20
+ UPDATE qe_patterns SET context_json = ?, updated_at = datetime('now') WHERE id = ?
21
+ `).run(JSON.stringify(a),e)}}async getEnhancedAdapter(){return{message:"Use EnhancedReasoningBankAdapter for full agentic-flow integration",importPath:"../integrations/agentic-flow/reasoning-bank/index.js"}}async dispose(){this.sqliteStore.close(),M(),this.hnswIndex=null,this.patternIdMap.clear(),this.routingLatencies.clear(),this.stats.routingRequests=0,this.stats.totalRoutingLatency=0,this.stats.learningOutcomes=0,this.stats.successfulOutcomes=0,this.initialized=!1,o.info("Disposed")}async destroy(){return this.dispose()}};function Ee(k={},e){return new R(k,e)}export{Ee 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.9");process.exit(0)}
2
- import{b as m,c as y}from"./chunk-N46VHXWO.js";import{e as S,f as A}from"./chunk-STFUARVH.js";import{a as R,b as g,c as v}from"./chunk-C6HU5SIU.js";import{a as p,g as b}from"./chunk-HZLDCCUG.js";y();var s=null,f=!1;function w(t){s=t,f=t!==null}var E=(()=>{let t=process.env.AQE_RVF_SIZE_GUARD_BYTES,r=t?Number(t):NaN;return Number.isFinite(r)&&r>0?r:256*1024*1024})(),C=(()=>{let t=process.env.AQE_RVF_DEAD_RATIO_THRESHOLD,r=t?Number(t):NaN;return Number.isFinite(r)&&r>0&&r<=1?r:.3})();function _(t=".agentic-qe",r=384){if(f)return s;f=!0;try{let{isRvfNativeAvailable:e,createRvfStore:o,openRvfStore:i}=(A(),b(S));if(!e())return console.warn("[RVF] Native bindings unavailable \u2014 agent branching and dream COW disabled. Install @ruvector/rvf-node to enable."),null;let l=p("path"),c=l.isAbsolute(t)?t:l.join(process.env.AQE_PROJECT_ROOT??m(),t),u=l.join(c,"patterns.rvf");return s=$(i,o,u,r),N(s,u),s}catch(e){return console.warn("[RVF] Shared adapter init failed:",e instanceof Error?e.message:e),null}}function $(t,r,e,o){let i=()=>{try{return{adapter:t(e),err:null}}catch(n){return{adapter:null,err:n}}},l=n=>{let a=n instanceof Error?n.message:String(n);return a.includes("LockHeld")||a.includes("0x0300")},{adapter:c,err:u}=i();if(!c&&l(u))try{let n=p("fs"),a=`${e}.lock`;n.existsSync(a)&&g(e)?console.warn(`[RVF] ${e} is locked by a live process (pid ${R(e)}) \u2014 not breaking the lock; degrading to SQLite for this run.`):n.existsSync(a)&&(n.unlinkSync(a),console.warn(`[RVF] Removed stale lock file at ${a} (prior process exited without closing). Retrying open. If you see this repeatedly under live concurrency, file an issue.`),{adapter:c,err:u}=i())}catch(n){process.env.DEBUG&&console.debug("[RVF] stale-lock recovery failed:",n instanceof Error?n.message:n)}if(c){let n=c.dimension();if(n===o)return c;console.warn(`[RVF] patterns.rvf dimension mismatch: file=${n} requested=${o} \u2014 closing and degrading. Delete the .rvf file to recreate at the requested dim.`);try{c.close()}catch{}throw new Error(`RVF dimension mismatch (file=${n}, requested=${o})`)}try{return r(e,o)}catch(n){try{let a=t(e);if(a.dimension()!==o){try{a.close()}catch{}throw new Error(`RVF dimension mismatch after race (file=${a.dimension()}, requested=${o})`)}return a}catch{if(v(e,n instanceof Error?n.message:String(n)))return r(e,o);throw n instanceof Error?n:new Error(String(n))}}}function h(t,r){if(r?.force)return{shouldCompact:!0,trigger:"force"};let e=r?.sizeGuardBytes??E,o=r?.deadRatioThreshold??C;return t.fileSizeBytes>=e?{shouldCompact:!0,trigger:"size-guard"}:(t.deadSpaceRatio??0)>=o?{shouldCompact:!0,trigger:"dead-ratio"}:{shouldCompact:!1,trigger:"none"}}function k(t){if(!s)return null;let r;try{r=s.status()}catch{return null}let e=h(r,t);if(!e.shouldCompact)return null;let o=r.fileSizeBytes,i;try{i=s.compact()}catch{return null}return i?((i.bytesReclaimed>0||i.segmentsCompacted>0)&&console.log(`[RVF] compacted patterns.rvf: reclaimed ${d(i.bytesReclaimed)} (${i.segmentsCompacted} segments, fileSize ${d(o)} \u2192 ${d(Math.max(0,o-i.bytesReclaimed))}, trigger: ${e.trigger})`),i):null}function N(t,r){try{let e=t.status(),o=h(e);if(!o.shouldCompact)return null;let i=t.compact();return i&&(i.bytesReclaimed>0||i.segmentsCompacted>0)&&console.log(`[RVF] boot-time compact (${r}): reclaimed ${d(i.bytesReclaimed)} from ${i.segmentsCompacted} segments (trigger: ${o.trigger})`),i}catch(e){return process.env.DEBUG&&console.debug("[RVF] boot-time compact guard skipped:",e instanceof Error?e.message:e),null}}function d(t){if(!Number.isFinite(t)||t<0)return`${t}B`;let r=["B","KB","MB","GB","TB"],e=0,o=t;for(;o>=1024&&e<r.length-1;)o/=1024,e++;return`${o.toFixed(e===0?0:1)}${r[e]}`}function T(){if(s){try{s.close()}catch{}s=null}f=!1}export{w as a,_ as b,h as c,k as d,N as e,T 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.11");process.exit(0)}
2
+ import{b as m,c as y}from"./chunk-LREIHR2A.js";import{e as S,f as A}from"./chunk-2D7SBOZ4.js";import{a as R,b as g,c as v}from"./chunk-FXKOHZBN.js";import{a as p,g as b}from"./chunk-LUAXQB57.js";y();var s=null,f=!1;function w(t){s=t,f=t!==null}var E=(()=>{let t=process.env.AQE_RVF_SIZE_GUARD_BYTES,r=t?Number(t):NaN;return Number.isFinite(r)&&r>0?r:256*1024*1024})(),C=(()=>{let t=process.env.AQE_RVF_DEAD_RATIO_THRESHOLD,r=t?Number(t):NaN;return Number.isFinite(r)&&r>0&&r<=1?r:.3})();function _(t=".agentic-qe",r=384){if(f)return s;f=!0;try{let{isRvfNativeAvailable:e,createRvfStore:o,openRvfStore:i}=(A(),b(S));if(!e())return console.warn("[RVF] Native bindings unavailable \u2014 agent branching and dream COW disabled. Install @ruvector/rvf-node to enable."),null;let l=p("path"),c=l.isAbsolute(t)?t:l.join(process.env.AQE_PROJECT_ROOT??m(),t),u=l.join(c,"patterns.rvf");return s=$(i,o,u,r),N(s,u),s}catch(e){return console.warn("[RVF] Shared adapter init failed:",e instanceof Error?e.message:e),null}}function $(t,r,e,o){let i=()=>{try{return{adapter:t(e),err:null}}catch(n){return{adapter:null,err:n}}},l=n=>{let a=n instanceof Error?n.message:String(n);return a.includes("LockHeld")||a.includes("0x0300")},{adapter:c,err:u}=i();if(!c&&l(u))try{let n=p("fs"),a=`${e}.lock`;n.existsSync(a)&&g(e)?console.warn(`[RVF] ${e} is locked by a live process (pid ${R(e)}) \u2014 not breaking the lock; degrading to SQLite for this run.`):n.existsSync(a)&&(n.unlinkSync(a),console.warn(`[RVF] Removed stale lock file at ${a} (prior process exited without closing). Retrying open. If you see this repeatedly under live concurrency, file an issue.`),{adapter:c,err:u}=i())}catch(n){process.env.DEBUG&&console.debug("[RVF] stale-lock recovery failed:",n instanceof Error?n.message:n)}if(c){let n=c.dimension();if(n===o)return c;console.warn(`[RVF] patterns.rvf dimension mismatch: file=${n} requested=${o} \u2014 closing and degrading. Delete the .rvf file to recreate at the requested dim.`);try{c.close()}catch{}throw new Error(`RVF dimension mismatch (file=${n}, requested=${o})`)}try{return r(e,o)}catch(n){try{let a=t(e);if(a.dimension()!==o){try{a.close()}catch{}throw new Error(`RVF dimension mismatch after race (file=${a.dimension()}, requested=${o})`)}return a}catch{if(v(e,n instanceof Error?n.message:String(n)))return r(e,o);throw n instanceof Error?n:new Error(String(n))}}}function h(t,r){if(r?.force)return{shouldCompact:!0,trigger:"force"};let e=r?.sizeGuardBytes??E,o=r?.deadRatioThreshold??C;return t.fileSizeBytes>=e?{shouldCompact:!0,trigger:"size-guard"}:(t.deadSpaceRatio??0)>=o?{shouldCompact:!0,trigger:"dead-ratio"}:{shouldCompact:!1,trigger:"none"}}function k(t){if(!s)return null;let r;try{r=s.status()}catch{return null}let e=h(r,t);if(!e.shouldCompact)return null;let o=r.fileSizeBytes,i;try{i=s.compact()}catch{return null}return i?((i.bytesReclaimed>0||i.segmentsCompacted>0)&&console.log(`[RVF] compacted patterns.rvf: reclaimed ${d(i.bytesReclaimed)} (${i.segmentsCompacted} segments, fileSize ${d(o)} \u2192 ${d(Math.max(0,o-i.bytesReclaimed))}, trigger: ${e.trigger})`),i):null}function N(t,r){try{let e=t.status(),o=h(e);if(!o.shouldCompact)return null;let i=t.compact();return i&&(i.bytesReclaimed>0||i.segmentsCompacted>0)&&console.log(`[RVF] boot-time compact (${r}): reclaimed ${d(i.bytesReclaimed)} from ${i.segmentsCompacted} segments (trigger: ${o.trigger})`),i}catch(e){return process.env.DEBUG&&console.debug("[RVF] boot-time compact guard skipped:",e instanceof Error?e.message:e),null}}function d(t){if(!Number.isFinite(t)||t<0)return`${t}B`;let r=["B","KB","MB","GB","TB"],e=0,o=t;for(;o>=1024&&e<r.length-1;)o/=1024,e++;return`${o.toFixed(e===0?0:1)}${r[e]}`}function T(){if(s){try{s.close()}catch{}s=null}f=!1}export{w as a,_ as b,h as c,k as d,N as e,T 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.9");process.exit(0)}
2
- import{a as ie,b as ae}from"./chunk-ZXXUIYCB.js";import{S as oe,i as D,p as $}from"./chunk-MTDKYFTA.js";import{c as g,e as ne,g as W}from"./chunk-HZLDCCUG.js";var I,E=g(()=>{"use strict";I={dimensions:384,M:16,efConstruction:200,efSearch:100,metric:"cosine"}});function se(){if(z)return A!==null;try{let i=(ae(),W(ie));if(A=i.differentiableSearch,P=i.init,P)try{P()}catch{}return z=!0,!0}catch{return z=!0,!1}}function j(i){let e=0;for(let r=0;r<i.length;r++)e+=i[r]*i[r];return Math.sqrt(e)}function ce(i,e,r,t){let n=r*t;if(n===0)return 0;let a=0,o=Math.min(i.length,e.length);for(let c=0;c<o;c++)a+=i[c]*e[c];return a/n}function q(i,e){let r=0,t=Math.min(i.length,e.length);for(let n=0;n<t;n++){let a=i[n]-e[n];r+=a*a}return Math.sqrt(r)}function le(i,e){if(i.length===e)return i;let r=new Float32Array(e);if(i.length>e){let t=i.length/e;for(let n=0;n<e;n++){let a=Math.floor(n*t),o=Math.floor((n+1)*t),c=0;for(let s=a;s<o;s++)c+=i[s];r[n]=c/(o-a)}}else for(let t=0;t<i.length;t++)r[t]=i[t];return r}var A,P,z,S,B=g(()=>{"use strict";E();A=null,P=null,z=!1;S=class{config;entries=[];idToIndex=new Map;hasRuvector=!1;loaded=!1;constructor(e){this.config={...I,...e}}ensureLoaded(){this.loaded||(this.hasRuvector=se(),this.loaded=!0)}normalizeVector(e){return e.length===this.config.dimensions?e:le(e,this.config.dimensions)}add(e,r,t){this.ensureLoaded();let n=this.normalizeVector(r),a=j(n);if(this.idToIndex.has(e)){let c=this.idToIndex.get(e);this.entries[c]={id:e,vector:n,norm:a,metadata:t};return}let o=this.entries.length;this.entries.push({id:e,vector:n,norm:a,metadata:t}),this.idToIndex.set(e,o)}search(e,r){if(this.ensureLoaded(),this.entries.length===0)return[];let t=this.normalizeVector(e),n=j(t),a=Math.min(r,this.entries.length),o=this.entries.length>0?this.entries[0].vector.length:0,c=t.length===o;if(this.config.metric==="cosine")return this.bruteForcSearch(t,n,a);if(this.hasRuvector&&c&&A)try{let s=this.entries.map(u=>u.vector),l=A(t,s,a,1).indices.map(u=>{let h=this.entries[u],m=-q(t,h.vector);return{id:h.id,score:m,metadata:h.metadata}});return l.sort((u,h)=>h.score-u.score),l}catch{}return this.bruteForcSearch(t,n,a)}bruteForcSearch(e,r,t){let n=[];for(let a of this.entries){let o;this.config.metric==="cosine"?o=ce(e,a.vector,r,a.norm):o=-q(e,a.vector),n.push({id:a.id,score:o,metadata:a.metadata})}return n.sort((a,o)=>o.score-a.score),n.slice(0,t)}remove(e){let r=this.idToIndex.get(e);if(r===void 0)return!1;let t=this.entries.length-1;if(r!==t){let n=this.entries[t];this.entries[r]=n,this.idToIndex.set(n.id,r)}return this.entries.pop(),this.idToIndex.delete(e),!0}size(){return this.entries.length}dimensions(){return this.config.dimensions}recall(){return this.hasRuvector,1}isRuvectorAvailable(){return this.ensureLoaded(),this.hasRuvector}getConfig(){return{...this.config}}clear(){this.entries=[],this.idToIndex.clear()}dispose(){this.clear()}}});import{createRequire as he}from"module";function de(){if(U){if(k)return k;throw new b(O??"Unknown load error")}U=!0;try{let i=ue("hnswlib-node");if(!i.HierarchicalNSW)throw new Error("hnswlib-node module missing HierarchicalNSW export");return k=i,k}catch(i){let e=i instanceof Error?i.message:String(i);throw O=e,new b(e)}}function me(i,e){if(i.length===e)return i;let r=new Float32Array(e);if(i.length>e){let t=i.length/e;for(let n=0;n<e;n++){let a=Math.floor(n*t),o=Math.floor((n+1)*t),c=0;for(let s=a;s<o;s++)c+=i[s];r[n]=c/(o-a)}}else for(let t=0;t<i.length;t++)r[t]=i[t];return r}function K(i){let e=new Array(i.length);for(let r=0;r<i.length;r++)e[r]=i[r];return e}var ue,b,k,U,O,J,w,Q=g(()=>{"use strict";E();ue=he(import.meta.url),b=class extends Error{constructor(e){super(`Native HNSW backend unavailable: ${e}`),this.name="NativeHnswUnavailableError"}},k=null,U=!1,O=null;J=1e4,w=class{config;nativeIndex=null;currentMaxElements=J;liveIds=new Set;metadataStore=new Map;_metrics={totalSearches:0,totalAdds:0,totalRemoves:0,avgSearchLatencyMs:0,maxSearchLatencyMs:0,lastSearchLatencyMs:0,fallbackSearchCount:0,bruteForceSearchCount:0,nativeSearchCount:0,fallbackRate:0,allSearchesBruteForce:!1};constructor(e){this.config={...I,...e},this.nativeIndex=this.createFreshIndex()}createFreshIndex(){let e=de(),r=this.config.metric==="euclidean"?"l2":"cosine";try{let t=new e.HierarchicalNSW(r,this.config.dimensions);return t.initIndex(this.currentMaxElements,this.config.M,this.config.efConstruction,100,!0),t.setEf(this.config.efSearch),t}catch(t){let n=t instanceof Error?t.message:String(t);throw new b(`HierarchicalNSW init failed: ${n}`)}}add(e,r,t){if(!this.nativeIndex)throw new Error("NativeHnswBackend has been disposed");let n=this.normalizeVector(r);if(!this.liveIds.has(e)&&this.liveIds.size>=this.currentMaxElements){let a=this.currentMaxElements*2;this.nativeIndex.resizeIndex(a),this.currentMaxElements=a}this.nativeIndex.addPoint(K(n),e,!0),this.liveIds.add(e),t?this.metadataStore.set(e,t):this.metadataStore.delete(e),this._metrics.totalAdds++}search(e,r){if(!this.nativeIndex)throw new Error("NativeHnswBackend has been disposed");if(this.liveIds.size===0||r<=0)return[];let t=performance.now(),n=this.normalizeVector(e),a=Math.min(r,this.liveIds.size),o=Math.min(this.liveIds.size,Math.max(a,this.config.efSearch)*2),c=this.nativeIndex.searchKnn(K(n),o),s=this.config.metric==="cosine",d=new Map;for(let h=0;h<c.neighbors.length;h++){let m=c.neighbors[h];if(!this.liveIds.has(m))continue;let x=c.distances[h],f=s?1-x:-x,G=d.get(m);(G===void 0||f>G.score)&&d.set(m,{id:m,score:f,metadata:this.metadataStore.get(m)})}let l=Array.from(d.values());l.sort((h,m)=>m.score-h.score),l.length>a&&(l.length=a);let u=performance.now()-t;return this.updateSearchMetrics(u),this._metrics.nativeSearchCount=this._metrics.totalSearches,u>50&&console.warn(`[NativeHNSW] search took ${u.toFixed(1)}ms (k=${r}, results=${l.length})`),l}remove(e){if(!this.nativeIndex||!this.liveIds.has(e))return!1;try{this.nativeIndex.markDelete(e)}catch{return!1}return this.liveIds.delete(e),this.metadataStore.delete(e),this._metrics.totalRemoves++,!0}size(){return this.liveIds.size}dimensions(){return this.config.dimensions}recall(){return .99}getMetrics(){return{...this._metrics}}get lastSearchLatencyMs(){return this._metrics.lastSearchLatencyMs}getConfig(){return{...this.config}}clear(){this.nativeIndex&&(this.liveIds.clear(),this.metadataStore.clear(),this.currentMaxElements=J,this.nativeIndex=this.createFreshIndex())}dispose(){this.liveIds.clear(),this.metadataStore.clear(),this.nativeIndex=null}isNativeAvailable(){return this.nativeIndex!==null}normalizeVector(e){return e.length===this.config.dimensions?e:me(e,this.config.dimensions)}updateSearchMetrics(e){this._metrics.totalSearches++,this._metrics.lastSearchLatencyMs=e,e>this._metrics.maxSearchLatencyMs&&(this._metrics.maxSearchLatencyMs=e);let r=this._metrics.totalSearches;this._metrics.avgSearchLatencyMs=this._metrics.avgSearchLatencyMs*((r-1)/r)+e/r}}});function X(i,e){let r=Array.from({length:e},()=>new Float64Array(e));for(let t=0;t<e;t++){let n=i[t].length;r[t][t]=n;for(let a of i[t])r[t][a]=-1}return r}function N(i,e){let r=e.length,t=new Float64Array(r);for(let n=0;n<r;n++){let a=i[n].length;t[n]=a*e[n];for(let o of i[n])t[n]-=e[o]}return t}function H(i){let e=0;for(let r=0;r<i.length;r++)e+=i[r]*i[r];return Math.sqrt(e)}function R(i){let e=H(i);if(e>0)for(let r=0;r<i.length;r++)i[r]/=e}function v(i,e){let r=0;for(let t=0;t<i.length;t++)r+=i[t]*e[t];for(let t=0;t<i.length;t++)i[t]-=r*e[t]}function y(i,e,r=100,t=1e-6){if(e<=1)return 0;if(e===2)return i[0].includes(1)?2:0;let n=new Float64Array(e).fill(1/Math.sqrt(e)),a=new Float64Array(e);for(let l=0;l<e;l++)a[l]=Math.random()-.5;v(a,n),R(a);let o=0;for(let l=0;l<30;l++){let u=N(i,a);if(v(u,n),o=H(u),o>0)for(let h=0;h<e;h++)a[h]=u[h]/o}if(o<t)return 0;let c=new Float64Array(e);for(let l=0;l<e;l++)c[l]=Math.random()-.5;v(c,n),R(c);let s=0;for(let l=0;l<r;l++){let u=N(i,c),h=new Float64Array(e);for(let f=0;f<e;f++)h[f]=o*c[f]-u[f];v(h,n);let m=H(h);if(m<t)break;let x=m;for(let f=0;f<e;f++)c[f]=h[f]/m;if(Math.abs(x-s)<t)break;s=x}let d=o-s;return Math.max(0,d)}function F(i,e,r=100,t=1e-6){return y(i,e,r,t)}function C(i,e,r=50,t){if(e<=1)return 0;let n=t??y(i,e);if(n<1e-10)return 1/0;let o=2*Math.max(...i.map(d=>d.length),1),s=2*(Math.log(o/n)/(o-n));return Math.max(0,s)}function M(i,e,r){let t=1-Math.exp(-i/.05),n=1-Math.exp(-e/.5),a=r===1/0?0:1/(1+r/5),o=.4*t+.3*n+.3*a;return Math.max(0,Math.min(1,o))}var _=g(()=>{"use strict"});var ee={};ne(ee,{ALERT_THRESHOLDS:()=>fe,DEFAULT_HNSW_HEALTH_CONFIG:()=>Y,HnswHealthMonitor:()=>L,_resetNativeLoader:()=>be,approximateFiedlerValue:()=>y,approximateSpectralGap:()=>F,buildAdjacencyFromIndex:()=>Z,buildLaplacian:()=>X,computeCoherenceScore:()=>M,createHnswHealthMonitor:()=>ge,deflateVector:()=>v,estimateEffectiveResistance:()=>C,laplacianMultiply:()=>N,normalizeInPlace:()=>R,vectorNorm:()=>H});function pe(){return V?T:(V=!0,T=null,null)}function be(){T=null,V=!1}function Z(i,e=16,r){let t=i.size();if(t===0)return{adjacency:[],nodeCount:0,adjacencySource:"approximate"};let n=Array.from({length:t},()=>[]),a=Math.min(e,t-1);if(a===0)return{adjacency:n,nodeCount:t,adjacencySource:"approximate"};if(r&&r.size>0){let o=Array.from(r.keys()).slice(0,t),c=new Map;for(let s=0;s<o.length;s++)c.set(o[s],s);for(let s=0;s<o.length;s++){let d=r.get(o[s]);if(!d)continue;let l=i.search(d,a+1);for(let u of l){if(u.id===o[s])continue;let h=c.get(u.id);h!==void 0&&(n[s].includes(h)||n[s].push(h),n[h].includes(s)||n[h].push(s))}}return{adjacency:n,nodeCount:t,adjacencySource:"actual-search"}}console.warn("[HnswHealthMonitor] No stored vectors provided \u2014 using approximate circular adjacency. Pass stored vectors for accurate health metrics.");for(let o=0;o<t;o++)for(let c=0;c<a;c++){let s=(o+c+1)%t;n[o].includes(s)||n[o].push(s),n[s].includes(o)||n[s].push(o)}return{adjacency:n,nodeCount:t,adjacencySource:"approximate"}}function ge(i){return new L(i)}var Y,fe,T,V,L,te=g(()=>{"use strict";_();_();Y={fiedlerThreshold:.01,spectralGapThreshold:.1,resistanceThreshold:10,coherenceThreshold:.3,maxPowerIterations:100,convergenceTolerance:1e-6,resistanceSampleSize:50,maxHistoryEntries:200,minIndexSize:3},fe={FragileIndex:.01,PoorExpansion:.1,HighResistance:10,LowCoherence:.3},T=null,V=!1;L=class{config;alerts=[];history=[];lastReport=null;useNative=!1;nativeChecked=!1;constructor(e){this.config={...Y,...e}}checkHealth(e){let r=performance.now(),t=e.size();if(t<this.config.minIndexSize)return this.createSmallIndexReport(t,performance.now()-r);this.nativeChecked||(this.nativeChecked=!0,this.useNative=pe()!==null);let{adjacency:n,nodeCount:a,adjacencySource:o}=Z(e),c=this.useNative?this.computeNativeMetrics(n):this.computeApproximateMetrics(n,a),s=this.generateAlerts(c);this.alerts.length=0,this.alerts.push(...s);let d=performance.now()-r,l={healthy:s.length===0,metrics:c,alerts:s,indexSize:t,usedNativeBackend:this.useNative,adjacencySource:o,checkDurationMs:d,checkedAt:new Date};return this.addHistoryPoint({coherenceScore:c.coherenceScore,fiedlerValue:c.fiedlerValue,indexSize:t,healthy:l.healthy,timestamp:l.checkedAt}),this.lastReport=l,l}getAlerts(){return[...this.alerts]}getMetricsHistory(e){let r=[...this.history];return e!==void 0&&e<r.length?r.slice(-e):r}isHealthy(){return this.lastReport===null?!0:this.lastReport.healthy}getLastReport(){return this.lastReport}clearHistory(){this.history.length=0,this.alerts.length=0,this.lastReport=null}computeNativeMetrics(e){let r=T,t=r.computeFiedlerValue(e),n=r.computeSpectralGap(e),a=r.computeEffectiveResistance(e),o=M(t,n,a);return{fiedlerValue:t,spectralGap:n,effectiveResistance:a,coherenceScore:o}}computeApproximateMetrics(e,r){let t=y(e,r,this.config.maxPowerIterations,this.config.convergenceTolerance),n=F(e,r,this.config.maxPowerIterations,this.config.convergenceTolerance),a=C(e,r,this.config.resistanceSampleSize,t),o=M(t,n,a);return{fiedlerValue:t,spectralGap:n,effectiveResistance:a,coherenceScore:o}}generateAlerts(e){let r=[],t=new Date;return e.fiedlerValue<this.config.fiedlerThreshold&&r.push({type:"FragileIndex",message:`Fiedler value ${e.fiedlerValue.toFixed(6)} is below threshold ${this.config.fiedlerThreshold}. The index graph has weak algebraic connectivity.`,value:e.fiedlerValue,threshold:this.config.fiedlerThreshold,timestamp:t}),e.spectralGap<this.config.spectralGapThreshold&&r.push({type:"PoorExpansion",message:`Spectral gap ${e.spectralGap.toFixed(6)} is below threshold ${this.config.spectralGapThreshold}. The index graph has poor expansion properties.`,value:e.spectralGap,threshold:this.config.spectralGapThreshold,timestamp:t}),e.effectiveResistance>this.config.resistanceThreshold&&r.push({type:"HighResistance",message:`Average effective resistance ${e.effectiveResistance.toFixed(4)} exceeds threshold ${this.config.resistanceThreshold}. Nodes are poorly connected.`,value:e.effectiveResistance,threshold:this.config.resistanceThreshold,timestamp:t}),e.coherenceScore<this.config.coherenceThreshold&&r.push({type:"LowCoherence",message:`Coherence score ${e.coherenceScore.toFixed(4)} is below threshold ${this.config.coherenceThreshold}. Overall index health is degraded.`,value:e.coherenceScore,threshold:this.config.coherenceThreshold,timestamp:t}),r}createSmallIndexReport(e,r){let t={fiedlerValue:e>0?1:0,spectralGap:e>0?1:0,effectiveResistance:e>0?.5:0,coherenceScore:e>0?1:0},n={healthy:!0,metrics:t,alerts:[],indexSize:e,usedNativeBackend:!1,adjacencySource:"approximate",checkDurationMs:r,checkedAt:new Date};return this.addHistoryPoint({coherenceScore:t.coherenceScore,fiedlerValue:t.fiedlerValue,indexSize:e,healthy:!0,timestamp:n.checkedAt}),this.lastReport=n,n}addHistoryPoint(e){this.history.push(e),this.history.length>this.config.maxHistoryEntries&&this.history.splice(0,this.history.length-this.config.maxHistoryEntries)}}});var ve,p,re,ye=g(()=>{B();Q();oe();ve={patterns:{dimensions:384,M:16,efConstruction:200,efSearch:100,metric:"cosine"},"qe-memory":{dimensions:384,M:16,efConstruction:200,efSearch:100,metric:"cosine"},learning:{dimensions:384,M:16,efConstruction:200,efSearch:50,metric:"cosine"},coverage:{dimensions:384,M:16,efConstruction:200,efSearch:100,metric:"cosine"}},p=new Map,re=class i{backend;_isNativeBackend;indexName;stringToNumericId=new Map;numericToStringId=new Map;nextAutoId=0;healthMonitor=null;healthMonitorLoaded=!1;operationsSinceLastCheck=0;healthCheckFrequency=100;lastHealthReport=null;constructor(e,r){this.indexName=e;let n={...ve[e]??{},...r},{backend:a,isNative:o}=i.createBackend(n);this.backend=a,this._isNativeBackend=o}add(e,r,t){this.backend.add(e,r,t),this.maybeRunHealthCheck()}search(e,r){let t=performance.now(),n=this.backend.search(e,r),a=performance.now()-t;return a>50&&console.warn(`[HNSW] search took ${a.toFixed(1)}ms (k=${r}, results=${n.length})`),this._lastSearchLatencyMs=a,n}_lastSearchLatencyMs=0;get lastSearchLatencyMs(){return this._lastSearchLatencyMs}remove(e){return this.backend.remove(e)}size(){return this.backend.size()}dimensions(){return this.backend.dimensions()}recall(){return this.backend.recall()}addByStringId(e,r){let t=this.stringToNumericId.get(e);t!==void 0?this.backend.remove(t):(t=this.nextAutoId++,this.stringToNumericId.set(e,t),this.numericToStringId.set(t,e)),this.backend.add(t,new Float32Array(r))}searchByArray(e,r){return this.backend.search(new Float32Array(e),r).map(n=>({id:this.numericToStringId.get(n.id)??String(n.id),score:n.score}))}removeByStringId(e){let r=this.stringToNumericId.get(e);if(r===void 0)return!1;let t=this.backend.remove(r);return t&&(this.stringToNumericId.delete(e),this.numericToStringId.delete(r)),t}clear(){this.backend.clear?.(),this.stringToNumericId.clear(),this.numericToStringId.clear(),this.nextAutoId=0}dispose(){try{this.backend.dispose?.()}catch{}this.stringToNumericId.clear(),this.numericToStringId.clear(),this.nextAutoId=0}isRuvectorAvailable(){return this.backend instanceof S?this.backend.isRuvectorAvailable():this.backend instanceof w?this.backend.isNativeAvailable():!1}isNativeBackend(){return this._isNativeBackend}getName(){return this.indexName}setHealthCheckFrequency(e){this.healthCheckFrequency=Math.max(1,e)}getHealthCheckFrequency(){return this.healthCheckFrequency}getLastHealthReport(){return this.lastHealthReport}getHealthMonitor(){return this.healthMonitor}maybeRunHealthCheck(){if($()&&(this.operationsSinceLastCheck++,!(this.operationsSinceLastCheck<this.healthCheckFrequency)&&(this.operationsSinceLastCheck=0,this.ensureHealthMonitor(),this.healthMonitor)))try{this.lastHealthReport=this.healthMonitor.checkHealth(this.backend),this.lastHealthReport.healthy||console.warn(`[HNSW-Health] Index "${this.indexName}" health check failed: ${this.lastHealthReport.alerts.length} alert(s). Coherence: ${this.lastHealthReport.metrics.coherenceScore.toFixed(3)}`)}catch(e){console.warn(`[HNSW-Health] Health check error for "${this.indexName}":`,e)}}ensureHealthMonitor(){if(!this.healthMonitorLoaded){this.healthMonitorLoaded=!0;try{let e=(te(),W(ee));this.healthMonitor=e.createHnswHealthMonitor()}catch(e){process.env.DEBUG&&console.debug("[HNSW-Health] Monitor module unavailable:",e instanceof Error?e.message:e),this.healthMonitor=null}}}static createBackend(e){if(D())try{return{backend:new w(e),isNative:!0}}catch(r){r instanceof b?console.info(`[HNSW] Native backend unavailable, falling back to JS: ${r.message}`):console.warn("[HNSW] Unexpected error creating native backend, falling back to JS:",r)}return{backend:new S(e),isNative:!1}}static create(e,r){let t=p.get(e);if(t instanceof i)return t;let n=new i(e,r);return p.set(e,n),n}static get(e){let r=p.get(e);return r instanceof i?r:void 0}static close(e){let r=p.get(e);r instanceof i&&r.dispose(),p.delete(e)}static closeAll(){for(let[e]of p)i.close(e);p.clear()}static listIndexes(){return Array.from(p.keys())}}});export{re as a,ye 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.11");process.exit(0)}
2
+ import{a as ie,b as ae}from"./chunk-PT6U3IIK.js";import{S as oe,i as D,p as $}from"./chunk-NHL37QAZ.js";import{c as g,e as ne,g as W}from"./chunk-LUAXQB57.js";var I,E=g(()=>{"use strict";I={dimensions:384,M:16,efConstruction:200,efSearch:100,metric:"cosine"}});function se(){if(z)return A!==null;try{let i=(ae(),W(ie));if(A=i.differentiableSearch,P=i.init,P)try{P()}catch{}return z=!0,!0}catch{return z=!0,!1}}function j(i){let e=0;for(let r=0;r<i.length;r++)e+=i[r]*i[r];return Math.sqrt(e)}function ce(i,e,r,t){let n=r*t;if(n===0)return 0;let a=0,o=Math.min(i.length,e.length);for(let c=0;c<o;c++)a+=i[c]*e[c];return a/n}function q(i,e){let r=0,t=Math.min(i.length,e.length);for(let n=0;n<t;n++){let a=i[n]-e[n];r+=a*a}return Math.sqrt(r)}function le(i,e){if(i.length===e)return i;let r=new Float32Array(e);if(i.length>e){let t=i.length/e;for(let n=0;n<e;n++){let a=Math.floor(n*t),o=Math.floor((n+1)*t),c=0;for(let s=a;s<o;s++)c+=i[s];r[n]=c/(o-a)}}else for(let t=0;t<i.length;t++)r[t]=i[t];return r}var A,P,z,S,B=g(()=>{"use strict";E();A=null,P=null,z=!1;S=class{config;entries=[];idToIndex=new Map;hasRuvector=!1;loaded=!1;constructor(e){this.config={...I,...e}}ensureLoaded(){this.loaded||(this.hasRuvector=se(),this.loaded=!0)}normalizeVector(e){return e.length===this.config.dimensions?e:le(e,this.config.dimensions)}add(e,r,t){this.ensureLoaded();let n=this.normalizeVector(r),a=j(n);if(this.idToIndex.has(e)){let c=this.idToIndex.get(e);this.entries[c]={id:e,vector:n,norm:a,metadata:t};return}let o=this.entries.length;this.entries.push({id:e,vector:n,norm:a,metadata:t}),this.idToIndex.set(e,o)}search(e,r){if(this.ensureLoaded(),this.entries.length===0)return[];let t=this.normalizeVector(e),n=j(t),a=Math.min(r,this.entries.length),o=this.entries.length>0?this.entries[0].vector.length:0,c=t.length===o;if(this.config.metric==="cosine")return this.bruteForcSearch(t,n,a);if(this.hasRuvector&&c&&A)try{let s=this.entries.map(u=>u.vector),l=A(t,s,a,1).indices.map(u=>{let h=this.entries[u],m=-q(t,h.vector);return{id:h.id,score:m,metadata:h.metadata}});return l.sort((u,h)=>h.score-u.score),l}catch{}return this.bruteForcSearch(t,n,a)}bruteForcSearch(e,r,t){let n=[];for(let a of this.entries){let o;this.config.metric==="cosine"?o=ce(e,a.vector,r,a.norm):o=-q(e,a.vector),n.push({id:a.id,score:o,metadata:a.metadata})}return n.sort((a,o)=>o.score-a.score),n.slice(0,t)}remove(e){let r=this.idToIndex.get(e);if(r===void 0)return!1;let t=this.entries.length-1;if(r!==t){let n=this.entries[t];this.entries[r]=n,this.idToIndex.set(n.id,r)}return this.entries.pop(),this.idToIndex.delete(e),!0}size(){return this.entries.length}dimensions(){return this.config.dimensions}recall(){return this.hasRuvector,1}isRuvectorAvailable(){return this.ensureLoaded(),this.hasRuvector}getConfig(){return{...this.config}}clear(){this.entries=[],this.idToIndex.clear()}dispose(){this.clear()}}});import{createRequire as he}from"module";function de(){if(U){if(k)return k;throw new b(O??"Unknown load error")}U=!0;try{let i=ue("hnswlib-node");if(!i.HierarchicalNSW)throw new Error("hnswlib-node module missing HierarchicalNSW export");return k=i,k}catch(i){let e=i instanceof Error?i.message:String(i);throw O=e,new b(e)}}function me(i,e){if(i.length===e)return i;let r=new Float32Array(e);if(i.length>e){let t=i.length/e;for(let n=0;n<e;n++){let a=Math.floor(n*t),o=Math.floor((n+1)*t),c=0;for(let s=a;s<o;s++)c+=i[s];r[n]=c/(o-a)}}else for(let t=0;t<i.length;t++)r[t]=i[t];return r}function K(i){let e=new Array(i.length);for(let r=0;r<i.length;r++)e[r]=i[r];return e}var ue,b,k,U,O,J,w,Q=g(()=>{"use strict";E();ue=he(import.meta.url),b=class extends Error{constructor(e){super(`Native HNSW backend unavailable: ${e}`),this.name="NativeHnswUnavailableError"}},k=null,U=!1,O=null;J=1e4,w=class{config;nativeIndex=null;currentMaxElements=J;liveIds=new Set;metadataStore=new Map;_metrics={totalSearches:0,totalAdds:0,totalRemoves:0,avgSearchLatencyMs:0,maxSearchLatencyMs:0,lastSearchLatencyMs:0,fallbackSearchCount:0,bruteForceSearchCount:0,nativeSearchCount:0,fallbackRate:0,allSearchesBruteForce:!1};constructor(e){this.config={...I,...e},this.nativeIndex=this.createFreshIndex()}createFreshIndex(){let e=de(),r=this.config.metric==="euclidean"?"l2":"cosine";try{let t=new e.HierarchicalNSW(r,this.config.dimensions);return t.initIndex(this.currentMaxElements,this.config.M,this.config.efConstruction,100,!0),t.setEf(this.config.efSearch),t}catch(t){let n=t instanceof Error?t.message:String(t);throw new b(`HierarchicalNSW init failed: ${n}`)}}add(e,r,t){if(!this.nativeIndex)throw new Error("NativeHnswBackend has been disposed");let n=this.normalizeVector(r);if(!this.liveIds.has(e)&&this.liveIds.size>=this.currentMaxElements){let a=this.currentMaxElements*2;this.nativeIndex.resizeIndex(a),this.currentMaxElements=a}this.nativeIndex.addPoint(K(n),e,!0),this.liveIds.add(e),t?this.metadataStore.set(e,t):this.metadataStore.delete(e),this._metrics.totalAdds++}search(e,r){if(!this.nativeIndex)throw new Error("NativeHnswBackend has been disposed");if(this.liveIds.size===0||r<=0)return[];let t=performance.now(),n=this.normalizeVector(e),a=Math.min(r,this.liveIds.size),o=Math.min(this.liveIds.size,Math.max(a,this.config.efSearch)*2),c=this.nativeIndex.searchKnn(K(n),o),s=this.config.metric==="cosine",d=new Map;for(let h=0;h<c.neighbors.length;h++){let m=c.neighbors[h];if(!this.liveIds.has(m))continue;let x=c.distances[h],f=s?1-x:-x,G=d.get(m);(G===void 0||f>G.score)&&d.set(m,{id:m,score:f,metadata:this.metadataStore.get(m)})}let l=Array.from(d.values());l.sort((h,m)=>m.score-h.score),l.length>a&&(l.length=a);let u=performance.now()-t;return this.updateSearchMetrics(u),this._metrics.nativeSearchCount=this._metrics.totalSearches,u>50&&console.warn(`[NativeHNSW] search took ${u.toFixed(1)}ms (k=${r}, results=${l.length})`),l}remove(e){if(!this.nativeIndex||!this.liveIds.has(e))return!1;try{this.nativeIndex.markDelete(e)}catch{return!1}return this.liveIds.delete(e),this.metadataStore.delete(e),this._metrics.totalRemoves++,!0}size(){return this.liveIds.size}dimensions(){return this.config.dimensions}recall(){return .99}getMetrics(){return{...this._metrics}}get lastSearchLatencyMs(){return this._metrics.lastSearchLatencyMs}getConfig(){return{...this.config}}clear(){this.nativeIndex&&(this.liveIds.clear(),this.metadataStore.clear(),this.currentMaxElements=J,this.nativeIndex=this.createFreshIndex())}dispose(){this.liveIds.clear(),this.metadataStore.clear(),this.nativeIndex=null}isNativeAvailable(){return this.nativeIndex!==null}normalizeVector(e){return e.length===this.config.dimensions?e:me(e,this.config.dimensions)}updateSearchMetrics(e){this._metrics.totalSearches++,this._metrics.lastSearchLatencyMs=e,e>this._metrics.maxSearchLatencyMs&&(this._metrics.maxSearchLatencyMs=e);let r=this._metrics.totalSearches;this._metrics.avgSearchLatencyMs=this._metrics.avgSearchLatencyMs*((r-1)/r)+e/r}}});function X(i,e){let r=Array.from({length:e},()=>new Float64Array(e));for(let t=0;t<e;t++){let n=i[t].length;r[t][t]=n;for(let a of i[t])r[t][a]=-1}return r}function N(i,e){let r=e.length,t=new Float64Array(r);for(let n=0;n<r;n++){let a=i[n].length;t[n]=a*e[n];for(let o of i[n])t[n]-=e[o]}return t}function H(i){let e=0;for(let r=0;r<i.length;r++)e+=i[r]*i[r];return Math.sqrt(e)}function R(i){let e=H(i);if(e>0)for(let r=0;r<i.length;r++)i[r]/=e}function v(i,e){let r=0;for(let t=0;t<i.length;t++)r+=i[t]*e[t];for(let t=0;t<i.length;t++)i[t]-=r*e[t]}function y(i,e,r=100,t=1e-6){if(e<=1)return 0;if(e===2)return i[0].includes(1)?2:0;let n=new Float64Array(e).fill(1/Math.sqrt(e)),a=new Float64Array(e);for(let l=0;l<e;l++)a[l]=Math.random()-.5;v(a,n),R(a);let o=0;for(let l=0;l<30;l++){let u=N(i,a);if(v(u,n),o=H(u),o>0)for(let h=0;h<e;h++)a[h]=u[h]/o}if(o<t)return 0;let c=new Float64Array(e);for(let l=0;l<e;l++)c[l]=Math.random()-.5;v(c,n),R(c);let s=0;for(let l=0;l<r;l++){let u=N(i,c),h=new Float64Array(e);for(let f=0;f<e;f++)h[f]=o*c[f]-u[f];v(h,n);let m=H(h);if(m<t)break;let x=m;for(let f=0;f<e;f++)c[f]=h[f]/m;if(Math.abs(x-s)<t)break;s=x}let d=o-s;return Math.max(0,d)}function F(i,e,r=100,t=1e-6){return y(i,e,r,t)}function C(i,e,r=50,t){if(e<=1)return 0;let n=t??y(i,e);if(n<1e-10)return 1/0;let o=2*Math.max(...i.map(d=>d.length),1),s=2*(Math.log(o/n)/(o-n));return Math.max(0,s)}function M(i,e,r){let t=1-Math.exp(-i/.05),n=1-Math.exp(-e/.5),a=r===1/0?0:1/(1+r/5),o=.4*t+.3*n+.3*a;return Math.max(0,Math.min(1,o))}var _=g(()=>{"use strict"});var ee={};ne(ee,{ALERT_THRESHOLDS:()=>fe,DEFAULT_HNSW_HEALTH_CONFIG:()=>Y,HnswHealthMonitor:()=>L,_resetNativeLoader:()=>be,approximateFiedlerValue:()=>y,approximateSpectralGap:()=>F,buildAdjacencyFromIndex:()=>Z,buildLaplacian:()=>X,computeCoherenceScore:()=>M,createHnswHealthMonitor:()=>ge,deflateVector:()=>v,estimateEffectiveResistance:()=>C,laplacianMultiply:()=>N,normalizeInPlace:()=>R,vectorNorm:()=>H});function pe(){return V?T:(V=!0,T=null,null)}function be(){T=null,V=!1}function Z(i,e=16,r){let t=i.size();if(t===0)return{adjacency:[],nodeCount:0,adjacencySource:"approximate"};let n=Array.from({length:t},()=>[]),a=Math.min(e,t-1);if(a===0)return{adjacency:n,nodeCount:t,adjacencySource:"approximate"};if(r&&r.size>0){let o=Array.from(r.keys()).slice(0,t),c=new Map;for(let s=0;s<o.length;s++)c.set(o[s],s);for(let s=0;s<o.length;s++){let d=r.get(o[s]);if(!d)continue;let l=i.search(d,a+1);for(let u of l){if(u.id===o[s])continue;let h=c.get(u.id);h!==void 0&&(n[s].includes(h)||n[s].push(h),n[h].includes(s)||n[h].push(s))}}return{adjacency:n,nodeCount:t,adjacencySource:"actual-search"}}console.warn("[HnswHealthMonitor] No stored vectors provided \u2014 using approximate circular adjacency. Pass stored vectors for accurate health metrics.");for(let o=0;o<t;o++)for(let c=0;c<a;c++){let s=(o+c+1)%t;n[o].includes(s)||n[o].push(s),n[s].includes(o)||n[s].push(o)}return{adjacency:n,nodeCount:t,adjacencySource:"approximate"}}function ge(i){return new L(i)}var Y,fe,T,V,L,te=g(()=>{"use strict";_();_();Y={fiedlerThreshold:.01,spectralGapThreshold:.1,resistanceThreshold:10,coherenceThreshold:.3,maxPowerIterations:100,convergenceTolerance:1e-6,resistanceSampleSize:50,maxHistoryEntries:200,minIndexSize:3},fe={FragileIndex:.01,PoorExpansion:.1,HighResistance:10,LowCoherence:.3},T=null,V=!1;L=class{config;alerts=[];history=[];lastReport=null;useNative=!1;nativeChecked=!1;constructor(e){this.config={...Y,...e}}checkHealth(e){let r=performance.now(),t=e.size();if(t<this.config.minIndexSize)return this.createSmallIndexReport(t,performance.now()-r);this.nativeChecked||(this.nativeChecked=!0,this.useNative=pe()!==null);let{adjacency:n,nodeCount:a,adjacencySource:o}=Z(e),c=this.useNative?this.computeNativeMetrics(n):this.computeApproximateMetrics(n,a),s=this.generateAlerts(c);this.alerts.length=0,this.alerts.push(...s);let d=performance.now()-r,l={healthy:s.length===0,metrics:c,alerts:s,indexSize:t,usedNativeBackend:this.useNative,adjacencySource:o,checkDurationMs:d,checkedAt:new Date};return this.addHistoryPoint({coherenceScore:c.coherenceScore,fiedlerValue:c.fiedlerValue,indexSize:t,healthy:l.healthy,timestamp:l.checkedAt}),this.lastReport=l,l}getAlerts(){return[...this.alerts]}getMetricsHistory(e){let r=[...this.history];return e!==void 0&&e<r.length?r.slice(-e):r}isHealthy(){return this.lastReport===null?!0:this.lastReport.healthy}getLastReport(){return this.lastReport}clearHistory(){this.history.length=0,this.alerts.length=0,this.lastReport=null}computeNativeMetrics(e){let r=T,t=r.computeFiedlerValue(e),n=r.computeSpectralGap(e),a=r.computeEffectiveResistance(e),o=M(t,n,a);return{fiedlerValue:t,spectralGap:n,effectiveResistance:a,coherenceScore:o}}computeApproximateMetrics(e,r){let t=y(e,r,this.config.maxPowerIterations,this.config.convergenceTolerance),n=F(e,r,this.config.maxPowerIterations,this.config.convergenceTolerance),a=C(e,r,this.config.resistanceSampleSize,t),o=M(t,n,a);return{fiedlerValue:t,spectralGap:n,effectiveResistance:a,coherenceScore:o}}generateAlerts(e){let r=[],t=new Date;return e.fiedlerValue<this.config.fiedlerThreshold&&r.push({type:"FragileIndex",message:`Fiedler value ${e.fiedlerValue.toFixed(6)} is below threshold ${this.config.fiedlerThreshold}. The index graph has weak algebraic connectivity.`,value:e.fiedlerValue,threshold:this.config.fiedlerThreshold,timestamp:t}),e.spectralGap<this.config.spectralGapThreshold&&r.push({type:"PoorExpansion",message:`Spectral gap ${e.spectralGap.toFixed(6)} is below threshold ${this.config.spectralGapThreshold}. The index graph has poor expansion properties.`,value:e.spectralGap,threshold:this.config.spectralGapThreshold,timestamp:t}),e.effectiveResistance>this.config.resistanceThreshold&&r.push({type:"HighResistance",message:`Average effective resistance ${e.effectiveResistance.toFixed(4)} exceeds threshold ${this.config.resistanceThreshold}. Nodes are poorly connected.`,value:e.effectiveResistance,threshold:this.config.resistanceThreshold,timestamp:t}),e.coherenceScore<this.config.coherenceThreshold&&r.push({type:"LowCoherence",message:`Coherence score ${e.coherenceScore.toFixed(4)} is below threshold ${this.config.coherenceThreshold}. Overall index health is degraded.`,value:e.coherenceScore,threshold:this.config.coherenceThreshold,timestamp:t}),r}createSmallIndexReport(e,r){let t={fiedlerValue:e>0?1:0,spectralGap:e>0?1:0,effectiveResistance:e>0?.5:0,coherenceScore:e>0?1:0},n={healthy:!0,metrics:t,alerts:[],indexSize:e,usedNativeBackend:!1,adjacencySource:"approximate",checkDurationMs:r,checkedAt:new Date};return this.addHistoryPoint({coherenceScore:t.coherenceScore,fiedlerValue:t.fiedlerValue,indexSize:e,healthy:!0,timestamp:n.checkedAt}),this.lastReport=n,n}addHistoryPoint(e){this.history.push(e),this.history.length>this.config.maxHistoryEntries&&this.history.splice(0,this.history.length-this.config.maxHistoryEntries)}}});var ve,p,re,ye=g(()=>{B();Q();oe();ve={patterns:{dimensions:384,M:16,efConstruction:200,efSearch:100,metric:"cosine"},"qe-memory":{dimensions:384,M:16,efConstruction:200,efSearch:100,metric:"cosine"},learning:{dimensions:384,M:16,efConstruction:200,efSearch:50,metric:"cosine"},coverage:{dimensions:384,M:16,efConstruction:200,efSearch:100,metric:"cosine"}},p=new Map,re=class i{backend;_isNativeBackend;indexName;stringToNumericId=new Map;numericToStringId=new Map;nextAutoId=0;healthMonitor=null;healthMonitorLoaded=!1;operationsSinceLastCheck=0;healthCheckFrequency=100;lastHealthReport=null;constructor(e,r){this.indexName=e;let n={...ve[e]??{},...r},{backend:a,isNative:o}=i.createBackend(n);this.backend=a,this._isNativeBackend=o}add(e,r,t){this.backend.add(e,r,t),this.maybeRunHealthCheck()}search(e,r){let t=performance.now(),n=this.backend.search(e,r),a=performance.now()-t;return a>50&&console.warn(`[HNSW] search took ${a.toFixed(1)}ms (k=${r}, results=${n.length})`),this._lastSearchLatencyMs=a,n}_lastSearchLatencyMs=0;get lastSearchLatencyMs(){return this._lastSearchLatencyMs}remove(e){return this.backend.remove(e)}size(){return this.backend.size()}dimensions(){return this.backend.dimensions()}recall(){return this.backend.recall()}addByStringId(e,r){let t=this.stringToNumericId.get(e);t!==void 0?this.backend.remove(t):(t=this.nextAutoId++,this.stringToNumericId.set(e,t),this.numericToStringId.set(t,e)),this.backend.add(t,new Float32Array(r))}searchByArray(e,r){return this.backend.search(new Float32Array(e),r).map(n=>({id:this.numericToStringId.get(n.id)??String(n.id),score:n.score}))}removeByStringId(e){let r=this.stringToNumericId.get(e);if(r===void 0)return!1;let t=this.backend.remove(r);return t&&(this.stringToNumericId.delete(e),this.numericToStringId.delete(r)),t}clear(){this.backend.clear?.(),this.stringToNumericId.clear(),this.numericToStringId.clear(),this.nextAutoId=0}dispose(){try{this.backend.dispose?.()}catch{}this.stringToNumericId.clear(),this.numericToStringId.clear(),this.nextAutoId=0}isRuvectorAvailable(){return this.backend instanceof S?this.backend.isRuvectorAvailable():this.backend instanceof w?this.backend.isNativeAvailable():!1}isNativeBackend(){return this._isNativeBackend}getName(){return this.indexName}setHealthCheckFrequency(e){this.healthCheckFrequency=Math.max(1,e)}getHealthCheckFrequency(){return this.healthCheckFrequency}getLastHealthReport(){return this.lastHealthReport}getHealthMonitor(){return this.healthMonitor}maybeRunHealthCheck(){if($()&&(this.operationsSinceLastCheck++,!(this.operationsSinceLastCheck<this.healthCheckFrequency)&&(this.operationsSinceLastCheck=0,this.ensureHealthMonitor(),this.healthMonitor)))try{this.lastHealthReport=this.healthMonitor.checkHealth(this.backend),this.lastHealthReport.healthy||console.warn(`[HNSW-Health] Index "${this.indexName}" health check failed: ${this.lastHealthReport.alerts.length} alert(s). Coherence: ${this.lastHealthReport.metrics.coherenceScore.toFixed(3)}`)}catch(e){console.warn(`[HNSW-Health] Health check error for "${this.indexName}":`,e)}}ensureHealthMonitor(){if(!this.healthMonitorLoaded){this.healthMonitorLoaded=!0;try{let e=(te(),W(ee));this.healthMonitor=e.createHnswHealthMonitor()}catch(e){process.env.DEBUG&&console.debug("[HNSW-Health] Monitor module unavailable:",e instanceof Error?e.message:e),this.healthMonitor=null}}}static createBackend(e){if(D())try{return{backend:new w(e),isNative:!0}}catch(r){r instanceof b?console.info(`[HNSW] Native backend unavailable, falling back to JS: ${r.message}`):console.warn("[HNSW] Unexpected error creating native backend, falling back to JS:",r)}return{backend:new S(e),isNative:!1}}static create(e,r){let t=p.get(e);if(t instanceof i)return t;let n=new i(e,r);return p.set(e,n),n}static get(e){let r=p.get(e);return r instanceof i?r:void 0}static close(e){let r=p.get(e);r instanceof i&&r.dispose(),p.delete(e)}static closeAll(){for(let[e]of p)i.close(e);p.clear()}static listIndexes(){return Array.from(p.keys())}}});export{re as a,ye 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.9");process.exit(0)}
2
- import{c as s,e as t}from"./chunk-HZLDCCUG.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.11");process.exit(0)}
2
+ import{c as s,e as t}from"./chunk-LUAXQB57.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,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.9");process.exit(0)}
2
- import{a as T}from"./chunk-EEKIJM5G.js";import{c as S}from"./chunk-IYG6DTCX.js";import{b as C,d as P}from"./chunk-JOCSV4LF.js";import{a as b,c as $}from"./chunk-MOI2ZRZO.js";import{a as w,d as M}from"./chunk-IAETFGEU.js";$();M();import{randomUUID as A}from"crypto";var x={topology:"hierarchical",maxConcurrentSkills:10,maxConcurrentModels:3,timeout:3e5,continueOnFailure:!0,retry:{maxRetries:2,retryDelayMs:1e3}},R=class{config;learner;skillValidator=null;workers=new Map;taskQueue=[];isRunning=!1;constructor(e,t){this.config={...x,...e},this.learner=t}setSkillValidator(e){this.skillValidator=e}async validateSkillsParallel(e,t,i){let s=Date.now(),a=i?.trustTier??3,n=i?.validationLevel??"eval",c=this.determineTopology(e.length,t.length),r=this.createValidationTasks(e,t,a,n),o=await this.executeTasksParallel(r,c),l=new Map;for(let u of o){let p=l.get(u.skill)||[];p.push(u),l.set(u.skill,p)}return await this.recordOutcomesToLearner(o,a,n),l}async validateSkillCrossModel(e,t,i){return(await this.validateSkillsParallel([e],t,i)).get(e)||[]}getSummary(e){let t=[],i=new Map,s=new Map;for(let[c,r]of e){i.set(c,r);for(let o of r){t.push(o);let l=s.get(o.model)||[];l.push(o),s.set(o.model,l)}}let a=t.filter(c=>c.errors.length===0&&c.evalPassRate>=.9).length,n=t.reduce((c,r)=>c+r.durationMs,0);return{totalSkills:i.size,totalModels:s.size,successCount:a,failureCount:t.length-a,overallPassRate:t.length>0?a/t.length:0,totalDurationMs:n,avgDurationMs:t.length>0?n/t.length:0,topology:this.config.topology,bySkill:i,byModel:s,results:t}}determineTopology(e,t){if(this.config.topology){let i=e*t;return i>20&&this.config.topology==="mesh"&&console.warn(`[SwarmSkillValidator] Large workload (${i} tasks) may be more efficient with hierarchical topology`),this.config.topology}return e>5||e>t*2?"hierarchical":t>5&&e<=3?"mesh":"hierarchical"}createValidationTasks(e,t,i,s){let a=[];for(let n of e)for(let c of t)a.push({id:`${n}-${c}-${Date.now()}-${A().slice(0,8)}`,skill:n,model:c,trustTier:i,validationLevel:s,timeout:this.config.timeout,retryCount:0});return a}async executeTasksParallel(e,t){this.isRunning=!0,this.taskQueue=[...e];let i=[],s=t==="hierarchical"?this.config.maxConcurrentSkills:Math.min(this.config.maxConcurrentSkills*this.config.maxConcurrentModels,e.length),a=[];for(let n=0;n<Math.min(s,e.length);n++){let c=`worker-${n}`;this.workers.set(c,{id:c,task:null,status:"idle"}),a.push(this.runWorker(c,i))}return await Promise.all(a),this.isRunning=!1,this.workers.clear(),i}async runWorker(e,t){let i=this.workers.get(e);if(i){for(;this.taskQueue.length>0&&this.isRunning;){let s=this.taskQueue.shift();if(!s)break;i.task=s,i.status="running",i.startTime=Date.now();try{let a=await this.executeValidationTask(s);t.push(a),i.result=a,i.status="completed"}catch(a){let n=this.createErrorResult(s,a);this.config.retry&&s.retryCount<this.config.retry.maxRetries&&this.config.continueOnFailure?(s.retryCount++,this.taskQueue.push(s),await this.delay(this.config.retry.retryDelayMs)):(t.push(n),i.result=n,i.status="failed")}}i.task=null,i.status="idle"}}async executeValidationTask(e){let t=Date.now();if(!this.skillValidator)return this.createSimulatedResult(e,t);let i=new Promise((n,c)=>{setTimeout(()=>c(new Error(`Validation timeout after ${e.timeout}ms`)),e.timeout)}),s=await Promise.race([this.skillValidator(e.skill,e.model,{trustTier:e.trustTier,validationLevel:e.validationLevel,timeout:e.timeout}),i]),a=Date.now()-t;return this.outcomeToResult(s,e,a)}outcomeToResult(e,t,i){let s=e.testCaseResults.filter(c=>c.passed).length,a=e.testCaseResults.length,n=a>0?s/a:e.score;return{skill:t.skill,model:t.model,schemaValid:e.validationLevel!=="schema"||e.passed,validatorPassed:e.validationLevel!=="validator"||e.passed,evalPassRate:n,durationMs:i,errors:e.passed?[]:["Validation failed"],trustTier:t.trustTier,validationLevel:t.validationLevel,retryCount:t.retryCount,timestamp:new Date}}createSimulatedResult(e,t){let i=Date.now()-t+w()*100,s=.85+w()*.15;return{skill:e.skill,model:e.model,schemaValid:!0,validatorPassed:s>.8,evalPassRate:s,durationMs:i,errors:s>.8?[]:["Simulated validation failure"],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}createErrorResult(e,t){let i=b(t);return{skill:e.skill,model:e.model,schemaValid:!1,validatorPassed:!1,evalPassRate:0,durationMs:0,errors:[i],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}async recordOutcomesToLearner(e,t,i){for(let s of e){let a={skillName:s.skill,trustTier:s.trustTier||t,validationLevel:s.validationLevel||i,model:s.model,passed:s.errors.length===0&&s.evalPassRate>=.9,score:s.evalPassRate,testCaseResults:this.createTestCaseResults(s),timestamp:s.timestamp,runId:`swarm-${Date.now()}`,metadata:{duration:s.durationMs,retryCount:s.retryCount}};await this.learner.recordValidationOutcome(a)}}createTestCaseResults(e){return[{testId:`${e.skill}-${e.model}-aggregate`,passed:e.errors.length===0,expectedPatterns:["valid-output"],actualPatterns:e.errors.length===0?["valid-output"]:[],reasoningQuality:e.evalPassRate,executionTimeMs:e.durationMs,category:"swarm-validation",priority:"high",error:e.errors.length>0?e.errors.join("; "):void 0}]}delay(e){return new Promise(t=>setTimeout(t,e))}getConfig(){return{...this.config}}isValidationRunning(){return this.isRunning}getWorkerStatus(){return Array.from(this.workers.values())}cancel(){this.isRunning=!1,this.taskQueue=[]}};function D(y,e){return new R(y,e)}var F=["security-testing","accessibility-testing","api-testing","performance-testing","visual-regression-testing","mutation-testing","contract-testing","chaos-testing","compliance-testing","penetration-testing"],I=["claude-sonnet","claude-haiku","claude-opus"];P();import{readFileSync as E,writeFileSync as L,existsSync as N}from"fs";var O={varianceThreshold:.04,regressionThreshold:.1,minSamples:3,autoUpdateManifest:!1},k=class{constructor(e,t,i={}){this.learner=e;this.manifestPath=t;this.config={...O,...i}}learner;manifestPath;config;async aggregateResults(e){let t=`agg-${Date.now()}`,i=new Date,s=this.buildSkillResultsMap(e),a=this.calculateSummary(s,e),n=await this.detectCrossModelAnomalies(e),c=await this.detectRegressions(e,this.config.regressionThreshold),r=this.generateRecommendations(s,n,c),o={timestamp:i,runId:t,summary:a,skillResults:s,crossModelAnalysis:n,regressions:c,recommendations:r,metadata:{version:"1.0.0",environment:e[0]?.metadata?.environment,generatedBy:"ValidationResultAggregator",inputs:{runIds:e.map(l=>l.runId),models:[...new Set(e.map(l=>l.model))]}}};return this.config.autoUpdateManifest&&await this.updateManifest(o),o}buildSkillResultsMap(e){let t=new Map;for(let i of e)for(let s of i.outcomes){let a=s.skillName;t.has(a)||t.set(a,{skill:a,trustTier:s.trustTier,passRateByModel:new Map,avgPassRate:0,schemaValid:!0,validatorPassed:!0,evalPassed:!0,issues:[],executionTimeMs:0,testCount:0,passedTests:0,failedTests:0});let n=t.get(a),c=s.testCaseResults.filter(r=>r.passed).length/(s.testCaseResults.length||1);n.passRateByModel.set(i.model,c),n.testCount+=s.testCaseResults.length,n.passedTests+=s.testCaseResults.filter(r=>r.passed).length,n.failedTests+=s.testCaseResults.filter(r=>!r.passed).length,n.executionTimeMs+=s.metadata?.duration||0,s.validationLevel==="schema"&&!s.passed&&(n.schemaValid=!1),s.validationLevel==="validator"&&!s.passed&&(n.validatorPassed=!1),s.validationLevel==="eval"&&!s.passed&&(n.evalPassed=!1);for(let r of s.testCaseResults)!r.passed&&r.error&&n.issues.push({skill:a,model:i.model,severity:r.priority==="critical"?"critical":r.priority==="high"?"high":r.priority==="medium"?"medium":"low",type:this.categorizeIssueType(s.validationLevel,r.error),message:r.error,testId:r.testId})}for(let i of t.values()){let s=Array.from(i.passRateByModel.values());i.avgPassRate=s.length>0?s.reduce((a,n)=>a+n,0)/s.length:0}return t}categorizeIssueType(e,t){return t.toLowerCase().includes("timeout")?"timeout":e==="schema"?"schema_failure":e==="validator"?"validator_failure":e==="eval"?"eval_failure":"error"}calculateSummary(e,t){let i=Array.from(e.values()),s=i.filter(n=>n.avgPassRate>=.9).length,a=i.length>0?i.reduce((n,c)=>n+c.avgPassRate,0)/i.length:0;return{totalSkills:i.length,passedSkills:s,failedSkills:i.length-s,avgPassRate:a,totalDurationMs:t.reduce((n,c)=>n+c.durationMs,0),totalTests:i.reduce((n,c)=>n+c.testCount,0),passedTests:i.reduce((n,c)=>n+c.passedTests,0),failedTests:i.reduce((n,c)=>n+c.failedTests,0),modelsUsed:[...new Set(t.map(n=>n.model))]}}async detectCrossModelAnomalies(e){let t=new Map,i=new Map,s=new Map;for(let d of e){t.has(d.model)||(t.set(d.model,[]),i.set(d.model,{totalTests:0,passedTests:0,skillCount:0}));for(let g of d.outcomes){let h=g.testCaseResults.filter(m=>m.passed).length/(g.testCaseResults.length||1);t.get(d.model).push(h);let f=i.get(d.model);f.totalTests+=g.testCaseResults.length,f.passedTests+=g.testCaseResults.filter(m=>m.passed).length,f.skillCount++,s.has(g.skillName)||s.set(g.skillName,{passRates:[],models:[]}),s.get(g.skillName).passRates.push(h),s.get(g.skillName).models.push(d.model)}}let a=[];for(let d of t.values())a.push(...d);let n=a.length>0?a.reduce((d,g)=>d+g,0)/a.length:0,c=a.length>1?a.reduce((d,g)=>d+Math.pow(g-n,2),0)/a.length:0,r=Math.sqrt(c),o=[],l=new Map;for(let[d,g]of t.entries()){let h=g.reduce((v,V)=>v+V,0)/g.length,f=h-n,m=i.get(d);l.set(d,{avgPassRate:h,skillCount:m.skillCount,totalTests:m.totalTests}),Math.abs(f)>this.config.varianceThreshold*2&&o.push({model:d,type:f<0?"low_performance":"high_variance",description:`Model ${d} has ${(f*100).toFixed(1)}% difference from average`,passRate:h,avgPassRate:n,deviation:Math.abs(f)})}let u=[],p=[];for(let[d,g]of s.entries()){if(g.passRates.length<2)continue;let h=g.passRates.reduce((m,v)=>m+v,0)/g.passRates.length;g.passRates.reduce((m,v)=>m+Math.pow(v-h,2),0)/g.passRates.length<this.config.varianceThreshold?u.push(d):p.push(d)}return{variance:c,stdDeviation:r,anomalies:o,consistentSkills:u,inconsistentSkills:p,modelPerformance:l}}async detectRegressions(e,t){let i=[],s=new Set;for(let a of e)for(let n of a.outcomes){let c=`${n.skillName}-${a.model}`;if(s.has(c))continue;s.add(c);let r=await this.learner.getValidationTrends(n.skillName);if(!r)continue;let o=n.testCaseResults.filter(p=>p.passed).length/(n.testCaseResults.length||1),l=r.recentPassRate,u=l-o;u>=t&&i.push({skill:n.skillName,model:a.model,previousPassRate:l,currentPassRate:o,regressionAmount:u,trend:r.overall,possibleCauses:this.analyzePossibleCauses(n,u),severity:this.categorizeRegressionSeverity(u)})}return i.sort((a,n)=>{let c={critical:0,high:1,medium:2,low:3},r=c[a.severity]-c[n.severity];return r!==0?r:n.regressionAmount-a.regressionAmount})}analyzePossibleCauses(e,t){let i=[],s=e.testCaseResults.filter(c=>!c.passed);if(s.length>0){let c=[...new Set(s.map(r=>r.category).filter(Boolean))];c.length>0&&i.push(`Failures in categories: ${c.join(", ")}`)}let a=s.filter(c=>c.priority==="critical");a.length>0&&i.push(`${a.length} critical test(s) failing`);let n=e.testCaseResults.reduce((c,r)=>c+r.reasoningQuality,0)/(e.testCaseResults.length||1);return n<.7&&i.push(`Low reasoning quality score: ${(n*100).toFixed(1)}%`),t>.3&&i.push("Possible model behavior change or prompt drift"),i.length===0&&i.push("No specific cause identified - review test details"),i}categorizeRegressionSeverity(e){return e>=.5?"critical":e>=.3?"high":e>=.15?"medium":"low"}generateRecommendations(e,t,i){let s=[];if(t.inconsistentSkills.length>0&&s.push(`Review ${t.inconsistentSkills.length} skills with inconsistent cross-model behavior: `+t.inconsistentSkills.slice(0,3).join(", ")+(t.inconsistentSkills.length>3?` and ${t.inconsistentSkills.length-3} more`:"")),t.anomalies.some(r=>r.type==="low_performance")){let r=t.anomalies.filter(o=>o.type==="low_performance").map(o=>o.model);s.push(`Investigate low performance on model(s): ${r.join(", ")}`)}let a=i.filter(r=>r.severity==="critical");a.length>0&&s.push(`URGENT: ${a.length} critical regression(s) detected - immediate review required`);let n=Array.from(e.values()).filter(r=>r.avgPassRate<.9);if(n.length>0){let r=n.filter(l=>!l.schemaValid),o=n.filter(l=>!l.validatorPassed);r.length>0&&s.push(`Fix schema validation for: ${r.map(l=>l.skill).slice(0,3).join(", ")}`),o.length>0&&s.push(`Review validator scripts for: ${o.map(l=>l.skill).slice(0,3).join(", ")}`)}return Array.from(e.values()).reduce((r,o)=>r+o.avgPassRate,0)/e.size<.8&&s.push("Overall pass rate below 80% - consider reviewing skill definitions and test expectations"),s.length===0&&s.push("All validations passing - no immediate action required"),s}async updateManifest(e){if(!N(this.manifestPath))throw new Error(`Manifest file not found: ${this.manifestPath}`);let t=C(E(this.manifestPath,"utf-8"));for(let[s,a]of e.skillResults.entries())if(t.skills&&t.skills[s]){let n=t.skills[s];n.validation||(n.validation={}),n.validation.passRate=a.avgPassRate,n.validation.lastValidated=e.timestamp.toISOString(),n.validation.status=a.avgPassRate>=.9?"passing":"failing",n.validation.passRateByModel=Object.fromEntries(a.passRateByModel)}let i=Array.from(e.skillResults.values());t.validationStatus={passing:i.filter(s=>s.avgPassRate>=.9).length,failing:i.filter(s=>s.avgPassRate<.9).length,unknown:0,skipped:t.summary?.tier0||0},t.generatedAt=new Date().toISOString(),t.lastValidationRun={runId:e.runId,timestamp:e.timestamp.toISOString(),avgPassRate:e.summary.avgPassRate,modelsUsed:e.summary.modelsUsed},L(this.manifestPath,JSON.stringify(t,null,2))}generateMarkdownReport(e){let{summary:t,crossModelAnalysis:i,regressions:s,recommendations:a,skillResults:n}=e,c=(t.avgPassRate>=.9||t.avgPassRate>=.7,"`"),r=[];if(r.push(`# Validation Report
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.11");process.exit(0)}
2
+ import{a as T}from"./chunk-CYQRZ645.js";import{c as S}from"./chunk-QYHRDBKI.js";import{b as C,d as P}from"./chunk-TZA45FI7.js";import{a as b,c as $}from"./chunk-TCVEXQLL.js";import{a as w,d as M}from"./chunk-WJB6YYMJ.js";$();M();import{randomUUID as A}from"crypto";var x={topology:"hierarchical",maxConcurrentSkills:10,maxConcurrentModels:3,timeout:3e5,continueOnFailure:!0,retry:{maxRetries:2,retryDelayMs:1e3}},R=class{config;learner;skillValidator=null;workers=new Map;taskQueue=[];isRunning=!1;constructor(e,t){this.config={...x,...e},this.learner=t}setSkillValidator(e){this.skillValidator=e}async validateSkillsParallel(e,t,i){let s=Date.now(),a=i?.trustTier??3,n=i?.validationLevel??"eval",c=this.determineTopology(e.length,t.length),r=this.createValidationTasks(e,t,a,n),o=await this.executeTasksParallel(r,c),l=new Map;for(let u of o){let p=l.get(u.skill)||[];p.push(u),l.set(u.skill,p)}return await this.recordOutcomesToLearner(o,a,n),l}async validateSkillCrossModel(e,t,i){return(await this.validateSkillsParallel([e],t,i)).get(e)||[]}getSummary(e){let t=[],i=new Map,s=new Map;for(let[c,r]of e){i.set(c,r);for(let o of r){t.push(o);let l=s.get(o.model)||[];l.push(o),s.set(o.model,l)}}let a=t.filter(c=>c.errors.length===0&&c.evalPassRate>=.9).length,n=t.reduce((c,r)=>c+r.durationMs,0);return{totalSkills:i.size,totalModels:s.size,successCount:a,failureCount:t.length-a,overallPassRate:t.length>0?a/t.length:0,totalDurationMs:n,avgDurationMs:t.length>0?n/t.length:0,topology:this.config.topology,bySkill:i,byModel:s,results:t}}determineTopology(e,t){if(this.config.topology){let i=e*t;return i>20&&this.config.topology==="mesh"&&console.warn(`[SwarmSkillValidator] Large workload (${i} tasks) may be more efficient with hierarchical topology`),this.config.topology}return e>5||e>t*2?"hierarchical":t>5&&e<=3?"mesh":"hierarchical"}createValidationTasks(e,t,i,s){let a=[];for(let n of e)for(let c of t)a.push({id:`${n}-${c}-${Date.now()}-${A().slice(0,8)}`,skill:n,model:c,trustTier:i,validationLevel:s,timeout:this.config.timeout,retryCount:0});return a}async executeTasksParallel(e,t){this.isRunning=!0,this.taskQueue=[...e];let i=[],s=t==="hierarchical"?this.config.maxConcurrentSkills:Math.min(this.config.maxConcurrentSkills*this.config.maxConcurrentModels,e.length),a=[];for(let n=0;n<Math.min(s,e.length);n++){let c=`worker-${n}`;this.workers.set(c,{id:c,task:null,status:"idle"}),a.push(this.runWorker(c,i))}return await Promise.all(a),this.isRunning=!1,this.workers.clear(),i}async runWorker(e,t){let i=this.workers.get(e);if(i){for(;this.taskQueue.length>0&&this.isRunning;){let s=this.taskQueue.shift();if(!s)break;i.task=s,i.status="running",i.startTime=Date.now();try{let a=await this.executeValidationTask(s);t.push(a),i.result=a,i.status="completed"}catch(a){let n=this.createErrorResult(s,a);this.config.retry&&s.retryCount<this.config.retry.maxRetries&&this.config.continueOnFailure?(s.retryCount++,this.taskQueue.push(s),await this.delay(this.config.retry.retryDelayMs)):(t.push(n),i.result=n,i.status="failed")}}i.task=null,i.status="idle"}}async executeValidationTask(e){let t=Date.now();if(!this.skillValidator)return this.createSimulatedResult(e,t);let i=new Promise((n,c)=>{setTimeout(()=>c(new Error(`Validation timeout after ${e.timeout}ms`)),e.timeout)}),s=await Promise.race([this.skillValidator(e.skill,e.model,{trustTier:e.trustTier,validationLevel:e.validationLevel,timeout:e.timeout}),i]),a=Date.now()-t;return this.outcomeToResult(s,e,a)}outcomeToResult(e,t,i){let s=e.testCaseResults.filter(c=>c.passed).length,a=e.testCaseResults.length,n=a>0?s/a:e.score;return{skill:t.skill,model:t.model,schemaValid:e.validationLevel!=="schema"||e.passed,validatorPassed:e.validationLevel!=="validator"||e.passed,evalPassRate:n,durationMs:i,errors:e.passed?[]:["Validation failed"],trustTier:t.trustTier,validationLevel:t.validationLevel,retryCount:t.retryCount,timestamp:new Date}}createSimulatedResult(e,t){let i=Date.now()-t+w()*100,s=.85+w()*.15;return{skill:e.skill,model:e.model,schemaValid:!0,validatorPassed:s>.8,evalPassRate:s,durationMs:i,errors:s>.8?[]:["Simulated validation failure"],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}createErrorResult(e,t){let i=b(t);return{skill:e.skill,model:e.model,schemaValid:!1,validatorPassed:!1,evalPassRate:0,durationMs:0,errors:[i],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}async recordOutcomesToLearner(e,t,i){for(let s of e){let a={skillName:s.skill,trustTier:s.trustTier||t,validationLevel:s.validationLevel||i,model:s.model,passed:s.errors.length===0&&s.evalPassRate>=.9,score:s.evalPassRate,testCaseResults:this.createTestCaseResults(s),timestamp:s.timestamp,runId:`swarm-${Date.now()}`,metadata:{duration:s.durationMs,retryCount:s.retryCount}};await this.learner.recordValidationOutcome(a)}}createTestCaseResults(e){return[{testId:`${e.skill}-${e.model}-aggregate`,passed:e.errors.length===0,expectedPatterns:["valid-output"],actualPatterns:e.errors.length===0?["valid-output"]:[],reasoningQuality:e.evalPassRate,executionTimeMs:e.durationMs,category:"swarm-validation",priority:"high",error:e.errors.length>0?e.errors.join("; "):void 0}]}delay(e){return new Promise(t=>setTimeout(t,e))}getConfig(){return{...this.config}}isValidationRunning(){return this.isRunning}getWorkerStatus(){return Array.from(this.workers.values())}cancel(){this.isRunning=!1,this.taskQueue=[]}};function D(y,e){return new R(y,e)}var F=["security-testing","accessibility-testing","api-testing","performance-testing","visual-regression-testing","mutation-testing","contract-testing","chaos-testing","compliance-testing","penetration-testing"],I=["claude-sonnet","claude-haiku","claude-opus"];P();import{readFileSync as E,writeFileSync as L,existsSync as N}from"fs";var O={varianceThreshold:.04,regressionThreshold:.1,minSamples:3,autoUpdateManifest:!1},k=class{constructor(e,t,i={}){this.learner=e;this.manifestPath=t;this.config={...O,...i}}learner;manifestPath;config;async aggregateResults(e){let t=`agg-${Date.now()}`,i=new Date,s=this.buildSkillResultsMap(e),a=this.calculateSummary(s,e),n=await this.detectCrossModelAnomalies(e),c=await this.detectRegressions(e,this.config.regressionThreshold),r=this.generateRecommendations(s,n,c),o={timestamp:i,runId:t,summary:a,skillResults:s,crossModelAnalysis:n,regressions:c,recommendations:r,metadata:{version:"1.0.0",environment:e[0]?.metadata?.environment,generatedBy:"ValidationResultAggregator",inputs:{runIds:e.map(l=>l.runId),models:[...new Set(e.map(l=>l.model))]}}};return this.config.autoUpdateManifest&&await this.updateManifest(o),o}buildSkillResultsMap(e){let t=new Map;for(let i of e)for(let s of i.outcomes){let a=s.skillName;t.has(a)||t.set(a,{skill:a,trustTier:s.trustTier,passRateByModel:new Map,avgPassRate:0,schemaValid:!0,validatorPassed:!0,evalPassed:!0,issues:[],executionTimeMs:0,testCount:0,passedTests:0,failedTests:0});let n=t.get(a),c=s.testCaseResults.filter(r=>r.passed).length/(s.testCaseResults.length||1);n.passRateByModel.set(i.model,c),n.testCount+=s.testCaseResults.length,n.passedTests+=s.testCaseResults.filter(r=>r.passed).length,n.failedTests+=s.testCaseResults.filter(r=>!r.passed).length,n.executionTimeMs+=s.metadata?.duration||0,s.validationLevel==="schema"&&!s.passed&&(n.schemaValid=!1),s.validationLevel==="validator"&&!s.passed&&(n.validatorPassed=!1),s.validationLevel==="eval"&&!s.passed&&(n.evalPassed=!1);for(let r of s.testCaseResults)!r.passed&&r.error&&n.issues.push({skill:a,model:i.model,severity:r.priority==="critical"?"critical":r.priority==="high"?"high":r.priority==="medium"?"medium":"low",type:this.categorizeIssueType(s.validationLevel,r.error),message:r.error,testId:r.testId})}for(let i of t.values()){let s=Array.from(i.passRateByModel.values());i.avgPassRate=s.length>0?s.reduce((a,n)=>a+n,0)/s.length:0}return t}categorizeIssueType(e,t){return t.toLowerCase().includes("timeout")?"timeout":e==="schema"?"schema_failure":e==="validator"?"validator_failure":e==="eval"?"eval_failure":"error"}calculateSummary(e,t){let i=Array.from(e.values()),s=i.filter(n=>n.avgPassRate>=.9).length,a=i.length>0?i.reduce((n,c)=>n+c.avgPassRate,0)/i.length:0;return{totalSkills:i.length,passedSkills:s,failedSkills:i.length-s,avgPassRate:a,totalDurationMs:t.reduce((n,c)=>n+c.durationMs,0),totalTests:i.reduce((n,c)=>n+c.testCount,0),passedTests:i.reduce((n,c)=>n+c.passedTests,0),failedTests:i.reduce((n,c)=>n+c.failedTests,0),modelsUsed:[...new Set(t.map(n=>n.model))]}}async detectCrossModelAnomalies(e){let t=new Map,i=new Map,s=new Map;for(let d of e){t.has(d.model)||(t.set(d.model,[]),i.set(d.model,{totalTests:0,passedTests:0,skillCount:0}));for(let g of d.outcomes){let h=g.testCaseResults.filter(m=>m.passed).length/(g.testCaseResults.length||1);t.get(d.model).push(h);let f=i.get(d.model);f.totalTests+=g.testCaseResults.length,f.passedTests+=g.testCaseResults.filter(m=>m.passed).length,f.skillCount++,s.has(g.skillName)||s.set(g.skillName,{passRates:[],models:[]}),s.get(g.skillName).passRates.push(h),s.get(g.skillName).models.push(d.model)}}let a=[];for(let d of t.values())a.push(...d);let n=a.length>0?a.reduce((d,g)=>d+g,0)/a.length:0,c=a.length>1?a.reduce((d,g)=>d+Math.pow(g-n,2),0)/a.length:0,r=Math.sqrt(c),o=[],l=new Map;for(let[d,g]of t.entries()){let h=g.reduce((v,V)=>v+V,0)/g.length,f=h-n,m=i.get(d);l.set(d,{avgPassRate:h,skillCount:m.skillCount,totalTests:m.totalTests}),Math.abs(f)>this.config.varianceThreshold*2&&o.push({model:d,type:f<0?"low_performance":"high_variance",description:`Model ${d} has ${(f*100).toFixed(1)}% difference from average`,passRate:h,avgPassRate:n,deviation:Math.abs(f)})}let u=[],p=[];for(let[d,g]of s.entries()){if(g.passRates.length<2)continue;let h=g.passRates.reduce((m,v)=>m+v,0)/g.passRates.length;g.passRates.reduce((m,v)=>m+Math.pow(v-h,2),0)/g.passRates.length<this.config.varianceThreshold?u.push(d):p.push(d)}return{variance:c,stdDeviation:r,anomalies:o,consistentSkills:u,inconsistentSkills:p,modelPerformance:l}}async detectRegressions(e,t){let i=[],s=new Set;for(let a of e)for(let n of a.outcomes){let c=`${n.skillName}-${a.model}`;if(s.has(c))continue;s.add(c);let r=await this.learner.getValidationTrends(n.skillName);if(!r)continue;let o=n.testCaseResults.filter(p=>p.passed).length/(n.testCaseResults.length||1),l=r.recentPassRate,u=l-o;u>=t&&i.push({skill:n.skillName,model:a.model,previousPassRate:l,currentPassRate:o,regressionAmount:u,trend:r.overall,possibleCauses:this.analyzePossibleCauses(n,u),severity:this.categorizeRegressionSeverity(u)})}return i.sort((a,n)=>{let c={critical:0,high:1,medium:2,low:3},r=c[a.severity]-c[n.severity];return r!==0?r:n.regressionAmount-a.regressionAmount})}analyzePossibleCauses(e,t){let i=[],s=e.testCaseResults.filter(c=>!c.passed);if(s.length>0){let c=[...new Set(s.map(r=>r.category).filter(Boolean))];c.length>0&&i.push(`Failures in categories: ${c.join(", ")}`)}let a=s.filter(c=>c.priority==="critical");a.length>0&&i.push(`${a.length} critical test(s) failing`);let n=e.testCaseResults.reduce((c,r)=>c+r.reasoningQuality,0)/(e.testCaseResults.length||1);return n<.7&&i.push(`Low reasoning quality score: ${(n*100).toFixed(1)}%`),t>.3&&i.push("Possible model behavior change or prompt drift"),i.length===0&&i.push("No specific cause identified - review test details"),i}categorizeRegressionSeverity(e){return e>=.5?"critical":e>=.3?"high":e>=.15?"medium":"low"}generateRecommendations(e,t,i){let s=[];if(t.inconsistentSkills.length>0&&s.push(`Review ${t.inconsistentSkills.length} skills with inconsistent cross-model behavior: `+t.inconsistentSkills.slice(0,3).join(", ")+(t.inconsistentSkills.length>3?` and ${t.inconsistentSkills.length-3} more`:"")),t.anomalies.some(r=>r.type==="low_performance")){let r=t.anomalies.filter(o=>o.type==="low_performance").map(o=>o.model);s.push(`Investigate low performance on model(s): ${r.join(", ")}`)}let a=i.filter(r=>r.severity==="critical");a.length>0&&s.push(`URGENT: ${a.length} critical regression(s) detected - immediate review required`);let n=Array.from(e.values()).filter(r=>r.avgPassRate<.9);if(n.length>0){let r=n.filter(l=>!l.schemaValid),o=n.filter(l=>!l.validatorPassed);r.length>0&&s.push(`Fix schema validation for: ${r.map(l=>l.skill).slice(0,3).join(", ")}`),o.length>0&&s.push(`Review validator scripts for: ${o.map(l=>l.skill).slice(0,3).join(", ")}`)}return Array.from(e.values()).reduce((r,o)=>r+o.avgPassRate,0)/e.size<.8&&s.push("Overall pass rate below 80% - consider reviewing skill definitions and test expectations"),s.length===0&&s.push("All validations passing - no immediate action required"),s}async updateManifest(e){if(!N(this.manifestPath))throw new Error(`Manifest file not found: ${this.manifestPath}`);let t=C(E(this.manifestPath,"utf-8"));for(let[s,a]of e.skillResults.entries())if(t.skills&&t.skills[s]){let n=t.skills[s];n.validation||(n.validation={}),n.validation.passRate=a.avgPassRate,n.validation.lastValidated=e.timestamp.toISOString(),n.validation.status=a.avgPassRate>=.9?"passing":"failing",n.validation.passRateByModel=Object.fromEntries(a.passRateByModel)}let i=Array.from(e.skillResults.values());t.validationStatus={passing:i.filter(s=>s.avgPassRate>=.9).length,failing:i.filter(s=>s.avgPassRate<.9).length,unknown:0,skipped:t.summary?.tier0||0},t.generatedAt=new Date().toISOString(),t.lastValidationRun={runId:e.runId,timestamp:e.timestamp.toISOString(),avgPassRate:e.summary.avgPassRate,modelsUsed:e.summary.modelsUsed},L(this.manifestPath,JSON.stringify(t,null,2))}generateMarkdownReport(e){let{summary:t,crossModelAnalysis:i,regressions:s,recommendations:a,skillResults:n}=e,c=(t.avgPassRate>=.9||t.avgPassRate>=.7,"`"),r=[];if(r.push(`# Validation Report
3
3
 
4
4
  > ${c} Generated: ${e.timestamp.toISOString()}
5
5
  > Run ID: ${e.runId}
@@ -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.9");process.exit(0)}
2
- import{a as h}from"./chunk-Q3TRNLVW.js";import{a as C,f as x}from"./chunk-CKRIQVMB.js";var d={mechanical:["convert var to const","add types","remove console","convert to async","convert to esm","arrow function","rename variable","format code"],simple:["fix typo","update comment","fix simple bug","add documentation","format","rename","simple refactor","basic test"],moderate:["implement feature","implement","refactor","complex refactor","performance optimization","optimize","test generation","generate test","error handling","validation logic","api integration","code index","coverage analysis","quality assessment","defect prediction","predict defect","analyze coverage","analyze","assess","scan","detect"],complex:["multi-file refactor","orchestrate","coordinate","large codebase","migration","cross-domain","workflow","system design","analyze security","security scan","security analysis","vulnerability scan","chaos test","resilience test","contract validation"],critical:["architecture","security audit","critical bug","algorithm design","system-wide","vulnerability","cryptography","performance critical","hardcoded secret","cve","owasp","penetration test","exploit"]},f={architecture:/\b(architect|design|system design|overall structure|component design)\b/i,security:/\b(security|vulnerability|audit|xss|sql injection|csrf|encryption|auth|authentication|authorization)\b/i,multiStep:/\b(orchestrate|coordinate|workflow|pipeline|multi[- ]step)\b/i,crossDomain:/\b(cross[- ]domain|across (domains|modules)|integrate|coordination)\b/i},m=class{config;agentBoosterAdapter;constructor(e,t){this.config=e,this.agentBoosterAdapter=t}async collectSignals(e){let t=e.task.toLowerCase(),r=await this.checkAgentBoosterEligibility(e),o={simple:this.findKeywordMatches(t,d.simple),moderate:this.findKeywordMatches(t,d.moderate),complex:this.findKeywordMatches(t,d.complex),critical:this.findKeywordMatches(t,d.critical)},c=e.codeContext?e.codeContext.split(`
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.11");process.exit(0)}
2
+ import{a as h}from"./chunk-UX5SM2PW.js";import{a as C,f as x}from"./chunk-EWH7PFV6.js";var d={mechanical:["convert var to const","add types","remove console","convert to async","convert to esm","arrow function","rename variable","format code"],simple:["fix typo","update comment","fix simple bug","add documentation","format","rename","simple refactor","basic test"],moderate:["implement feature","implement","refactor","complex refactor","performance optimization","optimize","test generation","generate test","error handling","validation logic","api integration","code index","coverage analysis","quality assessment","defect prediction","predict defect","analyze coverage","analyze","assess","scan","detect"],complex:["multi-file refactor","orchestrate","coordinate","large codebase","migration","cross-domain","workflow","system design","analyze security","security scan","security analysis","vulnerability scan","chaos test","resilience test","contract validation"],critical:["architecture","security audit","critical bug","algorithm design","system-wide","vulnerability","cryptography","performance critical","hardcoded secret","cve","owasp","penetration test","exploit"]},f={architecture:/\b(architect|design|system design|overall structure|component design)\b/i,security:/\b(security|vulnerability|audit|xss|sql injection|csrf|encryption|auth|authentication|authorization)\b/i,multiStep:/\b(orchestrate|coordinate|workflow|pipeline|multi[- ]step)\b/i,crossDomain:/\b(cross[- ]domain|across (domains|modules)|integrate|coordination)\b/i},m=class{config;agentBoosterAdapter;constructor(e,t){this.config=e,this.agentBoosterAdapter=t}async collectSignals(e){let t=e.task.toLowerCase(),r=await this.checkAgentBoosterEligibility(e),o={simple:this.findKeywordMatches(t,d.simple),moderate:this.findKeywordMatches(t,d.moderate),complex:this.findKeywordMatches(t,d.complex),critical:this.findKeywordMatches(t,d.critical)},c=e.codeContext?e.codeContext.split(`
3
3
  `).length:void 0,n=e.filePaths?e.filePaths.length:void 0,i=f.architecture.test(t),a=f.security.test(t),l=f.multiStep.test(t),g=f.crossDomain.test(t),b=this.detectCreativityRequirement(t),S=this.estimateLanguageComplexity(e.codeContext,e.filePaths),T=e.codeContext?this.estimateCyclomaticComplexity(e.codeContext):void 0;return{linesOfCode:c,fileCount:n,hasArchitectureScope:i,hasSecurityScope:a,requiresMultiStepReasoning:l,requiresCrossDomainCoordination:g,isMechanicalTransform:r.eligible,languageComplexity:S,cyclomaticComplexity:T,dependencyCount:this.countDependencies(e.codeContext),requiresCreativity:b,detectedTransformType:r.transformType,keywordMatches:o}}async checkAgentBoosterEligibility(e){if(!this.config.enableAgentBooster)return{eligible:!1,confidence:0,reason:"Agent Booster is disabled"};let t=e.task.toLowerCase(),r,o=0;for(let n of h){let i=this.getTransformKeywords(n),a=0;for(let l of i)t.includes(l.toLowerCase())&&(a=a===0?.5:a+.25);for(let l of d.mechanical)t.includes(l.toLowerCase())&&(a=Math.max(a,.6));a>o&&(o=a,r=n)}if(e.codeContext&&r&&this.agentBoosterAdapter)try{let i=(await this.agentBoosterAdapter.detectTransformOpportunities(e.codeContext)).opportunities.find(a=>a.type===r);if(i)return{eligible:i.confidence>=this.config.agentBoosterThreshold,transformType:r,confidence:i.confidence,reason:i.reason}}catch(n){console.debug("[SignalCollector] WASM analysis error:",n instanceof Error?n.message:n)}let c=o>=this.config.agentBoosterThreshold&&r!==void 0;return{eligible:c,transformType:r,confidence:Math.min(o,1),reason:c?`Detected ${r} transform pattern`:"No mechanical transform pattern detected"}}findKeywordMatches(e,t){let r=[];for(let o of t)e.includes(o.toLowerCase())&&r.push(o);return r}detectCreativityRequirement(e){return e.includes("design")||e.includes("creative")||e.includes("innovative")||e.includes("novel")}estimateLanguageComplexity(e,t){if(!e&&(!t||t.length===0))return;let r=[".ts",".tsx",".rs",".cpp",".c",".go"],o=[".js",".jsx",".py",".java"],c=[".json",".yaml",".md",".txt",".css",".html"];if(t){for(let n of t)if(r.some(i=>n.endsWith(i)))return"high";for(let n of t)if(o.some(i=>n.endsWith(i)))return"medium";for(let n of t)if(c.some(i=>n.endsWith(i)))return"low"}if(e){let n=/<[A-Z][^>]*>/.test(e),i=/\b(async|await)\b/.test(e),a=/\b(interface|type|class)\b/.test(e);return n&&a?"high":i||a?"medium":"low"}return"medium"}estimateCyclomaticComplexity(e){let t=[/\bif\b/g,/\bfor\b/g,/\bwhile\b/g,/\bcase\b/g,/\bcatch\b/g,/&&/g,/\|\|/g,/\?/g],r=1;for(let o of t){let c=e.match(o);c&&(r+=c.length)}return r}countDependencies(e){if(!e)return;let t=e.match(/\b(import|require|from)\b.*['"].*['"]/g);return t?t.length:0}getTransformKeywords(e){return{"var-to-const":["var to const","convert var","var declaration","var to let","convert var to const","change var to const"],"add-types":["add types","add type","typescript types","type annotations","type annotation","add type annotations"],"remove-console":["remove console","delete console","console.log","remove console.log","strip console"],"promise-to-async":["promise to async","async await",".then to async","convert to async","convert function to async"],"cjs-to-esm":["commonjs to esm","require to import","convert to esm","cjs to esm","module conversion"],"func-to-arrow":["arrow function","function to arrow","convert to arrow","convert function to arrow"]}[e]||[]}};function v(s,e){return new m(s,e)}var u=class{calculateCodeComplexity(e){let t=0;return t+=this.calculateLinesOfCodeContribution(e.linesOfCode),t+=this.calculateFileCountContribution(e.fileCount),t+=this.calculateCyclomaticContribution(e.cyclomaticComplexity),t+=this.calculateLanguageContribution(e.languageComplexity),Math.min(t,100)}calculateReasoningComplexity(e){let t=0;return t+=this.calculateKeywordScore(e.keywordMatches),e.requiresMultiStepReasoning&&(t+=20),e.requiresCreativity&&(t+=20),Math.min(t,100)}calculateScopeComplexity(e){let t=0;return e.hasArchitectureScope&&(t+=40),e.hasSecurityScope&&(t+=30),e.requiresCrossDomainCoordination&&(t+=20),t+=this.calculateDependencyContribution(e.dependencyCount),Math.min(t,100)}calculateOverallComplexity(e,t,r,o){if(o.isMechanicalTransform&&!o.hasSecurityScope&&!o.hasArchitectureScope&&!o.requiresMultiStepReasoning&&!o.requiresCrossDomainCoordination&&e===0&&t===0&&r===0)return 5;let c=e*.3+t*.4+r*.3,n=0;return o.hasSecurityScope&&(n=Math.max(n,50)),o.hasArchitectureScope&&(n=Math.max(n,55)),o.requiresCrossDomainCoordination&&(n=Math.max(n,35)),o.requiresMultiStepReasoning&&(n=Math.max(n,30)),o.keywordMatches.simple.length+o.keywordMatches.moderate.length+o.keywordMatches.complex.length+o.keywordMatches.critical.length===0&&!o.isMechanicalTransform&&c<15&&(n=Math.max(n,15)),Math.min(Math.max(Math.round(c),n),100)}calculateConfidence(e,t){let r=.5;return t.codeContext&&(r+=.2),t.filePaths&&t.filePaths.length>0&&(r+=.1),r+=this.calculateKeywordConfidenceBoost(e.keywordMatches),e.isMechanicalTransform&&(r+=.15),Math.min(r,1)}calculateLinesOfCodeContribution(e){return e===void 0||e<10?0:e<50?10:e<200?20:30}calculateFileCountContribution(e){return e===void 0||e===1?0:e<5?10:20}calculateCyclomaticContribution(e){return e===void 0||e<5?0:e<10?10:e<20?20:30}calculateLanguageContribution(e){return e==="low"?0:e==="medium"?10:e==="high"?20:0}calculateKeywordScore(e){let t=e.simple.length*5+e.moderate.length*15+e.complex.length*25+e.critical.length*35;return Math.min(t,60)}calculateDependencyContribution(e){return e===void 0||e<3?0:e<10?5:10}calculateKeywordConfidenceBoost(e){let t=e.simple.length+e.moderate.length+e.complex.length+e.critical.length;return t>=3?.1:t>=1?.05:0}};function M(){return new u}var p=class{getRecommendedTier(e){for(let t of[0,1,2,3,4]){let[r,o]=C[t].complexityRange;if(e>=r&&e<=o)return t}return 2}findAlternateTiers(e,t){let r=[];return t>0&&r.push(t-1),t<4&&r.push(t+1),t<3&&!r.includes(4)&&r.push(4),r}generateExplanation(e,t,r){let o=[];return o.push(`Complexity score: ${e}/100 (Tier ${t})`),r.isMechanicalTransform&&o.push(this.formatMechanicalTransformInfo(r.detectedTransformType)),o.push(...this.formatScopeExplanations(r)),o.push(...this.formatCodeMetricsExplanations(r)),o.join(". ")}formatMechanicalTransformInfo(e){return`Detected mechanical transform: ${e}`}formatScopeExplanations(e){let t=[];return e.hasArchitectureScope&&t.push("Architecture scope detected"),e.hasSecurityScope&&t.push("Security scope detected"),e.requiresMultiStepReasoning&&t.push("Multi-step reasoning required"),e.requiresCrossDomainCoordination&&t.push("Cross-domain coordination required"),t}formatCodeMetricsExplanations(e){let t=[];return e.linesOfCode!==void 0&&e.linesOfCode>100&&t.push(`Large code change: ${e.linesOfCode} lines`),e.fileCount!==void 0&&e.fileCount>3&&t.push(`Multi-file change: ${e.fileCount} files`),t}};function w(){return new p}var y=class{config;signalCollector;scoreCalculator;tierRecommender;constructor(e,t,r,o){this.config=e,this.signalCollector=t,this.scoreCalculator=r,this.tierRecommender=o}async analyze(e){try{let t=await this.signalCollector.collectSignals(e),r=this.scoreCalculator.calculateCodeComplexity(t),o=this.scoreCalculator.calculateReasoningComplexity(t),c=this.scoreCalculator.calculateScopeComplexity(t),n=this.scoreCalculator.calculateOverallComplexity(r,o,c,t),i=this.tierRecommender.getRecommendedTier(n),a=this.tierRecommender.findAlternateTiers(n,i),l=this.scoreCalculator.calculateConfidence(t,e),g=this.tierRecommender.generateExplanation(n,i,t);return{overall:n,codeComplexity:r,reasoningComplexity:o,scopeComplexity:c,confidence:l,signals:t,recommendedTier:i,alternateTiers:a,explanation:g}}catch(t){throw new x(`Failed to analyze task complexity: ${t instanceof Error?t.message:"Unknown error"}`,t instanceof Error?t:void 0)}}async checkAgentBoosterEligibility(e){return this.signalCollector.checkAgentBoosterEligibility(e)}getRecommendedTier(e){return this.tierRecommender.getRecommendedTier(e)}};function L(s,e){let t=new m(s,e),r=new u,o=new p;return new y(s,t,r,o)}function z(s,e,t,r){return new y(s,e,t,r)}export{m as a,v as b,u as c,M as d,p as e,w as f,y as g,L as h,z as i};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.9");process.exit(0)}
2
- import{b as d,d as L}from"./chunk-UNAAAXI2.js";import{createHash as m}from"crypto";import{existsSync as g,readFileSync as R,writeFileSync as A,openSync as X,writeSync as U,closeSync as f}from"fs";var p=[`CREATE TABLE IF NOT EXISTS qe_patterns (
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.11");process.exit(0)}
2
+ import{b as d,d as L}from"./chunk-2Y3PW5EJ.js";import{createHash as m}from"crypto";import{existsSync as g,readFileSync as R,writeFileSync as A,openSync as X,writeSync as U,closeSync as f}from"fs";var p=[`CREATE TABLE IF NOT EXISTS qe_patterns (
3
3
  id TEXT PRIMARY KEY, pattern_type TEXT NOT NULL, qe_domain TEXT NOT NULL,
4
4
  domain TEXT NOT NULL, name TEXT NOT NULL, description TEXT,
5
5
  confidence REAL DEFAULT 0.5, usage_count INTEGER DEFAULT 0,
@@ -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.9");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.11");process.exit(0)}
2
2
  var l=class m{vertices=new Map;edges=new Map;adjacencyList=new Map;totalWeight=0;addVertex(e){if(this.vertices.has(e.id)){this.vertices.set(e.id,e);return}this.vertices.set(e.id,e),this.adjacencyList.set(e.id,[])}removeVertex(e){if(!this.vertices.has(e))return!1;let t=this.adjacencyList.get(e)||[];for(let r of t)this.removeEdge(e,r.neighborId);for(let[,r]of this.adjacencyList){let n=r.findIndex(i=>i.neighborId===e);n!==-1&&(this.totalWeight-=r[n].weight,r.splice(n,1))}return this.vertices.delete(e),this.adjacencyList.delete(e),!0}getVertex(e){return this.vertices.get(e)}hasVertex(e){return this.vertices.has(e)}getVertices(){return Array.from(this.vertices.values())}getVertexIds(){return Array.from(this.vertices.keys())}getVerticesByDomain(e){return this.getVertices().filter(t=>t.domain===e)}getVerticesByType(e){return this.getVertices().filter(t=>t.type===e)}addEdge(e){if(!this.vertices.has(e.source))throw new Error(`Source vertex ${e.source} does not exist`);if(!this.vertices.has(e.target))throw new Error(`Target vertex ${e.target} does not exist`);let t=this.edgeKey(e.source,e.target);if(this.edges.has(t)){let r=this.edges.get(t);this.totalWeight-=r.weight,this.removeFromAdjacency(e.source,e.target),r.bidirectional&&this.removeFromAdjacency(e.target,e.source)}this.edges.set(t,e),this.totalWeight+=e.weight,this.addToAdjacency(e.source,e.target,e.weight,e),e.bidirectional&&this.addToAdjacency(e.target,e.source,e.weight,e)}removeEdge(e,t){let r=this.edgeKey(e,t),n=this.edges.get(r);return n?(this.totalWeight-=n.weight,this.edges.delete(r),this.removeFromAdjacency(e,t),n.bidirectional&&this.removeFromAdjacency(t,e),!0):!1}getEdge(e,t){return this.edges.get(this.edgeKey(e,t))}hasEdge(e,t){return this.edges.has(this.edgeKey(e,t))}getEdges(){return Array.from(this.edges.values())}getEdgesForVertex(e){return(this.adjacencyList.get(e)||[]).map(r=>r.edge)}degree(e){return this.adjacencyList.get(e)?.length||0}weightedDegree(e){let t=this.adjacencyList.get(e);return t?t.reduce((r,n)=>r+n.weight,0):0}neighbors(e){return(this.adjacencyList.get(e)||[]).map(r=>({vertex:this.vertices.get(r.neighborId),weight:r.weight})).filter(r=>r.vertex!==void 0)}neighborIds(e){return(this.adjacencyList.get(e)||[]).map(r=>r.neighborId)}getStats(){let e=this.vertices.size,t=this.edges.size,r=0;for(let[,s]of this.adjacencyList)r+=s.length;let n=e>0?r/e:0,i=e>1?e*(e-1)/2:0,a=i>0?t/i:0,o=this.countConnectedComponents(),c=o===1&&e>0;return{vertexCount:e,edgeCount:t,totalWeight:this.totalWeight,averageDegree:n,density:a,isConnected:c,componentCount:o}}countConnectedComponents(){let e=new Set,t=0;for(let r of this.vertices.keys())e.has(r)||(this.dfs(r,e),t++);return t}dfs(e,t){t.add(e);let r=this.adjacencyList.get(e)||[];for(let n of r)t.has(n.neighborId)||this.dfs(n.neighborId,t)}isConnected(){if(this.vertices.size===0||this.vertices.size===1)return!0;let e=new Set,t=this.vertices.keys().next().value;return t===void 0?!0:(this.dfs(t,e),e.size===this.vertices.size)}getConnectedComponent(e){if(!this.vertices.has(e))return[];let t=new Set;return this.dfs(e,t),Array.from(t)}snapshot(){return{timestamp:new Date,vertices:this.getVertices(),edges:this.getEdges(),stats:this.getStats()}}clone(){let e=new m;for(let t of this.vertices.values())e.addVertex({...t});for(let t of this.edges.values())e.addEdge({...t});return e}static fromSnapshot(e){let t=new m;for(let r of e.vertices)t.addVertex(r);for(let r of e.edges)t.addEdge(r);return t}clear(){this.vertices.clear(),this.edges.clear(),this.adjacencyList.clear(),this.totalWeight=0}get vertexCount(){return this.vertices.size}get edgeCount(){return this.edges.size}isEmpty(){return this.vertices.size===0}edgeKey(e,t){return e<t?`${e}:${t}`:`${t}:${e}`}addToAdjacency(e,t,r,n){let i=this.adjacencyList.get(e);i&&(i.find(o=>o.neighborId===t)||i.push({neighborId:t,weight:r,edge:n}))}removeFromAdjacency(e,t){let r=this.adjacencyList.get(e);if(r){let n=r.findIndex(i=>i.neighborId===t);n!==-1&&r.splice(n,1)}}};function p(){return new l}var f=class{approxMinCut(e){let t=Date.now();if(e.isEmpty())return this.emptyResult(t,"weighted-degree");let r=e.getVertexIds(),n=1/0,i=null;for(let o of r){let c=e.weightedDegree(o);c<n&&(n=c,i=o)}if(i===null||r.length===1)return this.emptyResult(t,"weighted-degree");let a=e.getEdgesForVertex(i);return{value:n,sourceSide:[i],targetSide:r.filter(o=>o!==i),cutEdges:a,calculatedAt:new Date,algorithm:"weighted-degree",durationMs:Date.now()-t}}findWeakVertices(e,t){if(e.isEmpty())return[];let r=e.getVertices(),n=[],i=new Map,a=0;for(let g of r){let h=e.weightedDegree(g.id);i.set(g.id,h),a+=h}let o=a/r.length,c=0;for(let g of i.values())c+=(g-o)**2;let s=Math.sqrt(c/r.length),d=1/0;for(let g of i.values())g<d&&(d=g);let u=t??o-s;for(let g of r){let h=i.get(g.id);if(h<=u){let w=this.calculateRiskScore(h,o,s,d),y=this.determineWeakReason(g,h,o,e),v=this.generateStrengtheningActions(g,e,h);n.push({vertexId:g.id,vertex:g,weightedDegree:h,riskScore:w,reason:y,suggestions:v})}}return n.sort((g,h)=>h.riskScore-g.riskScore),n}getMinCutValue(e){if(e.isEmpty())return 0;let t=1/0;for(let r of e.getVertexIds()){let n=e.weightedDegree(r);n<t&&(t=n)}return t===1/0?0:t}isConnectivityCritical(e,t){return this.getMinCutValue(e)<t}getMinDegreeVertex(e){if(e.isEmpty())return null;let t=1/0,r=null;for(let n of e.getVertexIds()){let i=e.weightedDegree(n);i<t&&(t=i,r=n)}return r?{vertexId:r,degree:t}:null}getLocalMinCut(e,t){return e.hasVertex(t)?e.weightedDegree(t):0}findPartitioningPoints(e){if(e.isEmpty()||e.vertexCount<2)return[];let t=this.findArticulationPoints(e),r=[];for(let n of e.getVertices()){let i=this.getLocalMinCut(e,n.id);r.push({vertexId:n.id,localMinCut:i,wouldDisconnect:t.has(n.id)&&e.vertexCount>2})}return r.sort((n,i)=>n.localMinCut-i.localMinCut),r}findArticulationPoints(e){let t=new Map,r=new Map,n=new Map,i=new Set,a=0,o=e.getVertexIds();for(let s of o)t.set(s,-1),r.set(s,-1),n.set(s,null);let c=s=>{let d=0;t.set(s,a),r.set(s,a),a++;for(let u of e.neighborIds(s))t.get(u)===-1?(d++,n.set(u,s),c(u),r.set(s,Math.min(r.get(s),r.get(u))),n.get(s)===null&&d>1&&i.add(s),n.get(s)!==null&&r.get(u)>=t.get(s)&&i.add(s)):u!==n.get(s)&&r.set(s,Math.min(r.get(s),t.get(u)))};for(let s of o)t.get(s)===-1&&c(s);return i}suggestEdgeAdditions(e,t){let r=this.findWeakVertices(e),n=[],i=0,a=e.getVertices().map(o=>({vertex:o,degree:e.weightedDegree(o.id)})).sort((o,c)=>c.degree-o.degree);for(let o of r){if(i>=t)break;let c=new Set(e.neighborIds(o.vertexId));for(let{vertex:s}of a){if(s.id===o.vertexId||c.has(s.id))continue;let d={source:o.vertexId,target:s.id,weight:1,type:"coordination",bidirectional:!0};n.push(d),i+=1;break}}return n}emptyResult(e,t){return{value:0,sourceSide:[],targetSide:[],cutEdges:[],calculatedAt:new Date,algorithm:t,durationMs:Date.now()-e}}calculateRiskScore(e,t,r,n){if(r===0)return .5;let i=(t-e)/r,a=1/(1+Math.exp(-i)),o=n>0?n/e:1;return Math.min(1,a*o)}determineWeakReason(e,t,r,n){return t===0?"Isolated vertex with no connections":n.degree(e.id)===1?"Single connection point (leaf node)":t<r*.5?`Low connectivity (${(t/r*100).toFixed(0)}% of average)`:"Below average connectivity threshold"}generateStrengtheningActions(e,t,r){let n=[],i=new Set(t.neighborIds(e.id)),a=t.getStats().averageDegree,o=Math.max(a,3),c=Math.ceil(o-r),s=t.getVertices().filter(d=>d.id!==e.id&&!i.has(d.id)).sort((d,u)=>t.weightedDegree(u.id)-t.weightedDegree(d.id)).slice(0,c);for(let d of s)n.push({type:"add_edge",targetVertex:d.id,priority:"high",estimatedImprovement:1});return e.type==="agent"&&e.domain&&r<1&&n.push({type:"spawn_agent",domain:e.domain,priority:"critical",estimatedImprovement:2}),i.size>0&&i.size<3&&n.push({type:"increase_weight",weightDelta:.5,priority:"medium",estimatedImprovement:.5*i.size}),n}};function x(){return new f}export{l as a,p as b,f as c,x as d};
@@ -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.9");process.exit(0)}
2
- import{c as s}from"./chunk-HZLDCCUG.js";function A(r=l,o=process.env){let t=o.AQE_OLLAMA_URL??o.OLLAMA_URL??r,e=t.length;for(;e>0&&t.charCodeAt(e-1)===47;)e-=1;return t.slice(0,e)}var l,n=s(()=>{"use strict";l="http://localhost:11434"});export{A as a,n 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.11");process.exit(0)}
2
+ import{c as s}from"./chunk-LUAXQB57.js";function A(r=l,o=process.env){let t=o.AQE_OLLAMA_URL??o.OLLAMA_URL??r,e=t.length;for(;e>0&&t.charCodeAt(e-1)===47;)e-=1;return t.slice(0,e)}var l,n=s(()=>{"use strict";l="http://localhost:11434"});export{A as a,n 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.9");process.exit(0)}
2
- import{S as f,b as p}from"./chunk-MTDKYFTA.js";f();var y={predictionWindowSize:10,compressionThreshold:.3,maxConcurrentStreams:8,oscillationFrequencyMs:100};function d(s){try{return JSON.stringify(s).length}catch{return 0}}function w(s,t){let e={},n=!1;for(let r of Object.keys(t))JSON.stringify(s[r])!==JSON.stringify(t[r])&&(e[r]=t[r],n=!0);for(let r of Object.keys(s))r in t||(e[r]=void 0,n=!0);return n?e:null}function v(s,t){let e={...s};for(let[n,r]of Object.entries(t))r===void 0?delete e[n]:e[n]=r;return e}var l=class{windowSize;windows=new Map;constructor(t){this.windowSize=Math.max(1,t)}predict(t){let e=this.windows.get(t);if(!e||e.length===0)return null;let n=e[e.length-1];return typeof n!="object"||n===null||Array.isArray(n)?null:{...n}}record(t,e){let n=this.windows.get(t);n||(n=[],this.windows.set(t,n)),n.push(e),n.length>this.windowSize&&n.shift()}removeStream(t){this.windows.delete(t)}},h=class{maxStreams;cycleMs;streamIds=[];currentIndex=0;constructor(t,e){this.maxStreams=Math.max(1,t),this.cycleMs=Math.max(1,e)}addStream(t){return this.streamIds.includes(t)||this.streamIds.length>=this.maxStreams?!1:(this.streamIds.push(t),!0)}removeStream(t){let e=this.streamIds.indexOf(t);return e===-1?!1:(this.streamIds.splice(e,1),this.currentIndex>=this.streamIds.length&&(this.currentIndex=0),!0)}nextStream(){if(this.streamIds.length===0)return null;let t=this.streamIds[this.currentIndex];return this.currentIndex=(this.currentIndex+1)%this.streamIds.length,t}getActiveStreams(){return[...this.streamIds]}get activeCount(){return this.streamIds.length}},g=class{config;predictor;router;lastPayloads=new Map;totalMessages=0;compressedMessages=0;totalOriginalBytes=0;totalCompressedBytes=0;constructor(t){this.config={...y,...t},this.predictor=new l(this.config.predictionWindowSize),this.router=new h(this.config.maxConcurrentStreams,this.config.oscillationFrequencyMs)}send(t,e,n,r){this.totalMessages++;let i=d(r);this.totalOriginalBytes+=i;let c=!1,o=r,a=i;if(typeof r=="object"&&r!==null&&!Array.isArray(r)){let m=this.predictor.predict(t);if(m){let u=w(m,r);u?1-d(u)/Math.max(i,1)>=this.config.compressionThreshold&&(o={__delta:!0,__changes:u},a=d(o),c=!0,this.compressedMessages++):(o={__delta:!0,__changes:{}},a=d(o),c=!0,this.compressedMessages++)}}return this.totalCompressedBytes+=a,this.predictor.record(t,r),this.lastPayloads.set(t,r),{streamId:t,senderId:e,receiverId:n,payload:o,compressed:c,originalSize:i,compressedSize:a,timestamp:Date.now()}}receive(t){if(!t.compressed||typeof t.payload!="object"||t.payload===null)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let e=t.payload;if(!e.__delta)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let n=this.predictor.predict(t.streamId),r=e.__changes??{};if(!n)return r;let i=v(n,r);return this.predictor.record(t.streamId,i),this.lastPayloads.set(t.streamId,i),i}getStats(){let t=this.totalOriginalBytes-this.totalCompressedBytes;return{totalMessages:this.totalMessages,compressedMessages:this.compressedMessages,bandwidthSavedBytes:Math.max(0,t),bandwidthReductionPercent:this.totalOriginalBytes>0?Math.max(0,t)/this.totalOriginalBytes*100:0,activeStreams:this.router.activeCount}}addStream(t){this.router.addStream(t)}removeStream(t){this.router.removeStream(t),this.predictor.removeStream(t),this.lastPayloads.delete(t)}};function M(s){return S()?new g(s):null}function S(){return p().useCognitiveRouting}export{M as a,S 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.11");process.exit(0)}
2
+ import{S as f,b as p}from"./chunk-NHL37QAZ.js";f();var y={predictionWindowSize:10,compressionThreshold:.3,maxConcurrentStreams:8,oscillationFrequencyMs:100};function d(s){try{return JSON.stringify(s).length}catch{return 0}}function w(s,t){let e={},n=!1;for(let r of Object.keys(t))JSON.stringify(s[r])!==JSON.stringify(t[r])&&(e[r]=t[r],n=!0);for(let r of Object.keys(s))r in t||(e[r]=void 0,n=!0);return n?e:null}function v(s,t){let e={...s};for(let[n,r]of Object.entries(t))r===void 0?delete e[n]:e[n]=r;return e}var l=class{windowSize;windows=new Map;constructor(t){this.windowSize=Math.max(1,t)}predict(t){let e=this.windows.get(t);if(!e||e.length===0)return null;let n=e[e.length-1];return typeof n!="object"||n===null||Array.isArray(n)?null:{...n}}record(t,e){let n=this.windows.get(t);n||(n=[],this.windows.set(t,n)),n.push(e),n.length>this.windowSize&&n.shift()}removeStream(t){this.windows.delete(t)}},h=class{maxStreams;cycleMs;streamIds=[];currentIndex=0;constructor(t,e){this.maxStreams=Math.max(1,t),this.cycleMs=Math.max(1,e)}addStream(t){return this.streamIds.includes(t)||this.streamIds.length>=this.maxStreams?!1:(this.streamIds.push(t),!0)}removeStream(t){let e=this.streamIds.indexOf(t);return e===-1?!1:(this.streamIds.splice(e,1),this.currentIndex>=this.streamIds.length&&(this.currentIndex=0),!0)}nextStream(){if(this.streamIds.length===0)return null;let t=this.streamIds[this.currentIndex];return this.currentIndex=(this.currentIndex+1)%this.streamIds.length,t}getActiveStreams(){return[...this.streamIds]}get activeCount(){return this.streamIds.length}},g=class{config;predictor;router;lastPayloads=new Map;totalMessages=0;compressedMessages=0;totalOriginalBytes=0;totalCompressedBytes=0;constructor(t){this.config={...y,...t},this.predictor=new l(this.config.predictionWindowSize),this.router=new h(this.config.maxConcurrentStreams,this.config.oscillationFrequencyMs)}send(t,e,n,r){this.totalMessages++;let i=d(r);this.totalOriginalBytes+=i;let c=!1,o=r,a=i;if(typeof r=="object"&&r!==null&&!Array.isArray(r)){let m=this.predictor.predict(t);if(m){let u=w(m,r);u?1-d(u)/Math.max(i,1)>=this.config.compressionThreshold&&(o={__delta:!0,__changes:u},a=d(o),c=!0,this.compressedMessages++):(o={__delta:!0,__changes:{}},a=d(o),c=!0,this.compressedMessages++)}}return this.totalCompressedBytes+=a,this.predictor.record(t,r),this.lastPayloads.set(t,r),{streamId:t,senderId:e,receiverId:n,payload:o,compressed:c,originalSize:i,compressedSize:a,timestamp:Date.now()}}receive(t){if(!t.compressed||typeof t.payload!="object"||t.payload===null)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let e=t.payload;if(!e.__delta)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let n=this.predictor.predict(t.streamId),r=e.__changes??{};if(!n)return r;let i=v(n,r);return this.predictor.record(t.streamId,i),this.lastPayloads.set(t.streamId,i),i}getStats(){let t=this.totalOriginalBytes-this.totalCompressedBytes;return{totalMessages:this.totalMessages,compressedMessages:this.compressedMessages,bandwidthSavedBytes:Math.max(0,t),bandwidthReductionPercent:this.totalOriginalBytes>0?Math.max(0,t)/this.totalOriginalBytes*100:0,activeStreams:this.router.activeCount}}addStream(t){this.router.addStream(t)}removeStream(t){this.router.removeStream(t),this.predictor.removeStream(t),this.lastPayloads.delete(t)}};function M(s){return S()?new g(s):null}function S(){return p().useCognitiveRouting}export{M as a,S 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.9");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.11");process.exit(0)}
2
2
  var N="ffffffff-ffff-ffff-ffff-ffffffffffff";var _="00000000-0000-0000-0000-000000000000";var y=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function k(r){return typeof r=="string"&&y.test(r)}var u=k;function q(r){if(!u(r))throw TypeError("Invalid UUID");let n;return Uint8Array.of((n=parseInt(r.slice(0,8),16))>>>24,n>>>16&255,n>>>8&255,n&255,(n=parseInt(r.slice(9,13),16))>>>8,n&255,(n=parseInt(r.slice(14,18),16))>>>8,n&255,(n=parseInt(r.slice(19,23),16))>>>8,n&255,(n=parseInt(r.slice(24,36),16))/1099511627776&255,n/4294967296&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255)}var c=q;var x=[];for(let r=0;r<256;++r)x.push((r+256).toString(16).slice(1));function l(r,n=0){return(x[r[n+0]]+x[r[n+1]]+x[r[n+2]]+x[r[n+3]]+"-"+x[r[n+4]]+x[r[n+5]]+"-"+x[r[n+6]]+x[r[n+7]]+"-"+x[r[n+8]]+x[r[n+9]]+"-"+x[r[n+10]]+x[r[n+11]]+x[r[n+12]]+x[r[n+13]]+x[r[n+14]]+x[r[n+15]]).toLowerCase()}function C(r,n=0){let f=l(r,n);if(!u(f))throw TypeError("Stringified UUID is invalid");return f}var H=C;var v=new Uint8Array(16);function m(){return crypto.getRandomValues(v)}var g={};function X(r,n,f){let e,o=r?._v6??!1;if(r){let t=Object.keys(r);t.length===1&&t[0]==="_v6"&&(r=void 0)}if(r)e=E(r.random??r.rng?.()??m(),r.msecs,r.nsecs,r.clockseq,r.node,n,f);else{let t=Date.now(),i=m();j(g,t,i),e=E(i,g.msecs,g.nsecs,o?void 0:g.clockseq,o?void 0:g.node,n,f)}return n??l(e)}function j(r,n,f){return r.msecs??=-1/0,r.nsecs??=0,n===r.msecs?(r.nsecs++,r.nsecs>=1e4&&(r.node=void 0,r.nsecs=0)):n>r.msecs?r.nsecs=0:n<r.msecs&&(r.node=void 0),r.node||(r.node=f.slice(10,16),r.node[0]|=1,r.clockseq=(f[8]<<8|f[9])&16383),r.msecs=n,r}function E(r,n,f,e,o,t,i=0){if(r.length<16)throw new Error("Random bytes length must be >= 16");if(!t)t=new Uint8Array(16),i=0;else if(i<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);n??=Date.now(),f??=0,e??=(r[8]<<8|r[9])&16383,o??=r.slice(10,16),n+=122192928e5;let d=((n&268435455)*1e4+f)%4294967296;t[i++]=d>>>24&255,t[i++]=d>>>16&255,t[i++]=d>>>8&255,t[i++]=d&255;let a=n/4294967296*1e4&268435455;t[i++]=a>>>8&255,t[i++]=a&255,t[i++]=a>>>24&15|16,t[i++]=a>>>16&255,t[i++]=e>>>8|128,t[i++]=e&255;for(let p=0;p<6;++p)t[i++]=o[p];return t}var D=X;function U(r){let n=typeof r=="string"?c(r):r,f=G(n);return typeof r=="string"?l(f):f}function G(r){return Uint8Array.of((r[6]&15)<<4|r[7]>>4&15,(r[7]&15)<<4|(r[4]&240)>>4,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,(r[1]&15)<<4|(r[2]&240)>>4,96|r[2]&15,r[3],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}import{createHash as K}from"node:crypto";function M(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),K("md5").update(r).digest()}var T=M;function O(r){r=unescape(encodeURIComponent(r));let n=new Uint8Array(r.length);for(let f=0;f<r.length;++f)n[f]=r.charCodeAt(f);return n}var w="6ba7b810-9dad-11d1-80b4-00c04fd430c8",I="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function h(r,n,f,e,o,t){let i=typeof f=="string"?O(f):f,d=typeof e=="string"?c(e):e;if(typeof e=="string"&&(e=c(e)),e?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+i.length);if(a.set(d),a.set(i,d.length),a=n(a),a[6]=a[6]&15|r,a[8]=a[8]&63|128,o){if(t??=0,t<0||t+16>o.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let p=0;p<16;++p)o[t+p]=a[p];return o}return l(a)}function S(r,n,f,e){return h(48,T,r,n,f,e)}S.DNS=w;S.URL=I;var z=S;function F(r,n,f){return!n&&!r&&crypto.randomUUID?crypto.randomUUID():J(r,n,f)}function J(r,n,f){r=r||{};let e=r.random??r.rng?.()??m();if(e.length<16)throw new Error("Random bytes length must be >= 16");if(e[6]=e[6]&15|64,e[8]=e[8]&63|128,n){if(f=f||0,f<0||f+16>n.length)throw new RangeError(`UUID byte range ${f}:${f+15} is out of buffer bounds`);for(let o=0;o<16;++o)n[f+o]=e[o];return n}return l(e)}var P=F;import{createHash as Q}from"node:crypto";function W(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),Q("sha1").update(r).digest()}var V=W;function R(r,n,f,e){return h(80,V,r,n,f,e)}R.DNS=w;R.URL=I;var Y=R;function Z(r,n,f){r??={},f??=0;let e=D({...r,_v6:!0},new Uint8Array(16));if(e=U(e),n){if(f<0||f+16>n.length)throw new RangeError(`UUID byte range ${f}:${f+15} is out of buffer bounds`);for(let o=0;o<16;o++)n[f+o]=e[o];return n}return l(e)}var s=Z;function $(r){let n=typeof r=="string"?c(r):r,f=b(n);return typeof r=="string"?l(f):f}function b(r){return Uint8Array.of((r[3]&15)<<4|r[4]>>4&15,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|r[6]&15,r[7],(r[1]&15)<<4|(r[2]&240)>>4,(r[2]&15)<<4|(r[3]&240)>>4,16|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}var A={};function B(r,n,f){let e;if(r)e=L(r.random??r.rng?.()??m(),r.msecs,r.seq,n,f);else{let o=Date.now(),t=m();r0(A,o,t),e=L(t,A.msecs,A.seq,n,f)}return n??l(e)}function r0(r,n,f){return r.msecs??=-1/0,r.seq??=0,n>r.msecs?(r.seq=f[6]<<23|f[7]<<16|f[8]<<8|f[9],r.msecs=n):(r.seq=r.seq+1|0,r.seq===0&&r.msecs++),r}function L(r,n,f,e,o=0){if(r.length<16)throw new Error("Random bytes length must be >= 16");if(!e)e=new Uint8Array(16),o=0;else if(o<0||o+16>e.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return n??=Date.now(),f??=r[6]*127<<24|r[7]<<16|r[8]<<8|r[9],e[o++]=n/1099511627776&255,e[o++]=n/4294967296&255,e[o++]=n/16777216&255,e[o++]=n/65536&255,e[o++]=n/256&255,e[o++]=n&255,e[o++]=112|f>>>28&15,e[o++]=f>>>20&255,e[o++]=128|f>>>14&63,e[o++]=f>>>6&255,e[o++]=f<<2&255|r[10]&3,e[o++]=r[11],e[o++]=r[12],e[o++]=r[13],e[o++]=r[14],e[o++]=r[15],e}var n0=B;function f0(r){if(!u(r))throw TypeError("Invalid UUID");return parseInt(r.slice(14,15),16)}var e0=f0;export{N as a,_ as b,u as c,c as d,H as e,D as f,U as g,z as h,P as i,Y as j,s as k,$ as l,n0 as m,e0 as n};
@@ -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.9");process.exit(0)}
2
- import{c as t,e as o}from"./chunk-HZLDCCUG.js";var L={};o(L,{DotProductAttention:()=>d,FlashAttention:()=>m,HyperbolicAttention:()=>f,LinearAttention:()=>h,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>g,TensorCompress:()=>c,default:()=>i,differentiableSearch:()=>l,getCompressionLevel:()=>s,hierarchicalForward:()=>p,init:()=>u,pipeline:()=>v});import{createRequire as n}from"module";var r,e,i,a,c,l,p,s,u,m,d,A,f,h,_,g,v,b=t(()=>{r=n(import.meta.url),e=r("@ruvector/gnn"),i=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:p,getCompressionLevel:s,init:u,FlashAttention:m,DotProductAttention:d,MultiHeadAttention:A,HyperbolicAttention:f,LinearAttention:h,MoEAttention:_,SonaEngine:g,pipeline:v}=e||{}});export{L 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.11");process.exit(0)}
2
+ import{c as t,e as o}from"./chunk-LUAXQB57.js";var L={};o(L,{DotProductAttention:()=>d,FlashAttention:()=>m,HyperbolicAttention:()=>f,LinearAttention:()=>h,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>g,TensorCompress:()=>c,default:()=>i,differentiableSearch:()=>l,getCompressionLevel:()=>s,hierarchicalForward:()=>p,init:()=>u,pipeline:()=>v});import{createRequire as n}from"module";var r,e,i,a,c,l,p,s,u,m,d,A,f,h,_,g,v,b=t(()=>{r=n(import.meta.url),e=r("@ruvector/gnn"),i=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:p,getCompressionLevel:s,init:u,FlashAttention:m,DotProductAttention:d,MultiHeadAttention:A,HyperbolicAttention:f,LinearAttention:h,MoEAttention:_,SonaEngine:g,pipeline:v}=e||{}});export{L as a,b};