agentic-qe 3.10.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +72 -0
  3. package/README.md +35 -8
  4. package/dist/cli/bundle.js +5 -5
  5. package/dist/cli/chunks/adapter-3JS2CN7C.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-5UDM2PWG.js → agent-booster-wasm-FZLWOPSX.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-JSYER5YC.js → agent-handler-KAGRVCKS.js} +2 -2
  8. package/dist/cli/chunks/{agent-memory-branch-T2SAHI4F.js → agent-memory-branch-JJKFEXQW.js} +2 -2
  9. package/dist/cli/chunks/aqe-learning-engine-Q4GFNGU6.js +2 -0
  10. package/dist/cli/chunks/{audit-HIBRVGXG.js → audit-DN5SY4JJ.js} +2 -2
  11. package/dist/cli/chunks/base-Q3MAL22Y.js +2 -0
  12. package/dist/cli/chunks/{hnswlib-node-TA4DZV62.js → better-sqlite3-XGPW4HK5.js} +2 -2
  13. package/dist/cli/chunks/{brain-handler-N6AWIMXG.js → brain-handler-O7MP5BGY.js} +3 -3
  14. package/dist/cli/chunks/{branch-enumerator-VYQGBVEJ.js → branch-enumerator-ZPTN5J6V.js} +2 -2
  15. package/dist/cli/chunks/{browser-2X4WKZPT.js → browser-PAZE2JSD.js} +2 -2
  16. package/dist/cli/chunks/browser-workflow-JX3M2UWG.js +2 -0
  17. package/dist/cli/chunks/{chunk-SGONA5GS.js → chunk-25QGPRWN.js} +2 -2
  18. package/dist/cli/chunks/{chunk-NT4PI5HI.js → chunk-2ETDES5W.js} +2 -2
  19. package/dist/cli/chunks/{chunk-UGX4EHT5.js → chunk-2KTRRSKD.js} +2 -2
  20. package/dist/cli/chunks/{chunk-UCIJCRPB.js → chunk-2S4XHK26.js} +2 -2
  21. package/dist/cli/chunks/{chunk-KNL3QWVA.js → chunk-2TDWCXZ6.js} +2 -2
  22. package/dist/cli/chunks/{chunk-HZPXOAFW.js → chunk-2UN4DOBJ.js} +2 -2
  23. package/dist/cli/chunks/{chunk-T7DLX3LS.js → chunk-32R7EA7B.js} +3 -3
  24. package/dist/cli/chunks/{chunk-CU4IUJ2K.js → chunk-3YOPJ7DY.js} +2 -2
  25. package/dist/cli/chunks/{chunk-55JPAF56.js → chunk-4AWJ5PE4.js} +1 -1
  26. package/dist/cli/chunks/{chunk-GPKZ4MMH.js → chunk-57NJQV57.js} +1 -1
  27. package/dist/cli/chunks/{chunk-G2HA2O3R.js → chunk-5EU2VQK3.js} +2 -2
  28. package/dist/cli/chunks/{chunk-BXCS55GB.js → chunk-5KFCH7RH.js} +1 -1
  29. package/dist/cli/chunks/{chunk-WC6KZDPM.js → chunk-5OTYBWRL.js} +2 -2
  30. package/dist/cli/chunks/{chunk-ALCQRJDY.js → chunk-5ZCVMR5E.js} +2 -2
  31. package/dist/cli/chunks/{chunk-FX4SYT6Y.js → chunk-622MIAOR.js} +3 -3
  32. package/dist/cli/chunks/{chunk-J5RJYFRM.js → chunk-6A2NIR2E.js} +2 -2
  33. package/dist/cli/chunks/{chunk-6F3WJOU2.js → chunk-6D57DWQ6.js} +2 -2
  34. package/dist/cli/chunks/{chunk-Z6JLPPAY.js → chunk-6E7GI2UB.js} +1 -1
  35. package/dist/cli/chunks/{chunk-M73IL7FA.js → chunk-6LRCMFLV.js} +2 -2
  36. package/dist/cli/chunks/{chunk-L4N6PTIC.js → chunk-6QFONVEE.js} +2 -2
  37. package/dist/cli/chunks/{chunk-6H5MRVJS.js → chunk-6VQ5MFJ6.js} +3 -3
  38. package/dist/cli/chunks/{chunk-JUICZG3T.js → chunk-6ZRMQXVL.js} +2 -2
  39. package/dist/cli/chunks/{chunk-RARSTEUO.js → chunk-7CKVAYP3.js} +1 -1
  40. package/dist/cli/chunks/{chunk-KDFW7MVM.js → chunk-7MSYTHZM.js} +2 -2
  41. package/dist/cli/chunks/{chunk-DY7IRNE2.js → chunk-7SQD2TTQ.js} +1 -1
  42. package/dist/cli/chunks/{chunk-IQNR662U.js → chunk-AABKTWXC.js} +2 -2
  43. package/dist/cli/chunks/{chunk-LYVFC7C7.js → chunk-AUVC3DDB.js} +2 -2
  44. package/dist/cli/chunks/{chunk-OWMGD7FO.js → chunk-BECU52UY.js} +3 -3
  45. package/dist/cli/chunks/chunk-BF7MUYWC.js +2 -0
  46. package/dist/cli/chunks/{chunk-BQT4J3BD.js → chunk-BGBSYF3K.js} +2 -2
  47. package/dist/cli/chunks/{chunk-TR7BZLB6.js → chunk-BN7ERYXI.js} +1 -1
  48. package/dist/cli/chunks/{chunk-DQJJS4AX.js → chunk-CKECJH2A.js} +2 -2
  49. package/dist/cli/chunks/{chunk-I4T4JPR2.js → chunk-COZDJLIL.js} +1 -1
  50. package/dist/cli/chunks/{chunk-URVDWF2Y.js → chunk-CR4ERDS2.js} +2 -2
  51. package/dist/cli/chunks/chunk-DMIYWPQQ.js +2 -0
  52. package/dist/cli/chunks/{chunk-Y4I5JBOL.js → chunk-DQIS6J77.js} +2 -2
  53. package/dist/cli/chunks/{chunk-7ZIRDBXH.js → chunk-DVOH75S4.js} +1 -1
  54. package/dist/cli/chunks/{chunk-Z2SCTEZD.js → chunk-EBQ6YKP2.js} +2 -2
  55. package/dist/cli/chunks/{chunk-2GL4GH52.js → chunk-ECPB7IAH.js} +4 -4
  56. package/dist/cli/chunks/{chunk-LQ3TA22E.js → chunk-EIROAH6N.js} +2 -2
  57. package/dist/cli/chunks/{chunk-UCXQQCIP.js → chunk-ELUERFGA.js} +2 -2
  58. package/dist/cli/chunks/{chunk-KOSKGZK4.js → chunk-ELZ67OHQ.js} +2 -2
  59. package/dist/cli/chunks/{chunk-WVCIZIKH.js → chunk-EO4B5GS4.js} +1 -1
  60. package/dist/cli/chunks/{chunk-HD6CZBZV.js → chunk-EUJHHXE6.js} +2 -2
  61. package/dist/cli/chunks/{chunk-KCHFF4IE.js → chunk-F3OVFA6W.js} +2 -2
  62. package/dist/cli/chunks/{chunk-7Y54QZKF.js → chunk-FJSR2U65.js} +2 -2
  63. package/dist/cli/chunks/{chunk-5QJDH4Z5.js → chunk-G3BQU3Q6.js} +2 -2
  64. package/dist/cli/chunks/{chunk-LDMG4372.js → chunk-G5DTENO3.js} +2 -2
  65. package/dist/cli/chunks/{chunk-JKVNZASH.js → chunk-GMKGLZJU.js} +2 -2
  66. package/dist/cli/chunks/{chunk-O3NAUNFC.js → chunk-GRG3OP34.js} +2 -2
  67. package/dist/cli/chunks/{chunk-3U77XX6J.js → chunk-GRYXNWPF.js} +4 -4
  68. package/dist/cli/chunks/{chunk-3QULDB7K.js → chunk-GTGONWGX.js} +1 -1
  69. package/dist/cli/chunks/{chunk-OGT45MZN.js → chunk-GTRXZJNX.js} +2 -2
  70. package/dist/cli/chunks/{chunk-TEJPHJMW.js → chunk-GXJ4BCGC.js} +2 -2
  71. package/dist/cli/chunks/{chunk-4NQ6KANC.js → chunk-H22MMMYY.js} +2 -2
  72. package/dist/cli/chunks/{chunk-VTIXFHZR.js → chunk-H44WD7QX.js} +2 -2
  73. package/dist/cli/chunks/{chunk-X4U5NYB6.js → chunk-HPNEZ7YN.js} +1 -1
  74. package/dist/cli/chunks/{chunk-FQ5FT7IE.js → chunk-HRDGN3OK.js} +1 -1
  75. package/dist/cli/chunks/{chunk-6HCHW5TS.js → chunk-IHDUWPFY.js} +2 -2
  76. package/dist/cli/chunks/{chunk-DQLEZBWV.js → chunk-IITKJCPK.js} +2 -2
  77. package/dist/cli/chunks/{chunk-VMJXNTJT.js → chunk-IJ4BUSJN.js} +4 -4
  78. package/dist/cli/chunks/{chunk-MJBXQXSX.js → chunk-IK6AJX3C.js} +1 -1
  79. package/dist/cli/chunks/{chunk-NLCUQMUR.js → chunk-IPRDHKSI.js} +2 -2
  80. package/dist/cli/chunks/{chunk-ZYZWBNKT.js → chunk-JLKHPIQF.js} +1 -1
  81. package/dist/cli/chunks/chunk-K22TPWOJ.js +3 -0
  82. package/dist/cli/chunks/{chunk-L3IFZ4IX.js → chunk-K4T3RDCB.js} +2 -2
  83. package/dist/cli/chunks/{chunk-XFUU2RCA.js → chunk-KCTH5MHE.js} +2 -2
  84. package/dist/cli/chunks/{chunk-L2AIES7X.js → chunk-KEC5FBAW.js} +1 -1
  85. package/dist/cli/chunks/{chunk-M4HDBRVJ.js → chunk-KKNBYXYA.js} +1 -1
  86. package/dist/cli/chunks/{chunk-5UOV7T36.js → chunk-KRXKU54J.js} +2 -2
  87. package/dist/cli/chunks/{provider-manager-HV55NIIO.js → chunk-KZJXVIAW.js} +13 -13
  88. package/dist/cli/chunks/{chunk-YHNEBCYQ.js → chunk-LF7URN2X.js} +2 -2
  89. package/dist/cli/chunks/{chunk-HD5NQDOL.js → chunk-MQYTW2IN.js} +2 -2
  90. package/dist/cli/chunks/{chunk-66GIKUI2.js → chunk-MVGVD6LS.js} +2 -2
  91. package/dist/cli/chunks/{chunk-M3M7HXDH.js → chunk-NDCPEXDN.js} +2 -2
  92. package/dist/cli/chunks/{chunk-RF6QKV7M.js → chunk-NOCYYXK4.js} +2 -2
  93. package/dist/cli/chunks/{chunk-U56TIYGP.js → chunk-NPSBMDVU.js} +2 -2
  94. package/dist/cli/chunks/{chunk-OUJJ34JH.js → chunk-NQZYUH6S.js} +1 -1
  95. package/dist/cli/chunks/{chunk-F363JJUI.js → chunk-NRLT44YB.js} +1 -1
  96. package/dist/cli/chunks/{chunk-27ACATRH.js → chunk-OC3OJWLB.js} +2 -2
  97. package/dist/cli/chunks/{chunk-XFMSHTXG.js → chunk-OQP5OFRR.js} +1 -1
  98. package/dist/cli/chunks/{chunk-RGONSQ44.js → chunk-OVENSL64.js} +210 -210
  99. package/dist/cli/chunks/{chunk-DXV6NRG3.js → chunk-P7T5Y735.js} +2 -2
  100. package/dist/cli/chunks/{chunk-QU54GUEA.js → chunk-PLRSKAFZ.js} +2 -2
  101. package/dist/cli/chunks/{chunk-NWHSEXHA.js → chunk-PUXDXIUE.js} +1 -1
  102. package/dist/cli/chunks/{chunk-RH3PHCJT.js → chunk-PW6MOFXG.js} +2 -2
  103. package/dist/cli/chunks/{chunk-3BO7EKGO.js → chunk-PXFQSVA2.js} +3 -3
  104. package/dist/cli/chunks/{chunk-UE3XXKLN.js → chunk-Q24OJX44.js} +2 -2
  105. package/dist/cli/chunks/{chunk-LXHA55EB.js → chunk-Q5VHBI4U.js} +1 -1
  106. package/dist/cli/chunks/{chunk-OKGK7DBT.js → chunk-QNW335PD.js} +2 -2
  107. package/dist/cli/chunks/{chunk-S4CNA6Z5.js → chunk-RPL6K623.js} +3 -3
  108. package/dist/cli/chunks/{chunk-FCSJ7GIZ.js → chunk-RRLQFFCO.js} +4 -4
  109. package/dist/cli/chunks/{chunk-W6U7SIIK.js → chunk-RWYW573C.js} +3 -3
  110. package/dist/cli/chunks/{chunk-BTIVIWIG.js → chunk-SLNGJW4G.js} +1 -1
  111. package/dist/cli/chunks/{chunk-P6XYFDXN.js → chunk-SQBB2DC6.js} +1 -1
  112. package/dist/cli/chunks/{chunk-SCYF5CQA.js → chunk-T3UXMPXX.js} +1 -1
  113. package/dist/cli/chunks/{chunk-C5QESAYA.js → chunk-TFNLXAK5.js} +1 -1
  114. package/dist/cli/chunks/{chunk-ZFBMBCKN.js → chunk-TL5F2S3Z.js} +2 -2
  115. package/dist/cli/chunks/{chunk-HIWBW4IQ.js → chunk-TNGGVMPQ.js} +1 -1
  116. package/dist/cli/chunks/{chunk-5RQT7EJP.js → chunk-TNVYKYTO.js} +3 -3
  117. package/dist/cli/chunks/{chunk-4WYGUTSF.js → chunk-TP77PNN6.js} +2 -2
  118. package/dist/cli/chunks/{chunk-WG6I7YF3.js → chunk-TX7SNQKL.js} +1 -1
  119. package/dist/cli/chunks/{chunk-WLLE54TA.js → chunk-UDFLR7GR.js} +1 -1
  120. package/dist/cli/chunks/{chunk-KYLJERZ3.js → chunk-UDVX34ZG.js} +2 -2
  121. package/dist/cli/chunks/{chunk-YYDHTBHE.js → chunk-UU2Q6XWF.js} +1 -1
  122. package/dist/cli/chunks/{chunk-JCKX2LEJ.js → chunk-VKRMVTWU.js} +49 -49
  123. package/dist/cli/chunks/{chunk-AFFYJSW2.js → chunk-VOIWDPIU.js} +2 -2
  124. package/dist/cli/chunks/chunk-VPCE5CIT.js +2 -0
  125. package/dist/cli/chunks/{chunk-4UUDFWOP.js → chunk-W2DT3CDE.js} +2 -2
  126. package/dist/cli/chunks/{chunk-VTO5O7DA.js → chunk-W6ZF2CPN.js} +1 -1
  127. package/dist/cli/chunks/{chunk-BQX5QDU5.js → chunk-WDTCCPK4.js} +1 -1
  128. package/dist/cli/chunks/{chunk-PNDO4W4L.js → chunk-WL2J6ECN.js} +2 -2
  129. package/dist/cli/chunks/chunk-WMG5F6R6.js +2 -0
  130. package/dist/cli/chunks/{chunk-QL3U5VSM.js → chunk-WO7KYT3X.js} +2 -2
  131. package/dist/cli/chunks/{chunk-S33246T4.js → chunk-WPNZSL4S.js} +1 -1
  132. package/dist/cli/chunks/{chunk-IBXNBLGM.js → chunk-WQEZKAUR.js} +2 -2
  133. package/dist/cli/chunks/{chunk-3OSCWD7Z.js → chunk-WS4XVJHI.js} +1 -1
  134. package/dist/cli/chunks/{chunk-GXCD7GNH.js → chunk-XGUQYVJR.js} +2 -2
  135. package/dist/cli/chunks/{chunk-I4E6CLC4.js → chunk-XKOKMS5A.js} +2 -2
  136. package/dist/cli/chunks/{chunk-ZCNVFULO.js → chunk-XRK7FBTY.js} +2 -2
  137. package/dist/cli/chunks/{chunk-FEBXP74Y.js → chunk-Y2DPXMOR.js} +1 -1
  138. package/dist/cli/chunks/{chunk-MF3XRML3.js → chunk-Y357YFLF.js} +2 -2
  139. package/dist/cli/chunks/{chunk-LRISVDVO.js → chunk-YGRTMAWB.js} +1 -1
  140. package/dist/cli/chunks/{chunk-VEOQH4W6.js → chunk-YPOTBXPU.js} +2 -2
  141. package/dist/cli/chunks/{chunk-2POXDKUB.js → chunk-YYWIA5FX.js} +1 -1
  142. package/dist/cli/chunks/{chunk-QWBO76AU.js → chunk-ZEMXMDD3.js} +2 -2
  143. package/dist/cli/chunks/{chunk-V5TRAL57.js → chunk-ZTMWJQTZ.js} +2 -2
  144. package/dist/cli/chunks/{ci-7TR4NQ5I.js → ci-EHRUN7O6.js} +2 -2
  145. package/dist/cli/chunks/{ci-output-SLTICF3O.js → ci-output-EXDXVXKB.js} +2 -2
  146. package/dist/cli/chunks/{circuit-breaker-7GVVTMBY.js → circuit-breaker-LM4QRAAL.js} +2 -2
  147. package/dist/cli/chunks/{claude-flow-setup-TYCWYEMM.js → claude-flow-setup-ZHUCZVW7.js} +2 -2
  148. package/dist/cli/chunks/client-PA3UJIHH.js +2 -0
  149. package/dist/cli/chunks/{cline-installer-ESIAJOLK.js → cline-installer-WMFLQOW2.js} +2 -2
  150. package/dist/cli/chunks/{code-I42JGOVI.js → code-L7KRLU5E.js} +2 -2
  151. package/dist/cli/chunks/{code-index-extractor-2CCXPCQW.js → code-index-extractor-FTMUYQC6.js} +2 -2
  152. package/dist/cli/chunks/{codex-installer-HEZRDNUT.js → codex-installer-B3F6WI3Z.js} +2 -2
  153. package/dist/cli/chunks/{completions-44HLIZGI.js → completions-3JZQRNB6.js} +2 -2
  154. package/dist/cli/chunks/{complexity-analyzer-SOCSFDVO.js → complexity-analyzer-LB2FFEKX.js} +2 -2
  155. package/dist/cli/chunks/{continuedev-installer-Q7O4HLIM.js → continuedev-installer-WH6IMV7R.js} +2 -2
  156. package/dist/cli/chunks/{copilot-installer-GIWCVLCS.js → copilot-installer-NOIEOFJM.js} +2 -2
  157. package/dist/cli/chunks/{cost-tracker-G7BONKEV.js → cost-tracker-IKX2VYSA.js} +2 -2
  158. package/dist/cli/chunks/{coverage-5TWVP7KY.js → coverage-TD37CYSY.js} +3 -3
  159. package/dist/cli/chunks/cross-domain-router-BVJRP2ZX.js +2 -0
  160. package/dist/cli/chunks/{cursor-installer-43EQZSB5.js → cursor-installer-4NSVGRM5.js} +2 -2
  161. package/dist/cli/chunks/{daemon-ZXHFRDKG.js → daemon-LYDV7NRW.js} +3 -3
  162. package/dist/cli/chunks/{daemon-QQZE4BU2.js → daemon-UWEBUIDT.js} +4 -4
  163. package/dist/cli/chunks/{dag-attention-scheduler-GOZAVAZQ.js → dag-attention-scheduler-NECJGCHC.js} +2 -2
  164. package/dist/cli/chunks/{detect-X777GVJ4.js → detect-4XGC7ILO.js} +2 -2
  165. package/dist/cli/chunks/{dist-node-EZZK46TB.js → dist-node-GGJDXRKJ.js} +2 -2
  166. package/dist/cli/chunks/{domain-handler-ZT32DKYY.js → domain-handler-UOFONAUT.js} +2 -2
  167. package/dist/cli/chunks/{domain-transfer-LHQVSLJW.js → domain-transfer-6JLNOYPA.js} +2 -2
  168. package/dist/cli/chunks/dream-BXZUEIW2.js +2 -0
  169. package/dist/cli/chunks/{embed-and-insert-pattern-XFYPPWG7.js → embed-and-insert-pattern-ZM75DQ4J.js} +2 -2
  170. package/dist/cli/chunks/{eval-V4NYJZUZ.js → eval-CYZJTHEB.js} +2 -2
  171. package/dist/cli/chunks/{experience-capture-middleware-HXX2W4GL.js → experience-capture-middleware-RBOJLDUB.js} +3 -3
  172. package/dist/cli/chunks/{fast-paths-RBPWQSFJ.js → fast-paths-S5BWZR3L.js} +2 -2
  173. package/dist/cli/chunks/{feature-flags-NX5EXRO3.js → feature-flags-6E7H3NYP.js} +2 -2
  174. package/dist/cli/chunks/{feature-flags-INJJZBMN.js → feature-flags-DUNQPDU3.js} +2 -2
  175. package/dist/cli/chunks/{file-discovery-SNFSG6NK.js → file-discovery-PFFKDGYG.js} +2 -2
  176. package/dist/cli/chunks/{fleet-6SDN4UWE.js → fleet-RCDZZFXN.js} +3 -3
  177. package/dist/cli/chunks/{gnn-wrapper-2JDRTDDK.js → gnn-wrapper-5AG3WDWF.js} +2 -2
  178. package/dist/cli/chunks/{heartbeat-handler-QLK6E7KA.js → heartbeat-handler-O2KAEX4Y.js} +4 -4
  179. package/dist/cli/chunks/heartbeat-scheduler-LEKAWFJF.js +2 -0
  180. package/dist/cli/chunks/hnsw-adapter-2TCEG5M2.js +2 -0
  181. package/dist/cli/chunks/hnsw-index-VDPUTEES.js +2 -0
  182. package/dist/cli/chunks/{hnsw-legacy-bridge-Q2ZEZQKB.js → hnsw-legacy-bridge-C7FG6YGW.js} +2 -2
  183. package/dist/cli/chunks/{better-sqlite3-Y6GX6CGB.js → hnswlib-node-YX6OOBN6.js} +2 -2
  184. package/dist/cli/chunks/{hooks-D4YENHO2.js → hooks-FUHNE2P7.js} +10 -10
  185. package/dist/cli/chunks/hybrid-router-2EMDIYIG.js +2 -0
  186. package/dist/cli/chunks/{hypergraph-engine-G72U446M.js → hypergraph-engine-LQRYBNPV.js} +2 -2
  187. package/dist/cli/chunks/{hypergraph-handler-TRZ5FDRH.js → hypergraph-handler-AFFNLZVD.js} +3 -3
  188. package/dist/cli/chunks/impact-analyzer-HFD6CPWC.js +2 -0
  189. package/dist/cli/chunks/{init-handler-3ZD4GCT4.js → init-handler-BQ6IDBX4.js} +6 -6
  190. package/dist/cli/chunks/init-wizard-552QIVRC.js +2 -0
  191. package/dist/cli/chunks/kernel-5DN6O6EE.js +2 -0
  192. package/dist/cli/chunks/{kilocode-installer-AXSIW3XW.js → kilocode-installer-KS72HUSG.js} +2 -2
  193. package/dist/cli/chunks/{kiro-installer-JQGIFWBK.js → kiro-installer-2ZEFLGRX.js} +2 -2
  194. package/dist/cli/chunks/knowledge-graph-76Y77MB6.js +2 -0
  195. package/dist/cli/chunks/{learning-SPO7TGWX.js → learning-GGHGJ6B6.js} +3 -3
  196. package/dist/cli/chunks/llm-router-LP6K5BJF.js +36 -0
  197. package/dist/cli/chunks/llm-router-service-4O6GCEFH.js +2 -0
  198. package/dist/cli/chunks/{load-XIDDK64U.js → load-2MLKXOT2.js} +2 -2
  199. package/dist/cli/chunks/load-test-FCI2IWRJ.js +2 -0
  200. package/dist/cli/chunks/{mcp-3JXRGXO4.js → mcp-CDJBJG5H.js} +2 -2
  201. package/dist/cli/chunks/{memory-A66KRS2P.js → memory-4LAX7JZS.js} +5 -5
  202. package/dist/cli/chunks/memory-backend-MKNCBNDE.js +2 -0
  203. package/dist/cli/chunks/memory-handlers-OBAFR4WV.js +2 -0
  204. package/dist/cli/chunks/{multi-model-executor-XCDGUVCE.js → multi-model-executor-SLJV73HE.js} +2 -2
  205. package/dist/cli/chunks/{opencode-installer-GELXWLF2.js → opencode-installer-M76SONWV.js} +2 -2
  206. package/dist/cli/chunks/{orchestrator-CCS3K6NH.js → orchestrator-TJPUDJMP.js} +5 -5
  207. package/dist/cli/chunks/{pipeline-Z5C72H5S.js → pipeline-2PVNFT6J.js} +2 -2
  208. package/dist/cli/chunks/{platform-4AK7XJ3Y.js → platform-KCSEDKEE.js} +2 -2
  209. package/dist/cli/chunks/{plugin-7RYBIZI7.js → plugin-QX47QF5U.js} +2 -2
  210. package/dist/cli/chunks/{prime-radiant-advanced-wasm-E5PARKRX.js → prime-radiant-advanced-wasm-L6VWL7VR.js} +2 -2
  211. package/dist/cli/chunks/protocol-executor-IA7WNT23.js +2 -0
  212. package/dist/cli/chunks/{protocol-handler-R6QJQFNL.js → protocol-handler-WDNJDEUE.js} +2 -2
  213. package/dist/cli/chunks/{prove-7ESQ2YAL.js → prove-3B75DA3S.js} +2 -2
  214. package/dist/cli/chunks/provider-manager-3K5KB5A6.js +2 -0
  215. package/dist/cli/chunks/qe-reasoning-bank-V5Z3BBYY.js +2 -0
  216. package/dist/cli/chunks/{quality-4UE345QA.js → quality-UGASS5WM.js} +2 -2
  217. package/dist/cli/chunks/queen-coordinator-QOMPA27Z.js +2 -0
  218. package/dist/cli/chunks/{real-embeddings-TYIVN3N5.js → real-embeddings-COBP2LHS.js} +2 -2
  219. package/dist/cli/chunks/{roocode-installer-2KOANC47.js → roocode-installer-TOZ4VLFT.js} +2 -2
  220. package/dist/cli/chunks/router-P5RZUPC4.js +2 -0
  221. package/dist/cli/chunks/routing-feedback-3PS3OZQC.js +2 -0
  222. package/dist/cli/chunks/{routing-handler-JFEYTN7T.js → routing-handler-5TDVSILX.js} +2 -2
  223. package/dist/cli/chunks/{ruvector-commands-KSLSZRJX.js → ruvector-commands-AM63KWQN.js} +2 -2
  224. package/dist/cli/chunks/{rvf-dual-writer-EPBL226J.js → rvf-dual-writer-UANIFE2M.js} +2 -2
  225. package/dist/cli/chunks/{rvf-migration-adapter-25KSI6SF.js → rvf-migration-adapter-LNPYWAPI.js} +2 -2
  226. package/dist/cli/chunks/{rvf-migration-coordinator-2XBYHPZP.js → rvf-migration-coordinator-U47L63DQ.js} +2 -2
  227. package/dist/cli/chunks/rvf-native-adapter-TT7OJPKM.js +2 -0
  228. package/dist/cli/chunks/safe-db-PEW7VBAE.js +2 -0
  229. package/dist/cli/chunks/schedule-QHOTHBQE.js +2 -0
  230. package/dist/cli/chunks/scheduler-KXJBYTRT.js +2 -0
  231. package/dist/cli/chunks/{security-4XWYKI4O.js → security-KDQ2AH7G.js} +3 -3
  232. package/dist/cli/chunks/{shared-rvf-adapter-WRZ3HGDQ.js → shared-rvf-adapter-5MAGLLYJ.js} +2 -2
  233. package/dist/cli/chunks/{shared-rvf-dual-writer-DX2N5STR.js → shared-rvf-dual-writer-GF2OPPM5.js} +2 -2
  234. package/dist/cli/chunks/sqlite-persistence-TPXJK34J.js +2 -0
  235. package/dist/cli/chunks/{status-handler-V75OSXMQ.js → status-handler-XZKEL7LO.js} +2 -2
  236. package/dist/cli/chunks/{structural-health-TLX3JHZ6.js → structural-health-27QKWW25.js} +2 -2
  237. package/dist/cli/chunks/{sync-DXZFMVZQ.js → sync-INNKS6UK.js} +2 -2
  238. package/dist/cli/chunks/{sync-KGBEXUF7.js → sync-V3HGPEJT.js} +2 -2
  239. package/dist/cli/chunks/{task-handler-T3OJ6R7H.js → task-handler-LDUVOM6G.js} +2 -2
  240. package/dist/cli/chunks/{task-handlers-NJYR54AS.js → task-handlers-HTCPV7OO.js} +3 -3
  241. package/dist/cli/chunks/{test-KMVDNNQA.js → test-PCUVGVJL.js} +4 -4
  242. package/dist/cli/chunks/{test-scheduling-R5EQ2XGV.js → test-scheduling-GYVXWCAA.js} +3 -3
  243. package/dist/cli/chunks/{token-bootstrap-PFKVV3RO.js → token-bootstrap-MJ2ANC4P.js} +2 -2
  244. package/dist/cli/chunks/{token-usage-ZLOGA6LR.js → token-usage-ZREHROTF.js} +2 -2
  245. package/dist/cli/chunks/{transformers-TNPSPQI3.js → transformers-6B3FWFYL.js} +2 -2
  246. package/dist/cli/chunks/{tree-sitter-wasm-parser-A2EEB5BF.js → tree-sitter-wasm-parser-JVV234MN.js} +2 -2
  247. package/dist/cli/chunks/{types-DIXPI4NR.js → types-MVZTJI2F.js} +2 -2
  248. package/dist/cli/chunks/unified-memory-ROS2NKR5.js +2 -0
  249. package/dist/cli/chunks/unified-memory-hnsw-FLEUF3XO.js +2 -0
  250. package/dist/cli/chunks/unified-persistence-QC5L7UNQ.js +2 -0
  251. package/dist/cli/chunks/{upgrade-LX5KP6VO.js → upgrade-MKTFEILD.js} +2 -2
  252. package/dist/cli/chunks/{validate-3L6F7M36.js → validate-IABGALSW.js} +2 -2
  253. package/dist/cli/chunks/{validate-swarm-FD42ZKAQ.js → validate-swarm-RHF53RF6.js} +2 -2
  254. package/dist/cli/chunks/{vibium-GSBSJR53.js → vibium-RAKW6FMF.js} +2 -2
  255. package/dist/cli/chunks/visual-security-NLIOUQCR.js +2 -0
  256. package/dist/cli/chunks/{web-tree-sitter-TXHMO4BW.js → web-tree-sitter-PYK7F4JZ.js} +2 -2
  257. package/dist/cli/chunks/{windsurf-installer-3EUZ6RD3.js → windsurf-installer-S3U2HWZ4.js} +2 -2
  258. package/dist/cli/chunks/{witness-chain-ONAUEJ4M.js → witness-chain-435NKQLB.js} +2 -2
  259. package/dist/cli/chunks/witness-chain-U7X6JX5J.js +2 -0
  260. package/dist/cli/chunks/{workflow-E7A6BV4C.js → workflow-5UHJCZ6J.js} +4 -4
  261. package/dist/cli/chunks/workflow-orchestrator-APE6BAXH.js +2 -0
  262. package/dist/cli/chunks/{wrappers-AHHAQJM3.js → wrappers-RD3NCMLK.js} +2 -2
  263. package/dist/cli/commands/llm-router.js +83 -26
  264. package/dist/domains/chaos-resilience/coordinator.d.ts +2 -1
  265. package/dist/domains/chaos-resilience/coordinator.js +3 -2
  266. package/dist/domains/chaos-resilience/plugin.d.ts +4 -2
  267. package/dist/domains/chaos-resilience/plugin.js +8 -5
  268. package/dist/domains/code-intelligence/coordinator.d.ts +2 -1
  269. package/dist/domains/code-intelligence/coordinator.js +3 -2
  270. package/dist/domains/code-intelligence/plugin.d.ts +4 -2
  271. package/dist/domains/code-intelligence/plugin.js +8 -5
  272. package/dist/domains/contract-testing/coordinator.d.ts +2 -1
  273. package/dist/domains/contract-testing/coordinator.js +3 -2
  274. package/dist/domains/contract-testing/plugin.d.ts +4 -2
  275. package/dist/domains/contract-testing/plugin.js +8 -5
  276. package/dist/domains/coverage-analysis/coordinator.d.ts +2 -1
  277. package/dist/domains/coverage-analysis/coordinator.js +4 -3
  278. package/dist/domains/coverage-analysis/plugin.d.ts +3 -2
  279. package/dist/domains/coverage-analysis/plugin.js +4 -4
  280. package/dist/domains/defect-intelligence/coordinator.d.ts +2 -1
  281. package/dist/domains/defect-intelligence/coordinator.js +4 -3
  282. package/dist/domains/defect-intelligence/plugin.d.ts +4 -2
  283. package/dist/domains/defect-intelligence/plugin.js +9 -6
  284. package/dist/domains/learning-optimization/coordinator.d.ts +2 -1
  285. package/dist/domains/learning-optimization/coordinator.js +3 -2
  286. package/dist/domains/learning-optimization/plugin.d.ts +4 -2
  287. package/dist/domains/learning-optimization/plugin.js +8 -5
  288. package/dist/domains/quality-assessment/coordinator.d.ts +2 -1
  289. package/dist/domains/quality-assessment/coordinator.js +4 -3
  290. package/dist/domains/quality-assessment/plugin.d.ts +4 -2
  291. package/dist/domains/quality-assessment/plugin.js +10 -6
  292. package/dist/domains/requirements-validation/coordinator.d.ts +2 -1
  293. package/dist/domains/requirements-validation/coordinator.js +3 -2
  294. package/dist/domains/requirements-validation/plugin.d.ts +4 -2
  295. package/dist/domains/requirements-validation/plugin.js +8 -5
  296. package/dist/domains/security-compliance/coordinator.d.ts +2 -1
  297. package/dist/domains/security-compliance/coordinator.js +4 -2
  298. package/dist/domains/security-compliance/plugin.d.ts +4 -2
  299. package/dist/domains/security-compliance/plugin.js +11 -6
  300. package/dist/domains/test-execution/coordinator.d.ts +3 -2
  301. package/dist/domains/test-execution/coordinator.js +6 -5
  302. package/dist/domains/test-execution/plugin.d.ts +4 -2
  303. package/dist/domains/test-execution/plugin.js +6 -4
  304. package/dist/domains/test-generation/coordinator.d.ts +2 -1
  305. package/dist/domains/test-generation/coordinator.js +4 -3
  306. package/dist/domains/test-generation/plugin.d.ts +4 -2
  307. package/dist/domains/test-generation/plugin.js +12 -7
  308. package/dist/domains/visual-accessibility/coordinator.d.ts +2 -1
  309. package/dist/domains/visual-accessibility/coordinator.js +4 -3
  310. package/dist/domains/visual-accessibility/plugin.d.ts +4 -2
  311. package/dist/domains/visual-accessibility/plugin.js +9 -6
  312. package/dist/kernel/interfaces.d.ts +37 -0
  313. package/dist/kernel/kernel.d.ts +39 -0
  314. package/dist/kernel/kernel.js +157 -17
  315. package/dist/mcp/bundle.js +417 -395
  316. package/dist/mcp/qe-tool-bridge.js +8 -1
  317. package/dist/mcp/tools/base.d.ts +56 -0
  318. package/dist/mcp/tools/base.js +104 -1
  319. package/dist/mcp/tools/chaos-resilience/inject.js +4 -2
  320. package/dist/mcp/tools/code-intelligence/analyze.js +5 -3
  321. package/dist/mcp/tools/contract-testing/validate.js +4 -2
  322. package/dist/mcp/tools/coverage-analysis/index.js +11 -5
  323. package/dist/mcp/tools/defect-intelligence/predict.js +5 -10
  324. package/dist/mcp/tools/learning-optimization/optimize.js +4 -2
  325. package/dist/mcp/tools/registry.js +8 -1
  326. package/dist/mcp/tools/test-generation/generate.js +10 -6
  327. package/dist/mcp/tools/visual-accessibility/index.js +7 -4
  328. package/dist/shared/llm/llm-router-service.d.ts +77 -0
  329. package/dist/shared/llm/llm-router-service.js +166 -0
  330. package/dist/shared/llm/providers/gemini.js +5 -2
  331. package/dist/shared/llm/router/config-store.d.ts +89 -0
  332. package/dist/shared/llm/router/config-store.js +261 -0
  333. package/dist/shared/llm/router/hybrid-router.js +33 -11
  334. package/package.json +1 -1
  335. package/dist/cli/chunks/adapter-WTE6UVGP.js +0 -2
  336. package/dist/cli/chunks/aqe-learning-engine-LCLEBU7D.js +0 -2
  337. package/dist/cli/chunks/base-73I73HBF.js +0 -2
  338. package/dist/cli/chunks/browser-workflow-2NSV5O6W.js +0 -2
  339. package/dist/cli/chunks/chunk-6MONUYQ5.js +0 -2
  340. package/dist/cli/chunks/chunk-X73CRYF4.js +0 -2
  341. package/dist/cli/chunks/client-7GB4WWUD.js +0 -2
  342. package/dist/cli/chunks/cross-domain-router-7HQ74TLE.js +0 -2
  343. package/dist/cli/chunks/dream-G5SEFHI4.js +0 -2
  344. package/dist/cli/chunks/heartbeat-scheduler-NG7BY3FR.js +0 -2
  345. package/dist/cli/chunks/hnsw-adapter-TDSLUI7K.js +0 -2
  346. package/dist/cli/chunks/hnsw-index-OWLQSOQH.js +0 -2
  347. package/dist/cli/chunks/hybrid-router-URU2XLBD.js +0 -2
  348. package/dist/cli/chunks/impact-analyzer-NMTN75KA.js +0 -2
  349. package/dist/cli/chunks/init-wizard-SHBFYGBV.js +0 -2
  350. package/dist/cli/chunks/kernel-7KVY2JGO.js +0 -2
  351. package/dist/cli/chunks/knowledge-graph-V4G5J5B7.js +0 -2
  352. package/dist/cli/chunks/llm-router-G6N2OKDA.js +0 -36
  353. package/dist/cli/chunks/load-test-N4RNPLG4.js +0 -2
  354. package/dist/cli/chunks/memory-backend-HPGJ5YDQ.js +0 -2
  355. package/dist/cli/chunks/memory-handlers-K33YVCVQ.js +0 -2
  356. package/dist/cli/chunks/protocol-executor-GNVWUJUP.js +0 -2
  357. package/dist/cli/chunks/qe-reasoning-bank-DDSBHO6D.js +0 -2
  358. package/dist/cli/chunks/queen-coordinator-BQJ5O63C.js +0 -2
  359. package/dist/cli/chunks/router-C2RKWB7J.js +0 -2
  360. package/dist/cli/chunks/routing-feedback-RHATTSJ6.js +0 -2
  361. package/dist/cli/chunks/rvf-native-adapter-QG4CXHLL.js +0 -2
  362. package/dist/cli/chunks/safe-db-A4KQ2IDB.js +0 -2
  363. package/dist/cli/chunks/schedule-O7MLASQT.js +0 -2
  364. package/dist/cli/chunks/scheduler-HT7RNYQ2.js +0 -2
  365. package/dist/cli/chunks/sqlite-persistence-4NNKJ6CQ.js +0 -2
  366. package/dist/cli/chunks/unified-memory-CMNJVHOJ.js +0 -2
  367. package/dist/cli/chunks/unified-memory-hnsw-JQLU2KI6.js +0 -2
  368. package/dist/cli/chunks/unified-persistence-I25TEDIU.js +0 -2
  369. package/dist/cli/chunks/visual-security-AJJIEV5V.js +0 -2
  370. package/dist/cli/chunks/witness-chain-762QQBTN.js +0 -2
  371. package/dist/cli/chunks/workflow-orchestrator-ZGPYISKY.js +0 -2
