agentic-qe 3.12.1 → 3.12.3

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 (373) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +87 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/cli/bundle.js +5 -5
  5. package/dist/cli/chunks/adapter-D657MKZY.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-P4VYM5KK.js → agent-booster-wasm-XFAQATTH.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-PBQ7L2TO.js → agent-handler-2ZV4CA3U.js} +2 -2
  8. package/dist/cli/chunks/{agent-memory-branch-UPWO3X6V.js → agent-memory-branch-6WGP7F5T.js} +2 -2
  9. package/dist/cli/chunks/aqe-learning-engine-AFR6OZJK.js +2 -0
  10. package/dist/cli/chunks/{arena-QYTP3FG6.js → arena-FWX7XZAE.js} +4 -4
  11. package/dist/cli/chunks/{arena-LEUTILZ7.js → arena-KJUNQK4N.js} +2 -2
  12. package/dist/cli/chunks/{audit-TB6M2YLK.js → audit-YFUDEOKN.js} +3 -3
  13. package/dist/cli/chunks/base-K5QRGZWE.js +2 -0
  14. package/dist/cli/chunks/{hnswlib-node-62RTSHAY.js → better-sqlite3-FE55OGYB.js} +2 -2
  15. package/dist/cli/chunks/brain-handler-ZCK4WTPK.js +89 -0
  16. package/dist/cli/chunks/{branch-enumerator-WEIP3DXB.js → branch-enumerator-HTVINRYG.js} +2 -2
  17. package/dist/cli/chunks/{browser-HY6VLXHZ.js → browser-WUL2B77M.js} +2 -2
  18. package/dist/cli/chunks/browser-workflow-ZMMKCGYW.js +2 -0
  19. package/dist/cli/chunks/{chunk-NHRBKOYD.js → chunk-2CPJCXV6.js} +2 -2
  20. package/dist/cli/chunks/{chunk-D72N5V2S.js → chunk-2HCMRGMO.js} +2 -2
  21. package/dist/cli/chunks/{chunk-UBPJQKYS.js → chunk-2LNDU7AW.js} +2 -2
  22. package/dist/cli/chunks/{chunk-ONSNNY6J.js → chunk-2OX74DOO.js} +1 -1
  23. package/dist/cli/chunks/{chunk-QORWBION.js → chunk-2YDZXFO2.js} +2 -2
  24. package/dist/cli/chunks/{chunk-QJXUK54J.js → chunk-32L7DKNQ.js} +2 -2
  25. package/dist/cli/chunks/{chunk-UZXDYT6O.js → chunk-3YC4YUGB.js} +2 -2
  26. package/dist/cli/chunks/{chunk-NOCPO55P.js → chunk-4EHW4TNA.js} +2 -2
  27. package/dist/cli/chunks/{chunk-QZBPXJ5C.js → chunk-4HP7N6SP.js} +2 -2
  28. package/dist/cli/chunks/{chunk-XTAXSKPC.js → chunk-5FAWIIWF.js} +2 -2
  29. package/dist/cli/chunks/{chunk-YGB3MT3R.js → chunk-67BCEHU5.js} +1 -1
  30. package/dist/cli/chunks/{chunk-3W2FZXFD.js → chunk-6E47R27C.js} +1 -1
  31. package/dist/cli/chunks/{chunk-74VIADSJ.js → chunk-6HQDPDN5.js} +2 -2
  32. package/dist/cli/chunks/chunk-6SQ72FG7.js +2 -0
  33. package/dist/cli/chunks/{chunk-RJ7TU2MP.js → chunk-6SUSRXXF.js} +1 -1
  34. package/dist/cli/chunks/{chunk-FFSS3Y6W.js → chunk-72QQDR3Y.js} +2 -2
  35. package/dist/cli/chunks/{chunk-CP4GSICY.js → chunk-7Q74K3HZ.js} +1 -1
  36. package/dist/cli/chunks/{chunk-UEC53US3.js → chunk-7WF3TW3G.js} +4 -4
  37. package/dist/cli/chunks/chunk-7XUM4LBC.js +2 -0
  38. package/dist/cli/chunks/{chunk-UGPBL7LX.js → chunk-ADQFQBFJ.js} +2 -2
  39. package/dist/cli/chunks/{chunk-BALFQQB7.js → chunk-AIWRYWK2.js} +2 -2
  40. package/dist/cli/chunks/{chunk-XJTGLG7G.js → chunk-AZ24ONMX.js} +1 -1
  41. package/dist/cli/chunks/{chunk-LRWBOJ5Y.js → chunk-BDGKB2PT.js} +2 -2
  42. package/dist/cli/chunks/{chunk-NK2Z6FGF.js → chunk-BEPP57C2.js} +2 -2
  43. package/dist/cli/chunks/{chunk-HGKSU4QV.js → chunk-BQ2K4BPD.js} +2 -2
  44. package/dist/cli/chunks/{chunk-QOAI6ETC.js → chunk-BSNNTOHY.js} +3 -3
  45. package/dist/cli/chunks/chunk-CHFTHSMM.js +9 -0
  46. package/dist/cli/chunks/{chunk-IHWWZOHP.js → chunk-CL6SNCFF.js} +1 -1
  47. package/dist/cli/chunks/{chunk-7N2SCRWJ.js → chunk-CXMOIE7D.js} +2 -2
  48. package/dist/cli/chunks/{chunk-PZ3Q34OT.js → chunk-CYSBM52D.js} +2 -2
  49. package/dist/cli/chunks/{chunk-X2CEX4KC.js → chunk-D4GMAUTP.js} +10 -10
  50. package/dist/cli/chunks/{chunk-JDZIBSMY.js → chunk-DCYBV6HV.js} +1 -1
  51. package/dist/cli/chunks/chunk-DDYP6FBC.js +2 -0
  52. package/dist/cli/chunks/{chunk-SFQFBLWQ.js → chunk-DHUZHT5D.js} +1 -1
  53. package/dist/cli/chunks/{chunk-X2K3BTI4.js → chunk-DMD6WVJ2.js} +2 -2
  54. package/dist/cli/chunks/{chunk-GW3M7GQH.js → chunk-DTZFZ5M7.js} +2 -2
  55. package/dist/cli/chunks/{chunk-WBDV4V3H.js → chunk-DW7OI5IF.js} +2 -2
  56. package/dist/cli/chunks/{chunk-CYYT6YEV.js → chunk-DZ775UGW.js} +2 -2
  57. package/dist/cli/chunks/{chunk-BNMV5DCM.js → chunk-E2U3LTGM.js} +1 -1
  58. package/dist/cli/chunks/{chunk-KQV5644J.js → chunk-E53UR2EW.js} +3 -3
  59. package/dist/cli/chunks/{chunk-XYV6YUWS.js → chunk-EH7TSJPS.js} +2 -2
  60. package/dist/cli/chunks/{chunk-42GFB7VX.js → chunk-EHO52NKU.js} +2 -2
  61. package/dist/cli/chunks/{chunk-75AVUS5U.js → chunk-EOUJ6X5H.js} +1 -1
  62. package/dist/cli/chunks/{chunk-ZNITDSWL.js → chunk-FHHCH7WL.js} +1 -1
  63. package/dist/cli/chunks/{chunk-PQ4NSXZM.js → chunk-FJACKKRL.js} +2 -2
  64. package/dist/cli/chunks/{chunk-45QNHMTP.js → chunk-FTM562PF.js} +1 -1
  65. package/dist/cli/chunks/{chunk-4KI72C2E.js → chunk-FXOOOJQD.js} +1 -1
  66. package/dist/cli/chunks/chunk-G5OGKVLO.js +2 -0
  67. package/dist/cli/chunks/{chunk-42PYEEYQ.js → chunk-GGTCD4MA.js} +1 -1
  68. package/dist/cli/chunks/{chunk-GASACVTU.js → chunk-GMFFMJD6.js} +2 -2
  69. package/dist/cli/chunks/{chunk-JRNDFC23.js → chunk-GS6G7AVS.js} +2 -2
  70. package/dist/cli/chunks/{chunk-BKKJEKNT.js → chunk-GV2BS5NC.js} +2 -2
  71. package/dist/cli/chunks/{chunk-JRHRC2MP.js → chunk-HGJQSTQD.js} +1 -1
  72. package/dist/cli/chunks/{chunk-M5P5WNXA.js → chunk-HJ2LG5IH.js} +1 -1
  73. package/dist/cli/chunks/{chunk-UR655D4K.js → chunk-HJ4U64BL.js} +2 -2
  74. package/dist/cli/chunks/chunk-ILRKO6A5.js +43 -0
  75. package/dist/cli/chunks/{chunk-LZ6TJ7XL.js → chunk-IWQHQLT6.js} +2 -2
  76. package/dist/cli/chunks/{chunk-SHKOPOPD.js → chunk-J2RJOJ5Q.js} +1 -1
  77. package/dist/cli/chunks/{chunk-JIM4VSLF.js → chunk-KA4EAMMQ.js} +3 -3
  78. package/dist/cli/chunks/{chunk-6432JORM.js → chunk-KE3RK35K.js} +1 -1
  79. package/dist/cli/chunks/{chunk-VTFYY4SH.js → chunk-KGHSKDC7.js} +2 -2
  80. package/dist/cli/chunks/{chunk-3I3Z4C5X.js → chunk-KKOFH26C.js} +1 -1
  81. package/dist/cli/chunks/{chunk-AGWKCY42.js → chunk-KNWBRMLL.js} +2 -2
  82. package/dist/cli/chunks/{chunk-C7HGYLNF.js → chunk-KRS4KGX5.js} +2 -2
  83. package/dist/cli/chunks/{chunk-VHJCQBD2.js → chunk-KVHCWH4H.js} +2 -2
  84. package/dist/cli/chunks/{chunk-N3PSRG6F.js → chunk-KXKACV3E.js} +2 -2
  85. package/dist/cli/chunks/{chunk-BLU7OLQZ.js → chunk-L2X3BWMN.js} +2 -2
  86. package/dist/cli/chunks/{chunk-4U5MJX2H.js → chunk-L6GZGEFQ.js} +2 -2
  87. package/dist/cli/chunks/{chunk-DSNFOX22.js → chunk-LCM7TY76.js} +2 -2
  88. package/dist/cli/chunks/{chunk-NVXSM7UO.js → chunk-LGYEOYQJ.js} +2 -2
  89. package/dist/cli/chunks/{chunk-J4IAMQZI.js → chunk-LHAUFY4Y.js} +2 -2
  90. package/dist/cli/chunks/{chunk-OJORNYN3.js → chunk-LNIHLNW4.js} +3 -3
  91. package/dist/cli/chunks/{chunk-PRA73XZY.js → chunk-M32DTUZM.js} +2 -2
  92. package/dist/cli/chunks/{chunk-GGF5FZWS.js → chunk-M7W6VJ65.js} +1 -1
  93. package/dist/cli/chunks/{chunk-HZGFER4N.js → chunk-MB7TZQW3.js} +3 -3
  94. package/dist/cli/chunks/{chunk-RIASOMB2.js → chunk-MOX25RZQ.js} +2 -2
  95. package/dist/cli/chunks/{chunk-BPM7NEHS.js → chunk-MOXKKY5Q.js} +6 -6
  96. package/dist/cli/chunks/{chunk-UKF4V7LE.js → chunk-MS6VOSPY.js} +5 -5
  97. package/dist/cli/chunks/{chunk-QXZOUETY.js → chunk-MSDIIRLM.js} +2 -2
  98. package/dist/cli/chunks/{chunk-BBNQDHGF.js → chunk-MZ7SIO6R.js} +2 -2
  99. package/dist/cli/chunks/{chunk-HDI3FD4G.js → chunk-N4ML23ZG.js} +1 -1
  100. package/dist/cli/chunks/{chunk-7KHIOWBN.js → chunk-NAMJGRGC.js} +1 -1
  101. package/dist/cli/chunks/{chunk-IE6FDICX.js → chunk-NJDLJ3KD.js} +2 -2
  102. package/dist/cli/chunks/{chunk-4LKQZW2H.js → chunk-NKTLKMUB.js} +1 -1
  103. package/dist/cli/chunks/{chunk-CXUHD2O5.js → chunk-NLDLUHOF.js} +2 -2
  104. package/dist/cli/chunks/{chunk-XDRAU3W6.js → chunk-NOSQI2OW.js} +2 -2
  105. package/dist/cli/chunks/{chunk-ZCDGLNJ7.js → chunk-NT66CT73.js} +2 -2
  106. package/dist/cli/chunks/{chunk-JWZNWVLG.js → chunk-NX522PRH.js} +2 -2
  107. package/dist/cli/chunks/{chunk-O65OPAZH.js → chunk-OBL6W4Z5.js} +2 -2
  108. package/dist/cli/chunks/chunk-OPG2HV2W.js +2 -0
  109. package/dist/cli/chunks/{chunk-BCBITOMT.js → chunk-PDX7IYTJ.js} +2 -2
  110. package/dist/cli/chunks/{chunk-IC6SOVGO.js → chunk-PEHEANAM.js} +2 -2
  111. package/dist/cli/chunks/{chunk-J6ZCULWG.js → chunk-PPUDKQ4X.js} +2 -2
  112. package/dist/cli/chunks/{chunk-WPEGG6DX.js → chunk-PSDH7CIL.js} +1 -1
  113. package/dist/cli/chunks/{chunk-NTMN2ZJY.js → chunk-PTPN6HQ7.js} +2 -2
  114. package/dist/cli/chunks/{chunk-C2K4LQI5.js → chunk-PXCJDB7J.js} +1 -1
  115. package/dist/cli/chunks/{chunk-WPG5LXR7.js → chunk-QILF6BZH.js} +2 -2
  116. package/dist/cli/chunks/{chunk-BAHXVVX3.js → chunk-R6WMGSEK.js} +2 -2
  117. package/dist/cli/chunks/{chunk-2PQ7YADF.js → chunk-RE42RJYR.js} +2 -2
  118. package/dist/cli/chunks/{chunk-BWNMAXV7.js → chunk-RLBNAB6Y.js} +1 -1
  119. package/dist/cli/chunks/{chunk-BXIJY6SB.js → chunk-ROFCS47F.js} +1 -1
  120. package/dist/cli/chunks/{chunk-7KK6XSYK.js → chunk-RSZOCQOL.js} +2 -2
  121. package/dist/cli/chunks/{chunk-NEXJUTHF.js → chunk-S47YGWXK.js} +2 -2
  122. package/dist/cli/chunks/{chunk-5H5A74U2.js → chunk-SFS3UHNF.js} +1 -1
  123. package/dist/cli/chunks/{chunk-U5ITD7ZD.js → chunk-SGMJ277D.js} +1 -1
  124. package/dist/cli/chunks/{chunk-OXVAGR64.js → chunk-SPI4LUJ6.js} +2 -2
  125. package/dist/cli/chunks/{chunk-FBYFDD7L.js → chunk-SV7J5FDW.js} +2 -2
  126. package/dist/cli/chunks/{chunk-S42RFOZJ.js → chunk-TP3UAWMB.js} +2 -2
  127. package/dist/cli/chunks/{chunk-OEXSBR72.js → chunk-TXLPOXAN.js} +1 -1
  128. package/dist/cli/chunks/{chunk-R4A6PY5D.js → chunk-UAPUA6OY.js} +2 -2
  129. package/dist/cli/chunks/{chunk-55MQ2SFP.js → chunk-UGW23T6S.js} +2 -2
  130. package/dist/cli/chunks/{chunk-774X6OJY.js → chunk-UGXHMQ6P.js} +2 -2
  131. package/dist/cli/chunks/{chunk-GLO53MUQ.js → chunk-UIHZ34SJ.js} +2 -2
  132. package/dist/cli/chunks/{chunk-TMPRR3FZ.js → chunk-ULQCEM7K.js} +2 -2
  133. package/dist/cli/chunks/{chunk-YNXQMJGJ.js → chunk-UZ7FXVH5.js} +1 -1
  134. package/dist/cli/chunks/{chunk-LAJHHR3Q.js → chunk-VFYMWDSJ.js} +1 -1
  135. package/dist/cli/chunks/{chunk-XS6BIOPQ.js → chunk-VSD6JE2H.js} +2 -2
  136. package/dist/cli/chunks/{chunk-MIAY35K6.js → chunk-VUCVSKJC.js} +2 -2
  137. package/dist/cli/chunks/{chunk-I4BZLVFE.js → chunk-WBZNLFTV.js} +3 -3
  138. package/dist/cli/chunks/{chunk-PDS5P5QD.js → chunk-WFPGIP4N.js} +2 -2
  139. package/dist/cli/chunks/{chunk-PZZDAECU.js → chunk-WKE6WL5C.js} +3 -3
  140. package/dist/cli/chunks/{chunk-VFRWLSQO.js → chunk-WQASUQ5P.js} +1 -1
  141. package/dist/cli/chunks/{chunk-GXMNCW2M.js → chunk-WUE53ZPH.js} +1 -1
  142. package/dist/cli/chunks/{chunk-UBWSYDO5.js → chunk-XBOCRCC6.js} +1 -1
  143. package/dist/cli/chunks/{chunk-HHMTQQUE.js → chunk-XDHGCBTS.js} +2 -2
  144. package/dist/cli/chunks/chunk-XQ5JT7KM.js +3 -0
  145. package/dist/cli/chunks/{chunk-USTUWUCE.js → chunk-XUUVAAHV.js} +2 -2
  146. package/dist/cli/chunks/{chunk-6RX5QZMU.js → chunk-XZGOXLZH.js} +1 -1
  147. package/dist/cli/chunks/{chunk-DQ3J7ZT6.js → chunk-Y5L37K7X.js} +2 -2
  148. package/dist/cli/chunks/{chunk-5HMGDB7B.js → chunk-Y625LP6K.js} +3 -3
  149. package/dist/cli/chunks/{chunk-REJGZP27.js → chunk-Y6XNISHP.js} +2 -2
  150. package/dist/cli/chunks/{chunk-LF5XOYR7.js → chunk-YDYKFSD2.js} +11 -11
  151. package/dist/cli/chunks/{chunk-U55X2ZUM.js → chunk-YEC55GO5.js} +2 -2
  152. package/dist/cli/chunks/{chunk-6ONUCDVL.js → chunk-YOG5KQZF.js} +2 -2
  153. package/dist/cli/chunks/{chunk-6BCVKCG5.js → chunk-YUDGQZJN.js} +2 -2
  154. package/dist/cli/chunks/{chunk-EOBZJDJR.js → chunk-Z3SXMYVI.js} +3 -3
  155. package/dist/cli/chunks/chunk-ZFLE4D4X.js +18 -0
  156. package/dist/cli/chunks/{chunk-W52R3G22.js → chunk-ZGKQCUPB.js} +2 -2
  157. package/dist/cli/chunks/{chunk-MCUILJ33.js → chunk-ZTKCGEB6.js} +1 -1
  158. package/dist/cli/chunks/{ci-IU5HVUL5.js → ci-MMLUV6L6.js} +2 -2
  159. package/dist/cli/chunks/{ci-output-CLI4A43F.js → ci-output-25GS6RXR.js} +2 -2
  160. package/dist/cli/chunks/{circuit-breaker-ZR5OFMW7.js → circuit-breaker-4OWAN6R6.js} +2 -2
  161. package/dist/cli/chunks/{claude-flow-setup-UBMA6ZHJ.js → claude-flow-setup-LR3SRBX6.js} +2 -2
  162. package/dist/cli/chunks/client-WI7RRUZO.js +2 -0
  163. package/dist/cli/chunks/{cline-installer-EWYELOBI.js → cline-installer-YSZWRZUI.js} +2 -2
  164. package/dist/cli/chunks/{code-YSPF4MXN.js → code-UUWUIXI7.js} +2 -2
  165. package/dist/cli/chunks/{code-index-extractor-WW5OKSTN.js → code-index-extractor-2LSPQORU.js} +2 -2
  166. package/dist/cli/chunks/{codex-installer-GLADK5PY.js → codex-installer-E5BVXZVA.js} +2 -2
  167. package/dist/cli/chunks/{completions-2KTWZ3AK.js → completions-YKXBKZSO.js} +2 -2
  168. package/dist/cli/chunks/{complexity-analyzer-KMX4OWKB.js → complexity-analyzer-HNT2QRWB.js} +2 -2
  169. package/dist/cli/chunks/{continuedev-installer-4FHU4OEJ.js → continuedev-installer-AW5VCB66.js} +2 -2
  170. package/dist/cli/chunks/{copilot-installer-AKR4WE7B.js → copilot-installer-B6SVZXQT.js} +2 -2
  171. package/dist/cli/chunks/core-handlers-T6URR57V.js +2 -0
  172. package/dist/cli/chunks/{cost-tracker-BUJ6WEWY.js → cost-tracker-POZMBN2V.js} +2 -2
  173. package/dist/cli/chunks/{coverage-OB6HVQS4.js → coverage-V5BGPN5Q.js} +3 -3
  174. package/dist/cli/chunks/cross-domain-router-WHTTKHWM.js +2 -0
  175. package/dist/cli/chunks/{cursor-installer-3AOE4O3Q.js → cursor-installer-EYBI4QVK.js} +2 -2
  176. package/dist/cli/chunks/{daemon-4RAL5URG.js → daemon-CF6ENQB2.js} +3 -3
  177. package/dist/cli/chunks/{daemon-JGSPLYGO.js → daemon-HKARXY2W.js} +4 -4
  178. package/dist/cli/chunks/{dag-attention-scheduler-DSBTHIMH.js → dag-attention-scheduler-XIL5IAP7.js} +2 -2
  179. package/dist/cli/chunks/{detect-6CVW2VUQ.js → detect-RRX2U2KK.js} +2 -2
  180. package/dist/cli/chunks/{dist-node-EWPKBTYA.js → dist-node-DOANNRCS.js} +2 -2
  181. package/dist/cli/chunks/{domain-handler-HLVIJU25.js → domain-handler-QMTJV5OR.js} +2 -2
  182. package/dist/cli/chunks/{domain-transfer-7Y3BR3YU.js → domain-transfer-FSNH75XW.js} +2 -2
  183. package/dist/cli/chunks/dream-QUL6SURC.js +2 -0
  184. package/dist/cli/chunks/{embed-and-insert-pattern-ZMJ3263X.js → embed-and-insert-pattern-NI7PGONV.js} +2 -2
  185. package/dist/cli/chunks/eval-6ZAF2RY3.js +17 -0
  186. package/dist/cli/chunks/{experience-capture-middleware-OGJ3JOSQ.js → experience-capture-middleware-JMXR7N5G.js} +3 -3
  187. package/dist/cli/chunks/{fast-paths-5XCY3Y6U.js → fast-paths-YB7XZZ76.js} +2 -2
  188. package/dist/cli/chunks/{feature-flags-R5V2FRJR.js → feature-flags-2RC4GFC4.js} +2 -2
  189. package/dist/cli/chunks/{feature-flags-VULQI6KY.js → feature-flags-KJSP7KR6.js} +2 -2
  190. package/dist/cli/chunks/{file-discovery-HW33C3HC.js → file-discovery-SUPBXFYI.js} +2 -2
  191. package/dist/cli/chunks/{fleet-NH3XR5OY.js → fleet-KSXFOLFW.js} +3 -3
  192. package/dist/cli/chunks/{gnn-wrapper-L3XMLPTG.js → gnn-wrapper-DFZ5KPPK.js} +2 -2
  193. package/dist/cli/chunks/{heartbeat-handler-TIQFBT4D.js → heartbeat-handler-G3EADK2H.js} +4 -4
  194. package/dist/cli/chunks/heartbeat-scheduler-VZNKE33K.js +2 -0
  195. package/dist/cli/chunks/hnsw-adapter-LGWLDZLC.js +2 -0
  196. package/dist/cli/chunks/hnsw-index-66FOOI7U.js +2 -0
  197. package/dist/cli/chunks/{hnsw-legacy-bridge-YL2SUIPA.js → hnsw-legacy-bridge-MA676GER.js} +2 -2
  198. package/dist/cli/chunks/{better-sqlite3-IPKCAVLS.js → hnswlib-node-SKTT5KIH.js} +2 -2
  199. package/dist/cli/chunks/{hooks-UR2ZF54G.js → hooks-HTCPMZNZ.js} +10 -10
  200. package/dist/cli/chunks/hybrid-router-I5MEVQDF.js +2 -0
  201. package/dist/cli/chunks/{hypergraph-engine-NX45AOPY.js → hypergraph-engine-QPB3IH4A.js} +2 -2
  202. package/dist/cli/chunks/{hypergraph-handler-LUM4YI4K.js → hypergraph-handler-GBFSVD7N.js} +3 -3
  203. package/dist/cli/chunks/impact-analyzer-K6ANYIY3.js +2 -0
  204. package/dist/cli/chunks/{init-handler-YTKKNTVV.js → init-handler-XYBTBCPD.js} +6 -6
  205. package/dist/cli/chunks/init-wizard-URHGXJ32.js +2 -0
  206. package/dist/cli/chunks/kernel-OKI5ZY5P.js +2 -0
  207. package/dist/cli/chunks/{kilocode-installer-ZW7DVH7T.js → kilocode-installer-LY6JOBFY.js} +2 -2
  208. package/dist/cli/chunks/{kiro-installer-IA7INW4N.js → kiro-installer-JF6NXTJL.js} +2 -2
  209. package/dist/cli/chunks/knowledge-graph-VQQSK7T5.js +2 -0
  210. package/dist/cli/chunks/{learning-4AZ5PGTT.js → learning-BIISN67N.js} +3 -3
  211. package/dist/cli/chunks/{llm-router-WQ4E3AOP.js → llm-router-YZUNVZQE.js} +5 -5
  212. package/dist/cli/chunks/llm-router-service-TISH33SY.js +2 -0
  213. package/dist/cli/chunks/{load-4FAH7CZO.js → load-MTWNBNLL.js} +2 -2
  214. package/dist/cli/chunks/load-test-KWKWC4Q7.js +2 -0
  215. package/dist/cli/chunks/{mcp-KLLHI6DG.js → mcp-37PYMNHQ.js} +2 -2
  216. package/dist/cli/chunks/{memory-Q5HLIUC6.js → memory-IXUUDCI3.js} +5 -5
  217. package/dist/cli/chunks/memory-backend-JSQQMXVS.js +2 -0
  218. package/dist/cli/chunks/memory-handlers-RM2VOFJX.js +2 -0
  219. package/dist/cli/chunks/{multi-model-executor-ABI73AFV.js → multi-model-executor-RKKS5XYG.js} +2 -2
  220. package/dist/cli/chunks/{opencode-installer-KRPQ6JOJ.js → opencode-installer-3VXI5MTR.js} +2 -2
  221. package/dist/cli/chunks/{orchestrator-SUPEONRG.js → orchestrator-UO3ZOGFZ.js} +5 -5
  222. package/dist/cli/chunks/pattern-null-store-SXBIUKE5.js +2 -0
  223. package/dist/cli/chunks/{pattern-usage-recorder-R4GKK6RZ.js → pattern-usage-recorder-YJKRL2GI.js} +2 -2
  224. package/dist/cli/chunks/{pipeline-LCUETNGD.js → pipeline-GJQJKXWX.js} +2 -2
  225. package/dist/cli/chunks/{platform-WJDIB4X3.js → platform-RHVCZK6C.js} +2 -2
  226. package/dist/cli/chunks/{plugin-2X5NY2RF.js → plugin-ZKAIW7O6.js} +2 -2
  227. package/dist/cli/chunks/{prime-radiant-advanced-wasm-3T665QC6.js → prime-radiant-advanced-wasm-4X3DSKQV.js} +2 -2
  228. package/dist/cli/chunks/protocol-executor-D3Q5P3WY.js +2 -0
  229. package/dist/cli/chunks/{protocol-handler-JTXRF7GU.js → protocol-handler-KKYQZMB2.js} +2 -2
  230. package/dist/cli/chunks/{prove-BFPWWPOC.js → prove-OD6RPKWX.js} +2 -2
  231. package/dist/cli/chunks/provider-manager-2EIX7E5Q.js +2 -0
  232. package/dist/cli/chunks/qe-reasoning-bank-ITOW2ZHC.js +2 -0
  233. package/dist/cli/chunks/{quality-F7UZU4RN.js → quality-ZRWBXCKO.js} +2 -2
  234. package/dist/cli/chunks/{quality-gate-R5L4UZIX.js → quality-gate-Y6BWQV7J.js} +3 -3
  235. package/dist/cli/chunks/queen-coordinator-TO5X2EXL.js +2 -0
  236. package/dist/cli/chunks/{real-embeddings-LZD6HTQF.js → real-embeddings-YYEUO4P2.js} +2 -2
  237. package/dist/cli/chunks/{roocode-installer-6TTG7VSH.js → roocode-installer-JBCPS3FK.js} +2 -2
  238. package/dist/cli/chunks/router-GZJQEJU3.js +2 -0
  239. package/dist/cli/chunks/routing-feedback-CRXSKFNS.js +2 -0
  240. package/dist/cli/chunks/{routing-handler-SW442GK7.js → routing-handler-KTPJOSBJ.js} +2 -2
  241. package/dist/cli/chunks/{ruvector-commands-CLFGKXMW.js → ruvector-commands-SCZZVRE7.js} +2 -2
  242. package/dist/cli/chunks/{rvf-dual-writer-EVPPXXXS.js → rvf-dual-writer-IP7GELQJ.js} +2 -2
  243. package/dist/cli/chunks/{rvf-migration-adapter-NOHDIRIP.js → rvf-migration-adapter-WLFTDARU.js} +2 -2
  244. package/dist/cli/chunks/{rvf-migration-coordinator-BYJ3M7WZ.js → rvf-migration-coordinator-MGFDQ5WD.js} +2 -2
  245. package/dist/cli/chunks/rvf-native-adapter-WHADT5HX.js +2 -0
  246. package/dist/cli/chunks/rvf-store-integrity-OTOAGT5W.js +2 -0
  247. package/dist/cli/chunks/safe-db-MIZ2OFWC.js +2 -0
  248. package/dist/cli/chunks/schedule-XFILYTYC.js +2 -0
  249. package/dist/cli/chunks/scheduler-EIPJ777A.js +2 -0
  250. package/dist/cli/chunks/{security-IXDKBPSG.js → security-B2CLZKRB.js} +3 -3
  251. package/dist/cli/chunks/shared-rvf-adapter-2PMFAQMN.js +2 -0
  252. package/dist/cli/chunks/{shared-rvf-dual-writer-FFKBKYNL.js → shared-rvf-dual-writer-B6P732AV.js} +2 -2
  253. package/dist/cli/chunks/sqlite-persistence-PFU3GSRD.js +2 -0
  254. package/dist/cli/chunks/status-handler-M6SN2W2D.js +47 -0
  255. package/dist/cli/chunks/{structural-health-55X6BTLT.js → structural-health-YCCTGI3K.js} +2 -2
  256. package/dist/cli/chunks/{sync-BUGDXW3Y.js → sync-3SDMVAIU.js} +2 -2
  257. package/dist/cli/chunks/{sync-NUG67HGK.js → sync-KSRF77ID.js} +2 -2
  258. package/dist/cli/chunks/{task-handler-T6ZKXV4S.js → task-handler-MIKRB2SL.js} +2 -2
  259. package/dist/cli/chunks/{task-handlers-H63TB2UI.js → task-handlers-YXKRUBQ4.js} +3 -3
  260. package/dist/cli/chunks/{test-VEK76SBT.js → test-MLOLQCB7.js} +4 -4
  261. package/dist/cli/chunks/{test-scheduling-QZM6PNZH.js → test-scheduling-3KXESUZS.js} +3 -3
  262. package/dist/cli/chunks/token-bootstrap-6V2PMDBJ.js +2 -0
  263. package/dist/cli/chunks/{token-usage-OBY6UEUR.js → token-usage-DP6THJ3I.js} +2 -2
  264. package/dist/cli/chunks/{transformers-EFNY2MRX.js → transformers-QFOBOP2Y.js} +2 -2
  265. package/dist/cli/chunks/{tree-sitter-wasm-parser-EU2S5NVM.js → tree-sitter-wasm-parser-COK2XERS.js} +2 -2
  266. package/dist/cli/chunks/{types-3DYRKX23.js → types-PYHUCVOZ.js} +2 -2
  267. package/dist/cli/chunks/unified-memory-OUVCMFGK.js +2 -0
  268. package/dist/cli/chunks/unified-memory-hnsw-YGQPOHXB.js +2 -0
  269. package/dist/cli/chunks/unified-persistence-GFRZVDOW.js +2 -0
  270. package/dist/cli/chunks/{upgrade-H5V53FRF.js → upgrade-ONP2HNGL.js} +2 -2
  271. package/dist/cli/chunks/{validate-IL22VB5I.js → validate-NWSICDAY.js} +2 -2
  272. package/dist/cli/chunks/{validate-swarm-WZKECK3W.js → validate-swarm-KXS5P3U7.js} +2 -2
  273. package/dist/cli/chunks/{vibium-KKM23OTQ.js → vibium-TZSGZRCQ.js} +2 -2
  274. package/dist/cli/chunks/visual-security-LVOOYQ64.js +2 -0
  275. package/dist/cli/chunks/{web-tree-sitter-NJM5YBOY.js → web-tree-sitter-V2FADNRA.js} +2 -2
  276. package/dist/cli/chunks/{windsurf-installer-SLP43TVT.js → windsurf-installer-GQM7KWDC.js} +2 -2
  277. package/dist/cli/chunks/{witness-chain-XBEPT4XD.js → witness-chain-GTITDIA2.js} +2 -2
  278. package/dist/cli/chunks/witness-chain-QNFPV4UL.js +2 -0
  279. package/dist/cli/chunks/{witness-key-manager-DAAMNYOW.js → witness-key-manager-AHRM2M52.js} +2 -2
  280. package/dist/cli/chunks/{workflow-SZOOU6D3.js → workflow-XCGHEL3I.js} +4 -4
  281. package/dist/cli/chunks/workflow-orchestrator-MIVBCALG.js +2 -0
  282. package/dist/cli/chunks/{wrappers-I2CBKWGF.js → wrappers-VGO2GO4J.js} +2 -2
  283. package/dist/cli/commands/eval.js +73 -3
  284. package/dist/cli/commands/llm-router.js +2 -0
  285. package/dist/cli/handlers/status-handler.d.ts +5 -0
  286. package/dist/cli/handlers/status-handler.js +35 -0
  287. package/dist/coordination/consensus/providers/index.js +11 -0
  288. package/dist/integrations/ruvector/brain-rvf-exporter.js +115 -13
  289. package/dist/integrations/ruvector/rvf-dual-writer.js +20 -3
  290. package/dist/integrations/ruvector/rvf-store-integrity.d.ts +49 -0
  291. package/dist/integrations/ruvector/rvf-store-integrity.js +137 -0
  292. package/dist/integrations/ruvector/shared-rvf-adapter.js +23 -5
  293. package/dist/learning/pattern-store.js +23 -5
  294. package/dist/learning/qe-flywheel/platform-signer.d.ts +32 -0
  295. package/dist/learning/qe-flywheel/platform-signer.js +60 -0
  296. package/dist/learning/qe-flywheel/receipt.js +9 -2
  297. package/dist/mcp/bundle.js +425 -406
  298. package/dist/shared/llm/billing-modes.d.ts +24 -0
  299. package/dist/shared/llm/billing-modes.js +56 -0
  300. package/dist/shared/llm/cost-tracker.js +2 -0
  301. package/dist/shared/llm/interfaces.d.ts +61 -3
  302. package/dist/shared/llm/provider-manager.d.ts +34 -0
  303. package/dist/shared/llm/provider-manager.js +152 -3
  304. package/dist/shared/llm/providers/claude-code.d.ts +57 -0
  305. package/dist/shared/llm/providers/claude-code.js +312 -0
  306. package/dist/shared/llm/providers/cognitum.d.ts +64 -0
  307. package/dist/shared/llm/providers/cognitum.js +369 -0
  308. package/dist/shared/llm/providers/index.d.ts +2 -0
  309. package/dist/shared/llm/providers/index.js +2 -0
  310. package/dist/shared/llm/router/config-store.d.ts +31 -11
  311. package/dist/shared/llm/router/config-store.js +82 -12
  312. package/dist/shared/llm/router/hybrid-router.js +16 -0
  313. package/dist/shared/llm/router/types.js +7 -0
  314. package/dist/shared/llm/spend-ledger.d.ts +64 -0
  315. package/dist/shared/llm/spend-ledger.js +115 -0
  316. package/dist/shared/llm/translation/message-formatter.js +2 -0
  317. package/dist/shared/llm/translation/prompt-translator.js +2 -0
  318. package/dist/shared/llm/translation/tool-translator.js +2 -0
  319. package/dist/validation/index.d.ts +1 -0
  320. package/dist/validation/index.js +2 -0
  321. package/dist/validation/provider-llm-executor.d.ts +45 -0
  322. package/dist/validation/provider-llm-executor.js +98 -0
  323. package/package.json +2 -2
  324. package/dist/cli/chunks/adapter-X4UEC6UJ.js +0 -2
  325. package/dist/cli/chunks/aqe-learning-engine-5FG7JCY7.js +0 -2
  326. package/dist/cli/chunks/base-CWPMFSZG.js +0 -2
  327. package/dist/cli/chunks/brain-handler-JF3OK35F.js +0 -89
  328. package/dist/cli/chunks/browser-workflow-A77OFBVY.js +0 -2
  329. package/dist/cli/chunks/chunk-CDVKFAYP.js +0 -18
  330. package/dist/cli/chunks/chunk-CJTXZI37.js +0 -2
  331. package/dist/cli/chunks/chunk-FNMEVLSN.js +0 -2
  332. package/dist/cli/chunks/chunk-P7G5LGUE.js +0 -3
  333. package/dist/cli/chunks/chunk-R7XEACKR.js +0 -2
  334. package/dist/cli/chunks/chunk-RAS7WRN5.js +0 -24
  335. package/dist/cli/chunks/chunk-TGIKKD43.js +0 -9
  336. package/dist/cli/chunks/client-KKCFGD7R.js +0 -2
  337. package/dist/cli/chunks/core-handlers-KRSSJEO5.js +0 -2
  338. package/dist/cli/chunks/cross-domain-router-27QGWU27.js +0 -2
  339. package/dist/cli/chunks/dream-M6K47Q4H.js +0 -2
  340. package/dist/cli/chunks/eval-73XW2WJD.js +0 -15
  341. package/dist/cli/chunks/heartbeat-scheduler-URXBF5RW.js +0 -2
  342. package/dist/cli/chunks/hnsw-adapter-WWAGM6HK.js +0 -2
  343. package/dist/cli/chunks/hnsw-index-UFV2HSZE.js +0 -2
  344. package/dist/cli/chunks/hybrid-router-3U6Q6OTL.js +0 -2
  345. package/dist/cli/chunks/impact-analyzer-EUEX6ZRO.js +0 -2
  346. package/dist/cli/chunks/init-wizard-POKY2LRY.js +0 -2
  347. package/dist/cli/chunks/kernel-HPAONLZY.js +0 -2
  348. package/dist/cli/chunks/knowledge-graph-2WCUFG63.js +0 -2
  349. package/dist/cli/chunks/llm-router-service-D5VMG6SD.js +0 -2
  350. package/dist/cli/chunks/load-test-DHG26REU.js +0 -2
  351. package/dist/cli/chunks/memory-backend-GLWQ4DAL.js +0 -2
  352. package/dist/cli/chunks/memory-handlers-P72I4VV4.js +0 -2
  353. package/dist/cli/chunks/pattern-null-store-Y2YFTE3V.js +0 -2
  354. package/dist/cli/chunks/protocol-executor-HNT67NN5.js +0 -2
  355. package/dist/cli/chunks/provider-manager-5YGPZIEZ.js +0 -2
  356. package/dist/cli/chunks/qe-reasoning-bank-Z5UGOA3F.js +0 -2
  357. package/dist/cli/chunks/queen-coordinator-P5LU5NWI.js +0 -2
  358. package/dist/cli/chunks/router-CRGHUAVR.js +0 -2
  359. package/dist/cli/chunks/routing-feedback-BVX5ZBCF.js +0 -2
  360. package/dist/cli/chunks/rvf-native-adapter-FZJSQOJM.js +0 -2
  361. package/dist/cli/chunks/safe-db-USYNEOC6.js +0 -2
  362. package/dist/cli/chunks/schedule-KCRCQ3PS.js +0 -2
  363. package/dist/cli/chunks/scheduler-CX3UHI4U.js +0 -2
  364. package/dist/cli/chunks/shared-rvf-adapter-VCOK3OVD.js +0 -2
  365. package/dist/cli/chunks/sqlite-persistence-K23C4TFH.js +0 -2
  366. package/dist/cli/chunks/status-handler-M5W64S5U.js +0 -46
  367. package/dist/cli/chunks/token-bootstrap-W5IAMJW4.js +0 -2
  368. package/dist/cli/chunks/unified-memory-NCDBQLLF.js +0 -2
  369. package/dist/cli/chunks/unified-memory-hnsw-T7NSGQ2H.js +0 -2
  370. package/dist/cli/chunks/unified-persistence-XUAYDCMM.js +0 -2
  371. package/dist/cli/chunks/visual-security-3TUC4GPP.js +0 -2
  372. package/dist/cli/chunks/witness-chain-QLOKUZXC.js +0 -2
  373. package/dist/cli/chunks/workflow-orchestrator-6JAYTZ7L.js +0 -2
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Agentic QE v3 — Billing mode resolution (ADR-123)
3
+ *
4
+ * Maps a provider type to how it bills, and provides the human-facing startup
5
+ * notice text. Kept separate from the provider classes so callers (router,
6
+ * kernel, `aqe health`) can resolve a billing mode without constructing a
7
+ * provider, and so a provider that doesn't set `billingMode` still resolves.
8
+ */
9
+ import type { BillingMode, LLMProvider, LLMProviderType } from './interfaces';
10
+ /**
11
+ * Resolve a provider's billing mode: the instance's own `billingMode` wins,
12
+ * else the per-type default, else `metered-api` (the safe, cap-requiring
13
+ * assumption for an unknown provider).
14
+ */
15
+ export declare function resolveBillingMode(provider: Pick<LLMProvider, 'type' | 'billingMode'>): BillingMode;
16
+ /** Resolve a billing mode from a bare provider type. */
17
+ export declare function billingModeForType(type: LLMProviderType): BillingMode;
18
+ /**
19
+ * One-line notice shown at startup / in `aqe health` describing how the
20
+ * active provider bills, so a user is never surprised (issue #557). Returns
21
+ * `undefined` for `local` (nothing to warn about).
22
+ */
23
+ export declare function billingNotice(provider: LLMProviderType, mode: BillingMode): string | undefined;
24
+ //# sourceMappingURL=billing-modes.d.ts.map
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Agentic QE v3 — Billing mode resolution (ADR-123)
3
+ *
4
+ * Maps a provider type to how it bills, and provides the human-facing startup
5
+ * notice text. Kept separate from the provider classes so callers (router,
6
+ * kernel, `aqe health`) can resolve a billing mode without constructing a
7
+ * provider, and so a provider that doesn't set `billingMode` still resolves.
8
+ */
9
+ /** Default billing mode per provider type. */
10
+ const BILLING_MODE_BY_TYPE = {
11
+ claude: 'metered-api',
12
+ 'claude-code': 'subscription',
13
+ openai: 'metered-api',
14
+ openrouter: 'metered-api',
15
+ gemini: 'metered-api',
16
+ 'azure-openai': 'metered-api',
17
+ bedrock: 'metered-api',
18
+ cognitum: 'metered-capped',
19
+ ollama: 'local',
20
+ };
21
+ /**
22
+ * Resolve a provider's billing mode: the instance's own `billingMode` wins,
23
+ * else the per-type default, else `metered-api` (the safe, cap-requiring
24
+ * assumption for an unknown provider).
25
+ */
26
+ export function resolveBillingMode(provider) {
27
+ return provider.billingMode ?? BILLING_MODE_BY_TYPE[provider.type] ?? 'metered-api';
28
+ }
29
+ /** Resolve a billing mode from a bare provider type. */
30
+ export function billingModeForType(type) {
31
+ return BILLING_MODE_BY_TYPE[type] ?? 'metered-api';
32
+ }
33
+ /**
34
+ * One-line notice shown at startup / in `aqe health` describing how the
35
+ * active provider bills, so a user is never surprised (issue #557). Returns
36
+ * `undefined` for `local` (nothing to warn about).
37
+ */
38
+ export function billingNotice(provider, mode) {
39
+ switch (mode) {
40
+ case 'metered-api':
41
+ return (`⚠️ LLM provider "${provider}" bills a pay-per-token API key (not your Claude ` +
42
+ `subscription) and has no server-side spend cap. Set a budget with ` +
43
+ `--max-budget-usd / AQE_MAX_BUDGET_USD, or use AQE_LLM_PROVIDER=claude-code ` +
44
+ `to run on your Claude Code subscription instead.`);
45
+ case 'metered-capped':
46
+ return (`ℹ️ LLM provider "${provider}" bills per-token but enforces a server-side ` +
47
+ `hard spend cap; it will pause at the cap rather than overspend.`);
48
+ case 'subscription':
49
+ return (`ℹ️ LLM provider "${provider}" runs on your Claude Code subscription ` +
50
+ `(shared plan usage). Worst case is hitting your plan's rate limit and pausing — ` +
51
+ `no per-token API charges.`);
52
+ case 'local':
53
+ return undefined;
54
+ }
55
+ }
56
+ //# sourceMappingURL=billing-modes.js.map
@@ -176,12 +176,14 @@ export class CostTracker {
176
176
  const relevantRecords = this.records.filter((r) => r.timestamp >= periodStart && r.timestamp <= periodEnd);
177
177
  const byProvider = {
178
178
  claude: 0,
179
+ 'claude-code': 0,
179
180
  openai: 0,
180
181
  ollama: 0,
181
182
  openrouter: 0,
182
183
  bedrock: 0,
183
184
  'azure-openai': 0,
184
185
  gemini: 0,
186
+ cognitum: 0,
185
187
  };
186
188
  const byModel = {};
187
189
  let totalCost = 0;
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Supported LLM provider types
13
13
  */
14
- export type LLMProviderType = 'claude' | 'openai' | 'ollama' | 'openrouter' | 'bedrock' | 'azure-openai' | 'gemini';
14
+ export type LLMProviderType = 'claude' | 'claude-code' | 'openai' | 'ollama' | 'openrouter' | 'bedrock' | 'azure-openai' | 'gemini' | 'cognitum';
15
15
  /**
16
16
  * Message role in a conversation
17
17
  */
@@ -35,6 +35,25 @@ export interface TokenUsage {
35
35
  /** ADR-088: tokens served from the prompt cache this request (billed ~0.1x input rate) */
36
36
  cacheReadTokens?: number;
37
37
  }
38
+ /**
39
+ * How a provider bills for usage (ADR-123).
40
+ *
41
+ * - `metered-api`: pay-per-token against an API key with no server-side cap
42
+ * (Anthropic API, OpenAI, OpenRouter, Gemini, Azure, Bedrock). Unbounded
43
+ * spend — relies on AQE's local enforced budget.
44
+ * - `metered-capped`: pay-per-token but the provider enforces its own hard
45
+ * spend cap server-side (Cognitum `hardCapUsd`). Worst case: provider pauses.
46
+ * - `subscription`: draws from a Pro/Max plan's shared usage allowance
47
+ * (claude-code provider). Worst case: hit the plan rate limit and pause.
48
+ * - `local`: on-device compute, no monetary cost (Ollama, ONNX).
49
+ */
50
+ export type BillingMode = 'metered-api' | 'metered-capped' | 'subscription' | 'local';
51
+ /**
52
+ * Where a request's cost figure came from (ADR-123). Provider-reported
53
+ * receipts (e.g. Cognitum's `x_cognitum.price_usd`) are authoritative and
54
+ * preferred over locally computed price-table estimates.
55
+ */
56
+ export type CostSource = 'provider-receipt' | 'local-estimate';
38
57
  /**
39
58
  * Cost information for a request
40
59
  */
@@ -43,6 +62,11 @@ export interface CostInfo {
43
62
  outputCost: number;
44
63
  totalCost: number;
45
64
  currency: 'USD';
65
+ /**
66
+ * ADR-123: provenance of `totalCost`. Absent is treated as
67
+ * `local-estimate` for backward compatibility.
68
+ */
69
+ source?: CostSource;
46
70
  }
47
71
  /**
48
72
  * LLM generation response
@@ -237,6 +261,25 @@ export interface BedrockConfig extends LLMConfig {
237
261
  /** Inference profile ARN (for cross-region inference) */
238
262
  inferenceProfileArn?: string;
239
263
  }
