agentic-qe 3.10.1 → 3.10.2

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 (325) hide show
  1. package/.claude/hooks/README.txt +17 -0
  2. package/.claude/hooks/aqe-hook.cjs +98 -0
  3. package/.claude/hooks/cross-phase-memory.yaml +296 -0
  4. package/.claude/hooks/post-task-sync.sh +113 -0
  5. package/.claude/hooks/v3-domain-workers.json +121 -0
  6. package/.claude/skills/skills-manifest.json +1 -1
  7. package/CHANGELOG.md +76 -0
  8. package/dist/cli/bundle.js +5 -5
  9. package/dist/cli/chunks/adapter-CR6J5C76.js +2 -0
  10. package/dist/cli/chunks/{agent-booster-wasm-FZLWOPSX.js → agent-booster-wasm-DHSIPFTH.js} +2 -2
  11. package/dist/cli/chunks/{agent-handler-KAGRVCKS.js → agent-handler-FPQVHGGT.js} +2 -2
  12. package/dist/cli/chunks/{agent-memory-branch-JJKFEXQW.js → agent-memory-branch-OLOF5ZHV.js} +2 -2
  13. package/dist/cli/chunks/aqe-learning-engine-2MNTHMB6.js +2 -0
  14. package/dist/cli/chunks/{audit-DN5SY4JJ.js → audit-ALRYPHGP.js} +2 -2
  15. package/dist/cli/chunks/base-AOQNGMTL.js +2 -0
  16. package/dist/cli/chunks/{hnswlib-node-YX6OOBN6.js → better-sqlite3-5BT5FO64.js} +2 -2
  17. package/dist/cli/chunks/{brain-handler-O7MP5BGY.js → brain-handler-ROZUHCOT.js} +3 -3
  18. package/dist/cli/chunks/{branch-enumerator-ZPTN5J6V.js → branch-enumerator-VK7G4NKJ.js} +2 -2
  19. package/dist/cli/chunks/{browser-PAZE2JSD.js → browser-Q2S75M2F.js} +2 -2
  20. package/dist/cli/chunks/browser-workflow-UJ4A2ZXO.js +2 -0
  21. package/dist/cli/chunks/{chunk-WDTCCPK4.js → chunk-2244IFZA.js} +1 -1
  22. package/dist/cli/chunks/{chunk-WPNZSL4S.js → chunk-22D6VBPD.js} +1 -1
  23. package/dist/cli/chunks/{chunk-2KTRRSKD.js → chunk-24LUQICS.js} +2 -2
  24. package/dist/cli/chunks/{chunk-IHDUWPFY.js → chunk-2EDWGHDA.js} +2 -2
  25. package/dist/cli/chunks/{chunk-TP77PNN6.js → chunk-2JDLQWSV.js} +2 -2
  26. package/dist/cli/chunks/{chunk-GTGONWGX.js → chunk-2OH3ALYB.js} +1 -1
  27. package/dist/cli/chunks/{chunk-WMG5F6R6.js → chunk-3RHHKYUR.js} +2 -2
  28. package/dist/cli/chunks/{chunk-6E7GI2UB.js → chunk-3Z4FHA2E.js} +1 -1
  29. package/dist/cli/chunks/{chunk-JLKHPIQF.js → chunk-4BXGVM2C.js} +1 -1
  30. package/dist/cli/chunks/{chunk-6D57DWQ6.js → chunk-4F3ZTXHP.js} +2 -2
  31. package/dist/cli/chunks/{chunk-3YOPJ7DY.js → chunk-4GTDW2XL.js} +2 -2
  32. package/dist/cli/chunks/{chunk-W2DT3CDE.js → chunk-5HB54RUS.js} +2 -2
  33. package/dist/cli/chunks/{chunk-LF7URN2X.js → chunk-5PL7WTCU.js} +2 -2
  34. package/dist/cli/chunks/{chunk-Y357YFLF.js → chunk-5PRFFHFV.js} +2 -2
  35. package/dist/cli/chunks/{chunk-GXJ4BCGC.js → chunk-5QHSLWLP.js} +2 -2
  36. package/dist/cli/chunks/{chunk-TL5F2S3Z.js → chunk-5WJ3FWL4.js} +2 -2
  37. package/dist/cli/chunks/{chunk-ZTMWJQTZ.js → chunk-6KSCXPPL.js} +2 -2
  38. package/dist/cli/chunks/{chunk-SQBB2DC6.js → chunk-6NZHEM4V.js} +1 -1
  39. package/dist/cli/chunks/{chunk-EUJHHXE6.js → chunk-6ZFHIKQG.js} +2 -2
  40. package/dist/cli/chunks/{chunk-YPOTBXPU.js → chunk-7DKYCVJI.js} +2 -2
  41. package/dist/cli/chunks/{chunk-DQIS6J77.js → chunk-7IVQ6OVR.js} +2 -2
  42. package/dist/cli/chunks/{chunk-DMIYWPQQ.js → chunk-7IZ2OPC2.js} +2 -2
  43. package/dist/cli/chunks/{chunk-VOIWDPIU.js → chunk-7QRMARM7.js} +2 -2
  44. package/dist/cli/chunks/{chunk-KEC5FBAW.js → chunk-7SJX4CFK.js} +1 -1
  45. package/dist/cli/chunks/{chunk-2S4XHK26.js → chunk-7SWD3D6Y.js} +2 -2
  46. package/dist/cli/chunks/{chunk-RRLQFFCO.js → chunk-7V5UHLNY.js} +2 -2
  47. package/dist/cli/chunks/{chunk-G3BQU3Q6.js → chunk-7Z46RDDV.js} +2 -2
  48. package/dist/cli/chunks/{chunk-TNVYKYTO.js → chunk-A5RMQG4N.js} +3 -3
  49. package/dist/cli/chunks/{chunk-PXFQSVA2.js → chunk-AH7FXNFE.js} +3 -3
  50. package/dist/cli/chunks/{chunk-K22TPWOJ.js → chunk-AIUSZC6K.js} +2 -2
  51. package/dist/cli/chunks/{chunk-IK6AJX3C.js → chunk-AOI67HA3.js} +1 -1
  52. package/dist/cli/chunks/{chunk-6VQ5MFJ6.js → chunk-AV7KYE5P.js} +7 -7
  53. package/dist/cli/chunks/{chunk-GTRXZJNX.js → chunk-AWFIEGR3.js} +2 -2
  54. package/dist/cli/chunks/{chunk-6A2NIR2E.js → chunk-BQCSCAUC.js} +2 -2
  55. package/dist/cli/chunks/{chunk-NQZYUH6S.js → chunk-C2M74HCN.js} +1 -1
  56. package/dist/cli/chunks/{chunk-5EU2VQK3.js → chunk-CIRPP7RQ.js} +2 -2
  57. package/dist/cli/chunks/{chunk-Q5VHBI4U.js → chunk-CMACGG4Z.js} +1 -1
  58. package/dist/cli/chunks/{chunk-YGRTMAWB.js → chunk-CTDLI2ON.js} +1 -1
  59. package/dist/cli/chunks/{chunk-P7T5Y735.js → chunk-CV2SBMBW.js} +2 -2
  60. package/dist/cli/chunks/{chunk-UDFLR7GR.js → chunk-DMQPO43S.js} +1 -1
  61. package/dist/cli/chunks/{chunk-XKOKMS5A.js → chunk-DRWGK3YO.js} +2 -2
  62. package/dist/cli/chunks/{chunk-EBQ6YKP2.js → chunk-DZZEHPSJ.js} +2 -2
  63. package/dist/cli/chunks/{chunk-7SQD2TTQ.js → chunk-EA7ZSN3V.js} +1 -1
  64. package/dist/cli/chunks/{chunk-KKNBYXYA.js → chunk-EQBEGDTG.js} +1 -1
  65. package/dist/cli/chunks/{chunk-2UN4DOBJ.js → chunk-ETN5563K.js} +2 -2
  66. package/dist/cli/chunks/{chunk-BECU52UY.js → chunk-EVCOCGVJ.js} +3 -3
  67. package/dist/cli/chunks/{chunk-OC3OJWLB.js → chunk-FO43SQXP.js} +2 -2
  68. package/dist/cli/chunks/{chunk-CKECJH2A.js → chunk-FO73PZVU.js} +2 -2
  69. package/dist/cli/chunks/{chunk-Y2DPXMOR.js → chunk-FPAW77XV.js} +1 -1
  70. package/dist/cli/chunks/{chunk-UDVX34ZG.js → chunk-FY3CUPNN.js} +20 -17
  71. package/dist/cli/chunks/{chunk-EIROAH6N.js → chunk-G5U6Q42D.js} +2 -2
  72. package/dist/cli/chunks/{chunk-VKRMVTWU.js → chunk-HA63NBFK.js} +9 -9
  73. package/dist/cli/chunks/{chunk-2ETDES5W.js → chunk-HHCYSAH3.js} +2 -2
  74. package/dist/cli/chunks/{chunk-57NJQV57.js → chunk-HJME6G5M.js} +1 -1
  75. package/dist/cli/chunks/{chunk-BN7ERYXI.js → chunk-HJORBNXW.js} +1 -1
  76. package/dist/cli/chunks/{chunk-5KFCH7RH.js → chunk-HO37VP4O.js} +1 -1
  77. package/dist/cli/chunks/{chunk-622MIAOR.js → chunk-I677W5BT.js} +3 -3
  78. package/dist/cli/chunks/chunk-IAZEDWRX.js +2 -0
  79. package/dist/cli/chunks/{chunk-KRXKU54J.js → chunk-IICTTDAA.js} +2 -2
  80. package/dist/cli/chunks/{chunk-BGBSYF3K.js → chunk-JF53LRBL.js} +2 -2
  81. package/dist/cli/chunks/{chunk-RPL6K623.js → chunk-KB5L5TTF.js} +3 -3
  82. package/dist/cli/chunks/{chunk-Q24OJX44.js → chunk-L7VIX22Y.js} +2 -2
  83. package/dist/cli/chunks/{chunk-TFNLXAK5.js → chunk-LQTWPSYL.js} +1 -1
  84. package/dist/cli/chunks/{chunk-ECPB7IAH.js → chunk-LZCBSFAU.js} +4 -4
  85. package/dist/cli/chunks/{chunk-G5DTENO3.js → chunk-MCOFJHSJ.js} +2 -2
  86. package/dist/cli/chunks/{chunk-XRK7FBTY.js → chunk-MCZHKXB4.js} +2 -2
  87. package/dist/cli/chunks/{chunk-H44WD7QX.js → chunk-MEY43PIQ.js} +2 -2
  88. package/dist/cli/chunks/{chunk-WL2J6ECN.js → chunk-MMIQ5DMA.js} +2 -2
  89. package/dist/cli/chunks/{chunk-PUXDXIUE.js → chunk-MNUTRAUV.js} +1 -1
  90. package/dist/cli/chunks/{chunk-KCTH5MHE.js → chunk-MNV3E5KY.js} +2 -2
  91. package/dist/cli/chunks/{chunk-EO4B5GS4.js → chunk-MYWQTCS4.js} +1 -1
  92. package/dist/cli/chunks/{chunk-32R7EA7B.js → chunk-NZO4WUSO.js} +3 -3
  93. package/dist/cli/chunks/{chunk-NOCYYXK4.js → chunk-OIEQF7PG.js} +2 -2
  94. package/dist/cli/chunks/{chunk-IPRDHKSI.js → chunk-OIRZJCZY.js} +2 -2
  95. package/dist/cli/chunks/{chunk-ELZ67OHQ.js → chunk-ON4D4TJ4.js} +2 -2
  96. package/dist/cli/chunks/chunk-OPFN5LFT.js +95 -0
  97. package/dist/cli/chunks/{chunk-4AWJ5PE4.js → chunk-ORF2UKQH.js} +1 -1
  98. package/dist/cli/chunks/{chunk-6LRCMFLV.js → chunk-OWQ6HEYI.js} +2 -2
  99. package/dist/cli/chunks/{chunk-GRG3OP34.js → chunk-OXCEUR5F.js} +2 -2
  100. package/dist/cli/chunks/{chunk-SLNGJW4G.js → chunk-PEK6NGVJ.js} +1 -1
  101. package/dist/cli/chunks/{chunk-5ZCVMR5E.js → chunk-PIZYRPMT.js} +2 -2
  102. package/dist/cli/chunks/{chunk-K4T3RDCB.js → chunk-PXTDEO65.js} +2 -2
  103. package/dist/cli/chunks/{chunk-GRYXNWPF.js → chunk-PYIHZXCI.js} +12 -12
  104. package/dist/cli/chunks/{chunk-HRDGN3OK.js → chunk-QBRHKTFT.js} +1 -1
  105. package/dist/cli/chunks/{chunk-COZDJLIL.js → chunk-QEPFXY6G.js} +1 -1
  106. package/dist/cli/chunks/{chunk-HPNEZ7YN.js → chunk-QJ2EHLJ2.js} +1 -1
  107. package/dist/cli/chunks/{chunk-GMKGLZJU.js → chunk-QQNCSEZG.js} +2 -2
  108. package/dist/cli/chunks/{chunk-CR4ERDS2.js → chunk-QSE67XJO.js} +2 -2
  109. package/dist/cli/chunks/{chunk-7CKVAYP3.js → chunk-R2O6OKT2.js} +1 -1
  110. package/dist/cli/chunks/{chunk-OVENSL64.js → chunk-RLXTBL3H.js} +8 -8
  111. package/dist/cli/chunks/{chunk-PW6MOFXG.js → chunk-RNREAOY4.js} +2 -2
  112. package/dist/cli/chunks/{chunk-YYWIA5FX.js → chunk-S3OZ7XSY.js} +1 -1
  113. package/dist/cli/chunks/{chunk-KZJXVIAW.js → chunk-S3ZO7JXS.js} +2 -2
  114. package/dist/cli/chunks/{chunk-ZEMXMDD3.js → chunk-SJH3HYNC.js} +2 -2
  115. package/dist/cli/chunks/{chunk-5OTYBWRL.js → chunk-STEGWLH5.js} +2 -2
  116. package/dist/cli/chunks/{chunk-F3OVFA6W.js → chunk-SVYTN2GT.js} +2 -2
  117. package/dist/cli/chunks/{chunk-QNW335PD.js → chunk-SW4OKUTC.js} +2 -2
  118. package/dist/cli/chunks/{chunk-WS4XVJHI.js → chunk-THRTUW4Z.js} +1 -1
  119. package/dist/cli/chunks/{chunk-NPSBMDVU.js → chunk-TJKDATEU.js} +2 -2
  120. package/dist/cli/chunks/{chunk-H22MMMYY.js → chunk-U3EUH6LX.js} +2 -2
  121. package/dist/cli/chunks/{chunk-FJSR2U65.js → chunk-UUFOHMUG.js} +2 -2
  122. package/dist/cli/chunks/{chunk-RWYW573C.js → chunk-UVU7XLJY.js} +3 -3
  123. package/dist/cli/chunks/{chunk-BF7MUYWC.js → chunk-UWXH2UQK.js} +2 -2
  124. package/dist/cli/chunks/{chunk-UU2Q6XWF.js → chunk-UYYBPWU3.js} +1 -1
  125. package/dist/cli/chunks/{chunk-AUVC3DDB.js → chunk-VSUTI4G6.js} +2 -2
  126. package/dist/cli/chunks/{chunk-25QGPRWN.js → chunk-WDMPJ2M2.js} +2 -2
  127. package/dist/cli/chunks/{chunk-MVGVD6LS.js → chunk-WNR2KAUH.js} +2 -2
  128. package/dist/cli/chunks/{chunk-NDCPEXDN.js → chunk-WSVUSIAZ.js} +2 -2
  129. package/dist/cli/chunks/{chunk-T3UXMPXX.js → chunk-WZJUMJ2S.js} +1 -1
  130. package/dist/cli/chunks/{chunk-TX7SNQKL.js → chunk-X2VAOIUY.js} +1 -1
  131. package/dist/cli/chunks/{chunk-DVOH75S4.js → chunk-XDSA7YUQ.js} +1 -1
  132. package/dist/cli/chunks/{chunk-TNGGVMPQ.js → chunk-XDU624HU.js} +1 -1
  133. package/dist/cli/chunks/{chunk-6ZRMQXVL.js → chunk-XGBAHAGC.js} +2 -2
  134. package/dist/cli/chunks/{chunk-IITKJCPK.js → chunk-XMJTTF5N.js} +2 -2
  135. package/dist/cli/chunks/{chunk-2TDWCXZ6.js → chunk-XPCNUX2U.js} +2 -2
  136. package/dist/cli/chunks/{chunk-W6ZF2CPN.js → chunk-XRJECWZE.js} +1 -1
  137. package/dist/cli/chunks/{chunk-MQYTW2IN.js → chunk-XTCUN36Z.js} +2 -2
  138. package/dist/cli/chunks/{chunk-7MSYTHZM.js → chunk-Y63MBMOV.js} +2 -2
  139. package/dist/cli/chunks/{chunk-6QFONVEE.js → chunk-YACT5WFC.js} +2 -2
  140. package/dist/cli/chunks/{chunk-PLRSKAFZ.js → chunk-YI6GNRQM.js} +2 -2
  141. package/dist/cli/chunks/chunk-YNNOY3XN.js +62 -0
  142. package/dist/cli/chunks/{chunk-XGUQYVJR.js → chunk-YWZHMXTO.js} +2 -2
  143. package/dist/cli/chunks/{chunk-OQP5OFRR.js → chunk-ZDHMZPSL.js} +1 -1
  144. package/dist/cli/chunks/{chunk-NRLT44YB.js → chunk-ZGNZJJFF.js} +1 -1
  145. package/dist/cli/chunks/{chunk-ELUERFGA.js → chunk-ZK2BH23O.js} +2 -2
  146. package/dist/cli/chunks/{chunk-AABKTWXC.js → chunk-ZQUXNG5X.js} +2 -2
  147. package/dist/cli/chunks/{chunk-WQEZKAUR.js → chunk-ZXTO4C7R.js} +2 -2
  148. package/dist/cli/chunks/{ci-EHRUN7O6.js → ci-PYCRCL7G.js} +2 -2
  149. package/dist/cli/chunks/{ci-output-EXDXVXKB.js → ci-output-EKQQFE2D.js} +2 -2
  150. package/dist/cli/chunks/{circuit-breaker-LM4QRAAL.js → circuit-breaker-RH3Q2MJO.js} +2 -2
  151. package/dist/cli/chunks/{claude-flow-setup-ZHUCZVW7.js → claude-flow-setup-DUDXB4VV.js} +2 -2
  152. package/dist/cli/chunks/client-RDPWGOSA.js +2 -0
  153. package/dist/cli/chunks/{cline-installer-WMFLQOW2.js → cline-installer-3Q4WIWUG.js} +2 -2
  154. package/dist/cli/chunks/{code-L7KRLU5E.js → code-E4Q6DGOO.js} +2 -2
  155. package/dist/cli/chunks/{code-index-extractor-FTMUYQC6.js → code-index-extractor-2PCISUOW.js} +2 -2
  156. package/dist/cli/chunks/{codex-installer-B3F6WI3Z.js → codex-installer-YNNNOLJ6.js} +2 -2
  157. package/dist/cli/chunks/{completions-3JZQRNB6.js → completions-2F7TUFBD.js} +2 -2
  158. package/dist/cli/chunks/{complexity-analyzer-LB2FFEKX.js → complexity-analyzer-2B6MHO7W.js} +2 -2
  159. package/dist/cli/chunks/{continuedev-installer-WH6IMV7R.js → continuedev-installer-ENOKRU5M.js} +2 -2
  160. package/dist/cli/chunks/{copilot-installer-NOIEOFJM.js → copilot-installer-6YD2KM5F.js} +2 -2
  161. package/dist/cli/chunks/{cost-tracker-IKX2VYSA.js → cost-tracker-FCH4QOEA.js} +2 -2
  162. package/dist/cli/chunks/{coverage-TD37CYSY.js → coverage-JTOXZE3T.js} +3 -3
  163. package/dist/cli/chunks/cross-domain-router-4K5ZVZEZ.js +2 -0
  164. package/dist/cli/chunks/{cursor-installer-4NSVGRM5.js → cursor-installer-QZFBUGLQ.js} +2 -2
  165. package/dist/cli/chunks/{daemon-LYDV7NRW.js → daemon-K4QFB5FQ.js} +3 -3
  166. package/dist/cli/chunks/{daemon-UWEBUIDT.js → daemon-M422U3ZA.js} +4 -4
  167. package/dist/cli/chunks/{dag-attention-scheduler-NECJGCHC.js → dag-attention-scheduler-BXAAW33V.js} +2 -2
  168. package/dist/cli/chunks/{detect-4XGC7ILO.js → detect-UGSWIOAD.js} +2 -2
  169. package/dist/cli/chunks/{dist-node-GGJDXRKJ.js → dist-node-FN3HX3OK.js} +2 -2
  170. package/dist/cli/chunks/{domain-handler-UOFONAUT.js → domain-handler-7PP7VYA7.js} +2 -2
  171. package/dist/cli/chunks/{domain-transfer-6JLNOYPA.js → domain-transfer-XZM44W7I.js} +2 -2
  172. package/dist/cli/chunks/dream-RPNWM7VS.js +2 -0
  173. package/dist/cli/chunks/{embed-and-insert-pattern-ZM75DQ4J.js → embed-and-insert-pattern-JZVERJ5L.js} +2 -2
  174. package/dist/cli/chunks/{eval-CYZJTHEB.js → eval-466NFF2D.js} +2 -2
  175. package/dist/cli/chunks/{experience-capture-middleware-RBOJLDUB.js → experience-capture-middleware-I7IQCC7V.js} +3 -3
  176. package/dist/cli/chunks/{fast-paths-S5BWZR3L.js → fast-paths-34OICNZA.js} +2 -2
  177. package/dist/cli/chunks/{feature-flags-6E7H3NYP.js → feature-flags-6UBIVTAD.js} +2 -2
  178. package/dist/cli/chunks/{feature-flags-DUNQPDU3.js → feature-flags-X5WBBWSO.js} +2 -2
  179. package/dist/cli/chunks/{file-discovery-PFFKDGYG.js → file-discovery-NLMDBWXX.js} +2 -2
  180. package/dist/cli/chunks/{fleet-RCDZZFXN.js → fleet-W7CYCHDI.js} +3 -3
  181. package/dist/cli/chunks/{gnn-wrapper-5AG3WDWF.js → gnn-wrapper-K4VTAG5X.js} +2 -2
  182. package/dist/cli/chunks/{heartbeat-handler-O2KAEX4Y.js → heartbeat-handler-ZGKF2Z6T.js} +4 -4
  183. package/dist/cli/chunks/heartbeat-scheduler-JBCXMMZO.js +2 -0
  184. package/dist/cli/chunks/hnsw-adapter-3SC2HZIG.js +2 -0
  185. package/dist/cli/chunks/hnsw-index-FQORAR6K.js +2 -0
  186. package/dist/cli/chunks/{hnsw-legacy-bridge-C7FG6YGW.js → hnsw-legacy-bridge-ELDRLKK5.js} +2 -2
  187. package/dist/cli/chunks/{better-sqlite3-XGPW4HK5.js → hnswlib-node-ZGSUMHDC.js} +2 -2
  188. package/dist/cli/chunks/{hooks-FUHNE2P7.js → hooks-T4CBINAV.js} +13 -13
  189. package/dist/cli/chunks/hybrid-router-6CBFDXPR.js +2 -0
  190. package/dist/cli/chunks/{hypergraph-engine-LQRYBNPV.js → hypergraph-engine-UWFW3XP5.js} +2 -2
  191. package/dist/cli/chunks/{hypergraph-handler-AFFNLZVD.js → hypergraph-handler-PK2BI46K.js} +3 -3
  192. package/dist/cli/chunks/impact-analyzer-SOEFVZWG.js +2 -0
  193. package/dist/cli/chunks/{init-handler-BQ6IDBX4.js → init-handler-HNG6KJOU.js} +6 -6
  194. package/dist/cli/chunks/init-wizard-3E4IU5M4.js +2 -0
  195. package/dist/cli/chunks/kernel-GFZP4G5J.js +2 -0
  196. package/dist/cli/chunks/{kilocode-installer-KS72HUSG.js → kilocode-installer-25V7FEJ4.js} +2 -2
  197. package/dist/cli/chunks/{kiro-installer-2ZEFLGRX.js → kiro-installer-7RMTTCQB.js} +2 -2
  198. package/dist/cli/chunks/knowledge-graph-BKRKBU26.js +2 -0
  199. package/dist/cli/chunks/{learning-GGHGJ6B6.js → learning-XQC2MG2R.js} +3 -3
  200. package/dist/cli/chunks/{llm-router-LP6K5BJF.js → llm-router-6KTTONH4.js} +4 -4
  201. package/dist/cli/chunks/llm-router-service-KE4IGZPP.js +2 -0
  202. package/dist/cli/chunks/{load-2MLKXOT2.js → load-BV64P3AL.js} +2 -2
  203. package/dist/cli/chunks/load-test-VSYJV2AO.js +2 -0
  204. package/dist/cli/chunks/{mcp-CDJBJG5H.js → mcp-U5ZN77TA.js} +2 -2
  205. package/dist/cli/chunks/{memory-4LAX7JZS.js → memory-WB5BNBK7.js} +5 -5
  206. package/dist/cli/chunks/memory-backend-B72RGHRF.js +2 -0
  207. package/dist/cli/chunks/{memory-handlers-OBAFR4WV.js → memory-handlers-NWCH7AUO.js} +2 -2
  208. package/dist/cli/chunks/{multi-model-executor-SLJV73HE.js → multi-model-executor-3X3W3UTY.js} +2 -2
  209. package/dist/cli/chunks/{opencode-installer-M76SONWV.js → opencode-installer-TTTMG7ZZ.js} +2 -2
  210. package/dist/cli/chunks/{orchestrator-TJPUDJMP.js → orchestrator-BLCGSHMZ.js} +18 -18
  211. package/dist/cli/chunks/{pipeline-2PVNFT6J.js → pipeline-DZPGMRG7.js} +2 -2
  212. package/dist/cli/chunks/{platform-KCSEDKEE.js → platform-EVMZAUNV.js} +2 -2
  213. package/dist/cli/chunks/{plugin-QX47QF5U.js → plugin-OR55K4HT.js} +2 -2
  214. package/dist/cli/chunks/{prime-radiant-advanced-wasm-L6VWL7VR.js → prime-radiant-advanced-wasm-4ODV27HD.js} +2 -2
  215. package/dist/cli/chunks/protocol-executor-V3F37FPO.js +2 -0
  216. package/dist/cli/chunks/{protocol-handler-WDNJDEUE.js → protocol-handler-ZOTI5PID.js} +2 -2
  217. package/dist/cli/chunks/{prove-3B75DA3S.js → prove-DIMBYJ7V.js} +2 -2
  218. package/dist/cli/chunks/provider-manager-2PN72TT6.js +2 -0
  219. package/dist/cli/chunks/qe-reasoning-bank-P665QNIR.js +2 -0
  220. package/dist/cli/chunks/{quality-UGASS5WM.js → quality-7MX4VL6M.js} +2 -2
  221. package/dist/cli/chunks/queen-coordinator-XD4F7BGB.js +2 -0
  222. package/dist/cli/chunks/{real-embeddings-COBP2LHS.js → real-embeddings-YPUHWRN2.js} +2 -2
  223. package/dist/cli/chunks/{roocode-installer-TOZ4VLFT.js → roocode-installer-WG5AU4QM.js} +2 -2
  224. package/dist/cli/chunks/router-4SSNWDJC.js +2 -0
  225. package/dist/cli/chunks/routing-feedback-O2JSIBW6.js +2 -0
  226. package/dist/cli/chunks/{routing-handler-5TDVSILX.js → routing-handler-LZB4MN2K.js} +2 -2
  227. package/dist/cli/chunks/{ruvector-commands-AM63KWQN.js → ruvector-commands-YE4ADBMC.js} +2 -2
  228. package/dist/cli/chunks/{rvf-dual-writer-UANIFE2M.js → rvf-dual-writer-QS5ATW4C.js} +2 -2
  229. package/dist/cli/chunks/{rvf-migration-adapter-LNPYWAPI.js → rvf-migration-adapter-YIGKSBD3.js} +2 -2
  230. package/dist/cli/chunks/{rvf-migration-coordinator-U47L63DQ.js → rvf-migration-coordinator-2NDCWP7F.js} +2 -2
  231. package/dist/cli/chunks/rvf-native-adapter-WIUHYXRB.js +2 -0
  232. package/dist/cli/chunks/safe-db-WL5Y7ZNS.js +2 -0
  233. package/dist/cli/chunks/schedule-U7QDGU5A.js +2 -0
  234. package/dist/cli/chunks/scheduler-LXKGQYXA.js +2 -0
  235. package/dist/cli/chunks/{security-KDQ2AH7G.js → security-HT4SUT24.js} +3 -3
  236. package/dist/cli/chunks/{shared-rvf-adapter-5MAGLLYJ.js → shared-rvf-adapter-4IZOJL33.js} +2 -2
  237. package/dist/cli/chunks/{shared-rvf-dual-writer-GF2OPPM5.js → shared-rvf-dual-writer-ZKFO7CBY.js} +2 -2
  238. package/dist/cli/chunks/sqlite-persistence-4KFO3SEB.js +2 -0
  239. package/dist/cli/chunks/{status-handler-XZKEL7LO.js → status-handler-AMEMKBI4.js} +2 -2
  240. package/dist/cli/chunks/{structural-health-27QKWW25.js → structural-health-RBADRLC3.js} +2 -2
  241. package/dist/cli/chunks/{sync-V3HGPEJT.js → sync-ARDDLQBS.js} +2 -2
  242. package/dist/cli/chunks/{sync-INNKS6UK.js → sync-PCB23M4K.js} +2 -2
  243. package/dist/cli/chunks/{task-handler-LDUVOM6G.js → task-handler-J26FSCH5.js} +2 -2
  244. package/dist/cli/chunks/{task-handlers-HTCPV7OO.js → task-handlers-AQRLR6BL.js} +3 -3
  245. package/dist/cli/chunks/{test-PCUVGVJL.js → test-YXWSIOSB.js} +4 -4
  246. package/dist/cli/chunks/{test-scheduling-GYVXWCAA.js → test-scheduling-XY532GI4.js} +3 -3
  247. package/dist/cli/chunks/{token-bootstrap-MJ2ANC4P.js → token-bootstrap-KL2QIQ36.js} +2 -2
  248. package/dist/cli/chunks/{token-usage-ZREHROTF.js → token-usage-2MJVE4DT.js} +2 -2
  249. package/dist/cli/chunks/{transformers-6B3FWFYL.js → transformers-QSNTOD2Z.js} +2 -2
  250. package/dist/cli/chunks/{tree-sitter-wasm-parser-JVV234MN.js → tree-sitter-wasm-parser-QJOKHOIW.js} +2 -2
  251. package/dist/cli/chunks/{types-MVZTJI2F.js → types-RNKRSYMO.js} +2 -2
  252. package/dist/cli/chunks/unified-memory-7AS4LIEF.js +2 -0
  253. package/dist/cli/chunks/unified-memory-hnsw-GREESNJX.js +2 -0
  254. package/dist/cli/chunks/unified-persistence-BPJOMZOA.js +2 -0
  255. package/dist/cli/chunks/{upgrade-MKTFEILD.js → upgrade-EKJHIFWP.js} +2 -2
  256. package/dist/cli/chunks/{validate-IABGALSW.js → validate-KS4T7LWC.js} +2 -2
  257. package/dist/cli/chunks/{validate-swarm-RHF53RF6.js → validate-swarm-SKKWRP2H.js} +2 -2
  258. package/dist/cli/chunks/{vibium-RAKW6FMF.js → vibium-FLUQO4IF.js} +2 -2
  259. package/dist/cli/chunks/visual-security-BW662FHQ.js +2 -0
  260. package/dist/cli/chunks/{web-tree-sitter-PYK7F4JZ.js → web-tree-sitter-UMC63DWD.js} +2 -2
  261. package/dist/cli/chunks/{windsurf-installer-S3U2HWZ4.js → windsurf-installer-V3FQGJIQ.js} +2 -2
  262. package/dist/cli/chunks/{witness-chain-435NKQLB.js → witness-chain-GE74TLSO.js} +2 -2
  263. package/dist/cli/chunks/witness-chain-OXVDLNVT.js +2 -0
  264. package/dist/cli/chunks/{workflow-5UHJCZ6J.js → workflow-4YZ2RPWA.js} +4 -4
  265. package/dist/cli/chunks/workflow-orchestrator-KKNR46XV.js +2 -0
  266. package/dist/cli/chunks/{wrappers-RD3NCMLK.js → wrappers-37NLMKPE.js} +2 -2
  267. package/dist/cli/commands/hooks-handlers/command-hooks.js +1 -1
  268. package/dist/cli/commands/hooks-handlers/routing-hooks.js +1 -1
  269. package/dist/cli/commands/hooks-handlers/task-hooks.js +1 -1
  270. package/dist/init/init-wizard-hooks.js +271 -271
  271. package/dist/init/phases/07-hooks.d.ts +7 -0
  272. package/dist/init/phases/07-hooks.js +132 -96
  273. package/dist/learning/agent-routing.d.ts +19 -0
  274. package/dist/learning/agent-routing.js +27 -1
  275. package/dist/learning/dream/dream-scheduler.d.ts +11 -36
  276. package/dist/learning/dream/dream-scheduler.js +44 -0
  277. package/dist/learning/experience-consolidation.d.ts +16 -0
  278. package/dist/learning/experience-consolidation.js +55 -11
  279. package/dist/learning/pattern-lifecycle.d.ts +21 -0
  280. package/dist/learning/pattern-lifecycle.js +70 -6
  281. package/dist/mcp/bundle.js +352 -349
  282. package/dist/mcp/protocol-server.js +13 -14
  283. package/dist/mcp/transport/stdio.d.ts +20 -0
  284. package/dist/mcp/transport/stdio.js +35 -2
  285. package/dist/shared/utils/rabitq.d.ts +133 -0
  286. package/dist/shared/utils/rabitq.js +201 -0
  287. package/package.json +8 -2
  288. package/dist/cli/chunks/adapter-3JS2CN7C.js +0 -2
  289. package/dist/cli/chunks/aqe-learning-engine-Q4GFNGU6.js +0 -2
  290. package/dist/cli/chunks/base-Q3MAL22Y.js +0 -2
  291. package/dist/cli/chunks/browser-workflow-JX3M2UWG.js +0 -2
  292. package/dist/cli/chunks/chunk-IJ4BUSJN.js +0 -95
  293. package/dist/cli/chunks/chunk-VPCE5CIT.js +0 -2
  294. package/dist/cli/chunks/chunk-WO7KYT3X.js +0 -62
  295. package/dist/cli/chunks/client-PA3UJIHH.js +0 -2
  296. package/dist/cli/chunks/cross-domain-router-BVJRP2ZX.js +0 -2
  297. package/dist/cli/chunks/dream-BXZUEIW2.js +0 -2
  298. package/dist/cli/chunks/heartbeat-scheduler-LEKAWFJF.js +0 -2
  299. package/dist/cli/chunks/hnsw-adapter-2TCEG5M2.js +0 -2
  300. package/dist/cli/chunks/hnsw-index-VDPUTEES.js +0 -2
  301. package/dist/cli/chunks/hybrid-router-2EMDIYIG.js +0 -2
  302. package/dist/cli/chunks/impact-analyzer-HFD6CPWC.js +0 -2
  303. package/dist/cli/chunks/init-wizard-552QIVRC.js +0 -2
  304. package/dist/cli/chunks/kernel-5DN6O6EE.js +0 -2
  305. package/dist/cli/chunks/knowledge-graph-76Y77MB6.js +0 -2
  306. package/dist/cli/chunks/llm-router-service-4O6GCEFH.js +0 -2
  307. package/dist/cli/chunks/load-test-FCI2IWRJ.js +0 -2
  308. package/dist/cli/chunks/memory-backend-MKNCBNDE.js +0 -2
  309. package/dist/cli/chunks/protocol-executor-IA7WNT23.js +0 -2
  310. package/dist/cli/chunks/provider-manager-3K5KB5A6.js +0 -2
  311. package/dist/cli/chunks/qe-reasoning-bank-V5Z3BBYY.js +0 -2
  312. package/dist/cli/chunks/queen-coordinator-QOMPA27Z.js +0 -2
  313. package/dist/cli/chunks/router-P5RZUPC4.js +0 -2
  314. package/dist/cli/chunks/routing-feedback-3PS3OZQC.js +0 -2
  315. package/dist/cli/chunks/rvf-native-adapter-TT7OJPKM.js +0 -2
  316. package/dist/cli/chunks/safe-db-PEW7VBAE.js +0 -2
  317. package/dist/cli/chunks/schedule-QHOTHBQE.js +0 -2
  318. package/dist/cli/chunks/scheduler-KXJBYTRT.js +0 -2
  319. package/dist/cli/chunks/sqlite-persistence-TPXJK34J.js +0 -2
  320. package/dist/cli/chunks/unified-memory-ROS2NKR5.js +0 -2
  321. package/dist/cli/chunks/unified-memory-hnsw-FLEUF3XO.js +0 -2
  322. package/dist/cli/chunks/unified-persistence-QC5L7UNQ.js +0 -2
  323. package/dist/cli/chunks/visual-security-NLIOUQCR.js +0 -2
  324. package/dist/cli/chunks/witness-chain-U7X6JX5J.js +0 -2
  325. package/dist/cli/chunks/workflow-orchestrator-APE6BAXH.js +0 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,82 @@ 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.10.2] - 2026-06-02
