agentic-qe 3.10.3 → 3.10.5

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 (370) hide show
  1. package/.claude/skills/qcsd-development-swarm/SKILL.md +27 -6
  2. package/.claude/skills/skills-manifest.json +1 -1
  3. package/CHANGELOG.md +104 -0
  4. package/assets/skills/skills-manifest.json +1 -1
  5. package/dist/arena/arena.d.ts +68 -0
  6. package/dist/arena/arena.js +169 -0
  7. package/dist/arena/mutator.d.ts +23 -0
  8. package/dist/arena/mutator.js +112 -0
  9. package/dist/arena/rng.d.ts +15 -0
  10. package/dist/arena/rng.js +34 -0
  11. package/dist/arena/runner.d.ts +44 -0
  12. package/dist/arena/runner.js +79 -0
  13. package/dist/cli/bundle.js +7 -7
  14. package/dist/cli/chunks/adapter-XZVL3DHO.js +2 -0
  15. package/dist/cli/chunks/{agent-booster-wasm-NGC6LSQP.js → agent-booster-wasm-3BC5LIEB.js} +2 -2
  16. package/dist/cli/chunks/{agent-handler-P2IJE4GK.js → agent-handler-QLXWVZZF.js} +2 -2
  17. package/dist/cli/chunks/{agent-memory-branch-JXRJ5GKQ.js → agent-memory-branch-3U5PDYW7.js} +2 -2
  18. package/dist/cli/chunks/aqe-learning-engine-YIL25K6W.js +2 -0
  19. package/dist/cli/chunks/arena-BMJQK4RD.js +18 -0
  20. package/dist/cli/chunks/arena-XENAGV4I.js +4 -0
  21. package/dist/cli/chunks/audit-WPIRUJNZ.js +3 -0
  22. package/dist/cli/chunks/base-YCYV23Q3.js +2 -0
  23. package/dist/cli/chunks/{hnswlib-node-64EGGWIC.js → better-sqlite3-6AGIBSVE.js} +2 -2
  24. package/dist/cli/chunks/{brain-handler-SACNDFSW.js → brain-handler-PHSWG5PR.js} +3 -3
  25. package/dist/cli/chunks/{branch-enumerator-LFOTVUDA.js → branch-enumerator-LNSYT34I.js} +2 -2
  26. package/dist/cli/chunks/{browser-FK7PRF3W.js → browser-M5BVQMBI.js} +2 -2
  27. package/dist/cli/chunks/browser-workflow-ALCOCRA2.js +2 -0
  28. package/dist/cli/chunks/{chunk-ZXQNE4QV.js → chunk-24A7KD3D.js} +1 -1
  29. package/dist/cli/chunks/{chunk-6Q2PPOOF.js → chunk-253TDTPH.js} +1 -1
  30. package/dist/cli/chunks/{chunk-MC7K44M4.js → chunk-2RLRPKCG.js} +2 -2
  31. package/dist/cli/chunks/{chunk-VRXY4T22.js → chunk-2UQWVF4P.js} +2 -2
  32. package/dist/cli/chunks/{chunk-UDV4YB42.js → chunk-2Z7HIT5I.js} +1 -1
  33. package/dist/cli/chunks/{chunk-CTDO2UB2.js → chunk-3BGGNHHZ.js} +1 -1
  34. package/dist/cli/chunks/{chunk-HWM2XJ3P.js → chunk-3JWV4GE6.js} +2 -2
  35. package/dist/cli/chunks/{chunk-BT3QLWII.js → chunk-3KGUP2SD.js} +2 -2
  36. package/dist/cli/chunks/{chunk-T63EK6GH.js → chunk-3WOQY6UL.js} +2 -2
  37. package/dist/cli/chunks/{chunk-QM65UGPV.js → chunk-4FTO3TPH.js} +2 -2
  38. package/dist/cli/chunks/{chunk-WWD5IWTV.js → chunk-4K7T6AKM.js} +1 -1
  39. package/dist/cli/chunks/{chunk-XTP2GHI7.js → chunk-4Z7XH4JE.js} +2 -2
  40. package/dist/cli/chunks/{chunk-FND6V2RV.js → chunk-54IPDQIZ.js} +8 -8
  41. package/dist/cli/chunks/{chunk-KTRB3L53.js → chunk-56RA6YPN.js} +2 -2
  42. package/dist/cli/chunks/{chunk-7YYTTWGY.js → chunk-5D7GLMT3.js} +1 -1
  43. package/dist/cli/chunks/{chunk-M5CDW2ZH.js → chunk-66LOFIBP.js} +2 -2
  44. package/dist/cli/chunks/{chunk-3X2ZQ55B.js → chunk-6SAU7GXO.js} +3 -3
  45. package/dist/cli/chunks/{chunk-DF3MJ2YL.js → chunk-75MP7JMV.js} +1 -1
  46. package/dist/cli/chunks/{chunk-RTDHWOAG.js → chunk-7DU35D4M.js} +1 -1
  47. package/dist/cli/chunks/{chunk-Q7EBD24B.js → chunk-7JZCEQFR.js} +1 -1
  48. package/dist/cli/chunks/{chunk-JXIPRMAY.js → chunk-A3BDPU5F.js} +4 -4
  49. package/dist/cli/chunks/{chunk-I42R57ON.js → chunk-A7HGS7FW.js} +2 -2
  50. package/dist/cli/chunks/{chunk-NNZMEYLT.js → chunk-AMBIOEMO.js} +1 -1
  51. package/dist/cli/chunks/{chunk-BO2OV2RH.js → chunk-AVQD7KEN.js} +2 -2
  52. package/dist/cli/chunks/{chunk-6GCOIIHY.js → chunk-AZCKTAUI.js} +2 -2
  53. package/dist/cli/chunks/{chunk-GL3HZN3O.js → chunk-B4F5EPNR.js} +1 -1
  54. package/dist/cli/chunks/{chunk-HAO3SPOE.js → chunk-BB7MEGXD.js} +2 -2
  55. package/dist/cli/chunks/{chunk-VDTFRMES.js → chunk-BSRCL6RU.js} +2 -2
  56. package/dist/cli/chunks/{chunk-RZCAA2PZ.js → chunk-CS3UB2OL.js} +1 -1
  57. package/dist/cli/chunks/{chunk-4OUAHZX2.js → chunk-CTG3GJIM.js} +2 -2
  58. package/dist/cli/chunks/{chunk-BWP3UVPE.js → chunk-CUAM34RQ.js} +3 -3
  59. package/dist/cli/chunks/chunk-CUY2EUSQ.js +2 -0
  60. package/dist/cli/chunks/{chunk-X2B7SANM.js → chunk-D3Q4443B.js} +1 -1
  61. package/dist/cli/chunks/{chunk-5IBJURYB.js → chunk-D4WDJ4ZF.js} +2 -2
  62. package/dist/cli/chunks/chunk-D7NKRCIL.js +2 -0
  63. package/dist/cli/chunks/{chunk-JP63XACW.js → chunk-DBR4TQPK.js} +2 -2
  64. package/dist/cli/chunks/{chunk-FLTPHVZ3.js → chunk-DIJ74M7V.js} +1 -1
  65. package/dist/cli/chunks/{chunk-PFCAMX6H.js → chunk-DJQYZ4RZ.js} +1 -1
  66. package/dist/cli/chunks/{chunk-5LON3MLI.js → chunk-DN65ILSI.js} +2 -2
  67. package/dist/cli/chunks/{chunk-6ZK24V2Y.js → chunk-DWLGFYXV.js} +2 -2
  68. package/dist/cli/chunks/{chunk-5EWWA4QP.js → chunk-EIL7FQC4.js} +6 -6
  69. package/dist/cli/chunks/{chunk-IRR7YA3Q.js → chunk-FE3FGMNB.js} +2 -2
  70. package/dist/cli/chunks/{chunk-ADV4DH3W.js → chunk-FLYFNNSN.js} +3 -3
  71. package/dist/cli/chunks/{chunk-SWOG3PBD.js → chunk-FNJZBIR3.js} +2 -2
  72. package/dist/cli/chunks/chunk-FPWA73N6.js +2 -0
  73. package/dist/cli/chunks/{chunk-NEYYLAYS.js → chunk-FW3C4LWU.js} +2 -2
  74. package/dist/cli/chunks/{chunk-5G5AAEFF.js → chunk-G4GX6YKX.js} +2 -2
  75. package/dist/cli/chunks/{chunk-NNVXHC74.js → chunk-G5UIGH4C.js} +3 -3
  76. package/dist/cli/chunks/{chunk-QEODION5.js → chunk-G6FP3S3G.js} +2 -2
  77. package/dist/cli/chunks/{chunk-ZG4P3DTL.js → chunk-GDUGW6FZ.js} +2 -2
  78. package/dist/cli/chunks/{chunk-GJUGSH7T.js → chunk-GKG6IQP6.js} +3 -3
  79. package/dist/cli/chunks/chunk-GMU7P5O3.js +2 -0
  80. package/dist/cli/chunks/{chunk-NRCL3WCP.js → chunk-GTVXVYKE.js} +2 -2
  81. package/dist/cli/chunks/{chunk-2ULVCLOW.js → chunk-HHEHGERJ.js} +2 -2
  82. package/dist/cli/chunks/{chunk-6FL3GN4T.js → chunk-HKJ3LG3N.js} +2 -2
  83. package/dist/cli/chunks/{chunk-E2BJT6A7.js → chunk-HNYSBE5J.js} +2 -2
  84. package/dist/cli/chunks/{chunk-JTZ3Q2QS.js → chunk-HPKYIK7R.js} +2 -2
  85. package/dist/cli/chunks/{chunk-GHNNJHH3.js → chunk-HRORJ352.js} +2 -2
  86. package/dist/cli/chunks/{chunk-5ER3COX3.js → chunk-IIFCTJOF.js} +2 -2
  87. package/dist/cli/chunks/{chunk-UIJFU4KD.js → chunk-IOE6LDPF.js} +2 -2
  88. package/dist/cli/chunks/{chunk-JD2PG4KS.js → chunk-IRS4HKAR.js} +1 -1
  89. package/dist/cli/chunks/{chunk-VIWIO27R.js → chunk-IT7CEHAJ.js} +2 -2
  90. package/dist/cli/chunks/{chunk-JE3C7JYN.js → chunk-IUKERFLT.js} +1 -1
  91. package/dist/cli/chunks/{chunk-YDKYLNKZ.js → chunk-IVKSZNMI.js} +1 -1
  92. package/dist/cli/chunks/{chunk-3RZL4QTT.js → chunk-IWRORKD7.js} +2 -2
  93. package/dist/cli/chunks/{chunk-NZHOKLII.js → chunk-J533CJUN.js} +3 -3
  94. package/dist/cli/chunks/{chunk-5SGEOO2F.js → chunk-JPOEI7CJ.js} +2 -2
  95. package/dist/cli/chunks/{chunk-MBSJ5G4I.js → chunk-JY7T2AQQ.js} +4 -4
  96. package/dist/cli/chunks/{chunk-4QFAUSWQ.js → chunk-K5KKZWED.js} +2 -2
  97. package/dist/cli/chunks/{chunk-L74CHKFR.js → chunk-KIMJPTHD.js} +2 -2
  98. package/dist/cli/chunks/{chunk-N7IBYDW5.js → chunk-MEN3UW7W.js} +1 -1
  99. package/dist/cli/chunks/{chunk-UHDBM7QS.js → chunk-MFQIJ3HV.js} +2 -2
  100. package/dist/cli/chunks/{chunk-SL6YZAT4.js → chunk-MGCW5FWH.js} +2 -2
  101. package/dist/cli/chunks/{chunk-U6UK3UMX.js → chunk-MIMJVKJJ.js} +3 -3
  102. package/dist/cli/chunks/{chunk-7ZSPCGTI.js → chunk-MJRYHHOG.js} +2 -2
  103. package/dist/cli/chunks/{chunk-FU77CDEM.js → chunk-MRXKIXVV.js} +2 -2
  104. package/dist/cli/chunks/{chunk-DY5KEOHX.js → chunk-MWPFUBXS.js} +2 -2
  105. package/dist/cli/chunks/{chunk-C6BBRM2J.js → chunk-N2TJXGHG.js} +1 -1
  106. package/dist/cli/chunks/{chunk-MQOFFRTA.js → chunk-NGSA53GC.js} +2 -2
  107. package/dist/cli/chunks/{chunk-YXH2CVAF.js → chunk-NKW7VOZV.js} +1 -1
  108. package/dist/cli/chunks/{chunk-YIYV2JB6.js → chunk-O5OOUMBB.js} +2 -2
  109. package/dist/cli/chunks/{chunk-HM523MTQ.js → chunk-OATHXZYW.js} +1 -1
  110. package/dist/cli/chunks/{chunk-WPVCSFDA.js → chunk-OJNG6ZXG.js} +2 -2
  111. package/dist/cli/chunks/{chunk-7SEHQTYD.js → chunk-PGNQR2VM.js} +1 -1
  112. package/dist/cli/chunks/{chunk-UZL366ZI.js → chunk-PPM5D7LH.js} +1 -1
  113. package/dist/cli/chunks/{chunk-ERYMAYJW.js → chunk-PYBVFG6T.js} +2 -2
  114. package/dist/cli/chunks/{chunk-FJGSEPFL.js → chunk-Q6BKJZTG.js} +2 -2
  115. package/dist/cli/chunks/chunk-QAW6RVAR.js +699 -0
  116. package/dist/cli/chunks/chunk-QTDZS4U6.js +2 -0
  117. package/dist/cli/chunks/{chunk-USFZ4IJD.js → chunk-R573V37S.js} +15 -15
  118. package/dist/cli/chunks/{chunk-Z2K5IZM6.js → chunk-RCAIOTIF.js} +2 -2
  119. package/dist/cli/chunks/{chunk-7RMZAVGO.js → chunk-RFNEEDPQ.js} +2 -2
  120. package/dist/cli/chunks/{chunk-IL2KOW5W.js → chunk-RFVZMNYX.js} +2 -2
  121. package/dist/cli/chunks/{chunk-B5MMDMH6.js → chunk-RLU7764Y.js} +2 -2
  122. package/dist/cli/chunks/chunk-RLZDXQNM.js +2 -0
  123. package/dist/cli/chunks/{chunk-QWG76RHA.js → chunk-RONMVGCT.js} +2 -2
  124. package/dist/cli/chunks/{chunk-X3RJ6SFC.js → chunk-RR55MLD4.js} +1 -1
  125. package/dist/cli/chunks/{chunk-PL5SLO2W.js → chunk-RUQV3BTV.js} +1 -1
  126. package/dist/cli/chunks/{chunk-NXPFGPHV.js → chunk-RZ7D5SHS.js} +1 -1
  127. package/dist/cli/chunks/{chunk-3LRK7PYN.js → chunk-S73KENCH.js} +2 -2
  128. package/dist/cli/chunks/{chunk-3HBWDG62.js → chunk-S7FGTHFE.js} +2 -2
  129. package/dist/cli/chunks/{chunk-CAMEFWRK.js → chunk-S7HQOGVD.js} +1 -1
  130. package/dist/cli/chunks/{chunk-PZHZPX3O.js → chunk-SK6YRNXI.js} +2 -2
  131. package/dist/cli/chunks/{chunk-JTF6D2RJ.js → chunk-SXQIH2QA.js} +2 -2
  132. package/dist/cli/chunks/{chunk-6B4S7PKP.js → chunk-TISBFSDJ.js} +1 -1
  133. package/dist/cli/chunks/{chunk-72LE6PHL.js → chunk-TMD6IC6D.js} +2 -2
  134. package/dist/cli/chunks/{chunk-YDDZJCKY.js → chunk-TMTLWSSA.js} +1 -1
  135. package/dist/cli/chunks/{chunk-HQJMCTWN.js → chunk-UOIT5JZ6.js} +2 -2
  136. package/dist/cli/chunks/{chunk-OPDTDKN3.js → chunk-UTORITJT.js} +2 -2
  137. package/dist/cli/chunks/{chunk-3JAOFKEU.js → chunk-VB7DZVCI.js} +1 -1
  138. package/dist/cli/chunks/{chunk-2L73WXA4.js → chunk-VC256KH2.js} +2 -2
  139. package/dist/cli/chunks/{chunk-SNTMAVPH.js → chunk-VESYE5YO.js} +3 -3
  140. package/dist/cli/chunks/{chunk-YYAPO3CU.js → chunk-VKWDMOR4.js} +2 -2
  141. package/dist/cli/chunks/{chunk-HRLXU4LH.js → chunk-VWN66V7U.js} +2 -2
  142. package/dist/cli/chunks/{chunk-CNEWYJKT.js → chunk-W5C7R2LS.js} +3 -3
  143. package/dist/cli/chunks/{chunk-JLL27IGU.js → chunk-W7KGHW4T.js} +2 -2
  144. package/dist/cli/chunks/{chunk-H56AROF2.js → chunk-WFZ4DRIC.js} +2 -2
  145. package/dist/cli/chunks/{chunk-4CYLSXA6.js → chunk-WFZUKXV5.js} +2 -2
  146. package/dist/cli/chunks/{chunk-AEJVOJPT.js → chunk-X4B3R3ZZ.js} +2 -2
  147. package/dist/cli/chunks/{chunk-KG5SM36Y.js → chunk-XI6ZZMX7.js} +1 -1
  148. package/dist/cli/chunks/{chunk-R5ONQAQL.js → chunk-YEO2Z3UX.js} +2 -2
  149. package/dist/cli/chunks/{chunk-D2FBUOAR.js → chunk-YZD4VIE5.js} +1 -1
  150. package/dist/cli/chunks/{chunk-U7NMPZE2.js → chunk-YZFNPTGN.js} +2 -2
  151. package/dist/cli/chunks/{chunk-OX4R55T3.js → chunk-ZCYKWEAM.js} +2 -2
  152. package/dist/cli/chunks/{chunk-OG7CWWFR.js → chunk-ZG3DSWUA.js} +1 -1
  153. package/dist/cli/chunks/{chunk-EETVN2OJ.js → chunk-ZS4BGJJV.js} +1 -1
  154. package/dist/cli/chunks/{chunk-LZ6TNTGO.js → chunk-ZT7JSFGT.js} +2 -2
  155. package/dist/cli/chunks/{chunk-HMFEPKAR.js → chunk-ZTC64OJE.js} +2 -2
  156. package/dist/cli/chunks/{chunk-RNF47IJ5.js → chunk-ZUBJBAUD.js} +15 -15
  157. package/dist/cli/chunks/{ci-AWZ3S5OT.js → ci-M2BSQBLL.js} +2 -2
  158. package/dist/cli/chunks/{ci-output-JLCYTIMT.js → ci-output-Z4TMK6GZ.js} +2 -2
  159. package/dist/cli/chunks/{circuit-breaker-BJDKBDIL.js → circuit-breaker-E3G4GGWB.js} +2 -2
  160. package/dist/cli/chunks/{claude-flow-setup-KKOP5ZMO.js → claude-flow-setup-MASRQU54.js} +2 -2
  161. package/dist/cli/chunks/client-RPB6RYVY.js +2 -0
  162. package/dist/cli/chunks/{cline-installer-7M525SEA.js → cline-installer-P3BWAKQA.js} +2 -2
  163. package/dist/cli/chunks/{code-27SUVJDO.js → code-7HY5HQAV.js} +2 -2
  164. package/dist/cli/chunks/{code-index-extractor-TTQQZLAK.js → code-index-extractor-MBVKLOEU.js} +2 -2
  165. package/dist/cli/chunks/{codex-installer-GHNGNPKP.js → codex-installer-WZ6QO2PH.js} +2 -2
  166. package/dist/cli/chunks/{completions-JPJD24DG.js → completions-TOJC2UFP.js} +2 -2
  167. package/dist/cli/chunks/{complexity-analyzer-Q74EJV33.js → complexity-analyzer-QYVDIAAW.js} +2 -2
  168. package/dist/cli/chunks/{continuedev-installer-ULTRDIML.js → continuedev-installer-J72CV7P4.js} +2 -2
  169. package/dist/cli/chunks/{copilot-installer-EK52X4CG.js → copilot-installer-ACDA3GEA.js} +2 -2
  170. package/dist/cli/chunks/core-handlers-QFJT5NX6.js +2 -0
  171. package/dist/cli/chunks/{cost-tracker-2GKBRYXL.js → cost-tracker-BAYQJELE.js} +2 -2
  172. package/dist/cli/chunks/{coverage-YCLC3W2A.js → coverage-QD3XJV6W.js} +3 -3
  173. package/dist/cli/chunks/cross-domain-router-5GJ7WZKX.js +2 -0
  174. package/dist/cli/chunks/{cursor-installer-B3ALFW5E.js → cursor-installer-SPGZ4TQM.js} +2 -2
  175. package/dist/cli/chunks/{daemon-ZKEBVLJA.js → daemon-3EVOL2UH.js} +3 -3
  176. package/dist/cli/chunks/daemon-N4JKD5SO.js +10 -0
  177. package/dist/cli/chunks/{dag-attention-scheduler-OQPJ6ULA.js → dag-attention-scheduler-3BVLL3L5.js} +2 -2
  178. package/dist/cli/chunks/{detect-YMYIQH3Q.js → detect-SWACKB45.js} +2 -2
  179. package/dist/cli/chunks/{dist-node-R4FAYQRY.js → dist-node-LU4E7PI6.js} +2 -2
  180. package/dist/cli/chunks/{domain-handler-IGWXLF2S.js → domain-handler-5AKKAC43.js} +2 -2
  181. package/dist/cli/chunks/{domain-transfer-A7YNO76C.js → domain-transfer-LB6H7RPX.js} +2 -2
  182. package/dist/cli/chunks/dream-C6VNLTON.js +2 -0
  183. package/dist/cli/chunks/{embed-and-insert-pattern-KODZAS7Y.js → embed-and-insert-pattern-7RBA5NDK.js} +2 -2
  184. package/dist/cli/chunks/{eval-ALQW7Q2S.js → eval-ZZFPRENX.js} +5 -5
  185. package/dist/cli/chunks/{experience-capture-middleware-3WK4RXWK.js → experience-capture-middleware-HRO3EGIW.js} +3 -3
  186. package/dist/cli/chunks/{fast-paths-PQWDFIJZ.js → fast-paths-IRRNQBTY.js} +2 -2
  187. package/dist/cli/chunks/{feature-flags-JRUAZCND.js → feature-flags-R5N5IWI2.js} +2 -2
  188. package/dist/cli/chunks/{feature-flags-6X33B3WX.js → feature-flags-W54ABAUA.js} +2 -2
  189. package/dist/cli/chunks/{file-discovery-SA3YU3IH.js → file-discovery-6CIDLVID.js} +2 -2
  190. package/dist/cli/chunks/{fleet-7TXCAOKQ.js → fleet-YTFN64WE.js} +3 -3
  191. package/dist/cli/chunks/{gnn-wrapper-ZKNYACEC.js → gnn-wrapper-RXMPLMV2.js} +2 -2
  192. package/dist/cli/chunks/{heartbeat-handler-KRZRZ23F.js → heartbeat-handler-HQQWEEQQ.js} +4 -4
  193. package/dist/cli/chunks/heartbeat-scheduler-4SBO27BG.js +2 -0
  194. package/dist/cli/chunks/hnsw-adapter-W7G6VNXW.js +2 -0
  195. package/dist/cli/chunks/hnsw-index-LENA5QML.js +2 -0
  196. package/dist/cli/chunks/{hnsw-legacy-bridge-LVHQ5SG7.js → hnsw-legacy-bridge-GPZIKYFD.js} +2 -2
  197. package/dist/cli/chunks/{better-sqlite3-HP4JZS6K.js → hnswlib-node-P6HSEFLW.js} +2 -2
  198. package/dist/cli/chunks/hooks-AYLAGFOK.js +285 -0
  199. package/dist/cli/chunks/hybrid-router-IXHIC45P.js +2 -0
  200. package/dist/cli/chunks/{hypergraph-engine-2EZBZMFK.js → hypergraph-engine-56FMXI3T.js} +2 -2
  201. package/dist/cli/chunks/{hypergraph-handler-GLPWYII2.js → hypergraph-handler-APEVT5IE.js} +3 -3
  202. package/dist/cli/chunks/impact-analyzer-DKGVMYU6.js +2 -0
  203. package/dist/cli/chunks/{init-handler-ZSDO5VMA.js → init-handler-5DWF4REQ.js} +6 -6
  204. package/dist/cli/chunks/init-wizard-BBY3LY3F.js +2 -0
  205. package/dist/cli/chunks/kernel-7CUW7G62.js +2 -0
  206. package/dist/cli/chunks/{kilocode-installer-ATYSDWIV.js → kilocode-installer-XKAUA5VA.js} +2 -2
  207. package/dist/cli/chunks/{kiro-installer-K66YT6PC.js → kiro-installer-NI2KIYJE.js} +2 -2
  208. package/dist/cli/chunks/knowledge-graph-Q5CP47IP.js +2 -0
  209. package/dist/cli/chunks/{learning-BVYCC4RI.js → learning-ZIUMUNXZ.js} +3 -3
  210. package/dist/cli/chunks/{llm-router-VBCXE6DN.js → llm-router-IL52EF2V.js} +4 -4
  211. package/dist/cli/chunks/llm-router-service-MTXCX7TO.js +2 -0
  212. package/dist/cli/chunks/{load-AREDQE2U.js → load-B5LFYD6O.js} +2 -2
  213. package/dist/cli/chunks/load-test-YBWXASBO.js +2 -0
  214. package/dist/cli/chunks/{mcp-NG6H6UC5.js → mcp-K6GZLWBC.js} +2 -2
  215. package/dist/cli/chunks/{memory-Y65EHG6N.js → memory-NCQRVSN6.js} +5 -5
  216. package/dist/cli/chunks/memory-backend-52LANEA3.js +2 -0
  217. package/dist/cli/chunks/memory-handlers-KFW3HYAP.js +2 -0
  218. package/dist/cli/chunks/{multi-model-executor-VRPRFUZT.js → multi-model-executor-R4LBSJWK.js} +2 -2
  219. package/dist/cli/chunks/{opencode-installer-CKQXPM5R.js → opencode-installer-I6CBR3PV.js} +2 -2
  220. package/dist/cli/chunks/{orchestrator-I7JBKD6G.js → orchestrator-5FXUCES6.js} +10 -10
  221. package/dist/cli/chunks/{pipeline-MV2RWCBI.js → pipeline-GDKCTXJH.js} +2 -2
  222. package/dist/cli/chunks/{platform-VU5P3SOG.js → platform-ZFY3F4T3.js} +2 -2
  223. package/dist/cli/chunks/{plugin-6TERLKCB.js → plugin-HQMEN3OS.js} +2 -2
  224. package/dist/cli/chunks/{prime-radiant-advanced-wasm-WIUIN2DL.js → prime-radiant-advanced-wasm-LSJGF4CV.js} +2 -2
  225. package/dist/cli/chunks/protocol-executor-TRYUS77M.js +2 -0
  226. package/dist/cli/chunks/{protocol-handler-HKWBGARO.js → protocol-handler-BMDNIGPP.js} +2 -2
  227. package/dist/cli/chunks/{prove-7CQPHBRJ.js → prove-ABVGAG4Z.js} +2 -2
  228. package/dist/cli/chunks/provider-manager-6XQQN7FX.js +2 -0
  229. package/dist/cli/chunks/qe-reasoning-bank-3IUPE4DJ.js +2 -0
  230. package/dist/cli/chunks/{quality-VLUVXKVG.js → quality-ENJXPNP5.js} +2 -2
  231. package/dist/cli/chunks/queen-coordinator-VWPH4XPX.js +2 -0
  232. package/dist/cli/chunks/{real-embeddings-JPZ64KK2.js → real-embeddings-W3GNAEJO.js} +2 -2
  233. package/dist/cli/chunks/{roocode-installer-NONVB3UE.js → roocode-installer-4FJNQ7PU.js} +2 -2
  234. package/dist/cli/chunks/router-OIB6ODHA.js +2 -0
  235. package/dist/cli/chunks/routing-feedback-EKYPCZYG.js +2 -0
  236. package/dist/cli/chunks/{routing-handler-YYXDT4J2.js → routing-handler-GFS5FA4F.js} +2 -2
  237. package/dist/cli/chunks/{ruvector-commands-5PFMNDLR.js → ruvector-commands-GBMYNJKN.js} +2 -2
  238. package/dist/cli/chunks/{rvf-dual-writer-TF6H7AXH.js → rvf-dual-writer-STUAQT6U.js} +2 -2
  239. package/dist/cli/chunks/{rvf-migration-adapter-VNGIUZCO.js → rvf-migration-adapter-LO6DBNJH.js} +2 -2
  240. package/dist/cli/chunks/{rvf-migration-coordinator-VA52YAIY.js → rvf-migration-coordinator-I5AD4VJ2.js} +2 -2
  241. package/dist/cli/chunks/rvf-native-adapter-7RXP2Q4Q.js +2 -0
  242. package/dist/cli/chunks/safe-db-MNKFEPBX.js +2 -0
  243. package/dist/cli/chunks/schedule-AJXABVXX.js +2 -0
  244. package/dist/cli/chunks/scheduler-LDWYHIAW.js +2 -0
  245. package/dist/cli/chunks/{security-62HEETBF.js → security-X3WCA5K5.js} +3 -3
  246. package/dist/cli/chunks/shared-rvf-adapter-Z4FSPWNP.js +2 -0
  247. package/dist/cli/chunks/{shared-rvf-dual-writer-JTZK7LRD.js → shared-rvf-dual-writer-QOPOIRIC.js} +2 -2
  248. package/dist/cli/chunks/sqlite-persistence-A6GKDMOJ.js +2 -0
  249. package/dist/cli/chunks/{status-handler-LSUPUKRF.js → status-handler-B2B5QBVK.js} +2 -2
  250. package/dist/cli/chunks/{structural-health-Z75A666N.js → structural-health-KT47LBVH.js} +2 -2
  251. package/dist/cli/chunks/sync-CKID22IW.js +2 -0
  252. package/dist/cli/chunks/{sync-M3O4T3A3.js → sync-VWD6OOUR.js} +2 -2
  253. package/dist/cli/chunks/{task-handler-AQBSZAQC.js → task-handler-X5JT5YBF.js} +2 -2
  254. package/dist/cli/chunks/{task-handlers-BOZP247V.js → task-handlers-IW4GQDW4.js} +3 -3
  255. package/dist/cli/chunks/{test-FTEGPNN2.js → test-MBZSUASD.js} +4 -4
  256. package/dist/cli/chunks/{test-scheduling-IGR4U2VQ.js → test-scheduling-E5KHKRZS.js} +3 -3
  257. package/dist/cli/chunks/token-bootstrap-TIDPJ5IG.js +2 -0
  258. package/dist/cli/chunks/{token-usage-VCHV47EO.js → token-usage-ECJSPOQB.js} +2 -2
  259. package/dist/cli/chunks/{transformers-M27QSNFH.js → transformers-UZJAQ7OZ.js} +2 -2
  260. package/dist/cli/chunks/{tree-sitter-wasm-parser-IIGEJYFU.js → tree-sitter-wasm-parser-H6BU2E5R.js} +2 -2
  261. package/dist/cli/chunks/{types-RQFPUUKA.js → types-PM7NT3MH.js} +2 -2
  262. package/dist/cli/chunks/unified-memory-27QJHABO.js +2 -0
  263. package/dist/cli/chunks/unified-memory-hnsw-76VUXR4H.js +2 -0
  264. package/dist/cli/chunks/unified-persistence-QRCGDEXH.js +2 -0
  265. package/dist/cli/chunks/{upgrade-VJMYX3AL.js → upgrade-FS2XYC2P.js} +2 -2
  266. package/dist/cli/chunks/{validate-ML7HUAU5.js → validate-4Y2BNN3A.js} +3 -3
  267. package/dist/cli/chunks/{validate-swarm-RCR6EYRC.js → validate-swarm-Z7QXZSUE.js} +4 -4
  268. package/dist/cli/chunks/{vibium-ZOOS3W5L.js → vibium-VZ6L3O2G.js} +2 -2
  269. package/dist/cli/chunks/visual-security-KB27O7BE.js +2 -0
  270. package/dist/cli/chunks/{web-tree-sitter-2YPGYLWK.js → web-tree-sitter-H7P37W5U.js} +2 -2
  271. package/dist/cli/chunks/{windsurf-installer-GOJWUWC5.js → windsurf-installer-IB2VHSZS.js} +2 -2
  272. package/dist/cli/chunks/{witness-chain-3MGSS3Q4.js → witness-chain-C4DISYJN.js} +2 -2
  273. package/dist/cli/chunks/witness-chain-EYPXHRDV.js +2 -0
  274. package/dist/cli/chunks/{workflow-B5Q77BI4.js → workflow-IGM7KVIO.js} +4 -4
  275. package/dist/cli/chunks/workflow-orchestrator-6AQZ3USU.js +2 -0
  276. package/dist/cli/chunks/wrappers-PQXC263L.js +2 -0
  277. package/dist/cli/commands/arena.d.ts +10 -0
  278. package/dist/cli/commands/arena.js +129 -0
  279. package/dist/cli/commands/hooks-handlers/command-hooks.js +38 -2
  280. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.d.ts +4 -0
  281. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +66 -3
  282. package/dist/cli/commands/hooks-handlers/nesting-provenance.d.ts +27 -0
  283. package/dist/cli/commands/hooks-handlers/nesting-provenance.js +46 -0
  284. package/dist/cli/commands/hooks-handlers/task-hooks.js +72 -1
  285. package/dist/cli/commands/hooks-handlers/tool-loop-guardrail.d.ts +71 -0
  286. package/dist/cli/commands/hooks-handlers/tool-loop-guardrail.js +142 -0
  287. package/dist/cli/index.js +17 -0
  288. package/dist/contracts/verdicts.d.ts +297 -0
  289. package/dist/contracts/verdicts.js +178 -0
  290. package/dist/coordination/queen-types.d.ts +4 -0
  291. package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +15 -6
  292. package/dist/integrations/agentic-flow/reasoning-bank/trajectory-tracker.js +12 -0
  293. package/dist/integrations/ruvector/shared-rvf-adapter.js +12 -1
  294. package/dist/integrations/ruvector/shared-rvf-dual-writer.js +6 -2
  295. package/dist/kernel/project-root.d.ts +33 -0
  296. package/dist/kernel/project-root.js +86 -0
  297. package/dist/kernel/unified-memory.d.ts +2 -19
  298. package/dist/kernel/unified-memory.js +8 -64
  299. package/dist/learning/local-judge-client.d.ts +55 -0
  300. package/dist/learning/local-judge-client.js +127 -0
  301. package/dist/learning/nagual-client.d.ts +73 -0
  302. package/dist/learning/nagual-client.js +150 -0
  303. package/dist/learning/pattern-store.js +10 -3
  304. package/dist/mcp/bundle.js +393 -391
  305. package/dist/mcp/entry.js +44 -33
  306. package/dist/mcp/handlers/core-handlers.d.ts +20 -0
  307. package/dist/mcp/handlers/core-handlers.js +28 -0
  308. package/dist/mcp/handlers/domain-handler-configs.d.ts +3 -0
  309. package/dist/mcp/handlers/domain-handler-configs.js +22 -10
  310. package/dist/mcp/transport/stdio.d.ts +7 -0
  311. package/dist/mcp/transport/stdio.js +39 -2
  312. package/dist/shared/llm/cost-tracker.js +6 -2
  313. package/dist/shared/llm/interfaces.d.ts +4 -0
  314. package/dist/shared/llm/providers/claude.js +16 -2
  315. package/dist/shared/reasoning-scrub.d.ts +29 -0
  316. package/dist/shared/reasoning-scrub.js +75 -0
  317. package/dist/workers/daemon.js +2 -0
  318. package/dist/workers/quality-daemon/git-watcher.js +2 -0
  319. package/dist/workers/quality-daemon/index.js +2 -0
  320. package/dist/workers/worker-manager.js +4 -0
  321. package/package.json +1 -1
  322. package/dist/cli/chunks/adapter-BHPUKMJ5.js +0 -2
  323. package/dist/cli/chunks/aqe-learning-engine-JQ5WD2HM.js +0 -2
  324. package/dist/cli/chunks/audit-BMQ3VESB.js +0 -3
  325. package/dist/cli/chunks/base-E32WLGY2.js +0 -2
  326. package/dist/cli/chunks/browser-workflow-LNNXXAJG.js +0 -2
  327. package/dist/cli/chunks/chunk-2EQVYYBF.js +0 -2
  328. package/dist/cli/chunks/chunk-3VF3HCG4.js +0 -2
  329. package/dist/cli/chunks/chunk-GELF4ILR.js +0 -699
  330. package/dist/cli/chunks/chunk-JOLDCS6X.js +0 -2
  331. package/dist/cli/chunks/chunk-JSFYPLMQ.js +0 -2
  332. package/dist/cli/chunks/chunk-YX2HY4MX.js +0 -2
  333. package/dist/cli/chunks/client-2UKBYFX4.js +0 -2
  334. package/dist/cli/chunks/cross-domain-router-FPM3L27L.js +0 -2
  335. package/dist/cli/chunks/daemon-YWINEHG4.js +0 -10
  336. package/dist/cli/chunks/dream-XM33US3V.js +0 -2
  337. package/dist/cli/chunks/heartbeat-scheduler-GM3M2MTG.js +0 -2
  338. package/dist/cli/chunks/hnsw-adapter-K62GEHIL.js +0 -2
  339. package/dist/cli/chunks/hnsw-index-VCAK3TWN.js +0 -2
  340. package/dist/cli/chunks/hooks-6Y3UHYI2.js +0 -248
  341. package/dist/cli/chunks/hybrid-router-432QNCNG.js +0 -2
  342. package/dist/cli/chunks/impact-analyzer-VTSISNN4.js +0 -2
  343. package/dist/cli/chunks/init-wizard-COB5AH7Q.js +0 -2
  344. package/dist/cli/chunks/kernel-ROK7X5FM.js +0 -2
  345. package/dist/cli/chunks/knowledge-graph-YUWIDIWW.js +0 -2
  346. package/dist/cli/chunks/llm-router-service-7VLXJ7VE.js +0 -2
  347. package/dist/cli/chunks/load-test-32524DL3.js +0 -2
  348. package/dist/cli/chunks/memory-backend-BI2V5AAB.js +0 -2
  349. package/dist/cli/chunks/memory-handlers-NSOFWVFN.js +0 -2
  350. package/dist/cli/chunks/protocol-executor-2UPB7SPI.js +0 -2
  351. package/dist/cli/chunks/provider-manager-PDT37MIJ.js +0 -2
  352. package/dist/cli/chunks/qe-reasoning-bank-AQQ2BI4V.js +0 -2
  353. package/dist/cli/chunks/queen-coordinator-6DVDVEU4.js +0 -2
  354. package/dist/cli/chunks/router-O2G4KQ6L.js +0 -2
  355. package/dist/cli/chunks/routing-feedback-TAGTD3KQ.js +0 -2
  356. package/dist/cli/chunks/rvf-native-adapter-46GRWQJR.js +0 -2
  357. package/dist/cli/chunks/safe-db-LNIPXXHH.js +0 -2
  358. package/dist/cli/chunks/schedule-AUH3ZALY.js +0 -2
  359. package/dist/cli/chunks/scheduler-KK3OYPWW.js +0 -2
  360. package/dist/cli/chunks/shared-rvf-adapter-XWTQPGCT.js +0 -2
  361. package/dist/cli/chunks/sqlite-persistence-CYESP7NG.js +0 -2
  362. package/dist/cli/chunks/sync-VI37UHHH.js +0 -2
  363. package/dist/cli/chunks/token-bootstrap-2DFRVMBM.js +0 -2
  364. package/dist/cli/chunks/unified-memory-RISHEANP.js +0 -2
  365. package/dist/cli/chunks/unified-memory-hnsw-2IKXGMNZ.js +0 -2
  366. package/dist/cli/chunks/unified-persistence-ZTTUJNTU.js +0 -2
  367. package/dist/cli/chunks/visual-security-D66DTAO5.js +0 -2
  368. package/dist/cli/chunks/witness-chain-RHWHHDLV.js +0 -2
  369. package/dist/cli/chunks/workflow-orchestrator-OQMFW2TC.js +0 -2
  370. package/dist/cli/chunks/wrappers-MM5VLEPG.js +0 -2
