agentic-qe 3.14.4 → 3.14.5
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.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +93 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/audit/witness-chain.d.ts +1 -1
- package/dist/audit/witness-chain.js +29 -22
- package/dist/cli/bundle.js +13 -10
- package/dist/cli/chunks/adapter-IYC62SXA.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-5PC7D2FW.js → agent-booster-wasm-EDNKP3SP.js} +2 -2
- package/dist/cli/chunks/{agent-handler-RDNTK4CA.js → agent-handler-V6CZ7Q6S.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-NAAMBWIR.js → agent-memory-branch-ZMD6ULC3.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-LLOU2IXD.js +2 -0
- package/dist/cli/chunks/{arena-HXTWJ5YY.js → arena-4UPAEHFT.js} +4 -4
- package/dist/cli/chunks/{arena-KXFHRWX4.js → arena-QLSBESC7.js} +2 -2
- package/dist/cli/chunks/{audit-YSGA7UWT.js → audit-CVZQMF55.js} +3 -3
- package/dist/cli/chunks/base-P3Z4IKCT.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-UICJZIDG.js → better-sqlite3-4DSBPDRH.js} +2 -2
- package/dist/cli/chunks/brain-handler-GBY4EZ4P.js +94 -0
- package/dist/cli/chunks/{branch-enumerator-SS7UNVIA.js → branch-enumerator-XYBVXCNO.js} +2 -2
- package/dist/cli/chunks/{browser-77GI6KBE.js → browser-32F6MREU.js} +2 -2
- package/dist/cli/chunks/browser-workflow-YYHQQ25X.js +2 -0
- package/dist/cli/chunks/{chunk-FGYMFUE2.js → chunk-2JGEZHWY.js} +2 -2
- package/dist/cli/chunks/{chunk-MOBNBMFW.js → chunk-2KJQ2UQE.js} +1 -1
- package/dist/cli/chunks/{chunk-C2WU3533.js → chunk-2OMLTYQK.js} +1 -1
- package/dist/cli/chunks/{chunk-CU46J64M.js → chunk-37TUN44F.js} +2 -2
- package/dist/cli/chunks/{chunk-Z3RHREWF.js → chunk-3DDXWYMO.js} +1 -1
- package/dist/cli/chunks/{chunk-Q5DO24IJ.js → chunk-3EZ5DR2R.js} +3 -3
- package/dist/cli/chunks/{chunk-WLG5AJ4N.js → chunk-3KDL6QDK.js} +2 -2
- package/dist/cli/chunks/{chunk-MTZH7AHC.js → chunk-3VIXOHMS.js} +1 -1
- package/dist/cli/chunks/{chunk-ISDMD6EU.js → chunk-3YUB5HER.js} +96 -96
- package/dist/cli/chunks/{chunk-CDKG6EI7.js → chunk-4FWTLJEP.js} +2 -2
- package/dist/cli/chunks/{chunk-HDSAM2RE.js → chunk-52L77RMG.js} +2 -2
- package/dist/cli/chunks/{chunk-MEGDYJPV.js → chunk-5D36YHS3.js} +4 -4
- package/dist/cli/chunks/{chunk-T6BVLVI5.js → chunk-5WOSWNDN.js} +1 -1
- package/dist/cli/chunks/{chunk-M2JBBZQB.js → chunk-67YV75XP.js} +2 -2
- package/dist/cli/chunks/{chunk-KHFNNVJA.js → chunk-6A44AOGN.js} +2 -2
- package/dist/cli/chunks/{chunk-IPR4QP3H.js → chunk-6CR4VQBQ.js} +2 -2
- package/dist/cli/chunks/{chunk-XRT2WRMS.js → chunk-6ITZZIQX.js} +2 -2
- package/dist/cli/chunks/{chunk-4OYFXLBK.js → chunk-6LKDHEBY.js} +2 -2
- package/dist/cli/chunks/{chunk-FLYOJOKN.js → chunk-6TU7FEMD.js} +1 -1
- package/dist/cli/chunks/{chunk-6QYNWR7U.js → chunk-6VAZAHQG.js} +2 -2
- package/dist/cli/chunks/{chunk-TWAWHOP7.js → chunk-73EI4C2E.js} +2 -2
- package/dist/cli/chunks/{chunk-5R3QL7WN.js → chunk-75QJ5HWE.js} +2 -2
- package/dist/cli/chunks/{chunk-Y3MW3YBC.js → chunk-7CD7PBHY.js} +2 -2
- package/dist/cli/chunks/chunk-7DETTOPZ.js +14 -0
- package/dist/cli/chunks/{chunk-KSKEF7LZ.js → chunk-7JZJJA7U.js} +3 -3
- package/dist/cli/chunks/{chunk-AIHDEEJO.js → chunk-7VFY7TUR.js} +2 -2
- package/dist/cli/chunks/chunk-7X7JYWT4.js +27 -0
- package/dist/cli/chunks/chunk-AF4XKLXO.js +2 -0
- package/dist/cli/chunks/{chunk-6KJABXAR.js → chunk-AFEDJ3RU.js} +2 -2
- package/dist/cli/chunks/{chunk-5SJHQ2CO.js → chunk-AMMQOV35.js} +2 -2
- package/dist/cli/chunks/{chunk-6VRA2QGL.js → chunk-BHFR2EXL.js} +1 -1
- package/dist/cli/chunks/{chunk-ZBAKA4YB.js → chunk-BJPL6THQ.js} +1 -1
- package/dist/cli/chunks/{chunk-DOTK76IJ.js → chunk-BXVAVFGU.js} +2 -2
- package/dist/cli/chunks/{chunk-MNW6QGNJ.js → chunk-BYG36QC5.js} +2 -2
- package/dist/cli/chunks/chunk-C3HQL6S4.js +2 -0
- package/dist/cli/chunks/{chunk-PZJOPURC.js → chunk-C3Z4VVHP.js} +5 -5
- package/dist/cli/chunks/{chunk-OULHKEVH.js → chunk-CPC7FN52.js} +2 -2
- package/dist/cli/chunks/{chunk-BFP7KO7P.js → chunk-CVMNJSCB.js} +2 -2
- package/dist/cli/chunks/{chunk-AUXFKCQL.js → chunk-CYE2TJFV.js} +2 -2
- package/dist/cli/chunks/{chunk-7D777LTF.js → chunk-CZO4BJG5.js} +2 -2
- package/dist/cli/chunks/{chunk-VD6QRULW.js → chunk-D6OUCB2H.js} +2 -2
- package/dist/cli/chunks/{chunk-6UWGMOND.js → chunk-DDCIYOGT.js} +2 -2
- package/dist/cli/chunks/{chunk-STJCATGN.js → chunk-DKUBQQFG.js} +2 -2
- package/dist/cli/chunks/{chunk-M4WJKGVK.js → chunk-DLF5BOJD.js} +1 -1
- package/dist/cli/chunks/{chunk-DA5K5754.js → chunk-DO6EI5KB.js} +1 -1
- package/dist/cli/chunks/{chunk-BDESSCVR.js → chunk-DPBRWP4J.js} +3 -3
- package/dist/cli/chunks/{chunk-HV2J7KKQ.js → chunk-E3W6XQ57.js} +2 -2
- package/dist/cli/chunks/{chunk-MDWCE7YW.js → chunk-E4AZXCT5.js} +1 -1
- package/dist/cli/chunks/{chunk-F3SBRQC6.js → chunk-E4EYPYR3.js} +2 -2
- package/dist/cli/chunks/{chunk-55RWDRJD.js → chunk-EFV4ADMO.js} +4 -4
- package/dist/cli/chunks/{chunk-5YPYDPBJ.js → chunk-ELBZON4V.js} +2 -2
- package/dist/cli/chunks/{chunk-PO3IXGMQ.js → chunk-EOR2UT72.js} +2 -2
- package/dist/cli/chunks/{chunk-EDJ3O7RH.js → chunk-F34OAHOM.js} +2 -2
- package/dist/cli/chunks/{chunk-XRYF6JV7.js → chunk-FUNGTIF2.js} +2 -2
- package/dist/cli/chunks/{chunk-EKQ673SA.js → chunk-G3L5L6YQ.js} +1 -1
- package/dist/cli/chunks/{chunk-NJBGXDQ7.js → chunk-G3W6BMVJ.js} +1 -1
- package/dist/cli/chunks/{chunk-CIZ5JPDC.js → chunk-GTKCGPJZ.js} +3 -3
- package/dist/cli/chunks/{chunk-QGIU2WRL.js → chunk-HBCGYMQU.js} +1 -1
- package/dist/cli/chunks/{chunk-V3QLFNA2.js → chunk-HSVKZ5KI.js} +4 -4
- package/dist/cli/chunks/{chunk-BGE6FOLM.js → chunk-HVU64GP5.js} +2 -2
- package/dist/cli/chunks/chunk-HVXJC3OC.js +2 -0
- package/dist/cli/chunks/{chunk-MIQTXNBG.js → chunk-HYEJJJY3.js} +1 -1
- package/dist/cli/chunks/{chunk-CLTMDCSE.js → chunk-I2NENQ44.js} +2 -2
- package/dist/cli/chunks/{chunk-SGYJ4NFZ.js → chunk-I6X3EGJI.js} +1 -1
- package/dist/cli/chunks/{chunk-BOARZKU3.js → chunk-IGBEJ4UJ.js} +2 -2
- package/dist/cli/chunks/{chunk-FWGOHAAB.js → chunk-IIAR5S7Q.js} +2 -2
- package/dist/cli/chunks/{chunk-DHJPWQBR.js → chunk-IJHCIXJC.js} +2 -2
- package/dist/cli/chunks/{chunk-UEM7ZF5K.js → chunk-IUDWEOLX.js} +2 -2
- package/dist/cli/chunks/chunk-IUHB5GVS.js +3 -0
- package/dist/cli/chunks/{chunk-M5QUBZY6.js → chunk-IYTLXUBO.js} +2 -2
- package/dist/cli/chunks/chunk-J27F4NSB.js +2 -0
- package/dist/cli/chunks/{chunk-G6T45OIC.js → chunk-J5UNP6W3.js} +2 -2
- package/dist/cli/chunks/{chunk-3UPAMMCB.js → chunk-JES6R5KP.js} +1 -1
- package/dist/cli/chunks/{chunk-ZBQY5GLF.js → chunk-JROVR6YS.js} +2 -2
- package/dist/cli/chunks/chunk-JSZ663MU.js +2 -0
- package/dist/cli/chunks/{chunk-PFR4G3DJ.js → chunk-JVQBWYHW.js} +2 -2
- package/dist/cli/chunks/{chunk-JBNEE5UH.js → chunk-K27SU3RE.js} +2 -2
- package/dist/cli/chunks/{chunk-JZ3ORVZ3.js → chunk-K7NJHFLZ.js} +3 -3
- package/dist/cli/chunks/{chunk-3VOQRIQM.js → chunk-KEY43ANX.js} +2 -2
- package/dist/cli/chunks/chunk-KIP6WZGV.js +13 -0
- package/dist/cli/chunks/{chunk-UDHKLT4C.js → chunk-KKHYJF5U.js} +1 -1
- package/dist/cli/chunks/{chunk-ZNEMGX5O.js → chunk-KLTP5IDB.js} +1 -1
- package/dist/cli/chunks/{chunk-ONII3572.js → chunk-KO4FNAUR.js} +3 -3
- package/dist/cli/chunks/{chunk-TSRSV3LD.js → chunk-KYA5LARK.js} +1 -1
- package/dist/cli/chunks/{chunk-2JW3BCGG.js → chunk-LSUILON7.js} +1 -1
- package/dist/cli/chunks/chunk-LULD4JV2.js +15 -0
- package/dist/cli/chunks/{chunk-FRH6VAUS.js → chunk-M23ZOZVY.js} +1 -1
- package/dist/cli/chunks/{chunk-R5NE6B2M.js → chunk-M5AEL7IS.js} +2 -2
- package/dist/cli/chunks/chunk-MI5Q55DG.js +65 -0
- package/dist/cli/chunks/chunk-N7H767TP.js +4 -0
- package/dist/cli/chunks/{chunk-RJCYCLZV.js → chunk-NQI7FWCS.js} +2 -2
- package/dist/cli/chunks/{chunk-CXQPR5MY.js → chunk-NRE4NAVA.js} +1 -1
- package/dist/cli/chunks/{chunk-ODKLFVYC.js → chunk-NU7UTXMP.js} +2 -2
- package/dist/cli/chunks/{chunk-MVPCNSPY.js → chunk-NVYBM3R4.js} +2 -2
- package/dist/cli/chunks/{chunk-MVNP7GIR.js → chunk-O3JTQ7N4.js} +1 -1
- package/dist/cli/chunks/{chunk-6CQN24ZK.js → chunk-OEIQTWQP.js} +1 -1
- package/dist/cli/chunks/{chunk-U5K45TFH.js → chunk-PSPKSUF6.js} +1 -1
- package/dist/cli/chunks/{chunk-CDHQFHRP.js → chunk-QIRL6B3C.js} +2 -2
- package/dist/cli/chunks/{chunk-OSLYSG3B.js → chunk-QRCIZFNK.js} +2 -2
- package/dist/cli/chunks/{chunk-BOZZYWCR.js → chunk-QWUXCG2L.js} +1 -1
- package/dist/cli/chunks/{chunk-HIYXCDEP.js → chunk-QYOGD2VW.js} +1 -1
- package/dist/cli/chunks/{chunk-A4FYONNU.js → chunk-QZMUXJHZ.js} +2 -2
- package/dist/cli/chunks/{chunk-3TW5W5LX.js → chunk-R6IU3EWP.js} +2 -2
- package/dist/cli/chunks/{chunk-3X3DJZJJ.js → chunk-R74ZKREV.js} +1 -1
- package/dist/cli/chunks/{chunk-HIVA55CJ.js → chunk-RD2VGOUH.js} +1 -1
- package/dist/cli/chunks/{chunk-TPGED2IF.js → chunk-RD6TEZ64.js} +2 -2
- package/dist/cli/chunks/{chunk-4MHXCAG2.js → chunk-RGGK6VZ7.js} +1 -1
- package/dist/cli/chunks/{chunk-UGVHCMUN.js → chunk-RIZVC4XY.js} +3 -3
- package/dist/cli/chunks/{chunk-R4VL6E65.js → chunk-RKOUXVZZ.js} +2 -2
- package/dist/cli/chunks/{chunk-IFCLB7FJ.js → chunk-RP2ZKPYV.js} +1 -1
- package/dist/cli/chunks/{chunk-34WO57CW.js → chunk-SQF6HRXR.js} +1 -1
- package/dist/cli/chunks/{chunk-YNXS6CGV.js → chunk-SQKW3B6B.js} +1 -1
- package/dist/cli/chunks/{chunk-TDZ53WO2.js → chunk-SX4JLSLV.js} +2 -2
- package/dist/cli/chunks/{chunk-PAWXJ73E.js → chunk-TUSSPKRM.js} +1 -1
- package/dist/cli/chunks/{chunk-DFZCKIGY.js → chunk-TY5WC3FT.js} +3 -3
- package/dist/cli/chunks/{chunk-J6GNQS62.js → chunk-UDHVCKGA.js} +2 -2
- package/dist/cli/chunks/{chunk-CIKSHTEQ.js → chunk-UJWAWIRV.js} +4 -4
- package/dist/cli/chunks/{chunk-XJ7QNVI5.js → chunk-UKGXWW64.js} +3 -3
- package/dist/cli/chunks/{chunk-64PFWE2F.js → chunk-UMGFMKDW.js} +2 -2
- package/dist/cli/chunks/{chunk-DPFRKBOG.js → chunk-URVHZPWY.js} +2 -2
- package/dist/cli/chunks/{chunk-MCUJEZT6.js → chunk-UTBYJ4RF.js} +2 -2
- package/dist/cli/chunks/{chunk-HUWNIPZ5.js → chunk-VD5IO5EO.js} +1 -1
- package/dist/cli/chunks/{chunk-7ZIOFPL3.js → chunk-VTOVWHEM.js} +2 -2
- package/dist/cli/chunks/{chunk-SRKETSFF.js → chunk-W2XCZU62.js} +1 -1
- package/dist/cli/chunks/{chunk-CNG6GQEZ.js → chunk-WJHWH5D2.js} +2 -2
- package/dist/cli/chunks/{chunk-ZJ26AQA5.js → chunk-WJTSY5MC.js} +1 -1
- package/dist/cli/chunks/{chunk-OCWWP5PL.js → chunk-WK7B4B6Y.js} +2 -2
- package/dist/cli/chunks/{chunk-KPA7MZ6C.js → chunk-WLXK2KNU.js} +2 -2
- package/dist/cli/chunks/{chunk-ZBJ4XOOV.js → chunk-WOIGKU2N.js} +4 -4
- package/dist/cli/chunks/{chunk-ZZDIMOOV.js → chunk-WX6RRIGW.js} +2 -2
- package/dist/cli/chunks/{chunk-STM3UDNO.js → chunk-XEZIIQYJ.js} +2 -2
- package/dist/cli/chunks/{chunk-3QHGWY7T.js → chunk-XFPPERA2.js} +2 -2
- package/dist/cli/chunks/{chunk-VIHTL3U2.js → chunk-XLAUGSW7.js} +2 -2
- package/dist/cli/chunks/{chunk-XC7DYDSY.js → chunk-XQSIRBKT.js} +2 -2
- package/dist/cli/chunks/{chunk-GPLQ6DOK.js → chunk-XUR2M2WB.js} +2 -2
- package/dist/cli/chunks/{chunk-KCZR45PA.js → chunk-XZSMZHM2.js} +2 -2
- package/dist/cli/chunks/{chunk-ZNPKDCZR.js → chunk-Y5L3ES4L.js} +2 -2
- package/dist/cli/chunks/{chunk-W7BWUTVV.js → chunk-YDFL445W.js} +2 -2
- package/dist/cli/chunks/{chunk-AWWNB2T7.js → chunk-YQGPQBCX.js} +2 -2
- package/dist/cli/chunks/{chunk-DAEFDCJ4.js → chunk-YXP6BKGS.js} +17 -17
- package/dist/cli/chunks/{chunk-OBAP2TXZ.js → chunk-ZBABIZ2D.js} +2 -2
- package/dist/cli/chunks/{chunk-CSU5NYOX.js → chunk-ZCWERUYB.js} +4 -4
- package/dist/cli/chunks/{ci-464KPQNP.js → ci-RACDAJMR.js} +2 -2
- package/dist/cli/chunks/{ci-output-I7FX2RSO.js → ci-output-EHRSZBKG.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-3FW237WW.js → circuit-breaker-GBV7M5XG.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-6JKMBPGU.js → claude-flow-setup-5LVJOFKP.js} +2 -2
- package/dist/cli/chunks/client-HUVFA5PF.js +2 -0
- package/dist/cli/chunks/{cline-installer-UWFHT6VY.js → cline-installer-W4NMXJSG.js} +2 -2
- package/dist/cli/chunks/{code-KQSUT3FS.js → code-JWXJMYXB.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-PABBNUSC.js → code-index-extractor-RVI2IFTM.js} +2 -2
- package/dist/cli/chunks/codex-installer-3BORJINH.js +14 -0
- package/dist/cli/chunks/{completions-7RWHAUAR.js → completions-A55NCTAO.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-XPOAF33E.js → complexity-analyzer-JCXHGGLY.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-V4F2FIZP.js → continuedev-installer-PUVFMGYW.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-JMICURQB.js → copilot-installer-4DCMYWHB.js} +2 -2
- package/dist/cli/chunks/core-handlers-UEXO3VAA.js +2 -0
- package/dist/cli/chunks/{cost-tracker-5OFHEYFJ.js → cost-tracker-5TV2GGKY.js} +2 -2
- package/dist/cli/chunks/{coverage-QKN57JDS.js → coverage-NNWM7TX3.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-ODU5IZD6.js +2 -0
- package/dist/cli/chunks/{cursor-installer-GBJ7YXSM.js → cursor-installer-4NCHGJGK.js} +2 -2
- package/dist/cli/chunks/{daemon-IAVSO6HK.js → daemon-QIKCXKWO.js} +4 -4
- package/dist/cli/chunks/{daemon-GKP7CMEK.js → daemon-T4JO4IXP.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-S225TCI7.js → dag-attention-scheduler-RPAAIDAD.js} +2 -2
- package/dist/cli/chunks/{detect-IUYH422U.js → detect-SBEEVDSN.js} +2 -2
- package/dist/cli/chunks/{dist-node-2YRE6A7C.js → dist-node-ZHI6NCSU.js} +2 -2
- package/dist/cli/chunks/{domain-handler-PL2TZC6H.js → domain-handler-LBC3GJ7Z.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-HCGLXKIT.js → domain-plugins-H6IZ5USZ.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-KQJRUPXA.js → domain-transfer-JZA5TMW3.js} +2 -2
- package/dist/cli/chunks/dream-HE3OX42F.js +2 -0
- package/dist/cli/chunks/embed-and-insert-pattern-AHTR7CRU.js +3 -0
- package/dist/cli/chunks/{eval-WCK7KNFN.js → eval-DZU2KISM.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-2MSQWSAR.js → experience-capture-middleware-5IQCWKSL.js} +4 -4
- package/dist/cli/chunks/{fast-paths-VYOSIBKF.js → fast-paths-2KLDUWCY.js} +2 -2
- package/dist/cli/chunks/{feature-flags-UJRHFBRX.js → feature-flags-7AC3XDZA.js} +2 -2
- package/dist/cli/chunks/{feature-flags-WCFUKHNQ.js → feature-flags-N6UAEZY4.js} +2 -2
- package/dist/cli/chunks/{file-discovery-JDGL4ZWS.js → file-discovery-5SDIW4V2.js} +2 -2
- package/dist/cli/chunks/{fleet-ROXVMZ2F.js → fleet-ZIQCAZ2Y.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-NIO4ZCO3.js → gnn-wrapper-DUMBZJEV.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-PI42WD3C.js → heartbeat-handler-6HVM6ZMR.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-QUIFGGLX.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-42KB37KP.js +2 -0
- package/dist/cli/chunks/hnsw-index-T2PGO77J.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-YLC7SPK2.js → hnsw-legacy-bridge-5DRL5FLX.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-LG6OS3B7.js → hnswlib-node-GW67GTCL.js} +2 -2
- package/dist/cli/chunks/{hooks-WVALP5GX.js → hooks-QHH6FVO4.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-FRNWYRKH.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-GJEMW3EG.js → hypergraph-engine-7XDCCVG2.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-BLF6LXEV.js → hypergraph-handler-QHF7NOU5.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-A5QYOYBR.js +2 -0
- package/dist/cli/chunks/{init-handler-K25RWRYY.js → init-handler-5UIVOM7K.js} +6 -6
- package/dist/cli/chunks/init-wizard-XBU674YH.js +2 -0
- package/dist/cli/chunks/kernel-DV5MTNZD.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-BXN6WZ7G.js → kilocode-installer-TGGV6K5Q.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-PM362DLN.js → kiro-installer-4XYBHZWW.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-4ACGVJQK.js +2 -0
- package/dist/cli/chunks/{learning-CPERDDRG.js → learning-STE5W6BS.js} +3 -3
- package/dist/cli/chunks/{llm-router-GOAV5FPI.js → llm-router-NKF7J3RI.js} +4 -4
- package/dist/cli/chunks/llm-router-service-PSMASERT.js +2 -0
- package/dist/cli/chunks/{load-2BG6SHAK.js → load-B2T77UJQ.js} +2 -2
- package/dist/cli/chunks/load-test-MRUO2VPF.js +2 -0
- package/dist/cli/chunks/mcp-JGSFCEMH.js +2 -0
- package/dist/cli/chunks/{memory-4NHBYT6S.js → memory-WRFZKG56.js} +6 -6
- package/dist/cli/chunks/memory-backend-2MPGI6JW.js +2 -0
- package/dist/cli/chunks/memory-handlers-XT4HMITB.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-KCWSGCDT.js → multi-model-executor-26Q5BSVG.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-ATZLLK74.js → opencode-installer-J36EMQU7.js} +2 -2
- package/dist/cli/chunks/{orchestrator-RKB7XJRG.js → orchestrator-D5IFV65I.js} +18 -18
- package/dist/cli/chunks/pattern-null-store-TGWUL237.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-7VE4XDAI.js → pattern-usage-recorder-BVMTWI3E.js} +2 -2
- package/dist/cli/chunks/{pipeline-LQZSNDD2.js → pipeline-OWAHDUAQ.js} +2 -2
- package/dist/cli/chunks/platform-ANGBFWBV.js +2 -0
- package/dist/cli/chunks/{plugin-EJ6K2MGU.js → plugin-OO7ON2YW.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-OIHTKJMN.js → prime-radiant-advanced-wasm-HFG3BXWU.js} +2 -2
- package/dist/cli/chunks/project-root-LNOYVTYY.js +2 -0
- package/dist/cli/chunks/protocol-executor-GEVH5KD6.js +2 -0
- package/dist/cli/chunks/{protocol-handler-NRBROAU7.js → protocol-handler-CE3Q6LY4.js} +2 -2
- package/dist/cli/chunks/{prove-EJOGEGD3.js → prove-7XPN53PY.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-DJ2JL6QB.js +2 -0
- package/dist/cli/chunks/{quality-E55UC73D.js → quality-TT23JRFX.js} +2 -2
- package/dist/cli/chunks/{quality-gate-OIQATNT3.js → quality-gate-PPPRP255.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-F7E3AS26.js +2 -0
- package/dist/cli/chunks/real-embeddings-EYNZIFJE.js +2 -0
- package/dist/cli/chunks/{ref-validation-OPO6J7OL.js → ref-validation-QQR64ZXD.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-ODY5KRWU.js → roocode-installer-UIGS7ZJD.js} +2 -2
- package/dist/cli/chunks/router-OZH3QSAU.js +2 -0
- package/dist/cli/chunks/routing-feedback-J2E3ADZB.js +2 -0
- package/dist/cli/chunks/{routing-handler-KQM6VWLC.js → routing-handler-6AENUIRG.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-U2GVV6PF.js → ruvector-commands-5AWMEV34.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-HK525Y5Y.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-Q7FB3BKR.js +2 -0
- package/dist/cli/chunks/rvf-migration-coordinator-NWRJ7C22.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-5ZRCGUI6.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-KMIHD3LP.js → rvf-store-integrity-ISKRP563.js} +2 -2
- package/dist/cli/chunks/safe-db-3OYEPVEH.js +2 -0
- package/dist/cli/chunks/schedule-AG4C2EIQ.js +2 -0
- package/dist/cli/chunks/scheduler-SQS2CZFZ.js +2 -0
- package/dist/cli/chunks/{security-P5NM353C.js → security-325A7FMB.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-LVIUOO4S.js → shared-rvf-adapter-NFL6QSZ6.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-2CSG7C4W.js → shared-rvf-dual-writer-THFDYS2Z.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-MAKDFSHC.js +2 -0
- package/dist/cli/chunks/standalone-memory-UD4MJ6GZ.js +2 -0
- package/dist/cli/chunks/{status-handler-6TU6O37R.js → status-handler-CPFTN4XL.js} +2 -2
- package/dist/cli/chunks/{structural-health-KBIJSTXJ.js → structural-health-2MG2IVBL.js} +2 -2
- package/dist/cli/chunks/{sync-LNHI5SB7.js → sync-EE4VVKOW.js} +2 -2
- package/dist/cli/chunks/{sync-UHOX6RJW.js → sync-MBTW5XBF.js} +2 -2
- package/dist/cli/chunks/task-handler-7H5OYJG4.js +54 -0
- package/dist/cli/chunks/task-handlers-NH4GJHCJ.js +9 -0
- package/dist/cli/chunks/{test-DHAAI3DU.js → test-MPHGT4T6.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-XDBZ3QC2.js → test-scheduling-CHQ4ZLLJ.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-SSDCYEKK.js +2 -0
- package/dist/cli/chunks/{token-usage-Q2YG5YQN.js → token-usage-EBXUJNRB.js} +2 -2
- package/dist/cli/chunks/{transformers-F5UQTQCY.js → transformers-ZEKS2OJZ.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-DEGOHS6F.js → tree-sitter-wasm-parser-J6ZMAK37.js} +2 -2
- package/dist/cli/chunks/{types-JQ7EQO5Q.js → types-KYAA5VLV.js} +2 -2
- package/dist/cli/chunks/unified-memory-DDWMC435.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-4JA7SGBK.js +2 -0
- package/dist/cli/chunks/unified-persistence-F6OSNTXY.js +2 -0
- package/dist/cli/chunks/{upgrade-TJRVGHGD.js → upgrade-UJBJ5AYM.js} +2 -2
- package/dist/cli/chunks/{validate-BWPCVHBN.js → validate-RUV6YMWS.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-QVVKCQLP.js → validate-swarm-IVEVMGVM.js} +2 -2
- package/dist/cli/chunks/{vibium-ZFATIWHO.js → vibium-HOGMFJ2Z.js} +2 -2
- package/dist/cli/chunks/visual-security-25SMBIYT.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-KPLY7ONR.js → web-tree-sitter-AVWA6HKE.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-H7XM7ISA.js → windsurf-installer-DAH7HI2W.js} +2 -2
- package/dist/cli/chunks/{witness-chain-RRN6NDCH.js → witness-chain-PJOQPFUX.js} +2 -2
- package/dist/cli/chunks/witness-chain-ZW6KKUZU.js +2 -0
- package/dist/cli/chunks/{witness-key-manager-DFRL42GE.js → witness-key-manager-JSTBMG43.js} +2 -2
- package/dist/cli/chunks/{workflow-2ZQO6WYI.js → workflow-TWOIA6LZ.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-UKSIDM7Q.js +2 -0
- package/dist/cli/chunks/{wrappers-SUS6XEJD.js → wrappers-UR7BLXKV.js} +2 -2
- package/dist/cli/commands/mcp.js +6 -0
- package/dist/cli/commands/memory.d.ts +1 -1
- package/dist/cli/commands/memory.js +8 -8
- package/dist/cli/commands/platform.js +15 -2
- package/dist/cli/commands/upgrade.d.ts +3 -3
- package/dist/cli/commands/upgrade.js +3 -3
- package/dist/cli/handlers/init-handler.d.ts +10 -0
- package/dist/cli/handlers/task-handler.js +24 -3
- package/dist/cli/helpers/standalone-memory.d.ts +12 -0
- package/dist/cli/helpers/standalone-memory.js +46 -0
- package/dist/cli/index.js +37 -41
- package/dist/cli/log-gate.d.ts +66 -0
- package/dist/cli/log-gate.js +170 -0
- package/dist/init/codex-installer.js +18 -6
- package/dist/init/orchestrator.js +1 -0
- package/dist/init/phases/09-assets.d.ts +10 -0
- package/dist/init/phases/09-assets.js +3 -0
- package/dist/init/token-bootstrap.d.ts +1 -1
- package/dist/init/token-bootstrap.js +12 -2
- package/dist/init/types.d.ts +10 -0
- package/dist/integrations/ruvector/brain-exporter.js +17 -0
- package/dist/integrations/ruvector/brain-import-audit.d.ts +20 -0
- package/dist/integrations/ruvector/brain-import-audit.js +22 -0
- package/dist/integrations/ruvector/brain-rvf-exporter.js +16 -0
- package/dist/integrations/ruvector/brain-shared.js +1 -1
- package/dist/integrations/ruvector/rvf-dual-writer.js +6 -1
- package/dist/kernel/hybrid-backend.d.ts +6 -0
- package/dist/kernel/hybrid-backend.js +18 -0
- package/dist/kernel/kernel.js +9 -14
- package/dist/kernel/project-root.d.ts +1 -1
- package/dist/kernel/project-root.js +24 -3
- package/dist/learning/embedder-identity-store.js +4 -3
- package/dist/learning/pattern-store.js +5 -1
- package/dist/learning/real-embeddings.d.ts +8 -0
- package/dist/learning/real-embeddings.js +16 -0
- package/dist/learning/rvf-pattern-store.js +10 -3
- package/dist/mcp/bundle.js +442 -442
- package/dist/mcp/entry.js +2 -0
- package/dist/mcp/handlers/memory-handlers.d.ts +6 -1
- package/dist/mcp/handlers/memory-handlers.js +44 -22
- package/dist/mcp/handlers/task-handlers.js +14 -1
- package/dist/mcp/protocol-server.js +1 -0
- package/dist/mcp/services/session-store.js +5 -1
- package/dist/plugins/cache.d.ts +2 -0
- package/dist/plugins/cache.js +15 -2
- package/dist/plugins/lifecycle.js +15 -2
- package/dist/plugins/manifest.js +7 -5
- package/dist/plugins/resolver.d.ts +13 -22
- package/dist/plugins/resolver.js +169 -61
- package/dist/plugins/version-policy.d.ts +13 -0
- package/dist/plugins/version-policy.js +18 -0
- package/dist/shared/types/index.d.ts +6 -0
- package/dist/shared/types/index.js +8 -0
- package/package.json +2 -1
- package/dist/cli/chunks/adapter-TNNNJRDG.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-5ZRMYJLB.js +0 -2
- package/dist/cli/chunks/base-KWZHOPSH.js +0 -2
- package/dist/cli/chunks/brain-handler-ET6YAP4B.js +0 -90
- package/dist/cli/chunks/browser-workflow-2FZTKDUL.js +0 -2
- package/dist/cli/chunks/chunk-33YYYWBQ.js +0 -4
- package/dist/cli/chunks/chunk-5Z6XZV7K.js +0 -65
- package/dist/cli/chunks/chunk-6J62K3SW.js +0 -2
- package/dist/cli/chunks/chunk-6TPKK7LD.js +0 -15
- package/dist/cli/chunks/chunk-DEYLEDJN.js +0 -27
- package/dist/cli/chunks/chunk-KGT36Z42.js +0 -14
- package/dist/cli/chunks/chunk-NA7B2QYB.js +0 -2
- package/dist/cli/chunks/chunk-NDPFGIMJ.js +0 -13
- package/dist/cli/chunks/chunk-PEPFCPES.js +0 -2
- package/dist/cli/chunks/chunk-TT23RRB7.js +0 -2
- package/dist/cli/chunks/chunk-XWMZ6D6N.js +0 -2
- package/dist/cli/chunks/client-7E4LM2WW.js +0 -2
- package/dist/cli/chunks/codex-installer-CQ24DTP5.js +0 -14
- package/dist/cli/chunks/core-handlers-IFG3757P.js +0 -2
- package/dist/cli/chunks/cross-domain-router-EK7W4PGP.js +0 -2
- package/dist/cli/chunks/dream-NFSCSLY7.js +0 -2
- package/dist/cli/chunks/embed-and-insert-pattern-ZPAG7235.js +0 -3
- package/dist/cli/chunks/heartbeat-scheduler-ZATCDJDK.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-WXQABRCA.js +0 -2
- package/dist/cli/chunks/hnsw-index-TPSWLEA5.js +0 -2
- package/dist/cli/chunks/impact-analyzer-HNIU45P5.js +0 -2
- package/dist/cli/chunks/init-wizard-JUIPBMHG.js +0 -2
- package/dist/cli/chunks/kernel-5BOZQ754.js +0 -2
- package/dist/cli/chunks/knowledge-graph-EWDAENWM.js +0 -2
- package/dist/cli/chunks/llm-router-service-3YT7JGBS.js +0 -2
- package/dist/cli/chunks/load-test-BP2CPLIV.js +0 -2
- package/dist/cli/chunks/mcp-5TTB37DC.js +0 -2
- package/dist/cli/chunks/memory-backend-4PYQBPRM.js +0 -2
- package/dist/cli/chunks/memory-handlers-2B27NITS.js +0 -2
- package/dist/cli/chunks/pattern-null-store-OYOQOV2O.js +0 -2
- package/dist/cli/chunks/platform-OD5H5U6G.js +0 -2
- package/dist/cli/chunks/protocol-executor-3ATJTXWG.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-LLMYZT4X.js +0 -2
- package/dist/cli/chunks/queen-coordinator-RN7L6KG5.js +0 -2
- package/dist/cli/chunks/real-embeddings-FPFFNOSZ.js +0 -2
- package/dist/cli/chunks/router-MDHITQ2V.js +0 -2
- package/dist/cli/chunks/routing-feedback-5XLNJ3Y3.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-JBW4O3II.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-BPPQL4XJ.js +0 -2
- package/dist/cli/chunks/rvf-migration-coordinator-V2GHCJKN.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-S4562CG5.js +0 -2
- package/dist/cli/chunks/safe-db-FIRHSXVF.js +0 -2
- package/dist/cli/chunks/schedule-RVXFB4HK.js +0 -2
- package/dist/cli/chunks/scheduler-IKKAMAOO.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-SQ3HCUQ7.js +0 -2
- package/dist/cli/chunks/task-handler-AVDHMLGI.js +0 -49
- package/dist/cli/chunks/task-handlers-KYK4VTRA.js +0 -9
- package/dist/cli/chunks/token-bootstrap-GUTTLPZX.js +0 -2
- package/dist/cli/chunks/unified-memory-CXHLHB5I.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-I7WAE54M.js +0 -2
- package/dist/cli/chunks/unified-persistence-6CPF65WI.js +0 -2
- package/dist/cli/chunks/visual-security-GNPHME5H.js +0 -2
- package/dist/cli/chunks/witness-chain-VT4UHHBR.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-DB3HIECD.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.14.
|
|
2
|
-
import{
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{e as C,f as $}from"./chunk-SX4JLSLV.js";import{a as g,b as h,c as p,e as b,f as y}from"./chunk-HBCGYMQU.js";import{b as v,c as S}from"./chunk-C3HQL6S4.js";import{a as R,f as E}from"./chunk-JSZ663MU.js";S();var i=null,d=!1;function k(r){i=r,d=r!==null}var N=(()=>{let r=process.env.AQE_RVF_SIZE_GUARD_BYTES,t=r?Number(r):NaN;return Number.isFinite(t)&&t>0?t:256*1024*1024})(),B=(()=>{let r=process.env.AQE_RVF_DEAD_RATIO_THRESHOLD,t=r?Number(r):NaN;return Number.isFinite(t)&&t>0&&t<=1?t:.3})();function V(r=".agentic-qe",t=384){if(d)return i;d=!0;try{let{isRvfNativeAvailable:e,createRvfStore:o,openRvfStore:a}=($(),E(C));if(!e())return console.warn("[RVF] Native bindings unavailable \u2014 agent branching and dream COW disabled. Install @ruvector/rvf-node to enable."),null;let s=R("path"),l=s.isAbsolute(r)?r:s.join(process.env.AQE_PROJECT_ROOT??v(),r),n=s.join(l,"patterns.rvf");return i=F(a,o,n,t),w(i,n),i}catch(e){return console.warn("[RVF] Shared adapter init failed:",e instanceof Error?e.message:e),null}}function F(r,t,e,o){let a=()=>{try{return{adapter:r(e),err:null}}catch(n){return{adapter:null,err:n}}},{adapter:s,err:l}=a();if(!s&&p(l))try{let n=R("fs"),c=`${e}.lock`;n.existsSync(c)&&h(e)?console.warn(`[RVF] ${e} is locked by a live process (pid ${g(e)}) \u2014 not breaking the lock; degrading to SQLite for this run.`):b(e)&&(console.warn(`[RVF] Removed stale lock file at ${c} (prior process exited without closing). Retrying open. If you see this repeatedly under live concurrency, file an issue.`),{adapter:s,err:l}=a())}catch(n){process.env.DEBUG&&console.debug("[RVF] stale-lock recovery failed:",n instanceof Error?n.message:n)}if(s){let n=s.dimension();if(n===o)return s;console.warn(`[RVF] patterns.rvf dimension mismatch: file=${n} requested=${o} \u2014 closing and degrading. Delete the .rvf file to recreate at the requested dim.`);try{s.close()}catch{}throw new Error(`RVF dimension mismatch (file=${n}, requested=${o})`)}try{return t(e,o)}catch(n){let c;try{c=r(e)}catch(f){if(p(f))throw f;if(y(e,n instanceof Error?n.message:String(n),f))return t(e,o);throw n instanceof Error?n:new Error(String(n))}let m=c.dimension();if(m!==o){try{c.close()}catch{}throw new Error(`RVF dimension mismatch after race (file=${m}, requested=${o})`)}return c}}function A(r,t){if(t?.force)return{shouldCompact:!0,trigger:"force"};let e=t?.sizeGuardBytes??N,o=t?.deadRatioThreshold??B;return r.fileSizeBytes>=e?{shouldCompact:!0,trigger:"size-guard"}:(r.deadSpaceRatio??0)>=o?{shouldCompact:!0,trigger:"dead-ratio"}:{shouldCompact:!1,trigger:"none"}}function q(r){if(!i)return null;let t;try{t=i.status()}catch{return null}let e=A(t,r);if(!e.shouldCompact)return null;let o=t.fileSizeBytes,a;try{a=i.compact()}catch{return null}return a?((a.bytesReclaimed>0||a.segmentsCompacted>0)&&console.log(`[RVF] compacted patterns.rvf: reclaimed ${u(a.bytesReclaimed)} (${a.segmentsCompacted} segments, fileSize ${u(o)} \u2192 ${u(Math.max(0,o-a.bytesReclaimed))}, trigger: ${e.trigger})`),a):null}function w(r,t){try{let e=r.status(),o=A(e);if(!o.shouldCompact)return null;let a=r.compact();return a&&(a.bytesReclaimed>0||a.segmentsCompacted>0)&&console.log(`[RVF] boot-time compact (${t}): reclaimed ${u(a.bytesReclaimed)} from ${a.segmentsCompacted} segments (trigger: ${o.trigger})`),a}catch(e){return process.env.DEBUG&&console.debug("[RVF] boot-time compact guard skipped:",e instanceof Error?e.message:e),null}}function u(r){if(!Number.isFinite(r)||r<0)return`${r}B`;let t=["B","KB","MB","GB","TB"],e=0,o=r;for(;o>=1024&&e<t.length-1;)o/=1024,e++;return`${o.toFixed(e===0?0:1)}${t[e]}`}function x(){if(i){try{i.close()}catch{}i=null}d=!1}export{k as a,V as b,A as c,q as d,w as e,x as f};
|
|
@@ -1,12 +1,12 @@
|
|
|
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.14.
|
|
2
|
-
import{a as G,b as H}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{a as G,b as H}from"./chunk-UDHVCKGA.js";import{h as U}from"./chunk-UJWAWIRV.js";import{b as W}from"./chunk-MI5Q55DG.js";import{e as N}from"./chunk-RP2ZKPYV.js";import{e as F}from"./chunk-5WOSWNDN.js";import{b as v,c as x}from"./chunk-BYG36QC5.js";import{b as k,d as _}from"./chunk-IJHCIXJC.js";import{c as b,d as E}from"./chunk-XEZIIQYJ.js";import{a as se}from"./chunk-J27F4NSB.js";import{c as O}from"./chunk-7CD7PBHY.js";import{a as y,c as I}from"./chunk-J5UNP6W3.js";import{i as q}from"./chunk-W2XCZU62.js";import{S as ae,b as z}from"./chunk-WJHWH5D2.js";import{randomUUID as ee}from"crypto";I();_();import{randomUUID as oe}from"node:crypto";var B=x(),P=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;localTrajectories=new Map;async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async startTrajectory(e,t){let i=`trajectory-${oe()}`;if(this.claudeFlowAvailable)try{let{execFileSync:r}=await import("child_process"),n=["--no-install",B,"hooks","intelligence","trajectory-start","--task",e];t&&n.push("--agent",t);let s=r("npx",n,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot}).match(/trajectoryId[:\s]+["']?([^"'\s,}]+)/i);if(s?.[1])return s[1]}catch(r){console.debug("[TrajectoryBridge] Claude Flow trajectory start failed:",r instanceof Error?r.message:r)}return this.localTrajectories.set(i,{id:i,task:e,agent:t,steps:[],startedAt:Date.now()}),i}async recordStep(e,t,i,r){if(this.claudeFlowAvailable)try{let{execFileSync:a}=await import("child_process"),s=["--no-install",B,"hooks","intelligence","trajectory-step","--trajectory-id",e,"--action",t];i&&s.push("--result",i),r!==void 0&&s.push("--quality",String(r)),a("npx",s,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot});return}catch(a){console.debug("[TrajectoryBridge] Claude Flow trajectory step failed:",a instanceof Error?a.message:a)}let n=this.localTrajectories.get(e);n&&n.steps.push({id:`step-${n.steps.length+1}`,action:t,result:i,quality:r,timestamp:Date.now()})}async endTrajectory(e,t,i){if(this.claudeFlowAvailable)try{let{execFileSync:n}=await import("child_process"),a=["--no-install",B,"hooks","intelligence","trajectory-end","--trajectory-id",e,"--success",String(t)];i&&a.push("--feedback",i),n("npx",a,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot})}catch{}let r=this.localTrajectories.get(e);if(r)return r.success=t,r.feedback=i,r.completedAt=Date.now(),await this.persistTrajectory(r),r}getTrajectory(e){return this.localTrajectories.get(e)}isClaudeFlowAvailable(){return this.claudeFlowAvailable}async persistTrajectory(e){try{let{getUnifiedMemory:t}=await import("./unified-memory-DDWMC435.js"),i=t();i.isInitialized()||await i.initialize();let r=i.getDatabase();try{r.prepare("PRAGMA table_info(qe_trajectories)").all().some(o=>o.name==="feedback")||r.exec("ALTER TABLE qe_trajectories ADD COLUMN feedback TEXT")}catch{}let n=new Date(e.startedAt).toISOString(),a=e.completedAt?new Date(e.completedAt).toISOString():null;r.prepare(`
|
|
3
3
|
INSERT OR REPLACE INTO qe_trajectories
|
|
4
4
|
(id, task, agent, domain, started_at, ended_at, success, steps_json, feedback)
|
|
5
5
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
6
|
-
`).run(e.id,e.task,e.agent||null,null,n,a,e.success?1:0,JSON.stringify(e.steps),e.feedback||null)}catch(t){console.debug("[TrajectoryBridge] Trajectory persistence failed:",t instanceof Error?t.message:t)}}};var V=x(),J={low:[/simple/i,/basic/i,/fix typo/i,/rename/i,/format/i,/add comment/i,/lint/i,/minor/i,/quick/i],high:[/architect/i,/design/i,/complex/i,/security/i,/performance/i,/refactor.*large/i,/critical/i,/analysis/i,/multi.*file/i,/database.*migration/i,/distributed/i,/concurrent/i]},R=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;routingHistory=[];async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async routeTask(e){if(this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process"),i=t("npx",["--no-install",V,"hooks","model-route","--task",e],{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot}),r=i.match(/model[:\s]+["']?(haiku|sonnet|opus)/i),n=i.match(/confidence[:\s]+([0-9.]+)/i),a=i.match(/reason(?:ing)?[:\s]+["']?([^"'\n]+)/i);if(r)return{model:r[1].toLowerCase(),confidence:n?parseFloat(n[1]):.7,reasoning:a?.[1]?.trim()}}catch(t){console.debug("[ModelRouterBridge] Claude Flow routing failed:",t instanceof Error?t.message:t)}return this.localRoute(e)}async recordOutcome(e){if(this.routingHistory.push(e),this.routingHistory.length>1e3&&(this.routingHistory=this.routingHistory.slice(-500)),this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process");t("npx",["--no-install",V,"hooks","model-outcome","--task",e.task,"--model",e.model,"--outcome",e.outcome],{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot})}catch(t){console.debug("[ModelRouterBridge] Outcome recording failed:",t instanceof Error?t.message:t)}}getStats(){let e={totalRoutings:this.routingHistory.length,modelDistribution:{haiku:0,sonnet:0,opus:0},successRate:{haiku:0,sonnet:0,opus:0}},t={haiku:0,sonnet:0,opus:0};for(let i of this.routingHistory)e.modelDistribution[i.model]++,i.outcome==="success"&&t[i.model]++;for(let i of["haiku","sonnet","opus"]){let r=e.modelDistribution[i];e.successRate[i]=r>0?t[i]/r:0}return e}isClaudeFlowAvailable(){return this.claudeFlowAvailable}localRoute(e){let t=e.toLowerCase();for(let i of J.low)if(i.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task detected - using haiku for speed"};for(let i of J.high)if(i.test(t))return{model:"opus",confidence:.8,reasoning:"High complexity task detected - using opus for capability"};return e.length>500?{model:"opus",confidence:.65,reasoning:"Long task description - using opus for complex reasoning"}:e.length<50?{model:"haiku",confidence:.6,reasoning:"Short task description - using haiku for efficiency"}:{model:"sonnet",confidence:.7,reasoning:"Medium complexity task - using sonnet for balance"}}};q();I();var D=x(),S=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;analysisCache=new Map;async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async analyze(e,t="medium"){let i=e||this.options.projectRoot,r=`${i}:${t}`,n=this.analysisCache.get(r);if(n)return n;if(this.claudeFlowAvailable)try{let{execFileSync:a}=await import("child_process"),s=a("npx",["--no-install",D,"hooks","pretrain","--path",i,"--depth",t],{encoding:"utf-8",timeout:12e4,cwd:this.options.projectRoot});try{let o=k(s),p={success:!0,repositoryPath:i,depth:t,analysis:o.analysis||void 0,agentConfigs:o.agentConfigs};return this.analysisCache.set(r,p),p}catch{return{success:!0,repositoryPath:i,depth:t}}}catch(a){console.debug("[PretrainBridge] Claude Flow analyze failed, using local:",a instanceof Error?a.message:a)}return this.localAnalyze(i,t)}async generateAgentConfigs(e="yaml"){if(this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process"),i=t("npx",["--no-install",D,"hooks","build-agents","--format",e],{encoding:"utf-8",timeout:6e4,cwd:this.options.projectRoot});try{return k(i)}catch(r){return console.debug("[PretrainBridge] Agent config parse error:",r instanceof Error?r.message:r),[]}}catch(t){console.debug("[PretrainBridge] Claude Flow generateAgentConfigs failed:",t instanceof Error?t.message:t)}return this.generateLocalAgentConfigs()}async transferPatterns(e,t=.7){if(this.claudeFlowAvailable)try{let{execFileSync:i}=await import("child_process"),r=i("npx",["--no-install",D,"hooks","transfer","--source-path",e,"--min-confidence",String(t)],{encoding:"utf-8",timeout:6e4,cwd:this.options.projectRoot}),n=r.match(/transferred[:\s]+(\d+)/i),a=r.match(/skipped[:\s]+(\d+)/i);return{transferred:n?parseInt(n[1]):0,skipped:a?parseInt(a[1]):0}}catch(i){console.debug("[PretrainBridge] Claude Flow transferPatterns failed:",i instanceof Error?i.message:i)}return{transferred:0,skipped:0}}isClaudeFlowAvailable(){return this.claudeFlowAvailable}async localAnalyze(e,t){try{let i=await import("fast-glob"),{existsSync:r,readFileSync:n}=await import("fs"),{join:a}=await import("path"),s=t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],o=["node_modules/**","dist/**","coverage/**",".git/**"],p=await i.default(s,{cwd:e,ignore:o,onlyFiles:!0}),u=new Set,g=new Set;for(let d of p.slice(0,100))(d.endsWith(".ts")||d.endsWith(".tsx"))&&u.add("typescript"),(d.endsWith(".js")||d.endsWith(".jsx"))&&u.add("javascript"),d.endsWith(".py")&&u.add("python"),d.endsWith(".go")&&u.add("go"),d.endsWith(".rs")&&u.add("rust");let w=a(e,"package.json");if(r(w))try{let d=k(n(w,"utf-8")),f={...d.dependencies,...d.devDependencies};f.react&&g.add("react"),f.vue&&g.add("vue"),f.angular&&g.add("angular"),f.vitest&&g.add("vitest"),f.jest&&g.add("jest"),f.playwright&&g.add("playwright"),f.express&&g.add("express"),f.fastify&&g.add("fastify")}catch(d){console.debug("[PretrainBridge] package.json parse error:",d instanceof Error?d.message:d)}let m={success:!0,repositoryPath:e,depth:t,analysis:{languages:Array.from(u),frameworks:Array.from(g),patterns:[],complexity:p.length>500?3:p.length>100?2:1}};return this.analysisCache.set(`${e}:${t}`,m),m}catch(i){return{success:!1,repositoryPath:e,depth:t,error:y(i)}}}generateLocalAgentConfigs(){return[{name:"qe-test-architect",type:"worker",capabilities:["test-generation","test-design"],model:"sonnet"},{name:"qe-coverage-specialist",type:"worker",capabilities:["coverage-analysis","gap-detection"],model:"haiku"},{name:"qe-quality-gate",type:"worker",capabilities:["quality-assessment","risk-scoring"],model:"sonnet"},{name:"qe-security-scanner",type:"worker",capabilities:["security-scanning","vulnerability-detection"],model:"opus"}]}};var M=class{constructor(e){this.options=e;this.trajectory=new P(e),this.modelRouter=new R(e),this.pretrain=new S(e)}options;trajectory;modelRouter;pretrain;initialized=!1;async initialize(){this.initialized||(await Promise.all([this.trajectory.initialize(),this.modelRouter.initialize(),this.pretrain.initialize()]),this.initialized=!0)}getStatus(){return{available:this.isAvailable(),features:{trajectories:this.trajectory.isClaudeFlowAvailable(),modelRouting:this.modelRouter.isClaudeFlowAvailable(),pretrain:this.pretrain.isClaudeFlowAvailable(),patternSearch:this.trajectory.isClaudeFlowAvailable()}}}isAvailable(){return this.trajectory.isClaudeFlowAvailable()||this.modelRouter.isClaudeFlowAvailable()||this.pretrain.isClaudeFlowAvailable()}};function X(l){return new M(l)}ae();se();var T=O.create("experience-capture"),K={"catches-bug":1,flaky:-1,"false-positive":-1,"new-coverage":.3,redundant:0,"code-smell":-.5,neutral:0},ce=new Set(Object.keys(K));function Z(l){return typeof l=="string"&&ce.has(l)}function le(l){if(Z(l))return K[l]}var ue={namespace:"qe-experiences",minQualityForPatternExtraction:.7,similarityThreshold:.85,promotionThreshold:F,maxExperiencesPerDomain:1e3,enableCrossDomainSharing:!0,autoCleanup:!0,cleanupIntervalMs:864e5},Q=class{constructor(e,t,i,r={}){this.memory=e;this.patternStore=t;this.eventBus=i;this.config={...ue,...r}}memory;patternStore;eventBus;config;initialized=!1;cleanupTimer;activeExperiences=new Map;stats={totalCaptured:0,successfulCaptures:0,patternsExtracted:0,patternsPromoted:0,byDomain:new Map};sessionCaptureCount=0;witnessChain;nullRecorder;setWitnessChain(e){this.witnessChain=e}setNullRecorder(e){this.nullRecorder=e}async initialize(){this.initialized||(await this.loadStats(),this.config.autoCleanup&&(this.cleanupTimer=setInterval(()=>this.cleanup(),this.config.cleanupIntervalMs)),this.initialized=!0,console.log("[ExperienceCapture] Initialized"))}startCapture(e,t){let i=`exp-${Date.now()}-${z().slice(0,8)}`,r={id:i,task:e,agent:t?.agent,domain:t?.domain,model:t?.model,startedAt:Date.now(),completedAt:0,durationMs:0,steps:[],success:!1,quality:0,trajectoryId:t?.trajectoryId,metadata:t?.metadata,appliedPatterns:t?.appliedPatterns};return this.activeExperiences.set(i,r),i}recordStep(e,t){let i=this.activeExperiences.get(e);if(!i){console.warn(`[ExperienceCapture] Experience not found: ${e}`);return}i.steps.push({...t,timestamp:Date.now()})}async completeCapture(e,t){let i=this.activeExperiences.get(e);if(!i)return E(new Error(`Experience not found: ${e}`));let r=Date.now();i.completedAt=r,i.durationMs=r-i.startedAt,i.success=t.success,i.feedback=t.feedback,t.quality!==void 0?i.quality=t.quality:i.quality=this.calculateQuality(i);let n=t.testOutcome??i.metadata?.testOutcome;if(n&&Z(n)&&(i.testOutcome=n,i.reward=le(n)),this.witnessChain&&_().useWitnessChain)try{let o=this.witnessChain.appendWitness({type:"experience-capture",decision:i.success?"PASS":"FAIL",context:{experienceId:i.id,task:i.task,quality:i.quality,domain:i.domain,reward:i.reward},evidence:i.reward});i.witnessHash=o.hash}catch(o){T.warn("Failed to create witness receipt for experience",{experienceId:i.id,error:o instanceof Error?o.message:String(o)})}this.activeExperiences.delete(e),await this.storeExperience(i),this.updateStats(i);let a=i.reward!==void 0?i.reward<0:!i.success;if(this.nullRecorder&&a&&i.appliedPatterns?.length){let o=`${i.domain??"unknown"}:${i.agent??"unknown"}`;for(let p of i.appliedPatterns)try{this.nullRecorder({patternId:p,contextFingerprint:o,failureMode:i.testOutcome??i.feedback??"task-failure",trajectoryRef:i.trajectoryId,evidenceClass:"EXECUTED"})}catch(u){T.warn("Failed to record pattern null",{patternId:p,error:u instanceof Error?u.message:String(u)})}}let s=i.reward===void 0||i.reward>0;if(i.success&&i.quality>=this.config.minQualityForPatternExtraction&&s){let o=await this.extractPattern(i);(o.newPattern||o.reinforced)&&(i.patterns=[o.patternId])}return this.emitExperienceCaptured(i),b(i)}getActiveExperience(e){return this.activeExperiences.get(e)}getPendingCount(){return this.activeExperiences.size}async flushPending(){let e=Array.from(this.activeExperiences.entries());if(e.length===0)return 0;let t=0;for(let[i,r]of e){let n=Date.now();r.completedAt=n,r.durationMs=n-r.startedAt,r.quality=r.quality||this.calculateQuality(r),r.metadata={...r.metadata,flushedByCompaction:!0},await this.storeExperience(r),this.updateStats(r),this.activeExperiences.delete(i),t++}return T.info(`Flushed ${t} pending experiences before compaction`),t}async getExperience(e){let t=`${this.config.namespace}:experience:${e}`;return await this.memory.get(t)??null}async searchExperiences(e={}){let t=e.limit||100,i=[],r;e.domain?r=await this.memory.search(`${this.config.namespace}:index:domain:${e.domain}:*`,t*2):r=await this.memory.search(`${this.config.namespace}:experience:*`,t*2);for(let n of r){if(i.length>=t)break;let a=n.includes(":index:")?await this.memory.get(n):null,s=a?await this.getExperience(a):await this.memory.get(n);s&&(e.agent&&s.agent!==e.agent||e.success!==void 0&&s.success!==e.success||e.minQuality!==void 0&&s.quality<e.minQuality||i.push(s))}return i}async getStats(){let e={};for(let[t,i]of this.stats.byDomain)e[t]=i;return{totalExperiences:this.stats.totalCaptured,byDomain:e,successRate:this.stats.totalCaptured>0?this.stats.successfulCaptures/this.stats.totalCaptured:0,avgQuality:await this.calculateAvgQuality(),patternsExtracted:this.stats.patternsExtracted,patternsPromoted:this.stats.patternsPromoted}}async extractPattern(e){if(!this.patternStore)return{newPattern:!1,reinforced:!1,promoted:!1};let t=await this.patternStore.search(e.task,{limit:1,domain:e.domain,useVectorSearch:!0});if(t.success&&t.value.length>0){let n=t.value[0];if(n.similarity>=this.config.similarityThreshold){let a=await this.patternStore.recordUsage(n.pattern.id,e.success),s=await this.patternStore.get(n.pattern.id),o=!1;return s&&s.tier==="short-term"&&s.usageCount>=this.config.promotionThreshold&&(await this.patternStore.promote(n.pattern.id)).success&&(o=!0,this.stats.patternsPromoted++,console.log(`[ExperienceCapture] Pattern promoted: ${n.pattern.id} (${s.usageCount} uses)`)),{newPattern:!1,patternId:n.pattern.id,reinforced:a.success,promoted:o}}}let i=this.experienceToPatternOptions(e),r=await this.patternStore.create(i);return r.success?(this.stats.patternsExtracted++,await this.patternStore.recordUsage(r.value.id,e.success),{newPattern:!0,patternId:r.value.id,reinforced:!1,promoted:!1}):{newPattern:!1,reinforced:!1,promoted:!1}}async shareAcrossDomains(e){if(!this.config.enableCrossDomainSharing||!e.domain)return;let t=this.getRelatedDomains(e.domain);for(let i of t){let r=`${this.config.namespace}:shared:${i}:${e.id}`;await this.memory.set(r,{sourceExperience:e.id,sourceDomain:e.domain,sharedAt:Date.now()},{persist:!0})}}async cleanup(){let t=0;for(let i of this.stats.byDomain.keys()){let r=this.stats.byDomain.get(i)||0;if(r>this.config.maxExperiencesPerDomain){let n=await this.searchExperiences({domain:i,limit:r});n.sort((s,o)=>s.quality-o.quality||s.startedAt-o.startedAt);let a=r-this.config.maxExperiencesPerDomain;for(let s=0;s<Math.min(a,n.length);s++){let o=n[s];await this.softDeleteExperience(o.id),t++}}}return console.log(`[ExperienceCapture] Cleanup: ${t} archived (0 destroyed)`),{removed:0,consolidated:0,archived:t}}async dispose(){this.cleanupTimer&&(clearInterval(this.cleanupTimer),this.cleanupTimer=void 0),await this.saveStats(),this.sessionCaptureCount===0&&console.warn("[ExperienceCapture] WARNING: Zero experiences captured this session. Learning cannot improve without experience data. Ensure tasks call startCapture()/completeCapture() to feed the learning loop."),this.activeExperiences.clear(),this.initialized=!1}async storeExperience(e){let t=`${this.config.namespace}:experience:${e.id}`;if(await this.memory.set(t,e,{persist:!0}),e.domain){let i=`${this.config.namespace}:index:domain:${e.domain}:${e.id}`;await this.memory.set(i,e.id,{persist:!0})}if(e.agent){let i=`${this.config.namespace}:index:agent:${e.agent}:${e.id}`;await this.memory.set(i,e.id,{persist:!0})}}async deleteExperience(e){await this.softDeleteExperience(e)}async softDeleteExperience(e){let t=await this.getExperience(e);if(!t)return;let i=`${this.config.namespace}:experience:${e}`,r={...t,_archived:!0};await this.memory.set(i,r,{persist:!0})}calculateQuality(e){if(e.steps.length===0)return e.success?.5:.2;let t=e.steps.filter(r=>r.quality!==void 0);if(t.length===0)return e.success?.6:.3;let i=t.reduce((r,n)=>r+(n.quality||0),0)/t.length;return e.success?Math.min(1,i+.1):Math.max(0,i-.2)}updateStats(e){if(this.stats.totalCaptured++,this.sessionCaptureCount++,e.success&&this.stats.successfulCaptures++,e.domain){let t=this.stats.byDomain.get(e.domain)||0;this.stats.byDomain.set(e.domain,t+1)}}async calculateAvgQuality(){let e=await this.searchExperiences({limit:100});return e.length===0?0:e.reduce((i,r)=>i+r.quality,0)/e.length}experienceToPatternOptions(e){let t=this.detectPatternType(e.task),r=`Task: {{task}}
|
|
6
|
+
`).run(e.id,e.task,e.agent||null,null,n,a,e.success?1:0,JSON.stringify(e.steps),e.feedback||null)}catch(t){console.debug("[TrajectoryBridge] Trajectory persistence failed:",t instanceof Error?t.message:t)}}};var V=x(),J={low:[/simple/i,/basic/i,/fix typo/i,/rename/i,/format/i,/add comment/i,/lint/i,/minor/i,/quick/i],high:[/architect/i,/design/i,/complex/i,/security/i,/performance/i,/refactor.*large/i,/critical/i,/analysis/i,/multi.*file/i,/database.*migration/i,/distributed/i,/concurrent/i]},R=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;routingHistory=[];async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async routeTask(e){if(this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process"),i=t("npx",["--no-install",V,"hooks","model-route","--task",e],{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot}),r=i.match(/model[:\s]+["']?(haiku|sonnet|opus)/i),n=i.match(/confidence[:\s]+([0-9.]+)/i),a=i.match(/reason(?:ing)?[:\s]+["']?([^"'\n]+)/i);if(r)return{model:r[1].toLowerCase(),confidence:n?parseFloat(n[1]):.7,reasoning:a?.[1]?.trim()}}catch(t){console.debug("[ModelRouterBridge] Claude Flow routing failed:",t instanceof Error?t.message:t)}return this.localRoute(e)}async recordOutcome(e){if(this.routingHistory.push(e),this.routingHistory.length>1e3&&(this.routingHistory=this.routingHistory.slice(-500)),this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process");t("npx",["--no-install",V,"hooks","model-outcome","--task",e.task,"--model",e.model,"--outcome",e.outcome],{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot})}catch(t){console.debug("[ModelRouterBridge] Outcome recording failed:",t instanceof Error?t.message:t)}}getStats(){let e={totalRoutings:this.routingHistory.length,modelDistribution:{haiku:0,sonnet:0,opus:0},successRate:{haiku:0,sonnet:0,opus:0}},t={haiku:0,sonnet:0,opus:0};for(let i of this.routingHistory)e.modelDistribution[i.model]++,i.outcome==="success"&&t[i.model]++;for(let i of["haiku","sonnet","opus"]){let r=e.modelDistribution[i];e.successRate[i]=r>0?t[i]/r:0}return e}isClaudeFlowAvailable(){return this.claudeFlowAvailable}localRoute(e){let t=e.toLowerCase();for(let i of J.low)if(i.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task detected - using haiku for speed"};for(let i of J.high)if(i.test(t))return{model:"opus",confidence:.8,reasoning:"High complexity task detected - using opus for capability"};return e.length>500?{model:"opus",confidence:.65,reasoning:"Long task description - using opus for complex reasoning"}:e.length<50?{model:"haiku",confidence:.6,reasoning:"Short task description - using haiku for efficiency"}:{model:"sonnet",confidence:.7,reasoning:"Medium complexity task - using sonnet for balance"}}};_();I();var D=x(),S=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;analysisCache=new Map;async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async analyze(e,t="medium"){let i=e||this.options.projectRoot,r=`${i}:${t}`,n=this.analysisCache.get(r);if(n)return n;if(this.claudeFlowAvailable)try{let{execFileSync:a}=await import("child_process"),s=a("npx",["--no-install",D,"hooks","pretrain","--path",i,"--depth",t],{encoding:"utf-8",timeout:12e4,cwd:this.options.projectRoot});try{let o=k(s),p={success:!0,repositoryPath:i,depth:t,analysis:o.analysis||void 0,agentConfigs:o.agentConfigs};return this.analysisCache.set(r,p),p}catch{return{success:!0,repositoryPath:i,depth:t}}}catch(a){console.debug("[PretrainBridge] Claude Flow analyze failed, using local:",a instanceof Error?a.message:a)}return this.localAnalyze(i,t)}async generateAgentConfigs(e="yaml"){if(this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process"),i=t("npx",["--no-install",D,"hooks","build-agents","--format",e],{encoding:"utf-8",timeout:6e4,cwd:this.options.projectRoot});try{return k(i)}catch(r){return console.debug("[PretrainBridge] Agent config parse error:",r instanceof Error?r.message:r),[]}}catch(t){console.debug("[PretrainBridge] Claude Flow generateAgentConfigs failed:",t instanceof Error?t.message:t)}return this.generateLocalAgentConfigs()}async transferPatterns(e,t=.7){if(this.claudeFlowAvailable)try{let{execFileSync:i}=await import("child_process"),r=i("npx",["--no-install",D,"hooks","transfer","--source-path",e,"--min-confidence",String(t)],{encoding:"utf-8",timeout:6e4,cwd:this.options.projectRoot}),n=r.match(/transferred[:\s]+(\d+)/i),a=r.match(/skipped[:\s]+(\d+)/i);return{transferred:n?parseInt(n[1]):0,skipped:a?parseInt(a[1]):0}}catch(i){console.debug("[PretrainBridge] Claude Flow transferPatterns failed:",i instanceof Error?i.message:i)}return{transferred:0,skipped:0}}isClaudeFlowAvailable(){return this.claudeFlowAvailable}async localAnalyze(e,t){try{let i=await import("fast-glob"),{existsSync:r,readFileSync:n}=await import("fs"),{join:a}=await import("path"),s=t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],o=["node_modules/**","dist/**","coverage/**",".git/**"],p=await i.default(s,{cwd:e,ignore:o,onlyFiles:!0}),u=new Set,g=new Set;for(let d of p.slice(0,100))(d.endsWith(".ts")||d.endsWith(".tsx"))&&u.add("typescript"),(d.endsWith(".js")||d.endsWith(".jsx"))&&u.add("javascript"),d.endsWith(".py")&&u.add("python"),d.endsWith(".go")&&u.add("go"),d.endsWith(".rs")&&u.add("rust");let w=a(e,"package.json");if(r(w))try{let d=k(n(w,"utf-8")),f={...d.dependencies,...d.devDependencies};f.react&&g.add("react"),f.vue&&g.add("vue"),f.angular&&g.add("angular"),f.vitest&&g.add("vitest"),f.jest&&g.add("jest"),f.playwright&&g.add("playwright"),f.express&&g.add("express"),f.fastify&&g.add("fastify")}catch(d){console.debug("[PretrainBridge] package.json parse error:",d instanceof Error?d.message:d)}let m={success:!0,repositoryPath:e,depth:t,analysis:{languages:Array.from(u),frameworks:Array.from(g),patterns:[],complexity:p.length>500?3:p.length>100?2:1}};return this.analysisCache.set(`${e}:${t}`,m),m}catch(i){return{success:!1,repositoryPath:e,depth:t,error:y(i)}}}generateLocalAgentConfigs(){return[{name:"qe-test-architect",type:"worker",capabilities:["test-generation","test-design"],model:"sonnet"},{name:"qe-coverage-specialist",type:"worker",capabilities:["coverage-analysis","gap-detection"],model:"haiku"},{name:"qe-quality-gate",type:"worker",capabilities:["quality-assessment","risk-scoring"],model:"sonnet"},{name:"qe-security-scanner",type:"worker",capabilities:["security-scanning","vulnerability-detection"],model:"opus"}]}};var M=class{constructor(e){this.options=e;this.trajectory=new P(e),this.modelRouter=new R(e),this.pretrain=new S(e)}options;trajectory;modelRouter;pretrain;initialized=!1;async initialize(){this.initialized||(await Promise.all([this.trajectory.initialize(),this.modelRouter.initialize(),this.pretrain.initialize()]),this.initialized=!0)}getStatus(){return{available:this.isAvailable(),features:{trajectories:this.trajectory.isClaudeFlowAvailable(),modelRouting:this.modelRouter.isClaudeFlowAvailable(),pretrain:this.pretrain.isClaudeFlowAvailable(),patternSearch:this.trajectory.isClaudeFlowAvailable()}}}isAvailable(){return this.trajectory.isClaudeFlowAvailable()||this.modelRouter.isClaudeFlowAvailable()||this.pretrain.isClaudeFlowAvailable()}};function X(l){return new M(l)}se();ae();var T=O.create("experience-capture"),K={"catches-bug":1,flaky:-1,"false-positive":-1,"new-coverage":.3,redundant:0,"code-smell":-.5,neutral:0},ce=new Set(Object.keys(K));function Z(l){return typeof l=="string"&&ce.has(l)}function le(l){if(Z(l))return K[l]}var ue={namespace:"qe-experiences",minQualityForPatternExtraction:.7,similarityThreshold:.85,promotionThreshold:F,maxExperiencesPerDomain:1e3,enableCrossDomainSharing:!0,autoCleanup:!0,cleanupIntervalMs:864e5},Q=class{constructor(e,t,i,r={}){this.memory=e;this.patternStore=t;this.eventBus=i;this.config={...ue,...r}}memory;patternStore;eventBus;config;initialized=!1;cleanupTimer;activeExperiences=new Map;stats={totalCaptured:0,successfulCaptures:0,patternsExtracted:0,patternsPromoted:0,byDomain:new Map};sessionCaptureCount=0;witnessChain;nullRecorder;setWitnessChain(e){this.witnessChain=e}setNullRecorder(e){this.nullRecorder=e}async initialize(){this.initialized||(await this.loadStats(),this.config.autoCleanup&&(this.cleanupTimer=setInterval(()=>this.cleanup(),this.config.cleanupIntervalMs)),this.initialized=!0,console.log("[ExperienceCapture] Initialized"))}startCapture(e,t){let i=`exp-${Date.now()}-${q().slice(0,8)}`,r={id:i,task:e,agent:t?.agent,domain:t?.domain,model:t?.model,startedAt:Date.now(),completedAt:0,durationMs:0,steps:[],success:!1,quality:0,trajectoryId:t?.trajectoryId,metadata:t?.metadata,appliedPatterns:t?.appliedPatterns};return this.activeExperiences.set(i,r),i}recordStep(e,t){let i=this.activeExperiences.get(e);if(!i){console.warn(`[ExperienceCapture] Experience not found: ${e}`);return}i.steps.push({...t,timestamp:Date.now()})}async completeCapture(e,t){let i=this.activeExperiences.get(e);if(!i)return E(new Error(`Experience not found: ${e}`));let r=Date.now();i.completedAt=r,i.durationMs=r-i.startedAt,i.success=t.success,i.feedback=t.feedback,t.quality!==void 0?i.quality=t.quality:i.quality=this.calculateQuality(i);let n=t.testOutcome??i.metadata?.testOutcome;if(n&&Z(n)&&(i.testOutcome=n,i.reward=le(n)),this.witnessChain&&z().useWitnessChain)try{let o=this.witnessChain.appendWitness({type:"experience-capture",decision:i.success?"PASS":"FAIL",context:{experienceId:i.id,task:i.task,quality:i.quality,domain:i.domain,reward:i.reward},evidence:i.reward});i.witnessHash=o.hash}catch(o){T.warn("Failed to create witness receipt for experience",{experienceId:i.id,error:o instanceof Error?o.message:String(o)})}this.activeExperiences.delete(e),await this.storeExperience(i),this.updateStats(i);let a=i.reward!==void 0?i.reward<0:!i.success;if(this.nullRecorder&&a&&i.appliedPatterns?.length){let o=`${i.domain??"unknown"}:${i.agent??"unknown"}`;for(let p of i.appliedPatterns)try{this.nullRecorder({patternId:p,contextFingerprint:o,failureMode:i.testOutcome??i.feedback??"task-failure",trajectoryRef:i.trajectoryId,evidenceClass:"EXECUTED"})}catch(u){T.warn("Failed to record pattern null",{patternId:p,error:u instanceof Error?u.message:String(u)})}}let s=i.reward===void 0||i.reward>0;if(i.success&&i.quality>=this.config.minQualityForPatternExtraction&&s){let o=await this.extractPattern(i);(o.newPattern||o.reinforced)&&(i.patterns=[o.patternId])}return this.emitExperienceCaptured(i),b(i)}getActiveExperience(e){return this.activeExperiences.get(e)}getPendingCount(){return this.activeExperiences.size}async flushPending(){let e=Array.from(this.activeExperiences.entries());if(e.length===0)return 0;let t=0;for(let[i,r]of e){let n=Date.now();r.completedAt=n,r.durationMs=n-r.startedAt,r.quality=r.quality||this.calculateQuality(r),r.metadata={...r.metadata,flushedByCompaction:!0},await this.storeExperience(r),this.updateStats(r),this.activeExperiences.delete(i),t++}return T.info(`Flushed ${t} pending experiences before compaction`),t}async getExperience(e){let t=`${this.config.namespace}:experience:${e}`;return await this.memory.get(t)??null}async searchExperiences(e={}){let t=e.limit||100,i=[],r;e.domain?r=await this.memory.search(`${this.config.namespace}:index:domain:${e.domain}:*`,t*2):r=await this.memory.search(`${this.config.namespace}:experience:*`,t*2);for(let n of r){if(i.length>=t)break;let a=n.includes(":index:")?await this.memory.get(n):null,s=a?await this.getExperience(a):await this.memory.get(n);s&&(e.agent&&s.agent!==e.agent||e.success!==void 0&&s.success!==e.success||e.minQuality!==void 0&&s.quality<e.minQuality||i.push(s))}return i}async getStats(){let e={};for(let[t,i]of this.stats.byDomain)e[t]=i;return{totalExperiences:this.stats.totalCaptured,byDomain:e,successRate:this.stats.totalCaptured>0?this.stats.successfulCaptures/this.stats.totalCaptured:0,avgQuality:await this.calculateAvgQuality(),patternsExtracted:this.stats.patternsExtracted,patternsPromoted:this.stats.patternsPromoted}}async extractPattern(e){if(!this.patternStore)return{newPattern:!1,reinforced:!1,promoted:!1};let t=await this.patternStore.search(e.task,{limit:1,domain:e.domain,useVectorSearch:!0});if(t.success&&t.value.length>0){let n=t.value[0];if(n.similarity>=this.config.similarityThreshold){let a=await this.patternStore.recordUsage(n.pattern.id,e.success),s=await this.patternStore.get(n.pattern.id),o=!1;return s&&s.tier==="short-term"&&s.usageCount>=this.config.promotionThreshold&&(await this.patternStore.promote(n.pattern.id)).success&&(o=!0,this.stats.patternsPromoted++,console.log(`[ExperienceCapture] Pattern promoted: ${n.pattern.id} (${s.usageCount} uses)`)),{newPattern:!1,patternId:n.pattern.id,reinforced:a.success,promoted:o}}}let i=this.experienceToPatternOptions(e),r=await this.patternStore.create(i);return r.success?(this.stats.patternsExtracted++,await this.patternStore.recordUsage(r.value.id,e.success),{newPattern:!0,patternId:r.value.id,reinforced:!1,promoted:!1}):{newPattern:!1,reinforced:!1,promoted:!1}}async shareAcrossDomains(e){if(!this.config.enableCrossDomainSharing||!e.domain)return;let t=this.getRelatedDomains(e.domain);for(let i of t){let r=`${this.config.namespace}:shared:${i}:${e.id}`;await this.memory.set(r,{sourceExperience:e.id,sourceDomain:e.domain,sharedAt:Date.now()},{persist:!0})}}async cleanup(){let t=0;for(let i of this.stats.byDomain.keys()){let r=this.stats.byDomain.get(i)||0;if(r>this.config.maxExperiencesPerDomain){let n=await this.searchExperiences({domain:i,limit:r});n.sort((s,o)=>s.quality-o.quality||s.startedAt-o.startedAt);let a=r-this.config.maxExperiencesPerDomain;for(let s=0;s<Math.min(a,n.length);s++){let o=n[s];await this.softDeleteExperience(o.id),t++}}}return console.log(`[ExperienceCapture] Cleanup: ${t} archived (0 destroyed)`),{removed:0,consolidated:0,archived:t}}async dispose(){this.cleanupTimer&&(clearInterval(this.cleanupTimer),this.cleanupTimer=void 0),await this.saveStats(),this.sessionCaptureCount===0&&console.warn("[ExperienceCapture] WARNING: Zero experiences captured this session. Learning cannot improve without experience data. Ensure tasks call startCapture()/completeCapture() to feed the learning loop."),this.activeExperiences.clear(),this.initialized=!1}async storeExperience(e){let t=`${this.config.namespace}:experience:${e.id}`;if(await this.memory.set(t,e,{persist:!0}),e.domain){let i=`${this.config.namespace}:index:domain:${e.domain}:${e.id}`;await this.memory.set(i,e.id,{persist:!0})}if(e.agent){let i=`${this.config.namespace}:index:agent:${e.agent}:${e.id}`;await this.memory.set(i,e.id,{persist:!0})}}async deleteExperience(e){await this.softDeleteExperience(e)}async softDeleteExperience(e){let t=await this.getExperience(e);if(!t)return;let i=`${this.config.namespace}:experience:${e}`,r={...t,_archived:!0};await this.memory.set(i,r,{persist:!0})}calculateQuality(e){if(e.steps.length===0)return e.success?.5:.2;let t=e.steps.filter(r=>r.quality!==void 0);if(t.length===0)return e.success?.6:.3;let i=t.reduce((r,n)=>r+(n.quality||0),0)/t.length;return e.success?Math.min(1,i+.1):Math.max(0,i-.2)}updateStats(e){if(this.stats.totalCaptured++,this.sessionCaptureCount++,e.success&&this.stats.successfulCaptures++,e.domain){let t=this.stats.byDomain.get(e.domain)||0;this.stats.byDomain.set(e.domain,t+1)}}async calculateAvgQuality(){let e=await this.searchExperiences({limit:100});return e.length===0?0:e.reduce((i,r)=>i+r.quality,0)/e.length}experienceToPatternOptions(e){let t=this.detectPatternType(e.task),r=`Task: {{task}}
|
|
7
7
|
|
|
8
8
|
Steps:
|
|
9
9
|
${e.steps.map((n,a)=>`${a+1}. ${n.action}${n.result?` \u2192 ${n.result}`:""}`).join(`
|
|
10
10
|
`)}
|
|
11
11
|
|
|
12
|
-
Duration: ${e.durationMs}ms`;return{patternType:t,name:this.generatePatternName(e),description:`Pattern extracted from: ${e.task}`,context:{tags:this.extractTags(e),testType:this.detectTestType(e.task)},template:{type:"workflow",content:r,variables:[{name:"task",type:"string",description:"The task to execute",required:!0}]}}}detectPatternType(e){let t=e.toLowerCase();return t.includes("test")||t.includes("spec")?(t.includes("unit")||t.includes("integration")||t.includes("e2e"),"test-template"):t.includes("mock")||t.includes("stub")?"mock-pattern":t.includes("assert")||t.includes("expect")?"assertion-pattern":t.includes("coverage")?"coverage-strategy":t.includes("api")||t.includes("contract")?"api-contract":t.includes("visual")||t.includes("screenshot")?"visual-baseline":t.includes("accessibility")||t.includes("a11y")?"a11y-check":t.includes("performance")||t.includes("perf")?"perf-benchmark":t.includes("flaky")?"flaky-fix":t.includes("refactor")?"refactor-safe":t.includes("error")||t.includes("exception")?"error-handling":"test-template"}generatePatternName(e){let t=e.task.replace(/[^a-zA-Z0-9\s-]/g,"").slice(0,50).trim();return`${e.domain?`[${e.domain}] `:""}${t}`}extractTags(e){let t=[];e.domain&&t.push(e.domain),e.agent&&t.push(e.agent),e.model&&t.push(`model:${e.model}`);let i=e.task.toLowerCase().split(/\s+/),r=["unit","integration","e2e","api","mock","coverage","security"];for(let n of r)i.some(a=>a.includes(n))&&t.push(n);return t}detectTestType(e){let t=e.toLowerCase();if(t.includes("unit"))return"unit";if(t.includes("integration"))return"integration";if(t.includes("e2e")||t.includes("end-to-end"))return"e2e";if(t.includes("contract")||t.includes("api"))return"contract";if(t.includes("smoke"))return"smoke"}getRelatedDomains(e){return{"test-generation":["test-execution","coverage-analysis"],"test-execution":["test-generation","coverage-analysis","quality-assessment"],"coverage-analysis":["test-generation","test-execution"],"quality-assessment":["test-execution","defect-intelligence"],"defect-intelligence":["quality-assessment","code-intelligence"],"requirements-validation":["test-generation","quality-assessment"],"code-intelligence":["defect-intelligence","security-compliance"],"security-compliance":["code-intelligence","quality-assessment"],"contract-testing":["test-generation","test-execution"],"visual-accessibility":["quality-assessment","test-execution"],"chaos-resilience":["test-execution","quality-assessment"],"learning-optimization":[]}[e]||[]}emitExperienceCaptured(e){this.eventBus&&this.eventBus.publish({id:`exp-captured-${e.id}`,type:"learning.ExperienceCaptured",source:"learning-optimization",timestamp:new Date,payload:{experience:e,reward:e.reward,testOutcome:e.testOutcome}})}async loadStats(){try{let e=await this.memory.get(`${this.config.namespace}:stats`);e&&(this.stats.totalCaptured=e.totalCaptured,this.stats.successfulCaptures=e.successfulCaptures,this.stats.patternsExtracted=e.patternsExtracted,this.stats.patternsPromoted=e.patternsPromoted,this.stats.byDomain=new Map(e.byDomain))}catch(e){T.debug("Stats restoration failed, starting fresh",{error:e instanceof Error?e.message:String(e)})}}async saveStats(){try{await this.memory.set(`${this.config.namespace}:stats`,{totalCaptured:this.stats.totalCaptured,successfulCaptures:this.stats.successfulCaptures,patternsExtracted:this.stats.patternsExtracted,patternsPromoted:this.stats.patternsPromoted,byDomain:Array.from(this.stats.byDomain.entries())},{persist:!0})}catch(e){console.error("[ExperienceCapture] Failed to save stats:",e)}}};function Y(l,e,t,i){return new Q(l,e,t,i)}var de={enableClaudeFlow:!0,enableExperienceCapture:!0,enablePatternPromotion:!0,promotionThreshold:F},L=class{constructor(e,t,i){this.memory=e;this.eventBus=i;this.config={...de,...t}}memory;eventBus;config;reasoningBank;claudeFlowBridge;experienceCapture;patternStore;coherenceService;initialized=!1;_domainTransferEngine=null;_domainTransferInterval=null;activeTasks=new Map;completedTasks=0;claudeFlowErrors=0;async initialize(){if(!this.initialized){try{this.coherenceService=await G(H),this.coherenceService.isInitialized()&&console.log("[AQELearningEngine] CoherenceService initialized with WASM engines")}catch(e){console.log("[AQELearningEngine] CoherenceService WASM unavailable, using fallback:",y(e))}this.patternStore=W(this.memory,{promotionThreshold:this.config.promotionThreshold}),await this.patternStore.initialize(),this.reasoningBank=U(this.memory,this.eventBus,this.config.reasoningBank,this.coherenceService),await this.reasoningBank.initialize();try{let{getSharedRvfDualWriter:e}=await import("./shared-rvf-dual-writer-2CSG7C4W.js"),t=await e();t&&this.reasoningBank.setRvfDualWriter(t)}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] RVF wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableExperienceCapture){this.experienceCapture=Y(this.memory,this.patternStore,this.eventBus,{promotionThreshold:this.config.promotionThreshold}),await this.experienceCapture.initialize();try{let{isWitnessChainFeatureEnabled:e}=await import("./witness-chain-RRN6NDCH.js");if(e()){let{createPersistentWitnessChain:t,createWitnessChainSQLitePersistence:i}=await import("./witness-chain-RRN6NDCH.js"),{getUnifiedPersistence:r}=await import("./unified-persistence-6CPF65WI.js"),n=r();if(n.isInitialized()){let a=n.getDatabase(),s=i(a),o=t(s);this.experienceCapture.setWitnessChain(o)}}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Witness chain wiring skipped:",e instanceof Error?e.message:e)}try{let{getUnifiedPersistence:e}=await import("./unified-persistence-6CPF65WI.js"),t=e();if(t.isInitialized()){let{PatternNullStore:i}=await import("./pattern-null-store-OYOQOV2O.js"),r=new i(t.getDatabase());this.experienceCapture.setNullRecorder(n=>r.recordNull(n))}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Null recorder wiring skipped:",e instanceof Error?e.message:e)}}try{let{isCrossDomainTransferEnabled:e}=await import("./feature-flags-UJRHFBRX.js");if(e()&&this.patternStore){let{createDomainTransferEngine:t}=await import("./domain-transfer-KQJRUPXA.js"),i=t(),r=this.patternStore,n=await r.getStats();this._domainTransferInterval=setInterval(async()=>{try{n=await r.getStats()}catch(a){process.env.DEBUG&&console.debug("[AQELearningEngine] Stats refresh failed:",a instanceof Error?a.message:a)}},6e4),this._domainTransferInterval.unref?.(),i.setPerformanceProvider(a=>{let s=n.byDomain?.[a]??0,o=n.totalPatterns??0;return{domain:a,successRate:o>0?s/o:.5,avgConfidence:n.avgConfidence??.5,patternCount:s,timestamp:Date.now()}}),this._domainTransferEngine=i}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Domain transfer wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableClaudeFlow)try{this.claudeFlowBridge=X({projectRoot:this.config.projectRoot}),await this.claudeFlowBridge.initialize(),this.claudeFlowBridge.isAvailable()&&console.log("[AQELearningEngine] Claude Flow integration enabled")}catch(e){process.env.DEBUG&&console.log("[AQELearningEngine] Claude Flow not available, using standalone mode:",y(e))}this.initialized=!0,console.log("[AQELearningEngine] Initialized")}}getStatus(){let e=this.claudeFlowBridge?.getStatus();return{initialized:this.initialized,claudeFlowAvailable:e?.available??!1,features:{patternLearning:!0,vectorSearch:!0,taskRouting:!0,trajectories:e?.features.trajectories??!1,modelRouting:e?.features.modelRouting??!1,pretrain:e?.features.pretrain??!1}}}async getStats(){if(!this.initialized||!this.reasoningBank)throw new Error("Engine not initialized");let e=await this.reasoningBank.getStats(),t=this.experienceCapture?await this.experienceCapture.getStats():{totalExperiences:0,byDomain:{},successRate:0,avgQuality:0,patternsExtracted:0,patternsPromoted:0};return{...e,activeTasks:this.activeTasks.size,completedTasks:this.completedTasks,claudeFlowStatus:this.claudeFlowBridge?.getStatus()??{available:!1,features:{trajectories:!1,modelRouting:!1,pretrain:!1,patternSearch:!1}},claudeFlowErrors:this.claudeFlowErrors,experienceCapture:t}}async storePattern(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.storePattern(e)}async searchPatterns(e,t){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.searchPatterns(e,t)}async getPattern(e){return!this.initialized||!this.reasoningBank?null:this.reasoningBank.getPattern(e)}async recordOutcome(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.recordOutcome(e)}async routeTask(e){if(!this.initialized||!this.reasoningBank)return E(new Error("Engine not initialized"));let t=await this.searchPatternsForTask(e.task,{limit:5,minConfidence:.4,domain:e.domain,contextFingerprint:e.domain?`${e.domain}:router`:void 0});t.success&&t.value.length>0&&await this.trackPatternSearch(e.task,t.value);let i=await this.reasoningBank.routeTask(e);if(i.success&&this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable(),i.success&&t.success){let r=N(i.value,t.value);return b(r)}return i}async route(e,t){let i=await this.routeTask({task:e,context:t});return i.success?i.value:null}async searchPatternsForTask(e,t={}){if(!this.reasoningBank)return b([]);try{return await this.reasoningBank.searchPatterns(e,{limit:t.limit||5,minConfidence:t.minConfidence||.4,domain:t.domain,contextFingerprint:t.contextFingerprint,useVectorSearch:!0})}catch(i){return console.warn("[AQELearningEngine] Pattern search failed:",y(i)),b([])}}async trackPatternSearch(e,t){let i={timestamp:Date.now(),task:e.slice(0,500),patternsFound:t.length,patternIds:t.map(r=>r.pattern.id),avgSimilarity:t.length>0?t.reduce((r,n)=>r+n.similarity,0)/t.length:0};try{let r=`pattern-usage:search:${Date.now()}-${ee().slice(0,8)}`;await this.memory.set(r,i,{persist:!0,ttl:10080*60})}catch(r){console.debug("[AQELearningEngine] Failed to track pattern search:",y(r))}}async recommendModel(e){if(this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.modelRouter.routeTask(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow model routing failed:",t instanceof Error?t.message:t)}return this.localModelRoute(e)}async recordModelOutcome(e,t,i){this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable()&&await this.claudeFlowBridge.modelRouter.recordOutcome({task:e,model:t,outcome:i})}localModelRoute(e){let t=e.toLowerCase(),i=[/simple/i,/basic/i,/fix typo/i,/rename/i,/format/i,/add comment/i,/lint/i,/minor/i,/quick/i,/small/i];for(let n of i)if(n.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task - using haiku for speed"};let r=[/architect/i,/design/i,/complex/i,/security/i,/performance/i,/refactor.*large/i,/critical/i,/analysis/i,/multi.*file/i,/distributed/i,/concurrent/i,/migration/i];for(let n of r)if(n.test(t))return{model:"opus",confidence:.8,reasoning:"High complexity task - using opus for capability"};return e.length>500?{model:"opus",confidence:.65,reasoning:"Long task description - using opus for complex reasoning"}:e.length<50?{model:"haiku",confidence:.6,reasoning:"Short task - using haiku for efficiency"}:{model:"sonnet",confidence:.7,reasoning:"Medium complexity - using sonnet for balance"}}async startTask(e,t,i){let r=`task-${Date.now()}-${ee().slice(0,8)}`,n=r;if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{n=await this.claudeFlowBridge.trajectory.startTrajectory(e,t)}catch(u){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow startTrajectory failed (${this.claudeFlowErrors} total errors):`,y(u))}let a=`${i??"unknown"}:${t??"unknown"}`,s;try{let u=await this.searchPatternsForTask(e,{domain:i,contextFingerprint:a});u.success&&u.value.length>0&&(s=u.value.map(g=>g.pattern.id))}catch{}let o;this.experienceCapture&&(o=this.experienceCapture.startCapture(e,{agent:t,domain:i,trajectoryId:n!==r?n:void 0,appliedPatterns:s}));let p={id:o||n,task:e,agent:t,startedAt:Date.now(),steps:[]};return this.activeTasks.set(p.id,p),p.id}async recordStep(e,t,i,r){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.recordStep(e,t,i,r)}catch(a){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow recordStep failed (${this.claudeFlowErrors} total errors):`,y(a))}this.experienceCapture&&this.experienceCapture.recordStep(e,{action:t,result:i,quality:r});let n=this.activeTasks.get(e);n&&n.steps.push({action:t,result:i,quality:r,timestamp:Date.now()})}async endTask(e,t,i){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.endTrajectory(e,t,i)}catch(n){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow endTrajectory failed (${this.claudeFlowErrors} total errors):`,y(n))}let r=this.activeTasks.get(e);if(r)return this.activeTasks.delete(e),this.completedTasks++,this.config.enableExperienceCapture&&t&&await this.captureExperience(r),r}getTask(e){return this.activeTasks.get(e)}async analyzeCodebase(e,t="medium"){let i=e||this.config.projectRoot;if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.analyze(i,t)}catch(r){console.debug("[AQELearningEngine] Claude Flow pretrain analyze failed:",r instanceof Error?r.message:r)}return this.localAnalyze(i,t)}async generateAgentConfigs(e="yaml"){if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.generateAgentConfigs(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow agent config failed:",t instanceof Error?t.message:t)}return[{name:"qe-test-architect",type:"worker",capabilities:["test-generation","test-design"],model:"sonnet"},{name:"qe-coverage-specialist",type:"worker",capabilities:["coverage-analysis","gap-detection"],model:"haiku"},{name:"qe-security-scanner",type:"worker",capabilities:["security-scanning","vulnerability-detection"],model:"opus"}]}async captureExperience(e){if(!this.experienceCapture||!this.config.enableExperienceCapture)return;let t=e.steps.length>0?e.steps.reduce((r,n)=>r+(n.quality??.5),0)/e.steps.length:.5;await this.experienceCapture.completeCapture(e.id,{success:!0,quality:t});let i=await this.experienceCapture.getExperience(e.id);i&&i.quality>=.7&&await this.experienceCapture.shareAcrossDomains(i)}startExperienceCapture(e,t){if(this.experienceCapture)return this.experienceCapture.startCapture(e,t)}getExperienceCaptureService(){return this.experienceCapture}async localAnalyze(e,t){try{let i=await import("fast-glob"),{existsSync:r,readFileSync:n}=await import("fs"),{join:a}=await import("path"),s=t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],o=["node_modules/**","dist/**","coverage/**",".git/**"],p=await i.default(s,{cwd:e,ignore:o,onlyFiles:!0}),u=new Set,g=new Set;for(let m of p.slice(0,100))(m.endsWith(".ts")||m.endsWith(".tsx"))&&u.add("typescript"),(m.endsWith(".js")||m.endsWith(".jsx"))&&u.add("javascript"),m.endsWith(".py")&&u.add("python"),m.endsWith(".go")&&u.add("go"),m.endsWith(".rs")&&u.add("rust");let w=a(e,"package.json");if(r(w))try{let m=k(n(w,"utf-8")),d={...m.dependencies,...m.devDependencies};d.react&&g.add("react"),d.vue&&g.add("vue"),d.vitest&&g.add("vitest"),d.jest&&g.add("jest"),d.playwright&&g.add("playwright")}catch(m){console.debug("[AQELearningEngine] package.json parse failed:",m instanceof Error?m.message:m)}return{success:!0,repositoryPath:e,depth:t,analysis:{languages:Array.from(u),frameworks:Array.from(g),patterns:[],complexity:p.length>500?3:p.length>100?2:1}}}catch(i){return{success:!1,repositoryPath:e,depth:t,error:y(i)}}}getGuidance(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.getGuidance(e,t)}generateContext(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.generateContext(e,t)}checkAntiPatterns(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.checkAntiPatterns(e,t)}async dispose(){this._domainTransferInterval&&(clearInterval(this._domainTransferInterval),this._domainTransferInterval=null),this._domainTransferEngine=null,this.experienceCapture&&await this.experienceCapture.dispose(),this.patternStore&&await this.patternStore.dispose(),this.reasoningBank&&await this.reasoningBank.dispose(),this.activeTasks.clear(),this.initialized=!1}},pe={enabled:!1,snapshotIntervalMs:3e5,minSnapshotsForAnalysis:5,autoApplyThreshold:.8},te=class{config;constructor(e){this.config={...pe,...e}}runMetaLearningCycle(e){if(process.env.AQE_META_LEARNING_ENABLED!=="true")return[];if(!this.config.enabled)return[];if(e.length<this.config.minSnapshotsForAnalysis)return[];let t=Math.floor(e.length/2),i=e.slice(0,t),r=e.slice(t),n=[],a=Date.now(),s=h(i.map(c=>c.tokenMetrics.costUsd)),o=h(r.map(c=>c.tokenMetrics.costUsd)),p=h(i.map(c=>c.tokenMetrics.savingsUsd)),u=h(r.map(c=>c.tokenMetrics.savingsUsd));if(o>s*1.1&&u<=p*1.05){let c=Math.min(1,(o-s)/(s||1));n.push({id:`meta-tw-${a}`,type:"token-waste",description:`Token cost increased by ${((o/(s||1)-1)*100).toFixed(1)}% while savings remained flat`,confidence:A(c),suggestedAction:"Review cache configuration and increase pattern reuse thresholds",detectedAt:a})}let g=h(i.map(c=>c.qualityMetrics.gatePassRate)),w=h(r.map(c=>c.qualityMetrics.gatePassRate));Math.abs(w-g)<.02&&e.length>=this.config.minSnapshotsForAnalysis&&n.push({id:`meta-qp-${a}`,type:"quality-plateau",description:`Gate pass rate has been flat at ${(w*100).toFixed(1)}% across ${e.length} snapshots`,confidence:A(.6+(e.length-this.config.minSnapshotsForAnalysis)*.05),suggestedAction:"Consider reviewing quality thresholds or adding new test coverage domains",detectedAt:a});let d=h(i.map(c=>c.learningMetrics.patternCount)),f=h(r.map(c=>c.learningMetrics.patternCount)),ie=h(i.map(c=>c.learningMetrics.averageConfidence)),$=h(r.map(c=>c.learningMetrics.averageConfidence)),re=Math.abs(f-d),ne=Math.abs($-ie);re<1&&ne<.02&&n.push({id:`meta-ls-${a}`,type:"learning-stall",description:`Pattern count (~${Math.round(f)}) and confidence (~${$.toFixed(2)}) have stagnated`,confidence:A(.65+(e.length-this.config.minSnapshotsForAnalysis)*.04),suggestedAction:"Expand to new QE domains or lower pattern creation thresholds to encourage exploration",detectedAt:a});let C=h(i.map(c=>c.performanceMetrics.p95LatencyMs)),j=h(r.map(c=>c.performanceMetrics.p95LatencyMs));if(j>C*1.2&&C>0){let c=Math.min(1,(j-C)/(C||1));n.push({id:`meta-pr-${a}`,type:"performance-regression",description:`P95 latency increased from ${C.toFixed(0)}ms to ${j.toFixed(0)}ms`,confidence:A(c),suggestedAction:"Profile hot paths and consider HNSW index tuning or batch size reduction",detectedAt:a})}return n}shouldAutoApply(e,t){let i=(t??this.config).autoApplyThreshold;return e.confidence>=i}};function h(l){return l.length===0?0:l.reduce((e,t)=>e+t,0)/l.length}function A(l){return Math.max(0,Math.min(1,l))}function ge(l,e,t){return new L(l,e,t)}function it(l,e,t){return ge(l,{projectRoot:e},t)}export{de as a,L as b,pe as c,te as d,ge as e,it as f};
|
|
12
|
+
Duration: ${e.durationMs}ms`;return{patternType:t,name:this.generatePatternName(e),description:`Pattern extracted from: ${e.task}`,context:{tags:this.extractTags(e),testType:this.detectTestType(e.task)},template:{type:"workflow",content:r,variables:[{name:"task",type:"string",description:"The task to execute",required:!0}]}}}detectPatternType(e){let t=e.toLowerCase();return t.includes("test")||t.includes("spec")?(t.includes("unit")||t.includes("integration")||t.includes("e2e"),"test-template"):t.includes("mock")||t.includes("stub")?"mock-pattern":t.includes("assert")||t.includes("expect")?"assertion-pattern":t.includes("coverage")?"coverage-strategy":t.includes("api")||t.includes("contract")?"api-contract":t.includes("visual")||t.includes("screenshot")?"visual-baseline":t.includes("accessibility")||t.includes("a11y")?"a11y-check":t.includes("performance")||t.includes("perf")?"perf-benchmark":t.includes("flaky")?"flaky-fix":t.includes("refactor")?"refactor-safe":t.includes("error")||t.includes("exception")?"error-handling":"test-template"}generatePatternName(e){let t=e.task.replace(/[^a-zA-Z0-9\s-]/g,"").slice(0,50).trim();return`${e.domain?`[${e.domain}] `:""}${t}`}extractTags(e){let t=[];e.domain&&t.push(e.domain),e.agent&&t.push(e.agent),e.model&&t.push(`model:${e.model}`);let i=e.task.toLowerCase().split(/\s+/),r=["unit","integration","e2e","api","mock","coverage","security"];for(let n of r)i.some(a=>a.includes(n))&&t.push(n);return t}detectTestType(e){let t=e.toLowerCase();if(t.includes("unit"))return"unit";if(t.includes("integration"))return"integration";if(t.includes("e2e")||t.includes("end-to-end"))return"e2e";if(t.includes("contract")||t.includes("api"))return"contract";if(t.includes("smoke"))return"smoke"}getRelatedDomains(e){return{"test-generation":["test-execution","coverage-analysis"],"test-execution":["test-generation","coverage-analysis","quality-assessment"],"coverage-analysis":["test-generation","test-execution"],"quality-assessment":["test-execution","defect-intelligence"],"defect-intelligence":["quality-assessment","code-intelligence"],"requirements-validation":["test-generation","quality-assessment"],"code-intelligence":["defect-intelligence","security-compliance"],"security-compliance":["code-intelligence","quality-assessment"],"contract-testing":["test-generation","test-execution"],"visual-accessibility":["quality-assessment","test-execution"],"chaos-resilience":["test-execution","quality-assessment"],"learning-optimization":[]}[e]||[]}emitExperienceCaptured(e){this.eventBus&&this.eventBus.publish({id:`exp-captured-${e.id}`,type:"learning.ExperienceCaptured",source:"learning-optimization",timestamp:new Date,payload:{experience:e,reward:e.reward,testOutcome:e.testOutcome}})}async loadStats(){try{let e=await this.memory.get(`${this.config.namespace}:stats`);e&&(this.stats.totalCaptured=e.totalCaptured,this.stats.successfulCaptures=e.successfulCaptures,this.stats.patternsExtracted=e.patternsExtracted,this.stats.patternsPromoted=e.patternsPromoted,this.stats.byDomain=new Map(e.byDomain))}catch(e){T.debug("Stats restoration failed, starting fresh",{error:e instanceof Error?e.message:String(e)})}}async saveStats(){try{await this.memory.set(`${this.config.namespace}:stats`,{totalCaptured:this.stats.totalCaptured,successfulCaptures:this.stats.successfulCaptures,patternsExtracted:this.stats.patternsExtracted,patternsPromoted:this.stats.patternsPromoted,byDomain:Array.from(this.stats.byDomain.entries())},{persist:!0})}catch(e){console.error("[ExperienceCapture] Failed to save stats:",e)}}};function Y(l,e,t,i){return new Q(l,e,t,i)}var de={enableClaudeFlow:!0,enableExperienceCapture:!0,enablePatternPromotion:!0,promotionThreshold:F},L=class{constructor(e,t,i){this.memory=e;this.eventBus=i;this.config={...de,...t}}memory;eventBus;config;reasoningBank;claudeFlowBridge;experienceCapture;patternStore;coherenceService;initialized=!1;_domainTransferEngine=null;_domainTransferInterval=null;activeTasks=new Map;completedTasks=0;claudeFlowErrors=0;async initialize(){if(!this.initialized){try{this.coherenceService=await G(H),this.coherenceService.isInitialized()&&console.log("[AQELearningEngine] CoherenceService initialized with WASM engines")}catch(e){console.log("[AQELearningEngine] CoherenceService WASM unavailable, using fallback:",y(e))}this.patternStore=W(this.memory,{promotionThreshold:this.config.promotionThreshold}),await this.patternStore.initialize(),this.reasoningBank=U(this.memory,this.eventBus,this.config.reasoningBank,this.coherenceService),await this.reasoningBank.initialize();try{let{getSharedRvfDualWriter:e}=await import("./shared-rvf-dual-writer-THFDYS2Z.js"),t=await e();t&&this.reasoningBank.setRvfDualWriter(t)}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] RVF wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableExperienceCapture){this.experienceCapture=Y(this.memory,this.patternStore,this.eventBus,{promotionThreshold:this.config.promotionThreshold}),await this.experienceCapture.initialize();try{let{isWitnessChainFeatureEnabled:e}=await import("./witness-chain-PJOQPFUX.js");if(e()){let{createPersistentWitnessChain:t,createWitnessChainSQLitePersistence:i}=await import("./witness-chain-PJOQPFUX.js"),{getUnifiedPersistence:r}=await import("./unified-persistence-F6OSNTXY.js"),n=r();if(n.isInitialized()){let a=n.getDatabase(),s=i(a),o=t(s);this.experienceCapture.setWitnessChain(o)}}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Witness chain wiring skipped:",e instanceof Error?e.message:e)}try{let{getUnifiedPersistence:e}=await import("./unified-persistence-F6OSNTXY.js"),t=e();if(t.isInitialized()){let{PatternNullStore:i}=await import("./pattern-null-store-TGWUL237.js"),r=new i(t.getDatabase());this.experienceCapture.setNullRecorder(n=>r.recordNull(n))}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Null recorder wiring skipped:",e instanceof Error?e.message:e)}}try{let{isCrossDomainTransferEnabled:e}=await import("./feature-flags-7AC3XDZA.js");if(e()&&this.patternStore){let{createDomainTransferEngine:t}=await import("./domain-transfer-JZA5TMW3.js"),i=t(),r=this.patternStore,n=await r.getStats();this._domainTransferInterval=setInterval(async()=>{try{n=await r.getStats()}catch(a){process.env.DEBUG&&console.debug("[AQELearningEngine] Stats refresh failed:",a instanceof Error?a.message:a)}},6e4),this._domainTransferInterval.unref?.(),i.setPerformanceProvider(a=>{let s=n.byDomain?.[a]??0,o=n.totalPatterns??0;return{domain:a,successRate:o>0?s/o:.5,avgConfidence:n.avgConfidence??.5,patternCount:s,timestamp:Date.now()}}),this._domainTransferEngine=i}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Domain transfer wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableClaudeFlow)try{this.claudeFlowBridge=X({projectRoot:this.config.projectRoot}),await this.claudeFlowBridge.initialize(),this.claudeFlowBridge.isAvailable()&&console.log("[AQELearningEngine] Claude Flow integration enabled")}catch(e){process.env.DEBUG&&console.log("[AQELearningEngine] Claude Flow not available, using standalone mode:",y(e))}this.initialized=!0,console.log("[AQELearningEngine] Initialized")}}getStatus(){let e=this.claudeFlowBridge?.getStatus();return{initialized:this.initialized,claudeFlowAvailable:e?.available??!1,features:{patternLearning:!0,vectorSearch:!0,taskRouting:!0,trajectories:e?.features.trajectories??!1,modelRouting:e?.features.modelRouting??!1,pretrain:e?.features.pretrain??!1}}}async getStats(){if(!this.initialized||!this.reasoningBank)throw new Error("Engine not initialized");let e=await this.reasoningBank.getStats(),t=this.experienceCapture?await this.experienceCapture.getStats():{totalExperiences:0,byDomain:{},successRate:0,avgQuality:0,patternsExtracted:0,patternsPromoted:0};return{...e,activeTasks:this.activeTasks.size,completedTasks:this.completedTasks,claudeFlowStatus:this.claudeFlowBridge?.getStatus()??{available:!1,features:{trajectories:!1,modelRouting:!1,pretrain:!1,patternSearch:!1}},claudeFlowErrors:this.claudeFlowErrors,experienceCapture:t}}async storePattern(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.storePattern(e)}async searchPatterns(e,t){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.searchPatterns(e,t)}async getPattern(e){return!this.initialized||!this.reasoningBank?null:this.reasoningBank.getPattern(e)}async recordOutcome(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.recordOutcome(e)}async routeTask(e){if(!this.initialized||!this.reasoningBank)return E(new Error("Engine not initialized"));let t=await this.searchPatternsForTask(e.task,{limit:5,minConfidence:.4,domain:e.domain,contextFingerprint:e.domain?`${e.domain}:router`:void 0});t.success&&t.value.length>0&&await this.trackPatternSearch(e.task,t.value);let i=await this.reasoningBank.routeTask(e);if(i.success&&this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable(),i.success&&t.success){let r=N(i.value,t.value);return b(r)}return i}async route(e,t){let i=await this.routeTask({task:e,context:t});return i.success?i.value:null}async searchPatternsForTask(e,t={}){if(!this.reasoningBank)return b([]);try{return await this.reasoningBank.searchPatterns(e,{limit:t.limit||5,minConfidence:t.minConfidence||.4,domain:t.domain,contextFingerprint:t.contextFingerprint,useVectorSearch:!0})}catch(i){return console.warn("[AQELearningEngine] Pattern search failed:",y(i)),b([])}}async trackPatternSearch(e,t){let i={timestamp:Date.now(),task:e.slice(0,500),patternsFound:t.length,patternIds:t.map(r=>r.pattern.id),avgSimilarity:t.length>0?t.reduce((r,n)=>r+n.similarity,0)/t.length:0};try{let r=`pattern-usage:search:${Date.now()}-${ee().slice(0,8)}`;await this.memory.set(r,i,{persist:!0,ttl:10080*60})}catch(r){console.debug("[AQELearningEngine] Failed to track pattern search:",y(r))}}async recommendModel(e){if(this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.modelRouter.routeTask(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow model routing failed:",t instanceof Error?t.message:t)}return this.localModelRoute(e)}async recordModelOutcome(e,t,i){this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable()&&await this.claudeFlowBridge.modelRouter.recordOutcome({task:e,model:t,outcome:i})}localModelRoute(e){let t=e.toLowerCase(),i=[/simple/i,/basic/i,/fix typo/i,/rename/i,/format/i,/add comment/i,/lint/i,/minor/i,/quick/i,/small/i];for(let n of i)if(n.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task - using haiku for speed"};let r=[/architect/i,/design/i,/complex/i,/security/i,/performance/i,/refactor.*large/i,/critical/i,/analysis/i,/multi.*file/i,/distributed/i,/concurrent/i,/migration/i];for(let n of r)if(n.test(t))return{model:"opus",confidence:.8,reasoning:"High complexity task - using opus for capability"};return e.length>500?{model:"opus",confidence:.65,reasoning:"Long task description - using opus for complex reasoning"}:e.length<50?{model:"haiku",confidence:.6,reasoning:"Short task - using haiku for efficiency"}:{model:"sonnet",confidence:.7,reasoning:"Medium complexity - using sonnet for balance"}}async startTask(e,t,i){let r=`task-${Date.now()}-${ee().slice(0,8)}`,n=r;if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{n=await this.claudeFlowBridge.trajectory.startTrajectory(e,t)}catch(u){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow startTrajectory failed (${this.claudeFlowErrors} total errors):`,y(u))}let a=`${i??"unknown"}:${t??"unknown"}`,s;try{let u=await this.searchPatternsForTask(e,{domain:i,contextFingerprint:a});u.success&&u.value.length>0&&(s=u.value.map(g=>g.pattern.id))}catch{}let o;this.experienceCapture&&(o=this.experienceCapture.startCapture(e,{agent:t,domain:i,trajectoryId:n!==r?n:void 0,appliedPatterns:s}));let p={id:o||n,task:e,agent:t,startedAt:Date.now(),steps:[]};return this.activeTasks.set(p.id,p),p.id}async recordStep(e,t,i,r){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.recordStep(e,t,i,r)}catch(a){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow recordStep failed (${this.claudeFlowErrors} total errors):`,y(a))}this.experienceCapture&&this.experienceCapture.recordStep(e,{action:t,result:i,quality:r});let n=this.activeTasks.get(e);n&&n.steps.push({action:t,result:i,quality:r,timestamp:Date.now()})}async endTask(e,t,i){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.endTrajectory(e,t,i)}catch(n){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow endTrajectory failed (${this.claudeFlowErrors} total errors):`,y(n))}let r=this.activeTasks.get(e);if(r)return this.activeTasks.delete(e),this.completedTasks++,this.config.enableExperienceCapture&&t&&await this.captureExperience(r),r}getTask(e){return this.activeTasks.get(e)}async analyzeCodebase(e,t="medium"){let i=e||this.config.projectRoot;if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.analyze(i,t)}catch(r){console.debug("[AQELearningEngine] Claude Flow pretrain analyze failed:",r instanceof Error?r.message:r)}return this.localAnalyze(i,t)}async generateAgentConfigs(e="yaml"){if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.generateAgentConfigs(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow agent config failed:",t instanceof Error?t.message:t)}return[{name:"qe-test-architect",type:"worker",capabilities:["test-generation","test-design"],model:"sonnet"},{name:"qe-coverage-specialist",type:"worker",capabilities:["coverage-analysis","gap-detection"],model:"haiku"},{name:"qe-security-scanner",type:"worker",capabilities:["security-scanning","vulnerability-detection"],model:"opus"}]}async captureExperience(e){if(!this.experienceCapture||!this.config.enableExperienceCapture)return;let t=e.steps.length>0?e.steps.reduce((r,n)=>r+(n.quality??.5),0)/e.steps.length:.5;await this.experienceCapture.completeCapture(e.id,{success:!0,quality:t});let i=await this.experienceCapture.getExperience(e.id);i&&i.quality>=.7&&await this.experienceCapture.shareAcrossDomains(i)}startExperienceCapture(e,t){if(this.experienceCapture)return this.experienceCapture.startCapture(e,t)}getExperienceCaptureService(){return this.experienceCapture}async localAnalyze(e,t){try{let i=await import("fast-glob"),{existsSync:r,readFileSync:n}=await import("fs"),{join:a}=await import("path"),s=t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],o=["node_modules/**","dist/**","coverage/**",".git/**"],p=await i.default(s,{cwd:e,ignore:o,onlyFiles:!0}),u=new Set,g=new Set;for(let m of p.slice(0,100))(m.endsWith(".ts")||m.endsWith(".tsx"))&&u.add("typescript"),(m.endsWith(".js")||m.endsWith(".jsx"))&&u.add("javascript"),m.endsWith(".py")&&u.add("python"),m.endsWith(".go")&&u.add("go"),m.endsWith(".rs")&&u.add("rust");let w=a(e,"package.json");if(r(w))try{let m=k(n(w,"utf-8")),d={...m.dependencies,...m.devDependencies};d.react&&g.add("react"),d.vue&&g.add("vue"),d.vitest&&g.add("vitest"),d.jest&&g.add("jest"),d.playwright&&g.add("playwright")}catch(m){console.debug("[AQELearningEngine] package.json parse failed:",m instanceof Error?m.message:m)}return{success:!0,repositoryPath:e,depth:t,analysis:{languages:Array.from(u),frameworks:Array.from(g),patterns:[],complexity:p.length>500?3:p.length>100?2:1}}}catch(i){return{success:!1,repositoryPath:e,depth:t,error:y(i)}}}getGuidance(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.getGuidance(e,t)}generateContext(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.generateContext(e,t)}checkAntiPatterns(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.checkAntiPatterns(e,t)}async dispose(){this._domainTransferInterval&&(clearInterval(this._domainTransferInterval),this._domainTransferInterval=null),this._domainTransferEngine=null,this.experienceCapture&&await this.experienceCapture.dispose(),this.patternStore&&await this.patternStore.dispose(),this.reasoningBank&&await this.reasoningBank.dispose(),this.activeTasks.clear(),this.initialized=!1}},pe={enabled:!1,snapshotIntervalMs:3e5,minSnapshotsForAnalysis:5,autoApplyThreshold:.8},te=class{config;constructor(e){this.config={...pe,...e}}runMetaLearningCycle(e){if(process.env.AQE_META_LEARNING_ENABLED!=="true")return[];if(!this.config.enabled)return[];if(e.length<this.config.minSnapshotsForAnalysis)return[];let t=Math.floor(e.length/2),i=e.slice(0,t),r=e.slice(t),n=[],a=Date.now(),s=h(i.map(c=>c.tokenMetrics.costUsd)),o=h(r.map(c=>c.tokenMetrics.costUsd)),p=h(i.map(c=>c.tokenMetrics.savingsUsd)),u=h(r.map(c=>c.tokenMetrics.savingsUsd));if(o>s*1.1&&u<=p*1.05){let c=Math.min(1,(o-s)/(s||1));n.push({id:`meta-tw-${a}`,type:"token-waste",description:`Token cost increased by ${((o/(s||1)-1)*100).toFixed(1)}% while savings remained flat`,confidence:A(c),suggestedAction:"Review cache configuration and increase pattern reuse thresholds",detectedAt:a})}let g=h(i.map(c=>c.qualityMetrics.gatePassRate)),w=h(r.map(c=>c.qualityMetrics.gatePassRate));Math.abs(w-g)<.02&&e.length>=this.config.minSnapshotsForAnalysis&&n.push({id:`meta-qp-${a}`,type:"quality-plateau",description:`Gate pass rate has been flat at ${(w*100).toFixed(1)}% across ${e.length} snapshots`,confidence:A(.6+(e.length-this.config.minSnapshotsForAnalysis)*.05),suggestedAction:"Consider reviewing quality thresholds or adding new test coverage domains",detectedAt:a});let d=h(i.map(c=>c.learningMetrics.patternCount)),f=h(r.map(c=>c.learningMetrics.patternCount)),ie=h(i.map(c=>c.learningMetrics.averageConfidence)),$=h(r.map(c=>c.learningMetrics.averageConfidence)),re=Math.abs(f-d),ne=Math.abs($-ie);re<1&&ne<.02&&n.push({id:`meta-ls-${a}`,type:"learning-stall",description:`Pattern count (~${Math.round(f)}) and confidence (~${$.toFixed(2)}) have stagnated`,confidence:A(.65+(e.length-this.config.minSnapshotsForAnalysis)*.04),suggestedAction:"Expand to new QE domains or lower pattern creation thresholds to encourage exploration",detectedAt:a});let C=h(i.map(c=>c.performanceMetrics.p95LatencyMs)),j=h(r.map(c=>c.performanceMetrics.p95LatencyMs));if(j>C*1.2&&C>0){let c=Math.min(1,(j-C)/(C||1));n.push({id:`meta-pr-${a}`,type:"performance-regression",description:`P95 latency increased from ${C.toFixed(0)}ms to ${j.toFixed(0)}ms`,confidence:A(c),suggestedAction:"Profile hot paths and consider HNSW index tuning or batch size reduction",detectedAt:a})}return n}shouldAutoApply(e,t){let i=(t??this.config).autoApplyThreshold;return e.confidence>=i}};function h(l){return l.length===0?0:l.reduce((e,t)=>e+t,0)/l.length}function A(l){return Math.max(0,Math.min(1,l))}function ge(l,e,t){return new L(l,e,t)}function it(l,e,t){return ge(l,{projectRoot:e},t)}export{de as a,L as b,pe as c,te as d,ge as e,it as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
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.14.
|
|
2
|
-
import{a as O}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{a as O}from"./chunk-G3W6BMVJ.js";import{d as D,e as P}from"./chunk-DO6EI5KB.js";import{a as Q}from"./chunk-QRCIZFNK.js";import{c as E,d as _}from"./chunk-G3L5L6YQ.js";import"./chunk-XEZIIQYJ.js";import"./chunk-JSZ663MU.js";import{Command as Y}from"commander";import i from"chalk";import*as b from"fs";import*as g from"path";import*as F from"fs";import*as R from"path";var q={version:"1",name:"aqe-ci",phases:[{name:"Test Generation",type:"test",enabled:!0,config:{target:".",framework:"vitest",type:"unit"},continueOnFailure:!1,timeout:300},{name:"Coverage Analysis",type:"coverage",enabled:!0,config:{target:".",threshold:80},continueOnFailure:!0,timeout:300},{name:"Security Scan",type:"security",enabled:!0,config:{sast:!0},continueOnFailure:!0,timeout:300},{name:"Quality Gate",type:"quality-gate",enabled:!0,config:{},continueOnFailure:!1,timeout:60}],output:{format:"json",directory:".aqe-ci-output",combinedReport:!0},qualityGate:{enforced:!0,thresholds:{coverage:80,security:"medium",quality:70}}},M=[".aqe-ci.yml",".aqe-ci.yaml","aqe-ci.yml","aqe-ci.yaml"];function x(t=process.cwd()){let n=R.resolve(t);for(let r=0;r<10;r++){for(let a of M){let e=R.join(n,a);if(F.existsSync(e))return e}let l=R.dirname(n);if(l===n)break;n=l}return null}function A(t){if(!F.existsSync(t))return{success:!1,errors:[`Config file not found: ${t}`]};let n;try{n=F.readFileSync(t,"utf-8")}catch(r){return{success:!1,errors:[`Failed to read config: ${r}`]}}return V(n,t)}function V(t,n){let r=[],l;try{l=Q(t)}catch(e){return{success:!1,errors:[`Invalid YAML: ${e}`]}}let a={version:l.version||q.version,name:l.name||q.name,phases:[],output:{...q.output},qualityGate:{...q.qualityGate,thresholds:{...q.qualityGate.thresholds}}};if(l.output&&typeof l.output=="object"){let e=l.output;e.format&&(a.output.format=e.format),e.directory&&(a.output.directory=e.directory),e.combined_report!==void 0&&(a.output.combinedReport=e.combined_report)}if(l.quality_gate&&typeof l.quality_gate=="object"){let e=l.quality_gate;if(e.enforced!==void 0&&(a.qualityGate.enforced=e.enforced),e.thresholds&&typeof e.thresholds=="object"){let s=e.thresholds;s.coverage!==void 0&&(a.qualityGate.thresholds.coverage=s.coverage),s.security!==void 0&&(a.qualityGate.thresholds.security=s.security),s.quality!==void 0&&(a.qualityGate.thresholds.quality=s.quality)}}if(l.phases&&Array.isArray(l.phases))for(let e=0;e<l.phases.length;e++){let s=l.phases[e];if(!s.name){r.push(`Phase ${e+1} must have a "name" field`);continue}if(!s.type){r.push(`Phase "${s.name}" must have a "type" field`);continue}let c=["test","coverage","security","quality-gate","code-intelligence","custom"];if(!c.includes(s.type)){r.push(`Phase "${s.name}" has invalid type "${s.type}". Valid: ${c.join(", ")}`);continue}let p={name:s.name,type:s.type,enabled:s.enabled!==!1,config:s.config||{},continueOnFailure:s.continue_on_failure||!1,timeout:s.timeout||300};a.phases.push(p)}else a.phases=[...q.phases];return a.phases.length===0&&r.push("Config must have at least one phase"),r.length>0?{success:!1,config:a,errors:r}:{success:!0,config:a,errors:[],configPath:n}}function L(){return{...q,phases:q.phases.map(t=>({...t,config:{...t.config}})),output:{...q.output},qualityGate:{...q.qualityGate,thresholds:{...q.qualityGate.thresholds}}}}async function B(t,n,r,l){let a=Date.now(),e=[];if(!t.enabled)return{phase:t.name,type:t.type,status:"skipped",duration:0,exitCode:0,summary:"Phase disabled",artifacts:[]};try{let s={},c="passed",p="";switch(t.type){case"test":{let h=await n.kernel.getDomainAPIAsync("test-generation");if(!h)return T(t,a,"failed",1,"Test generation domain not available",e);let u=t.config.target||".",{walkSourceFiles:C}=await import("./file-discovery-5SDIW4V2.js"),I=g.resolve(u),v=C(I,{includeTests:!1}),y=await h.generateTests({sourceFiles:v,testType:t.config.type||"unit",framework:t.config.framework||"vitest",coverageTarget:80});if(y.success&&y.value){let m=y.value;s={testsGenerated:m.tests.length,coverageEstimate:m.coverageEstimate},p=`Generated ${m.tests.length} tests (est. ${m.coverageEstimate}% coverage)`;let f=g.join(r,"test-generation.json");b.writeFileSync(f,P(m),"utf-8"),e.push(f)}else c="failed",p=y.error?.message||"Test generation failed";break}case"coverage":{let h=await n.kernel.getDomainAPIAsync("coverage-analysis");if(!h)return T(t,a,"failed",1,"Coverage analysis domain not available",e);let u=t.config.target||".",C=t.config.threshold||80,{walkSourceFiles:I}=await import("./file-discovery-5SDIW4V2.js"),v=g.resolve(u),y=I(v,{includeTests:!1}),m=O(y),f=await h.analyze({coverageData:m,threshold:C,includeFileDetails:!0});if(f.success&&f.value){let w=f.value;s={...w.summary,meetsThreshold:w.meetsThreshold,threshold:C},c=w.meetsThreshold?"passed":"warning",p=`Line: ${w.summary.line}%, Branch: ${w.summary.branch}% \u2014 ${w.meetsThreshold?"meets":"below"} ${C}% threshold`;let k=g.join(r,"coverage.json");b.writeFileSync(k,P(f.value),"utf-8"),e.push(k)}else c="failed",p=f.error?.message||"Coverage analysis failed";break}case"security":{let h=await n.kernel.getDomainAPIAsync("security-compliance");if(!h)return T(t,a,"failed",1,"Security domain not available",e);let u=t.config.target||".",{walkSourceFiles:C}=await import("./file-discovery-5SDIW4V2.js"),I=g.resolve(u),v=C(I,{includeTests:!0}),y=await h.runSASTScan(v);if(y.success&&y.value){let m=y.value,f=m.vulnerabilities||[],w=f.filter(o=>o.severity==="high"||o.severity==="critical").length;s={vulnerabilities:f.length,high:w},c=w>0?"failed":f.length>0?"warning":"passed",p=f.length===0?"No vulnerabilities found":`${f.length} vulnerabilities (${w} high/critical)`;let{toSARIF:k}=await import("./ci-output-EHRSZBKG.js"),G=g.join(r,"security.sarif");b.writeFileSync(G,k({vulnerabilities:f,target:u,scanType:"SAST"}),"utf-8"),e.push(G);let $=g.join(r,"security.json");b.writeFileSync($,P(m),"utf-8"),e.push($)}else c="failed",p=y.error?.message||"Security scan failed";break}case"quality-gate":{try{let u=await E(n.kernel.memory),C=_(u);s={...C,metrics:u,evidenceStatus:"measured"},c=C.passed?"passed":"failed",p=`Quality gate: ${C.passed?"PASSED":"FAILED"} (${C.checks.filter(I=>I.passed).length}/${C.checks.length} measured checks passed)`}catch(u){c="failed",p=`Quality gate: ${u instanceof Error?u.message:String(u)}`,s={passed:!1,evidenceStatus:"unavailable",error:p,checks:[]}}let h=g.join(r,`quality-gate-${l+1}.json`);b.writeFileSync(h,P(s),"utf-8"),e.push(h);break}case"code-intelligence":{let h=await n.kernel.getDomainAPIAsync("code-intelligence");if(!h)return T(t,a,"failed",1,"Code intelligence domain not available",e);let u=t.config.target||".",{walkSourceFiles:C}=await import("./file-discovery-5SDIW4V2.js"),I=g.resolve(u),v=C(I,{includeTests:!1}),y=await h.index({paths:v,incremental:!0});if(y.success&&y.value){let m=y.value;s=m,p=`Indexed ${m.filesIndexed} files, ${m.nodesCreated} nodes`;let f=g.join(r,"code-intelligence.json");b.writeFileSync(f,P(m),"utf-8"),e.push(f)}else c="warning",p=y.error?.message||"Code intelligence indexing incomplete";break}default:p=`Custom phase "${t.name}" \u2014 no built-in handler`,c="warning"}let S=Date.now()-a;return{phase:t.name,type:t.type,status:c,duration:S,exitCode:c==="failed"?1:0,summary:p,artifacts:e,details:s}}catch(s){let c=Date.now()-a;return{phase:t.name,type:t.type,status:"failed",duration:c,exitCode:1,summary:`Error: ${s instanceof Error?s.message:String(s)}`,artifacts:e}}}function T(t,n,r,l,a,e){return{phase:t.name,type:t.type,status:r,duration:Date.now()-n,exitCode:l,summary:a,artifacts:e}}function N(t){let n=`# AQE CI/CD Report
|
|
3
3
|
|
|
4
4
|
`;n+=`**Status:** ${t.overallStatus==="passed"?"PASSED":t.overallStatus==="warning"?"WARNING":"FAILED"}
|
|
5
5
|
`,n+=`**Duration:** ${(t.duration/1e3).toFixed(1)}s
|
|
@@ -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.14.
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-DO6EI5KB.js";import"./chunk-JSZ663MU.js";export{b as FORMAT_OPTION,c as OUTPUT_OPTION,h as coverageToMarkdown,i as qualityGateToMarkdown,a as securityExecutionStatus,j as securityToMarkdown,k as testRunToMarkdown,e as toJSON,g as toJUnit,f as toSARIF,d as writeOutput};
|
|
@@ -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.14.
|
|
2
|
-
import{a,b}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{a,b}from"./chunk-NRE4NAVA.js";import"./chunk-JSZ663MU.js";export{a as AdvisorCircuitBreaker,b as AdvisorCircuitBreakerError};
|
|
@@ -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.14.
|
|
2
|
-
import{b as g}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{b as g}from"./chunk-BYG36QC5.js";import{b as f,d as h}from"./chunk-IJHCIXJC.js";import{a as d,c as v}from"./chunk-J5UNP6W3.js";import{a as b}from"./chunk-JSZ663MU.js";h();v();import{existsSync as c,writeFileSync as p,readFileSync as m}from"node:fs";import{join as a}from"node:path";async function C(t,e){let o=g(t);if(e&&o.available&&console.log(`[ClaudeFlow] Detected via ${o.method}${o.version?`: v${o.version}`:""}`),!o.available)return{available:!1};let r={"mcp-config":"mcp","local-binary":"cli","npx-cached":"cli","npm-dependency":"npm"};return{available:!0,version:o.version,method:o.method?r[o.method]:void 0}}async function S(t){return{trajectories:!0,modelRouting:!0,pretrain:!0,workers:!0,patternSearch:!0}}function F(t,e){return{version:"1.0",projectRoot:t,integration:{enabled:!0,features:{trajectories:e.trajectories,modelRouting:e.modelRouting,pretrain:e.pretrain,workers:e.workers}},learning:{trajectoryStorage:e.trajectories?"claude-flow":"local",patternSearch:e.patternSearch?"claude-flow":"local"},routing:{modelRouting:e.modelRouting?"claude-flow":"rule-based",preferences:{simple:"haiku",standard:"sonnet",complex:"opus"}},pretrain:{enabled:e.pretrain,depth:"medium",autoRun:!0},workers:{enabled:e.workers,autoDispatch:["optimize","consolidate"]}}}function y(t){let e=a(t,".claude","settings.json"),o={};if(c(e))try{o=f(m(e,"utf-8"))}catch{}o.mcpServers||(o.mcpServers={});let r=o.mcpServers;!r.ruflo&&!r["claude-flow"]&&(r.ruflo={command:"npx",args:["ruflo@3.5.18","mcp"],env:{}}),p(e,JSON.stringify(o,null,2))}async function q(t){let{projectRoot:e,force:o,checkOnly:r,debug:s}=t,n=await C(e,s);if(!n.available&&!o)return{available:!1,features:{trajectories:!1,modelRouting:!1,pretrain:!1,workers:!1,patternSearch:!1}};let l=await S(e);if(r)return{available:n.available,version:n.version,features:l};let w=a(e,".agentic-qe"),u=a(w,"claude-flow-integration.json");try{let i=F(e,l);p(u,JSON.stringify(i,null,2)),s&&console.log(`[ClaudeFlow] Config written to: ${u}`)}catch(i){return{available:n.available,version:n.version,features:l,error:`Failed to write config: ${d(i)}`}}try{y(e)}catch(i){s&&console.log("[ClaudeFlow] MCP config update failed:",d(i))}return{available:!0,version:n.version,features:l,configPath:u}}function O(t){let e=a(t,".agentic-qe","claude-flow-integration.json");return c(e)}function $(t){let e=a(t,".agentic-qe","claude-flow-integration.json");if(!c(e))return null;try{return f(m(e,"utf-8"))}catch{return null}}function D(t){let e=a(t,".agentic-qe","claude-flow-integration.json");if(c(e))try{return b("node:fs").rmSync(e),!0}catch{return!1}return!0}export{$ as getClaudeFlowConfig,O as isClaudeFlowConfigured,D as removeClaudeFlowIntegration,q as setupClaudeFlowIntegration};
|
|
@@ -0,0 +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.14.5");process.exit(0)}
|
|
2
|
+
import{c as a,d as b,e as c}from"./chunk-TY5WC3FT.js";import"./chunk-YQGPQBCX.js";import"./chunk-J5UNP6W3.js";import"./chunk-JSZ663MU.js";c();export{a as VibiumClientImpl,b as VibiumClientProvider};
|
|
@@ -1,4 +1,4 @@
|
|
|
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.14.
|
|
2
|
-
import{b as f}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{b as f}from"./chunk-LSUILON7.js";import{a as m,c as v}from"./chunk-J5UNP6W3.js";import"./chunk-JSZ663MU.js";v();import{existsSync as s,mkdirSync as p,readFileSync as u,writeFileSync as a}from"fs";import{join as h,dirname as d}from"path";var l=class{projectRoot;overwrite;options;generator;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.options=e,this.generator=f()}async install(){let e={success:!0,mcpConfigured:!1,modeInstalled:!1,errors:[],configPath:"",modePath:""};try{let t=this.generator.generateMcpConfig("cline",{memoryBackend:this.options.memoryBackend}),r=h(this.projectRoot,t.path);if(e.configPath=r,!s(r)||this.overwrite){let o=d(r);if(s(o)||p(o,{recursive:!0}),s(r)&&this.overwrite){let c=this.mergeExistingConfig(r,t.content);a(r,c)}else a(r,t.content);e.mcpConfigured=!0}let n=this.generator.generateBehavioralRules("cline"),i=h(this.projectRoot,n.path);if(e.modePath=i,!s(i)||this.overwrite){let o=d(i);if(s(o)||p(o,{recursive:!0}),s(i)&&this.overwrite){let c=this.mergeExistingModes(i,n.content);a(i,c)}else a(i,n.content);e.modeInstalled=!0}}catch(t){e.success=!1,e.errors.push(`Cline installation failed: ${m(t)}`)}return e}mergeExistingConfig(e,t){try{let r=JSON.parse(u(e,"utf-8")),n=JSON.parse(t);return r.mcpServers||(r.mcpServers={}),Object.assign(r.mcpServers,n.mcpServers),JSON.stringify(r,null,2)+`
|
|
3
3
|
`}catch{return t}}mergeExistingModes(e,t){try{let r=JSON.parse(u(e,"utf-8")),n=JSON.parse(t);if(!Array.isArray(r))return t;let i=r.filter(o=>o.slug!=="qe-engineer");return i.push(...n),JSON.stringify(i,null,2)+`
|
|
4
4
|
`}catch{return t}}};function x(g){return new l(g)}export{l as ClineInstaller,x as createClineInstaller};
|
|
@@ -1,5 +1,5 @@
|
|
|
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.14.
|
|
2
|
-
import{a as T,b as I}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{a as T,b as I}from"./chunk-I6X3EGJI.js";import{d as $,e as C}from"./chunk-DO6EI5KB.js";import"./chunk-JSZ663MU.js";import{Command as z}from"commander";import e from"chalk";function O(A,y,P){return new z("code").description("Code intelligence analysis").argument("<action>","Action (index|search|impact|deps|complexity|c4)").argument("[target]","Target path or query").option("--depth <depth>","Analysis depth","3").option("--include-tests","Include test files").option("--incremental","Incremental indexing (index action only)").option("--git-since <ref>","Index changes since git ref (index action only)").option("--level <level>","C4 level for c4 action (context|container|component|all)","all").option("-F, --format <format>","Output format (text|json)","text").option("-o, --output <path>","Write output to file").addHelpText("after",`
|
|
3
3
|
Examples:
|
|
4
4
|
aqe code index src/ Index source files into knowledge graph
|
|
5
5
|
aqe code index src/ --incremental Incremental index (only changed files)
|
|
@@ -13,7 +13,7 @@ Examples:
|
|
|
13
13
|
aqe code c4 . --format json -o c4.json Full C4 result as JSON
|
|
14
14
|
`).action(async(b,m,c)=>{if(await P())try{let u=await A.kernel.getDomainAPIAsync("code-intelligence");if(!u){console.log(e.red("Code intelligence domain not available"));return}let v=await import("path"),D=c.format||"text",F=parseInt(c.depth);if(isNaN(F)||F<1){console.log(e.red(`Invalid --depth value: "${c.depth}" (must be a positive integer)`));return}if(b==="index"){let g=c.incremental||!1,l=c.gitSince,r=g?"Incrementally indexing":"Indexing";console.log(e.blue(`
|
|
15
15
|
${r} codebase at ${m||"."}${l?` (since ${l})`:""}...
|
|
16
|
-
`));let n=v.resolve(m||"."),a;if(l){let{getGitRefError:t}=await import("./ref-validation-
|
|
16
|
+
`));let n=v.resolve(m||"."),a;if(l){let{getGitRefError:t}=await import("./ref-validation-QQR64ZXD.js"),d=t(l,"--git-since ref");if(d)return console.log(e.red(d)),await y(1);let{execFileSync:f}=await import("child_process");try{let h=f("git",["diff","--name-only","--diff-filter=ACMR",l,"--",n],{encoding:"utf-8",cwd:process.cwd()}).trim();a=h?h.split(`
|
|
17
17
|
`).filter(p=>T.has(v.extname(p))).map(p=>v.resolve(p)):[]}catch{console.log(e.yellow(` Warning: git diff failed for ref "${l}", falling back to full scan`)),a=I(n,{includeTests:c.includeTests||!1})}}else a=I(n,{includeTests:c.includeTests||!1});console.log(e.gray(` Found ${a.length} files to index...
|
|
18
18
|
`));let o=await u.index({paths:a,incremental:g,includeTests:c.includeTests||!1});if(o.success&&o.value){let t=o.value;if(D==="json")$(C(t),c.output);else{if(console.log(e.green(`Indexing complete
|
|
19
19
|
`)),console.log(e.cyan(" Results:")),console.log(` Files indexed: ${e.white(t.filesIndexed)}`),console.log(` Nodes created: ${e.white(t.nodesCreated)}`),console.log(` Edges created: ${e.white(t.edgesCreated)}`),console.log(` Duration: ${e.yellow(t.duration+"ms")}`),t.warnings&&t.warnings.length>0){console.log(e.yellow(`
|
package/dist/cli/chunks/{code-index-extractor-PABBNUSC.js → code-index-extractor-RVI2IFTM.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
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.14.
|
|
2
|
-
import"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import"./chunk-JSZ663MU.js";import{readFile as m}from"fs/promises";var d=new Set(["if","for","while","switch","catch","return","new","throw","import","export","constructor"]),h=50;function x(o,c){let n=c.split(`
|
|
3
3
|
`),e=[],i=[];for(let t=0;t<n.length;t++){let s=n[t],a=s.match(/(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s+(\w+)/);if(a){e.push({type:"function",name:a[1],lineStart:t+1});continue}let l=s.match(/(?:export\s+)?(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s+)?(?:\([^)]*\)|[a-zA-Z_]\w*)\s*(?::\s*[^=]+)?\s*=>/);if(l){e.push({type:"function",name:l[1],lineStart:t+1});continue}let u=s.match(/(?:export\s+)?(?:default\s+)?(?:abstract\s+)?class\s+(\w+)/);if(u){e.push({type:"class",name:u[1],lineStart:t+1});continue}let f=s.match(/(?:export\s+)?interface\s+(\w+)/);if(f){e.push({type:"interface",name:f[1],lineStart:t+1});continue}let r=s.match(/^\s+(?:(?:public|private|protected|static|readonly|override|abstract|async)\s+)*(\w+)\s*(?:<[^>]*>)?\s*\([^)]*\)\s*(?::\s*[^{]+)?\s*\{?\s*$/);if(r&&!d.has(r[1])){e.push({type:"function",name:r[1],lineStart:t+1});continue}let p=s.match(/(?:import|from)\s+['"](\.[^'"]+)['"]/);p&&i.push(p[1])}return{path:o,entities:e,imports:i}}async function y(o){let c=[];for(let n=0;n<o.length;n+=h){let e=o.slice(n,n+h),i=await Promise.allSettled(e.map(async t=>{let s=await m(t,"utf-8");return x(t,s)}));for(let t of i)t.status==="fulfilled"&&c.push(t.value)}return{files:c}}export{y as extractCodeIndex};
|
|
@@ -0,0 +1,14 @@
|
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{a as I}from"./chunk-VD5IO5EO.js";import{a as P}from"./chunk-TUSSPKRM.js";import{b as j}from"./chunk-LSUILON7.js";import{a as b,c as M}from"./chunk-J5UNP6W3.js";import"./chunk-JSZ663MU.js";M();import{copyFileSync as E,existsSync as l,mkdirSync as C,readFileSync as v,readdirSync as N,statSync as w,writeFileSync as h}from"fs";import{join as n,dirname as S}from"path";import{fileURLToPath as F}from"url";var H=512,G=`# Agentic QE
|
|
3
|
+
|
|
4
|
+
Preserve project data, especially .agentic-qe/memory.db. Read affected code and tests before editing, validate inputs at system boundaries, and run focused checks before broader gates. Discover AQE tools and skills from their live schemas.`,O=class y{projectRoot;overwrite;options;generator;static AGENTS_START="<!-- BEGIN AGENTIC-QE CODEX -->";static AGENTS_END="<!-- END AGENTIC-QE CODEX -->";constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.options=e,this.generator=j()}async install(){let e={success:!0,mcpConfigured:!1,agentsMdInstalled:!1,hooksConfigured:!1,skillsInstalled:0,errors:[],configPath:"",agentsMdPath:"",hooksPath:n(this.projectRoot,".codex","hooks.json"),skillsPath:n(this.projectRoot,".agents","skills"),guidancePolicy:this.options.guidancePolicy??"full",ownedGuidanceBytes:0,components:{mcp:{status:"skipped"},rules:{status:"skipped"},hooks:{status:"unavailable"},skills:{status:"unavailable"}}};try{let t=this.generator.generateMcpConfig("codex",{memoryBackend:this.options.memoryBackend}),s=n(this.projectRoot,t.path);e.configPath=s;let o=l(s);if(this.options.installMcp!==!1&&(!o||this.overwrite)){let r=S(s);if(l(r)||C(r,{recursive:!0}),l(s)&&this.overwrite){let c=this.mergeExistingTomlConfig(s,t.content);h(s,c)}else h(s,t.content);e.mcpConfigured=!0,e.components.mcp.status=o?"updated":"installed"}else this.options.installMcp!==!1&&o&&(e.components.mcp.status="preserved")}catch(t){this.recordComponentFailure(e,"mcp",t)}try{let t=this.options.guidancePolicy??"full",s=this.generator.generateBehavioralRules("codex"),o=n(this.projectRoot,s.path);e.agentsMdPath=o;let r=l(o);if(t==="none")if(!r)e.components.rules.status="skipped";else{let c=v(o,"utf-8"),i=this.removeOwnedAgentsSections(c);i!==c?(h(o,i),e.components.rules.status="updated"):e.components.rules.status="preserved"}else if(r){let c=t==="compact"?G:s.content,i=v(o,"utf-8"),d=this.mergeExistingAgentsMdContent(i,c);d!==i?(h(o,d),e.agentsMdInstalled=!0,e.components.rules.status="updated"):e.components.rules.status="preserved",e.ownedGuidanceBytes=this.measureOwnedAgentsSection(d)}else{let c=t==="compact"?G:s.content,i=this.markAgentsSection(c);h(o,i),e.agentsMdInstalled=!0,e.ownedGuidanceBytes=Buffer.byteLength(i),e.components.rules.status="installed"}}catch(t){this.recordComponentFailure(e,"rules",t)}try{e.components.hooks.status=this.installCodexHooks(e)}catch(t){this.recordComponentFailure(e,"hooks",t)}try{let t=this.installCodexSkills();e.skillsInstalled=t.count,e.components.skills.status=t.status}catch(t){this.recordComponentFailure(e,"skills",t)}for(let t of["hooks","skills"])if(e.components[t].status==="unavailable"){let s=`Codex ${t} unavailable: packaged assets could not be located`;e.components[t].error=s,e.errors.push(s)}return e.success=e.errors.length===0,e}recordComponentFailure(e,t,s){let o=b(s);e.components[t]={status:"failed",error:o},e.errors.push(`Codex ${t} installation failed: ${o}`)}installCodexHooks(e){let t=this.resolvePackageRoot();if(!t)return"unavailable";let s=n(t,".codex","hooks.json"),o=n(t,".codex","hooks");if(!l(s)||!l(o))return"unavailable";let r=n(this.projectRoot,".codex"),c=n(r,"hooks");C(c,{recursive:!0});for(let a of N(o)){if(!this.options.includeRuflo&&a==="ruflo-codex-hook.cjs")continue;let u=n(o,a);if(!w(u).isFile())continue;let f=n(c,a);(!l(f)||this.overwrite)&&E(u,f)}let i=[{source:n(t,".claude","hooks","aqe-hook.cjs"),target:n(c,"aqe-runtime.cjs")},...this.options.includeRuflo?[{source:n(t,".claude","helpers","ruflo-hook.cjs"),target:n(c,"ruflo-runtime.cjs")}]:[]];for(let a of i)l(a.source)&&(!l(a.target)||this.overwrite)&&E(a.source,a.target);let d=JSON.parse(v(s,"utf-8")),g=a=>a.flatMap(u=>{if(!u||typeof u!="object")return[u];let f=u;if(!Array.isArray(f.hooks))return JSON.stringify(u).includes("ruflo-codex-hook.cjs")?[]:[u];let R=f.hooks.filter(T=>!JSON.stringify(T).includes("ruflo-codex-hook.cjs"));return R.length>0?[{...f,hooks:R}]:[]}),k={...d,hooks:Object.fromEntries(Object.entries(d.hooks||{}).map(([a,u])=>[a,this.options.includeRuflo?u:g(u)]))},p=n(r,"hooks.json");if(!l(p))return h(p,JSON.stringify(k,null,2)+`
|
|
5
|
+
`),e.hooksConfigured=!0,"installed";let m=JSON.parse(v(p,"utf-8")),x=a=>JSON.stringify(a).includes("/.codex/hooks/aqe-codex-hook.cjs")||JSON.stringify(a).includes("/.codex/hooks/ruflo-codex-hook.cjs"),A={},D=new Set([...Object.keys(m.hooks||{}),...Object.keys(k.hooks||{})]);for(let a of D){let u=(m.hooks?.[a]||[]).filter(f=>!x(f));A[a]=[...u,...k.hooks?.[a]||[]]}return h(p,JSON.stringify({...m,description:k.description,hooks:A},null,2)+`
|
|
6
|
+
`),e.hooksConfigured=!0,"updated"}installCodexSkills(){let e=this.resolvePackageRoot();if(!e)return{count:0,status:"unavailable"};let t=n(e,".agents","skills");if(!l(t))return{count:0,status:"unavailable"};let s=n(this.projectRoot,".agents","skills");C(s,{recursive:!0});let o=0,r=0;for(let i of I({includeRuflo:this.options.includeRuflo})){let d=n(t,i.name);if(!l(d)||!w(d).isDirectory())throw new Error(`Missing packaged Codex skill directory: ${i.name}`);let g=n(s,i.name);if(l(g)&&!this.overwrite)continue;let k=l(g);if(i.files){C(g,{recursive:!0});for(let p of i.files){let m=n(d,p);if(!l(m)||!w(m).isFile())throw new Error(`Missing packaged Codex skill file: ${i.name}/${p}`);let x=n(g,p);C(S(x),{recursive:!0}),E(m,x)}}else this.copyDirectory(d,g);k?r++:o++}return{count:o+r,status:r>0?"updated":o>0?"installed":"preserved"}}copyDirectory(e,t){C(t,{recursive:!0});for(let s of N(e)){let o=n(e,s),r=n(t,s);w(o).isDirectory()?this.copyDirectory(o,r):E(o,r)}}resolvePackageRoot(){let e=P(import.meta.url);if(e)return e;let t=S(F(import.meta.url));return[n(t,"..",".."),n(S(process.argv[1]||""),"..",".."),n(this.projectRoot,"node_modules","agentic-qe")].find(o=>l(n(o,".codex","hooks.json"))||l(n(o,".agents","skills")))}mergeExistingTomlConfig(e,t){let s=v(e,"utf-8"),o=/^\s*\[mcp_servers\.(?:agentic-qe|"agentic-qe")(?:\.(?:[^\]]+))?\]\s*(?:#.*)?$/,r=s.split(/\r?\n/),c=[],i=!1;for(let d of r)/^\s*\[[^\]]+\]\s*(?:#.*)?$/.test(d)&&(i=o.test(d)),i||c.push(d);return c.join(`
|
|
7
|
+
`).trimEnd()+`
|
|
8
|
+
|
|
9
|
+
`+t.trim()+`
|
|
10
|
+
`}mergeExistingAgentsMdContent(e,t){this.assertOwnedAgentsSectionsWellFormed(e);let s=e.includes(`\r
|
|
11
|
+
`)?`\r
|
|
12
|
+
`:`
|
|
13
|
+
`,o=this.markAgentsSection(t,s),r=!1,c=e.replace(this.ownedAgentsPattern(),()=>r?"":(r=!0,o));return r?c:e.length===0?o:e+o}removeOwnedAgentsSections(e){return this.assertOwnedAgentsSectionsWellFormed(e),e.replace(this.ownedAgentsPattern(),"")}measureOwnedAgentsSection(e){this.assertOwnedAgentsSectionsWellFormed(e);let t=e.match(this.ownedAgentsPattern());return t?Buffer.byteLength(t[0]):0}assertOwnedAgentsSectionsWellFormed(e){let t=e.match(/<!-- BEGIN AGENTIC-QE CODEX -->/g)?.length??0,s=e.match(/<!-- END AGENTIC-QE CODEX -->/g)?.length??0,o=e.match(this.ownedAgentsPattern())?.length??0;if(t!==s||o!==t)throw new Error("Malformed Agentic QE Codex sentinel in AGENTS.md; file was preserved")}ownedAgentsPattern(){return/<!-- BEGIN AGENTIC-QE CODEX -->[\s\S]*?<!-- END AGENTIC-QE CODEX -->(?:\r?\n)?/g}markAgentsSection(e,t=`
|
|
14
|
+
`){let s=e.trim().replace(/\r?\n/g,t);return`${y.AGENTS_START}${t}${s}${t}${y.AGENTS_END}${t}`}};function W(y){return new O(y)}export{H as CODEX_COMPACT_GUIDANCE_MAX_BYTES,O as CodexInstaller,W as createCodexInstaller};
|
|
@@ -1,5 +1,5 @@
|
|
|
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.14.
|
|
2
|
-
import"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import"./chunk-JSZ663MU.js";import{Command as v}from"commander";import o from"chalk";var c=["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence","requirements-validation","code-intelligence","security-compliance","contract-testing","visual-accessibility","chaos-resilience","learning-optimization"],a=["qe-tdd-specialist","qe-test-architect","qe-parallel-executor","qe-flaky-hunter","qe-retry-handler","qe-coverage-specialist","qe-gap-detector","qe-quality-gate","qe-deployment-advisor","qe-code-complexity","qe-qx-partner","qe-security-scanner","qe-security-auditor","qe-contract-validator","qe-integration-tester","qe-graphql-tester","qe-visual-tester","qe-accessibility-auditor","qe-responsive-tester","qe-performance-tester","qe-load-tester","qe-chaos-engineer","qe-code-intelligence","qe-dependency-mapper","qe-kg-builder","qe-requirements-validator","qe-bdd-generator","qe-defect-predictor","qe-root-cause-analyzer","qe-regression-analyzer","qe-impact-analyzer","qe-risk-assessor","qe-learning-coordinator","qe-pattern-learner","qe-transfer-specialist","qe-metrics-optimizer","qe-fleet-commander","qe-queen-coordinator","qe-property-tester","qe-mutation-tester","qe-tdd-red","qe-tdd-green","qe-tdd-refactor","qe-code-reviewer","qe-integration-reviewer","qe-performance-reviewer","qe-security-reviewer"],i=["tester","reviewer","security-auditor","security-architect","performance-engineer","code-analyzer","cicd-engineer","reasoningbank-learner","adr-architect","ddd-domain-expert","v3-integration-architect","memory-specialist","claims-authorizer","sparc-orchestrator","sona-learning-optimizer","safla-neural","production-validator","tdd-london-swarm","queen-coordinator","swarm-memory-manager","worker-specialist","collective-intelligence-coordinator","scout-explorer","adaptive-coordinator","mesh-coordinator","hierarchical-coordinator","consensus-coordinator","byzantine-coordinator","raft-manager","crdt-synchronizer","n8n-workflow-executor","n8n-unit-tester","n8n-integration-test","n8n-trigger-test","n8n-security-auditor"],P=[...a,...i];var p=["generate-tests","execute-tests","analyze-coverage","assess-quality","predict-defects","validate-requirements","analyze-code","scan-security","validate-contracts","test-accessibility","chaos-test","optimize-learning"],b=["p0","p1","p2","p3"],y=["pending","running","completed","failed","cancelled"],d=["jest","vitest","pytest","junit","playwright","cypress","go-test","node-test"],w=["unit","integration","e2e"],C=["sqlite","agentdb","hybrid"];function q(){return`#!/bin/bash
|
|
3
3
|
# AQE CLI Bash Completion Script
|
|
4
4
|
# Generated by aqe completions bash
|
|
5
5
|
# ADR-041: Shell Completions for Enhanced Developer Experience
|
|
@@ -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.14.
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i}from"./chunk-F34OAHOM.js";import"./chunk-DLF5BOJD.js";import"./chunk-QZMUXJHZ.js";import"./chunk-R6IU3EWP.js";import"./chunk-JSZ663MU.js";export{g as ComplexityAnalyzer,c as ScoreCalculator,a as SignalCollector,e as TierRecommender,h as createComplexityAnalyzer,i as createComplexityAnalyzerWithDependencies,d as createScoreCalculator,b as createSignalCollector,f as createTierRecommender};
|
package/dist/cli/chunks/{continuedev-installer-V4F2FIZP.js → continuedev-installer-PUVFMGYW.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
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.14.
|
|
2
|
-
import{b as m}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{b as m}from"./chunk-LSUILON7.js";import{a as u,c as h}from"./chunk-J5UNP6W3.js";import"./chunk-JSZ663MU.js";h();import{existsSync as i,mkdirSync as g,readFileSync as d,writeFileSync as a}from"fs";import{join as f,dirname as p}from"path";var c=class{projectRoot;overwrite;options;generator;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.options=e,this.generator=m()}async install(){let e={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let r=this.generator.generateMcpConfig("continuedev",{memoryBackend:this.options.memoryBackend}),t=f(this.projectRoot,r.path);if(e.configPath=t,!i(t)||this.overwrite){let o=p(t);if(i(o)||g(o,{recursive:!0}),i(t)&&this.overwrite){let v=this.mergeExistingYamlConfig(t,r.content);a(t,v)}else a(t,r.content);e.mcpConfigured=!0}let s=this.generator.generateBehavioralRules("continuedev"),n=f(this.projectRoot,s.path);if(e.rulesPath=n,!i(n)||this.overwrite){let o=p(n);i(o)||g(o,{recursive:!0}),a(n,s.content),e.rulesInstalled=!0}}catch(r){e.success=!1,e.errors.push(`Continue.dev installation failed: ${u(r)}`)}return e}mergeExistingYamlConfig(e,r){try{let t=d(e,"utf-8");if(t.includes("agentic-qe"))return t;if(t.includes("mcpServers:")){let n=` - name: agentic-qe
|
|
3
3
|
command: npx
|
|
4
4
|
args:
|
|
5
5
|
- "-y"
|
|
@@ -1,3 +1,3 @@
|
|
|
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.14.
|
|
2
|
-
import{b as g}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{b as g}from"./chunk-LSUILON7.js";import{a as p,c as v}from"./chunk-J5UNP6W3.js";import"./chunk-JSZ663MU.js";v();import{existsSync as s,mkdirSync as f,readFileSync as C,writeFileSync as l}from"fs";import{join as u,dirname as m}from"path";var a=class{projectRoot;overwrite;options;generator;constructor(t){this.projectRoot=t.projectRoot,this.overwrite=t.overwrite??!1,this.options=t,this.generator=g()}async install(){let t={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let r=this.generator.generateMcpConfig("copilot",{memoryBackend:this.options.memoryBackend}),e=u(this.projectRoot,r.path);if(t.configPath=e,!s(e)||this.overwrite){let o=m(e);if(s(o)||f(o,{recursive:!0}),s(e)&&this.overwrite){let h=this.mergeExistingConfig(e,r.content);l(e,h)}else l(e,r.content);t.mcpConfigured=!0}let i=this.generator.generateBehavioralRules("copilot"),n=u(this.projectRoot,i.path);if(t.rulesPath=n,!s(n)||this.overwrite){let o=m(n);s(o)||f(o,{recursive:!0}),l(n,i.content),t.rulesInstalled=!0}}catch(r){t.success=!1,t.errors.push(`Copilot installation failed: ${p(r)}`)}return t}mergeExistingConfig(t,r){try{let e=JSON.parse(C(t,"utf-8")),i=JSON.parse(r);return e.servers||(e.servers={}),Object.assign(e.servers,i.servers),JSON.stringify(e,null,2)+`
|
|
3
3
|
`}catch{return r}}};function R(c){return new a(c)}export{a as CopilotInstaller,R as createCopilotInstaller};
|
|
@@ -0,0 +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.14.5");process.exit(0)}
|
|
2
|
+
import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l}from"./chunk-YXP6BKGS.js";import"./chunk-K27SU3RE.js";import"./chunk-WK7B4B6Y.js";import"./chunk-3EZ5DR2R.js";import"./chunk-IUDWEOLX.js";import"./chunk-37TUN44F.js";import"./chunk-6TU7FEMD.js";import"./chunk-3YUB5HER.js";import"./chunk-N7H767TP.js";import"./chunk-DPBRWP4J.js";import"./chunk-G3L5L6YQ.js";import"./chunk-RIZVC4XY.js";import"./chunk-IYTLXUBO.js";import"./chunk-AFEDJ3RU.js";import"./chunk-2OMLTYQK.js";import"./chunk-HSVKZ5KI.js";import"./chunk-QYOGD2VW.js";import"./chunk-OEIQTWQP.js";import"./chunk-DKUBQQFG.js";import"./chunk-JES6R5KP.js";import"./chunk-XLAUGSW7.js";import"./chunk-AF4XKLXO.js";import"./chunk-6VAZAHQG.js";import"./chunk-FUNGTIF2.js";import"./chunk-KKHYJF5U.js";import"./chunk-E3W6XQ57.js";import"./chunk-VTOVWHEM.js";import"./chunk-RGGK6VZ7.js";import"./chunk-TY5WC3FT.js";import"./chunk-XFPPERA2.js";import"./chunk-67YV75XP.js";import"./chunk-C3Z4VVHP.js";import"./chunk-KEY43ANX.js";import"./chunk-ZCWERUYB.js";import"./chunk-UDHVCKGA.js";import"./chunk-HYEJJJY3.js";import"./chunk-6ITZZIQX.js";import"./chunk-YDFL445W.js";import"./chunk-IGBEJ4UJ.js";import"./chunk-75QJ5HWE.js";import"./chunk-3DDXWYMO.js";import"./chunk-CPC7FN52.js";import"./chunk-KLTP5IDB.js";import"./chunk-RD2VGOUH.js";import"./chunk-HVXJC3OC.js";import"./chunk-KO4FNAUR.js";import"./chunk-M5AEL7IS.js";import"./chunk-YQGPQBCX.js";import"./chunk-WOIGKU2N.js";import"./chunk-E4AZXCT5.js";import"./chunk-2KJQ2UQE.js";import"./chunk-AMMQOV35.js";import"./chunk-QIRL6B3C.js";import"./chunk-IIAR5S7Q.js";import"./chunk-PSPKSUF6.js";import"./chunk-4FWTLJEP.js";import"./chunk-CYE2TJFV.js";import"./chunk-JVQBWYHW.js";import"./chunk-BHFR2EXL.js";import"./chunk-UKGXWW64.js";import"./chunk-I2NENQ44.js";import"./chunk-F34OAHOM.js";import"./chunk-DLF5BOJD.js";import"./chunk-QZMUXJHZ.js";import"./chunk-UJWAWIRV.js";import"./chunk-MI5Q55DG.js";import"./chunk-RP2ZKPYV.js";import"./chunk-6LKDHEBY.js";import"./chunk-5WOSWNDN.js";import"./chunk-BJPL6THQ.js";import"./chunk-WJTSY5MC.js";import"./chunk-BYG36QC5.js";import"./chunk-7DETTOPZ.js";import"./chunk-EOR2UT72.js";import"./chunk-SQKW3B6B.js";import"./chunk-K7NJHFLZ.js";import"./chunk-2JGEZHWY.js";import"./chunk-BXVAVFGU.js";import"./chunk-JROVR6YS.js";import"./chunk-WX6RRIGW.js";import"./chunk-E4EYPYR3.js";import"./chunk-R6IU3EWP.js";import"./chunk-GTKCGPJZ.js";import"./chunk-ZBABIZ2D.js";import"./chunk-SX4JLSLV.js";import"./chunk-HBCGYMQU.js";import"./chunk-6CR4VQBQ.js";import"./chunk-Y5L3ES4L.js";import"./chunk-7X7JYWT4.js";import"./chunk-RD6TEZ64.js";import"./chunk-LULD4JV2.js";import"./chunk-CZO4BJG5.js";import"./chunk-UTBYJ4RF.js";import"./chunk-KIP6WZGV.js";import"./chunk-EFV4ADMO.js";import"./chunk-RKOUXVZZ.js";import"./chunk-IJHCIXJC.js";import"./chunk-NQI7FWCS.js";import"./chunk-C3HQL6S4.js";import"./chunk-QWUXCG2L.js";import"./chunk-XEZIIQYJ.js";import"./chunk-J27F4NSB.js";import"./chunk-7CD7PBHY.js";import"./chunk-J5UNP6W3.js";import"./chunk-W2XCZU62.js";import"./chunk-7VFY7TUR.js";import"./chunk-HVU64GP5.js";import"./chunk-ELBZON4V.js";import"./chunk-52L77RMG.js";import"./chunk-XZSMZHM2.js";import"./chunk-CVMNJSCB.js";import"./chunk-NU7UTXMP.js";import"./chunk-D6OUCB2H.js";import"./chunk-6A44AOGN.js";import"./chunk-WJHWH5D2.js";import"./chunk-JSZ663MU.js";export{c as adoptExternalFleet,e as assignAgentLevel,k as disposeFleet,f as getAgentLevel,g as getAllAgentLevels,a as getFleetState,d as getFleetTopology,l as handleAQEHealth,j as handleFleetHealth,h as handleFleetInit,i as handleFleetStatus,b as isFleetInitialized};
|
|
@@ -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.14.
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-E4EYPYR3.js";import"./chunk-R6IU3EWP.js";import"./chunk-JSZ663MU.js";f();export{c as CostTracker,a as MODEL_PRICING,d as getGlobalCostTracker,e as resetGlobalCostTracker,b as resolveModelPricing};
|
|
@@ -1,5 +1,5 @@
|
|
|
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.14.
|
|
2
|
-
import{a as u,b as j,c as F,d as x,e as N,f as O,g as L,h as D,i as B,j as M}from"./chunk-
|
|
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.14.5");process.exit(0)}
|
|
2
|
+
import{a as V}from"./chunk-G3W6BMVJ.js";import{a as u,b as j,c as F,d as x,e as N,f as O,g as L,h as D,i as B,j as M}from"./chunk-M23ZOZVY.js";import{b as I}from"./chunk-I6X3EGJI.js";import{d as P,e as W,h as G}from"./chunk-DO6EI5KB.js";import"./chunk-JSZ663MU.js";import{Command as q}from"commander";import e from"chalk";var R={low:{minRisk:.7,maxGaps:10,description:"Only critical gaps with high risk scores"},medium:{minRisk:.5,maxGaps:20,description:"Moderate gaps including medium risk items"},high:{minRisk:.3,maxGaps:50,description:"All gaps including low risk items"}},$=class extends M{constructor(t={}){super(t)}getTitle(){return"Coverage Analysis Wizard"}getSubtitle(){return"Analyze code coverage with O(log n) gap detection"}getConfirmationPrompt(){return"Proceed with coverage analysis?"}isNonInteractive(){return this.options.nonInteractive??!1}getCommands(){return[new D({id:"target",stepNumber:"1/7",title:"Target Directory",description:"Enter the directory or file to analyze for coverage",examples:"src/, ./lib, coverage/lcov.info",defaultValue:this.options.defaultTarget||".",suggestionsProvider:j.getCoverageTargets,validatePath:!0}),new x({id:"sensitivity",stepNumber:"2/7",title:"Gap Detection Sensitivity",description:"Select how sensitive the gap detection should be",options:[{key:"1",value:"low",label:"low",description:R.low.description},{key:"2",value:"medium",label:"medium",description:R.medium.description},{key:"3",value:"high",label:"high",description:R.high.description}],defaultValue:this.options.defaultSensitivity||"medium",validValues:["low","medium","high"]}),new x({id:"format",stepNumber:"3/7",title:"Report Format",description:"Select the output format for the coverage report",options:[{key:"1",value:"json",label:"json",description:"JSON - Machine-readable, good for CI/CD pipelines"},{key:"2",value:"html",label:"html",description:"HTML - Interactive, visual report with charts"},{key:"3",value:"markdown",label:"markdown",description:"Markdown - Documentation-friendly format"},{key:"4",value:"text",label:"text",description:"Text - Simple console output"}],defaultValue:this.options.defaultFormat||"json",validValues:["json","html","markdown","text"]}),new N({id:"priorityFocus",stepNumber:"4/7",title:"Priority Focus Areas",description:"Select coverage metrics to prioritize (comma-separated or numbers)",instructions:"Example: 1,2 or functions,branches",options:[{key:"1",value:"functions",label:"functions",description:"Functions - Focus on function coverage"},{key:"2",value:"branches",label:"branches",description:"Branches - Focus on branch/decision coverage"},{key:"3",value:"lines",label:"lines",description:"Lines - Focus on line coverage"},{key:"4",value:"statements",label:"statements",description:"Statements - Focus on statement coverage"}],defaultValue:this.options.defaultPriorityFocus||["functions","branches"],validValues:["functions","branches","lines","statements"]}),new O({id:"riskScoring",stepNumber:"5/7",title:"Enable risk scoring",description:"Enable risk scoring to prioritize coverage gaps by potential impact",additionalInfo:"Risk scores consider code complexity, change frequency, and criticality",defaultValue:this.options.defaultRiskScoring??!0}),new L({id:"threshold",stepNumber:"6/7",title:"Coverage threshold %",description:"Set the minimum coverage percentage required. Files below this threshold will be flagged.",presets:[{key:"1",value:60,label:"60% - Legacy/maintenance projects"},{key:"2",value:70,label:"70% - Standard projects"},{key:"3",value:80,label:"80% - Quality-focused projects"},{key:"4",value:90,label:"90% - Critical/high-reliability projects"}],defaultValue:this.options.defaultThreshold||80,min:0,max:100}),new B({id:"patterns",stepNumber:"7/7",title:"File Patterns (Optional)",description:"Specify patterns to include or exclude from analysis. Leave blank to analyze all files."})]}buildResult(t){let h=t.patterns;return{target:t.target,sensitivity:t.sensitivity,format:t.format,priorityFocus:t.priorityFocus,riskScoring:t.riskScoring,threshold:t.threshold,includePatterns:h?.include,excludePatterns:h?.exclude,cancelled:!1}}printSummary(t){u.printSummaryHeader();let h=F.relativePath(t.target,this.cwd);u.printSummaryField("Target",h),u.printSummaryField("Sensitivity",t.sensitivity),u.printSummaryField("Report Format",t.format),u.printSummaryField("Priority Focus",t.priorityFocus.join(", ")),u.printSummaryField("Risk Scoring",F.enabledDisabled(t.riskScoring)),u.printSummaryField("Threshold",F.percentage(t.threshold)),t.includePatterns&&t.includePatterns.length>0&&u.printSummaryField("Include",t.includePatterns.join(", ")),t.excludePatterns&&t.excludePatterns.length>0&&u.printSummaryField("Exclude",t.excludePatterns.join(", "));let b=R[t.sensitivity];u.printDerivedSettings({"Min risk score":String(b.minRisk),"Max gaps shown":String(b.maxGaps)})}getDefaults(){return{target:this.options.defaultTarget||this.cwd,sensitivity:this.options.defaultSensitivity||"medium",format:this.options.defaultFormat||"json",priorityFocus:this.options.defaultPriorityFocus||["functions","branches"],riskScoring:this.options.defaultRiskScoring??!0,threshold:this.options.defaultThreshold||80,cancelled:!1}}getCancelled(){return{target:".",sensitivity:"medium",format:"json",priorityFocus:["functions","branches"],riskScoring:!0,threshold:80,cancelled:!0}}};async function E(p={}){return new $(p).run()}function z(p){return p>=80?e.green:p>=50?e.yellow:e.red}function te(p,t,h){let b=new q("coverage").description("Coverage analysis shortcut").argument("[target]","Target file or directory",".").option("--risk","Include risk scoring").option("--gaps","Detect coverage gaps").option("--threshold <percent>","Coverage threshold percentage","80").option("--sensitivity <level>","Gap detection sensitivity (low|medium|high)","medium").option("--wizard","Run interactive coverage analysis wizard").option("--ghost","Include ghost intent coverage analysis (detect untested behavioral intents)").option("-F, --format <format>","Output format (text|json|markdown)","text").option("-o, --output <path>","Write output to file").action(async(y,i)=>{let g=y,w=i.risk,k=i.gaps,d=parseInt(i.threshold,10);if(i.wizard)try{let s=await E({defaultTarget:y!=="."?y:void 0,defaultThreshold:i.threshold!=="80"?parseInt(i.threshold,10):void 0,defaultRiskScoring:i.risk,defaultSensitivity:i.sensitivity!=="medium"?i.sensitivity:void 0});s.cancelled&&(console.log(e.yellow(`
|
|
3
3
|
Coverage analysis cancelled.
|
|
4
4
|
`)),await t(0)),g=s.target,w=s.riskScoring,k=!0,d=s.threshold,console.log(e.green(`
|
|
5
5
|
Starting coverage analysis...
|
|
@@ -19,7 +19,7 @@ import{a as u,b as j,c as F,d as x,e as N,f as O,g as L,h as D,i as B,j as M}fro
|
|
|
19
19
|
Risk Analysis:`));let o=[...c.files].sort((n,r)=>n.lines.covered/n.lines.total-r.lines.covered/r.lines.total).slice(0,5);for(let n of o){let r=await s.calculateRisk({file:n.path,uncoveredLines:n.uncoveredLines});if(r.success&&r.value){let l=r.value,C=l.riskLevel==="high"?e.red:l.riskLevel==="medium"?e.yellow:e.green,A=n.path.replace(process.cwd()+"/","");console.log(` ${C(`[${l.riskLevel}]`)} ${e.white(A)}`),console.log(e.gray(` Risk: ${(l.overallRisk*100).toFixed(0)}%, Coverage: ${Math.round(n.lines.covered/n.lines.total*100)}%`))}}}if(a&&f==="json"?P(W(a),i.output):a&&f==="markdown"?P(G(a),i.output):f==="text"&&console.log(e.green(`
|
|
20
20
|
Coverage analysis complete
|
|
21
21
|
`)),a&&!a.meetsThreshold&&await t(1),a){let o=(a.summary.line+a.summary.branch+a.summary.function+a.summary.statement)/4;o<d+5&&o>=d&&await t(2)}await t(0)}catch(s){console.error(e.red(`
|
|
22
|
-
Failed:`),s),await t(1)}});return b.command("gaps").description("Enumerate unhandled branches in source files").argument("<file>","Source file to analyze").option("--mechanical","Exhaustive mode: report all branches without filtering").option("--json","Output as JSON").option("--markdown","Output as markdown report").action(async(y,i)=>{try{let{readFileSync:g,existsSync:w}=await import("fs"),k=await import("path"),{enumerateBranches:d,formatBranchReport:s,formatBranchJSON:T}=await import("./branch-enumerator-
|
|
22
|
+
Failed:`),s),await t(1)}});return b.command("gaps").description("Enumerate unhandled branches in source files").argument("<file>","Source file to analyze").option("--mechanical","Exhaustive mode: report all branches without filtering").option("--json","Output as JSON").option("--markdown","Output as markdown report").action(async(y,i)=>{try{let{readFileSync:g,existsSync:w}=await import("fs"),k=await import("path"),{enumerateBranches:d,formatBranchReport:s,formatBranchJSON:T}=await import("./branch-enumerator-XYBVXCNO.js"),v=k.resolve(y);w(v)||(console.error(e.red(`
|
|
23
23
|
File not found: ${v}
|
|
24
24
|
`)),await t(1));let S=g(v,"utf-8"),c=d(S,v);if(i.json)console.log(T(c));else if(i.markdown)console.log(s(c));else{if(console.log(`
|
|
25
25
|
${e.cyan("Branch Enumeration:")} ${e.white(y)}`),console.log(e.gray(`Found ${c.unhandledCount} unhandled branches (${c.duration}ms)
|
|
@@ -0,0 +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.14.5");process.exit(0)}
|
|
2
|
+
import{a,b}from"./chunk-JVQBWYHW.js";import"./chunk-BHFR2EXL.js";import"./chunk-XEZIIQYJ.js";import"./chunk-W2XCZU62.js";import"./chunk-JSZ663MU.js";export{a as CrossDomainEventRouter,b as createCrossDomainRouter};
|