@@ -75,7 +75,14 @@ export function registerMissingQETools(registerFn) {
75
75
  parameters: schemaToParameters(tool),
76
76
  },
77
77
  handler: async (params) => {
78
- const result = await tool.invoke(params);
78
+ // ADR-043: explicitly forward the shared HybridRouter (registered
79
+ // by QEKernelImpl during initialize() in production, or built
80
+ // lazily for MCP-only contexts) so the MCPToolContext.llmRouter
81
+ // field carries the actual instance rather than relying on each
82
+ // tool's getLLMRouter(context) singleton fallback.
83
+ const { getSharedLLMRouter } = await import('./tools/base.js');
84
+ const llmRouter = (await getSharedLLMRouter()) ?? undefined;
85
+ const result = await tool.invoke(params, { llmRouter });
79
86
  return result;
80
87
  },
81
88
  };
@@ -26,6 +26,41 @@ export declare function resetSharedMemoryBackend(): void;
26
26
  * Get memory backend from context or create shared one
27
27
  */
28
28
  export declare function getMemoryBackend(context?: MCPToolContext): Promise<MemoryBackend>;
29
+ /**
30
+ * Register an externally-built HybridRouter as the shared singleton.
31
+ * Called by QEKernelImpl during initialize() so kernel-mode and MCP-mode
32
+ * tools share the same router instance. Idempotent — calling with the
33
+ * same router twice is a no-op; calling with a different router
34
+ * replaces the previous one (and any in-flight lazy init is cancelled
35
+ * for next-read semantics).
36
+ */
37
+ export declare function setSharedLLMRouter(router: import('../../shared/llm/router/hybrid-router.js').HybridRouter): void;
38
+ /**
39
+ * Get or create the shared HybridRouter for standalone MCP tools that
40
+ * construct their service directly (without going through the kernel /
41
+ * plugin chain that Phase 2 wired up).
42
+ *
43
+ * Returns null when:
44
+ * - AQE_LLM_ROUTER_DISABLED env kill-switch is set, OR
45
+ * - no provider key is in env and the project has no llm-config.json
46
+ *
47
+ * Callers MUST tolerate a null return value and fall back to
48
+ * deterministic-only behavior in that case.
49
+ *
50
+ * Resets via `resetSharedLLMRouter()` for tests.
51
+ */
52
+ export declare function getSharedLLMRouter(): Promise<import('../../shared/llm/router/hybrid-router.js').HybridRouter | null>;
53
+ /**
54
+ * Reset the shared LLM router singleton. For tests.
55
+ */
56
+ export declare function resetSharedLLMRouter(): void;
57
+ /**
58
+ * Get LLM router from context or shared singleton. Returns undefined
59
+ * (not null) when no router is available, so it can be spread directly
60
+ * into a `{ memory, llmRouter }` dependency bag without contaminating
61
+ * the value.
62
+ */
63
+ export declare function getLLMRouter(context?: MCPToolContext): Promise<import('../../shared/llm/router/hybrid-router.js').HybridRouter | undefined>;
29
64
  /**
30
65
  * JSON Schema property definition for tool parameters
31
66
  */