package/dist/mcp/entry.js CHANGED
@@ -47,42 +47,53 @@ async function main() {
47
47
  }
48
48
  catch { /* ignore */ }
49
49
  };
50
- process.on('SIGINT', async () => {
51
- stopCleanupTimer();
52
- await shutdownTokenTracking();
53
- await shutdownDaemon();
54
- if (httpServer) {
55
- await httpServer.stop();
56
- }
57
- if (server) {
58
- await server.stop();
59
- }
60
- // Close data stores AFTER server has drained connections
61
- try {
62
- const { resetSharedRvfDualWriter } = await import('../integrations/ruvector/shared-rvf-dual-writer.js');
63
- resetSharedRvfDualWriter();
64
- }
65
- catch { /* ignore */ }
66
- process.exit(0);
67
- });
68
- process.on('SIGTERM', async () => {
69
- stopCleanupTimer();
70
- await shutdownTokenTracking();
71
- await shutdownDaemon();
72
- if (httpServer) {
73
- await httpServer.stop();
74
- }
75
- if (server) {
76
- await server.stop();
77
- }
78
- // Close data stores AFTER server has drained connections
50
+ // Issue #513: single idempotent shutdown shared by every termination trigger
51
+ // (signals + stdin EOF). A re-entrancy guard prevents overlapping runs, and
52
+ // an unref()'d watchdog guarantees the process exits even if a graceful step
53
+ // hangs — the old async SIGTERM handler could stall on an await that never
54
+ // resolved, which is why `kill <pid>` appeared to be "ignored" and only
55
+ // `kill -9` worked.
56
+ let shuttingDown = false;
57
+ const shutdown = async (reason) => {
58
+ if (shuttingDown)
59
+ return;
60
+ shuttingDown = true;
61
+ originalStderrWrite(`[AQE] Shutting down (${reason})\n`);
62
+ const watchdog = setTimeout(() => {
63
+ originalStderrWrite('[AQE] Shutdown watchdog fired — forcing exit\n');
64
+ process.exit(0);
65
+ }, 3000);
66
+ watchdog.unref();
79
67
  try {
80
- const { resetSharedRvfDualWriter } = await import('../integrations/ruvector/shared-rvf-dual-writer.js');
81
- resetSharedRvfDualWriter();
68
+ stopCleanupTimer();
69
+ await shutdownTokenTracking();
70
+ await shutdownDaemon();
71
+ if (httpServer) {
72
+ await httpServer.stop();
73
+ }
74
+ if (server) {
75
+ await server.stop();
76
+ }
77
+ // Close data stores AFTER server has drained connections
78
+ try {
79
+ const { resetSharedRvfDualWriter } = await import('../integrations/ruvector/shared-rvf-dual-writer.js');
80
+ resetSharedRvfDualWriter();
81
+ }
82
+ catch { /* ignore */ }
82
83
  }
83
- catch { /* ignore */ }
84
+ catch { /* best-effort — the watchdog still guarantees exit */ }
84
85
  process.exit(0);
85
- });
86
+ };
87
+ process.on('SIGINT', () => { void shutdown('SIGINT'); });
88
+ process.on('SIGTERM', () => { void shutdown('SIGTERM'); });
89
+ // Issue #513: when the parent (e.g. the Claude Code session) exits, our stdin
90
+ // reaches EOF. An orphaned stdio MCP server has no parent to serve, so exit
91
+ // instead of lingering at high CPU. Guarded to a piped stdin so an
92
+ // interactive TTY debug session (Ctrl-D) is unaffected.
93
+ if (!process.stdin.isTTY) {
94
+ process.stdin.on('end', () => { void shutdown('stdin-eof'); });
95
+ process.stdin.on('close', () => { void shutdown('stdin-close'); });
96
+ }
86
97
  // Catch unhandled exceptions/rejections to prevent MCP connection drops
