agentic-qe 3.14.4 → 3.14.6

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 (486) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +169 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/adapters/ag-ui/event-types.d.ts +1 -1
  5. package/dist/audit/witness-chain-hash.d.ts +18 -0
  6. package/dist/audit/witness-chain-hash.js +37 -0
  7. package/dist/audit/witness-chain-repair.d.ts +71 -0
  8. package/dist/audit/witness-chain-repair.js +203 -0
  9. package/dist/audit/witness-chain-verifier.d.ts +152 -0
  10. package/dist/audit/witness-chain-verifier.js +293 -0
  11. package/dist/audit/witness-chain.d.ts +10 -43
  12. package/dist/audit/witness-chain.js +43 -126
  13. package/dist/audit/witness-findings.js +4 -1
  14. package/dist/cli/bundle.js +13 -10
  15. package/dist/cli/chunks/adapter-UYOJPTOX.js +2 -0
  16. package/dist/cli/chunks/agent-booster-wasm-2YGML6OU.js +2 -0
  17. package/dist/cli/chunks/{agent-handler-RDNTK4CA.js → agent-handler-D5SSQYNU.js} +2 -2
  18. package/dist/cli/chunks/{agent-memory-branch-NAAMBWIR.js → agent-memory-branch-YHPLTITV.js} +2 -2
  19. package/dist/cli/chunks/aqe-learning-engine-JR5AVQXR.js +2 -0
  20. package/dist/cli/chunks/{arena-KXFHRWX4.js → arena-7BGOXGXO.js} +2 -2
  21. package/dist/cli/chunks/{arena-HXTWJ5YY.js → arena-MCE6EU7K.js} +4 -4
  22. package/dist/cli/chunks/audit-BMWTQECB.js +4 -0
  23. package/dist/cli/chunks/base-DRZ2LS6X.js +2 -0
  24. package/dist/cli/chunks/{better-sqlite3-UICJZIDG.js → better-sqlite3-PMUNGASU.js} +2 -2
  25. package/dist/cli/chunks/brain-handler-QPUFYX7F.js +94 -0
  26. package/dist/cli/chunks/{branch-enumerator-SS7UNVIA.js → branch-enumerator-WKFDGRN4.js} +2 -2
  27. package/dist/cli/chunks/{browser-77GI6KBE.js → browser-VY5HKH5X.js} +2 -2
  28. package/dist/cli/chunks/browser-workflow-CJ7T3MXF.js +2 -0
  29. package/dist/cli/chunks/{chunk-PZJOPURC.js → chunk-257E2A5M.js} +5 -5
  30. package/dist/cli/chunks/{chunk-55RWDRJD.js → chunk-2JVWITNK.js} +4 -4
  31. package/dist/cli/chunks/{chunk-BOARZKU3.js → chunk-2NPKIBAZ.js} +2 -2
  32. package/dist/cli/chunks/chunk-2TMWAQQ3.js +13 -0
  33. package/dist/cli/chunks/{chunk-M4WJKGVK.js → chunk-2YXGBZWV.js} +1 -1
  34. package/dist/cli/chunks/{chunk-3VOQRIQM.js → chunk-3EA536JF.js} +2 -2
  35. package/dist/cli/chunks/{chunk-ZZDIMOOV.js → chunk-3EZOZN25.js} +2 -2
  36. package/dist/cli/chunks/{chunk-MNW6QGNJ.js → chunk-3HZS4M3O.js} +2 -2
  37. package/dist/cli/chunks/{chunk-EKQ673SA.js → chunk-3NIG7S5W.js} +1 -1
  38. package/dist/cli/chunks/{chunk-7D777LTF.js → chunk-4N23RFDU.js} +2 -2
  39. package/dist/cli/chunks/{chunk-BOZZYWCR.js → chunk-5J6W7SIA.js} +1 -1
  40. package/dist/cli/chunks/{chunk-HIVA55CJ.js → chunk-5OOMJGFN.js} +1 -1
  41. package/dist/cli/chunks/{chunk-W7BWUTVV.js → chunk-5QQSIGUA.js} +2 -2
  42. package/dist/cli/chunks/{chunk-PAWXJ73E.js → chunk-5VFPCSK7.js} +1 -1
  43. package/dist/cli/chunks/{chunk-KPA7MZ6C.js → chunk-62N4NUJH.js} +2 -2
  44. package/dist/cli/chunks/chunk-64VGZQLB.js +2 -0
  45. package/dist/cli/chunks/{chunk-64PFWE2F.js → chunk-66VWCR67.js} +2 -2
  46. package/dist/cli/chunks/{chunk-XRT2WRMS.js → chunk-6LIHFV7O.js} +2 -2
  47. package/dist/cli/chunks/{chunk-STJCATGN.js → chunk-6OS76PHI.js} +2 -2
  48. package/dist/cli/chunks/{chunk-ZNPKDCZR.js → chunk-6RE3X4V5.js} +2 -2
  49. package/dist/cli/chunks/{chunk-BFP7KO7P.js → chunk-6SH5VZUD.js} +2 -2
  50. package/dist/cli/chunks/chunk-6SQM2MUX.js +4 -0
  51. package/dist/cli/chunks/{chunk-IPR4QP3H.js → chunk-6U7LNMWZ.js} +2 -2
  52. package/dist/cli/chunks/{chunk-MIQTXNBG.js → chunk-72KXSMWI.js} +1 -1
  53. package/dist/cli/chunks/chunk-7CUQCCMD.js +27 -0
  54. package/dist/cli/chunks/chunk-7D3V65N5.js +2 -0
  55. package/dist/cli/chunks/{chunk-JZ3ORVZ3.js → chunk-7J6QC567.js} +3 -3
  56. package/dist/cli/chunks/{chunk-4OYFXLBK.js → chunk-7LPR6HJG.js} +2 -2
  57. package/dist/cli/chunks/{chunk-4MHXCAG2.js → chunk-7NITCZWD.js} +1 -1
  58. package/dist/cli/chunks/{chunk-M5QUBZY6.js → chunk-7Z5LHRC3.js} +2 -2
  59. package/dist/cli/chunks/{chunk-CSU5NYOX.js → chunk-AHKELLIO.js} +4 -4
  60. package/dist/cli/chunks/{chunk-DHJPWQBR.js → chunk-AIRGNL55.js} +2 -2
  61. package/dist/cli/chunks/{chunk-C2WU3533.js → chunk-AJRUJAAK.js} +1 -1
  62. package/dist/cli/chunks/{chunk-HIYXCDEP.js → chunk-AVBJYI5I.js} +1 -1
  63. package/dist/cli/chunks/{chunk-U5K45TFH.js → chunk-B6D2CHEH.js} +1 -1
  64. package/dist/cli/chunks/{chunk-FRH6VAUS.js → chunk-B6MOJC3X.js} +1 -1
  65. package/dist/cli/chunks/{chunk-HUWNIPZ5.js → chunk-BAMN2CHI.js} +1 -1
  66. package/dist/cli/chunks/{chunk-ONII3572.js → chunk-BBT64TII.js} +3 -3
  67. package/dist/cli/chunks/{chunk-KSKEF7LZ.js → chunk-BJTJLJRZ.js} +3 -3
  68. package/dist/cli/chunks/chunk-BMAPORJ7.js +15 -0
  69. package/dist/cli/chunks/{chunk-CIZ5JPDC.js → chunk-BPEDWS6O.js} +3 -3
  70. package/dist/cli/chunks/{chunk-Z3RHREWF.js → chunk-BVR7RMC5.js} +1 -1
  71. package/dist/cli/chunks/{chunk-HDSAM2RE.js → chunk-C6KWXUFJ.js} +2 -2
  72. package/dist/cli/chunks/{chunk-ZBAKA4YB.js → chunk-CCK4BF76.js} +1 -1
  73. package/dist/cli/chunks/{chunk-IFCLB7FJ.js → chunk-CD542DNJ.js} +1 -1
  74. package/dist/cli/chunks/{chunk-6KJABXAR.js → chunk-CF2ISEOJ.js} +2 -2
  75. package/dist/cli/chunks/chunk-CM7U6TAX.js +5 -0
  76. package/dist/cli/chunks/{chunk-3X3DJZJJ.js → chunk-D45SG6CP.js} +1 -1
  77. package/dist/cli/chunks/{chunk-DAEFDCJ4.js → chunk-D6CJIGRU.js} +89 -83
  78. package/dist/cli/chunks/{chunk-MVPCNSPY.js → chunk-DBDPRORT.js} +2 -2
  79. package/dist/cli/chunks/{chunk-AUXFKCQL.js → chunk-DHVX5UB2.js} +2 -2
  80. package/dist/cli/chunks/{chunk-GPLQ6DOK.js → chunk-DK4XN4CU.js} +2 -2
  81. package/dist/cli/chunks/{chunk-SRKETSFF.js → chunk-DPYSUDAO.js} +1 -1
  82. package/dist/cli/chunks/{chunk-CNG6GQEZ.js → chunk-DUYOVM5I.js} +2 -2
  83. package/dist/cli/chunks/{chunk-VIHTL3U2.js → chunk-DZ3AUAAB.js} +2 -2
  84. package/dist/cli/chunks/{chunk-CU46J64M.js → chunk-E6G2RD5H.js} +2 -2
  85. package/dist/cli/chunks/{chunk-5YPYDPBJ.js → chunk-EAY2JMZG.js} +2 -2
  86. package/dist/cli/chunks/{chunk-V3QLFNA2.js → chunk-ELLBS5RP.js} +4 -4
  87. package/dist/cli/chunks/chunk-ENGZ4D5V.js +2 -0
  88. package/dist/cli/chunks/chunk-FBMN7B46.js +4 -0
  89. package/dist/cli/chunks/{chunk-EDJ3O7RH.js → chunk-FWASDOT2.js} +2 -2
  90. package/dist/cli/chunks/{chunk-MDWCE7YW.js → chunk-FZOBD67M.js} +1 -1
  91. package/dist/cli/chunks/{chunk-A4FYONNU.js → chunk-GDSXITFH.js} +2 -2
  92. package/dist/cli/chunks/{chunk-2JW3BCGG.js → chunk-GGRHV6D7.js} +1 -1
  93. package/dist/cli/chunks/{chunk-ISDMD6EU.js → chunk-GPYVDFB3.js} +90 -90
  94. package/dist/cli/chunks/{chunk-CDKG6EI7.js → chunk-GSF6MB64.js} +2 -2
  95. package/dist/cli/chunks/{chunk-WLG5AJ4N.js → chunk-H52HZ67P.js} +2 -2
  96. package/dist/cli/chunks/{chunk-FGYMFUE2.js → chunk-H5BS5VH7.js} +2 -2
  97. package/dist/cli/chunks/{chunk-34WO57CW.js → chunk-H6ZM3PUT.js} +1 -1
  98. package/dist/cli/chunks/{chunk-6CQN24ZK.js → chunk-HM6ZSCPI.js} +1 -1
  99. package/dist/cli/chunks/{chunk-DPFRKBOG.js → chunk-HNFVJP4I.js} +2 -2
  100. package/dist/cli/chunks/{chunk-TPGED2IF.js → chunk-I33ERSGB.js} +2 -2
  101. package/dist/cli/chunks/{chunk-UEM7ZF5K.js → chunk-IAF6T27S.js} +2 -2
  102. package/dist/cli/chunks/{chunk-KCZR45PA.js → chunk-IB27QACC.js} +2 -2
  103. package/dist/cli/chunks/{chunk-SGYJ4NFZ.js → chunk-ICTXTNQZ.js} +1 -1
  104. package/dist/cli/chunks/chunk-IG5GNEC6.js +4 -0
  105. package/dist/cli/chunks/{chunk-KHFNNVJA.js → chunk-IQO7UCFR.js} +2 -2
  106. package/dist/cli/chunks/{chunk-3TW5W5LX.js → chunk-IV5UZOHH.js} +2 -2
  107. package/dist/cli/chunks/{chunk-7ZIOFPL3.js → chunk-JBTPOIAC.js} +2 -2
  108. package/dist/cli/chunks/{chunk-ZNEMGX5O.js → chunk-JIXUMYKZ.js} +1 -1
  109. package/dist/cli/chunks/{chunk-MTZH7AHC.js → chunk-JMONHE4B.js} +1 -1
  110. package/dist/cli/chunks/{chunk-TDZ53WO2.js → chunk-JVNTSNWU.js} +2 -2
  111. package/dist/cli/chunks/{chunk-PFR4G3DJ.js → chunk-JXGFRBUO.js} +2 -2
  112. package/dist/cli/chunks/chunk-JZOS5FCX.js +2 -0
  113. package/dist/cli/chunks/{chunk-STM3UDNO.js → chunk-KNNISEDY.js} +2 -2
  114. package/dist/cli/chunks/{chunk-TWAWHOP7.js → chunk-L4RUBPLR.js} +2 -2
  115. package/dist/cli/chunks/chunk-LL3IGZBI.js +2 -0
  116. package/dist/cli/chunks/{chunk-CIKSHTEQ.js → chunk-MBRHSU6W.js} +10 -10
  117. package/dist/cli/chunks/{chunk-G6T45OIC.js → chunk-MJS53PRX.js} +2 -2
  118. package/dist/cli/chunks/{chunk-PO3IXGMQ.js → chunk-MQROI74N.js} +2 -2
  119. package/dist/cli/chunks/{chunk-DOTK76IJ.js → chunk-MUOG6QXR.js} +2 -2
  120. package/dist/cli/chunks/{chunk-MVNP7GIR.js → chunk-MW2GGZZ5.js} +1 -1
  121. package/dist/cli/chunks/{chunk-FWGOHAAB.js → chunk-NHWGMJAP.js} +2 -2
  122. package/dist/cli/chunks/{chunk-ZBJ4XOOV.js → chunk-NMAIY4PX.js} +4 -4
  123. package/dist/cli/chunks/{chunk-CDHQFHRP.js → chunk-NQZ5AR3D.js} +2 -2
  124. package/dist/cli/chunks/{chunk-FLYOJOKN.js → chunk-P6OYS755.js} +1 -1
  125. package/dist/cli/chunks/{chunk-BGE6FOLM.js → chunk-PI7TJS62.js} +2 -2
  126. package/dist/cli/chunks/chunk-PX5YDCRH.js +4 -0
  127. package/dist/cli/chunks/{chunk-Q5DO24IJ.js → chunk-PZPWRQ2M.js} +3 -3
  128. package/dist/cli/chunks/{chunk-R4VL6E65.js → chunk-Q5XTSMWR.js} +2 -2
  129. package/dist/cli/chunks/{chunk-JBNEE5UH.js → chunk-Q7EAGKAE.js} +2 -2
  130. package/dist/cli/chunks/{chunk-R5NE6B2M.js → chunk-QDFTT3RF.js} +2 -2
  131. package/dist/cli/chunks/{chunk-DFZCKIGY.js → chunk-QGA55PFM.js} +3 -3
  132. package/dist/cli/chunks/{chunk-RJCYCLZV.js → chunk-QW6VMTBR.js} +2 -2
  133. package/dist/cli/chunks/{chunk-6VRA2QGL.js → chunk-QZANMBIT.js} +1 -1
  134. package/dist/cli/chunks/{chunk-MEGDYJPV.js → chunk-RETBYIAC.js} +4 -4
  135. package/dist/cli/chunks/{chunk-XJ7QNVI5.js → chunk-RFNPJK6N.js} +3 -3
  136. package/dist/cli/chunks/{chunk-NJBGXDQ7.js → chunk-RG52OKAM.js} +1 -1
  137. package/dist/cli/chunks/{chunk-DA5K5754.js → chunk-RSXXCL4A.js} +1 -1
  138. package/dist/cli/chunks/{chunk-HV2J7KKQ.js → chunk-RTFO5UQH.js} +2 -2
  139. package/dist/cli/chunks/{chunk-6UWGMOND.js → chunk-RZZCUIAI.js} +2 -2
  140. package/dist/cli/chunks/chunk-SDRHUMJB.js +2 -0
  141. package/dist/cli/chunks/{chunk-TSRSV3LD.js → chunk-SE4WIB26.js} +1 -1
  142. package/dist/cli/chunks/{chunk-ODKLFVYC.js → chunk-SESK3ARK.js} +2 -2
  143. package/dist/cli/chunks/{chunk-AWWNB2T7.js → chunk-SJUXE4IC.js} +2 -2
  144. package/dist/cli/chunks/{chunk-QGIU2WRL.js → chunk-SMDN3BQZ.js} +1 -1
  145. package/dist/cli/chunks/{chunk-VD6QRULW.js → chunk-SNOBH4AZ.js} +2 -2
  146. package/dist/cli/chunks/{chunk-OSLYSG3B.js → chunk-SPV2VKC5.js} +2 -2
  147. package/dist/cli/chunks/chunk-TCHGOB2N.js +2 -0
  148. package/dist/cli/chunks/{chunk-MOBNBMFW.js → chunk-TVYY3OCX.js} +1 -1
  149. package/dist/cli/chunks/{chunk-UGVHCMUN.js → chunk-UCFQALXO.js} +3 -3
  150. package/dist/cli/chunks/{chunk-3QHGWY7T.js → chunk-UKA2KOXE.js} +2 -2
  151. package/dist/cli/chunks/{chunk-MCUJEZT6.js → chunk-UNFFDHER.js} +16 -11
  152. package/dist/cli/chunks/{chunk-6QYNWR7U.js → chunk-UQ32JHES.js} +2 -2
  153. package/dist/cli/chunks/{chunk-OULHKEVH.js → chunk-V4DM6ELU.js} +2 -2
  154. package/dist/cli/chunks/{chunk-M2JBBZQB.js → chunk-VGFFFKGK.js} +2 -2
  155. package/dist/cli/chunks/{chunk-OCWWP5PL.js → chunk-VMNWDJIZ.js} +2 -2
  156. package/dist/cli/chunks/chunk-W6HXLH5G.js +180 -0
  157. package/dist/cli/chunks/{chunk-AIHDEEJO.js → chunk-WCJBU2KI.js} +2 -2
  158. package/dist/cli/chunks/{chunk-ZBQY5GLF.js → chunk-WGM35YWL.js} +2 -2
  159. package/dist/cli/chunks/chunk-WO4QMXIG.js +3 -0
  160. package/dist/cli/chunks/{chunk-3UPAMMCB.js → chunk-XAS3XRYM.js} +1 -1
  161. package/dist/cli/chunks/chunk-Y3LZ35OG.js +2 -0
  162. package/dist/cli/chunks/{chunk-5R3QL7WN.js → chunk-Y3UOUNHM.js} +2 -2
  163. package/dist/cli/chunks/{chunk-ZJ26AQA5.js → chunk-YFBSPLJG.js} +1 -1
  164. package/dist/cli/chunks/{chunk-BDESSCVR.js → chunk-YHKEDEAA.js} +3 -3
  165. package/dist/cli/chunks/{chunk-CXQPR5MY.js → chunk-YS4FCTWF.js} +1 -1
  166. package/dist/cli/chunks/{chunk-CLTMDCSE.js → chunk-YSLL6VSL.js} +2 -2
  167. package/dist/cli/chunks/chunk-Z6GGIRQQ.js +65 -0
  168. package/dist/cli/chunks/{chunk-F3SBRQC6.js → chunk-Z7WODOTH.js} +2 -2
  169. package/dist/cli/chunks/chunk-ZCRTRYXK.js +14 -0
  170. package/dist/cli/chunks/{chunk-XRYF6JV7.js → chunk-ZEV3YTO7.js} +2 -2
  171. package/dist/cli/chunks/{chunk-YNXS6CGV.js → chunk-ZL6SYKUK.js} +1 -1
  172. package/dist/cli/chunks/{chunk-5SJHQ2CO.js → chunk-ZSPU4MOS.js} +2 -2
  173. package/dist/cli/chunks/{chunk-UDHKLT4C.js → chunk-ZVWVV4EX.js} +1 -1
  174. package/dist/cli/chunks/{ci-464KPQNP.js → ci-W6K6G2KZ.js} +2 -2
  175. package/dist/cli/chunks/{ci-output-I7FX2RSO.js → ci-output-LDT24TS3.js} +2 -2
  176. package/dist/cli/chunks/{circuit-breaker-3FW237WW.js → circuit-breaker-F5V4KITU.js} +2 -2
  177. package/dist/cli/chunks/claude-flow-setup-DT6WQQVD.js +2 -0
  178. package/dist/cli/chunks/client-KHWJT6FB.js +2 -0
  179. package/dist/cli/chunks/{cline-installer-UWFHT6VY.js → cline-installer-G7TJOAEX.js} +2 -2
  180. package/dist/cli/chunks/{code-KQSUT3FS.js → code-PGE6A42V.js} +3 -3
  181. package/dist/cli/chunks/{code-index-extractor-PABBNUSC.js → code-index-extractor-RNITH372.js} +2 -2
  182. package/dist/cli/chunks/codex-installer-LBX77AI3.js +14 -0
  183. package/dist/cli/chunks/{completions-7RWHAUAR.js → completions-4AWLAARX.js} +2 -2
  184. package/dist/cli/chunks/{complexity-analyzer-XPOAF33E.js → complexity-analyzer-ZPNSS476.js} +2 -2
  185. package/dist/cli/chunks/{continuedev-installer-V4F2FIZP.js → continuedev-installer-UAPWX6OA.js} +2 -2
  186. package/dist/cli/chunks/{copilot-installer-JMICURQB.js → copilot-installer-BJN2YJGI.js} +2 -2
  187. package/dist/cli/chunks/core-handlers-HING5RRG.js +2 -0
  188. package/dist/cli/chunks/{cost-tracker-5OFHEYFJ.js → cost-tracker-MHP2VJ63.js} +2 -2
  189. package/dist/cli/chunks/{coverage-QKN57JDS.js → coverage-PQB4IEFG.js} +3 -3
  190. package/dist/cli/chunks/cross-domain-router-PQTD6AZN.js +2 -0
  191. package/dist/cli/chunks/{cursor-installer-GBJ7YXSM.js → cursor-installer-ZXBWYAS3.js} +2 -2
  192. package/dist/cli/chunks/{daemon-GKP7CMEK.js → daemon-64C7R6OJ.js} +3 -3
  193. package/dist/cli/chunks/{daemon-IAVSO6HK.js → daemon-N2BEGEFY.js} +4 -4
  194. package/dist/cli/chunks/{dag-attention-scheduler-S225TCI7.js → dag-attention-scheduler-SPZDAPNL.js} +2 -2
  195. package/dist/cli/chunks/{detect-IUYH422U.js → detect-LXJBSSZW.js} +2 -2
  196. package/dist/cli/chunks/{dist-node-2YRE6A7C.js → dist-node-U3TKZ2IZ.js} +2 -2
  197. package/dist/cli/chunks/{domain-handler-PL2TZC6H.js → domain-handler-3DDWUVSR.js} +2 -2
  198. package/dist/cli/chunks/{domain-plugins-HCGLXKIT.js → domain-plugins-JJVWI4OQ.js} +2 -2
  199. package/dist/cli/chunks/domain-transfer-M36KUJ2U.js +2 -0
  200. package/dist/cli/chunks/dream-WUGRSNCV.js +2 -0
  201. package/dist/cli/chunks/embed-and-insert-pattern-JPAR7TXX.js +3 -0
  202. package/dist/cli/chunks/{eval-WCK7KNFN.js → eval-SOLG23EA.js} +2 -2
  203. package/dist/cli/chunks/{experience-capture-middleware-2MSQWSAR.js → experience-capture-middleware-T7G2VOOD.js} +4 -4
  204. package/dist/cli/chunks/{fast-paths-VYOSIBKF.js → fast-paths-32N3ELI4.js} +2 -2
  205. package/dist/cli/chunks/{feature-flags-WCFUKHNQ.js → feature-flags-APJDQ4N7.js} +2 -2
  206. package/dist/cli/chunks/{feature-flags-UJRHFBRX.js → feature-flags-NAHKLDRN.js} +2 -2
  207. package/dist/cli/chunks/{file-discovery-JDGL4ZWS.js → file-discovery-YKVM3MDB.js} +2 -2
  208. package/dist/cli/chunks/{fleet-ROXVMZ2F.js → fleet-55M5CJS4.js} +3 -3
  209. package/dist/cli/chunks/{gnn-wrapper-NIO4ZCO3.js → gnn-wrapper-UD6E6S6Z.js} +2 -2
  210. package/dist/cli/chunks/{heartbeat-handler-PI42WD3C.js → heartbeat-handler-OYVW3VSC.js} +4 -4
  211. package/dist/cli/chunks/heartbeat-scheduler-33XX5XNQ.js +2 -0
  212. package/dist/cli/chunks/hnsw-adapter-XQPERX3H.js +2 -0
  213. package/dist/cli/chunks/hnsw-index-2GNXTWHH.js +2 -0
  214. package/dist/cli/chunks/{hnsw-legacy-bridge-YLC7SPK2.js → hnsw-legacy-bridge-HBYIS3ZW.js} +2 -2
  215. package/dist/cli/chunks/{hnswlib-node-LG6OS3B7.js → hnswlib-node-EQPM42OU.js} +2 -2
  216. package/dist/cli/chunks/{hooks-WVALP5GX.js → hooks-5ZSSJWO6.js} +10 -10
  217. package/dist/cli/chunks/hybrid-backend-CCF7URKI.js +2 -0
  218. package/dist/cli/chunks/{hypergraph-engine-GJEMW3EG.js → hypergraph-engine-XBGVQ4PD.js} +2 -2
  219. package/dist/cli/chunks/{hypergraph-handler-BLF6LXEV.js → hypergraph-handler-CAWAQ673.js} +3 -3
  220. package/dist/cli/chunks/impact-analyzer-HGKAZWIG.js +2 -0
  221. package/dist/cli/chunks/{init-handler-K25RWRYY.js → init-handler-PRHXSARK.js} +6 -6
  222. package/dist/cli/chunks/init-wizard-72MFBI3G.js +2 -0
  223. package/dist/cli/chunks/kernel-BRCBVMSK.js +2 -0
  224. package/dist/cli/chunks/{kilocode-installer-BXN6WZ7G.js → kilocode-installer-F7LXBM7I.js} +2 -2
  225. package/dist/cli/chunks/{kiro-installer-PM362DLN.js → kiro-installer-NM723ZRG.js} +2 -2
  226. package/dist/cli/chunks/knowledge-graph-DG44IPEI.js +2 -0
  227. package/dist/cli/chunks/{learning-CPERDDRG.js → learning-5QYIDHH3.js} +3 -3
  228. package/dist/cli/chunks/{llm-router-GOAV5FPI.js → llm-router-43HKWPSX.js} +4 -4
  229. package/dist/cli/chunks/llm-router-service-24KXFX32.js +2 -0
  230. package/dist/cli/chunks/{load-2BG6SHAK.js → load-5YDBWSCS.js} +2 -2
  231. package/dist/cli/chunks/load-test-N4TAYJY3.js +2 -0
  232. package/dist/cli/chunks/mcp-UMAPMNMY.js +2 -0
  233. package/dist/cli/chunks/{memory-4NHBYT6S.js → memory-FWCPCQFP.js} +6 -6
  234. package/dist/cli/chunks/memory-backend-NVYFYVAU.js +2 -0
  235. package/dist/cli/chunks/memory-handlers-UTWCNCHL.js +2 -0
  236. package/dist/cli/chunks/multi-model-executor-2XTBGLE4.js +14 -0
  237. package/dist/cli/chunks/{opencode-installer-ATZLLK74.js → opencode-installer-GIXOJ6NS.js} +2 -2
  238. package/dist/cli/chunks/orchestrator-VW6BKHLI.js +393 -0
  239. package/dist/cli/chunks/pattern-null-store-SBPNYDBR.js +2 -0
  240. package/dist/cli/chunks/{pattern-usage-recorder-7VE4XDAI.js → pattern-usage-recorder-7CEUC3J7.js} +2 -2
  241. package/dist/cli/chunks/{pipeline-LQZSNDD2.js → pipeline-IGUQPPPO.js} +2 -2
  242. package/dist/cli/chunks/platform-2P636I7B.js +2 -0
  243. package/dist/cli/chunks/{plugin-EJ6K2MGU.js → plugin-NY6SWDPE.js} +2 -2
  244. package/dist/cli/chunks/{prime-radiant-advanced-wasm-OIHTKJMN.js → prime-radiant-advanced-wasm-2UUDTIO2.js} +2 -2
  245. package/dist/cli/chunks/project-root-IOISG5KX.js +2 -0
  246. package/dist/cli/chunks/protocol-executor-IBYEII5Q.js +2 -0
  247. package/dist/cli/chunks/{protocol-handler-NRBROAU7.js → protocol-handler-ZTPCRQ5W.js} +2 -2
  248. package/dist/cli/chunks/{prove-EJOGEGD3.js → prove-SQX5A3IG.js} +2 -2
  249. package/dist/cli/chunks/qe-reasoning-bank-7IETWW6W.js +2 -0
  250. package/dist/cli/chunks/{quality-E55UC73D.js → quality-DROILKRY.js} +2 -2
  251. package/dist/cli/chunks/{quality-gate-OIQATNT3.js → quality-gate-PWKWDJY2.js} +3 -3
  252. package/dist/cli/chunks/queen-coordinator-NHUK2MWJ.js +2 -0
  253. package/dist/cli/chunks/real-embeddings-P5U3MGYC.js +2 -0
  254. package/dist/cli/chunks/{ref-validation-OPO6J7OL.js → ref-validation-KY73NQXD.js} +2 -2
  255. package/dist/cli/chunks/{roocode-installer-ODY5KRWU.js → roocode-installer-6JPPRB3W.js} +2 -2
  256. package/dist/cli/chunks/router-SRSO3IHF.js +2 -0
  257. package/dist/cli/chunks/routing-feedback-PASRE5HY.js +2 -0
  258. package/dist/cli/chunks/{routing-handler-KQM6VWLC.js → routing-handler-VTJIVFUO.js} +2 -2
  259. package/dist/cli/chunks/{ruvector-commands-U2GVV6PF.js → ruvector-commands-C6RPSJJO.js} +2 -2
  260. package/dist/cli/chunks/rvf-dual-writer-4M4J67OU.js +2 -0
  261. package/dist/cli/chunks/rvf-migration-adapter-TSXGT5LF.js +2 -0
  262. package/dist/cli/chunks/rvf-migration-coordinator-R53URRIO.js +2 -0
  263. package/dist/cli/chunks/rvf-native-adapter-MOF3E7BR.js +2 -0
  264. package/dist/cli/chunks/{rvf-store-integrity-KMIHD3LP.js → rvf-store-integrity-MMXN5TEJ.js} +2 -2
  265. package/dist/cli/chunks/safe-db-QJLFO33B.js +2 -0
  266. package/dist/cli/chunks/schedule-YIVXW5O2.js +2 -0
  267. package/dist/cli/chunks/scheduler-AON7DWSJ.js +2 -0
  268. package/dist/cli/chunks/{security-P5NM353C.js → security-3B3R2NL4.js} +3 -3
  269. package/dist/cli/chunks/shared-rvf-adapter-VIJB7JUS.js +2 -0
  270. package/dist/cli/chunks/{shared-rvf-dual-writer-2CSG7C4W.js → shared-rvf-dual-writer-UVWGDUWC.js} +2 -2
  271. package/dist/cli/chunks/sqlite-persistence-75VHKKQB.js +2 -0
  272. package/dist/cli/chunks/standalone-memory-M4LWAAYZ.js +2 -0
  273. package/dist/cli/chunks/{status-handler-6TU6O37R.js → status-handler-YYFV6OZL.js} +2 -2
  274. package/dist/cli/chunks/{structural-health-KBIJSTXJ.js → structural-health-27E6LLKB.js} +2 -2
  275. package/dist/cli/chunks/sync-26CEGSTC.js +2 -0
  276. package/dist/cli/chunks/{sync-LNHI5SB7.js → sync-J3LJ56WN.js} +2 -2
  277. package/dist/cli/chunks/task-handler-4MCEBQZL.js +54 -0
  278. package/dist/cli/chunks/task-handlers-GYBAWKE2.js +9 -0
  279. package/dist/cli/chunks/{test-DHAAI3DU.js → test-MPC5HRH5.js} +4 -4
  280. package/dist/cli/chunks/{test-scheduling-XDBZ3QC2.js → test-scheduling-ZJBFRZ3J.js} +3 -3
  281. package/dist/cli/chunks/token-bootstrap-2Y2XITBX.js +2 -0
  282. package/dist/cli/chunks/{token-usage-Q2YG5YQN.js → token-usage-3X5WMTG2.js} +2 -2
  283. package/dist/cli/chunks/{transformers-F5UQTQCY.js → transformers-MVL4C5IX.js} +2 -2
  284. package/dist/cli/chunks/tree-sitter-wasm-parser-SLW65ZFO.js +2 -0
  285. package/dist/cli/chunks/{types-JQ7EQO5Q.js → types-TG5P3CRS.js} +2 -2
  286. package/dist/cli/chunks/unified-memory-UCQ6AB32.js +2 -0
  287. package/dist/cli/chunks/unified-memory-hnsw-IXYUMKRR.js +2 -0
  288. package/dist/cli/chunks/unified-persistence-7E6JQ4FZ.js +2 -0
  289. package/dist/cli/chunks/{upgrade-TJRVGHGD.js → upgrade-ETBHDEPY.js} +2 -2
  290. package/dist/cli/chunks/{validate-BWPCVHBN.js → validate-C2A73LZK.js} +2 -2
  291. package/dist/cli/chunks/{validate-swarm-QVVKCQLP.js → validate-swarm-67XN42ML.js} +2 -2
  292. package/dist/cli/chunks/{vibium-ZFATIWHO.js → vibium-NILGKHLN.js} +2 -2
  293. package/dist/cli/chunks/visual-security-4VZXPEVG.js +2 -0
  294. package/dist/cli/chunks/{web-tree-sitter-KPLY7ONR.js → web-tree-sitter-USJN77P4.js} +2 -2
  295. package/dist/cli/chunks/{windsurf-installer-H7XM7ISA.js → windsurf-installer-5GGZXGJW.js} +2 -2
  296. package/dist/cli/chunks/witness-chain-IWS5ZHHL.js +2 -0
  297. package/dist/cli/chunks/witness-chain-JQA2VPZI.js +2 -0
  298. package/dist/cli/chunks/witness-chain-repair-4UA7IPS3.js +2 -0
  299. package/dist/cli/chunks/witness-chain-verifier-3GEADWPE.js +2 -0
  300. package/dist/cli/chunks/{witness-key-manager-DFRL42GE.js → witness-key-manager-ZWEIK3VJ.js} +2 -2
  301. package/dist/cli/chunks/{workflow-2ZQO6WYI.js → workflow-KHMVVBBA.js} +4 -4
  302. package/dist/cli/chunks/workflow-orchestrator-GI5NQH7C.js +2 -0
  303. package/dist/cli/chunks/wrappers-N6XIK5PT.js +2 -0
  304. package/dist/cli/commands/audit.d.ts +20 -2
  305. package/dist/cli/commands/audit.js +158 -16
  306. package/dist/cli/commands/claude-flow-setup.js +5 -4
  307. package/dist/cli/commands/mcp.js +6 -0
  308. package/dist/cli/commands/memory.d.ts +1 -1
  309. package/dist/cli/commands/memory.js +8 -8
  310. package/dist/cli/commands/platform.js +15 -2
  311. package/dist/cli/commands/upgrade.d.ts +3 -3
  312. package/dist/cli/commands/upgrade.js +3 -3
  313. package/dist/cli/handlers/init-handler.d.ts +10 -0
  314. package/dist/cli/handlers/task-handler.js +24 -3
  315. package/dist/cli/helpers/standalone-memory.d.ts +12 -0
  316. package/dist/cli/helpers/standalone-memory.js +46 -0
  317. package/dist/cli/index.js +39 -42
  318. package/dist/cli/log-gate.d.ts +66 -0
  319. package/dist/cli/log-gate.js +170 -0
  320. package/dist/init/agents-installer.d.ts +4 -0
  321. package/dist/init/agents-installer.js +24 -11
  322. package/dist/init/codex-installer.js +22 -8
  323. package/dist/init/idempotent-write.d.ts +53 -0
  324. package/dist/init/idempotent-write.js +160 -0
  325. package/dist/init/orchestrator.js +1 -0
  326. package/dist/init/phases/05-learning.js +3 -1
  327. package/dist/init/phases/07-hooks.js +32 -16
  328. package/dist/init/phases/08-mcp.js +4 -2
  329. package/dist/init/phases/09-assets.d.ts +10 -0
  330. package/dist/init/phases/09-assets.js +3 -0
  331. package/dist/init/phases/10-workers.js +7 -5
  332. package/dist/init/phases/12-verification.js +7 -2
  333. package/dist/init/project-analyzer.d.ts +9 -0
  334. package/dist/init/project-analyzer.js +20 -1
  335. package/dist/init/self-configurator.d.ts +5 -3
  336. package/dist/init/self-configurator.js +18 -29
  337. package/dist/init/skills-installer.js +4 -2
  338. package/dist/init/token-bootstrap.d.ts +1 -1
  339. package/dist/init/token-bootstrap.js +12 -2
  340. package/dist/init/types.d.ts +16 -0
  341. package/dist/init/types.js +20 -24
  342. package/dist/integrations/coherence/coherence-service.js +84 -24
  343. package/dist/integrations/coherence/vote-tally.d.ts +38 -0
  344. package/dist/integrations/coherence/vote-tally.js +39 -0
  345. package/dist/integrations/ruvector/brain-exporter.js +17 -0
  346. package/dist/integrations/ruvector/brain-import-audit.d.ts +20 -0
  347. package/dist/integrations/ruvector/brain-import-audit.js +22 -0
  348. package/dist/integrations/ruvector/brain-rvf-exporter.js +16 -0
  349. package/dist/integrations/ruvector/brain-shared.js +1 -1
  350. package/dist/integrations/ruvector/rvf-dual-writer.js +6 -1
  351. package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +23 -0
  352. package/dist/integrations/ruvector/shared-rvf-adapter.js +24 -0
  353. package/dist/kernel/hybrid-backend.d.ts +6 -0
  354. package/dist/kernel/hybrid-backend.js +18 -0
  355. package/dist/kernel/kernel.js +12 -16
  356. package/dist/kernel/project-root.d.ts +1 -1
  357. package/dist/kernel/project-root.js +24 -3
  358. package/dist/learning/embedder-identity-store.js +4 -3
  359. package/dist/learning/pattern-store.d.ts +11 -0
  360. package/dist/learning/pattern-store.js +31 -9
  361. package/dist/learning/qe-patterns.d.ts +6 -0
  362. package/dist/learning/qe-patterns.js +7 -1
  363. package/dist/learning/qe-reasoning-bank.js +3 -0
  364. package/dist/learning/real-embeddings.d.ts +8 -0
  365. package/dist/learning/real-embeddings.js +16 -0
  366. package/dist/learning/rvf-pattern-store.js +30 -10
  367. package/dist/learning/sqlite-persistence.d.ts +8 -1
  368. package/dist/learning/sqlite-persistence.js +49 -9
  369. package/dist/logging/console-logger.d.ts +2 -5
  370. package/dist/logging/console-logger.js +10 -46
  371. package/dist/logging/index.d.ts +2 -0
  372. package/dist/logging/index.js +1 -0
  373. package/dist/logging/redaction.d.ts +27 -0
  374. package/dist/logging/redaction.js +170 -0
  375. package/dist/mcp/bundle.js +463 -449
  376. package/dist/mcp/entry.js +2 -0
  377. package/dist/mcp/handlers/core-handlers.js +5 -4
  378. package/dist/mcp/handlers/memory-handlers.d.ts +6 -1
  379. package/dist/mcp/handlers/memory-handlers.js +44 -22
  380. package/dist/mcp/handlers/task-handlers.js +14 -1
  381. package/dist/mcp/protocol-server.js +3 -1
  382. package/dist/mcp/services/session-store.js +5 -1
  383. package/dist/mcp/tools/base.d.ts +9 -2
  384. package/dist/mcp/tools/base.js +7 -0
  385. package/dist/mcp/tools/coherence/consensus.js +51 -2
  386. package/dist/mcp/tools/planning/goap-plan.d.ts +20 -7
  387. package/dist/mcp/tools/planning/goap-plan.js +92 -20
  388. package/dist/mcp/tools/planning/goap-status.d.ts +37 -12
  389. package/dist/mcp/tools/planning/goap-status.js +52 -23
  390. package/dist/mcp/tools/planning/world-state.d.ts +101 -0
  391. package/dist/mcp/tools/planning/world-state.js +274 -0
  392. package/dist/mcp/types.d.ts +4 -2
  393. package/dist/planning/goap-planner.d.ts +60 -4
  394. package/dist/planning/goap-planner.js +218 -60
  395. package/dist/planning/index.d.ts +1 -1
  396. package/dist/planning/index.js +1 -1
  397. package/dist/planning/plan-executor.d.ts +20 -1
  398. package/dist/planning/plan-executor.js +209 -100
  399. package/dist/planning/types.d.ts +16 -0
  400. package/dist/planning/types.js +17 -0
  401. package/dist/plugins/cache.d.ts +2 -0
  402. package/dist/plugins/cache.js +15 -2
  403. package/dist/plugins/lifecycle.js +15 -2
  404. package/dist/plugins/manifest.js +7 -5
  405. package/dist/plugins/resolver.d.ts +13 -22
  406. package/dist/plugins/resolver.js +169 -61
  407. package/dist/plugins/version-policy.d.ts +13 -0
  408. package/dist/plugins/version-policy.js +18 -0
  409. package/dist/shared/types/index.d.ts +6 -0
  410. package/dist/shared/types/index.js +8 -0
  411. package/package.json +2 -1
  412. package/dist/cli/chunks/adapter-TNNNJRDG.js +0 -2
  413. package/dist/cli/chunks/agent-booster-wasm-5PC7D2FW.js +0 -2
  414. package/dist/cli/chunks/aqe-learning-engine-5ZRMYJLB.js +0 -2
  415. package/dist/cli/chunks/audit-YSGA7UWT.js +0 -3
  416. package/dist/cli/chunks/base-KWZHOPSH.js +0 -2
  417. package/dist/cli/chunks/brain-handler-ET6YAP4B.js +0 -90
  418. package/dist/cli/chunks/browser-workflow-2FZTKDUL.js +0 -2
  419. package/dist/cli/chunks/chunk-33YYYWBQ.js +0 -4
  420. package/dist/cli/chunks/chunk-5Z6XZV7K.js +0 -65
  421. package/dist/cli/chunks/chunk-6J62K3SW.js +0 -2
  422. package/dist/cli/chunks/chunk-6TPKK7LD.js +0 -15
  423. package/dist/cli/chunks/chunk-DEYLEDJN.js +0 -27
  424. package/dist/cli/chunks/chunk-J6GNQS62.js +0 -5
  425. package/dist/cli/chunks/chunk-KGT36Z42.js +0 -14
  426. package/dist/cli/chunks/chunk-NA7B2QYB.js +0 -2
  427. package/dist/cli/chunks/chunk-NDPFGIMJ.js +0 -13
  428. package/dist/cli/chunks/chunk-OBAP2TXZ.js +0 -2
  429. package/dist/cli/chunks/chunk-PEPFCPES.js +0 -2
  430. package/dist/cli/chunks/chunk-T6BVLVI5.js +0 -2
  431. package/dist/cli/chunks/chunk-TT23RRB7.js +0 -2
  432. package/dist/cli/chunks/chunk-XC7DYDSY.js +0 -180
  433. package/dist/cli/chunks/chunk-XWMZ6D6N.js +0 -2
  434. package/dist/cli/chunks/chunk-Y3MW3YBC.js +0 -3
  435. package/dist/cli/chunks/claude-flow-setup-6JKMBPGU.js +0 -2
  436. package/dist/cli/chunks/client-7E4LM2WW.js +0 -2
  437. package/dist/cli/chunks/codex-installer-CQ24DTP5.js +0 -14
  438. package/dist/cli/chunks/core-handlers-IFG3757P.js +0 -2
  439. package/dist/cli/chunks/cross-domain-router-EK7W4PGP.js +0 -2
  440. package/dist/cli/chunks/domain-transfer-KQJRUPXA.js +0 -2
  441. package/dist/cli/chunks/dream-NFSCSLY7.js +0 -2
  442. package/dist/cli/chunks/embed-and-insert-pattern-ZPAG7235.js +0 -3
  443. package/dist/cli/chunks/heartbeat-scheduler-ZATCDJDK.js +0 -2
  444. package/dist/cli/chunks/hnsw-adapter-WXQABRCA.js +0 -2
  445. package/dist/cli/chunks/hnsw-index-TPSWLEA5.js +0 -2
  446. package/dist/cli/chunks/impact-analyzer-HNIU45P5.js +0 -2
  447. package/dist/cli/chunks/init-wizard-JUIPBMHG.js +0 -2
  448. package/dist/cli/chunks/kernel-5BOZQ754.js +0 -2
  449. package/dist/cli/chunks/knowledge-graph-EWDAENWM.js +0 -2
  450. package/dist/cli/chunks/llm-router-service-3YT7JGBS.js +0 -2
  451. package/dist/cli/chunks/load-test-BP2CPLIV.js +0 -2
  452. package/dist/cli/chunks/mcp-5TTB37DC.js +0 -2
  453. package/dist/cli/chunks/memory-backend-4PYQBPRM.js +0 -2
  454. package/dist/cli/chunks/memory-handlers-2B27NITS.js +0 -2
  455. package/dist/cli/chunks/multi-model-executor-KCWSGCDT.js +0 -14
  456. package/dist/cli/chunks/orchestrator-RKB7XJRG.js +0 -393
  457. package/dist/cli/chunks/pattern-null-store-OYOQOV2O.js +0 -2
  458. package/dist/cli/chunks/platform-OD5H5U6G.js +0 -2
  459. package/dist/cli/chunks/protocol-executor-3ATJTXWG.js +0 -2
  460. package/dist/cli/chunks/qe-reasoning-bank-LLMYZT4X.js +0 -2
  461. package/dist/cli/chunks/queen-coordinator-RN7L6KG5.js +0 -2
  462. package/dist/cli/chunks/real-embeddings-FPFFNOSZ.js +0 -2
  463. package/dist/cli/chunks/router-MDHITQ2V.js +0 -2
  464. package/dist/cli/chunks/routing-feedback-5XLNJ3Y3.js +0 -2
  465. package/dist/cli/chunks/rvf-dual-writer-JBW4O3II.js +0 -2
  466. package/dist/cli/chunks/rvf-migration-adapter-BPPQL4XJ.js +0 -2
  467. package/dist/cli/chunks/rvf-migration-coordinator-V2GHCJKN.js +0 -2
  468. package/dist/cli/chunks/rvf-native-adapter-S4562CG5.js +0 -2
  469. package/dist/cli/chunks/safe-db-FIRHSXVF.js +0 -2
  470. package/dist/cli/chunks/schedule-RVXFB4HK.js +0 -2
  471. package/dist/cli/chunks/scheduler-IKKAMAOO.js +0 -2
  472. package/dist/cli/chunks/shared-rvf-adapter-LVIUOO4S.js +0 -2
  473. package/dist/cli/chunks/sqlite-persistence-SQ3HCUQ7.js +0 -2
  474. package/dist/cli/chunks/sync-UHOX6RJW.js +0 -2
  475. package/dist/cli/chunks/task-handler-AVDHMLGI.js +0 -49
  476. package/dist/cli/chunks/task-handlers-KYK4VTRA.js +0 -9
  477. package/dist/cli/chunks/token-bootstrap-GUTTLPZX.js +0 -2
  478. package/dist/cli/chunks/tree-sitter-wasm-parser-DEGOHS6F.js +0 -2
  479. package/dist/cli/chunks/unified-memory-CXHLHB5I.js +0 -2
  480. package/dist/cli/chunks/unified-memory-hnsw-I7WAE54M.js +0 -2
  481. package/dist/cli/chunks/unified-persistence-6CPF65WI.js +0 -2
  482. package/dist/cli/chunks/visual-security-GNPHME5H.js +0 -2
  483. package/dist/cli/chunks/witness-chain-RRN6NDCH.js +0 -2
  484. package/dist/cli/chunks/witness-chain-VT4UHHBR.js +0 -2
  485. package/dist/cli/chunks/workflow-orchestrator-DB3HIECD.js +0 -2
  486. package/dist/cli/chunks/wrappers-SUS6XEJD.js +0 -2