@@ -79,6 +114,13 @@ export interface MCPToolContext {
79
114
  demoMode?: boolean;
80
115
  /** Shared memory backend for persistent storage */
81
116
  memory?: import('../../kernel/interfaces').MemoryBackend;
117
+ /**
118
+ * ADR-043: HybridRouter for LLM-enhanced analysis. Standalone MCP
119
+ * tools that construct services directly should fetch this via
120
+ * `getLLMRouter(context)` and pass it into the service dependency
121
+ * bag so isLLMAnalysisAvailable() returns true.
122
+ */
123
+ llmRouter?: import('../../shared/llm/router/hybrid-router.js').HybridRouter;
82
124
  }
83
125
  /**
84
126
  * Data source tracking for audit/transparency
@@ -167,6 +209,20 @@ export declare abstract class MCPToolBase<TParams extends Record<string, unknown
167
209
  abortSignal?: AbortSignal;
168
210
  /** Explicit demo mode - returns sample data without calling real services */
169
211
  demoMode?: boolean;
212
+ /**
213
+ * ADR-043: Optional memory backend injection. When provided, the
214
+ * context.memory field is populated and tools skip the shared
215
+ * singleton fallback.
216
+ */
217
+ memory?: import('../../kernel/interfaces').MemoryBackend;
218
+ /**
219
+ * ADR-043: Optional LLM router injection. When provided, the
220
+ * context.llmRouter field is populated so getLLMRouter(context)
221
+ * returns it directly — used by the MCP runtime to forward the
222
+ * kernel singleton without going through getSharedLLMRouter()'s
223
+ * lazy build path.
224
+ */
225
+ llmRouter?: import('../../shared/llm/router/hybrid-router.js').HybridRouter;
170
226
  }): Promise<ToolResult<TResult>>;
