agentic-qe 3.13.11 → 3.13.12

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 (353) hide show
  1. package/.claude/helpers/.helpers-version +1 -1
  2. package/.claude/helpers/helpers.manifest.json +2 -2
  3. package/.claude/helpers/statusline.cjs +89 -40
  4. package/.claude/skills/skills-manifest.json +1 -1
  5. package/CHANGELOG.md +40 -0
  6. package/assets/skills/skills-manifest.json +1 -1
  7. package/dist/cli/bundle.js +5 -5
  8. package/dist/cli/chunks/adapter-FUV6LBJT.js +2 -0
  9. package/dist/cli/chunks/{agent-booster-wasm-5ARDZYNO.js → agent-booster-wasm-7I7LZFNC.js} +2 -2
  10. package/dist/cli/chunks/{agent-handler-SVKEPF7B.js → agent-handler-QZZT52BH.js} +2 -2
  11. package/dist/cli/chunks/{agent-memory-branch-QDL7OVHC.js → agent-memory-branch-MLQS5Y26.js} +2 -2
  12. package/dist/cli/chunks/aqe-learning-engine-QNFNA3J4.js +2 -0
  13. package/dist/cli/chunks/{arena-7OCKBN6O.js → arena-IM4CP6LP.js} +2 -2
  14. package/dist/cli/chunks/{arena-HQLSNQZ3.js → arena-WRIY37EJ.js} +4 -4
  15. package/dist/cli/chunks/{audit-2EQJW5UE.js → audit-BSAQ4EFN.js} +3 -3
  16. package/dist/cli/chunks/base-37W2XIXC.js +2 -0
  17. package/dist/cli/chunks/{better-sqlite3-OBFNNE4T.js → better-sqlite3-X2XZUXWZ.js} +2 -2
  18. package/dist/cli/chunks/{brain-handler-FV2AJZ4A.js → brain-handler-TVTTWZGP.js} +3 -3
  19. package/dist/cli/chunks/{branch-enumerator-6B4L5O3D.js → branch-enumerator-NI4Q7DSJ.js} +2 -2
  20. package/dist/cli/chunks/{browser-VDMGBWNK.js → browser-PXBLORUZ.js} +2 -2
  21. package/dist/cli/chunks/browser-workflow-PDIUEK7B.js +2 -0
  22. package/dist/cli/chunks/{chunk-EKFKQGIT.js → chunk-2JAC57JE.js} +1 -1
  23. package/dist/cli/chunks/{chunk-NC7HTDH5.js → chunk-2VTX4SYW.js} +2 -2
  24. package/dist/cli/chunks/{chunk-JK6ENS3J.js → chunk-2VY7FL6A.js} +2 -2
  25. package/dist/cli/chunks/{chunk-YEPJS4AM.js → chunk-2W3D5A4R.js} +2 -2
  26. package/dist/cli/chunks/{chunk-VLW63UA2.js → chunk-33YZGOT6.js} +2 -2
  27. package/dist/cli/chunks/{chunk-WYQM7GXW.js → chunk-3ASVQILY.js} +2 -2
  28. package/dist/cli/chunks/{chunk-EN36AFRJ.js → chunk-3XVZHJQT.js} +1 -1
  29. package/dist/cli/chunks/{chunk-W7BB4XLP.js → chunk-42AS3HPO.js} +2 -2
  30. package/dist/cli/chunks/{chunk-5364DBZG.js → chunk-44NPKZGI.js} +2 -2
  31. package/dist/cli/chunks/{chunk-TJ67B7S7.js → chunk-4AITMWFZ.js} +2 -2
  32. package/dist/cli/chunks/{chunk-XEUUWOSS.js → chunk-4ANJV6I4.js} +3 -3
  33. package/dist/cli/chunks/{chunk-M3MRFZKD.js → chunk-4FVOJBEU.js} +1 -1
  34. package/dist/cli/chunks/{chunk-TMY2Y7SC.js → chunk-4M7YZ2X7.js} +1 -1
  35. package/dist/cli/chunks/{chunk-FPX4JSFH.js → chunk-4THFPRFM.js} +2 -2
  36. package/dist/cli/chunks/{chunk-MUAW4AJ6.js → chunk-4YFXF5AQ.js} +2 -2
  37. package/dist/cli/chunks/{chunk-WJB6YYMJ.js → chunk-4Z4X2ND4.js} +2 -2
  38. package/dist/cli/chunks/{chunk-PJNIDDER.js → chunk-52VGZJSD.js} +1 -1
  39. package/dist/cli/chunks/{chunk-RGUKQXKL.js → chunk-5E76HULA.js} +2 -2
  40. package/dist/cli/chunks/{chunk-MS5CAEPA.js → chunk-5PI75QYP.js} +2 -2
  41. package/dist/cli/chunks/{chunk-UX5SM2PW.js → chunk-5PNQNBDZ.js} +1 -1
  42. package/dist/cli/chunks/{chunk-V7QZMOG3.js → chunk-5VSS2RBD.js} +2 -2
  43. package/dist/cli/chunks/{chunk-TBO64O56.js → chunk-66OQ7AB3.js} +1 -1
  44. package/dist/cli/chunks/{chunk-HZR4G6I3.js → chunk-6BSZHNOC.js} +1 -1
  45. package/dist/cli/chunks/{chunk-LREIHR2A.js → chunk-6KI6LAAZ.js} +2 -2
  46. package/dist/cli/chunks/{chunk-WRZ5WZG3.js → chunk-6KKVMPPR.js} +2 -2
  47. package/dist/cli/chunks/{chunk-VU3ARH4S.js → chunk-7A4WTRWI.js} +1 -1
  48. package/dist/cli/chunks/{chunk-B646CE3C.js → chunk-7LATB5IR.js} +2 -2
  49. package/dist/cli/chunks/{chunk-7YL7P5XG.js → chunk-7PCIN7UN.js} +2 -2
  50. package/dist/cli/chunks/{chunk-YDEYB6Z2.js → chunk-7RVLVIAI.js} +1 -1
  51. package/dist/cli/chunks/{chunk-UPMQHCC2.js → chunk-7ZVO7I4Q.js} +1 -1
  52. package/dist/cli/chunks/{chunk-S3FNAHNC.js → chunk-A5RWLPVT.js} +2 -2
  53. package/dist/cli/chunks/{chunk-76NSSNB3.js → chunk-AKUDUB3O.js} +2 -2
  54. package/dist/cli/chunks/{chunk-CK7ZLMD2.js → chunk-AM42ROKZ.js} +1 -1
  55. package/dist/cli/chunks/{chunk-NHL37QAZ.js → chunk-AN5CGTTJ.js} +2 -2
  56. package/dist/cli/chunks/{chunk-VNVGCJCS.js → chunk-AOOCV56W.js} +1 -1
  57. package/dist/cli/chunks/{chunk-ATRUE6CT.js → chunk-ASWWBNX2.js} +2 -2
  58. package/dist/cli/chunks/{chunk-DLL3AJH7.js → chunk-AYH3DMW2.js} +1 -1
  59. package/dist/cli/chunks/{chunk-ZNGFSR5M.js → chunk-BODFJ3DC.js} +2 -2
  60. package/dist/cli/chunks/{chunk-AZVV7POX.js → chunk-BZIPYXSW.js} +3 -3
  61. package/dist/cli/chunks/{chunk-BPPEN7SS.js → chunk-DCVFHVPR.js} +2 -2
  62. package/dist/cli/chunks/{chunk-4X4GTEQY.js → chunk-DFLASG3B.js} +1 -1
  63. package/dist/cli/chunks/{chunk-IGW5L7YM.js → chunk-DGFINXUE.js} +1 -1
  64. package/dist/cli/chunks/{chunk-XDK2TPI5.js → chunk-E67ZXRG6.js} +1 -1
  65. package/dist/cli/chunks/{chunk-FXKOHZBN.js → chunk-EDRPTLAX.js} +1 -1
  66. package/dist/cli/chunks/{chunk-W2NQDAJZ.js → chunk-EG73WYAW.js} +2 -2
  67. package/dist/cli/chunks/{chunk-HV6LJ57R.js → chunk-FI6J3UHJ.js} +1 -1
  68. package/dist/cli/chunks/{chunk-VHNAN7E2.js → chunk-G45AOQDZ.js} +1 -1
  69. package/dist/cli/chunks/{chunk-XVFSZLRS.js → chunk-G6FJHDUG.js} +1 -1
  70. package/dist/cli/chunks/chunk-GEQWCK4F.js +2 -0
  71. package/dist/cli/chunks/{chunk-PBJ5I2NS.js → chunk-GJJWXRAD.js} +2 -2
  72. package/dist/cli/chunks/{chunk-Z5ARI4XT.js → chunk-GJUGG6UR.js} +2 -2
  73. package/dist/cli/chunks/{chunk-AFXMTSO3.js → chunk-GMLRIZ4E.js} +1 -1
  74. package/dist/cli/chunks/{chunk-2CBEQV6R.js → chunk-GQLJYTXN.js} +2 -2
  75. package/dist/cli/chunks/{chunk-E54QUKAD.js → chunk-H3GAR4SV.js} +2 -2
  76. package/dist/cli/chunks/{chunk-JKP2BUF5.js → chunk-HAJG44BD.js} +2 -2
  77. package/dist/cli/chunks/{chunk-2D7SBOZ4.js → chunk-HQWFZQMJ.js} +2 -2
  78. package/dist/cli/chunks/{chunk-IZOWGVTU.js → chunk-HRTSYT4N.js} +2 -2
  79. package/dist/cli/chunks/{chunk-DPZ4AU6W.js → chunk-I5SXLV7D.js} +2 -2
  80. package/dist/cli/chunks/{chunk-QYHRDBKI.js → chunk-IOJ34SXJ.js} +2 -2
  81. package/dist/cli/chunks/{chunk-YYAJEPRD.js → chunk-IPDM3CAK.js} +1 -1
  82. package/dist/cli/chunks/{chunk-UDFTDQ6C.js → chunk-IPZEBALY.js} +10 -10
  83. package/dist/cli/chunks/{chunk-JKPMV5VB.js → chunk-IQH2RDN3.js} +5 -5
  84. package/dist/cli/chunks/{chunk-24XW7KUX.js → chunk-IT5QIUUA.js} +2 -2
  85. package/dist/cli/chunks/{chunk-FBASWZ7G.js → chunk-JTYCOFTD.js} +1 -1
  86. package/dist/cli/chunks/{chunk-23E37MDA.js → chunk-JVFZAJ5N.js} +2 -2
  87. package/dist/cli/chunks/{chunk-SJJFU7KK.js → chunk-KRZYWVS3.js} +2 -2
  88. package/dist/cli/chunks/{chunk-BL5BHBXR.js → chunk-KXSUDN46.js} +1 -1
  89. package/dist/cli/chunks/{chunk-OJUI65TR.js → chunk-KYJBJ56M.js} +2 -2
  90. package/dist/cli/chunks/{chunk-TCVEXQLL.js → chunk-L3GBNX7B.js} +2 -2
  91. package/dist/cli/chunks/{chunk-LM727BVL.js → chunk-LRO74LPA.js} +4 -4
  92. package/dist/cli/chunks/{chunk-BVKFBJX6.js → chunk-LXVT6JXO.js} +2 -2
  93. package/dist/cli/chunks/{chunk-4DTBGQWA.js → chunk-M3354CE4.js} +2 -2
  94. package/dist/cli/chunks/{chunk-2Y3PW5EJ.js → chunk-M73KM3AZ.js} +2 -2
  95. package/dist/cli/chunks/{chunk-LLP3UW62.js → chunk-M7CPJW53.js} +2 -2
  96. package/dist/cli/chunks/{chunk-RAV2NJNX.js → chunk-MB2KLJ6Q.js} +1 -1
  97. package/dist/cli/chunks/{chunk-U6G6RUFI.js → chunk-MGKH4LCM.js} +1 -1
  98. package/dist/cli/chunks/{chunk-K652SCBA.js → chunk-MLFELTJX.js} +2 -2
  99. package/dist/cli/chunks/{chunk-UZ7OWJ75.js → chunk-MLXLGBQZ.js} +1 -1
  100. package/dist/cli/chunks/{chunk-EHZQIXH6.js → chunk-MYVKTG55.js} +3 -3
  101. package/dist/cli/chunks/{chunk-PT6U3IIK.js → chunk-N4OQ4D4V.js} +2 -2
  102. package/dist/cli/chunks/{chunk-XZI4QXJJ.js → chunk-NDRZZSD5.js} +2 -2
  103. package/dist/cli/chunks/{chunk-IZF3VLNW.js → chunk-NG6A7LCG.js} +1 -1
  104. package/dist/cli/chunks/{chunk-GPJDZFFV.js → chunk-NJ3QXJ54.js} +2 -2
  105. package/dist/cli/chunks/{chunk-2BDTZYQN.js → chunk-NJ4YVAG7.js} +3 -3
  106. package/dist/cli/chunks/{chunk-2E2QCIGR.js → chunk-NL2SCAGJ.js} +3 -3
  107. package/dist/cli/chunks/chunk-NLZUGANH.js +11 -0
  108. package/dist/cli/chunks/{chunk-WINYWMQP.js → chunk-NNLZAVFH.js} +1 -1
  109. package/dist/cli/chunks/{chunk-LPDT27EC.js → chunk-NTALX2YC.js} +2 -2
  110. package/dist/cli/chunks/{chunk-4ZQOJ7Q2.js → chunk-O4BWESH5.js} +2 -2
  111. package/dist/cli/chunks/{chunk-YRV45WDT.js → chunk-OG3DBHIV.js} +2 -2
  112. package/dist/cli/chunks/{chunk-P736OKQN.js → chunk-OZ53BIY5.js} +1 -1
  113. package/dist/cli/chunks/{chunk-H5DS7S4B.js → chunk-P6EFKHNI.js} +2 -2
  114. package/dist/cli/chunks/{chunk-T5M4TZRB.js → chunk-PGFCKE4G.js} +3 -3
  115. package/dist/cli/chunks/{chunk-HGPMS6JL.js → chunk-PVINNJ4P.js} +2 -2
  116. package/dist/cli/chunks/{chunk-H3AKF2HS.js → chunk-QG5L2JM5.js} +10 -10
  117. package/dist/cli/chunks/{chunk-EWH7PFV6.js → chunk-QM4Z7TQH.js} +1 -1
  118. package/dist/cli/chunks/{chunk-7HTYM6XY.js → chunk-QXO35J6F.js} +2 -2
  119. package/dist/cli/chunks/{chunk-OLPJGYO5.js → chunk-R7LGVJMZ.js} +2 -2
  120. package/dist/cli/chunks/{chunk-VC77SDNH.js → chunk-RACWX2ZX.js} +2 -2
  121. package/dist/cli/chunks/{chunk-UJ2NRIAS.js → chunk-RP2BRRLX.js} +2 -2
  122. package/dist/cli/chunks/{chunk-GWTGBQ6X.js → chunk-RP5VFZJO.js} +2 -2
  123. package/dist/cli/chunks/{chunk-TU4BYSXR.js → chunk-S6WHYOWV.js} +2 -2
  124. package/dist/cli/chunks/{chunk-LIGDJP6H.js → chunk-SCQNISGS.js} +1 -1
  125. package/dist/cli/chunks/chunk-SNC73DWF.js +2 -0
  126. package/dist/cli/chunks/{chunk-W2T36CS5.js → chunk-SOS37ECY.js} +1 -1
  127. package/dist/cli/chunks/{chunk-AAPJG3WI.js → chunk-SXFSJJZF.js} +2 -2
  128. package/dist/cli/chunks/{chunk-DMHQ4ZUZ.js → chunk-TB2N3CAK.js} +2 -2
  129. package/dist/cli/chunks/chunk-TDVMILKO.js +2 -0
  130. package/dist/cli/chunks/{chunk-WVNLNXXI.js → chunk-TJVTV3HP.js} +2 -2
  131. package/dist/cli/chunks/{chunk-GJTGHVAX.js → chunk-TK5XLF3Z.js} +4 -4
  132. package/dist/cli/chunks/{chunk-JTQSXU6V.js → chunk-TWUWLSGQ.js} +3 -3
  133. package/dist/cli/chunks/{chunk-AHG2O5HT.js → chunk-U5G6OC2C.js} +2 -2
  134. package/dist/cli/chunks/{chunk-CTS545BF.js → chunk-UBOGJHWC.js} +1 -1
  135. package/dist/cli/chunks/{chunk-4TJJU5Y2.js → chunk-UC4EIULB.js} +13 -13
  136. package/dist/cli/chunks/{chunk-4CTKRLRX.js → chunk-UJUK6T4V.js} +2 -2
  137. package/dist/cli/chunks/chunk-UQ4UCHO7.js +2 -0
  138. package/dist/cli/chunks/{chunk-JWT675RM.js → chunk-UWZYXI3R.js} +2 -2
  139. package/dist/cli/chunks/{chunk-TZA45FI7.js → chunk-VA2ORJB5.js} +2 -2
  140. package/dist/cli/chunks/{chunk-2E3PRDEX.js → chunk-VBHA4SDU.js} +2 -2
  141. package/dist/cli/chunks/{chunk-H3BHOIT6.js → chunk-VD53LBF7.js} +3 -3
  142. package/dist/cli/chunks/{chunk-MWTFFGU3.js → chunk-VNODKACB.js} +2 -2
  143. package/dist/cli/chunks/{chunk-HHEWINDL.js → chunk-VQCLSX7T.js} +1 -1
  144. package/dist/cli/chunks/{chunk-UGFHEVG4.js → chunk-VQD2ELNL.js} +2 -2
  145. package/dist/cli/chunks/{chunk-WRMJWQUI.js → chunk-VZGP77YU.js} +1 -1
  146. package/dist/cli/chunks/chunk-WA6CSEOX.js +2 -0
  147. package/dist/cli/chunks/{chunk-PZHAPI47.js → chunk-WE3VKDMK.js} +3 -3
  148. package/dist/cli/chunks/{chunk-Y2S6SS7M.js → chunk-WXU7FAEB.js} +2 -2
  149. package/dist/cli/chunks/{chunk-PADCR4LY.js → chunk-WYFAPA2G.js} +2 -2
  150. package/dist/cli/chunks/{chunk-SW56PB22.js → chunk-WYIXNHPF.js} +2 -2
  151. package/dist/cli/chunks/{chunk-OQWG7GOD.js → chunk-X2SZCVDA.js} +2 -2
  152. package/dist/cli/chunks/{chunk-H7QWOJF2.js → chunk-X3JNFQW2.js} +2 -2
  153. package/dist/cli/chunks/{chunk-YRCNWQBO.js → chunk-XIKYUBIV.js} +2 -2
  154. package/dist/cli/chunks/{chunk-4TUGQESL.js → chunk-XM5I7J5S.js} +2 -2
  155. package/dist/cli/chunks/{chunk-2HT5HRAA.js → chunk-XT473WPO.js} +2 -2
  156. package/dist/cli/chunks/{chunk-IYMV4CU5.js → chunk-YL2GOJF6.js} +2 -2
  157. package/dist/cli/chunks/{chunk-36ONUM43.js → chunk-YQOQVSYU.js} +1 -1
  158. package/dist/cli/chunks/{chunk-EI4KYBNI.js → chunk-Z56BBX77.js} +2 -2
  159. package/dist/cli/chunks/{chunk-3SPYI7TS.js → chunk-Z6DSYLAG.js} +1 -1
  160. package/dist/cli/chunks/{chunk-LUAXQB57.js → chunk-ZMYV4R32.js} +1 -1
  161. package/dist/cli/chunks/{chunk-DXQMVATY.js → chunk-ZSAGRDXA.js} +2 -2
  162. package/dist/cli/chunks/{ci-M6WYL2XY.js → ci-QAUD62WH.js} +2 -2
  163. package/dist/cli/chunks/{ci-output-JFC3WOHX.js → ci-output-TZDVTNE7.js} +2 -2
  164. package/dist/cli/chunks/{circuit-breaker-IMVBU6WP.js → circuit-breaker-ZWPHJ7YJ.js} +2 -2
  165. package/dist/cli/chunks/{claude-flow-setup-M5T5ZUXX.js → claude-flow-setup-SCB4EURN.js} +2 -2
  166. package/dist/cli/chunks/client-4W3KWTAU.js +2 -0
  167. package/dist/cli/chunks/{cline-installer-LSFAUHXC.js → cline-installer-EHZLMLXF.js} +2 -2
  168. package/dist/cli/chunks/{code-N3SWJ3XL.js → code-3N6PBJMK.js} +2 -2
  169. package/dist/cli/chunks/{code-index-extractor-WPGRG36B.js → code-index-extractor-6DIKHNRI.js} +2 -2
  170. package/dist/cli/chunks/{codex-installer-LKRCSDU5.js → codex-installer-P7DPQMYL.js} +2 -2
  171. package/dist/cli/chunks/{completions-E5TBZ5AB.js → completions-5MKWWCCE.js} +2 -2
  172. package/dist/cli/chunks/{complexity-analyzer-3FOSOELK.js → complexity-analyzer-TPM4IPEK.js} +2 -2
  173. package/dist/cli/chunks/{continuedev-installer-ZSVFWMQB.js → continuedev-installer-VXODKGVX.js} +2 -2
  174. package/dist/cli/chunks/{copilot-installer-POSKHPZM.js → copilot-installer-PVD5O56P.js} +2 -2
  175. package/dist/cli/chunks/core-handlers-BDU2XBLO.js +2 -0
  176. package/dist/cli/chunks/{cost-tracker-3UWDCNGC.js → cost-tracker-JOMZEQF3.js} +2 -2
  177. package/dist/cli/chunks/{coverage-HPBO67JF.js → coverage-HTXLEV3B.js} +3 -3
  178. package/dist/cli/chunks/cross-domain-router-BPB6IHN4.js +2 -0
  179. package/dist/cli/chunks/{cursor-installer-DSW3L62X.js → cursor-installer-SHKDTDDZ.js} +2 -2
  180. package/dist/cli/chunks/{daemon-2622ZCMJ.js → daemon-FCFEWVVJ.js} +3 -3
  181. package/dist/cli/chunks/{daemon-33KTKDUM.js → daemon-PN4FEPLE.js} +4 -4
  182. package/dist/cli/chunks/{dag-attention-scheduler-YFT5JMM6.js → dag-attention-scheduler-PLOHU5SR.js} +2 -2
  183. package/dist/cli/chunks/{detect-COR3Q6BE.js → detect-F3H4ZEZY.js} +2 -2
  184. package/dist/cli/chunks/{dist-node-5TRNTNWI.js → dist-node-5TC665N6.js} +2 -2
  185. package/dist/cli/chunks/{domain-handler-TZC4GCF6.js → domain-handler-ZIWVFXCU.js} +2 -2
  186. package/dist/cli/chunks/{domain-transfer-D2TENM3Y.js → domain-transfer-7Q5JYMYR.js} +2 -2
  187. package/dist/cli/chunks/dream-WFCZGFDY.js +2 -0
  188. package/dist/cli/chunks/{embed-and-insert-pattern-COAZZGS6.js → embed-and-insert-pattern-VESJQSYD.js} +2 -2
  189. package/dist/cli/chunks/{eval-5ID5D77H.js → eval-E2K2T75A.js} +2 -2
  190. package/dist/cli/chunks/{experience-capture-middleware-MT4Z74TD.js → experience-capture-middleware-Z5SE2O53.js} +3 -3
  191. package/dist/cli/chunks/{fast-paths-MACRZGSE.js → fast-paths-3H52RSUK.js} +2 -2
  192. package/dist/cli/chunks/{feature-flags-LFNL6BHS.js → feature-flags-LUHSMHPS.js} +2 -2
  193. package/dist/cli/chunks/{feature-flags-JZX6ZBUX.js → feature-flags-ONIKUZVK.js} +2 -2
  194. package/dist/cli/chunks/{file-discovery-DA5BEAO2.js → file-discovery-FLYSYSS4.js} +2 -2
  195. package/dist/cli/chunks/{fleet-35I4F7D2.js → fleet-6OJUAAKV.js} +3 -3
  196. package/dist/cli/chunks/{gnn-wrapper-2W3HM3ZI.js → gnn-wrapper-PUL6B7KZ.js} +2 -2
  197. package/dist/cli/chunks/{heartbeat-handler-6O2D2FU2.js → heartbeat-handler-HGHHDUDY.js} +4 -4
  198. package/dist/cli/chunks/heartbeat-scheduler-HWS4SHRM.js +2 -0
  199. package/dist/cli/chunks/hnsw-adapter-7QOBHKRB.js +2 -0
  200. package/dist/cli/chunks/hnsw-index-6WUKYJH7.js +2 -0
  201. package/dist/cli/chunks/{hnsw-legacy-bridge-GWBXEMQR.js → hnsw-legacy-bridge-NDZSNMYX.js} +2 -2
  202. package/dist/cli/chunks/{hnswlib-node-TZ4VLARU.js → hnswlib-node-PISLKSO2.js} +2 -2
  203. package/dist/cli/chunks/{hooks-723GPTQ4.js → hooks-WYG54MRI.js} +10 -10
  204. package/dist/cli/chunks/hybrid-router-525JTRA5.js +2 -0
  205. package/dist/cli/chunks/{hypergraph-engine-ILRYFJM5.js → hypergraph-engine-EDHKHZZ2.js} +2 -2
  206. package/dist/cli/chunks/{hypergraph-handler-523TSK4P.js → hypergraph-handler-OCHZAPPL.js} +3 -3
  207. package/dist/cli/chunks/impact-analyzer-GG6CJEOK.js +2 -0
  208. package/dist/cli/chunks/{init-handler-RBDYIXNV.js → init-handler-5TCJ672H.js} +6 -6
  209. package/dist/cli/chunks/init-wizard-4VFAOK4Y.js +2 -0
  210. package/dist/cli/chunks/kernel-N3FQGOST.js +2 -0
  211. package/dist/cli/chunks/{kilocode-installer-E2QSX7Z7.js → kilocode-installer-SWUQRCTZ.js} +2 -2
  212. package/dist/cli/chunks/{kiro-installer-EZZLT2R5.js → kiro-installer-L22EBAM5.js} +2 -2
  213. package/dist/cli/chunks/knowledge-graph-I5QIHB4G.js +2 -0
  214. package/dist/cli/chunks/{learning-II2U3EV2.js → learning-TQOGG3CR.js} +3 -3
  215. package/dist/cli/chunks/llm-router-F2L4LFT2.js +37 -0
  216. package/dist/cli/chunks/llm-router-service-NCJZYJLG.js +2 -0
  217. package/dist/cli/chunks/{load-QFQ3YOBQ.js → load-A4ZF2KHC.js} +2 -2
  218. package/dist/cli/chunks/load-test-DCJEYIXD.js +2 -0
  219. package/dist/cli/chunks/{mcp-FPBBJJFY.js → mcp-T2Z46NNK.js} +2 -2
  220. package/dist/cli/chunks/{memory-RKN6KV75.js → memory-PUC3J6XC.js} +5 -5
  221. package/dist/cli/chunks/memory-backend-O6KO2KTX.js +2 -0
  222. package/dist/cli/chunks/memory-handlers-4Z43WEKD.js +2 -0
  223. package/dist/cli/chunks/{multi-model-executor-OUNW3JM5.js → multi-model-executor-U5L4FI4O.js} +2 -2
  224. package/dist/cli/chunks/{opencode-installer-FXETYGGY.js → opencode-installer-UWI6KHYH.js} +2 -2
  225. package/dist/cli/chunks/{orchestrator-35UTVXSP.js → orchestrator-3BEI7R5D.js} +5 -5
  226. package/dist/cli/chunks/pattern-null-store-5WIJKX2K.js +2 -0
  227. package/dist/cli/chunks/{pattern-usage-recorder-YEQDS7DN.js → pattern-usage-recorder-EGWUI5LU.js} +2 -2
  228. package/dist/cli/chunks/{pipeline-YDJMWCAR.js → pipeline-JG6M4RHD.js} +2 -2
  229. package/dist/cli/chunks/{platform-L3LPNVKT.js → platform-F76G6RUI.js} +2 -2
  230. package/dist/cli/chunks/{plugin-55EYFJH5.js → plugin-EEGN3PMK.js} +2 -2
  231. package/dist/cli/chunks/{prime-radiant-advanced-wasm-SUZT6RTM.js → prime-radiant-advanced-wasm-7KZAINFT.js} +2 -2
  232. package/dist/cli/chunks/protocol-executor-5TPNAZTB.js +2 -0
  233. package/dist/cli/chunks/{protocol-handler-QNBFRJNY.js → protocol-handler-UCEHYK2R.js} +2 -2
  234. package/dist/cli/chunks/{prove-3X5NQP4L.js → prove-JSNG75VD.js} +2 -2
  235. package/dist/cli/chunks/provider-manager-3VMOZ6HV.js +2 -0
  236. package/dist/cli/chunks/qe-reasoning-bank-BATV4NTT.js +2 -0
  237. package/dist/cli/chunks/{quality-5ZONTNA6.js → quality-7SRM2HBM.js} +2 -2
  238. package/dist/cli/chunks/{quality-gate-JPNREEVR.js → quality-gate-A5MPWHST.js} +3 -3
  239. package/dist/cli/chunks/queen-coordinator-EIHGYBUO.js +2 -0
  240. package/dist/cli/chunks/{real-embeddings-HHR75AR5.js → real-embeddings-ZBF5EQOG.js} +2 -2
  241. package/dist/cli/chunks/{roocode-installer-ZK73O2GD.js → roocode-installer-UYQK64BZ.js} +2 -2
  242. package/dist/cli/chunks/router-EMVGY4HU.js +2 -0
  243. package/dist/cli/chunks/routing-feedback-JUP4OFB2.js +2 -0
  244. package/dist/cli/chunks/{routing-handler-2UN5GRHJ.js → routing-handler-PY3KPDTH.js} +2 -2
  245. package/dist/cli/chunks/{ruvector-commands-EQQUEVWN.js → ruvector-commands-GCAOUTYS.js} +2 -2
  246. package/dist/cli/chunks/{rvf-dual-writer-43L75WLF.js → rvf-dual-writer-BUNP4SKD.js} +2 -2
  247. package/dist/cli/chunks/{rvf-migration-adapter-Y5OVCYTO.js → rvf-migration-adapter-VSOAPLMB.js} +2 -2
  248. package/dist/cli/chunks/{rvf-migration-coordinator-NEPDFB3N.js → rvf-migration-coordinator-LSWEHAWX.js} +2 -2
  249. package/dist/cli/chunks/rvf-native-adapter-LOC42TQ6.js +2 -0
  250. package/dist/cli/chunks/{rvf-store-integrity-66FEC3MD.js → rvf-store-integrity-HNDKOM4L.js} +2 -2
  251. package/dist/cli/chunks/safe-db-WQ62IQKV.js +2 -0
  252. package/dist/cli/chunks/schedule-XJRP57TE.js +2 -0
  253. package/dist/cli/chunks/scheduler-EZH5SDIM.js +2 -0
  254. package/dist/cli/chunks/{security-H7PEUUCV.js → security-MQ2VB7PY.js} +3 -3
  255. package/dist/cli/chunks/{shared-rvf-adapter-XETNK4ID.js → shared-rvf-adapter-TAZEU6QK.js} +2 -2
  256. package/dist/cli/chunks/{shared-rvf-dual-writer-PXD54BWJ.js → shared-rvf-dual-writer-B7N6AOCY.js} +2 -2
  257. package/dist/cli/chunks/sqlite-persistence-HPEVCTIB.js +2 -0
  258. package/dist/cli/chunks/status-handler-NZP7DFHE.js +47 -0
  259. package/dist/cli/chunks/{structural-health-EIFBDCRI.js → structural-health-ALLUQ4X6.js} +2 -2
  260. package/dist/cli/chunks/{sync-3SU4H6R3.js → sync-MM7OCUYD.js} +2 -2
  261. package/dist/cli/chunks/{sync-PECWQ64K.js → sync-WJJG5J6V.js} +2 -2
  262. package/dist/cli/chunks/{task-handler-ZTUAT6YF.js → task-handler-CAQUEEB4.js} +2 -2
  263. package/dist/cli/chunks/{task-handlers-4RIO7LJJ.js → task-handlers-25BJ7D3W.js} +3 -3
  264. package/dist/cli/chunks/{test-EV7BSUTI.js → test-HW7GVGVN.js} +4 -4
  265. package/dist/cli/chunks/{test-scheduling-4WVI5DLE.js → test-scheduling-HTMFJMSP.js} +3 -3
  266. package/dist/cli/chunks/{token-bootstrap-3P22AYZ4.js → token-bootstrap-F2DCLWGW.js} +2 -2
  267. package/dist/cli/chunks/{token-usage-FR3JOWYB.js → token-usage-RJZDMBDP.js} +2 -2
  268. package/dist/cli/chunks/{transformers-FENO33LA.js → transformers-3YFW3EUO.js} +2 -2
  269. package/dist/cli/chunks/{tree-sitter-wasm-parser-YFGJLSMB.js → tree-sitter-wasm-parser-U3PQPIK7.js} +2 -2
  270. package/dist/cli/chunks/{types-N3Y565RZ.js → types-7Q762WDO.js} +2 -2
  271. package/dist/cli/chunks/unified-memory-ATILROKR.js +2 -0
  272. package/dist/cli/chunks/unified-memory-hnsw-XJXAX7DW.js +2 -0
  273. package/dist/cli/chunks/unified-persistence-3TN5PBWE.js +2 -0
  274. package/dist/cli/chunks/{upgrade-33ZVVZFW.js → upgrade-F7MKJWBQ.js} +2 -2
  275. package/dist/cli/chunks/{validate-CS5PXGDF.js → validate-B27AVRA6.js} +2 -2
  276. package/dist/cli/chunks/{validate-swarm-GRZPWYNM.js → validate-swarm-GYZR3GNL.js} +2 -2
  277. package/dist/cli/chunks/{vibium-IO7N4VEE.js → vibium-W4XQMPJP.js} +2 -2
  278. package/dist/cli/chunks/visual-security-VFWRBCNA.js +2 -0
  279. package/dist/cli/chunks/{web-tree-sitter-UQXR5HHR.js → web-tree-sitter-I7CDCFJU.js} +2 -2
  280. package/dist/cli/chunks/{windsurf-installer-BCKLSLZT.js → windsurf-installer-UYLHFDHU.js} +2 -2
  281. package/dist/cli/chunks/{witness-chain-R3V26QWL.js → witness-chain-B66SYZKU.js} +2 -2
  282. package/dist/cli/chunks/witness-chain-JC5LEXRV.js +2 -0
  283. package/dist/cli/chunks/{witness-key-manager-Y36HMPEM.js → witness-key-manager-U4JPAHVW.js} +2 -2
  284. package/dist/cli/chunks/{workflow-4TCIUUFQ.js → workflow-DYMO47FF.js} +4 -4
  285. package/dist/cli/chunks/workflow-orchestrator-TKQUF2KN.js +2 -0
  286. package/dist/cli/chunks/{wrappers-MD4JRHJH.js → wrappers-7S6DQTEA.js} +2 -2
  287. package/dist/cli/commands/llm-router.js +35 -6
  288. package/dist/cli/handlers/status-handler.js +18 -2
  289. package/dist/mcp/bundle.js +398 -390
  290. package/dist/shared/llm/billing-modes.d.ts +5 -0
  291. package/dist/shared/llm/billing-modes.js +42 -3
  292. package/dist/shared/llm/index.d.ts +4 -1
  293. package/dist/shared/llm/index.js +5 -1
  294. package/dist/shared/llm/interfaces.d.ts +34 -3
  295. package/dist/shared/llm/interfaces.js +17 -0
  296. package/dist/shared/llm/provider-manager.js +8 -1
  297. package/dist/shared/llm/provider-registry.d.ts +135 -0
  298. package/dist/shared/llm/provider-registry.js +227 -0
  299. package/dist/shared/llm/providers/external-cli.d.ts +129 -0
  300. package/dist/shared/llm/providers/external-cli.js +385 -0
  301. package/dist/shared/llm/router/config-store.d.ts +14 -0
  302. package/dist/shared/llm/router/config-store.js +102 -14
  303. package/dist/shared/llm/router/external-provider-config.d.ts +47 -0
  304. package/dist/shared/llm/router/external-provider-config.js +105 -0
  305. package/dist/shared/llm/router/types.d.ts +50 -4
  306. package/dist/shared/llm/router/types.js +10 -0
  307. package/dist/shared/llm/translation/message-formatter.js +7 -1
  308. package/package.json +5 -1
  309. package/dist/cli/chunks/adapter-YBSKQFQ4.js +0 -2
  310. package/dist/cli/chunks/aqe-learning-engine-3H7DRDD4.js +0 -2
  311. package/dist/cli/chunks/base-ZTD6PFD7.js +0 -2
  312. package/dist/cli/chunks/browser-workflow-GKWDM25H.js +0 -2
  313. package/dist/cli/chunks/chunk-CYQRZ645.js +0 -2
  314. package/dist/cli/chunks/chunk-GP5QBJVO.js +0 -3
  315. package/dist/cli/chunks/chunk-JGXP67BP.js +0 -2
  316. package/dist/cli/chunks/chunk-UDSNWQQI.js +0 -2
  317. package/dist/cli/chunks/chunk-YXUFGDGS.js +0 -2
  318. package/dist/cli/chunks/client-4Q5JE7RY.js +0 -2
  319. package/dist/cli/chunks/core-handlers-4GKEYGPS.js +0 -2
  320. package/dist/cli/chunks/cross-domain-router-PBJ2ZGPJ.js +0 -2
  321. package/dist/cli/chunks/dream-4EXVFHUJ.js +0 -2
  322. package/dist/cli/chunks/heartbeat-scheduler-UNEYR3WR.js +0 -2
  323. package/dist/cli/chunks/hnsw-adapter-JQG66H4L.js +0 -2
  324. package/dist/cli/chunks/hnsw-index-2NOROILM.js +0 -2
  325. package/dist/cli/chunks/hybrid-router-FXTAJATE.js +0 -2
  326. package/dist/cli/chunks/impact-analyzer-VHZSBWMT.js +0 -2
  327. package/dist/cli/chunks/init-wizard-EML4OET2.js +0 -2
  328. package/dist/cli/chunks/kernel-TMRJOEO2.js +0 -2
  329. package/dist/cli/chunks/knowledge-graph-FMKVCMJQ.js +0 -2
  330. package/dist/cli/chunks/llm-router-WC66OXZH.js +0 -36
  331. package/dist/cli/chunks/llm-router-service-GOSVGMKM.js +0 -2
  332. package/dist/cli/chunks/load-test-WIRGDZIA.js +0 -2
  333. package/dist/cli/chunks/memory-backend-XBBIXDZU.js +0 -2
  334. package/dist/cli/chunks/memory-handlers-SQHNK3DK.js +0 -2
  335. package/dist/cli/chunks/pattern-null-store-PFLKHRVU.js +0 -2
  336. package/dist/cli/chunks/protocol-executor-GAMNY2JB.js +0 -2
  337. package/dist/cli/chunks/provider-manager-VTIG5AKU.js +0 -2
  338. package/dist/cli/chunks/qe-reasoning-bank-KAX63PXV.js +0 -2
  339. package/dist/cli/chunks/queen-coordinator-UYW2MDKI.js +0 -2
  340. package/dist/cli/chunks/router-NVDU7IIA.js +0 -2
  341. package/dist/cli/chunks/routing-feedback-KHR3J2J3.js +0 -2
  342. package/dist/cli/chunks/rvf-native-adapter-PQ4IOTZU.js +0 -2
  343. package/dist/cli/chunks/safe-db-QHSFV63M.js +0 -2
  344. package/dist/cli/chunks/schedule-JGZFHJGM.js +0 -2
  345. package/dist/cli/chunks/scheduler-NGCDQIW5.js +0 -2
  346. package/dist/cli/chunks/sqlite-persistence-3JSNWL6I.js +0 -2
  347. package/dist/cli/chunks/status-handler-CTXOH3FX.js +0 -47
  348. package/dist/cli/chunks/unified-memory-4VO5KSHP.js +0 -2
  349. package/dist/cli/chunks/unified-memory-hnsw-ZR2FZXOB.js +0 -2
  350. package/dist/cli/chunks/unified-persistence-VFPW5MFM.js +0 -2
  351. package/dist/cli/chunks/visual-security-SNADRUPR.js +0 -2
  352. package/dist/cli/chunks/witness-chain-2TXUTEJE.js +0 -2
  353. package/dist/cli/chunks/workflow-orchestrator-ON6UYRVE.js +0 -2
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Agentic QE v3 — Generic external CLI provider (ADR-127 / issue #628)
3
+ *
4
+ * A provider built from a *declaration* rather than from code. It generalizes
5
+ * the shape AQE has already shipped twice — `providers/codex.ts` and
6
+ * `providers/claude-code.ts` — into something a downstream integrator can
7
+ * obtain by writing JSON:
8
+ *
9
+ * spawn a host CLI → feed it a prompt on stdin → read the completion from
10
+ * stdout → attribute the usage honestly.
11
+ *
12
+ * WHY DECLARATIVE: the requester (agentic-kit) drives AQE as spawned
13
+ * subprocesses — the `aqe` CLI bundle and the MCP server bundle are separate
14
+ * esbuild artifacts — so an in-process `registerProvider()` call cannot reach
15
+ * them. A declaration in `.agentic-qe/llm-config.json` reaches both, and does
16
+ * so without AQE ever importing third-party code. See ADR-127 for why the
17
+ * dynamic-`import()` plugin design was rejected.
18
+ *
19
+ * LOAD-BEARING: `stripEnv` removes named variables from the child environment.
20
+ * A host that bills against a subscription must be able to guarantee an API
21
+ * key is not silently present to flip it back to metered billing — the same
22
+ * discipline `codex.ts` enforces for OPENAI_API_KEY / CODEX_API_KEY.
23
+ */
24
+ import { type BillingMode, type CompleteOptions, type CompletionResponse, type EmbedOptions, type EmbeddingResponse, type GenerateOptions, type HealthCheckResult, type LLMConfig, type LLMProvider, type LLMResponse, type Message } from '../interfaces';
25
+ /**
26
+ * A declared external CLI provider. This is the on-disk contract — see ADR-127
27
+ * §Schema. Everything except `kind` and `command` is optional.
28
+ */
29
+ export interface ExternalCliProviderConfig {
30
+ /** Discriminator. Only `'cli'` exists today; `'http'` is a follow-up. */
31
+ readonly kind: 'cli';
32
+ /** argv. Not shell-interpreted — `command[0]` is the binary. */
33
+ readonly command: readonly string[];
34
+ /** How this host bills. Unverified assertion; defaults to `metered-api`. */
35
+ readonly billingMode?: BillingMode;
36
+ /** Models this host accepts. Defaults to `['default']`. */
37
+ readonly models?: readonly string[];
38
+ /** Model used when the caller does not name one. Defaults to `models[0]`. */
39
+ readonly defaultModel?: string;
40
+ /** Flag used to pass the model, e.g. `--model`. Omitted = never passed. */
41
+ readonly modelFlag?: string;
42
+ /** Hard timeout per invocation. Defaults to 180000. */
43
+ readonly timeoutMs?: number;
44
+ /** Max concurrent subprocesses. Defaults to 2. */
45
+ readonly maxConcurrency?: number;
46
+ /** Env vars removed from the child process before spawning. */
47
+ readonly stripEnv?: readonly string[];
48
+ /** Human-facing name for CLI output. Defaults to the type string. */
49
+ readonly displayName?: string;
50
+ }
51
+ export declare const DEFAULT_EXTERNAL_CLI_TIMEOUT_MS = 180000;
52
+ export declare const DEFAULT_EXTERNAL_CLI_CONCURRENCY = 2;
53
+ export declare const EXTERNAL_CLI_DEFAULT_MODEL = "default";
54
+ /**
55
+ * Validate a declaration. Returns an error message, or `undefined` when the
56
+ * declaration is usable.
57
+ *
58
+ * Deliberately does NOT check that the binary exists — that is a runtime
59
+ * availability question answered by `isAvailable()`. A declaration for a host
60
+ * that is not installed yet is valid-but-unavailable, not malformed, so a
61
+ * config file stays portable across machines.
62
+ */
63
+ export declare function validateExternalCliConfig(type: string, config: unknown): string | undefined;
64
+ export declare class ExternalCliProvider implements LLMProvider {
65
+ readonly type: string;
66
+ readonly name: string;
67
+ readonly billingMode: BillingMode;
68
+ private readonly config;
69
+ private requestCounter;
70
+ private availabilityCache?;
71
+ private active;
72
+ private readonly queue;
73
+ constructor(type: string, config: ExternalCliProviderConfig);
74
+ /**
75
+ * Is the host's binary present and executable?
76
+ *
77
+ * Deliberately does NOT run it. AQE cannot know what invoking an arbitrary
78
+ * host costs — a declared host has no `--version` contract it agreed to, and
79
+ * spawning it with an empty prompt could burn a real request against the
80
+ * user's plan just to answer "are you installed?". Resolving the binary on
81
+ * PATH answers the question for free.
82
+ */
83
+ isAvailable(): Promise<boolean>;
84
+ healthCheck(): Promise<HealthCheckResult>;
85
+ generate(input: string | Message[], options?: GenerateOptions): Promise<LLMResponse>;
86
+ /**
87
+ * ADR-127: a generic CLI contract cannot promise an embeddings endpoint.
88
+ * Throws `EMBEDDING_UNSUPPORTED` — a distinct, non-retryable signal so the
89
+ * caller falls back to a provider that has one, and never receives a
90
+ * fabricated vector.
91
+ */
92
+ embed(_text: string, _options?: EmbedOptions): Promise<EmbeddingResponse>;
93
+ complete(prompt: string, options?: CompleteOptions): Promise<CompletionResponse>;
94
+ getConfig(): LLMConfig;
95
+ getSupportedModels(): string[];
96
+ /**
97
+ * Unknown. A declared host does not tell AQE its per-token price, and
98
+ * inventing one would feed fabricated numbers into cost reporting.
99
+ */
100
+ getCostPerToken(): {
101
+ input: number;
102
+ output: number;
103
+ };
104
+ dispose(): Promise<void>;
105
+ private defaultModel;
106
+ /**
107
+ * Child env with the declared keys removed (LOAD-BEARING — see file header).
108
+ * Static so tests can assert the strip without spawning anything.
109
+ */
110
+ static childEnv(stripEnv?: readonly string[], base?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
111
+ private classifyError;
112
+ private spawnHost;
113
+ /** Semaphore so we never spawn unbounded host subprocesses. */
114
+ private withConcurrency;
115
+ }
116
+ /**
117
+ * Does this binary resolve to something executable, without running it?
118
+ * An absolute or explicitly-relative path is checked directly; a bare name is
119
+ * looked up across PATH the way the shell would.
120
+ */
121
+ export declare function resolvesOnPath(binary: string, env?: NodeJS.ProcessEnv): boolean;
122
+ /**
123
+ * Flatten messages into a single prompt. A generic CLI has no role protocol,
124
+ * so system content is hoisted into a preamble — the same strategy
125
+ * `codex.ts` uses and the reason `message-formatter` falls back to
126
+ * `'first-message'` for unknown providers.
127
+ */
128
+ export declare function flattenPrompt(input: string | Message[], systemPrompt?: string): string;
129
+ //# sourceMappingURL=external-cli.d.ts.map
@@ -0,0 +1,385 @@
1
+ /**
2
+ * Agentic QE v3 — Generic external CLI provider (ADR-127 / issue #628)
3
+ *
4
+ * A provider built from a *declaration* rather than from code. It generalizes
5
+ * the shape AQE has already shipped twice — `providers/codex.ts` and
6
+ * `providers/claude-code.ts` — into something a downstream integrator can
7
+ * obtain by writing JSON:
8
+ *
9
+ * spawn a host CLI → feed it a prompt on stdin → read the completion from
10
+ * stdout → attribute the usage honestly.
11
+ *
12
+ * WHY DECLARATIVE: the requester (agentic-kit) drives AQE as spawned
13
+ * subprocesses — the `aqe` CLI bundle and the MCP server bundle are separate
14
+ * esbuild artifacts — so an in-process `registerProvider()` call cannot reach
15
+ * them. A declaration in `.agentic-qe/llm-config.json` reaches both, and does
16
+ * so without AQE ever importing third-party code. See ADR-127 for why the
17
+ * dynamic-`import()` plugin design was rejected.
18
+ *
19
+ * LOAD-BEARING: `stripEnv` removes named variables from the child environment.
20
+ * A host that bills against a subscription must be able to guarantee an API
21
+ * key is not silently present to flip it back to metered billing — the same
22
+ * discipline `codex.ts` enforces for OPENAI_API_KEY / CODEX_API_KEY.
23
+ */
24
+ import { spawn } from 'node:child_process';
25
+ import { accessSync, constants as fsConstants, statSync } from 'node:fs';
26
+ import { delimiter, join } from 'node:path';
27
+ import { createLLMError, } from '../interfaces.js';
28
+ export const DEFAULT_EXTERNAL_CLI_TIMEOUT_MS = 180_000;
29
+ export const DEFAULT_EXTERNAL_CLI_CONCURRENCY = 2;
30
+ export const EXTERNAL_CLI_DEFAULT_MODEL = 'default';
31
+ /**
32
+ * Validate a declaration. Returns an error message, or `undefined` when the
33
+ * declaration is usable.
34
+ *
35
+ * Deliberately does NOT check that the binary exists — that is a runtime
36
+ * availability question answered by `isAvailable()`. A declaration for a host
37
+ * that is not installed yet is valid-but-unavailable, not malformed, so a
38
+ * config file stays portable across machines.
39
+ */
40
+ export function validateExternalCliConfig(type, config) {
41
+ if (!config || typeof config !== 'object') {
42
+ return `externalProviders["${type}"] must be an object`;
43
+ }
44
+ const c = config;
45
+ if (c.kind !== 'cli') {
46
+ return `externalProviders["${type}"].kind must be "cli" (got ${JSON.stringify(c.kind)})`;
47
+ }
48
+ if (!Array.isArray(c.command) || c.command.length === 0) {
49
+ return `externalProviders["${type}"].command must be a non-empty string array`;
50
+ }
51
+ if (!c.command.every((part) => typeof part === 'string' && part.length > 0)) {
52
+ return `externalProviders["${type}"].command must contain only non-empty strings`;
53
+ }
54
+ if (c.billingMode !== undefined &&
55
+ !['subscription', 'metered-api', 'metered-capped', 'local'].includes(c.billingMode)) {
56
+ return `externalProviders["${type}"].billingMode "${String(c.billingMode)}" is not a valid billing mode`;
57
+ }
58
+ if (c.models !== undefined && (!Array.isArray(c.models) || c.models.some((m) => typeof m !== 'string'))) {
59
+ return `externalProviders["${type}"].models must be a string array`;
60
+ }
61
+ if (c.timeoutMs !== undefined && (typeof c.timeoutMs !== 'number' || c.timeoutMs <= 0)) {
62
+ return `externalProviders["${type}"].timeoutMs must be a positive number`;
63
+ }
64
+ if (c.maxConcurrency !== undefined &&
65
+ (typeof c.maxConcurrency !== 'number' || c.maxConcurrency < 1)) {
66
+ return `externalProviders["${type}"].maxConcurrency must be >= 1`;
67
+ }
68
+ if (c.stripEnv !== undefined &&
69
+ (!Array.isArray(c.stripEnv) || c.stripEnv.some((k) => typeof k !== 'string'))) {
70
+ return `externalProviders["${type}"].stripEnv must be a string array`;
71
+ }
72
+ if ('apiKey' in c) {
73
+ // Matches saveRouterConfigFile's never-persist-keys discipline. Reported
74
+ // as an error so the key is noticed and removed rather than silently kept
75
+ // in a file that gets committed.
76
+ return `externalProviders["${type}"] must not contain an apiKey — keys belong in the environment, not in llm-config.json`;
77
+ }
78
+ return undefined;
79
+ }
80
+ // ============================================================================
81
+ // Provider
82
+ // ============================================================================
83
+ export class ExternalCliProvider {
84
+ type;
85
+ name;
86
+ billingMode;
87
+ config;
88
+ requestCounter = 0;
89
+ availabilityCache;
90
+ active = 0;
91
+ queue = [];
92
+ constructor(type, config) {
93
+ const problem = validateExternalCliConfig(type, config);
94
+ if (problem) {
95
+ throw createLLMError(problem, 'INVALID_REGISTRATION', { retryable: false });
96
+ }
97
+ this.type = type;
98
+ this.config = config;
99
+ this.name = config.displayName ?? type;
100
+ // Undeclared => metered-api: assume it costs money and requires a cap.
101
+ this.billingMode = config.billingMode ?? 'metered-api';
102
+ }
103
+ /**
104
+ * Is the host's binary present and executable?
105
+ *
106
+ * Deliberately does NOT run it. AQE cannot know what invoking an arbitrary
107
+ * host costs — a declared host has no `--version` contract it agreed to, and
108
+ * spawning it with an empty prompt could burn a real request against the
109
+ * user's plan just to answer "are you installed?". Resolving the binary on
110
+ * PATH answers the question for free.
111
+ */
112
+ async isAvailable() {
113
+ const now = Date.now();
114
+ if (this.availabilityCache && now - this.availabilityCache.at < 60_000) {
115
+ return this.availabilityCache.available;
116
+ }
117
+ const available = resolvesOnPath(this.config.command[0]);
118
+ this.availabilityCache = { at: now, available };
119
+ return available;
120
+ }
121
+ async healthCheck() {
122
+ const start = Date.now();
123
+ const available = await this.isAvailable();
124
+ const latencyMs = Date.now() - start;
125
+ if (!available) {
126
+ return {
127
+ healthy: false,
128
+ latencyMs,
129
+ error: `External provider "${this.type}" could not run "${this.config.command[0]}". ` +
130
+ `Check that the host is installed and on PATH.`,
131
+ };
132
+ }
133
+ return {
134
+ healthy: true,
135
+ latencyMs,
136
+ models: this.getSupportedModels(),
137
+ details: {
138
+ command: this.config.command[0],
139
+ billing: this.billingMode,
140
+ external: true,
141
+ },
142
+ };
143
+ }
144
+ async generate(input, options) {
145
+ const model = options?.model ?? this.defaultModel();
146
+ const requestId = `${this.type}-${++this.requestCounter}-${Date.now()}`;
147
+ const prompt = flattenPrompt(input, options?.systemPrompt);
148
+ const timeoutMs = options?.timeoutMs ?? this.config.timeoutMs ?? DEFAULT_EXTERNAL_CLI_TIMEOUT_MS;
149
+ const extraArgs = [];
150
+ if (this.config.modelFlag && model && model !== EXTERNAL_CLI_DEFAULT_MODEL) {
151
+ extraArgs.push(this.config.modelFlag, model);
152
+ }
153
+ const start = Date.now();
154
+ const { code, stdout, stderr } = await this.withConcurrency(() => this.spawnHost(extraArgs, prompt, timeoutMs));
155
+ const latencyMs = Date.now() - start;
156
+ const content = stdout.trim();
157
+ if (code !== 0 && !content) {
158
+ throw this.classifyError(stderr || `${this.type} exited with code ${code}`, model);
159
+ }
160
+ // No per-token receipt from a generic CLI. Estimate for visibility only
161
+ // (~4 chars/token) and mark the cost `local-estimate` so ADR-126's
162
+ // provenance rule holds: an estimate is never reported as a measurement.
163
+ const promptTokens = Math.ceil(prompt.length / 4);
164
+ const completionTokens = Math.ceil(content.length / 4);
165
+ const usage = {
166
+ promptTokens,
167
+ completionTokens,
168
+ totalTokens: promptTokens + completionTokens,
169
+ };
170
+ return {
171
+ content,
172
+ model,
173
+ provider: this.type,
174
+ usage,
175
+ cost: {
176
+ inputCost: 0,
177
+ outputCost: 0,
178
+ totalCost: 0,
179
+ currency: 'USD',
180
+ // Even for a subscription host this is an estimate, not a receipt:
181
+ // AQE did not observe the billing event and cannot verify the mode
182
+ // the declaration claimed.
183
+ source: 'local-estimate',
184
+ },
185
+ latencyMs,
186
+ finishReason: 'stop',
187
+ cached: false,
188
+ requestId,
189
+ };
190
+ }
191
+ /**
192
+ * ADR-127: a generic CLI contract cannot promise an embeddings endpoint.
193
+ * Throws `EMBEDDING_UNSUPPORTED` — a distinct, non-retryable signal so the
194
+ * caller falls back to a provider that has one, and never receives a
195
+ * fabricated vector.
196
+ */
197
+ async embed(_text, _options) {
198
+ throw createLLMError(`External provider "${this.type}" does not support embeddings. ` +
199
+ `Use a provider with an embeddings endpoint (openai, ollama, cognitum).`, 'EMBEDDING_UNSUPPORTED', { provider: this.type, retryable: false });
200
+ }
201
+ async complete(prompt, options) {
202
+ const response = await this.generate(prompt, {
203
+ model: options?.model,
204
+ temperature: options?.temperature,
205
+ maxTokens: options?.maxTokens,
206
+ });
207
+ return {
208
+ completion: response.content,
209
+ model: response.model,
210
+ provider: this.type,
211
+ usage: response.usage,
212
+ latencyMs: response.latencyMs,
213
+ cached: response.cached,
214
+ };
215
+ }
216
+ getConfig() {
217
+ return { ...this.config };
218
+ }
219
+ getSupportedModels() {
220
+ return [...(this.config.models ?? [EXTERNAL_CLI_DEFAULT_MODEL])];
221
+ }
222
+ /**
223
+ * Unknown. A declared host does not tell AQE its per-token price, and
224
+ * inventing one would feed fabricated numbers into cost reporting.
225
+ */
226
+ getCostPerToken() {
227
+ return { input: 0, output: 0 };
228
+ }
229
+ async dispose() {
230
+ // No persistent resources — each request is its own subprocess.
231
+ }
232
+ // -- internals -------------------------------------------------------------
233
+ defaultModel() {
234
+ return this.config.defaultModel ?? this.config.models?.[0] ?? EXTERNAL_CLI_DEFAULT_MODEL;
235
+ }
236
+ /**
237
+ * Child env with the declared keys removed (LOAD-BEARING — see file header).
238
+ * Static so tests can assert the strip without spawning anything.
239
+ */
240
+ static childEnv(stripEnv = [], base = process.env) {
241
+ const env = { ...base };
242
+ for (const key of stripEnv) {
243
+ delete env[key];
244
+ }
245
+ return env;
246
+ }
247
+ classifyError(message, model) {
248
+ const lower = message.toLowerCase();
249
+ if (lower.includes('rate limit') ||
250
+ lower.includes('usage limit') ||
251
+ lower.includes('429') ||
252
+ lower.includes('quota')) {
253
+ return createLLMError(message, 'RATE_LIMITED', {
254
+ provider: this.type,
255
+ model,
256
+ retryable: true,
257
+ retryAfterMs: 60_000,
258
+ });
259
+ }
260
+ return createLLMError(message, 'PROVIDER_UNAVAILABLE', {
261
+ provider: this.type,
262
+ model,
263
+ retryable: true,
264
+ });
265
+ }
266
+ spawnHost(extraArgs, stdin, timeoutMs) {
267
+ const [binary, ...baseArgs] = this.config.command;
268
+ const args = [...baseArgs, ...extraArgs];
269
+ return new Promise((resolve, reject) => {
270
+ const child = spawn(binary, args, {
271
+ env: ExternalCliProvider.childEnv(this.config.stripEnv),
272
+ stdio: ['pipe', 'pipe', 'pipe'],
273
+ });
274
+ let stdout = '';
275
+ let stderr = '';
276
+ let settled = false;
277
+ const timer = setTimeout(() => {
278
+ if (settled)
279
+ return;
280
+ settled = true;
281
+ child.kill('SIGKILL');
282
+ reject(createLLMError(`${this.type} timed out after ${timeoutMs}ms`, 'TIMEOUT', {
283
+ provider: this.type,
284
+ retryable: true,
285
+ }));
286
+ }, timeoutMs);
287
+ child.stdout.on('data', (d) => (stdout += d.toString()));
288
+ child.stderr.on('data', (d) => (stderr += d.toString()));
289
+ child.on('error', (err) => {
290
+ if (settled)
291
+ return;
292
+ settled = true;
293
+ clearTimeout(timer);
294
+ reject(createLLMError(`Failed to spawn "${binary}" for provider "${this.type}": ${err.message}`, 'PROVIDER_UNAVAILABLE', { provider: this.type, retryable: false, cause: err }));
295
+ });
296
+ child.on('close', (code) => {
297
+ if (settled)
298
+ return;
299
+ settled = true;
300
+ clearTimeout(timer);
301
+ resolve({ code: code ?? 0, stdout, stderr });
302
+ });
303
+ // EPIPE guard: a host that exits before reading stdin (e.g. not logged
304
+ // in) makes the write emit 'error' on the stdin stream. Without a
305
+ // listener Node throws an uncaught exception that kills the calling
306
+ // process. The close/error handlers above carry the real outcome.
307
+ child.stdin.on('error', () => {
308
+ /* swallow EPIPE — outcome reported via close/error */
309
+ });
310
+ try {
311
+ child.stdin.write(stdin);
312
+ child.stdin.end();
313
+ }
314
+ catch {
315
+ /* stream already torn down — process handlers report the failure */
316
+ }
317
+ });
318
+ }
319
+ /** Semaphore so we never spawn unbounded host subprocesses. */
320
+ async withConcurrency(fn) {
321
+ const limit = this.config.maxConcurrency ?? DEFAULT_EXTERNAL_CLI_CONCURRENCY;
322
+ if (this.active >= limit) {
323
+ await new Promise((resolve) => this.queue.push(resolve));
324
+ }
325
+ this.active++;
326
+ try {
327
+ return await fn();
328
+ }
329
+ finally {
330
+ this.active--;
331
+ const next = this.queue.shift();
332
+ if (next)
333
+ next();
334
+ }
335
+ }
336
+ }
337
+ // ============================================================================
338
+ // Helpers
339
+ // ============================================================================
340
+ /**
341
+ * Does this binary resolve to something executable, without running it?
342
+ * An absolute or explicitly-relative path is checked directly; a bare name is
343
+ * looked up across PATH the way the shell would.
344
+ */
345
+ export function resolvesOnPath(binary, env = process.env) {
346
+ const isExecutable = (candidate) => {
347
+ try {
348
+ accessSync(candidate, fsConstants.X_OK);
349
+ return statSync(candidate).isFile();
350
+ }
351
+ catch {
352
+ return false;
353
+ }
354
+ };
355
+ if (binary.includes('/') || binary.includes('\\')) {
356
+ return isExecutable(binary);
357
+ }
358
+ const entries = (env.PATH ?? '').split(delimiter).filter(Boolean);
359
+ // PATHEXT matters on Windows, where `my-host` is really `my-host.cmd`.
360
+ const extensions = process.platform === 'win32'
361
+ ? ['', ...(env.PATHEXT ?? '.COM;.EXE;.BAT;.CMD').split(';').filter(Boolean)]
362
+ : [''];
363
+ return entries.some((dir) => extensions.some((ext) => isExecutable(join(dir, binary + ext))));
364
+ }
365
+ /**
366
+ * Flatten messages into a single prompt. A generic CLI has no role protocol,
367
+ * so system content is hoisted into a preamble — the same strategy
368
+ * `codex.ts` uses and the reason `message-formatter` falls back to
369
+ * `'first-message'` for unknown providers.
370
+ */
371
+ export function flattenPrompt(input, systemPrompt) {
372
+ if (typeof input === 'string') {
373
+ return systemPrompt ? `${systemPrompt}\n\n${input}` : input;
374
+ }
375
+ const systemParts = input.filter((m) => m.role === 'system').map((m) => m.content);
376
+ if (systemPrompt)
377
+ systemParts.unshift(systemPrompt);
378
+ const convo = input
379
+ .filter((m) => m.role !== 'system')
380
+ .map((m) => `${m.role === 'assistant' ? 'Assistant' : 'User'}: ${m.content}`)
381
+ .join('\n\n');
382
+ const preamble = systemParts.length > 0 ? `${systemParts.join('\n\n')}\n\n` : '';
383
+ return `${preamble}${convo}`;
384
+ }
385
+ //# sourceMappingURL=external-cli.js.map
@@ -20,6 +20,20 @@
20
20
  import type { RouterConfig, ExtendedProviderType, AgentProviderOverride } from './types.js';
21
21
  /** Filename under .agentic-qe/ */
22
22
  export declare const ROUTER_CONFIG_FILENAME = "llm-config.json";
23
+ /**
24
+ * Can `ProviderManager.createProvider()` build this type? True for the
25
+ * built-in constructible set, and for any provider registered per ADR-127.
26
+ */
27
+ export declare function isRuntimeConstructible(provider: ExtendedProviderType): boolean;
28
+ /**
29
+ * Every provider type the router may legitimately be pointed at: the ones AQE
30
+ * ships plus the ones a downstream integrator registered (ADR-127).
31
+ *
32
+ * `ALL_PROVIDER_TYPES` deliberately stays frozen as "what AQE ships" — it is
33
+ * exported public API that consumers read — so validation paths call this
34
+ * instead of widening that constant at runtime.
35
+ */
36
+ export declare function allSelectableProviderTypes(): readonly ExtendedProviderType[];
23
37
  /**
24
38
  * Return the resolved config-file path for a project.
25
39
  * Caller may override projectRoot for tests; defaults to findProjectRoot().