agentic-qe 3.9.0 → 3.9.1

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 (411) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +32 -0
  3. package/dist/audit/witness-chain.d.ts +1 -1
  4. package/dist/cli/bundle.js +5 -5
  5. package/dist/cli/chunks/adapter-NTM4ZH3P.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-PQYB7VRU.js → agent-booster-wasm-UH2J6BNA.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-QDAB5NQS.js → agent-handler-ZCBWQE3X.js} +2 -2
  8. package/dist/cli/chunks/agent-memory-branch-2BAVI7UW.js +2 -0
  9. package/dist/cli/chunks/aqe-learning-engine-RVX6MPYK.js +2 -0
  10. package/dist/cli/chunks/{audit-S7JUYYVP.js → audit-G5UIJBSQ.js} +2 -2
  11. package/dist/cli/chunks/base-7HKNQ6UP.js +2 -0
  12. package/dist/cli/chunks/better-sqlite3-YHIAPPVT.js +2 -0
  13. package/dist/cli/chunks/brain-handler-5EE3J5PR.js +68 -0
  14. package/dist/cli/chunks/{branch-enumerator-XK4V5W7L.js → branch-enumerator-OV54PID5.js} +2 -2
  15. package/dist/cli/chunks/{browser-PALA5PL3.js → browser-7RZGKOEO.js} +2 -2
  16. package/dist/cli/chunks/browser-workflow-UOFSQK7X.js +2 -0
  17. package/dist/cli/chunks/{chunk-JJO7Y4H3.js → chunk-24E47G3D.js} +3 -3
  18. package/dist/cli/chunks/{chunk-UFUVUO3J.js → chunk-35H73OPP.js} +2 -2
  19. package/dist/cli/chunks/{chunk-7R6YMLVS.js → chunk-36X2O3BL.js} +2 -2
  20. package/dist/cli/chunks/{chunk-OI5NGQO2.js → chunk-3JESHZQM.js} +2 -2
  21. package/dist/cli/chunks/{chunk-72WOAVK6.js → chunk-3VAKR43Z.js} +1 -1
  22. package/dist/cli/chunks/chunk-3WQNW6CH.js +2 -0
  23. package/dist/cli/chunks/{chunk-24FKIJNC.js → chunk-43M6Y6VF.js} +2 -2
  24. package/dist/cli/chunks/{chunk-ZDATDCYN.js → chunk-4BHOAQJH.js} +1 -1
  25. package/dist/cli/chunks/{chunk-XIBDETCS.js → chunk-4LWXZCSD.js} +2 -2
  26. package/dist/cli/chunks/{chunk-3IUNFTIF.js → chunk-4TNXEANY.js} +1 -1
  27. package/dist/cli/chunks/{chunk-RTGGL7D7.js → chunk-4XBY5JDT.js} +2 -2
  28. package/dist/cli/chunks/chunk-4XREPCBZ.js +2 -0
  29. package/dist/cli/chunks/{chunk-TLHP5EII.js → chunk-5GPTM2RV.js} +1 -1
  30. package/dist/cli/chunks/{chunk-FGA7VIFR.js → chunk-5KBQQP3X.js} +3 -3
  31. package/dist/cli/chunks/{chunk-3ZOONQG6.js → chunk-5LDBKZ6P.js} +1 -1
  32. package/dist/cli/chunks/{chunk-LNQIY6BP.js → chunk-6BSJNG2S.js} +2 -2
  33. package/dist/cli/chunks/{chunk-EHDQJQ6Y.js → chunk-6YC24TPL.js} +5 -5
  34. package/dist/cli/chunks/{chunk-YVA65UZL.js → chunk-7ATLJCSG.js} +1 -1
  35. package/dist/cli/chunks/{chunk-U5RN7YQW.js → chunk-7JQTHPCD.js} +2 -2
  36. package/dist/cli/chunks/{chunk-ESVQ6MEB.js → chunk-7YUOUVN7.js} +2 -2
  37. package/dist/cli/chunks/{chunk-YAGODYIG.js → chunk-7ZNINH6J.js} +3 -3
  38. package/dist/cli/chunks/{chunk-4VUPRTVX.js → chunk-A57BEPL7.js} +2 -2
  39. package/dist/cli/chunks/{chunk-N2NS2PHA.js → chunk-AFPMCMVX.js} +2 -2
  40. package/dist/cli/chunks/{chunk-RU5WAHB7.js → chunk-AREIP4FX.js} +2 -2
  41. package/dist/cli/chunks/{chunk-XO6PVK2P.js → chunk-B2I7BJLL.js} +2 -2
  42. package/dist/cli/chunks/{chunk-HY6PMO5W.js → chunk-BEHP3DEF.js} +2 -2
  43. package/dist/cli/chunks/{chunk-YPFOCNOE.js → chunk-C24ZDUCM.js} +1 -1
  44. package/dist/cli/chunks/{chunk-CL6POIX4.js → chunk-D4PSFWND.js} +1 -1
  45. package/dist/cli/chunks/{chunk-YR6ZZGH7.js → chunk-D55PSO5D.js} +1 -1
  46. package/dist/cli/chunks/{chunk-4YS3IJ45.js → chunk-DC3HPOOJ.js} +1 -1
  47. package/dist/cli/chunks/chunk-DMGLX76J.js +180 -0
  48. package/dist/cli/chunks/{chunk-NZ2VCPN4.js → chunk-E33KQBMW.js} +2 -2
  49. package/dist/cli/chunks/{chunk-YANUP2RO.js → chunk-EQFZQPFN.js} +1 -1
  50. package/dist/cli/chunks/{chunk-TWUWL5EJ.js → chunk-FPRL6UDF.js} +2 -2
  51. package/dist/cli/chunks/{chunk-GRUUQAR6.js → chunk-FRNB4CH2.js} +2 -2
  52. package/dist/cli/chunks/{chunk-WBQSXPBI.js → chunk-FWDKVTK4.js} +2 -2
  53. package/dist/cli/chunks/chunk-GFNUESMU.js +2 -0
  54. package/dist/cli/chunks/{chunk-JBANAPWG.js → chunk-GJW6V35N.js} +1 -1
  55. package/dist/cli/chunks/{chunk-BULKFVYX.js → chunk-GLIFZWV2.js} +1 -1
  56. package/dist/cli/chunks/{chunk-WJ3DLOXF.js → chunk-GNUUBTSX.js} +2 -2
  57. package/dist/cli/chunks/{chunk-MZOFWJTM.js → chunk-HAUXLXKZ.js} +2 -2
  58. package/dist/cli/chunks/{chunk-X3KI6JOY.js → chunk-HTXSUTWL.js} +2 -2
  59. package/dist/cli/chunks/chunk-I5WZ2NM2.js +95 -0
  60. package/dist/cli/chunks/{chunk-BLBRY5UD.js → chunk-I7TA453K.js} +2 -2
  61. package/dist/cli/chunks/{chunk-5T2ZQWKF.js → chunk-IF6GW6IY.js} +2 -2
  62. package/dist/cli/chunks/{chunk-GKNNSCLC.js → chunk-IHWSNYL2.js} +2 -2
  63. package/dist/cli/chunks/chunk-IJKYJGJL.js +2 -0
  64. package/dist/cli/chunks/{chunk-3ADGXLTM.js → chunk-IQPXANCE.js} +1 -1
  65. package/dist/cli/chunks/{chunk-VOS4NQSF.js → chunk-JCEY7RLP.js} +2 -2
  66. package/dist/cli/chunks/{chunk-WGMPEW2T.js → chunk-JSOBRKMA.js} +2 -2
  67. package/dist/cli/chunks/{chunk-GPQ57KA4.js → chunk-KIGRLIU4.js} +2 -2
  68. package/dist/cli/chunks/{chunk-IFNIIK34.js → chunk-L4H54Z27.js} +3 -3
  69. package/dist/cli/chunks/{chunk-CS2KS7LP.js → chunk-LCOEBFAB.js} +1 -1
  70. package/dist/cli/chunks/chunk-MZ54VM6A.js +2 -0
  71. package/dist/cli/chunks/{chunk-IAV2JMIX.js → chunk-NB47YT6A.js} +2 -2
  72. package/dist/cli/chunks/{chunk-B36CDR4U.js → chunk-NG3BKE7V.js} +2 -2
  73. package/dist/cli/chunks/{chunk-WIEC7VKK.js → chunk-NG4TE3OW.js} +2 -2
  74. package/dist/cli/chunks/{chunk-Y7BHKZFJ.js → chunk-O636JKJR.js} +2 -2
  75. package/dist/cli/chunks/{chunk-BTREG4IW.js → chunk-O6QQ4HLS.js} +2 -2
  76. package/dist/cli/chunks/{chunk-MDUHYUHF.js → chunk-OFNIQCGX.js} +2 -2
  77. package/dist/cli/chunks/{chunk-JXM26HEE.js → chunk-OTSJU5LH.js} +2 -2
  78. package/dist/cli/chunks/{chunk-AFLLQ5PP.js → chunk-POLFT2PQ.js} +2 -2
  79. package/dist/cli/chunks/{chunk-XLRQYLWW.js → chunk-QAYTL6KC.js} +1 -1
  80. package/dist/cli/chunks/{chunk-AKE543X2.js → chunk-QMFP5OKH.js} +2 -2
  81. package/dist/cli/chunks/{chunk-OLHKGP35.js → chunk-RAJO7VML.js} +2 -2
  82. package/dist/cli/chunks/{chunk-5SKGFSKD.js → chunk-RKIGOARX.js} +2 -2
  83. package/dist/cli/chunks/{chunk-IGJPMN4I.js → chunk-RU6Q5HOC.js} +1 -1
  84. package/dist/cli/chunks/chunk-RV6SGDET.js +2 -0
  85. package/dist/cli/chunks/chunk-RWXI7XAR.js +2 -0
  86. package/dist/cli/chunks/{chunk-3NZLZHJI.js → chunk-RXVYOXDB.js} +1 -1
  87. package/dist/cli/chunks/{chunk-7VDBAVTY.js → chunk-SGRN6JFB.js} +2 -2
  88. package/dist/cli/chunks/{chunk-BPWXXEH2.js → chunk-SVNX4UWR.js} +128 -128
  89. package/dist/cli/chunks/{chunk-B6LLWYQ6.js → chunk-TL7ABIMP.js} +2 -2
  90. package/dist/cli/chunks/{chunk-6EOS7KX2.js → chunk-TOLYWONQ.js} +2 -2
  91. package/dist/cli/chunks/{chunk-XRE2HCWG.js → chunk-TPXYS3WG.js} +1 -1
  92. package/dist/cli/chunks/chunk-U5JQGRHZ.js +2 -0
  93. package/dist/cli/chunks/{chunk-SUSEVMZT.js → chunk-UB7RGVKO.js} +1 -1
  94. package/dist/cli/chunks/{chunk-4YOMLWEK.js → chunk-UBKK7KCR.js} +1 -1
  95. package/dist/cli/chunks/chunk-UMGWGX7C.js +2 -0
  96. package/dist/cli/chunks/chunk-UN4PA4M2.js +2 -0
  97. package/dist/cli/chunks/{chunk-N4TL73TH.js → chunk-US7INRP2.js} +8 -8
  98. package/dist/cli/chunks/{chunk-LHJQD2VU.js → chunk-UWDBFPHQ.js} +68 -68
  99. package/dist/cli/chunks/{chunk-4I2IOUS4.js → chunk-UZZCWWIG.js} +1 -1
  100. package/dist/cli/chunks/{chunk-BXAXGEFC.js → chunk-V4HM4QAO.js} +5 -5
  101. package/dist/cli/chunks/{chunk-2E5NQNSU.js → chunk-V4U3CTS2.js} +11 -11
  102. package/dist/cli/chunks/{chunk-XT2V2322.js → chunk-VCCMCFDU.js} +2 -2
  103. package/dist/cli/chunks/{chunk-2BZFNEN2.js → chunk-VEWIT6VN.js} +1 -1
  104. package/dist/cli/chunks/{chunk-4VBTXZRM.js → chunk-VNYGVG4Y.js} +2 -2
  105. package/dist/cli/chunks/{chunk-BGXNSCXX.js → chunk-VO3OVD5D.js} +1 -1
  106. package/dist/cli/chunks/{chunk-6SVX4DJC.js → chunk-VY74OMGQ.js} +3 -3
  107. package/dist/cli/chunks/{chunk-HRO6OZQD.js → chunk-WDJBGXC2.js} +1 -1
  108. package/dist/cli/chunks/chunk-WDV6TN7E.js +65 -0
  109. package/dist/cli/chunks/{chunk-YW2THB5Q.js → chunk-WLXEDOG4.js} +2 -2
  110. package/dist/cli/chunks/chunk-WXXAAXNS.js +12 -0
  111. package/dist/cli/chunks/{chunk-VSVXUTJN.js → chunk-X4MZYBOU.js} +2 -2
  112. package/dist/cli/chunks/{chunk-3IHG3WOY.js → chunk-XE2YAYU5.js} +3 -3
  113. package/dist/cli/chunks/chunk-XP6XKBNW.js +2 -0
  114. package/dist/cli/chunks/{chunk-JRYGQO2W.js → chunk-XPB6ZVQY.js} +1 -1
  115. package/dist/cli/chunks/chunk-XRVUSKQV.js +1 -0
  116. package/dist/cli/chunks/{chunk-ZAPS3UGQ.js → chunk-XSITQBYB.js} +3 -3
  117. package/dist/cli/chunks/{chunk-BDIEMZ22.js → chunk-XTLA4F5Z.js} +2 -2
  118. package/dist/cli/chunks/{chunk-FEKY7T6Q.js → chunk-XU6L2VJY.js} +2 -2
  119. package/dist/cli/chunks/chunk-XUFHYPZK.js +2 -0
  120. package/dist/cli/chunks/{chunk-UQHYFOBX.js → chunk-Y2ZEDXTV.js} +2 -2
  121. package/dist/cli/chunks/{chunk-CWFB6BSA.js → chunk-YQWB4QUP.js} +4 -4
  122. package/dist/cli/chunks/chunk-YUQIXT3G.js +79 -0
  123. package/dist/cli/chunks/chunk-YYYB2JN5.js +2 -0
  124. package/dist/cli/chunks/{chunk-GAOJV3OX.js → chunk-ZEUVPLGX.js} +2 -2
  125. package/dist/cli/chunks/{chunk-KP5NUODU.js → chunk-ZSRQHJEW.js} +1 -1
  126. package/dist/cli/chunks/{ci-J374KDLI.js → ci-N4NTYAAI.js} +2 -2
  127. package/dist/cli/chunks/ci-output-XYR2PSYH.js +2 -0
  128. package/dist/cli/chunks/{claude-flow-setup-245JLJCN.js → claude-flow-setup-FX7PRBJV.js} +2 -2
  129. package/dist/cli/chunks/client-CRRENRK4.js +2 -0
  130. package/dist/cli/chunks/{cline-installer-LBA2M5N3.js → cline-installer-GTHQOK7U.js} +2 -2
  131. package/dist/cli/chunks/{code-U4N4WONM.js → code-4G6ZHVNI.js} +2 -2
  132. package/dist/cli/chunks/{code-index-extractor-A57Z6BO4.js → code-index-extractor-MKJTP5AK.js} +2 -2
  133. package/dist/cli/chunks/{codex-installer-UXMK2N4T.js → codex-installer-UGS773DT.js} +2 -2
  134. package/dist/cli/chunks/{completions-W66BSCOE.js → completions-B3BXNXAU.js} +2 -2
  135. package/dist/cli/chunks/complexity-analyzer-PMN77CUP.js +2 -0
  136. package/dist/cli/chunks/{continuedev-installer-LRFZ2SJM.js → continuedev-installer-3DYKSIP3.js} +2 -2
  137. package/dist/cli/chunks/{copilot-installer-CQ3JYBIB.js → copilot-installer-IUC5HDHD.js} +2 -2
  138. package/dist/cli/chunks/cost-tracker-GSGQ7O5T.js +2 -0
  139. package/dist/cli/chunks/{coverage-4PUEQXAY.js → coverage-PO72QC3P.js} +3 -3
  140. package/dist/cli/chunks/cross-domain-router-FSCGJG3B.js +2 -0
  141. package/dist/cli/chunks/{cursor-installer-JZEDEDHA.js → cursor-installer-FK53S3ZL.js} +2 -2
  142. package/dist/cli/chunks/{daemon-B7TWGHXQ.js → daemon-4UIQTQ73.js} +3 -3
  143. package/dist/cli/chunks/dag-attention-scheduler-ZGIMLECE.js +2 -0
  144. package/dist/cli/chunks/detect-XXHLTLL7.js +2 -0
  145. package/dist/cli/chunks/{domain-handler-FT5FLZWL.js → domain-handler-PPGFP7P4.js} +2 -2
  146. package/dist/cli/chunks/domain-transfer-Q5UAE65W.js +2 -0
  147. package/dist/cli/chunks/dream-PONKQULG.js +2 -0
  148. package/dist/cli/chunks/esm-node-XLWDJRBX.js +2 -0
  149. package/dist/cli/chunks/{eval-GHMPFGWV.js → eval-JVJKHSTQ.js} +2 -2
  150. package/dist/cli/chunks/{fast-paths-B3R647KN.js → fast-paths-3KX4ZV66.js} +2 -2
  151. package/dist/cli/chunks/feature-flags-2NOVE7DL.js +2 -0
  152. package/dist/cli/chunks/{feature-flags-DWS7ARSX.js → feature-flags-GKHHG2I2.js} +2 -2
  153. package/dist/cli/chunks/file-discovery-XFSGQNM3.js +2 -0
  154. package/dist/cli/chunks/{fleet-EKOKMOMW.js → fleet-FOIDAXLR.js} +3 -3
  155. package/dist/cli/chunks/gnn-wrapper-HPCQREKP.js +2 -0
  156. package/dist/cli/chunks/{heartbeat-handler-MBBS4IBU.js → heartbeat-handler-HTR3EFFV.js} +4 -4
  157. package/dist/cli/chunks/{heartbeat-scheduler-XDGMOT7X.js → heartbeat-scheduler-NZQWN7CH.js} +2 -2
  158. package/dist/cli/chunks/hnsw-adapter-BNA5WUAB.js +2 -0
  159. package/dist/cli/chunks/hnsw-index-RQIIAE7S.js +2 -0
  160. package/dist/cli/chunks/hnsw-legacy-bridge-H6OA3AA3.js +2 -0
  161. package/dist/cli/chunks/hnswlib-node-FF27BDMD.js +2 -0
  162. package/dist/cli/chunks/{hooks-L5VLZGEK.js → hooks-63NZQ7NH.js} +6 -6
  163. package/dist/cli/chunks/hypergraph-engine-XMSLA4XH.js +2 -0
  164. package/dist/cli/chunks/{hypergraph-handler-3HDGB5SZ.js → hypergraph-handler-ID6J6GS2.js} +3 -3
  165. package/dist/cli/chunks/impact-analyzer-FS2UNVP4.js +2 -0
  166. package/dist/cli/chunks/{init-handler-JDET6WUN.js → init-handler-CIKZGGAY.js} +6 -6
  167. package/dist/cli/chunks/init-wizard-TUU5PPY6.js +2 -0
  168. package/dist/cli/chunks/kernel-XFG42WAG.js +2 -0
  169. package/dist/cli/chunks/{kilocode-installer-GZZG5AFW.js → kilocode-installer-N7NLISYY.js} +2 -2
  170. package/dist/cli/chunks/{kiro-installer-IWNY5TKH.js → kiro-installer-U6XIPAT3.js} +2 -2
  171. package/dist/cli/chunks/knowledge-graph-XV7FPU2T.js +2 -0
  172. package/dist/cli/chunks/{learning-722ZNSZ6.js → learning-NKOF7KDJ.js} +3 -3
  173. package/dist/cli/chunks/{llm-router-DNAV746L.js → llm-router-34WHT3PH.js} +2 -2
  174. package/dist/cli/chunks/{load-Y3GCUFM4.js → load-ZW4Z3YLT.js} +2 -2
  175. package/dist/cli/chunks/load-test-F4L7RTXJ.js +2 -0
  176. package/dist/cli/chunks/{mcp-LKPIBZ3W.js → mcp-6R7SVGKO.js} +2 -2
  177. package/dist/cli/chunks/{memory-L57MLFOP.js → memory-OUYCBU4M.js} +5 -5
  178. package/dist/cli/chunks/memory-backend-DTJD2DWF.js +2 -0
  179. package/dist/cli/chunks/{memory-handlers-MDZQ7HVW.js → memory-handlers-WNXKZRNM.js} +2 -2
  180. package/dist/cli/chunks/opencode-installer-FR75GHFU.js +3 -0
  181. package/dist/cli/chunks/{orchestrator-QHSBB2UC.js → orchestrator-AK7ZMVNH.js} +5 -5
  182. package/dist/cli/chunks/{pipeline-D3QER35Z.js → pipeline-CFOPG7EM.js} +2 -2
  183. package/dist/cli/chunks/{platform-T4E7Q3RD.js → platform-NY3ULBR7.js} +2 -2
  184. package/dist/cli/chunks/{plugin-JHW2YPRC.js → plugin-LRANQYUR.js} +2 -2
  185. package/dist/cli/chunks/{prime-radiant-advanced-wasm-G7CFNNQV.js → prime-radiant-advanced-wasm-6KEIU55P.js} +2 -2
  186. package/dist/cli/chunks/protocol-executor-6W4PS2D4.js +2 -0
  187. package/dist/cli/chunks/{protocol-handler-2BQQ4HDM.js → protocol-handler-ESSZGJ7R.js} +2 -2
  188. package/dist/cli/chunks/{prove-UQ6JFT73.js → prove-EF2PPY65.js} +2 -2
  189. package/dist/cli/chunks/qe-reasoning-bank-7G3TZLEA.js +2 -0
  190. package/dist/cli/chunks/{quality-JRZYMC77.js → quality-AYBXB635.js} +2 -2
  191. package/dist/cli/chunks/queen-coordinator-NFPKGMQN.js +2 -0
  192. package/dist/cli/chunks/real-embeddings-QPBXE7MA.js +2 -0
  193. package/dist/cli/chunks/{roocode-installer-F4E2LAYR.js → roocode-installer-UF6MMBH6.js} +2 -2
  194. package/dist/cli/chunks/router-F4B7Q66G.js +2 -0
  195. package/dist/cli/chunks/routing-feedback-5CIDDW7P.js +2 -0
  196. package/dist/cli/chunks/{routing-handler-VNKFUUGB.js → routing-handler-5TVKFU7V.js} +2 -2
  197. package/dist/cli/chunks/ruvector-commands-E33VXFIA.js +8 -0
  198. package/dist/cli/chunks/rvf-dual-writer-O3AZKD24.js +2 -0
  199. package/dist/cli/chunks/rvf-migration-adapter-IKEUZ2HX.js +2 -0
  200. package/dist/cli/chunks/rvf-migration-coordinator-M4H7W4RN.js +2 -0
  201. package/dist/cli/chunks/rvf-native-adapter-UX3WAPIP.js +2 -0
  202. package/dist/cli/chunks/safe-db-QBBNXEVK.js +2 -0
  203. package/dist/cli/chunks/schedule-GFT4NN6Z.js +2 -0
  204. package/dist/cli/chunks/scheduler-CQ56T7DB.js +2 -0
  205. package/dist/cli/chunks/{security-EBEG2OPU.js → security-ZLWT7IU3.js} +3 -3
  206. package/dist/cli/chunks/shared-rvf-adapter-EXACQ2PT.js +2 -0
  207. package/dist/cli/chunks/shared-rvf-dual-writer-G43LQDIV.js +2 -0
  208. package/dist/cli/chunks/sqlite-persistence-JHSUZPAW.js +2 -0
  209. package/dist/cli/chunks/{status-handler-VZ32M4G4.js → status-handler-7P23CXUI.js} +2 -2
  210. package/dist/cli/chunks/{structural-health-K6LRCKV6.js → structural-health-SCNBNL7K.js} +2 -2
  211. package/dist/cli/chunks/{sync-MHSHNLIM.js → sync-BYZBBH65.js} +2 -2
  212. package/dist/cli/chunks/{task-handler-JNOIBZ2G.js → task-handler-DWJQXZ2K.js} +2 -2
  213. package/dist/cli/chunks/{task-handlers-P5DSUKND.js → task-handlers-35JIXVRW.js} +2 -2
  214. package/dist/cli/chunks/{test-DO22BNIL.js → test-2JSS4XW7.js} +4 -4
  215. package/dist/cli/chunks/{test-scheduling-VLRQZEFL.js → test-scheduling-TWJ5I7N3.js} +3 -3
  216. package/dist/cli/chunks/{token-bootstrap-4VJKGVMK.js → token-bootstrap-LLLNJT5V.js} +2 -2
  217. package/dist/cli/chunks/{token-usage-LG3PXRXH.js → token-usage-EQ4HM4EZ.js} +2 -2
  218. package/dist/cli/chunks/transformers-PBIR5U5S.js +2 -0
  219. package/dist/cli/chunks/{tree-sitter-wasm-parser-FT2KB66N.js → tree-sitter-wasm-parser-X3L2GXUX.js} +2 -2
  220. package/dist/cli/chunks/types-OD43K2NP.js +2 -0
  221. package/dist/cli/chunks/unified-memory-YPHONR2T.js +2 -0
  222. package/dist/cli/chunks/unified-memory-hnsw-HJS4OXWM.js +2 -0
  223. package/dist/cli/chunks/unified-persistence-EFZRO6AW.js +2 -0
  224. package/dist/cli/chunks/{validate-VQCRSVNQ.js → validate-POMLT2KU.js} +2 -2
  225. package/dist/cli/chunks/{validate-swarm-A5DHAWTP.js → validate-swarm-UOC4JGZT.js} +2 -2
  226. package/dist/cli/chunks/{vibium-RZBSL4EB.js → vibium-5JF6LAXI.js} +2 -2
  227. package/dist/cli/chunks/visual-security-7KWFLYNB.js +2 -0
  228. package/dist/cli/chunks/{web-tree-sitter-7C4NXEOF.js → web-tree-sitter-R7WR7J7B.js} +2 -2
  229. package/dist/cli/chunks/{windsurf-installer-ES3KPQG3.js → windsurf-installer-ZSPEUBKR.js} +2 -2
  230. package/dist/cli/chunks/witness-chain-CFSPCXHG.js +2 -0
  231. package/dist/cli/chunks/witness-chain-RWU6WT37.js +2 -0
  232. package/dist/cli/chunks/{workflow-JETHX4ML.js → workflow-YNQT3OW2.js} +4 -4
  233. package/dist/cli/chunks/workflow-orchestrator-Z6TAVMQP.js +2 -0
  234. package/dist/cli/chunks/{wrappers-WP5RH745.js → wrappers-BP4FODVH.js} +2 -2
  235. package/dist/cli/commands/ruvector-commands.js +14 -2
  236. package/dist/coordination/agent-memory-branch.d.ts +117 -0
  237. package/dist/coordination/agent-memory-branch.js +213 -0
  238. package/dist/coordination/agent-teams/mailbox.d.ts +43 -0
  239. package/dist/coordination/agent-teams/mailbox.js +130 -4
  240. package/dist/coordination/handlers/handler-utils.d.ts +1 -0
  241. package/dist/coordination/handlers/handler-utils.js +9 -2
  242. package/dist/coordination/handlers/quality-handlers.js +7 -1
  243. package/dist/domains/contract-testing/coordinator.js +11 -0
  244. package/dist/domains/quality-assessment/coherence/gate-controller.d.ts +20 -1
  245. package/dist/domains/quality-assessment/coherence/gate-controller.js +64 -0
  246. package/dist/domains/quality-assessment/coherence/index.d.ts +3 -3
  247. package/dist/domains/quality-assessment/coherence/index.js +2 -2
  248. package/dist/domains/quality-assessment/coherence/types.d.ts +39 -0
  249. package/dist/domains/quality-assessment/coherence/types.js +11 -0
  250. package/dist/domains/quality-assessment/coordinator.d.ts +14 -0
  251. package/dist/domains/quality-assessment/coordinator.js +92 -0
  252. package/dist/domains/test-execution/coordinator.d.ts +19 -0
  253. package/dist/domains/test-execution/coordinator.js +102 -5
  254. package/dist/domains/test-generation/coordinator.js +11 -0
  255. package/dist/domains/test-generation/interfaces.d.ts +2 -0
  256. package/dist/domains/test-generation/services/test-generator.d.ts +9 -0
  257. package/dist/domains/test-generation/services/test-generator.js +37 -0
  258. package/dist/init/agents-installer.d.ts +5 -3
  259. package/dist/init/agents-installer.js +17 -43
  260. package/dist/init/find-package-root.d.ts +22 -0
  261. package/dist/init/find-package-root.js +46 -0
  262. package/dist/init/n8n-installer.d.ts +4 -2
  263. package/dist/init/n8n-installer.js +23 -23
  264. package/dist/init/opencode-installer.d.ts +0 -5
  265. package/dist/init/opencode-installer.js +12 -39
  266. package/dist/init/skills-installer.d.ts +5 -2
  267. package/dist/init/skills-installer.js +15 -37
  268. package/dist/integrations/embeddings/index/HNSWIndex.d.ts +9 -2
  269. package/dist/integrations/embeddings/index/HNSWIndex.js +110 -35
  270. package/dist/integrations/ruvector/cognitive-routing.d.ts +67 -0
  271. package/dist/integrations/ruvector/cognitive-routing.js +208 -0
  272. package/dist/integrations/ruvector/feature-flags.d.ts +84 -0
  273. package/dist/integrations/ruvector/feature-flags.js +59 -0
  274. package/dist/integrations/ruvector/hdc-fingerprint.d.ts +76 -0
  275. package/dist/integrations/ruvector/hdc-fingerprint.js +217 -0
  276. package/dist/integrations/ruvector/hyperbolic-hnsw.d.ts +59 -0
  277. package/dist/integrations/ruvector/hyperbolic-hnsw.js +194 -0
  278. package/dist/integrations/ruvector/index.d.ts +5 -2
  279. package/dist/integrations/ruvector/index.js +13 -2
  280. package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +24 -0
  281. package/dist/integrations/ruvector/shared-rvf-adapter.js +55 -0
  282. package/dist/integrations/ruvector/shared-rvf-dual-writer.d.ts +6 -0
  283. package/dist/integrations/ruvector/shared-rvf-dual-writer.js +38 -0
  284. package/dist/integrations/ruvector/sona-persistence.d.ts +8 -0
  285. package/dist/integrations/ruvector/sona-persistence.js +10 -0
  286. package/dist/integrations/ruvector/vector-delta-tracker.d.ts +96 -0
  287. package/dist/integrations/ruvector/vector-delta-tracker.js +226 -0
  288. package/dist/kernel/agent-coordinator.d.ts +75 -1
  289. package/dist/kernel/agent-coordinator.js +250 -1
  290. package/dist/kernel/hnsw-legacy-bridge.d.ts +38 -0
  291. package/dist/kernel/hnsw-legacy-bridge.js +88 -0
  292. package/dist/kernel/hnsw-shadow-validator.d.ts +91 -0
  293. package/dist/kernel/hnsw-shadow-validator.js +139 -0
  294. package/dist/kernel/index.d.ts +1 -1
  295. package/dist/kernel/index.js +1 -1
  296. package/dist/kernel/interfaces.d.ts +39 -0
  297. package/dist/kernel/kernel.d.ts +23 -0
  298. package/dist/kernel/kernel.js +106 -1
  299. package/dist/kernel/unified-memory.d.ts +1 -1
  300. package/dist/kernel/unified-memory.js +7 -3
  301. package/dist/learning/aqe-learning-engine.d.ts +65 -0
  302. package/dist/learning/aqe-learning-engine.js +134 -0
  303. package/dist/learning/dream/dream-engine.d.ts +6 -1
  304. package/dist/learning/dream/dream-engine.js +37 -2
  305. package/dist/learning/dream/dream-scheduler.d.ts +25 -0
  306. package/dist/learning/dream/dream-scheduler.js +120 -0
  307. package/dist/learning/dream/rvcow-branch-manager.d.ts +6 -3
  308. package/dist/learning/dream/rvcow-branch-manager.js +60 -5
  309. package/dist/learning/experience-capture.d.ts +3 -3
  310. package/dist/learning/hyperbolic-pattern-index.d.ts +82 -0
  311. package/dist/learning/hyperbolic-pattern-index.js +142 -0
  312. package/dist/learning/index.d.ts +3 -3
  313. package/dist/learning/index.js +1 -1
  314. package/dist/learning/metrics-tracker.d.ts +44 -0
  315. package/dist/learning/metrics-tracker.js +37 -0
  316. package/dist/learning/pattern-promotion.d.ts +3 -3
  317. package/dist/learning/pattern-store.d.ts +45 -2
  318. package/dist/learning/pattern-store.js +217 -4
  319. package/dist/learning/qe-patterns.d.ts +1 -1
  320. package/dist/learning/qe-reasoning-bank.js +1 -1
  321. package/dist/learning/rvf-pattern-migration.d.ts +50 -0
  322. package/dist/learning/rvf-pattern-migration.js +106 -0
  323. package/dist/learning/rvf-pattern-store.d.ts +66 -0
  324. package/dist/learning/rvf-pattern-store.js +447 -0
  325. package/dist/mcp/bundle.js +1894 -1804
  326. package/dist/mcp/handlers/index.d.ts +1 -0
  327. package/dist/mcp/handlers/index.js +2 -0
  328. package/dist/mcp/handlers/migration-handlers.d.ts +52 -0
  329. package/dist/mcp/handlers/migration-handlers.js +85 -0
  330. package/dist/mcp/protocol-server.d.ts +1 -0
  331. package/dist/mcp/protocol-server.js +63 -2
  332. package/dist/mcp/types.d.ts +1 -1
  333. package/dist/optimization/early-exit-token-optimizer.d.ts +7 -7
  334. package/dist/optimization/early-exit-token-optimizer.js +3 -3
  335. package/dist/persistence/rvf-consistency-validator.d.ts +85 -0
  336. package/dist/persistence/rvf-consistency-validator.js +182 -0
  337. package/dist/persistence/rvf-migration-adapter.d.ts +125 -0
  338. package/dist/persistence/rvf-migration-adapter.js +303 -0
  339. package/dist/persistence/rvf-migration-coordinator.d.ts +115 -0
  340. package/dist/persistence/rvf-migration-coordinator.js +224 -0
  341. package/dist/persistence/rvf-stage-gate.d.ts +70 -0
  342. package/dist/persistence/rvf-stage-gate.js +163 -0
  343. package/package.json +10 -10
  344. package/dist/cli/chunks/adapter-WBR5NXS3.js +0 -2
  345. package/dist/cli/chunks/aqe-learning-engine-TK4JQCGT.js +0 -2
  346. package/dist/cli/chunks/base-2WXOSMBQ.js +0 -2
  347. package/dist/cli/chunks/better-sqlite3-7KY2RDXO.js +0 -2
  348. package/dist/cli/chunks/brain-handler-PPEGDCN4.js +0 -68
  349. package/dist/cli/chunks/browser-workflow-42F7GK5T.js +0 -2
  350. package/dist/cli/chunks/chunk-263XS447.js +0 -2
  351. package/dist/cli/chunks/chunk-2I7J3O6V.js +0 -2
  352. package/dist/cli/chunks/chunk-3JPRUND5.js +0 -2
  353. package/dist/cli/chunks/chunk-3THRQEZ2.js +0 -95
  354. package/dist/cli/chunks/chunk-4B6NCELM.js +0 -2
  355. package/dist/cli/chunks/chunk-62ADTHV7.js +0 -2
  356. package/dist/cli/chunks/chunk-BR26T7ZS.js +0 -180
  357. package/dist/cli/chunks/chunk-DRT3WKQW.js +0 -2
  358. package/dist/cli/chunks/chunk-FIA6X7UL.js +0 -2
  359. package/dist/cli/chunks/chunk-J3KWWR6Z.js +0 -1
  360. package/dist/cli/chunks/chunk-JZSDOIXA.js +0 -2
  361. package/dist/cli/chunks/chunk-MV6CMOJQ.js +0 -65
  362. package/dist/cli/chunks/chunk-N5UXCLFI.js +0 -2
  363. package/dist/cli/chunks/chunk-OF4D7MYI.js +0 -2
  364. package/dist/cli/chunks/chunk-QOVHWZEP.js +0 -1
  365. package/dist/cli/chunks/chunk-RFSN6IDA.js +0 -79
  366. package/dist/cli/chunks/chunk-X5IJGWYG.js +0 -2
  367. package/dist/cli/chunks/ci-output-7JN7F6CI.js +0 -2
  368. package/dist/cli/chunks/client-MCSNSH2C.js +0 -2
  369. package/dist/cli/chunks/complexity-analyzer-AB4OZARV.js +0 -2
  370. package/dist/cli/chunks/cost-tracker-4F723RB6.js +0 -2
  371. package/dist/cli/chunks/cross-domain-router-OWR5IJ5G.js +0 -2
  372. package/dist/cli/chunks/dag-attention-scheduler-JWO6XI6A.js +0 -2
  373. package/dist/cli/chunks/detect-L6ZZHUSX.js +0 -2
  374. package/dist/cli/chunks/domain-transfer-5Y4FGJAJ.js +0 -2
  375. package/dist/cli/chunks/dream-4TDBIYED.js +0 -2
  376. package/dist/cli/chunks/esm-node-2PKHKOTS.js +0 -2
  377. package/dist/cli/chunks/feature-flags-IVQ3AL4Q.js +0 -2
  378. package/dist/cli/chunks/file-discovery-QFPA6GMV.js +0 -2
  379. package/dist/cli/chunks/gnn-wrapper-OYC55N5E.js +0 -2
  380. package/dist/cli/chunks/hnsw-index-YO7CT23I.js +0 -2
  381. package/dist/cli/chunks/hnswlib-node-56YWVXFE.js +0 -2
  382. package/dist/cli/chunks/hypergraph-engine-A4Y2ZRAG.js +0 -2
  383. package/dist/cli/chunks/impact-analyzer-UEIGXSZ4.js +0 -2
  384. package/dist/cli/chunks/init-wizard-JWZUGIPJ.js +0 -2
  385. package/dist/cli/chunks/kernel-YNDTVKIW.js +0 -2
  386. package/dist/cli/chunks/knowledge-graph-NGJKFTSN.js +0 -2
  387. package/dist/cli/chunks/load-test-GZUBXFF3.js +0 -2
  388. package/dist/cli/chunks/memory-backend-3NQIZUXE.js +0 -2
  389. package/dist/cli/chunks/opencode-installer-4HUB36H5.js +0 -3
  390. package/dist/cli/chunks/protocol-executor-SPUVRDWT.js +0 -2
  391. package/dist/cli/chunks/qe-reasoning-bank-3HBK2FVD.js +0 -2
  392. package/dist/cli/chunks/queen-coordinator-RW3NKO5A.js +0 -2
  393. package/dist/cli/chunks/real-embeddings-GK63VF35.js +0 -2
  394. package/dist/cli/chunks/router-RJGHWDQ3.js +0 -2
  395. package/dist/cli/chunks/routing-feedback-ZXBXFKX6.js +0 -2
  396. package/dist/cli/chunks/ruvector-commands-2TLNHC3A.js +0 -8
  397. package/dist/cli/chunks/rvf-dual-writer-MQW2SJLT.js +0 -2
  398. package/dist/cli/chunks/rvf-native-adapter-LKFKTMUN.js +0 -2
  399. package/dist/cli/chunks/safe-db-G22E5ROA.js +0 -2
  400. package/dist/cli/chunks/schedule-Y7VVCPYV.js +0 -2
  401. package/dist/cli/chunks/scheduler-AUQIFQB7.js +0 -2
  402. package/dist/cli/chunks/shared-rvf-dual-writer-BVSCQAFS.js +0 -2
  403. package/dist/cli/chunks/sqlite-persistence-JAVHUGGL.js +0 -2
  404. package/dist/cli/chunks/transformers-GY7SIKEU.js +0 -2
  405. package/dist/cli/chunks/types-QJGNBKP2.js +0 -2
  406. package/dist/cli/chunks/unified-memory-XYGENQUT.js +0 -2
  407. package/dist/cli/chunks/unified-memory-hnsw-MVEGQBF3.js +0 -2
  408. package/dist/cli/chunks/unified-persistence-PFRCWEUG.js +0 -2
  409. package/dist/cli/chunks/visual-security-V47BLGJM.js +0 -2
  410. package/dist/cli/chunks/witness-chain-BR63P4A7.js +0 -2
  411. package/dist/cli/chunks/workflow-orchestrator-7PZMX3JZ.js +0 -2