9
+
10
+ Self-learning hardening release with two critical hook/dream fixes reported by users.
11
+
12
+ ### Fixed
13
+
14
+ - **Task trajectories were silently recorded as failed (#508).** The
15
+ `aqe init`-generated PostToolUse hook ran `post-task … --success --json`, but
16
+ `--success` was declared as a value-taking option, so Commander consumed the
17
+ following `--json` as the success value — every `qe_trajectories` /
18
+ `captured_experiences` row was written with `success=0`, and no `--agent` was
19
+ passed so each row recorded `agent='unknown'`. Because pattern distillation
20
+ groups by agent/domain/success, Task-tool trajectories were **unpromotable**
21
+ and the pattern count stayed pinned near zero. The `--success` option is now
22
+ optional-valued (a bare `--success` parses `true`), and the generated hook
23
+ passes real agent attribution + description. **Existing installs:** re-run
24
+ `aqe init` (it detects and replaces AQE hooks) to pick up the corrected hook.
25
+ - **Dream-scheduler SessionStart readout was perpetually stale (#509).** After
26
+ ADR-094 moved dream cycles to the kernel scheduler, the `dream-scheduler:hook-state`
27
+ row that SessionStart reads was only ever incremented by the post-task hook and
28
+ never reset by the entity that dreams — so `lastDreamTime` stayed `null` and the
29
+ pending-experiences counter grew without bound. The kernel `DreamScheduler` now
30
+ reconciles that row after each successful cycle.
31
+ - **MCP unknown-tool errors lost their JSON-RPC code.** A `tools/call` for an
32
+ unknown tool surfaced `Internal error: [object Object]` instead of a proper
33
+ JSON-RPC `-32601`; now returns the correct coded error.
34
+ - **Failure-based pattern deprecation never fired.** `checkDeprecation` read a
35
+ `consecutive_failures` column that the row mapper dropped, so a pattern that
36
+ kept failing was never deprecated for failures. The column is now surfaced.
37
+ - **Routing confidence was diluted by broad domain detection.** The domain-match
38
+ score divided by the full count of *detected* domains (7–12 per task), washing
39
+ out real matches; the denominator is now capped, recovering confidence on
40
+ broad multi-domain tasks (tunable, ranking preserved).
41
+
42
+ ### Added
43
+
44
+ - **Importance-weighted forgetting protection (EWC++).** Confidence decay and
45
+ stale/age deprecation are now weighted by pattern importance (success rate ×
46
+ usage), so proven high-value patterns resist being crowded out by an influx of
47
+ new low-value ones. Reversible via exported constants; low-importance patterns
48
+ are unaffected.
49
+ - **Contradiction detection in consolidation.** Two experiences with the same
50
+ context but opposite outcomes are no longer merged — the lower-quality loser is
51
+ suppressed from retrieval (even if previously applied) so it can't poison recall.
52
+ - **Self-learning verification harness** (`npm run benchmark:self-learning`) —
53
+ proves the learning stores actually persist what they claim, survive a restart,
54
+ and that aggregators agree, with an isolated-temp-store negative control.
55
+ - **Real MCP protocol + tool-parity smokes** (`npm run mcp:validate`,
56
+ `npm run mcp:parity`) — boot the real server and validate the `initialize` /
57
+ `tools/list` handshake against the MCP spec; replaces the previous no-op
58
+ `mcp:validate`.
59
+ - **Resilient hook shim** (`.claude/hooks/aqe-hook.sh`) — keeps init diagnostics
60
+ out of the Claude Code transcript and guarantees a hook never blocks a turn.
61
+ - **Pretrain-from-history bootstrap** (`npm run pretrain:history`) — seeds the
62
+ pattern store from the repo's own git commits so a fresh project starts
63
+ non-empty and project-specific.
64
+ - **RaBitQ 1-bit signature utility** (`src/shared/utils/rabitq.ts`,
65
+ `npm run benchmark:rabitq`) — 32× index-memory reduction for vector similarity
66
+ (utility only; not yet wired into a retrieval path).
67
+ - **Plugin contract smoke** (`npm run plugin:smoke`) — machine-checkable
68
+ structural contract for the `agentic-qe-fleet` marketplace bundle.
69
+ - **ADR-098** documenting the learning-store & routing hardening decisions.
70
+
71
+ ### Changed
72
+
73
+ - **`aqe init` now installs a resilient hook shim and routes hooks through it.**
74
+ A cross-platform Node shim (`.claude/hooks/aqe-hook.cjs`) is copied into each
75
+ project, and generated `settings.json` hooks run
76
+ `node .../aqe-hook.cjs <cmd>` instead of `npx agentic-qe hooks <cmd>`. The
77
+ shim keeps init diagnostics out of the Claude Code transcript, guarantees a
78
+ hook never blocks a turn, prefers the project-local install (falling back to
79
+ `npx` for npx-only setups). Re-running `aqe init` migrates existing `npx`-based
80
+ hooks to the shim form (no duplicates).
81
+ - Router state-encoding hardened with a regression guard (audit of two upstream
82
+ router bugs — confirmed not present in AQE).
83
+
8
84
  ## [3.10.1] - 2026-05-22
9
85
 
10
86
  ### Changed — behavioral
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
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.10.1");process.exit(0)}
3
- import{a as y}from"./chunks/chunk-Y2DPXMOR.js";import{a as f,c as A}from"./chunks/chunk-2TDWCXZ6.js";import"./chunks/chunk-4AWJ5PE4.js";A();import{Command as P}from"commander";import m from"chalk";function h(e,i,a,s){let l=e.command(i).description(a);if(s)for(let u of s)l.alias(u);return l.helpOption(!1),l.allowUnknownOption(!0),l.allowExcessArguments(!0),l}function w(e,i){let a=e.commands,s=a.indexOf(i);s>=0&&a.splice(s,1)}function o(e,i){let a=h(e,i.name,i.description,i.aliases);a.action(async()=>{try{let s=await i.factory();w(e,a),e.addCommand(s),await e.parseAsync(process.argv)}catch(s){console.error(`Failed to load command '${i.name}':`,s instanceof Error?s.message:s),process.exit(1)}})}function d(e,i,a,s,l,u){let g=h(e,i,a,u);g.action(async()=>{try{let p=await s();w(e,g),p.register(e,l),await e.parseAsync(process.argv)}catch(p){console.error(`Failed to load command '${i}':`,p instanceof Error?p.message:p),process.exit(1)}})}var S=["[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]"],I=/^\[\d{2}:\d{2}:\d{2}\.\d{3}\]\s+\[/,b=console.log.bind(console);console.log=(...e)=>{let a=(typeof e[0]=="string"?e[0]:"").trimStart();if(S.some(s=>a.startsWith(s))||I.test(a)){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.10.2");process.exit(0)}
3
+ import{a as y}from"./chunks/chunk-FPAW77XV.js";import{a as f,c as A}from"./chunks/chunk-XPCNUX2U.js";import"./chunks/chunk-ORF2UKQH.js";A();import{Command as P}from"commander";import m from"chalk";function h(e,i,a,s){let l=e.command(i).description(a);if(s)for(let u of s)l.alias(u);return l.helpOption(!1),l.allowUnknownOption(!0),l.allowExcessArguments(!0),l}function w(e,i){let a=e.commands,s=a.indexOf(i);s>=0&&a.splice(s,1)}function o(e,i){let a=h(e,i.name,i.description,i.aliases);a.action(async()=>{try{let s=await i.factory();w(e,a),e.addCommand(s),await e.parseAsync(process.argv)}catch(s){console.error(`Failed to load command '${i.name}':`,s instanceof Error?s.message:s),process.exit(1)}})}function d(e,i,a,s,l,u){let g=h(e,i,a,u);g.action(async()=>{try{let p=await s();w(e,g),p.register(e,l),await e.parseAsync(process.argv)}catch(p){console.error(`Failed to load command '${i}':`,p instanceof Error?p.message:p),process.exit(1)}})}var S=["[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]"],I=/^\[\d{2}:\d{2}:\d{2}\.\d{3}\]\s+\[/,b=console.log.bind(console);console.log=(...e)=>{let a=(typeof e[0]=="string"?e[0]:"").trimStart();if(S.some(s=>a.startsWith(s))||I.test(a)){process.stderr.write(e.map(String).join(" ")+`
4
4
  `);return}b(...e)};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,i){let a=e.getDomainAPI("visual-accessibility");if(a?.registerWorkflowActions)try{a.registerWorkflowActions(i)}catch(l){console.error(m.yellow(` Warning: Could not register visual-accessibility workflow actions: ${f(l)}`))}let s=e.getDomainAPI("requirements-validation");if(s?.registerWorkflowActions)try{s.registerWorkflowActions(i)}catch(l){console.error(m.yellow(` Warning: Could not register requirements-validation workflow actions: ${f(l)}`))}}async function D(){let{QEKernelImpl:e}=await import("./chunks/kernel-5DN6O6EE.js"),{CrossDomainEventRouter:i}=await import("./chunks/cross-domain-router-BVJRP2ZX.js"),{DefaultProtocolExecutor:a}=await import("./chunks/protocol-executor-IA7WNT23.js"),{WorkflowOrchestrator:s}=await import("./chunks/workflow-orchestrator-APE6BAXH.js"),{createQueenCoordinator:l}=await import("./chunks/queen-coordinator-QOMPA27Z.js"),{createPersistentScheduler:u}=await import("./chunks/scheduler-KXJBYTRT.js");t.kernel=new e({maxConcurrentAgents:15,memoryBackend:"sqlite",hnswEnabled:!0,lazyLoading:!0,enabledDomains:[...y],enableExperienceBridge:!1}),await t.kernel.initialize(),t.router=new i(t.kernel.eventBus),await t.router.initialize();let g=E=>t.kernel.getDomainAPI(E),p=new a(t.kernel.eventBus,t.kernel.memory,g);t.workflowOrchestrator=new s(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"),a=(await import("path")).resolve(".agentic-qe");return e.existsSync(a)?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,i){let a=e.getDomainAPI("visual-accessibility");if(a?.registerWorkflowActions)try{a.registerWorkflowActions(i)}catch(l){console.error(m.yellow(` Warning: Could not register visual-accessibility workflow actions: ${f(l)}`))}let s=e.getDomainAPI("requirements-validation");if(s?.registerWorkflowActions)try{s.registerWorkflowActions(i)}catch(l){console.error(m.yellow(` Warning: Could not register requirements-validation workflow actions: ${f(l)}`))}}async function D(){let{QEKernelImpl:e}=await import("./chunks/kernel-GFZP4G5J.js"),{CrossDomainEventRouter:i}=await import("./chunks/cross-domain-router-4K5ZVZEZ.js"),{DefaultProtocolExecutor:a}=await import("./chunks/protocol-executor-V3F37FPO.js"),{WorkflowOrchestrator:s}=await import("./chunks/workflow-orchestrator-KKNR46XV.js"),{createQueenCoordinator:l}=await import("./chunks/queen-coordinator-XD4F7BGB.js"),{createPersistentScheduler:u}=await import("./chunks/scheduler-LXKGQYXA.js");t.kernel=new e({maxConcurrentAgents:15,memoryBackend:"sqlite",hnswEnabled:!0,lazyLoading:!0,enabledDomains:[...y],enableExperienceBridge:!1}),await t.kernel.initialize(),t.router=new i(t.kernel.eventBus),await t.router.initialize();let g=E=>t.kernel.getDomainAPI(E),p=new a(t.kernel.eventBus,t.kernel.memory,g);t.workflowOrchestrator=new s(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"),a=(await import("path")).resolve(".agentic-qe");return e.existsSync(a)?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,i=new Promise((a,s)=>{setTimeout(()=>s(new Error("Initialization timeout after 30 seconds")),e)});try{return await Promise.race([D(),i]),process.stderr.write(m.green("System ready")+`
8
8
 
9
- `),!0}catch(a){return a.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:"),a),console.log(m.yellow("Try running `aqe init` manually."))),!1}}async function r(e=0){try{t.workflowOrchestrator&&t.workflowOrchestrator.dispose().catch(()=>{}),t.queen&&t.queen.dispose().catch(()=>{}),t.router&&t.router.dispose().catch(()=>{}),t.kernel&&t.kernel.dispose().catch(()=>{})}catch{}process.exit(e)}var n=new P,v="3.10.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-BQ6IDBX4.js").then(e=>e.createInitHandler(r)),t);d(n,"status","Show system status",()=>import("./chunks/status-handler-XZKEL7LO.js").then(e=>e.createStatusHandler(r,k)),t);d(n,"health","Check system health",()=>import("./chunks/status-handler-XZKEL7LO.js").then(e=>e.createHealthHandler(r,k)),t);d(n,"task","Manage QE tasks",()=>import("./chunks/task-handler-LDUVOM6G.js").then(e=>e.createTaskHandler(r,c)),t);d(n,"agent","Manage QE agents",()=>import("./chunks/agent-handler-KAGRVCKS.js").then(e=>e.createAgentHandler(r,c)),t);d(n,"domain","Domain operations",()=>import("./chunks/domain-handler-UOFONAUT.js").then(e=>e.createDomainHandler(r,c)),t);d(n,"protocol","Execute coordination protocols",()=>import("./chunks/protocol-handler-WDNJDEUE.js").then(e=>e.createProtocolHandler(r,c)),t);d(n,"brain","Export, import, and inspect QE brain state",()=>import("./chunks/brain-handler-O7MP5BGY.js").then(e=>e.createBrainHandler(r,c)),t);d(n,"hypergraph","Query the code knowledge hypergraph",()=>import("./chunks/hypergraph-handler-AFFNLZVD.js").then(e=>e.createHypergraphHandler(r,c)),t,["hg"]);d(n,"heartbeat","Manage the token-free heartbeat scheduler",()=>import("./chunks/heartbeat-handler-O2KAEX4Y.js").then(e=>e.createHeartbeatHandler(r)),t);d(n,"routing","View routing performance, economics, and accuracy",()=>import("./chunks/routing-handler-5TDVSILX.js").then(e=>e.createRoutingHandler(r)),t);o(n,{name:"workflow",description:"Manage QE workflows and pipelines (ADR-041)",factory:()=>import("./chunks/workflow-5UHJCZ6J.js").then(e=>e.createWorkflowCommand(t,r,c))});o(n,{name:"test",description:"Test generation, execution, scheduling, and load testing",factory:()=>import("./chunks/test-PCUVGVJL.js").then(e=>e.createTestCommand(t,r,c))});o(n,{name:"coverage",description:"Coverage analysis shortcut",factory:()=>import("./chunks/coverage-TD37CYSY.js").then(e=>e.createCoverageCommand(t,r,c))});o(n,{name:"quality",description:"Quality assessment shortcut",factory:()=>import("./chunks/quality-UGASS5WM.js").then(e=>e.createQualityCommand(t,r,c))});o(n,{name:"security",description:"Security scanning and URL validation",factory:()=>import("./chunks/security-KDQ2AH7G.js").then(e=>e.createSecurityCommand(t,r,c))});o(n,{name:"code",description:"Code intelligence analysis",factory:()=>import("./chunks/code-L7KRLU5E.js").then(e=>e.createCodeCommand(t,r,c))});o(n,{name:"completions",description:"Generate shell completions for aqe",factory:()=>import("./chunks/completions-3JZQRNB6.js").then(e=>e.createCompletionsCommand(r))});o(n,{name:"upgrade",description:"Detect optional native bindings and recommend install / flag changes",factory:()=>import("./chunks/upgrade-MKTFEILD.js").then(e=>e.createUpgradeCommand(r))});o(n,{name:"fleet",description:"Fleet operations with multi-agent progress tracking",factory:()=>import("./chunks/fleet-RCDZZFXN.js").then(e=>e.createFleetCommand(t,r,c,C))});o(n,{name:"validate",description:"Validation commands for skills and agents",factory:()=>import("./chunks/validate-swarm-RHF53RF6.js").then(e=>e.createValidateSwarmCommand(t,r,c))});o(n,{name:"skill",description:"Skill validation and reporting (ADR-056)",factory:()=>import("./chunks/validate-IABGALSW.js").then(e=>e.createValidateCommand(t,r,c))});o(n,{name:"eval",description:"Run skill evaluation suites in parallel",factory:()=>import("./chunks/eval-CYZJTHEB.js").then(e=>e.createEvalCommand())});o(n,{name:"ci",description:"CI/CD pipeline orchestration",factory:()=>import("./chunks/ci-EHRUN7O6.js").then(e=>e.createCICommand(t,r,c))});o(n,{name:"token-usage",description:"View and analyze token consumption metrics (ADR-042)",factory:()=>import("./chunks/token-usage-ZREHROTF.js").then(e=>e.createTokenUsageCommand())});o(n,{name:"llm",description:"LLM Router management (ADR-043)",factory:()=>import("./chunks/llm-router-LP6K5BJF.js").then(e=>e.createLLMRouterCommand())});o(n,{name:"sync",description:"Sync local learning data to cloud PostgreSQL",factory:()=>import("./chunks/sync-INNKS6UK.js").then(e=>e.createSyncCommands())});o(n,{name:"hooks",description:"Self-learning QE hooks for pattern recognition and guidance",factory:()=>import("./chunks/hooks-FUHNE2P7.js").then(e=>e.createHooksCommand())});o(n,{name:"learning",description:"AQE self-learning system management (standalone, no claude-flow required)",factory:()=>import("./chunks/learning-GGHGJ6B6.js").then(e=>e.createLearningCommand())});o(n,{name:"memory",description:"Memory store, retrieve, search, and delete operations",factory:()=>import("./chunks/memory-4LAX7JZS.js").then(e=>e.createMemoryCommand(t,r,c))});o(n,{name:"mcp",description:"Start the MCP protocol server for Claude Code integration",factory:()=>import("./chunks/mcp-CDJBJG5H.js").then(e=>e.createMcpCommand())});o(n,{name:"platform",description:"Manage coding agent platform configurations",factory:()=>import("./chunks/platform-KCSEDKEE.js").then(e=>e.createPlatformCommand())});o(n,{name:"prove",description:"Generate a verifiable Proof-of-Quality attestation",factory:()=>import("./chunks/prove-3B75DA3S.js").then(e=>e.createProveCommand(t,r,c))});o(n,{name:"ruvector",description:"RuVector integration management",factory:()=>import("./chunks/ruvector-commands-AM63KWQN.js").then(e=>e.createRuVectorCommand())});o(n,{name:"audit",description:"Witness chain audit trail management",factory:()=>import("./chunks/audit-DN5SY4JJ.js").then(e=>e.createAuditCommand(t,r,c))});o(n,{name:"pipeline",description:"Manage YAML deterministic pipelines (Imp-9)",factory:()=>import("./chunks/pipeline-2PVNFT6J.js").then(e=>e.createPipelineCommand(t,r,c))});o(n,{name:"plugin",description:"Manage external QE domain plugins",factory:()=>import("./chunks/plugin-QX47QF5U.js").then(e=>e.createPluginCommand())});o(n,{name:"daemon",description:"Manage the QE Quality Daemon",factory:()=>import("./chunks/daemon-LYDV7NRW.js").then(e=>e.createDaemonCommand())});process.on("SIGINT",async()=>{console.log(m.yellow(`
9
+ `),!0}catch(a){return a.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:"),a),console.log(m.yellow("Try running `aqe init` manually."))),!1}}async function r(e=0){try{t.workflowOrchestrator&&t.workflowOrchestrator.dispose().catch(()=>{}),t.queen&&t.queen.dispose().catch(()=>{}),t.router&&t.router.dispose().catch(()=>{}),t.kernel&&t.kernel.dispose().catch(()=>{})}catch{}process.exit(e)}var n=new P,v="3.10.2";n.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(v);d(n,"init","Initialize the AQE v3 system",()=>import("./chunks/init-handler-HNG6KJOU.js").then(e=>e.createInitHandler(r)),t);d(n,"status","Show system status",()=>import("./chunks/status-handler-AMEMKBI4.js").then(e=>e.createStatusHandler(r,k)),t);d(n,"health","Check system health",()=>import("./chunks/status-handler-AMEMKBI4.js").then(e=>e.createHealthHandler(r,k)),t);d(n,"task","Manage QE tasks",()=>import("./chunks/task-handler-J26FSCH5.js").then(e=>e.createTaskHandler(r,c)),t);d(n,"agent","Manage QE agents",()=>import("./chunks/agent-handler-FPQVHGGT.js").then(e=>e.createAgentHandler(r,c)),t);d(n,"domain","Domain operations",()=>import("./chunks/domain-handler-7PP7VYA7.js").then(e=>e.createDomainHandler(r,c)),t);d(n,"protocol","Execute coordination protocols",()=>import("./chunks/protocol-handler-ZOTI5PID.js").then(e=>e.createProtocolHandler(r,c)),t);d(n,"brain","Export, import, and inspect QE brain state",()=>import("./chunks/brain-handler-ROZUHCOT.js").then(e=>e.createBrainHandler(r,c)),t);d(n,"hypergraph","Query the code knowledge hypergraph",()=>import("./chunks/hypergraph-handler-PK2BI46K.js").then(e=>e.createHypergraphHandler(r,c)),t,["hg"]);d(n,"heartbeat","Manage the token-free heartbeat scheduler",()=>import("./chunks/heartbeat-handler-ZGKF2Z6T.js").then(e=>e.createHeartbeatHandler(r)),t);d(n,"routing","View routing performance, economics, and accuracy",()=>import("./chunks/routing-handler-LZB4MN2K.js").then(e=>e.createRoutingHandler(r)),t);o(n,{name:"workflow",description:"Manage QE workflows and pipelines (ADR-041)",factory:()=>import("./chunks/workflow-4YZ2RPWA.js").then(e=>e.createWorkflowCommand(t,r,c))});o(n,{name:"test",description:"Test generation, execution, scheduling, and load testing",factory:()=>import("./chunks/test-YXWSIOSB.js").then(e=>e.createTestCommand(t,r,c))});o(n,{name:"coverage",description:"Coverage analysis shortcut",factory:()=>import("./chunks/coverage-JTOXZE3T.js").then(e=>e.createCoverageCommand(t,r,c))});o(n,{name:"quality",description:"Quality assessment shortcut",factory:()=>import("./chunks/quality-7MX4VL6M.js").then(e=>e.createQualityCommand(t,r,c))});o(n,{name:"security",description:"Security scanning and URL validation",factory:()=>import("./chunks/security-HT4SUT24.js").then(e=>e.createSecurityCommand(t,r,c))});o(n,{name:"code",description:"Code intelligence analysis",factory:()=>import("./chunks/code-E4Q6DGOO.js").then(e=>e.createCodeCommand(t,r,c))});o(n,{name:"completions",description:"Generate shell completions for aqe",factory:()=>import("./chunks/completions-2F7TUFBD.js").then(e=>e.createCompletionsCommand(r))});o(n,{name:"upgrade",description:"Detect optional native bindings and recommend install / flag changes",factory:()=>import("./chunks/upgrade-EKJHIFWP.js").then(e=>e.createUpgradeCommand(r))});o(n,{name:"fleet",description:"Fleet operations with multi-agent progress tracking",factory:()=>import("./chunks/fleet-W7CYCHDI.js").then(e=>e.createFleetCommand(t,r,c,C))});o(n,{name:"validate",description:"Validation commands for skills and agents",factory:()=>import("./chunks/validate-swarm-SKKWRP2H.js").then(e=>e.createValidateSwarmCommand(t,r,c))});o(n,{name:"skill",description:"Skill validation and reporting (ADR-056)",factory:()=>import("./chunks/validate-KS4T7LWC.js").then(e=>e.createValidateCommand(t,r,c))});o(n,{name:"eval",description:"Run skill evaluation suites in parallel",factory:()=>import("./chunks/eval-466NFF2D.js").then(e=>e.createEvalCommand())});o(n,{name:"ci",description:"CI/CD pipeline orchestration",factory:()=>import("./chunks/ci-PYCRCL7G.js").then(e=>e.createCICommand(t,r,c))});o(n,{name:"token-usage",description:"View and analyze token consumption metrics (ADR-042)",factory:()=>import("./chunks/token-usage-2MJVE4DT.js").then(e=>e.createTokenUsageCommand())});o(n,{name:"llm",description:"LLM Router management (ADR-043)",factory:()=>import("./chunks/llm-router-6KTTONH4.js").then(e=>e.createLLMRouterCommand())});o(n,{name:"sync",description:"Sync local learning data to cloud PostgreSQL",factory:()=>import("./chunks/sync-PCB23M4K.js").then(e=>e.createSyncCommands())});o(n,{name:"hooks",description:"Self-learning QE hooks for pattern recognition and guidance",factory:()=>import("./chunks/hooks-T4CBINAV.js").then(e=>e.createHooksCommand())});o(n,{name:"learning",description:"AQE self-learning system management (standalone, no claude-flow required)",factory:()=>import("./chunks/learning-XQC2MG2R.js").then(e=>e.createLearningCommand())});o(n,{name:"memory",description:"Memory store, retrieve, search, and delete operations",factory:()=>import("./chunks/memory-WB5BNBK7.js").then(e=>e.createMemoryCommand(t,r,c))});o(n,{name:"mcp",description:"Start the MCP protocol server for Claude Code integration",factory:()=>import("./chunks/mcp-U5ZN77TA.js").then(e=>e.createMcpCommand())});o(n,{name:"platform",description:"Manage coding agent platform configurations",factory:()=>import("./chunks/platform-EVMZAUNV.js").then(e=>e.createPlatformCommand())});o(n,{name:"prove",description:"Generate a verifiable Proof-of-Quality attestation",factory:()=>import("./chunks/prove-DIMBYJ7V.js").then(e=>e.createProveCommand(t,r,c))});o(n,{name:"ruvector",description:"RuVector integration management",factory:()=>import("./chunks/ruvector-commands-YE4ADBMC.js").then(e=>e.createRuVectorCommand())});o(n,{name:"audit",description:"Witness chain audit trail management",factory:()=>import("./chunks/audit-ALRYPHGP.js").then(e=>e.createAuditCommand(t,r,c))});o(n,{name:"pipeline",description:"Manage YAML deterministic pipelines (Imp-9)",factory:()=>import("./chunks/pipeline-DZPGMRG7.js").then(e=>e.createPipelineCommand(t,r,c))});o(n,{name:"plugin",description:"Manage external QE domain plugins",factory:()=>import("./chunks/plugin-OR55K4HT.js").then(e=>e.createPluginCommand())});o(n,{name:"daemon",description:"Manage the QE Quality Daemon",factory:()=>import("./chunks/daemon-K4QFB5FQ.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 x(){let{isVersionFastPath:e}=await import("./chunks/fast-paths-S5BWZR3L.js");e(process.argv)&&(console.log(v),process.exit(0));let{bootstrapTokenTracking:i}=await import("./chunks/token-bootstrap-MJ2ANC4P.js");await i({enableOptimization:!0,enablePersistence:!0,verbose:process.env.AQE_VERBOSE==="true"}),await n.parseAsync(),await r(0)}x().catch(async e=>{console.error(m.red("Fatal error:"),e),await r(1)});
13
+ Received SIGTERM, shutting down gracefully...`)),await r(0)});async function x(){let{isVersionFastPath:e}=await import("./chunks/fast-paths-34OICNZA.js");e(process.argv)&&(console.log(v),process.exit(0));let{bootstrapTokenTracking:i}=await import("./chunks/token-bootstrap-KL2QIQ36.js");await i({enableOptimization:!0,enablePersistence:!0,verbose:process.env.AQE_VERBOSE==="true"}),await n.parseAsync(),await r(0)}x().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.10.2");process.exit(0)}
2
+ import{a,b,c}from"./chunk-NZO4WUSO.js";import"./chunk-AWFIEGR3.js";import"./chunk-HJORBNXW.js";import"./chunk-SW4OKUTC.js";import"./chunk-XPCNUX2U.js";import"./chunk-ORF2UKQH.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
2
- import{a as x}from"./chunk-VPCE5CIT.js";import{c as f}from"./chunk-BGBSYF3K.js";import"./chunk-4AWJ5PE4.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.10.2");process.exit(0)}
2
+ import{a as x}from"./chunk-IAZEDWRX.js";import{c as f}from"./chunk-JF53LRBL.js";import"./chunk-ORF2UKQH.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
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
2
- import{b as p}from"./chunk-OC3OJWLB.js";import{a as g}from"./chunk-EO4B5GS4.js";import"./chunk-QNW335PD.js";import"./chunk-4AWJ5PE4.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.10.2");process.exit(0)}
2
+ import{b as p}from"./chunk-FO43SQXP.js";import{a as g}from"./chunk-MYWQTCS4.js";import"./chunk-SW4OKUTC.js";import"./chunk-ORF2UKQH.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(`
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
2
- import"./chunk-4AWJ5PE4.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};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.2");process.exit(0)}
2
+ import"./chunk-ORF2UKQH.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.10.2");process.exit(0)}
2
+ import{a,b,c,d,e,f}from"./chunk-EVCOCGVJ.js";import"./chunk-7Z46RDDV.js";import"./chunk-AV7KYE5P.js";import"./chunk-LQTWPSYL.js";import"./chunk-LZCBSFAU.js";import"./chunk-5PL7WTCU.js";import"./chunk-DMQPO43S.js";import"./chunk-THRTUW4Z.js";import"./chunk-ZGNZJJFF.js";import"./chunk-7DKYCVJI.js";import"./chunk-VSUTI4G6.js";import"./chunk-TJKDATEU.js";import"./chunk-SVYTN2GT.js";import"./chunk-AH7FXNFE.js";import"./chunk-L7VIX22Y.js";import"./chunk-5QHSLWLP.js";import"./chunk-SW4OKUTC.js";import"./chunk-CV2SBMBW.js";import"./chunk-IAZEDWRX.js";import"./chunk-JF53LRBL.js";import"./chunk-FPAW77XV.js";import"./chunk-XPCNUX2U.js";import"./chunk-AOI67HA3.js";import"./chunk-MCZHKXB4.js";import"./chunk-YI6GNRQM.js";import"./chunk-OXCEUR5F.js";import"./chunk-DRWGK3YO.js";import"./chunk-HHCYSAH3.js";import"./chunk-WNR2KAUH.js";import"./chunk-WDMPJ2M2.js";import"./chunk-IICTTDAA.js";import"./chunk-ON4D4TJ4.js";import"./chunk-ORF2UKQH.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
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
2
- import{d as c,e as u,f as h,g as m}from"./chunk-3YOPJ7DY.js";import{f as s,o as p}from"./chunk-Q24OJX44.js";import"./chunk-GXJ4BCGC.js";import"./chunk-QNW335PD.js";import"./chunk-VPCE5CIT.js";import"./chunk-BGBSYF3K.js";import"./chunk-2TDWCXZ6.js";import"./chunk-XRK7FBTY.js";import{p as l,q as d}from"./chunk-PLRSKAFZ.js";import"./chunk-GRG3OP34.js";import"./chunk-XKOKMS5A.js";import"./chunk-2ETDES5W.js";import"./chunk-MVGVD6LS.js";import"./chunk-25QGPRWN.js";import"./chunk-KRXKU54J.js";import"./chunk-ELZ67OHQ.js";import{g as f}from"./chunk-4AWJ5PE4.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.10.2");process.exit(0)}
2
+ import{d as c,e as u,f as h,g as m}from"./chunk-4GTDW2XL.js";import{f as s,o as p}from"./chunk-L7VIX22Y.js";import"./chunk-5QHSLWLP.js";import"./chunk-SW4OKUTC.js";import"./chunk-IAZEDWRX.js";import"./chunk-JF53LRBL.js";import"./chunk-XPCNUX2U.js";import"./chunk-MCZHKXB4.js";import{p as l,q as d}from"./chunk-YI6GNRQM.js";import"./chunk-OXCEUR5F.js";import"./chunk-DRWGK3YO.js";import"./chunk-HHCYSAH3.js";import"./chunk-WNR2KAUH.js";import"./chunk-WDMPJ2M2.js";import"./chunk-IICTTDAA.js";import"./chunk-ON4D4TJ4.js";import{g as f}from"./chunk-ORF2UKQH.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.10.2");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-UWXH2UQK.js";import"./chunk-G5U6Q42D.js";import"./chunk-L7VIX22Y.js";import"./chunk-5QHSLWLP.js";import"./chunk-SW4OKUTC.js";import"./chunk-IAZEDWRX.js";import"./chunk-JF53LRBL.js";import"./chunk-XPCNUX2U.js";import"./chunk-AOI67HA3.js";import"./chunk-MCZHKXB4.js";import"./chunk-YI6GNRQM.js";import"./chunk-OXCEUR5F.js";import"./chunk-DRWGK3YO.js";import"./chunk-HHCYSAH3.js";import"./chunk-WNR2KAUH.js";import"./chunk-WDMPJ2M2.js";import"./chunk-IICTTDAA.js";import"./chunk-ON4D4TJ4.js";import"./chunk-ORF2UKQH.js";export{j as MCPToolBase,i as defaultToolLogger,h as getLLMRouter,d as getMemoryBackend,f as getSharedLLMRouter,b as getSharedMemoryBackend,a as registerRvfResetFn,g as resetSharedLLMRouter,c as resetSharedMemoryBackend,e as setSharedLLMRouter};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.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-6A2NIR2E.js";import"./chunk-4AWJ5PE4.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};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.2");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-YI6GNRQM.js";import"./chunk-ORF2UKQH.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};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
2
- import{a as A,b as L,c as F,d as R,e as Y,f as T,g as P,h as C,i as j,j as X,k as V,l as ge,m as $,n as Z,o as ye,p as _,q as J,r as U,s as W}from"./chunk-DQIS6J77.js";import{h as pe}from"./chunk-AUVC3DDB.js";import"./chunk-Q24OJX44.js";import"./chunk-GXJ4BCGC.js";import{b as x,d as Q}from"./chunk-QNW335PD.js";import{a as fe,b as me,c as ue,d as k,f as We}from"./chunk-P7T5Y735.js";import"./chunk-VPCE5CIT.js";import"./chunk-BGBSYF3K.js";import"./chunk-2TDWCXZ6.js";import{a as O,b as Ue}from"./chunk-XRK7FBTY.js";import"./chunk-PLRSKAFZ.js";import"./chunk-GRG3OP34.js";import"./chunk-XKOKMS5A.js";import"./chunk-2ETDES5W.js";import"./chunk-MVGVD6LS.js";import"./chunk-25QGPRWN.js";import"./chunk-KRXKU54J.js";import"./chunk-ELZ67OHQ.js";import"./chunk-4AWJ5PE4.js";import B from"path";import o from"chalk";Ue();Q();import{existsSync as z,mkdirSync as ze,writeFileSync as He,readFileSync as ee}from"fs";import{join as E,resolve as ne}from"path";var Ke={rl_q_values:"includeQValues",dream_insights:"includeDreamInsights",dream_cycles:"includeDreamInsights",witness_chain:"includeWitnessChain",vectors:"includeVectors"};function Ge(e,n){let r=Ke[e.tableName];return!(r&&n[r]===!1)}var Qe=1e4;function Ye(e,n,r,t){if(!Ge(n,r))return Z(E(t,n.fileName),[]),{count:0,rows:[]};let[a,s]=n.domainColumn?$(r.domains,n.domainColumn):[void 0,[]];if(X(e,n.tableName,a,s)>=Qe){let d=n.blobColumns,c=d&&d.length>0?p=>T(p,d):void 0;return{count:ye(E(t,n.fileName),ge(e,n.tableName,a,s),c)}}let i=V(e,n.tableName,a,s);return n.blobColumns&&n.blobColumns.length>0&&(i=i.map(d=>T(d,n.blobColumns))),Z(E(t,n.fileName),i),{count:i.length,rows:i}}function be(e){let n=[];for(let r of R){let t=E(e,r.fileName);z(t)?n.push(C(ee(t,"utf-8"))):n.push(C(""))}return C(n.join(":"))}function he(e,n,r="memory.db"){let t=ne(n.outputPath);z(t)||ze(t,{recursive:!0});let a=0,s={},l=new Set;for(let u of R){let p=Ye(e,u,n,t);if(s[u.tableName]=p.count,a+=p.count,u.tableName==="qe_patterns"){if(p.rows)for(let f of p.rows)f.qe_domain&&l.add(f.qe_domain);else if(p.count>0){let[f,w]=u.domainColumn?$(n.domains,u.domainColumn):[void 0,[]],y=`SELECT DISTINCT qe_domain FROM qe_patterns ${f?`WHERE ${f} AND qe_domain IS NOT NULL`:"WHERE qe_domain IS NOT NULL"}`;try{let g=e.prepare(y).all(...w||[]);for(let v of g)l.add(v.qe_domain)}catch{}}}}let i=n.includeVectors!==!1?X(e,"vectors"):0,d=be(t),c={version:"3.0",exportedAt:new Date().toISOString(),sourceDb:r,stats:{patternCount:s.qe_patterns||0,vectorCount:i,qValueCount:s.rl_q_values||0,dreamInsightCount:s.dream_insights||0,witnessChainLength:s.witness_chain||0,totalRecords:a},domains:[...l].sort(),checksum:d,tableRecordCounts:s};return He(E(t,"manifest.json"),JSON.stringify(c,null,2),"utf-8"),c}var Xe=new Set(["qe_patterns","rl_q_values","dream_insights","witness_chain"]);function Ze(e){return e==="1.0"?R.filter(n=>Xe.has(n.tableName)):e==="3.0"?R:(console.warn(`[brain-import] Unknown manifest version '${e}'. Attempting full import \u2014 some files may be missing.`),R)}function we(e,n,r){let t=ne(n),a=E(t,"manifest.json");if(!z(a))throw new Error(`Manifest not found at ${a}`);let s=x(ee(a,"utf-8")),l=be(t);if(l!==s.checksum)throw new Error(`Checksum mismatch: expected ${s.checksum}, got ${l}. The export may have been tampered with or corrupted.`);let i=Ze(s.version);if(r.dryRun){let f=0;for(let w of i){let m=_(E(t,w.fileName),x);f+=m.length}return{imported:f,skipped:0,conflicts:0}}W(e);let d=0,c=0,u=0;return e.transaction(()=>{for(let f of i){let w=E(t,f.fileName),m=_(w,x);f.blobColumns&&f.blobColumns.length>0&&(m=m.map(y=>P(y,f.blobColumns)));for(let y of m){let g;if(f.dedupColumns&&f.dedupColumns.length>0)g=U(e,f.tableName,y,f.dedupColumns);else{let v=A[f.tableName]||"id",b=F[f.tableName],I=L[f.tableName];g=J(e,f.tableName,y,v,r.mergeStrategy,b,I)}d+=g.imported,c+=g.skipped,u+=g.conflicts}}})(),{imported:d,skipped:c,conflicts:u}}function ve(e){let n=ne(e),r=E(n,"manifest.json");if(!z(r))throw new Error(`Manifest not found at ${r}`);return x(ee(r,"utf-8"))}We();import{existsSync as H,statSync as en,unlinkSync as Re,writeFileSync as nn}from"fs";import{resolve as te}from"path";function Se(e,n,r="memory.db"){if(!k())throw new Error("@ruvector/rvf-node is not available. Install it or use --format jsonl instead.");let t=te(n.outputPath),a=n.dimension??384;H(t)&&Re(t);let s=`${t}.idmap.json`;H(s)&&Re(s);let l=fe(t,a);try{let i={},d=new Set,c=0;for(let S of R){let[h,ce]=S.domainColumn?$(n.domains,S.domainColumn):[void 0,[]],D=V(e,S.tableName,h,ce);if(S.tableName==="qe_patterns")for(let q of D)q.qe_domain&&d.add(q.qe_domain);let G=Y[S.tableName];G&&G.length>0&&(D=D.map(q=>T(q,G))),i[S.tableName]=D,c+=D.length}let u=0,p=[];if(j(e,"qe_pattern_embeddings")){let S=e.prepare("SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings").all();for(let h of S)h.embedding&&h.dimension===a&&p.push({id:`pe:${h.pattern_id}`,vector:new Float32Array(h.embedding.buffer,h.embedding.byteOffset,a),metadata:{tableName:"qe_pattern_embeddings"}})}if(j(e,"captured_experiences")){let S=e.prepare("SELECT id, embedding, embedding_dimension, domain, quality FROM captured_experiences WHERE embedding IS NOT NULL").all();for(let h of S)h.embedding_dimension===a&&p.push({id:`exp:${h.id}`,vector:new Float32Array(h.embedding.buffer,h.embedding.byteOffset,a),metadata:{tableName:"captured_experiences",domain:h.domain,confidence:h.quality}})}if(j(e,"sona_patterns")){let S=e.prepare("SELECT id, state_embedding, domain, confidence FROM sona_patterns WHERE state_embedding IS NOT NULL").all();for(let h of S)h.state_embedding.byteLength/4===a&&p.push({id:`sona:${h.id}`,vector:new Float32Array(h.state_embedding.buffer,h.state_embedding.byteOffset,a),metadata:{tableName:"sona_patterns",domain:h.domain,confidence:h.confidence}})}p.length>0&&(u=l.ingest(p).accepted);let f={version:"3.0",format:"rvf",exportedAt:new Date().toISOString(),sourceDb:r,domains:[...d].sort(),tables:i},w=JSON.stringify(f),m=C(w),y=Buffer.from(w);l.embedKernel(y);let g=n.sign?l.sign(y)??void 0:void 0,v=g?n.signerKeyId??"default":void 0,b=l.fileId(),I=b?{fileId:b,parentId:l.parentId(),lineageDepth:l.lineageDepth()}:void 0,N=l.status(),M={version:"3.0",format:"rvf",exportedAt:f.exportedAt,sourceDb:r,stats:{patternCount:(i.qe_patterns||[]).length,embeddingCount:u,qValueCount:(i.rl_q_values||[]).length,dreamInsightCount:(i.dream_insights||[]).length,witnessChainLength:(i.witness_chain||[]).length,totalRecords:c},domains:f.domains,checksum:m,rvfStatus:{totalVectors:N.totalVectors,totalSegments:N.totalSegments,fileSizeBytes:N.fileSizeBytes},...g?{signature:g,signerKeyId:v}:{},...I?{lineage:I}:{}};if(g)try{l.freeze()}catch{}let Je=`${t}.manifest.json`;return nn(Je,JSON.stringify(M,null,2),"utf-8"),M}finally{l.close()}}var tn={patterns:"qe_patterns",qValues:"rl_q_values",dreamInsights:"dream_insights",witnessChain:"witness_chain"};function xe(e,n,r){if(!k())throw new Error("@ruvector/rvf-node is not available. Install it or use JSONL format.");let t=te(n);if(!H(t))throw new Error(`RVF file not found: ${t}`);let a=me(t);try{let s=a.verifyWitness();if(!s.valid&&(s.totalEntries>0||s.errors.length>0)){let m=s.errors.length>0?s.errors.join("; "):"unknown integrity error";throw new Error(`RVF witness verification failed: ${m}`)}let l=a.extractKernel();if(!l||!l.image)throw new Error("No brain data found in RVF file (missing kernel segment)");let i;try{i=JSON.parse(l.image.toString("utf-8"))}catch(m){throw new Error(`Failed to parse brain kernel data as JSON: ${m instanceof Error?m.message:m}`)}if(r.dryRun){let m=0;if(i.tables)for(let y of Object.values(i.tables))m+=y?.length??0;else m=(i.patterns?.length??0)+(i.qValues?.length??0)+(i.dreamInsights?.length??0)+(i.witnessChain?.length??0);return{imported:m,skipped:0,conflicts:0,embeddingsRestored:0}}W(e);let d=0,c=0,u=0,p=0,f={};if(i.tables)Object.assign(f,i.tables);else for(let[m,y]of Object.entries(tn)){let g=i[m];Array.isArray(g)&&(f[y]=g)}if(e.transaction(()=>{for(let m of R){let y=f[m.tableName];if(!y||!Array.isArray(y))continue;let g=Y[m.tableName];if(g&&g.length>0){y=y.map(v=>P(v,g));for(let v of y)for(let b of g)v[b]instanceof Buffer&&p++}for(let v of y){let b;if(m.dedupColumns&&m.dedupColumns.length>0)b=U(e,m.tableName,v,m.dedupColumns);else{let I=A[m.tableName]||"id",N=F[m.tableName],M=L[m.tableName];b=J(e,m.tableName,v,I,r.mergeStrategy,N,M)}d+=b.imported,c+=b.skipped,u+=b.conflicts}}})(),u>0)try{a.compact()}catch{}return{imported:d,skipped:c,conflicts:u,embeddingsRestored:p}}finally{a.close()}}function K(e){if(!k())throw new Error("@ruvector/rvf-node is not available.");let n=te(e);if(!H(n))throw new Error(`RVF file not found: ${n}`);let r=ue(n);try{let t=r.extractKernel();if(!t||!t.image)throw new Error("No brain data found in RVF file");let a=t.image.toString("utf-8"),s;try{s=JSON.parse(a)}catch(w){throw new Error(`Failed to parse brain kernel data as JSON: ${w instanceof Error?w.message:w}`)}let l=r.status(),i=en(n).size,d=s.tables,c=d?d.qe_patterns?.length??0:s.patterns?.length??0,u=d?d.rl_q_values?.length??0:s.qValues?.length??0,p=d?d.dream_insights?.length??0:s.dreamInsights?.length??0,f=d?d.witness_chain?.length??0:s.witnessChain?.length??0;return{version:"3.0",format:"rvf",exportedAt:s.exportedAt??"unknown",sourceDb:s.sourceDb??"unknown",stats:{patternCount:c,embeddingCount:l.totalVectors,qValueCount:u,dreamInsightCount:p,witnessChainLength:f},domains:s.domains??[],checksum:C(a),rvfStatus:{totalVectors:l.totalVectors,totalSegments:l.totalSegments,fileSizeBytes:i}}}finally{r.close()}}function re(){return k()}Q();import{existsSync as ae,readFileSync as rn,statSync as on}from"fs";import{join as oe,resolve as Ce}from"path";function Ie(e,n,r={}){let t=Ce(e),a=Ce(n),s=Ee(t),l=Ee(a),i=Be(t,s),d=Be(a,l),c=s==="jsonl"&&l==="jsonl",u=ln({pathA:t,pathB:a,manifestA:i,manifestB:d,recordLevel:c,tableFilter:r.tableFilter,maxIdsPerBucket:r.maxIdsPerBucket??500}),p=new Set(i.domains),f=new Set(d.domains),w=i.domains.filter(b=>!f.has(b)),m=d.domains.filter(b=>!p.has(b)),y=i.checksum===d.checksum,g=i.version===d.version,v=y&&g&&u.every(b=>b.delta===0&&(b.added?.length??0)===0&&(b.removed?.length??0)===0&&(b.changed?.length??0)===0);return{pathA:t,pathB:a,formatA:s,formatB:l,manifestA:i,manifestB:d,checksumMatch:y,versionMatch:g,identical:v,recordLevel:c,tableDiffs:u,domainsOnlyInA:w,domainsOnlyInB:m}}function Ee(e){if(!ae(e))throw new Error(`Path not found: ${e}`);if(e.endsWith(".rvf"))return"rvf";if(on(e).isFile())throw new Error(`Unsupported brain export: ${e} (expected a .rvf file or a JSONL directory)`);return"jsonl"}function Be(e,n){return n==="rvf"?sn(e):an(e)}function an(e){let n=oe(e,"manifest.json");if(!ae(n))throw new Error(`Manifest not found at ${n}`);let r=x(rn(n,"utf-8"));return Oe(r,"jsonl")}function sn(e){let n=K(e);return Oe(n,"rvf")}function Oe(e,n){return{format:n,version:e.version??"unknown",exportedAt:e.exportedAt??"unknown",sourceDb:e.sourceDb??"unknown",checksum:e.checksum??"",totalRecords:e.stats?.totalRecords??0,domains:e.domains??[],tableRecordCounts:e.tableRecordCounts??{}}}function ln(e){let n=e.tableFilter?R.filter(t=>t.tableName===e.tableFilter):R;if(e.tableFilter&&n.length===0)throw new Error(`Unknown table: ${e.tableFilter}`);let r=[];for(let t of n){let a=e.manifestA.tableRecordCounts[t.tableName]??0,s=e.manifestB.tableRecordCounts[t.tableName]??0,l=s-a,i,d,c;if(e.recordLevel&&dn(t)){let u=cn(oe(e.pathA,t.fileName),oe(e.pathB,t.fileName),t,e.maxIdsPerBucket);i=u.added,d=u.removed,c=u.changed}r.push({tableName:t.tableName,countA:a,countB:s,delta:l,...i!==void 0?{added:i}:{},...d!==void 0?{removed:d}:{},...c!==void 0?{changed:c}:{}})}return r}function dn(e){return!0}function cn(e,n,r,t){let a=_e(e,r),s=_e(n,r),l=[],i=[],d=[];for(let[c,u]of a){let p=s.get(c);if(p===void 0)i.length<t&&i.push(c);else if(p!==u){if(r.dedupColumns&&r.dedupColumns.length>0)continue;d.length<t&&d.push(c)}}for(let c of s.keys())a.has(c)||l.length<t&&l.push(c);return l.sort(),i.sort(),d.sort(),{added:l,removed:i,changed:d}}function _e(e,n){let r=new Map;if(!ae(e))return r;let t=_(e,x);for(let a of t){let s=fn(a,n);if(s===void 0)continue;let l=mn(a);r.set(s,un(l))}return r}function fn(e,n){if(n.dedupColumns&&n.dedupColumns.length>0){let a=[];for(let s of n.dedupColumns){let l=e[s];if(l==null)return;a.push(String(l))}return a.join("")}let r=A[n.tableName]??"id",t=e[r];if(t!=null)return String(t)}function mn(e){let n=Object.keys(e).sort(),r={};for(let t of n)r[t]=e[t];return JSON.stringify(r)}function un(e){return C(e)}Q();import{existsSync as ie,statSync as pn}from"fs";import{join as Ae,resolve as gn}from"path";var yn=20,bn="qe_patterns";function Ne(e,n={}){let r=gn(e);vn(r);let t=n.table??bn,a=R.find(g=>g.tableName===t);if(!a)throw new Error(`Unknown table: ${t}`);let s=Ae(r,a.fileName);if(!ie(s))throw new Error(`Table file not found: ${a.fileName} (expected in ${r}). Was this export generated with --format jsonl?`);let l=_(s,x),i=a.domainColumn,d=Math.max(1,n.limit??yn),c=n.query?n.query.toLowerCase():void 0,u=n.domains&&n.domains.length>0?new Set(n.domains):void 0,p=n.since,f=n.until,w=n.patternType,m=0,y=[];for(let g of l)hn(g,{domainColumn:i,domains:u,patternType:w,since:p,until:f,queryLower:c})&&(m++,y.length<d&&y.push(wn(g,a.tableName,i)));return{table:t,inputPath:r,totalScanned:l.length,totalMatched:m,limit:d,hits:y,truncated:m>d}}function hn(e,n){if(n.domains){if(!n.domainColumn)return!1;let r=e[n.domainColumn];if(typeof r!="string"||!n.domains.has(r))return!1}if(n.patternType!==void 0&&e.pattern_type!==n.patternType)return!1;if(n.since!==void 0||n.until!==void 0){let r=De(e);if(r===void 0||n.since!==void 0&&r<n.since||n.until!==void 0&&r>n.until)return!1}if(n.queryLower!==void 0){let r=typeof e.name=="string"?e.name.toLowerCase():"",t=typeof e.description=="string"?e.description.toLowerCase():"";if(!r.includes(n.queryLower)&&!t.includes(n.queryLower))return!1}return!0}function De(e){for(let n of["updated_at","created_at","timestamp"]){let r=e[n];if(typeof r=="string"&&r.length>0)return r}}function wn(e,n,r){let t=(typeof e.id=="string"||typeof e.id=="number"?String(e.id):void 0)??`${n}:?`,a={name:typeof e.name=="string"?e.name:void 0,description:typeof e.description=="string"?e.description:void 0,domain:r&&typeof e[r]=="string"?e[r]:void 0,patternType:typeof e.pattern_type=="string"?e.pattern_type:void 0,confidence:typeof e.confidence=="number"?e.confidence:void 0,updatedAt:De(e)};return{id:t,display:a,row:e}}function vn(e){if(!ie(e))throw new Error(`Path not found: ${e}`);if(pn(e).isFile())throw e.endsWith(".rvf")?new Error("Brain search does not support RVF exports. Re-export with --format jsonl, or use `aqe brain info` for RVF summaries."):new Error(`Unsupported brain export: ${e} (expected a JSONL directory)`);let r=Ae(e,"manifest.json");if(!ie(r))throw new Error(`Manifest not found at ${r}. Is this a brain export directory?`)}function ke(e,n){if(!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return{created:0,skipped:0};e.exec(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.2");process.exit(0)}
2
+ import{a as A,b as L,c as F,d as R,e as Y,f as T,g as P,h as C,i as j,j as X,k as V,l as ge,m as $,n as Z,o as ye,p as _,q as J,r as U,s as W}from"./chunk-7IVQ6OVR.js";import{h as pe}from"./chunk-VSUTI4G6.js";import"./chunk-L7VIX22Y.js";import"./chunk-5QHSLWLP.js";import{b as x,d as Q}from"./chunk-SW4OKUTC.js";import{a as fe,b as me,c as ue,d as k,f as We}from"./chunk-CV2SBMBW.js";import"./chunk-IAZEDWRX.js";import"./chunk-JF53LRBL.js";import"./chunk-XPCNUX2U.js";import{a as O,b as Ue}from"./chunk-MCZHKXB4.js";import"./chunk-YI6GNRQM.js";import"./chunk-OXCEUR5F.js";import"./chunk-DRWGK3YO.js";import"./chunk-HHCYSAH3.js";import"./chunk-WNR2KAUH.js";import"./chunk-WDMPJ2M2.js";import"./chunk-IICTTDAA.js";import"./chunk-ON4D4TJ4.js";import"./chunk-ORF2UKQH.js";import B from"path";import o from"chalk";Ue();Q();import{existsSync as z,mkdirSync as ze,writeFileSync as He,readFileSync as ee}from"fs";import{join as E,resolve as ne}from"path";var Ke={rl_q_values:"includeQValues",dream_insights:"includeDreamInsights",dream_cycles:"includeDreamInsights",witness_chain:"includeWitnessChain",vectors:"includeVectors"};function Ge(e,n){let r=Ke[e.tableName];return!(r&&n[r]===!1)}var Qe=1e4;function Ye(e,n,r,t){if(!Ge(n,r))return Z(E(t,n.fileName),[]),{count:0,rows:[]};let[a,s]=n.domainColumn?$(r.domains,n.domainColumn):[void 0,[]];if(X(e,n.tableName,a,s)>=Qe){let d=n.blobColumns,c=d&&d.length>0?p=>T(p,d):void 0;return{count:ye(E(t,n.fileName),ge(e,n.tableName,a,s),c)}}let i=V(e,n.tableName,a,s);return n.blobColumns&&n.blobColumns.length>0&&(i=i.map(d=>T(d,n.blobColumns))),Z(E(t,n.fileName),i),{count:i.length,rows:i}}function be(e){let n=[];for(let r of R){let t=E(e,r.fileName);z(t)?n.push(C(ee(t,"utf-8"))):n.push(C(""))}return C(n.join(":"))}function he(e,n,r="memory.db"){let t=ne(n.outputPath);z(t)||ze(t,{recursive:!0});let a=0,s={},l=new Set;for(let u of R){let p=Ye(e,u,n,t);if(s[u.tableName]=p.count,a+=p.count,u.tableName==="qe_patterns"){if(p.rows)for(let f of p.rows)f.qe_domain&&l.add(f.qe_domain);else if(p.count>0){let[f,w]=u.domainColumn?$(n.domains,u.domainColumn):[void 0,[]],y=`SELECT DISTINCT qe_domain FROM qe_patterns ${f?`WHERE ${f} AND qe_domain IS NOT NULL`:"WHERE qe_domain IS NOT NULL"}`;try{let g=e.prepare(y).all(...w||[]);for(let v of g)l.add(v.qe_domain)}catch{}}}}let i=n.includeVectors!==!1?X(e,"vectors"):0,d=be(t),c={version:"3.0",exportedAt:new Date().toISOString(),sourceDb:r,stats:{patternCount:s.qe_patterns||0,vectorCount:i,qValueCount:s.rl_q_values||0,dreamInsightCount:s.dream_insights||0,witnessChainLength:s.witness_chain||0,totalRecords:a},domains:[...l].sort(),checksum:d,tableRecordCounts:s};return He(E(t,"manifest.json"),JSON.stringify(c,null,2),"utf-8"),c}var Xe=new Set(["qe_patterns","rl_q_values","dream_insights","witness_chain"]);function Ze(e){return e==="1.0"?R.filter(n=>Xe.has(n.tableName)):e==="3.0"?R:(console.warn(`[brain-import] Unknown manifest version '${e}'. Attempting full import \u2014 some files may be missing.`),R)}function we(e,n,r){let t=ne(n),a=E(t,"manifest.json");if(!z(a))throw new Error(`Manifest not found at ${a}`);let s=x(ee(a,"utf-8")),l=be(t);if(l!==s.checksum)throw new Error(`Checksum mismatch: expected ${s.checksum}, got ${l}. The export may have been tampered with or corrupted.`);let i=Ze(s.version);if(r.dryRun){let f=0;for(let w of i){let m=_(E(t,w.fileName),x);f+=m.length}return{imported:f,skipped:0,conflicts:0}}W(e);let d=0,c=0,u=0;return e.transaction(()=>{for(let f of i){let w=E(t,f.fileName),m=_(w,x);f.blobColumns&&f.blobColumns.length>0&&(m=m.map(y=>P(y,f.blobColumns)));for(let y of m){let g;if(f.dedupColumns&&f.dedupColumns.length>0)g=U(e,f.tableName,y,f.dedupColumns);else{let v=A[f.tableName]||"id",b=F[f.tableName],I=L[f.tableName];g=J(e,f.tableName,y,v,r.mergeStrategy,b,I)}d+=g.imported,c+=g.skipped,u+=g.conflicts}}})(),{imported:d,skipped:c,conflicts:u}}function ve(e){let n=ne(e),r=E(n,"manifest.json");if(!z(r))throw new Error(`Manifest not found at ${r}`);return x(ee(r,"utf-8"))}We();import{existsSync as H,statSync as en,unlinkSync as Re,writeFileSync as nn}from"fs";import{resolve as te}from"path";function Se(e,n,r="memory.db"){if(!k())throw new Error("@ruvector/rvf-node is not available. Install it or use --format jsonl instead.");let t=te(n.outputPath),a=n.dimension??384;H(t)&&Re(t);let s=`${t}.idmap.json`;H(s)&&Re(s);let l=fe(t,a);try{let i={},d=new Set,c=0;for(let S of R){let[h,ce]=S.domainColumn?$(n.domains,S.domainColumn):[void 0,[]],D=V(e,S.tableName,h,ce);if(S.tableName==="qe_patterns")for(let q of D)q.qe_domain&&d.add(q.qe_domain);let G=Y[S.tableName];G&&G.length>0&&(D=D.map(q=>T(q,G))),i[S.tableName]=D,c+=D.length}let u=0,p=[];if(j(e,"qe_pattern_embeddings")){let S=e.prepare("SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings").all();for(let h of S)h.embedding&&h.dimension===a&&p.push({id:`pe:${h.pattern_id}`,vector:new Float32Array(h.embedding.buffer,h.embedding.byteOffset,a),metadata:{tableName:"qe_pattern_embeddings"}})}if(j(e,"captured_experiences")){let S=e.prepare("SELECT id, embedding, embedding_dimension, domain, quality FROM captured_experiences WHERE embedding IS NOT NULL").all();for(let h of S)h.embedding_dimension===a&&p.push({id:`exp:${h.id}`,vector:new Float32Array(h.embedding.buffer,h.embedding.byteOffset,a),metadata:{tableName:"captured_experiences",domain:h.domain,confidence:h.quality}})}if(j(e,"sona_patterns")){let S=e.prepare("SELECT id, state_embedding, domain, confidence FROM sona_patterns WHERE state_embedding IS NOT NULL").all();for(let h of S)h.state_embedding.byteLength/4===a&&p.push({id:`sona:${h.id}`,vector:new Float32Array(h.state_embedding.buffer,h.state_embedding.byteOffset,a),metadata:{tableName:"sona_patterns",domain:h.domain,confidence:h.confidence}})}p.length>0&&(u=l.ingest(p).accepted);let f={version:"3.0",format:"rvf",exportedAt:new Date().toISOString(),sourceDb:r,domains:[...d].sort(),tables:i},w=JSON.stringify(f),m=C(w),y=Buffer.from(w);l.embedKernel(y);let g=n.sign?l.sign(y)??void 0:void 0,v=g?n.signerKeyId??"default":void 0,b=l.fileId(),I=b?{fileId:b,parentId:l.parentId(),lineageDepth:l.lineageDepth()}:void 0,N=l.status(),M={version:"3.0",format:"rvf",exportedAt:f.exportedAt,sourceDb:r,stats:{patternCount:(i.qe_patterns||[]).length,embeddingCount:u,qValueCount:(i.rl_q_values||[]).length,dreamInsightCount:(i.dream_insights||[]).length,witnessChainLength:(i.witness_chain||[]).length,totalRecords:c},domains:f.domains,checksum:m,rvfStatus:{totalVectors:N.totalVectors,totalSegments:N.totalSegments,fileSizeBytes:N.fileSizeBytes},...g?{signature:g,signerKeyId:v}:{},...I?{lineage:I}:{}};if(g)try{l.freeze()}catch{}let Je=`${t}.manifest.json`;return nn(Je,JSON.stringify(M,null,2),"utf-8"),M}finally{l.close()}}var tn={patterns:"qe_patterns",qValues:"rl_q_values",dreamInsights:"dream_insights",witnessChain:"witness_chain"};function xe(e,n,r){if(!k())throw new Error("@ruvector/rvf-node is not available. Install it or use JSONL format.");let t=te(n);if(!H(t))throw new Error(`RVF file not found: ${t}`);let a=me(t);try{let s=a.verifyWitness();if(!s.valid&&(s.totalEntries>0||s.errors.length>0)){let m=s.errors.length>0?s.errors.join("; "):"unknown integrity error";throw new Error(`RVF witness verification failed: ${m}`)}let l=a.extractKernel();if(!l||!l.image)throw new Error("No brain data found in RVF file (missing kernel segment)");let i;try{i=JSON.parse(l.image.toString("utf-8"))}catch(m){throw new Error(`Failed to parse brain kernel data as JSON: ${m instanceof Error?m.message:m}`)}if(r.dryRun){let m=0;if(i.tables)for(let y of Object.values(i.tables))m+=y?.length??0;else m=(i.patterns?.length??0)+(i.qValues?.length??0)+(i.dreamInsights?.length??0)+(i.witnessChain?.length??0);return{imported:m,skipped:0,conflicts:0,embeddingsRestored:0}}W(e);let d=0,c=0,u=0,p=0,f={};if(i.tables)Object.assign(f,i.tables);else for(let[m,y]of Object.entries(tn)){let g=i[m];Array.isArray(g)&&(f[y]=g)}if(e.transaction(()=>{for(let m of R){let y=f[m.tableName];if(!y||!Array.isArray(y))continue;let g=Y[m.tableName];if(g&&g.length>0){y=y.map(v=>P(v,g));for(let v of y)for(let b of g)v[b]instanceof Buffer&&p++}for(let v of y){let b;if(m.dedupColumns&&m.dedupColumns.length>0)b=U(e,m.tableName,v,m.dedupColumns);else{let I=A[m.tableName]||"id",N=F[m.tableName],M=L[m.tableName];b=J(e,m.tableName,v,I,r.mergeStrategy,N,M)}d+=b.imported,c+=b.skipped,u+=b.conflicts}}})(),u>0)try{a.compact()}catch{}return{imported:d,skipped:c,conflicts:u,embeddingsRestored:p}}finally{a.close()}}function K(e){if(!k())throw new Error("@ruvector/rvf-node is not available.");let n=te(e);if(!H(n))throw new Error(`RVF file not found: ${n}`);let r=ue(n);try{let t=r.extractKernel();if(!t||!t.image)throw new Error("No brain data found in RVF file");let a=t.image.toString("utf-8"),s;try{s=JSON.parse(a)}catch(w){throw new Error(`Failed to parse brain kernel data as JSON: ${w instanceof Error?w.message:w}`)}let l=r.status(),i=en(n).size,d=s.tables,c=d?d.qe_patterns?.length??0:s.patterns?.length??0,u=d?d.rl_q_values?.length??0:s.qValues?.length??0,p=d?d.dream_insights?.length??0:s.dreamInsights?.length??0,f=d?d.witness_chain?.length??0:s.witnessChain?.length??0;return{version:"3.0",format:"rvf",exportedAt:s.exportedAt??"unknown",sourceDb:s.sourceDb??"unknown",stats:{patternCount:c,embeddingCount:l.totalVectors,qValueCount:u,dreamInsightCount:p,witnessChainLength:f},domains:s.domains??[],checksum:C(a),rvfStatus:{totalVectors:l.totalVectors,totalSegments:l.totalSegments,fileSizeBytes:i}}}finally{r.close()}}function re(){return k()}Q();import{existsSync as ae,readFileSync as rn,statSync as on}from"fs";import{join as oe,resolve as Ce}from"path";function Ie(e,n,r={}){let t=Ce(e),a=Ce(n),s=Ee(t),l=Ee(a),i=Be(t,s),d=Be(a,l),c=s==="jsonl"&&l==="jsonl",u=ln({pathA:t,pathB:a,manifestA:i,manifestB:d,recordLevel:c,tableFilter:r.tableFilter,maxIdsPerBucket:r.maxIdsPerBucket??500}),p=new Set(i.domains),f=new Set(d.domains),w=i.domains.filter(b=>!f.has(b)),m=d.domains.filter(b=>!p.has(b)),y=i.checksum===d.checksum,g=i.version===d.version,v=y&&g&&u.every(b=>b.delta===0&&(b.added?.length??0)===0&&(b.removed?.length??0)===0&&(b.changed?.length??0)===0);return{pathA:t,pathB:a,formatA:s,formatB:l,manifestA:i,manifestB:d,checksumMatch:y,versionMatch:g,identical:v,recordLevel:c,tableDiffs:u,domainsOnlyInA:w,domainsOnlyInB:m}}function Ee(e){if(!ae(e))throw new Error(`Path not found: ${e}`);if(e.endsWith(".rvf"))return"rvf";if(on(e).isFile())throw new Error(`Unsupported brain export: ${e} (expected a .rvf file or a JSONL directory)`);return"jsonl"}function Be(e,n){return n==="rvf"?sn(e):an(e)}function an(e){let n=oe(e,"manifest.json");if(!ae(n))throw new Error(`Manifest not found at ${n}`);let r=x(rn(n,"utf-8"));return Oe(r,"jsonl")}function sn(e){let n=K(e);return Oe(n,"rvf")}function Oe(e,n){return{format:n,version:e.version??"unknown",exportedAt:e.exportedAt??"unknown",sourceDb:e.sourceDb??"unknown",checksum:e.checksum??"",totalRecords:e.stats?.totalRecords??0,domains:e.domains??[],tableRecordCounts:e.tableRecordCounts??{}}}function ln(e){let n=e.tableFilter?R.filter(t=>t.tableName===e.tableFilter):R;if(e.tableFilter&&n.length===0)throw new Error(`Unknown table: ${e.tableFilter}`);let r=[];for(let t of n){let a=e.manifestA.tableRecordCounts[t.tableName]??0,s=e.manifestB.tableRecordCounts[t.tableName]??0,l=s-a,i,d,c;if(e.recordLevel&&dn(t)){let u=cn(oe(e.pathA,t.fileName),oe(e.pathB,t.fileName),t,e.maxIdsPerBucket);i=u.added,d=u.removed,c=u.changed}r.push({tableName:t.tableName,countA:a,countB:s,delta:l,...i!==void 0?{added:i}:{},...d!==void 0?{removed:d}:{},...c!==void 0?{changed:c}:{}})}return r}function dn(e){return!0}function cn(e,n,r,t){let a=_e(e,r),s=_e(n,r),l=[],i=[],d=[];for(let[c,u]of a){let p=s.get(c);if(p===void 0)i.length<t&&i.push(c);else if(p!==u){if(r.dedupColumns&&r.dedupColumns.length>0)continue;d.length<t&&d.push(c)}}for(let c of s.keys())a.has(c)||l.length<t&&l.push(c);return l.sort(),i.sort(),d.sort(),{added:l,removed:i,changed:d}}function _e(e,n){let r=new Map;if(!ae(e))return r;let t=_(e,x);for(let a of t){let s=fn(a,n);if(s===void 0)continue;let l=mn(a);r.set(s,un(l))}return r}function fn(e,n){if(n.dedupColumns&&n.dedupColumns.length>0){let a=[];for(let s of n.dedupColumns){let l=e[s];if(l==null)return;a.push(String(l))}return a.join("")}let r=A[n.tableName]??"id",t=e[r];if(t!=null)return String(t)}function mn(e){let n=Object.keys(e).sort(),r={};for(let t of n)r[t]=e[t];return JSON.stringify(r)}function un(e){return C(e)}Q();import{existsSync as ie,statSync as pn}from"fs";import{join as Ae,resolve as gn}from"path";var yn=20,bn="qe_patterns";function Ne(e,n={}){let r=gn(e);vn(r);let t=n.table??bn,a=R.find(g=>g.tableName===t);if(!a)throw new Error(`Unknown table: ${t}`);let s=Ae(r,a.fileName);if(!ie(s))throw new Error(`Table file not found: ${a.fileName} (expected in ${r}). Was this export generated with --format jsonl?`);let l=_(s,x),i=a.domainColumn,d=Math.max(1,n.limit??yn),c=n.query?n.query.toLowerCase():void 0,u=n.domains&&n.domains.length>0?new Set(n.domains):void 0,p=n.since,f=n.until,w=n.patternType,m=0,y=[];for(let g of l)hn(g,{domainColumn:i,domains:u,patternType:w,since:p,until:f,queryLower:c})&&(m++,y.length<d&&y.push(wn(g,a.tableName,i)));return{table:t,inputPath:r,totalScanned:l.length,totalMatched:m,limit:d,hits:y,truncated:m>d}}function hn(e,n){if(n.domains){if(!n.domainColumn)return!1;let r=e[n.domainColumn];if(typeof r!="string"||!n.domains.has(r))return!1}if(n.patternType!==void 0&&e.pattern_type!==n.patternType)return!1;if(n.since!==void 0||n.until!==void 0){let r=De(e);if(r===void 0||n.since!==void 0&&r<n.since||n.until!==void 0&&r>n.until)return!1}if(n.queryLower!==void 0){let r=typeof e.name=="string"?e.name.toLowerCase():"",t=typeof e.description=="string"?e.description.toLowerCase():"";if(!r.includes(n.queryLower)&&!t.includes(n.queryLower))return!1}return!0}function De(e){for(let n of["updated_at","created_at","timestamp"]){let r=e[n];if(typeof r=="string"&&r.length>0)return r}}function wn(e,n,r){let t=(typeof e.id=="string"||typeof e.id=="number"?String(e.id):void 0)??`${n}:?`,a={name:typeof e.name=="string"?e.name:void 0,description:typeof e.description=="string"?e.description:void 0,domain:r&&typeof e[r]=="string"?e[r]:void 0,patternType:typeof e.pattern_type=="string"?e.pattern_type:void 0,confidence:typeof e.confidence=="number"?e.confidence:void 0,updatedAt:De(e)};return{id:t,display:a,row:e}}function vn(e){if(!ie(e))throw new Error(`Path not found: ${e}`);if(pn(e).isFile())throw e.endsWith(".rvf")?new Error("Brain search does not support RVF exports. Re-export with --format jsonl, or use `aqe brain info` for RVF summaries."):new Error(`Unsupported brain export: ${e} (expected a JSONL directory)`);let r=Ae(e,"manifest.json");if(!ie(r))throw new Error(`Manifest not found at ${r}. Is this a brain export directory?`)}function ke(e,n){if(!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return{created:0,skipped:0};e.exec(`
3
3
  CREATE TEMP TABLE IF NOT EXISTS _covered_patterns (
4
4
  pattern_id TEXT PRIMARY KEY
5
5
  )
@@ -74,7 +74,7 @@ Examples:
74
74
  aqe brain diff ./brain-a ./brain-b --verbose
75
75
  aqe brain search -i ./brain-export --query oauth --domain test-generation
76
76
  aqe brain search -i ./brain-export --since 2026-03-01 --limit 50 --json
77
- `}};async function se(e){if(e)return e;let{findProjectRoot:n}=await import("./unified-memory-ROS2NKR5.js");return B.join(n(),".agentic-qe","memory.db")}function je(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Sn(e){let n=Number.parseInt(e,10);return!Number.isFinite(n)||n<1?20:n}function xn(e){if(e===void 0)return;let n=Array.isArray(e)?e:[e],r=[];for(let t of n)for(let a of t.split(",")){let s=a.trim();s&&r.push(s)}return r.length>0?r:void 0}function Cn(e,n){console.log(o.blue(`
77
+ `}};async function se(e){if(e)return e;let{findProjectRoot:n}=await import("./unified-memory-7AS4LIEF.js");return B.join(n(),".agentic-qe","memory.db")}function je(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Sn(e){let n=Number.parseInt(e,10);return!Number.isFinite(n)||n<1?20:n}function xn(e){if(e===void 0)return;let n=Array.isArray(e)?e:[e],r=[];for(let t of n)for(let a of t.split(",")){let s=a.trim();s&&r.push(s)}return r.length>0?r:void 0}function Cn(e,n){console.log(o.blue(`
78
78
  Brain Diff
79
79
  `)),console.log(` A: ${o.cyan(e.pathA)} (${e.formatA})`),console.log(` B: ${o.cyan(e.pathB)} (${e.formatB})`),console.log(` Versions: ${o.cyan(e.manifestA.version)} \u2192 ${o.cyan(e.manifestB.version)}`+(e.versionMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Checksums: ${o.gray(e.manifestA.checksum.slice(0,12))}\u2026 \u2192 ${o.gray(e.manifestB.checksum.slice(0,12))}\u2026`+(e.checksumMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Exported: ${o.gray(e.manifestA.exportedAt)} \u2192 ${o.gray(e.manifestB.exportedAt)}`),console.log(` Records: ${o.cyan(e.manifestA.totalRecords)} \u2192 ${o.cyan(e.manifestB.totalRecords)} `+Ve(e.manifestB.totalRecords-e.manifestA.totalRecords)),(e.domainsOnlyInA.length>0||e.domainsOnlyInB.length>0)&&(console.log(o.blue(`
80
80
  Domains:`)),e.domainsOnlyInA.length>0&&console.log(` Only in A: ${o.yellow(e.domainsOnlyInA.join(", "))}`),e.domainsOnlyInB.length>0&&console.log(` Only in B: ${o.yellow(e.domainsOnlyInB.join(", "))}`)),e.recordLevel||console.log(o.gray(`
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
2
- import"./chunk-4AWJ5PE4.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.10.2");process.exit(0)}
2
+ import"./chunk-ORF2UKQH.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
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
2
- import{a as p}from"./chunk-WPNZSL4S.js";import"./chunk-4AWJ5PE4.js";import{readFile as m,readdir as k}from"fs/promises";import{join as c,basename as y,dirname as W}from"path";import{fileURLToPath as v}from"url";import{parse as d}from"yaml";var b=v(import.meta.url),E=W(b),l=class{templatesDir;cache=new Map;constructor(r){this.templatesDir=r||c(E,"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.10.2");process.exit(0)}
2
+ import{a as p}from"./chunk-22D6VBPD.js";import"./chunk-ORF2UKQH.js";import{readFile as m,readdir as k}from"fs/promises";import{join as c,basename as y,dirname as W}from"path";import{fileURLToPath as v}from"url";import{parse as d}from"yaml";var b=v(import.meta.url),E=W(b),l=class{templatesDir;cache=new Map;constructor(r){this.templatesDir=r||c(E,"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)}},x=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 T(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"],A={"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 _(a){return h[a]}function P(a){return g.includes(a)}function L(){return g.map(a=>{let r=Object.entries(h).find(([e,n])=>n.includes(a))?.[0]||"other";return{name:a,description:A[a],category:r}})}export{h as WORKFLOW_CATEGORIES,A as WORKFLOW_DESCRIPTIONS,g as WORKFLOW_TEMPLATES,l as WorkflowLoader,x as defaultWorkflowLoader,T as evaluateCondition,L as getAllWorkflowTemplates,_ as getWorkflowsByCategory,w as interpolateVariables,P 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.10.2");process.exit(0)}
2
+ import{a}from"./chunk-4F3ZTXHP.js";import"./chunk-UWXH2UQK.js";import"./chunk-G5U6Q42D.js";import"./chunk-L7VIX22Y.js";import"./chunk-5QHSLWLP.js";import"./chunk-SW4OKUTC.js";import"./chunk-IAZEDWRX.js";import"./chunk-JF53LRBL.js";import"./chunk-XPCNUX2U.js";import"./chunk-AOI67HA3.js";import"./chunk-MCZHKXB4.js";import"./chunk-YI6GNRQM.js";import"./chunk-OXCEUR5F.js";import"./chunk-DRWGK3YO.js";import"./chunk-HHCYSAH3.js";import"./chunk-WNR2KAUH.js";import"./chunk-WDMPJ2M2.js";import"./chunk-IICTTDAA.js";import"./chunk-ON4D4TJ4.js";import"./chunk-ORF2UKQH.js";export{a as BrowserWorkflowTool};
@@ -1,3 +1,3 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.2");process.exit(0)}
2
2
  import{readFileSync as R,existsSync as v,readdirSync as y}from"fs";import{join as S}from"path";var M=100*1024,b=/mcp__([a-z][a-z0-9-]*)__([a-z][a-z0-9_]*)/g,x=/^```/;function w(e,r){let n=e.length>M?e.slice(0,M):e,o=[],i=n.split(`
3
3
  `),a=!1;for(let s=0;s<i.length;s++){let p=i[s];if(x.test(p.trim())){a=!a;continue}let l,c=new RegExp(b.source,"g");for(;(l=c.exec(p))!==null;){let t=l[1],g=l[2],f=l[0],d=a?"code-block":"prose",u=d==="prose"?.9:.5;o.push({toolName:f,serverName:t,actionName:g,confidence:u,context:d,lineNumber:s+1})}}return o}function E(e){let r=new Map;for(let n of e)r.has(n.serverName)||r.set(n.serverName,[]),r.get(n.serverName).push(n);return r}function N(e){let r=[],n=[S(e,".claude","mcp.json"),S(e,".mcp.json")],o=process.env.HOME||process.env.USERPROFILE||"";o&&n.push(S(o,".claude","mcp.json"));for(let i of n)if(v(i))try{let a=R(i,"utf-8"),s=JSON.parse(a);s.mcpServers&&typeof s.mcpServers=="object"&&r.push(...Object.keys(s.mcpServers))}catch{}return[...new Set(r)]}function h(e,r,n){if(!v(e))return{agentName:r,references:[],requiredServers:[],availableServers:n,missingServers:[],warnings:[`Agent file not found: ${e}`],allSatisfied:!0};let o;try{o=R(e,"utf-8")}catch{return{agentName:r,references:[],requiredServers:[],availableServers:n,missingServers:[],warnings:[`Failed to read agent file: ${e}`],allSatisfied:!0}}let i=w(o,r),a=E(i),s=[...a.keys()],p=new Set(n),l=s.filter(t=>!p.has(t)),c=[];for(let t of l){let g=a.get(t)||[],f=Math.max(...g.map(m=>m.confidence)),d=g.length,u=[...new Set(g.map(m=>m.context))].join(", ");c.push(`[advisory] Agent "${r}" references MCP server "${t}" (${d} tool ref${d>1?"s":""}, confidence: ${f}, context: ${u}) but server is not configured. Agent may have reduced capabilities.`)}return{agentName:r,references:i,requiredServers:s,availableServers:n,missingServers:l,warnings:c,allSatisfied:l.length===0}}function C(e,r){let n=Date.now(),o=[],i=[],a=N(r);if(!v(e))return{agents:[],totalServersReferenced:0,globalMissingServers:[],agentsWithMissingDeps:[],warnings:[`Agents directory not found: ${e}`],durationMs:Date.now()-n};try{let c=y(e);for(let g of c){if(!g.endsWith(".md"))continue;let f=g.replace(".md",""),d=S(e,g),u=h(d,f,a);o.push(u),i.push(...u.warnings)}let t=S(e,"subagents");if(v(t)){let g=y(t);for(let f of g){if(!f.endsWith(".md"))continue;let d=f.replace(".md",""),u=S(t,f),m=h(u,d,a);o.push(m),i.push(...m.warnings)}}}catch(c){i.push(`Error scanning agents directory: ${c.message}`)}let s=new Set,p=new Set,l=[];for(let c of o){for(let t of c.requiredServers)s.add(t);for(let t of c.missingServers)p.add(t);c.missingServers.length>0&&l.push(c.agentName)}return{agents:o,totalServersReferenced:s.size,globalMissingServers:[...p],agentsWithMissingDeps:l,warnings:i,durationMs:Date.now()-n}}export{N as a,C as b};
@@ -1,3 +1,3 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.2");process.exit(0)}
2
2
  var p={"||":1,"&&":2,"===":3,"!==":3,"==":3,"!=":3,"<":4,">":4,"<=":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6},l=new Set(Object.keys(p)),w=new Set(["!","-","+"]);function h(r){let n=[],e=0;for(;e<r.length;){let t=r[e];if(/\s/.test(t)){e++;continue}if(/\d/.test(t)||t==="."&&/\d/.test(r[e+1])){let s="";for(;e<r.length&&/[\d.]/.test(r[e]);)s+=r[e++];n.push({type:"NUMBER",value:parseFloat(s),raw:s});continue}if(t==='"'||t==="'"){let s=t,u="";for(e++;e<r.length&&r[e]!==s;){if(r[e]==="\\"&&e+1<r.length){e++;let c=r[e];switch(c){case"n":u+=`
3
3
  `;break;case"t":u+=" ";break;case"r":u+="\r";break;default:u+=c}}else u+=r[e];e++}e++,n.push({type:"STRING",value:u,raw:`${s}${u}${s}`});continue}if(/[a-zA-Z_$]/.test(t)){let s="";for(;e<r.length&&/[a-zA-Z0-9_$]/.test(r[e]);)s+=r[e++];s==="true"?n.push({type:"BOOLEAN",value:!0,raw:s}):s==="false"?n.push({type:"BOOLEAN",value:!1,raw:s}):s==="null"?n.push({type:"NULL",value:null,raw:s}):s==="undefined"?n.push({type:"UNDEFINED",value:void 0,raw:s}):n.push({type:"IDENTIFIER",value:s,raw:s});continue}let a=r.slice(e,e+2),o=r.slice(e,e+3);if(o==="==="||o==="!=="){n.push({type:"OPERATOR",value:o,raw:o}),e+=3;continue}if(a==="=="||a==="!="||a==="<="||a===">="||a==="&&"||a==="||"){n.push({type:"OPERATOR",value:a,raw:a}),e+=2;continue}if(t==="("){n.push({type:"LPAREN",value:"(",raw:"("}),e++;continue}if(t===")"){n.push({type:"RPAREN",value:")",raw:")"}),e++;continue}if(t==="."){n.push({type:"DOT",value:".",raw:"."}),e++;continue}if("+-*/%<>!".includes(t)){n.push({type:"OPERATOR",value:t,raw:t}),e++;continue}throw new Error(`Unexpected character at position ${e}: ${t}`)}return n.push({type:"EOF",value:"",raw:""}),n}var i=class{tokens;pos=0;context;constructor(n,e){this.tokens=n,this.context=e}current(){return this.tokens[this.pos]}advance(){return this.tokens[this.pos++]}expect(n){let e=this.current();if(e.type!==n)throw new Error(`Expected ${n}, got ${e.type}`);return this.advance()}parse(){let n=this.parseExpression(0);if(this.current().type!=="EOF")throw new Error(`Unexpected token: ${this.current().raw}`);return n}parseExpression(n){let e=this.parseUnary();for(;;){let t=this.current();if(t.type!=="OPERATOR"||!l.has(t.value))break;let a=p[t.value];if(a<n)break;let o=this.advance().value,s=this.parseExpression(a+1);e=this.applyBinaryOperator(o,e,s)}return e}parseUnary(){let n=this.current();if(n.type==="OPERATOR"&&w.has(n.value)){let e=this.advance().value,t=this.parseUnary();return this.applyUnaryOperator(e,t)}return this.parsePrimary()}parsePrimary(){let n=this.current();switch(n.type){case"NUMBER":case"STRING":case"BOOLEAN":case"NULL":case"UNDEFINED":return this.advance(),n.value;case"IDENTIFIER":return this.parseIdentifier();case"LPAREN":this.advance();let e=this.parseExpression(0);return this.expect("RPAREN"),e;default:throw new Error(`Unexpected token: ${n.raw}`)}}parseIdentifier(){let n=this.context,e=this.advance().value;for(typeof n=="object"&&n!==null&&(e in n)?n=n[e]:n=void 0;this.current().type==="DOT";){this.advance();let t=this.expect("IDENTIFIER").value;n!=null&&typeof n=="object"?n=n[t]:n=void 0}return n}applyBinaryOperator(n,e,t){switch(n){case"===":return e===t;case"!==":return e!==t;case"==":return e==t;case"!=":return e!=t;case"<":return e<t;case">":return e>t;case"<=":return e<=t;case">=":return e>=t;case"&&":return e&&t;case"||":return e||t;case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return e/t;case"%":return e%t;default:throw new Error(`Unknown operator: ${n}`)}}applyUnaryOperator(n,e){switch(n){case"!":return!e;case"-":return-e;case"+":return+e;default:throw new Error(`Unknown unary operator: ${n}`)}}};function E(r,n={}){if(!r||typeof r!="string")throw new Error("Expression must be a non-empty string");let e=[/\beval\b/i,/\bFunction\b/,/\bconstructor\b/,/\b__proto__\b/,/\bprototype\b/,/\bimport\b/,/\brequire\b/,/\bprocess\b/,/\bglobal\b/,/\bwindow\b/,/\bdocument\b/,/\[\s*['"`]/,/\[.*\]/];for(let o of e)if(o.test(r))throw new Error(`Expression contains potentially dangerous pattern: ${r}`);let t=h(r.trim());return new i(t,n).parse()}function b(r,n={},e=!1){try{return!!E(r,n)}catch(t){return console.warn(`[SafeEvaluator] Failed to evaluate expression: ${r}`,t),e}}export{b as a};