264
+ /**
265
+ * Claude Code (subscription) provider configuration (ADR-123).
266
+ * Runs `claude -p` on the user's Pro/Max subscription instead of an API key.
267
+ */
268
+ export interface ClaudeCodeConfig extends LLMConfig {
269
+ /** Path to the `claude` binary (default: 'claude' on PATH). */
270
+ binaryPath?: string;
271
+ /** Max concurrent `claude -p` subprocesses. */
272
+ maxConcurrency?: number;
273
+ /** Tools to disallow in the headless session (safety). */
274
+ disallowedTools?: string[];
275
+ }
276
+ /**
277
+ * Cognitum provider configuration (ADR-123). OpenAI-compatible gateway with
278
+ * per-request cost receipts and a server-side hard spend cap.
279
+ */
280
+ export interface CognitumConfig extends LLMConfig {
281
+ model: 'cognitum-auto' | 'cognitum-low' | 'cognitum-mid' | 'cognitum-high' | string;
282
+ }
240
283
  /**
241
284
  * Provider manager configuration
242
285
  */
@@ -250,19 +293,28 @@ export interface ProviderManagerConfig {
250
293
  /** Provider-specific configurations (ADR-043: All 7 providers) */
251
294
  providers: {
252
295
  claude?: ClaudeConfig;
296
+ 'claude-code'?: ClaudeCodeConfig;
253
297
  openai?: OpenAIConfig;
254
298
  ollama?: OllamaConfig;
255
299
  openrouter?: OpenRouterConfig;
256
300
  gemini?: GeminiConfig;
257
301
  'azure-openai'?: AzureOpenAIConfig;
258
302
  bedrock?: BedrockConfig;
303
+ cognitum?: CognitumConfig;
259
304
  };
260
305
  /** Global settings */
261
306
  global?: {
262
- /** Max total cost per hour in USD */
307
+ /** Max total cost per hour in USD (ADR-123: enforced cross-process) */
263
308
  maxCostPerHour?: number;
264
- /** Max total cost per day in USD */
309
+ /** Max total cost per day in USD (ADR-123: enforced cross-process) */
265
310
  maxCostPerDay?: number;
311
+ /**
312
+ * ADR-123: max spend for a single run/process in USD. Set via
313
+ * `--max-budget-usd` or `AQE_MAX_BUDGET_USD`. Enforced against this
314
+ * process's cumulative spend, so it caps one invocation regardless of the
315
+ * shared hourly/daily ledger.
316
+ */
317
+ maxCostPerRun?: number;
266
318
  /** Enable cost tracking */
267
319
  enableCostTracking?: boolean;
268
320
  /** Enable metrics collection */
@@ -339,6 +391,12 @@ export interface LLMProvider {
339
391
  readonly type: LLMProviderType;
340
392
  /** Provider display name */
341
393
  readonly name: string;
394
+ /**
395
+ * ADR-123: how this provider bills. Optional for backward compatibility
396
+ * with existing/mock implementations; when absent, callers resolve it from
397
+ * the provider type via `resolveBillingMode()`.
398
+ */
399
+ readonly billingMode?: BillingMode;
342
400
  /** Check if provider is available and configured */
343
401
  isAvailable(): Promise<boolean>;
344
402
  /** Health check with latency measurement */
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import { LLMProvider, LLMProviderType, ProviderManagerConfig, ProviderMetrics, Message, GenerateOptions, EmbedOptions, CompleteOptions, LLMResponse, EmbeddingResponse, CompletionResponse, HealthCheckResult, CircuitBreakerConfig, LLMCacheConfig } from './interfaces';
13
13
  import { CostTracker } from './cost-tracker';
14
+ import { type SpendLedger } from './spend-ledger';
14
15
  /**
15
16
  * Default provider manager configuration
16
17
  */
@@ -28,15 +29,48 @@ export declare class ProviderManager {
28
29
  private metrics;
29
30
  private roundRobinIndex;
30
31
  private initialized;
32
+ /** ADR-123: cross-process spend ledger (memory.db-backed by default). */
33
+ private spendLedger?;
34
+ private injectedLedger?;
35
+ /** ADR-123: per-run cap in USD (from AQE_MAX_BUDGET_USD or global.maxCostPerRun). */
36
+ private maxCostPerRun?;
37
+ private billingNoticeShown;
31
38
  constructor(config?: Partial<ProviderManagerConfig>, options?: {
32
39
  circuitBreakerConfig?: Partial<CircuitBreakerConfig>;
33
40
  cacheConfig?: Partial<LLMCacheConfig>;
34
41
  costTracker?: CostTracker;
42
+ /** ADR-123: inject a ledger (tests / kernel with an open DB handle). */
43
+ spendLedger?: SpendLedger;
35
44
  });
36
45
  /**
37
46
  * Initialize the provider manager
38
47
  */
39
48
  initialize(): Promise<void>;
49
+ /** ADR-123: whether any spend cap is configured. */
50
+ private budgetConfigured;
51
+ /**
52
+ * ADR-123: print a one-line notice describing how the primary provider bills,
53
+ * once per manager, unless silenced with AQE_LLM_NO_BILLING_NOTICE=1.
54
+ */
55
+ private emitBillingNotice;
56
+ /**
57
+ * ADR-123: throw COST_LIMIT_EXCEEDED before a call that would breach a
58
+ * configured budget. Estimate is conservative: prompt tokens from input
59
+ * length, completion tokens from the requested `maxTokens`. Local providers
60
+ * ($0) never trip a cap.
61
+ */
62
+ private enforceBudget;
63
+ /** ADR-123: persist a completed charge to the cross-process ledger. */
64
+ private recordSpend;
65
+ /**
66
+ * ADR-123: public budget gate for callers that execute providers WITHOUT
67
+ * going through `generate()`/`complete()` — notably HybridRouter, which is
68
+ * the primary QE domain/fleet execution path. Throws COST_LIMIT_EXCEEDED
69
+ * when a configured cap would be breached; a no-op when no budget is set.
70
+ */
71
+ assertWithinBudget(input: string | Message[], options?: GenerateOptions | CompleteOptions): void;
72
+ /** ADR-123: public spend recorder for those same bypassing callers. */
73
+ recordResponseSpend(response: LLMResponse): void;
40
74
  /**
41
75
  * Generate text using the best available provider
42
76
  */
@@ -13,8 +13,12 @@ import { createLLMError, } from './interfaces';
13
13
  import { secureRandomInt } from '../utils/crypto-random.js';
14
14
  import { CircuitBreakerManager } from './circuit-breaker';
15
15
  import { LLMResponseCache } from './cache';
16
- import { getGlobalCostTracker } from './cost-tracker';
16
+ import { CostTracker, getGlobalCostTracker } from './cost-tracker';
17
+ import { createDefaultSpendLedger, InMemorySpendLedger, } from './spend-ledger';
18
+ import { resolveBillingMode, billingNotice } from './billing-modes';
17
19
  import { ClaudeProvider } from './providers/claude';
20
+ import { ClaudeCodeProvider } from './providers/claude-code';
21
+ import { CognitumProvider } from './providers/cognitum';
18
22
  import { OpenAIProvider } from './providers/openai';
19
23
  import { OllamaProvider } from './providers/ollama';
20
24
  import { OpenRouterProvider } from './providers/openrouter';
@@ -48,11 +52,23 @@ export class ProviderManager {
48
52
  metrics = new Map();
49
53
  roundRobinIndex = 0;
50
54
  initialized = false;
55
+ /** ADR-123: cross-process spend ledger (memory.db-backed by default). */
56
+ spendLedger;
57
+ injectedLedger;
58
+ /** ADR-123: per-run cap in USD (from AQE_MAX_BUDGET_USD or global.maxCostPerRun). */
59
+ maxCostPerRun;
60
+ billingNoticeShown = false;
51
61
  constructor(config = {}, options) {
52
62
  this.config = { ...DEFAULT_PROVIDER_MANAGER_CONFIG, ...config };
53
63
  this.circuitBreakers = new CircuitBreakerManager(options?.circuitBreakerConfig);
54
64
  this.cache = new LLMResponseCache(options?.cacheConfig);
55
65
  this.costTracker = options?.costTracker ?? getGlobalCostTracker();
66
+ this.injectedLedger = options?.spendLedger;
67
+ // AQE_MAX_BUDGET_USD env overrides an unset per-run cap.
68
+ const envRun = Number.parseFloat(process.env.AQE_MAX_BUDGET_USD ?? '');
69
+ this.maxCostPerRun =
70
+ this.config.global?.maxCostPerRun ??
71
+ (Number.isFinite(envRun) && envRun > 0 ? envRun : undefined);
56
72
  }
57
73
  /**
58
74
  * Initialize the provider manager
@@ -67,8 +83,118 @@ export class ProviderManager {
67
83
  for (const type of this.providers.keys()) {
68
84
  this.initializeMetrics(type);
69
85
  }
86
+ // ADR-123: resolve the spend ledger only when a budget is actually
87
+ // configured — no DB work for callers who never set a cap.
88
+ if (this.budgetConfigured()) {
89
+ this.spendLedger =
90
+ this.injectedLedger ??
91
+ (await createDefaultSpendLedger().catch(() => new InMemorySpendLedger()));
92
+ }
93
+ this.emitBillingNotice();
70
94
  this.initialized = true;
71
95
  }
96
+ /** ADR-123: whether any spend cap is configured. */
97
+ budgetConfigured() {
98
+ const g = this.config.global;
99
+ return Boolean(this.maxCostPerRun ||
100
+ (g?.maxCostPerHour && g.maxCostPerHour > 0) ||
101
+ (g?.maxCostPerDay && g.maxCostPerDay > 0));
102
+ }
103
+ /**
104
+ * ADR-123: print a one-line notice describing how the primary provider bills,
105
+ * once per manager, unless silenced with AQE_LLM_NO_BILLING_NOTICE=1.
106
+ */
107
+ emitBillingNotice() {
108
+ if (this.billingNoticeShown)
109
+ return;
110
+ if ((process.env.AQE_LLM_NO_BILLING_NOTICE ?? '') === '1')
111
+ return;
112
+ const primary = this.providers.get(this.config.primary);
113
+ if (!primary)
114
+ return;
115
+ const mode = resolveBillingMode(primary);
116
+ const notice = billingNotice(primary.type, mode);
117
+ if (notice) {
118
+ // eslint-disable-next-line no-console
119
+ console.error(notice);
120
+ }
121
+ this.billingNoticeShown = true;
122
+ }
123
+ /**
124
+ * ADR-123: throw COST_LIMIT_EXCEEDED before a call that would breach a
125
+ * configured budget. Estimate is conservative: prompt tokens from input
126
+ * length, completion tokens from the requested `maxTokens`. Local providers
127
+ * ($0) never trip a cap.
128
+ */
129
+ enforceBudget(input, options) {
130
+ if (!this.budgetConfigured() || !this.spendLedger)
131
+ return;
132
+ // Resolve the concrete model that will actually be billed: the caller's
133
+ // override, else the primary provider's configured model. `config.primary`
134
+ // is a provider *type*, not a model id, so it can't be priced directly.
135
+ const model = options?.model ??
136
+ this.providers.get(this.config.primary)?.getConfig().model ??
137
+ this.config.primary;
138
+ const inputStr = typeof input === 'string' ? input : JSON.stringify(input);
139
+ const estPromptTokens = Math.ceil(inputStr.length / 4);
140
+ const estCompletionTokens = options?.maxTokens ?? 4096;
141
+ const estCost = this.costTracker.estimateCost(model, estPromptTokens, estCompletionTokens).totalCost;
142
+ // Free/local models can't breach a spend cap.
143
+ if (estCost === 0)
144
+ return;
145
+ const g = this.config.global;
146
+ const checks = [
147
+ {
148
+ limit: this.maxCostPerRun,
149
+ spent: this.costTracker.getCurrentCost('all'),
150
+ label: 'per-run',
151
+ },
152
+ {
153
+ limit: g?.maxCostPerHour,
154
+ spent: this.spendLedger.spentSince(3_600_000),
155
+ label: 'hourly',
156
+ },
157
+ {
158
+ limit: g?.maxCostPerDay,
159
+ spent: this.spendLedger.spentSince(86_400_000),
160
+ label: 'daily',
161
+ },
162
+ ];
163
+ for (const { limit, spent, label } of checks) {
164
+ if (limit && limit > 0 && spent + estCost > limit) {
165
+ throw createLLMError(`LLM ${label} budget exceeded: $${spent.toFixed(4)} spent + ` +
166
+ `$${estCost.toFixed(4)} estimated > $${limit.toFixed(2)} cap. ` +
167
+ `Raise --max-budget-usd / maxCost* or switch to a local/subscription provider.`, 'COST_LIMIT_EXCEEDED', { retryable: false });
168
+ }
169
+ }
170
+ }
171
+ /** ADR-123: persist a completed charge to the cross-process ledger. */
172
+ recordSpend(response) {
173
+ if (!this.spendLedger)
174
+ return;
175
+ this.spendLedger.record({
176
+ provider: response.provider,
177
+ model: response.model,
178
+ costUsd: response.cost.totalCost,
179
+ costSource: response.cost.source ?? 'local-estimate',
180
+ promptTokens: response.usage.promptTokens,
181
+ completionTokens: response.usage.completionTokens,
182
+ requestId: response.requestId,
183
+ });
184
+ }
185
+ /**
186
+ * ADR-123: public budget gate for callers that execute providers WITHOUT
187
+ * going through `generate()`/`complete()` — notably HybridRouter, which is
188
+ * the primary QE domain/fleet execution path. Throws COST_LIMIT_EXCEEDED
189
+ * when a configured cap would be breached; a no-op when no budget is set.
190
+ */
191
+ assertWithinBudget(input, options) {
192
+ this.enforceBudget(input, options);
193
+ }
194
+ /** ADR-123: public spend recorder for those same bypassing callers. */
195
+ recordResponseSpend(response) {
196
+ this.recordSpend(response);
197
+ }
72
198
  /**
73
199
  * Generate text using the best available provider
74
200
  */
@@ -87,6 +213,8 @@ export class ProviderManager {
87
213
  return { ...cached, cached: true };
88
214
  }
89
215
  }
216
+ // ADR-123: enforce budget before spending anything.
217
+ this.enforceBudget(input, options);
90
218
  // Select provider and execute with failover
91
219
  const response = await this.executeWithFailover('generate', async (provider) => provider.generate(input, options), options?.preferredProvider);
92
220
  // Cache the response
@@ -99,8 +227,9 @@ export class ProviderManager {
99
227
  systemPrompt: options?.systemPrompt,
100
228
  });
101
229
  }
102
- // Track cost
230
+ // Track cost (in-process) and persist to the cross-process ledger.
103
231
  this.costTracker.recordUsage(response.provider, response.model, response.usage, response.requestId);
232
+ this.recordSpend(response);
104
233
  return response;
105
234
  }
106
235
  /**
@@ -116,7 +245,8 @@ export class ProviderManager {
116
245
  }
117
246
  }
118
247
  // For embeddings, prefer providers that support them
119
- const embeddingProviders = ['openai', 'ollama'];
248
+ // ADR-123: cognitum exposes /v1/embeddings, so it can serve embeddings too.
249
+ const embeddingProviders = ['openai', 'ollama', 'cognitum'];
120
250
  const response = await this.executeWithFailover('embed', async (provider) => provider.embed(text, options), embeddingProviders.find((p) => this.providers.has(p)));
121
251
  // Cache the response
122
252
  if (!options?.skipCache) {
@@ -140,6 +270,8 @@ export class ProviderManager {
140
270
  return { ...cached, cached: true };
141
271
  }
142
272
  }
273
+ // ADR-123: enforce budget before spending anything.
274
+ this.enforceBudget(prompt, options);
143
275
  const response = await this.executeWithFailover('complete', async (provider) => provider.complete(prompt, options));
144
276
  // Cache the response
145
277
  if (!options?.skipCache) {
@@ -149,6 +281,19 @@ export class ProviderManager {
149
281
  maxTokens: options?.maxTokens,
150
282
  });
151
283
  }
284
+ // ADR-123: persist to the cross-process ledger (completion has usage too).
285
+ this.costTracker.recordUsage(response.provider, response.model, response.usage, `complete-${response.model}-${Date.now()}`);
286
+ this.recordSpend({
287
+ content: response.completion,
288
+ model: response.model,
289
+ provider: response.provider,
290
+ usage: response.usage,
291
+ cost: CostTracker.calculateCost(response.model, response.usage),
292
+ latencyMs: response.latencyMs,
293
+ finishReason: 'stop',
294
+ cached: response.cached,
295
+ requestId: `complete-${response.model}-${Date.now()}`,
296
+ });
152
297
  return response;
153
298
  }
154
299
  /**
@@ -270,6 +415,10 @@ export class ProviderManager {
270
415
  switch (type) {
271
416
  case 'claude':
272
417
  return new ClaudeProvider(this.config.providers.claude);
418
+ case 'claude-code':
419
+ return new ClaudeCodeProvider(this.config.providers['claude-code']);
420
+ case 'cognitum':
421
+ return new CognitumProvider(this.config.providers.cognitum);
273
422
  case 'openai':
274
423
  return new OpenAIProvider(this.config.providers.openai);
275
424
  case 'ollama':
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Agentic QE v3 — Claude Code (subscription) Provider (ADR-123, issue #557)
3
+ *
4
+ * Runs QE analysis on the user's Claude Pro/Max subscription by shelling out
5
+ * to the Claude Code CLI (`claude -p --output-format json`) instead of calling
6
+ * `api.anthropic.com` with a paid API key. The CLI authenticates with the
7
+ * user's existing OAuth login and draws from the subscription's shared usage
8
+ * allowance, so the worst case is "hit the plan rate limit and pause" rather
9
+ * than a surprise per-token bill.
10
+ *
11
+ * LOAD-BEARING: the child process env has ANTHROPIC_API_KEY / CLAUDE_API_KEY /
12
+ * ANTHROPIC_AUTH_TOKEN stripped. If any is present, the CLI silently reverts
13
+ * to API-key billing and this provider would be a lie. `parity` test coverage
14
+ * asserts the strip.
15
+ */
16
+ import { LLMProvider, LLMProviderType, BillingMode, ClaudeCodeConfig, Message, GenerateOptions, EmbedOptions, CompleteOptions, LLMResponse, EmbeddingResponse, CompletionResponse, HealthCheckResult } from '../interfaces';
17
+ export type { ClaudeCodeConfig };
18
+ /** Env vars whose presence flips the CLI from subscription to API billing. */
19
+ export declare const API_BILLING_ENV_VARS: readonly ["ANTHROPIC_API_KEY", "CLAUDE_API_KEY", "ANTHROPIC_AUTH_TOKEN"];
20
+ export declare const DEFAULT_CLAUDE_CODE_CONFIG: ClaudeCodeConfig;
21
+ export declare class ClaudeCodeProvider implements LLMProvider {
22
+ readonly type: LLMProviderType;
23
+ readonly name: string;
24
+ readonly billingMode: BillingMode;
25
+ private config;
26
+ private requestId;
27
+ private availabilityCache?;
28
+ private active;
29
+ private readonly queue;
30
+ constructor(config?: Partial<ClaudeCodeConfig>);
31
+ isAvailable(): Promise<boolean>;
32
+ healthCheck(): Promise<HealthCheckResult>;
33
+ generate(input: string | Message[], options?: GenerateOptions): Promise<LLMResponse>;
34
+ embed(_text: string, _options?: EmbedOptions): Promise<EmbeddingResponse>;
35
+ complete(prompt: string, options?: CompleteOptions): Promise<CompletionResponse>;
36
+ getConfig(): ClaudeCodeConfig;
37
+ getSupportedModels(): string[];
38
+ getCostPerToken(): {
39
+ input: number;
40
+ output: number;
41
+ };
42
+ dispose(): Promise<void>;
43
+ /** Map an AQE canonical/model id to a CLI alias the `claude` binary accepts. */
44
+ private toCliModel;
45
+ private flatten;
46
+ private mapFinishReason;
47
+ private classifyError;
48
+ /**
49
+ * Build the child env with API-billing keys stripped (LOAD-BEARING).
50
+ * Exported logic tested by parity/env-strip tests.
51
+ */
52
+ static childEnv(base?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
53
+ private runProcess;
54
+ /** Simple semaphore so we don't spawn unbounded `claude` subprocesses. */
55
+ private withConcurrency;
56
+ }
57
+ //# sourceMappingURL=claude-code.d.ts.map