171
227
  /**
172
228
  * Create result metadata
@@ -97,6 +97,101 @@ export async function getMemoryBackend(context) {
97
97
  }
98
98
  return getSharedMemoryBackend();
99
99
  }
100
+ // ============================================================================
101
+ // Shared LLM Router for MCP Tools (ADR-043)
102
+ // ============================================================================
103
+ //
104
+ // Two paths populate this singleton:
105
+ //
106
+ // 1. QEKernelImpl._initializeLLMRouter() calls setSharedLLMRouter() on
107
+ // boot, so kernel-mode AND MCP-mode share ONE HybridRouter — one
108
+ // cost tracker, one metrics collector, one provider circuit breaker.
109
+ // This is the production path.
110
+ //
111
+ // 2. Pure-MCP processes (no kernel — e.g. standalone CLI invocations
112
+ // that go directly through the MCP tool surface) lazily construct
113
+ // a router on first getSharedLLMRouter() call. Subordinate to (1).
114
+ //
115
+ // AQE_LLM_ROUTER_DISABLED env kill-switch is honored in both paths so a
116
+ // user can opt out without code changes.
117
+ let sharedLLMRouter = null;
118
+ let llmRouterInitPromise = null;
119
+ /**
120
+ * Returns true when the AQE_LLM_ROUTER_DISABLED env kill-switch is set.
121
+ * Honors '1', 'true', 'yes', 'on'; ignores '', '0', 'false', 'no', 'off'.
122
+ */
123
+ function isRouterKillSwitchSet() {
124
+ const v = (process.env.AQE_LLM_ROUTER_DISABLED ?? '').trim().toLowerCase();
125
+ if (!v)
126
+ return false;
127
+ return v !== 'false' && v !== '0' && v !== 'no' && v !== 'off';
128
+ }
129
+ /**
130
+ * Register an externally-built HybridRouter as the shared singleton.
131
+ * Called by QEKernelImpl during initialize() so kernel-mode and MCP-mode
132
+ * tools share the same router instance. Idempotent — calling with the
133
+ * same router twice is a no-op; calling with a different router
134
+ * replaces the previous one (and any in-flight lazy init is cancelled
135
+ * for next-read semantics).
136
+ */
137
+ export function setSharedLLMRouter(router) {
138
+ sharedLLMRouter = router;
139
+ llmRouterInitPromise = null;
140
+ }
141
+ /**
142
+ * Get or create the shared HybridRouter for standalone MCP tools that
143
+ * construct their service directly (without going through the kernel /
144
+ * plugin chain that Phase 2 wired up).
145
+ *
146
+ * Returns null when:
147
+ * - AQE_LLM_ROUTER_DISABLED env kill-switch is set, OR
148
+ * - no provider key is in env and the project has no llm-config.json
149
+ *
150
+ * Callers MUST tolerate a null return value and fall back to
151
+ * deterministic-only behavior in that case.
152
+ *
153
+ * Resets via `resetSharedLLMRouter()` for tests.
154
+ */
155
+ export async function getSharedLLMRouter() {
156
+ if (isRouterKillSwitchSet()) {
157
+ return null;
158
+ }
159
+ if (sharedLLMRouter) {
160
+ return sharedLLMRouter;
161
+ }
162
+ if (llmRouterInitPromise) {
163
+ return llmRouterInitPromise;
164
+ }
165
+ llmRouterInitPromise = (async () => {
166
+ const { createLLMRouterService } = await import('../../shared/llm/llm-router-service.js');
167
+ const built = await createLLMRouterService();
168
+ if (!built)
169
+ return null;
170
+ sharedLLMRouter = built.router;
171
+ return sharedLLMRouter;
172
+ })();
173
+ return llmRouterInitPromise;
174
+ }
175
+ /**
176
+ * Reset the shared LLM router singleton. For tests.
177
+ */
178
+ export function resetSharedLLMRouter() {
179
+ sharedLLMRouter = null;
180
+ llmRouterInitPromise = null;
181
+ }
182
+ /**
183
+ * Get LLM router from context or shared singleton. Returns undefined
184
+ * (not null) when no router is available, so it can be spread directly
185
+ * into a `{ memory, llmRouter }` dependency bag without contaminating
186
+ * the value.
187
+ */
188
+ export async function getLLMRouter(context) {
189
+ if (context?.llmRouter) {
190
+ return context.llmRouter;
191
+ }
192
+ const shared = await getSharedLLMRouter();
193
+ return shared ?? undefined;
194
+ }
100
195
  /**
101
196
  * Default console logger
102
197
  */
