agentic-qe 3.11.1 → 3.11.2

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 (334) hide show
  1. package/.claude/skills/qe-code-intelligence/SKILL.md +3 -0
  2. package/.claude/skills/skills-manifest.json +1 -1
  3. package/CHANGELOG.md +35 -0
  4. package/README.md +1 -0
  5. package/assets/skills/qe-code-intelligence/SKILL.md +3 -0
  6. package/dist/cli/bundle.js +5 -5
  7. package/dist/cli/chunks/adapter-LDNYC4GH.js +2 -0
  8. package/dist/cli/chunks/{agent-booster-wasm-3OJAT664.js → agent-booster-wasm-FNCVODUJ.js} +2 -2
  9. package/dist/cli/chunks/{agent-handler-6TCTI5AT.js → agent-handler-JK7VK37B.js} +2 -2
  10. package/dist/cli/chunks/{agent-memory-branch-FAWCYEGJ.js → agent-memory-branch-EPVVJNNA.js} +2 -2
  11. package/dist/cli/chunks/aqe-learning-engine-CA4CT5Q7.js +2 -0
  12. package/dist/cli/chunks/{arena-O2TCUQBF.js → arena-EH2IMSRW.js} +4 -4
  13. package/dist/cli/chunks/{arena-UVYIGYUF.js → arena-NTHVDZTJ.js} +2 -2
  14. package/dist/cli/chunks/{audit-AYESKHAJ.js → audit-ODZV2T2B.js} +2 -2
  15. package/dist/cli/chunks/base-TSDAEMT4.js +2 -0
  16. package/dist/cli/chunks/{hnswlib-node-FUWQTM2D.js → better-sqlite3-5JTP47LA.js} +2 -2
  17. package/dist/cli/chunks/{brain-handler-KSJBVTHZ.js → brain-handler-NVB6OJ25.js} +3 -3
  18. package/dist/cli/chunks/{branch-enumerator-4O3S42EG.js → branch-enumerator-BIXSELMY.js} +2 -2
  19. package/dist/cli/chunks/{browser-5VXK323P.js → browser-S2Y2W33Z.js} +2 -2
  20. package/dist/cli/chunks/browser-workflow-3HCTJBLR.js +2 -0
  21. package/dist/cli/chunks/{chunk-XEVUW4QL.js → chunk-26ZMIYSK.js} +2 -2
  22. package/dist/cli/chunks/{chunk-7GP7ZG3K.js → chunk-27KNLVOY.js} +2 -2
  23. package/dist/cli/chunks/{chunk-5Y7GXQOM.js → chunk-2Q65LTJN.js} +2 -2
  24. package/dist/cli/chunks/{chunk-QOR4YAZY.js → chunk-3ATEYGVD.js} +2 -2
  25. package/dist/cli/chunks/{chunk-NVJIOCS5.js → chunk-3J3QXLWP.js} +2 -2
  26. package/dist/cli/chunks/{chunk-OUBYADPD.js → chunk-3KTOM7NN.js} +2 -2
  27. package/dist/cli/chunks/{chunk-EZBXCEBV.js → chunk-3NCVUFAL.js} +2 -2
  28. package/dist/cli/chunks/{chunk-2RE32VOF.js → chunk-42DCMEUM.js} +1 -1
  29. package/dist/cli/chunks/{chunk-ZRWAFMM7.js → chunk-4FTVTAMN.js} +2 -2
  30. package/dist/cli/chunks/{chunk-437XL5VZ.js → chunk-4PYJCIRO.js} +2 -2
  31. package/dist/cli/chunks/{chunk-4RUS5E3Q.js → chunk-527U4AHC.js} +2 -2
  32. package/dist/cli/chunks/{chunk-OX2PGDUM.js → chunk-5AFO7ZZG.js} +3 -3
  33. package/dist/cli/chunks/{chunk-S7IHSELP.js → chunk-5BDVFFYF.js} +2 -2
  34. package/dist/cli/chunks/{chunk-IAHJ62JS.js → chunk-5KMGG3QW.js} +4 -4
  35. package/dist/cli/chunks/{chunk-LNV76GGB.js → chunk-6LQIVIZB.js} +2 -2
  36. package/dist/cli/chunks/{chunk-FOD6JEEU.js → chunk-6SOGYNJG.js} +2 -2
  37. package/dist/cli/chunks/{chunk-5PSIKJL5.js → chunk-6VAFRS5N.js} +2 -2
  38. package/dist/cli/chunks/chunk-72VVTMEL.js +2 -0
  39. package/dist/cli/chunks/{chunk-SU4YXUVK.js → chunk-75C5GX7D.js} +2 -2
  40. package/dist/cli/chunks/{chunk-B6U56VWG.js → chunk-76RO2RHG.js} +1 -1
  41. package/dist/cli/chunks/{chunk-OUSD2RWO.js → chunk-7HYO76F2.js} +2 -2
  42. package/dist/cli/chunks/{chunk-PY4YQDBM.js → chunk-7KHZZVF2.js} +4 -4
  43. package/dist/cli/chunks/{chunk-NKCL6RAF.js → chunk-7MKF52GT.js} +2 -2
  44. package/dist/cli/chunks/{chunk-FK3XYV3A.js → chunk-7VM4ZUHT.js} +2 -2
  45. package/dist/cli/chunks/{chunk-VS2G6LX5.js → chunk-7XIQR6VU.js} +2 -2
  46. package/dist/cli/chunks/{chunk-OHBZON7T.js → chunk-A4ZDKF5F.js} +1 -1
  47. package/dist/cli/chunks/{chunk-K7XPKGOL.js → chunk-AAVUZVM6.js} +2 -2
  48. package/dist/cli/chunks/{chunk-44HXRFOP.js → chunk-AINAWVGD.js} +2 -2
  49. package/dist/cli/chunks/{chunk-P7CMWL7Y.js → chunk-AK5Q2WCJ.js} +2 -2
  50. package/dist/cli/chunks/{chunk-Z6ADE3KJ.js → chunk-AKZK46TQ.js} +2 -2
  51. package/dist/cli/chunks/{chunk-4UHWZ47M.js → chunk-ARUXFZDY.js} +1 -1
  52. package/dist/cli/chunks/{chunk-7DQLYWLR.js → chunk-AYXRT2ND.js} +1 -1
  53. package/dist/cli/chunks/{chunk-X2OVUBF6.js → chunk-AZQ6HDPM.js} +2 -2
  54. package/dist/cli/chunks/{chunk-CN2HMHIY.js → chunk-BGVEBYV4.js} +2 -2
  55. package/dist/cli/chunks/{chunk-LOPM3YIO.js → chunk-C6UTRG66.js} +2 -2
  56. package/dist/cli/chunks/{chunk-4OYC5TIZ.js → chunk-CAUTOCLZ.js} +2 -2
  57. package/dist/cli/chunks/{chunk-6WNYBIPS.js → chunk-CAVBEZV4.js} +2 -2
  58. package/dist/cli/chunks/{chunk-BOQNPFO5.js → chunk-CEMROADY.js} +1 -1
  59. package/dist/cli/chunks/{chunk-ATQTTGSE.js → chunk-CMVNYVKL.js} +2 -2
  60. package/dist/cli/chunks/{chunk-N52WQO3G.js → chunk-CUDGKSFX.js} +2 -2
  61. package/dist/cli/chunks/{chunk-X4GKYSOH.js → chunk-CZYSCUJ4.js} +2 -2
  62. package/dist/cli/chunks/{chunk-72UPBNVF.js → chunk-DMUQV2YU.js} +2 -2
  63. package/dist/cli/chunks/{chunk-BXLWERBR.js → chunk-DPFLJMEI.js} +3 -3
  64. package/dist/cli/chunks/{chunk-H5GCRC2D.js → chunk-DU4GQKTH.js} +2 -2
  65. package/dist/cli/chunks/{chunk-S7ZHD6VN.js → chunk-EDH4H55B.js} +2 -2
  66. package/dist/cli/chunks/{chunk-MILWEZSZ.js → chunk-EIWZDVMT.js} +3 -3
  67. package/dist/cli/chunks/{chunk-O5NF6BBD.js → chunk-FPZLOVEF.js} +1 -1
  68. package/dist/cli/chunks/{chunk-6CH7476R.js → chunk-FV53RMVB.js} +1 -1
  69. package/dist/cli/chunks/{chunk-QEDS3MOJ.js → chunk-FYY7OJ6Y.js} +2 -2
  70. package/dist/cli/chunks/{chunk-CXIFCN6G.js → chunk-G4CQBQBV.js} +1 -1
  71. package/dist/cli/chunks/{chunk-CZU5G6J4.js → chunk-G6LIQFT2.js} +1 -1
  72. package/dist/cli/chunks/{chunk-TUEDIQHY.js → chunk-H3LGBH4Y.js} +1 -1
  73. package/dist/cli/chunks/{chunk-BR4ERWVD.js → chunk-H4ZPPHOI.js} +2 -2
  74. package/dist/cli/chunks/{chunk-N6RSJGTW.js → chunk-H5TM4KIB.js} +2 -2
  75. package/dist/cli/chunks/{chunk-K3BBLIWW.js → chunk-H6MBRYA7.js} +2 -2
  76. package/dist/cli/chunks/{chunk-YFY35CSD.js → chunk-HDBJORV7.js} +2 -2
  77. package/dist/cli/chunks/{chunk-QXDZN2WX.js → chunk-I3AD523O.js} +1 -1
  78. package/dist/cli/chunks/{chunk-HOFEAA4R.js → chunk-I7UWFV6N.js} +1 -1
  79. package/dist/cli/chunks/{chunk-4BMPFEEG.js → chunk-IMPSB5WW.js} +2 -2
  80. package/dist/cli/chunks/{chunk-ILZHECWZ.js → chunk-IO7ZUP2G.js} +3 -3
  81. package/dist/cli/chunks/{chunk-QUTKELAS.js → chunk-IQOCTGA2.js} +2 -2
  82. package/dist/cli/chunks/{chunk-S456W64P.js → chunk-IXYF5BZY.js} +2 -2
  83. package/dist/cli/chunks/{chunk-B5EE63VE.js → chunk-JC4Z2ADP.js} +2 -2
  84. package/dist/cli/chunks/{chunk-IUVAWWQG.js → chunk-JCH2FHJ7.js} +2 -2
  85. package/dist/cli/chunks/{chunk-MX6M2VPB.js → chunk-JDFF2QMZ.js} +1 -1
  86. package/dist/cli/chunks/{chunk-EFRIMR74.js → chunk-JELN5XTK.js} +1 -1
  87. package/dist/cli/chunks/{chunk-3G25ZBQ6.js → chunk-JSZNI3AO.js} +1 -1
  88. package/dist/cli/chunks/{chunk-AEZMNFXM.js → chunk-K3YM2Z3E.js} +1 -1
  89. package/dist/cli/chunks/{chunk-QMN563LV.js → chunk-K426HTEQ.js} +44 -44
  90. package/dist/cli/chunks/{chunk-7OAKIXNM.js → chunk-K6IQBVD7.js} +2 -2
  91. package/dist/cli/chunks/{chunk-C7FYDE5F.js → chunk-KEJEZY2R.js} +125 -150
  92. package/dist/cli/chunks/{chunk-SZPTUV3B.js → chunk-KFE6LB4I.js} +2 -2
  93. package/dist/cli/chunks/{chunk-TOQJWLJV.js → chunk-KO3WB4SU.js} +2 -2
  94. package/dist/cli/chunks/{chunk-3IMEDZIS.js → chunk-LAY35POY.js} +3 -3
  95. package/dist/cli/chunks/{chunk-NYWK7ZSX.js → chunk-LFXXA325.js} +1 -1
  96. package/dist/cli/chunks/{chunk-IVZVVZZ3.js → chunk-LI3T5YNC.js} +3 -3
  97. package/dist/cli/chunks/{chunk-7SRSOZMP.js → chunk-LIEA5EON.js} +1 -1
  98. package/dist/cli/chunks/{chunk-76UVJLPM.js → chunk-LRJWKFGY.js} +2 -2
  99. package/dist/cli/chunks/{chunk-N6NSZG7Z.js → chunk-LY6PTRVL.js} +2 -2
  100. package/dist/cli/chunks/{chunk-L2QHZFC3.js → chunk-MAXOIEUG.js} +1 -1
  101. package/dist/cli/chunks/{chunk-7WQKKYYG.js → chunk-MN6W7ZNL.js} +1 -1
  102. package/dist/cli/chunks/{chunk-DZT4A7R3.js → chunk-NGE5YNKC.js} +2 -2
  103. package/dist/cli/chunks/{chunk-O75SVMMB.js → chunk-NIW4CLN2.js} +2 -2
  104. package/dist/cli/chunks/{chunk-BVFNF3RW.js → chunk-NPT7BYGF.js} +1 -1
  105. package/dist/cli/chunks/{chunk-CII57TME.js → chunk-NZNXEEZR.js} +1 -1
  106. package/dist/cli/chunks/{chunk-J2LAYCYZ.js → chunk-O3IIAIXB.js} +1 -1
  107. package/dist/cli/chunks/{chunk-3D4HNUZM.js → chunk-OC2W7KIW.js} +2 -2
  108. package/dist/cli/chunks/{chunk-ZKPOKMJZ.js → chunk-OFUF3APC.js} +2 -2
  109. package/dist/cli/chunks/{chunk-4G4GTF36.js → chunk-OU52V67H.js} +4 -4
  110. package/dist/cli/chunks/{chunk-5QFZEEJ2.js → chunk-P2RR4SW5.js} +3 -3
  111. package/dist/cli/chunks/{chunk-JGHEGMLD.js → chunk-P3VRXQ3H.js} +3 -3
  112. package/dist/cli/chunks/{chunk-KIBP3LGY.js → chunk-P5SGBQLY.js} +1 -1
  113. package/dist/cli/chunks/{chunk-5LDUW2FD.js → chunk-P7MIOTVP.js} +1 -1
  114. package/dist/cli/chunks/{chunk-VGR65B4Y.js → chunk-PFDILSVO.js} +1 -1
  115. package/dist/cli/chunks/{chunk-WIC5UZCQ.js → chunk-PPD5ZLNA.js} +2 -2
  116. package/dist/cli/chunks/{chunk-4565IIF6.js → chunk-QFJDR4HC.js} +2 -2
  117. package/dist/cli/chunks/{chunk-7QICU44H.js → chunk-QZ2GQGJX.js} +2 -2
  118. package/dist/cli/chunks/{chunk-EQYDPF52.js → chunk-QZLTIGLB.js} +1 -1
  119. package/dist/cli/chunks/{chunk-3V5DAM37.js → chunk-RHSUXQNF.js} +2 -2
  120. package/dist/cli/chunks/{chunk-HMVL55QX.js → chunk-S6BWEZKK.js} +2 -2
  121. package/dist/cli/chunks/{chunk-IIX5Y7BO.js → chunk-SE4S23C7.js} +1 -1
  122. package/dist/cli/chunks/{chunk-6ZAUNPAI.js → chunk-TOGZ37RL.js} +2 -2
  123. package/dist/cli/chunks/{chunk-D6MPGK7R.js → chunk-UCXW24HY.js} +2 -2
  124. package/dist/cli/chunks/{chunk-D4DAZ3P2.js → chunk-UQ6WB4N2.js} +2 -2
  125. package/dist/cli/chunks/{chunk-22FHOXEE.js → chunk-UQBGA4UA.js} +1 -1
  126. package/dist/cli/chunks/{chunk-UDLN2THT.js → chunk-VNFL2TPU.js} +1 -1
  127. package/dist/cli/chunks/{chunk-U5GCSSYX.js → chunk-WARFZ626.js} +1 -1
  128. package/dist/cli/chunks/{chunk-XMDZRULK.js → chunk-WEBHFIWS.js} +2 -2
  129. package/dist/cli/chunks/{chunk-N4OWZLH5.js → chunk-WKIYYF3G.js} +2 -2
  130. package/dist/cli/chunks/{chunk-3DS7ZHA7.js → chunk-WZC4HKGZ.js} +2 -2
  131. package/dist/cli/chunks/{chunk-T7PUM6OY.js → chunk-X36TZXDK.js} +1 -1
  132. package/dist/cli/chunks/{chunk-4S3UIY3G.js → chunk-XN4G3SRU.js} +2 -2
  133. package/dist/cli/chunks/{chunk-V6YDM37M.js → chunk-XNREA3FG.js} +1 -1
  134. package/dist/cli/chunks/{chunk-EJSDQQZH.js → chunk-XRDPGJNW.js} +2 -2
  135. package/dist/cli/chunks/{chunk-GUSW3OGX.js → chunk-XXCSJMSR.js} +1 -1
  136. package/dist/cli/chunks/{chunk-VRHLHGKR.js → chunk-XY2B2BEJ.js} +2 -2
  137. package/dist/cli/chunks/{chunk-CIDTFU3C.js → chunk-XY4JS3IZ.js} +2 -2
  138. package/dist/cli/chunks/{chunk-W6RS5S4Q.js → chunk-Y4M2HMPR.js} +2 -2
  139. package/dist/cli/chunks/{chunk-AG4BYKUV.js → chunk-YDPBCN7H.js} +2 -2
  140. package/dist/cli/chunks/{chunk-56PICCZN.js → chunk-YGR54EAA.js} +2 -2
  141. package/dist/cli/chunks/{chunk-6YNXH6H4.js → chunk-YGRY2TVI.js} +2 -2
  142. package/dist/cli/chunks/{chunk-H4V6WCF7.js → chunk-YJUJCLXV.js} +2 -2
  143. package/dist/cli/chunks/{chunk-KRUKMGPF.js → chunk-YWG4LHFU.js} +2 -2
  144. package/dist/cli/chunks/{chunk-FBOPSWF6.js → chunk-Z2QNTRUX.js} +2 -2
  145. package/dist/cli/chunks/{chunk-3XCEFSUK.js → chunk-ZBJMVWQR.js} +2 -2
  146. package/dist/cli/chunks/{chunk-C27UV6DO.js → chunk-ZH6HYT7C.js} +1 -1
  147. package/dist/cli/chunks/{chunk-WEPZOCN7.js → chunk-ZP2GE6DM.js} +1 -1
  148. package/dist/cli/chunks/{chunk-LSZLXLZA.js → chunk-ZQYEBLTL.js} +2 -2
  149. package/dist/cli/chunks/{chunk-AL54LED5.js → chunk-ZRU3OZEU.js} +2 -2
  150. package/dist/cli/chunks/{chunk-HYT5EMES.js → chunk-ZU3V4CJ4.js} +2 -2
  151. package/dist/cli/chunks/{chunk-TCKBICJ3.js → chunk-ZWMXF6AX.js} +2 -2
  152. package/dist/cli/chunks/{ci-KTWY7BZT.js → ci-SM3EVLZ4.js} +2 -2
  153. package/dist/cli/chunks/{ci-output-WOX6QBMS.js → ci-output-YYXICZBC.js} +2 -2
  154. package/dist/cli/chunks/{circuit-breaker-6XKOSFIF.js → circuit-breaker-CV5UGKXT.js} +2 -2
  155. package/dist/cli/chunks/{claude-flow-setup-5JA4MNE4.js → claude-flow-setup-BSBUZ4B7.js} +2 -2
  156. package/dist/cli/chunks/client-WRDYZGM2.js +2 -0
  157. package/dist/cli/chunks/{cline-installer-Z2ANHEKW.js → cline-installer-P2O6STIC.js} +2 -2
  158. package/dist/cli/chunks/code-M7DDLBGS.js +58 -0
  159. package/dist/cli/chunks/{code-index-extractor-VV4OEPG7.js → code-index-extractor-3QZIUYOG.js} +2 -2
  160. package/dist/cli/chunks/{codex-installer-BP7Y2NYR.js → codex-installer-5JVZCCTC.js} +2 -2
  161. package/dist/cli/chunks/{completions-YULJQUF4.js → completions-EM7IL2BJ.js} +8 -5
  162. package/dist/cli/chunks/{complexity-analyzer-D7XYPQ76.js → complexity-analyzer-VJXVB2CV.js} +2 -2
  163. package/dist/cli/chunks/{continuedev-installer-E3L7UF72.js → continuedev-installer-RCKJIAEC.js} +2 -2
  164. package/dist/cli/chunks/{copilot-installer-5TRUMJC5.js → copilot-installer-DZ7LTDOZ.js} +2 -2
  165. package/dist/cli/chunks/core-handlers-O6E5DNHT.js +2 -0
  166. package/dist/cli/chunks/{cost-tracker-QTYSJMSV.js → cost-tracker-QLOLXVAM.js} +2 -2
  167. package/dist/cli/chunks/{coverage-D5DKZ3XT.js → coverage-LYHTLWRV.js} +3 -3
  168. package/dist/cli/chunks/cross-domain-router-EV7LQMDO.js +2 -0
  169. package/dist/cli/chunks/{cursor-installer-UDBHGUIG.js → cursor-installer-PSIZ3Y53.js} +2 -2
  170. package/dist/cli/chunks/{daemon-IVWUMQKL.js → daemon-IYDTMA5M.js} +4 -4
  171. package/dist/cli/chunks/{daemon-2GXYN7F7.js → daemon-YLOAXM4X.js} +3 -3
  172. package/dist/cli/chunks/{dag-attention-scheduler-PWXR4QTU.js → dag-attention-scheduler-I2UIO3Z7.js} +2 -2
  173. package/dist/cli/chunks/{detect-C6P7ONFB.js → detect-ZXQ7X7GZ.js} +2 -2
  174. package/dist/cli/chunks/{dist-node-2BUFM2JK.js → dist-node-GK6OZX4H.js} +2 -2
  175. package/dist/cli/chunks/{domain-handler-Q2GWZLDM.js → domain-handler-NS3IBLRQ.js} +2 -2
  176. package/dist/cli/chunks/{domain-transfer-GMUBAM3J.js → domain-transfer-5G4RZEWF.js} +2 -2
  177. package/dist/cli/chunks/dream-E4C236UL.js +2 -0
  178. package/dist/cli/chunks/{embed-and-insert-pattern-EFUERRM2.js → embed-and-insert-pattern-V4JJUFR6.js} +2 -2
  179. package/dist/cli/chunks/{eval-24FIC43F.js → eval-7Q6PPYKR.js} +2 -2
  180. package/dist/cli/chunks/{experience-capture-middleware-R4UP2Q2M.js → experience-capture-middleware-DUBKSYFM.js} +3 -3
  181. package/dist/cli/chunks/{fast-paths-RQCGGTXB.js → fast-paths-IDPPMBUW.js} +2 -2
  182. package/dist/cli/chunks/{feature-flags-SOXVYIBN.js → feature-flags-EPTMAAKA.js} +2 -2
  183. package/dist/cli/chunks/{feature-flags-APTWWVNQ.js → feature-flags-KXI6FDY7.js} +2 -2
  184. package/dist/cli/chunks/{file-discovery-66KRMXVF.js → file-discovery-EDX2OJO7.js} +2 -2
  185. package/dist/cli/chunks/{fleet-EMBNKO5Q.js → fleet-67BO3LJ4.js} +3 -3
  186. package/dist/cli/chunks/{gnn-wrapper-6TKDWFJF.js → gnn-wrapper-YARORYT7.js} +2 -2
  187. package/dist/cli/chunks/{heartbeat-handler-4ODKJ75H.js → heartbeat-handler-K3JGPBYR.js} +4 -4
  188. package/dist/cli/chunks/heartbeat-scheduler-WMADLDKT.js +2 -0
  189. package/dist/cli/chunks/hnsw-adapter-STRDGJ65.js +2 -0
  190. package/dist/cli/chunks/hnsw-index-DBHX3TSC.js +2 -0
  191. package/dist/cli/chunks/{hnsw-legacy-bridge-25KFCLUC.js → hnsw-legacy-bridge-CDDRSV5E.js} +2 -2
  192. package/dist/cli/chunks/{better-sqlite3-MJNUEPYB.js → hnswlib-node-2KL54YUA.js} +2 -2
  193. package/dist/cli/chunks/{hooks-JIDA2COE.js → hooks-6SCAE6LC.js} +10 -10
  194. package/dist/cli/chunks/hybrid-router-L2K55I4T.js +2 -0
  195. package/dist/cli/chunks/{hypergraph-engine-3YDFDPE3.js → hypergraph-engine-I3LUMO7I.js} +2 -2
  196. package/dist/cli/chunks/{hypergraph-handler-VWZX2OJX.js → hypergraph-handler-YAKAIVCN.js} +3 -3
  197. package/dist/cli/chunks/impact-analyzer-WMO7ZGS7.js +2 -0
  198. package/dist/cli/chunks/{init-handler-DH7VQAMF.js → init-handler-NBKCZD7Q.js} +6 -6
  199. package/dist/cli/chunks/init-wizard-ZAB7UZZS.js +2 -0
  200. package/dist/cli/chunks/kernel-4MUFDEQI.js +2 -0
  201. package/dist/cli/chunks/{kilocode-installer-2W2KZCGH.js → kilocode-installer-YGPJCPU3.js} +2 -2
  202. package/dist/cli/chunks/{kiro-installer-E5KP7OMD.js → kiro-installer-JV3ONVMN.js} +2 -2
  203. package/dist/cli/chunks/knowledge-graph-GZRFGXLX.js +2 -0
  204. package/dist/cli/chunks/{learning-XJRUVPLF.js → learning-2FEZJ5CX.js} +3 -3
  205. package/dist/cli/chunks/{llm-router-AEEKEMF5.js → llm-router-SILI4KLU.js} +4 -4
  206. package/dist/cli/chunks/llm-router-service-5ODLU5U5.js +2 -0
  207. package/dist/cli/chunks/{load-PZ4YOTBJ.js → load-EGXLQVR3.js} +2 -2
  208. package/dist/cli/chunks/load-test-ZDQFS5XS.js +2 -0
  209. package/dist/cli/chunks/{mcp-IVA6LC2S.js → mcp-OJH775TL.js} +2 -2
  210. package/dist/cli/chunks/{memory-Y3DHXFQE.js → memory-FNEOK4FW.js} +5 -5
  211. package/dist/cli/chunks/memory-backend-UK7SQ6ZM.js +2 -0
  212. package/dist/cli/chunks/{memory-handlers-V5PXEJWL.js → memory-handlers-6LDUH3JZ.js} +2 -2
  213. package/dist/cli/chunks/{multi-model-executor-646G4S4Y.js → multi-model-executor-ORTFWLLE.js} +2 -2
  214. package/dist/cli/chunks/{opencode-installer-P6KOOTUS.js → opencode-installer-UAQLW6XX.js} +2 -2
  215. package/dist/cli/chunks/{orchestrator-T2GVKYMX.js → orchestrator-VE5KJ2V4.js} +5 -5
  216. package/dist/cli/chunks/pattern-null-store-LO2QTIBU.js +2 -0
  217. package/dist/cli/chunks/{pipeline-CK2ON45P.js → pipeline-FNMDRWTU.js} +2 -2
  218. package/dist/cli/chunks/{platform-OQNSD3A3.js → platform-MGAKRUQN.js} +2 -2
  219. package/dist/cli/chunks/{plugin-UOG6RNRM.js → plugin-YX7THX3I.js} +2 -2
  220. package/dist/cli/chunks/{prime-radiant-advanced-wasm-37UE6TG5.js → prime-radiant-advanced-wasm-XJV4RLMK.js} +2 -2
  221. package/dist/cli/chunks/protocol-executor-JWMYQEOI.js +2 -0
  222. package/dist/cli/chunks/{protocol-handler-V722S6YH.js → protocol-handler-QFET442Y.js} +2 -2
  223. package/dist/cli/chunks/{prove-ANGY6W3W.js → prove-QBAESCOC.js} +2 -2
  224. package/dist/cli/chunks/provider-manager-PEXOHGNB.js +2 -0
  225. package/dist/cli/chunks/qe-reasoning-bank-7B2G4UGQ.js +2 -0
  226. package/dist/cli/chunks/{quality-KG4ALI2L.js → quality-ZTNRL6EG.js} +2 -2
  227. package/dist/cli/chunks/queen-coordinator-6OF4HT3S.js +2 -0
  228. package/dist/cli/chunks/{real-embeddings-GUZDO5UN.js → real-embeddings-ZFFDV6HC.js} +2 -2
  229. package/dist/cli/chunks/{roocode-installer-WROAR6MJ.js → roocode-installer-J4LFL4AE.js} +2 -2
  230. package/dist/cli/chunks/router-GMWRF6DU.js +2 -0
  231. package/dist/cli/chunks/routing-feedback-XKJSQK3I.js +2 -0
  232. package/dist/cli/chunks/{routing-handler-UFPSSS5D.js → routing-handler-A5QG2TP2.js} +2 -2
  233. package/dist/cli/chunks/{ruvector-commands-XJQMKDRM.js → ruvector-commands-J5JL5WX5.js} +2 -2
  234. package/dist/cli/chunks/{rvf-dual-writer-QPRMDKYX.js → rvf-dual-writer-H7442GMO.js} +2 -2
  235. package/dist/cli/chunks/{rvf-migration-adapter-SOHBK23K.js → rvf-migration-adapter-PTFQUYKC.js} +2 -2
  236. package/dist/cli/chunks/{rvf-migration-coordinator-MTWUSPEJ.js → rvf-migration-coordinator-RSNROYRX.js} +2 -2
  237. package/dist/cli/chunks/rvf-native-adapter-YEA6TMXB.js +2 -0
  238. package/dist/cli/chunks/safe-db-5DOP2J3V.js +2 -0
  239. package/dist/cli/chunks/schedule-SUWTOBHP.js +2 -0
  240. package/dist/cli/chunks/scheduler-P4VTC5SQ.js +2 -0
  241. package/dist/cli/chunks/{security-5MAMQKP6.js → security-LHHLMCBA.js} +3 -3
  242. package/dist/cli/chunks/{shared-rvf-adapter-YEUBSRNN.js → shared-rvf-adapter-NPSHVUTM.js} +2 -2
  243. package/dist/cli/chunks/{shared-rvf-dual-writer-DBQJHG42.js → shared-rvf-dual-writer-INQDY5WE.js} +2 -2
  244. package/dist/cli/chunks/sqlite-persistence-5Z2RAXH7.js +2 -0
  245. package/dist/cli/chunks/{status-handler-ZUB2UKQZ.js → status-handler-R2KIAMAE.js} +2 -2
  246. package/dist/cli/chunks/{structural-health-B2GHENWX.js → structural-health-2VPPIOZX.js} +2 -2
  247. package/dist/cli/chunks/{sync-7VMXJTR2.js → sync-ASZ3T5GT.js} +2 -2
  248. package/dist/cli/chunks/{sync-YCUUW3IP.js → sync-NLASP7AK.js} +2 -2
  249. package/dist/cli/chunks/{task-handler-N7LJTXZM.js → task-handler-UV5R6LJG.js} +2 -2
  250. package/dist/cli/chunks/{task-handlers-GDHNJV2E.js → task-handlers-I6YJXPYP.js} +3 -3
  251. package/dist/cli/chunks/{test-6COGC5KI.js → test-TE43TNTI.js} +4 -4
  252. package/dist/cli/chunks/{test-scheduling-CUERHJMF.js → test-scheduling-WWWWF2TZ.js} +3 -3
  253. package/dist/cli/chunks/{token-bootstrap-JTGSL6PP.js → token-bootstrap-HEWP7KKS.js} +2 -2
  254. package/dist/cli/chunks/{token-usage-LSG3JYGX.js → token-usage-3FVHUAW6.js} +2 -2
  255. package/dist/cli/chunks/{transformers-ODIITRCT.js → transformers-O5OFM4XM.js} +2 -2
  256. package/dist/cli/chunks/{tree-sitter-wasm-parser-KSP7ZZ5H.js → tree-sitter-wasm-parser-YOYWFW63.js} +2 -2
  257. package/dist/cli/chunks/{types-6N6SUU2O.js → types-42GR6PLO.js} +2 -2
  258. package/dist/cli/chunks/unified-memory-HCKOPFAY.js +2 -0
  259. package/dist/cli/chunks/unified-memory-hnsw-6NQPYA5C.js +2 -0
  260. package/dist/cli/chunks/unified-persistence-NIMKNAFR.js +2 -0
  261. package/dist/cli/chunks/{upgrade-7SCVOCPS.js → upgrade-BU6DJ4LT.js} +2 -2
  262. package/dist/cli/chunks/{validate-762ISH2Y.js → validate-MPTBARGN.js} +2 -2
  263. package/dist/cli/chunks/{validate-swarm-R6WYYXGO.js → validate-swarm-5LUQYHPP.js} +2 -2
  264. package/dist/cli/chunks/{vibium-5GZYSUDQ.js → vibium-MJJDANDL.js} +2 -2
  265. package/dist/cli/chunks/visual-security-HFGHA57Z.js +2 -0
  266. package/dist/cli/chunks/{web-tree-sitter-VYYVAJTY.js → web-tree-sitter-5TF4UGB3.js} +2 -2
  267. package/dist/cli/chunks/{windsurf-installer-RRIOR3B6.js → windsurf-installer-NQAOSVCN.js} +2 -2
  268. package/dist/cli/chunks/{witness-chain-SRVBEKDB.js → witness-chain-23UWK2JT.js} +2 -2
  269. package/dist/cli/chunks/witness-chain-VZGGJ7TJ.js +2 -0
  270. package/dist/cli/chunks/{workflow-XNUDHGEC.js → workflow-3QOLXRJC.js} +4 -4
  271. package/dist/cli/chunks/workflow-orchestrator-45L7D4SN.js +2 -0
  272. package/dist/cli/chunks/{wrappers-3STST7QW.js → wrappers-S6EUZBCX.js} +2 -2
  273. package/dist/cli/commands/code.js +78 -2
  274. package/dist/cli/completions/index.js +4 -1
  275. package/dist/domains/code-intelligence/coordinator.js +8 -4
  276. package/dist/domains/code-intelligence/services/c4-model/from-detected.d.ts +41 -0
  277. package/dist/domains/code-intelligence/services/c4-model/from-detected.js +152 -0
  278. package/dist/domains/code-intelligence/services/c4-model/kg-relationships.d.ts +71 -0
  279. package/dist/domains/code-intelligence/services/c4-model/kg-relationships.js +87 -0
  280. package/dist/domains/code-intelligence/services/knowledge-graph.d.ts +6 -0
  281. package/dist/domains/code-intelligence/services/knowledge-graph.js +3 -3
  282. package/dist/domains/code-intelligence/services/product-factors-bridge.d.ts +26 -5
  283. package/dist/domains/code-intelligence/services/product-factors-bridge.js +72 -65
  284. package/dist/mcp/bundle.js +429 -454
  285. package/dist/mcp/tools/code-intelligence/c4.d.ts +56 -0
  286. package/dist/mcp/tools/code-intelligence/c4.js +145 -0
  287. package/dist/mcp/tools/index.d.ts +1 -0
  288. package/dist/mcp/tools/index.js +1 -0
  289. package/dist/mcp/tools/registry.d.ts +1 -0
  290. package/dist/mcp/tools/registry.js +3 -0
  291. package/dist/shared/c4-model/confidence.d.ts +38 -0
  292. package/dist/shared/c4-model/confidence.js +69 -0
  293. package/dist/shared/c4-model/index.d.ts +4 -0
  294. package/dist/shared/c4-model/index.js +1 -0
  295. package/package.json +1 -1
  296. package/dist/cli/chunks/adapter-A6GCBONS.js +0 -2
  297. package/dist/cli/chunks/aqe-learning-engine-FRCSXNMG.js +0 -2
  298. package/dist/cli/chunks/base-CZ3EHBU5.js +0 -2
  299. package/dist/cli/chunks/browser-workflow-EKTGQQBQ.js +0 -2
  300. package/dist/cli/chunks/chunk-57WGS6BI.js +0 -2
  301. package/dist/cli/chunks/client-X3KUJ6R5.js +0 -2
  302. package/dist/cli/chunks/code-NO4ZKNDU.js +0 -39
  303. package/dist/cli/chunks/core-handlers-A2EQB3UH.js +0 -2
  304. package/dist/cli/chunks/cross-domain-router-OKZ2PDHT.js +0 -2
  305. package/dist/cli/chunks/dream-ZBP4Z5C3.js +0 -2
  306. package/dist/cli/chunks/heartbeat-scheduler-6JUWQXWG.js +0 -2
  307. package/dist/cli/chunks/hnsw-adapter-JT4BU7XJ.js +0 -2
  308. package/dist/cli/chunks/hnsw-index-JC5YELJX.js +0 -2
  309. package/dist/cli/chunks/hybrid-router-SLTXHUFG.js +0 -2
  310. package/dist/cli/chunks/impact-analyzer-JXHCMZXY.js +0 -2
  311. package/dist/cli/chunks/init-wizard-EX37TYOG.js +0 -2
  312. package/dist/cli/chunks/kernel-JPHAG27D.js +0 -2
  313. package/dist/cli/chunks/knowledge-graph-5QJZIRYB.js +0 -2
  314. package/dist/cli/chunks/llm-router-service-SE2RO4P5.js +0 -2
  315. package/dist/cli/chunks/load-test-LOTBWIIS.js +0 -2
  316. package/dist/cli/chunks/memory-backend-BSDKTFAN.js +0 -2
  317. package/dist/cli/chunks/pattern-null-store-LRSXCZWM.js +0 -2
  318. package/dist/cli/chunks/protocol-executor-WPUVJEL7.js +0 -2
  319. package/dist/cli/chunks/provider-manager-EVPWSH3E.js +0 -2
  320. package/dist/cli/chunks/qe-reasoning-bank-IH63FG33.js +0 -2
  321. package/dist/cli/chunks/queen-coordinator-TTCAGYQO.js +0 -2
  322. package/dist/cli/chunks/router-64Q4ILOQ.js +0 -2
  323. package/dist/cli/chunks/routing-feedback-KCZV4XXC.js +0 -2
  324. package/dist/cli/chunks/rvf-native-adapter-GNJKMURU.js +0 -2
  325. package/dist/cli/chunks/safe-db-6VBZQIJI.js +0 -2
  326. package/dist/cli/chunks/schedule-4V7O5IPX.js +0 -2
  327. package/dist/cli/chunks/scheduler-CQDMHEHN.js +0 -2
  328. package/dist/cli/chunks/sqlite-persistence-7DHUFTHL.js +0 -2
  329. package/dist/cli/chunks/unified-memory-MQA72NLP.js +0 -2
  330. package/dist/cli/chunks/unified-memory-hnsw-K7HA3CWV.js +0 -2
  331. package/dist/cli/chunks/unified-persistence-2DXB4OE4.js +0 -2
  332. package/dist/cli/chunks/visual-security-UD6CARIJ.js +0 -2
  333. package/dist/cli/chunks/witness-chain-LWALPPMC.js +0 -2
  334. package/dist/cli/chunks/workflow-orchestrator-QU652FLH.js +0 -2
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.1");process.exit(0)}
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v as L,w as M,x as N}from"./chunk-SZPTUV3B.js";import{a as v,b as w,c as x,d as y,e as z,f as A,g as B,h as C,i as D,j as E,k as F,l as G,m as H,n as I,o as J,p as K}from"./chunk-ZKPOKMJZ.js";import"./chunk-437XL5VZ.js";import"./chunk-W6RS5S4Q.js";import"./chunk-57WGS6BI.js";import"./chunk-S7IHSELP.js";import"./chunk-IUVAWWQG.js";import"./chunk-N6NSZG7Z.js";import"./chunk-S456W64P.js";import"./chunk-QEDS3MOJ.js";import"./chunk-X2OVUBF6.js";import"./chunk-FBOPSWF6.js";import"./chunk-FOD6JEEU.js";import"./chunk-NKCL6RAF.js";import"./chunk-VRHLHGKR.js";import"./chunk-44HXRFOP.js";import"./chunk-O75SVMMB.js";import"./chunk-D6MPGK7R.js";import"./chunk-N4OWZLH5.js";import"./chunk-7SRSOZMP.js";export{z as GNNLayerFactory,i as QEFlashAttention,x as QEGNNEmbeddingIndex,y as QEGNNIndexFactory,a as QESONA,e as QE_FLASH_ATTENTION_CONFIG,g as QE_PERFORMANCE_TARGETS,f as QE_SONA_CONFIG,A as TensorCompressionFactory,u as batchComputeAttention,K as batchDifferentiableSearch,M as checkRuvectorPackagesAvailable,c as createDomainQESONA,j as createQEFlashAttention,b as createQESONA,D as getDifferentiableSearch,F as getGetCompressionLevel,E as getHierarchicalForward,G as getInit,h as getOptimalBlockConfig,k as getQEFlashAttentionConfig,n as getRuvectorDotProductAttention,m as getRuvectorFlashAttention,p as getRuvectorHyperbolicAttention,B as getRuvectorLayer,q as getRuvectorLinearAttention,r as getRuvectorMoEAttention,o as getRuvectorMultiHeadAttention,L as getRuvectorPackageVersions,C as getTensorCompress,l as getWorkloadTypes,N as initAllRuvectorPackages,w as initGNN,d as isAttentionAvailable,v as isGNNAvailable,s as toFloat32Array,H as toFloat32ArrayGNN,J as toIEmbedding,t as toNumberArrayAttn,I as toNumberArrayGNN};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.2");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v as L,w as M,x as N}from"./chunk-KFE6LB4I.js";import{a as v,b as w,c as x,d as y,e as z,f as A,g as B,h as C,i as D,j as E,k as F,l as G,m as H,n as I,o as J,p as K}from"./chunk-OFUF3APC.js";import"./chunk-4PYJCIRO.js";import"./chunk-Y4M2HMPR.js";import"./chunk-72VVTMEL.js";import"./chunk-5BDVFFYF.js";import"./chunk-JCH2FHJ7.js";import"./chunk-LY6PTRVL.js";import"./chunk-IXYF5BZY.js";import"./chunk-FYY7OJ6Y.js";import"./chunk-AZQ6HDPM.js";import"./chunk-Z2QNTRUX.js";import"./chunk-6SOGYNJG.js";import"./chunk-7MKF52GT.js";import"./chunk-XY2B2BEJ.js";import"./chunk-AINAWVGD.js";import"./chunk-NIW4CLN2.js";import"./chunk-UCXW24HY.js";import"./chunk-WKIYYF3G.js";import"./chunk-LIEA5EON.js";export{z as GNNLayerFactory,i as QEFlashAttention,x as QEGNNEmbeddingIndex,y as QEGNNIndexFactory,a as QESONA,e as QE_FLASH_ATTENTION_CONFIG,g as QE_PERFORMANCE_TARGETS,f as QE_SONA_CONFIG,A as TensorCompressionFactory,u as batchComputeAttention,K as batchDifferentiableSearch,M as checkRuvectorPackagesAvailable,c as createDomainQESONA,j as createQEFlashAttention,b as createQESONA,D as getDifferentiableSearch,F as getGetCompressionLevel,E as getHierarchicalForward,G as getInit,h as getOptimalBlockConfig,k as getQEFlashAttentionConfig,n as getRuvectorDotProductAttention,m as getRuvectorFlashAttention,p as getRuvectorHyperbolicAttention,B as getRuvectorLayer,q as getRuvectorLinearAttention,r as getRuvectorMoEAttention,o as getRuvectorMultiHeadAttention,L as getRuvectorPackageVersions,C as getTensorCompress,l as getWorkloadTypes,N as initAllRuvectorPackages,w as initGNN,d as isAttentionAvailable,v as isGNNAvailable,s as toFloat32Array,H as toFloat32ArrayGNN,J as toIEmbedding,t as toNumberArrayAttn,I as toNumberArrayGNN};
@@ -10,12 +10,13 @@ import { writeOutput, toJSON } from '../utils/ci-output.js';
10
10
  export function createCodeCommand(context, cleanupAndExit, ensureInitialized) {
11
11
  const codeCmd = new Command('code')
12
12
  .description('Code intelligence analysis')
13
- .argument('<action>', 'Action (index|search|impact|deps|complexity)')
13
+ .argument('<action>', 'Action (index|search|impact|deps|complexity|c4)')
14
14
  .argument('[target]', 'Target path or query')
15
15
  .option('--depth <depth>', 'Analysis depth', '3')
16
16
  .option('--include-tests', 'Include test files')
17
17
  .option('--incremental', 'Incremental indexing (index action only)')
18
18
  .option('--git-since <ref>', 'Index changes since git ref (index action only)')
19
+ .option('--level <level>', 'C4 level for c4 action (context|container|component|all)', 'all')
19
20
  .option('-F, --format <format>', 'Output format (text|json)', 'text')
20
21
  .option('-o, --output <path>', 'Write output to file')
21
22
  .addHelpText('after', `
@@ -27,6 +28,9 @@ Examples:
27
28
  aqe code impact src/auth/ Analyze change impact
28
29
  aqe code deps src/ Map dependencies
29
30
  aqe code complexity src/ Analyze code complexity metrics
31
+ aqe code c4 . Generate C4 architecture diagrams (Mermaid)
32
+ aqe code c4 src/ --level component Only the C4 component diagram
33
+ aqe code c4 . --format json -o c4.json Full C4 result as JSON
30
34
  `)
31
35
  .action(async (action, target, options) => {
32
36
  if (!await ensureInitialized())
@@ -328,9 +332,81 @@ Examples:
328
332
  }
329
333
  }
330
334
  }
