agentic-qe 3.9.36 → 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 (382) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +147 -0
  3. package/README.md +35 -8
  4. package/assets/skills/skills-manifest.json +1 -1
  5. package/dist/cli/bundle.js +5 -5
  6. package/dist/cli/chunks/adapter-3JS2CN7C.js +2 -0
  7. package/dist/cli/chunks/{agent-booster-wasm-L6D36M77.js → agent-booster-wasm-FZLWOPSX.js} +2 -2
  8. package/dist/cli/chunks/{agent-handler-3JNKP4OI.js → agent-handler-KAGRVCKS.js} +2 -2
  9. package/dist/cli/chunks/{agent-memory-branch-QBRBX7O4.js → agent-memory-branch-JJKFEXQW.js} +2 -2
  10. package/dist/cli/chunks/aqe-learning-engine-Q4GFNGU6.js +2 -0
  11. package/dist/cli/chunks/{audit-M4W43TXQ.js → audit-DN5SY4JJ.js} +2 -2
  12. package/dist/cli/chunks/base-Q3MAL22Y.js +2 -0
  13. package/dist/cli/chunks/{hnswlib-node-NN6GB2YD.js → better-sqlite3-XGPW4HK5.js} +2 -2
  14. package/dist/cli/chunks/{brain-handler-WQN7C55Z.js → brain-handler-O7MP5BGY.js} +3 -3
  15. package/dist/cli/chunks/{branch-enumerator-BOTGLI7M.js → branch-enumerator-ZPTN5J6V.js} +2 -2
  16. package/dist/cli/chunks/{browser-ZFZCR7LP.js → browser-PAZE2JSD.js} +2 -2
  17. package/dist/cli/chunks/browser-workflow-JX3M2UWG.js +2 -0
  18. package/dist/cli/chunks/{chunk-DTJHO3WI.js → chunk-25QGPRWN.js} +2 -2
  19. package/dist/cli/chunks/{chunk-IF4ZZ2HD.js → chunk-2ETDES5W.js} +2 -2
  20. package/dist/cli/chunks/{chunk-556GYKN5.js → chunk-2KTRRSKD.js} +2 -2
  21. package/dist/cli/chunks/{chunk-TOZ6WUAB.js → chunk-2S4XHK26.js} +2 -2
  22. package/dist/cli/chunks/{chunk-O4C3JEOR.js → chunk-2TDWCXZ6.js} +2 -2
  23. package/dist/cli/chunks/{chunk-YUFUGGXY.js → chunk-2UN4DOBJ.js} +2 -2
  24. package/dist/cli/chunks/{chunk-CLATNP57.js → chunk-32R7EA7B.js} +3 -3
  25. package/dist/cli/chunks/{chunk-NYU4YD5V.js → chunk-3YOPJ7DY.js} +2 -2
  26. package/dist/cli/chunks/{chunk-SCBWRKPE.js → chunk-4AWJ5PE4.js} +1 -1
  27. package/dist/cli/chunks/{chunk-TCDGJYM2.js → chunk-57NJQV57.js} +1 -1
  28. package/dist/cli/chunks/{chunk-ZK6GXL5J.js → chunk-5EU2VQK3.js} +2 -2
  29. package/dist/cli/chunks/{chunk-6M2POFDF.js → chunk-5KFCH7RH.js} +1 -1
  30. package/dist/cli/chunks/{chunk-CSDGFQKW.js → chunk-5OTYBWRL.js} +2 -2
  31. package/dist/cli/chunks/{chunk-I7BXATQ6.js → chunk-5ZCVMR5E.js} +2 -2
  32. package/dist/cli/chunks/{chunk-MEQ4OPSL.js → chunk-622MIAOR.js} +3 -3
  33. package/dist/cli/chunks/{chunk-YKZ3ZJWT.js → chunk-6A2NIR2E.js} +2 -2
  34. package/dist/cli/chunks/{chunk-BI54GWTK.js → chunk-6D57DWQ6.js} +2 -2
  35. package/dist/cli/chunks/{chunk-CK5TGFII.js → chunk-6E7GI2UB.js} +1 -1
  36. package/dist/cli/chunks/{chunk-6BHUKCLI.js → chunk-6LRCMFLV.js} +2 -2
  37. package/dist/cli/chunks/{chunk-2AANIKDG.js → chunk-6QFONVEE.js} +2 -2
  38. package/dist/cli/chunks/{chunk-OO2JHVMS.js → chunk-6VQ5MFJ6.js} +3 -3
  39. package/dist/cli/chunks/{chunk-Z5A2ENBC.js → chunk-6ZRMQXVL.js} +2 -2
  40. package/dist/cli/chunks/{chunk-QYUWWTE3.js → chunk-7CKVAYP3.js} +1 -1
  41. package/dist/cli/chunks/{chunk-TG44VKO3.js → chunk-7MSYTHZM.js} +2 -2
  42. package/dist/cli/chunks/{chunk-EAMKH35X.js → chunk-7SQD2TTQ.js} +1 -1
  43. package/dist/cli/chunks/{chunk-GLI5EN6O.js → chunk-AABKTWXC.js} +2 -2
  44. package/dist/cli/chunks/{chunk-AJ2VFSLX.js → chunk-AUVC3DDB.js} +2 -2
  45. package/dist/cli/chunks/{chunk-P4VQTIJE.js → chunk-BECU52UY.js} +3 -3
  46. package/dist/cli/chunks/chunk-BF7MUYWC.js +2 -0
  47. package/dist/cli/chunks/{chunk-VENEJ3UI.js → chunk-BGBSYF3K.js} +2 -2
  48. package/dist/cli/chunks/{chunk-W2DF6FNE.js → chunk-BN7ERYXI.js} +1 -1
  49. package/dist/cli/chunks/{chunk-LPVRFVSC.js → chunk-CKECJH2A.js} +2 -2
  50. package/dist/cli/chunks/{chunk-FK4B2HIW.js → chunk-COZDJLIL.js} +1 -1
  51. package/dist/cli/chunks/{chunk-2EWOYVH3.js → chunk-CR4ERDS2.js} +2 -2
  52. package/dist/cli/chunks/chunk-DMIYWPQQ.js +2 -0
  53. package/dist/cli/chunks/{chunk-QXM3PRVR.js → chunk-DQIS6J77.js} +2 -2
  54. package/dist/cli/chunks/{chunk-P7IOH7L4.js → chunk-DVOH75S4.js} +1 -1
  55. package/dist/cli/chunks/{chunk-DKBBMZWB.js → chunk-EBQ6YKP2.js} +2 -2
  56. package/dist/cli/chunks/{chunk-SJ3SHZUC.js → chunk-ECPB7IAH.js} +4 -4
  57. package/dist/cli/chunks/{chunk-QH7K2UPP.js → chunk-EIROAH6N.js} +2 -2
  58. package/dist/cli/chunks/{chunk-AH3TKDVW.js → chunk-ELUERFGA.js} +2 -2
  59. package/dist/cli/chunks/{chunk-ZBY4HSHR.js → chunk-ELZ67OHQ.js} +2 -2
  60. package/dist/cli/chunks/{chunk-HHGZ4LXC.js → chunk-EO4B5GS4.js} +1 -1
  61. package/dist/cli/chunks/{chunk-5ZTY5JJX.js → chunk-EUJHHXE6.js} +2 -2
  62. package/dist/cli/chunks/{chunk-MFPVS2KP.js → chunk-F3OVFA6W.js} +9 -9
  63. package/dist/cli/chunks/{chunk-RDXIRE2I.js → chunk-FJSR2U65.js} +2 -2
  64. package/dist/cli/chunks/{chunk-TU2PSEDW.js → chunk-G3BQU3Q6.js} +2 -2
  65. package/dist/cli/chunks/{chunk-BNFW4LMD.js → chunk-G5DTENO3.js} +2 -2
  66. package/dist/cli/chunks/{chunk-IMP43AXO.js → chunk-GMKGLZJU.js} +2 -2
  67. package/dist/cli/chunks/{chunk-Y4ERDIPP.js → chunk-GRG3OP34.js} +2 -2
  68. package/dist/cli/chunks/{chunk-PYCYZYIL.js → chunk-GRYXNWPF.js} +4 -4
  69. package/dist/cli/chunks/{chunk-GW7HWFWQ.js → chunk-GTGONWGX.js} +1 -1
  70. package/dist/cli/chunks/{chunk-AH3UC4IV.js → chunk-GTRXZJNX.js} +2 -2
  71. package/dist/cli/chunks/{chunk-QAGAEAKM.js → chunk-GXJ4BCGC.js} +2 -2
  72. package/dist/cli/chunks/{chunk-EXBJCDFM.js → chunk-H22MMMYY.js} +2 -2
  73. package/dist/cli/chunks/{chunk-FZA674BT.js → chunk-H44WD7QX.js} +2 -2
  74. package/dist/cli/chunks/{chunk-NKBCAW27.js → chunk-HPNEZ7YN.js} +1 -1
  75. package/dist/cli/chunks/{chunk-EXUT2LCP.js → chunk-HRDGN3OK.js} +1 -1
  76. package/dist/cli/chunks/{chunk-O5JNHH2D.js → chunk-IHDUWPFY.js} +2 -2
  77. package/dist/cli/chunks/{chunk-GFMSAL5Y.js → chunk-IITKJCPK.js} +2 -2
  78. package/dist/cli/chunks/{chunk-AY2LLGZN.js → chunk-IJ4BUSJN.js} +4 -4
  79. package/dist/cli/chunks/{chunk-NKA3X6VT.js → chunk-IK6AJX3C.js} +1 -1
  80. package/dist/cli/chunks/{chunk-D5CLABLM.js → chunk-IPRDHKSI.js} +2 -2
  81. package/dist/cli/chunks/{chunk-BGD65PL4.js → chunk-JLKHPIQF.js} +1 -1
  82. package/dist/cli/chunks/chunk-K22TPWOJ.js +3 -0
  83. package/dist/cli/chunks/{chunk-6DACR7QY.js → chunk-K4T3RDCB.js} +2 -2
  84. package/dist/cli/chunks/{chunk-LUFY3GGI.js → chunk-KCTH5MHE.js} +2 -2
  85. package/dist/cli/chunks/{chunk-7ZCDG3IM.js → chunk-KEC5FBAW.js} +1 -1
  86. package/dist/cli/chunks/{chunk-PY4B37U3.js → chunk-KKNBYXYA.js} +1 -1
  87. package/dist/cli/chunks/{chunk-X6UGFKHW.js → chunk-KRXKU54J.js} +2 -2
  88. package/dist/cli/chunks/{provider-manager-VPS4W7KG.js → chunk-KZJXVIAW.js} +13 -13
  89. package/dist/cli/chunks/{chunk-C2JK5O55.js → chunk-LF7URN2X.js} +2 -2
  90. package/dist/cli/chunks/{chunk-CAGRQR2U.js → chunk-MQYTW2IN.js} +2 -2
  91. package/dist/cli/chunks/{chunk-KI6RXKP4.js → chunk-MVGVD6LS.js} +2 -2
  92. package/dist/cli/chunks/{chunk-U6QAKKNB.js → chunk-NDCPEXDN.js} +2 -2
  93. package/dist/cli/chunks/{chunk-PUZAIRMY.js → chunk-NOCYYXK4.js} +2 -2
  94. package/dist/cli/chunks/{chunk-L3JJ52N6.js → chunk-NPSBMDVU.js} +2 -2
  95. package/dist/cli/chunks/{chunk-U7B4WCBY.js → chunk-NQZYUH6S.js} +1 -1
  96. package/dist/cli/chunks/{chunk-4R3WXD4U.js → chunk-NRLT44YB.js} +1 -1
  97. package/dist/cli/chunks/{chunk-FSDUNGYM.js → chunk-OC3OJWLB.js} +2 -2
  98. package/dist/cli/chunks/{chunk-5ECOD4O6.js → chunk-OQP5OFRR.js} +1 -1
  99. package/dist/cli/chunks/{chunk-7TO7NTLT.js → chunk-OVENSL64.js} +210 -210
  100. package/dist/cli/chunks/{chunk-5SYH5QMQ.js → chunk-P7T5Y735.js} +2 -2
  101. package/dist/cli/chunks/{chunk-RCU5L7FF.js → chunk-PLRSKAFZ.js} +2 -2
  102. package/dist/cli/chunks/{chunk-74DA4P5K.js → chunk-PUXDXIUE.js} +1 -1
  103. package/dist/cli/chunks/{chunk-A3TOJ4KN.js → chunk-PW6MOFXG.js} +2 -2
  104. package/dist/cli/chunks/chunk-PXFQSVA2.js +12 -0
  105. package/dist/cli/chunks/{chunk-5MSZREOD.js → chunk-Q24OJX44.js} +2 -2
  106. package/dist/cli/chunks/{chunk-XNXFEMWT.js → chunk-Q5VHBI4U.js} +1 -1
  107. package/dist/cli/chunks/{chunk-HOZNVDFF.js → chunk-QNW335PD.js} +2 -2
  108. package/dist/cli/chunks/{chunk-ESIE3MT5.js → chunk-RPL6K623.js} +3 -3
  109. package/dist/cli/chunks/{chunk-JFDNNXIX.js → chunk-RRLQFFCO.js} +4 -4
  110. package/dist/cli/chunks/{chunk-G6Q66YLG.js → chunk-RWYW573C.js} +3 -3
  111. package/dist/cli/chunks/{chunk-CJQT3MYN.js → chunk-SLNGJW4G.js} +1 -1
  112. package/dist/cli/chunks/{chunk-PGRDHDEJ.js → chunk-SQBB2DC6.js} +1 -1
  113. package/dist/cli/chunks/{chunk-GWLLNJ64.js → chunk-T3UXMPXX.js} +1 -1
  114. package/dist/cli/chunks/{chunk-MJJAHA2T.js → chunk-TFNLXAK5.js} +1 -1
  115. package/dist/cli/chunks/{chunk-YE42UTLT.js → chunk-TL5F2S3Z.js} +2 -2
  116. package/dist/cli/chunks/{chunk-JA7YARLP.js → chunk-TNGGVMPQ.js} +1 -1
  117. package/dist/cli/chunks/{chunk-YMB4YVFX.js → chunk-TNVYKYTO.js} +3 -3
  118. package/dist/cli/chunks/{chunk-FYJE4QLL.js → chunk-TP77PNN6.js} +2 -2
  119. package/dist/cli/chunks/{chunk-2KMCRASK.js → chunk-TX7SNQKL.js} +1 -1
  120. package/dist/cli/chunks/{chunk-TK7TGVVQ.js → chunk-UDFLR7GR.js} +1 -1
  121. package/dist/cli/chunks/{chunk-G7YDYXQH.js → chunk-UDVX34ZG.js} +2 -2
  122. package/dist/cli/chunks/{chunk-5RPHV7Y3.js → chunk-UU2Q6XWF.js} +1 -1
  123. package/dist/cli/chunks/{chunk-27FNROZ2.js → chunk-VKRMVTWU.js} +49 -49
  124. package/dist/cli/chunks/{chunk-AWC7G2D3.js → chunk-VOIWDPIU.js} +2 -2
  125. package/dist/cli/chunks/chunk-VPCE5CIT.js +2 -0
  126. package/dist/cli/chunks/{chunk-6M44C43I.js → chunk-W2DT3CDE.js} +2 -2
  127. package/dist/cli/chunks/{chunk-GAC4MD6S.js → chunk-W6ZF2CPN.js} +1 -1
  128. package/dist/cli/chunks/{chunk-5OAAJUGO.js → chunk-WDTCCPK4.js} +1 -1
  129. package/dist/cli/chunks/{chunk-NMHULQAV.js → chunk-WL2J6ECN.js} +2 -2
  130. package/dist/cli/chunks/chunk-WMG5F6R6.js +2 -0
  131. package/dist/cli/chunks/{chunk-MAHLTWGV.js → chunk-WO7KYT3X.js} +2 -2
  132. package/dist/cli/chunks/{chunk-5M63H6RY.js → chunk-WPNZSL4S.js} +1 -1
  133. package/dist/cli/chunks/{chunk-X6IEQVSF.js → chunk-WQEZKAUR.js} +2 -2
  134. package/dist/cli/chunks/{chunk-BUVY7IGM.js → chunk-WS4XVJHI.js} +1 -1
  135. package/dist/cli/chunks/{chunk-66636UWH.js → chunk-XGUQYVJR.js} +2 -2
  136. package/dist/cli/chunks/{chunk-3CIQ6CQ4.js → chunk-XKOKMS5A.js} +2 -2
  137. package/dist/cli/chunks/{chunk-TXSVZYFA.js → chunk-XRK7FBTY.js} +2 -2
  138. package/dist/cli/chunks/{chunk-QMUTKI34.js → chunk-Y2DPXMOR.js} +1 -1
  139. package/dist/cli/chunks/{chunk-F57OUXHJ.js → chunk-Y357YFLF.js} +2 -2
  140. package/dist/cli/chunks/{chunk-EDG4NEET.js → chunk-YGRTMAWB.js} +1 -1
  141. package/dist/cli/chunks/{chunk-LIE24NRL.js → chunk-YPOTBXPU.js} +2 -2
  142. package/dist/cli/chunks/{chunk-F5IVWV2P.js → chunk-YYWIA5FX.js} +1 -1
  143. package/dist/cli/chunks/{chunk-OLBYILKU.js → chunk-ZEMXMDD3.js} +2 -2
  144. package/dist/cli/chunks/{chunk-DCXFHBHS.js → chunk-ZTMWJQTZ.js} +2 -2
  145. package/dist/cli/chunks/{ci-YA6SQ3PU.js → ci-EHRUN7O6.js} +2 -2
  146. package/dist/cli/chunks/{ci-output-KKHXCQI4.js → ci-output-EXDXVXKB.js} +2 -2
  147. package/dist/cli/chunks/{circuit-breaker-RTBCXGKA.js → circuit-breaker-LM4QRAAL.js} +2 -2
  148. package/dist/cli/chunks/{claude-flow-setup-CRV3Y6LO.js → claude-flow-setup-ZHUCZVW7.js} +2 -2
  149. package/dist/cli/chunks/client-PA3UJIHH.js +2 -0
  150. package/dist/cli/chunks/{cline-installer-IS2VLXQS.js → cline-installer-WMFLQOW2.js} +2 -2
  151. package/dist/cli/chunks/{code-3CSNTK5O.js → code-L7KRLU5E.js} +2 -2
  152. package/dist/cli/chunks/{code-index-extractor-P2YXEJGV.js → code-index-extractor-FTMUYQC6.js} +2 -2
  153. package/dist/cli/chunks/{codex-installer-QGDV2CAQ.js → codex-installer-B3F6WI3Z.js} +2 -2
  154. package/dist/cli/chunks/{completions-TYECEYHY.js → completions-3JZQRNB6.js} +2 -2
  155. package/dist/cli/chunks/{complexity-analyzer-GA5KSFF2.js → complexity-analyzer-LB2FFEKX.js} +2 -2
  156. package/dist/cli/chunks/{continuedev-installer-NW5Y4ZMI.js → continuedev-installer-WH6IMV7R.js} +2 -2
  157. package/dist/cli/chunks/{copilot-installer-E5BIBYG6.js → copilot-installer-NOIEOFJM.js} +2 -2
  158. package/dist/cli/chunks/{cost-tracker-JLSEY4ID.js → cost-tracker-IKX2VYSA.js} +2 -2
  159. package/dist/cli/chunks/{coverage-4TH275AN.js → coverage-TD37CYSY.js} +3 -3
  160. package/dist/cli/chunks/cross-domain-router-BVJRP2ZX.js +2 -0
  161. package/dist/cli/chunks/{cursor-installer-4SXSE5YT.js → cursor-installer-4NSVGRM5.js} +2 -2
  162. package/dist/cli/chunks/{daemon-7T4RZQH6.js → daemon-LYDV7NRW.js} +3 -3
  163. package/dist/cli/chunks/{daemon-U6MP4P6S.js → daemon-UWEBUIDT.js} +4 -4
  164. package/dist/cli/chunks/{dag-attention-scheduler-DT2V46XR.js → dag-attention-scheduler-NECJGCHC.js} +2 -2
  165. package/dist/cli/chunks/{detect-WHSTB4QT.js → detect-4XGC7ILO.js} +2 -2
  166. package/dist/cli/chunks/{dist-node-4LC2RJXW.js → dist-node-GGJDXRKJ.js} +2 -2
  167. package/dist/cli/chunks/{domain-handler-A2LOOU7Y.js → domain-handler-UOFONAUT.js} +2 -2
  168. package/dist/cli/chunks/{domain-transfer-4RJTMB3Y.js → domain-transfer-6JLNOYPA.js} +2 -2
  169. package/dist/cli/chunks/dream-BXZUEIW2.js +2 -0
  170. package/dist/cli/chunks/{embed-and-insert-pattern-PR3KTT24.js → embed-and-insert-pattern-ZM75DQ4J.js} +2 -2
  171. package/dist/cli/chunks/{eval-2HRBMOOB.js → eval-CYZJTHEB.js} +2 -2
  172. package/dist/cli/chunks/{experience-capture-middleware-X46IYOSD.js → experience-capture-middleware-RBOJLDUB.js} +3 -3
  173. package/dist/cli/chunks/{fast-paths-LYYYU362.js → fast-paths-S5BWZR3L.js} +2 -2
  174. package/dist/cli/chunks/{feature-flags-RNAMQPUN.js → feature-flags-6E7H3NYP.js} +2 -2
  175. package/dist/cli/chunks/{feature-flags-TKDXIHOH.js → feature-flags-DUNQPDU3.js} +2 -2
  176. package/dist/cli/chunks/{file-discovery-MKGGMDIW.js → file-discovery-PFFKDGYG.js} +2 -2
  177. package/dist/cli/chunks/{fleet-OY4IBCZG.js → fleet-RCDZZFXN.js} +3 -3
  178. package/dist/cli/chunks/{gnn-wrapper-G5OGHVAQ.js → gnn-wrapper-5AG3WDWF.js} +2 -2
  179. package/dist/cli/chunks/{heartbeat-handler-N7IUATSD.js → heartbeat-handler-O2KAEX4Y.js} +4 -4
  180. package/dist/cli/chunks/heartbeat-scheduler-LEKAWFJF.js +2 -0
  181. package/dist/cli/chunks/hnsw-adapter-2TCEG5M2.js +2 -0
  182. package/dist/cli/chunks/hnsw-index-VDPUTEES.js +2 -0
  183. package/dist/cli/chunks/{hnsw-legacy-bridge-TMCMZDVF.js → hnsw-legacy-bridge-C7FG6YGW.js} +2 -2
  184. package/dist/cli/chunks/{better-sqlite3-SPABZYYQ.js → hnswlib-node-YX6OOBN6.js} +2 -2
  185. package/dist/cli/chunks/{hooks-5QDXEZ25.js → hooks-FUHNE2P7.js} +10 -10
  186. package/dist/cli/chunks/hybrid-router-2EMDIYIG.js +2 -0
  187. package/dist/cli/chunks/{hypergraph-engine-QQYKS2F3.js → hypergraph-engine-LQRYBNPV.js} +2 -2
  188. package/dist/cli/chunks/{hypergraph-handler-YXFNXMRF.js → hypergraph-handler-AFFNLZVD.js} +3 -3
  189. package/dist/cli/chunks/impact-analyzer-HFD6CPWC.js +2 -0
  190. package/dist/cli/chunks/{init-handler-SFFSDGEF.js → init-handler-BQ6IDBX4.js} +6 -6
  191. package/dist/cli/chunks/init-wizard-552QIVRC.js +2 -0
  192. package/dist/cli/chunks/kernel-5DN6O6EE.js +2 -0
  193. package/dist/cli/chunks/{kilocode-installer-QFRYXQYY.js → kilocode-installer-KS72HUSG.js} +2 -2
  194. package/dist/cli/chunks/{kiro-installer-7L2EYEOR.js → kiro-installer-2ZEFLGRX.js} +2 -2
  195. package/dist/cli/chunks/knowledge-graph-76Y77MB6.js +2 -0
  196. package/dist/cli/chunks/{learning-7TVVL5UH.js → learning-GGHGJ6B6.js} +3 -3
  197. package/dist/cli/chunks/llm-router-LP6K5BJF.js +36 -0
  198. package/dist/cli/chunks/llm-router-service-4O6GCEFH.js +2 -0
  199. package/dist/cli/chunks/{load-Y46RO7BF.js → load-2MLKXOT2.js} +2 -2
  200. package/dist/cli/chunks/load-test-FCI2IWRJ.js +2 -0
  201. package/dist/cli/chunks/{mcp-PYNP2S5O.js → mcp-CDJBJG5H.js} +2 -2
  202. package/dist/cli/chunks/{memory-DAVXW5OP.js → memory-4LAX7JZS.js} +5 -5
  203. package/dist/cli/chunks/memory-backend-MKNCBNDE.js +2 -0
  204. package/dist/cli/chunks/memory-handlers-OBAFR4WV.js +2 -0
  205. package/dist/cli/chunks/{multi-model-executor-7ECJRCM3.js → multi-model-executor-SLJV73HE.js} +2 -2
  206. package/dist/cli/chunks/{opencode-installer-H7QOONUC.js → opencode-installer-M76SONWV.js} +2 -2
  207. package/dist/cli/chunks/{orchestrator-TSJ2F3MG.js → orchestrator-TJPUDJMP.js} +5 -5
  208. package/dist/cli/chunks/{pipeline-SXR4MRY7.js → pipeline-2PVNFT6J.js} +2 -2
  209. package/dist/cli/chunks/{platform-7NOS56VD.js → platform-KCSEDKEE.js} +2 -2
  210. package/dist/cli/chunks/{plugin-VLSWBGJN.js → plugin-QX47QF5U.js} +2 -2
  211. package/dist/cli/chunks/{prime-radiant-advanced-wasm-7ZHSOP7H.js → prime-radiant-advanced-wasm-L6VWL7VR.js} +2 -2
  212. package/dist/cli/chunks/protocol-executor-IA7WNT23.js +2 -0
  213. package/dist/cli/chunks/{protocol-handler-LWNYDM4D.js → protocol-handler-WDNJDEUE.js} +2 -2
  214. package/dist/cli/chunks/{prove-JYFW3OBB.js → prove-3B75DA3S.js} +2 -2
  215. package/dist/cli/chunks/provider-manager-3K5KB5A6.js +2 -0
  216. package/dist/cli/chunks/qe-reasoning-bank-V5Z3BBYY.js +2 -0
  217. package/dist/cli/chunks/{quality-FCAOFXZ2.js → quality-UGASS5WM.js} +2 -2
  218. package/dist/cli/chunks/queen-coordinator-QOMPA27Z.js +2 -0
  219. package/dist/cli/chunks/real-embeddings-COBP2LHS.js +2 -0
  220. package/dist/cli/chunks/{roocode-installer-ZVGJSAWD.js → roocode-installer-TOZ4VLFT.js} +2 -2
  221. package/dist/cli/chunks/router-P5RZUPC4.js +2 -0
  222. package/dist/cli/chunks/routing-feedback-3PS3OZQC.js +2 -0
  223. package/dist/cli/chunks/{routing-handler-AGDHK3A2.js → routing-handler-5TDVSILX.js} +2 -2
  224. package/dist/cli/chunks/{ruvector-commands-UGZINDCN.js → ruvector-commands-AM63KWQN.js} +2 -2
  225. package/dist/cli/chunks/{rvf-dual-writer-PW7H6G4V.js → rvf-dual-writer-UANIFE2M.js} +2 -2
  226. package/dist/cli/chunks/{rvf-migration-adapter-ZKOTVCHJ.js → rvf-migration-adapter-LNPYWAPI.js} +2 -2
  227. package/dist/cli/chunks/{rvf-migration-coordinator-SCBEMOP3.js → rvf-migration-coordinator-U47L63DQ.js} +2 -2
  228. package/dist/cli/chunks/rvf-native-adapter-TT7OJPKM.js +2 -0
  229. package/dist/cli/chunks/safe-db-PEW7VBAE.js +2 -0
  230. package/dist/cli/chunks/schedule-QHOTHBQE.js +2 -0
  231. package/dist/cli/chunks/scheduler-KXJBYTRT.js +2 -0
  232. package/dist/cli/chunks/{security-H7QX46VA.js → security-KDQ2AH7G.js} +3 -3
  233. package/dist/cli/chunks/{shared-rvf-adapter-LWYHWJIA.js → shared-rvf-adapter-5MAGLLYJ.js} +2 -2
  234. package/dist/cli/chunks/{shared-rvf-dual-writer-P2U424FB.js → shared-rvf-dual-writer-GF2OPPM5.js} +2 -2
  235. package/dist/cli/chunks/sqlite-persistence-TPXJK34J.js +2 -0
  236. package/dist/cli/chunks/{status-handler-UNX3RA3S.js → status-handler-XZKEL7LO.js} +2 -2
  237. package/dist/cli/chunks/{structural-health-65YV3M5E.js → structural-health-27QKWW25.js} +2 -2
  238. package/dist/cli/chunks/{sync-OZ7CHYYO.js → sync-INNKS6UK.js} +2 -2
  239. package/dist/cli/chunks/{sync-B4O3NDJ6.js → sync-V3HGPEJT.js} +2 -2
  240. package/dist/cli/chunks/{task-handler-NIG3USPG.js → task-handler-LDUVOM6G.js} +2 -2
  241. package/dist/cli/chunks/{task-handlers-Z2PI7BTO.js → task-handlers-HTCPV7OO.js} +3 -3
  242. package/dist/cli/chunks/{test-MNLYS3WS.js → test-PCUVGVJL.js} +4 -4
  243. package/dist/cli/chunks/{test-scheduling-VCL6D6T7.js → test-scheduling-GYVXWCAA.js} +3 -3
  244. package/dist/cli/chunks/{token-bootstrap-DGMEU3W4.js → token-bootstrap-MJ2ANC4P.js} +2 -2
  245. package/dist/cli/chunks/{token-usage-IXTYAV5K.js → token-usage-ZREHROTF.js} +2 -2
  246. package/dist/cli/chunks/{transformers-5CWLXT2M.js → transformers-6B3FWFYL.js} +2 -2
  247. package/dist/cli/chunks/{tree-sitter-wasm-parser-W3FKJLJG.js → tree-sitter-wasm-parser-JVV234MN.js} +2 -2
  248. package/dist/cli/chunks/{types-NVOCAZCQ.js → types-MVZTJI2F.js} +2 -2
  249. package/dist/cli/chunks/unified-memory-ROS2NKR5.js +2 -0
  250. package/dist/cli/chunks/unified-memory-hnsw-FLEUF3XO.js +2 -0
  251. package/dist/cli/chunks/unified-persistence-QC5L7UNQ.js +2 -0
  252. package/dist/cli/chunks/{upgrade-VJYD4U4X.js → upgrade-MKTFEILD.js} +2 -2
  253. package/dist/cli/chunks/{validate-CAKTCZ3T.js → validate-IABGALSW.js} +2 -2
  254. package/dist/cli/chunks/{validate-swarm-H24JHUTN.js → validate-swarm-RHF53RF6.js} +2 -2
  255. package/dist/cli/chunks/{vibium-247XN6V3.js → vibium-RAKW6FMF.js} +2 -2
  256. package/dist/cli/chunks/visual-security-NLIOUQCR.js +2 -0
  257. package/dist/cli/chunks/{web-tree-sitter-3DOMHLRH.js → web-tree-sitter-PYK7F4JZ.js} +2 -2
  258. package/dist/cli/chunks/{windsurf-installer-S2MOA5TQ.js → windsurf-installer-S3U2HWZ4.js} +2 -2
  259. package/dist/cli/chunks/{witness-chain-CKLVPFLG.js → witness-chain-435NKQLB.js} +2 -2
  260. package/dist/cli/chunks/witness-chain-U7X6JX5J.js +2 -0
  261. package/dist/cli/chunks/{workflow-GU3IV2OD.js → workflow-5UHJCZ6J.js} +4 -4
  262. package/dist/cli/chunks/workflow-orchestrator-APE6BAXH.js +2 -0
  263. package/dist/cli/chunks/{wrappers-74Y4EKW3.js → wrappers-RD3NCMLK.js} +2 -2
  264. package/dist/cli/commands/llm-router.js +83 -26
  265. package/dist/domains/chaos-resilience/coordinator.d.ts +2 -1
  266. package/dist/domains/chaos-resilience/coordinator.js +3 -2
  267. package/dist/domains/chaos-resilience/plugin.d.ts +4 -2
  268. package/dist/domains/chaos-resilience/plugin.js +8 -5
  269. package/dist/domains/code-intelligence/coordinator.d.ts +2 -1
  270. package/dist/domains/code-intelligence/coordinator.js +3 -2
  271. package/dist/domains/code-intelligence/plugin.d.ts +4 -2
  272. package/dist/domains/code-intelligence/plugin.js +8 -5
  273. package/dist/domains/contract-testing/coordinator.d.ts +2 -1
  274. package/dist/domains/contract-testing/coordinator.js +3 -2
  275. package/dist/domains/contract-testing/plugin.d.ts +4 -2
  276. package/dist/domains/contract-testing/plugin.js +8 -5
  277. package/dist/domains/coverage-analysis/coordinator.d.ts +2 -1
  278. package/dist/domains/coverage-analysis/coordinator.js +4 -3
  279. package/dist/domains/coverage-analysis/plugin.d.ts +3 -2
  280. package/dist/domains/coverage-analysis/plugin.js +4 -4
  281. package/dist/domains/defect-intelligence/coordinator.d.ts +2 -1
  282. package/dist/domains/defect-intelligence/coordinator.js +4 -3
  283. package/dist/domains/defect-intelligence/plugin.d.ts +4 -2
  284. package/dist/domains/defect-intelligence/plugin.js +9 -6
  285. package/dist/domains/learning-optimization/coordinator.d.ts +2 -1
  286. package/dist/domains/learning-optimization/coordinator.js +3 -2
  287. package/dist/domains/learning-optimization/plugin.d.ts +4 -2
  288. package/dist/domains/learning-optimization/plugin.js +8 -5
  289. package/dist/domains/quality-assessment/coordinator.d.ts +2 -1
  290. package/dist/domains/quality-assessment/coordinator.js +4 -3
  291. package/dist/domains/quality-assessment/plugin.d.ts +4 -2
  292. package/dist/domains/quality-assessment/plugin.js +10 -6
  293. package/dist/domains/requirements-validation/coordinator.d.ts +2 -1
  294. package/dist/domains/requirements-validation/coordinator.js +3 -2
  295. package/dist/domains/requirements-validation/plugin.d.ts +4 -2
  296. package/dist/domains/requirements-validation/plugin.js +8 -5
  297. package/dist/domains/security-compliance/coordinator.d.ts +2 -1
  298. package/dist/domains/security-compliance/coordinator.js +4 -2
  299. package/dist/domains/security-compliance/plugin.d.ts +4 -2
  300. package/dist/domains/security-compliance/plugin.js +11 -6
  301. package/dist/domains/test-execution/coordinator.d.ts +3 -2
  302. package/dist/domains/test-execution/coordinator.js +6 -5
  303. package/dist/domains/test-execution/plugin.d.ts +4 -2
  304. package/dist/domains/test-execution/plugin.js +6 -4
  305. package/dist/domains/test-generation/coordinator.d.ts +2 -1
  306. package/dist/domains/test-generation/coordinator.js +4 -3
  307. package/dist/domains/test-generation/plugin.d.ts +4 -2
  308. package/dist/domains/test-generation/plugin.js +12 -7
  309. package/dist/domains/visual-accessibility/coordinator.d.ts +2 -1
  310. package/dist/domains/visual-accessibility/coordinator.js +4 -3
  311. package/dist/domains/visual-accessibility/plugin.d.ts +4 -2
  312. package/dist/domains/visual-accessibility/plugin.js +9 -6
  313. package/dist/kernel/interfaces.d.ts +37 -0
  314. package/dist/kernel/kernel.d.ts +39 -0
  315. package/dist/kernel/kernel.js +157 -17
  316. package/dist/learning/embedder-endpoint-client.d.ts +133 -0
  317. package/dist/learning/embedder-endpoint-client.js +426 -0
  318. package/dist/learning/embedder-identity-store.d.ts +30 -0
  319. package/dist/learning/embedder-identity-store.js +136 -0
  320. package/dist/learning/qe-reasoning-bank.js +11 -3
  321. package/dist/learning/real-embeddings.d.ts +28 -0
  322. package/dist/learning/real-embeddings.js +130 -19
  323. package/dist/learning/sqlite-persistence.js +16 -3
  324. package/dist/mcp/bundle.js +455 -423
  325. package/dist/mcp/qe-tool-bridge.js +8 -1
  326. package/dist/mcp/tools/base.d.ts +56 -0
  327. package/dist/mcp/tools/base.js +104 -1
  328. package/dist/mcp/tools/chaos-resilience/inject.js +4 -2
  329. package/dist/mcp/tools/code-intelligence/analyze.js +5 -3
  330. package/dist/mcp/tools/contract-testing/validate.js +4 -2
  331. package/dist/mcp/tools/coverage-analysis/index.js +11 -5
  332. package/dist/mcp/tools/defect-intelligence/predict.js +5 -10
  333. package/dist/mcp/tools/learning-optimization/optimize.js +4 -2
  334. package/dist/mcp/tools/registry.js +8 -1
  335. package/dist/mcp/tools/test-generation/generate.js +10 -6
  336. package/dist/mcp/tools/visual-accessibility/index.js +7 -4
  337. package/dist/shared/llm/llm-router-service.d.ts +77 -0
  338. package/dist/shared/llm/llm-router-service.js +166 -0
  339. package/dist/shared/llm/providers/gemini.js +5 -2
  340. package/dist/shared/llm/router/config-store.d.ts +89 -0
  341. package/dist/shared/llm/router/config-store.js +261 -0
  342. package/dist/shared/llm/router/hybrid-router.js +33 -11
  343. package/package.json +1 -1
  344. package/dist/cli/chunks/adapter-MISKG4JY.js +0 -2
  345. package/dist/cli/chunks/aqe-learning-engine-NDLBNM6C.js +0 -2
  346. package/dist/cli/chunks/base-OMDJAHGF.js +0 -2
  347. package/dist/cli/chunks/browser-workflow-XUG5Z5CJ.js +0 -2
  348. package/dist/cli/chunks/chunk-JD3VV2BD.js +0 -2
  349. package/dist/cli/chunks/chunk-USLHYNYG.js +0 -2
  350. package/dist/cli/chunks/chunk-ZYPSXPQ5.js +0 -2
  351. package/dist/cli/chunks/client-VXJRAW3W.js +0 -2
  352. package/dist/cli/chunks/cross-domain-router-AKHC7TFO.js +0 -2
  353. package/dist/cli/chunks/dream-FPWIC7KF.js +0 -2
  354. package/dist/cli/chunks/heartbeat-scheduler-WHGMTRT7.js +0 -2
  355. package/dist/cli/chunks/hnsw-adapter-IA2M5KDH.js +0 -2
  356. package/dist/cli/chunks/hnsw-index-UBXTXXLQ.js +0 -2
  357. package/dist/cli/chunks/hybrid-router-IY62NN7G.js +0 -2
  358. package/dist/cli/chunks/impact-analyzer-6PVCOS33.js +0 -2
  359. package/dist/cli/chunks/init-wizard-XHP5C6RD.js +0 -2
  360. package/dist/cli/chunks/kernel-YM5PY5SS.js +0 -2
  361. package/dist/cli/chunks/knowledge-graph-LTUOUHO7.js +0 -2
  362. package/dist/cli/chunks/llm-router-S3HHVPH4.js +0 -36
  363. package/dist/cli/chunks/load-test-CYCAQI3F.js +0 -2
  364. package/dist/cli/chunks/memory-backend-RW2OPAJU.js +0 -2
  365. package/dist/cli/chunks/memory-handlers-6COHVON7.js +0 -2
  366. package/dist/cli/chunks/protocol-executor-CREUYOBZ.js +0 -2
  367. package/dist/cli/chunks/qe-reasoning-bank-J4DLHRJY.js +0 -2
  368. package/dist/cli/chunks/queen-coordinator-MGLNSTPY.js +0 -2
  369. package/dist/cli/chunks/real-embeddings-LE6YXNPZ.js +0 -2
  370. package/dist/cli/chunks/router-CXGPFUT2.js +0 -2
  371. package/dist/cli/chunks/routing-feedback-MZ73LFBP.js +0 -2
  372. package/dist/cli/chunks/rvf-native-adapter-T6JBPHTE.js +0 -2
  373. package/dist/cli/chunks/safe-db-DS4SKPYB.js +0 -2
  374. package/dist/cli/chunks/schedule-H2Q7XWAK.js +0 -2
  375. package/dist/cli/chunks/scheduler-PMZMKQIF.js +0 -2
  376. package/dist/cli/chunks/sqlite-persistence-ONKEAMTQ.js +0 -2
  377. package/dist/cli/chunks/unified-memory-PNHI6I3R.js +0 -2
  378. package/dist/cli/chunks/unified-memory-hnsw-CDV3UMBD.js +0 -2
  379. package/dist/cli/chunks/unified-persistence-FMCHCEZV.js +0 -2
  380. package/dist/cli/chunks/visual-security-3WRJQDUY.js +0 -2
  381. package/dist/cli/chunks/witness-chain-5ZKCKNRJ.js +0 -2
  382. package/dist/cli/chunks/workflow-orchestrator-OBSFY7YK.js +0 -2
