agentic-qe 3.10.5 → 3.10.6

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 (434) hide show
  1. package/.claude/agents/v3/qe-accessibility-auditor.md +8 -0
  2. package/.claude/agents/v3/qe-bdd-generator.md +8 -0
  3. package/.claude/agents/v3/qe-chaos-engineer.md +8 -0
  4. package/.claude/agents/v3/qe-code-complexity.md +8 -0
  5. package/.claude/agents/v3/qe-code-intelligence.md +8 -0
  6. package/.claude/agents/v3/qe-contract-validator.md +8 -0
  7. package/.claude/agents/v3/qe-coverage-specialist.md +8 -0
  8. package/.claude/agents/v3/qe-defect-predictor.md +8 -0
  9. package/.claude/agents/v3/qe-dependency-mapper.md +8 -0
  10. package/.claude/agents/v3/qe-deployment-advisor.md +8 -0
  11. package/.claude/agents/v3/qe-devils-advocate.md +8 -0
  12. package/.claude/agents/v3/qe-flaky-hunter.md +8 -0
  13. package/.claude/agents/v3/qe-fleet-commander.md +8 -0
  14. package/.claude/agents/v3/qe-gap-detector.md +8 -0
  15. package/.claude/agents/v3/qe-graphql-tester.md +8 -0
  16. package/.claude/agents/v3/qe-impact-analyzer.md +8 -0
  17. package/.claude/agents/v3/qe-integration-tester.md +8 -0
  18. package/.claude/agents/v3/qe-kg-builder.md +8 -0
  19. package/.claude/agents/v3/qe-learning-coordinator.md +8 -0
  20. package/.claude/agents/v3/qe-load-tester.md +8 -0
  21. package/.claude/agents/v3/qe-message-broker-tester.md +8 -0
  22. package/.claude/agents/v3/qe-metrics-optimizer.md +8 -0
  23. package/.claude/agents/v3/qe-middleware-validator.md +8 -0
  24. package/.claude/agents/v3/qe-mutation-tester.md +8 -0
  25. package/.claude/agents/v3/qe-odata-contract-tester.md +8 -0
  26. package/.claude/agents/v3/qe-parallel-executor.md +8 -0
  27. package/.claude/agents/v3/qe-pattern-learner.md +8 -0
  28. package/.claude/agents/v3/qe-pentest-validator.md +8 -0
  29. package/.claude/agents/v3/qe-performance-tester.md +8 -0
  30. package/.claude/agents/v3/qe-product-factors-assessor.md +8 -0
  31. package/.claude/agents/v3/qe-property-tester.md +8 -0
  32. package/.claude/agents/v3/qe-quality-criteria-recommender.md +8 -0
  33. package/.claude/agents/v3/qe-quality-gate.md +8 -0
  34. package/.claude/agents/v3/qe-qx-partner.md +8 -0
  35. package/.claude/agents/v3/qe-regression-analyzer.md +8 -0
  36. package/.claude/agents/v3/qe-requirements-validator.md +8 -0
  37. package/.claude/agents/v3/qe-responsive-tester.md +8 -0
  38. package/.claude/agents/v3/qe-retry-handler.md +8 -0
  39. package/.claude/agents/v3/qe-risk-assessor.md +8 -0
  40. package/.claude/agents/v3/qe-root-cause-analyzer.md +8 -0
  41. package/.claude/agents/v3/qe-sap-idoc-tester.md +8 -0
  42. package/.claude/agents/v3/qe-sap-rfc-tester.md +8 -0
  43. package/.claude/agents/v3/qe-security-auditor.md +8 -0
  44. package/.claude/agents/v3/qe-security-scanner.md +8 -0
  45. package/.claude/agents/v3/qe-soap-tester.md +8 -0
  46. package/.claude/agents/v3/qe-sod-analyzer.md +8 -0
  47. package/.claude/agents/v3/qe-tdd-specialist.md +8 -0
  48. package/.claude/agents/v3/qe-test-architect.md +8 -0
  49. package/.claude/agents/v3/qe-test-idea-rewriter.md +8 -0
  50. package/.claude/agents/v3/qe-transfer-specialist.md +8 -0
  51. package/.claude/agents/v3/qe-visual-tester.md +8 -0
  52. package/.claude/skills/skills-manifest.json +1 -1
  53. package/CHANGELOG.md +9012 -8934
  54. package/assets/agents/v3/qe-accessibility-auditor.md +8 -0
  55. package/assets/agents/v3/qe-bdd-generator.md +8 -0
  56. package/assets/agents/v3/qe-chaos-engineer.md +8 -0
  57. package/assets/agents/v3/qe-code-complexity.md +8 -0
  58. package/assets/agents/v3/qe-code-intelligence.md +8 -0
  59. package/assets/agents/v3/qe-contract-validator.md +8 -0
  60. package/assets/agents/v3/qe-coverage-specialist.md +8 -0
  61. package/assets/agents/v3/qe-defect-predictor.md +8 -0
  62. package/assets/agents/v3/qe-dependency-mapper.md +8 -0
  63. package/assets/agents/v3/qe-deployment-advisor.md +8 -0
  64. package/assets/agents/v3/qe-devils-advocate.md +8 -0
  65. package/assets/agents/v3/qe-flaky-hunter.md +8 -0
  66. package/assets/agents/v3/qe-fleet-commander.md +8 -0
  67. package/assets/agents/v3/qe-gap-detector.md +8 -0
  68. package/assets/agents/v3/qe-graphql-tester.md +8 -0
  69. package/assets/agents/v3/qe-impact-analyzer.md +8 -0
  70. package/assets/agents/v3/qe-integration-tester.md +8 -0
  71. package/assets/agents/v3/qe-kg-builder.md +8 -0
  72. package/assets/agents/v3/qe-learning-coordinator.md +8 -0
  73. package/assets/agents/v3/qe-load-tester.md +8 -0
  74. package/assets/agents/v3/qe-message-broker-tester.md +8 -0
  75. package/assets/agents/v3/qe-metrics-optimizer.md +8 -0
  76. package/assets/agents/v3/qe-middleware-validator.md +8 -0
  77. package/assets/agents/v3/qe-mutation-tester.md +8 -0
  78. package/assets/agents/v3/qe-odata-contract-tester.md +8 -0
  79. package/assets/agents/v3/qe-parallel-executor.md +8 -0
  80. package/assets/agents/v3/qe-pattern-learner.md +8 -0
  81. package/assets/agents/v3/qe-pentest-validator.md +8 -0
  82. package/assets/agents/v3/qe-performance-tester.md +8 -0
  83. package/assets/agents/v3/qe-product-factors-assessor.md +8 -0
  84. package/assets/agents/v3/qe-property-tester.md +8 -0
  85. package/assets/agents/v3/qe-quality-criteria-recommender.md +8 -0
  86. package/assets/agents/v3/qe-quality-gate.md +8 -0
  87. package/assets/agents/v3/qe-qx-partner.md +8 -0
  88. package/assets/agents/v3/qe-regression-analyzer.md +8 -0
  89. package/assets/agents/v3/qe-requirements-validator.md +8 -0
  90. package/assets/agents/v3/qe-responsive-tester.md +8 -0
  91. package/assets/agents/v3/qe-retry-handler.md +8 -0
  92. package/assets/agents/v3/qe-risk-assessor.md +8 -0
  93. package/assets/agents/v3/qe-root-cause-analyzer.md +8 -0
  94. package/assets/agents/v3/qe-sap-idoc-tester.md +8 -0
  95. package/assets/agents/v3/qe-sap-rfc-tester.md +8 -0
  96. package/assets/agents/v3/qe-security-auditor.md +8 -0
  97. package/assets/agents/v3/qe-security-scanner.md +8 -0
  98. package/assets/agents/v3/qe-soap-tester.md +8 -0
  99. package/assets/agents/v3/qe-sod-analyzer.md +8 -0
  100. package/assets/agents/v3/qe-tdd-specialist.md +8 -0
  101. package/assets/agents/v3/qe-test-architect.md +8 -0
  102. package/assets/agents/v3/qe-test-idea-rewriter.md +8 -0
  103. package/assets/agents/v3/qe-transfer-specialist.md +8 -0
  104. package/assets/agents/v3/qe-visual-tester.md +8 -0
  105. package/dist/cli/bundle.js +5 -5
  106. package/dist/cli/chunks/adapter-AMIHQ243.js +2 -0
  107. package/dist/cli/chunks/{agent-booster-wasm-3BC5LIEB.js → agent-booster-wasm-J5CITTTV.js} +2 -2
  108. package/dist/cli/chunks/{agent-handler-QLXWVZZF.js → agent-handler-HMN4ZBZ6.js} +2 -2
  109. package/dist/cli/chunks/{agent-memory-branch-3U5PDYW7.js → agent-memory-branch-SCAKN4DU.js} +2 -2
  110. package/dist/cli/chunks/aqe-learning-engine-LRG2UG6P.js +2 -0
  111. package/dist/cli/chunks/{arena-BMJQK4RD.js → arena-CJOLCHZW.js} +4 -4
  112. package/dist/cli/chunks/{arena-XENAGV4I.js → arena-FVBTSGKS.js} +2 -2
  113. package/dist/cli/chunks/audit-SOF6L5RY.js +3 -0
  114. package/dist/cli/chunks/base-WDL3FANJ.js +2 -0
  115. package/dist/cli/chunks/{hnswlib-node-P6HSEFLW.js → better-sqlite3-5G7LRX7Q.js} +2 -2
  116. package/dist/cli/chunks/{brain-handler-PHSWG5PR.js → brain-handler-D2ZQQI2J.js} +3 -3
  117. package/dist/cli/chunks/{branch-enumerator-LNSYT34I.js → branch-enumerator-QQXOCGOR.js} +2 -2
  118. package/dist/cli/chunks/{browser-M5BVQMBI.js → browser-XASHKIEN.js} +2 -2
  119. package/dist/cli/chunks/browser-workflow-W7S4IKWD.js +2 -0
  120. package/dist/cli/chunks/{chunk-DN65ILSI.js → chunk-2CZQA3NN.js} +2 -2
  121. package/dist/cli/chunks/{chunk-VKWDMOR4.js → chunk-2I5RXDNO.js} +2 -2
  122. package/dist/cli/chunks/{chunk-5D7GLMT3.js → chunk-2IC2I525.js} +1 -1
  123. package/dist/cli/chunks/{chunk-RFVZMNYX.js → chunk-2RQSFRON.js} +2 -2
  124. package/dist/cli/chunks/{chunk-VESYE5YO.js → chunk-2UI5LQ7C.js} +3 -3
  125. package/dist/cli/chunks/{chunk-54IPDQIZ.js → chunk-3XUPDWMA.js} +8 -8
  126. package/dist/cli/chunks/chunk-434VUSZP.js +2 -0
  127. package/dist/cli/chunks/{chunk-FLYFNNSN.js → chunk-4B22URZJ.js} +3 -3
  128. package/dist/cli/chunks/{chunk-PGNQR2VM.js → chunk-4N4TU7ST.js} +1 -1
  129. package/dist/cli/chunks/{chunk-N2TJXGHG.js → chunk-4XEUJH2M.js} +1 -1
  130. package/dist/cli/chunks/{chunk-Q6BKJZTG.js → chunk-5QTUGFFP.js} +2 -2
  131. package/dist/cli/chunks/{chunk-A7HGS7FW.js → chunk-5V4IFRG5.js} +2 -2
  132. package/dist/cli/chunks/{chunk-G5UIGH4C.js → chunk-5VTRPOYL.js} +3 -3
  133. package/dist/cli/chunks/{chunk-HKJ3LG3N.js → chunk-6DHJPKAH.js} +2 -2
  134. package/dist/cli/chunks/{chunk-G4GX6YKX.js → chunk-6RFPELCD.js} +2 -2
  135. package/dist/cli/chunks/{chunk-JY7T2AQQ.js → chunk-6ZLVQTQ5.js} +4 -4
  136. package/dist/cli/chunks/{chunk-DJQYZ4RZ.js → chunk-7BPYFDWY.js} +1 -1
  137. package/dist/cli/chunks/{chunk-KIMJPTHD.js → chunk-7NXVVIJZ.js} +2 -2
  138. package/dist/cli/chunks/{chunk-DIJ74M7V.js → chunk-7OK5H6ML.js} +1 -1
  139. package/dist/cli/chunks/{chunk-MGCW5FWH.js → chunk-7RTI5WT4.js} +2 -2
  140. package/dist/cli/chunks/{chunk-OATHXZYW.js → chunk-7SFCZ3AE.js} +1 -1
  141. package/dist/cli/chunks/{chunk-RCAIOTIF.js → chunk-A2DCROAN.js} +2 -2
  142. package/dist/cli/chunks/{chunk-DWLGFYXV.js → chunk-AJ2VDNPB.js} +3 -3
  143. package/dist/cli/chunks/chunk-AQPFTDGS.js +14 -0
  144. package/dist/cli/chunks/{chunk-ZTC64OJE.js → chunk-B3H2TTYT.js} +2 -2
  145. package/dist/cli/chunks/{chunk-7DU35D4M.js → chunk-BHD6THT5.js} +1 -1
  146. package/dist/cli/chunks/{chunk-TMD6IC6D.js → chunk-BXOGLZGU.js} +2 -2
  147. package/dist/cli/chunks/{chunk-MIMJVKJJ.js → chunk-C75ODWRP.js} +3 -3
  148. package/dist/cli/chunks/{chunk-CUAM34RQ.js → chunk-CH7KUYGO.js} +3 -3
  149. package/dist/cli/chunks/{chunk-MEN3UW7W.js → chunk-CSM4LXTH.js} +1 -1
  150. package/dist/cli/chunks/{chunk-VWN66V7U.js → chunk-DAUQIXHW.js} +2 -2
  151. package/dist/cli/chunks/{chunk-D4WDJ4ZF.js → chunk-DF4Z7TKZ.js} +2 -2
  152. package/dist/cli/chunks/{chunk-56RA6YPN.js → chunk-DFBVWMX3.js} +2 -2
  153. package/dist/cli/chunks/{chunk-UTORITJT.js → chunk-EDPVATNH.js} +2 -2
  154. package/dist/cli/chunks/{chunk-RR55MLD4.js → chunk-EJWAKPZD.js} +1 -1
  155. package/dist/cli/chunks/{chunk-2RLRPKCG.js → chunk-ELC6JIXL.js} +2 -2
  156. package/dist/cli/chunks/{chunk-K5KKZWED.js → chunk-ELTN4F4R.js} +2 -2
  157. package/dist/cli/chunks/{chunk-G6FP3S3G.js → chunk-ESZDW6G7.js} +2 -2
  158. package/dist/cli/chunks/{chunk-MWPFUBXS.js → chunk-EYKID5HA.js} +1 -1
  159. package/dist/cli/chunks/{chunk-VC256KH2.js → chunk-F72A356B.js} +2 -2
  160. package/dist/cli/chunks/{chunk-VB7DZVCI.js → chunk-GWHDPEBT.js} +1 -1
  161. package/dist/cli/chunks/{chunk-4K7T6AKM.js → chunk-GXNNKM7F.js} +1 -1
  162. package/dist/cli/chunks/{chunk-WFZUKXV5.js → chunk-H4Q36ILL.js} +2 -2
  163. package/dist/cli/chunks/{chunk-2UQWVF4P.js → chunk-H6UPZFI6.js} +2 -2
  164. package/dist/cli/chunks/{chunk-QAW6RVAR.js → chunk-H73FLSBV.js} +10 -10
  165. package/dist/cli/chunks/{chunk-24A7KD3D.js → chunk-HDEFCRHI.js} +1 -1
  166. package/dist/cli/chunks/{chunk-ZUBJBAUD.js → chunk-HFU3LTQX.js} +2 -2
  167. package/dist/cli/chunks/{chunk-IOE6LDPF.js → chunk-HMHQOEU7.js} +2 -2
  168. package/dist/cli/chunks/{chunk-CS3UB2OL.js → chunk-HWKFBRMX.js} +1 -1
  169. package/dist/cli/chunks/{chunk-DBR4TQPK.js → chunk-HZGOVRZ6.js} +2 -2
  170. package/dist/cli/chunks/{chunk-3JWV4GE6.js → chunk-I7ADT6AZ.js} +2 -2
  171. package/dist/cli/chunks/{chunk-D3Q4443B.js → chunk-IB3QQDC4.js} +1 -1
  172. package/dist/cli/chunks/{chunk-J533CJUN.js → chunk-J2SMTP2L.js} +3 -3
  173. package/dist/cli/chunks/{chunk-S7FGTHFE.js → chunk-J3WUBGLQ.js} +2 -2
  174. package/dist/cli/chunks/{chunk-IT7CEHAJ.js → chunk-JADBRSQN.js} +2 -2
  175. package/dist/cli/chunks/{chunk-BSRCL6RU.js → chunk-JP2YXWJD.js} +2 -2
  176. package/dist/cli/chunks/chunk-JPL53G4V.js +20 -0
  177. package/dist/cli/chunks/{chunk-IUKERFLT.js → chunk-JX7HZMW5.js} +1 -1
  178. package/dist/cli/chunks/{chunk-FE3FGMNB.js → chunk-JXCIRWLQ.js} +2 -2
  179. package/dist/cli/chunks/{chunk-IRS4HKAR.js → chunk-K32AUACO.js} +1 -1
  180. package/dist/cli/chunks/{chunk-A3BDPU5F.js → chunk-KQOJYO5Z.js} +4 -4
  181. package/dist/cli/chunks/{chunk-IIFCTJOF.js → chunk-KVMY2ABO.js} +2 -2
  182. package/dist/cli/chunks/{chunk-WFZ4DRIC.js → chunk-L2IMTNZF.js} +2 -2
  183. package/dist/cli/chunks/{chunk-HHEHGERJ.js → chunk-LAGNWKAD.js} +2 -2
  184. package/dist/cli/chunks/{chunk-RZ7D5SHS.js → chunk-LEDF3LGZ.js} +1 -1
  185. package/dist/cli/chunks/{chunk-YZFNPTGN.js → chunk-LHA4OQ7G.js} +2 -2
  186. package/dist/cli/chunks/{chunk-GTVXVYKE.js → chunk-LHZOIXJ6.js} +2 -2
  187. package/dist/cli/chunks/{chunk-TISBFSDJ.js → chunk-LOQMQEKN.js} +1 -1
  188. package/dist/cli/chunks/{chunk-GMU7P5O3.js → chunk-LWUIK5DH.js} +2 -2
  189. package/dist/cli/chunks/{chunk-MFQIJ3HV.js → chunk-M3APJ7VS.js} +2 -2
  190. package/dist/cli/chunks/{chunk-CTG3GJIM.js → chunk-M4OYZMXE.js} +2 -2
  191. package/dist/cli/chunks/{chunk-AVQD7KEN.js → chunk-MCMVRPNG.js} +2 -2
  192. package/dist/cli/chunks/{chunk-YZD4VIE5.js → chunk-MJLDZSFB.js} +1 -1
  193. package/dist/cli/chunks/{chunk-PPM5D7LH.js → chunk-MQN3HYFX.js} +1 -1
  194. package/dist/cli/chunks/{chunk-RONMVGCT.js → chunk-MSJGDIRP.js} +2 -2
  195. package/dist/cli/chunks/{chunk-UOIT5JZ6.js → chunk-NEIJP6TG.js} +2 -2
  196. package/dist/cli/chunks/{chunk-3KGUP2SD.js → chunk-NHC635LL.js} +2 -2
  197. package/dist/cli/chunks/{chunk-SK6YRNXI.js → chunk-NKEGEQ3J.js} +2 -2
  198. package/dist/cli/chunks/{chunk-66LOFIBP.js → chunk-NN35QH6X.js} +2 -2
  199. package/dist/cli/chunks/{chunk-GKG6IQP6.js → chunk-NUCJS3Z7.js} +3 -3
  200. package/dist/cli/chunks/{chunk-IWRORKD7.js → chunk-O2H5WYFK.js} +2 -2
  201. package/dist/cli/chunks/{chunk-S73KENCH.js → chunk-O4MNYX4X.js} +2 -2
  202. package/dist/cli/chunks/{chunk-B4F5EPNR.js → chunk-OBLAWVXM.js} +1 -1
  203. package/dist/cli/chunks/{chunk-MRXKIXVV.js → chunk-OU4HRUVV.js} +2 -2
  204. package/dist/cli/chunks/{chunk-HNYSBE5J.js → chunk-P7EOYGR2.js} +2 -2
  205. package/dist/cli/chunks/{chunk-3BGGNHHZ.js → chunk-PFSBUTDA.js} +1 -1
  206. package/dist/cli/chunks/{chunk-FPWA73N6.js → chunk-PIIBVLFC.js} +2 -2
  207. package/dist/cli/chunks/{chunk-BB7MEGXD.js → chunk-PIJ5XOMM.js} +2 -2
  208. package/dist/cli/chunks/{chunk-O5OOUMBB.js → chunk-Q4LYWIEX.js} +2 -2
  209. package/dist/cli/chunks/{chunk-RFNEEDPQ.js → chunk-Q5432RIH.js} +2 -2
  210. package/dist/cli/chunks/{chunk-D7NKRCIL.js → chunk-QJXZ4SU7.js} +2 -2
  211. package/dist/cli/chunks/{chunk-6SAU7GXO.js → chunk-QNIL3D6E.js} +1 -1
  212. package/dist/cli/chunks/{chunk-W7KGHW4T.js → chunk-QUQA4NNZ.js} +2 -2
  213. package/dist/cli/chunks/{chunk-FNJZBIR3.js → chunk-QZSNYXYC.js} +2 -2
  214. package/dist/cli/chunks/{chunk-R573V37S.js → chunk-RA7HEY5G.js} +17 -17
  215. package/dist/cli/chunks/{chunk-253TDTPH.js → chunk-RBZWUWUG.js} +1 -1
  216. package/dist/cli/chunks/{chunk-HRORJ352.js → chunk-RH3I4Q23.js} +2 -2
  217. package/dist/cli/chunks/{chunk-CUY2EUSQ.js → chunk-ROXH622K.js} +2 -2
  218. package/dist/cli/chunks/{chunk-NGSA53GC.js → chunk-RTAGNKCV.js} +2 -2
  219. package/dist/cli/chunks/{chunk-ZS4BGJJV.js → chunk-RTFFD263.js} +1 -1
  220. package/dist/cli/chunks/{chunk-ZG3DSWUA.js → chunk-S574AFAT.js} +1 -1
  221. package/dist/cli/chunks/{chunk-GDUGW6FZ.js → chunk-SA5FTDRS.js} +2 -2
  222. package/dist/cli/chunks/{chunk-NKW7VOZV.js → chunk-SHVTMMJB.js} +1 -1
  223. package/dist/cli/chunks/{chunk-QTDZS4U6.js → chunk-SUGQZCNI.js} +2 -2
  224. package/dist/cli/chunks/{chunk-TMTLWSSA.js → chunk-T6CUKJHS.js} +1 -1
  225. package/dist/cli/chunks/{chunk-HPKYIK7R.js → chunk-T6SCQVWH.js} +2 -2
  226. package/dist/cli/chunks/{chunk-75MP7JMV.js → chunk-TFA5UETW.js} +1 -1
  227. package/dist/cli/chunks/{chunk-JPOEI7CJ.js → chunk-TFJDJVPC.js} +2 -2
  228. package/dist/cli/chunks/chunk-TNVOINYC.js +12 -0
  229. package/dist/cli/chunks/{chunk-MJRYHHOG.js → chunk-TUFU3BAK.js} +2 -2
  230. package/dist/cli/chunks/{chunk-X4B3R3ZZ.js → chunk-TWH3ZL6B.js} +2 -2
  231. package/dist/cli/chunks/{chunk-RUQV3BTV.js → chunk-ULEVKOWQ.js} +1 -1
  232. package/dist/cli/chunks/{chunk-AMBIOEMO.js → chunk-ULV5K4V5.js} +1 -1
  233. package/dist/cli/chunks/{chunk-S7HQOGVD.js → chunk-UNDPB5SS.js} +1 -1
  234. package/dist/cli/chunks/{chunk-YEO2Z3UX.js → chunk-UQYDFT6I.js} +2 -2
  235. package/dist/cli/chunks/{chunk-ZCYKWEAM.js → chunk-USPBUR6P.js} +2 -2
  236. package/dist/cli/chunks/{chunk-IVKSZNMI.js → chunk-UVWOIF6P.js} +1 -1
  237. package/dist/cli/chunks/{chunk-PYBVFG6T.js → chunk-UWDC3TZP.js} +2 -2
  238. package/dist/cli/chunks/{chunk-2Z7HIT5I.js → chunk-VFFIMJWT.js} +1 -1
  239. package/dist/cli/chunks/{chunk-7JZCEQFR.js → chunk-VQM2TC2V.js} +1 -1
  240. package/dist/cli/chunks/{chunk-4Z7XH4JE.js → chunk-WNAFMYND.js} +2 -2
  241. package/dist/cli/chunks/{chunk-AZCKTAUI.js → chunk-X3YWLJGT.js} +2 -2
  242. package/dist/cli/chunks/{chunk-SXQIH2QA.js → chunk-X5R6SUWM.js} +2 -2
  243. package/dist/cli/chunks/{chunk-4FTO3TPH.js → chunk-XKRJQIGP.js} +2 -2
  244. package/dist/cli/chunks/{chunk-XI6ZZMX7.js → chunk-XLFYVBOD.js} +1 -1
  245. package/dist/cli/chunks/chunk-XOGBTPJI.js +65 -0
  246. package/dist/cli/chunks/{chunk-ZT7JSFGT.js → chunk-XOYTW6LI.js} +2 -2
  247. package/dist/cli/chunks/{chunk-RLU7764Y.js → chunk-Z3RPA3RD.js} +2 -2
  248. package/dist/cli/chunks/{chunk-OJNG6ZXG.js → chunk-ZBSEXVEI.js} +2 -2
  249. package/dist/cli/chunks/{chunk-3WOQY6UL.js → chunk-ZMCMSDXR.js} +2 -2
  250. package/dist/cli/chunks/{chunk-FW3C4LWU.js → chunk-ZY4G7O7Y.js} +2 -2
  251. package/dist/cli/chunks/{ci-M2BSQBLL.js → ci-COQUVZH6.js} +2 -2
  252. package/dist/cli/chunks/{ci-output-Z4TMK6GZ.js → ci-output-KVUHUEOT.js} +2 -2
  253. package/dist/cli/chunks/{circuit-breaker-E3G4GGWB.js → circuit-breaker-O4JNXAYH.js} +2 -2
  254. package/dist/cli/chunks/{claude-flow-setup-MASRQU54.js → claude-flow-setup-J65U34NA.js} +2 -2
  255. package/dist/cli/chunks/client-VJNNIAMG.js +2 -0
  256. package/dist/cli/chunks/{cline-installer-P3BWAKQA.js → cline-installer-ZTG234Z2.js} +2 -2
  257. package/dist/cli/chunks/{code-7HY5HQAV.js → code-5GWPY4IX.js} +2 -2
  258. package/dist/cli/chunks/{code-index-extractor-MBVKLOEU.js → code-index-extractor-TWNKG4VS.js} +2 -2
  259. package/dist/cli/chunks/{codex-installer-WZ6QO2PH.js → codex-installer-4TM4BLAE.js} +2 -2
  260. package/dist/cli/chunks/{completions-TOJC2UFP.js → completions-BBNHQXMV.js} +2 -2
  261. package/dist/cli/chunks/{complexity-analyzer-QYVDIAAW.js → complexity-analyzer-2SCI2VGH.js} +2 -2
  262. package/dist/cli/chunks/{continuedev-installer-J72CV7P4.js → continuedev-installer-CTIORASU.js} +2 -2
  263. package/dist/cli/chunks/{copilot-installer-ACDA3GEA.js → copilot-installer-4R2V4IYB.js} +2 -2
  264. package/dist/cli/chunks/core-handlers-MV5CAR7O.js +2 -0
  265. package/dist/cli/chunks/{cost-tracker-BAYQJELE.js → cost-tracker-KDBYQBKG.js} +2 -2
  266. package/dist/cli/chunks/{coverage-QD3XJV6W.js → coverage-QQJQVDPZ.js} +3 -3
  267. package/dist/cli/chunks/cross-domain-router-ULY4NIML.js +2 -0
  268. package/dist/cli/chunks/{cursor-installer-SPGZ4TQM.js → cursor-installer-5WEZCESZ.js} +2 -2
  269. package/dist/cli/chunks/{daemon-3EVOL2UH.js → daemon-M4DKHEEA.js} +3 -3
  270. package/dist/cli/chunks/{daemon-N4JKD5SO.js → daemon-Y7H3ZUXQ.js} +4 -4
  271. package/dist/cli/chunks/{dag-attention-scheduler-3BVLL3L5.js → dag-attention-scheduler-SD2UIADT.js} +2 -2
  272. package/dist/cli/chunks/{detect-SWACKB45.js → detect-WONWUXFH.js} +2 -2
  273. package/dist/cli/chunks/{dist-node-LU4E7PI6.js → dist-node-Q5GQN2R6.js} +2 -2
  274. package/dist/cli/chunks/{domain-handler-5AKKAC43.js → domain-handler-EMXE2XQW.js} +2 -2
  275. package/dist/cli/chunks/{domain-transfer-LB6H7RPX.js → domain-transfer-QATUJJRP.js} +2 -2
  276. package/dist/cli/chunks/dream-PIGWXWE4.js +2 -0
  277. package/dist/cli/chunks/{embed-and-insert-pattern-7RBA5NDK.js → embed-and-insert-pattern-AAFHLBEJ.js} +2 -2
  278. package/dist/cli/chunks/{eval-ZZFPRENX.js → eval-73BDNLSK.js} +2 -2
  279. package/dist/cli/chunks/{experience-capture-middleware-HRO3EGIW.js → experience-capture-middleware-YPAPVSYY.js} +3 -3
  280. package/dist/cli/chunks/{fast-paths-IRRNQBTY.js → fast-paths-33ZKMNYY.js} +2 -2
  281. package/dist/cli/chunks/{feature-flags-R5N5IWI2.js → feature-flags-F3DVW4ST.js} +2 -2
  282. package/dist/cli/chunks/{feature-flags-W54ABAUA.js → feature-flags-QKO5YYDU.js} +2 -2
  283. package/dist/cli/chunks/{file-discovery-6CIDLVID.js → file-discovery-YYVZLRYD.js} +2 -2
  284. package/dist/cli/chunks/{fleet-YTFN64WE.js → fleet-EJX6BXLR.js} +3 -3
  285. package/dist/cli/chunks/{gnn-wrapper-RXMPLMV2.js → gnn-wrapper-TBNLYPTM.js} +2 -2
  286. package/dist/cli/chunks/{heartbeat-handler-HQQWEEQQ.js → heartbeat-handler-HPRTS6SI.js} +4 -4
  287. package/dist/cli/chunks/heartbeat-scheduler-5BBLZP6R.js +2 -0
  288. package/dist/cli/chunks/hnsw-adapter-FMEBL5T4.js +2 -0
  289. package/dist/cli/chunks/hnsw-index-K2R24V4Z.js +2 -0
  290. package/dist/cli/chunks/{hnsw-legacy-bridge-GPZIKYFD.js → hnsw-legacy-bridge-Z6V6TOF5.js} +2 -2
  291. package/dist/cli/chunks/{better-sqlite3-6AGIBSVE.js → hnswlib-node-LFVNGGCL.js} +2 -2
  292. package/dist/cli/chunks/{hooks-AYLAGFOK.js → hooks-GG2Z3BDB.js} +10 -10
  293. package/dist/cli/chunks/hybrid-router-LVF6N345.js +2 -0
  294. package/dist/cli/chunks/{hypergraph-engine-56FMXI3T.js → hypergraph-engine-X4Q2TTET.js} +2 -2
  295. package/dist/cli/chunks/{hypergraph-handler-APEVT5IE.js → hypergraph-handler-6BZWV5PL.js} +3 -3
  296. package/dist/cli/chunks/impact-analyzer-CCVVMGWE.js +2 -0
  297. package/dist/cli/chunks/{init-handler-5DWF4REQ.js → init-handler-EKUS7U6L.js} +6 -6
  298. package/dist/cli/chunks/init-wizard-KDPMO4G3.js +2 -0
  299. package/dist/cli/chunks/kernel-PBYNK5VA.js +2 -0
  300. package/dist/cli/chunks/{kilocode-installer-XKAUA5VA.js → kilocode-installer-BWAVVSQG.js} +2 -2
  301. package/dist/cli/chunks/{kiro-installer-NI2KIYJE.js → kiro-installer-UADO53E5.js} +2 -2
  302. package/dist/cli/chunks/knowledge-graph-C7LVHHLN.js +2 -0
  303. package/dist/cli/chunks/{learning-ZIUMUNXZ.js → learning-HMUTCYQM.js} +3 -3
  304. package/dist/cli/chunks/{llm-router-IL52EF2V.js → llm-router-453TBDUY.js} +4 -4
  305. package/dist/cli/chunks/llm-router-service-LMTRJCPP.js +2 -0
  306. package/dist/cli/chunks/{load-B5LFYD6O.js → load-DBBSNP6T.js} +2 -2
  307. package/dist/cli/chunks/load-test-FHMZXTXD.js +2 -0
  308. package/dist/cli/chunks/{mcp-K6GZLWBC.js → mcp-PK3SAKRF.js} +2 -2
  309. package/dist/cli/chunks/{memory-NCQRVSN6.js → memory-63NHVBXS.js} +5 -5
  310. package/dist/cli/chunks/memory-backend-UZHPCQTB.js +2 -0
  311. package/dist/cli/chunks/memory-handlers-YIKKORRY.js +2 -0
  312. package/dist/cli/chunks/{multi-model-executor-R4LBSJWK.js → multi-model-executor-HUGRXJ6D.js} +2 -2
  313. package/dist/cli/chunks/{opencode-installer-I6CBR3PV.js → opencode-installer-A6IXNF26.js} +2 -2
  314. package/dist/cli/chunks/{orchestrator-5FXUCES6.js → orchestrator-KDFYDNE3.js} +5 -5
  315. package/dist/cli/chunks/pattern-null-store-5PS4JN6V.js +2 -0
  316. package/dist/cli/chunks/{pipeline-GDKCTXJH.js → pipeline-HSPRKEYE.js} +2 -2
  317. package/dist/cli/chunks/{platform-ZFY3F4T3.js → platform-X74IBN2H.js} +2 -2
  318. package/dist/cli/chunks/{plugin-HQMEN3OS.js → plugin-KDJZ7VFD.js} +2 -2
  319. package/dist/cli/chunks/{prime-radiant-advanced-wasm-LSJGF4CV.js → prime-radiant-advanced-wasm-2YZGKQE7.js} +2 -2
  320. package/dist/cli/chunks/protocol-executor-2GTGIOFD.js +2 -0
  321. package/dist/cli/chunks/{protocol-handler-BMDNIGPP.js → protocol-handler-I2SDHC7B.js} +2 -2
  322. package/dist/cli/chunks/{prove-ABVGAG4Z.js → prove-JQJDNIZH.js} +2 -2
  323. package/dist/cli/chunks/provider-manager-VH6YTBB3.js +2 -0
  324. package/dist/cli/chunks/qe-reasoning-bank-47JSO76G.js +2 -0
  325. package/dist/cli/chunks/{quality-ENJXPNP5.js → quality-2P7KHVY3.js} +2 -2
  326. package/dist/cli/chunks/queen-coordinator-C7EDY7IS.js +2 -0
  327. package/dist/cli/chunks/{real-embeddings-W3GNAEJO.js → real-embeddings-L7NMMNDO.js} +2 -2
  328. package/dist/cli/chunks/{roocode-installer-4FJNQ7PU.js → roocode-installer-LA4QN5AG.js} +2 -2
  329. package/dist/cli/chunks/router-7DVH66WB.js +2 -0
  330. package/dist/cli/chunks/routing-feedback-4I2MF235.js +2 -0
  331. package/dist/cli/chunks/{routing-handler-GFS5FA4F.js → routing-handler-B5CDEZF3.js} +2 -2
  332. package/dist/cli/chunks/{ruvector-commands-GBMYNJKN.js → ruvector-commands-SOVCRLJ6.js} +2 -2
  333. package/dist/cli/chunks/{rvf-dual-writer-STUAQT6U.js → rvf-dual-writer-M6WI2KFB.js} +2 -2
  334. package/dist/cli/chunks/{rvf-migration-adapter-LO6DBNJH.js → rvf-migration-adapter-YDMZGPMA.js} +2 -2
  335. package/dist/cli/chunks/{rvf-migration-coordinator-I5AD4VJ2.js → rvf-migration-coordinator-TFGQ5EO4.js} +2 -2
  336. package/dist/cli/chunks/rvf-native-adapter-UN3ESMMW.js +2 -0
  337. package/dist/cli/chunks/safe-db-Y2ZXKWBK.js +2 -0
  338. package/dist/cli/chunks/schedule-PG2NVRGA.js +2 -0
  339. package/dist/cli/chunks/scheduler-CNH6WWU2.js +2 -0
  340. package/dist/cli/chunks/{security-X3WCA5K5.js → security-R3IXQXDA.js} +3 -3
  341. package/dist/cli/chunks/{shared-rvf-adapter-Z4FSPWNP.js → shared-rvf-adapter-GZX7LSQZ.js} +2 -2
  342. package/dist/cli/chunks/{shared-rvf-dual-writer-QOPOIRIC.js → shared-rvf-dual-writer-YT7SJX7K.js} +2 -2
  343. package/dist/cli/chunks/sqlite-persistence-WWT4DRRP.js +2 -0
  344. package/dist/cli/chunks/{status-handler-B2B5QBVK.js → status-handler-7PZSPBHJ.js} +2 -2
  345. package/dist/cli/chunks/{structural-health-KT47LBVH.js → structural-health-UMJS6IVR.js} +2 -2
  346. package/dist/cli/chunks/sync-HA5SLSBA.js +2 -0
  347. package/dist/cli/chunks/{sync-VWD6OOUR.js → sync-UIREA3UG.js} +2 -2
  348. package/dist/cli/chunks/{task-handler-X5JT5YBF.js → task-handler-NV4HGMEG.js} +2 -2
  349. package/dist/cli/chunks/{task-handlers-IW4GQDW4.js → task-handlers-RXYWWOSU.js} +3 -3
  350. package/dist/cli/chunks/{test-MBZSUASD.js → test-2Y6OXGEU.js} +4 -4
  351. package/dist/cli/chunks/{test-scheduling-E5KHKRZS.js → test-scheduling-N55VFOYT.js} +3 -3
  352. package/dist/cli/chunks/token-bootstrap-FW3ZVMRP.js +2 -0
  353. package/dist/cli/chunks/{token-usage-ECJSPOQB.js → token-usage-YXKOB3U6.js} +2 -2
  354. package/dist/cli/chunks/{transformers-UZJAQ7OZ.js → transformers-GBRSFAVA.js} +2 -2
  355. package/dist/cli/chunks/{tree-sitter-wasm-parser-H6BU2E5R.js → tree-sitter-wasm-parser-FJHMEHJS.js} +2 -2
  356. package/dist/cli/chunks/{types-PM7NT3MH.js → types-NVMRVSBH.js} +2 -2
  357. package/dist/cli/chunks/unified-memory-PXEJKKMN.js +2 -0
  358. package/dist/cli/chunks/unified-memory-hnsw-M7OI5WUU.js +2 -0
  359. package/dist/cli/chunks/unified-persistence-WR4VDTAF.js +2 -0
  360. package/dist/cli/chunks/{upgrade-FS2XYC2P.js → upgrade-L2OTYHD3.js} +2 -2
  361. package/dist/cli/chunks/{validate-4Y2BNN3A.js → validate-3NWRQYTP.js} +2 -2
  362. package/dist/cli/chunks/{validate-swarm-Z7QXZSUE.js → validate-swarm-MDURRWXK.js} +2 -2
  363. package/dist/cli/chunks/{vibium-VZ6L3O2G.js → vibium-SZX7RB4H.js} +2 -2
  364. package/dist/cli/chunks/visual-security-CKSZZHKG.js +2 -0
  365. package/dist/cli/chunks/{web-tree-sitter-H7P37W5U.js → web-tree-sitter-LGQT7JRD.js} +2 -2
  366. package/dist/cli/chunks/{windsurf-installer-IB2VHSZS.js → windsurf-installer-EYYGHPPX.js} +2 -2
  367. package/dist/cli/chunks/witness-chain-IOQX3XFG.js +2 -0
  368. package/dist/cli/chunks/{witness-chain-C4DISYJN.js → witness-chain-YYYA2CU3.js} +2 -2
  369. package/dist/cli/chunks/{workflow-IGM7KVIO.js → workflow-UD45FQAH.js} +4 -4
  370. package/dist/cli/chunks/workflow-orchestrator-Z2ZJRWIN.js +2 -0
  371. package/dist/cli/chunks/wrappers-JXD3KNSR.js +2 -0
  372. package/dist/kernel/unified-memory-schemas.d.ts +3 -2
  373. package/dist/kernel/unified-memory-schemas.js +3 -2
  374. package/dist/kernel/unified-memory.js +3 -1
  375. package/dist/learning/aqe-learning-engine.js +32 -0
  376. package/dist/learning/experience-capture.d.ts +8 -0
  377. package/dist/learning/experience-capture.js +30 -0
  378. package/dist/learning/pattern-null-store.d.ts +32 -0
  379. package/dist/learning/pattern-null-store.js +77 -0
  380. package/dist/learning/pattern-store.d.ts +10 -0
  381. package/dist/learning/pattern-store.js +23 -0
  382. package/dist/mcp/bundle.js +377 -347
  383. package/dist/mcp/handlers/validation-pipeline-handler.d.ts +19 -0
  384. package/dist/mcp/handlers/validation-pipeline-handler.js +10 -0
  385. package/dist/migrations/20260611_add_pattern_nulls_table.d.ts +26 -0
  386. package/dist/migrations/20260611_add_pattern_nulls_table.js +63 -0
  387. package/dist/validation/pipeline.d.ts +25 -0
  388. package/dist/validation/pipeline.js +28 -5
  389. package/dist/validation/steps/requirements.js +5 -0
  390. package/package.json +2 -1
  391. package/dist/cli/chunks/adapter-XZVL3DHO.js +0 -2
  392. package/dist/cli/chunks/aqe-learning-engine-YIL25K6W.js +0 -2
  393. package/dist/cli/chunks/audit-WPIRUJNZ.js +0 -3
  394. package/dist/cli/chunks/base-YCYV23Q3.js +0 -2
  395. package/dist/cli/chunks/browser-workflow-ALCOCRA2.js +0 -2
  396. package/dist/cli/chunks/chunk-EIL7FQC4.js +0 -65
  397. package/dist/cli/chunks/chunk-RLZDXQNM.js +0 -2
  398. package/dist/cli/chunks/chunk-W5C7R2LS.js +0 -12
  399. package/dist/cli/chunks/client-RPB6RYVY.js +0 -2
  400. package/dist/cli/chunks/core-handlers-QFJT5NX6.js +0 -2
  401. package/dist/cli/chunks/cross-domain-router-5GJ7WZKX.js +0 -2
  402. package/dist/cli/chunks/dream-C6VNLTON.js +0 -2
  403. package/dist/cli/chunks/heartbeat-scheduler-4SBO27BG.js +0 -2
  404. package/dist/cli/chunks/hnsw-adapter-W7G6VNXW.js +0 -2
  405. package/dist/cli/chunks/hnsw-index-LENA5QML.js +0 -2
  406. package/dist/cli/chunks/hybrid-router-IXHIC45P.js +0 -2
  407. package/dist/cli/chunks/impact-analyzer-DKGVMYU6.js +0 -2
  408. package/dist/cli/chunks/init-wizard-BBY3LY3F.js +0 -2
  409. package/dist/cli/chunks/kernel-7CUW7G62.js +0 -2
  410. package/dist/cli/chunks/knowledge-graph-Q5CP47IP.js +0 -2
  411. package/dist/cli/chunks/llm-router-service-MTXCX7TO.js +0 -2
  412. package/dist/cli/chunks/load-test-YBWXASBO.js +0 -2
  413. package/dist/cli/chunks/memory-backend-52LANEA3.js +0 -2
  414. package/dist/cli/chunks/memory-handlers-KFW3HYAP.js +0 -2
  415. package/dist/cli/chunks/protocol-executor-TRYUS77M.js +0 -2
  416. package/dist/cli/chunks/provider-manager-6XQQN7FX.js +0 -2
  417. package/dist/cli/chunks/qe-reasoning-bank-3IUPE4DJ.js +0 -2
  418. package/dist/cli/chunks/queen-coordinator-VWPH4XPX.js +0 -2
  419. package/dist/cli/chunks/router-OIB6ODHA.js +0 -2
  420. package/dist/cli/chunks/routing-feedback-EKYPCZYG.js +0 -2
  421. package/dist/cli/chunks/rvf-native-adapter-7RXP2Q4Q.js +0 -2
  422. package/dist/cli/chunks/safe-db-MNKFEPBX.js +0 -2
  423. package/dist/cli/chunks/schedule-AJXABVXX.js +0 -2
  424. package/dist/cli/chunks/scheduler-LDWYHIAW.js +0 -2
  425. package/dist/cli/chunks/sqlite-persistence-A6GKDMOJ.js +0 -2
  426. package/dist/cli/chunks/sync-CKID22IW.js +0 -2
  427. package/dist/cli/chunks/token-bootstrap-TIDPJ5IG.js +0 -2
  428. package/dist/cli/chunks/unified-memory-27QJHABO.js +0 -2
  429. package/dist/cli/chunks/unified-memory-hnsw-76VUXR4H.js +0 -2
  430. package/dist/cli/chunks/unified-persistence-QRCGDEXH.js +0 -2
  431. package/dist/cli/chunks/visual-security-KB27O7BE.js +0 -2
  432. package/dist/cli/chunks/witness-chain-EYPXHRDV.js +0 -2
  433. package/dist/cli/chunks/workflow-orchestrator-6AQZ3USU.js +0 -2
  434. package/dist/cli/chunks/wrappers-PQXC263L.js +0 -2
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.5");process.exit(0)}
2
- import{b as d,d as c}from"./chunk-56RA6YPN.js";import{a as l,c as g}from"./chunk-S73KENCH.js";g();c();import{existsSync as y,readFileSync as p}from"node:fs";import{join as o,dirname as u}from"node:path";import{fileURLToPath as m}from"node:url";var i=class extends Error{constructor(t,n,r){super(t);this.code=n;this.cause=r;this.name="PatternLoaderError"}code;cause},s=class a{static instance=null;config;patterns;isLoading=!1;constructor(e={}){this.config={basePath:e.basePath??this.getDefaultBasePath(),throwOnMissing:e.throwOnMissing??!1,validatePatterns:e.validatePatterns??!0},this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]}}static getInstance(e){return a.instance||(a.instance=new a(e)),a.instance}static resetInstance(){a.instance=null}getDefaultBasePath(){try{let e=import.meta.url,t=m(e),n=u(t),r=o(n,"..","..","..");return o(r,"assets","patterns")}catch{return o(process.cwd(),"assets","patterns")}}async loadPatterns(){if(!this.isLoading){this.isLoading=!0,this.patterns.errors=[];try{this.patterns.index=this.loadJsonFile("index.json");let[e,t,n,r]=await Promise.all([Promise.resolve(this.loadJsonFile("adr-051-booster-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-router-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-embedding-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-reasoning-patterns.json"))]);this.patterns.booster=e,this.patterns.router=t,this.patterns.embedding=n,this.patterns.reasoning=r,this.patterns.loadedAt=new Date,this.config.validatePatterns&&this.validateLoadedPatterns()}finally{this.isLoading=!1}}}loadJsonFile(e){let t=o(this.config.basePath,e);try{if(!y(t)){let r=`Pattern file not found: ${t}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"FILE_NOT_FOUND");return null}let n=p(t,"utf-8");return d(n)}catch(n){if(n instanceof i)throw n;let r=`Failed to load pattern file ${e}: ${l(n)}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"PARSE_ERROR",n instanceof Error?n:void 0);return null}}validateLoadedPatterns(){this.patterns.booster&&(Array.isArray(this.patterns.booster.patterns)||this.patterns.errors.push("Booster patterns file missing patterns array")),this.patterns.router&&(Array.isArray(this.patterns.router.patterns)||this.patterns.errors.push("Router patterns file missing patterns array")),this.patterns.embedding&&(Array.isArray(this.patterns.embedding.patterns)||this.patterns.errors.push("Embedding patterns file missing patterns array")),this.patterns.reasoning&&(Array.isArray(this.patterns.reasoning.patterns)||this.patterns.errors.push("Reasoning patterns file missing patterns array"))}async ensureLoaded(){this.patterns.loadedAt||await this.loadPatterns()}async getIndex(){return await this.ensureLoaded(),this.patterns.index}async getBoosterPatterns(){return await this.ensureLoaded(),this.patterns.booster}async getRouterPatterns(){return await this.ensureLoaded(),this.patterns.router}async getEmbeddingPatterns(){return await this.ensureLoaded(),this.patterns.embedding}async getReasoningPatterns(){return await this.ensureLoaded(),this.patterns.reasoning}async getBoosterPatternByKey(e){let t=await this.getBoosterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getRouterPatternByKey(e){let t=await this.getRouterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEmbeddingPatternByKey(e){let t=await this.getEmbeddingPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getReasoningPatternByKey(e){let t=await this.getReasoningPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEligibleBoosterTransforms(){let e=await this.getBoosterPatternByKey("booster-transform-eligibility");return e?e.eligibility_criteria.simple_transforms:[]}async getTierHierarchy(){let e=await this.getRouterPatternByKey("router-5tier-complexity");return e?e.tier_hierarchy:null}async getQualityGateThresholds(){let e=await this.getReasoningPatternByKey("reasoning-pattern-quality-gates");return e?e.gate_thresholds:null}isLoaded(){return this.patterns.loadedAt!==null}getLoadedAt(){return this.patterns.loadedAt}getErrors(){return[...this.patterns.errors]}async getStatistics(){let e=await this.getIndex();return e?e.pattern_statistics:null}async reload(){this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]},await this.loadPatterns()}async getAllPatterns(){return await this.ensureLoaded(),{...this.patterns}}};function x(){return s.getInstance()}export{x as a};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.6");process.exit(0)}
2
+ import{b as d,d as c}from"./chunk-DFBVWMX3.js";import{a as l,c as g}from"./chunk-O4MNYX4X.js";g();c();import{existsSync as y,readFileSync as p}from"node:fs";import{join as o,dirname as u}from"node:path";import{fileURLToPath as m}from"node:url";var i=class extends Error{constructor(t,n,r){super(t);this.code=n;this.cause=r;this.name="PatternLoaderError"}code;cause},s=class a{static instance=null;config;patterns;isLoading=!1;constructor(e={}){this.config={basePath:e.basePath??this.getDefaultBasePath(),throwOnMissing:e.throwOnMissing??!1,validatePatterns:e.validatePatterns??!0},this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]}}static getInstance(e){return a.instance||(a.instance=new a(e)),a.instance}static resetInstance(){a.instance=null}getDefaultBasePath(){try{let e=import.meta.url,t=m(e),n=u(t),r=o(n,"..","..","..");return o(r,"assets","patterns")}catch{return o(process.cwd(),"assets","patterns")}}async loadPatterns(){if(!this.isLoading){this.isLoading=!0,this.patterns.errors=[];try{this.patterns.index=this.loadJsonFile("index.json");let[e,t,n,r]=await Promise.all([Promise.resolve(this.loadJsonFile("adr-051-booster-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-router-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-embedding-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-reasoning-patterns.json"))]);this.patterns.booster=e,this.patterns.router=t,this.patterns.embedding=n,this.patterns.reasoning=r,this.patterns.loadedAt=new Date,this.config.validatePatterns&&this.validateLoadedPatterns()}finally{this.isLoading=!1}}}loadJsonFile(e){let t=o(this.config.basePath,e);try{if(!y(t)){let r=`Pattern file not found: ${t}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"FILE_NOT_FOUND");return null}let n=p(t,"utf-8");return d(n)}catch(n){if(n instanceof i)throw n;let r=`Failed to load pattern file ${e}: ${l(n)}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"PARSE_ERROR",n instanceof Error?n:void 0);return null}}validateLoadedPatterns(){this.patterns.booster&&(Array.isArray(this.patterns.booster.patterns)||this.patterns.errors.push("Booster patterns file missing patterns array")),this.patterns.router&&(Array.isArray(this.patterns.router.patterns)||this.patterns.errors.push("Router patterns file missing patterns array")),this.patterns.embedding&&(Array.isArray(this.patterns.embedding.patterns)||this.patterns.errors.push("Embedding patterns file missing patterns array")),this.patterns.reasoning&&(Array.isArray(this.patterns.reasoning.patterns)||this.patterns.errors.push("Reasoning patterns file missing patterns array"))}async ensureLoaded(){this.patterns.loadedAt||await this.loadPatterns()}async getIndex(){return await this.ensureLoaded(),this.patterns.index}async getBoosterPatterns(){return await this.ensureLoaded(),this.patterns.booster}async getRouterPatterns(){return await this.ensureLoaded(),this.patterns.router}async getEmbeddingPatterns(){return await this.ensureLoaded(),this.patterns.embedding}async getReasoningPatterns(){return await this.ensureLoaded(),this.patterns.reasoning}async getBoosterPatternByKey(e){let t=await this.getBoosterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getRouterPatternByKey(e){let t=await this.getRouterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEmbeddingPatternByKey(e){let t=await this.getEmbeddingPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getReasoningPatternByKey(e){let t=await this.getReasoningPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEligibleBoosterTransforms(){let e=await this.getBoosterPatternByKey("booster-transform-eligibility");return e?e.eligibility_criteria.simple_transforms:[]}async getTierHierarchy(){let e=await this.getRouterPatternByKey("router-5tier-complexity");return e?e.tier_hierarchy:null}async getQualityGateThresholds(){let e=await this.getReasoningPatternByKey("reasoning-pattern-quality-gates");return e?e.gate_thresholds:null}isLoaded(){return this.patterns.loadedAt!==null}getLoadedAt(){return this.patterns.loadedAt}getErrors(){return[...this.patterns.errors]}async getStatistics(){let e=await this.getIndex();return e?e.pattern_statistics:null}async reload(){this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]},await this.loadPatterns()}async getAllPatterns(){return await this.ensureLoaded(),{...this.patterns}}};function x(){return s.getInstance()}export{x as a};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.5");process.exit(0)}
2
- import{c as s,e as t}from"./chunk-S7HQOGVD.js";var K={};t(K,{DEFAULT_FEATURE_FLAGS:()=>r,getRuVectorFeatureFlags:()=>i,getRvfMigrationStage:()=>H,initFeatureFlagsFromEnv:()=>z,isAgentMemoryBranchingEnabled:()=>I,isCNNVisualRegressionEnabled:()=>b,isCognitiveRoutingEnabled:()=>Y,isCoherenceActionGateEnabled:()=>A,isCoherenceGateEnabled:()=>f,isColdTierGNNEnabled:()=>m,isCrossDomainTransferEnabled:()=>N,isCusumDriftDetectionEnabled:()=>M,isDAGAttentionEnabled:()=>g,isDeltaEventSourcingEnabled:()=>F,isDeterministicDitherEnabled:()=>C,isEpropOnlineLearningEnabled:()=>Q,isEwcPlusPlusEnabled:()=>L,isFlashAttentionEnabled:()=>E,isGNNIndexEnabled:()=>R,isGrangerCausalityEnabled:()=>B,isGraphMAEEnabled:()=>x,isHDCFingerprintingEnabled:()=>D,isHnswHealthMonitorEnabled:()=>U,isHopfieldMemoryEnabled:()=>h,isHyperbolicHnswEnabled:()=>k,isMetaLearningEnabled:()=>P,isMetadataFilteringEnabled:()=>S,isNativeHNSWEnabled:()=>_,isNeuralRoutingEnabled:()=>T,isRVFPatternStoreEnabled:()=>V,isReasoningQECEnabled:()=>v,isRegretTrackingEnabled:()=>O,isReservoirReplayEnabled:()=>w,isSONAEnabled:()=>a,isSONAThreeLoopEnabled:()=>p,isSpectralSparsificationEnabled:()=>W,isSublinearSolverEnabled:()=>y,isTemporalCompressionEnabled:()=>c,isUnifiedHnswEnabled:()=>G,isWitnessChainEnabled:()=>d,resetRuVectorFeatureFlags:()=>u,setRuVectorFeatureFlags:()=>o,shouldLogMigrationMetrics:()=>l});function i(){return{...e}}function o(n){e={...e,...n}}function u(){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 C(){return e.useDeterministicDither}function T(){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 M(){return e.useCusumDriftDetection}function F(){return e.useDeltaEventSourcing}function L(){return e.useEwcPlusPlusRegularization}function x(){return e.useGraphMAEEmbeddings}function h(){return e.useHopfieldMemory}function m(){return e.useColdTierGNN}function P(){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_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,i as b,o as c,u as d,a as e,E as f,R as g,l as h,_ as i,c as j,S as k,C as l,T 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,M as C,F as D,L as E,x as F,h as G,m as H,P 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.10.6");process.exit(0)}
2
+ import{c as s,e as t}from"./chunk-UNDPB5SS.js";var K={};t(K,{DEFAULT_FEATURE_FLAGS:()=>r,getRuVectorFeatureFlags:()=>i,getRvfMigrationStage:()=>H,initFeatureFlagsFromEnv:()=>z,isAgentMemoryBranchingEnabled:()=>I,isCNNVisualRegressionEnabled:()=>b,isCognitiveRoutingEnabled:()=>Y,isCoherenceActionGateEnabled:()=>A,isCoherenceGateEnabled:()=>f,isColdTierGNNEnabled:()=>m,isCrossDomainTransferEnabled:()=>N,isCusumDriftDetectionEnabled:()=>M,isDAGAttentionEnabled:()=>g,isDeltaEventSourcingEnabled:()=>F,isDeterministicDitherEnabled:()=>C,isEpropOnlineLearningEnabled:()=>Q,isEwcPlusPlusEnabled:()=>L,isFlashAttentionEnabled:()=>E,isGNNIndexEnabled:()=>R,isGrangerCausalityEnabled:()=>B,isGraphMAEEnabled:()=>x,isHDCFingerprintingEnabled:()=>D,isHnswHealthMonitorEnabled:()=>U,isHopfieldMemoryEnabled:()=>h,isHyperbolicHnswEnabled:()=>k,isMetaLearningEnabled:()=>P,isMetadataFilteringEnabled:()=>S,isNativeHNSWEnabled:()=>_,isNeuralRoutingEnabled:()=>T,isRVFPatternStoreEnabled:()=>V,isReasoningQECEnabled:()=>v,isRegretTrackingEnabled:()=>O,isReservoirReplayEnabled:()=>w,isSONAEnabled:()=>a,isSONAThreeLoopEnabled:()=>p,isSpectralSparsificationEnabled:()=>W,isSublinearSolverEnabled:()=>y,isTemporalCompressionEnabled:()=>c,isUnifiedHnswEnabled:()=>G,isWitnessChainEnabled:()=>d,resetRuVectorFeatureFlags:()=>u,setRuVectorFeatureFlags:()=>o,shouldLogMigrationMetrics:()=>l});function i(){return{...e}}function o(n){e={...e,...n}}function u(){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 C(){return e.useDeterministicDither}function T(){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 M(){return e.useCusumDriftDetection}function F(){return e.useDeltaEventSourcing}function L(){return e.useEwcPlusPlusRegularization}function x(){return e.useGraphMAEEmbeddings}function h(){return e.useHopfieldMemory}function m(){return e.useColdTierGNN}function P(){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_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,i as b,o as c,u as d,a as e,E as f,R as g,l as h,_ as i,c as j,S as k,C as l,T 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,M as C,F as D,L as E,x as F,h as G,m as H,P 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.10.5");process.exit(0)}
2
- import{c as N,g as O,i as L}from"./chunk-J533CJUN.js";import{i as R,m as D}from"./chunk-R573V37S.js";import{b as g,d as w}from"./chunk-56RA6YPN.js";import{a as p,c as q}from"./chunk-S73KENCH.js";import{i as h}from"./chunk-7DU35D4M.js";import{a as S,b as C}from"./chunk-KIMJPTHD.js";C();w();q();D();function y(E,e){let n=E.prepare("SELECT confidence, usage_count, successful_uses FROM qe_patterns WHERE id = ?").get(e.patternId);if(!n)return{updated:!1};let t=e.success?1:0,r=n.usage_count+1,a=n.successful_uses+t,s=a/r,i=Math.min(1,r/100),o=n.confidence*.3+i*.2+s*.5,c=E.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.10.6");process.exit(0)}
2
+ import{c as N,g as O,i as L}from"./chunk-J2SMTP2L.js";import{i as R,m as D}from"./chunk-RA7HEY5G.js";import{b as g,d as w}from"./chunk-DFBVWMX3.js";import{a as p,c as q}from"./chunk-O4MNYX4X.js";import{i as h}from"./chunk-BHD6THT5.js";import{a as S,b as C}from"./chunk-7NXVVIJZ.js";C();w();q();D();function y(E,e){let n=E.prepare("SELECT confidence, usage_count, successful_uses FROM qe_patterns WHERE id = ?").get(e.patternId);if(!n)return{updated:!1};let t=e.success?1:0,r=n.usage_count+1,a=n.successful_uses+t,s=a/r,i=Math.min(1,r/100),o=n.confidence*.3+i*.2+s*.5,c=E.prepare(`
3
3
  INSERT INTO qe_pattern_usage (pattern_id, success, metrics_json, feedback)
4
4
  VALUES (?, ?, ?, ?)
5
5
  `),m=E.prepare(`
@@ -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.10.5");process.exit(0)}
2
- import{c as f}from"./chunk-S7HQOGVD.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.10.6");process.exit(0)}
2
+ import{c as f}from"./chunk-UNDPB5SS.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,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.10.5");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.10.6");process.exit(0)}
2
2
  var P="quality-daemon",x=class{constructor(e){this.backend=e}backend;async get(e){return this.backend.kvGet(e,P)}async set(e,t){await this.backend.kvSet(e,t,P)}async search(e){return this.backend.kvSearch(e,P)}};import{cpus as Z,freemem as ee,totalmem as te,loadavg as ie}from"os";var g=class{queues={now:[],next:[],later:[]};_maxSize;constructor(e=1e3){this._maxSize=e}enqueue(e){return this.size>=this._maxSize?!1:(this.queues[e.priority].push(e),!0)}dequeue(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(;i.length>0;){let o=i.shift();if(!(o.ttlMs&&e-o.createdAt>o.ttlMs))return o}}}peek(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(let o of i)if(!o.ttlMs||e-o.createdAt<=o.ttlMs)return o}}drainPriority(e){let t=this.queues[e].splice(0),i=Date.now();return t.filter(o=>!o.ttlMs||i-o.createdAt<=o.ttlMs)}pruneExpired(){let e=0,t=Date.now();for(let i of["now","next","later"]){let o=this.queues[i].length;this.queues[i]=this.queues[i].filter(r=>!r.ttlMs||t-r.createdAt<=r.ttlMs),e+=o-this.queues[i].length}return e}get size(){return this.queues.now.length+this.queues.next.length+this.queues.later.length}get depths(){return{now:this.queues.now.length,next:this.queues.next.length,later:this.queues.later.length}}get isEmpty(){return this.size===0}clear(){this.queues.now=[],this.queues.next=[],this.queues.later=[]}};import{watch as G}from"fs";import{execFile as Q}from"child_process";import{promisify as $}from"util";import{resolve as q,join as H}from"path";import{existsSync as L,readFileSync as U}from"fs";var _=$(Q),z={repoRoot:process.cwd(),debounceMs:500,maxChangedFiles:200,pollIntervalMs:5e3},p=class{constructor(e,t){this.queue=e;this.options={...z,...t}}queue;watcher;pollTimer;options;lastKnownHeads=new Map;debounceTimer;_running=!1;_polling=!1;get running(){return this._running}async start(){if(this._running)return;let e=q(this.options.repoRoot,".git","refs","heads");if(!L(e))throw new Error(`Git refs directory not found: ${e}`);await this.snapshotHeads(),process.platform==="darwin"||process.platform==="win32"?this.watcher=G(e,{recursive:!0},(i,o)=>{o&&this.handleRefChange(o)}):(this.pollTimer=setInterval(()=>{this.poll().catch(i=>{console.debug("[GitWatcher] Poll error:",i)})},this.options.pollIntervalMs),this.pollTimer.unref?.()),this._running=!0}stop(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=void 0),this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=void 0),this.watcher&&(this.watcher.close(),this.watcher=void 0),this._running=!1}async poll(){if(this._polling)return[];this._polling=!0;let e=[];try{let{stdout:t}=await _("git",["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot});for(let i of t.trim().split(`
3
3
  `)){if(!i)continue;let[o,r]=i.split(" "),n=this.lastKnownHeads.get(o);n&&n!==r&&(e.push(o),await this.enqueueCommitAnalysis(o,r)),this.lastKnownHeads.set(o,r)}}catch{}finally{this._polling=!1}return e}handleRefChange(e){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.processRefChange(e).catch(t=>{console.debug("[GitWatcher] Error processing ref change:",t)})},this.options.debounceMs)}async processRefChange(e){let t=e.replace(/\\/g,"/"),i=q(this.options.repoRoot,".git","refs","heads"),o=H(i,e),r;try{r=U(o,"utf-8").trim()}catch{return}this.lastKnownHeads.get(t)!==r&&(this.lastKnownHeads.set(t,r),await this.enqueueCommitAnalysis(t,r))}async enqueueCommitAnalysis(e,t){let i=[];try{let{stdout:n}=await _("git",["diff-tree","--no-commit-id","--name-only","-r",t],{cwd:this.options.repoRoot});i=n.trim().split(`
4
4
  `).filter(Boolean).slice(0,this.options.maxChangedFiles)}catch{}let o={type:"git_commit",branch:e,commitHash:t,changedFiles:i},r={id:`git-${t}-${Date.now()}`,priority:"next",payload:o,createdAt:Date.now(),source:"git-watcher",ttlMs:300*1e3};this.queue.enqueue(r)}async snapshotHeads(){try{let{stdout:e}=await _("git",["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot});for(let t of e.trim().split(`
@@ -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.10.5");process.exit(0)}
2
- function b(i,t){return{ingest(e){i.ingest(e)},search(e,r){return i.search(e,r).map(n=>({id:n.id,score:n.score}))},delete(e){i.delete(e)},status(){let e=i.status();return{totalVectors:e.totalVectors,dimensions:t,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries}},close(){i.close()},compact(){return i.compact()}}}function c(i,t){return(i.prepare("SELECT COUNT(*) as cnt FROM sqlite_master WHERE type='table' AND name=?").get(t)?.cnt??0)>0}var d=class{db;config;rvfStore=null;rvfAvailable=!1;constructor(t,e){this.db=t,this.config={...e,dimensions:e.dimensions??384}}async initialize(){if(this.config.mode==="sqlite-only"){this.rvfAvailable=!1;return}try{let t=await import("./rvf-native-adapter-7RXP2Q4Q.js");if(!t.isRvfNativeAvailable()){this.rvfAvailable=!1;return}let e;try{e=t.openRvfStore(this.config.rvfPath)}catch{e=t.createRvfStore(this.config.rvfPath,this.config.dimensions)}this.rvfStore=b(e,this.config.dimensions),this.rvfAvailable=!0}catch{this.rvfAvailable=!1}}setRvfStore(t){this.rvfStore=t,this.rvfAvailable=!0}writePattern(t,e){let r={sqliteSuccess:!1,rvfSuccess:!1};try{this.writeSqliteEmbedding(t,e),r.sqliteSuccess=!0}catch{r.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.ingest([{id:t,vector:e instanceof Float32Array?Array.from(e):e}]),r.rvfSuccess=!0}catch{r.rvfSuccess=!1,r.divergence="rvf-write-failed"}return r}deletePattern(t){let e={sqliteSuccess:!1,rvfSuccess:!1};try{this.deleteSqliteEmbedding(t),e.sqliteSuccess=!0}catch{e.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.delete([t]),e.rvfSuccess=!0}catch{e.rvfSuccess=!1,e.divergence="rvf-delete-failed"}return e}search(t,e){if(this.config.mode==="rvf-primary"&&this.rvfAvailable&&this.rvfStore)try{return this.rvfStore.search(t,e)}catch{}return this.searchSqlite(t,e)}getDivergenceReport(){let t={totalChecked:0,divergences:0,details:[]},e=this.getSqliteEmbeddingCount();if(t.totalChecked=e,!this.rvfAvailable||!this.rvfStore)return this.config.mode!=="sqlite-only"&&e>0&&(t.divergences=1,t.details.push({patternId:"*",issue:"count-mismatch"})),t;let n=this.rvfStore.status().totalVectors;return e!==n&&(t.divergences=1,t.details.push({patternId:"*",issue:"count-mismatch"})),t}isPromotionSafe(){return this.getDivergenceReport().divergences===0}status(){let t=this.getSqlitePatternCount(),e=this.getSqliteEmbeddingCount(),r=null;if(this.rvfAvailable&&this.rvfStore)try{r=this.rvfStore.status()}catch{r=null}return{sqlite:{patternCount:t,vectorCount:e},rvf:r,mode:this.config.mode}}close(){if(this.rvfStore){try{this.rvfStore.close()}catch{}this.rvfStore=null,this.rvfAvailable=!1}}compact(){if(!this.rvfStore||!this.rvfAvailable||!this.rvfStore.compact)return null;try{return this.rvfStore.compact()??null}catch{return null}}shouldWriteRvf(){return(this.config.mode==="dual-write"||this.config.mode==="rvf-primary")&&this.rvfAvailable&&this.rvfStore!==null}writeSqliteEmbedding(t,e){let r=Buffer.from(e instanceof Float32Array?e.buffer:new Float32Array(e).buffer),n=e.length;c(this.db,"qe_pattern_embeddings")&&this.db.prepare(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.6");process.exit(0)}
2
+ function b(i,t){return{ingest(e){i.ingest(e)},search(e,r){return i.search(e,r).map(n=>({id:n.id,score:n.score}))},delete(e){i.delete(e)},status(){let e=i.status();return{totalVectors:e.totalVectors,dimensions:t,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries}},close(){i.close()},compact(){return i.compact()}}}function c(i,t){return(i.prepare("SELECT COUNT(*) as cnt FROM sqlite_master WHERE type='table' AND name=?").get(t)?.cnt??0)>0}var d=class{db;config;rvfStore=null;rvfAvailable=!1;constructor(t,e){this.db=t,this.config={...e,dimensions:e.dimensions??384}}async initialize(){if(this.config.mode==="sqlite-only"){this.rvfAvailable=!1;return}try{let t=await import("./rvf-native-adapter-UN3ESMMW.js");if(!t.isRvfNativeAvailable()){this.rvfAvailable=!1;return}let e;try{e=t.openRvfStore(this.config.rvfPath)}catch{e=t.createRvfStore(this.config.rvfPath,this.config.dimensions)}this.rvfStore=b(e,this.config.dimensions),this.rvfAvailable=!0}catch{this.rvfAvailable=!1}}setRvfStore(t){this.rvfStore=t,this.rvfAvailable=!0}writePattern(t,e){let r={sqliteSuccess:!1,rvfSuccess:!1};try{this.writeSqliteEmbedding(t,e),r.sqliteSuccess=!0}catch{r.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.ingest([{id:t,vector:e instanceof Float32Array?Array.from(e):e}]),r.rvfSuccess=!0}catch{r.rvfSuccess=!1,r.divergence="rvf-write-failed"}return r}deletePattern(t){let e={sqliteSuccess:!1,rvfSuccess:!1};try{this.deleteSqliteEmbedding(t),e.sqliteSuccess=!0}catch{e.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.delete([t]),e.rvfSuccess=!0}catch{e.rvfSuccess=!1,e.divergence="rvf-delete-failed"}return e}search(t,e){if(this.config.mode==="rvf-primary"&&this.rvfAvailable&&this.rvfStore)try{return this.rvfStore.search(t,e)}catch{}return this.searchSqlite(t,e)}getDivergenceReport(){let t={totalChecked:0,divergences:0,details:[]},e=this.getSqliteEmbeddingCount();if(t.totalChecked=e,!this.rvfAvailable||!this.rvfStore)return this.config.mode!=="sqlite-only"&&e>0&&(t.divergences=1,t.details.push({patternId:"*",issue:"count-mismatch"})),t;let n=this.rvfStore.status().totalVectors;return e!==n&&(t.divergences=1,t.details.push({patternId:"*",issue:"count-mismatch"})),t}isPromotionSafe(){return this.getDivergenceReport().divergences===0}status(){let t=this.getSqlitePatternCount(),e=this.getSqliteEmbeddingCount(),r=null;if(this.rvfAvailable&&this.rvfStore)try{r=this.rvfStore.status()}catch{r=null}return{sqlite:{patternCount:t,vectorCount:e},rvf:r,mode:this.config.mode}}close(){if(this.rvfStore){try{this.rvfStore.close()}catch{}this.rvfStore=null,this.rvfAvailable=!1}}compact(){if(!this.rvfStore||!this.rvfAvailable||!this.rvfStore.compact)return null;try{return this.rvfStore.compact()??null}catch{return null}}shouldWriteRvf(){return(this.config.mode==="dual-write"||this.config.mode==="rvf-primary")&&this.rvfAvailable&&this.rvfStore!==null}writeSqliteEmbedding(t,e){let r=Buffer.from(e instanceof Float32Array?e.buffer:new Float32Array(e).buffer),n=e.length;c(this.db,"qe_pattern_embeddings")&&this.db.prepare(`
3
3
  INSERT INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model, created_at)
4
4
  VALUES (?, ?, ?, 'all-MiniLM-L6-v2', datetime('now'))
5
5
  ON CONFLICT(pattern_id) DO UPDATE SET
@@ -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.10.5");process.exit(0)}
2
- import{a as h}from"./chunk-DIJ74M7V.js";import{a as C,f as x}from"./chunk-NKW7VOZV.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.10.6");process.exit(0)}
2
+ import{a as C,f as x}from"./chunk-SHVTMMJB.js";import{a as h}from"./chunk-7OK5H6ML.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,11 +1,11 @@
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.10.5");process.exit(0)}
2
- import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./chunk-D7NKRCIL.js";import{b as L,d as Z}from"./chunk-56RA6YPN.js";import{a as De}from"./chunk-RLZDXQNM.js";import{c as Q}from"./chunk-VC256KH2.js";import{a as V,c as be}from"./chunk-S73KENCH.js";import{a as J,b as ye}from"./chunk-KIMJPTHD.js";import{a as ee,d as v,e as te,f as ne}from"./chunk-HPKYIK7R.js";import{a as O,e as ve}from"./chunk-RONMVGCT.js";import{c as R,e as Oe}from"./chunk-S7HQOGVD.js";function I(i){if(!q.has(i))throw new Error(`Invalid table name: "${i}" is not in the allowlist`);return i}function ze(i){let e=i.split(".");if(e.length>2)throw new Error(`Invalid SQL identifier: "${i}" has too many parts (max: schema.table)`);for(let t of e)if(!re.test(t))throw new Error(`Invalid SQL identifier: "${i}" \u2014 part "${t}" does not match pattern ${re}`);return i}var q,re,z=R(()=>{"use strict";q=new Set(["schema_version","kv_store","vectors","rl_q_values","goap_goals","goap_actions","goap_plans","goap_plan_signatures","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","sona_patterns","sona_fisher_matrices","test_outcomes","routing_outcomes","coverage_sessions","patterns","hypergraph_nodes","hypergraph_edges","hypergraph_vertices","hypergraph_hyperedges","hypergraph_edge_vertices","hypergraph_vertex_properties","hypergraph_edge_properties","captured_experiences","experience_applications","witness_chain","witness_chain_receipts","witness_chain_archive","trajectories","trajectory_steps","pattern_evolution_events","pattern_relationships","pattern_versions","learning_daily_snapshots","metrics_outcomes","experience_consolidation_log","qe_pattern_reuse","qe_agent_co_execution"]);re=/^[a-z_][a-z0-9_]{0,62}$/});var D,se,oe,ie,ae,ce,Te,Ee,de,ue,le,pe,ge=R(()=>{"use strict";Xe();D=9,se=`
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.10.6");process.exit(0)}
2
+ import{d as G,f as we}from"./chunk-UQYDFT6I.js";import{a as ye}from"./chunk-434VUSZP.js";import{c as J}from"./chunk-F72A356B.js";import{a as q,b,c as Fe}from"./chunk-QJXZ4SU7.js";import{b as L,d as ee}from"./chunk-DFBVWMX3.js";import{a as k,c as Ue}from"./chunk-JPL53G4V.js";import{a as Q,c as ve}from"./chunk-O4MNYX4X.js";import{a as Z,b as Xe}from"./chunk-7NXVVIJZ.js";import{a as te,d as v,e as ne,f as re}from"./chunk-T6SCQVWH.js";import{a as O,e as De}from"./chunk-MSJGDIRP.js";import{c as R,e as be}from"./chunk-UNDPB5SS.js";function I(i){if(!z.has(i))throw new Error(`Invalid table name: "${i}" is not in the allowlist`);return i}function Be(i){let e=i.split(".");if(e.length>2)throw new Error(`Invalid SQL identifier: "${i}" has too many parts (max: schema.table)`);for(let t of e)if(!se.test(t))throw new Error(`Invalid SQL identifier: "${i}" \u2014 part "${t}" does not match pattern ${se}`);return i}var z,se,j=R(()=>{"use strict";z=new Set(["schema_version","kv_store","vectors","rl_q_values","goap_goals","goap_actions","goap_plans","goap_plan_signatures","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","sona_patterns","sona_fisher_matrices","test_outcomes","routing_outcomes","coverage_sessions","patterns","hypergraph_nodes","hypergraph_edges","hypergraph_vertices","hypergraph_hyperedges","hypergraph_edge_vertices","hypergraph_vertex_properties","hypergraph_edge_properties","captured_experiences","experience_applications","witness_chain","witness_chain_receipts","witness_chain_archive","trajectories","trajectory_steps","pattern_evolution_events","pattern_relationships","pattern_versions","learning_daily_snapshots","metrics_outcomes","experience_consolidation_log","qe_pattern_reuse","qe_agent_co_execution"]);se=/^[a-z_][a-z0-9_]{0,62}$/});var D,oe,ie,ae,ce,Te,Ee,de,ue,le,pe,ge,me=R(()=>{"use strict";we();Ue();D=10,oe=`
3
3
  CREATE TABLE IF NOT EXISTS schema_version (
4
4
  id INTEGER PRIMARY KEY CHECK (id = 1),
5
5
  version INTEGER NOT NULL,
6
6
  migrated_at TEXT DEFAULT (datetime('now'))
7
7
  );
8
- `,oe=`
8
+ `,ie=`
9
9
  -- Key-Value Store (v2 compatible - same schema as HybridBackend)
10
10
  CREATE TABLE IF NOT EXISTS kv_store (
11
11
  key TEXT NOT NULL,
@@ -17,7 +17,7 @@ import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./c
17
17
  );
18
18
  CREATE INDEX IF NOT EXISTS idx_kv_namespace ON kv_store(namespace);
19
19
  CREATE INDEX IF NOT EXISTS idx_kv_expires ON kv_store(expires_at) WHERE expires_at IS NOT NULL;
20
- `,ie=`
20
+ `,ae=`
21
21
  -- Vector Embeddings (new in v3 - replaces in-memory AgentDB)
22
22
  CREATE TABLE IF NOT EXISTS vectors (
23
23
  id TEXT PRIMARY KEY,
@@ -30,7 +30,7 @@ import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./c
30
30
  );
31
31
  CREATE INDEX IF NOT EXISTS idx_vectors_namespace ON vectors(namespace);
32
32
  CREATE INDEX IF NOT EXISTS idx_vectors_dimensions ON vectors(dimensions);
33
- `,ae=`
33
+ `,ce=`
34
34
  -- Q-Values for RL algorithms (ADR-046)
35
35
  CREATE TABLE IF NOT EXISTS rl_q_values (
36
36
  id TEXT PRIMARY KEY,
@@ -51,7 +51,7 @@ import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./c
51
51
  CREATE INDEX IF NOT EXISTS idx_qvalues_state ON rl_q_values(agent_id, state_key);
52
52
  CREATE INDEX IF NOT EXISTS idx_qvalues_domain ON rl_q_values(domain);
53
53
  CREATE INDEX IF NOT EXISTS idx_qvalues_updated ON rl_q_values(updated_at);
54
- `,ce=`
54
+ `,Te=`
55
55
  -- GOAP Goals
56
56
  CREATE TABLE IF NOT EXISTS goap_goals (
57
57
  id TEXT PRIMARY KEY,
@@ -117,7 +117,7 @@ import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./c
117
117
  CREATE INDEX IF NOT EXISTS idx_goap_actions_agent ON goap_actions(agent_type);
118
118
  CREATE INDEX IF NOT EXISTS idx_goap_plans_status ON goap_plans(status);
119
119
  CREATE INDEX IF NOT EXISTS idx_goap_sig_goal ON goap_plan_signatures(goal_hash);
120
- `,Te=`
120
+ `,Ee=`
121
121
  -- Concept Graph Nodes (Dream Engine)
122
122
  CREATE TABLE IF NOT EXISTS concept_nodes (
123
123
  id TEXT PRIMARY KEY,
@@ -186,7 +186,7 @@ import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./c
186
186
  CREATE INDEX IF NOT EXISTS idx_edge_weight ON concept_edges(weight DESC);
187
187
  CREATE INDEX IF NOT EXISTS idx_insight_cycle ON dream_insights(cycle_id);
188
188
  CREATE INDEX IF NOT EXISTS idx_dream_status ON dream_cycles(status);
189
- `,Ee=`
189
+ `,de=`
190
190
  -- QE Patterns table (unified from sqlite-persistence.ts)
191
191
  CREATE TABLE IF NOT EXISTS qe_patterns (
192
192
  id TEXT PRIMARY KEY,
@@ -336,7 +336,7 @@ import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./c
336
336
  CREATE INDEX IF NOT EXISTS idx_execution_results_status ON execution_results(status);
337
337
  CREATE INDEX IF NOT EXISTS idx_executed_steps_execution ON executed_steps(execution_id);
338
338
  CREATE INDEX IF NOT EXISTS idx_executed_steps_action ON executed_steps(action_id);
339
- `,de=`
339
+ `,ue=`
340
340
  -- MinCut Graph Snapshots (ADR-047)
341
341
  CREATE TABLE IF NOT EXISTS mincut_snapshots (
342
342
  id TEXT PRIMARY KEY,
@@ -442,7 +442,7 @@ import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./c
442
442
  CREATE INDEX IF NOT EXISTS idx_mincut_healing_type ON mincut_healing_actions(action_type);
443
443
  CREATE INDEX IF NOT EXISTS idx_mincut_healing_success ON mincut_healing_actions(success);
444
444
  CREATE INDEX IF NOT EXISTS idx_mincut_observations_iter ON mincut_observations(iteration);
445
- `,ue=`
445
+ `,le=`
446
446
  -- SONA Patterns table (ADR-046: Pattern Persistence for Neural Backbone)
447
447
  CREATE TABLE IF NOT EXISTS sona_patterns (
448
448
  id TEXT PRIMARY KEY,
@@ -468,7 +468,7 @@ import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./c
468
468
  CREATE INDEX IF NOT EXISTS idx_sona_patterns_domain ON sona_patterns(domain);
469
469
  CREATE INDEX IF NOT EXISTS idx_sona_patterns_confidence ON sona_patterns(confidence DESC);
470
470
  CREATE INDEX IF NOT EXISTS idx_sona_patterns_updated ON sona_patterns(updated_at DESC);
471
- `,le=`
471
+ `,pe=`
472
472
  -- Test outcomes (ADR-023: Quality Feedback Loop)
473
473
  CREATE TABLE IF NOT EXISTS test_outcomes (
474
474
  id TEXT PRIMARY KEY,
@@ -551,16 +551,16 @@ import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./c
551
551
  CREATE INDEX IF NOT EXISTS idx_coverage_sessions_technique ON coverage_sessions(technique);
552
552
  CREATE INDEX IF NOT EXISTS idx_coverage_sessions_agent ON coverage_sessions(agent_id);
553
553
  CREATE INDEX IF NOT EXISTS idx_coverage_sessions_created ON coverage_sessions(created_at);
554
- `,pe=["kv_store","vectors","rl_q_values","goap_actions","goap_goals","goap_plans","goap_plan_signatures","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","hypergraph_nodes","hypergraph_edges","sona_patterns","witness_chain"]});function y(i,e,t){let n={value:e,timestamp:t??(e!==void 0?Date.now():0),nodeId:e!==void 0?i:"",version:e!==void 0?1:0,lastUpdated:Date.now()};function E(o,c,u,d){return o!==u?o-u:c.localeCompare(d)}return{get(){return n.value},set(o,c){let u=c??Date.now();(n.timestamp===0||E(u,i,n.timestamp,n.nodeId)>0)&&(n={value:o,timestamp:u,nodeId:i,version:n.version+1,lastUpdated:Date.now()})},merge(o){let c=o.getState();this.applyState(c)},getState(){return{value:n.value,timestamp:n.timestamp,nodeId:n.nodeId,version:n.version,lastUpdated:n.lastUpdated}},applyState(o){(n.timestamp===0||E(o.timestamp,o.nodeId,n.timestamp,n.nodeId)>0)&&(n={value:o.value,timestamp:o.timestamp,nodeId:o.nodeId,version:Math.max(n.version,o.version)+1,lastUpdated:Date.now()})},getNodeId(){return i},getTimestamp(){return n.timestamp}}}function X(i,e){let t=y(i);return t.applyState(e),t}var j=R(()=>{"use strict"});function C(i){let e={counts:{},version:0,lastUpdated:Date.now()};return e.counts[i]=0,{get(){return Object.values(e.counts).reduce((t,n)=>t+n,0)},increment(t=1){if(t<0)throw new Error("G-Counter can only increment by positive values");t!==0&&(e.counts[i]=(e.counts[i]||0)+t,e.version++,e.lastUpdated=Date.now())},merge(t){let n=t.getState();this.applyState(n)},getState(){return{counts:{...e.counts},version:e.version,lastUpdated:e.lastUpdated}},applyState(t){let n=!1;for(let[E,o]of Object.entries(t.counts)){let c=e.counts[E]||0;o>c&&(e.counts[E]=o,n=!0)}n&&(e.version=Math.max(e.version,t.version)+1,e.lastUpdated=Date.now())},getNodeId(){return i},getLocalCount(){return e.counts[i]||0}}}function w(i,e){let t=C(i);return t.applyState(e),t}var U=R(()=>{"use strict"});function F(i){let e=C(i),t=C(i),n=0,E=Date.now();return{get(){return e.get()-t.get()},increment(o=1){if(o<0)throw new Error("Use decrement() for negative values");o!==0&&(e.increment(o),n++,E=Date.now())},decrement(o=1){if(o<0)throw new Error("Use increment() for negative values");o!==0&&(t.increment(o),n++,E=Date.now())},merge(o){let c=o.getState();this.applyState(c)},getState(){return{positive:e.getState(),negative:t.getState(),version:n,lastUpdated:E}},applyState(o){let c=this.get();e.applyState(o.positive),t.applyState(o.negative);let u=this.get();c!==u&&(n=Math.max(n,o.version)+1,E=Date.now())},getNodeId(){return i}}}function x(i,e){let t=F(i);return t.applyState(e),t}var B=R(()=>{"use strict";U()});function Ue(i,e){return`${i}:${Date.now()}:${e}`}function W(i){return typeof i=="string"?`s:${i}`:typeof i=="number"?`n:${i}`:typeof i=="boolean"?`b:${i}`:`j:${JSON.stringify(i)}`}function Fe(i){let e=i.substring(0,2),t=i.substring(2);switch(e){case"s:":return t;case"n:":return Number(t);case"b:":return t==="true";case"j:":return L(t);default:throw new Error(`Unknown serialization type: ${e}`)}}function M(i){let e=new Map,t=new Map,n=0,E=Date.now(),o=0;function c(d){let T=e.get(d);if(!T||T.size===0)return!1;let l=t.get(d);if(!l||l.size===0)return!0;for(let g of T)if(!l.has(g))return!0;return!1}function u(d){let T=e.get(d);if(!T)return new Set;let l=t.get(d)||new Set,g=new Set;for(let p of T)l.has(p)||g.add(p);return g}return{has(d){let T=W(d);return c(T)},values(){let d=[];for(let[T]of e)c(T)&&d.push(Fe(T));return d},size(){let d=0;for(let[T]of e)c(T)&&d++;return d},add(d){let T=W(d),l=Ue(i,o++);e.has(T)||e.set(T,new Set),e.get(T).add(l),n++,E=Date.now()},remove(d){let T=W(d),l=e.get(T);if(!l||l.size===0)return;t.has(T)||t.set(T,new Set);let g=t.get(T);for(let p of l)g.add(p);n++,E=Date.now()},merge(d){let T=d.getState();this.applyState(T)},getState(){let d={};for(let[l,g]of e)d[l]=Array.from(g);let T={};for(let[l,g]of t)g.size>0&&(T[l]=Array.from(g));return{elements:d,tombstones:T,version:n,lastUpdated:E}},applyState(d){let T=!1;for(let[l,g]of Object.entries(d.elements)){e.has(l)||e.set(l,new Set);let p=e.get(l);for(let f of g)p.has(f)||(p.add(f),T=!0)}for(let[l,g]of Object.entries(d.tombstones)){t.has(l)||t.set(l,new Set);let p=t.get(l);for(let f of g)p.has(f)||(p.add(f),T=!0)}T&&(n=Math.max(n,d.version)+1,E=Date.now())},getNodeId(){return i},clear(){for(let[d,T]of e){t.has(d)||t.set(d,new Set);let l=t.get(d);for(let g of T)l.add(g)}n++,E=Date.now()}}}function P(i,e){let t=M(i);return t.applyState(e),t}var Y=R(()=>{"use strict";Z()});function H(i){let e={...xe,...i},{nodeId:t,enableDeltaTracking:n,maxDeltaHistory:E}=e,o=new Map,c=new Map,u=new Map,d=new Map,T=0,l=[],g=new Set,p={registers:new Set,gCounters:new Set,pnCounters:new Set,sets:new Set};function f(s,r,a){let _={key:s,type:r,operation:a,timestamp:Date.now(),nodeId:t};for(let Ie of g)try{Ie(_)}catch(Ae){console.error("[CRDTStore] Error in change listener:",Ae)}}function N(s,r){T++,n&&p[s].add(r)}function K(){if(!n||!(p.registers.size>0||p.gCounters.size>0||p.pnCounters.size>0||p.sets.size>0))return;let r={fromVersion:l.length>0?l[l.length-1].toVersion:0,toVersion:T,timestamp:Date.now(),nodeId:t};if(p.registers.size>0){r.registers={};for(let a of p.registers){let _=o.get(a);_&&(r.registers[a]=_.getState())}p.registers.clear()}if(p.gCounters.size>0){r.gCounters={};for(let a of p.gCounters){let _=c.get(a);_&&(r.gCounters[a]=_.getState())}p.gCounters.clear()}if(p.pnCounters.size>0){r.pnCounters={};for(let a of p.pnCounters){let _=u.get(a);_&&(r.pnCounters[a]=_.getState())}p.pnCounters.clear()}if(p.sets.size>0){r.sets={};for(let a of p.sets){let _=d.get(a);_&&(r.sets[a]=_.getState())}p.sets.clear()}for(l.push(r);l.length>E;)l.shift()}let h={getRegister(s){return o.has(s)||o.set(s,y(t)),o.get(s)},setRegister(s,r){h.getRegister(s).set(r),N("registers",s),f(s,"lww-register","set")},hasRegister(s){return o.has(s)},deleteRegister(s){let r=o.delete(s);return r&&N("registers",s),r},getGCounter(s){return c.has(s)||c.set(s,C(t)),c.get(s)},incrementGCounter(s,r){h.getGCounter(s).increment(r),N("gCounters",s),f(s,"g-counter","increment")},hasGCounter(s){return c.has(s)},deleteGCounter(s){let r=c.delete(s);return r&&N("gCounters",s),r},getCounter(s){return u.has(s)||u.set(s,F(t)),u.get(s)},incrementCounter(s,r){h.getCounter(s).increment(r),N("pnCounters",s),f(s,"pn-counter","increment")},decrementCounter(s,r){h.getCounter(s).decrement(r),N("pnCounters",s),f(s,"pn-counter","decrement")},hasCounter(s){return u.has(s)},deleteCounter(s){let r=u.delete(s);return r&&N("pnCounters",s),r},getSet(s){return d.has(s)||d.set(s,M(t)),d.get(s)},addToSet(s,r){h.getSet(s).add(r),N("sets",s),f(s,"or-set","add")},removeFromSet(s,r){h.getSet(s).remove(r),N("sets",s),f(s,"or-set","remove")},hasSet(s){return d.has(s)},deleteSet(s){let r=d.delete(s);return r&&N("sets",s),r},merge(s){let r=s.getState();h.applyState(r)},getState(){K();let s={version:T,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let[r,a]of o)s.registers[r]=a.getState();for(let[r,a]of c)s.gCounters[r]=a.getState();for(let[r,a]of u)s.pnCounters[r]=a.getState();for(let[r,a]of d)s.sets[r]=a.getState();return s},applyState(s){for(let[r,a]of Object.entries(s.registers))o.has(r)?o.get(r).applyState(a):o.set(r,X(t,a)),N("registers",r),f(r,"lww-register","merge");for(let[r,a]of Object.entries(s.gCounters))c.has(r)?c.get(r).applyState(a):c.set(r,w(t,a)),N("gCounters",r),f(r,"g-counter","merge");for(let[r,a]of Object.entries(s.pnCounters))u.has(r)?u.get(r).applyState(a):u.set(r,x(t,a)),N("pnCounters",r),f(r,"pn-counter","merge");for(let[r,a]of Object.entries(s.sets))d.has(r)?d.get(r).applyState(a):d.set(r,P(t,a)),N("sets",r),f(r,"or-set","merge");T=Math.max(T,s.version)+1},getDelta(s){if(K(),l.length===0)return s>=T,null;let r=l.filter(_=>_.toVersion>s);if(r.length===0)return null;let a={fromVersion:s,toVersion:T,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let _ of r)_.registers&&Object.assign(a.registers,_.registers),_.gCounters&&Object.assign(a.gCounters,_.gCounters),_.pnCounters&&Object.assign(a.pnCounters,_.pnCounters),_.sets&&Object.assign(a.sets,_.sets);return Object.keys(a.registers).length===0&&delete a.registers,Object.keys(a.gCounters).length===0&&delete a.gCounters,Object.keys(a.pnCounters).length===0&&delete a.pnCounters,Object.keys(a.sets).length===0&&delete a.sets,a},applyDelta(s){if(s.registers)for(let[r,a]of Object.entries(s.registers))o.has(r)?o.get(r).applyState(a):o.set(r,X(t,a)),N("registers",r),f(r,"lww-register","merge");if(s.gCounters)for(let[r,a]of Object.entries(s.gCounters))c.has(r)?c.get(r).applyState(a):c.set(r,w(t,a)),N("gCounters",r),f(r,"g-counter","merge");if(s.pnCounters)for(let[r,a]of Object.entries(s.pnCounters))u.has(r)?u.get(r).applyState(a):u.set(r,x(t,a)),N("pnCounters",r),f(r,"pn-counter","merge");if(s.sets)for(let[r,a]of Object.entries(s.sets))d.has(r)?d.get(r).applyState(a):d.set(r,P(t,a)),N("sets",r),f(r,"or-set","merge");T=Math.max(T,s.toVersion)+1},getVersion(){return T},getNodeId(){return t},on(s,r){if(s==="change")return g.add(r),()=>{g.delete(r)};throw new Error(`Unknown event type: ${s}`)},removeAllListeners(){g.clear()},keys(s){let r=[];return(!s||s==="lww-register")&&r.push(...Array.from(o.keys())),(!s||s==="g-counter")&&r.push(...Array.from(c.keys())),(!s||s==="pn-counter")&&r.push(...Array.from(u.keys())),(!s||s==="or-set")&&r.push(...Array.from(d.keys())),r},clear(){o.clear(),c.clear(),u.clear(),d.clear(),l.length=0,p.registers.clear(),p.gCounters.clear(),p.pnCounters.clear(),p.sets.clear(),T=0},getStats(){return{total:o.size+c.size+u.size+d.size,registers:o.size,gCounters:c.size,pnCounters:u.size,sets:d.size,version:T,nodeId:t,deltaHistorySize:l.length}}};return h}var xe,me=R(()=>{"use strict";j();U();B();Y();xe={nodeId:"default-node",enableDeltaTracking:!0,maxDeltaHistory:100}});var _e=R(()=>{"use strict"});var fe=R(()=>{"use strict";j();U();B();Y();me();_e()});var ke={};Oe(ke,{ALLOWED_TABLE_NAMES:()=>q,BinaryHeap:()=>ee,DEFAULT_UNIFIED_MEMORY_CONFIG:()=>he,UnifiedHnswIndex:()=>v,UnifiedMemoryManager:()=>A,clearProjectRootCache:()=>k,createHnswIndex:()=>te,findProjectRoot:()=>b,getDefaultDbPath:()=>Re,getResolvedDefaultConfig:()=>Le,getUnifiedMemory:()=>Ce,initializeUnifiedMemory:()=>Me,resetUnifiedMemory:()=>Pe,validateTableName:()=>I});import*as m from"fs";import*as Se from"os";import*as S from"path";function Re(){let i=b();return S.join(i,".agentic-qe","memory.db")}function Le(){return{...he,dbPath:Re()}}function Ce(i){return A.getInstance(i)}async function Me(i){let e=Ce(i);return await e.initialize(),e}function Pe(){A.resetInstance()}function Ge(){if(Ne)return;Ne=!0;let i=()=>{try{let e=A.instance;e&&e.close()}catch(e){console.debug("[UnifiedMemory] Cleanup error:",e instanceof Error?e.message:e)}};process.on("beforeExit",i),process.on("SIGINT",()=>{i(),process.exit(0)}),process.on("SIGTERM",()=>{i(),process.exit(0)})}var $,he,A,Ne,qe=R(()=>{ye();Z();be();ve();De();z();z();ne();ne();ge();fe();we();$=Q.create("unified-memory");he={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:O.MMAP_SIZE_BYTES,cacheSize:O.CACHE_SIZE_KB,busyTimeout:O.BUSY_TIMEOUT_MS,vectorDimensions:O.DEFAULT_VECTOR_DIMENSIONS};A=class i{static instance=null;static instancePromise=null;db=null;config;initialized=!1;vectorsLoaded=!1;initPromise=null;preparedStatements=new Map;vectorIndex=new v("qe-memory");crdtStore=null;constructor(e){let t=Le();if(this.config={...t,...e},!S.isAbsolute(this.config.dbPath)){let n=b();this.config.dbPath=S.join(n,this.config.dbPath)}}static getInstance(e){return i.instance||(i.instance=new i(e)),i.instance}static async getInstanceAsync(e){return i.instance?.initialized?i.instance:(i.instancePromise||(i.instancePromise=(async()=>{let t=i.getInstance(e);return await t.initialize(),t})()),i.instancePromise)}static resetInstance(){i.instance&&(i.instance.close(),i.instance=null),i.instancePromise=null,k()}async initialize(e){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize(e?.signal)),this.initPromise}async _doInitialize(e){if(!this.initialized){e?.throwIfAborted();try{let t=process.env.AQE_PROJECT_ROOT;if(t){let c=S.resolve(this.config.dbPath),u=S.resolve(t);!c.startsWith(u)&&!c.startsWith(Se.tmpdir())&&c.includes(".agentic-qe")&&(console.error(`[UnifiedMemory] WARNING: DB path "${this.config.dbPath}" points to a production .agentic-qe/ while AQE_PROJECT_ROOT="${t}". Redirecting to test-safe path.`),this.config.dbPath=S.join(t,".agentic-qe","memory.db"))}let n=S.dirname(this.config.dbPath);m.existsSync(n)||m.mkdirSync(n,{recursive:!0});let E=m.existsSync(this.config.dbPath),o=0;if(E)o=m.statSync(this.config.dbPath).size;else if(m.existsSync(n)){let c=this.findRecentBackups(n);if(c.length>0){let u=c[0];console.error(`[UnifiedMemory] CRITICAL: Database file missing but directory exists!
554
+ `,ge=["kv_store","vectors","rl_q_values","goap_actions","goap_goals","goap_plans","goap_plan_signatures","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","hypergraph_nodes","hypergraph_edges","sona_patterns","witness_chain"]});function y(i,e,t){let n={value:e,timestamp:t??(e!==void 0?Date.now():0),nodeId:e!==void 0?i:"",version:e!==void 0?1:0,lastUpdated:Date.now()};function E(o,c,u,d){return o!==u?o-u:c.localeCompare(d)}return{get(){return n.value},set(o,c){let u=c??Date.now();(n.timestamp===0||E(u,i,n.timestamp,n.nodeId)>0)&&(n={value:o,timestamp:u,nodeId:i,version:n.version+1,lastUpdated:Date.now()})},merge(o){let c=o.getState();this.applyState(c)},getState(){return{value:n.value,timestamp:n.timestamp,nodeId:n.nodeId,version:n.version,lastUpdated:n.lastUpdated}},applyState(o){(n.timestamp===0||E(o.timestamp,o.nodeId,n.timestamp,n.nodeId)>0)&&(n={value:o.value,timestamp:o.timestamp,nodeId:o.nodeId,version:Math.max(n.version,o.version)+1,lastUpdated:Date.now()})},getNodeId(){return i},getTimestamp(){return n.timestamp}}}function X(i,e){let t=y(i);return t.applyState(e),t}var B=R(()=>{"use strict"});function C(i){let e={counts:{},version:0,lastUpdated:Date.now()};return e.counts[i]=0,{get(){return Object.values(e.counts).reduce((t,n)=>t+n,0)},increment(t=1){if(t<0)throw new Error("G-Counter can only increment by positive values");t!==0&&(e.counts[i]=(e.counts[i]||0)+t,e.version++,e.lastUpdated=Date.now())},merge(t){let n=t.getState();this.applyState(n)},getState(){return{counts:{...e.counts},version:e.version,lastUpdated:e.lastUpdated}},applyState(t){let n=!1;for(let[E,o]of Object.entries(t.counts)){let c=e.counts[E]||0;o>c&&(e.counts[E]=o,n=!0)}n&&(e.version=Math.max(e.version,t.version)+1,e.lastUpdated=Date.now())},getNodeId(){return i},getLocalCount(){return e.counts[i]||0}}}function w(i,e){let t=C(i);return t.applyState(e),t}var U=R(()=>{"use strict"});function F(i){let e=C(i),t=C(i),n=0,E=Date.now();return{get(){return e.get()-t.get()},increment(o=1){if(o<0)throw new Error("Use decrement() for negative values");o!==0&&(e.increment(o),n++,E=Date.now())},decrement(o=1){if(o<0)throw new Error("Use increment() for negative values");o!==0&&(t.increment(o),n++,E=Date.now())},merge(o){let c=o.getState();this.applyState(c)},getState(){return{positive:e.getState(),negative:t.getState(),version:n,lastUpdated:E}},applyState(o){let c=this.get();e.applyState(o.positive),t.applyState(o.negative);let u=this.get();c!==u&&(n=Math.max(n,o.version)+1,E=Date.now())},getNodeId(){return i}}}function x(i,e){let t=F(i);return t.applyState(e),t}var W=R(()=>{"use strict";U()});function xe(i,e){return`${i}:${Date.now()}:${e}`}function Y(i){return typeof i=="string"?`s:${i}`:typeof i=="number"?`n:${i}`:typeof i=="boolean"?`b:${i}`:`j:${JSON.stringify(i)}`}function Me(i){let e=i.substring(0,2),t=i.substring(2);switch(e){case"s:":return t;case"n:":return Number(t);case"b:":return t==="true";case"j:":return L(t);default:throw new Error(`Unknown serialization type: ${e}`)}}function M(i){let e=new Map,t=new Map,n=0,E=Date.now(),o=0;function c(d){let T=e.get(d);if(!T||T.size===0)return!1;let l=t.get(d);if(!l||l.size===0)return!0;for(let g of T)if(!l.has(g))return!0;return!1}function u(d){let T=e.get(d);if(!T)return new Set;let l=t.get(d)||new Set,g=new Set;for(let p of T)l.has(p)||g.add(p);return g}return{has(d){let T=Y(d);return c(T)},values(){let d=[];for(let[T]of e)c(T)&&d.push(Me(T));return d},size(){let d=0;for(let[T]of e)c(T)&&d++;return d},add(d){let T=Y(d),l=xe(i,o++);e.has(T)||e.set(T,new Set),e.get(T).add(l),n++,E=Date.now()},remove(d){let T=Y(d),l=e.get(T);if(!l||l.size===0)return;t.has(T)||t.set(T,new Set);let g=t.get(T);for(let p of l)g.add(p);n++,E=Date.now()},merge(d){let T=d.getState();this.applyState(T)},getState(){let d={};for(let[l,g]of e)d[l]=Array.from(g);let T={};for(let[l,g]of t)g.size>0&&(T[l]=Array.from(g));return{elements:d,tombstones:T,version:n,lastUpdated:E}},applyState(d){let T=!1;for(let[l,g]of Object.entries(d.elements)){e.has(l)||e.set(l,new Set);let p=e.get(l);for(let f of g)p.has(f)||(p.add(f),T=!0)}for(let[l,g]of Object.entries(d.tombstones)){t.has(l)||t.set(l,new Set);let p=t.get(l);for(let f of g)p.has(f)||(p.add(f),T=!0)}T&&(n=Math.max(n,d.version)+1,E=Date.now())},getNodeId(){return i},clear(){for(let[d,T]of e){t.has(d)||t.set(d,new Set);let l=t.get(d);for(let g of T)l.add(g)}n++,E=Date.now()}}}function P(i,e){let t=M(i);return t.applyState(e),t}var H=R(()=>{"use strict";ee()});function $(i){let e={...Pe,...i},{nodeId:t,enableDeltaTracking:n,maxDeltaHistory:E}=e,o=new Map,c=new Map,u=new Map,d=new Map,T=0,l=[],g=new Set,p={registers:new Set,gCounters:new Set,pnCounters:new Set,sets:new Set};function f(s,r,a){let _={key:s,type:r,operation:a,timestamp:Date.now(),nodeId:t};for(let Ae of g)try{Ae(_)}catch(Oe){console.error("[CRDTStore] Error in change listener:",Oe)}}function N(s,r){T++,n&&p[s].add(r)}function V(){if(!n||!(p.registers.size>0||p.gCounters.size>0||p.pnCounters.size>0||p.sets.size>0))return;let r={fromVersion:l.length>0?l[l.length-1].toVersion:0,toVersion:T,timestamp:Date.now(),nodeId:t};if(p.registers.size>0){r.registers={};for(let a of p.registers){let _=o.get(a);_&&(r.registers[a]=_.getState())}p.registers.clear()}if(p.gCounters.size>0){r.gCounters={};for(let a of p.gCounters){let _=c.get(a);_&&(r.gCounters[a]=_.getState())}p.gCounters.clear()}if(p.pnCounters.size>0){r.pnCounters={};for(let a of p.pnCounters){let _=u.get(a);_&&(r.pnCounters[a]=_.getState())}p.pnCounters.clear()}if(p.sets.size>0){r.sets={};for(let a of p.sets){let _=d.get(a);_&&(r.sets[a]=_.getState())}p.sets.clear()}for(l.push(r);l.length>E;)l.shift()}let h={getRegister(s){return o.has(s)||o.set(s,y(t)),o.get(s)},setRegister(s,r){h.getRegister(s).set(r),N("registers",s),f(s,"lww-register","set")},hasRegister(s){return o.has(s)},deleteRegister(s){let r=o.delete(s);return r&&N("registers",s),r},getGCounter(s){return c.has(s)||c.set(s,C(t)),c.get(s)},incrementGCounter(s,r){h.getGCounter(s).increment(r),N("gCounters",s),f(s,"g-counter","increment")},hasGCounter(s){return c.has(s)},deleteGCounter(s){let r=c.delete(s);return r&&N("gCounters",s),r},getCounter(s){return u.has(s)||u.set(s,F(t)),u.get(s)},incrementCounter(s,r){h.getCounter(s).increment(r),N("pnCounters",s),f(s,"pn-counter","increment")},decrementCounter(s,r){h.getCounter(s).decrement(r),N("pnCounters",s),f(s,"pn-counter","decrement")},hasCounter(s){return u.has(s)},deleteCounter(s){let r=u.delete(s);return r&&N("pnCounters",s),r},getSet(s){return d.has(s)||d.set(s,M(t)),d.get(s)},addToSet(s,r){h.getSet(s).add(r),N("sets",s),f(s,"or-set","add")},removeFromSet(s,r){h.getSet(s).remove(r),N("sets",s),f(s,"or-set","remove")},hasSet(s){return d.has(s)},deleteSet(s){let r=d.delete(s);return r&&N("sets",s),r},merge(s){let r=s.getState();h.applyState(r)},getState(){V();let s={version:T,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let[r,a]of o)s.registers[r]=a.getState();for(let[r,a]of c)s.gCounters[r]=a.getState();for(let[r,a]of u)s.pnCounters[r]=a.getState();for(let[r,a]of d)s.sets[r]=a.getState();return s},applyState(s){for(let[r,a]of Object.entries(s.registers))o.has(r)?o.get(r).applyState(a):o.set(r,X(t,a)),N("registers",r),f(r,"lww-register","merge");for(let[r,a]of Object.entries(s.gCounters))c.has(r)?c.get(r).applyState(a):c.set(r,w(t,a)),N("gCounters",r),f(r,"g-counter","merge");for(let[r,a]of Object.entries(s.pnCounters))u.has(r)?u.get(r).applyState(a):u.set(r,x(t,a)),N("pnCounters",r),f(r,"pn-counter","merge");for(let[r,a]of Object.entries(s.sets))d.has(r)?d.get(r).applyState(a):d.set(r,P(t,a)),N("sets",r),f(r,"or-set","merge");T=Math.max(T,s.version)+1},getDelta(s){if(V(),l.length===0)return s>=T,null;let r=l.filter(_=>_.toVersion>s);if(r.length===0)return null;let a={fromVersion:s,toVersion:T,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let _ of r)_.registers&&Object.assign(a.registers,_.registers),_.gCounters&&Object.assign(a.gCounters,_.gCounters),_.pnCounters&&Object.assign(a.pnCounters,_.pnCounters),_.sets&&Object.assign(a.sets,_.sets);return Object.keys(a.registers).length===0&&delete a.registers,Object.keys(a.gCounters).length===0&&delete a.gCounters,Object.keys(a.pnCounters).length===0&&delete a.pnCounters,Object.keys(a.sets).length===0&&delete a.sets,a},applyDelta(s){if(s.registers)for(let[r,a]of Object.entries(s.registers))o.has(r)?o.get(r).applyState(a):o.set(r,X(t,a)),N("registers",r),f(r,"lww-register","merge");if(s.gCounters)for(let[r,a]of Object.entries(s.gCounters))c.has(r)?c.get(r).applyState(a):c.set(r,w(t,a)),N("gCounters",r),f(r,"g-counter","merge");if(s.pnCounters)for(let[r,a]of Object.entries(s.pnCounters))u.has(r)?u.get(r).applyState(a):u.set(r,x(t,a)),N("pnCounters",r),f(r,"pn-counter","merge");if(s.sets)for(let[r,a]of Object.entries(s.sets))d.has(r)?d.get(r).applyState(a):d.set(r,P(t,a)),N("sets",r),f(r,"or-set","merge");T=Math.max(T,s.toVersion)+1},getVersion(){return T},getNodeId(){return t},on(s,r){if(s==="change")return g.add(r),()=>{g.delete(r)};throw new Error(`Unknown event type: ${s}`)},removeAllListeners(){g.clear()},keys(s){let r=[];return(!s||s==="lww-register")&&r.push(...Array.from(o.keys())),(!s||s==="g-counter")&&r.push(...Array.from(c.keys())),(!s||s==="pn-counter")&&r.push(...Array.from(u.keys())),(!s||s==="or-set")&&r.push(...Array.from(d.keys())),r},clear(){o.clear(),c.clear(),u.clear(),d.clear(),l.length=0,p.registers.clear(),p.gCounters.clear(),p.pnCounters.clear(),p.sets.clear(),T=0},getStats(){return{total:o.size+c.size+u.size+d.size,registers:o.size,gCounters:c.size,pnCounters:u.size,sets:d.size,version:T,nodeId:t,deltaHistorySize:l.length}}};return h}var Pe,_e=R(()=>{"use strict";B();U();W();H();Pe={nodeId:"default-node",enableDeltaTracking:!0,maxDeltaHistory:100}});var fe=R(()=>{"use strict"});var Ne=R(()=>{"use strict";B();U();W();H();_e();fe()});var ze={};be(ze,{ALLOWED_TABLE_NAMES:()=>z,BinaryHeap:()=>te,DEFAULT_UNIFIED_MEMORY_CONFIG:()=>Le,UnifiedHnswIndex:()=>v,UnifiedMemoryManager:()=>A,clearProjectRootCache:()=>q,createHnswIndex:()=>ne,findProjectRoot:()=>b,getDefaultDbPath:()=>he,getResolvedDefaultConfig:()=>Ce,getUnifiedMemory:()=>Ie,initializeUnifiedMemory:()=>Ge,resetUnifiedMemory:()=>ke,validateTableName:()=>I});import*as m from"fs";import*as Re from"os";import*as S from"path";function he(){let i=b();return S.join(i,".agentic-qe","memory.db")}function Ce(){return{...Le,dbPath:he()}}function Ie(i){return A.getInstance(i)}async function Ge(i){let e=Ie(i);return await e.initialize(),e}function ke(){A.resetInstance()}function qe(){if(Se)return;Se=!0;let i=()=>{try{let e=A.instance;e&&e.close()}catch(e){console.debug("[UnifiedMemory] Cleanup error:",e instanceof Error?e.message:e)}};process.on("beforeExit",i),process.on("SIGINT",()=>{i(),process.exit(0)}),process.on("SIGTERM",()=>{i(),process.exit(0)})}var K,Le,A,Se,je=R(()=>{Xe();ee();ve();De();ye();j();j();re();re();me();Ne();Fe();K=J.create("unified-memory");Le={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:O.MMAP_SIZE_BYTES,cacheSize:O.CACHE_SIZE_KB,busyTimeout:O.BUSY_TIMEOUT_MS,vectorDimensions:O.DEFAULT_VECTOR_DIMENSIONS};A=class i{static instance=null;static instancePromise=null;db=null;config;initialized=!1;vectorsLoaded=!1;initPromise=null;preparedStatements=new Map;vectorIndex=new v("qe-memory");crdtStore=null;constructor(e){let t=Ce();if(this.config={...t,...e},!S.isAbsolute(this.config.dbPath)){let n=b();this.config.dbPath=S.join(n,this.config.dbPath)}}static getInstance(e){return i.instance||(i.instance=new i(e)),i.instance}static async getInstanceAsync(e){return i.instance?.initialized?i.instance:(i.instancePromise||(i.instancePromise=(async()=>{let t=i.getInstance(e);return await t.initialize(),t})()),i.instancePromise)}static resetInstance(){i.instance&&(i.instance.close(),i.instance=null),i.instancePromise=null,q()}async initialize(e){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize(e?.signal)),this.initPromise}async _doInitialize(e){if(!this.initialized){e?.throwIfAborted();try{let t=process.env.AQE_PROJECT_ROOT;if(t){let c=S.resolve(this.config.dbPath),u=S.resolve(t);!c.startsWith(u)&&!c.startsWith(Re.tmpdir())&&c.includes(".agentic-qe")&&(console.error(`[UnifiedMemory] WARNING: DB path "${this.config.dbPath}" points to a production .agentic-qe/ while AQE_PROJECT_ROOT="${t}". Redirecting to test-safe path.`),this.config.dbPath=S.join(t,".agentic-qe","memory.db"))}let n=S.dirname(this.config.dbPath);m.existsSync(n)||m.mkdirSync(n,{recursive:!0});let E=m.existsSync(this.config.dbPath),o=0;if(E)o=m.statSync(this.config.dbPath).size;else if(m.existsSync(n)){let c=this.findRecentBackups(n);if(c.length>0){let u=c[0];console.error(`[UnifiedMemory] CRITICAL: Database file missing but directory exists!
555
555
  Expected: ${this.config.dbPath}
556
556
  Found ${c.length} backup(s), newest: ${u.path} (${(u.size/1024/1024).toFixed(1)}MB)
557
- Restoring from backup to prevent data loss...`),m.copyFileSync(u.path,this.config.dbPath);for(let d of["-wal","-shm"]){let T=this.config.dbPath+d;m.existsSync(T)&&m.unlinkSync(T)}o=u.size}}if(e?.throwIfAborted(),this.db=J(this.config.dbPath,{walMode:this.config.walMode,busyTimeout:this.config.busyTimeout}),this.db.pragma(`mmap_size = ${this.config.mmapSize}`),this.db.pragma(`cache_size = ${this.config.cacheSize}`),this.db.pragma("foreign_keys = ON"),e?.aborted){try{this.db.close()}catch{}this.db=null,e.throwIfAborted()}if(await this.runMigrations(),e?.throwIfAborted(),E&&o>1e6)try{let c=this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get();if(c&&c.cnt===0){let u=m.statSync(this.config.dbPath).size;u<o*.1&&console.error(`[UnifiedMemory] CRITICAL: Possible data loss detected!
557
+ Restoring from backup to prevent data loss...`),m.copyFileSync(u.path,this.config.dbPath);for(let d of["-wal","-shm"]){let T=this.config.dbPath+d;m.existsSync(T)&&m.unlinkSync(T)}o=u.size}}if(e?.throwIfAborted(),this.db=Z(this.config.dbPath,{walMode:this.config.walMode,busyTimeout:this.config.busyTimeout}),this.db.pragma(`mmap_size = ${this.config.mmapSize}`),this.db.pragma(`cache_size = ${this.config.cacheSize}`),this.db.pragma("foreign_keys = ON"),e?.aborted){try{this.db.close()}catch{}this.db=null,e.throwIfAborted()}if(await this.runMigrations(),e?.throwIfAborted(),E&&o>1e6)try{let c=this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get();if(c&&c.cnt===0){let u=m.statSync(this.config.dbPath).size;u<o*.1&&console.error(`[UnifiedMemory] CRITICAL: Possible data loss detected!
558
558
  DB was ${(o/1024/1024).toFixed(1)}MB, now ${(u/1024/1024).toFixed(1)}MB with 0 patterns.
559
559
  This looks like the DB was replaced with an empty schema.
560
- Check backups in ${n} and restore manually.`)}}catch{}this.vectorsLoaded=!1,this.initialized=!0,console.log(`[UnifiedMemory] Initialized: ${this.config.dbPath}`),this.warnIfDuplicateDatabases()}catch(t){throw this.initPromise=null,t instanceof Error&&(t.name==="AbortError"||(e?.aborted??!1))?t:new Error(`Failed to initialize UnifiedMemoryManager: ${V(t)}`)}}}findRecentBackups(e){try{let n=m.readdirSync(e).filter(o=>o.startsWith("memory")&&o.endsWith(".db")&&o!=="memory.db").map(o=>{let c=S.join(e,o),u=m.statSync(c);return{path:c,size:u.size,mtime:u.mtimeMs}}).filter(o=>o.size>1e6).sort((o,c)=>c.mtime-o.mtime),E=S.join(e,"backups");if(m.existsSync(E)){let o=m.readdirSync(E);for(let c of o)if(c.endsWith(".db")){let u=S.join(E,c),d=m.statSync(u);d.size>1e6&&n.push({path:u,size:d.size,mtime:d.mtimeMs})}n.sort((c,u)=>u.mtime-c.mtime)}return n}catch{return[]}}warnIfDuplicateDatabases(){try{let e=b(),t=S.resolve(this.config.dbPath),E=[S.join(e,".agentic-qe","memory.db"),S.join(e,"v3",".agentic-qe","memory.db")].map(o=>S.resolve(o)).filter(o=>o!==t&&m.existsSync(o));E.length>0&&console.warn(`[UnifiedMemory] WARNING: Duplicate database(s) detected!
560
+ Check backups in ${n} and restore manually.`)}}catch{}this.vectorsLoaded=!1,this.initialized=!0,console.log(`[UnifiedMemory] Initialized: ${this.config.dbPath}`),this.warnIfDuplicateDatabases()}catch(t){throw this.initPromise=null,t instanceof Error&&(t.name==="AbortError"||(e?.aborted??!1))?t:new Error(`Failed to initialize UnifiedMemoryManager: ${Q(t)}`)}}}findRecentBackups(e){try{let n=m.readdirSync(e).filter(o=>o.startsWith("memory")&&o.endsWith(".db")&&o!=="memory.db").map(o=>{let c=S.join(e,o),u=m.statSync(c);return{path:c,size:u.size,mtime:u.mtimeMs}}).filter(o=>o.size>1e6).sort((o,c)=>c.mtime-o.mtime),E=S.join(e,"backups");if(m.existsSync(E)){let o=m.readdirSync(E);for(let c of o)if(c.endsWith(".db")){let u=S.join(E,c),d=m.statSync(u);d.size>1e6&&n.push({path:u,size:d.size,mtime:d.mtimeMs})}n.sort((c,u)=>u.mtime-c.mtime)}return n}catch{return[]}}warnIfDuplicateDatabases(){try{let e=b(),t=S.resolve(this.config.dbPath),E=[S.join(e,".agentic-qe","memory.db"),S.join(e,"v3",".agentic-qe","memory.db")].map(o=>S.resolve(o)).filter(o=>o!==t&&m.existsSync(o));E.length>0&&console.warn(`[UnifiedMemory] WARNING: Duplicate database(s) detected!
561
561
  Canonical: ${t}
562
562
  Duplicates: ${E.join(", ")}
563
- This can cause data splits. Remove duplicates or set AQE_PROJECT_ROOT.`)}catch(e){$.debug("Duplicate database check failed",{error:e instanceof Error?e.message:String(e)})}}columnExists(e,t){if(!this.db)return!1;try{let n=I(e);return this.db.prepare(`PRAGMA table_info(${n})`).all().some(o=>o.name===t)}catch(n){return $.debug("Column existence check failed",{table:e,column:t,error:n instanceof Error?n.message:String(n)}),!1}}handleV2SchemaIncompatibilities(){if(!this.db)return;let e=[{table:"goap_plans",requiredColumn:"status",columnDef:"TEXT DEFAULT 'pending'"},{table:"goap_actions",requiredColumn:"agent_type",columnDef:"TEXT DEFAULT 'unknown'"},{table:"concept_nodes",requiredColumn:"concept_type",columnDef:"TEXT DEFAULT 'general'"},{table:"concept_edges",requiredColumn:"edge_type",columnDef:"TEXT DEFAULT 'related'"},{table:"dream_insights",requiredColumn:"cycle_id",columnDef:"TEXT DEFAULT ''"},{table:"rl_q_values",requiredColumn:"algorithm",columnDef:"TEXT DEFAULT 'q-learning'"}];for(let{table:t,requiredColumn:n,columnDef:E}of e)if(this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(t)&&!this.columnExists(t,n)){let c=I(t);try{this.db.exec(`ALTER TABLE ${c} ADD COLUMN ${n} ${E}`),console.log(`[UnifiedMemory] Added column ${n} to ${t} (safe migration)`)}catch(u){console.log(`[UnifiedMemory] Column ${n} on ${t}: ${u instanceof Error?u.message:String(u)}`)}}}async runMigrations(){if(!this.db)throw new Error("Database not initialized");this.db.exec(se),this.handleV2SchemaIncompatibilities();let t=this.db.prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;t<D&&(console.log(`[UnifiedMemory] Migrating from v${t} to v${D}`),this.db.transaction(()=>{t<1&&this.db.exec(oe),t<2&&this.db.exec(ie),t<3&&(this.db.exec(ae),this.db.exec(ce),this.db.exec(Te)),t<4&&this.db.exec(Ee),t<5&&this.db.exec(de),t<6&&this.db.exec(G),t<7&&this.db.exec(ue),t<8&&this.db.exec(le),t<9&&(this.db.exec(`
563
+ This can cause data splits. Remove duplicates or set AQE_PROJECT_ROOT.`)}catch(e){K.debug("Duplicate database check failed",{error:e instanceof Error?e.message:String(e)})}}columnExists(e,t){if(!this.db)return!1;try{let n=I(e);return this.db.prepare(`PRAGMA table_info(${n})`).all().some(o=>o.name===t)}catch(n){return K.debug("Column existence check failed",{table:e,column:t,error:n instanceof Error?n.message:String(n)}),!1}}handleV2SchemaIncompatibilities(){if(!this.db)return;let e=[{table:"goap_plans",requiredColumn:"status",columnDef:"TEXT DEFAULT 'pending'"},{table:"goap_actions",requiredColumn:"agent_type",columnDef:"TEXT DEFAULT 'unknown'"},{table:"concept_nodes",requiredColumn:"concept_type",columnDef:"TEXT DEFAULT 'general'"},{table:"concept_edges",requiredColumn:"edge_type",columnDef:"TEXT DEFAULT 'related'"},{table:"dream_insights",requiredColumn:"cycle_id",columnDef:"TEXT DEFAULT ''"},{table:"rl_q_values",requiredColumn:"algorithm",columnDef:"TEXT DEFAULT 'q-learning'"}];for(let{table:t,requiredColumn:n,columnDef:E}of e)if(this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(t)&&!this.columnExists(t,n)){let c=I(t);try{this.db.exec(`ALTER TABLE ${c} ADD COLUMN ${n} ${E}`),console.log(`[UnifiedMemory] Added column ${n} to ${t} (safe migration)`)}catch(u){console.log(`[UnifiedMemory] Column ${n} on ${t}: ${u instanceof Error?u.message:String(u)}`)}}}async runMigrations(){if(!this.db)throw new Error("Database not initialized");this.db.exec(oe),this.handleV2SchemaIncompatibilities();let t=this.db.prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;t<D&&(console.log(`[UnifiedMemory] Migrating from v${t} to v${D}`),this.db.transaction(()=>{t<1&&this.db.exec(ie),t<2&&this.db.exec(ae),t<3&&(this.db.exec(ce),this.db.exec(Te),this.db.exec(Ee)),t<4&&this.db.exec(de),t<5&&this.db.exec(ue),t<6&&this.db.exec(G),t<7&&this.db.exec(le),t<8&&this.db.exec(pe),t<9&&(this.db.exec(`
564
564
  CREATE VIRTUAL TABLE IF NOT EXISTS qe_patterns_fts USING fts5(
565
565
  name, description, pattern_type, qe_domain,
566
566
  content='qe_patterns',
@@ -586,7 +586,7 @@ import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./c
586
586
  `),this.db.exec(`
587
587
  INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
588
588
  SELECT rowid, name, description, pattern_type, qe_domain FROM qe_patterns;
589
- `)),this.db.prepare(`
589
+ `)),t<10&&this.db.exec(k),this.db.prepare(`
590
590
  INSERT OR REPLACE INTO schema_version (id, version, migrated_at)
591
591
  VALUES (1, ?, datetime('now'))
592
592
  `).run(D)})(),console.log("[UnifiedMemory] Migration complete"))}async loadVectorIndex(){if(this.vectorsLoaded)return;if(!this.db)throw new Error("Database not initialized");this.vectorIndex.clear();let e=this.db.prepare("SELECT id, embedding, dimensions FROM vectors").all();for(let t of e){let n=this.bufferToFloatArray(t.embedding,t.dimensions);this.vectorIndex.add(t.id,n)}this.vectorsLoaded=!0,console.log(`[UnifiedMemory] Loaded ${e.length} vectors into vector index (ruvector flat)`)}async kvSet(e,t,n="default",E){this.ensureInitialized();let o=E?Date.now()+E*1e3:null,c=JSON.stringify(t);this.db.prepare(`
@@ -608,4 +608,4 @@ import{d as G,f as Xe}from"./chunk-YEO2Z3UX.js";import{a as k,b,c as we}from"./c
608
608
  VALUES (?, ?, ?, ?, ?, datetime('now'))
609
609
  `).run(e,n,o,t.length,c),this.vectorIndex.add(e,t)}async vectorGet(e){this.ensureInitialized();let t=this.db.prepare(`
610
610
  SELECT embedding, dimensions, metadata FROM vectors WHERE id = ?
611
- `).get(e);if(t)return{embedding:this.bufferToFloatArray(t.embedding,t.dimensions),metadata:t.metadata?L(t.metadata):void 0}}async vectorDelete(e){this.ensureInitialized();let t=this.db.prepare("DELETE FROM vectors WHERE id = ?").run(e);return this.vectorIndex.remove(e),t.changes>0}async vectorSearch(e,t=10,n){this.ensureInitialized(),this.vectorsLoaded||await this.loadVectorIndex();let E=this.vectorIndex.search(e,t*2);if(E.length===0)return[];let o=E.map(T=>T.id),c=o.map(()=>"?").join(","),u=this.db.prepare(`SELECT id, namespace, metadata FROM vectors WHERE id IN (${c})`).all(...o),d=new Map(u.map(T=>[T.id,T]));if(n){let T=[];for(let l of E){let g=d.get(l.id);if(g&&g.namespace===n&&(T.push({id:l.id,score:l.score,metadata:g.metadata?L(g.metadata):void 0}),T.length>=t))break}return T}return E.slice(0,t).map(T=>{let l=d.get(T.id);return{id:T.id,score:T.score,metadata:l?.metadata?L(l.metadata):void 0}})}async vectorCount(e){return this.ensureInitialized(),e?this.db.prepare("SELECT COUNT(*) as count FROM vectors WHERE namespace = ?").get(e).count:this.db.prepare("SELECT COUNT(*) as count FROM vectors").get().count}queryCount(e){this.ensureInitialized();let t=I(e);return this.db.prepare(`SELECT COUNT(*) as c FROM ${t}`).get().c}initializeCRDT(e){if(this.crdtStore){console.warn("[UnifiedMemory] CRDT store already initialized");return}this.crdtStore=H({nodeId:e}),console.log(`[UnifiedMemory] CRDT store initialized for node: ${e}`)}getCRDTStore(){return this.crdtStore}isCRDTInitialized(){return this.crdtStore!==null}async crdtSet(e,t,n="crdt"){this.ensureInitialized(),this.crdtStore&&this.crdtStore.setRegister(e,t),await this.kvSet(e,t,n)}async crdtGet(e,t="crdt"){if(this.crdtStore){let n=this.crdtStore.getRegister(e);if(n)return n.get()}return this.kvGet(e,t)}crdtIncrement(e,t=1){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");let n=this.crdtStore.getCounter(e);n||(this.crdtStore.incrementCounter(e,0),n=this.crdtStore.getCounter(e));for(let E=0;E<t;E++)this.crdtStore.incrementCounter(e)}crdtGetCounter(e){return this.crdtStore?this.crdtStore.getCounter(e)?.get()??0:0}crdtAddToSet(e,t){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.addToSet(e,t)}crdtRemoveFromSet(e,t){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.removeFromSet(e,t)}crdtGetSet(e){if(!this.crdtStore)return new Set;let t=this.crdtStore.getSet(e);return new Set(t.values())}crdtGetState(){return this.crdtStore?this.crdtStore.getState():null}crdtGetDelta(e){return this.crdtStore?this.crdtStore.getDelta(e??0):null}crdtMerge(e){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.applyState(e)}crdtApplyDelta(e){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.applyDelta(e)}async crdtPersist(){if(!this.crdtStore)return;let e=this.crdtStore.getState();await this.kvSet("__crdt_state__",e,"crdt-internal")}async crdtRestore(){if(!this.crdtStore)return!1;let e=await this.kvGet("__crdt_state__","crdt-internal");return e?(this.crdtStore.applyState(e),!0):!1}getDatabase(){if(!this.db||!this.initialized)throw new Error("UnifiedMemoryManager not initialized");return this.db}isInitialized(){return this.initialized}getDbPath(){return this.config.dbPath}prepare(e,t){if(!this.db)throw new Error("Database not initialized");let n=this.preparedStatements.get(e);return n||(n=this.db.prepare(t),this.preparedStatements.set(e,n)),n}transaction(e){if(!this.db)throw new Error("Database not initialized");return this.db.transaction(e)()}getStats(){if(!this.db)throw new Error("Database not initialized");let e=pe.map(E=>{try{let o=this.db.prepare(`SELECT COUNT(*) as count FROM ${E}`).get();return{name:E,rowCount:o.count}}catch(o){return $.debug("Table row count query failed",{table:E,error:o instanceof Error?o.message:String(o)}),{name:E,rowCount:0}}}),t=0,n=0;try{m.existsSync(this.config.dbPath)&&(t=m.statSync(this.config.dbPath).size);let E=this.config.dbPath+"-wal";m.existsSync(E)&&(n=m.statSync(E).size)}catch(E){console.debug("[UnifiedMemory] File stat error:",E instanceof Error?E.message:E)}return{tables:e,fileSize:t,walSize:n,vectorIndexSize:this.vectorIndex.size()}}vacuum(){if(!this.db)throw new Error("Database not initialized");this.db.exec("VACUUM")}checkpoint(){if(!this.db)throw new Error("Database not initialized");this.db.pragma("wal_checkpoint(TRUNCATE)")}close(){this.db&&(this.preparedStatements.clear(),this.vectorIndex.clear(),this.db.close(),this.db=null,this.initialized=!1,console.log("[UnifiedMemory] Database closed"))}ensureInitialized(){if(!this.initialized||!this.db)throw new Error("UnifiedMemoryManager not initialized. Call initialize() first.")}floatArrayToBuffer(e){let t=Buffer.alloc(e.length*4);for(let n=0;n<e.length;n++)t.writeFloatLE(e[n],n*4);return t}bufferToFloatArray(e,t){let n=new Float32Array(e.buffer,e.byteOffset,t);return Array.from(n)}};Ne=!1;Ge()});export{q as a,I as b,ze as c,z as d,Re as e,he as f,Le as g,A as h,Ce as i,Me as j,Pe as k,ke as l,qe as m};
611
+ `).get(e);if(t)return{embedding:this.bufferToFloatArray(t.embedding,t.dimensions),metadata:t.metadata?L(t.metadata):void 0}}async vectorDelete(e){this.ensureInitialized();let t=this.db.prepare("DELETE FROM vectors WHERE id = ?").run(e);return this.vectorIndex.remove(e),t.changes>0}async vectorSearch(e,t=10,n){this.ensureInitialized(),this.vectorsLoaded||await this.loadVectorIndex();let E=this.vectorIndex.search(e,t*2);if(E.length===0)return[];let o=E.map(T=>T.id),c=o.map(()=>"?").join(","),u=this.db.prepare(`SELECT id, namespace, metadata FROM vectors WHERE id IN (${c})`).all(...o),d=new Map(u.map(T=>[T.id,T]));if(n){let T=[];for(let l of E){let g=d.get(l.id);if(g&&g.namespace===n&&(T.push({id:l.id,score:l.score,metadata:g.metadata?L(g.metadata):void 0}),T.length>=t))break}return T}return E.slice(0,t).map(T=>{let l=d.get(T.id);return{id:T.id,score:T.score,metadata:l?.metadata?L(l.metadata):void 0}})}async vectorCount(e){return this.ensureInitialized(),e?this.db.prepare("SELECT COUNT(*) as count FROM vectors WHERE namespace = ?").get(e).count:this.db.prepare("SELECT COUNT(*) as count FROM vectors").get().count}queryCount(e){this.ensureInitialized();let t=I(e);return this.db.prepare(`SELECT COUNT(*) as c FROM ${t}`).get().c}initializeCRDT(e){if(this.crdtStore){console.warn("[UnifiedMemory] CRDT store already initialized");return}this.crdtStore=$({nodeId:e}),console.log(`[UnifiedMemory] CRDT store initialized for node: ${e}`)}getCRDTStore(){return this.crdtStore}isCRDTInitialized(){return this.crdtStore!==null}async crdtSet(e,t,n="crdt"){this.ensureInitialized(),this.crdtStore&&this.crdtStore.setRegister(e,t),await this.kvSet(e,t,n)}async crdtGet(e,t="crdt"){if(this.crdtStore){let n=this.crdtStore.getRegister(e);if(n)return n.get()}return this.kvGet(e,t)}crdtIncrement(e,t=1){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");let n=this.crdtStore.getCounter(e);n||(this.crdtStore.incrementCounter(e,0),n=this.crdtStore.getCounter(e));for(let E=0;E<t;E++)this.crdtStore.incrementCounter(e)}crdtGetCounter(e){return this.crdtStore?this.crdtStore.getCounter(e)?.get()??0:0}crdtAddToSet(e,t){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.addToSet(e,t)}crdtRemoveFromSet(e,t){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.removeFromSet(e,t)}crdtGetSet(e){if(!this.crdtStore)return new Set;let t=this.crdtStore.getSet(e);return new Set(t.values())}crdtGetState(){return this.crdtStore?this.crdtStore.getState():null}crdtGetDelta(e){return this.crdtStore?this.crdtStore.getDelta(e??0):null}crdtMerge(e){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.applyState(e)}crdtApplyDelta(e){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.applyDelta(e)}async crdtPersist(){if(!this.crdtStore)return;let e=this.crdtStore.getState();await this.kvSet("__crdt_state__",e,"crdt-internal")}async crdtRestore(){if(!this.crdtStore)return!1;let e=await this.kvGet("__crdt_state__","crdt-internal");return e?(this.crdtStore.applyState(e),!0):!1}getDatabase(){if(!this.db||!this.initialized)throw new Error("UnifiedMemoryManager not initialized");return this.db}isInitialized(){return this.initialized}getDbPath(){return this.config.dbPath}prepare(e,t){if(!this.db)throw new Error("Database not initialized");let n=this.preparedStatements.get(e);return n||(n=this.db.prepare(t),this.preparedStatements.set(e,n)),n}transaction(e){if(!this.db)throw new Error("Database not initialized");return this.db.transaction(e)()}getStats(){if(!this.db)throw new Error("Database not initialized");let e=ge.map(E=>{try{let o=this.db.prepare(`SELECT COUNT(*) as count FROM ${E}`).get();return{name:E,rowCount:o.count}}catch(o){return K.debug("Table row count query failed",{table:E,error:o instanceof Error?o.message:String(o)}),{name:E,rowCount:0}}}),t=0,n=0;try{m.existsSync(this.config.dbPath)&&(t=m.statSync(this.config.dbPath).size);let E=this.config.dbPath+"-wal";m.existsSync(E)&&(n=m.statSync(E).size)}catch(E){console.debug("[UnifiedMemory] File stat error:",E instanceof Error?E.message:E)}return{tables:e,fileSize:t,walSize:n,vectorIndexSize:this.vectorIndex.size()}}vacuum(){if(!this.db)throw new Error("Database not initialized");this.db.exec("VACUUM")}checkpoint(){if(!this.db)throw new Error("Database not initialized");this.db.pragma("wal_checkpoint(TRUNCATE)")}close(){this.db&&(this.preparedStatements.clear(),this.vectorIndex.clear(),this.db.close(),this.db=null,this.initialized=!1,console.log("[UnifiedMemory] Database closed"))}ensureInitialized(){if(!this.initialized||!this.db)throw new Error("UnifiedMemoryManager not initialized. Call initialize() first.")}floatArrayToBuffer(e){let t=Buffer.alloc(e.length*4);for(let n=0;n<e.length;n++)t.writeFloatLE(e[n],n*4);return t}bufferToFloatArray(e,t){let n=new Float32Array(e.buffer,e.byteOffset,t);return Array.from(n)}};Se=!1;qe()});export{z as a,I as b,Be as c,j as d,he as e,Le as f,Ce as g,A as h,Ie as i,Ge as j,ke as k,ze as l,je as m};
@@ -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.10.5");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.10.6");process.exit(0)}
2
2
  import{createRequire as t}from"module";var o=t(import.meta.url),e=o("@huggingface/transformers"),n=e,{RuvectorLayer:i,TensorCompress:a,differentiableSearch:c,hierarchicalForward:s,getCompressionLevel:l,init:p,FlashAttention:m,DotProductAttention:u,MultiHeadAttention:d,HyperbolicAttention:f,LinearAttention:A,MoEAttention:g,SonaEngine:h,pipeline:_}=e||{};export{n as a,i as b,a as c,c as d,s as e,l as f,p as g,m as h,u as i,d as j,f as k,A as l,g as m,h as n,_ as o};
@@ -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.10.5");process.exit(0)}
2
- import{a as n}from"./chunk-K5KKZWED.js";import{a as o}from"./chunk-HHEHGERJ.js";import{a,e as c}from"./chunk-RONMVGCT.js";c();var M=a.CLEANUP_INTERVAL_MS,y=".agentic-qe/memory.db";async function d(r,t=!0){let e;switch(r.type){case"memory":e=new o;break;case"sqlite":e=new n({sqlite:r.sqlite,enableFallback:!0});break;case"agentdb":e=new n({sqlite:{path:r.agentdb?.path??y},enableFallback:!0});break;case"hybrid":e=new n(r.hybrid);break;default:throw new Error(`Unknown memory backend type: ${r.type}`)}return t&&await e.initialize(),{backend:e,type:r.type,initialized:t}}async function u(r=!0){let t=process.env.AQE_MEMORY_BACKEND??"memory",e=process.env.AQE_MEMORY_PATH??".agentic-qe",i={type:t,sqlite:{path:`${e}/memory.db`,walMode:!0},agentdb:{path:`${e}/memory.db`},hybrid:{enableFallback:!0,sqlite:{path:`${e}/memory.db`}}};return d(i,r)}export{d as a,u as b};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.6");process.exit(0)}
2
+ import{a as n}from"./chunk-ELTN4F4R.js";import{a as o}from"./chunk-LAGNWKAD.js";import{a,e as c}from"./chunk-MSJGDIRP.js";c();var M=a.CLEANUP_INTERVAL_MS,y=".agentic-qe/memory.db";async function d(r,t=!0){let e;switch(r.type){case"memory":e=new o;break;case"sqlite":e=new n({sqlite:r.sqlite,enableFallback:!0});break;case"agentdb":e=new n({sqlite:{path:r.agentdb?.path??y},enableFallback:!0});break;case"hybrid":e=new n(r.hybrid);break;default:throw new Error(`Unknown memory backend type: ${r.type}`)}return t&&await e.initialize(),{backend:e,type:r.type,initialized:t}}async function u(r=!0){let t=process.env.AQE_MEMORY_BACKEND??"memory",e=process.env.AQE_MEMORY_PATH??".agentic-qe",i={type:t,sqlite:{path:`${e}/memory.db`,walMode:!0},agentdb:{path:`${e}/memory.db`},hybrid:{enableFallback:!0,sqlite:{path:`${e}/memory.db`}}};return d(i,r)}export{d as a,u as b};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.5");process.exit(0)}
2
- import{f as s,i as o,k as c,m}from"./chunk-R573V37S.js";import{a,c as d}from"./chunk-S73KENCH.js";import{a as r,e as l}from"./chunk-RONMVGCT.js";d();m();l();var u={dbPath:s.dbPath,walMode:!0,mmapSize:r.MMAP_SIZE_BYTES,cacheSize:r.CACHE_SIZE_KB,busyTimeout:r.BUSY_TIMEOUT_MS},n=class e{static instance=null;static instancePromise=null;unifiedMemory=null;config;initialized=!1;initPromise=null;constructor(i){this.config={...u,...i}}static getInstance(i){return e.instance||(e.instance=new e(i)),e.instance}static async getInstanceAsync(i){return e.instance?.initialized?e.instance:(e.instancePromise||(e.instancePromise=(async()=>{let t=e.getInstance(i);return await t.initialize(),t})()),e.instancePromise)}static resetInstance(){e.instance&&(e.instance.close(),e.instance=null),e.instancePromise=null,c()}async initialize(){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize()),this.initPromise}async _doInitialize(){if(!this.initialized)try{let i={dbPath:this.config.dbPath,walMode:this.config.walMode,busyTimeout:this.config.busyTimeout,mmapSize:this.config.mmapSize,cacheSize:this.config.cacheSize};this.unifiedMemory=o(i),await this.unifiedMemory.initialize(),this.initialized=!0,console.log(`[UnifiedPersistence] Initialized via UnifiedMemoryManager: ${this.config.dbPath}`)}catch(i){throw this.initPromise=null,new Error(`Failed to initialize UnifiedPersistenceManager: ${a(i)}`)}}getDatabase(){if(!this.unifiedMemory||!this.initialized)throw new Error("UnifiedPersistenceManager not initialized");return this.unifiedMemory.getDatabase()}isInitialized(){return this.initialized}getDbPath(){return this.config.dbPath}prepare(i,t){if(!this.unifiedMemory)throw new Error("Database not initialized");return this.unifiedMemory.prepare(i,t)}transaction(i){if(!this.unifiedMemory)throw new Error("Database not initialized");return this.unifiedMemory.transaction(i)}getStats(){if(!this.unifiedMemory)throw new Error("Database not initialized");let i=this.unifiedMemory.getStats();return{tables:i.tables,fileSize:i.fileSize,walSize:i.walSize}}vacuum(){this.getDatabase().exec("VACUUM")}checkpoint(){this.getDatabase().pragma("wal_checkpoint(TRUNCATE)")}close(){this.initialized=!1,console.log("[UnifiedPersistence] Facade closed")}};function g(e){return n.getInstance(e)}async function U(e){let i=g(e);return await i.initialize(),i}function z(){n.resetInstance()}var f=!1;function h(){if(f)return;f=!0;let e=()=>{try{let i=n.instance;i&&i.close()}catch(i){console.debug("[UnifiedPersistence] Cleanup error:",i instanceof Error?i.message:i)}};process.on("beforeExit",e),process.on("SIGINT",()=>{e(),process.exit(0)}),process.on("SIGTERM",()=>{e(),process.exit(0)})}h();export{u as a,n as b,g as c,U as d,z as e};
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.10.6");process.exit(0)}
2
+ import{f as s,i as o,k as c,m}from"./chunk-RA7HEY5G.js";import{a,c as d}from"./chunk-O4MNYX4X.js";import{a as r,e as l}from"./chunk-MSJGDIRP.js";d();m();l();var u={dbPath:s.dbPath,walMode:!0,mmapSize:r.MMAP_SIZE_BYTES,cacheSize:r.CACHE_SIZE_KB,busyTimeout:r.BUSY_TIMEOUT_MS},n=class e{static instance=null;static instancePromise=null;unifiedMemory=null;config;initialized=!1;initPromise=null;constructor(i){this.config={...u,...i}}static getInstance(i){return e.instance||(e.instance=new e(i)),e.instance}static async getInstanceAsync(i){return e.instance?.initialized?e.instance:(e.instancePromise||(e.instancePromise=(async()=>{let t=e.getInstance(i);return await t.initialize(),t})()),e.instancePromise)}static resetInstance(){e.instance&&(e.instance.close(),e.instance=null),e.instancePromise=null,c()}async initialize(){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize()),this.initPromise}async _doInitialize(){if(!this.initialized)try{let i={dbPath:this.config.dbPath,walMode:this.config.walMode,busyTimeout:this.config.busyTimeout,mmapSize:this.config.mmapSize,cacheSize:this.config.cacheSize};this.unifiedMemory=o(i),await this.unifiedMemory.initialize(),this.initialized=!0,console.log(`[UnifiedPersistence] Initialized via UnifiedMemoryManager: ${this.config.dbPath}`)}catch(i){throw this.initPromise=null,new Error(`Failed to initialize UnifiedPersistenceManager: ${a(i)}`)}}getDatabase(){if(!this.unifiedMemory||!this.initialized)throw new Error("UnifiedPersistenceManager not initialized");return this.unifiedMemory.getDatabase()}isInitialized(){return this.initialized}getDbPath(){return this.config.dbPath}prepare(i,t){if(!this.unifiedMemory)throw new Error("Database not initialized");return this.unifiedMemory.prepare(i,t)}transaction(i){if(!this.unifiedMemory)throw new Error("Database not initialized");return this.unifiedMemory.transaction(i)}getStats(){if(!this.unifiedMemory)throw new Error("Database not initialized");let i=this.unifiedMemory.getStats();return{tables:i.tables,fileSize:i.fileSize,walSize:i.walSize}}vacuum(){this.getDatabase().exec("VACUUM")}checkpoint(){this.getDatabase().pragma("wal_checkpoint(TRUNCATE)")}close(){this.initialized=!1,console.log("[UnifiedPersistence] Facade closed")}};function g(e){return n.getInstance(e)}async function U(e){let i=g(e);return await i.initialize(),i}function z(){n.resetInstance()}var f=!1;function h(){if(f)return;f=!0;let e=()=>{try{let i=n.instance;i&&i.close()}catch(i){console.debug("[UnifiedPersistence] Cleanup error:",i instanceof Error?i.message:i)}};process.on("beforeExit",e),process.on("SIGINT",()=>{e(),process.exit(0)}),process.on("SIGTERM",()=>{e(),process.exit(0)})}h();export{u as a,n as b,g as c,U as d,z as e};
@@ -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.10.5");process.exit(0)}
2
- import{a as w,b as A,c as O,e as D,f as z}from"./chunk-YEO2Z3UX.js";import{b as S,d as $}from"./chunk-56RA6YPN.js";import{a as N,c as F}from"./chunk-S73KENCH.js";import{i as v}from"./chunk-7DU35D4M.js";import*as I from"node:path";z();$();var P=["function","module","test","file","class"],L=["calls","imports","tests","depends_on","covers"],b=class{ensureSchema(e){e.transaction(()=>{e.exec(w),e.exec(A),e.exec(O)})()}schemaExists(e){return D(e)}getNodeTypes(){return P}getEdgeTypes(){return L}isValidNodeType(e){return P.includes(e)}isValidEdgeType(e){return L.includes(e)}getStats(e){if(!this.schemaExists(e))return{nodeCount:0,edgeCount:0};let t=e.prepare("SELECT COUNT(*) as count FROM hypergraph_nodes").get().count,r=e.prepare("SELECT COUNT(*) as count FROM hypergraph_edges").get().count;return{nodeCount:t,edgeCount:r}}dropSchema(e){let t=e.prepare("SELECT COUNT(*) as cnt FROM hypergraph_nodes").get()?.cnt??0,r=e.prepare("SELECT COUNT(*) as cnt FROM hypergraph_edges").get()?.cnt??0;if(t>0||r>0)throw new Error(`REFUSING to drop hypergraph schema: tables contain data (${t} nodes, ${r} edges). Backup and manually drop if needed.`);e.transaction(()=>{e.exec("DROP TABLE IF EXISTS hypergraph_edges"),e.exec("DROP TABLE IF EXISTS hypergraph_nodes")})()}};function C(n){return{id:n.id,type:n.type,name:n.name,file_path:n.filePath??null,line_start:n.lineStart??null,line_end:n.lineEnd??null,complexity:n.complexity??null,coverage:n.coverage??null,metadata:n.metadata?JSON.stringify(n.metadata):null,embedding:n.embedding?U(n.embedding):null}}function T(n){return{id:n.id,type:n.type,name:n.name,filePath:n.file_path??void 0,lineStart:n.line_start??void 0,lineEnd:n.line_end??void 0,complexity:n.complexity??void 0,coverage:n.coverage??void 0,metadata:n.metadata?S(n.metadata):void 0,embedding:n.embedding?W(n.embedding):void 0,createdAt:n.created_at,updatedAt:n.updated_at}}function M(n){return{id:n.id,source_id:n.sourceId,target_id:n.targetId,type:n.type,weight:n.weight??1,properties:n.properties?JSON.stringify(n.properties):null}}function H(n){return{id:n.id,sourceId:n.source_id,targetId:n.target_id,type:n.type,weight:n.weight,properties:n.properties?S(n.properties):void 0,createdAt:n.created_at}}function x(n,e,t){return`${n}--${t}-->${e}`}function U(n){let e=Buffer.alloc(n.length*4);for(let t=0;t<n.length;t++)e.writeFloatLE(n[t],t*4);return e}function W(n){let e=[],t=n.length/4;for(let r=0;r<t;r++)e.push(n.readFloatLE(r*4));return e}F();var B={maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1},R=class{config;schemaManager;initialized=!1;constructor(e){this.config={...B,...e},this.schemaManager=new b}async initialize(){this.initialized||(this.schemaManager.ensureSchema(this.config.db),this.initialized=!0)}isInitialized(){return this.initialized}async addNode(e){this.ensureInitialized();let t=v(),r={id:t,...e},s=C(r);return this.config.db.prepare(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.6");process.exit(0)}
2
+ import{a as w,b as A,c as O,e as D,f as z}from"./chunk-UQYDFT6I.js";import{b as S,d as $}from"./chunk-DFBVWMX3.js";import{a as N,c as F}from"./chunk-O4MNYX4X.js";import{i as v}from"./chunk-BHD6THT5.js";import*as I from"node:path";z();$();var P=["function","module","test","file","class"],L=["calls","imports","tests","depends_on","covers"],b=class{ensureSchema(e){e.transaction(()=>{e.exec(w),e.exec(A),e.exec(O)})()}schemaExists(e){return D(e)}getNodeTypes(){return P}getEdgeTypes(){return L}isValidNodeType(e){return P.includes(e)}isValidEdgeType(e){return L.includes(e)}getStats(e){if(!this.schemaExists(e))return{nodeCount:0,edgeCount:0};let t=e.prepare("SELECT COUNT(*) as count FROM hypergraph_nodes").get().count,r=e.prepare("SELECT COUNT(*) as count FROM hypergraph_edges").get().count;return{nodeCount:t,edgeCount:r}}dropSchema(e){let t=e.prepare("SELECT COUNT(*) as cnt FROM hypergraph_nodes").get()?.cnt??0,r=e.prepare("SELECT COUNT(*) as cnt FROM hypergraph_edges").get()?.cnt??0;if(t>0||r>0)throw new Error(`REFUSING to drop hypergraph schema: tables contain data (${t} nodes, ${r} edges). Backup and manually drop if needed.`);e.transaction(()=>{e.exec("DROP TABLE IF EXISTS hypergraph_edges"),e.exec("DROP TABLE IF EXISTS hypergraph_nodes")})()}};function C(n){return{id:n.id,type:n.type,name:n.name,file_path:n.filePath??null,line_start:n.lineStart??null,line_end:n.lineEnd??null,complexity:n.complexity??null,coverage:n.coverage??null,metadata:n.metadata?JSON.stringify(n.metadata):null,embedding:n.embedding?U(n.embedding):null}}function T(n){return{id:n.id,type:n.type,name:n.name,filePath:n.file_path??void 0,lineStart:n.line_start??void 0,lineEnd:n.line_end??void 0,complexity:n.complexity??void 0,coverage:n.coverage??void 0,metadata:n.metadata?S(n.metadata):void 0,embedding:n.embedding?W(n.embedding):void 0,createdAt:n.created_at,updatedAt:n.updated_at}}function M(n){return{id:n.id,source_id:n.sourceId,target_id:n.targetId,type:n.type,weight:n.weight??1,properties:n.properties?JSON.stringify(n.properties):null}}function H(n){return{id:n.id,sourceId:n.source_id,targetId:n.target_id,type:n.type,weight:n.weight,properties:n.properties?S(n.properties):void 0,createdAt:n.created_at}}function x(n,e,t){return`${n}--${t}-->${e}`}function U(n){let e=Buffer.alloc(n.length*4);for(let t=0;t<n.length;t++)e.writeFloatLE(n[t],t*4);return e}function W(n){let e=[],t=n.length/4;for(let r=0;r<t;r++)e.push(n.readFloatLE(r*4));return e}F();var B={maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1},R=class{config;schemaManager;initialized=!1;constructor(e){this.config={...B,...e},this.schemaManager=new b}async initialize(){this.initialized||(this.schemaManager.ensureSchema(this.config.db),this.initialized=!0)}isInitialized(){return this.initialized}async addNode(e){this.ensureInitialized();let t=v(),r={id:t,...e},s=C(r);return this.config.db.prepare(`
3
3
  INSERT INTO hypergraph_nodes (id, type, name, file_path, line_start, line_end, complexity, coverage, metadata, embedding)
4
4
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
5
5
  `).run(s.id,s.type,s.name,s.file_path,s.line_start,s.line_end,s.complexity,s.coverage,s.metadata,s.embedding),t}async addEdge(e){this.ensureInitialized();let t=x(e.sourceId,e.targetId,e.type),r={id:t,...e},s=M(r);return this.config.db.prepare(`
@@ -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.10.5");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.10.6");process.exit(0)}
2
2
  import{readFileSync as R,existsSync as v,readdirSync as y}from"fs";import{join as S}from"path";var M=100*1024,b=/mcp__([a-z][a-z0-9-]*)__([a-z][a-z0-9_]*)/g,x=/^```/;function w(e,r){let n=e.length>M?e.slice(0,M):e,o=[],i=n.split(`
3
3
  `),a=!1;for(let s=0;s<i.length;s++){let p=i[s];if(x.test(p.trim())){a=!a;continue}let l,c=new RegExp(b.source,"g");for(;(l=c.exec(p))!==null;){let t=l[1],g=l[2],f=l[0],d=a?"code-block":"prose",u=d==="prose"?.9:.5;o.push({toolName:f,serverName:t,actionName:g,confidence:u,context:d,lineNumber:s+1})}}return o}function E(e){let r=new Map;for(let n of e)r.has(n.serverName)||r.set(n.serverName,[]),r.get(n.serverName).push(n);return r}function N(e){let r=[],n=[S(e,".claude","mcp.json"),S(e,".mcp.json")],o=process.env.HOME||process.env.USERPROFILE||"";o&&n.push(S(o,".claude","mcp.json"));for(let i of n)if(v(i))try{let a=R(i,"utf-8"),s=JSON.parse(a);s.mcpServers&&typeof s.mcpServers=="object"&&r.push(...Object.keys(s.mcpServers))}catch{}return[...new Set(r)]}function h(e,r,n){if(!v(e))return{agentName:r,references:[],requiredServers:[],availableServers:n,missingServers:[],warnings:[`Agent file not found: ${e}`],allSatisfied:!0};let o;try{o=R(e,"utf-8")}catch{return{agentName:r,references:[],requiredServers:[],availableServers:n,missingServers:[],warnings:[`Failed to read agent file: ${e}`],allSatisfied:!0}}let i=w(o,r),a=E(i),s=[...a.keys()],p=new Set(n),l=s.filter(t=>!p.has(t)),c=[];for(let t of l){let g=a.get(t)||[],f=Math.max(...g.map(m=>m.confidence)),d=g.length,u=[...new Set(g.map(m=>m.context))].join(", ");c.push(`[advisory] Agent "${r}" references MCP server "${t}" (${d} tool ref${d>1?"s":""}, confidence: ${f}, context: ${u}) but server is not configured. Agent may have reduced capabilities.`)}return{agentName:r,references:i,requiredServers:s,availableServers:n,missingServers:l,warnings:c,allSatisfied:l.length===0}}function C(e,r){let n=Date.now(),o=[],i=[],a=N(r);if(!v(e))return{agents:[],totalServersReferenced:0,globalMissingServers:[],agentsWithMissingDeps:[],warnings:[`Agents directory not found: ${e}`],durationMs:Date.now()-n};try{let c=y(e);for(let g of c){if(!g.endsWith(".md"))continue;let f=g.replace(".md",""),d=S(e,g),u=h(d,f,a);o.push(u),i.push(...u.warnings)}let t=S(e,"subagents");if(v(t)){let g=y(t);for(let f of g){if(!f.endsWith(".md"))continue;let d=f.replace(".md",""),u=S(t,f),m=h(u,d,a);o.push(m),i.push(...m.warnings)}}}catch(c){i.push(`Error scanning agents directory: ${c.message}`)}let s=new Set,p=new Set,l=[];for(let c of o){for(let t of c.requiredServers)s.add(t);for(let t of c.missingServers)p.add(t);c.missingServers.length>0&&l.push(c.agentName)}return{agents:o,totalServersReferenced:s.size,globalMissingServers:[...p],agentsWithMissingDeps:l,warnings:i,durationMs:Date.now()-n}}export{N as a,C 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.10.5");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.10.6");process.exit(0)}
2
2
  import{existsSync as c,readFileSync as f}from"fs";import{join as p,dirname as i}from"path";import{fileURLToPath as s}from"url";function u(o,a=10){let t=i(s(o));for(let r=0;r<a;r++){let n=p(t,"package.json");if(c(n))try{if(JSON.parse(f(n,"utf-8")).name==="agentic-qe")return t}catch{}let e=i(t);if(e===t)break;t=e}return null}export{u as a};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.5");process.exit(0)}
2
- import{a as g}from"./chunk-FE3FGMNB.js";import{b as p,c}from"./chunk-IRS4HKAR.js";import{a as x,b as f,c as w}from"./chunk-S73KENCH.js";import{i as v}from"./chunk-7DU35D4M.js";w();var l={ProtocolStarted:"coordination.ProtocolStarted",ProtocolCompleted:"coordination.ProtocolCompleted",ProtocolFailed:"coordination.ProtocolFailed",ProtocolCancelled:"coordination.ProtocolCancelled",ActionStarted:"coordination.ActionStarted",ActionCompleted:"coordination.ActionCompleted",ActionFailed:"coordination.ActionFailed"},E=class{constructor(e,t,o){this.eventBus=e;this.memory=t;this.getDomainAPI=o}eventBus;memory;getDomainAPI;protocols=new Map;executions=new Map;scheduledProtocols=new Map;schedulerRunning=!1;registerProtocol(e){this.protocols.set(e.id,e),e.schedule.type==="event"&&e.enabled&&this.setupEventTriggers(e),(e.schedule.type==="cron"||e.schedule.type==="interval")&&e.enabled&&this.scheduleProtocol(e)}unregisterProtocol(e){if(!this.protocols.get(e))return!1;let o=this.scheduledProtocols.get(e);return o?.intervalId&&clearInterval(o.intervalId),this.scheduledProtocols.delete(e),this.protocols.delete(e),!0}getProtocol(e){return this.protocols.get(e)}listProtocols(){return Array.from(this.protocols.values())}async execute(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,t):c(new Error(`Protocol is disabled: ${e}`)):c(new Error(`Protocol not found: ${e}`))}async executeOnEvent(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,void 0,t):c(new Error(`Protocol is disabled: ${e}`)):c(new Error(`Protocol not found: ${e}`))}getExecution(e){let t=this.executions.get(e);if(t)return this.toImmutableExecution(t.execution)}listActiveExecutions(){return Array.from(this.executions.values()).filter(e=>e.execution.status==="running"||e.execution.status==="paused").map(e=>this.toImmutableExecution(e.execution))}async cancelExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"&&t.execution.status!=="paused"?c(new Error(`Cannot cancel execution in status: ${t.execution.status}`)):(t.cancelled=!0,t.execution.status="cancelled",t.execution.completedAt=new Date,await this.publishEvent(l.ProtocolCancelled,{executionId:e,protocolId:t.protocol.id}),p(void 0)):c(new Error(`Execution not found: ${e}`))}async pauseExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"?c(new Error(`Cannot pause execution in status: ${t.execution.status}`)):(t.paused=!0,t.execution.status="paused",p(void 0)):c(new Error(`Execution not found: ${e}`))}async resumeExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="paused"?c(new Error(`Cannot resume execution in status: ${t.execution.status}`)):(t.paused=!1,t.execution.status="running",p(void 0)):c(new Error(`Execution not found: ${e}`))}startScheduler(){if(!this.schedulerRunning){this.schedulerRunning=!0;for(let e of this.protocols.values())e.enabled&&(e.schedule.type==="interval"||e.schedule.type==="cron")&&this.scheduleProtocol(e)}}stopScheduler(){this.schedulerRunning=!1;for(let e of this.scheduledProtocols.values())e.intervalId&&(clearInterval(e.intervalId),e.intervalId=void 0)}async dispose(){this.stopScheduler(),this.protocols.clear(),this.executions.clear(),this.scheduledProtocols.clear()}async executeProtocol(e,t,o){let r=v(),a=o?.correlationId??r,n={executionId:r,protocolId:e.id,status:"running",participants:[...e.participants],results:new Map,startedAt:new Date,correlationId:a,triggeredBy:o},u={execution:n,protocol:e,params:t,actionResults:new Map,cancelled:!1,paused:!1};this.executions.set(r,u),await this.publishEvent(l.ProtocolStarted,{executionId:r,protocolId:e.id,participants:e.participants},a);try{await this.executeActions(u);let i=Array.from(u.actionResults.values()).some(s=>s.status==="failed");return u.cancelled?n.status="cancelled":i?(n.status="failed",await this.publishEvent(l.ProtocolFailed,{executionId:r,protocolId:e.id,failedActions:Array.from(u.actionResults.values()).filter(s=>s.status==="failed").map(s=>s.actionId)},a)):(n.status="completed",await this.publishEvent(l.ProtocolCompleted,{executionId:r,protocolId:e.id,duration:Date.now()-n.startedAt.getTime()},a)),n.completedAt=new Date,n.results=u.actionResults,await this.storeExecutionHistory(n),p(this.toImmutableExecution(n))}catch(i){return n.status="failed",n.completedAt=new Date,await this.publishEvent(l.ProtocolFailed,{executionId:r,protocolId:e.id,error:x(i)},a),c(f(i))}}async executeActions(e){let{protocol:t,actionResults:o}=e,r=new Set(t.actions.map(n=>n.id)),a=new Set;for(;r.size>0&&!e.cancelled;){for(;e.paused&&!e.cancelled;)await this.sleep(100);if(e.cancelled)break;let n=t.actions.filter(i=>r.has(i.id)&&this.dependenciesSatisfied(i,a));if(n.length===0&&r.size>0)throw new Error(`Deadlock detected: actions ${Array.from(r).join(", ")} cannot proceed`);let u=await Promise.allSettled(n.map(i=>this.executeAction(i,e)));for(let i=0;i<n.length;i++){let s=n[i],d=u[i],m;d.status==="fulfilled"?m=d.value:m={actionId:s.id,status:"failed",error:d.reason instanceof Error?d.reason.message:String(d.reason)},o.set(s.id,m),r.delete(s.id),m.status==="completed"&&a.add(s.id)}}for(let n of r)o.set(n,{actionId:n,status:e.cancelled?"cancelled":"skipped"})}async executeAction(e,t){let o=new Date;await this.publishEvent(l.ActionStarted,{executionId:t.execution.executionId,actionId:e.id,actionName:e.name,targetDomain:e.targetDomain},t.execution.correlationId);let r=0,a=e.retry?.maxAttempts??1,n;for(;r<a;){r++;try{let i=this.getDomainAPI(e.targetDomain);if(!i)throw new Error(`Domain API not available: ${e.targetDomain}`);let s=i[e.method];if(typeof s!="function")throw new Error(`Method ${e.method} not found on domain ${e.targetDomain}`);let d={...e.params,...t.params},m=await this.executeWithTimeout(s.bind(i)(d),e.timeout??3e4),h=new Date;return await this.publishEvent(l.ActionCompleted,{executionId:t.execution.executionId,actionId:e.id,duration:h.getTime()-o.getTime()},t.execution.correlationId),{actionId:e.id,status:"completed",startedAt:o,completedAt:h,duration:h.getTime()-o.getTime(),result:m,retryAttempts:r>1?r-1:void 0}}catch(i){if(n=f(i),r<a&&e.retry){let s=e.retry.backoffMs*Math.pow(e.retry.backoffMultiplier??2,r-1);await this.sleep(s)}}}let u=new Date;return await this.publishEvent(l.ActionFailed,{executionId:t.execution.executionId,actionId:e.id,error:n?.message??"Unknown error",attempts:r},t.execution.correlationId),{actionId:e.id,status:"failed",startedAt:o,completedAt:u,duration:u.getTime()-o.getTime(),error:n?.message??"Unknown error",retryAttempts:r>1?r-1:void 0}}dependenciesSatisfied(e,t){return!e.dependsOn||e.dependsOn.length===0?!0:e.dependsOn.every(o=>t.has(o))}async executeWithTimeout(e,t){return Promise.race([e,new Promise((o,r)=>setTimeout(()=>r(new Error("Action timeout")),t))])}setupEventTriggers(e){if(e.schedule.type==="event")for(let t of e.schedule.triggerEvents)this.eventBus.subscribe(t,async o=>{await this.executeOnEvent(e.id,o)})}scheduleProtocol(e){if(e.schedule.type==="interval"){let t={protocolId:e.id,schedule:e.schedule};t.intervalId=setInterval(async()=>{this.schedulerRunning&&await this.execute(e.id)},e.schedule.intervalMs),this.scheduledProtocols.set(e.id,t)}}async storeExecutionHistory(e){let t=`protocol-execution:${e.executionId}`;await this.memory.set(t,{...e,results:Object.fromEntries(e.results)},{namespace:"coordination",ttl:864e5})}toImmutableExecution(e){return{executionId:e.executionId,protocolId:e.protocolId,status:e.status,participants:[...e.participants],results:new Map(e.results),startedAt:e.startedAt,completedAt:e.completedAt,correlationId:e.correlationId,triggeredBy:e.triggeredBy}}async publishEvent(e,t,o){let r=g(e,"learning-optimization",t,o);await this.eventBus.publish(r)}sleep(e){return new Promise(t=>setTimeout(t,e))}};function S(P,e,t){return new E(P,e,t)}export{E 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.10.6");process.exit(0)}
2
+ import{a as g}from"./chunk-JXCIRWLQ.js";import{b as p,c}from"./chunk-K32AUACO.js";import{a as x,b as f,c as w}from"./chunk-O4MNYX4X.js";import{i as v}from"./chunk-BHD6THT5.js";w();var l={ProtocolStarted:"coordination.ProtocolStarted",ProtocolCompleted:"coordination.ProtocolCompleted",ProtocolFailed:"coordination.ProtocolFailed",ProtocolCancelled:"coordination.ProtocolCancelled",ActionStarted:"coordination.ActionStarted",ActionCompleted:"coordination.ActionCompleted",ActionFailed:"coordination.ActionFailed"},E=class{constructor(e,t,o){this.eventBus=e;this.memory=t;this.getDomainAPI=o}eventBus;memory;getDomainAPI;protocols=new Map;executions=new Map;scheduledProtocols=new Map;schedulerRunning=!1;registerProtocol(e){this.protocols.set(e.id,e),e.schedule.type==="event"&&e.enabled&&this.setupEventTriggers(e),(e.schedule.type==="cron"||e.schedule.type==="interval")&&e.enabled&&this.scheduleProtocol(e)}unregisterProtocol(e){if(!this.protocols.get(e))return!1;let o=this.scheduledProtocols.get(e);return o?.intervalId&&clearInterval(o.intervalId),this.scheduledProtocols.delete(e),this.protocols.delete(e),!0}getProtocol(e){return this.protocols.get(e)}listProtocols(){return Array.from(this.protocols.values())}async execute(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,t):c(new Error(`Protocol is disabled: ${e}`)):c(new Error(`Protocol not found: ${e}`))}async executeOnEvent(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,void 0,t):c(new Error(`Protocol is disabled: ${e}`)):c(new Error(`Protocol not found: ${e}`))}getExecution(e){let t=this.executions.get(e);if(t)return this.toImmutableExecution(t.execution)}listActiveExecutions(){return Array.from(this.executions.values()).filter(e=>e.execution.status==="running"||e.execution.status==="paused").map(e=>this.toImmutableExecution(e.execution))}async cancelExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"&&t.execution.status!=="paused"?c(new Error(`Cannot cancel execution in status: ${t.execution.status}`)):(t.cancelled=!0,t.execution.status="cancelled",t.execution.completedAt=new Date,await this.publishEvent(l.ProtocolCancelled,{executionId:e,protocolId:t.protocol.id}),p(void 0)):c(new Error(`Execution not found: ${e}`))}async pauseExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"?c(new Error(`Cannot pause execution in status: ${t.execution.status}`)):(t.paused=!0,t.execution.status="paused",p(void 0)):c(new Error(`Execution not found: ${e}`))}async resumeExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="paused"?c(new Error(`Cannot resume execution in status: ${t.execution.status}`)):(t.paused=!1,t.execution.status="running",p(void 0)):c(new Error(`Execution not found: ${e}`))}startScheduler(){if(!this.schedulerRunning){this.schedulerRunning=!0;for(let e of this.protocols.values())e.enabled&&(e.schedule.type==="interval"||e.schedule.type==="cron")&&this.scheduleProtocol(e)}}stopScheduler(){this.schedulerRunning=!1;for(let e of this.scheduledProtocols.values())e.intervalId&&(clearInterval(e.intervalId),e.intervalId=void 0)}async dispose(){this.stopScheduler(),this.protocols.clear(),this.executions.clear(),this.scheduledProtocols.clear()}async executeProtocol(e,t,o){let r=v(),a=o?.correlationId??r,n={executionId:r,protocolId:e.id,status:"running",participants:[...e.participants],results:new Map,startedAt:new Date,correlationId:a,triggeredBy:o},u={execution:n,protocol:e,params:t,actionResults:new Map,cancelled:!1,paused:!1};this.executions.set(r,u),await this.publishEvent(l.ProtocolStarted,{executionId:r,protocolId:e.id,participants:e.participants},a);try{await this.executeActions(u);let i=Array.from(u.actionResults.values()).some(s=>s.status==="failed");return u.cancelled?n.status="cancelled":i?(n.status="failed",await this.publishEvent(l.ProtocolFailed,{executionId:r,protocolId:e.id,failedActions:Array.from(u.actionResults.values()).filter(s=>s.status==="failed").map(s=>s.actionId)},a)):(n.status="completed",await this.publishEvent(l.ProtocolCompleted,{executionId:r,protocolId:e.id,duration:Date.now()-n.startedAt.getTime()},a)),n.completedAt=new Date,n.results=u.actionResults,await this.storeExecutionHistory(n),p(this.toImmutableExecution(n))}catch(i){return n.status="failed",n.completedAt=new Date,await this.publishEvent(l.ProtocolFailed,{executionId:r,protocolId:e.id,error:x(i)},a),c(f(i))}}async executeActions(e){let{protocol:t,actionResults:o}=e,r=new Set(t.actions.map(n=>n.id)),a=new Set;for(;r.size>0&&!e.cancelled;){for(;e.paused&&!e.cancelled;)await this.sleep(100);if(e.cancelled)break;let n=t.actions.filter(i=>r.has(i.id)&&this.dependenciesSatisfied(i,a));if(n.length===0&&r.size>0)throw new Error(`Deadlock detected: actions ${Array.from(r).join(", ")} cannot proceed`);let u=await Promise.allSettled(n.map(i=>this.executeAction(i,e)));for(let i=0;i<n.length;i++){let s=n[i],d=u[i],m;d.status==="fulfilled"?m=d.value:m={actionId:s.id,status:"failed",error:d.reason instanceof Error?d.reason.message:String(d.reason)},o.set(s.id,m),r.delete(s.id),m.status==="completed"&&a.add(s.id)}}for(let n of r)o.set(n,{actionId:n,status:e.cancelled?"cancelled":"skipped"})}async executeAction(e,t){let o=new Date;await this.publishEvent(l.ActionStarted,{executionId:t.execution.executionId,actionId:e.id,actionName:e.name,targetDomain:e.targetDomain},t.execution.correlationId);let r=0,a=e.retry?.maxAttempts??1,n;for(;r<a;){r++;try{let i=this.getDomainAPI(e.targetDomain);if(!i)throw new Error(`Domain API not available: ${e.targetDomain}`);let s=i[e.method];if(typeof s!="function")throw new Error(`Method ${e.method} not found on domain ${e.targetDomain}`);let d={...e.params,...t.params},m=await this.executeWithTimeout(s.bind(i)(d),e.timeout??3e4),h=new Date;return await this.publishEvent(l.ActionCompleted,{executionId:t.execution.executionId,actionId:e.id,duration:h.getTime()-o.getTime()},t.execution.correlationId),{actionId:e.id,status:"completed",startedAt:o,completedAt:h,duration:h.getTime()-o.getTime(),result:m,retryAttempts:r>1?r-1:void 0}}catch(i){if(n=f(i),r<a&&e.retry){let s=e.retry.backoffMs*Math.pow(e.retry.backoffMultiplier??2,r-1);await this.sleep(s)}}}let u=new Date;return await this.publishEvent(l.ActionFailed,{executionId:t.execution.executionId,actionId:e.id,error:n?.message??"Unknown error",attempts:r},t.execution.correlationId),{actionId:e.id,status:"failed",startedAt:o,completedAt:u,duration:u.getTime()-o.getTime(),error:n?.message??"Unknown error",retryAttempts:r>1?r-1:void 0}}dependenciesSatisfied(e,t){return!e.dependsOn||e.dependsOn.length===0?!0:e.dependsOn.every(o=>t.has(o))}async executeWithTimeout(e,t){return Promise.race([e,new Promise((o,r)=>setTimeout(()=>r(new Error("Action timeout")),t))])}setupEventTriggers(e){if(e.schedule.type==="event")for(let t of e.schedule.triggerEvents)this.eventBus.subscribe(t,async o=>{await this.executeOnEvent(e.id,o)})}scheduleProtocol(e){if(e.schedule.type==="interval"){let t={protocolId:e.id,schedule:e.schedule};t.intervalId=setInterval(async()=>{this.schedulerRunning&&await this.execute(e.id)},e.schedule.intervalMs),this.scheduledProtocols.set(e.id,t)}}async storeExecutionHistory(e){let t=`protocol-execution:${e.executionId}`;await this.memory.set(t,{...e,results:Object.fromEntries(e.results)},{namespace:"coordination",ttl:864e5})}toImmutableExecution(e){return{executionId:e.executionId,protocolId:e.protocolId,status:e.status,participants:[...e.participants],results:new Map(e.results),startedAt:e.startedAt,completedAt:e.completedAt,correlationId:e.correlationId,triggeredBy:e.triggeredBy}}async publishEvent(e,t,o){let r=g(e,"learning-optimization",t,o);await this.eventBus.publish(r)}sleep(e){return new Promise(t=>setTimeout(t,e))}};function S(P,e,t){return new E(P,e,t)}export{E 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.10.5");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.10.6");process.exit(0)}
2
2
  var u={0:{tier:0,name:"Agent Booster",description:"Mechanical code transforms via Rust/WASM",useCases:["var-to-const conversion","add-types","remove-console statements","promise-to-async","cjs-to-esm","func-to-arrow"],typicalLatencyMs:1,relativeCost:0,exampleModels:["agent-booster-wasm","agent-booster-typescript"],requiresNetwork:!1,complexityRange:[0,10]},1:{tier:1,name:"Haiku",description:"Fast, cost-effective for simple tasks",useCases:["Simple bug fixes","Code formatting","Documentation updates","Basic refactoring","Test generation (simple)"],typicalLatencyMs:500,relativeCost:1,exampleModels:["claude-haiku-4-5-20251001","gpt-4o-mini","gemini-flash"],requiresNetwork:!0,complexityRange:[10,35]},2:{tier:2,name:"Sonnet",description:"Balanced capability for complex reasoning",useCases:["Feature implementation","Complex refactoring","Security analysis","Performance optimization","Test generation (complex)"],typicalLatencyMs:3e3,relativeCost:2,exampleModels:["claude-sonnet-4-6","gpt-4o","gemini-pro"],requiresNetwork:!0,complexityRange:[35,70]},3:{tier:3,name:"Sonnet Extended",description:"Extended context for multi-step workflows",useCases:["Multi-file refactoring","Workflow orchestration","Cross-domain coordination","Large codebase analysis"],typicalLatencyMs:7e3,relativeCost:3,exampleModels:["claude-sonnet-4-6"],requiresNetwork:!0,complexityRange:[60,85]},4:{tier:4,name:"Opus",description:"Maximum capability for critical decisions",useCases:["Architecture design","Security audits","Complex algorithm design","Critical bug analysis","System-wide refactoring"],typicalLatencyMs:5e3,relativeCost:4,exampleModels:["claude-opus-4-7","gpt-4-turbo"],requiresNetwork:!0,complexityRange:[75,100]}},d={enabled:!0,tierBudgets:{0:{tier:0,maxCostPerRequest:0,maxRequestsPerHour:1e4,maxRequestsPerDay:1e5,maxDailyCostUsd:0,enabled:!0},1:{tier:1,maxCostPerRequest:.01,maxRequestsPerHour:100,maxRequestsPerDay:1e3,maxDailyCostUsd:5,enabled:!0},2:{tier:2,maxCostPerRequest:.1,maxRequestsPerHour:50,maxRequestsPerDay:500,maxDailyCostUsd:20,enabled:!0},3:{tier:3,maxCostPerRequest:.5,maxRequestsPerHour:20,maxRequestsPerDay:100,maxDailyCostUsd:30,enabled:!0},4:{tier:4,maxCostPerRequest:2,maxRequestsPerHour:10,maxRequestsPerDay:50,maxDailyCostUsd:50,enabled:!0}},maxDailyCostUsd:100,warningThreshold:.8,onBudgetExceeded:"downgrade",onBudgetWarning:"warn",allowCriticalOverrides:!0},y={budgetConfig:d,enableAgentBooster:!0,agentBoosterThreshold:.7,enableAutoRouting:!0,complexityThresholds:{0:10,1:35,2:70,3:85,4:100},allowManualOverrides:!0,enableDecisionCache:!0,decisionCacheTtlMs:300*1e3,enableMetrics:!0,maxDecisionTimeMs:10,fallbackTier:2,tierModels:{0:"agent-booster",1:"claude-haiku-4-5-20251001",2:"claude-sonnet-4-6",3:"claude-sonnet-4-6",4:"claude-opus-4-7"}},r=class extends Error{constructor(e,t,l){super(e);this.code=t;this.cause=l;this.name="ModelRouterError"}code;cause},a=class extends r{constructor(e,t,l){super(e,"BUDGET_EXCEEDED");this.tier=t;this.usage=l;this.name="BudgetExceededError"}tier;usage},i=class extends r{constructor(o,e){super(o,"COMPLEXITY_ANALYSIS_ERROR",e),this.name="ComplexityAnalysisError"}},s=class extends r{constructor(e,t){super(e,"ROUTING_TIMEOUT");this.timeoutMs=t;this.name="RoutingTimeoutError"}timeoutMs};export{u as a,d as b,y as c,r as d,a as e,i 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.10.5");process.exit(0)}
2
- import{b as R,c as y}from"./chunk-D7NKRCIL.js";import{e as A,f as E}from"./chunk-MFQIJ3HV.js";import{a as m,c as g,e as h,g as b}from"./chunk-S7HQOGVD.js";var T={};h(T,{__setSharedRvfAdapterForTests:()=>S,compactSharedRvfAdapter:()=>F,decideCompactionFromStatus:()=>p,getSharedRvfAdapter:()=>$,resetSharedRvfAdapter:()=>_,runBootCompactGuard:()=>v});function S(e){s=e,f=e!==null}function $(e=".agentic-qe",r=384){if(f)return s;f=!0;try{let{isRvfNativeAvailable:t,createRvfStore:n,openRvfStore:o}=(E(),b(A));if(!t())return console.warn("[RVF] Native bindings unavailable \u2014 agent branching and dream COW disabled. Install @ruvector/rvf-node to enable."),null;let l=m("path"),c=l.isAbsolute(e)?e:l.join(process.env.AQE_PROJECT_ROOT??R(),e),u=l.join(c,"patterns.rvf");return s=B(o,n,u,r),v(s,u),s}catch(t){return console.warn("[RVF] Shared adapter init failed:",t instanceof Error?t.message:t),null}}function B(e,r,t,n){let o=()=>{try{return{adapter:e(t),err:null}}catch(a){return{adapter:null,err:a}}},l=a=>{let i=a instanceof Error?a.message:String(a);return i.includes("LockHeld")||i.includes("0x0300")},{adapter:c,err:u}=o();if(!c&&l(u))try{let a=m("fs"),i=`${t}.lock`;a.existsSync(i)&&(a.unlinkSync(i),console.warn(`[RVF] Removed stale lock file at ${i} (prior process exited without closing). Retrying open. If you see this repeatedly under live concurrency, file an issue.`),{adapter:c,err:u}=o())}catch(a){process.env.DEBUG&&console.debug("[RVF] stale-lock recovery failed:",a instanceof Error?a.message:a)}if(c){let a=c.dimension();if(a===n)return c;console.warn(`[RVF] patterns.rvf dimension mismatch: file=${a} requested=${n} \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=${a}, requested=${n})`)}try{return r(t,n)}catch(a){try{let i=e(t);if(i.dimension()!==n){try{i.close()}catch{}throw new Error(`RVF dimension mismatch after race (file=${i.dimension()}, requested=${n})`)}return i}catch{throw a instanceof Error?a:new Error(String(a))}}}function p(e,r){if(r?.force)return{shouldCompact:!0,trigger:"force"};let t=r?.sizeGuardBytes??C,n=r?.deadRatioThreshold??N;return e.fileSizeBytes>=t?{shouldCompact:!0,trigger:"size-guard"}:(e.deadSpaceRatio??0)>=n?{shouldCompact:!0,trigger:"dead-ratio"}:{shouldCompact:!1,trigger:"none"}}function F(e){if(!s)return null;let r;try{r=s.status()}catch{return null}let t=p(r,e);if(!t.shouldCompact)return null;let n=r.fileSizeBytes,o;try{o=s.compact()}catch{return null}return o?((o.bytesReclaimed>0||o.segmentsCompacted>0)&&console.log(`[RVF] compacted patterns.rvf: reclaimed ${d(o.bytesReclaimed)} (${o.segmentsCompacted} segments, fileSize ${d(n)} \u2192 ${d(Math.max(0,n-o.bytesReclaimed))}, trigger: ${t.trigger})`),o):null}function v(e,r){try{let t=e.status(),n=p(t);if(!n.shouldCompact)return null;let o=e.compact();return o&&(o.bytesReclaimed>0||o.segmentsCompacted>0)&&console.log(`[RVF] boot-time compact (${r}): reclaimed ${d(o.bytesReclaimed)} from ${o.segmentsCompacted} segments (trigger: ${n.trigger})`),o}catch(t){return process.env.DEBUG&&console.debug("[RVF] boot-time compact guard skipped:",t instanceof Error?t.message:t),null}}function d(e){if(!Number.isFinite(e)||e<0)return`${e}B`;let r=["B","KB","MB","GB","TB"],t=0,n=e;for(;n>=1024&&t<r.length-1;)n/=1024,t++;return`${n.toFixed(t===0?0:1)}${r[t]}`}function _(){if(s){try{s.close()}catch{}s=null}f=!1}var s,f,C,N,w=g(()=>{y();s=null,f=!1;C=(()=>{let e=process.env.AQE_RVF_SIZE_GUARD_BYTES,r=e?Number(e):NaN;return Number.isFinite(r)&&r>0?r:256*1024*1024})(),N=(()=>{let e=process.env.AQE_RVF_DEAD_RATIO_THRESHOLD,r=e?Number(e):NaN;return Number.isFinite(r)&&r>0&&r<=1?r:.3})()});export{S as a,$ as b,p as c,F as d,v as e,_ as f,T as g,w as h};
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.10.6");process.exit(0)}
2
+ import{b as R,c as y}from"./chunk-QJXZ4SU7.js";import{e as A,f as E}from"./chunk-M3APJ7VS.js";import{a as m,c as g,e as h,g as b}from"./chunk-UNDPB5SS.js";var T={};h(T,{__setSharedRvfAdapterForTests:()=>S,compactSharedRvfAdapter:()=>F,decideCompactionFromStatus:()=>p,getSharedRvfAdapter:()=>$,resetSharedRvfAdapter:()=>_,runBootCompactGuard:()=>v});function S(e){s=e,f=e!==null}function $(e=".agentic-qe",r=384){if(f)return s;f=!0;try{let{isRvfNativeAvailable:t,createRvfStore:n,openRvfStore:o}=(E(),b(A));if(!t())return console.warn("[RVF] Native bindings unavailable \u2014 agent branching and dream COW disabled. Install @ruvector/rvf-node to enable."),null;let l=m("path"),c=l.isAbsolute(e)?e:l.join(process.env.AQE_PROJECT_ROOT??R(),e),u=l.join(c,"patterns.rvf");return s=B(o,n,u,r),v(s,u),s}catch(t){return console.warn("[RVF] Shared adapter init failed:",t instanceof Error?t.message:t),null}}function B(e,r,t,n){let o=()=>{try{return{adapter:e(t),err:null}}catch(a){return{adapter:null,err:a}}},l=a=>{let i=a instanceof Error?a.message:String(a);return i.includes("LockHeld")||i.includes("0x0300")},{adapter:c,err:u}=o();if(!c&&l(u))try{let a=m("fs"),i=`${t}.lock`;a.existsSync(i)&&(a.unlinkSync(i),console.warn(`[RVF] Removed stale lock file at ${i} (prior process exited without closing). Retrying open. If you see this repeatedly under live concurrency, file an issue.`),{adapter:c,err:u}=o())}catch(a){process.env.DEBUG&&console.debug("[RVF] stale-lock recovery failed:",a instanceof Error?a.message:a)}if(c){let a=c.dimension();if(a===n)return c;console.warn(`[RVF] patterns.rvf dimension mismatch: file=${a} requested=${n} \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=${a}, requested=${n})`)}try{return r(t,n)}catch(a){try{let i=e(t);if(i.dimension()!==n){try{i.close()}catch{}throw new Error(`RVF dimension mismatch after race (file=${i.dimension()}, requested=${n})`)}return i}catch{throw a instanceof Error?a:new Error(String(a))}}}function p(e,r){if(r?.force)return{shouldCompact:!0,trigger:"force"};let t=r?.sizeGuardBytes??C,n=r?.deadRatioThreshold??N;return e.fileSizeBytes>=t?{shouldCompact:!0,trigger:"size-guard"}:(e.deadSpaceRatio??0)>=n?{shouldCompact:!0,trigger:"dead-ratio"}:{shouldCompact:!1,trigger:"none"}}function F(e){if(!s)return null;let r;try{r=s.status()}catch{return null}let t=p(r,e);if(!t.shouldCompact)return null;let n=r.fileSizeBytes,o;try{o=s.compact()}catch{return null}return o?((o.bytesReclaimed>0||o.segmentsCompacted>0)&&console.log(`[RVF] compacted patterns.rvf: reclaimed ${d(o.bytesReclaimed)} (${o.segmentsCompacted} segments, fileSize ${d(n)} \u2192 ${d(Math.max(0,n-o.bytesReclaimed))}, trigger: ${t.trigger})`),o):null}function v(e,r){try{let t=e.status(),n=p(t);if(!n.shouldCompact)return null;let o=e.compact();return o&&(o.bytesReclaimed>0||o.segmentsCompacted>0)&&console.log(`[RVF] boot-time compact (${r}): reclaimed ${d(o.bytesReclaimed)} from ${o.segmentsCompacted} segments (trigger: ${n.trigger})`),o}catch(t){return process.env.DEBUG&&console.debug("[RVF] boot-time compact guard skipped:",t instanceof Error?t.message:t),null}}function d(e){if(!Number.isFinite(e)||e<0)return`${e}B`;let r=["B","KB","MB","GB","TB"],t=0,n=e;for(;n>=1024&&t<r.length-1;)n/=1024,t++;return`${n.toFixed(t===0?0:1)}${r[t]}`}function _(){if(s){try{s.close()}catch{}s=null}f=!1}var s,f,C,N,w=g(()=>{y();s=null,f=!1;C=(()=>{let e=process.env.AQE_RVF_SIZE_GUARD_BYTES,r=e?Number(e):NaN;return Number.isFinite(r)&&r>0?r:256*1024*1024})(),N=(()=>{let e=process.env.AQE_RVF_DEAD_RATIO_THRESHOLD,r=e?Number(e):NaN;return Number.isFinite(r)&&r>0&&r<=1?r:.3})()});export{S as a,$ as b,p as c,F as d,v as e,_ as f,T as g,w as h};