335
+ else if (action === 'c4') {
336
+ const targetPath = path.resolve(target || '.');
337
+ const level = String(options.level || 'all').toLowerCase();
338
+ const validLevels = ['context', 'container', 'component', 'all'];
339
+ if (!validLevels.includes(level)) {
340
+ console.log(chalk.red(`Invalid --level: "${level}" (must be ${validLevels.join('|')})`));
341
+ return await cleanupAndExit(1);
342
+ }
343
+ if (typeof codeAPI.getCoordinator !== 'function' || !codeAPI.getCoordinator()) {
344
+ console.log(chalk.red('C4 generation not available — ensure the fleet is initialized'));
345
+ return await cleanupAndExit(1);
346
+ }
347
+ console.log(chalk.blue(`\n Generating C4 diagrams for ${targetPath} (level: ${level})...\n`));
348
+ const want = (l) => level === 'all' || level === l;
349
+ const result = await codeAPI.getCoordinator().generateC4Diagrams(targetPath, {
350
+ includeContext: want('context'),
351
+ includeContainer: want('container'),
352
+ includeComponent: want('component'),
353
+ includeDependency: level === 'all',
354
+ analyzeComponents: true,
355
+ detectExternalSystems: true,
356
+ analyzeCoupling: true,
357
+ });
358
+ if (!result.success || !result.value) {
359
+ console.log(chalk.red(`Failed: ${result.error?.message || 'Unknown error'}`));
360
+ return await cleanupAndExit(1);
361
+ }
362
+ const c4 = result.value;
363
+ const confidence = c4.metadata.analysisMetadata?.confidence;
364
+ if (format === 'json') {
365
+ writeOutput(toJSON(c4), options.output);
366
+ }
367
+ else {
368
+ // Build the Markdown (fenced mermaid blocks) — copy-paste into GitHub/IDE.
369
+ const blocks = [];
370
+ const add = (titleLevel, code) => {
371
+ if (code)
372
+ blocks.push(`### C4 ${titleLevel}\n\n\`\`\`mermaid\n${code.trim()}\n\`\`\``);
373
+ };
374
+ add('Context', c4.diagrams.context);
375
+ add('Container', c4.diagrams.container);
376
+ add('Component', c4.diagrams.component);
377
+ if (c4.diagrams.dependency)
378
+ blocks.push(`### Dependency Graph\n\n\`\`\`mermaid\n${c4.diagrams.dependency.trim()}\n\`\`\``);
379
+ const markdown = `# C4 Architecture — ${c4.metadata.projectName}\n\n${blocks.join('\n\n')}\n`;
380
+ if (options.output) {
381
+ writeOutput(markdown, options.output);
382
+ }
383
+ else {
384
+ console.log(markdown);
385
+ }
386
+ // Confidence banner (ADR-112 quality gate) — always to stderr-style console.
387
+ if (confidence) {
388
+ const color = confidence.level === 'high' ? chalk.green : confidence.level === 'medium' ? chalk.yellow : chalk.red;
389
+ console.log(color(`Confidence: ${confidence.level.toUpperCase()} (${(confidence.score * 100).toFixed(0)}%)`));
390
+ if (confidence.level !== 'high') {
391
+ for (const reason of confidence.reasons) {
392
+ console.log(chalk.gray(` - ${reason}`));
393
+ }
394
+ }
395
+ }
396
+ // Architecture analysis (coupling/cycles).
397
+ const coupling = c4.couplingAnalysis ?? [];
398
+ const circular = coupling.filter((c) => c.isCircular);
399
+ console.log(chalk.cyan(`\n Components: ${chalk.white(c4.components.length)} External systems: ${chalk.white(c4.externalSystems.length)} Relationships: ${chalk.white(c4.relationships.length)}`));
400
+ if (circular.length > 0) {
401
+ console.log(chalk.red(` Circular dependencies: ${circular.length}`));
402
+ for (const c of circular.slice(0, 3))
403
+ console.log(chalk.red(` ${c.moduleA} <-> ${c.moduleB}`));
404
+ }
405
+ }
406
+ }
331
407
  else {
332
408
  console.log(chalk.red(`\nUnknown action: ${action}`));
333
- console.log(chalk.gray(' Available: index, search, impact, deps, complexity\n'));
409
+ console.log(chalk.gray(' Available: index, search, impact, deps, complexity, c4\n'));
334
410
  await cleanupAndExit(1);
335
411
  }