@@ -245,7 +340,13 @@ export class MCPToolBase {
245
340
  metadata: this.createMetadata(startTime, requestId),
246
341
  };
247
342
  }
248
- // Create execution context
343
+ // Create execution context.
344
+ // ADR-043: memory + llmRouter are populated from invoke() options so
345
+ // the MCP runtime (qe-tool-bridge, registry, daemon) can forward the
346
+ // kernel singleton explicitly rather than relying on the shared
347
+ // singleton fallback. When unset, getLLMRouter(context) falls back
348
+ // to getSharedLLMRouter() — which itself is kernel-aware via
349
+ // setSharedLLMRouter() registered during kernel.initialize().
249
350
  const context = {
250
351
  requestId,
251
352
  startTime,
@@ -253,6 +354,8 @@ export class MCPToolBase {
253
354
  onStream: options.onStream,
254
355
  abortSignal: options.abortSignal,
255
356
  demoMode: options.demoMode,
357
+ memory: options.memory,
358
+ llmRouter: options.llmRouter,
256
359
  };
257
360
  try {
258
361
  // Execute the tool
@@ -7,7 +7,7 @@
7
7
  * - ChaosEngineerService for fault injection and experiment execution
8
8
  */
9
9
  import { v4 as uuidv4 } from 'uuid';
10
- import { MCPToolBase, getSharedMemoryBackend } from '../base.js';
10
+ import { MCPToolBase, getSharedMemoryBackend, getLLMRouter } from '../base.js';
11
11
  import { ChaosEngineerService } from '../../../domains/chaos-resilience/services/chaos-engineer.js';
12
12
  import { toErrorMessage } from '../../../shared/error-utils.js';
13
13
  // ============================================================================
@@ -26,7 +26,9 @@ export class ChaosInjectTool extends MCPToolBase {
26
26
  async getService(context) {
27
27
  if (!this.chaosEngineer) {
28
28
  const memory = context.memory || await getSharedMemoryBackend();
29
- this.chaosEngineer = new ChaosEngineerService({ memory }, {
29
+ // ADR-043 wiring.
30
+ const llmRouter = await getLLMRouter(context);
31
+ this.chaosEngineer = new ChaosEngineerService({ memory, llmRouter }, {
30
32
  enableDryRun: true,
31
33
  autoRollbackOnFailure: true,
32
34
  });
@@ -8,7 +8,7 @@
8
8
  * - SemanticAnalyzerService for semantic code search
9
9
  * - ImpactAnalyzerService for change impact analysis
10
10
  */
11
- import { MCPToolBase, getSharedMemoryBackend } from '../base';
11
+ import { MCPToolBase, getSharedMemoryBackend, getLLMRouter } from '../base';
12
12
  import { KnowledgeGraphService } from '../../../domains/code-intelligence/services/knowledge-graph';
13
13
  import { SemanticAnalyzerService } from '../../../domains/code-intelligence/services/semantic-analyzer';
14
14
  import { ImpactAnalyzerService } from '../../../domains/code-intelligence/services/impact-analyzer';
@@ -35,8 +35,10 @@ export class CodeAnalyzeTool extends MCPToolBase {
35
35
  */
36
36
  async getKnowledgeGraph(context) {
37
37
  if (!this.knowledgeGraph) {
38
- const memory = context.memory;
39
- this.knowledgeGraph = new KnowledgeGraphService(memory || await getSharedMemoryBackend());
38
+ // ADR-043 wiring.
39
+ const memory = context.memory ?? await getSharedMemoryBackend();
40
+ const llmRouter = await getLLMRouter(context);
41
+ this.knowledgeGraph = new KnowledgeGraphService({ memory, llmRouter });
40
42
  }
41
43
  return this.knowledgeGraph;
42
44
  }
@@ -7,7 +7,7 @@
7
7
  * - ContractValidatorService for contract/schema validation
8
8
  * - ApiCompatibilityService for breaking change detection
9
9
  */
10
- import { MCPToolBase, getSharedMemoryBackend } from '../base.js';
10
+ import { MCPToolBase, getSharedMemoryBackend, getLLMRouter } from '../base.js';
11
11
  import { safeJsonParse } from '../../../shared/safe-json.js';
12
12
  import { Version } from '../../../shared/value-objects/index.js';
13
13
  import { ContractValidatorService } from '../../../domains/contract-testing/services/contract-validator.js';
@@ -67,7 +67,9 @@ export class ContractValidateTool extends MCPToolBase {
67
67
  async getServices(context) {
68
68
  if (!this.contractValidator || !this.apiCompatibility) {
69
69
  const memory = context.memory || await getSharedMemoryBackend();
70
- this.contractValidator = new ContractValidatorService({ memory });
70
+ // ADR-043 wiring.
71
+ const llmRouter = await getLLMRouter(context);
72
+ this.contractValidator = new ContractValidatorService({ memory, llmRouter });
71
73
  this.apiCompatibility = new ApiCompatibilityService(memory);
72
74
  }
73
75
  return {
@@ -7,7 +7,7 @@
7
7
  * This module wraps the REAL coverage-analysis domain services.
8
8
  * Uses actual LCOV/JSON parsing and vector-based gap detection.
9
9
  */
10
- import { MCPToolBase, getSharedMemoryBackend } from '../base';
10
+ import { MCPToolBase, getSharedMemoryBackend, getLLMRouter } from '../base';
11
11
  import { CoverageAnalyzerService } from '../../../domains/coverage-analysis/services/coverage-analyzer';
12
12
  import { GapDetectorService } from '../../../domains/coverage-analysis/services/gap-detector';
13
13
  import { findAndParseCoverage, parseCoverage, } from '../../../domains/coverage-analysis/services/coverage-parser';
@@ -83,8 +83,12 @@ export class CoverageAnalyzeTool extends MCPToolBase {
83
83
  analyzerService = null;
84
84
  async getService(context) {
85
85
  if (!this.analyzerService) {
86
- const memory = context.memory;
87
- this.analyzerService = new CoverageAnalyzerService(memory || await getSharedMemoryBackend());
86
+ // ADR-043 wiring: pull the shared HybridRouter (returns undefined
87
+ // when no provider key is present) so isLLMAnalysisAvailable()
88
+ // returns true in MCP mode the same way it does in kernel mode.
89
+ const memory = context.memory ?? await getSharedMemoryBackend();
90
+ const llmRouter = await getLLMRouter(context);
91
+ this.analyzerService = new CoverageAnalyzerService({ memory, llmRouter });
88
92
  }
89
93
  return this.analyzerService;
90
94
  }
@@ -296,8 +300,10 @@ export class CoverageGapsTool extends MCPToolBase {
296
300
  gapService = null;
297
301
  async getService(context) {
298
302
  if (!this.gapService) {
299
- const memory = context.memory;
300
- this.gapService = new GapDetectorService(memory || await getSharedMemoryBackend());
303
+ // ADR-043 wiring.
304
+ const memory = context.memory ?? await getSharedMemoryBackend();
305
+ const llmRouter = await getLLMRouter(context);
306
+ this.gapService = new GapDetectorService({ memory, llmRouter });
301
307
  }
302
308
  return this.gapService;
303
309
  }
@@ -6,7 +6,7 @@
6
6
  * This tool wraps the REAL defect-intelligence domain service.
7
7
  * Uses actual code analysis, git history, and weighted feature prediction.
8
8
  */
9
- import { MCPToolBase, getSharedMemoryBackend } from '../base';
9
+ import { MCPToolBase, getSharedMemoryBackend, getLLMRouter } from '../base';
10
10
  import { DefectPredictorService } from '../../../domains/defect-intelligence/services/defect-predictor';
11
11
  import { toErrorMessage } from '../../../shared/error-utils.js';
12
12
  // ============================================================================
@@ -44,15 +44,10 @@ export class DefectPredictTool extends MCPToolBase {
44
44
  */
45
45
  async getService(context) {
46
46
  if (!this.predictorService) {
47
- // Create a memory backend from context or use shared persistent backend
48
- const memory = context.memory;
49
- if (memory) {
50
- this.predictorService = new DefectPredictorService(memory);
51
- }
52
- else {
53
- // Use shared persistent memory backend
54
- this.predictorService = new DefectPredictorService(await getSharedMemoryBackend());
55
- }
47
+ // ADR-043 wiring.
48
+ const memory = context.memory ?? await getSharedMemoryBackend();
49
+ const llmRouter = await getLLMRouter(context);
50
+ this.predictorService = new DefectPredictorService({ memory, llmRouter });
56
51
  }
57
52
  return this.predictorService;
58
53
  }
@@ -8,7 +8,7 @@
8
8
  * - MetricsOptimizerService for strategy optimization
9
9
  * - TransferSpecialistService for knowledge transfer
10
10
  */
11
- import { MCPToolBase, getSharedMemoryBackend } from '../base.js';
11
+ import { MCPToolBase, getSharedMemoryBackend, getLLMRouter } from '../base.js';
12
12
  import { TimeRange } from '../../../shared/value-objects/index.js';
13
13
  import { LearningCoordinatorService } from '../../../domains/learning-optimization/services/learning-coordinator.js';
14
14
  import { MetricsOptimizerService } from '../../../domains/learning-optimization/services/metrics-optimizer.js';
@@ -33,7 +33,9 @@ export class LearningOptimizeTool extends MCPToolBase {
33
33
  async getServices(context) {
34
34
  if (!this.learningCoordinator || !this.metricsOptimizer || !this.transferSpecialist) {
35
35
  const memory = context.memory || await getSharedMemoryBackend();
36
- this.learningCoordinator = new LearningCoordinatorService({ memory });
36
+ // ADR-043 wiring.
37
+ const llmRouter = await getLLMRouter(context);
38
+ this.learningCoordinator = new LearningCoordinatorService({ memory, llmRouter });
37
39
  this.metricsOptimizer = new MetricsOptimizerService(memory);
38
40
  this.transferSpecialist = new TransferSpecialistService(memory);
39
41
  }
@@ -166,7 +166,14 @@ export function registerAllQETools(registry) {
166
166
  category: 'domain',
167
167
  domain: tool.domain,
168
168
  lazyLoad: false, // QE tools are always available
169
- }, async (params) => tool.invoke(params));
169
+ },
170
+ // ADR-043: forward the shared HybridRouter so the tool's
171
+ // MCPToolContext.llmRouter is populated explicitly.
172
+ async (params) => {
173
+ const { getSharedLLMRouter } = await import('./base.js');
174
+ const llmRouter = (await getSharedLLMRouter()) ?? undefined;
175
+ return tool.invoke(params, { llmRouter });
176
+ });
170
177
  }
171
178
  }
172
179
  /**
@@ -6,8 +6,8 @@
6
6
  * This tool wraps the test-generation domain service and exposes it via MCP.
7
7
  * Supports unit, integration, and e2e test generation with AI enhancement.
8
8
  */
9
- import { MCPToolBase, getSharedMemoryBackend } from '../base';
10
- import { createTestGeneratorService } from '../../../domains/test-generation/services/test-generator';
9
+ import { MCPToolBase, getSharedMemoryBackend, getLLMRouter } from '../base';
10
+ import { createTestGeneratorServiceWithDependencies } from '../../../domains/test-generation/services/test-generator';
11
11
  import { TokenOptimizerService } from '../../../optimization/token-optimizer-service.js';
12
12
  import { toErrorMessage } from '../../../shared/error-utils.js';
13
13
  // ============================================================================
@@ -27,10 +27,13 @@ export class TestGenerateTool extends MCPToolBase {
27
27
  * Initialize or get the test generator service with persistent storage
28
28
  * Uses factory function for proper dependency injection
29
29
  */
30
- async getService() {
30
+ async getService(context) {
31
31
  if (!this.testGeneratorService) {
32
+ // ADR-043 wiring: dependencies factory accepts llmRouter so the
33
+ // ADR-051 LLM-enhanced generation branch is reachable in MCP mode.
32
34
  const memory = await getSharedMemoryBackend();
33
- this.testGeneratorService = createTestGeneratorService(memory, {
35
+ const llmRouter = await getLLMRouter(context);
36
+ this.testGeneratorService = createTestGeneratorServiceWithDependencies({ memory, llmRouter }, {
34
37
  defaultFramework: 'vitest',
35
38
  maxTestsPerFile: 50,
36
39
  coverageTargetDefault: 80,
@@ -71,8 +74,9 @@ export class TestGenerateTool extends MCPToolBase {
71
74
  `saving ~${earlyExitResult.estimatedTokensSaved} tokens`);
72
75
  }
73
76
  }
74
- // Get the domain service and call it with the request
75
- const service = await this.getService();
77
+ // Get the domain service and call it with the request.
78
+ // Pass context so ADR-043 llmRouter reaches the service.
79
+ const service = await this.getService(context);
76
80
  // Build the domain request from MCP params
77
81
  const domainRequest = {
78
82
  sourceFiles,
@@ -8,8 +8,8 @@
8
8
  * - VisualTesterService for screenshot capture and comparison
9
9
  * - AccessibilityTesterService for WCAG compliance auditing
10
10
  */
11
- import { MCPToolBase, getSharedMemoryBackend } from '../base';
12
- import { createVisualTesterService } from '../../../domains/visual-accessibility/services/visual-tester';
11
+ import { MCPToolBase, getSharedMemoryBackend, getLLMRouter } from '../base';
12
+ import { createVisualTesterServiceWithDependencies } from '../../../domains/visual-accessibility/services/visual-tester';
13
13
  import { AccessibilityTesterService } from '../../../domains/visual-accessibility/services/accessibility-tester';
14
14
  import { toErrorMessage } from '../../../shared/error-utils.js';
15
15
  // ============================================================================
@@ -30,8 +30,11 @@ export class VisualCompareTool extends MCPToolBase {
30
30
  */
31
31
  async getService(context) {
32
32
  if (!this.visualTester) {
33
- const memory = context.memory;
34
- this.visualTester = createVisualTesterService(memory || await getSharedMemoryBackend());
33
+ // ADR-043 wiring: dependencies factory accepts llmRouter so the
34
+ // ADR-051 LLM-enhanced visual analysis branch is reachable in MCP mode.
35
+ const memory = context.memory ?? await getSharedMemoryBackend();
36
+ const llmRouter = await getLLMRouter(context);
37
+ this.visualTester = createVisualTesterServiceWithDependencies({ memory, llmRouter });
35
38
  }
36
39
  return this.visualTester;
37
40
  }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Agentic QE v3 - LLM Router Service (kernel singleton)
3
+ *
4
+ * Thin wrapper around ProviderManager + HybridRouter that:
5
+ * 1. Loads RouterConfig via config-store (defaults <- disk <- env <- override)
6
+ * 2. Builds a ProviderManager whose enabled provider set matches what's
7
+ * actually available (key in env OR explicitly enabled on disk)
8
+ * 3. Picks `primary` and `fallbacks` from the enabled set in a sensible
9
+ * order, honoring the user's defaultProvider when possible
10
+ * 4. Constructs the HybridRouter and initializes it once
11
+ *
12
+ * This is what the QEKernelImpl instantiates and exposes as
13
+ * `kernel.llmRouter`. Domain plugins receive it via their factory's
14
+ * 4th argument and pass it down to coordinators/services so the
15
+ * isLLMAnalysisAvailable() branches in 14 services actually fire.
16
+ *
17
+ * Why a service wrapper rather than constructing HybridRouter inline
18
+ * in the kernel: the kernel already has too much going on, and the
19
+ * provider-selection + fallback-ordering logic is non-trivial enough
20
+ * to deserve its own test surface (see llm-router-service.test.ts).
21
+ */
22
+ import { ProviderManager } from './provider-manager.js';
23
+ import { HybridRouter } from './router/hybrid-router.js';
24
+ import type { RouterConfig, ExtendedProviderType } from './router/types.js';
25
+ /**
26
+ * Options accepted by createLLMRouterService(). All optional — defaults
27
+ * produce a router suitable for kernel boot when at least one provider
28
+ * key is in env.
29
+ */
30
+ export interface LLMRouterServiceOptions {
31
+ /** Project root (used to find .agentic-qe/llm-config.json). Defaults to findProjectRoot(). */
32
+ projectRoot?: string;
33
+ /** Explicit config override (highest precedence). */
34
+ override?: Partial<RouterConfig>;
35
+ /** Custom env (for testing). Defaults to process.env. */
36
+ env?: NodeJS.ProcessEnv;
37
+ /**
38
+ * Inject a pre-built ProviderManager (for tests with mock providers).
39
+ * When supplied, config loading and provider construction is skipped.
40
+ */
41
+ providerManager?: ProviderManager;
42
+ }
43
+ /**
44
+ * Result of building a router. Carries the router plus the resolved
45
+ * config (useful for logging at boot) and the set of providers we
46
+ * actually wired up.
47
+ */
48
+ export interface BuiltLLMRouter {
49
+ router: HybridRouter;
50
+ resolvedConfig: RouterConfig;
51
+ enabledProviders: ExtendedProviderType[];
52
+ }
53
+ /**
54
+ * Build (and initialize) a HybridRouter for use as the kernel singleton.
55
+ * Returns null when no providers are available — caller decides whether
56
+ * that's an error or a "router-disabled" boot.
57
+ */
58
+ export declare function createLLMRouterService(options?: LLMRouterServiceOptions): Promise<BuiltLLMRouter | null>;
59
+ /**
60
+ * Determine which providers are actually usable. A provider is enabled if:
61
+ * - its config has `enabled: true`, AND
62
+ * - it's either local (ollama, onnx) OR has a detected env key
63
+ *
64
+ * Returns a deduped list in FALLBACK_PRIORITY order with the user's
65
+ * defaultProvider hoisted to the front when present.
66
+ */
67
+ export declare function pickEnabledProviders(config: RouterConfig, env?: NodeJS.ProcessEnv): ExtendedProviderType[];
68
+ /**
69
+ * Choose the primary provider and fallback chain from the enabled set.
70
+ * Honors config.defaultProvider when it's in the enabled set, otherwise
71
+ * picks the first enabled provider in priority order.
72
+ */
73
+ export declare function pickPrimaryAndFallbacks(config: RouterConfig, enabled: ExtendedProviderType[]): {
74
+ primary: ExtendedProviderType;
75
+ fallbacks: ExtendedProviderType[];
76
+ };
77
+ //# sourceMappingURL=llm-router-service.d.ts.map