package/dist/cli/index.js CHANGED
@@ -10,47 +10,19 @@
10
10
  * See: cli/commands/ for additional command modules
11
11
  */
12
12
  import { toErrorMessage } from '../shared/error-utils.js';
13
+ import { initFeatureFlagsFromEnv } from '../integrations/ruvector/feature-flags.js';
13
14
  import { createRequire } from 'node:module';
14
15
  import { Command } from 'commander';
15
16
  import chalk from 'chalk';
16
17
  import { ALL_DOMAINS } from '../shared/types/index.js';
17
18
  // ============================================================================
18
- // Redirect internal domain logs to stderr so stdout stays clean for CI/JSON
19
+ // Route internal diagnostics to stderr, filtered by AQE_LOG_LEVEL / LOG_LEVEL /
20
+ // AQE_VERBOSE (default: warn), so stdout stays clean for CI/JSON.
19
21
  // ============================================================================
20
- const INTERNAL_LOG_PREFIXES = [
21
- '[UnifiedMemory]', '[HybridBackend]', '[UnifiedPersistence]',
22
- '[PersistentSONAEngine]', '[QueenGovernance]', '[QueenCoordinator]',
23
- '[Queen]', '[QUEEN]', '[DomainBreakerRegistry]',
24
- '[RealEmbeddings]', '[HNSWIndex]', '[PatternStore]',
25
- '[TestGenerationCoordinator]', '[CodeIntelligence]', '[ProductFactorsBridge]',
26
- '[LearningOptimizationCoordinator]', '[DreamEngine]', '[DreamScheduler]',
27
- '[SecurityCompliance]', '[Providers]', '[GNN]',
28
- '[test-generation]', '[test-execution]', '[coverage-analysis]',
29
- '[quality-assessment]', '[defect-intelligence]', '[requirements-validation]',
30
- '[code-intelligence]', '[security-compliance]', '[contract-testing]',
31
- '[visual-accessibility]', '[chaos-resilience]', '[learning-optimization]',
32
- '[enterprise-integration]', '[coordination]', '[PatternLearnerService]',
33
- '[RequirementsValidation]', '[ParserRegistry]', '[AdversarialDefense]',
34
- '[ContinueGateIntegration]', '[ContinueGate]', '[SQLitePatternStore]',
35
- '[TokenTracking]', '[InfraHealing]', '[ExperienceCapture]',
36
- ];
37
- /** Timestamped log pattern: [HH:MM:SS.sss] [LEVEL] */
38
- const TIMESTAMPED_LOG_RE = /^\[\d{2}:\d{2}:\d{2}\.\d{3}\]\s+\[/;
39
- const originalConsoleLog = console.log.bind(console);
40
- console.log = (...args) => {
41
- const first = typeof args[0] === 'string' ? args[0] : '';
42
- const trimmed = first.trimStart();
43
- if (INTERNAL_LOG_PREFIXES.some(prefix => trimmed.startsWith(prefix)) ||
44
- TIMESTAMPED_LOG_RE.test(trimmed)) {
45
- process.stderr.write(args.map(String).join(' ') + '\n');
46
- return;
47
- }
48
- originalConsoleLog(...args);
49
- };
50
- // Also redirect timestamped INFO/WARN/ERROR log lines (e.g. "[07:12:24.372] [INFO ]")
51
- console.info = (...args) => {
52
- process.stderr.write(args.map(String).join(' ') + '\n');
53
- };
22
+ import { applyCommandVerbosity, installCliLogGate, isCliLogLevelEnabled } from './log-gate.js';
23
+ import { LogLevel } from '../logging/index.js';
24
+ import { formatErrorForLog } from '../logging/redaction.js';
25
+ installCliLogGate();
54
26
  // ============================================================================
55
27
  // CLI State
56
28
  // ============================================================================
@@ -144,10 +116,12 @@ async function ensureInitializedStrict() {
144
116
  // For diagnostic commands: check if project was explicitly initialized
145
117
  const fs = await import('fs');
146
118
  const path = await import('path');
147
- const configDir = path.resolve('.agentic-qe');
119
+ const { findProjectRoot } = await import('../kernel/project-root.js');
120
+ const configDir = path.join(findProjectRoot(), '.agentic-qe');
148
121
  if (!fs.existsSync(configDir)) {
149
122
  console.error(chalk.red('\nError: AQE system not initialized in this directory.'));
150
123
  console.log(chalk.yellow('Run `aqe init` first to set up this project.\n'));
124
+ process.exitCode = 1;
151
125
  return false;
152
126
  }
153
127
  return ensureInitialized();
@@ -156,14 +130,19 @@ async function ensureInitialized() {
156
130
  if (context.initialized && context.kernel && context.queen) {
157
131
  return true;
158
132
  }
159
- process.stderr.write(chalk.gray('Auto-initializing v3 system...') + '\n');
133
+ const showProgress = isCliLogLevelEnabled(LogLevel.INFO);
134
+ if (showProgress) {
135
+ process.stderr.write(chalk.gray('Auto-initializing v3 system...') + '\n');
136
+ }
160
137
  const timeout = 30000;
161
138
  const timeoutPromise = new Promise((_, reject) => {
162
139
  setTimeout(() => reject(new Error('Initialization timeout after 30 seconds')), timeout);
163
140
  });
164
141
  try {
165
142
  await Promise.race([autoInitialize(), timeoutPromise]);
166
- process.stderr.write(chalk.green('System ready') + '\n\n');
143
+ if (showProgress) {
144
+ process.stderr.write(chalk.green('System ready') + '\n\n');
145
+ }
167
146
  return true;
168
147
  }
169
148
  catch (err) {
@@ -176,6 +155,8 @@ async function ensureInitialized() {
176
155
  console.error(chalk.red('Failed to auto-initialize:'), err);
177
156
  console.log(chalk.yellow('Try running `aqe init` manually.'));
178
157
  }
158
+ // Callers `return` on false; main() then exits with this code (#758).
159
+ process.exitCode = 1;
179
160
  return false;
180
161
  }
181
162
  }
@@ -216,7 +197,18 @@ const VERSION = typeof __CLI_VERSION__ !== 'undefined' ? __CLI_VERSION__ : packa
216
197
  program
217
198
  .name('aqe')
218
199
  .description('Agentic QE - Domain-Driven Quality Engineering')
219
- .version(VERSION);
200
+ .version(VERSION)
201
+ .addHelpText('after', `
202
+ Environment:
203
+ AQE_LOG_LEVEL Internal log level: debug | info | warn | error | silent (default: warn)
204
+ LOG_LEVEL Same as AQE_LOG_LEVEL; AQE_LOG_LEVEL takes precedence
205
+ AQE_VERBOSE=1 Shorthand for info-level logging (full system-init output)
206
+ Diagnostics are written to stderr; stdout carries command output only.`);
207
+ // A command's own --verbose flag (aqe sync|status|workflow|eval ... --verbose)
208
+ // raises the log gate to INFO for that run; AQE_LOG_LEVEL / LOG_LEVEL win.
209
+ program.hook('preAction', (_thisCommand, actionCommand) => {
210
+ applyCommandVerbosity(actionCommand.opts());
211
+ });
220
212
  // ============================================================================
221
213
  // Register Handlers (lazy — each handler loads only when its command runs)
222
214
  // ============================================================================
@@ -338,7 +330,11 @@ registerLazyCommand(program, {
338
330
  registerLazyCommand(program, {
339
331
  name: 'memory',
340
332
  description: 'Memory store, retrieve, search, and delete operations',
341
- factory: () => import('./commands/memory.js').then(m => m.createMemoryCommand(context, cleanupAndExit, ensureInitialized)),
333
+ // Memory subcommands open only the memory store, not the full v3 system.
334
+ factory: () => Promise.all([
335
+ import('./commands/memory.js'),
336
+ import('./helpers/standalone-memory.js'),
337
+ ]).then(([m, h]) => m.createMemoryCommand(context, cleanupAndExit, h.createEnsureMemoryBackend(context))),
342
338
  });
343
339
  registerLazyCommand(program, {
344
340
  name: 'mcp',
@@ -402,6 +398,7 @@ async function main() {
402
398
  console.log(VERSION);
403
399
  process.exit(0);
404
400
  }
401
+ initFeatureFlagsFromEnv();
405
402
  // File recovery must validate its input before anything opens, migrates, or
406
403
  // auto-restores the project's database. Commander accepts `--` separators.
407
404
  const commandArgs = process.argv.slice(2).filter(arg => arg !== '--');
@@ -421,10 +418,10 @@ async function main() {
421
418
  return;
422
419
  // If the command didn't explicitly exit, clean up and exit now.
423
420
  // This prevents process hangs from active handles (domain init, embeddings, etc.)
424
- await cleanupAndExit(0);
421
+ await cleanupAndExit(process.exitCode ?? 0);
425
422
  }
426
423
  main().catch(async (error) => {
427
- console.error(chalk.red('Fatal error:'), error);
424
+ console.error(chalk.red('Fatal error:'), formatErrorForLog(error));
428
425
  await cleanupAndExit(1);
429
426
  });
430
427
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Agentic QE v3 - CLI Log Gate
3
+ *
4
+ * Single place that decides how much internal diagnostic output a CLI
5
+ * invocation prints. Two kinds of diagnostics exist in the codebase:
6
+ *
7
+ * 1. Structured logger output (LoggerFactory / ConsoleLogger), formatted as
8
+ * "[HH:MM:SS.mmm] [INFO ] [domain] message".
9
+ * 2. Ad-hoc console calls with a bracketed tag, e.g.
10
+ * console.log('[UnifiedMemory] Initialized: ...').
11
+ *
12
+ * Both are routed to stderr (stdout stays clean for JSON/CI consumers) and
13
+ * filtered against one threshold resolved from the environment:
14
+ *
15
+ * AQE_LOG_LEVEL debug | info | warn | error | silent (highest precedence)
16
+ * LOG_LEVEL same values
17
+ * AQE_VERBOSE 1 | true | yes | on -> info
18
+ * (default) warn
19
+ *
20
+ * Regular command output (anything without a bracketed tag) is never touched.
21
+ */
22
+ import { LogLevel } from '../logging/index.js';
23
+ type ConsoleMethod = 'log' | 'info' | 'debug' | 'warn' | 'error';
24
+ type ConsoleLike = Pick<Console, ConsoleMethod>;
25
+ /** Default threshold for CLI commands when nothing is configured. */
26
+ export declare const DEFAULT_CLI_LOG_LEVEL = LogLevel.WARN;
27
+ /**
28
+ * Resolve the effective CLI log level from the environment.
29
+ * Unrecognised values are ignored rather than silently mapped to INFO.
30
+ */
31
+ export declare function resolveCliLogLevel(env?: NodeJS.ProcessEnv, defaultLevel?: LogLevel): LogLevel;
32
+ /**
33
+ * Classify a console call. Returns the diagnostic level of the line, or null
34
+ * when the line is regular command output that must pass through untouched.
35
+ */
36
+ export declare function classifyConsoleLine(method: ConsoleMethod, firstArg: unknown): LogLevel | null;
37
+ /** True when AQE_LOG_LEVEL or LOG_LEVEL holds a recognised level. */
38
+ export declare function hasExplicitCliLogLevel(env?: NodeJS.ProcessEnv): boolean;
39
+ /**
40
+ * Honour a command's own `--verbose` flag (e.g. `aqe sync --verbose`): raise
41
+ * the threshold to INFO so the diagnostics the user explicitly asked for are
42
+ * printed (on stderr). An explicit AQE_LOG_LEVEL / LOG_LEVEL still wins.
43
+ * Returns true when the level was raised.
44
+ */
45
+ export declare function applyCommandVerbosity(options: Record<string, unknown>, env?: NodeJS.ProcessEnv): boolean;
46
+ /** Current CLI log threshold. */
47
+ export declare function getCliLogLevel(): LogLevel;
48
+ /** True when diagnostics at `level` should be printed. */
49
+ export declare function isCliLogLevelEnabled(level: LogLevel): boolean;
50
+ /**
51
+ * Change the threshold at runtime. Also reconfigures LoggerFactory so loggers
52
+ * created afterwards filter at the source instead of relying on the gate.
53
+ */
54
+ export declare function setCliLogLevel(level: LogLevel): void;
55
+ export interface InstallCliLogGateOptions {
56
+ level?: LogLevel;
57
+ target?: ConsoleLike;
58
+ writeStderr?: (text: string) => void;
59
+ }
60
+ /**
61
+ * Patch the console so internal diagnostics are routed to stderr and filtered
62
+ * by the CLI log level. Returns a function that restores the original methods.
63
+ */
64
+ export declare function installCliLogGate(options?: InstallCliLogGateOptions): () => void;
65
+ export {};
66
+ //# sourceMappingURL=log-gate.d.ts.map
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Agentic QE v3 - CLI Log Gate
3
+ *
4
+ * Single place that decides how much internal diagnostic output a CLI
5
+ * invocation prints. Two kinds of diagnostics exist in the codebase:
6
+ *
7
+ * 1. Structured logger output (LoggerFactory / ConsoleLogger), formatted as
8
+ * "[HH:MM:SS.mmm] [INFO ] [domain] message".
9
+ * 2. Ad-hoc console calls with a bracketed tag, e.g.
10
+ * console.log('[UnifiedMemory] Initialized: ...').
11
+ *
12
+ * Both are routed to stderr (stdout stays clean for JSON/CI consumers) and
13
+ * filtered against one threshold resolved from the environment:
14
+ *
15
+ * AQE_LOG_LEVEL debug | info | warn | error | silent (highest precedence)
16
+ * LOG_LEVEL same values
17
+ * AQE_VERBOSE 1 | true | yes | on -> info
18
+ * (default) warn
19
+ *
20
+ * Regular command output (anything without a bracketed tag) is never touched.
21
+ */
22
+ import { format } from 'node:util';
23
+ import { LogLevel, LoggerFactory } from '../logging/index.js';
24
+ /** Default threshold for CLI commands when nothing is configured. */
25
+ export const DEFAULT_CLI_LOG_LEVEL = LogLevel.WARN;
26
+ const LEVEL_NAMES = {
27
+ debug: LogLevel.DEBUG,
28
+ info: LogLevel.INFO,
29
+ warn: LogLevel.WARN,
30
+ warning: LogLevel.WARN,
31
+ error: LogLevel.ERROR,
32
+ silent: LogLevel.SILENT,
33
+ none: LogLevel.SILENT,
34
+ off: LogLevel.SILENT,
35
+ };
36
+ const TRUTHY = new Set(['1', 'true', 'yes', 'on']);
37
+ // eslint-disable-next-line no-control-regex
38
+ const ANSI_RE = /\x1b\[[0-9;]*m/g;
39
+ /** "[10:01:10.407] [INFO ] ..." or "[2026-09-28T10:01:10.407Z] [WARN ] ..." */
40
+ const STRUCTURED_RE = /^\[(?:\d{2}:\d{2}:\d{2}\.\d{3}|\d{4}-\d{2}-\d{2}T[^\]]+)\]\s+\[(DEBUG|INFO|WARN|ERROR)\s*\]/;
41
+ /**
42
+ * "[UnifiedMemory] ...", "[sona-three-loop] ...", "[quality-assessment/rl] ...".
43
+ * Requires a letter first and whitespace after the closing bracket so JSON
44
+ * arrays such as '["a"]' or '[true]' are never mistaken for diagnostics.
45
+ *
46
+ * Only a tag at column 0 counts. Indented bracketed text is command output:
47
+ * severity markers (" [critical] Code Injection ..." from `aqe security`,
48
+ * " [high] ..." from `aqe status` / `aqe coverage`) and user data such as a
49
+ * stored memory value "[TODO] fix auth" printed by `aqe memory get`.
50
+ */
51
+ const TAGGED_RE = /^\[[A-Za-z][\w./:-]*\]\s/;
52
+ const TAG_METHOD_LEVEL = {
53
+ debug: LogLevel.DEBUG,
54
+ log: LogLevel.INFO,
55
+ info: LogLevel.INFO,
56
+ warn: LogLevel.WARN,
57
+ error: LogLevel.ERROR,
58
+ };
59
+ let currentLevel = DEFAULT_CLI_LOG_LEVEL;
60
+ function parseLevel(value) {
61
+ if (!value)
62
+ return undefined;
63
+ return LEVEL_NAMES[value.trim().toLowerCase()];
64
+ }
65
+ /**
66
+ * Resolve the effective CLI log level from the environment.
67
+ * Unrecognised values are ignored rather than silently mapped to INFO.
68
+ */
69
+ export function resolveCliLogLevel(env = process.env, defaultLevel = DEFAULT_CLI_LOG_LEVEL) {
70
+ const explicit = parseLevel(env.AQE_LOG_LEVEL) ?? parseLevel(env.LOG_LEVEL);
71
+ if (explicit !== undefined)
72
+ return explicit;
73
+ if (env.AQE_VERBOSE && TRUTHY.has(env.AQE_VERBOSE.trim().toLowerCase())) {
74
+ return LogLevel.INFO;
75
+ }
76
+ return defaultLevel;
77
+ }
78
+ /**
79
+ * Classify a console call. Returns the diagnostic level of the line, or null
80
+ * when the line is regular command output that must pass through untouched.
81
+ */
82
+ export function classifyConsoleLine(method, firstArg) {
83
+ if (typeof firstArg !== 'string')
84
+ return null;
85
+ const text = firstArg.replace(ANSI_RE, '');
86
+ const structured = STRUCTURED_RE.exec(text.trimStart());
87
+ if (structured) {
88
+ return LEVEL_NAMES[structured[1].toLowerCase()];
89
+ }
90
+ if (TAGGED_RE.test(text)) {
91
+ return TAG_METHOD_LEVEL[method];
92
+ }
93
+ return null;
94
+ }
95
+ /** True when AQE_LOG_LEVEL or LOG_LEVEL holds a recognised level. */
96
+ export function hasExplicitCliLogLevel(env = process.env) {
97
+ return parseLevel(env.AQE_LOG_LEVEL) !== undefined || parseLevel(env.LOG_LEVEL) !== undefined;
98
+ }
99
+ /**
100
+ * Honour a command's own `--verbose` flag (e.g. `aqe sync --verbose`): raise
101
+ * the threshold to INFO so the diagnostics the user explicitly asked for are
102
+ * printed (on stderr). An explicit AQE_LOG_LEVEL / LOG_LEVEL still wins.
103
+ * Returns true when the level was raised.
104
+ */
105
+ export function applyCommandVerbosity(options, env = process.env) {
106
+ if (options.verbose !== true || hasExplicitCliLogLevel(env))
107
+ return false;
108
+ if (isCliLogLevelEnabled(LogLevel.INFO))
109
+ return false;
110
+ setCliLogLevel(LogLevel.INFO);
111
+ return true;
112
+ }
113
+ /** Current CLI log threshold. */
114
+ export function getCliLogLevel() {
115
+ return currentLevel;
116
+ }
117
+ /** True when diagnostics at `level` should be printed. */
118
+ export function isCliLogLevelEnabled(level) {
119
+ return level >= currentLevel && currentLevel !== LogLevel.SILENT;
120
+ }
121
+ /**
122
+ * Change the threshold at runtime. Also reconfigures LoggerFactory so loggers
123
+ * created afterwards filter at the source instead of relying on the gate.
124
+ */
125
+ export function setCliLogLevel(level) {
126
+ currentLevel = level;
127
+ LoggerFactory.setLevel(level);
128
+ }
129
+ /**
130
+ * Patch the console so internal diagnostics are routed to stderr and filtered
131
+ * by the CLI log level. Returns a function that restores the original methods.
132
+ */
133
+ export function installCliLogGate(options = {}) {
134
+ const target = options.target ?? console;
135
+ const writeStderr = options.writeStderr ?? ((text) => { process.stderr.write(text); });
136
+ setCliLogLevel(options.level ?? resolveCliLogLevel());
137
+ const original = {
138
+ log: target.log.bind(target),
139
+ info: target.info.bind(target),
140
+ debug: target.debug.bind(target),
141
+ warn: target.warn.bind(target),
142
+ error: target.error.bind(target),
143
+ };
144
+ const toStderr = (args) => writeStderr(format(...args) + '\n');
145
+ const gate = (method, passthrough, emit) => (...args) => {
146
+ const level = classifyConsoleLine(method, args[0]);
147
+ if (level === null) {
148
+ passthrough(args);
149
+ }
150
+ else if (isCliLogLevelEnabled(level)) {
151
+ emit(args);
152
+ }
153
+ };
154
+ // log/debug output normally goes to stdout; diagnostics are moved to stderr.
155
+ target.log = gate('log', args => original.log(...args), toStderr);
156
+ target.debug = gate('debug', args => original.debug(...args), toStderr);
157
+ // console.info has always been redirected to stderr by the CLI.
158
+ target.info = gate('info', toStderr, toStderr);
159
+ // warn/error already target stderr; keep their native formatting.
160
+ target.warn = gate('warn', args => original.warn(...args), args => original.warn(...args));
161
+ target.error = gate('error', args => original.error(...args), args => original.error(...args));
162
+ return () => {
163
+ target.log = original.log;
164
+ target.info = original.info;
165
+ target.debug = original.debug;
166
+ target.warn = original.warn;
167
+ target.error = original.error;
168
+ };
169
+ }
170
+ //# sourceMappingURL=log-gate.js.map
@@ -74,6 +74,10 @@ export declare class AgentsInstaller {
74
74
  * Install a single agent
75
75
  */
76
76
  private installAgent;
77
+ /**
78
+ * Describe an agent from its installed file (type, description, domain).
79
+ */
80
+ private describeAgent;
77
81
  /**
78
82
  * Get the type of an agent based on its name
79
83
  */
@@ -11,6 +11,7 @@ import { toErrorMessage } from '../shared/error-utils.js';
11
11
  import { loadOverlays, applyOverlayToContent } from '../agents/overlay-loader.js';
12
12
  import { validateFleetMcpDeps } from '../validation/steps/agent-mcp-validator.js';
13
13
  import { findPackageRoot } from './find-package-root.js';
14
+ import { GENERATED_ON_LINE, writeTextIfChangedIgnoring } from './idempotent-write.js';
14
15
  // ============================================================================
15
16
  // Helpers
16
17
  // ============================================================================
@@ -240,15 +241,21 @@ export class AgentsInstaller {
240
241
  result.totalCount = availableAgents.length;
241
242
  // Filter agents based on options
242
243
  const agentsToInstall = this.filterAgents(availableAgents);
244
+ // Every selected agent present on disk after this run — newly installed or
245
+ // already there — so the index describes the install, not just this run's
246
+ // delta (a repeat init used to rewrite it as "Total Agents: 0", #778).
247
+ const presentAgents = [];
243
248
  // Install each agent
244
249
  for (const agentName of agentsToInstall) {
245
250
  try {
246
251
  const agentInfo = await this.installAgent(agentName, targetAgentsDir, targetSubagentsDir);
247
252
  if (agentInfo) {
248
253
  result.installed.push(agentInfo);
254
+ presentAgents.push(agentInfo);
249
255
  }
250
256
  else {
251
257
  result.skipped.push(agentName);
258
+ presentAgents.push(this.describeAgent(agentName, targetAgentsDir, targetSubagentsDir));
252
259
  }
253
260
  }
254
261
  catch (error) {
@@ -313,7 +320,7 @@ export class AgentsInstaller {
313
320
  }
314
321
  }
315
322
  // Create agents index file
316
- await this.createAgentsIndex(targetAgentsDir, result.installed);
323
+ await this.createAgentsIndex(targetAgentsDir, presentAgents);
317
324
  return result;
318
325
  }
319
326
  /**
@@ -405,17 +412,22 @@ export class AgentsInstaller {
405
412
  else {
406
413
  throw new Error(`Source file not found: ${sourceFile}`);
407
414
  }
408
- // Determine agent type
409
- const agentType = this.getAgentType(agentName, isSubagent);
410
- // Get description from agent file
411
- const description = this.getAgentDescription(targetFile);
412
- // Get domain from agent name
413
- const domain = this.getAgentDomain(agentName);
415
+ return this.describeAgent(agentPath, targetDir, targetSubagentsDir);
416
+ }
417
+ /**
418
+ * Describe an agent from its installed file (type, description, domain).
419
+ */
420
+ describeAgent(agentPath, targetDir, targetSubagentsDir) {
421
+ const isSubagent = agentPath.startsWith('subagents/');
422
+ const agentName = isSubagent ? agentPath.split('/')[1] : agentPath;
423
+ const targetFile = isSubagent
424
+ ? join(targetSubagentsDir, `${agentName}.md`)
425
+ : join(targetDir, `${agentName}.md`);
414
426
  return {
415
427
  name: agentName,
416
- type: agentType,
417
- description,
418
- domain,
428
+ type: this.getAgentType(agentName, isSubagent),
429
+ description: this.getAgentDescription(targetFile),
430
+ domain: this.getAgentDomain(agentName),
419
431
  };
420
432
  }
421
433
  /**
@@ -629,7 +641,8 @@ ${subagents.map(a => `- **${a.name}**${a.description ? `: ${a.description}` : ''
629
641
  if (!existsSync(docsDir)) {
630
642
  mkdirSync(docsDir, { recursive: true });
631
643
  }
632
- writeFileSync(join(docsDir, 'v3-agents-index.md'), indexContent, 'utf-8');
644
+ // #778: ignore the generation-timestamp footer when deciding to rewrite.
645
+ writeTextIfChangedIgnoring(join(docsDir, 'v3-agents-index.md'), indexContent, GENERATED_ON_LINE);
633
646
  }
634
647
  }
635
648
  /**
@@ -9,6 +9,8 @@ import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, statSyn
9
9
  import { join, dirname } from 'path';
10
10
  import { fileURLToPath } from 'url';
11
11
  import { toErrorMessage } from '../shared/error-utils.js';
12
+ import { findPackageRoot } from './find-package-root.js';
13
+ import { writeFileIfChanged } from './idempotent-write.js';
12
14
  import { selectCodexSkills } from './codex-skill-manifest.js';
13
15
  import { createPlatformConfigGenerator, } from './platform-config-generator.js';
14
16
  export const CODEX_COMPACT_GUIDANCE_MAX_BYTES = 512;
@@ -111,7 +113,7 @@ export class CodexInstaller {
111
113
  result.ownedGuidanceBytes = Buffer.byteLength(marked);
112
114
  result.components.rules.status = 'installed';
113
115
  }
114
- else if (this.overwrite || policy === 'compact') {
116
+ else {
115
117
  const content = policy === 'compact' ? COMPACT_CODEX_GUIDANCE : rules.content;
116
118
  const existing = readFileSync(agentsMdPath, 'utf-8');
117
119
  const merged = this.mergeExistingAgentsMdContent(existing, content);
@@ -125,10 +127,6 @@ export class CodexInstaller {
125
127
  }
126
128
  result.ownedGuidanceBytes = this.measureOwnedAgentsSection(merged);
127
129
  }
128
- else {
129
- result.components.rules.status = 'preserved';
130
- result.ownedGuidanceBytes = this.measureOwnedAgentsSection(readFileSync(agentsMdPath, 'utf-8'));
131
- }
132
130
  }
133
131
  catch (error) {
134
132
  this.recordComponentFailure(result, 'rules', error);
@@ -147,6 +145,13 @@ export class CodexInstaller {
147
145
  catch (error) {
148
146
  this.recordComponentFailure(result, 'skills', error);
149
147
  }
148
+ for (const component of ['hooks', 'skills']) {
149
+ if (result.components[component].status === 'unavailable') {
150
+ const message = `Codex ${component} unavailable: packaged assets could not be located`;
151
+ result.components[component].error = message;
152
+ result.errors.push(message);
153
+ }
154
+ }
150
155
  result.success = result.errors.length === 0;
151
156
  return result;
152
157
  }
@@ -232,9 +237,10 @@ export class CodexInstaller {
232
237
  const userGroups = (existing.hooks?.[event] || []).filter((group) => !owned(group));
233
238
  mergedHooks[event] = [...userGroups, ...(generated.hooks?.[event] || [])];
234
239
  }
235
- writeFileSync(targetConfig, JSON.stringify({ ...existing, description: generated.description, hooks: mergedHooks }, null, 2) + '\n');
240
+ // #778: a converged hooks.json is left untouched (no mtime churn).
241
+ const changed = writeFileIfChanged(targetConfig, JSON.stringify({ ...existing, description: generated.description, hooks: mergedHooks }, null, 2) + '\n');
236
242
  result.hooksConfigured = true;
237
- return 'updated';
243
+ return changed ? 'updated' : 'preserved';
238
244
  }
239
245
  /** Install the curated repo-scoped AQE skills Codex discovers automatically. */
240
246
  installCodexSkills() {
@@ -297,6 +303,11 @@ export class CodexInstaller {
297
303
  }
298
304
  }
299
305
  resolvePackageRoot() {
306
+ // Bundled chunks retain their real package location even when npm's aqe
307
+ // bin is a symlink in a global prefix.
308
+ const packagedRoot = findPackageRoot(import.meta.url);
309
+ if (packagedRoot)
310
+ return packagedRoot;
300
311
  const moduleDir = dirname(fileURLToPath(import.meta.url));
301
312
  const candidates = [
302
313
  join(moduleDir, '..', '..'),
@@ -348,7 +359,10 @@ export class CodexInstaller {
348
359
  return merged;
349
360
  if (existing.length === 0)
350
361
  return marked;
351
- return existing.trimEnd() + `${eol}${eol}---${eol}${eol}` + marked;
362
+ // The owned block starts at the original EOF. Keeping every pre-existing
363
+ // byte outside the sentinel lets `none` remove the block exactly, even
364
+ // when the user's file has no trailing newline.
365
+ return existing + marked;
352
366
  }
353
367
  removeOwnedAgentsSections(existing) {
354
368
  this.assertOwnedAgentsSectionsWellFormed(existing);
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Idempotent file writers for `aqe init` (#778).
3
+ *
4
+ * A repeat `aqe init` on an unchanged project must be a byte-stable
5
+ * convergence step: files whose content would not change are left alone (no
6
+ * rewrite, so the mtime is preserved too), and volatile fields such as
7
+ * generation timestamps are carried over from the existing file unless
8
+ * something else in that file actually changed.
9
+ */
10
+ /**
11
+ * Write `content` to `path` only when the bytes on disk differ.
12
+ * @returns true when the file was written.
13
+ */
14
+ export declare function writeFileIfChanged(path: string, content: string | Buffer): boolean;
15
+ /**
16
+ * Copy `src` to `dest` only when `dest` is missing or its bytes differ.
17
+ * Uses copyFileSync for the actual copy so file-mode semantics are unchanged.
18
+ * @returns true when the file was copied.
19
+ */
20
+ export declare function copyFileIfChanged(src: string, dest: string): boolean;
21
+ /**
22
+ * Write a text file whose content embeds a volatile line (e.g. a generation
23
+ * timestamp). When the existing file matches `content` on every line except
24
+ * the lines matching `volatileLine`, the file is left untouched.
25
+ * @returns true when the file was written.
26
+ */
27
+ export declare function writeTextIfChangedIgnoring(path: string, content: string, volatileLine: RegExp): boolean;
28
+ /** The `*Generated by AQE v3 init on <ISO>*` footer of generated index docs. */
29
+ export declare const GENERATED_ON_LINE: RegExp;
30
+ /** JSON serialization with object keys sorted, for order-insensitive comparison. */
31
+ export declare function canonicalJson(value: unknown): string;
32
+ /** Deep structural equality of two JSON values, ignoring object key order. */
33
+ export declare function jsonEquivalent(a: unknown, b: unknown): boolean;
34
+ /**
35
+ * Carry volatile fields (timestamps) over from `previous` into `next` when
36
+ * `next` is otherwise identical to `previous`.
37
+ *
38
+ * - Unchanged (apart from the volatile fields): `next` is mutated to hold the
39
+ * previous values and `false` is returned — the caller should not write.
40
+ * - Changed, or no previous document: `next` keeps its fresh values and
41
+ * `true` is returned — the caller should write.
42
+ */
43
+ export declare function stabilizeVolatileFields(previous: unknown, next: Record<string, unknown>, volatilePaths: ReadonlyArray<readonly string[]>): boolean;
44
+ /** Read and parse a JSON file, or return undefined when missing/unparseable. */
45
+ export declare function readJsonIfPresent(path: string): unknown;
46
+ /**
47
+ * Write a generated JSON document (2-space indent) unless it is equivalent to
48
+ * the one already on disk, preserving the existing values of `volatilePaths`
49
+ * (e.g. `[['createdAt']]`) when nothing else changed.
50
+ * @returns true when the file was written.
51
+ */
52
+ export declare function writeJsonIfChanged(path: string, doc: Record<string, unknown>, volatilePaths?: ReadonlyArray<readonly string[]>): boolean;
53
+ //# sourceMappingURL=idempotent-write.d.ts.map