@@ -932,7 +932,7 @@
932
932
  },
933
933
  "metadata": {
934
934
  "generatedBy": "Agentic QE Fleet",
935
- "fleetVersion": "3.9.0",
935
+ "fleetVersion": "3.9.1",
936
936
  "manifestVersion": "1.3.0",
937
937
  "lastUpdated": "2026-02-04T00:00:00.000Z",
938
938
  "contributors": [
package/CHANGELOG.md CHANGED
@@ -5,6 +5,38 @@ All notable changes to the Agentic QE project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.9.1] - 2026-04-05
9
+
10
+ ### Added
11
+
12
+ - **RVF persistent vector storage (ADR-065/066)** — `RvfPatternStore` backed by @ruvector/rvf-node native HNSW replaces in-memory index rebuild on startup. Cold-start drops from seconds to <2ms; search p50 under 0.2ms. Factory routing via `createPatternStore()` with automatic fallback to SQLite.
13
+ - **Agent memory branching (ADR-067)** — Per-agent COW isolation via `RvfNativeAdapter.derive()` with ingest-log merge on completion and automatic branch cleanup on failure. Wired into `DefaultAgentCoordinator` spawn/complete lifecycle.
14
+ - **Dream RVF COW (ADR-069)** — Dream engine uses RVF forks instead of SQLite savepoints when RVF is active. Child adapter lifecycle managed with temp file cleanup. Recall validation gate compares top-k overlap before merge.
15
+ - **HNSW unification (ADR-071)** — Three separate HNSW implementations (`InMemoryHNSWIndex`, `HNSWEmbeddingIndex`, `HNSWIndex`) unified through `HnswLegacyBridge` → `HnswAdapter`. Shadow validator confirms <2% divergence. Old implementations decommissioned.
16
+ - **RVF dual-write migration (ADR-072)** — `RvfMigrationAdapter` with 5-stage routing (SQLite-only → dual-write → RVF-primary). `RvfConsistencyValidator` tracks rolling divergence. `RvfStageGate` enforces go/no-go criteria with witness chain. Stage 2 (dual-write, SQLite reads) active by default. MCP tools: `migration_status`, `migration_check`, `migration_promote`.
17
+ - **StrongDM software factory (ADR-062)** — Loop detection wired to MCP protocol-server (blocks on strike 3+), holdout testing (10% FNV-1a selection), gate ratcheting (monotonic 5-pass/2%/95% cap), progressive context (TF-IDF prediction), and meta-learning cycles (4 insight types).
18
+ - **RuVector advanced capabilities (ADR-087)** — EWC++ outcome recording wired to 3 domain coordinators, HDC fingerprinting (10K-bit hypervectors), delta event sourcing, cognitive routing (predictive compression), and hyperbolic HNSW (Poincare ball).
19
+ - **HnswShadowValidator** — Brute-force vs HnswAdapter divergence validation for search consistency verification.
20
+ - **RvfMigrationCoordinator** — Wires migration adapter, consistency validator, and stage gate with real SQLite/RVF handles. Initializes on kernel boot when migration stage >= 2.
21
+ - **Shared RVF adapter singleton** — Eliminates dual file handles between kernel and dream engine.
22
+ - **500+ new tests** — Covering RVF pattern store, agent memory branching, HNSW bridge, shadow validator, migration adapter, consistency validator, stage gate, StrongDM tiers, and RuVector capabilities.
23
+
24
+ ### Fixed
25
+
26
+ - **`require()` fails in ESM bundles ("Dynamic require of X is not supported")** — esbuild's CJS compatibility shim throws in ESM chunks because `require` is undefined. Added `createRequire` banner to both CLI and MCP build scripts so every chunk has a working `require`. Fixes RVF, sqlite, and all native module paths in the CLI.
27
+ - **`aqe init` path resolution** — Skills and agents installers now resolve paths from package root via `findPackageRoot()` instead of brittle relative traversals that broke under esbuild code-splitting chunk layouts.
28
+ - **`quality_assess` hangs on large projects** — Defaults to `src/` instead of cwd; `discoverSourceFiles` skips `.agentic-qe/.claude/.cache` dirs with `maxFiles=5000` cap.
29
+ - **Dream cycle empty-query** — `RvfPatternStore` returns all patterns from SQLite when query is empty.
30
+ - **Coherence integration fallback** — `RvfPatternStore` computes brute-force cosine over SQLite embeddings when RVF adapter unavailable.
31
+ - **7 pre-existing test failures resolved** — Fixed console spy targets, ADR-062 loop detection in MCP tests, dream cycle RVF paths, and coherence vector search fallback.
32
+
33
+ ### Changed
34
+
35
+ - **@ruvector/gnn bumped 0.1.19 → 0.1.25** — Latest ProgressiveHnswBackend improvements.
36
+ - **3 RVF feature flags default to `true`** — `useRVFPatternStore`, `useAgentMemoryBranching`, `useUnifiedHnsw` all ship enabled (opt-out via config).
37
+ - **RVF migration stage default: 2** — Dual-write with SQLite as source of truth for reads. Stage promotions (3, 4) gated by observation periods.
38
+ - **ESM-safe dynamic imports** — `require()` replaced with `import()` in dream-engine and branch-manager.
39
+
8
40
  ## [3.9.0] - 2026-04-02
9
41
 
10
42
  ### Added
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { type Database as DatabaseType } from 'better-sqlite3';
9
9
  import { type WitnessKeyManager } from './witness-key-manager.js';
10
- export type WitnessActionType = 'PATTERN_CREATE' | 'PATTERN_UPDATE' | 'PATTERN_PROMOTE' | 'PATTERN_QUARANTINE' | 'DREAM_MERGE' | 'DREAM_DISCARD' | 'QUALITY_GATE_PASS' | 'QUALITY_GATE_FAIL' | 'ROUTING_DECISION' | 'BRANCH_MERGE' | 'HEBBIAN_PENALTY' | 'KEY_ROTATION';
10
+ export type WitnessActionType = 'PATTERN_CREATE' | 'PATTERN_UPDATE' | 'PATTERN_PROMOTE' | 'PATTERN_QUARANTINE' | 'DREAM_MERGE' | 'DREAM_DISCARD' | 'QUALITY_GATE_PASS' | 'QUALITY_GATE_FAIL' | 'ROUTING_DECISION' | 'BRANCH_MERGE' | 'BRANCH_DISCARD' | 'HEBBIAN_PENALTY' | 'KEY_ROTATION';
11
11
  export interface WitnessEntry {
12
12
  id: number;
13
13
  prev_hash: string;
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
3
- import{a as y}from"./chunks/chunk-3ZOONQG6.js";import{a as f,c as A}from"./chunks/chunk-JZSDOIXA.js";import"./chunks/chunk-4I2IOUS4.js";A();import{Command as I}from"commander";import m from"chalk";function h(e,s,o,a){let l=e.command(s).description(o);if(a)for(let u of a)l.alias(u);return l.helpOption(!1),l.allowUnknownOption(!0),l.allowExcessArguments(!0),l}function w(e,s){let o=e.commands,a=o.indexOf(s);a>=0&&o.splice(a,1)}function i(e,s){let o=h(e,s.name,s.description,s.aliases);o.action(async()=>{try{let a=await s.factory();w(e,o),e.addCommand(a),await e.parseAsync(process.argv)}catch(a){console.error(`Failed to load command '${s.name}':`,a instanceof Error?a.message:a),process.exit(1)}})}function d(e,s,o,a,l,u){let g=h(e,s,o,u);g.action(async()=>{try{let p=await a();w(e,g),p.register(e,l),await e.parseAsync(process.argv)}catch(p){console.error(`Failed to load command '${s}':`,p instanceof Error?p.message:p),process.exit(1)}})}var P=["[UnifiedMemory]","[HybridBackend]","[UnifiedPersistence]","[PersistentSONAEngine]","[QueenGovernance]","[QueenCoordinator]","[Queen]","[QUEEN]","[DomainBreakerRegistry]","[RealEmbeddings]","[HNSWIndex]","[PatternStore]","[TestGenerationCoordinator]","[CodeIntelligence]","[ProductFactorsBridge]","[LearningOptimizationCoordinator]","[DreamEngine]","[DreamScheduler]","[SecurityCompliance]","[Providers]","[GNN]","[test-generation]","[test-execution]","[coverage-analysis]","[quality-assessment]","[defect-intelligence]","[requirements-validation]","[code-intelligence]","[security-compliance]","[contract-testing]","[visual-accessibility]","[chaos-resilience]","[learning-optimization]","[enterprise-integration]","[coordination]","[PatternLearnerService]","[RequirementsValidation]","[ParserRegistry]","[AdversarialDefense]","[ContinueGateIntegration]","[ContinueGate]","[SQLitePatternStore]","[TokenTracking]","[InfraHealing]","[ExperienceCapture]"],S=/^\[\d{2}:\d{2}:\d{2}\.\d{3}\]\s+\[/,b=console.log.bind(console);console.log=(...e)=>{let o=(typeof e[0]=="string"?e[0]:"").trimStart();if(P.some(a=>o.startsWith(a))||S.test(o)){process.stderr.write(e.map(String).join(" ")+`
2
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
3
+ import{a as y}from"./chunks/chunk-5LDBKZ6P.js";import{a as f,c as A}from"./chunks/chunk-UN4PA4M2.js";import"./chunks/chunk-UZZCWWIG.js";A();import{Command as I}from"commander";import m from"chalk";function h(e,s,o,a){let l=e.command(s).description(o);if(a)for(let u of a)l.alias(u);return l.helpOption(!1),l.allowUnknownOption(!0),l.allowExcessArguments(!0),l}function w(e,s){let o=e.commands,a=o.indexOf(s);a>=0&&o.splice(a,1)}function i(e,s){let o=h(e,s.name,s.description,s.aliases);o.action(async()=>{try{let a=await s.factory();w(e,o),e.addCommand(a),await e.parseAsync(process.argv)}catch(a){console.error(`Failed to load command '${s.name}':`,a instanceof Error?a.message:a),process.exit(1)}})}function d(e,s,o,a,l,u){let g=h(e,s,o,u);g.action(async()=>{try{let p=await a();w(e,g),p.register(e,l),await e.parseAsync(process.argv)}catch(p){console.error(`Failed to load command '${s}':`,p instanceof Error?p.message:p),process.exit(1)}})}var P=["[UnifiedMemory]","[HybridBackend]","[UnifiedPersistence]","[PersistentSONAEngine]","[QueenGovernance]","[QueenCoordinator]","[Queen]","[QUEEN]","[DomainBreakerRegistry]","[RealEmbeddings]","[HNSWIndex]","[PatternStore]","[TestGenerationCoordinator]","[CodeIntelligence]","[ProductFactorsBridge]","[LearningOptimizationCoordinator]","[DreamEngine]","[DreamScheduler]","[SecurityCompliance]","[Providers]","[GNN]","[test-generation]","[test-execution]","[coverage-analysis]","[quality-assessment]","[defect-intelligence]","[requirements-validation]","[code-intelligence]","[security-compliance]","[contract-testing]","[visual-accessibility]","[chaos-resilience]","[learning-optimization]","[enterprise-integration]","[coordination]","[PatternLearnerService]","[RequirementsValidation]","[ParserRegistry]","[AdversarialDefense]","[ContinueGateIntegration]","[ContinueGate]","[SQLitePatternStore]","[TokenTracking]","[InfraHealing]","[ExperienceCapture]"],S=/^\[\d{2}:\d{2}:\d{2}\.\d{3}\]\s+\[/,b=console.log.bind(console);console.log=(...e)=>{let o=(typeof e[0]=="string"?e[0]:"").trimStart();if(P.some(a=>o.startsWith(a))||S.test(o)){process.stderr.write(e.map(String).join(" ")+`
4
4
  `);return}b(...e)};var M=console.info.bind(console);console.info=(...e)=>{process.stderr.write(e.map(String).join(" ")+`
5
- `)};var t={kernel:null,queen:null,router:null,workflowOrchestrator:null,scheduledWorkflows:new Map,persistentScheduler:null,initialized:!1};function C(e,s){let o=e.getDomainAPI("visual-accessibility");if(o?.registerWorkflowActions)try{o.registerWorkflowActions(s)}catch(l){console.error(m.yellow(` Warning: Could not register visual-accessibility workflow actions: ${f(l)}`))}let a=e.getDomainAPI("requirements-validation");if(a?.registerWorkflowActions)try{a.registerWorkflowActions(s)}catch(l){console.error(m.yellow(` Warning: Could not register requirements-validation workflow actions: ${f(l)}`))}}async function x(){let{QEKernelImpl:e}=await import("./chunks/kernel-YNDTVKIW.js"),{CrossDomainEventRouter:s}=await import("./chunks/cross-domain-router-OWR5IJ5G.js"),{DefaultProtocolExecutor:o}=await import("./chunks/protocol-executor-SPUVRDWT.js"),{WorkflowOrchestrator:a}=await import("./chunks/workflow-orchestrator-7PZMX3JZ.js"),{createQueenCoordinator:l}=await import("./chunks/queen-coordinator-RW3NKO5A.js"),{createPersistentScheduler:u}=await import("./chunks/scheduler-AUQIFQB7.js");t.kernel=new e({maxConcurrentAgents:15,memoryBackend:"sqlite",hnswEnabled:!0,lazyLoading:!0,enabledDomains:[...y]}),await t.kernel.initialize(),t.router=new s(t.kernel.eventBus),await t.router.initialize();let g=E=>t.kernel.getDomainAPI(E),p=new o(t.kernel.eventBus,t.kernel.memory,g);t.workflowOrchestrator=new a(t.kernel.eventBus,t.kernel.memory,t.kernel.coordinator),await t.workflowOrchestrator.initialize(),C(t.kernel,t.workflowOrchestrator),t.persistentScheduler=u(),t.queen=l(t.kernel,t.router,p,void 0),await t.queen.initialize(),t.initialized=!0}async function k(){if(t.initialized&&t.kernel&&t.queen)return!0;let e=await import("fs"),o=(await import("path")).resolve(".agentic-qe");return e.existsSync(o)?c():(console.error(m.red(`
5
+ `)};var t={kernel:null,queen:null,router:null,workflowOrchestrator:null,scheduledWorkflows:new Map,persistentScheduler:null,initialized:!1};function C(e,s){let o=e.getDomainAPI("visual-accessibility");if(o?.registerWorkflowActions)try{o.registerWorkflowActions(s)}catch(l){console.error(m.yellow(` Warning: Could not register visual-accessibility workflow actions: ${f(l)}`))}let a=e.getDomainAPI("requirements-validation");if(a?.registerWorkflowActions)try{a.registerWorkflowActions(s)}catch(l){console.error(m.yellow(` Warning: Could not register requirements-validation workflow actions: ${f(l)}`))}}async function x(){let{QEKernelImpl:e}=await import("./chunks/kernel-XFG42WAG.js"),{CrossDomainEventRouter:s}=await import("./chunks/cross-domain-router-FSCGJG3B.js"),{DefaultProtocolExecutor:o}=await import("./chunks/protocol-executor-6W4PS2D4.js"),{WorkflowOrchestrator:a}=await import("./chunks/workflow-orchestrator-Z6TAVMQP.js"),{createQueenCoordinator:l}=await import("./chunks/queen-coordinator-NFPKGMQN.js"),{createPersistentScheduler:u}=await import("./chunks/scheduler-CQ56T7DB.js");t.kernel=new e({maxConcurrentAgents:15,memoryBackend:"sqlite",hnswEnabled:!0,lazyLoading:!0,enabledDomains:[...y]}),await t.kernel.initialize(),t.router=new s(t.kernel.eventBus),await t.router.initialize();let g=E=>t.kernel.getDomainAPI(E),p=new o(t.kernel.eventBus,t.kernel.memory,g);t.workflowOrchestrator=new a(t.kernel.eventBus,t.kernel.memory,t.kernel.coordinator),await t.workflowOrchestrator.initialize(),C(t.kernel,t.workflowOrchestrator),t.persistentScheduler=u(),t.queen=l(t.kernel,t.router,p,void 0),await t.queen.initialize(),t.initialized=!0}async function k(){if(t.initialized&&t.kernel&&t.queen)return!0;let e=await import("fs"),o=(await import("path")).resolve(".agentic-qe");return e.existsSync(o)?c():(console.error(m.red(`
6
6
  Error: AQE system not initialized in this directory.`)),console.log(m.yellow("Run `aqe init` first to set up this project.\n")),!1)}async function c(){if(t.initialized&&t.kernel&&t.queen)return!0;process.stderr.write(m.gray("Auto-initializing v3 system...")+`
7
7
  `);let e=3e4,s=new Promise((o,a)=>{setTimeout(()=>a(new Error("Initialization timeout after 30 seconds")),e)});try{return await Promise.race([x(),s]),process.stderr.write(m.green("System ready")+`
8
8
 
9
- `),!0}catch(o){return o.message.includes("timeout")?(console.error(m.red("Initialization timed out after 30 seconds.")),console.log(m.yellow("Try running `aqe init` manually."))):(console.error(m.red("Failed to auto-initialize:"),o),console.log(m.yellow("Try running `aqe init` manually."))),!1}}async function r(e=0){setTimeout(()=>process.exit(e),3e3).unref?.();try{let{shutdownTokenTracking:o}=await import("./chunks/token-bootstrap-4VJKGVMK.js");await o(),t.workflowOrchestrator&&await t.workflowOrchestrator.dispose(),t.queen&&await t.queen.dispose(),t.router&&await t.router.dispose(),t.kernel&&await t.kernel.dispose();let{UnifiedMemoryManager:a}=await import("./chunks/unified-memory-XYGENQUT.js");a.resetInstance()}catch(o){console.debug("[CLI] Cleanup error during exit:",o instanceof Error?o.message:o)}process.exit(e)}var n=new I,v="3.9.0";n.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(v);d(n,"init","Initialize the AQE v3 system",()=>import("./chunks/init-handler-JDET6WUN.js").then(e=>e.createInitHandler(r)),t);d(n,"status","Show system status",()=>import("./chunks/status-handler-VZ32M4G4.js").then(e=>e.createStatusHandler(r,k)),t);d(n,"health","Check system health",()=>import("./chunks/status-handler-VZ32M4G4.js").then(e=>e.createHealthHandler(r,k)),t);d(n,"task","Manage QE tasks",()=>import("./chunks/task-handler-JNOIBZ2G.js").then(e=>e.createTaskHandler(r,c)),t);d(n,"agent","Manage QE agents",()=>import("./chunks/agent-handler-QDAB5NQS.js").then(e=>e.createAgentHandler(r,c)),t);d(n,"domain","Domain operations",()=>import("./chunks/domain-handler-FT5FLZWL.js").then(e=>e.createDomainHandler(r,c)),t);d(n,"protocol","Execute coordination protocols",()=>import("./chunks/protocol-handler-2BQQ4HDM.js").then(e=>e.createProtocolHandler(r,c)),t);d(n,"brain","Export, import, and inspect QE brain state",()=>import("./chunks/brain-handler-PPEGDCN4.js").then(e=>e.createBrainHandler(r,c)),t);d(n,"hypergraph","Query the code knowledge hypergraph",()=>import("./chunks/hypergraph-handler-3HDGB5SZ.js").then(e=>e.createHypergraphHandler(r,c)),t,["hg"]);d(n,"heartbeat","Manage the token-free heartbeat scheduler",()=>import("./chunks/heartbeat-handler-MBBS4IBU.js").then(e=>e.createHeartbeatHandler(r)),t);d(n,"routing","View routing performance, economics, and accuracy",()=>import("./chunks/routing-handler-VNKFUUGB.js").then(e=>e.createRoutingHandler(r)),t);i(n,{name:"workflow",description:"Manage QE workflows and pipelines (ADR-041)",factory:()=>import("./chunks/workflow-JETHX4ML.js").then(e=>e.createWorkflowCommand(t,r,c))});i(n,{name:"test",description:"Test generation, execution, scheduling, and load testing",factory:()=>import("./chunks/test-DO22BNIL.js").then(e=>e.createTestCommand(t,r,c))});i(n,{name:"coverage",description:"Coverage analysis shortcut",factory:()=>import("./chunks/coverage-4PUEQXAY.js").then(e=>e.createCoverageCommand(t,r,c))});i(n,{name:"quality",description:"Quality assessment shortcut",factory:()=>import("./chunks/quality-JRZYMC77.js").then(e=>e.createQualityCommand(t,r,c))});i(n,{name:"security",description:"Security scanning and URL validation",factory:()=>import("./chunks/security-EBEG2OPU.js").then(e=>e.createSecurityCommand(t,r,c))});i(n,{name:"code",description:"Code intelligence analysis",factory:()=>import("./chunks/code-U4N4WONM.js").then(e=>e.createCodeCommand(t,r,c))});i(n,{name:"completions",description:"Generate shell completions for aqe",factory:()=>import("./chunks/completions-W66BSCOE.js").then(e=>e.createCompletionsCommand(r))});i(n,{name:"fleet",description:"Fleet operations with multi-agent progress tracking",factory:()=>import("./chunks/fleet-EKOKMOMW.js").then(e=>e.createFleetCommand(t,r,c,C))});i(n,{name:"validate",description:"Validation commands for skills and agents",factory:()=>import("./chunks/validate-swarm-A5DHAWTP.js").then(e=>e.createValidateSwarmCommand(t,r,c))});i(n,{name:"skill",description:"Skill validation and reporting (ADR-056)",factory:()=>import("./chunks/validate-VQCRSVNQ.js").then(e=>e.createValidateCommand(t,r,c))});i(n,{name:"eval",description:"Run skill evaluation suites in parallel",factory:()=>import("./chunks/eval-GHMPFGWV.js").then(e=>e.createEvalCommand())});i(n,{name:"ci",description:"CI/CD pipeline orchestration",factory:()=>import("./chunks/ci-J374KDLI.js").then(e=>e.createCICommand(t,r,c))});i(n,{name:"token-usage",description:"View and analyze token consumption metrics (ADR-042)",factory:()=>import("./chunks/token-usage-LG3PXRXH.js").then(e=>e.createTokenUsageCommand())});i(n,{name:"llm",description:"LLM Router management (ADR-043)",factory:()=>import("./chunks/llm-router-DNAV746L.js").then(e=>e.createLLMRouterCommand())});i(n,{name:"sync",description:"Sync local learning data to cloud PostgreSQL",factory:()=>import("./chunks/sync-MHSHNLIM.js").then(e=>e.createSyncCommands())});i(n,{name:"hooks",description:"Self-learning QE hooks for pattern recognition and guidance",factory:()=>import("./chunks/hooks-L5VLZGEK.js").then(e=>e.createHooksCommand())});i(n,{name:"learning",description:"AQE self-learning system management (standalone, no claude-flow required)",factory:()=>import("./chunks/learning-722ZNSZ6.js").then(e=>e.createLearningCommand())});i(n,{name:"memory",description:"Memory store, retrieve, search, and delete operations",factory:()=>import("./chunks/memory-L57MLFOP.js").then(e=>e.createMemoryCommand(t,r,c))});i(n,{name:"mcp",description:"Start the MCP protocol server for Claude Code integration",factory:()=>import("./chunks/mcp-LKPIBZ3W.js").then(e=>e.createMcpCommand())});i(n,{name:"platform",description:"Manage coding agent platform configurations",factory:()=>import("./chunks/platform-T4E7Q3RD.js").then(e=>e.createPlatformCommand())});i(n,{name:"prove",description:"Generate a verifiable Proof-of-Quality attestation",factory:()=>import("./chunks/prove-UQ6JFT73.js").then(e=>e.createProveCommand(t,r,c))});i(n,{name:"ruvector",description:"RuVector integration management",factory:()=>import("./chunks/ruvector-commands-2TLNHC3A.js").then(e=>e.createRuVectorCommand())});i(n,{name:"audit",description:"Witness chain audit trail management",factory:()=>import("./chunks/audit-S7JUYYVP.js").then(e=>e.createAuditCommand(t,r,c))});i(n,{name:"pipeline",description:"Manage YAML deterministic pipelines (Imp-9)",factory:()=>import("./chunks/pipeline-D3QER35Z.js").then(e=>e.createPipelineCommand(t,r,c))});i(n,{name:"plugin",description:"Manage external QE domain plugins",factory:()=>import("./chunks/plugin-JHW2YPRC.js").then(e=>e.createPluginCommand())});i(n,{name:"daemon",description:"Manage the QE Quality Daemon",factory:()=>import("./chunks/daemon-B7TWGHXQ.js").then(e=>e.createDaemonCommand())});process.on("SIGINT",async()=>{console.log(m.yellow(`
9
+ `),!0}catch(o){return o.message.includes("timeout")?(console.error(m.red("Initialization timed out after 30 seconds.")),console.log(m.yellow("Try running `aqe init` manually."))):(console.error(m.red("Failed to auto-initialize:"),o),console.log(m.yellow("Try running `aqe init` manually."))),!1}}async function r(e=0){setTimeout(()=>process.exit(e),3e3).unref?.();try{let{shutdownTokenTracking:o}=await import("./chunks/token-bootstrap-LLLNJT5V.js");await o(),t.workflowOrchestrator&&await t.workflowOrchestrator.dispose(),t.queen&&await t.queen.dispose(),t.router&&await t.router.dispose(),t.kernel&&await t.kernel.dispose();let{UnifiedMemoryManager:a}=await import("./chunks/unified-memory-YPHONR2T.js");a.resetInstance()}catch(o){console.debug("[CLI] Cleanup error during exit:",o instanceof Error?o.message:o)}process.exit(e)}var n=new I,v="3.9.1";n.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(v);d(n,"init","Initialize the AQE v3 system",()=>import("./chunks/init-handler-CIKZGGAY.js").then(e=>e.createInitHandler(r)),t);d(n,"status","Show system status",()=>import("./chunks/status-handler-7P23CXUI.js").then(e=>e.createStatusHandler(r,k)),t);d(n,"health","Check system health",()=>import("./chunks/status-handler-7P23CXUI.js").then(e=>e.createHealthHandler(r,k)),t);d(n,"task","Manage QE tasks",()=>import("./chunks/task-handler-DWJQXZ2K.js").then(e=>e.createTaskHandler(r,c)),t);d(n,"agent","Manage QE agents",()=>import("./chunks/agent-handler-ZCBWQE3X.js").then(e=>e.createAgentHandler(r,c)),t);d(n,"domain","Domain operations",()=>import("./chunks/domain-handler-PPGFP7P4.js").then(e=>e.createDomainHandler(r,c)),t);d(n,"protocol","Execute coordination protocols",()=>import("./chunks/protocol-handler-ESSZGJ7R.js").then(e=>e.createProtocolHandler(r,c)),t);d(n,"brain","Export, import, and inspect QE brain state",()=>import("./chunks/brain-handler-5EE3J5PR.js").then(e=>e.createBrainHandler(r,c)),t);d(n,"hypergraph","Query the code knowledge hypergraph",()=>import("./chunks/hypergraph-handler-ID6J6GS2.js").then(e=>e.createHypergraphHandler(r,c)),t,["hg"]);d(n,"heartbeat","Manage the token-free heartbeat scheduler",()=>import("./chunks/heartbeat-handler-HTR3EFFV.js").then(e=>e.createHeartbeatHandler(r)),t);d(n,"routing","View routing performance, economics, and accuracy",()=>import("./chunks/routing-handler-5TVKFU7V.js").then(e=>e.createRoutingHandler(r)),t);i(n,{name:"workflow",description:"Manage QE workflows and pipelines (ADR-041)",factory:()=>import("./chunks/workflow-YNQT3OW2.js").then(e=>e.createWorkflowCommand(t,r,c))});i(n,{name:"test",description:"Test generation, execution, scheduling, and load testing",factory:()=>import("./chunks/test-2JSS4XW7.js").then(e=>e.createTestCommand(t,r,c))});i(n,{name:"coverage",description:"Coverage analysis shortcut",factory:()=>import("./chunks/coverage-PO72QC3P.js").then(e=>e.createCoverageCommand(t,r,c))});i(n,{name:"quality",description:"Quality assessment shortcut",factory:()=>import("./chunks/quality-AYBXB635.js").then(e=>e.createQualityCommand(t,r,c))});i(n,{name:"security",description:"Security scanning and URL validation",factory:()=>import("./chunks/security-ZLWT7IU3.js").then(e=>e.createSecurityCommand(t,r,c))});i(n,{name:"code",description:"Code intelligence analysis",factory:()=>import("./chunks/code-4G6ZHVNI.js").then(e=>e.createCodeCommand(t,r,c))});i(n,{name:"completions",description:"Generate shell completions for aqe",factory:()=>import("./chunks/completions-B3BXNXAU.js").then(e=>e.createCompletionsCommand(r))});i(n,{name:"fleet",description:"Fleet operations with multi-agent progress tracking",factory:()=>import("./chunks/fleet-FOIDAXLR.js").then(e=>e.createFleetCommand(t,r,c,C))});i(n,{name:"validate",description:"Validation commands for skills and agents",factory:()=>import("./chunks/validate-swarm-UOC4JGZT.js").then(e=>e.createValidateSwarmCommand(t,r,c))});i(n,{name:"skill",description:"Skill validation and reporting (ADR-056)",factory:()=>import("./chunks/validate-POMLT2KU.js").then(e=>e.createValidateCommand(t,r,c))});i(n,{name:"eval",description:"Run skill evaluation suites in parallel",factory:()=>import("./chunks/eval-JVJKHSTQ.js").then(e=>e.createEvalCommand())});i(n,{name:"ci",description:"CI/CD pipeline orchestration",factory:()=>import("./chunks/ci-N4NTYAAI.js").then(e=>e.createCICommand(t,r,c))});i(n,{name:"token-usage",description:"View and analyze token consumption metrics (ADR-042)",factory:()=>import("./chunks/token-usage-EQ4HM4EZ.js").then(e=>e.createTokenUsageCommand())});i(n,{name:"llm",description:"LLM Router management (ADR-043)",factory:()=>import("./chunks/llm-router-34WHT3PH.js").then(e=>e.createLLMRouterCommand())});i(n,{name:"sync",description:"Sync local learning data to cloud PostgreSQL",factory:()=>import("./chunks/sync-BYZBBH65.js").then(e=>e.createSyncCommands())});i(n,{name:"hooks",description:"Self-learning QE hooks for pattern recognition and guidance",factory:()=>import("./chunks/hooks-63NZQ7NH.js").then(e=>e.createHooksCommand())});i(n,{name:"learning",description:"AQE self-learning system management (standalone, no claude-flow required)",factory:()=>import("./chunks/learning-NKOF7KDJ.js").then(e=>e.createLearningCommand())});i(n,{name:"memory",description:"Memory store, retrieve, search, and delete operations",factory:()=>import("./chunks/memory-OUYCBU4M.js").then(e=>e.createMemoryCommand(t,r,c))});i(n,{name:"mcp",description:"Start the MCP protocol server for Claude Code integration",factory:()=>import("./chunks/mcp-6R7SVGKO.js").then(e=>e.createMcpCommand())});i(n,{name:"platform",description:"Manage coding agent platform configurations",factory:()=>import("./chunks/platform-NY3ULBR7.js").then(e=>e.createPlatformCommand())});i(n,{name:"prove",description:"Generate a verifiable Proof-of-Quality attestation",factory:()=>import("./chunks/prove-EF2PPY65.js").then(e=>e.createProveCommand(t,r,c))});i(n,{name:"ruvector",description:"RuVector integration management",factory:()=>import("./chunks/ruvector-commands-E33VXFIA.js").then(e=>e.createRuVectorCommand())});i(n,{name:"audit",description:"Witness chain audit trail management",factory:()=>import("./chunks/audit-G5UIJBSQ.js").then(e=>e.createAuditCommand(t,r,c))});i(n,{name:"pipeline",description:"Manage YAML deterministic pipelines (Imp-9)",factory:()=>import("./chunks/pipeline-CFOPG7EM.js").then(e=>e.createPipelineCommand(t,r,c))});i(n,{name:"plugin",description:"Manage external QE domain plugins",factory:()=>import("./chunks/plugin-LRANQYUR.js").then(e=>e.createPluginCommand())});i(n,{name:"daemon",description:"Manage the QE Quality Daemon",factory:()=>import("./chunks/daemon-4UIQTQ73.js").then(e=>e.createDaemonCommand())});process.on("SIGINT",async()=>{console.log(m.yellow(`
10
10
 
11
11
  Shutting down...`)),console.log(m.green(`Shutdown complete
12
12
  `)),await r(0)});process.on("SIGTERM",async()=>{console.log(m.yellow(`
13
- Received SIGTERM, shutting down gracefully...`)),await r(0)});async function D(){let{isVersionFastPath:e}=await import("./chunks/fast-paths-B3R647KN.js");e(process.argv)&&(console.log(v),process.exit(0));let{bootstrapTokenTracking:s}=await import("./chunks/token-bootstrap-4VJKGVMK.js");await s({enableOptimization:!0,enablePersistence:!0,verbose:process.env.AQE_VERBOSE==="true"}),await n.parseAsync(),await r(0)}D().catch(async e=>{console.error(m.red("Fatal error:"),e),await r(1)});
13
+ Received SIGTERM, shutting down gracefully...`)),await r(0)});async function D(){let{isVersionFastPath:e}=await import("./chunks/fast-paths-3KX4ZV66.js");e(process.argv)&&(console.log(v),process.exit(0));let{bootstrapTokenTracking:s}=await import("./chunks/token-bootstrap-LLLNJT5V.js");await s({enableOptimization:!0,enablePersistence:!0,verbose:process.env.AQE_VERBOSE==="true"}),await n.parseAsync(),await r(0)}D().catch(async e=>{console.error(m.red("Fatal error:"),e),await r(1)});
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{a,b,c}from"./chunk-VY74OMGQ.js";import"./chunk-TL7ABIMP.js";import"./chunk-3VAKR43Z.js";import"./chunk-JSOBRKMA.js";import"./chunk-UN4PA4M2.js";import"./chunk-UZZCWWIG.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
@@ -1,2 +1,2 @@
1
- if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
- import{a as x}from"./chunk-3JPRUND5.js";import{c as f}from"./chunk-4VUPRTVX.js";import"./chunk-4I2IOUS4.js";x();import{createRequire as w}from"module";var S=f.create("agent-booster-wasm"),t={JavaScript:0,TypeScript:1,Python:2,Rust:3,Go:4,Java:5,C:6,Cpp:7},l={ExactReplace:0,FuzzyReplace:1,InsertAfter:2,InsertBefore:3,Append:4},v={0:"JavaScript",1:"TypeScript",2:"Python",3:"Rust",4:"Go",5:"Java",6:"C",7:"Cpp"},a=null,u=null,p=null;async function g(){if(a)return!0;if(p)return!1;try{if(a=w(import.meta.url)("./agent_booster_wasm.js"),!a)throw new Error("WASM module loaded but is null");return u=new a.AgentBoosterWasm,!0}catch(e){return p=e,console.warn("[AgentBoosterWASM] Failed to load WASM module:",e),!1}}function A(e){return{".js":t.JavaScript,".mjs":t.JavaScript,".cjs":t.JavaScript,".jsx":t.JavaScript,".ts":t.TypeScript,".tsx":t.TypeScript,".mts":t.TypeScript,".cts":t.TypeScript,".py":t.Python,".rs":t.Rust,".go":t.Go,".java":t.Java,".c":t.C,".h":t.C,".cpp":t.Cpp,".cc":t.Cpp,".cxx":t.Cpp,".hpp":t.Cpp}[e.toLowerCase()]??t.JavaScript}var M=[{name:"var-to-const",detect:(e,r)=>e.includes("var ")&&r.includes("const "),apply:(e,r)=>e.replace(/\bvar\s+/g,"const ")},{name:"var-to-let",detect:(e,r)=>e.includes("var ")&&r.includes("let "),apply:(e,r)=>e.replace(/\bvar\s+/g,"let ")},{name:"add-types-function",detect:(e,r)=>e.includes("function")&&!e.includes(":")&&r.includes(":"),apply:(e,r)=>r},{name:"async-wrapper",detect:(e,r)=>!e.includes("async")&&r.includes("async")&&r.includes("await"),apply:(e,r)=>r},{name:"try-catch-wrapper",detect:(e,r)=>!e.includes("try {")&&r.includes("try {"),apply:(e,r)=>r},{name:"null-check",detect:(e,r)=>!e.includes("if (!")&&!e.includes("if (!")&&(r.includes("if (!")||r.includes("?.")),apply:(e,r)=>r},{name:"test-assertion",detect:(e,r)=>e.includes("test(")&&!e.includes("expect(")&&r.includes("expect("),apply:(e,r)=>r}];function y(e,r){for(let n of M)if(n.detect(e,r))try{return{success:!0,code:n.apply(e,r),pattern:n.name}}catch(s){S.debug("Pattern transform failed, trying next",{pattern:n.name,error:s instanceof Error?s.message:String(s)});continue}return{success:!1,code:r}}async function b(e,r,n,s={}){let o=performance.now(),{confidenceThreshold:T=.5,allowFallback:d=!0}=s;if(!e.trim())return{success:!0,mergedCode:r,confidence:1,strategy:l.Append,syntaxValid:!0,source:"fallback",latencyMs:performance.now()-o};if(await g()&&u&&a)try{let c=a.WasmLanguage[v[n]],i=u.apply_edit(e,r,c);return{success:!0,mergedCode:i.merged_code,confidence:i.confidence,strategy:i.strategy,syntaxValid:i.syntax_valid,source:"wasm",latencyMs:performance.now()-o}}catch(c){let i=c;if(d){let m=y(e,r);if(m.success)return{success:!0,mergedCode:m.code,confidence:.7,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:i.message}}if(d){let c=y(e,r);return{success:c.success,mergedCode:c.code,confidence:c.success?.7:0,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:p?.message??"WASM not available"}}async function W(e,r={}){return Promise.all(e.map(({original:n,edit:s,language:o})=>b(n,s,o,r)))}async function C(){return g()}async function L(){return await g()&&a?a.AgentBoosterWasm.version():"unavailable"}async function R(){if(await g(),u&&a)try{u.apply_edit("function x() {}","function x() {}",a.WasmLanguage.JavaScript)}catch(e){console.debug("[AgentBoosterWASM] Warmup error:",e instanceof Error?e.message:e)}}var _={transform:b,batchTransform:W,isWasmAvailable:C,getVersion:L,warmup:R,Language:t,MergeStrategy:l,languageFromExtension:A};export{t as Language,l as MergeStrategy,W as batchTransform,_ as default,L as getVersion,C as isWasmAvailable,A as languageFromExtension,b as transform,R as warmup};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{a as x}from"./chunk-U5JQGRHZ.js";import{c as f}from"./chunk-A57BEPL7.js";import"./chunk-UZZCWWIG.js";x();import{createRequire as w}from"module";var S=f.create("agent-booster-wasm"),t={JavaScript:0,TypeScript:1,Python:2,Rust:3,Go:4,Java:5,C:6,Cpp:7},l={ExactReplace:0,FuzzyReplace:1,InsertAfter:2,InsertBefore:3,Append:4},v={0:"JavaScript",1:"TypeScript",2:"Python",3:"Rust",4:"Go",5:"Java",6:"C",7:"Cpp"},a=null,u=null,p=null;async function g(){if(a)return!0;if(p)return!1;try{if(a=w(import.meta.url)("./agent_booster_wasm.js"),!a)throw new Error("WASM module loaded but is null");return u=new a.AgentBoosterWasm,!0}catch(e){return p=e,console.warn("[AgentBoosterWASM] Failed to load WASM module:",e),!1}}function A(e){return{".js":t.JavaScript,".mjs":t.JavaScript,".cjs":t.JavaScript,".jsx":t.JavaScript,".ts":t.TypeScript,".tsx":t.TypeScript,".mts":t.TypeScript,".cts":t.TypeScript,".py":t.Python,".rs":t.Rust,".go":t.Go,".java":t.Java,".c":t.C,".h":t.C,".cpp":t.Cpp,".cc":t.Cpp,".cxx":t.Cpp,".hpp":t.Cpp}[e.toLowerCase()]??t.JavaScript}var M=[{name:"var-to-const",detect:(e,r)=>e.includes("var ")&&r.includes("const "),apply:(e,r)=>e.replace(/\bvar\s+/g,"const ")},{name:"var-to-let",detect:(e,r)=>e.includes("var ")&&r.includes("let "),apply:(e,r)=>e.replace(/\bvar\s+/g,"let ")},{name:"add-types-function",detect:(e,r)=>e.includes("function")&&!e.includes(":")&&r.includes(":"),apply:(e,r)=>r},{name:"async-wrapper",detect:(e,r)=>!e.includes("async")&&r.includes("async")&&r.includes("await"),apply:(e,r)=>r},{name:"try-catch-wrapper",detect:(e,r)=>!e.includes("try {")&&r.includes("try {"),apply:(e,r)=>r},{name:"null-check",detect:(e,r)=>!e.includes("if (!")&&!e.includes("if (!")&&(r.includes("if (!")||r.includes("?.")),apply:(e,r)=>r},{name:"test-assertion",detect:(e,r)=>e.includes("test(")&&!e.includes("expect(")&&r.includes("expect("),apply:(e,r)=>r}];function y(e,r){for(let n of M)if(n.detect(e,r))try{return{success:!0,code:n.apply(e,r),pattern:n.name}}catch(s){S.debug("Pattern transform failed, trying next",{pattern:n.name,error:s instanceof Error?s.message:String(s)});continue}return{success:!1,code:r}}async function b(e,r,n,s={}){let o=performance.now(),{confidenceThreshold:T=.5,allowFallback:d=!0}=s;if(!e.trim())return{success:!0,mergedCode:r,confidence:1,strategy:l.Append,syntaxValid:!0,source:"fallback",latencyMs:performance.now()-o};if(await g()&&u&&a)try{let c=a.WasmLanguage[v[n]],i=u.apply_edit(e,r,c);return{success:!0,mergedCode:i.merged_code,confidence:i.confidence,strategy:i.strategy,syntaxValid:i.syntax_valid,source:"wasm",latencyMs:performance.now()-o}}catch(c){let i=c;if(d){let m=y(e,r);if(m.success)return{success:!0,mergedCode:m.code,confidence:.7,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:i.message}}if(d){let c=y(e,r);return{success:c.success,mergedCode:c.code,confidence:c.success?.7:0,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:p?.message??"WASM not available"}}async function W(e,r={}){return Promise.all(e.map(({original:n,edit:s,language:o})=>b(n,s,o,r)))}async function C(){return g()}async function L(){return await g()&&a?a.AgentBoosterWasm.version():"unavailable"}async function R(){if(await g(),u&&a)try{u.apply_edit("function x() {}","function x() {}",a.WasmLanguage.JavaScript)}catch(e){console.debug("[AgentBoosterWASM] Warmup error:",e instanceof Error?e.message:e)}}var _={transform:b,batchTransform:W,isWasmAvailable:C,getVersion:L,warmup:R,Language:t,MergeStrategy:l,languageFromExtension:A};export{t as Language,l as MergeStrategy,W as batchTransform,_ as default,L as getVersion,C as isWasmAvailable,A as languageFromExtension,b as transform,R as warmup};
@@ -1,5 +1,5 @@
1
- if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
- import{b as p}from"./chunk-RTGGL7D7.js";import{a as g}from"./chunk-YANUP2RO.js";import"./chunk-WGMPEW2T.js";import"./chunk-4I2IOUS4.js";import s from"chalk";var l=class{name="agent";description="Manage QE agents";cleanupAndExit;ensureInitialized;constructor(n,t){this.cleanupAndExit=n,this.ensureInitialized=t}register(n,t){let a=n.command("agent").description(this.description);a.command("list").description("List all agents").option("-d, --domain <domain>","Filter by domain").option("-s, --status <status>","Filter by status").action(async e=>{await this.executeList(e,t)}),a.command("spawn <domain>").description("Spawn an agent in a domain").option("-t, --type <type>","Agent type","worker").option("-c, --capabilities <caps>","Comma-separated capabilities","general").option("--no-progress","Disable progress indicator").action(async(e,o)=>{await this.executeSpawn(e,o,t)})}async executeList(n,t){if(await this.ensureInitialized())try{let a=n.domain?t.queen.getAgentsByDomain(n.domain):t.queen.listAllAgents();if(n.status&&(a=a.filter(e=>e.status===n.status)),console.log(s.blue(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{b as p}from"./chunk-4XBY5JDT.js";import{a as g}from"./chunk-EQFZQPFN.js";import"./chunk-JSOBRKMA.js";import"./chunk-UZZCWWIG.js";import s from"chalk";var l=class{name="agent";description="Manage QE agents";cleanupAndExit;ensureInitialized;constructor(n,t){this.cleanupAndExit=n,this.ensureInitialized=t}register(n,t){let a=n.command("agent").description(this.description);a.command("list").description("List all agents").option("-d, --domain <domain>","Filter by domain").option("-s, --status <status>","Filter by status").action(async e=>{await this.executeList(e,t)}),a.command("spawn <domain>").description("Spawn an agent in a domain").option("-t, --type <type>","Agent type","worker").option("-c, --capabilities <caps>","Comma-separated capabilities","general").option("--no-progress","Disable progress indicator").action(async(e,o)=>{await this.executeSpawn(e,o,t)})}async executeList(n,t){if(await this.ensureInitialized())try{let a=n.domain?t.queen.getAgentsByDomain(n.domain):t.queen.listAllAgents();if(n.status&&(a=a.filter(e=>e.status===n.status)),console.log(s.blue(`
3
3
  Agents (${a.length})
4
4
  `)),a.length===0)console.log(s.gray(" No agents found"));else{let e=new Map;for(let i of a)e.has(i.domain)||e.set(i.domain,[]),e.get(i.domain).push(i);let o=Array.from(e.entries());for(let[i,m]of o){console.log(s.cyan(` ${i}:`));for(let r of m)console.log(` ${r.id}`),console.log(` Type: ${r.type}`),console.log(` Status: ${g(r.status)}`),r.startedAt&&console.log(s.gray(` Started: ${r.startedAt.toISOString()}`));console.log("")}}}catch(a){console.error(s.red(`
5
5
  Failed to list agents:`),a),await this.cleanupAndExit(1)}}async executeSpawn(n,t,a){if(await this.ensureInitialized())try{let e=t.capabilities.split(",");console.log(s.blue(`
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import"./chunk-UZZCWWIG.js";import{existsSync as i,mkdirSync as d,unlinkSync as s,readdirSync as p,statSync as f}from"fs";import{join as o,basename as l}from"path";var v={branchDir:".agentic-qe/branches",defaultStrategy:"child-wins",orphanMaxAgeMs:36e5},g=class{config;parentAdapter;activeBranches=new Map;witnessChain=null;constructor(t,e){this.parentAdapter=t,this.config={...v,...e}}setWitnessChain(t){this.witnessChain=t}createBranch(t){if(this.activeBranches.has(t))throw new Error(`Branch already exists for agent ${t}`);i(this.config.branchDir)||d(this.config.branchDir,{recursive:!0});let e=o(this.config.branchDir,`${t}.rvf`),r=this.parentAdapter.path(),n=this.parentAdapter.derive(e),a={agentId:t,childPath:e,parentPath:r,childAdapter:n,createdAt:Date.now(),ingestLog:[]};return this.activeBranches.set(t,a),a}recordIngest(t,e){let r=this.activeBranches.get(t);if(r)for(let n of e)r.ingestLog.push({id:n.id,vector:n.vector})}async mergeBranch(t,e){let r=e??this.config.defaultStrategy,n=performance.now(),a=0;if(r==="child-wins"&&t.ingestLog.length>0)try{a=this.parentAdapter.ingest(t.ingestLog).accepted}catch(c){console.warn(`[AgentMemoryBranch] Merge replay failed for ${t.agentId}:`,c)}return this.witnessChain?.append("BRANCH_MERGE",{agentId:t.agentId,strategy:r,vectorsMerged:a,branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId),{vectorsMerged:a,strategy:r,durationMs:performance.now()-n}}discardBranch(t){this.witnessChain?.append("BRANCH_DISCARD",{agentId:t.agentId,action:"discard",branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId)}getBranch(t){return this.activeBranches.get(t)}getActiveBranches(){return Array.from(this.activeBranches.values())}listBranchFiles(){return i(this.config.branchDir)?p(this.config.branchDir).filter(e=>e.endsWith(".rvf")).map(e=>{let r=o(this.config.branchDir,e),n=f(r);return{agentId:l(e,".rvf"),path:r,sizeBytes:n.size,modifiedAt:n.mtime}}):[]}cleanupOrphans(t){let e=t??this.config.orphanMaxAgeMs,r=Date.now(),n=0;for(let a of this.listBranchFiles())if(r-a.modifiedAt.getTime()>e&&!this.activeBranches.has(a.agentId))try{s(a.path);let h=`${a.path}.idmap.json`;i(h)&&s(h),n++}catch{}return n}cleanupBranchFile(t){try{t.childAdapter.close()}catch{}try{i(t.childPath)&&s(t.childPath);let e=`${t.childPath}.idmap.json`;i(e)&&s(e)}catch{}}};export{g as AgentMemoryBranch};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{a,b,c,d,e,f}from"./chunk-V4HM4QAO.js";import"./chunk-IHWSNYL2.js";import"./chunk-US7INRP2.js";import"./chunk-C24ZDUCM.js";import"./chunk-WDV6TN7E.js";import"./chunk-XPB6ZVQY.js";import"./chunk-DC3HPOOJ.js";import"./chunk-X4MZYBOU.js";import"./chunk-B2I7BJLL.js";import"./chunk-6YC24TPL.js";import"./chunk-RV6SGDET.js";import"./chunk-WLXEDOG4.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-5LDBKZ6P.js";import"./chunk-UN4PA4M2.js";import"./chunk-UB7RGVKO.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.js";export{b as AQELearningEngine,a as DEFAULT_ENGINE_CONFIG,c as DEFAULT_META_LEARNING_CONFIG,d as MetaLearningEngine,e as createAQELearningEngine,f as createDefaultLearningEngine};
@@ -1,3 +1,3 @@
1
- if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
- import{d as c,e as u,f as h,g as m}from"./chunk-5T2ZQWKF.js";import{f as s,o as p}from"./chunk-JJO7Y4H3.js";import"./chunk-N2NS2PHA.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-WGMPEW2T.js";import"./chunk-JZSDOIXA.js";import"./chunk-263XS447.js";import{p as l,q as d}from"./chunk-MDUHYUHF.js";import"./chunk-GAOJV3OX.js";import"./chunk-62ADTHV7.js";import"./chunk-DRT3WKQW.js";import"./chunk-UFUVUO3J.js";import"./chunk-7VDBAVTY.js";import"./chunk-B36CDR4U.js";import"./chunk-2I7J3O6V.js";import{g as f}from"./chunk-4I2IOUS4.js";import{Command as g}from"commander";import a from"chalk";p();import{existsSync as y}from"node:fs";import b from"node:path";function C(n,i){let t=[];t.push(a.bold("Witness Chain Audit Verification")),t.push("");let e=i?a.green("ENABLED"):a.yellow("DISABLED");t.push(` Feature Flag: ${e}`),t.push(` Chain Length: ${n.length} receipts`);let r=n.valid?a.green("VALID"):a.red("BROKEN");return t.push(` Integrity: ${r}`),n.length>0&&t.push(` Last Hash: ${n.lastHash.slice(0,16)}...`),!n.valid&&n.brokenAt>=0&&(t.push(""),t.push(a.red(` Break detected at index ${n.brokenAt}`)),t.push(a.red(` ${n.message}`))),t.push(""),t.join(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{f as s,o as p}from"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import{d as c,e as u,f as h,g as m}from"./chunk-IF6GW6IY.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-UN4PA4M2.js";import"./chunk-GFNUESMU.js";import{p as l,q as d}from"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import{g as f}from"./chunk-UZZCWWIG.js";import{Command as g}from"commander";import a from"chalk";p();import{existsSync as y}from"node:fs";import b from"node:path";function C(n,i){let t=[];t.push(a.bold("Witness Chain Audit Verification")),t.push("");let e=i?a.green("ENABLED"):a.yellow("DISABLED");t.push(` Feature Flag: ${e}`),t.push(` Chain Length: ${n.length} receipts`);let r=n.valid?a.green("VALID"):a.red("BROKEN");return t.push(` Integrity: ${r}`),n.length>0&&t.push(` Last Hash: ${n.lastHash.slice(0,16)}...`),!n.valid&&n.brokenAt>=0&&(t.push(""),t.push(a.red(` Break detected at index ${n.brokenAt}`)),t.push(a.red(` ${n.message}`))),t.push(""),t.join(`
3
3
  `)}function x(){try{let n=s(),i=b.join(n,".agentic-qe","memory.db");if(!y(i))return null;let t=(d(),f(l)),e=new t(i),r=c(e),o=h(r);return e.close(),o}catch{return null}}async function A(n){let i=m(),e=(x()??u()).verifyChain(),r={featureEnabled:i,chainLength:e.length,integrity:e.valid,brokenAt:e.brokenAt,lastHash:e.lastHash,message:e.message};return n.format==="json"?console.log(JSON.stringify(r,null,2)):console.log(C(e,i)),r}function v(n,i,t){let e=new g("audit").description("Witness chain audit trail management");return e.command("verify").description("Verify witness chain integrity").option("-F, --format <format>","Output format (json|text)","text").action(async r=>{try{await A({format:r.format}),await i(0)}catch(o){console.error("Failed to verify witness chain:",o),await i(1)}}),e}export{v as createAuditCommand,C as formatVerificationText,A as handleAuditVerify};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{a,b,c,d,e,f}from"./chunk-E33KQBMW.js";import"./chunk-43M6Y6VF.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-UN4PA4M2.js";import"./chunk-UB7RGVKO.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.js";export{f as MCPToolBase,e as defaultToolLogger,d as getMemoryBackend,b as getSharedMemoryBackend,a as registerRvfResetFn,c as resetSharedMemoryBackend};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-OFNIQCGX.js";import"./chunk-UZZCWWIG.js";p();export{i as DotProductAttention,h as FlashAttention,k as HyperbolicAttention,l as LinearAttention,m as MoEAttention,j as MultiHeadAttention,b as RuvectorLayer,n as SonaEngine,c as TensorCompress,a as default,d as differentiableSearch,f as getCompressionLevel,e as hierarchicalForward,g as init,o as pipeline};
@@ -0,0 +1,68 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{a as $,b as M,c as L,d as v,e as H,f as k,g as F,h as _,i as P,j as G,k as V,l as ce,m as q,n as Q,o as de,p as Y,q as j,r as W,s as U}from"./chunk-NB47YT6A.js";import{h as ae}from"./chunk-6YC24TPL.js";import{a as se,b as ie,c as le,d as O,f as Ne}from"./chunk-RV6SGDET.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import{b as N,d as Be}from"./chunk-JSOBRKMA.js";import"./chunk-UN4PA4M2.js";import{a as S,b as Ie}from"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.js";import T from"path";import r from"chalk";Ie();Be();import{existsSync as z,mkdirSync as Oe,writeFileSync as ke,readFileSync as X}from"fs";import{join as E,resolve as Z}from"path";var qe={rl_q_values:"includeQValues",dream_insights:"includeDreamInsights",dream_cycles:"includeDreamInsights",witness_chain:"includeWitnessChain",vectors:"includeVectors"};function Te(n,t){let o=qe[n.tableName];return!(o&&t[o]===!1)}var Ae=1e4;function De(n,t,o,e){if(!Te(t,o))return Q(E(e,t.fileName),[]),{count:0,rows:[]};let[s,i]=t.domainColumn?q(o.domains,t.domainColumn):[void 0,[]];if(G(n,t.tableName,s,i)>=Ae){let d=t.blobColumns,f=d&&d.length>0?p=>k(p,d):void 0;return{count:de(E(e,t.fileName),ce(n,t.tableName,s,i),f)}}let a=V(n,t.tableName,s,i);return t.blobColumns&&t.blobColumns.length>0&&(a=a.map(d=>k(d,t.blobColumns))),Q(E(e,t.fileName),a),{count:a.length,rows:a}}function me(n){let t=[];for(let o of v){let e=E(n,o.fileName);z(e)?t.push(_(X(e,"utf-8"))):t.push(_(""))}return _(t.join(":"))}function fe(n,t,o="memory.db"){let e=Z(t.outputPath);z(e)||Oe(e,{recursive:!0});let s=0,i={},c=new Set;for(let u of v){let p=De(n,u,t,e);if(i[u.tableName]=p.count,s+=p.count,u.tableName==="qe_patterns"){if(p.rows)for(let l of p.rows)l.qe_domain&&c.add(l.qe_domain);else if(p.count>0){let[l,h]=u.domainColumn?q(t.domains,u.domainColumn):[void 0,[]],b=`SELECT DISTINCT qe_domain FROM qe_patterns ${l?`WHERE ${l} AND qe_domain IS NOT NULL`:"WHERE qe_domain IS NOT NULL"}`;try{let y=n.prepare(b).all(...h||[]);for(let R of y)c.add(R.qe_domain)}catch{}}}}let a=t.includeVectors!==!1?G(n,"vectors"):0,d=me(e),f={version:"3.0",exportedAt:new Date().toISOString(),sourceDb:o,stats:{patternCount:i.qe_patterns||0,vectorCount:a,qValueCount:i.rl_q_values||0,dreamInsightCount:i.dream_insights||0,witnessChainLength:i.witness_chain||0,totalRecords:s},domains:[...c].sort(),checksum:d,tableRecordCounts:i};return ke(E(e,"manifest.json"),JSON.stringify(f,null,2),"utf-8"),f}var $e=new Set(["qe_patterns","rl_q_values","dream_insights","witness_chain"]);function Me(n){return n==="1.0"?v.filter(t=>$e.has(t.tableName)):n==="3.0"?v:(console.warn(`[brain-import] Unknown manifest version '${n}'. Attempting full import \u2014 some files may be missing.`),v)}function ue(n,t,o){let e=Z(t),s=E(e,"manifest.json");if(!z(s))throw new Error(`Manifest not found at ${s}`);let i=N(X(s,"utf-8")),c=me(e);if(c!==i.checksum)throw new Error(`Checksum mismatch: expected ${i.checksum}, got ${c}. The export may have been tampered with or corrupted.`);let a=Me(i.version);if(o.dryRun){let l=0;for(let h of a){let m=Y(E(e,h.fileName),N);l+=m.length}return{imported:l,skipped:0,conflicts:0}}U(n);let d=0,f=0,u=0;return n.transaction(()=>{for(let l of a){let h=E(e,l.fileName),m=Y(h,N);l.blobColumns&&l.blobColumns.length>0&&(m=m.map(b=>F(b,l.blobColumns)));for(let b of m){let y;if(l.dedupColumns&&l.dedupColumns.length>0)y=W(n,l.tableName,b,l.dedupColumns);else{let R=$[l.tableName]||"id",C=L[l.tableName],x=M[l.tableName];y=j(n,l.tableName,b,R,o.mergeStrategy,C,x)}d+=y.imported,f+=y.skipped,u+=y.conflicts}}})(),{imported:d,skipped:f,conflicts:u}}function pe(n){let t=Z(n),o=E(t,"manifest.json");if(!z(o))throw new Error(`Manifest not found at ${o}`);return N(X(o,"utf-8"))}Ne();import{existsSync as K,statSync as Le,unlinkSync as ge,writeFileSync as Fe}from"fs";import{resolve as ee}from"path";function be(n,t,o="memory.db"){if(!O())throw new Error("@ruvector/rvf-node is not available. Install it or use --format jsonl instead.");let e=ee(t.outputPath),s=t.dimension??384;K(e)&&ge(e);let i=`${e}.idmap.json`;K(i)&&ge(i);let c=se(e,s);try{let a={},d=new Set,f=0;for(let w of v){let[g,oe]=w.domainColumn?q(t.domains,w.domainColumn):[void 0,[]],B=V(n,w.tableName,g,oe);if(w.tableName==="qe_patterns")for(let D of B)D.qe_domain&&d.add(D.qe_domain);let J=H[w.tableName];J&&J.length>0&&(B=B.map(D=>k(D,J))),a[w.tableName]=B,f+=B.length}let u=0,p=[];if(P(n,"qe_pattern_embeddings")){let w=n.prepare("SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings").all();for(let g of w)g.embedding&&g.dimension===s&&p.push({id:`pe:${g.pattern_id}`,vector:new Float32Array(g.embedding.buffer,g.embedding.byteOffset,s),metadata:{tableName:"qe_pattern_embeddings"}})}if(P(n,"captured_experiences")){let w=n.prepare("SELECT id, embedding, embedding_dimension, domain, quality FROM captured_experiences WHERE embedding IS NOT NULL").all();for(let g of w)g.embedding_dimension===s&&p.push({id:`exp:${g.id}`,vector:new Float32Array(g.embedding.buffer,g.embedding.byteOffset,s),metadata:{tableName:"captured_experiences",domain:g.domain,confidence:g.quality}})}if(P(n,"sona_patterns")){let w=n.prepare("SELECT id, state_embedding, domain, confidence FROM sona_patterns WHERE state_embedding IS NOT NULL").all();for(let g of w)g.state_embedding.byteLength/4===s&&p.push({id:`sona:${g.id}`,vector:new Float32Array(g.state_embedding.buffer,g.state_embedding.byteOffset,s),metadata:{tableName:"sona_patterns",domain:g.domain,confidence:g.confidence}})}p.length>0&&(u=c.ingest(p).accepted);let l={version:"3.0",format:"rvf",exportedAt:new Date().toISOString(),sourceDb:o,domains:[...d].sort(),tables:a},h=JSON.stringify(l),m=_(h),b=Buffer.from(h);c.embedKernel(b);let y=t.sign?c.sign(b)??void 0:void 0,R=y?t.signerKeyId??"default":void 0,C=c.fileId(),x=C?{fileId:C,parentId:c.parentId(),lineageDepth:c.lineageDepth()}:void 0,I=c.status(),A={version:"3.0",format:"rvf",exportedAt:l.exportedAt,sourceDb:o,stats:{patternCount:(a.qe_patterns||[]).length,embeddingCount:u,qValueCount:(a.rl_q_values||[]).length,dreamInsightCount:(a.dream_insights||[]).length,witnessChainLength:(a.witness_chain||[]).length,totalRecords:f},domains:l.domains,checksum:m,rvfStatus:{totalVectors:I.totalVectors,totalSegments:I.totalSegments,fileSizeBytes:I.fileSizeBytes},...y?{signature:y,signerKeyId:R}:{},...x?{lineage:x}:{}};if(y)try{c.freeze()}catch{}let Se=`${e}.manifest.json`;return Fe(Se,JSON.stringify(A,null,2),"utf-8"),A}finally{c.close()}}var Pe={patterns:"qe_patterns",qValues:"rl_q_values",dreamInsights:"dream_insights",witnessChain:"witness_chain"};function ye(n,t,o){if(!O())throw new Error("@ruvector/rvf-node is not available. Install it or use JSONL format.");let e=ee(t);if(!K(e))throw new Error(`RVF file not found: ${e}`);let s=ie(e);try{let i=s.verifyWitness();if(!i.valid&&(i.totalEntries>0||i.errors.length>0)){let m=i.errors.length>0?i.errors.join("; "):"unknown integrity error";throw new Error(`RVF witness verification failed: ${m}`)}let c=s.extractKernel();if(!c||!c.image)throw new Error("No brain data found in RVF file (missing kernel segment)");let a;try{a=JSON.parse(c.image.toString("utf-8"))}catch(m){throw new Error(`Failed to parse brain kernel data as JSON: ${m instanceof Error?m.message:m}`)}if(o.dryRun){let m=0;if(a.tables)for(let b of Object.values(a.tables))m+=b?.length??0;else m=(a.patterns?.length??0)+(a.qValues?.length??0)+(a.dreamInsights?.length??0)+(a.witnessChain?.length??0);return{imported:m,skipped:0,conflicts:0,embeddingsRestored:0}}U(n);let d=0,f=0,u=0,p=0,l={};if(a.tables)Object.assign(l,a.tables);else for(let[m,b]of Object.entries(Pe)){let y=a[m];Array.isArray(y)&&(l[b]=y)}if(n.transaction(()=>{for(let m of v){let b=l[m.tableName];if(!b||!Array.isArray(b))continue;let y=H[m.tableName];if(y&&y.length>0){b=b.map(R=>F(R,y));for(let R of b)for(let C of y)R[C]instanceof Buffer&&p++}for(let R of b){let C;if(m.dedupColumns&&m.dedupColumns.length>0)C=W(n,m.tableName,R,m.dedupColumns);else{let x=$[m.tableName]||"id",I=L[m.tableName],A=M[m.tableName];C=j(n,m.tableName,R,x,o.mergeStrategy,I,A)}d+=C.imported,f+=C.skipped,u+=C.conflicts}}})(),u>0)try{s.compact()}catch{}return{imported:d,skipped:f,conflicts:u,embeddingsRestored:p}}finally{s.close()}}function he(n){if(!O())throw new Error("@ruvector/rvf-node is not available.");let t=ee(n);if(!K(t))throw new Error(`RVF file not found: ${t}`);let o=le(t);try{let e=o.extractKernel();if(!e||!e.image)throw new Error("No brain data found in RVF file");let s=e.image.toString("utf-8"),i;try{i=JSON.parse(s)}catch(h){throw new Error(`Failed to parse brain kernel data as JSON: ${h instanceof Error?h.message:h}`)}let c=o.status(),a=Le(t).size,d=i.tables,f=d?d.qe_patterns?.length??0:i.patterns?.length??0,u=d?d.rl_q_values?.length??0:i.qValues?.length??0,p=d?d.dream_insights?.length??0:i.dreamInsights?.length??0,l=d?d.witness_chain?.length??0:i.witnessChain?.length??0;return{version:"3.0",format:"rvf",exportedAt:i.exportedAt??"unknown",sourceDb:i.sourceDb??"unknown",stats:{patternCount:f,embeddingCount:c.totalVectors,qValueCount:u,dreamInsightCount:p,witnessChainLength:l},domains:i.domains??[],checksum:_(s),rvfStatus:{totalVectors:c.totalVectors,totalSegments:c.totalSegments,fileSizeBytes:a}}}finally{o.close()}}function te(){return O()}function we(n,t){if(!n.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return{created:0,skipped:0};n.exec(`
3
+ CREATE TEMP TABLE IF NOT EXISTS _covered_patterns (
4
+ pattern_id TEXT PRIMARY KEY
5
+ )
6
+ `),n.exec("DELETE FROM _covered_patterns"),n.exec(`
7
+ INSERT INTO _covered_patterns (pattern_id)
8
+ SELECT DISTINCT json_extract(action_data, '$.patternId')
9
+ FROM witness_chain
10
+ WHERE action_type = 'PATTERN_CREATE'
11
+ AND json_extract(action_data, '$.patternId') IS NOT NULL
12
+ `),n.exec(`
13
+ INSERT OR IGNORE INTO _covered_patterns (pattern_id)
14
+ SELECT DISTINCT json_extract(action_data, '$.pattern_id')
15
+ FROM witness_chain
16
+ WHERE action_type = 'PATTERN_CREATE'
17
+ AND json_extract(action_data, '$.pattern_id') IS NOT NULL
18
+ `);let e=n.prepare(`SELECT p.id, p.pattern_type, p.qe_domain, p.name, p.created_at
19
+ FROM qe_patterns p
20
+ LEFT JOIN _covered_patterns c ON p.id = c.pattern_id
21
+ WHERE c.pattern_id IS NULL
22
+ ORDER BY p.created_at ASC`).all(),i=n.prepare("SELECT COUNT(*) as count FROM qe_patterns").get().count-e.length,c=0;for(let a of e)t.append("PATTERN_CREATE",{patternId:a.id,patternType:a.pattern_type,qeDomain:a.qe_domain,name:a.name,originalCreatedAt:a.created_at,backfilled:!0},"system:backfill"),c++;return n.exec("DROP TABLE IF EXISTS _covered_patterns"),{created:c,skipped:i}}async function Re(n,t){if(Ve(t.format)==="rvf"){let s=S(n,{readonly:!0});try{return be(s,{outputPath:t.outputPath,domains:t.domains},n)}finally{s.close()}}let e=S(n,{readonly:!0});try{return fe(e,t,n)}finally{e.close()}}async function Ce(n,t,o){if(_e(t,o.format)==="rvf"){let i=S(n);try{return ye(i,t,{mergeStrategy:o.mergeStrategy,dryRun:o.dryRun})}finally{i.close()}}let s=S(n);try{return ue(s,t,o)}finally{s.close()}}async function ve(n,t){return _e(n,t)==="rvf"?he(n):pe(n)}async function Ee(n){let t=S(n);try{let o=ae(t);return await o.initialize(),we(t,o)}finally{t.close()}}function Ve(n){if(n==="jsonl")return"jsonl";if(n==="rvf"){if(!te())throw new Error("RVF format requested but @ruvector/rvf-node is not available on this platform. Use --format jsonl instead.");return"rvf"}return te()?"rvf":"jsonl"}function _e(n,t){return t==="rvf"?"rvf":t==="jsonl"?"jsonl":n.endsWith(".rvf")?"rvf":"jsonl"}var re=class{name="brain";description="Export, import, and inspect QE brain state";cleanupAndExit;ensureInitialized;constructor(t,o){this.cleanupAndExit=t,this.ensureInitialized=o}register(t,o){let e=t.command("brain").description(this.description);e.command("export").description("Export brain state to a portable directory").requiredOption("-o, --output <path>","Output directory path").option("--format <format>","Export format: rvf (default) or jsonl","rvf").option("--db <path>","Source database path").action(async s=>{await this.executeExport(s)}),e.command("import").description("Import brain state from an export directory").requiredOption("-i, --input <path>","Path to brain export directory").option("--strategy <strategy>","Merge strategy","skip-conflicts").option("--dry-run","Preview import without writing",!1).option("--db <path>","Target database path").action(async s=>{await this.executeImport(s)}),e.command("info").description("Show manifest info for a brain export").requiredOption("-i, --input <path>","Path to brain export directory").action(async s=>{await this.executeInfo(s)}),e.command("witness-backfill").description("Create witness chain entries for patterns that predate the witness chain").option("--db <path>","Database path").action(async s=>{await this.executeWitnessBackfill(s)})}async executeExport(t){try{console.log(r.blue(`
23
+ Exporting brain state (format: ${t.format})...
24
+ `));let o=await ne(t.db),e=await Re(o,{outputPath:T.resolve(t.output),format:t.format});if(console.log(r.green(" Export complete.")),console.log(` Format: ${r.cyan("format"in e?e.format??"jsonl":"jsonl")}`),console.log(` Patterns: ${r.cyan(e.stats.patternCount)}`),"embeddingCount"in e.stats?console.log(` Vectors: ${r.cyan(e.stats.embeddingCount)}`):"vectorCount"in e.stats&&console.log(` Vectors: ${r.cyan(e.stats.vectorCount)}`),"rvfStatus"in e){let s=e.rvfStatus;console.log(` RVF Size: ${r.cyan(xe(s.fileSizeBytes))}`),console.log(` Segments: ${r.cyan(s.totalSegments)}`)}console.log(` Checksum: ${r.gray(e.checksum)}`),console.log(` Output: ${r.cyan(T.resolve(t.output))}`),console.log(""),await this.cleanupAndExit(0)}catch(o){console.error(r.red(`
25
+ Brain export failed:`),o),await this.cleanupAndExit(1)}}async executeImport(t){try{t.dryRun?console.log(r.yellow(`
26
+ Dry-run mode \u2014 no data will be written.
27
+ `)):console.log(r.blue(`
28
+ Importing brain state...
29
+ `));let o=await ne(t.db),e=await Ce(o,T.resolve(t.input),{mergeStrategy:t.strategy,dryRun:t.dryRun});console.log(r.green(" Import complete.")),console.log(` Imported: ${r.cyan(e.imported)}`),console.log(` Skipped: ${r.yellow(e.skipped)}`),console.log(` Conflicts: ${r.red(e.conflicts)}`),"embeddingsRestored"in e&&console.log(` Embeddings: ${r.cyan(e.embeddingsRestored)}`),console.log(""),await this.cleanupAndExit(0)}catch(o){console.error(r.red(`
30
+ Brain import failed:`),o),await this.cleanupAndExit(1)}}async executeInfo(t){try{console.log(r.blue(`
31
+ Brain Export Info
32
+ `));let o=T.resolve(t.input),e=await ve(o),s="format"in e?e.format??"jsonl":"jsonl";if(console.log(` Version: ${r.cyan(e.version)}`),console.log(` Format: ${r.cyan(s)}`),console.log(` Exported: ${r.cyan(e.exportedAt)}`),console.log(` Source DB: ${r.cyan(e.sourceDb)}`),console.log(r.blue(`
33
+ Learning Data:`)),console.log(` Patterns: ${r.cyan(e.stats.patternCount)}`),"qValueCount"in e.stats&&console.log(` Q-Values: ${r.cyan(e.stats.qValueCount)}`),"dreamInsightCount"in e.stats){let a=e.stats.dreamInsightCount,f=("tableRecordCounts"in e?e.tableRecordCounts:void 0)?.dream_cycles,u=f!==void 0?` (${f} cycles)`:"";console.log(` Dream Insights: ${r.cyan(a)}${r.gray(u)}`)}"witnessChainLength"in e.stats&&console.log(` Witness Chain: ${r.cyan(e.stats.witnessChainLength)} entries`),"embeddingCount"in e.stats?console.log(` Embeddings: ${r.cyan(e.stats.embeddingCount)}`):"vectorCount"in e.stats&&console.log(` Vectors: ${r.cyan(e.stats.vectorCount)}`);let i="tableRecordCounts"in e?e.tableRecordCounts:void 0;if(i){let a=Object.entries(i).filter(([d,f])=>f>0&&!["qe_patterns","rl_q_values","dream_insights","dream_cycles","witness_chain","vectors","qe_pattern_embeddings"].includes(d));if(a.length>0)for(let[d,f]of a){let p=`${d.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}:`.padEnd(15);console.log(` ${p}${r.cyan(f)}`)}}let c="totalRecords"in e.stats?e.stats.totalRecords:void 0;if(c!==void 0&&(console.log(r.blue(`
34
+ Summary:`)),console.log(` Total Records: ${r.cyan(c)}`)),"domains"in e&&Array.isArray(e.domains)&&e.domains.length>0&&(c||console.log(r.blue(`
35
+ Summary:`)),console.log(` Domains: ${r.cyan(e.domains.join(", "))}`)),"rvfStatus"in e){let a=e.rvfStatus;console.log(r.blue(`
36
+ RVF Details:`)),console.log(` File Size: ${r.cyan(xe(a.fileSizeBytes))}`),console.log(` Vectors: ${r.cyan(a.totalVectors)}`),console.log(` Segments: ${r.cyan(a.totalSegments)}`)}if("lineage"in e){let a=e.lineage;a&&(console.log(r.blue(`
37
+ Lineage:`)),console.log(` File ID: ${r.cyan(a.fileId)}`),console.log(` Parent ID: ${r.cyan(a.parentId??"none (root)")}`),console.log(` Depth: ${r.cyan(a.lineageDepth)}`))}if("signature"in e){let a=e.signature,d=e.signerKeyId;console.log(r.blue(`
38
+ Signature:`)),a?(console.log(` Status: ${r.green("Signed")}`),console.log(` Key ID: ${r.cyan(d??"unknown")}`),console.log(` Signature: ${r.gray(a.slice(0,32)+"...")}`)):console.log(` Status: ${r.yellow("Unsigned")}`)}console.log(`
39
+ Checksum: ${r.gray(e.checksum)}`),console.log(""),await this.cleanupAndExit(0)}catch(o){console.error(r.red(`
40
+ Failed to read brain info:`),o),await this.cleanupAndExit(1)}}async executeWitnessBackfill(t){try{console.log(r.blue(`
41
+ Running witness chain backfill...
42
+ `));let o=await ne(t.db),e=await Ee(o);console.log(r.green(" Backfill complete.")),console.log(` Created: ${r.cyan(e.created)} new witness entries`),console.log(` Skipped: ${r.cyan(e.skipped)} (already witnessed)`),console.log(""),await this.cleanupAndExit(0)}catch(o){console.error(r.red(`
43
+ Witness backfill failed:`),o),await this.cleanupAndExit(1)}}getHelp(){return`
44
+ Export, import, and inspect QE brain state.
45
+
46
+ Formats:
47
+ rvf \u2014 Single portable .rvf file (default, requires @ruvector/rvf-node)
48
+ jsonl \u2014 JSONL directory format (fallback when native not available)
49
+
50
+ Usage:
51
+ aqe brain export -o brain.rvf [--format rvf] [--db <path>]
52
+ aqe brain export -o ./brain-dir --format jsonl [--db <path>]
53
+ aqe brain import -i brain.rvf [--strategy skip-conflicts] [--dry-run] [--db <path>]
54
+ aqe brain info -i brain.rvf
55
+
56
+ Subcommands:
57
+ export Export brain state to a portable .rvf file or JSONL directory
58
+ import Import a brain export into the local database
59
+ info Show manifest metadata for an existing brain export
60
+
61
+ Examples:
62
+ aqe brain export -o .agentic-qe/brain.rvf
63
+ aqe brain export -o .agentic-qe/brain.rvf --format rvf
64
+ aqe brain export -o ./brain-export --format jsonl
65
+ aqe brain import -i .agentic-qe/brain.rvf --strategy latest-wins
66
+ aqe brain import -i .agentic-qe/brain.rvf --dry-run
67
+ aqe brain info -i .agentic-qe/brain.rvf
68
+ `}};async function ne(n){if(n)return n;let{findProjectRoot:t}=await import("./unified-memory-YPHONR2T.js");return T.join(t(),".agentic-qe","memory.db")}function xe(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function lt(n,t){return new re(n,t)}export{re as BrainHandler,lt as createBrainHandler};
@@ -1,5 +1,5 @@
1
- if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
- import"./chunk-4I2IOUS4.js";var f=class{language;constructor(e="typescript"){this.language=e}enumerate(e,s){let r=[],n=e.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.9.1");process.exit(0)}
2
+ import"./chunk-UZZCWWIG.js";var f=class{language;constructor(e="typescript"){this.language=e}enumerate(e,s){let r=[],n=e.split(`
3
3
  `),l=!1;for(let i=0;i<n.length;i++){let d=n[i],t=d.trim(),c=i+1,u=d.length-d.trimStart().length+1;if(l){t.includes("*/")&&(l=!1);continue}if(t.startsWith("/*")){l=!t.includes("*/");continue}if(t.startsWith("//"))continue;if(/^\s*if\s*\(/.test(d)&&(this.findMatchingElse(n,i)||r.push({file:s,line:c,column:u,language:this.language,construct:"if-without-else",triggerCondition:"when condition is false",currentHandling:"falls through \u2014 no else branch",suggestedGuard:"Add else branch or document why falsy path is safe",severity:"medium"})),/^\s*switch\s*\(/.test(d)){let a=this.extractBlock(n,i);if(a&&!a.includes("default:")&&!a.includes("default :")&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-no-default",triggerCondition:"when value matches no case",currentHandling:"falls through \u2014 no default case",suggestedGuard:"Add default case with error handling or exhaustive check",severity:"high"}),a){let g=a.match(/case\s+[^:]+:/g)||[],h=a.match(/\b(break|return|throw|continue)\b/g)||[];g.length>0&&h.length<g.length&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-missing-break",triggerCondition:"when case falls through to next case",currentHandling:"fall-through \u2014 may execute unintended cases",suggestedGuard:"Add break/return to each case or add explicit // falls through comment",severity:"medium"})}}if(/\bcatch\s*\(/.test(t)||/\bcatch\s*\{/.test(t)){let a=this.extractBlock(n,i);if(a!==null){let g=a.replace(/[{}]/g,"").trim();(g.length===0||/^\s*\/\//.test(g))&&r.push({file:s,line:c,column:u,language:this.language,construct:"try-empty-catch",triggerCondition:"when exception is thrown",currentHandling:"exception silently swallowed",suggestedGuard:"Log the error or rethrow with context",severity:"high"})}}if(/\btry\s*\{/.test(t)&&this.extractBlock(n,i)&&(n.slice(i,Math.min(i+30,n.length)).join(`
4
4
  `).includes("finally")||r.push({file:s,line:c,column:u,language:this.language,construct:"try-no-finally",triggerCondition:"when cleanup is needed regardless of success/failure",currentHandling:"no finally block \u2014 cleanup may be skipped on exception",suggestedGuard:"Add finally block for resource cleanup if applicable",severity:"low"})),t.includes("?.")){let a=t.match(/(\w+(?:\.\w+)*)\?\./g)||[];for(let g of a)if(!t.includes("??")&&!t.includes("|| ")&&!t.includes("if")){r.push({file:s,line:c,column:u,language:this.language,construct:"optional-chaining-null-path",triggerCondition:`when ${g.replace("?.","")} is null/undefined`,currentHandling:"returns undefined \u2014 may propagate",suggestedGuard:"Add ?? fallback or explicit null check",severity:"low"});break}}if(t.includes("??")&&!t.includes("?.")&&r.push({file:s,line:c,column:u,language:this.language,construct:"nullish-coalescing-fallback",triggerCondition:"when left side is null/undefined",currentHandling:"uses fallback value",suggestedGuard:"Verify fallback value is appropriate for all null cases",severity:"low"}),/\.\s*then\s*\(/.test(t)&&!t.includes(".catch")&&!t.includes("await")){let a=n.slice(i,Math.min(i+5,n.length)).join(" ");!a.includes(".catch")&&!a.includes("try")&&r.push({file:s,line:c,column:u,language:this.language,construct:"promise-no-catch",triggerCondition:"when promise rejects",currentHandling:"unhandled rejection \u2014 may crash process",suggestedGuard:"Add .catch() handler or use try/catch with await",severity:"high"})}let p=["map","filter","reduce","forEach","find","some","every","flatMap"];for(let a of p)if(new RegExp(`\\.${a}\\s*\\(`).test(t)){let h=n.slice(Math.max(0,i-3),i).join(" ");if(!h.includes(".length")&&!h.includes("if (")&&!h.includes("?.")){r.push({file:s,line:c,column:u,language:this.language,construct:"array-callback-empty",triggerCondition:`when array is empty before .${a}()`,currentHandling:a==="reduce"?"may throw without initial value":"returns empty result \u2014 may cause downstream issues",suggestedGuard:a==="reduce"?"Provide initial value or check array length":"Check array length or handle empty result",severity:a==="reduce"?"high":"low"});break}}/\|\|\s*['"`\d]/.test(t)&&!t.includes("??")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-or-falsy",triggerCondition:'when left side is falsy (0, "", false, null, undefined)',currentHandling:'uses fallback \u2014 may unintentionally override 0, "", or false',suggestedGuard:"Use ?? instead of || if only null/undefined should trigger fallback",severity:"medium"}),/&&\s*\w+\s*\(/.test(t)&&!t.includes("if")&&!t.includes("while")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-and-short-circuit",triggerCondition:"when left side is falsy \u2014 right side never executes",currentHandling:"short-circuits \u2014 function call skipped silently",suggestedGuard:"Use explicit if-statement for clarity when side effects matter",severity:"low"}),(t.match(/\?/g)||[]).length>=2&&t.includes(":")&&r.push({file:s,line:c,column:u,language:this.language,construct:"ternary-complex",triggerCondition:"when nested ternary conditions interact",currentHandling:"nested ternary \u2014 hard to read and maintain",suggestedGuard:"Refactor to if/else or switch for readability",severity:"medium"}),(/\btypeof\s+\w+\s*===?\s*['"]/.test(t)||/\binstanceof\b/.test(t))&&!t.includes("else")&&!this.findMatchingElse(n,i)&&r.push({file:s,line:c,column:u,language:this.language,construct:"type-guard-unhandled",triggerCondition:"when value does not match the guarded type",currentHandling:"unguarded type path \u2014 may cause runtime type errors",suggestedGuard:"Add else branch or exhaustive type checking",severity:"medium"})}return r}findMatchingElse(e,s){let r={depth:0};for(let n=s;n<Math.min(s+30,e.length);n++){let l=e[n];for(let i of l)i==="{"&&r.depth++,i==="}"&&r.depth--;if(r.depth===0&&n>s){if((e[n+1]?.trim()||"").startsWith("else")||e[n].trim().endsWith("else")||e[n].trim().endsWith("else {")||e[n].includes("} else"))return!0;break}}return!1}extractBlock(e,s){let r=0,n=!1,l=[];for(let i=s;i<Math.min(s+50,e.length);i++){let d=e[i];for(let t of d)t==="{"&&(r++,n=!0),t==="}"&&r--;if(n&&(l.push(d),r===0))return l.join(`
5
5
  `)}return null}};function y(o,e,s){let r=Date.now(),n=s||(e.endsWith(".ts")||e.endsWith(".tsx")?"typescript":"javascript"),i=new f(n).enumerate(o,e);return{file:e,language:n,branches:i,totalConstructs:i.length,unhandledCount:i.length,duration:Date.now()-r}}function b(o){let e=[];if(e.push(`# Branch Enumeration Report: ${o.file}`),e.push(""),e.push(`**Language**: ${o.language} | **Branches**: ${o.unhandledCount} | **Duration**: ${o.duration}ms`),e.push(""),o.branches.length===0)return e.push("No unhandled branches detected."),e.join(`
@@ -1,4 +1,4 @@
1
- if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
- import{a as p}from"./chunk-IGJPMN4I.js";import"./chunk-4I2IOUS4.js";import{readFile as m,readdir as k}from"fs/promises";import{join as c,basename as y}from"path";import{parse as d}from"yaml";var l=class{templatesDir;cache=new Map;constructor(r){this.templatesDir=r||c(__dirname,"templates")}async load(r){if(this.cache.has(r))return this.cache.get(r);try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n),i=await this.validate(o);if(!i.valid)throw new Error(`Invalid workflow template ${r}:
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{a as p}from"./chunk-RU6Q5HOC.js";import"./chunk-UZZCWWIG.js";import{readFile as m,readdir as k}from"fs/promises";import{join as c,basename as y}from"path";import{parse as d}from"yaml";var l=class{templatesDir;cache=new Map;constructor(r){this.templatesDir=r||c(__dirname,"templates")}async load(r){if(this.cache.has(r))return this.cache.get(r);try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n),i=await this.validate(o);if(!i.valid)throw new Error(`Invalid workflow template ${r}:
3
3
  ${i.errors.join(`
4
4
  `)}`);return this.cache.set(r,o),o}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${r}`):e}}async list(){try{return(await k(this.templatesDir)).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).map(e=>y(e,e.endsWith(".yaml")?".yaml":".yml")).sort()}catch(r){if(r.code==="ENOENT")return[];throw r}}async validate(r){let e=[],n=[];if(r.name||e.push("Workflow must have a name"),r.version||e.push("Workflow must have a version"),r.description||n.push("Workflow should have a description"),Array.isArray(r.variables)?r.variables.forEach((o,i)=>{o.name||e.push(`Variable at index ${i} must have a name`),o.type||e.push(`Variable ${o.name} must have a type`),o.required===void 0&&n.push(`Variable ${o.name} should specify if it's required`)}):e.push("Workflow must have a variables array"),!Array.isArray(r.steps))e.push("Workflow must have a steps array");else if(r.steps.length===0)e.push("Workflow must have at least one step");else{r.steps.forEach((t,s)=>{t.name||e.push(`Step at index ${s} must have a name`),t.action||e.push(`Step ${t.name||s} must have an action`),(!t.config||typeof t.config!="object")&&e.push(`Step ${t.name||s} must have a config object`),t.assertions&&Array.isArray(t.assertions)&&t.assertions.forEach((f,u)=>{f.condition||e.push(`Assertion ${u} in step ${t.name||s} must have a condition`),f.message||n.push(`Assertion ${u} in step ${t.name||s} should have a message`)})});let o=r.steps.map(t=>t.name),i=o.filter((t,s)=>o.indexOf(t)!==s);i.length>0&&e.push(`Duplicate step names found: ${i.join(", ")}`)}return{valid:e.length===0,errors:e,warnings:n}}async createContext(r,e){let n=await this.load(r),o=n.variables.filter(t=>t.required&&!(t.name in e)).map(t=>t.name);if(o.length>0)throw new Error(`Missing required variables: ${o.join(", ")}`);let i={};return n.variables.forEach(t=>{t.name in e?i[t.name]=e[t.name]:"default"in t&&(i[t.name]=t.default)}),{variables:i,results:new Map,metadata:{startTime:Date.now(),workflow:n.name,templateName:r}}}async getMetadata(r){try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n);return{name:o.name,version:o.version,description:o.description}}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${r}`):e}}clearCache(){this.cache.clear()}async reload(r){return this.cache.delete(r),this.load(r)}},W=new l;function w(a,r){return a.replace(/\{\{([^}]+)\}\}/g,(e,n)=>{let i=n.trim().split("."),t=r;for(let s of i)if(t&&typeof t=="object"&&s in t)t=t[s];else return e;return t!=null?String(t):e})}function v(a,r){let e={...r.variables,result:r.results.get("__last_result__")},n=w(a,e);return p(n,e,!1)}var g=["login-flow","oauth-flow","scraping-workflow","visual-regression","form-validation","navigation-flow","api-integration","performance-audit","accessibility-audit"],b={"login-flow":"Authentication testing workflow for login forms with credential validation","oauth-flow":"OAuth2/OIDC authentication testing workflow with provider integration","scraping-workflow":"Data extraction workflow for web scraping with pagination and structured output","visual-regression":"Screenshot comparison workflow for visual regression testing across breakpoints","form-validation":"Input validation testing workflow for form fields with error handling","navigation-flow":"Multi-page navigation workflow for testing user journeys and state persistence","api-integration":"Browser-API hybrid testing workflow for validating frontend-backend integration","performance-audit":"Lighthouse-style performance audit workflow with Core Web Vitals","accessibility-audit":"WCAG 2.1 Level AA compliance audit workflow with automated accessibility testing"},h={authentication:["login-flow","oauth-flow"],testing:["form-validation","navigation-flow","api-integration"],quality:["visual-regression","performance-audit","accessibility-audit"],automation:["scraping-workflow"]};function R(a){return h[a]}function S(a){return g.includes(a)}function $(){return g.map(a=>{let r=Object.entries(h).find(([e,n])=>n.includes(a))?.[0]||"other";return{name:a,description:b[a],category:r}})}export{h as WORKFLOW_CATEGORIES,b as WORKFLOW_DESCRIPTIONS,g as WORKFLOW_TEMPLATES,l as WorkflowLoader,W as defaultWorkflowLoader,v as evaluateCondition,$ as getAllWorkflowTemplates,R as getWorkflowsByCategory,w as interpolateVariables,S as isValidWorkflowTemplate};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{a}from"./chunk-I7TA453K.js";import"./chunk-E33KQBMW.js";import"./chunk-43M6Y6VF.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-UN4PA4M2.js";import"./chunk-UB7RGVKO.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.js";export{a as BrowserWorkflowTool};
@@ -1,5 +1,5 @@
1
- if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
- import{d as k,f as we}from"./chunk-N2NS2PHA.js";import{a as ye}from"./chunk-3JPRUND5.js";import{c as Q}from"./chunk-4VUPRTVX.js";import{b as C,d as Z}from"./chunk-WGMPEW2T.js";import{a as V,c as be}from"./chunk-JZSDOIXA.js";import{a as J,b as Xe}from"./chunk-263XS447.js";import{a as ee,b as te,c as b,f as ne}from"./chunk-GAOJV3OX.js";import{a as v,e as De}from"./chunk-7VDBAVTY.js";import{c as R,e as ve}from"./chunk-4I2IOUS4.js";function O(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";we();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.9.1");process.exit(0)}
2
+ import{d as k,f as we}from"./chunk-AFPMCMVX.js";import{a as ye}from"./chunk-U5JQGRHZ.js";import{c as Q}from"./chunk-A57BEPL7.js";import{b as C,d as Z}from"./chunk-JSOBRKMA.js";import{a as V,c as be}from"./chunk-UN4PA4M2.js";import{a as J,b as Xe}from"./chunk-GFNUESMU.js";import{a as ee,d as b,e as te,f as ne}from"./chunk-ZEUVPLGX.js";import{a as v,e as De}from"./chunk-SGRN6JFB.js";import{c as R,e as ve}from"./chunk-UZZCWWIG.js";function O(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";we();D=9,se=`
3
3
  CREATE TABLE IF NOT EXISTS schema_version (
4
4
  id INTEGER PRIMARY KEY CHECK (id = 1),
5
5
  version INTEGER NOT NULL,
@@ -544,7 +544,7 @@ import{d as k,f as we}from"./chunk-N2NS2PHA.js";import{a as ye}from"./chunk-3JPR
544
544
  CREATE INDEX IF NOT EXISTS idx_coverage_sessions_technique ON coverage_sessions(technique);
545
545
  CREATE INDEX IF NOT EXISTS idx_coverage_sessions_agent ON coverage_sessions(agent_id);
546
546
  CREATE INDEX IF NOT EXISTS idx_coverage_sessions_created ON coverage_sessions(created_at);
547
- `,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 c(o,a,l,E){return o!==l?o-l:a.localeCompare(E)}return{get(){return n.value},set(o,a){let l=a??Date.now();(n.timestamp===0||c(l,i,n.timestamp,n.nodeId)>0)&&(n={value:o,timestamp:l,nodeId:i,version:n.version+1,lastUpdated:Date.now()})},merge(o){let a=o.getState();this.applyState(a)},getState(){return{value:n.value,timestamp:n.timestamp,nodeId:n.nodeId,version:n.version,lastUpdated:n.lastUpdated}},applyState(o){(n.timestamp===0||c(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 I(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[c,o]of Object.entries(t.counts)){let a=e.counts[c]||0;o>a&&(e.counts[c]=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=I(i);return t.applyState(e),t}var U=R(()=>{"use strict"});function F(i){let e=I(i),t=I(i),n=0,c=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++,c=Date.now())},decrement(o=1){if(o<0)throw new Error("Use increment() for negative values");o!==0&&(t.increment(o),n++,c=Date.now())},merge(o){let a=o.getState();this.applyState(a)},getState(){return{positive:e.getState(),negative:t.getState(),version:n,lastUpdated:c}},applyState(o){let a=this.get();e.applyState(o.positive),t.applyState(o.negative);let l=this.get();a!==l&&(n=Math.max(n,o.version)+1,c=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 C(t);default:throw new Error(`Unknown serialization type: ${e}`)}}function M(i){let e=new Map,t=new Map,n=0,c=Date.now(),o=0;function a(E){let d=e.get(E);if(!d||d.size===0)return!1;let u=t.get(E);if(!u||u.size===0)return!0;for(let m of d)if(!u.has(m))return!0;return!1}function l(E){let d=e.get(E);if(!d)return new Set;let u=t.get(E)||new Set,m=new Set;for(let p of d)u.has(p)||m.add(p);return m}return{has(E){let d=W(E);return a(d)},values(){let E=[];for(let[d]of e)a(d)&&E.push(Fe(d));return E},size(){let E=0;for(let[d]of e)a(d)&&E++;return E},add(E){let d=W(E),u=Ue(i,o++);e.has(d)||e.set(d,new Set),e.get(d).add(u),n++,c=Date.now()},remove(E){let d=W(E),u=e.get(d);if(!u||u.size===0)return;t.has(d)||t.set(d,new Set);let m=t.get(d);for(let p of u)m.add(p);n++,c=Date.now()},merge(E){let d=E.getState();this.applyState(d)},getState(){let E={};for(let[u,m]of e)E[u]=Array.from(m);let d={};for(let[u,m]of t)m.size>0&&(d[u]=Array.from(m));return{elements:E,tombstones:d,version:n,lastUpdated:c}},applyState(E){let d=!1;for(let[u,m]of Object.entries(E.elements)){e.has(u)||e.set(u,new Set);let p=e.get(u);for(let S of m)p.has(S)||(p.add(S),d=!0)}for(let[u,m]of Object.entries(E.tombstones)){t.has(u)||t.set(u,new Set);let p=t.get(u);for(let S of m)p.has(S)||(p.add(S),d=!0)}d&&(n=Math.max(n,E.version)+1,c=Date.now())},getNodeId(){return i},clear(){for(let[E,d]of e){t.has(E)||t.set(E,new Set);let u=t.get(E);for(let m of d)u.add(m)}n++,c=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:c}=e,o=new Map,a=new Map,l=new Map,E=new Map,d=0,u=[],m=new Set,p={registers:new Set,gCounters:new Set,pnCounters:new Set,sets:new Set};function S(s,r,T){let _={key:s,type:r,operation:T,timestamp:Date.now(),nodeId:t};for(let Oe of m)try{Oe(_)}catch(Ae){console.error("[CRDTStore] Error in change listener:",Ae)}}function N(s,r){d++,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:u.length>0?u[u.length-1].toVersion:0,toVersion:d,timestamp:Date.now(),nodeId:t};if(p.registers.size>0){r.registers={};for(let T of p.registers){let _=o.get(T);_&&(r.registers[T]=_.getState())}p.registers.clear()}if(p.gCounters.size>0){r.gCounters={};for(let T of p.gCounters){let _=a.get(T);_&&(r.gCounters[T]=_.getState())}p.gCounters.clear()}if(p.pnCounters.size>0){r.pnCounters={};for(let T of p.pnCounters){let _=l.get(T);_&&(r.pnCounters[T]=_.getState())}p.pnCounters.clear()}if(p.sets.size>0){r.sets={};for(let T of p.sets){let _=E.get(T);_&&(r.sets[T]=_.getState())}p.sets.clear()}for(u.push(r);u.length>c;)u.shift()}let L={getRegister(s){return o.has(s)||o.set(s,y(t)),o.get(s)},setRegister(s,r){L.getRegister(s).set(r),N("registers",s),S(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 a.has(s)||a.set(s,I(t)),a.get(s)},incrementGCounter(s,r){L.getGCounter(s).increment(r),N("gCounters",s),S(s,"g-counter","increment")},hasGCounter(s){return a.has(s)},deleteGCounter(s){let r=a.delete(s);return r&&N("gCounters",s),r},getCounter(s){return l.has(s)||l.set(s,F(t)),l.get(s)},incrementCounter(s,r){L.getCounter(s).increment(r),N("pnCounters",s),S(s,"pn-counter","increment")},decrementCounter(s,r){L.getCounter(s).decrement(r),N("pnCounters",s),S(s,"pn-counter","decrement")},hasCounter(s){return l.has(s)},deleteCounter(s){let r=l.delete(s);return r&&N("pnCounters",s),r},getSet(s){return E.has(s)||E.set(s,M(t)),E.get(s)},addToSet(s,r){L.getSet(s).add(r),N("sets",s),S(s,"or-set","add")},removeFromSet(s,r){L.getSet(s).remove(r),N("sets",s),S(s,"or-set","remove")},hasSet(s){return E.has(s)},deleteSet(s){let r=E.delete(s);return r&&N("sets",s),r},merge(s){let r=s.getState();L.applyState(r)},getState(){K();let s={version:d,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let[r,T]of o)s.registers[r]=T.getState();for(let[r,T]of a)s.gCounters[r]=T.getState();for(let[r,T]of l)s.pnCounters[r]=T.getState();for(let[r,T]of E)s.sets[r]=T.getState();return s},applyState(s){for(let[r,T]of Object.entries(s.registers))o.has(r)?o.get(r).applyState(T):o.set(r,X(t,T)),N("registers",r),S(r,"lww-register","merge");for(let[r,T]of Object.entries(s.gCounters))a.has(r)?a.get(r).applyState(T):a.set(r,w(t,T)),N("gCounters",r),S(r,"g-counter","merge");for(let[r,T]of Object.entries(s.pnCounters))l.has(r)?l.get(r).applyState(T):l.set(r,x(t,T)),N("pnCounters",r),S(r,"pn-counter","merge");for(let[r,T]of Object.entries(s.sets))E.has(r)?E.get(r).applyState(T):E.set(r,P(t,T)),N("sets",r),S(r,"or-set","merge");d=Math.max(d,s.version)+1},getDelta(s){if(K(),u.length===0)return s>=d,null;let r=u.filter(_=>_.toVersion>s);if(r.length===0)return null;let T={fromVersion:s,toVersion:d,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let _ of r)_.registers&&Object.assign(T.registers,_.registers),_.gCounters&&Object.assign(T.gCounters,_.gCounters),_.pnCounters&&Object.assign(T.pnCounters,_.pnCounters),_.sets&&Object.assign(T.sets,_.sets);return Object.keys(T.registers).length===0&&delete T.registers,Object.keys(T.gCounters).length===0&&delete T.gCounters,Object.keys(T.pnCounters).length===0&&delete T.pnCounters,Object.keys(T.sets).length===0&&delete T.sets,T},applyDelta(s){if(s.registers)for(let[r,T]of Object.entries(s.registers))o.has(r)?o.get(r).applyState(T):o.set(r,X(t,T)),N("registers",r),S(r,"lww-register","merge");if(s.gCounters)for(let[r,T]of Object.entries(s.gCounters))a.has(r)?a.get(r).applyState(T):a.set(r,w(t,T)),N("gCounters",r),S(r,"g-counter","merge");if(s.pnCounters)for(let[r,T]of Object.entries(s.pnCounters))l.has(r)?l.get(r).applyState(T):l.set(r,x(t,T)),N("pnCounters",r),S(r,"pn-counter","merge");if(s.sets)for(let[r,T]of Object.entries(s.sets))E.has(r)?E.get(r).applyState(T):E.set(r,P(t,T)),N("sets",r),S(r,"or-set","merge");d=Math.max(d,s.toVersion)+1},getVersion(){return d},getNodeId(){return t},on(s,r){if(s==="change")return m.add(r),()=>{m.delete(r)};throw new Error(`Unknown event type: ${s}`)},removeAllListeners(){m.clear()},keys(s){let r=[];return(!s||s==="lww-register")&&r.push(...Array.from(o.keys())),(!s||s==="g-counter")&&r.push(...Array.from(a.keys())),(!s||s==="pn-counter")&&r.push(...Array.from(l.keys())),(!s||s==="or-set")&&r.push(...Array.from(E.keys())),r},clear(){o.clear(),a.clear(),l.clear(),E.clear(),u.length=0,p.registers.clear(),p.gCounters.clear(),p.pnCounters.clear(),p.sets.clear(),d=0},getStats(){return{total:o.size+a.size+l.size+E.size,registers:o.size,gCounters:a.size,pnCounters:l.size,sets:E.size,version:d,nodeId:t,deltaHistorySize:u.length}}};return L}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={};ve(ke,{ALLOWED_TABLE_NAMES:()=>q,BinaryHeap:()=>ee,DEFAULT_UNIFIED_MEMORY_CONFIG:()=>Le,InMemoryHNSWIndex:()=>te,RuvectorFlatIndex:()=>b,UnifiedMemoryManager:()=>A,clearProjectRootCache:()=>Re,findProjectRoot:()=>G,getDefaultDbPath:()=>he,getResolvedDefaultConfig:()=>Ce,getUnifiedMemory:()=>Ie,initializeUnifiedMemory:()=>Me,resetUnifiedMemory:()=>Pe,validateTableName:()=>O});import*as g from"fs";import*as Ne from"os";import*as f from"path";function Re(){h=null}function G(i=process.cwd()){if(h)return h;if(process.env.AQE_PROJECT_ROOT)return h=process.env.AQE_PROJECT_ROOT,h;let e=i,t=f.parse(e).root,n=e,c=null,o=null,a=null;for(;n!==t;)g.existsSync(f.join(n,".agentic-qe"))&&(c=n),g.existsSync(f.join(n,".git"))&&o===null&&(o=n),g.existsSync(f.join(n,"package.json"))&&(a=n),n=f.dirname(n);return c?h=c:o?h=o:a?h=a:h=process.cwd(),h}function he(){let i=G();return f.join(i,".agentic-qe","memory.db")}function Ce(){return{...Le,dbPath:he()}}function Ie(i){return A.getInstance(i)}async function Me(i){let e=Ie(i);return await e.initialize(),e}function Pe(){A.resetInstance()}function Ge(){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 $,h,Le,A,Se,qe=R(()=>{Xe();Z();be();De();ye();z();z();ne();ne();ge();fe();$=Q.create("unified-memory"),h=null;Le={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:v.MMAP_SIZE_BYTES,cacheSize:v.CACHE_SIZE_KB,busyTimeout:v.BUSY_TIMEOUT_MS,vectorDimensions:v.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 b;crdtStore=null;constructor(e){let t=Ce();if(this.config={...t,...e},!f.isAbsolute(this.config.dbPath)){let n=G();this.config.dbPath=f.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,Re()}async initialize(){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize()),this.initPromise}async _doInitialize(){if(!this.initialized)try{let e=process.env.AQE_PROJECT_ROOT;if(e){let o=f.resolve(this.config.dbPath),a=f.resolve(e);!o.startsWith(a)&&!o.startsWith(Ne.tmpdir())&&o.includes(".agentic-qe")&&(console.error(`[UnifiedMemory] WARNING: DB path "${this.config.dbPath}" points to a production .agentic-qe/ while AQE_PROJECT_ROOT="${e}". Redirecting to test-safe path.`),this.config.dbPath=f.join(e,".agentic-qe","memory.db"))}let t=f.dirname(this.config.dbPath);g.existsSync(t)||g.mkdirSync(t,{recursive:!0});let n=g.existsSync(this.config.dbPath),c=0;if(n)c=g.statSync(this.config.dbPath).size;else if(g.existsSync(t)){let o=this.findRecentBackups(t);if(o.length>0){let a=o[0];console.error(`[UnifiedMemory] CRITICAL: Database file missing but directory exists!
547
+ `,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 c(o,a,l,E){return o!==l?o-l:a.localeCompare(E)}return{get(){return n.value},set(o,a){let l=a??Date.now();(n.timestamp===0||c(l,i,n.timestamp,n.nodeId)>0)&&(n={value:o,timestamp:l,nodeId:i,version:n.version+1,lastUpdated:Date.now()})},merge(o){let a=o.getState();this.applyState(a)},getState(){return{value:n.value,timestamp:n.timestamp,nodeId:n.nodeId,version:n.version,lastUpdated:n.lastUpdated}},applyState(o){(n.timestamp===0||c(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 I(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[c,o]of Object.entries(t.counts)){let a=e.counts[c]||0;o>a&&(e.counts[c]=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=I(i);return t.applyState(e),t}var U=R(()=>{"use strict"});function F(i){let e=I(i),t=I(i),n=0,c=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++,c=Date.now())},decrement(o=1){if(o<0)throw new Error("Use increment() for negative values");o!==0&&(t.increment(o),n++,c=Date.now())},merge(o){let a=o.getState();this.applyState(a)},getState(){return{positive:e.getState(),negative:t.getState(),version:n,lastUpdated:c}},applyState(o){let a=this.get();e.applyState(o.positive),t.applyState(o.negative);let l=this.get();a!==l&&(n=Math.max(n,o.version)+1,c=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 C(t);default:throw new Error(`Unknown serialization type: ${e}`)}}function M(i){let e=new Map,t=new Map,n=0,c=Date.now(),o=0;function a(E){let d=e.get(E);if(!d||d.size===0)return!1;let u=t.get(E);if(!u||u.size===0)return!0;for(let m of d)if(!u.has(m))return!0;return!1}function l(E){let d=e.get(E);if(!d)return new Set;let u=t.get(E)||new Set,m=new Set;for(let p of d)u.has(p)||m.add(p);return m}return{has(E){let d=W(E);return a(d)},values(){let E=[];for(let[d]of e)a(d)&&E.push(Fe(d));return E},size(){let E=0;for(let[d]of e)a(d)&&E++;return E},add(E){let d=W(E),u=Ue(i,o++);e.has(d)||e.set(d,new Set),e.get(d).add(u),n++,c=Date.now()},remove(E){let d=W(E),u=e.get(d);if(!u||u.size===0)return;t.has(d)||t.set(d,new Set);let m=t.get(d);for(let p of u)m.add(p);n++,c=Date.now()},merge(E){let d=E.getState();this.applyState(d)},getState(){let E={};for(let[u,m]of e)E[u]=Array.from(m);let d={};for(let[u,m]of t)m.size>0&&(d[u]=Array.from(m));return{elements:E,tombstones:d,version:n,lastUpdated:c}},applyState(E){let d=!1;for(let[u,m]of Object.entries(E.elements)){e.has(u)||e.set(u,new Set);let p=e.get(u);for(let S of m)p.has(S)||(p.add(S),d=!0)}for(let[u,m]of Object.entries(E.tombstones)){t.has(u)||t.set(u,new Set);let p=t.get(u);for(let S of m)p.has(S)||(p.add(S),d=!0)}d&&(n=Math.max(n,E.version)+1,c=Date.now())},getNodeId(){return i},clear(){for(let[E,d]of e){t.has(E)||t.set(E,new Set);let u=t.get(E);for(let m of d)u.add(m)}n++,c=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:c}=e,o=new Map,a=new Map,l=new Map,E=new Map,d=0,u=[],m=new Set,p={registers:new Set,gCounters:new Set,pnCounters:new Set,sets:new Set};function S(s,r,T){let _={key:s,type:r,operation:T,timestamp:Date.now(),nodeId:t};for(let Oe of m)try{Oe(_)}catch(Ae){console.error("[CRDTStore] Error in change listener:",Ae)}}function N(s,r){d++,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:u.length>0?u[u.length-1].toVersion:0,toVersion:d,timestamp:Date.now(),nodeId:t};if(p.registers.size>0){r.registers={};for(let T of p.registers){let _=o.get(T);_&&(r.registers[T]=_.getState())}p.registers.clear()}if(p.gCounters.size>0){r.gCounters={};for(let T of p.gCounters){let _=a.get(T);_&&(r.gCounters[T]=_.getState())}p.gCounters.clear()}if(p.pnCounters.size>0){r.pnCounters={};for(let T of p.pnCounters){let _=l.get(T);_&&(r.pnCounters[T]=_.getState())}p.pnCounters.clear()}if(p.sets.size>0){r.sets={};for(let T of p.sets){let _=E.get(T);_&&(r.sets[T]=_.getState())}p.sets.clear()}for(u.push(r);u.length>c;)u.shift()}let L={getRegister(s){return o.has(s)||o.set(s,y(t)),o.get(s)},setRegister(s,r){L.getRegister(s).set(r),N("registers",s),S(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 a.has(s)||a.set(s,I(t)),a.get(s)},incrementGCounter(s,r){L.getGCounter(s).increment(r),N("gCounters",s),S(s,"g-counter","increment")},hasGCounter(s){return a.has(s)},deleteGCounter(s){let r=a.delete(s);return r&&N("gCounters",s),r},getCounter(s){return l.has(s)||l.set(s,F(t)),l.get(s)},incrementCounter(s,r){L.getCounter(s).increment(r),N("pnCounters",s),S(s,"pn-counter","increment")},decrementCounter(s,r){L.getCounter(s).decrement(r),N("pnCounters",s),S(s,"pn-counter","decrement")},hasCounter(s){return l.has(s)},deleteCounter(s){let r=l.delete(s);return r&&N("pnCounters",s),r},getSet(s){return E.has(s)||E.set(s,M(t)),E.get(s)},addToSet(s,r){L.getSet(s).add(r),N("sets",s),S(s,"or-set","add")},removeFromSet(s,r){L.getSet(s).remove(r),N("sets",s),S(s,"or-set","remove")},hasSet(s){return E.has(s)},deleteSet(s){let r=E.delete(s);return r&&N("sets",s),r},merge(s){let r=s.getState();L.applyState(r)},getState(){K();let s={version:d,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let[r,T]of o)s.registers[r]=T.getState();for(let[r,T]of a)s.gCounters[r]=T.getState();for(let[r,T]of l)s.pnCounters[r]=T.getState();for(let[r,T]of E)s.sets[r]=T.getState();return s},applyState(s){for(let[r,T]of Object.entries(s.registers))o.has(r)?o.get(r).applyState(T):o.set(r,X(t,T)),N("registers",r),S(r,"lww-register","merge");for(let[r,T]of Object.entries(s.gCounters))a.has(r)?a.get(r).applyState(T):a.set(r,w(t,T)),N("gCounters",r),S(r,"g-counter","merge");for(let[r,T]of Object.entries(s.pnCounters))l.has(r)?l.get(r).applyState(T):l.set(r,x(t,T)),N("pnCounters",r),S(r,"pn-counter","merge");for(let[r,T]of Object.entries(s.sets))E.has(r)?E.get(r).applyState(T):E.set(r,P(t,T)),N("sets",r),S(r,"or-set","merge");d=Math.max(d,s.version)+1},getDelta(s){if(K(),u.length===0)return s>=d,null;let r=u.filter(_=>_.toVersion>s);if(r.length===0)return null;let T={fromVersion:s,toVersion:d,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let _ of r)_.registers&&Object.assign(T.registers,_.registers),_.gCounters&&Object.assign(T.gCounters,_.gCounters),_.pnCounters&&Object.assign(T.pnCounters,_.pnCounters),_.sets&&Object.assign(T.sets,_.sets);return Object.keys(T.registers).length===0&&delete T.registers,Object.keys(T.gCounters).length===0&&delete T.gCounters,Object.keys(T.pnCounters).length===0&&delete T.pnCounters,Object.keys(T.sets).length===0&&delete T.sets,T},applyDelta(s){if(s.registers)for(let[r,T]of Object.entries(s.registers))o.has(r)?o.get(r).applyState(T):o.set(r,X(t,T)),N("registers",r),S(r,"lww-register","merge");if(s.gCounters)for(let[r,T]of Object.entries(s.gCounters))a.has(r)?a.get(r).applyState(T):a.set(r,w(t,T)),N("gCounters",r),S(r,"g-counter","merge");if(s.pnCounters)for(let[r,T]of Object.entries(s.pnCounters))l.has(r)?l.get(r).applyState(T):l.set(r,x(t,T)),N("pnCounters",r),S(r,"pn-counter","merge");if(s.sets)for(let[r,T]of Object.entries(s.sets))E.has(r)?E.get(r).applyState(T):E.set(r,P(t,T)),N("sets",r),S(r,"or-set","merge");d=Math.max(d,s.toVersion)+1},getVersion(){return d},getNodeId(){return t},on(s,r){if(s==="change")return m.add(r),()=>{m.delete(r)};throw new Error(`Unknown event type: ${s}`)},removeAllListeners(){m.clear()},keys(s){let r=[];return(!s||s==="lww-register")&&r.push(...Array.from(o.keys())),(!s||s==="g-counter")&&r.push(...Array.from(a.keys())),(!s||s==="pn-counter")&&r.push(...Array.from(l.keys())),(!s||s==="or-set")&&r.push(...Array.from(E.keys())),r},clear(){o.clear(),a.clear(),l.clear(),E.clear(),u.length=0,p.registers.clear(),p.gCounters.clear(),p.pnCounters.clear(),p.sets.clear(),d=0},getStats(){return{total:o.size+a.size+l.size+E.size,registers:o.size,gCounters:a.size,pnCounters:l.size,sets:E.size,version:d,nodeId:t,deltaHistorySize:u.length}}};return L}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={};ve(ke,{ALLOWED_TABLE_NAMES:()=>q,BinaryHeap:()=>ee,DEFAULT_UNIFIED_MEMORY_CONFIG:()=>Le,UnifiedHnswIndex:()=>b,UnifiedMemoryManager:()=>A,clearProjectRootCache:()=>Re,createHnswIndex:()=>te,findProjectRoot:()=>G,getDefaultDbPath:()=>he,getResolvedDefaultConfig:()=>Ce,getUnifiedMemory:()=>Ie,initializeUnifiedMemory:()=>Me,resetUnifiedMemory:()=>Pe,validateTableName:()=>O});import*as g from"fs";import*as Ne from"os";import*as f from"path";function Re(){h=null}function G(i=process.cwd()){if(h)return h;if(process.env.AQE_PROJECT_ROOT)return h=process.env.AQE_PROJECT_ROOT,h;let e=i,t=f.parse(e).root,n=e,c=null,o=null,a=null;for(;n!==t;)g.existsSync(f.join(n,".agentic-qe"))&&(c=n),g.existsSync(f.join(n,".git"))&&o===null&&(o=n),g.existsSync(f.join(n,"package.json"))&&(a=n),n=f.dirname(n);return c?h=c:o?h=o:a?h=a:h=process.cwd(),h}function he(){let i=G();return f.join(i,".agentic-qe","memory.db")}function Ce(){return{...Le,dbPath:he()}}function Ie(i){return A.getInstance(i)}async function Me(i){let e=Ie(i);return await e.initialize(),e}function Pe(){A.resetInstance()}function Ge(){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 $,h,Le,A,Se,qe=R(()=>{Xe();Z();be();De();ye();z();z();ne();ne();ge();fe();$=Q.create("unified-memory"),h=null;Le={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:v.MMAP_SIZE_BYTES,cacheSize:v.CACHE_SIZE_KB,busyTimeout:v.BUSY_TIMEOUT_MS,vectorDimensions:v.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 b("qe-memory");crdtStore=null;constructor(e){let t=Ce();if(this.config={...t,...e},!f.isAbsolute(this.config.dbPath)){let n=G();this.config.dbPath=f.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,Re()}async initialize(){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize()),this.initPromise}async _doInitialize(){if(!this.initialized)try{let e=process.env.AQE_PROJECT_ROOT;if(e){let o=f.resolve(this.config.dbPath),a=f.resolve(e);!o.startsWith(a)&&!o.startsWith(Ne.tmpdir())&&o.includes(".agentic-qe")&&(console.error(`[UnifiedMemory] WARNING: DB path "${this.config.dbPath}" points to a production .agentic-qe/ while AQE_PROJECT_ROOT="${e}". Redirecting to test-safe path.`),this.config.dbPath=f.join(e,".agentic-qe","memory.db"))}let t=f.dirname(this.config.dbPath);g.existsSync(t)||g.mkdirSync(t,{recursive:!0});let n=g.existsSync(this.config.dbPath),c=0;if(n)c=g.statSync(this.config.dbPath).size;else if(g.existsSync(t)){let o=this.findRecentBackups(t);if(o.length>0){let a=o[0];console.error(`[UnifiedMemory] CRITICAL: Database file missing but directory exists!
548
548
  Expected: ${this.config.dbPath}
549
549
  Found ${o.length} backup(s), newest: ${a.path} (${(a.size/1024/1024).toFixed(1)}MB)
550
550
  Restoring from backup to prevent data loss...`),g.copyFileSync(a.path,this.config.dbPath);for(let l of["-wal","-shm"]){let E=this.config.dbPath+l;g.existsSync(E)&&g.unlinkSync(E)}c=a.size}}if(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"),await this.runMigrations(),n&&c>1e6)try{let o=this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get();if(o&&o.cnt===0){let a=g.statSync(this.config.dbPath).size;a<c*.1&&console.error(`[UnifiedMemory] CRITICAL: Possible data loss detected!
@@ -1,2 +1,2 @@
1
- if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
- import{c as t,e as o}from"./chunk-4I2IOUS4.js";var L={};o(L,{DotProductAttention:()=>d,FlashAttention:()=>m,HyperbolicAttention:()=>f,LinearAttention:()=>h,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>g,TensorCompress:()=>c,default:()=>i,differentiableSearch:()=>l,getCompressionLevel:()=>s,hierarchicalForward:()=>p,init:()=>u,pipeline:()=>v});import{createRequire as n}from"module";var r,e,i,a,c,l,p,s,u,m,d,A,f,h,_,g,v,b=t(()=>{r=n(import.meta.url),e=r("@ruvector/gnn"),i=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:p,getCompressionLevel:s,init:u,FlashAttention:m,DotProductAttention:d,MultiHeadAttention:A,HyperbolicAttention:f,LinearAttention:h,MoEAttention:_,SonaEngine:g,pipeline:v}=e||{}});export{L as a,b};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{c as t,e as o}from"./chunk-UZZCWWIG.js";var L={};o(L,{DotProductAttention:()=>d,FlashAttention:()=>m,HyperbolicAttention:()=>f,LinearAttention:()=>h,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>g,TensorCompress:()=>c,default:()=>i,differentiableSearch:()=>l,getCompressionLevel:()=>s,hierarchicalForward:()=>p,init:()=>u,pipeline:()=>v});import{createRequire as n}from"module";var r,e,i,a,c,l,p,s,u,m,d,A,f,h,_,g,v,b=t(()=>{r=n(import.meta.url),e=r("@ruvector/gnn"),i=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:p,getCompressionLevel:s,init:u,FlashAttention:m,DotProductAttention:d,MultiHeadAttention:A,HyperbolicAttention:f,LinearAttention:h,MoEAttention:_,SonaEngine:g,pipeline:v}=e||{}});export{L as a,b};
@@ -1,3 +1,3 @@
1
- if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
- import{a as h}from"./chunk-72WOAVK6.js";import{a as C,f as x}from"./chunk-HRO6OZQD.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.9.1");process.exit(0)}
2
+ import{a as h}from"./chunk-3VAKR43Z.js";import{a as C,f as x}from"./chunk-WDJBGXC2.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,2 +1,2 @@
1
- if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
- import{c as u}from"./chunk-4I2IOUS4.js";function t(){return{...e}}function o(r){e={...e,...r}}function i(){e={...s}}function a(){return e.useBrowserMode}function E(){return e.useScreenshotCapture}function l(){return e.useVisualRegression}function c(){return e.useE2EExecution}function f(){return e.defaultHeadless}function d(){return e.useAutoRetry}function _(){return e.logPerformanceMetrics}function I(){return e.useAxeCore}function p(){let r={};process.env.VIBIUM_USE_BROWSER_MODE!==void 0&&(r.useBrowserMode=process.env.VIBIUM_USE_BROWSER_MODE==="true"),process.env.VIBIUM_USE_SCREENSHOT_CAPTURE!==void 0&&(r.useScreenshotCapture=process.env.VIBIUM_USE_SCREENSHOT_CAPTURE==="true"),process.env.VIBIUM_USE_VISUAL_REGRESSION!==void 0&&(r.useVisualRegression=process.env.VIBIUM_USE_VISUAL_REGRESSION==="true"),process.env.VIBIUM_USE_E2E_EXECUTION!==void 0&&(r.useE2EExecution=process.env.VIBIUM_USE_E2E_EXECUTION==="true"),process.env.VIBIUM_DEFAULT_HEADLESS!==void 0&&(r.defaultHeadless=process.env.VIBIUM_DEFAULT_HEADLESS==="true"),process.env.VIBIUM_USE_AUTO_RETRY!==void 0&&(r.useAutoRetry=process.env.VIBIUM_USE_AUTO_RETRY==="true"),process.env.VIBIUM_LOG_PERFORMANCE_METRICS!==void 0&&(r.logPerformanceMetrics=process.env.VIBIUM_LOG_PERFORMANCE_METRICS==="true"),process.env.VIBIUM_USE_AXE_CORE!==void 0&&(r.useAxeCore=process.env.VIBIUM_USE_AXE_CORE==="true"),o(r)}function U(){o({defaultHeadless:!0,useAutoRetry:!0,logPerformanceMetrics:!0})}function R(){o({defaultHeadless:!1,logPerformanceMetrics:!0})}function S(){o({useBrowserMode:!1,useScreenshotCapture:!1,useVisualRegression:!1,useE2EExecution:!1,useAxeCore:!1})}var s,e,n=u(()=>{s={useBrowserMode:!0,useScreenshotCapture:!0,useVisualRegression:!0,useE2EExecution:!0,defaultHeadless:!1,useAutoRetry:!0,logPerformanceMetrics:!0,useAxeCore:!0},e={...s}});export{s as a,t as b,o as c,i as d,a as e,E as f,l as g,c as h,f as i,d as j,_ as k,I as l,p as m,U as n,R as o,S as p,n as q};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
+ import{c as u}from"./chunk-UZZCWWIG.js";function t(){return{...e}}function o(r){e={...e,...r}}function i(){e={...s}}function a(){return e.useBrowserMode}function E(){return e.useScreenshotCapture}function l(){return e.useVisualRegression}function c(){return e.useE2EExecution}function f(){return e.defaultHeadless}function d(){return e.useAutoRetry}function _(){return e.logPerformanceMetrics}function I(){return e.useAxeCore}function p(){let r={};process.env.VIBIUM_USE_BROWSER_MODE!==void 0&&(r.useBrowserMode=process.env.VIBIUM_USE_BROWSER_MODE==="true"),process.env.VIBIUM_USE_SCREENSHOT_CAPTURE!==void 0&&(r.useScreenshotCapture=process.env.VIBIUM_USE_SCREENSHOT_CAPTURE==="true"),process.env.VIBIUM_USE_VISUAL_REGRESSION!==void 0&&(r.useVisualRegression=process.env.VIBIUM_USE_VISUAL_REGRESSION==="true"),process.env.VIBIUM_USE_E2E_EXECUTION!==void 0&&(r.useE2EExecution=process.env.VIBIUM_USE_E2E_EXECUTION==="true"),process.env.VIBIUM_DEFAULT_HEADLESS!==void 0&&(r.defaultHeadless=process.env.VIBIUM_DEFAULT_HEADLESS==="true"),process.env.VIBIUM_USE_AUTO_RETRY!==void 0&&(r.useAutoRetry=process.env.VIBIUM_USE_AUTO_RETRY==="true"),process.env.VIBIUM_LOG_PERFORMANCE_METRICS!==void 0&&(r.logPerformanceMetrics=process.env.VIBIUM_LOG_PERFORMANCE_METRICS==="true"),process.env.VIBIUM_USE_AXE_CORE!==void 0&&(r.useAxeCore=process.env.VIBIUM_USE_AXE_CORE==="true"),o(r)}function U(){o({defaultHeadless:!0,useAutoRetry:!0,logPerformanceMetrics:!0})}function R(){o({defaultHeadless:!1,logPerformanceMetrics:!0})}function S(){o({useBrowserMode:!1,useScreenshotCapture:!1,useVisualRegression:!1,useE2EExecution:!1,useAxeCore:!1})}var s,e,n=u(()=>{s={useBrowserMode:!0,useScreenshotCapture:!0,useVisualRegression:!0,useE2EExecution:!0,defaultHeadless:!1,useAutoRetry:!0,logPerformanceMetrics:!0,useAxeCore:!0},e={...s}});export{s as a,t as b,o as c,i as d,a as e,E as f,l as g,c as h,f as i,d as j,_ as k,I as l,p as m,U as n,R as o,S as p,n as q};
@@ -1,2 +1,2 @@
1
- if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
2
2
  var l=["var-to-const","add-types","remove-console","promise-to-async","cjs-to-esm","func-to-arrow"],p={"var-to-const":{type:"var-to-const",name:"Var to Const/Let",description:"Convert var declarations to const (if not reassigned) or let (if reassigned)",complexity:"simple",wasmAvailable:!0,typicalLatencyMs:1},"add-types":{type:"add-types",name:"Add TypeScript Types",description:"Add TypeScript type annotations to function parameters and return types",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:5},"remove-console":{type:"remove-console",name:"Remove Console Statements",description:"Remove all console.log, console.warn, console.error, etc. statements",complexity:"simple",wasmAvailable:!0,typicalLatencyMs:1},"promise-to-async":{type:"promise-to-async",name:"Promise to Async/Await",description:"Convert Promise .then()/.catch() chains to async/await syntax",complexity:"complex",wasmAvailable:!0,typicalLatencyMs:10},"cjs-to-esm":{type:"cjs-to-esm",name:"CommonJS to ES Modules",description:"Convert require() calls to import statements and module.exports to export",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:5},"func-to-arrow":{type:"func-to-arrow",name:"Function to Arrow",description:"Convert function declarations and expressions to arrow functions",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:3}},u={enabled:!0,fallbackToLLM:!0,confidenceThreshold:.7,transforms:[],maxFileSizeBytes:1024*1024,timeoutMs:5e3,cacheEnabled:!0,cacheTtlMs:300*1e3},t=class extends Error{constructor(e,s,o){super(e);this.code=s;this.cause=o;this.name="AgentBoosterError"}},a=class extends t{constructor(e,s,o){super(e,"TRANSFORM_ERROR",o);this.transformType=s;this.name="TransformError"}},i=class extends t{constructor(r="WASM module is not available",e){super(r,"WASM_UNAVAILABLE",e),this.name="WasmUnavailableError"}},c=class extends t{constructor(e,s,o){super(e,"TRANSFORM_TIMEOUT");this.transformType=s;this.timeoutMs=o;this.name="TransformTimeoutError"}},m=class extends t{constructor(e,s,o){super(`File ${e} is too large (${s} bytes, max ${o} bytes)`,"FILE_TOO_LARGE");this.filePath=e;this.sizeBytes=s;this.maxSizeBytes=o;this.name="FileTooLargeError"}};export{l as a,p as b,u as c,a as d,i as e,c as f,m as g};