@@ -0,0 +1,166 @@
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 { loadRouterConfig, shouldEnableRouter, detectAvailableProvidersFromEnv, } from './router/config-store.js';
25
+ /**
26
+ * Order in which we pick fallbacks when the user hasn't specified any.
27
+ * Local-first (free), then cheapest cloud, then richer providers. This
28
+ * is a defensive default; users who care should set
29
+ * `routerConfig.fallbackChain` explicitly.
30
+ */
31
+ const FALLBACK_PRIORITY = [
32
+ 'ollama',
33
+ 'onnx',
34
+ 'gemini',
35
+ 'openrouter',
36
+ 'openai',
37
+ 'claude',
38
+ 'azure-openai',
39
+ 'bedrock',
40
+ ];
41
+ /**
42
+ * Build (and initialize) a HybridRouter for use as the kernel singleton.
43
+ * Returns null when no providers are available — caller decides whether
44
+ * that's an error or a "router-disabled" boot.
45
+ */
46
+ export async function createLLMRouterService(options = {}) {
47
+ // Honor the test-injected ProviderManager path first.
48
+ if (options.providerManager) {
49
+ const config = loadRouterConfig({
50
+ projectRoot: options.projectRoot,
51
+ override: options.override,
52
+ env: options.env,
53
+ });
54
+ const router = new HybridRouter(options.providerManager, config);
55
+ await router.initialize();
56
+ return {
57
+ router,
58
+ resolvedConfig: config,
59
+ enabledProviders: providersFromConfig(config),
60
+ };
61
+ }
62
+ // Real path: detect env, load config, build provider manager.
63
+ if (!shouldEnableRouter({ projectRoot: options.projectRoot, env: options.env })) {
64
+ return null;
65
+ }
66
+ const config = loadRouterConfig({
67
+ projectRoot: options.projectRoot,
68
+ override: options.override,
69
+ env: options.env,
70
+ });
71
+ const enabled = pickEnabledProviders(config, options.env ?? process.env);
72
+ if (enabled.length === 0) {
73
+ return null;
74
+ }
75
+ const { primary, fallbacks } = pickPrimaryAndFallbacks(config, enabled);
76
+ const providerManagerConfig = {
77
+ primary: primary,
78
+ fallbacks: fallbacks,
79
+ providers: extractProviderConfigs(config, enabled),
80
+ loadBalancing: 'round-robin',
81
+ global: { enableCostTracking: true, enableMetrics: true },
82
+ };
83
+ const providerManager = new ProviderManager(providerManagerConfig);
84
+ const router = new HybridRouter(providerManager, config);
85
+ await router.initialize();
86
+ return {
87
+ router,
88
+ resolvedConfig: config,
89
+ enabledProviders: enabled,
90
+ };
91
+ }
92
+ /**
93
+ * Determine which providers are actually usable. A provider is enabled if:
94
+ * - its config has `enabled: true`, AND
95
+ * - it's either local (ollama, onnx) OR has a detected env key
96
+ *
97
+ * Returns a deduped list in FALLBACK_PRIORITY order with the user's
98
+ * defaultProvider hoisted to the front when present.
99
+ */
100
+ export function pickEnabledProviders(config, env = process.env) {
101
+ const detected = detectAvailableProvidersFromEnv(env);
102
+ const result = [];
103
+ const consider = (p) => {
104
+ if (result.includes(p))
105
+ return;
106
+ const cfg = config.providers?.[p];
107
+ if (!cfg?.enabled)
108
+ return;
109
+ if (!detected.has(p))
110
+ return;
111
+ result.push(p);
112
+ };
113
+ // User's preferred default first
114
+ consider(config.defaultProvider);
115
+ // Then fallback chain order if user set it
116
+ for (const entry of config.fallbackChain?.entries ?? []) {
117
+ consider(entry.provider);
118
+ }
119
+ // Then our defensive priority
120
+ for (const p of FALLBACK_PRIORITY) {
121
+ consider(p);
122
+ }
123
+ return result;
124
+ }
125
+ /**
126
+ * Collect the unique provider list from a RouterConfig — used by the
127
+ * test-injected ProviderManager path where we don't run the env-detect
128
+ * filter.
129
+ */
130
+ function providersFromConfig(config) {
131
+ const seen = new Set([config.defaultProvider]);
132
+ for (const entry of config.fallbackChain?.entries ?? []) {
133
+ seen.add(entry.provider);
134
+ }
135
+ return Array.from(seen);
136
+ }
137
+ /**
138
+ * Choose the primary provider and fallback chain from the enabled set.
139
+ * Honors config.defaultProvider when it's in the enabled set, otherwise
140
+ * picks the first enabled provider in priority order.
141
+ */
142
+ export function pickPrimaryAndFallbacks(config, enabled) {
143
+ if (enabled.length === 0) {
144
+ throw new Error('pickPrimaryAndFallbacks: no enabled providers');
145
+ }
146
+ const preferred = enabled.includes(config.defaultProvider)
147
+ ? config.defaultProvider
148
+ : enabled[0];
149
+ const fallbacks = enabled.filter((p) => p !== preferred);
150
+ return { primary: preferred, fallbacks };
151
+ }
152
+ /**
153
+ * Extract only the provider configs for the enabled set, so
154
+ * ProviderManager doesn't try to construct providers we don't need.
155
+ */
156
+ function extractProviderConfigs(config, enabled) {
157
+ const out = {};
158
+ for (const p of enabled) {
159
+ const cfg = config.providers?.[p];
160
+ if (cfg) {
161
+ out[p] = cfg;
162
+ }
163
+ }
164
+ return out;
165
+ }
166
+ //# sourceMappingURL=llm-router-service.js.map
@@ -84,7 +84,7 @@ export class GeminiProvider {
84
84
  if (!apiKey) {
85
85
  return {
86
86
  healthy: false,
87
- error: 'API key not configured. Set GOOGLE_AI_API_KEY or GEMINI_API_KEY environment variable.',
87
+ error: 'API key not configured. Set GOOGLE_AI_API_KEY, GEMINI_API_KEY, or GOOGLE_API_KEY environment variable.',
88
88
  };
89
89
  }
90
90
  const start = Date.now();
@@ -438,7 +438,10 @@ export class GeminiProvider {
438
438
  * Get API key from config or environment
439
439
  */
440
440
  getApiKey() {
441
- return this.config.apiKey ?? process.env.GOOGLE_AI_API_KEY ?? process.env.GEMINI_API_KEY;
441
+ return (this.config.apiKey ??
442
+ process.env.GOOGLE_AI_API_KEY ??
443
+ process.env.GEMINI_API_KEY ??
444
+ process.env.GOOGLE_API_KEY);
442
445
  }
443
446
  /**
444
447
  * Get base URL
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Agentic QE v3 - LLM Router Config Store (ADR-043)
3
+ *
4
+ * Persistent storage and environment-aware merging for HybridRouter
5
+ * configuration. Lives next to the project's .agentic-qe/ data dir so
6
+ * each project can carry its own routing policy without leaking secrets.
7
+ *
8
+ * Precedence (highest wins):
9
+ * 1. Explicit override passed to loadRouterConfig()
10
+ * 2. Environment variables (provider API keys, AQE_LLM_* settings)
11
+ * 3. .agentic-qe/llm-config.json (project file)
12
+ * 4. DEFAULT_ROUTER_CONFIG from types.ts
13
+ *
14
+ * Provider enablement: a provider whose API key is present in the
15
+ * environment is force-enabled (overriding any disk value of `enabled:
16
+ * false`). A provider whose key is absent is left in its disk/default
17
+ * state — we don't disable it implicitly, because users may set keys
18
+ * later via `aqe llm config --set`.
19
+ */
20
+ import type { RouterConfig, ExtendedProviderType } from './types.js';
21
+ /** Filename under .agentic-qe/ */
22
+ export declare const ROUTER_CONFIG_FILENAME = "llm-config.json";
23
+ /**
24
+ * Return the resolved config-file path for a project.
25
+ * Caller may override projectRoot for tests; defaults to findProjectRoot().
26
+ */
27
+ export declare function getRouterConfigPath(projectRoot?: string): string;
28
+ /**
29
+ * Detect which providers have a non-empty API key in the current env.
30
+ * Ollama and ONNX always count as detected (they're local).
31
+ */
32
+ export declare function detectAvailableProvidersFromEnv(env?: NodeJS.ProcessEnv): Set<ExtendedProviderType>;
33
+ /**
34
+ * Load the project-level router config from disk. Returns the parsed
35
+ * partial config, or {} if the file doesn't exist or is unreadable.
36
+ * Malformed JSON throws — we don't silently corrupt user config.
37
+ */
38
+ export declare function loadRouterConfigFile(projectRoot?: string): Partial<RouterConfig>;
39
+ /**
40
+ * Save the project-level router config to disk. Creates the .agentic-qe
41
+ * directory if missing. Writes atomically via a temp-file + rename so a
42
+ * crashed write can't leave a half-written config behind.
43
+ *
44
+ * IMPORTANT: this file is project-local and may end up checked into the
45
+ * repo. Callers MUST NOT pass API keys in `config.providers[*].apiKey`
46
+ * — keys belong in env vars. We strip apiKey fields defensively.
47
+ */
48
+ export declare function saveRouterConfigFile(config: Partial<RouterConfig>, projectRoot?: string): void;
49
+ /**
50
+ * Merge a partial config onto a base. Provider entries are shallow-merged
51
+ * (so a partial provider override doesn't wipe the default model). The
52
+ * top-level scalars use last-wins.
53
+ */
54
+ export declare function mergeRouterConfig(base: RouterConfig, override: Partial<RouterConfig>): RouterConfig;
55
+ /**
56
+ * Apply env-detection on top of a merged config: providers whose API
57
+ * keys are present in env are force-enabled (so a user who sets
58
+ * GOOGLE_API_KEY doesn't also have to remember to flip gemini.enabled
59
+ * to true). Providers without keys are left at their existing setting.
60
+ *
61
+ * COUNTERINTUITIVE: env presence OVERRIDES an explicit `enabled: false`
62
+ * on disk. The reasoning: env is more recent / more authoritative than
63
+ * a stale checked-in config file, and users who set an API key in env
64
+ * usually intend to use the provider. To truly disable a provider that
65
+ * has a key in env, either unset the env key OR set the env-only
66
+ * kill-switch `AQE_LLM_ROUTER_DISABLED=1` (which disables the entire
67
+ * router). This precedence is documented in ADR-043's addendum.
68
+ */
69
+ export declare function applyEnvProviderDetection(config: RouterConfig, env?: NodeJS.ProcessEnv): RouterConfig;
70
+ /**
71
+ * The full load path: defaults <- disk <- env detection <- override.
72
+ * This is what the kernel and CLI both call. Returns a fully-resolved
73
+ * RouterConfig ready to hand to HybridRouter.
74
+ */
75
+ export declare function loadRouterConfig(options?: {
76
+ projectRoot?: string;
77
+ override?: Partial<RouterConfig>;
78
+ env?: NodeJS.ProcessEnv;
79
+ }): RouterConfig;
80
+ /**
81
+ * Quick check used by the kernel to decide whether to construct a
82
+ * router at all. Returns true if at least one non-local provider has
83
+ * a key in env, OR the disk config explicitly enables a provider.
84
+ */
85
+ export declare function shouldEnableRouter(options?: {
86
+ projectRoot?: string;
87
+ env?: NodeJS.ProcessEnv;
88
+ }): boolean;
89
+ //# sourceMappingURL=config-store.d.ts.map
@@ -0,0 +1,261 @@
1
+ /**
2
+ * Agentic QE v3 - LLM Router Config Store (ADR-043)
3
+ *
4
+ * Persistent storage and environment-aware merging for HybridRouter
5
+ * configuration. Lives next to the project's .agentic-qe/ data dir so
6
+ * each project can carry its own routing policy without leaking secrets.
7
+ *
8
+ * Precedence (highest wins):
9
+ * 1. Explicit override passed to loadRouterConfig()
10
+ * 2. Environment variables (provider API keys, AQE_LLM_* settings)
11
+ * 3. .agentic-qe/llm-config.json (project file)
12
+ * 4. DEFAULT_ROUTER_CONFIG from types.ts
13
+ *
14
+ * Provider enablement: a provider whose API key is present in the
15
+ * environment is force-enabled (overriding any disk value of `enabled:
16
+ * false`). A provider whose key is absent is left in its disk/default
17
+ * state — we don't disable it implicitly, because users may set keys
18
+ * later via `aqe llm config --set`.
19
+ */
20
+ import * as fs from 'fs';
21
+ import * as path from 'path';
22
+ import { findProjectRoot } from '../../../kernel/unified-memory.js';
23
+ import { DEFAULT_ROUTER_CONFIG, ALL_PROVIDER_TYPES } from './types.js';
24
+ /** Filename under .agentic-qe/ */
25
+ export const ROUTER_CONFIG_FILENAME = 'llm-config.json';
26
+ /**
27
+ * Env var names per provider — multiple aliases supported where the
28
+ * upstream provider accepts more than one name. First non-empty wins.
29
+ *
30
+ * Empty array means "local provider, no key required". The set of
31
+ * runtime-constructible providers is narrower than ExtendedProviderType
32
+ * (e.g. onnx is in the type system but ProviderManager doesn't yet
33
+ * have a case for it) — see RUNTIME_CONSTRUCTIBLE_PROVIDERS below.
34
+ */
35
+ const PROVIDER_ENV_KEYS = {
36
+ claude: ['ANTHROPIC_API_KEY', 'CLAUDE_API_KEY'],
37
+ openai: ['OPENAI_API_KEY'],
38
+ ollama: [], // ollama is local; no key required
39
+ openrouter: ['OPENROUTER_API_KEY'],
40
+ gemini: ['GOOGLE_AI_API_KEY', 'GEMINI_API_KEY', 'GOOGLE_API_KEY'],
41
+ 'azure-openai': ['AZURE_OPENAI_API_KEY'],
42
+ bedrock: ['AWS_ACCESS_KEY_ID'], // bedrock auth is more complex; presence is a hint
43
+ onnx: [], // local
44
+ };
45
+ /**
46
+ * Providers that ProviderManager.createProvider() can actually
47
+ * instantiate today. Anything not in this set is dropped from the
48
+ * "available" set even if its env keys are present, so we don't emit
49
+ * a "Failed to create X provider" warning at every kernel boot.
50
+ *
51
+ * Keep this in sync with src/shared/llm/provider-manager.ts:createProvider().
52
+ */
53
+ const RUNTIME_CONSTRUCTIBLE_PROVIDERS = new Set([
54
+ 'claude',
55
+ 'openai',
56
+ 'ollama',
57
+ 'openrouter',
58
+ 'gemini',
59
+ 'azure-openai',
60
+ 'bedrock',
61
+ ]);
62
+ /**
63
+ * Return the resolved config-file path for a project.
64
+ * Caller may override projectRoot for tests; defaults to findProjectRoot().
65
+ */
66
+ export function getRouterConfigPath(projectRoot) {
67
+ const root = projectRoot ?? findProjectRoot();
68
+ return path.join(root, '.agentic-qe', ROUTER_CONFIG_FILENAME);
69
+ }
70
+ /**
71
+ * Detect which providers have a non-empty API key in the current env.
72
+ * Ollama and ONNX always count as detected (they're local).
73
+ */
74
+ export function detectAvailableProvidersFromEnv(env = process.env) {
75
+ const available = new Set();
76
+ for (const provider of ALL_PROVIDER_TYPES) {
77
+ if (!RUNTIME_CONSTRUCTIBLE_PROVIDERS.has(provider)) {
78
+ // ProviderManager has no case for this provider yet (e.g. onnx).
79
+ // Pretending it's available leads to "Failed to create" noise.
80
+ continue;
81
+ }
82
+ const keys = PROVIDER_ENV_KEYS[provider];
83
+ if (keys.length === 0) {
84
+ // local providers — always available if their binary is, but at
85
+ // config-merge time we treat them as "potentially available"
86
+ available.add(provider);
87
+ continue;
88
+ }
89
+ if (keys.some((k) => (env[k] ?? '').trim().length > 0)) {
90
+ available.add(provider);
91
+ }
92
+ }
93
+ return available;
94
+ }
95
+ /**
96
+ * Load the project-level router config from disk. Returns the parsed
97
+ * partial config, or {} if the file doesn't exist or is unreadable.
98
+ * Malformed JSON throws — we don't silently corrupt user config.
99
+ */
100
+ export function loadRouterConfigFile(projectRoot) {
101
+ const filePath = getRouterConfigPath(projectRoot);
102
+ if (!fs.existsSync(filePath)) {
103
+ return {};
104
+ }
105
+ const raw = fs.readFileSync(filePath, 'utf8');
106
+ if (!raw.trim()) {
107
+ return {};
108
+ }
109
+ const parsed = JSON.parse(raw);
110
+ if (typeof parsed !== 'object' || parsed === null) {
111
+ throw new Error(`Invalid ${ROUTER_CONFIG_FILENAME}: expected object, got ${typeof parsed}`);
112
+ }
113
+ return parsed;
114
+ }
115
+ /**
116
+ * Save the project-level router config to disk. Creates the .agentic-qe
117
+ * directory if missing. Writes atomically via a temp-file + rename so a
118
+ * crashed write can't leave a half-written config behind.
119
+ *
120
+ * IMPORTANT: this file is project-local and may end up checked into the
121
+ * repo. Callers MUST NOT pass API keys in `config.providers[*].apiKey`
122
+ * — keys belong in env vars. We strip apiKey fields defensively.
123
+ */
124
+ export function saveRouterConfigFile(config, projectRoot) {
125
+ const filePath = getRouterConfigPath(projectRoot);
126
+ const dir = path.dirname(filePath);
127
+ if (!fs.existsSync(dir)) {
128
+ fs.mkdirSync(dir, { recursive: true });
129
+ }
130
+ const sanitized = stripApiKeys(config);
131
+ const json = JSON.stringify(sanitized, null, 2) + '\n';
132
+ const tmp = filePath + '.tmp-' + process.pid;
133
+ fs.writeFileSync(tmp, json, { encoding: 'utf8', mode: 0o600 });
134
+ fs.renameSync(tmp, filePath);
135
+ }
136
+ /**
137
+ * Strip apiKey fields from provider configs to prevent accidental
138
+ * commits of secrets. Returns a deep clone — input is untouched.
139
+ *
140
+ * Emits a console warning when any apiKey is stripped, so silent
141
+ * strips don't surprise callers. The kernel/CLI consume from env
142
+ * vars (ANTHROPIC_API_KEY, GEMINI_API_KEY, GOOGLE_API_KEY, etc.),
143
+ * never from disk config — see config-store doc header for the
144
+ * precedence rule.
145
+ */
146
+ function stripApiKeys(config) {
147
+ if (!config.providers) {
148
+ return JSON.parse(JSON.stringify(config));
149
+ }
150
+ const cloned = JSON.parse(JSON.stringify(config));
151
+ let strippedProviders = [];
152
+ if (cloned.providers) {
153
+ for (const provider of Object.keys(cloned.providers)) {
154
+ const entry = cloned.providers[provider];
155
+ if (entry && 'apiKey' in entry && entry.apiKey) {
156
+ delete entry.apiKey;
157
+ strippedProviders.push(provider);
158
+ }
159
+ }
160
+ }
161
+ if (strippedProviders.length > 0) {
162
+ // eslint-disable-next-line no-console
163
+ console.warn(`[router-config] Refused to persist apiKey for: ${strippedProviders.join(', ')}. ` +
164
+ `API keys belong in environment variables (e.g. ANTHROPIC_API_KEY, GEMINI_API_KEY, ` +
165
+ `OPENAI_API_KEY, OPENROUTER_API_KEY), NOT in .agentic-qe/llm-config.json which may ` +
166
+ `be checked into source control.`);
167
+ }
168
+ return cloned;
169
+ }
170
+ /**
171
+ * Merge a partial config onto a base. Provider entries are shallow-merged
172
+ * (so a partial provider override doesn't wipe the default model). The
173
+ * top-level scalars use last-wins.
174
+ */
175
+ export function mergeRouterConfig(base, override) {
176
+ const merged = {
177
+ ...base,
178
+ ...override,
179
+ providers: { ...(base.providers ?? {}) },
180
+ };
181
+ if (override.providers) {
182
+ for (const [provider, cfg] of Object.entries(override.providers)) {
183
+ if (!cfg)
184
+ continue;
185
+ const key = provider;
186
+ merged.providers[key] = {
187
+ ...(base.providers?.[key] ?? {}),
188
+ ...cfg,
189
+ };
190
+ }
191
+ }
192
+ return merged;
193
+ }
194
+ /**
195
+ * Apply env-detection on top of a merged config: providers whose API
196
+ * keys are present in env are force-enabled (so a user who sets
197
+ * GOOGLE_API_KEY doesn't also have to remember to flip gemini.enabled
198
+ * to true). Providers without keys are left at their existing setting.
199
+ *
200
+ * COUNTERINTUITIVE: env presence OVERRIDES an explicit `enabled: false`
201
+ * on disk. The reasoning: env is more recent / more authoritative than
202
+ * a stale checked-in config file, and users who set an API key in env
203
+ * usually intend to use the provider. To truly disable a provider that
204
+ * has a key in env, either unset the env key OR set the env-only
205
+ * kill-switch `AQE_LLM_ROUTER_DISABLED=1` (which disables the entire
206
+ * router). This precedence is documented in ADR-043's addendum.
207
+ */
208
+ export function applyEnvProviderDetection(config, env = process.env) {
209
+ const available = detectAvailableProvidersFromEnv(env);
210
+ const merged = {
211
+ ...config,
212
+ providers: { ...(config.providers ?? {}) },
213
+ };
214
+ for (const provider of available) {
215
+ const keys = PROVIDER_ENV_KEYS[provider];
216
+ if (keys.length === 0)
217
+ continue; // local provider, leave default
218
+ const current = merged.providers[provider] ?? { enabled: false };
219
+ if (!current.enabled) {
220
+ merged.providers[provider] = { ...current, enabled: true };
221
+ }
222
+ }
223
+ return merged;
224
+ }
225
+ /**
226
+ * The full load path: defaults <- disk <- env detection <- override.
227
+ * This is what the kernel and CLI both call. Returns a fully-resolved
228
+ * RouterConfig ready to hand to HybridRouter.
229
+ */
230
+ export function loadRouterConfig(options = {}) {
231
+ const onDisk = loadRouterConfigFile(options.projectRoot);
232
+ const merged = mergeRouterConfig(DEFAULT_ROUTER_CONFIG, onDisk);
233
+ const withEnv = applyEnvProviderDetection(merged, options.env);
234
+ return options.override ? mergeRouterConfig(withEnv, options.override) : withEnv;
235
+ }
236
+ /**
237
+ * Quick check used by the kernel to decide whether to construct a
238
+ * router at all. Returns true if at least one non-local provider has
239
+ * a key in env, OR the disk config explicitly enables a provider.
240
+ */
241
+ export function shouldEnableRouter(options = {}) {
242
+ const env = options.env ?? process.env;
243
+ for (const provider of ALL_PROVIDER_TYPES) {
244
+ const keys = PROVIDER_ENV_KEYS[provider];
245
+ if (keys.length === 0)
246
+ continue;
247
+ if (keys.some((k) => (env[k] ?? '').trim().length > 0)) {
248
+ return true;
249
+ }
250
+ }
251
+ // No env keys — fall back to disk config.
252
+ const onDisk = loadRouterConfigFile(options.projectRoot);
253
+ if (onDisk.providers) {
254
+ for (const cfg of Object.values(onDisk.providers)) {
255
+ if (cfg?.enabled)
256
+ return true;
257
+ }
258
+ }
259
+ return false;
260
+ }
261
+ //# sourceMappingURL=config-store.js.map
@@ -443,16 +443,31 @@ export class HybridRouter {
443
443
  const executionOrder = [
444
444
  { provider: decision.providerType, model: decision.providerModelId },
445
445
  ];
446
- // Add fallback chain entries
446
+ // ADR-043 wiring fix: always include the user's defaultProvider as
447
+ // an implicit fallback. Without this, a request that matches a rule
448
+ // routing to provider X (e.g. small-requests-haiku → claude) but
449
+ // where X fails at API time has no way to recover for users who
450
+ // only have a non-X provider configured. This was a real bug
451
+ // surfaced by the rule-based E2E test in
452
+ // tests/e2e/llm-router-real-providers.test.ts.
453
+ const defaultProviderType = this.config.defaultProvider;
454
+ if (defaultProviderType && defaultProviderType !== decision.providerType) {
455
+ executionOrder.push({
456
+ provider: defaultProviderType,
457
+ model: this.config.defaultModel,
458
+ });
459
+ }
460
+ // Add explicit fallback chain entries. Previously this hardcoded
461
+ // ['claude', 'openai', 'ollama'] as "base providers" — but
462
+ // LLMProviderType includes 7 providers (claude/openai/ollama plus
463
+ // openrouter/gemini/azure-openai/bedrock from ADR-043) and
464
+ // ProviderManager.createProvider() builds all of them. The narrower
465
+ // list silently excluded users' actual fallback providers.
447
466
  for (const entry of fallbackChain.entries) {
448
467
  if (!entry.enabled)
449
468
  continue;
450
469
  if (entry.provider === decision.providerType)
451
470
  continue;
452
- // Only include providers that exist in the base system
453
- const baseProviders = ['claude', 'openai', 'ollama'];
454
- if (!baseProviders.includes(entry.provider))
455
- continue;
456
471
  for (const model of entry.models) {
457
472
  executionOrder.push({ provider: entry.provider, model });
458
473
  }
@@ -529,12 +544,19 @@ export class HybridRouter {
529
544
  this.routerMetrics.recordFallback(providerType, nextProvider.provider, lastError.message, params.agentType);
530
545
  }
531
546
  }
532
- // Check if error is retryable
533
- if (isLLMError(error) && !error.retryable) {
534
- throw error;
535
- }
536
- // Delay before retry
537
- if (attempts < fallbackBehavior.maxAttempts) {
547
+ // ADR-043 wiring fix: a non-retryable error from ONE provider
548
+ // (e.g. Claude returning "invalid x-api-key") tells us only that
549
+ // re-trying Claude is pointless — it does NOT tell us whether
550
+ // the NEXT provider in the fallback chain (e.g. Gemini) will
551
+ // work. Previously this `throw` short-circuited the fallback
552
+ // loop, defeating the whole point of having a fallback chain
553
+ // for users with multiple providers configured.
554
+ //
555
+ // New behavior: a non-retryable error skips the inter-attempt
556
+ // delay (because no need to wait) but DOES continue to the next
557
+ // entry in executionOrder. Only retryable errors get the delay.
558
+ const nonRetryable = isLLMError(error) && !error.retryable;
559
+ if (!nonRetryable && attempts < fallbackBehavior.maxAttempts) {
538
560
  await this.delay(fallbackBehavior.delayMs);
539
561
  }
540
562
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-qe",
3
- "version": "3.9.36",
3
+ "version": "3.10.1",
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.9.36");process.exit(0)}
2
- import{a,b,c}from"./chunk-CLATNP57.js";import"./chunk-AH3UC4IV.js";import"./chunk-W2DF6FNE.js";import"./chunk-HOZNVDFF.js";import"./chunk-O4C3JEOR.js";import"./chunk-SCBWRKPE.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.9.36");process.exit(0)}
2
- import{a,b,c,d,e,f}from"./chunk-P4VQTIJE.js";import"./chunk-TU2PSEDW.js";import"./chunk-OO2JHVMS.js";import"./chunk-SJ3SHZUC.js";import"./chunk-MJJAHA2T.js";import"./chunk-C2JK5O55.js";import"./chunk-TK7TGVVQ.js";import"./chunk-BUVY7IGM.js";import"./chunk-4R3WXD4U.js";import"./chunk-LIE24NRL.js";import"./chunk-AJ2VFSLX.js";import"./chunk-L3JJ52N6.js";import"./chunk-MFPVS2KP.js";import"./chunk-USLHYNYG.js";import"./chunk-5MSZREOD.js";import"./chunk-QAGAEAKM.js";import"./chunk-HOZNVDFF.js";import"./chunk-5SYH5QMQ.js";import"./chunk-ZYPSXPQ5.js";import"./chunk-VENEJ3UI.js";import"./chunk-QMUTKI34.js";import"./chunk-O4C3JEOR.js";import"./chunk-NKA3X6VT.js";import"./chunk-TXSVZYFA.js";import"./chunk-RCU5L7FF.js";import"./chunk-Y4ERDIPP.js";import"./chunk-3CIQ6CQ4.js";import"./chunk-IF4ZZ2HD.js";import"./chunk-KI6RXKP4.js";import"./chunk-DTJHO3WI.js";import"./chunk-X6UGFKHW.js";import"./chunk-ZBY4HSHR.js";import"./chunk-SCBWRKPE.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,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.9.36");process.exit(0)}
2
- import{a,b,c,d,e,f}from"./chunk-JD3VV2BD.js";import"./chunk-QH7K2UPP.js";import"./chunk-5MSZREOD.js";import"./chunk-QAGAEAKM.js";import"./chunk-HOZNVDFF.js";import"./chunk-ZYPSXPQ5.js";import"./chunk-VENEJ3UI.js";import"./chunk-O4C3JEOR.js";import"./chunk-NKA3X6VT.js";import"./chunk-TXSVZYFA.js";import"./chunk-RCU5L7FF.js";import"./chunk-Y4ERDIPP.js";import"./chunk-3CIQ6CQ4.js";import"./chunk-IF4ZZ2HD.js";import"./chunk-KI6RXKP4.js";import"./chunk-DTJHO3WI.js";import"./chunk-X6UGFKHW.js";import"./chunk-ZBY4HSHR.js";import"./chunk-SCBWRKPE.js";export{f as MCPToolBase,e as defaultToolLogger,d as getMemoryBackend,b as getSharedMemoryBackend,a as registerRvfResetFn,c as resetSharedMemoryBackend};
@@ -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.9.36");process.exit(0)}
2
- import{a}from"./chunk-BI54GWTK.js";import"./chunk-JD3VV2BD.js";import"./chunk-QH7K2UPP.js";import"./chunk-5MSZREOD.js";import"./chunk-QAGAEAKM.js";import"./chunk-HOZNVDFF.js";import"./chunk-ZYPSXPQ5.js";import"./chunk-VENEJ3UI.js";import"./chunk-O4C3JEOR.js";import"./chunk-NKA3X6VT.js";import"./chunk-TXSVZYFA.js";import"./chunk-RCU5L7FF.js";import"./chunk-Y4ERDIPP.js";import"./chunk-3CIQ6CQ4.js";import"./chunk-IF4ZZ2HD.js";import"./chunk-KI6RXKP4.js";import"./chunk-DTJHO3WI.js";import"./chunk-X6UGFKHW.js";import"./chunk-ZBY4HSHR.js";import"./chunk-SCBWRKPE.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.9.36");process.exit(0)}
2
- import{a as M}from"./chunk-QH7K2UPP.js";import{f as y,o as T}from"./chunk-5MSZREOD.js";import{a as p,c as S}from"./chunk-O4C3JEOR.js";import{i as b}from"./chunk-NKA3X6VT.js";T();S();import*as c from"path";import*as d from"fs";var m=null,u=null,l=null;function R(o){l=o}async function P(){return m||u||(u=(async()=>{let o=y(),e=c.join(o,".agentic-qe");d.existsSync(e)||d.mkdirSync(e,{recursive:!0});let r=new M({sqlite:{path:c.join(e,"memory.db"),walMode:!0,poolSize:3,busyTimeout:5e3},enableFallback:!0,defaultNamespace:"mcp-tools"});return await r.initialize(),m=r,r})(),u)}function $(){if(l)try{l()}catch{}m&&(m.dispose().catch(()=>{}),m=null),u=null}async function D(o){return o?.memory?o.memory:P()}var C={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||"")},h=class{logger=C;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:a,required:n}=this.config.schema;if(n)for(let i of n)i in t||r.push(`Missing required field: ${i}`);for(let[i,s]of Object.entries(t)){let g=a[i];if(!g)continue;let f=this.validateType(i,s,g);f&&r.push(f)}return{valid:r.length===0,errors:r}}validateType(e,r,t){if(r==null)return null;let a=Array.isArray(r)?"array":typeof r;if(t.type==="array"&&!Array.isArray(r))return`${e} must be an array`;if(t.type!=="array"&&a!==t.type)return`${e} must be of type ${t.type}, got ${a}`;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(),a=b();this.currentDataSource="real";let n=this.validate(e);if(!n.valid)return{success:!1,error:`Validation failed: ${n.errors.join("; ")}`,metadata:this.createMetadata(t,a)};let i={requestId:a,startTime:t,streaming:r.streaming,onStream:r.onStream,abortSignal:r.abortSignal,demoMode:r.demoMode};try{let s=await this.execute(e,i);return{...s,metadata:{...s.metadata,...this.createMetadata(t,a)}}}catch(s){return{success:!1,error:p(s),metadata:this.createMetadata(t,a)}}}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{R as a,P as b,$ as c,D as d,C as e,h as f};
@@ -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.9.36");process.exit(0)}
2
- import{a as F,c as D}from"./chunk-O4C3JEOR.js";import{d as $}from"./chunk-KI6RXKP4.js";$();D();var b=null,l=null,d=null,g=!1,f="",h={modelName:"Xenova/all-MiniLM-L6-v2",quantized:!0,enableCache:!0,maxCacheSize:1e4},o=new Map,P=36e5;function I(t){let e=t.trim();return!!(e.startsWith("{")&&/["']metrics["']/.test(e)||e.startsWith("[")&&e.endsWith("]")&&e.length>50||(e.match(/[a-zA-Z]/g)||[]).length/Math.max(e.length,1)<.3&&e.length>20)}async function A(t={}){if(g)throw new Error(`Transformer initialization previously failed: ${f}`);if(d)return d;let e={...h,...t};return d=(async()=>{try{b=(await import("./transformers-5CWLXT2M.js")).pipeline,console.log(`[RealEmbeddings] Loading model: ${e.modelName}`);let a=performance.now();l=await b("feature-extraction",e.modelName,{quantized:e.quantized});let s=performance.now()-a;console.log(`[RealEmbeddings] Model loaded in ${s.toFixed(0)}ms`)}catch(r){throw g=!0,f=F(r),new Error(`Failed to initialize transformer model: ${f}`)}})(),d}async function q(t,e={}){let r={...h,...e};if(I(t))return new Array(N()).fill(0);if(r.enableCache){let i=o.get(t);if(i&&Date.now()-i.timestamp<P)return i.embedding}if(l||await A(e),!l)throw new Error("Embedding model failed to initialize");let a=performance.now(),s=await l(t,{pooling:"mean",normalize:!0}),m=Array.from(s.data),n=performance.now()-a;if(n>500&&console.warn(`[RealEmbeddings] Slow embedding computation: ${n.toFixed(1)}ms for "${t.slice(0,50)}..."`),r.enableCache){if(o.size>=r.maxCacheSize){let i=o.keys().next().value;i&&o.delete(i)}o.set(t,{embedding:m,timestamp:Date.now()})}return m}async function B(t,e={}){let r={...h,...e},a=[],s=[],m=new Array(t.length).fill(null);if(r.enableCache)for(let n=0;n<t.length;n++){let i=o.get(t[n]);i&&Date.now()-i.timestamp<P?m[n]=i.embedding:(a.push(t[n]),s.push(n))}else{a.push(...t);for(let n=0;n<t.length;n++)s.push(n)}if(a.length>0){if(l||await A(e),!l)throw new Error("Embedding model failed to initialize");let n=performance.now(),i=32;for(let c=0;c<a.length;c+=i){let M=Math.min(c+i,a.length),p=a.slice(c,M),E=await l(p,{pooling:"mean",normalize:!0}),w=E.dims||[p.length,384],R=w[0],C=w[1];for(let u=0;u<R;u++){let z=u*C,x=Array.from(E.data.slice(z,z+C)),y=c+u,v=s[y];if(m[v]=x,r.enableCache){if(o.size>=r.maxCacheSize){let T=o.keys().next().value;T&&o.delete(T)}o.set(a[y],{embedding:x,timestamp:Date.now()})}}}let S=performance.now()-n;console.log(`[RealEmbeddings] Batch computed ${a.length} embeddings in ${S.toFixed(0)}ms`)}return m.filter(n=>n!==null)}function O(){o.clear(),console.log("[RealEmbeddings] Cache cleared")}function W(){return{size:o.size,hitRate:0}}function k(){return!g&&l!==null}function N(){return 384}function G(){b=null,l=null,d=null,g=!1,f="",o.clear()}export{h as a,q as b,B as c,O as d,W as e,k as f,N as g,G as h};
@@ -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.9.36");process.exit(0)}
2
- import{a as e,b as g,e as r}from"./chunk-VENEJ3UI.js";import{c as o}from"./chunk-SCBWRKPE.js";var L=o(()=>{"use strict";e();g();r()});export{L as a};
@@ -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.9.36");process.exit(0)}
2
- import{c as a,d as b,e as c}from"./chunk-YMB4YVFX.js";import"./chunk-RDXIRE2I.js";import"./chunk-O4C3JEOR.js";import"./chunk-SCBWRKPE.js";c();export{a as VibiumClientImpl,b as VibiumClientProvider};