agentic-qe 3.9.17 → 3.9.19
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/helpers/statusline-v3.cjs +1 -1
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +56 -0
- package/README.md +65 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-5NI3IO42.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-JN7W7O5X.js → agent-booster-wasm-HVBKHNIS.js} +2 -2
- package/dist/cli/chunks/{agent-handler-F6Q75SJQ.js → agent-handler-XNBDYRSJ.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-3GGTDVR4.js → agent-memory-branch-YCVTQEMJ.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-JOUK5HMO.js +2 -0
- package/dist/cli/chunks/{audit-R7KN45HM.js → audit-6C2PE7OY.js} +2 -2
- package/dist/cli/chunks/base-DCAB7AHK.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-2LTGEMYR.js → better-sqlite3-HZPCHUQU.js} +2 -2
- package/dist/cli/chunks/{brain-handler-PML5L6WQ.js → brain-handler-OV75Q2NM.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-OKUPS2XC.js → branch-enumerator-QW6D42HJ.js} +2 -2
- package/dist/cli/chunks/{browser-KOQOTSAT.js → browser-5BA7Q7OR.js} +2 -2
- package/dist/cli/chunks/browser-workflow-A4UV73SZ.js +2 -0
- package/dist/cli/chunks/{chunk-ZLOMFM25.js → chunk-255CWHTF.js} +2 -2
- package/dist/cli/chunks/{chunk-QW554DTP.js → chunk-2SIQ742L.js} +1 -1
- package/dist/cli/chunks/{chunk-XMMKAV5R.js → chunk-2SSDY6OE.js} +2 -2
- package/dist/cli/chunks/{chunk-HMT6LKHH.js → chunk-2WJLEZKP.js} +2 -2
- package/dist/cli/chunks/{chunk-VX6XHAG2.js → chunk-2WM4NYM5.js} +2 -2
- package/dist/cli/chunks/{chunk-6PRIY3HT.js → chunk-2XATUQIG.js} +2 -2
- package/dist/cli/chunks/{chunk-BCBC3DVN.js → chunk-3546SG2L.js} +2 -2
- package/dist/cli/chunks/{chunk-ORNWQXEX.js → chunk-37DTXQ6P.js} +2 -2
- package/dist/cli/chunks/{chunk-3GYAIW2P.js → chunk-3HQ4AZDH.js} +2 -2
- package/dist/cli/chunks/{chunk-YUCMGFHE.js → chunk-3X3QQZ7Q.js} +2 -2
- package/dist/cli/chunks/{chunk-ZQKNVZPD.js → chunk-44SPMVML.js} +2 -2
- package/dist/cli/chunks/{chunk-65Z6HMDA.js → chunk-5KGFDNYI.js} +2 -2
- package/dist/cli/chunks/{chunk-OUSQ4KQN.js → chunk-5LXWEAEJ.js} +2 -2
- package/dist/cli/chunks/{chunk-DJXYFFGA.js → chunk-5MGRZ4YD.js} +2 -2
- package/dist/cli/chunks/{chunk-6YFEWIL5.js → chunk-5R2DUR3A.js} +2 -2
- package/dist/cli/chunks/{chunk-QMVGGG4B.js → chunk-5X2AUPK2.js} +1 -1
- package/dist/cli/chunks/{chunk-QYDBV5MD.js → chunk-6BRUQTC7.js} +1 -1
- package/dist/cli/chunks/{chunk-RP2RHB7H.js → chunk-7IV2RK5M.js} +2 -2
- package/dist/cli/chunks/{chunk-A3WC5KTG.js → chunk-7WMHLBNZ.js} +1 -1
- package/dist/cli/chunks/{chunk-VYCFMW64.js → chunk-AEET2WOI.js} +68 -67
- package/dist/cli/chunks/{chunk-V4DMYY6P.js → chunk-AG7J7DTM.js} +2 -2
- package/dist/cli/chunks/{chunk-JT2KLBDB.js → chunk-ALYUJEYA.js} +2 -2
- package/dist/cli/chunks/{chunk-L6ZJSFAA.js → chunk-AOASQYOO.js} +1 -1
- package/dist/cli/chunks/{chunk-6YCZDIGF.js → chunk-AZKVGH5I.js} +2 -2
- package/dist/cli/chunks/{chunk-3UGV2XWF.js → chunk-B2EHSFUW.js} +2 -2
- package/dist/cli/chunks/{chunk-TATCL3AK.js → chunk-B65GTWF3.js} +2 -2
- package/dist/cli/chunks/{chunk-PMH52K5J.js → chunk-BB3KUX6C.js} +1 -1
- package/dist/cli/chunks/{chunk-EGBRCXYT.js → chunk-BFBR2ZZJ.js} +2 -2
- package/dist/cli/chunks/{chunk-LD4OYOX2.js → chunk-BGTYOZRK.js} +2 -2
- package/dist/cli/chunks/{chunk-KUEG6K4A.js → chunk-BOUCIIUI.js} +1 -1
- package/dist/cli/chunks/{chunk-AZWCJFT6.js → chunk-C5YFCM2H.js} +2 -2
- package/dist/cli/chunks/{chunk-F5X3U57Y.js → chunk-CYLQTVIA.js} +2 -2
- package/dist/cli/chunks/{chunk-G3G5QEHL.js → chunk-D2EHD2KF.js} +1 -1
- package/dist/cli/chunks/{chunk-AFLTMVMT.js → chunk-D74RGYKI.js} +1 -1
- package/dist/cli/chunks/{chunk-QVJQXRHU.js → chunk-DAPBSAVT.js} +2 -2
- package/dist/cli/chunks/{chunk-BGY4CHZA.js → chunk-DZS7XQ2Z.js} +2 -2
- package/dist/cli/chunks/{chunk-RYATPB5L.js → chunk-EW5TQQBR.js} +2 -2
- package/dist/cli/chunks/{chunk-L5JZIORJ.js → chunk-EZZJ5XD6.js} +2 -2
- package/dist/cli/chunks/{chunk-MNSF47HC.js → chunk-FJJLNCSL.js} +3 -3
- package/dist/cli/chunks/{chunk-6F6BNLVP.js → chunk-FL2DMHOQ.js} +1 -1
- package/dist/cli/chunks/{chunk-EVQYUUQ3.js → chunk-FNVA7U7X.js} +2 -2
- package/dist/cli/chunks/{chunk-I3NUJ6KJ.js → chunk-FPVXXQVX.js} +3 -3
- package/dist/cli/chunks/{chunk-K4FG3CRS.js → chunk-FT3MAIRW.js} +3 -3
- package/dist/cli/chunks/{chunk-CZXV3JAF.js → chunk-G2V4GMPR.js} +3 -3
- package/dist/cli/chunks/chunk-GJ5FON37.js +15 -0
- package/dist/cli/chunks/{chunk-6PCGUJCG.js → chunk-GL742O2V.js} +4 -4
- package/dist/cli/chunks/{chunk-X66N7E7D.js → chunk-GVDLCJC5.js} +1 -1
- package/dist/cli/chunks/{chunk-3KIUCAVI.js → chunk-GYDE5TCN.js} +1 -1
- package/dist/cli/chunks/{chunk-2K7GRX5U.js → chunk-GYESQBDU.js} +2 -2
- package/dist/cli/chunks/{chunk-63ERVKIO.js → chunk-H4QM37XS.js} +1 -1
- package/dist/cli/chunks/{chunk-VI2I5R6C.js → chunk-HCSTXZYE.js} +2 -2
- package/dist/cli/chunks/{chunk-6HGRJPD6.js → chunk-HJ7CRPZY.js} +1 -1
- package/dist/cli/chunks/{chunk-G5DEPXD4.js → chunk-HQFREZRX.js} +2 -2
- package/dist/cli/chunks/{chunk-7VGZDTY4.js → chunk-HVNW3TZS.js} +1 -1
- package/dist/cli/chunks/{chunk-W5HTZ3VZ.js → chunk-I3JRRFVT.js} +2 -2
- package/dist/cli/chunks/{chunk-Y47U7ICT.js → chunk-IG2RCBHJ.js} +1 -1
- package/dist/cli/chunks/{chunk-4TDIA2EN.js → chunk-IPLQPBJA.js} +2 -2
- package/dist/cli/chunks/{chunk-ARN2KDLJ.js → chunk-IV74GAZN.js} +2 -2
- package/dist/cli/chunks/{chunk-I64R2D4U.js → chunk-J7F65KKG.js} +4 -4
- package/dist/cli/chunks/{chunk-A67FRRPJ.js → chunk-JCPJG2KU.js} +3 -3
- package/dist/cli/chunks/{chunk-HQXRCW7Z.js → chunk-JLX35EPX.js} +2 -2
- package/dist/cli/chunks/{chunk-42TUEMH7.js → chunk-JYHZK44T.js} +1 -1
- package/dist/cli/chunks/{chunk-63V33NAB.js → chunk-K554X3T4.js} +2 -2
- package/dist/cli/chunks/{chunk-P2V5ZG3Q.js → chunk-KTDGHN2J.js} +1 -1
- package/dist/cli/chunks/{chunk-FVVZWNLV.js → chunk-KU7OXAFY.js} +1 -1
- package/dist/cli/chunks/{chunk-5J444NJR.js → chunk-LDBHCOM3.js} +2 -2
- package/dist/cli/chunks/{chunk-PGTMLW5K.js → chunk-LTE3CDOY.js} +2 -2
- package/dist/cli/chunks/{chunk-WP55YBB2.js → chunk-M6EP724N.js} +1 -1
- package/dist/cli/chunks/{chunk-Z5R46W6Q.js → chunk-MIQAFOFO.js} +1 -1
- package/dist/cli/chunks/{chunk-OSBJWQZL.js → chunk-MMVSIESL.js} +2 -2
- package/dist/cli/chunks/{chunk-WGEJ646F.js → chunk-MN4366PQ.js} +2 -2
- package/dist/cli/chunks/{chunk-7PWW2OXP.js → chunk-MTHO6A3V.js} +1 -1
- package/dist/cli/chunks/{chunk-UTO2M76W.js → chunk-N2PLNYEV.js} +1 -1
- package/dist/cli/chunks/{chunk-BCIEQ4IP.js → chunk-NBBIA3QA.js} +2 -2
- package/dist/cli/chunks/{chunk-2LXXYKAP.js → chunk-NMYZSZHW.js} +2 -2
- package/dist/cli/chunks/{chunk-V3VJNWOF.js → chunk-NPSWRGNT.js} +2 -2
- package/dist/cli/chunks/{chunk-PEHHOJE6.js → chunk-NXO7CT5K.js} +2 -2
- package/dist/cli/chunks/{chunk-42HSEBOH.js → chunk-O5ZP3CBF.js} +2 -2
- package/dist/cli/chunks/{chunk-DR6SJ6P3.js → chunk-O6UMETOH.js} +2 -2
- package/dist/cli/chunks/{chunk-CPZUNBSQ.js → chunk-OEQCZBBM.js} +2 -2
- package/dist/cli/chunks/{chunk-PJZHNAUT.js → chunk-P6EYD4V3.js} +2 -2
- package/dist/cli/chunks/{chunk-DDJUVCKF.js → chunk-PS72GF4R.js} +3 -3
- package/dist/cli/chunks/{chunk-LA565BGJ.js → chunk-PUUTYV32.js} +2 -2
- package/dist/cli/chunks/{chunk-AZQ476BM.js → chunk-QOK4TIE4.js} +2 -2
- package/dist/cli/chunks/chunk-R5IL3XD5.js +69 -0
- package/dist/cli/chunks/{chunk-BUWZOMC7.js → chunk-RL5CBCBV.js} +1 -1
- package/dist/cli/chunks/{chunk-FYNDV2NZ.js → chunk-SKDDAPBV.js} +1 -1
- package/dist/cli/chunks/{chunk-K44EQV74.js → chunk-SKNHAGYP.js} +2 -2
- package/dist/cli/chunks/{chunk-CQSU7NTG.js → chunk-SLDYG7LC.js} +2 -2
- package/dist/cli/chunks/{chunk-PV6WBC2D.js → chunk-SRKBR4DU.js} +2 -2
- package/dist/cli/chunks/{chunk-XZOJWFLH.js → chunk-TCUIYIZ4.js} +1 -1
- package/dist/cli/chunks/{chunk-JVDYHVF2.js → chunk-TMAIHTE3.js} +4 -4
- package/dist/cli/chunks/{chunk-B36RPXAQ.js → chunk-TXCOK5DC.js} +2 -2
- package/dist/cli/chunks/{chunk-KTUSZRS3.js → chunk-U257SS7D.js} +2 -2
- package/dist/cli/chunks/{chunk-32FWC6G3.js → chunk-U2WMCNNR.js} +2 -2
- package/dist/cli/chunks/{chunk-I5BLJ2QQ.js → chunk-UIASVDYG.js} +2 -2
- package/dist/cli/chunks/{chunk-CY73RJJJ.js → chunk-V7ZPTEP7.js} +1 -1
- package/dist/cli/chunks/{chunk-YE5AYBHX.js → chunk-VHG67L7O.js} +2 -2
- package/dist/cli/chunks/{chunk-FCWB2FJG.js → chunk-VLQYU7ZQ.js} +1 -1
- package/dist/cli/chunks/{chunk-R3COBKOP.js → chunk-VPDZTMMB.js} +3 -3
- package/dist/cli/chunks/{chunk-QFFSQWXP.js → chunk-VRGXYOIN.js} +1 -1
- package/dist/cli/chunks/{chunk-PMNZN4K7.js → chunk-VSI45JCP.js} +1 -1
- package/dist/cli/chunks/{chunk-DVEQOD74.js → chunk-VWWLJBRA.js} +45 -44
- package/dist/cli/chunks/{chunk-6MRUG5G2.js → chunk-VXUIIZNG.js} +1 -1
- package/dist/cli/chunks/{chunk-QXOAFWWK.js → chunk-W3IO4FQ5.js} +2 -2
- package/dist/cli/chunks/{chunk-XB4JRJU4.js → chunk-WULMXLNN.js} +1 -1
- package/dist/cli/chunks/{chunk-MER7IHAZ.js → chunk-WZUQT2BE.js} +2 -2
- package/dist/cli/chunks/{chunk-USORP6QK.js → chunk-XF32XZMY.js} +2 -2
- package/dist/cli/chunks/{chunk-ZI3UBCIN.js → chunk-XKD6AFY5.js} +1 -1
- package/dist/cli/chunks/{chunk-Z77BVREU.js → chunk-XP4T7CZY.js} +2 -2
- package/dist/cli/chunks/{chunk-APWO3FI3.js → chunk-XQZ63XSL.js} +1 -1
- package/dist/cli/chunks/{chunk-MPEQXXXR.js → chunk-XXHJKAE6.js} +2 -2
- package/dist/cli/chunks/{chunk-N64PBOR5.js → chunk-Y3GX66VZ.js} +2 -2
- package/dist/cli/chunks/{chunk-B3M3JEFD.js → chunk-YXLQJ226.js} +2 -2
- package/dist/cli/chunks/chunk-Z2E5DTKX.js +2 -0
- package/dist/cli/chunks/{ci-TRWQ33L2.js → ci-FTZE4PD3.js} +2 -2
- package/dist/cli/chunks/{ci-output-TCFNHOTU.js → ci-output-C3ORCIHU.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-GO2TIL7E.js → circuit-breaker-GS5OTOJZ.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-U77JVSVU.js → claude-flow-setup-RWOFP5L2.js} +2 -2
- package/dist/cli/chunks/client-UTNF2C5K.js +2 -0
- package/dist/cli/chunks/{cline-installer-XFD3SMGS.js → cline-installer-D7RGRAUH.js} +2 -2
- package/dist/cli/chunks/{code-V3VE2TMW.js → code-HBDMMYHY.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-C6DHOOWA.js → code-index-extractor-B2KUPAEH.js} +2 -2
- package/dist/cli/chunks/{codex-installer-IUR7MVE6.js → codex-installer-MPXV4AOD.js} +2 -2
- package/dist/cli/chunks/{completions-R7FZHNJJ.js → completions-QJS6QOZQ.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-EP4QF5CS.js → complexity-analyzer-YQQXWZIL.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-6DW2SBMQ.js → continuedev-installer-Z6PBKYMB.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-U3UOX7D5.js → copilot-installer-RWVD44CV.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-5QZ5A46I.js → cost-tracker-DFPBFYWL.js} +2 -2
- package/dist/cli/chunks/{coverage-QOOOITLD.js → coverage-DYST26FK.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-FCM34JOR.js +2 -0
- package/dist/cli/chunks/{cursor-installer-SY3TRE2I.js → cursor-installer-LL6UWKTZ.js} +2 -2
- package/dist/cli/chunks/{daemon-HBSBIPUZ.js → daemon-6PIHFZNR.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-ZNLUW2HL.js → dag-attention-scheduler-WS3HJW4F.js} +2 -2
- package/dist/cli/chunks/{detect-DMUJPGNC.js → detect-J4OITSUD.js} +2 -2
- package/dist/cli/chunks/{dist-node-4RPPRXUH.js → dist-node-QSLD5K6K.js} +2 -2
- package/dist/cli/chunks/{domain-handler-XJFDML77.js → domain-handler-BD53QZ4Q.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-MXPKJ2A2.js → domain-transfer-VZBWINQL.js} +2 -2
- package/dist/cli/chunks/dream-6KCS7EWS.js +2 -0
- package/dist/cli/chunks/embed-and-insert-pattern-5UAFXNDX.js +3 -0
- package/dist/cli/chunks/{eval-DHBZ74RL.js → eval-GBKU6VTD.js} +2 -2
- package/dist/cli/chunks/{fast-paths-WTNFCV2I.js → fast-paths-MYZ6GITZ.js} +2 -2
- package/dist/cli/chunks/{feature-flags-VC7BQNHU.js → feature-flags-2WVV66AO.js} +2 -2
- package/dist/cli/chunks/{feature-flags-264QUQ3E.js → feature-flags-6ALWBTHS.js} +2 -2
- package/dist/cli/chunks/{file-discovery-LXQPIRKG.js → file-discovery-FOYCPGD6.js} +2 -2
- package/dist/cli/chunks/{fleet-4OAZWNXG.js → fleet-JROEDHAT.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-MAXAOMTP.js → gnn-wrapper-KAXTFFEE.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-ZTUI75EB.js → heartbeat-handler-PG24CBMQ.js} +4 -4
- package/dist/cli/chunks/{heartbeat-scheduler-VWPA7XKA.js → heartbeat-scheduler-LSS3RD6E.js} +2 -2
- package/dist/cli/chunks/hnsw-adapter-PG6O67CQ.js +2 -0
- package/dist/cli/chunks/hnsw-index-AHYZHLNZ.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-EQDYPKGL.js → hnsw-legacy-bridge-HYH4AJAO.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-G4QGTGIB.js → hnswlib-node-WTTST5LC.js} +2 -2
- package/dist/cli/chunks/hooks-RDZSAFQG.js +214 -0
- package/dist/cli/chunks/{hybrid-router-XODWORQ3.js → hybrid-router-HNPS6EFL.js} +2 -2
- package/dist/cli/chunks/{hypergraph-engine-T73DH7N6.js → hypergraph-engine-JUFXRXCC.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-OZJJJW5B.js → hypergraph-handler-YFRF53TF.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-USAJVJY5.js +2 -0
- package/dist/cli/chunks/{init-handler-YXXNCXM4.js → init-handler-P4W5F57S.js} +6 -6
- package/dist/cli/chunks/init-wizard-GL7LAZID.js +2 -0
- package/dist/cli/chunks/kernel-2YAIESTR.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-3RCK2JPW.js → kilocode-installer-5VWY4DMH.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-LKC42QRS.js → kiro-installer-PZC3BQII.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-QSIYZRAG.js +2 -0
- package/dist/cli/chunks/{learning-BIBRKCYL.js → learning-4OH4ZG25.js} +3 -3
- package/dist/cli/chunks/{llm-router-Z6Z7TTBI.js → llm-router-LZBR6SZQ.js} +4 -4
- package/dist/cli/chunks/{load-T2QUB663.js → load-SPWP6VB3.js} +2 -2
- package/dist/cli/chunks/load-test-UEHSHLVN.js +2 -0
- package/dist/cli/chunks/{mcp-QBOL6TK4.js → mcp-QYPQMM7L.js} +2 -2
- package/dist/cli/chunks/{memory-7RQ2SF36.js → memory-54ILJMWQ.js} +5 -5
- package/dist/cli/chunks/memory-backend-4NE4ADPG.js +2 -0
- package/dist/cli/chunks/{memory-handlers-5OHDUBJS.js → memory-handlers-YK7H5UCX.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-PGSNT3NO.js → multi-model-executor-XAOAVPPI.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-AEOXTTFG.js → opencode-installer-CNS4XMUF.js} +2 -2
- package/dist/cli/chunks/{orchestrator-6K2L36JA.js → orchestrator-SSEMSKUI.js} +6 -6
- package/dist/cli/chunks/{pipeline-MFQCW7JD.js → pipeline-DS3AENTB.js} +2 -2
- package/dist/cli/chunks/{platform-DM6RQ3FM.js → platform-BL6LH5NF.js} +2 -2
- package/dist/cli/chunks/{plugin-CCTGDC55.js → plugin-FNXPEQ2C.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-J4FXB63L.js → prime-radiant-advanced-wasm-E6S6BGNA.js} +2 -2
- package/dist/cli/chunks/protocol-executor-YI4HNXND.js +2 -0
- package/dist/cli/chunks/{protocol-handler-7UOBNLET.js → protocol-handler-D4WIUU3W.js} +2 -2
- package/dist/cli/chunks/{prove-VAPGITFF.js → prove-OLB3PKW6.js} +2 -2
- package/dist/cli/chunks/{provider-manager-F6TLUJFW.js → provider-manager-GKTQ75DT.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-ANBAXQXC.js +2 -0
- package/dist/cli/chunks/{quality-7LJQI3SB.js → quality-ZYJVYTUL.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-MYYUSWVX.js +2 -0
- package/dist/cli/chunks/{real-embeddings-NHWAUSV3.js → real-embeddings-SKJRHLCS.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-HQFQJJPU.js → roocode-installer-WZGKOLWE.js} +2 -2
- package/dist/cli/chunks/router-RYCLZ7A4.js +2 -0
- package/dist/cli/chunks/routing-feedback-5KSRG2UI.js +2 -0
- package/dist/cli/chunks/{routing-handler-VH66WSPU.js → routing-handler-4GIMINCI.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-IPUWLJFU.js → ruvector-commands-YZONXZ2W.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-KRFEM6JH.js → rvf-dual-writer-WSS5GF54.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-SVCZ72IU.js → rvf-migration-adapter-WS4HHVEU.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-FYBIF3SX.js → rvf-migration-coordinator-6BY5GI47.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-NEIOLJRF.js +2 -0
- package/dist/cli/chunks/safe-db-3JQP4EPU.js +2 -0
- package/dist/cli/chunks/schedule-2QKCL64E.js +2 -0
- package/dist/cli/chunks/scheduler-FMOP45FC.js +2 -0
- package/dist/cli/chunks/{security-C2I6CG7B.js → security-HCNOL2K3.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-BMFIVWMJ.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-BPIFGN7I.js → shared-rvf-dual-writer-QRNLSDS7.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-I5RYLFOE.js +2 -0
- package/dist/cli/chunks/{status-handler-57UA6GNR.js → status-handler-QXZ442MY.js} +2 -2
- package/dist/cli/chunks/{structural-health-KMHBG6FO.js → structural-health-OFYZ3Z4A.js} +2 -2
- package/dist/cli/chunks/{sync-53YM6U4S.js → sync-J4BG65NF.js} +2 -2
- package/dist/cli/chunks/{task-handler-W2XPS5WW.js → task-handler-UBSFCKK3.js} +2 -2
- package/dist/cli/chunks/{task-handlers-BG4IAMBJ.js → task-handlers-JFUT2FQ7.js} +2 -2
- package/dist/cli/chunks/{test-QJBBVPL2.js → test-WTNAHJHH.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-Y4J6EY2K.js → test-scheduling-QREBYRGW.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-3TKR3UIE.js → token-bootstrap-HE5H77OL.js} +2 -2
- package/dist/cli/chunks/{token-usage-5FUNHHVZ.js → token-usage-V5B6K3JL.js} +2 -2
- package/dist/cli/chunks/{transformers-KVPA35SR.js → transformers-HIVMQP4O.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-LTBBLY5U.js → tree-sitter-wasm-parser-WP2SF2M5.js} +2 -2
- package/dist/cli/chunks/{types-Y2BHPD6B.js → types-7ZBTAO5Z.js} +2 -2
- package/dist/cli/chunks/unified-memory-2ETCY22B.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-OALJW537.js +2 -0
- package/dist/cli/chunks/unified-persistence-SQMP7A3O.js +2 -0
- package/dist/cli/chunks/{upgrade-E4VAQZQR.js → upgrade-WIFAJDBG.js} +2 -2
- package/dist/cli/chunks/{validate-4ICDQCKJ.js → validate-W63V36GA.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-AIEOQOUF.js → validate-swarm-CK5BM3YY.js} +2 -2
- package/dist/cli/chunks/{vibium-AF2K6YXR.js → vibium-MJCCO36E.js} +2 -2
- package/dist/cli/chunks/visual-security-JUJPF2QO.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-PM67K5SP.js → web-tree-sitter-ESERXLPK.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-4MKUQ2KT.js → windsurf-installer-FDWQ5BWI.js} +2 -2
- package/dist/cli/chunks/{witness-chain-FLPF7CS6.js → witness-chain-L5KSYE2S.js} +2 -2
- package/dist/cli/chunks/witness-chain-QJVKAAZT.js +2 -0
- package/dist/cli/chunks/{workflow-DHTCI6QD.js → workflow-34GYJDFW.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-WXB2RVVW.js +2 -0
- package/dist/cli/chunks/{wrappers-5K6UGI3T.js → wrappers-VGKEBQLW.js} +2 -2
- package/dist/cli/commands/hooks-handlers/command-hooks.js +104 -11
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.d.ts +98 -0
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +285 -1
- package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +20 -1
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +35 -3
- package/dist/cli/commands/hooks-handlers/routing-hooks.js +15 -5
- package/dist/cli/commands/hooks-handlers/task-hooks.js +216 -5
- package/dist/coordination/handlers/test-execution-handlers.d.ts +18 -0
- package/dist/coordination/handlers/test-execution-handlers.js +77 -9
- package/dist/coordination/task-executor.js +11 -2
- package/dist/domains/test-generation/generators/jest-vitest-generator.js +13 -3
- package/dist/domains/test-generation/interfaces.d.ts +12 -0
- package/dist/domains/test-generation/services/test-generator.js +5 -1
- package/dist/governance/continue-gate-integration.d.ts +13 -0
- package/dist/governance/continue-gate-integration.js +31 -8
- package/dist/init/phases/07-hooks.js +2 -2
- package/dist/integrations/ruvector/hypergraph-engine.js +63 -4
- package/dist/integrations/ruvector/hypergraph-schema.d.ts +6 -2
- package/dist/learning/embed-and-insert-pattern.d.ts +36 -0
- package/dist/learning/embed-and-insert-pattern.js +52 -0
- package/dist/learning/pattern-store.d.ts +8 -0
- package/dist/learning/pattern-store.js +66 -43
- package/dist/mcp/bundle.js +400 -392
- package/dist/mcp/entry.js +21 -1
- package/dist/mcp/protocol-server.js +6 -1
- package/dist/mcp/tools/coverage-analysis/index.js +11 -2
- package/dist/workers/workers/learning-consolidation.js +6 -1
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-2BIT6BGH.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-B5G3RG4W.js +0 -2
- package/dist/cli/chunks/base-A3ZRMSIZ.js +0 -2
- package/dist/cli/chunks/browser-workflow-C6Z53ZH6.js +0 -2
- package/dist/cli/chunks/chunk-2ARCG4XJ.js +0 -2
- package/dist/cli/chunks/chunk-JC4O47QG.js +0 -66
- package/dist/cli/chunks/chunk-KTJWRVFR.js +0 -15
- package/dist/cli/chunks/client-B3QSCZSJ.js +0 -2
- package/dist/cli/chunks/cross-domain-router-OYBTXKCV.js +0 -2
- package/dist/cli/chunks/dream-R2F6L47W.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-TQPQE4OJ.js +0 -2
- package/dist/cli/chunks/hnsw-index-2X3NMTDU.js +0 -2
- package/dist/cli/chunks/hooks-RBVHAPBL.js +0 -101
- package/dist/cli/chunks/impact-analyzer-B7GBDSA3.js +0 -2
- package/dist/cli/chunks/init-wizard-7N6MCER4.js +0 -2
- package/dist/cli/chunks/kernel-6CJ4FP5Z.js +0 -2
- package/dist/cli/chunks/knowledge-graph-4XYLO6ZW.js +0 -2
- package/dist/cli/chunks/load-test-UODCPBYF.js +0 -2
- package/dist/cli/chunks/memory-backend-PUPAE4QQ.js +0 -2
- package/dist/cli/chunks/protocol-executor-X3EYJINP.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-3RDWPSYG.js +0 -2
- package/dist/cli/chunks/queen-coordinator-XIQZIYAZ.js +0 -2
- package/dist/cli/chunks/router-AFEFPU2A.js +0 -2
- package/dist/cli/chunks/routing-feedback-AGYMQFMV.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-AFOWXCZH.js +0 -2
- package/dist/cli/chunks/safe-db-NNF5DE5T.js +0 -2
- package/dist/cli/chunks/schedule-HJUZSHEA.js +0 -2
- package/dist/cli/chunks/scheduler-DZ53RPJQ.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-5UQSTUSR.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-27ESC5DX.js +0 -2
- package/dist/cli/chunks/unified-memory-O7GFUSD3.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-XBLROJEN.js +0 -2
- package/dist/cli/chunks/unified-persistence-YBHEAL2S.js +0 -2
- package/dist/cli/chunks/visual-security-4F7VYCAU.js +0 -2
- package/dist/cli/chunks/witness-chain-AXJ44BGW.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-UAFUPHD3.js +0 -2
|
@@ -0,0 +1,69 @@
|
|
|
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.9.19");process.exit(0)}
|
|
2
|
+
import{a as w,b as A,c as O,e as D,f as $}from"./chunk-AG7J7DTM.js";import{b as S,d as z}from"./chunk-5R2DUR3A.js";import{a as b,c as F}from"./chunk-5MGRZ4YD.js";import{i as v}from"./chunk-MIQAFOFO.js";import*as I from"node:path";$();z();var P=["function","module","test","file","class"],L=["calls","imports","tests","depends_on","covers"],R=class{ensureSchema(e){e.transaction(()=>{e.exec(w),e.exec(A),e.exec(O)})()}schemaExists(e){return D(e)}getNodeTypes(){return P}getEdgeTypes(){return L}isValidNodeType(e){return P.includes(e)}isValidEdgeType(e){return L.includes(e)}getStats(e){if(!this.schemaExists(e))return{nodeCount:0,edgeCount:0};let t=e.prepare("SELECT COUNT(*) as count FROM hypergraph_nodes").get().count,r=e.prepare("SELECT COUNT(*) as count FROM hypergraph_edges").get().count;return{nodeCount:t,edgeCount:r}}dropSchema(e){let t=e.prepare("SELECT COUNT(*) as cnt FROM hypergraph_nodes").get()?.cnt??0,r=e.prepare("SELECT COUNT(*) as cnt FROM hypergraph_edges").get()?.cnt??0;if(t>0||r>0)throw new Error(`REFUSING to drop hypergraph schema: tables contain data (${t} nodes, ${r} edges). Backup and manually drop if needed.`);e.transaction(()=>{e.exec("DROP TABLE IF EXISTS hypergraph_edges"),e.exec("DROP TABLE IF EXISTS hypergraph_nodes")})()}};function H(n){return{id:n.id,type:n.type,name:n.name,file_path:n.filePath??null,line_start:n.lineStart??null,line_end:n.lineEnd??null,complexity:n.complexity??null,coverage:n.coverage??null,metadata:n.metadata?JSON.stringify(n.metadata):null,embedding:n.embedding?U(n.embedding):null}}function f(n){return{id:n.id,type:n.type,name:n.name,filePath:n.file_path??void 0,lineStart:n.line_start??void 0,lineEnd:n.line_end??void 0,complexity:n.complexity??void 0,coverage:n.coverage??void 0,metadata:n.metadata?S(n.metadata):void 0,embedding:n.embedding?W(n.embedding):void 0,createdAt:n.created_at,updatedAt:n.updated_at}}function M(n){return{id:n.id,source_id:n.sourceId,target_id:n.targetId,type:n.type,weight:n.weight??1,properties:n.properties?JSON.stringify(n.properties):null}}function C(n){return{id:n.id,sourceId:n.source_id,targetId:n.target_id,type:n.type,weight:n.weight,properties:n.properties?S(n.properties):void 0,createdAt:n.created_at}}function x(n,e,t){return`${n}--${t}-->${e}`}function U(n){let e=Buffer.alloc(n.length*4);for(let t=0;t<n.length;t++)e.writeFloatLE(n[t],t*4);return e}function W(n){let e=[],t=n.length/4;for(let r=0;r<t;r++)e.push(n.readFloatLE(r*4));return e}F();var B={maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1},_=class{config;schemaManager;initialized=!1;constructor(e){this.config={...B,...e},this.schemaManager=new R}async initialize(){this.initialized||(this.schemaManager.ensureSchema(this.config.db),this.initialized=!0)}isInitialized(){return this.initialized}async addNode(e){this.ensureInitialized();let t=v(),r={id:t,...e},i=H(r);return this.config.db.prepare(`
|
|
3
|
+
INSERT INTO hypergraph_nodes (id, type, name, file_path, line_start, line_end, complexity, coverage, metadata, embedding)
|
|
4
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
5
|
+
`).run(i.id,i.type,i.name,i.file_path,i.line_start,i.line_end,i.complexity,i.coverage,i.metadata,i.embedding),t}async addEdge(e){this.ensureInitialized();let t=x(e.sourceId,e.targetId,e.type),r={id:t,...e},i=M(r);return this.config.db.prepare(`
|
|
6
|
+
INSERT OR REPLACE INTO hypergraph_edges (id, source_id, target_id, type, weight, properties)
|
|
7
|
+
VALUES (?, ?, ?, ?, ?, ?)
|
|
8
|
+
`).run(i.id,i.source_id,i.target_id,i.type,i.weight,i.properties),t}async getNode(e){this.ensureInitialized();let t=this.config.db.prepare("SELECT * FROM hypergraph_nodes WHERE id = ?").get(e);return t?f(t):null}async getEdge(e){this.ensureInitialized();let t=this.config.db.prepare("SELECT * FROM hypergraph_edges WHERE id = ?").get(e);return t?C(t):null}async updateNode(e,t){this.ensureInitialized();let r=await this.getNode(e);if(!r)throw new Error(`Node not found: ${e}`);let i={...r,...t},s=H(i);this.config.db.prepare(`
|
|
9
|
+
UPDATE hypergraph_nodes
|
|
10
|
+
SET type = ?, name = ?, file_path = ?, line_start = ?, line_end = ?,
|
|
11
|
+
complexity = ?, coverage = ?, metadata = ?, embedding = ?,
|
|
12
|
+
updated_at = datetime('now')
|
|
13
|
+
WHERE id = ?
|
|
14
|
+
`).run(s.type,s.name,s.file_path,s.line_start,s.line_end,s.complexity,s.coverage,s.metadata,s.embedding,e)}async deleteNode(e){this.ensureInitialized(),this.config.db.prepare("DELETE FROM hypergraph_edges WHERE source_id = ? OR target_id = ?").run(e,e),this.config.db.prepare("DELETE FROM hypergraph_nodes WHERE id = ?").run(e)}async deleteEdge(e){this.ensureInitialized(),this.config.db.prepare("DELETE FROM hypergraph_edges WHERE id = ?").run(e)}async findNodes(e){this.ensureInitialized();let t=[],r=[];if(e.type){let u=Array.isArray(e.type)?e.type:[e.type];t.push(`type IN (${u.map(()=>"?").join(", ")})`),r.push(...u)}e.filePath&&(e.filePath.includes("%")?t.push("file_path LIKE ?"):t.push("file_path = ?"),r.push(e.filePath)),e.name&&typeof e.name=="string"&&(t.push("name = ?"),r.push(e.name)),e.minComplexity!==void 0&&(t.push("complexity >= ?"),r.push(e.minComplexity)),e.maxComplexity!==void 0&&(t.push("complexity <= ?"),r.push(e.maxComplexity)),e.minCoverage!==void 0&&(t.push("coverage >= ?"),r.push(e.minCoverage)),e.maxCoverage!==void 0&&(t.push("coverage <= ?"),r.push(e.maxCoverage));let i=t.length>0?`WHERE ${t.join(" AND ")}`:"",s=e.limit??this.config.maxQueryResults,d=`SELECT * FROM hypergraph_nodes ${i} LIMIT ?`;r.push(s);let c=this.config.db.prepare(d).all(...r).map(f);return e.name instanceof RegExp&&(c=c.filter(u=>e.name instanceof RegExp&&e.name.test(u.name))),c}async findEdges(e){this.ensureInitialized();let t=[],r=[];if(e.type){let c=Array.isArray(e.type)?e.type:[e.type];t.push(`type IN (${c.map(()=>"?").join(", ")})`),r.push(...c)}e.sourceId&&(t.push("source_id = ?"),r.push(e.sourceId)),e.targetId&&(t.push("target_id = ?"),r.push(e.targetId)),e.minWeight!==void 0&&(t.push("weight >= ?"),r.push(e.minWeight));let i=t.length>0?`WHERE ${t.join(" AND ")}`:"",s=e.limit??this.config.maxQueryResults,d=`SELECT * FROM hypergraph_edges ${i} LIMIT ?`;return r.push(s),this.config.db.prepare(d).all(...r).map(C)}async traverse(e,t=[],r=5){this.ensureInitialized();let i=new Map,s=new Map,d=[],g=0,c=[{nodeId:e,depth:0,path:{nodes:[e],edges:[]}}],u=Math.min(r,this.config.maxTraversalDepth);for(;c.length>0;){let{nodeId:a,depth:p,path:o}=c.shift();if(!i.has(a)){let l=await this.getNode(a);l&&i.set(a,l)}if(g=Math.max(g,p),p>=u){d.push(o);continue}let h={sourceId:a};t.length>0&&(h.type=t);let y=await this.findEdges(h);if(y.length===0){d.push(o);continue}for(let l of y)if(!s.has(l.id)){s.set(l.id,l);let m={nodes:[...o.nodes,l.targetId],edges:[...o.edges,l.id]};c.push({nodeId:l.targetId,depth:p+1,path:m})}}return{nodes:Array.from(i.values()),edges:Array.from(s.values()),paths:d,maxDepthReached:g}}async findUntestedFunctions(){return this.ensureInitialized(),this.config.db.prepare(`
|
|
15
|
+
SELECT n.* FROM hypergraph_nodes n
|
|
16
|
+
WHERE n.type = 'function'
|
|
17
|
+
AND NOT EXISTS (
|
|
18
|
+
SELECT 1 FROM hypergraph_edges e
|
|
19
|
+
JOIN hypergraph_nodes t ON t.id = e.source_id
|
|
20
|
+
WHERE e.target_id = n.id
|
|
21
|
+
AND e.type = 'covers'
|
|
22
|
+
AND t.type = 'test'
|
|
23
|
+
)
|
|
24
|
+
ORDER BY n.complexity DESC NULLS LAST
|
|
25
|
+
LIMIT ?
|
|
26
|
+
`).all(this.config.maxQueryResults).map(f)}async findImpactedTests(e){if(this.ensureInitialized(),e.length===0)return[];let r=`
|
|
27
|
+
SELECT DISTINCT t.* FROM hypergraph_nodes t
|
|
28
|
+
JOIN hypergraph_edges e ON e.source_id = t.id
|
|
29
|
+
JOIN hypergraph_nodes f ON f.id = e.target_id
|
|
30
|
+
WHERE t.type = 'test'
|
|
31
|
+
AND e.type = 'covers'
|
|
32
|
+
AND f.type = 'function'
|
|
33
|
+
AND f.file_path IN (${e.map(()=>"?").join(", ")})
|
|
34
|
+
LIMIT ?
|
|
35
|
+
`,i=[...e,this.config.maxQueryResults];return this.config.db.prepare(r).all(...i).map(f)}async findCoverageGaps(e=50){return this.ensureInitialized(),this.config.db.prepare(`
|
|
36
|
+
SELECT * FROM hypergraph_nodes
|
|
37
|
+
WHERE type = 'function'
|
|
38
|
+
AND coverage IS NOT NULL
|
|
39
|
+
AND coverage <= ?
|
|
40
|
+
ORDER BY coverage ASC, complexity DESC NULLS LAST
|
|
41
|
+
LIMIT ?
|
|
42
|
+
`).all(e,this.config.maxQueryResults).map(f)}async findModuleDependencies(e){this.ensureInitialized();let t=await this.findNodes({type:"module",filePath:e,limit:1});if(t.length===0){let a=await this.findNodes({type:"file",filePath:e,limit:1});if(a.length===0)throw new Error(`Module not found: ${e}`);t.push(a[0])}let r=t[0],i=await this.findEdges({sourceId:r.id,type:["imports","depends_on"]}),s=[];for(let a of i){let p=await this.getNode(a.targetId);p&&s.push(p)}let d=await this.findEdges({targetId:r.id,type:["imports","depends_on"]}),g=[];for(let a of d){let p=await this.getNode(a.sourceId);p&&g.push(p)}let c=await this.traverse(r.id,["imports","depends_on"],5),u=c.nodes.filter(a=>a.id!==r.id);return{module:r,directDependencies:s,dependents:g,transitiveDependencies:u,maxDependencyDepth:c.maxDepthReached}}async buildFromIndexResult(e){this.ensureInitialized();let t=Date.now(),r=0,i=0,s=0,d=[];return this.config.db.transaction(()=>{for(let a of e.files)try{let p=`file:${a.path}`;this.config.db.prepare("SELECT id FROM hypergraph_nodes WHERE id = ?").get(p)?i++:(this.config.db.prepare(`
|
|
43
|
+
INSERT INTO hypergraph_nodes (id, type, name, file_path)
|
|
44
|
+
VALUES (?, 'file', ?, ?)
|
|
45
|
+
`).run(p,a.path.split("/").pop()||a.path,a.path),r++)}catch(p){d.push({entity:`file:${a.path}`,error:b(p)})}for(let a of e.files){let p=`file:${a.path}`;for(let o of a.entities)try{let h=`${o.type}:${a.path}:${o.name}`,y=this.mapEntityTypeToNodeType(o.type);this.config.db.prepare("SELECT id FROM hypergraph_nodes WHERE id = ?").get(h)?(this.config.db.prepare(`
|
|
46
|
+
UPDATE hypergraph_nodes
|
|
47
|
+
SET line_start = ?, line_end = ?, complexity = ?, coverage = ?,
|
|
48
|
+
updated_at = datetime('now')
|
|
49
|
+
WHERE id = ?
|
|
50
|
+
`).run(o.lineStart,o.lineEnd,o.complexity,o.coverage,h),i++):(this.config.db.prepare(`
|
|
51
|
+
INSERT INTO hypergraph_nodes (id, type, name, file_path, line_start, line_end, complexity, coverage)
|
|
52
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
53
|
+
`).run(h,y,o.name,a.path,o.lineStart,o.lineEnd,o.complexity,o.coverage),r++);try{let m=x(p,h,"contains");this.config.db.prepare(`
|
|
54
|
+
INSERT OR REPLACE INTO hypergraph_edges (id, source_id, target_id, type, weight)
|
|
55
|
+
VALUES (?, ?, ?, 'contains', 1.0)
|
|
56
|
+
`).run(m,p,h),s++}catch(m){d.push({entity:`contains:${o.type}:${o.name}`,error:b(m)})}}catch(h){d.push({entity:`${o.type}:${o.name}`,error:b(h)})}}let c=[".ts",".tsx",".js",".jsx",".py",".mjs",".cjs"],u=["/index.ts","/index.tsx","/index.js","/index.jsx","/index.py"];for(let a of e.files){let p=`file:${a.path}`;for(let o of a.imports)try{let h=o;(o.startsWith("./")||o.startsWith("../"))&&(h=I.resolve(I.dirname(a.path),o));let y=`file:${h}`,l=this.config.db.prepare("SELECT id FROM hypergraph_nodes WHERE id = ?"),m=l.get(y);if(!m)for(let E of c){let T=y+E,N=l.get(T);if(N){y=T,m=N;break}}if(!m)for(let E of u){let T=y+E,N=l.get(T);if(N){y=T,m=N;break}}if(m){let E=x(p,y,"imports");this.config.db.prepare(`
|
|
57
|
+
INSERT OR REPLACE INTO hypergraph_edges (id, source_id, target_id, type, weight)
|
|
58
|
+
VALUES (?, ?, ?, 'imports', 1.0)
|
|
59
|
+
`).run(E,p,y),s++}}catch(h){d.push({entity:`import:${o}`,error:b(h)})}}})(),{nodesCreated:r,nodesUpdated:i,edgesCreated:s,durationMs:Date.now()-t,errors:d}}async syncWithKnowledgeGraph(e){this.ensureInitialized();let t=Date.now(),r=0,i=0,s=0,d=0,g=await this.findNodes({});for(let u of g){let a=await e.getNode(u.id);r++}return i=(await this.findEdges({})).length,{nodesSynced:r,edgesSynced:i,nodesAdded:s,nodesRemoved:d,durationMs:Date.now()-t}}async getStats(){this.ensureInitialized();let e=this.schemaManager.getStats(this.config.db),t=this.config.db.prepare(`
|
|
60
|
+
SELECT type, COUNT(*) as count FROM hypergraph_nodes GROUP BY type
|
|
61
|
+
`).all(),r={function:0,module:0,test:0,file:0,class:0};for(let g of t)g.type in r&&(r[g.type]=g.count);let i=this.config.db.prepare(`
|
|
62
|
+
SELECT type, COUNT(*) as count FROM hypergraph_edges GROUP BY type
|
|
63
|
+
`).all(),s={calls:0,imports:0,tests:0,depends_on:0,covers:0,contains:0};for(let g of i)g.type in s&&(s[g.type]=g.count);let d=this.config.db.prepare(`
|
|
64
|
+
SELECT
|
|
65
|
+
AVG(complexity) as avg_complexity,
|
|
66
|
+
AVG(coverage) as avg_coverage,
|
|
67
|
+
COUNT(CASE WHEN embedding IS NOT NULL THEN 1 END) as nodes_with_embeddings
|
|
68
|
+
FROM hypergraph_nodes
|
|
69
|
+
`).get();return{totalNodes:e.nodeCount,totalEdges:e.edgeCount,nodesByType:r,edgesByType:s,avgComplexity:d.avg_complexity??0,avgCoverage:d.avg_coverage??0,nodesWithEmbeddings:d.nodes_with_embeddings}}ensureInitialized(){if(!this.initialized)throw new Error("HypergraphEngine not initialized. Call initialize() first.")}mapEntityTypeToNodeType(e){return{function:"function",class:"class",module:"module",interface:"module",file:"file",test:"test"}[e]??"function"}};async function Q(n){let e=new _(n);return await e.initialize(),e}function J(n){return new _(n)}var X=_;export{B as a,_ as b,Q as c,J as d,X as e};
|
|
@@ -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.9.
|
|
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.9.19");process.exit(0)}
|
|
2
2
|
var i={domain:"test-generation",bestPractices:["Follow Arrange-Act-Assert (AAA) pattern for clear test structure","One logical assertion per test - test one behavior at a time","Use descriptive test names: should_returnValue_when_condition","Mock external dependencies to isolate unit under test","Test edge cases and boundary conditions, not just happy paths","Keep tests deterministic - avoid time-dependent assertions","Use test data builders or factories for complex objects","Prefer integration tests for workflows, unit tests for logic","Maintain test independence - no shared mutable state between tests","Write failing test first (TDD Red) before implementation"],antiPatterns:[{name:"God Test",description:"A single test that verifies too many behaviors",reason:"Hard to diagnose failures, brittle, slow to run",alternative:"Split into focused tests, each verifying one behavior",detection:"expect.*expect.*expect.*expect.*expect"},{name:"Mystery Guest",description:"Test relies on external data files or state not visible in test",reason:"Tests are hard to understand and maintain",alternative:"Make test data explicit within the test or use fixtures"},{name:"Eager Test",description:"Test that verifies more than needed for the current behavior",reason:"Creates unnecessary coupling, breaks easily",alternative:"Only assert what is necessary for this specific test case"},{name:"Flaky Assertion",description:"Assertions that depend on timing, order, or external state",reason:"Creates unreliable test suite, erodes trust",alternative:"Use deterministic assertions, mock time/random",detection:"setTimeout|Date\\.now|Math\\.random"},{name:"Test Code Duplication",description:"Same setup or assertion code repeated across tests",reason:"Maintenance burden, inconsistency risk",alternative:"Extract to beforeEach, helpers, or fixtures"}],frameworkGuidance:{jest:["Use describe blocks to group related tests","Prefer toEqual for deep equality, toBe for primitives","Use jest.mock() at module level for consistent mocking","Use jest.spyOn for partial mocking of objects","Enable --coverage to track test coverage"],vitest:["Use vi.mock() for module mocking","Prefer vi.fn() over jest.fn() syntax","Use vitest/ui for interactive test debugging","Enable browser mode for component tests","Use inline snapshots for small expected values"],mocha:["Use beforeEach/afterEach for setup/teardown","Combine with chai for assertions","Use sinon for spies, stubs, and mocks","Set appropriate timeouts for async tests"],pytest:["Use fixtures for reusable test setup","Use parametrize for data-driven tests","Use conftest.py for shared fixtures","Use pytest.raises for exception testing","Use pytest-cov for coverage reporting"],junit:["Use @BeforeEach and @AfterEach for setup/teardown","Use @DisplayName for readable test names","Use @ParameterizedTest for data-driven tests","Use Mockito for mocking dependencies"],testng:["Use @BeforeMethod and @AfterMethod appropriately","Use @DataProvider for parameterized tests","Configure test groups for selective execution"],playwright:["Use page.locator() for resilient element selection","Use expect(locator) for auto-waiting assertions","Use page.waitForLoadState for navigation","Use test.describe for grouping tests","Use fixtures for reusable browser contexts"],cypress:["Use cy.intercept() for API mocking","Avoid conditional testing - use deterministic state","Use data-cy attributes for stable selectors","Use cy.within() for scoped queries","Prefer cy.contains() for text-based selection"],selenium:["Use explicit waits over implicit waits","Use Page Object Model for maintainability","Handle stale element references with retry logic","Clean up browser state between tests"]},languageGuidance:{typescript:["Use type assertions in tests for better IDE support","Create typed test fixtures and builders","Use satisfies operator for test data validation","Mock types with ts-mockito or typed mocking libs"],javascript:["Use JSDoc comments for test documentation","Consider TypeScript for larger test suites","Use ESLint with testing plugins"],python:["Use type hints in test functions","Use dataclasses for test data","Follow PEP 8 naming: test_should_do_something"],java:["Use AssertJ for fluent assertions","Use Lombok for test data classes","Follow naming: shouldDoSomething_whenCondition"],go:["Use table-driven tests for multiple cases","Use testify for assertions and mocking","Place tests in _test.go files"],rust:["Use #[test] attribute for test functions","Use assert!, assert_eq!, assert_ne! macros","Place unit tests in same file with #[cfg(test)]"],csharp:["Use xUnit or NUnit for testing","Use FluentAssertions for readable assertions","Use Moq for mocking interfaces"],kotlin:["Use kotest for BDD-style testing","Use MockK for Kotlin-first mocking","Use data classes for test fixtures"]},examples:[{title:"Unit Test Template (TypeScript + Vitest)",description:"Standard AAA pattern for unit tests",content:`describe('UserService', () => {
|
|
3
3
|
describe('createUser', () => {
|
|
4
4
|
it('should create user with valid data', async () => {
|
|
@@ -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.9.
|
|
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.9.19");process.exit(0)}
|
|
2
2
|
function M(u){let e=u|0;return()=>{e=e+1831565813|0;let n=Math.imul(e^e>>>15,1|e);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}var A=2,y=10,x=200,p=1e-8,b=class{epsilon;seed;constructor(e){if(this.epsilon=e?.epsilon??.3,this.seed=e?.seed,this.epsilon<=0||this.epsilon>=1)throw new Error("SparsifierConfig.epsilon must be in (0, 1)")}sparsify(e){if(e.nodeCount<=0||e.edges.length===0)return{nodeCount:e.nodeCount,edges:[]};let n=this.seed!==void 0?M(this.seed):Math.random,t=this.approximateEffectiveResistances(e),i=e.nodeCount,r=e.edges.length,o=Math.max(1,Math.log(i)),m=this.epsilon*this.epsilon,l=Math.min(r,Math.max(i-1,A*(i-1)*(1-this.epsilon))),s=new Float64Array(r),c=0;for(let a=0;a<r;a++){let d=e.edges[a][2];s[a]=d*t[a],c+=s[a]}if(c<=0)return{nodeCount:e.nodeCount,edges:[]};let f=[];for(let a=0;a<r;a++){let[d,C,E]=e.edges[a],g=Math.min(1,s[a]/c*l);if(n()<g){let w=E/g;f.push([d,C,w])}}return{nodeCount:e.nodeCount,edges:f}}validateSpectral(e,n){let t=Math.min(y,Math.max(1,e.nodeCount-1)),i=this.computeLaplacian(e),r=this.computeLaplacian(n),o=this.computeTopEigenvalues(i,t),m=this.computeTopEigenvalues(r,t),l=[],s=!0,c=this.epsilon;for(let f=0;f<o.length;f++){if(o[f]<1e-10)continue;let a=m[f]/o[f];l.push(a),(a<1-c||a>1+c)&&(s=!1)}return{isValid:s,eigenvalueRatios:l,originalEdgeCount:e.edges.length,sparsifiedEdgeCount:n.edges.length,compressionRatio:e.edges.length>0?n.edges.length/e.edges.length:0}}computeLaplacian(e){let n=e.nodeCount,t=Array.from({length:n},()=>new Array(n).fill(0));for(let[i,r,o]of e.edges)i<0||i>=n||r<0||r>=n||(t[i][i]+=o,t[r][r]+=o,t[i][r]-=o,t[r][i]-=o);return t}computeTopEigenvalues(e,n){let t=e.length;if(t===0)return[];let i=[],r=[],o=e.map(m=>[...m]);for(let m=0;m<Math.min(n,t);m++){let l=this.powerIteration(o,t,r);if(l===null)break;i.push(l.eigenvalue),r.push(l.eigenvector),V(o,l.eigenvalue,l.eigenvector)}return i}approximateEffectiveResistances(e){let n=e.nodeCount,t=new Float64Array(n);for(let[r,o,m]of e.edges)r>=0&&r<n&&(t[r]+=m),o>=0&&o<n&&(t[o]+=m);let i=new Array(e.edges.length);for(let r=0;r<e.edges.length;r++){let[o,m]=e.edges[r],l=t[o]||1,s=t[m]||1;i[r]=1/l+1/s}return i}powerIteration(e,n,t){let i=0;for(let s=0;s<n;s++)for(let c=0;c<n;c++)i+=e[s][c]*e[s][c];if(i<p*p)return null;let r=t.length,o=new Array(n);for(let s=0;s<n;s++)o[s]=Math.sin((s+1)*(r+1)*1.618033988749895)+.1*(s-n/2);for(let s of t)h(o,s);if(R(o)<p)return null;let l=0;for(let s=0;s<x;s++){let c=L(e,o);for(let d of t)h(c,d);let f=S(c,o),a=v(c);if(a<p)return{eigenvalue:0,eigenvector:o};for(let d=0;d<n;d++)o[d]=c[d]/a;if(Math.abs(f-l)<p){l=f;break}l=f}return{eigenvalue:Math.abs(l),eigenvector:o}}};function L(u,e){let n=u.length,t=new Array(n).fill(0);for(let i=0;i<n;i++){let r=0;for(let o=0;o<n;o++)r+=u[i][o]*e[o];t[i]=r}return t}function v(u){let e=0;for(let n=0;n<u.length;n++)e+=u[n]*u[n];return Math.sqrt(e)}function R(u){let e=v(u);if(e>0)for(let n=0;n<u.length;n++)u[n]/=e;return e}function S(u,e){let n=0;for(let t=0;t<u.length;t++)n+=u[t]*e[t];return n}function h(u,e){let n=S(u,e);for(let t=0;t<u.length;t++)u[t]-=n*e[t]}function V(u,e,n){let t=n.length;for(let i=0;i<t;i++)for(let r=0;r<t;r++)u[i][r]-=e*n[i]*n[r]}export{b as a};
|
|
@@ -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.9.
|
|
2
|
-
import{c as t}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.9.19");process.exit(0)}
|
|
2
|
+
import{c as t}from"./chunk-WULMXLNN.js";import{randomInt as o}from"node:crypto";function a(){return Math.random()}function m(n,e){return o(n,e)}function c(n,e){return n+Math.random()*(e-n)}var r=t(()=>{"use strict"});export{a,m as b,c,r as d};
|
|
@@ -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.9.
|
|
2
|
-
import{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.9.19");process.exit(0)}
|
|
2
|
+
import{g}from"./chunk-FPVXXQVX.js";import{b as p,c as d}from"./chunk-N2PLNYEV.js";import{b as m,c as f}from"./chunk-5MGRZ4YD.js";import{i as h}from"./chunk-MIQAFOFO.js";f();var I={maxDepth:5,riskWeights:{directImpact:.4,transitiveImpact:.2,testCoverage:.2,criticalPath:.15,dependencyCount:.05},testPatterns:["**/*.test.ts","**/*.test.tsx","**/*.spec.ts","**/*.spec.tsx","**/test_*.py","**/*_test.py","**/*_test.go"],criticalPaths:["**/auth/**","**/security/**","**/payment/**","**/api/**","**/core/**"],namespace:"code-intelligence:impact"},u=class{constructor(e,t,i={}){this.memory=e;this.config={...I,...i},this.knowledgeGraph=t||new g(e)}memory;config;knowledgeGraph;async analyzeImpact(e){try{let{changedFiles:t,depth:i=this.config.maxDepth,includeTests:n=!0}=e;if(t.length===0)return p({directImpact:[],transitiveImpact:[],impactedTests:[],riskLevel:"info",recommendations:[]});let r=await this.analyzeDirectImpact(t),l=await this.analyzeTransitiveImpact(t,r,i),s=[];if(n){let a=await this.getImpactedTests(t);a.success&&(s=a.value)}let c={directImpact:r,transitiveImpact:l,impactedTests:s,riskLevel:"info",recommendations:[]};return c.riskLevel=this.calculateRiskLevel(c),c.recommendations=this.getRecommendations(c),await this.storeAnalysis(t,c),p(c)}catch(t){return d(m(t))}}async getImpactedTests(e){try{let t=new Set;for(let i of e){if(this.isTestFile(i)){t.add(i);continue}let n=await this.knowledgeGraph.mapDependencies({files:[i],direction:"incoming",depth:3});if(n.success)for(let s of n.value.nodes)this.isTestFile(s.path)&&t.add(s.path);let r=this.getBaseName(i),l=[`${r}.test`,`${r}.spec`,`test_${r}`,`${r}_test`];for(let s of l){let c=await this.memory.search(`code-intelligence:kg:node:*${s}*`,10);for(let a of c){let o=await this.memory.get(a);o?.properties?.path&&this.isTestFile(o.properties.path)&&t.add(o.properties.path)}}}return p(Array.from(t))}catch(t){return d(m(t))}}calculateRiskLevel(e){let t=this.config.riskWeights,i=0,n=Math.min(1,e.directImpact.length/10);i+=n*t.directImpact;let r=Math.min(1,e.transitiveImpact.length/20);i+=r*t.transitiveImpact;let l=e.impactedTests.length>0?Math.max(0,1-e.impactedTests.length/(e.directImpact.length||1)):1;i+=l*t.testCoverage;let s=this.countCriticalFiles([...e.directImpact.map(o=>o.file),...e.transitiveImpact.map(o=>o.file)]),c=Math.min(1,s/5);i+=c*t.criticalPath;let a=this.calculateAverageRiskScore([...e.directImpact,...e.transitiveImpact]);return i+=a*t.dependencyCount,i>=.8?"critical":i>=.6?"high":i>=.4?"medium":i>=.2?"low":"info"}getRecommendations(e){let t=[];(e.riskLevel==="critical"||e.riskLevel==="high")&&t.push("This change has significant impact - consider peer review before merging"),e.impactedTests.length===0&&e.directImpact.length>0?t.push("No tests found for impacted files - add test coverage"):e.impactedTests.length<e.directImpact.length/2&&t.push("Test coverage appears low for impacted files"),e.impactedTests.length>0&&(e.impactedTests.length<=10?t.push(`Run these ${e.impactedTests.length} tests: ${e.impactedTests.slice(0,3).join(", ")}${e.impactedTests.length>3?"...":""}`):t.push(`Run all ${e.impactedTests.length} impacted tests before deployment`));let i=[...e.directImpact,...e.transitiveImpact].filter(r=>this.isCriticalPath(r.file));i.length>0&&t.push(`${i.length} critical path files affected - extra scrutiny recommended`),e.transitiveImpact.length>10&&t.push("Large transitive impact - consider breaking down into smaller changes");let n=[...e.directImpact,...e.transitiveImpact].filter(r=>r.riskScore>=.7);return n.length>0&&t.push(`${n.length} high-risk files impacted: ${n.slice(0,2).map(r=>this.getFileName(r.file)).join(", ")}`),t}async analyzeDirectImpact(e){let t=[];for(let i of e){let n=await this.knowledgeGraph.mapDependencies({files:[i],direction:"incoming",depth:1});if(n.success){let{nodes:r,edges:l}=n.value;for(let s of r){if(s.path===i)continue;let c=l.find(o=>o.target===s.id||o.source===s.id),a=this.calculateFileRiskScore(s.path,s.inDegree,s.outDegree);t.push({file:s.path,reason:`Directly ${c?.type||"depends on"} ${this.getFileName(i)}`,distance:1,riskScore:a})}}}return this.deduplicateImpact(t)}async analyzeTransitiveImpact(e,t,i){let n=[],r=new Set([...e,...t.map(s=>s.file)]),l=t.map(s=>({file:s.file,distance:1}));for(;l.length>0;){let s=l.shift();if(s.distance>=i)continue;let c=await this.knowledgeGraph.mapDependencies({files:[s.file],direction:"incoming",depth:1});if(c.success)for(let a of c.value.nodes){if(r.has(a.path)||a.path===s.file)continue;r.add(a.path);let o=this.calculateFileRiskScore(a.path,a.inDegree,a.outDegree,s.distance+1);n.push({file:a.path,reason:`Transitively depends via ${this.getFileName(s.file)}`,distance:s.distance+1,riskScore:o}),l.push({file:a.path,distance:s.distance+1})}}return this.deduplicateImpact(n)}calculateFileRiskScore(e,t,i,n=1){let r=0;return r+=Math.min(.3,t/20),r+=Math.min(.2,i/30),this.isCriticalPath(e)&&(r+=.3),this.isEntryPoint(e)&&(r+=.2),r=r*Math.pow(.8,n-1),Math.min(1,Math.max(0,r))}calculateAverageRiskScore(e){return e.length===0?0:e.reduce((i,n)=>i+n.riskScore,0)/e.length}countCriticalFiles(e){return e.filter(t=>this.isCriticalPath(t)).length}isTestFile(e){return[/\.test\.[tj]sx?$/,/\.spec\.[tj]sx?$/,/_test\.[tj]sx?$/,/test_.*\.py$/,/.*_test\.py$/,/.*_test\.go$/].some(i=>i.test(e))}isCriticalPath(e){return this.config.criticalPaths.map(i=>i.replace(/\*\*/g,".*").replace(/\*/g,"[^/]*")).some(i=>new RegExp(i).test(e))}isEntryPoint(e){return[/\/index\.[tj]sx?$/,/\/main\.[tj]sx?$/,/\/app\.[tj]sx?$/,/^src\/[^/]+\.[tj]sx?$/,/\/server\.[tj]sx?$/,/\/__init__\.py$/,/\/main\.go$/].some(i=>i.test(e))}getBaseName(e){return this.getFileName(e).replace(/\.[^.]+$/,"")}getFileName(e){return e.split(/[/\\]/).pop()||e}deduplicateImpact(e){let t=new Map;for(let i of e){let n=t.get(i.file);(!n||i.distance<n.distance)&&t.set(i.file,i)}return Array.from(t.values()).sort((i,n)=>n.riskScore!==i.riskScore?n.riskScore-i.riskScore:i.distance-n.distance)}async storeAnalysis(e,t){let i=h();await this.memory.set(`${this.config.namespace}:analysis:${i}`,{id:i,changedFiles:e,analysis:t,timestamp:new Date().toISOString()},{namespace:this.config.namespace,persist:!0})}};export{u as a};
|
|
@@ -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.9.
|
|
2
|
-
import{c as u}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.9.19");process.exit(0)}
|
|
2
|
+
import{c as u}from"./chunk-WULMXLNN.js";function t(){return{...e}}function o(r){e={...e,...r}}function i(){e={...s}}function a(){return e.useBrowserMode}function E(){return e.useScreenshotCapture}function l(){return e.useVisualRegression}function c(){return e.useE2EExecution}function f(){return e.defaultHeadless}function d(){return e.useAutoRetry}function _(){return e.logPerformanceMetrics}function I(){return e.useAxeCore}function p(){let r={};process.env.VIBIUM_USE_BROWSER_MODE!==void 0&&(r.useBrowserMode=process.env.VIBIUM_USE_BROWSER_MODE==="true"),process.env.VIBIUM_USE_SCREENSHOT_CAPTURE!==void 0&&(r.useScreenshotCapture=process.env.VIBIUM_USE_SCREENSHOT_CAPTURE==="true"),process.env.VIBIUM_USE_VISUAL_REGRESSION!==void 0&&(r.useVisualRegression=process.env.VIBIUM_USE_VISUAL_REGRESSION==="true"),process.env.VIBIUM_USE_E2E_EXECUTION!==void 0&&(r.useE2EExecution=process.env.VIBIUM_USE_E2E_EXECUTION==="true"),process.env.VIBIUM_DEFAULT_HEADLESS!==void 0&&(r.defaultHeadless=process.env.VIBIUM_DEFAULT_HEADLESS==="true"),process.env.VIBIUM_USE_AUTO_RETRY!==void 0&&(r.useAutoRetry=process.env.VIBIUM_USE_AUTO_RETRY==="true"),process.env.VIBIUM_LOG_PERFORMANCE_METRICS!==void 0&&(r.logPerformanceMetrics=process.env.VIBIUM_LOG_PERFORMANCE_METRICS==="true"),process.env.VIBIUM_USE_AXE_CORE!==void 0&&(r.useAxeCore=process.env.VIBIUM_USE_AXE_CORE==="true"),o(r)}function U(){o({defaultHeadless:!0,useAutoRetry:!0,logPerformanceMetrics:!0})}function R(){o({defaultHeadless:!1,logPerformanceMetrics:!0})}function S(){o({useBrowserMode:!1,useScreenshotCapture:!1,useVisualRegression:!1,useE2EExecution:!1,useAxeCore:!1})}var s,e,n=u(()=>{s={useBrowserMode:!0,useScreenshotCapture:!0,useVisualRegression:!0,useE2EExecution:!0,defaultHeadless:!1,useAutoRetry:!0,logPerformanceMetrics:!0,useAxeCore:!0},e={...s}});export{s as a,t as b,o as c,i as d,a as e,E as f,l as g,c as h,f as i,d as j,_ as k,I as l,p as m,U as n,R as o,S as p,n as q};
|
|
@@ -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.9.
|
|
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.9.19");process.exit(0)}
|
|
2
2
|
var s={copilot:{id:"copilot",name:"GitHub Copilot",configPath:".vscode/mcp.json",configFormat:"json",configKey:"servers",rulesPath:".github/copilot-instructions.md",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},cursor:{id:"cursor",name:"Cursor",configPath:".cursor/mcp.json",configFormat:"json",configKey:"mcpServers",rulesPath:".cursorrules",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},cline:{id:"cline",name:"Cline",configPath:".vscode/cline_mcp_settings.json",configFormat:"json",configKey:"mcpServers",rulesPath:".vscode/cline_custom_modes.json",rulesFormat:"json",supportsAutoApprove:!0,supportsCustomModes:!0,globalConfig:!1},kilocode:{id:"kilocode",name:"Kilo Code",configPath:".kilocode/mcp.json",configFormat:"json",configKey:"mcpServers",rulesPath:".kilocode/modes.json",rulesFormat:"json",supportsAutoApprove:!0,supportsCustomModes:!0,globalConfig:!1},roocode:{id:"roocode",name:"Roo Code",configPath:".roo/mcp.json",configFormat:"json",configKey:"mcpServers",rulesPath:".roo/modes.json",rulesFormat:"json",supportsAutoApprove:!0,supportsCustomModes:!0,globalConfig:!1},codex:{id:"codex",name:"OpenAI Codex CLI",configPath:".codex/config.toml",configFormat:"toml",configKey:"mcp_servers",rulesPath:"AGENTS.md",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},windsurf:{id:"windsurf",name:"Windsurf",configPath:".windsurf/mcp_config.json",configFormat:"json",configKey:"mcpServers",rulesPath:".windsurfrules",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},continuedev:{id:"continuedev",name:"Continue.dev",configPath:".continue/config.yaml",configFormat:"yaml",configKey:"mcpServers",rulesPath:".continue/rules/aqe-qe-standards.yaml",rulesFormat:"yaml",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1}},i=["fleet_init","fleet_status","fleet_health","agent_list","agent_metrics","agent_status","team_list","team_health","task_list","task_status","test_generate_enhanced","coverage_analyze_sublinear","quality_assess","defect_predict","code_index","memory_store","memory_retrieve","memory_query","memory_usage","model_route","routing_metrics","aqe_health"];function l(n){let e={command:"npx",args:["-y","agentic-qe@latest","mcp"],env:{AQE_MEMORY_PATH:".agentic-qe/memory.db",AQE_V3_MODE:"true"}};return n&&(e.disabled=!1,e.alwaysAllow=i),e}function c(n){let e=l(n.supportsAutoApprove);if(n.id==="copilot"){let o={[n.configKey]:{"agentic-qe":{type:"stdio",...e}}};return JSON.stringify(o,null,2)+`
|
|
3
3
|
`}let t={[n.configKey]:{"agentic-qe":e}};return JSON.stringify(t,null,2)+`
|
|
4
4
|
`}function u(){return`# Agentic QE MCP Server
|
|
@@ -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.9.
|
|
2
|
-
import{b as P,c as x,d as R,f as O,g as j,h as D,i as $,j as L,k as N}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.9.19");process.exit(0)}
|
|
2
|
+
import{b as P,c as x,d as R,f as O,g as j,h as D,i as $,j as L,k as N}from"./chunk-B2EHSFUW.js";import{b as _,d as T}from"./chunk-5R2DUR3A.js";import{a as k,c as q}from"./chunk-5MGRZ4YD.js";import{a as v,b as ee}from"./chunk-PUUTYV32.js";T();import{existsSync as w,mkdirSync as Q,writeFileSync as S,readFileSync as I,copyFileSync as te}from"fs";import{join as g,dirname as ne}from"path";async function M(t,e){if(!e.hooks.claudeCode)return!1;let n=g(t,".claude");w(n)||Q(n,{recursive:!0});let r=g(n,"settings.json"),s={};if(w(r))try{let u=I(r,"utf-8");s=_(u)}catch{s={}}let i={PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks guard --file "$TOOL_INPUT_file_path" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-command --command "$TOOL_INPUT_command" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^Task$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-task --description "$TOOL_INPUT_prompt" --json',timeout:5e3,continueOnError:!0}]}],PostToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks post-edit --file "$TOOL_INPUT_file_path" --success --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks post-command --command "$TOOL_INPUT_command" --success --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Task$",hooks:[{type:"command",command:'npx agentic-qe hooks post-task --task-id "$TOOL_RESULT_agent_id" --success --json',timeout:5e3,continueOnError:!0}]}],UserPromptSubmit:[{hooks:[{type:"command",command:"npx agentic-qe hooks route --json",timeout:5e3,continueOnError:!0}]}],SessionStart:[{hooks:[{type:"command",command:'npx agentic-qe hooks session-start --session-id "$SESSION_ID" --json',timeout:1e4,continueOnError:!0}]}],Stop:[{hooks:[{type:"command",command:"npx agentic-qe hooks session-end --save-state --json",timeout:5e3,continueOnError:!0}]}]},d=s.hooks||{};s.hooks=O(d,i);let c=s.env||{};s.env={...c,...j(e)};let m=D(e,t);for(let[u,h]of Object.entries(m))if(u==="_aqePermissions"){let p=s.permissions||{},l=p.allow||[],f=h,C=[...new Set([...l,...f])];s.permissions={...p,allow:C}}else s[u]=h;let a=s.enabledMcpjsonServers||[];return a=a.filter(u=>u!=="aqe"),a.includes("agentic-qe")||a.push("agentic-qe"),s.enabledMcpjsonServers=a,S(r,JSON.stringify(s,null,2),"utf-8"),await re(t),!0}async function re(t){let e=g(t,".claude","hooks");w(e)||Q(e,{recursive:!0});let n=g(e,"cross-phase-memory.yaml");if(w(n))return;let r=[g(ne(import.meta.url.replace("file://","")),"..","..","assets","hooks","cross-phase-memory.yaml"),g(process.cwd(),"assets","hooks","cross-phase-memory.yaml"),g(process.cwd(),"v3","assets","hooks","cross-phase-memory.yaml")];for(let i of r)try{if(w(i)){te(i,n),console.log(" \u2713 Cross-phase memory hooks installed");return}}catch{}S(n,`# Cross-Phase Memory Hooks Configuration
|
|
3
3
|
# Generated by aqe init
|
|
4
4
|
# See: https://github.com/anthropics/agentic-qe/docs/cross-phase-memory.md
|
|
5
5
|
|
|
@@ -276,7 +276,7 @@ aqe init --auto
|
|
|
276
276
|
`).run("aqe_version",JSON.stringify(e),i),s.prepare(`
|
|
277
277
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, created_at)
|
|
278
278
|
VALUES (?, '_system', ?, ?)
|
|
279
|
-
`).run("init_timestamp",JSON.stringify(new Date().toISOString()),i),s.close(),console.log(` \u2713 Version ${e} written to memory.db`),!0}catch(i){return s.close(),console.warn(` \u26A0 Could not write version: ${k(i)}`),!1}}catch(r){return console.warn(` \u26A0 Could not open memory.db: ${k(r)}`),!1}}async function W(t){let e=null;try{e=(await import("./better-sqlite3-
|
|
279
|
+
`).run("init_timestamp",JSON.stringify(new Date().toISOString()),i),s.close(),console.log(` \u2713 Version ${e} written to memory.db`),!0}catch(i){return s.close(),console.warn(` \u26A0 Could not write version: ${k(i)}`),!1}}catch(r){return console.warn(` \u26A0 Could not open memory.db: ${k(r)}`),!1}}async function W(t){let e=null;try{e=(await import("./better-sqlite3-HZPCHUQU.js")).default}catch{throw new Error(`SQLite persistence REQUIRED but better-sqlite3 is not installed.
|
|
280
280
|
Install it with: npm install better-sqlite3
|
|
281
281
|
If you see native compilation errors, ensure build tools are installed:
|
|
282
282
|
- macOS: xcode-select --install
|
|
@@ -302,7 +302,7 @@ Database path: ${r}
|
|
|
302
302
|
Ensure the directory is writable and has sufficient disk space.`)}}async function G(t){let e=o(t,".agentic-qe","memory.db");if(!y(e))return!1;try{let n=v(e),r=n.prepare(`
|
|
303
303
|
SELECT COUNT(*) as count FROM kv_store
|
|
304
304
|
WHERE namespace = 'code-intelligence:kg'
|
|
305
|
-
`).get();return n.close(),r.count>0}catch{return!1}}async function V(t){try{let{KnowledgeGraphService:e}=await import("./knowledge-graph-
|
|
305
|
+
`).get();return n.close(),r.count>0}catch{return!1}}async function V(t){try{let{KnowledgeGraphService:e}=await import("./knowledge-graph-QSIYZRAG.js"),{InMemoryBackend:n}=await import("./memory-backend-4NE4ADPG.js"),r=new n;await r.initialize();let s=new e(r,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0}),d=await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:t,ignore:["node_modules/**","dist/**","coverage/**",".agentic-qe/**"]}),c=await s.index({paths:d.map(m=>o(t,m)),incremental:!1,includeTests:!0});return s.destroy(),c.success?{status:"indexed",entries:c.value.nodesCreated+c.value.edgesCreated}:{status:"error",entries:0}}catch(e){return console.warn("Code intelligence scan warning:",k(e)),{status:"skipped",entries:0}}}async function B(t){let e=o(t,".agentic-qe","memory.db");try{let n=v(e),r=n.prepare(`
|
|
306
306
|
SELECT COUNT(*) as count FROM kv_store
|
|
307
307
|
WHERE namespace LIKE 'code-intelligence:kg%'
|
|
308
308
|
`).get();return n.close(),r.count}catch{return 0}}async function H(t,e,n){if(!e.learning.enabled)return 0;let r=o(t,".agentic-qe","data");y(r)||b(r,{recursive:!0});let s=o(r,"hnsw");y(s)||b(s,{recursive:!0});let i=o(r,"learning-config.json"),d={embeddingModel:e.learning.embeddingModel,hnswConfig:e.learning.hnswConfig,qualityThreshold:e.learning.qualityThreshold,promotionThreshold:e.learning.promotionThreshold,databasePath:o(r,"memory.db"),hnswIndexPath:o(s,"index.bin"),initialized:new Date().toISOString()};E(i,JSON.stringify(d,null,2),"utf-8");let c=0;if(e.learning.pretrainedPatterns&&n){let m=n,a=new Map;for(let p of m.patterns){let l=p.domain||"general";a.has(l)||a.set(l,[]),a.get(l).push(p)}let u=o(r,"pretrained-index.json"),h={version:m.version,totalPatterns:m.statistics.totalPatterns,domains:Array.from(a.entries()).map(([p,l])=>({name:p,patternCount:l.length})),loadedAt:new Date().toISOString()};E(u,JSON.stringify(h,null,2),"utf-8");for(let[p,l]of a){let f=o(r,"patterns",p);y(f)||b(f,{recursive:!0});let C=o(f,"patterns.json");E(C,JSON.stringify(l,null,2),"utf-8"),c+=l.length}return c}return 0}async function J(t,e){if(!e.workers.daemonAutoStart||e.workers.enabled.length===0)return 0;let n=o(t,".agentic-qe","workers");y(n)||b(n,{recursive:!0});let r={},s={"pattern-consolidator":6e4,"coverage-gap-scanner":3e5,"flaky-test-detector":6e5,"routing-accuracy-monitor":12e4};for(let a of e.workers.enabled)r[a]={name:a,enabled:!0,interval:e.workers.intervals[a]||s[a]||6e4,lastRun:null,status:"pending"};let i=o(n,"registry.json"),d={version:e.version,maxConcurrent:e.workers.maxConcurrent,workers:r,createdAt:new Date().toISOString(),daemonPid:null};E(i,JSON.stringify(d,null,2),"utf-8");for(let a of e.workers.enabled){let u=o(n,`${a}.json`),h={name:a,enabled:!0,interval:e.workers.intervals[a]||s[a]||6e4,projectRoot:t,dataDir:o(t,".agentic-qe","data"),createdAt:new Date().toISOString()};E(u,JSON.stringify(h,null,2),"utf-8")}let c=o(n,"start-daemon.cjs");return E(c,`#!/usr/bin/env node
|
|
@@ -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.9.
|
|
2
|
-
import{d as k,f as we}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.9.19");process.exit(0)}
|
|
2
|
+
import{d as k,f as we}from"./chunk-AG7J7DTM.js";import{a as ye}from"./chunk-Z2E5DTKX.js";import{c as Q}from"./chunk-5KGFDNYI.js";import{b as C,d as Z}from"./chunk-5R2DUR3A.js";import{a as V,c as be}from"./chunk-5MGRZ4YD.js";import{a as J,b as Xe}from"./chunk-PUUTYV32.js";import{a as ee,d as b,e as te,f as ne}from"./chunk-GYESQBDU.js";import{a as v,e as De}from"./chunk-WZUQT2BE.js";import{c as R,e as ve}from"./chunk-WULMXLNN.js";function O(i){if(!q.has(i))throw new Error(`Invalid table name: "${i}" is not in the allowlist`);return i}function ze(i){let e=i.split(".");if(e.length>2)throw new Error(`Invalid SQL identifier: "${i}" has too many parts (max: schema.table)`);for(let t of e)if(!re.test(t))throw new Error(`Invalid SQL identifier: "${i}" \u2014 part "${t}" does not match pattern ${re}`);return i}var q,re,z=R(()=>{"use strict";q=new Set(["schema_version","kv_store","vectors","rl_q_values","goap_goals","goap_actions","goap_plans","goap_plan_signatures","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","sona_patterns","sona_fisher_matrices","test_outcomes","routing_outcomes","coverage_sessions","patterns","hypergraph_nodes","hypergraph_edges","hypergraph_vertices","hypergraph_hyperedges","hypergraph_edge_vertices","hypergraph_vertex_properties","hypergraph_edge_properties","captured_experiences","experience_applications","witness_chain","witness_chain_receipts","witness_chain_archive","trajectories","trajectory_steps","pattern_evolution_events","pattern_relationships","pattern_versions","learning_daily_snapshots","metrics_outcomes","experience_consolidation_log","qe_pattern_reuse","qe_agent_co_execution"]);re=/^[a-z_][a-z0-9_]{0,62}$/});var D,se,oe,ie,ae,ce,Te,Ee,de,ue,le,pe,ge=R(()=>{"use strict";we();D=9,se=`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS schema_version (
|
|
4
4
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
5
5
|
version INTEGER NOT NULL,
|
|
@@ -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.9.
|
|
2
|
-
import{d as l,f 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.9.19");process.exit(0)}
|
|
2
|
+
import{d as l,f as i}from"./chunk-O6UMETOH.js";import{a as r,c as g}from"./chunk-5MGRZ4YD.js";g();var c=class extends i{config={name:"qe/tests/schedule",description:"Schedule and execute tests using phase-based pipeline with git-aware selection and flaky tracking. Runs tests in phases (unit, integration, e2e), selects affected tests from git changes, and tracks flaky tests.",domain:"test-execution",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{cwd:{type:"string",description:"Working directory for test execution (defaults to project root)"},gitRef:{type:"string",description:'Git ref to compare for affected test selection (e.g., "main", "HEAD~3")'},useGitAware:{type:"boolean",description:"Enable git-aware test selection to only run affected tests",default:!0},trackFlaky:{type:"boolean",description:"Enable flaky test tracking and quarantine",default:!0}}}}async execute(s,o){try{let{runTestPipeline:n}=await import("./test-scheduling-QREBYRGW.js"),d=await l(o),t=await n({cwd:s.cwd||process.cwd(),memory:d,baseRef:s.gitRef,flakyHistoryPath:s.trackFlaky!==!1?".agentic-qe/flaky-history.json":void 0,runAllTests:s.useGitAware===!1}),u=t.phaseResults.reduce((e,a)=>e+a.totalTests,0),f=t.phaseResults.reduce((e,a)=>e+a.passed,0),p=t.phaseResults.reduce((e,a)=>e+a.failed,0);return{success:!0,data:{pipelineId:o.requestId,phases:t.phaseResults.map(e=>({phaseId:e.phaseId,phaseName:e.phaseName,totalTests:e.totalTests,passed:e.passed,failed:e.failed,passRate:e.passRate,durationMs:e.durationMs})),gitAware:{enabled:!t.ranAllTests,selectedTests:t.selectedTests.length,gitRef:s.gitRef},flakyTracking:{enabled:s.trackFlaky!==!1},totalDuration:t.totalDurationMs,ranAllTests:t.ranAllTests,summary:`Executed ${t.phaseResults.length} phases, ${u} tests (${f} passed, ${p} failed) in ${t.totalDurationMs}ms`}}}catch(n){return{success:!1,error:r(n)}}}};export{c as a};
|
|
@@ -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.9.
|
|
2
|
-
import{b as A,d 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.9.19");process.exit(0)}
|
|
2
|
+
import{b as A,d as M}from"./chunk-5R2DUR3A.js";import{a as S,b as D}from"./chunk-YXLQJ226.js";import{S as Q,l as E}from"./chunk-W3IO4FQ5.js";import{g as C}from"./chunk-WULMXLNN.js";M();Q();var v=(1+Math.sqrt(5))/2,R=1/v;function k(t,e=0){if(t<0||!Number.isFinite(t))throw new Error(`Invalid dither sequence length: ${t}`);if(!Number.isFinite(e))throw new Error(`Invalid dither seed: ${e}`);let n=new Float32Array(t),r=(e*R%1+1)%1;for(let i=0;i<t;i++)n[i]=((r+(i+1)*v)%1+1)%1;return n}function I(t,e,n=0){if(!(t instanceof Float32Array))throw new Error("Input vector must be a Float32Array");if(t.length===0)return{quantized:new Int32Array(0),dequantized:new Float32Array(0),bitDepth:e,seed:n,stepSize:0,minValue:0,maxValue:0};if(e<1||e>32||!Number.isInteger(e))throw new Error(`Invalid bit depth: ${e}. Must be an integer in [1, 32].`);let r=t[0],i=t[0];for(let d=1;d<t.length;d++)t[d]<r&&(r=t[d]),t[d]>i&&(i=t[d]);let s=(1<<e)-1,a=i-r,o=a===0?1:a/s,m=k(t.length,n),l=new Int32Array(t.length),u=new Float32Array(t.length);for(let d=0;d<t.length;d++){if(a===0)l[d]=Math.round(s/2);else{let L=(t[d]-r)/o+(m[d]-.5);l[d]=Math.max(0,Math.min(s,Math.round(L)))}u[d]=l[d]*o+r}return{quantized:l,dequantized:u,bitDepth:e,seed:n,stepSize:o,minValue:r,maxValue:i}}var h=null,b=null,p=null,g=null,f=null,w=null,x=!1;try{let t=(D(),C(S));h=t.RuvectorLayer,b=t.TensorCompress,p=t.differentiableSearch,g=t.hierarchicalForward,f=t.getCompressionLevel,w=t.init,x=!0}catch{}function H(){return x}function c(){if(!x)throw new Error("@ruvector/gnn native module is not available on this platform. Install the appropriate optional dependency for your platform, or use a platform where pre-built binaries are available.")}var F=!1;function V(){if(!F){c();let t=w();return F=!0,t}return"@ruvector/gnn already initialized"}var y=class{indexes;config;nextId;gnnLayers;compressor;constructor(e={}){this.config={M:e.M||16,efConstruction:e.efConstruction||200,efSearch:e.efSearch||50,dimension:e.dimension||384,metric:e.metric||"cosine",quantization:e.quantization||"none"},this.indexes=new Map,this.nextId=new Map,this.gnnLayers=new Map,c(),this.compressor=new b,V()}initializeIndex(e){this.indexes.has(e)||(this.indexes.set(e,new Map),this.nextId.set(e,0))}addEmbedding(e,n){let r=e.namespace;this.indexes.has(r)||this.initializeIndex(r);let i=this.indexes.get(r),s=n??this.nextId.get(r);return n===void 0&&this.nextId.set(r,s+1),i.set(s,e),s}addEmbeddingsBatch(e){let n=[];for(let r of e){let i=this.addEmbedding(r.embedding,r.id);n.push(i)}return n}search(e,n={}){let r=n.namespace||e.namespace;if(!this.indexes.has(r))return[];let i=this.indexes.get(r),s=n.limit||10,a=[];for(let[u,d]of i.entries())a.push({id:u,vector:Array.from(d.vector)});if(a.length===0)return[];let o=new Float32Array(e.vector),m=a.map(u=>new Float32Array(u.vector)),l=p(o,m,Math.min(s,a.length),1);return l.indices.map((u,d)=>({id:a[u]?.id??u,distance:1-l.weights[d]}))}differentiableSearchWithWeights(e,n,r,i=1){let s=new Float32Array(e.vector),a=n.map(m=>new Float32Array(m.embedding.vector)),o=p(s,a,Math.min(r,n.length),i);return{indices:o.indices.map(m=>n[m]?.id??m),weights:o.weights}}hierarchicalForward(e,n,r){let i=r.map(l=>`${l.inputDim}-${l.hiddenDim}`).join(",");if(!this.gnnLayers.has(i)){let l=[];for(let u of r){let d=new h(u.inputDim,u.hiddenDim,u.heads,u.dropout);l.push(d)}this.gnnLayers.set(i,l[0])}let a=this.gnnLayers.get(i).toJson(),o=new Float32Array(e),m=n.map(l=>l.map(u=>new Float32Array(u)));return Array.from(g(o,m,[a]))}compressEmbedding(e,n){let r=f(n),s={none:"none",half:"half",pq8:"pq8",pq4:"pq4",binary:"binary"}[r]??"none",a=new Float32Array(e.vector),o=this.compressor.compress(a,n);return{dimension:Array.from(e.vector).length,level:s,data:o,accessFreq:n}}decompressEmbedding(e){let n=this.compressor.decompress(e.data),r={none:"none",half:"fp16",pq8:"int8",pq4:"int8",binary:"binary"};return{vector:n,dimension:e.dimension,namespace:"code",text:"",timestamp:Date.now(),quantization:r[e.level]??"none"}}getCompressionLevelForFrequency(e){return c(),f(e)}getIndexStats(e){return this.indexes.has(e)?{size:this.indexes.get(e).size,maxElements:1e4,dimension:this.config.dimension,metric:this.config.metric}:null}clearIndex(e){this.indexes.delete(e),this.nextId.delete(e)}clearAll(){this.indexes.clear(),this.nextId.clear()}resizeIndex(e){}setEfSearch(e){this.config.efSearch=e}getConfig(){return{...this.config}}isInitialized(e){return this.indexes.has(e)}getInitializedNamespaces(){return Array.from(this.indexes.keys())}getSize(e){return this.indexes.get(e)?.size??0}async saveIndex(e,n){let r=this.indexes.get(e);if(!r)throw new Error(`Namespace ${e} not initialized`);let i=Array.from(r.entries()).map(([a,o])=>({id:a,vector:Array.from(o.vector),metadata:o.metadata}));await(await import("fs/promises")).writeFile(n,JSON.stringify(i,null,2))}async loadIndex(e,n){let i=await(await import("fs/promises")).readFile(n,"utf-8"),s=A(i);this.initializeIndex(e);for(let a of s){let o={vector:a.vector,dimension:a.vector.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none",metadata:a.metadata};this.addEmbedding(o,a.id)}}},q=class{static instances=new Map;static getInstance(e,n){return this.instances.has(e)||this.instances.set(e,new y(n)),this.instances.get(e)}static closeInstance(e){let n=this.instances.get(e);n&&(n.clearAll(),this.instances.delete(e))}static closeAll(){for(let e of this.instances.values())e.clearAll();this.instances.clear()}},z=class{static layers=new Map;static getLayer(e){let n=`${e.inputDim}-${e.hiddenDim}-${e.heads}-${e.dropout}`;if(!this.layers.has(n)){c();let r=new h(e.inputDim,e.hiddenDim,e.heads,e.dropout);this.layers.set(n,r)}return this.layers.get(n)}static layerFromJson(e){return c(),h.fromJson(e)}static clearCache(){this.layers.clear()}},N=class{static _compressor=null;static get compressor(){return this._compressor||(c(),this._compressor=new b),this._compressor}static compressWithLevel(e,n){let r={levelType:n,scale:1,subvectors:n==="pq8"?8:n==="pq4"?16:void 0,centroids:n==="pq8"?256:void 0,outlierThreshold:n==="pq4"?3:void 0,threshold:n==="binary"?0:void 0},i=e instanceof Float32Array?e:new Float32Array(e);return this.compressor.compressWithLevel(i,r)}static decompress(e){return this.compressor.decompress(e)}static getLevel(e){return c(),f(e)}static compressWithDither(e,n,r){let i=e instanceof Float32Array?e:new Float32Array(e),s;if(E()){let o={none:32,half:16,pq8:8,pq4:4,binary:1},m=r?.bitDepth??o[n]??8,l=r?.seed??0;s=I(i,m,l)}return{compressed:this.compressWithLevel(s?s.dequantized:e,n),ditherResult:s}}};function G(){return c(),h}function J(){return c(),b}function O(){return c(),p}function j(){return c(),g}function B(){return c(),f}function K(){return c(),w}function U(t){return t instanceof Float32Array?t:"vector"in t?t.vector instanceof Float32Array?t.vector:new Float32Array(t.vector):new Float32Array(t)}function X(t){return"vector"in t?Array.from(t.vector):Array.from(t)}function Y(t,e="code"){return{vector:t,dimension:t.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none"}}function Z(t,e,n,r=1){let i=[],s=e.map(a=>a instanceof Float32Array?a:new Float32Array(a));for(let a of t){let o=a instanceof Float32Array?a:new Float32Array(a),m=p(o,s,n,r);i.push({indices:m.indices,weights:m.weights})}return i}export{H as a,V as b,y as c,q as d,z as e,N as f,G as g,J as h,O as i,j,B as k,K as l,U as m,X as n,Y as o,Z as p};
|
|
@@ -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.9.
|
|
2
|
-
import{S as f,b as p}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.9.19");process.exit(0)}
|
|
2
|
+
import{S as f,b as p}from"./chunk-W3IO4FQ5.js";f();var y={predictionWindowSize:10,compressionThreshold:.3,maxConcurrentStreams:8,oscillationFrequencyMs:100};function d(s){try{return JSON.stringify(s).length}catch{return 0}}function w(s,t){let e={},n=!1;for(let r of Object.keys(t))JSON.stringify(s[r])!==JSON.stringify(t[r])&&(e[r]=t[r],n=!0);for(let r of Object.keys(s))r in t||(e[r]=void 0,n=!0);return n?e:null}function v(s,t){let e={...s};for(let[n,r]of Object.entries(t))r===void 0?delete e[n]:e[n]=r;return e}var l=class{windowSize;windows=new Map;constructor(t){this.windowSize=Math.max(1,t)}predict(t){let e=this.windows.get(t);if(!e||e.length===0)return null;let n=e[e.length-1];return typeof n!="object"||n===null||Array.isArray(n)?null:{...n}}record(t,e){let n=this.windows.get(t);n||(n=[],this.windows.set(t,n)),n.push(e),n.length>this.windowSize&&n.shift()}removeStream(t){this.windows.delete(t)}},h=class{maxStreams;cycleMs;streamIds=[];currentIndex=0;constructor(t,e){this.maxStreams=Math.max(1,t),this.cycleMs=Math.max(1,e)}addStream(t){return this.streamIds.includes(t)||this.streamIds.length>=this.maxStreams?!1:(this.streamIds.push(t),!0)}removeStream(t){let e=this.streamIds.indexOf(t);return e===-1?!1:(this.streamIds.splice(e,1),this.currentIndex>=this.streamIds.length&&(this.currentIndex=0),!0)}nextStream(){if(this.streamIds.length===0)return null;let t=this.streamIds[this.currentIndex];return this.currentIndex=(this.currentIndex+1)%this.streamIds.length,t}getActiveStreams(){return[...this.streamIds]}get activeCount(){return this.streamIds.length}},g=class{config;predictor;router;lastPayloads=new Map;totalMessages=0;compressedMessages=0;totalOriginalBytes=0;totalCompressedBytes=0;constructor(t){this.config={...y,...t},this.predictor=new l(this.config.predictionWindowSize),this.router=new h(this.config.maxConcurrentStreams,this.config.oscillationFrequencyMs)}send(t,e,n,r){this.totalMessages++;let i=d(r);this.totalOriginalBytes+=i;let c=!1,o=r,a=i;if(typeof r=="object"&&r!==null&&!Array.isArray(r)){let m=this.predictor.predict(t);if(m){let u=w(m,r);u?1-d(u)/Math.max(i,1)>=this.config.compressionThreshold&&(o={__delta:!0,__changes:u},a=d(o),c=!0,this.compressedMessages++):(o={__delta:!0,__changes:{}},a=d(o),c=!0,this.compressedMessages++)}}return this.totalCompressedBytes+=a,this.predictor.record(t,r),this.lastPayloads.set(t,r),{streamId:t,senderId:e,receiverId:n,payload:o,compressed:c,originalSize:i,compressedSize:a,timestamp:Date.now()}}receive(t){if(!t.compressed||typeof t.payload!="object"||t.payload===null)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let e=t.payload;if(!e.__delta)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let n=this.predictor.predict(t.streamId),r=e.__changes??{};if(!n)return r;let i=v(n,r);return this.predictor.record(t.streamId,i),this.lastPayloads.set(t.streamId,i),i}getStats(){let t=this.totalOriginalBytes-this.totalCompressedBytes;return{totalMessages:this.totalMessages,compressedMessages:this.compressedMessages,bandwidthSavedBytes:Math.max(0,t),bandwidthReductionPercent:this.totalOriginalBytes>0?Math.max(0,t)/this.totalOriginalBytes*100:0,activeStreams:this.router.activeCount}}addStream(t){this.router.addStream(t)}removeStream(t){this.router.removeStream(t),this.predictor.removeStream(t),this.lastPayloads.delete(t)}};function M(s){return S()?new g(s):null}function S(){return p().useCognitiveRouting}export{M as a,S as b};
|
|
@@ -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.9.
|
|
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.9.19");process.exit(0)}
|
|
2
2
|
import*as h from"fs";import*as M from"path";var S=["coverage/coverage-final.json","coverage/coverage-summary.json",".coverage/coverage-final.json"];function x(s){for(let v of S){let i=M.join(s,v);if(h.existsSync(i))try{let n=JSON.parse(h.readFileSync(i,"utf-8"));if(n.total&&n.total.lines)return L(n,s);let o=new Map;for(let[r,C]of Object.entries(n)){let c=C,g=Object.keys(c.s),u=g.filter(a=>c.s[a]>0).length,b=Object.keys(c.b),p=0,m=0;for(let a of b)for(let y of c.b[a])p++,y>0&&m++;let e=Object.keys(c.f),t=e.filter(a=>c.f[a]>0).length,f=new Set,d=new Set;for(let a of g){let y=c.statementMap[a];for(let F=y.start.line;F<=y.end.line;F++)d.add(F),c.s[a]>0&&f.add(F)}let l=[...d].filter(a=>!f.has(a)).sort((a,y)=>a-y);o.set(r,{path:r,lines:{covered:f.size,total:d.size},branches:{covered:m,total:p},functions:{covered:t,total:e.length},statements:{covered:u,total:g.length},uncoveredLines:l,uncoveredBranches:l.slice(0,Math.floor(l.length/2))})}return o.size>0?o:null}catch{continue}}return null}function L(s,v){let i=new Map;for(let[n,o]of Object.entries(s)){if(n==="total")continue;let r=o;i.set(n,{path:n,lines:{covered:r.lines.covered,total:r.lines.total},branches:{covered:r.branches.covered,total:r.branches.total},functions:{covered:r.functions.covered,total:r.functions.total},statements:{covered:r.statements.covered,total:r.statements.total},uncoveredLines:[],uncoveredBranches:[]})}return i.size>0?i:null}function B(s,v){let n=v.split(`
|
|
3
3
|
`).length,r=[s.replace(".ts",".test.ts").replace("/src/","/tests/"),s.replace(".ts",".spec.ts").replace("/src/","/tests/"),s.replace(".ts",".test.ts"),s.replace("/src/","/test/").replace(".ts",".test.ts")].some(d=>h.existsSync(d)),C=(v.match(/\bexport\b/g)||[]).length,c=(v.match(/\b(function|=>)\b/g)||[]).length,g=(v.match(/\b(if|switch|case|\?\?|\|\|)\b/g)||[]).length,u;if(r){let d=Math.min(g*.005,.15),l=Math.min(n*1e-4,.1);u=.85-d-l}else u=.2+(C>5?.1:0);u=Math.max(.05,Math.min(.95,u));let b=Math.floor(n*u),p=Math.max(c,1),m=Math.max(g,1),e=Math.floor(b*.7),t=Math.floor(p*u*.9),f=Array.from({length:n-b},(d,l)=>l+b+1);return{path:s,lines:{covered:b,total:n},branches:{covered:Math.min(e,m),total:m},functions:{covered:Math.min(t,p),total:p},statements:{covered:b,total:n},uncoveredLines:f,uncoveredBranches:f.slice(0,Math.floor(f.length/2))}}function j(s,v){let i=v||process.cwd(),n=x(i),o=[],r=!1;if(n&&n.size>0){r=!0;for(let e of s){let t=M.resolve(e),f=n.get(t)||n.get(e)||n.get(M.relative(i,t));if(f)o.push({...f,path:e});else{let l=(h.existsSync(e)?h.readFileSync(e,"utf-8"):"").split(`
|
|
4
4
|
`).length;o.push({path:e,lines:{covered:0,total:l},branches:{covered:0,total:1},functions:{covered:0,total:1},statements:{covered:0,total:l},uncoveredLines:Array.from({length:l},(a,y)=>y+1),uncoveredBranches:[]})}}}else for(let e of s){let t=h.existsSync(e)?h.readFileSync(e,"utf-8"):"";o.push(B(e,t))}let C=o.reduce((e,t)=>e+t.lines.total,0),c=o.reduce((e,t)=>e+t.lines.covered,0),g=o.reduce((e,t)=>e+t.branches.total,0),u=o.reduce((e,t)=>e+t.branches.covered,0),b=o.reduce((e,t)=>e+t.functions.total,0),p=o.reduce((e,t)=>e+t.functions.covered,0),m=(e,t)=>t>0?Math.round(e/t*100):0;return{files:o,summary:{line:m(c,C),branch:m(u,g),function:m(p,b),statement:m(c,C),files:o.length},instrumented:r}}export{j as a};
|
|
@@ -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.9.
|
|
2
|
-
import{a as _}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.9.19");process.exit(0)}
|
|
2
|
+
import{a as _}from"./chunk-BB3KUX6C.js";import{e as E}from"./chunk-6BRUQTC7.js";import{a as T}from"./chunk-Z2E5DTKX.js";import{c as h}from"./chunk-5KGFDNYI.js";import{b as p,d as b}from"./chunk-5R2DUR3A.js";import{S,j as g}from"./chunk-W3IO4FQ5.js";b();T();S();var o=h.create("pattern-lifecycle"),A={promotionRewardThreshold:.7,promotionMinOccurrences:E,promotionMinSuccessRate:.7,deprecationFailureThreshold:3,staleDaysThreshold:30,confidenceDecayRate:.01,minActiveConfidence:.3,maxAgeForActivePatterns:90,promotionActivityWindowDays:30,asymmetricLearning:{}},f=class{constructor(e,t={}){this.db=e;this.config={...A,...t},this.asymmetricEngine=new _(this.config.asymmetricLearning),this.ensureSchema()}db;config;asymmetricEngine;_witnessChain=null;set witnessChain(e){this._witnessChain=e}_compressionService=null;set compressionService(e){this._compressionService=e}ensureSchema(){try{this.db.prepare(`
|
|
3
3
|
SELECT deprecated_at FROM qe_patterns LIMIT 1
|
|
4
4
|
`).get()}catch(e){o.debug("Adding missing deprecated_at column",{error:e instanceof Error?e.message:String(e)}),this.db.exec(`
|
|
5
5
|
ALTER TABLE qe_patterns ADD COLUMN deprecated_at TEXT DEFAULT NULL
|
|
@@ -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.9.
|
|
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.9.19");process.exit(0)}
|
|
2
2
|
import{readFileSync as O,existsSync as x,readdirSync as A}from"fs";import{join as y,basename as v}from"path";function m(r){let e=[];if(!r||typeof r!="object")return e.push("Overlay must be a non-null object"),e;let t=r;if((!t.agent||typeof t.agent!="string")&&e.push('Overlay must have a string "agent" field'),t.replace!==void 0)if(typeof t.replace!="object"||t.replace===null)e.push('"replace" must be an object');else{let n=t.replace;n.description!==void 0&&typeof n.description!="string"&&e.push('"replace.description" must be a string'),n.domains!==void 0&&!Array.isArray(n.domains)&&e.push('"replace.domains" must be an array'),n.complexity!==void 0&&typeof n.complexity!="string"&&e.push('"replace.complexity" must be a string')}if(t.append!==void 0)if(typeof t.append!="object"||t.append===null)e.push('"append" must be an object');else{let n=t.append;n.instructions!==void 0&&typeof n.instructions!="string"&&e.push('"append.instructions" must be a string'),n.capabilities!==void 0&&!Array.isArray(n.capabilities)&&e.push('"append.capabilities" must be an array'),n.tags!==void 0&&!Array.isArray(n.tags)&&e.push('"append.tags" must be an array')}if(t.config!==void 0)if(typeof t.config!="object"||t.config===null)e.push('"config" must be an object');else{let n=t.config;n.minimumFindings!==void 0&&typeof n.minimumFindings!="number"&&e.push('"config.minimumFindings" must be a number'),n.maxParallelAgents!==void 0&&typeof n.maxParallelAgents!="number"&&e.push('"config.maxParallelAgents" must be a number'),n.preferredFrameworks!==void 0&&!Array.isArray(n.preferredFrameworks)&&e.push('"config.preferredFrameworks" must be an array'),n.needsContext!==void 0&&typeof n.needsContext!="boolean"&&e.push('"config.needsContext" must be a boolean')}return e}var w=".claude/agent-overrides";function $(r){let e={},t=r.split(`
|
|
3
3
|
`),n=null,i=null,s=null,a=null;for(let o of t){let l=o.replace(/\r$/,"");if(l.trim().startsWith("#")||l.trim()==="")continue;let u=l.length-l.trimStart().length,g=l.trim();if(g.startsWith("- ")){let c=g.slice(2).trim().replace(/^["']|["']$/g,"");s&&s.push(c);continue}if(s&&a){if(i&&n){let c=e[n]||{};c[a]=s,e[n]=c}else if(n){let c=e[n]||{};c[a]=s,e[n]=c}s=null,a=null}let f=g.match(/^(\w[\w.-]*)\s*:\s*(.*)$/);if(!f)continue;let[,p,b]=f,d=b.trim().replace(/^["']|["']$/g,"");if(u===0)d===""||d===void 0?(n=p,i=null,e[p]||(e[p]={})):(e[p]=h(d),n=null,i=null);else if(u<=4&&n)if(d===""||d===void 0)i=p,s=[],a=p;else{let c=e[n]||{};c[p]=h(d),e[n]=c}}if(s&&a&&n){let o=e[n]||{};o[a]=s,e[n]=o}return e}function h(r){if(r==="true")return!0;if(r==="false")return!1;if(r==="null")return null;let e=Number(r);return!isNaN(e)&&r!==""?e:r}function N(r){let e=y(r,w),t={overlays:[],warnings:[],errors:[]};if(!x(e))return t;let n;try{n=A(e).filter(i=>(i.endsWith(".yaml")||i.endsWith(".yml"))&&!i.startsWith("_"))}catch(i){return t.errors.push(`Failed to read overrides directory: ${i.message}`),t}for(let i of n){let s=y(e,i);try{let a=O(s,"utf-8"),o=$(a);if(!o.agent){let u=v(i).replace(/\.(override|customize)\.(yaml|yml)$/,"");o.agent=u}let l=m(o);if(l.length>0){t.warnings.push(`Overlay ${i} has validation issues: ${l.join("; ")}. Loading without overlay.`);continue}t.overlays.push(o)}catch(a){t.warnings.push(`Failed to parse overlay ${i}: ${a.message}. Agent loads without overlay.`)}}return t}function E(r,e){let t=r,n={agentName:e.agent,overlayFile:`${e.agent}.override.yaml`,replacedFields:[],appendedFields:[],configOverrides:[]};if(e.replace){if(e.replace.description){let i=/^(description:\s*).+$/m;i.test(t)&&(t=t.replace(i,`$1${e.replace.description}`),n.replacedFields.push("description"))}if(e.replace.domains){let i=/^(domain:\s*).+$/m;i.test(t)&&(t=t.replace(i,`$1${e.replace.domains.join(", ")}`),n.replacedFields.push("domains"))}if(e.replace.complexity){let i=/^(complexity:\s*).+$/m;i.test(t)&&(t=t.replace(i,`$1${e.replace.complexity}`),n.replacedFields.push("complexity"))}}if(e.append){if(e.append.instructions&&(t+=`
|
|
4
4
|
|
|
@@ -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.9.
|
|
2
|
-
import{a as U,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.9.19");process.exit(0)}
|
|
2
|
+
import{a as U,b as G}from"./chunk-5LXWEAEJ.js";import{g as W}from"./chunk-JCPJG2KU.js";import{a as _}from"./chunk-J7F65KKG.js";import{e as S}from"./chunk-6BRUQTC7.js";import{b as v,c as x}from"./chunk-ALYUJEYA.js";import{a as ne}from"./chunk-Z2E5DTKX.js";import{c as z}from"./chunk-5KGFDNYI.js";import{b as k,d as q}from"./chunk-5R2DUR3A.js";import{b,c as E}from"./chunk-N2PLNYEV.js";import{a as y,c as I}from"./chunk-5MGRZ4YD.js";import{i as O}from"./chunk-MIQAFOFO.js";import{S as ae,b as N}from"./chunk-W3IO4FQ5.js";import{randomUUID as Z}from"crypto";I();q();import{randomUUID as se}from"node:crypto";var j=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-${se()}`;if(this.claudeFlowAvailable)try{let{execFileSync:r}=await import("child_process"),n=["--no-install",j,"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",j,"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",j,"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{join:t}=await import("path"),{existsSync:i,mkdirSync:r}=await import("fs"),{createRequire:n}=await import("module"),a=n(import.meta.url),{openDatabase:s}=a("../../shared/safe-db.js"),o=t(this.options.projectRoot,".agentic-qe","trajectories.db"),u=t(this.options.projectRoot,".agentic-qe");i(u)||r(u,{recursive:!0});let p=s(o);p.exec(`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS trajectories (
|
|
4
4
|
id TEXT PRIMARY KEY,
|
|
5
5
|
task TEXT NOT NULL,
|
|
@@ -21,4 +21,4 @@ Steps:
|
|
|
21
21
|
${e.steps.map((n,a)=>`${a+1}. ${n.action}${n.result?` \u2192 ${n.result}`:""}`).join(`
|
|
22
22
|
`)}
|
|
23
23
|
|
|
24
|
-
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){M.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 ue={enableClaudeFlow:!0,enableExperienceCapture:!0,enablePatternPromotion:!0,promotionThreshold:S},L=class{constructor(e,t,i){this.memory=e;this.eventBus=i;this.config={...ue,...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 U(G),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=_(this.memory,{promotionThreshold:this.config.promotionThreshold}),await this.patternStore.initialize(),this.reasoningBank=W(this.memory,this.eventBus,this.config.reasoningBank,this.coherenceService),await this.reasoningBank.initialize();try{let{getSharedRvfDualWriter:e}=await import("./shared-rvf-dual-writer-BPIFGN7I.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-FLPF7CS6.js");if(e()){let{createPersistentWitnessChain:t,createWitnessChainSQLitePersistence:i}=await import("./witness-chain-FLPF7CS6.js"),{getUnifiedPersistence:r}=await import("./unified-persistence-YBHEAL2S.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{isCrossDomainTransferEnabled:e}=await import("./feature-flags-264QUQ3E.js");if(e()&&this.patternStore){let{createDomainTransferEngine:t}=await import("./domain-transfer-MXPKJ2A2.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=V({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});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=this.enhanceRoutingWithPatterns(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,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()}-${Z().slice(0,8)}`;await this.memory.set(r,i,{persist:!0,ttl:10080*60*1e3})}catch(r){console.debug("[AQELearningEngine] Failed to track pattern search:",y(r))}}enhanceRoutingWithPatterns(e,t){let i=t.filter(o=>o.similarity>=.5&&o.pattern.qualityScore>=.3);if(i.length===0)return e;let r=i.map(o=>{let u=o.pattern;return`[Pattern: ${u.name}] ${u.description} (confidence: ${(u.confidence*100).toFixed(0)}%, similarity: ${(o.similarity*100).toFixed(0)}%)`}),n=[...e.guidance,"--- Relevant Patterns ---",...r],a=[...e.patterns,...i.map(o=>o.pattern)],s=i.length>0?`; Found ${i.length} relevant pattern(s) with avg similarity ${(i.reduce((o,u)=>o+u.similarity,0)/i.length*100).toFixed(0)}%`:"";return{...e,patterns:a,guidance:n,reasoning:e.reasoning+s,confidence:Math.min(1,e.confidence+i.length*.02)}}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()}-${Z().slice(0,8)}`,n=r;if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{n=await this.claudeFlowBridge.trajectory.startTrajectory(e,t)}catch(o){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow startTrajectory failed (${this.claudeFlowErrors} total errors):`,y(o))}let a;this.experienceCapture&&(a=this.experienceCapture.startCapture(e,{agent:t,domain:i,trajectoryId:n!==r?n:void 0}));let s={id:a||n,task:e,agent:t,startedAt:Date.now(),steps:[]};return this.activeTasks.set(s.id,s),s.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/**"],u=await i.default(s,{cwd:e,ignore:o,onlyFiles:!0}),p=new Set,g=new Set;for(let m of u.slice(0,100))(m.endsWith(".ts")||m.endsWith(".tsx"))&&p.add("typescript"),(m.endsWith(".js")||m.endsWith(".jsx"))&&p.add("javascript"),m.endsWith(".py")&&p.add("python"),m.endsWith(".go")&&p.add("go"),m.endsWith(".rs")&&p.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(p),frameworks:Array.from(g),patterns:[],complexity:u.length>500?3:u.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}},de={enabled:!1,snapshotIntervalMs:3e5,minSnapshotsForAnalysis:5,autoApplyThreshold:.8},ee=class{config;constructor(e){this.config={...de,...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)),u=h(i.map(c=>c.tokenMetrics.savingsUsd)),p=h(r.map(c=>c.tokenMetrics.savingsUsd));if(o>s*1.1&&p<=u*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:F(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:F(.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)),te=h(i.map(c=>c.learningMetrics.averageConfidence)),$=h(r.map(c=>c.learningMetrics.averageConfidence)),ie=Math.abs(f-d),re=Math.abs($-te);ie<1&&re<.02&&n.push({id:`meta-ls-${a}`,type:"learning-stall",description:`Pattern count (~${Math.round(f)}) and confidence (~${$.toFixed(2)}) have stagnated`,confidence:F(.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)),A=h(r.map(c=>c.performanceMetrics.p95LatencyMs));if(A>C*1.2&&C>0){let c=Math.min(1,(A-C)/(C||1));n.push({id:`meta-pr-${a}`,type:"performance-regression",description:`P95 latency increased from ${C.toFixed(0)}ms to ${A.toFixed(0)}ms`,confidence:F(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 F(l){return Math.max(0,Math.min(1,l))}function pe(l,e,t){return new L(l,e,t)}function et(l,e,t){return pe(l,{projectRoot:e},t)}export{ue as a,L as b,de as c,ee as d,pe as e,et as f};
|
|
24
|
+
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){M.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 ue={enableClaudeFlow:!0,enableExperienceCapture:!0,enablePatternPromotion:!0,promotionThreshold:S},L=class{constructor(e,t,i){this.memory=e;this.eventBus=i;this.config={...ue,...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 U(G),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=_(this.memory,{promotionThreshold:this.config.promotionThreshold}),await this.patternStore.initialize(),this.reasoningBank=W(this.memory,this.eventBus,this.config.reasoningBank,this.coherenceService),await this.reasoningBank.initialize();try{let{getSharedRvfDualWriter:e}=await import("./shared-rvf-dual-writer-QRNLSDS7.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-L5KSYE2S.js");if(e()){let{createPersistentWitnessChain:t,createWitnessChainSQLitePersistence:i}=await import("./witness-chain-L5KSYE2S.js"),{getUnifiedPersistence:r}=await import("./unified-persistence-SQMP7A3O.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{isCrossDomainTransferEnabled:e}=await import("./feature-flags-6ALWBTHS.js");if(e()&&this.patternStore){let{createDomainTransferEngine:t}=await import("./domain-transfer-VZBWINQL.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=V({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});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=this.enhanceRoutingWithPatterns(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,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()}-${Z().slice(0,8)}`;await this.memory.set(r,i,{persist:!0,ttl:10080*60*1e3})}catch(r){console.debug("[AQELearningEngine] Failed to track pattern search:",y(r))}}enhanceRoutingWithPatterns(e,t){let i=t.filter(o=>o.similarity>=.5&&o.pattern.qualityScore>=.3);if(i.length===0)return e;let r=i.map(o=>{let u=o.pattern;return`[Pattern: ${u.name}] ${u.description} (confidence: ${(u.confidence*100).toFixed(0)}%, similarity: ${(o.similarity*100).toFixed(0)}%)`}),n=[...e.guidance,"--- Relevant Patterns ---",...r],a=[...e.patterns,...i.map(o=>o.pattern)],s=i.length>0?`; Found ${i.length} relevant pattern(s) with avg similarity ${(i.reduce((o,u)=>o+u.similarity,0)/i.length*100).toFixed(0)}%`:"";return{...e,patterns:a,guidance:n,reasoning:e.reasoning+s,confidence:Math.min(1,e.confidence+i.length*.02)}}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()}-${Z().slice(0,8)}`,n=r;if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{n=await this.claudeFlowBridge.trajectory.startTrajectory(e,t)}catch(o){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow startTrajectory failed (${this.claudeFlowErrors} total errors):`,y(o))}let a;this.experienceCapture&&(a=this.experienceCapture.startCapture(e,{agent:t,domain:i,trajectoryId:n!==r?n:void 0}));let s={id:a||n,task:e,agent:t,startedAt:Date.now(),steps:[]};return this.activeTasks.set(s.id,s),s.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/**"],u=await i.default(s,{cwd:e,ignore:o,onlyFiles:!0}),p=new Set,g=new Set;for(let m of u.slice(0,100))(m.endsWith(".ts")||m.endsWith(".tsx"))&&p.add("typescript"),(m.endsWith(".js")||m.endsWith(".jsx"))&&p.add("javascript"),m.endsWith(".py")&&p.add("python"),m.endsWith(".go")&&p.add("go"),m.endsWith(".rs")&&p.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(p),frameworks:Array.from(g),patterns:[],complexity:u.length>500?3:u.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}},de={enabled:!1,snapshotIntervalMs:3e5,minSnapshotsForAnalysis:5,autoApplyThreshold:.8},ee=class{config;constructor(e){this.config={...de,...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)),u=h(i.map(c=>c.tokenMetrics.savingsUsd)),p=h(r.map(c=>c.tokenMetrics.savingsUsd));if(o>s*1.1&&p<=u*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:F(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:F(.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)),te=h(i.map(c=>c.learningMetrics.averageConfidence)),$=h(r.map(c=>c.learningMetrics.averageConfidence)),ie=Math.abs(f-d),re=Math.abs($-te);ie<1&&re<.02&&n.push({id:`meta-ls-${a}`,type:"learning-stall",description:`Pattern count (~${Math.round(f)}) and confidence (~${$.toFixed(2)}) have stagnated`,confidence:F(.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)),A=h(r.map(c=>c.performanceMetrics.p95LatencyMs));if(A>C*1.2&&C>0){let c=Math.min(1,(A-C)/(C||1));n.push({id:`meta-pr-${a}`,type:"performance-regression",description:`P95 latency increased from ${C.toFixed(0)}ms to ${A.toFixed(0)}ms`,confidence:F(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 F(l){return Math.max(0,Math.min(1,l))}function pe(l,e,t){return new L(l,e,t)}function et(l,e,t){return pe(l,{projectRoot:e},t)}export{ue as a,L as b,de as c,ee as d,pe as e,et as f};
|
|
@@ -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.9.
|
|
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.9.19");process.exit(0)}
|
|
2
2
|
import{createRequire as t}from"module";var o=t(import.meta.url),e=o("@xenova/transformers"),n=e,{RuvectorLayer:i,TensorCompress:a,differentiableSearch:s,hierarchicalForward:c,getCompressionLevel:l,init:p,FlashAttention:m,DotProductAttention:u,MultiHeadAttention:d,HyperbolicAttention:A,LinearAttention:f,MoEAttention:h,SonaEngine:_,pipeline:v}=e||{};export{n as a,i as b,a as c,s as d,c as e,l as f,p as g,m as h,u as i,d as j,A as k,f as l,h as m,_ as n,v as o};
|
|
@@ -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.9.
|
|
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.9.19");process.exit(0)}
|
|
2
2
|
import{writeFileSync as p,readFileSync as m}from"node:fs";import{resolve as f,dirname as c,join as d}from"node:path";import{mkdirSync as g}from"node:fs";import{fileURLToPath as h}from"node:url";function $(){try{let e=typeof __dirname<"u"?__dirname:c(h(import.meta.url));for(let t=0;t<5;t++){let n=d(e,"package.json");try{let r=JSON.parse(m(n,"utf-8"));if(r.version)return r.version}catch{}e=c(e)}}catch{}return"unknown"}var T=["-F, --format <format>","Output format (text|json|sarif|junit|markdown)","text"],x=["-o, --output <path>","Write output to file instead of stdout"];function C(e,t,n){if(t){let r=f(t);g(c(r),{recursive:!0}),p(r,e,"utf-8"),n&&console.log(n),console.log(`Output written to: ${r}`)}else console.log(e)}function R(e){return JSON.stringify(e,null,2)}var v="https://raw.githubusercontent.com/oasis-tcs/sarif-spec/main/sarif-2.1/schema/sarif-schema-2.1.0.json";function w(e){let t=i=>{switch(i.toLowerCase()){case"critical":case"high":return"error";case"medium":return"warning";case"low":case"info":return"note";default:return"warning"}},n=new Map,r=[];for(let i of e.vulnerabilities){let o=i.ruleId||`AQE/${i.type.replace(/\s+/g,"-").toLowerCase()}`;n.has(o)||n.set(o,{id:o,name:i.type,shortDescription:i.type,...i.cweId?{helpUri:`https://cwe.mitre.org/data/definitions/${i.cweId.replace("CWE-","")}.html`}:{}}),r.push({ruleId:o,level:t(i.severity),message:{text:i.message},locations:[{physicalLocation:{artifactLocation:{uri:i.file,uriBaseId:"%SRCROOT%"},region:{startLine:i.line,startColumn:1}}}],...i.cweId?{taxa:[{id:i.cweId,toolComponent:{name:"CWE"}}]}:{}})}let s={$schema:v,version:"2.1.0",runs:[{tool:{driver:{name:"agentic-qe",version:$(),informationUri:"https://github.com/proffesor-for-testing/agentic-qe",rules:Array.from(n.values()).map(i=>({id:i.id,name:i.name,shortDescription:{text:i.shortDescription},...i.helpUri?{helpUri:i.helpUri}:{},defaultConfiguration:{level:"warning"}}))}},results:r,invocations:[{executionSuccessful:!0,commandLine:`aqe security --sast --format sarif -t ${e.target}`}]}]};return JSON.stringify(s,null,2)}function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function I(e){let t=e.tests||[],n=e.passed+e.failed+e.skipped,r=(e.duration/1e3).toFixed(3),s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
3
3
|
`;if(s+=`<testsuites tests="${n}" failures="${e.failed}" errors="0" time="${r}">
|
|
4
4
|
`,s+=` <testsuite name="aqe-test-run" tests="${n}" failures="${e.failed}" errors="0" skipped="${e.skipped}" time="${r}" id="${a(e.runId)}">
|