336
412
  console.log('');
@@ -349,7 +349,7 @@ _aqe_completions() {
349
349
  local protocol_subcmds="run"
350
350
  local completions_subcmds="bash zsh fish powershell install"
351
351
  local brain_subcmds="export import info diff search witness-backfill"
352
- local code_actions="index search impact deps"
352
+ local code_actions="index search impact deps complexity c4"
353
353
  local test_actions="generate execute"
354
354
 
355
355
  # Domains
@@ -1287,6 +1287,9 @@ complete -c aqe -n "__fish_seen_subcommand_from code; and not __fish_seen_subcom
1287
1287
  complete -c aqe -n "__fish_seen_subcommand_from code; and not __fish_seen_subcommand_from index search impact deps" -a "search" -d "Search code"
1288
1288
  complete -c aqe -n "__fish_seen_subcommand_from code; and not __fish_seen_subcommand_from index search impact deps" -a "impact" -d "Analyze impact"
1289
1289
  complete -c aqe -n "__fish_seen_subcommand_from code; and not __fish_seen_subcommand_from index search impact deps" -a "deps" -d "Map dependencies"
1290
+ complete -c aqe -n "__fish_seen_subcommand_from code; and not __fish_seen_subcommand_from index search impact deps complexity c4" -a "complexity" -d "Code complexity metrics"
1291
+ complete -c aqe -n "__fish_seen_subcommand_from code; and not __fish_seen_subcommand_from index search impact deps complexity c4" -a "c4" -d "Generate C4 architecture diagrams"
1292
+ complete -c aqe -n "__fish_seen_subcommand_from code; and __fish_seen_subcommand_from c4" -l level -d "C4 level" -xa "context container component all"
1290
1293
  complete -c aqe -n "__fish_seen_subcommand_from code" -l depth -d "Analysis depth" -xa "1 2 3 4 5"
1291
1294
  complete -c aqe -n "__fish_seen_subcommand_from code" -l include-tests -d "Include test files"
1292
1295
  # Directory completion for code actions
@@ -6,12 +6,14 @@
6
6
  * - QEGNNEmbeddingIndex: Code graph embeddings with HNSW for fast similarity search
7
7
  * - QESONA: Learns and adapts code patterns for improved intelligence
8
8
  */
9
+ import { existsSync } from 'node:fs';
9
10
  import { LoggerFactory } from '../../logging/index.js';
10
11
  import { v4 as uuidv4 } from 'uuid';
11
12
  import { err } from '../../shared/types';
12
13
  import { toError } from '../../shared/error-utils.js';
13
14
  import { CodeIntelligenceEvents, createEvent, } from '../../shared/events/domain-events';
14
15
  import { ProductFactorsBridgeService, } from './services/product-factors-bridge';
16
+ import { createKnowledgeGraphRelationshipResolver } from './services/c4-model/kg-relationships';
15
17
  import { KnowledgeGraphService, } from './services/knowledge-graph';
16
18
  import { SemanticAnalyzerService, } from './services/semantic-analyzer';
17
19
  import { ImpactAnalyzerService, } from './services/impact-analyzer';
@@ -85,9 +87,12 @@ export class CodeIntelligenceCoordinator extends BaseDomainCoordinator {
85
87
  this.semanticAnalyzer = new SemanticAnalyzerService(memory);
86
88
  this.impactAnalyzer = new ImpactAnalyzerService(memory, this.knowledgeGraph);
87
89
  this.fileReader = new FileReader();
88
- // Initialize Product Factors Bridge
90
+ // Initialize Product Factors Bridge.
91
+ // ADR-112 C2: inject a KG-backed relationship resolver so C4 component
92
+ // diagrams use REAL import/call edges (not the naming heuristic).
89
93
  this.productFactorsBridge = new ProductFactorsBridgeService(eventBus, memory, {
90
94
  publishEvents: this.config.publishEvents,
95
+ relationshipResolver: createKnowledgeGraphRelationshipResolver((projectPath) => new KnowledgeGraphService({ memory, llmRouter }, { basePath: projectPath })),
91
96
  });
92
97
  }
93
98
  // ==========================================================================
@@ -949,9 +954,8 @@ export class CodeIntelligenceCoordinator extends BaseDomainCoordinator {
949
954
  for (const marker of markers) {
950
955
  try {
951
956
  const markerPath = `${currentPath}/${marker}`;
952
- // Use synchronous check (since we're in async context anyway)
953
- const fs = require('fs');
954
- if (fs.existsSync(markerPath)) {
957
+ // Synchronous existence check (we're in an async context anyway).
958
+ if (existsSync(markerPath)) {
955
959
  return currentPath;
956
960
  }
957
961
  }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * ADR-112 — Detected → C4 spec mapping.
3
+ *
4
+ * Pure, dependency-free functions that convert the code-intelligence DETECTOR
5
+ * output (shared `Detected*` types, produced by ProductFactorsBridgeService's
6
+ * filesystem scan) into the `C4ModelService` Build*Request specs.
7
+ *
8
+ * This is the consolidation seam: the bridge keeps detection; the rich
9
+ * `C4ModelService` does all rendering/analysis/storage. Keeping the mapping pure
10
+ * makes the C1 parity test (every detected element survives into a spec) trivial
11
+ * and keeps zero coupling to the service's async/embedding/memory machinery.
12
+ */
13
+ import type { C4ProjectInfo, DetectedExternalSystem, DetectedComponent, DetectedRelationship, ExternalSystemType, C4ComponentType, C4RelationshipType as SharedC4RelationshipType } from '../../../../shared/c4-model';
14
+ import type { BuildContextRequest, BuildContainerRequest, BuildComponentRequest, ExternalSystemSpec, ComponentSpec, ComponentRelationshipSpec, SystemType, ComponentType, C4RelationshipType as DomainC4RelationshipType } from './types';
15
+ /** The single application container the detector models today (mirrors the
16
+ * legacy bridge, which hardcoded one "Application" container). Real multi-
17
+ * container detection is future work (ADR-112 G-ABORT note). */
18
+ export declare const DEFAULT_CONTAINER_NAME = "Application";
19
+ export declare function mapExternalSystemType(type: ExternalSystemType): SystemType;
20
+ export declare function mapComponentType(type: C4ComponentType): ComponentType;
21
+ export declare function mapRelationshipType(type: SharedC4RelationshipType): DomainC4RelationshipType;
22
+ /** Detected external systems → C4 ExternalSystemSpec[]. */
23
+ export declare function toExternalSystemSpecs(externalSystems: DetectedExternalSystem[]): ExternalSystemSpec[];
24
+ /** Detected components → C4 ComponentSpec[]. */
25
+ export declare function toComponentSpecs(components: DetectedComponent[]): ComponentSpec[];
26
+ /**
27
+ * Detected relationships → C4 ComponentRelationshipSpec[].
28
+ *
29
+ * `DetectedRelationship` references components by `id`; the service re-derives
30
+ * ids by sanitizing the spec's `from`/`to` NAMES. So we translate ids back to
31
+ * names via the component set; relationships whose endpoints aren't in the set
32
+ * are dropped (they can't render) — surfaced by the caller's count delta.
33
+ */
34
+ export declare function toComponentRelationshipSpecs(components: DetectedComponent[], relationships: DetectedRelationship[]): ComponentRelationshipSpec[];
35
+ /** Project + detected external systems → BuildContextRequest. */
36
+ export declare function toContextRequest(project: C4ProjectInfo, externalSystems: DetectedExternalSystem[]): BuildContextRequest;
37
+ /** Project + detected external systems → BuildContainerRequest (single app container). */
38
+ export declare function toContainerRequest(project: C4ProjectInfo, externalSystems: DetectedExternalSystem[]): BuildContainerRequest;
39
+ /** Detected components + relationships → BuildComponentRequest. */
40
+ export declare function toComponentRequest(components: DetectedComponent[], relationships: DetectedRelationship[], containerName?: string): BuildComponentRequest;
41
+ //# sourceMappingURL=from-detected.d.ts.map
@@ -0,0 +1,152 @@
1
+ /**
2
+ * ADR-112 — Detected → C4 spec mapping.
3
+ *
4
+ * Pure, dependency-free functions that convert the code-intelligence DETECTOR
5
+ * output (shared `Detected*` types, produced by ProductFactorsBridgeService's
6
+ * filesystem scan) into the `C4ModelService` Build*Request specs.
7
+ *
8
+ * This is the consolidation seam: the bridge keeps detection; the rich
9
+ * `C4ModelService` does all rendering/analysis/storage. Keeping the mapping pure
10
+ * makes the C1 parity test (every detected element survives into a spec) trivial
11
+ * and keeps zero coupling to the service's async/embedding/memory machinery.
12
+ */
13
+ /** The single application container the detector models today (mirrors the
14
+ * legacy bridge, which hardcoded one "Application" container). Real multi-
15
+ * container detection is future work (ADR-112 G-ABORT note). */
16
+ export const DEFAULT_CONTAINER_NAME = 'Application';
17
+ /** shared ExternalSystemType → domain SystemType (C4ModelService vocabulary). */
18
+ const EXTERNAL_SYSTEM_TYPE_MAP = {
19
+ database: 'database',
20
+ cache: 'cache',
21
+ queue: 'message_queue',
22
+ api: 'api',
23
+ storage: 'storage',
24
+ auth: 'authentication',
25
+ monitoring: 'monitoring',
26
+ cloud: 'third_party',
27
+ };
28
+ /** shared C4ComponentType → domain ComponentType (C4ModelService vocabulary).
29
+ * Types the service lacks (transformer/layer/feature/package/other) fold to the
30
+ * nearest supported concept so no component is dropped. */
31
+ const COMPONENT_TYPE_MAP = {
32
+ controller: 'controller',
33
+ service: 'service',
34
+ repository: 'repository',
35
+ facade: 'facade',
36
+ factory: 'factory',
37
+ adapter: 'adapter',
38
+ gateway: 'gateway',
39
+ handler: 'handler',
40
+ validator: 'validator',
41
+ transformer: 'adapter',
42
+ utility: 'utility',
43
+ module: 'module',
44
+ layer: 'module',
45
+ feature: 'module',
46
+ package: 'module',
47
+ other: 'module',
48
+ };
49
+ export function mapExternalSystemType(type) {
50
+ return EXTERNAL_SYSTEM_TYPE_MAP[type] ?? 'third_party';
51
+ }
52
+ export function mapComponentType(type) {
53
+ return COMPONENT_TYPE_MAP[type] ?? 'module';
54
+ }
55
+ /** shared C4RelationshipType → domain C4RelationshipType (C4ModelService vocabulary).
56
+ * The two unions diverge (shared `sends`/`reads`/`writes`/`imports`/`stores_data_in`
57
+ * vs domain `sends_to`/`reads_from`/`writes_to`); fold to the nearest domain verb. */
58
+ const RELATIONSHIP_TYPE_MAP = {
59
+ uses: 'uses',
60
+ calls: 'calls',
61
+ imports: 'depends_on',
62
+ depends_on: 'depends_on',
63
+ extends: 'extends',
64
+ implements: 'implements',
65
+ sends: 'sends_to',
66
+ reads: 'reads_from',
67
+ writes: 'writes_to',
68
+ stores_data_in: 'writes_to',
69
+ authenticates_with: 'authenticates_with',
70
+ };
71
+ export function mapRelationshipType(type) {
72
+ return RELATIONSHIP_TYPE_MAP[type] ?? 'uses';
73
+ }
74
+ /** Detected external systems → C4 ExternalSystemSpec[]. */
75
+ export function toExternalSystemSpecs(externalSystems) {
76
+ return externalSystems.map((es) => ({
77
+ name: es.name,
78
+ type: mapExternalSystemType(es.type),
79
+ technology: es.technology,
80
+ relationshipDescription: es.relationship,
81
+ }));
82
+ }
83
+ /** Detected components → C4 ComponentSpec[]. */
84
+ export function toComponentSpecs(components) {
85
+ return components.map((c) => ({
86
+ name: c.name,
87
+ type: mapComponentType(c.type),
88
+ technology: c.technology,
89
+ boundary: c.boundary,
90
+ files: c.files,
91
+ responsibilities: c.responsibilities,
92
+ }));
93
+ }
94
+ /**
95
+ * Detected relationships → C4 ComponentRelationshipSpec[].
96
+ *
97
+ * `DetectedRelationship` references components by `id`; the service re-derives
98
+ * ids by sanitizing the spec's `from`/`to` NAMES. So we translate ids back to
99
+ * names via the component set; relationships whose endpoints aren't in the set
100
+ * are dropped (they can't render) — surfaced by the caller's count delta.
101
+ */
102
+ export function toComponentRelationshipSpecs(components, relationships) {
103
+ const nameById = new Map(components.map((c) => [c.id, c.name]));
104
+ const specs = [];
105
+ for (const rel of relationships) {
106
+ const from = nameById.get(rel.sourceId);
107
+ const to = nameById.get(rel.targetId);
108
+ if (from === undefined || to === undefined)
109
+ continue;
110
+ specs.push({ from, to, type: mapRelationshipType(rel.type) });
111
+ }
112
+ return specs;
113
+ }
114
+ /** Project + detected external systems → BuildContextRequest. */
115
+ export function toContextRequest(project, externalSystems) {
116
+ return {
117
+ systemName: project.name,
118
+ systemDescription: project.description,
119
+ externalSystems: toExternalSystemSpecs(externalSystems),
120
+ };
121
+ }
122
+ /** Project + detected external systems → BuildContainerRequest (single app container). */
123
+ export function toContainerRequest(project, externalSystems) {
124
+ const externalSpecs = toExternalSystemSpecs(externalSystems);
125
+ return {
126
+ systemName: project.name,
127
+ containers: [
128
+ {
129
+ name: DEFAULT_CONTAINER_NAME,
130
+ type: 'web_application',
131
+ technology: 'TypeScript',
132
+ description: 'Main application',
133
+ },
134
+ ],
135
+ externalSystems: externalSpecs,
136
+ // The legacy bridge drew Rel(app, <external>) for each external system.
137
+ dependencies: externalSpecs.map((es) => ({
138
+ from: DEFAULT_CONTAINER_NAME,
139
+ to: es.name,
140
+ description: es.relationshipDescription,
141
+ })),
142
+ };
143
+ }
144
+ /** Detected components + relationships → BuildComponentRequest. */
145
+ export function toComponentRequest(components, relationships, containerName = DEFAULT_CONTAINER_NAME) {
146
+ return {
147
+ containerName,
148
+ components: toComponentSpecs(components),
149
+ relationships: toComponentRelationshipSpecs(components, relationships),
150
+ };
151
+ }
152
+ //# sourceMappingURL=from-detected.js.map
@@ -0,0 +1,71 @@
1
+ /**
2
+ * ADR-112 C2 — real component relationships from the Knowledge Graph.
3
+ *
4
+ * The detector models components as top-level `src/` directories but its edge
5
+ * detection is a NAMING heuristic (`likelyHasRelationship`) that never reads the
6
+ * code. This module folds the KnowledgeGraph's REAL file-level import/call edges
7
+ * (extracted from the AST by the TS parser — no LLM needed) up to
8
+ * component→component relationships.
9
+ *
10
+ * Pure aggregation + a resolver that drives the existing KG. The resolver
11
+ * returns `null` on any miss so the bridge falls back to the heuristic — C2 can
12
+ * only improve accuracy, never break generation.
13
+ */
14
+ import type { DetectedComponent, DetectedRelationship } from '../../../../shared/c4-model';
15
+ /** Minimal shape of the KG `mapDependencies` result we consume. */
16
+ export interface DependencyMapLike {
17
+ nodes: Array<{
18
+ id: string;
19
+ path: string;
20
+ }>;
21
+ edges: Array<{
22
+ source: string;
23
+ target: string;
24
+ }>;
25
+ }
26
+ /** Minimal slice of the KnowledgeGraph the resolver needs (keeps this decoupled). */
27
+ export interface KnowledgeGraphSlice {
28
+ index(req: {
29
+ paths: string[];
30
+ incremental?: boolean;
31
+ }): Promise<{
32
+ success: boolean;
33
+ }>;
34
+ mapDependencies(req: {
35
+ files: string[];
36
+ direction: 'incoming' | 'outgoing' | 'both';
37
+ depth?: number;
38
+ }): Promise<{
39
+ success: boolean;
40
+ value?: DependencyMapLike;
41
+ }>;
42
+ }
43
+ /**
44
+ * Resolve real component relationships for a set of detected components.
45
+ * Returns `null` when it cannot (no files, KG miss, no cross-component edges) so
46
+ * the caller keeps the heuristic.
47
+ */
48
+ export type RelationshipResolver = (components: DetectedComponent[], projectPath: string) => Promise<DetectedRelationship[] | null>;
49
+ /**
50
+ * PURE: fold file-level dependency edges into component→component relationships.
51
+ * An edge counts only when both endpoints map to *different* components; weight =
52
+ * number of underlying file edges. Exported for direct testing.
53
+ */
54
+ export declare function aggregateDependencyMapToComponentRelationships(components: DetectedComponent[], dependencyMap: DependencyMapLike, projectPath: string): DetectedRelationship[];
55
+ /**
56
+ * A KG factory scoped to a project root. Building the KG per-call lets us set
57
+ * the FileReader base directory to `projectPath`, so analyzing a repo outside
58
+ * cwd doesn't trip the path-traversal guard.
59
+ */
60
+ export type KnowledgeGraphFactory = (projectPath: string) => KnowledgeGraphSlice;
61
+ /**
62
+ * Build a resolver backed by the existing KnowledgeGraph. It (incrementally)
63
+ * indexes the component files so edges exist regardless of prior `aqe code
64
+ * index`, maps their dependencies, and aggregates to component edges.
65
+ *
66
+ * Accepts a project-scoped factory (preferred) or a single pre-built KG.
67
+ */
68
+ export declare function createKnowledgeGraphRelationshipResolver(kgOrFactory: KnowledgeGraphSlice | KnowledgeGraphFactory, opts?: {
69
+ autoIndex?: boolean;
70
+ }): RelationshipResolver;
71
+ //# sourceMappingURL=kg-relationships.d.ts.map
@@ -0,0 +1,87 @@
1
+ /**
2
+ * ADR-112 C2 — real component relationships from the Knowledge Graph.
3
+ *
4
+ * The detector models components as top-level `src/` directories but its edge
5
+ * detection is a NAMING heuristic (`likelyHasRelationship`) that never reads the
6
+ * code. This module folds the KnowledgeGraph's REAL file-level import/call edges
7
+ * (extracted from the AST by the TS parser — no LLM needed) up to
8
+ * component→component relationships.
9
+ *
10
+ * Pure aggregation + a resolver that drives the existing KG. The resolver
11
+ * returns `null` on any miss so the bridge falls back to the heuristic — C2 can
12
+ * only improve accuracy, never break generation.
13
+ */
14
+ import * as path from 'path';
15
+ const normalize = (projectPath, p) => path.resolve(projectPath, p).replace(/\\/g, '/');
16
+ /**
17
+ * PURE: fold file-level dependency edges into component→component relationships.
18
+ * An edge counts only when both endpoints map to *different* components; weight =
19
+ * number of underlying file edges. Exported for direct testing.
20
+ */
21
+ export function aggregateDependencyMapToComponentRelationships(components, dependencyMap, projectPath) {
22
+ // normalized file path → componentId
23
+ const fileToComponent = new Map();
24
+ for (const c of components) {
25
+ for (const f of c.files ?? [])
26
+ fileToComponent.set(normalize(projectPath, f), c.id);
27
+ }
28
+ const idToPath = new Map(dependencyMap.nodes.map((n) => [n.id, normalize(projectPath, n.path)]));
29
+ const componentOf = (nodeId) => {
30
+ const p = idToPath.get(nodeId);
31
+ if (!p)
32
+ return undefined;
33
+ const exact = fileToComponent.get(p);
34
+ if (exact)
35
+ return exact;
36
+ // Tolerate abs/rel divergence from the parser via a suffix match.
37
+ for (const [file, cid] of fileToComponent) {
38
+ if (p.endsWith(file) || file.endsWith(p))
39
+ return cid;
40
+ }
41
+ return undefined;
42
+ };
43
+ const byKey = new Map();
44
+ for (const e of dependencyMap.edges) {
45
+ const cs = componentOf(e.source);
46
+ const ct = componentOf(e.target);
47
+ if (!cs || !ct || cs === ct)
48
+ continue;
49
+ const key = `${cs}->${ct}`;
50
+ const existing = byKey.get(key);
51
+ if (existing)
52
+ existing.weight = (existing.weight ?? 1) + 1;
53
+ else
54
+ byKey.set(key, { sourceId: cs, targetId: ct, type: 'depends_on', weight: 1 });
55
+ }
56
+ return [...byKey.values()];
57
+ }
58
+ /**
59
+ * Build a resolver backed by the existing KnowledgeGraph. It (incrementally)
60
+ * indexes the component files so edges exist regardless of prior `aqe code
61
+ * index`, maps their dependencies, and aggregates to component edges.
62
+ *
63
+ * Accepts a project-scoped factory (preferred) or a single pre-built KG.
64
+ */
65
+ export function createKnowledgeGraphRelationshipResolver(kgOrFactory, opts = {}) {
66
+ const autoIndex = opts.autoIndex ?? true;
67
+ const factory = typeof kgOrFactory === 'function' ? kgOrFactory : () => kgOrFactory;
68
+ return async (components, projectPath) => {
69
+ const absFiles = components.flatMap((c) => (c.files ?? []).map((f) => path.resolve(projectPath, f)));
70
+ if (absFiles.length === 0)
71
+ return null;
72
+ try {
73
+ const kg = factory(projectPath);
74
+ if (autoIndex)
75
+ await kg.index({ paths: absFiles, incremental: true });
76
+ const dep = await kg.mapDependencies({ files: absFiles, direction: 'both' });
77
+ if (!dep.success || !dep.value)
78
+ return null;
79
+ const rels = aggregateDependencyMapToComponentRelationships(components, dep.value, projectPath);
80
+ return rels.length > 0 ? rels : null;
81
+ }
82
+ catch {
83
+ return null; // any failure → heuristic fallback
84
+ }
85
+ };
86
+ }
87
+ //# sourceMappingURL=kg-relationships.js.map
@@ -40,6 +40,12 @@ export interface KnowledgeGraphConfig {
40
40
  llmModelTier?: number;
41
41
  /** ADR-051: Max tokens for LLM responses */
42
42
  llmMaxTokens?: number;
43
+ /**
44
+ * ADR-112 C2: base directory for file reads. Defaults to cwd. Set to a
45
+ * project root so analyzing a repo OUTSIDE cwd (e.g. `aqe code c4 /other`)
46
+ * doesn't trip the FileReader path-traversal guard.
47
+ */
48
+ basePath?: string;
43
49
  }
44
50
  /**
45
51
  * Dependencies for KnowledgeGraphService
@@ -72,7 +72,7 @@ export class KnowledgeGraphService {
72
72
  this.llmRouter = undefined;
73
73
  }
74
74
  this.tsParser = new TypeScriptParser();
75
- this.fileReader = new FileReader();
75
+ this.fileReader = new FileReader(this.config.basePath ? { basePath: this.config.basePath } : undefined);
76
76
  this.embedder = new NomicEmbedder({
77
77
  enableFallback: true,
78
78
  });
@@ -390,7 +390,7 @@ Be precise and only report high-confidence findings.`,
390
390
  }
391
391
  return { semanticRelationships: [], designPatterns: [], architecturalBoundaries: [], dependencyImpacts: [] };
392
392
  }
393
- catch (error) {
393
+ catch {
394
394
  logger.warn('LLM relationship extraction failed:');
395
395
  return { semanticRelationships: [], designPatterns: [], architecturalBoundaries: [], dependencyImpacts: [] };
396
396
  }
@@ -501,7 +501,7 @@ Return JSON: { "rankedIds": ["id1", "id2", ...], "insights": ["insight1", "insig
501
501
  }
502
502
  return { enhancedResults: results, insights: [] };
503
503
  }
504
- catch (error) {
504
+ catch {
505
505
  logger.warn('LLM query enhancement failed:');
506
506
  return { enhancedResults: results, insights: [] };
507
507
  }
@@ -13,7 +13,8 @@
13
13
  */
14
14
  import { Result } from '../../../shared/types';
15
15
  import { EventBus, MemoryBackend } from '../../../kernel/interfaces';
16
- import { C4DiagramResult, C4DiagramRequest, C4ProjectInfo, DetectedExternalSystem, DetectedComponent, DetectedRelationship, IC4DiagramGenerator } from '../../../shared/c4-model';
16
+ import { C4DiagramResult, C4DiagramRequest, DetectedExternalSystem, DetectedComponent, DetectedRelationship } from '../../../shared/c4-model';
17
+ import type { RelationshipResolver } from './c4-model/kg-relationships';
17
18
  export interface ProductFactorsBridgeConfig {
18
19
  /** Cache TTL in milliseconds (default: 1 hour) */
19
20
  cacheTtlMs: number;
@@ -23,6 +24,18 @@ export interface ProductFactorsBridgeConfig {
23
24
  excludePatterns: string[];
24
25
  /** Maximum files to analyze */
25
26
  maxFiles: number;
27
+ /**
28
+ * ADR-112 C2: optional resolver that returns REAL component relationships
29
+ * from the Knowledge Graph. When it yields edges, they replace the naming
30
+ * heuristic; otherwise the heuristic stands. Off by default (no resolver).
31
+ */
32
+ relationshipResolver?: RelationshipResolver;
33
+ /**
34
+ * ADR-112: persist diagram embeddings so they're semantically searchable
35
+ * (`qe/code/c4 search`). Off by default — the internal product-factors path
36
+ * stays fast/offline; surfaces that expose search (MCP) turn it on.
37
+ */
38
+ enableC4Embeddings?: boolean;
26
39
  }
27
40
  export interface IProductFactorsBridge {
28
41
  /** Initialize the bridge and subscribe to events */
@@ -40,13 +53,21 @@ export interface IProductFactorsBridge {
40
53
  /** Get components for a project */
41
54
  getComponents(projectPath: string): Promise<Result<DetectedComponent[], Error>>;
42
55
  }
43
- export declare class ProductFactorsBridgeService implements IProductFactorsBridge, IC4DiagramGenerator {
56
+ export declare class ProductFactorsBridgeService implements IProductFactorsBridge {
44
57
  private readonly eventBus;
45
58
  private readonly memory;
46
59
  private readonly config;
47
60
  private initialized;
48
61
  private eventSubscriptions;
62
+ /** ADR-112: the consolidated render+analyze+store engine (lazily built). */
63
+ private c4Service?;
49
64
  constructor(eventBus: EventBus, memory: MemoryBackend, config?: Partial<ProductFactorsBridgeConfig>);
65
+ /**
66
+ * ADR-112: lazily construct the shared C4ModelService.
67
+ * Embeddings are OFF on this internal product-factors path (keeps it offline +
68
+ * fast); the CLI/MCP surfaces opt embeddings in when semantic search is wanted.
69
+ */
70
+ private getC4Service;
50
71
  initialize(): Promise<void>;
51
72
  dispose(): Promise<void>;
52
73
  private subscribeToEvents;
@@ -54,9 +75,9 @@ export declare class ProductFactorsBridgeService implements IProductFactorsBridg
54
75
  private handleImpactAnalysisCompleted;
55
76
  requestC4Diagrams(request: C4DiagramRequest): Promise<Result<C4DiagramResult, Error>>;
56
77
  private generateC4Diagrams;
57
- generateContextDiagram(project: C4ProjectInfo, externalSystems: DetectedExternalSystem[]): string;
58
- generateContainerDiagram(project: C4ProjectInfo, externalSystems: DetectedExternalSystem[]): string;
59
- generateComponentDiagram(projectName: string, components: DetectedComponent[], relationships: DetectedRelationship[]): string;
78
+ private renderContext;
79
+ private renderContainer;
80
+ private renderComponent;
60
81
  generateDependencyGraph(components: DetectedComponent[], relationships: DetectedRelationship[]): string;
61
82
  private getProjectMetadata;
62
83
  private detectExternalSystems;