87
98
  process.on('uncaughtException', (error) => {
88
99
  process.stderr.write(`[AQE] FATAL uncaught exception: ${error.message}\n`);
@@ -37,6 +37,26 @@ export declare function getFleetState(): FleetState;
37
37
  * Check if fleet is initialized
38
38
  */
39
39
  export declare function isFleetInitialized(): boolean;
40
+ /**
41
+ * Adopt already-initialized components into the fleet state.
42
+ *
43
+ * The CLI's autoInitialize() builds the same kernel/queen/router stack as
44
+ * handleFleetInit but kept it in its own CLIContext, so every handler guarded
45
+ * by isFleetInitialized() (memory, agent, task, team, pipeline) rejected CLI
46
+ * invocations with "Fleet not initialized" even after a successful auto-init.
47
+ * Bridging the components here gives the MCP server and the CLI one shared
48
+ * fleet state (MCP-CLI parity).
49
+ *
50
+ * Idempotent: if a fleet is already initialized, returns the existing fleetId
51
+ * without touching state.
52
+ */
53
+ export declare function adoptExternalFleet(components: {
54
+ kernel: QEKernel;
55
+ queen: QueenCoordinator;
56
+ router?: CrossDomainEventRouter | null;
57
+ workflowOrchestrator?: WorkflowOrchestrator | null;
58
+ topology?: TopologyType;
59
+ }): string;
40
60
  /**
41
61
  * Get the current fleet topology
42
62
  */
@@ -42,6 +42,34 @@ export function getFleetState() {
42
42
  export function isFleetInitialized() {
43
43
  return state.initialized && state.kernel !== null && state.queen !== null;
44
44
  }
45
+ /**
46
+ * Adopt already-initialized components into the fleet state.
47
+ *
48
+ * The CLI's autoInitialize() builds the same kernel/queen/router stack as
49
+ * handleFleetInit but kept it in its own CLIContext, so every handler guarded
50
+ * by isFleetInitialized() (memory, agent, task, team, pipeline) rejected CLI
51
+ * invocations with "Fleet not initialized" even after a successful auto-init.
52
+ * Bridging the components here gives the MCP server and the CLI one shared
53
+ * fleet state (MCP-CLI parity).
54
+ *
55
+ * Idempotent: if a fleet is already initialized, returns the existing fleetId
56
+ * without touching state.
57
+ */
58
+ export function adoptExternalFleet(components) {
59
+ if (isFleetInitialized()) {
60
+ return state.fleetId;
61
+ }
62
+ state.fleetId = `fleet-${uuidv4().slice(0, 8)}`;
63
+ state.kernel = components.kernel;
64
+ state.queen = components.queen;
65
+ state.router = components.router ?? null;
66
+ state.workflowOrchestrator = components.workflowOrchestrator ?? null;
67
+ state.initialized = true;
68
+ state.initTime = new Date();
69
+ state.topology = components.topology ?? 'hierarchical';
70
+ state.agentLevels.clear();
71
+ return state.fleetId;
72
+ }
45
73
  /**
46
74
  * Get the current fleet topology
47
75
  */
@@ -8,6 +8,7 @@
8
8
  */
9
9
  import { DomainHandlerConfig } from './handler-factory';
10
10
  import { TestGenerateParams, TestGenerateResult, TestExecuteParams, CoverageAnalyzeParams, CoverageAnalyzeResult, QualityAssessParams, SecurityScanParams, ContractValidateParams, AccessibilityTestParams, ChaosTestParams } from '../types';
11
+ import { type RiskDecision } from '../../contracts/verdicts.js';
11
12
  export interface TestExecuteResult {
12
13
  taskId: string;
13
14
  status: string;
@@ -32,6 +33,8 @@ export interface QualityAssessResult {
32
33
  recommendations: string[];
33
34
  duration: number;
34
35
  savedFiles?: string[];
36
+ /** ADR-103: versioned, schema-validated gate verdict (additive) */
37
+ riskDecision?: RiskDecision;
35
38
  }
36
39
  export interface SecurityScanResult {
37
40
  taskId: string;
@@ -9,6 +9,7 @@
9
9
  import { generateV2LearningFeedback, analyzeComplexity, generateV2AIInsights, generateV2Tests, detectAntiPatterns, generateTestId, } from './handler-factory';
10
10
  import { MetricsCollector } from '../metrics';
11
11
  import { DEFAULT_FRAMEWORKS, FRAMEWORK_TO_LANGUAGE, } from '../../shared/types/test-frameworks.js';
12
+ import { buildRiskDecisionFromQualityGate, validateRiskDecision, } from '../../contracts/verdicts.js';
12
13
  const SUPPORTED_LANGUAGES = Object.keys(DEFAULT_FRAMEWORKS);
13
14
  /**
14
15
  * Normalize a language string from MCP input. Returns the canonical
@@ -348,16 +349,27 @@ export const qualityAssessConfig = {
348
349
  useAgentBooster: routingResult?.useAgentBooster,
349
350
  compiledContext: routingResult?.compiledContext,
350
351
  }),
351
- mapToResult: (taskId, data, duration, savedFiles) => ({
352
- taskId,
353
- status: 'completed',
354
- qualityScore: data.qualityScore || 0,
355
- passed: data.passed || false,
356
- metrics: data.metrics || {},
357
- recommendations: data.recommendations || [],
358
- duration,
359
- savedFiles,
360
- }),
352
+ mapToResult: (taskId, data, duration, savedFiles) => {
353
+ // ADR-103: attach a schema-validated RiskDecision envelope at the MCP
354
+ // boundary (additive — existing fields unchanged). Omit rather than
355
+ // emit an invalid envelope.
356
+ const riskDecision = buildRiskDecisionFromQualityGate({
357
+ passed: typeof data.passed === 'boolean' ? data.passed : undefined,
358
+ qualityScore: data.qualityScore,
359
+ recommendations: data.recommendations || [],
360
+ });
361
+ return {
362
+ taskId,
363
+ status: 'completed',
364
+ qualityScore: data.qualityScore || 0,
365
+ passed: data.passed || false,
366
+ metrics: data.metrics || {},
367
+ recommendations: data.recommendations || [],
368
+ duration,
369
+ savedFiles,
370
+ ...(validateRiskDecision(riskDecision).valid ? { riskDecision } : {}),
371
+ };
372
+ },
361
373
  };
362
374
  // ============================================================================
363
375
  // Security Scan Configuration
@@ -71,6 +71,7 @@ export declare class StdioTransport {
71
71
  private requestHandler;
72
72
  private notificationHandler;
73
73
  private errorHandler;
74
+ private closeHandler;
74
75
  private running;
75
76
  private metrics;
76
77
  constructor(config?: TransportConfig);
@@ -102,6 +103,12 @@ export declare class StdioTransport {
102
103
  * Set error handler for transport-level errors
103
104
  */
104
105
  onError(handler: (error: Error) => void): void;
106
+ /**
107
+ * Set handler for a terminal close (stdin EOF / parent process exited).
108
+ * Issue #513: lets the server shut down gracefully instead of attempting
109
+ * to reconnect to a stream that can never come back.
110
+ */
111
+ onClose(handler: () => void): void;
105
112
  /**
106
113
  * Reconnect the transport by re-attaching to stdin/stdout.
107
114
  * Closes the existing readline interface and creates a new one.
@@ -53,6 +53,7 @@ export class StdioTransport {
53
53
  requestHandler = null;
54
54
  notificationHandler = null;
55
55
  errorHandler = null;
56
+ closeHandler = null;
56
57
  running = false;
57
58
  metrics = {
58
59
  messagesReceived: 0,
@@ -99,8 +100,25 @@ export class StdioTransport {
99
100
  this.rl.on('close', () => {
100
101
  const wasRunning = this.running;
101
102
  this.running = false;
102
- // If we were running and didn't explicitly stop, this is an unexpected close
103
- if (wasRunning && this.errorHandler) {
103
+ if (!wasRunning) {
104
+ return; // explicit stop() — nothing to signal
105
+ }
106
+ // Issue #513: a readline 'close' caused by stdin reaching EOF means the
107
+ // parent process is gone. stdio cannot reconnect to a new parent, so
108
+ // this is TERMINAL — route it to the close handler and never to the
109
+ // error handler. Firing the error handler here triggers the reconnect
110
+ // path, which re-attaches readline to the already-ended stdin and
111
+ // busy-loops (close → error → reconnect → close ...) at high CPU.
112
+ const ended = this.inputStream.readableEnded === true;
113
+ if (ended) {
114
+ if (this.closeHandler) {
115
+ this.closeHandler();
116
+ }
117
+ return;
118
+ }
119
+ // Stream not ended (e.g. an internal readline close without EOF):
120
+ // keep the legacy transient-error behavior so socket-like callers can retry.
121
+ if (this.errorHandler) {
104
122
  this.errorHandler(new Error('Transport connection closed unexpectedly'));
105
123
  }
106
124
  });
@@ -147,11 +165,30 @@ export class StdioTransport {
147
165
  onError(handler) {
148
166
  this.errorHandler = handler;
149
167
  }
168
+ /**
169
+ * Set handler for a terminal close (stdin EOF / parent process exited).
170
+ * Issue #513: lets the server shut down gracefully instead of attempting
171
+ * to reconnect to a stream that can never come back.
172
+ */
173
+ onClose(handler) {
174
+ this.closeHandler = handler;
175
+ }
150
176
  /**
151
177
  * Reconnect the transport by re-attaching to stdin/stdout.
152
178
  * Closes the existing readline interface and creates a new one.
153
179
  */
154
180
  reconnect() {
181
+ // Issue #513: never re-attach readline to an already-ended stdin. Doing so
182
+ // re-emits 'close' immediately and busy-loops. An ended input stream is
183
+ // terminal for stdio — signal the close handler and bail.
184
+ const ended = this.inputStream.readableEnded === true;
185
+ if (ended) {
186
+ this.running = false;
187
+ if (this.closeHandler) {
188
+ this.closeHandler();
189
+ }
190
+ return;
191
+ }
155
192
  if (this.rl) {
156
193
  this.rl.close();
157
194
  this.rl = null;
@@ -116,8 +116,12 @@ export class CostTracker {
116
116
  currency: 'USD',
117
117
  };
118
118
  }
119
- // Convert from per-million to actual cost
120
- const inputCost = (usage.promptTokens / 1_000_000) * pricing.input;
119
+ // Convert from per-million to actual cost.
120
+ // ADR-088: cache reads bill at ~0.1x input rate, cache writes at ~1.25x
121
+ // (5-minute TTL); promptTokens already excludes both.
122
+ const inputCost = (usage.promptTokens / 1_000_000) * pricing.input +
123
+ ((usage.cacheReadTokens ?? 0) / 1_000_000) * pricing.input * 0.1 +
124
+ ((usage.cacheCreationTokens ?? 0) / 1_000_000) * pricing.input * 1.25;
121
125
  const outputCost = (usage.completionTokens / 1_000_000) * pricing.output;
122
126
  return {
123
127
  inputCost,
@@ -30,6 +30,10 @@ export interface TokenUsage {
30
30
  promptTokens: number;
31
31
  completionTokens: number;
32
32
  totalTokens: number;
33
+ /** ADR-088: tokens written to the prompt cache this request (billed ~1.25x input rate) */
34
+ cacheCreationTokens?: number;
35
+ /** ADR-088: tokens served from the prompt cache this request (billed ~0.1x input rate) */
36
+ cacheReadTokens?: number;
33
37
  }
34
38
  /**
35
39
  * Cost information for a request
@@ -122,7 +122,15 @@ export class ClaudeProvider {
122
122
  messages,
123
123
  };
124
124
  if (options?.systemPrompt) {
125
- body.system = options.systemPrompt;
125
+ // ADR-088: when caching is enabled, send the system prompt as a
126
+ // content-block array with an ephemeral cache breakpoint — repeated
127
+ // calls within the TTL read the cached prefix at ~0.1x input price.
128
+ // Anthropic-native provider only (ADR-092: other providers untouched).
129
+ // Note: prefixes below the model's minimum (1024-4096 tokens) silently
130
+ // don't cache; the breakpoint is harmless in that case.
131
+ body.system = this.config.enableCache !== false
132
+ ? [{ type: 'text', text: options.systemPrompt, cache_control: { type: 'ephemeral' } }]
133
+ : options.systemPrompt;
126
134
  }
127
135
  if (options?.stopSequences && options.stopSequences.length > 0) {
128
136
  body.stop_sequences = options.stopSequences;
@@ -164,10 +172,16 @@ export class ClaudeProvider {
164
172
  throw this.handleApiError(response.status, errorData, model);
165
173
  }
166
174
  const data = await response.json();
175
+ // ADR-088: input_tokens is the uncached remainder only — cache
176
+ // read/creation tokens are reported separately by the API.
177
+ const cacheCreationTokens = data.usage.cache_creation_input_tokens ?? 0;
178
+ const cacheReadTokens = data.usage.cache_read_input_tokens ?? 0;
167
179
  const usage = {
168
180
  promptTokens: data.usage.input_tokens,
169
181
  completionTokens: data.usage.output_tokens,
170
- totalTokens: data.usage.input_tokens + data.usage.output_tokens,
182
+ totalTokens: data.usage.input_tokens + cacheCreationTokens + cacheReadTokens + data.usage.output_tokens,
183
+ cacheCreationTokens,
184
+ cacheReadTokens,
171
185
  };
172
186
  const cost = CostTracker.calculateCost(model, usage);
173
187
  // ADR-042: Track token usage in TokenMetricsCollector
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Agentic QE v3 - Reasoning-Tag Scrubber (ADR-099)
3
+ *
4
+ * Strips extended-thinking blocks (<think>, <thinking>, <reasoning>,
5
+ * <REASONING_SCRATCHPAD>) from text before it enters the learning pipeline —
6
+ * pattern distillation, trajectory persistence, and embedding generation.
7
+ *
8
+ * Why: reasoning-capable models (Fable 5 era) emit large scratchpad blocks
9
+ * inside task results and step actions. Embedding them verbatim contaminates
10
+ * the 384-dim pattern vectors in memory.db, degrading HNSW retrieval quality
11
+ * (the scratchpad dominates the signal of what the step actually did).
12
+ *
13
+ * Boundary-gated: only well-formed `<tag ...> ... </tag>` pairs are removed.
14
+ * Prose that merely *mentions* a tag name (e.g. documentation about
15
+ * "<thinking> blocks") without a closing tag is left intact.
16
+ */
17
+ /**
18
+ * Remove reasoning scratchpad blocks from text destined for the learning
19
+ * pipeline. Collapses the whitespace gap a removed block leaves behind so
20
+ * surrounding prose re-joins cleanly. Non-string / empty input returns as-is.
21
+ */
22
+ export declare function scrubReasoningBlocks(text: string): string;
23
+ /**
24
+ * Scrub a value that may be a string or a JSON-serializable structure whose
25
+ * string leaves may contain reasoning blocks. Non-objects pass through.
26
+ * Used for trajectory step `result.data` payloads serialized into memory.db.
27
+ */
28
+ export declare function scrubReasoningDeep<T>(value: T): T;
29
+ //# sourceMappingURL=reasoning-scrub.d.ts.map
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Agentic QE v3 - Reasoning-Tag Scrubber (ADR-099)
3
+ *
4
+ * Strips extended-thinking blocks (<think>, <thinking>, <reasoning>,
5
+ * <REASONING_SCRATCHPAD>) from text before it enters the learning pipeline —
6
+ * pattern distillation, trajectory persistence, and embedding generation.
7
+ *
8
+ * Why: reasoning-capable models (Fable 5 era) emit large scratchpad blocks
9
+ * inside task results and step actions. Embedding them verbatim contaminates
10
+ * the 384-dim pattern vectors in memory.db, degrading HNSW retrieval quality
11
+ * (the scratchpad dominates the signal of what the step actually did).
12
+ *
13
+ * Boundary-gated: only well-formed `<tag ...> ... </tag>` pairs are removed.
14
+ * Prose that merely *mentions* a tag name (e.g. documentation about
15
+ * "<thinking> blocks") without a closing tag is left intact.
16
+ */
17
+ /**
18
+ * Tag names treated as reasoning scratchpads. Matched case-insensitively
19
+ * as whole tag names (open tag may carry attributes).
20
+ */
21
+ const REASONING_TAG_NAMES = ['think', 'thinking', 'reasoning', 'reasoning_scratchpad'];
22
+ /**
23
+ * One alternation per tag, each backreference-paired so an open tag is only
24
+ * consumed when its own matching close tag exists. Non-greedy body keeps
25
+ * adjacent blocks separate. The `\s*` before `>` tolerates `</thinking >`.
26
+ */
27
+ const REASONING_BLOCK_RE = new RegExp(`<(${REASONING_TAG_NAMES.join('|')})(?:\\s[^>]*)?>[\\s\\S]*?</\\1\\s*>`, 'gi');
28
+ /**
29
+ * Remove reasoning scratchpad blocks from text destined for the learning
30
+ * pipeline. Collapses the whitespace gap a removed block leaves behind so
31
+ * surrounding prose re-joins cleanly. Non-string / empty input returns as-is.
32
+ */
33
+ export function scrubReasoningBlocks(text) {
34
+ if (!text || typeof text !== 'string' || !text.includes('<')) {
35
+ return text;
36
+ }
37
+ let out = text;
38
+ // Repeat until stable: removing an inner block can expose an outer pair
39
+ // (e.g. <thinking><thinking>…</thinking></thinking>).
40
+ for (let i = 0; i < 5; i++) {
41
+ const next = out.replace(REASONING_BLOCK_RE, ' ');
42
+ if (next === out)
43
+ break;
44
+ out = next;
45
+ }
46
+ // If nothing was removed, return the original text untouched (don't
47
+ // re-format whitespace of clean input).
48
+ if (out === text) {
49
+ return text;
50
+ }
51
+ // Collapse the space runs left where blocks were removed; preserve newlines.
52
+ return out.replace(/[ \t]{2,}/g, ' ').trim();
53
+ }
54
+ /**
55
+ * Scrub a value that may be a string or a JSON-serializable structure whose
56
+ * string leaves may contain reasoning blocks. Non-objects pass through.
57
+ * Used for trajectory step `result.data` payloads serialized into memory.db.
58
+ */
59
+ export function scrubReasoningDeep(value) {
60
+ if (typeof value === 'string') {
61
+ return scrubReasoningBlocks(value);
62
+ }
63
+ if (Array.isArray(value)) {
64
+ return value.map((v) => scrubReasoningDeep(v));
65
+ }
66
+ if (value !== null && typeof value === 'object') {
67
+ const out = {};
68
+ for (const [k, v] of Object.entries(value)) {
69
+ out[k] = scrubReasoningDeep(v);
70
+ }
71
+ return out;
72
+ }
73
+ return value;
74
+ }
75
+ //# sourceMappingURL=reasoning-scrub.js.map
@@ -56,6 +56,8 @@ export class QEDaemon {
56
56
  this._healthCheckTimer = setInterval(() => {
57
57
  this.performHealthCheck();
58
58
  }, this.config.healthCheckIntervalMs);
59
+ // Issue #513: never keep an orphaned process alive on the health timer alone.
60
+ this._healthCheckTimer.unref?.();
59
61
  // Auto-start workers if configured
60
62
  if (this.config.autoStart) {
61
63
  await this.workerManager.startAll();
@@ -65,6 +65,8 @@ export class GitWatcher {
65
65
  console.debug('[GitWatcher] Poll error:', err);
66
66
  });
67
67
  }, this.options.pollIntervalMs);
68
+ // Issue #513: don't keep an orphaned process alive on the git poll timer.
69
+ this.pollTimer.unref?.();
68
70
  }
69
71
  this._running = true;
70
72
  }
@@ -139,6 +139,8 @@ export class QualityDaemon {
139
139
  if (!this._running)
140
140
  return;
141
141
  this.tickTimer = setTimeout(() => this.tick(), this.config.tickIntervalMs);
142
+ // Issue #513: the tick loop must not keep an orphaned process alive on its own.
143
+ this.tickTimer.unref?.();
142
144
  }
143
145
  async tick() {
144
146
  if (!this._running || !this._memory)
@@ -367,6 +367,10 @@ export class WorkerManagerImpl {
367
367
  this.scheduleNextRun(worker);
368
368
  }
369
369
  }, worker.config.intervalMs);
370
+ // Issue #513: don't let a background worker tick keep an orphaned process
371
+ // alive. The timer still fires while the process lives for other reasons;
372
+ // unref() only removes it as a standalone reason to stay running.
373
+ timer.unref?.();
370
374
  this.timers.set(worker.config.id, timer);
371
375
  }
372
376
  createContext(workerId, signal) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-qe",
3
- "version": "3.10.3",
3
+ "version": "3.10.5",
4
4
  "description": "Agentic Quality Engineering V3 - Domain-Driven Design Architecture with 13 Bounded Contexts, O(log n) coverage analysis, ReasoningBank learning, 60 specialized QE agents, mathematical Coherence verification, deep Claude Flow integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,2 +0,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.3");process.exit(0)}
2
- import{a,b,c}from"./chunk-GJUGSH7T.js";import"./chunk-HAO3SPOE.js";import"./chunk-FLTPHVZ3.js";import"./chunk-KTRB3L53.js";import"./chunk-3LRK7PYN.js";import"./chunk-CAMEFWRK.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
@@ -1,2 +0,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.3");process.exit(0)}
2
- import{a,b,c,d,e,f}from"./chunk-CNEWYJKT.js";import"./chunk-72LE6PHL.js";import"./chunk-BWP3UVPE.js";import"./chunk-JE3C7JYN.js";import"./chunk-5EWWA4QP.js";import"./chunk-HRLXU4LH.js";import"./chunk-PL5SLO2W.js";import"./chunk-UDV4YB42.js";import"./chunk-NXPFGPHV.js";import"./chunk-JOLDCS6X.js";import"./chunk-5G5AAEFF.js";import"./chunk-BT3QLWII.js";import"./chunk-7RMZAVGO.js";import"./chunk-NZHOKLII.js";import"./chunk-USFZ4IJD.js";import"./chunk-R5ONQAQL.js";import"./chunk-KTRB3L53.js";import"./chunk-UHDBM7QS.js";import"./chunk-3VF3HCG4.js";import"./chunk-2L73WXA4.js";import"./chunk-JD2PG4KS.js";import"./chunk-3LRK7PYN.js";import"./chunk-RTDHWOAG.js";import"./chunk-L74CHKFR.js";import"./chunk-VRXY4T22.js";import"./chunk-JTZ3Q2QS.js";import"./chunk-7ZSPCGTI.js";import"./chunk-QWG76RHA.js";import"./chunk-3RZL4QTT.js";import"./chunk-NRCL3WCP.js";import"./chunk-HMFEPKAR.js";import"./chunk-YIYV2JB6.js";import"./chunk-CAMEFWRK.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 +0,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.3");process.exit(0)}
2
- import{d as c,e as u,f as h,g as m}from"./chunk-HQJMCTWN.js";import{f as s,o as p}from"./chunk-USFZ4IJD.js";import"./chunk-R5ONQAQL.js";import"./chunk-KTRB3L53.js";import"./chunk-3VF3HCG4.js";import"./chunk-2L73WXA4.js";import"./chunk-3LRK7PYN.js";import"./chunk-L74CHKFR.js";import{p as l,q as d}from"./chunk-VRXY4T22.js";import"./chunk-JTZ3Q2QS.js";import"./chunk-7ZSPCGTI.js";import"./chunk-QWG76RHA.js";import"./chunk-3RZL4QTT.js";import"./chunk-NRCL3WCP.js";import"./chunk-HMFEPKAR.js";import"./chunk-YIYV2JB6.js";import{g as f}from"./chunk-CAMEFWRK.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
- `)}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};
@@ -1,2 +0,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.3");process.exit(0)}
2
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-2EQVYYBF.js";import"./chunk-4QFAUSWQ.js";import"./chunk-USFZ4IJD.js";import"./chunk-R5ONQAQL.js";import"./chunk-KTRB3L53.js";import"./chunk-3VF3HCG4.js";import"./chunk-2L73WXA4.js";import"./chunk-3LRK7PYN.js";import"./chunk-RTDHWOAG.js";import"./chunk-L74CHKFR.js";import"./chunk-VRXY4T22.js";import"./chunk-JTZ3Q2QS.js";import"./chunk-7ZSPCGTI.js";import"./chunk-QWG76RHA.js";import"./chunk-3RZL4QTT.js";import"./chunk-NRCL3WCP.js";import"./chunk-HMFEPKAR.js";import"./chunk-YIYV2JB6.js";import"./chunk-CAMEFWRK.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 +0,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.3");process.exit(0)}
2
- import{a}from"./chunk-QEODION5.js";import"./chunk-2EQVYYBF.js";import"./chunk-4QFAUSWQ.js";import"./chunk-USFZ4IJD.js";import"./chunk-R5ONQAQL.js";import"./chunk-KTRB3L53.js";import"./chunk-3VF3HCG4.js";import"./chunk-2L73WXA4.js";import"./chunk-3LRK7PYN.js";import"./chunk-RTDHWOAG.js";import"./chunk-L74CHKFR.js";import"./chunk-VRXY4T22.js";import"./chunk-JTZ3Q2QS.js";import"./chunk-7ZSPCGTI.js";import"./chunk-QWG76RHA.js";import"./chunk-3RZL4QTT.js";import"./chunk-NRCL3WCP.js";import"./chunk-HMFEPKAR.js";import"./chunk-YIYV2JB6.js";import"./chunk-CAMEFWRK.js";export{a as BrowserWorkflowTool};
@@ -1,2 +0,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.3");process.exit(0)}
2
- import{a as S}from"./chunk-4QFAUSWQ.js";import{f as M,o as T}from"./chunk-USFZ4IJD.js";import{a as y,c as P}from"./chunk-3LRK7PYN.js";import{i as h}from"./chunk-RTDHWOAG.js";T();P();import*as g from"path";import*as c from"fs";var l=null,d=null,f=null;function j(o){f=o}async function C(){return l||d||(d=(async()=>{let o=M(),e=g.join(o,".agentic-qe");c.existsSync(e)||c.mkdirSync(e,{recursive:!0});let r=new S({sqlite:{path:g.join(e,"memory.db"),walMode:!0,poolSize:3,busyTimeout:5e3},enableFallback:!0,defaultNamespace:"mcp-tools"});return await r.initialize(),l=r,r})(),d)}function B(){if(f)try{f()}catch{}l&&(l.dispose().catch(()=>{}),l=null),d=null}async function A(o){return o?.memory?o.memory:C()}var u=null,m=null;function x(){let o=(process.env.AQE_LLM_ROUTER_DISABLED??"").trim().toLowerCase();return o?o!=="false"&&o!=="0"&&o!=="no"&&o!=="off":!1}function q(o){u=o,m=null}async function k(){return x()?null:u||m||(m=(async()=>{let{createLLMRouterService:o}=await import("./llm-router-service-7VLXJ7VE.js"),e=await o();return e?(u=e.router,u):null})(),m)}function O(){u=null,m=null}async function I(o){return o?.llmRouter?o.llmRouter:await k()??void 0}var L={info:(o,e)=>console.log(`[MCP-TOOL] ${o}`,e||""),warn:(o,e)=>console.warn(`[MCP-TOOL] \u26A0\uFE0F ${o}`,e||""),error:(o,e)=>console.error(`[MCP-TOOL] \u274C ${o}`,e||"")},R=class{logger=L;currentDataSource="real";setLogger(e){this.logger=e}markAsDemoData(e,r){this.currentDataSource=e.demoMode?"demo":"fallback",this.logger.warn(`${this.config.name} returning ${this.currentDataSource} data`,{reason:r,requestId:e.requestId,demoMode:e.demoMode})}markAsRealData(){this.currentDataSource="real"}isDemoMode(e){return e.demoMode===!0}validate(e){let r=[];if(typeof e!="object"||e===null)return{valid:!1,errors:["Parameters must be an object"]};let t=e,{properties:i,required:n}=this.config.schema;if(n)for(let a of n)a in t||r.push(`Missing required field: ${a}`);for(let[a,s]of Object.entries(t)){let p=i[a];if(!p)continue;let b=this.validateType(a,s,p);b&&r.push(b)}return{valid:r.length===0,errors:r}}validateType(e,r,t){if(r==null)return null;let i=Array.isArray(r)?"array":typeof r;if(t.type==="array"&&!Array.isArray(r))return`${e} must be an array`;if(t.type!=="array"&&i!==t.type)return`${e} must be of type ${t.type}, got ${i}`;if(t.enum&&!t.enum.includes(r))return`${e} must be one of: ${t.enum.join(", ")}`;if(t.type==="number"){let n=r;if(t.minimum!==void 0&&n<t.minimum)return`${e} must be >= ${t.minimum}`;if(t.maximum!==void 0&&n>t.maximum)return`${e} must be <= ${t.maximum}`}if(t.type==="string"){let n=r;if(t.minLength!==void 0&&n.length<t.minLength)return`${e} must be at least ${t.minLength} characters`;if(t.maxLength!==void 0&&n.length>t.maxLength)return`${e} must be at most ${t.maxLength} characters`}return null}async invoke(e,r={}){let t=Date.now(),i=h();this.currentDataSource="real";let n=this.validate(e);if(!n.valid)return{success:!1,error:`Validation failed: ${n.errors.join("; ")}`,metadata:this.createMetadata(t,i)};let a={requestId:i,startTime:t,streaming:r.streaming,onStream:r.onStream,abortSignal:r.abortSignal,demoMode:r.demoMode,memory:r.memory,llmRouter:r.llmRouter};try{let s=await this.execute(e,a);return{...s,metadata:{...s.metadata,...this.createMetadata(t,i)}}}catch(s){return{success:!1,error:y(s),metadata:this.createMetadata(t,i)}}}createMetadata(e,r){return{executionTime:Date.now()-e,timestamp:new Date().toISOString(),requestId:r,domain:this.config.domain,toolName:this.config.name,dataSource:this.currentDataSource}}emitStream(e,r){e.streaming&&e.onStream&&e.onStream(r)}isAborted(e){return e.abortSignal?.aborted??!1}get name(){return this.config.name}get description(){return this.config.description}get domain(){return this.config.domain}getSchema(){return this.config.schema}get timeout(){return this.config.timeout??6e4}get supportsStreaming(){return this.config.streaming??!1}resetInstanceCache(){}};export{j as a,C as b,B as c,A as d,q as e,k as f,O as g,I as h,L as i,R as j};
@@ -1,2 +0,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.3");process.exit(0)}
2
- import{a as e,b as g,e as r}from"./chunk-2L73WXA4.js";import{c as o}from"./chunk-CAMEFWRK.js";var L=o(()=>{"use strict";e();g();r()});export{L as a};