agentic-qe 3.8.13 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +48 -0
- package/dist/adapters/a2ui/integration/agui-sync.js +2 -1
- package/dist/audit/witness-chain.js +15 -3
- package/dist/boot/fast-paths.d.ts +24 -0
- package/dist/boot/fast-paths.js +43 -0
- package/dist/boot/parallel-prefetch.d.ts +26 -0
- package/dist/boot/parallel-prefetch.js +36 -0
- package/dist/cli/bundle.js +12 -9431
- package/dist/cli/chunks/adapter-WBR5NXS3.js +2 -0
- package/dist/cli/chunks/agent-booster-wasm-PQYB7VRU.js +2 -0
- package/dist/cli/chunks/agent-handler-QDAB5NQS.js +33 -0
- package/dist/cli/chunks/aqe-learning-engine-TK4JQCGT.js +2 -0
- package/dist/cli/chunks/audit-S7JUYYVP.js +3 -0
- package/dist/cli/chunks/base-2WXOSMBQ.js +2 -0
- package/dist/cli/chunks/better-sqlite3-7KY2RDXO.js +2 -0
- package/dist/cli/chunks/brain-handler-PPEGDCN4.js +68 -0
- package/dist/cli/chunks/branch-enumerator-XK4V5W7L.js +7 -0
- package/dist/cli/chunks/browser-PALA5PL3.js +4 -0
- package/dist/cli/chunks/browser-workflow-42F7GK5T.js +2 -0
- package/dist/cli/chunks/chunk-24FKIJNC.js +15 -0
- package/dist/cli/chunks/chunk-263XS447.js +2 -0
- package/dist/cli/chunks/chunk-2BZFNEN2.js +4 -0
- package/dist/cli/chunks/chunk-2E5NQNSU.js +180 -0
- package/dist/cli/chunks/chunk-2I7J3O6V.js +2 -0
- package/dist/cli/chunks/chunk-3ADGXLTM.js +14 -0
- package/dist/cli/chunks/chunk-3IHG3WOY.js +12 -0
- package/dist/cli/chunks/chunk-3IUNFTIF.js +2 -0
- package/dist/cli/chunks/chunk-3JPRUND5.js +2 -0
- package/dist/cli/chunks/chunk-3NZLZHJI.js +2 -0
- package/dist/cli/chunks/chunk-3THRQEZ2.js +95 -0
- package/dist/cli/chunks/chunk-3ZOONQG6.js +2 -0
- package/dist/cli/chunks/chunk-4B6NCELM.js +2 -0
- package/dist/cli/chunks/chunk-4I2IOUS4.js +2 -0
- package/dist/cli/chunks/chunk-4VBTXZRM.js +2 -0
- package/dist/cli/chunks/chunk-4VUPRTVX.js +3 -0
- package/dist/cli/chunks/chunk-4YOMLWEK.js +70 -0
- package/dist/cli/chunks/chunk-4YS3IJ45.js +2 -0
- package/dist/cli/chunks/chunk-5SKGFSKD.js +2 -0
- package/dist/cli/chunks/chunk-5T2ZQWKF.js +27 -0
- package/dist/cli/chunks/chunk-62ADTHV7.js +2 -0
- package/dist/cli/chunks/chunk-6EOS7KX2.js +2 -0
- package/dist/cli/chunks/chunk-6SVX4DJC.js +6 -0
- package/dist/cli/chunks/chunk-72WOAVK6.js +2 -0
- package/dist/cli/chunks/chunk-7R6YMLVS.js +3 -0
- package/dist/cli/chunks/chunk-7VDBAVTY.js +2 -0
- package/dist/cli/chunks/chunk-AFLLQ5PP.js +15 -0
- package/dist/cli/chunks/chunk-AKE543X2.js +2 -0
- package/dist/cli/chunks/chunk-B36CDR4U.js +2 -0
- package/dist/cli/chunks/chunk-B6LLWYQ6.js +2 -0
- package/dist/cli/chunks/chunk-BDIEMZ22.js +91 -0
- package/dist/cli/chunks/chunk-BGXNSCXX.js +4 -0
- package/dist/cli/chunks/chunk-BLBRY5UD.js +2 -0
- package/dist/cli/chunks/chunk-BPWXXEH2.js +3029 -0
- package/dist/cli/chunks/chunk-BR26T7ZS.js +180 -0
- package/dist/cli/chunks/chunk-BTREG4IW.js +2 -0
- package/dist/cli/chunks/chunk-BULKFVYX.js +2 -0
- package/dist/cli/chunks/chunk-BXAXGEFC.js +24 -0
- package/dist/cli/chunks/chunk-CL6POIX4.js +2 -0
- package/dist/cli/chunks/chunk-CS2KS7LP.js +2 -0
- package/dist/cli/chunks/chunk-CWFB6BSA.js +316 -0
- package/dist/cli/chunks/chunk-DRT3WKQW.js +2 -0
- package/dist/cli/chunks/chunk-EHDQJQ6Y.js +27 -0
- package/dist/cli/chunks/chunk-ESVQ6MEB.js +2 -0
- package/dist/cli/chunks/chunk-FEKY7T6Q.js +2 -0
- package/dist/cli/chunks/chunk-FGA7VIFR.js +7 -0
- package/dist/cli/chunks/chunk-FIA6X7UL.js +2 -0
- package/dist/cli/chunks/chunk-GAOJV3OX.js +2 -0
- package/dist/cli/chunks/chunk-GKNNSCLC.js +5 -0
- package/dist/cli/chunks/chunk-GPQ57KA4.js +2 -0
- package/dist/cli/chunks/chunk-GRUUQAR6.js +2 -0
- package/dist/cli/chunks/chunk-HRO6OZQD.js +2 -0
- package/dist/cli/chunks/chunk-HY6PMO5W.js +66 -0
- package/dist/cli/chunks/chunk-IAV2JMIX.js +167 -0
- package/dist/cli/chunks/chunk-IFNIIK34.js +21 -0
- package/dist/cli/chunks/chunk-IGJPMN4I.js +3 -0
- package/dist/cli/chunks/chunk-J3KWWR6Z.js +1 -0
- package/dist/cli/chunks/chunk-JBANAPWG.js +2 -0
- package/dist/cli/chunks/chunk-JJO7Y4H3.js +604 -0
- package/dist/cli/chunks/chunk-JRYGQO2W.js +2 -0
- package/dist/cli/chunks/chunk-JXM26HEE.js +2 -0
- package/dist/cli/chunks/chunk-JZSDOIXA.js +2 -0
- package/dist/cli/chunks/chunk-KP5NUODU.js +3 -0
- package/dist/cli/chunks/chunk-LHJQD2VU.js +750 -0
- package/dist/cli/chunks/chunk-LNQIY6BP.js +2 -0
- package/dist/cli/chunks/chunk-MDUHYUHF.js +2 -0
- package/dist/cli/chunks/chunk-MV6CMOJQ.js +65 -0
- package/dist/cli/chunks/chunk-MZOFWJTM.js +2 -0
- package/dist/cli/chunks/chunk-N2NS2PHA.js +45 -0
- package/dist/cli/chunks/chunk-N4TL73TH.js +314 -0
- package/dist/cli/chunks/chunk-N5UXCLFI.js +2 -0
- package/dist/cli/chunks/chunk-NZ2VCPN4.js +2 -0
- package/dist/cli/chunks/chunk-OF4D7MYI.js +2 -0
- package/dist/cli/chunks/chunk-OI5NGQO2.js +2 -0
- package/dist/cli/chunks/chunk-OLHKGP35.js +2 -0
- package/dist/cli/chunks/chunk-QOVHWZEP.js +1 -0
- package/dist/cli/chunks/chunk-RFSN6IDA.js +79 -0
- package/dist/cli/chunks/chunk-RTGGL7D7.js +4 -0
- package/dist/cli/chunks/chunk-RU5WAHB7.js +3 -0
- package/dist/cli/chunks/chunk-SUSEVMZT.js +2 -0
- package/dist/cli/chunks/chunk-TLHP5EII.js +2 -0
- package/dist/cli/chunks/chunk-TWUWL5EJ.js +2 -0
- package/dist/cli/chunks/chunk-U5RN7YQW.js +2 -0
- package/dist/cli/chunks/chunk-UFUVUO3J.js +2 -0
- package/dist/cli/chunks/chunk-UQHYFOBX.js +16 -0
- package/dist/cli/chunks/chunk-VOS4NQSF.js +2 -0
- package/dist/cli/chunks/chunk-VSVXUTJN.js +256 -0
- package/dist/cli/chunks/chunk-WBQSXPBI.js +2 -0
- package/dist/cli/chunks/chunk-WGMPEW2T.js +2 -0
- package/dist/cli/chunks/chunk-WIEC7VKK.js +2 -0
- package/dist/cli/chunks/chunk-WJ3DLOXF.js +14 -0
- package/dist/cli/chunks/chunk-X3KI6JOY.js +9 -0
- package/dist/cli/chunks/chunk-X5IJGWYG.js +2 -0
- package/dist/cli/chunks/chunk-XIBDETCS.js +146 -0
- package/dist/cli/chunks/chunk-XLRQYLWW.js +2 -0
- package/dist/cli/chunks/chunk-XO6PVK2P.js +3 -0
- package/dist/cli/chunks/chunk-XRE2HCWG.js +3 -0
- package/dist/cli/chunks/chunk-XT2V2322.js +2 -0
- package/dist/cli/chunks/chunk-Y7BHKZFJ.js +18 -0
- package/dist/cli/chunks/chunk-YAGODYIG.js +59 -0
- package/dist/cli/chunks/chunk-YANUP2RO.js +2 -0
- package/dist/cli/chunks/chunk-YPFOCNOE.js +30 -0
- package/dist/cli/chunks/chunk-YR6ZZGH7.js +81 -0
- package/dist/cli/chunks/chunk-YVA65UZL.js +2 -0
- package/dist/cli/chunks/chunk-YW2THB5Q.js +2 -0
- package/dist/cli/chunks/chunk-ZAPS3UGQ.js +20 -0
- package/dist/cli/chunks/chunk-ZDATDCYN.js +2 -0
- package/dist/cli/chunks/ci-J374KDLI.js +81 -0
- package/dist/cli/chunks/ci-output-7JN7F6CI.js +2 -0
- package/dist/cli/chunks/claude-flow-setup-245JLJCN.js +2 -0
- package/dist/cli/chunks/client-MCSNSH2C.js +2 -0
- package/dist/cli/chunks/cline-installer-LBA2M5N3.js +4 -0
- package/dist/cli/chunks/code-U4N4WONM.js +38 -0
- package/dist/cli/chunks/code-index-extractor-A57Z6BO4.js +3 -0
- package/dist/cli/chunks/codex-installer-UXMK2N4T.js +8 -0
- package/dist/cli/chunks/completions-W66BSCOE.js +1364 -0
- package/dist/cli/chunks/complexity-analyzer-AB4OZARV.js +2 -0
- package/dist/cli/chunks/continuedev-installer-LRFZ2SJM.js +14 -0
- package/dist/cli/chunks/copilot-installer-CQ3JYBIB.js +3 -0
- package/dist/cli/chunks/cost-tracker-4F723RB6.js +2 -0
- package/dist/cli/chunks/coverage-4PUEQXAY.js +27 -0
- package/dist/cli/chunks/cross-domain-router-OWR5IJ5G.js +2 -0
- package/dist/cli/chunks/cursor-installer-JZEDEDHA.js +3 -0
- package/dist/cli/chunks/daemon-B7TWGHXQ.js +19 -0
- package/dist/cli/chunks/dag-attention-scheduler-JWO6XI6A.js +2 -0
- package/dist/cli/chunks/detect-L6ZZHUSX.js +2 -0
- package/dist/cli/chunks/domain-handler-FT5FLZWL.js +25 -0
- package/dist/cli/chunks/domain-transfer-5Y4FGJAJ.js +2 -0
- package/dist/cli/chunks/dream-4TDBIYED.js +2 -0
- package/dist/cli/chunks/esm-node-2PKHKOTS.js +2 -0
- package/dist/cli/chunks/eval-GHMPFGWV.js +15 -0
- package/dist/cli/chunks/fast-paths-B3R647KN.js +2 -0
- package/dist/cli/chunks/feature-flags-DWS7ARSX.js +2 -0
- package/dist/cli/chunks/feature-flags-IVQ3AL4Q.js +2 -0
- package/dist/cli/chunks/file-discovery-QFPA6GMV.js +2 -0
- package/dist/cli/chunks/fleet-EKOKMOMW.js +43 -0
- package/dist/cli/chunks/gnn-wrapper-OYC55N5E.js +2 -0
- package/dist/cli/chunks/heartbeat-handler-MBBS4IBU.js +48 -0
- package/dist/cli/chunks/heartbeat-scheduler-XDGMOT7X.js +2 -0
- package/dist/cli/chunks/hnsw-index-YO7CT23I.js +2 -0
- package/dist/cli/chunks/hnswlib-node-56YWVXFE.js +2 -0
- package/dist/cli/chunks/hooks-L5VLZGEK.js +101 -0
- package/dist/cli/chunks/hypergraph-engine-A4Y2ZRAG.js +2 -0
- package/dist/cli/chunks/hypergraph-handler-3HDGB5SZ.js +35 -0
- package/dist/cli/chunks/impact-analyzer-UEIGXSZ4.js +2 -0
- package/dist/cli/chunks/init-handler-JDET6WUN.js +68 -0
- package/dist/cli/chunks/init-wizard-JWZUGIPJ.js +2 -0
- package/dist/cli/chunks/kernel-YNDTVKIW.js +2 -0
- package/dist/cli/chunks/kilocode-installer-GZZG5AFW.js +4 -0
- package/dist/cli/chunks/kiro-installer-IWNY5TKH.js +74 -0
- package/dist/cli/chunks/knowledge-graph-NGJKFTSN.js +2 -0
- package/dist/cli/chunks/learning-722ZNSZ6.js +107 -0
- package/dist/cli/chunks/llm-router-DNAV746L.js +30 -0
- package/dist/cli/chunks/load-Y3GCUFM4.js +2 -0
- package/dist/cli/chunks/load-test-GZUBXFF3.js +2 -0
- package/dist/cli/chunks/mcp-LKPIBZ3W.js +2 -0
- package/dist/cli/chunks/memory-L57MLFOP.js +32 -0
- package/dist/cli/chunks/memory-backend-3NQIZUXE.js +2 -0
- package/dist/cli/chunks/memory-handlers-MDZQ7HVW.js +2 -0
- package/dist/cli/chunks/opencode-installer-4HUB36H5.js +3 -0
- package/dist/cli/chunks/orchestrator-QHSBB2UC.js +371 -0
- package/dist/cli/chunks/pipeline-D3QER35Z.js +19 -0
- package/dist/cli/chunks/platform-T4E7Q3RD.js +2 -0
- package/dist/cli/chunks/plugin-JHW2YPRC.js +27 -0
- package/dist/cli/chunks/prime-radiant-advanced-wasm-G7CFNNQV.js +2 -0
- package/dist/cli/chunks/protocol-executor-SPUVRDWT.js +2 -0
- package/dist/cli/chunks/protocol-handler-2BQQ4HDM.js +20 -0
- package/dist/cli/chunks/prove-UQ6JFT73.js +3 -0
- package/dist/cli/chunks/qe-reasoning-bank-3HBK2FVD.js +2 -0
- package/dist/cli/chunks/quality-JRZYMC77.js +7 -0
- package/dist/cli/chunks/queen-coordinator-RW3NKO5A.js +2 -0
- package/dist/cli/chunks/real-embeddings-GK63VF35.js +2 -0
- package/dist/cli/chunks/roocode-installer-F4E2LAYR.js +4 -0
- package/dist/cli/chunks/router-RJGHWDQ3.js +2 -0
- package/dist/cli/chunks/routing-feedback-ZXBXFKX6.js +2 -0
- package/dist/cli/chunks/routing-handler-VNKFUUGB.js +20 -0
- package/dist/cli/chunks/ruvector-commands-2TLNHC3A.js +8 -0
- package/dist/cli/chunks/rvf-dual-writer-MQW2SJLT.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-LKFKTMUN.js +2 -0
- package/dist/cli/chunks/safe-db-G22E5ROA.js +2 -0
- package/dist/cli/chunks/schedule-Y7VVCPYV.js +2 -0
- package/dist/cli/chunks/scheduler-AUQIFQB7.js +2 -0
- package/dist/cli/chunks/security-EBEG2OPU.js +14 -0
- package/dist/cli/chunks/shared-rvf-dual-writer-BVSCQAFS.js +2 -0
- package/dist/cli/chunks/sqlite-persistence-JAVHUGGL.js +2 -0
- package/dist/cli/chunks/status-handler-VZ32M4G4.js +45 -0
- package/dist/cli/chunks/structural-health-K6LRCKV6.js +2 -0
- package/dist/cli/chunks/sync-MHSHNLIM.js +23 -0
- package/dist/cli/chunks/task-handler-JNOIBZ2G.js +49 -0
- package/dist/cli/chunks/task-handlers-P5DSUKND.js +2 -0
- package/dist/cli/chunks/test-DO22BNIL.js +33 -0
- package/dist/cli/chunks/test-scheduling-VLRQZEFL.js +15 -0
- package/dist/cli/chunks/token-bootstrap-4VJKGVMK.js +2 -0
- package/dist/cli/chunks/token-usage-LG3PXRXH.js +25 -0
- package/dist/cli/chunks/transformers-GY7SIKEU.js +2 -0
- package/dist/cli/chunks/tree-sitter-wasm-parser-FT2KB66N.js +2 -0
- package/dist/cli/chunks/types-QJGNBKP2.js +2 -0
- package/dist/cli/chunks/unified-memory-XYGENQUT.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-MVEGQBF3.js +2 -0
- package/dist/cli/chunks/unified-persistence-PFRCWEUG.js +2 -0
- package/dist/cli/chunks/validate-VQCRSVNQ.js +21 -0
- package/dist/cli/chunks/validate-swarm-A5DHAWTP.js +14 -0
- package/dist/cli/chunks/vibium-RZBSL4EB.js +2 -0
- package/dist/cli/chunks/visual-security-V47BLGJM.js +2 -0
- package/dist/cli/chunks/web-tree-sitter-7C4NXEOF.js +2 -0
- package/dist/cli/chunks/windsurf-installer-ES3KPQG3.js +7 -0
- package/dist/cli/chunks/witness-chain-BR63P4A7.js +2 -0
- package/dist/cli/chunks/workflow-JETHX4ML.js +51 -0
- package/dist/cli/chunks/workflow-orchestrator-7PZMX3JZ.js +2 -0
- package/dist/cli/chunks/wrappers-WP5RH745.js +2 -0
- package/dist/cli/commands/daemon.d.ts +13 -0
- package/dist/cli/commands/daemon.js +224 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +2 -1
- package/dist/cli/commands/plugin.d.ts +12 -0
- package/dist/cli/commands/plugin.js +135 -0
- package/dist/cli/commands/workflow.d.ts +10 -0
- package/dist/cli/commands/workflow.js +587 -0
- package/dist/cli/handlers/brain-handler.js +13 -8
- package/dist/cli/handlers/heartbeat-handler.d.ts +1 -0
- package/dist/cli/handlers/heartbeat-handler.js +20 -10
- package/dist/cli/handlers/hypergraph-handler.js +3 -3
- package/dist/cli/handlers/init-handler.js +10 -9
- package/dist/cli/handlers/interfaces.d.ts +4 -4
- package/dist/cli/index.js +159 -638
- package/dist/cli/lazy-registry.d.ts +27 -0
- package/dist/cli/lazy-registry.js +70 -0
- package/dist/context/compaction/context-budget.d.ts +71 -0
- package/dist/context/compaction/context-budget.js +120 -0
- package/dist/context/compaction/index.d.ts +96 -0
- package/dist/context/compaction/index.js +259 -0
- package/dist/context/compaction/llm-caller-adapter.d.ts +14 -0
- package/dist/context/compaction/llm-caller-adapter.js +47 -0
- package/dist/context/compaction/tier1-microcompact.d.ts +33 -0
- package/dist/context/compaction/tier1-microcompact.js +47 -0
- package/dist/context/compaction/tier2-session-summary.d.ts +72 -0
- package/dist/context/compaction/tier2-session-summary.js +172 -0
- package/dist/context/compaction/tier3-llm-compact.d.ts +65 -0
- package/dist/context/compaction/tier3-llm-compact.js +166 -0
- package/dist/context/compaction/tier4-reactive.d.ts +54 -0
- package/dist/context/compaction/tier4-reactive.js +129 -0
- package/dist/coordination/consensus/providers/claude-provider.d.ts +1 -0
- package/dist/coordination/consensus/providers/claude-provider.js +23 -3
- package/dist/domains/test-generation/generators/base-test-generator.d.ts +1 -1
- package/dist/domains/test-generation/generators/base-test-generator.js +11 -11
- package/dist/domains/test-generation/generators/go-test-generator.js +12 -12
- package/dist/domains/test-generation/generators/junit5-generator.js +9 -9
- package/dist/domains/test-generation/generators/kotlin-junit-generator.js +10 -10
- package/dist/domains/test-generation/generators/pytest-generator.js +8 -8
- package/dist/domains/test-generation/generators/swift-testing-generator.js +8 -8
- package/dist/domains/test-generation/generators/test-value-helpers.d.ts +20 -0
- package/dist/domains/test-generation/generators/test-value-helpers.js +48 -0
- package/dist/domains/test-generation/generators/xunit-generator.js +11 -11
- package/dist/hooks/cross-phase-hooks.d.ts +11 -0
- package/dist/hooks/cross-phase-hooks.js +73 -9
- package/dist/hooks/security/config-snapshot.d.ts +21 -0
- package/dist/hooks/security/config-snapshot.js +33 -0
- package/dist/hooks/security/exit-codes.d.ts +28 -0
- package/dist/hooks/security/exit-codes.js +33 -0
- package/dist/hooks/security/index.d.ts +15 -0
- package/dist/hooks/security/index.js +15 -0
- package/dist/hooks/security/ssrf-guard.d.ts +25 -0
- package/dist/hooks/security/ssrf-guard.js +69 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -2
- package/dist/init/init-wizard-hooks.js +15 -1
- package/dist/init/phases/07-hooks.js +2 -2
- package/dist/init/settings-merge.js +3 -7
- package/dist/kernel/kernel.js +35 -0
- package/dist/kernel/memory-backend.js +3 -1
- package/dist/mcp/bundle.js +416 -362
- package/dist/mcp/entry.js +132 -77
- package/dist/mcp/http-server.js +4 -1
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +5 -4
- package/dist/mcp/middleware/batch-executor.d.ts +46 -0
- package/dist/mcp/middleware/batch-executor.js +150 -0
- package/dist/mcp/middleware/microcompact.d.ts +97 -0
- package/dist/mcp/middleware/microcompact.js +179 -0
- package/dist/mcp/middleware/middleware-chain.d.ts +37 -0
- package/dist/mcp/middleware/middleware-chain.js +60 -0
- package/dist/mcp/protocol-server.d.ts +16 -0
- package/dist/mcp/protocol-server.js +140 -36
- package/dist/mcp/services/session-durability-middleware.d.ts +22 -0
- package/dist/mcp/services/session-durability-middleware.js +64 -0
- package/dist/mcp/services/session-resume.d.ts +29 -0
- package/dist/mcp/services/session-resume.js +221 -0
- package/dist/mcp/services/session-store.d.ts +84 -0
- package/dist/mcp/services/session-store.js +163 -0
- package/dist/mcp/tool-registry.d.ts +9 -0
- package/dist/mcp/tool-registry.js +30 -1
- package/dist/mcp/types.d.ts +1 -0
- package/dist/plugins/cache.d.ts +44 -0
- package/dist/plugins/cache.js +149 -0
- package/dist/plugins/index.d.ts +15 -0
- package/dist/plugins/index.js +15 -0
- package/dist/plugins/lifecycle.d.ts +67 -0
- package/dist/plugins/lifecycle.js +175 -0
- package/dist/plugins/manifest.d.ts +45 -0
- package/dist/plugins/manifest.js +173 -0
- package/dist/plugins/resolver.d.ts +37 -0
- package/dist/plugins/resolver.js +80 -0
- package/dist/plugins/security.d.ts +23 -0
- package/dist/plugins/security.js +125 -0
- package/dist/plugins/sources/github.d.ts +17 -0
- package/dist/plugins/sources/github.js +77 -0
- package/dist/plugins/sources/local.d.ts +20 -0
- package/dist/plugins/sources/local.js +32 -0
- package/dist/plugins/sources/npm.d.ts +18 -0
- package/dist/plugins/sources/npm.js +82 -0
- package/dist/shared/llm/retry.d.ts +5 -2
- package/dist/shared/llm/retry.js +7 -3
- package/dist/shared/prompt-cache-latch.d.ts +41 -0
- package/dist/shared/prompt-cache-latch.js +63 -0
- package/dist/shared/retry-engine.d.ts +77 -0
- package/dist/shared/retry-engine.js +194 -0
- package/dist/workers/daemon.d.ts +8 -0
- package/dist/workers/daemon.js +13 -0
- package/dist/workers/quality-daemon/ci-monitor.d.ts +55 -0
- package/dist/workers/quality-daemon/ci-monitor.js +147 -0
- package/dist/workers/quality-daemon/coverage-delta.d.ts +72 -0
- package/dist/workers/quality-daemon/coverage-delta.js +135 -0
- package/dist/workers/quality-daemon/git-watcher.d.ts +51 -0
- package/dist/workers/quality-daemon/git-watcher.js +209 -0
- package/dist/workers/quality-daemon/index.d.ts +119 -0
- package/dist/workers/quality-daemon/index.js +343 -0
- package/dist/workers/quality-daemon/nightly-consolidation.d.ts +74 -0
- package/dist/workers/quality-daemon/nightly-consolidation.js +136 -0
- package/dist/workers/quality-daemon/notification-service.d.ts +67 -0
- package/dist/workers/quality-daemon/notification-service.js +178 -0
- package/dist/workers/quality-daemon/persistent-memory.d.ts +31 -0
- package/dist/workers/quality-daemon/persistent-memory.js +30 -0
- package/dist/workers/quality-daemon/priority-queue.d.ts +97 -0
- package/dist/workers/quality-daemon/priority-queue.js +126 -0
- package/dist/workers/quality-daemon/test-suggester.d.ts +50 -0
- package/dist/workers/quality-daemon/test-suggester.js +121 -0
- package/dist/workers/worker-manager.js +2 -1
- package/package.json +1 -1
- package/dist/mcp/server.d.ts +0 -46
- package/dist/mcp/server.js +0 -802
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
3
|
+
import{a as U,b as Q}from"./chunk-GKNNSCLC.js";import{g as j}from"./chunk-N4TL73TH.js";import"./chunk-YPFOCNOE.js";import"./chunk-VSVXUTJN.js";import"./chunk-X5IJGWYG.js";import{a as S,b as z,c as F}from"./chunk-ZAPS3UGQ.js";import"./chunk-J3KWWR6Z.js";import"./chunk-EHDQJQ6Y.js";import"./chunk-MV6CMOJQ.js";import"./chunk-JRYGQO2W.js";import"./chunk-4YS3IJ45.js";import{a as L}from"./chunk-24FKIJNC.js";import"./chunk-YW2THB5Q.js";import"./chunk-3ZOONQG6.js";import"./chunk-SUSEVMZT.js";import{f as E,o as O}from"./chunk-JJO7Y4H3.js";import"./chunk-N2NS2PHA.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import{b as M,d as oe}from"./chunk-WGMPEW2T.js";import"./chunk-JZSDOIXA.js";import"./chunk-263XS447.js";import"./chunk-MDUHYUHF.js";import"./chunk-GAOJV3OX.js";import"./chunk-62ADTHV7.js";import"./chunk-DRT3WKQW.js";import"./chunk-UFUVUO3J.js";import"./chunk-7VDBAVTY.js";import"./chunk-B36CDR4U.js";import"./chunk-2I7J3O6V.js";import"./chunk-4I2IOUS4.js";import{Command as ge}from"commander";import A from"chalk";import V from"node:path";O();import{randomUUID as se}from"crypto";import I from"chalk";var v="dream-scheduler:hook-state",G=36e5,J=20,W=3e5;async function N(r){try{let e=await r.get(v);if(!e)return{triggered:!1,reason:"no-state"};let t=Date.now(),o=e.lastDreamTime?new Date(e.lastDreamTime).getTime():0,n=t-o;if(n<W)return{triggered:!1,reason:"too-soon"};let s=n>=G,a=e.experienceCount>=J;if(!s&&!a)return{triggered:!1,reason:"conditions-not-met"};let c=s?"time-interval":"experience-threshold";console.log(I.dim(`[hooks] Dream trigger: ${c} (${e.experienceCount} experiences, ${Math.round(n/6e4)}min since last dream)`));let{createDreamEngine:i}=await import("./dream-4TDBIYED.js"),{createQEReasoningBank:h}=await import("./qe-reasoning-bank-3HBK2FVD.js"),u=i({maxDurationMs:1e4,minConceptsRequired:3});await u.initialize();let k=h(r,void 0,{enableLearning:!0,enableGuidance:!1,enableRouting:!1,embeddingDimension:384,useONNXEmbeddings:!0});await k.initialize();let p=await k.searchPatterns("",{limit:100,minConfidence:.3});if(p.success&&p.value.length>0){let R=p.value.map($=>({id:$.pattern.id,name:$.pattern.name,description:$.pattern.description||`${$.pattern.patternType} pattern`,domain:$.pattern.qeDomain||"learning-optimization",patternType:$.pattern.patternType,confidence:$.pattern.confidence,successRate:$.pattern.successRate||.5}));await u.loadPatternsAsConcepts(R)}let f=await u.dream(1e4);return e.lastDreamTime=new Date().toISOString(),e.experienceCount=0,e.totalDreamsThisSession++,await r.set(v,e),await u.close(),{triggered:!0,reason:c,insightsGenerated:f.insights.length}}catch(e){return console.error(I.dim(`[hooks] Dream trigger failed: ${e instanceof Error?e.message:"unknown"}`)),{triggered:!1,reason:"error"}}}async function D(r){try{let e=await r.get(v);return e||(e={lastDreamTime:null,experienceCount:0,sessionStartTime:new Date().toISOString(),totalDreamsThisSession:0}),e.experienceCount++,await r.set(v,e),e.experienceCount}catch{return 0}}async function P(r){try{let{getUnifiedMemory:e}=await import("./unified-memory-XYGENQUT.js"),t=e();t.isInitialized()||await t.initialize();let o=t.getDatabase(),n=`cli-${Date.now()}-${se().slice(0,8)}`,s=r.durationMs||0,a;if(r.success){let c=s>0&&s<5e3?.1:0,i=r.source.includes("post-task")?.1:r.source.includes("post-edit")?.05:0;a=Math.min(.95,.7+c+i)}else{let c=r.source.includes("post-task")?.15:r.source.includes("post-edit")?.1:0;a=Math.min(.6,.3+c)}o.prepare(`
|
|
4
|
+
INSERT OR REPLACE INTO captured_experiences
|
|
5
|
+
(id, task, agent, domain, success, quality, duration_ms,
|
|
6
|
+
started_at, completed_at, source)
|
|
7
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, datetime('now'), datetime('now'), ?)
|
|
8
|
+
`).run(n,r.task.slice(0,500),r.agent,r.domain,r.success?1:0,a,s,r.source)}catch(e){console.error(I.dim(`[hooks] persistCommandExperience: ${e instanceof Error?e.message:"unknown"}`))}}async function B(){let{getUnifiedMemory:r}=await import("./unified-memory-XYGENQUT.js"),e=r();e.isInitialized()||await e.initialize();let t=e.getDatabase(),o=new Set(t.prepare("PRAGMA table_info(captured_experiences)").all().map(i=>i.name)),n=[["consolidated_into","TEXT DEFAULT NULL"],["consolidation_count","INTEGER DEFAULT 1"],["quality_updated_at","TEXT DEFAULT NULL"],["reuse_success_count","INTEGER DEFAULT 0"],["reuse_failure_count","INTEGER DEFAULT 0"]];for(let[i,h]of n)o.has(i)||t.exec(`ALTER TABLE captured_experiences ADD COLUMN ${i} ${h}`);let s=t.prepare(`
|
|
9
|
+
SELECT
|
|
10
|
+
domain,
|
|
11
|
+
agent,
|
|
12
|
+
COUNT(*) as cnt,
|
|
13
|
+
AVG(quality) as avg_quality,
|
|
14
|
+
SUM(success) as successes,
|
|
15
|
+
CAST(SUM(success) AS REAL) / COUNT(*) as success_rate,
|
|
16
|
+
AVG(duration_ms) as avg_duration,
|
|
17
|
+
GROUP_CONCAT(DISTINCT source) as sources
|
|
18
|
+
FROM captured_experiences
|
|
19
|
+
WHERE application_count = 0
|
|
20
|
+
AND agent != 'cli-hook'
|
|
21
|
+
GROUP BY domain, agent
|
|
22
|
+
HAVING cnt >= 3 AND avg_quality >= 0.5 AND success_rate >= 0.6
|
|
23
|
+
ORDER BY avg_quality DESC
|
|
24
|
+
LIMIT 50
|
|
25
|
+
`).all();if(s.length===0)return 0;let{v4:a}=await import("./esm-node-2PKHKOTS.js"),c=0;for(let i of s)try{let h=new Date().toISOString().slice(0,7),u=`${i.agent}-${i.domain}-${h}`,k=t.prepare(`
|
|
26
|
+
SELECT id FROM qe_patterns
|
|
27
|
+
WHERE qe_domain = ? AND name = ?
|
|
28
|
+
LIMIT 1
|
|
29
|
+
`).get(i.domain,u);if(k)t.prepare(`
|
|
30
|
+
UPDATE qe_patterns
|
|
31
|
+
SET usage_count = usage_count + ?,
|
|
32
|
+
successful_uses = successful_uses + ?,
|
|
33
|
+
confidence = MIN(0.99, confidence + 0.01),
|
|
34
|
+
quality_score = MIN(0.99, quality_score + 0.005),
|
|
35
|
+
updated_at = datetime('now')
|
|
36
|
+
WHERE id = ?
|
|
37
|
+
`).run(i.cnt,i.successes,k.id);else{let p=a(),f=Math.min(.95,i.avg_quality*.8+i.success_rate*.2),R=f*.3+Math.min(i.cnt,100)/100*.2+i.success_rate*.5;t.prepare(`
|
|
38
|
+
INSERT INTO qe_patterns (
|
|
39
|
+
id, pattern_type, qe_domain, domain, name, description,
|
|
40
|
+
confidence, usage_count, success_rate, quality_score, tier,
|
|
41
|
+
template_json, context_json, created_at, successful_uses
|
|
42
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now'), ?)
|
|
43
|
+
`).run(p,"workflow",i.domain,i.domain,u,`Auto-consolidated from ${i.cnt} experiences. Agent: ${i.agent}, success rate: ${(i.success_rate*100).toFixed(0)}%`,f,i.cnt,i.success_rate,R,"short-term",JSON.stringify({type:"workflow",content:`${i.agent} pattern for ${i.domain}`,variables:[]}),JSON.stringify({tags:(i.sources||"").split(","),sourceType:"session-consolidation",extractedAt:new Date().toISOString()}),i.successes),c++}t.prepare(`
|
|
44
|
+
UPDATE captured_experiences
|
|
45
|
+
SET application_count = application_count + 1
|
|
46
|
+
WHERE domain = ? AND agent = ? AND application_count = 0
|
|
47
|
+
`).run(i.domain,i.agent)}catch{}return c}var d={reasoningBank:null,hookRegistry:null,coherenceService:null,sessionId:null,initialized:!1,initializationPromise:null};async function g(){if(d.initializationPromise&&await d.initializationPromise,d.initialized&&d.reasoningBank&&d.hookRegistry)return{reasoningBank:d.reasoningBank,hookRegistry:d.hookRegistry};if(d.initializationPromise=re(),await d.initializationPromise,d.initializationPromise=null,!d.reasoningBank||!d.hookRegistry)throw new Error("Failed to initialize hooks system");return{reasoningBank:d.reasoningBank,hookRegistry:d.hookRegistry}}async function re(){if(!d.initialized)try{let r=E(),e=V.join(r,".agentic-qe"),t=await T(e);try{d.coherenceService=await U(Q),console.log(A.dim("[hooks] CoherenceService initialized with WASM engines"))}catch(a){console.log(A.dim(`[hooks] CoherenceService WASM unavailable, using fallback: ${a instanceof Error?a.message:"unknown"}`))}d.reasoningBank=j(t,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0},d.coherenceService??void 0);let o=1e4,n=d.reasoningBank.initialize(),s=new Promise((a,c)=>setTimeout(()=>c(new Error("ReasoningBank init timeout")),o));await Promise.race([n,s]);try{let{getSharedRvfDualWriter:a}=await import("./shared-rvf-dual-writer-BVSCQAFS.js"),c=await a();c&&d.reasoningBank.setRvfDualWriter(c)}catch(a){process.env.DEBUG&&console.debug("[hooks] RVF wiring skipped:",a instanceof Error?a.message:a)}d.hookRegistry=F(d.reasoningBank),d.initialized=!0,console.log(A.dim("[hooks] System initialized"))}catch(r){console.warn(A.yellow(`[hooks] Using fallback mode: ${r instanceof Error?r.message:"unknown error"}`));let e=ie();d.reasoningBank=j(e,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0}),d.hookRegistry=new z,d.hookRegistry.initialize(d.reasoningBank),d.initialized=!0}}async function T(r){let t=new L({sqlite:{path:V.join(r,"memory.db"),walMode:!0,poolSize:3,busyTimeout:5e3},enableFallback:!0,defaultNamespace:"qe-patterns"}),o=t.initialize(),n=new Promise((s,a)=>setTimeout(()=>a(new Error("Backend init timeout")),5e3));return await Promise.race([o,n]),t}function ie(){let r=new Map;return{initialize:async()=>{},dispose:async()=>{r.clear()},get:async e=>{let t=r.get(e);return t?t.value:void 0},set:async(e,t,o)=>{r.set(e,{value:t})},delete:async e=>r.delete(e),has:async e=>r.has(e),search:async(e,t)=>{let o=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(o.replace(/\*/g,".*"));return Array.from(r.keys()).filter(s=>n.test(s))},vectorSearch:async(e,t)=>[],storeVector:async(e,t,o)=>{},count:async e=>{let t=0,o=`${e}:`;for(let n of r.keys())n.startsWith(o)&&t++;return t},hasCodeIntelligenceIndex:async()=>{let e="code-intelligence:kg:";for(let t of r.keys())if(t.startsWith(e))return!0;return!1}}}function m(r){console.log(JSON.stringify(r,null,2))}function b(r){console.log(A.green("\u2713"),r)}function y(r){console.error(A.red("\u2717"),r)}function C(r){if(r.length===0){console.log(A.dim(" No specific guidance"));return}r.forEach((e,t)=>{console.log(A.cyan(` ${t+1}.`),e)})}import _ from"chalk";import ae from"node:path";O();function Z(r){r.command("pre-edit").description("Get context and guidance before editing a file").requiredOption("-f, --file <path>","File path to edit").option("-o, --operation <type>","Operation type: create, update, delete, refactor","update").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await g(),n=(await t.emit(S.PreTestGeneration,{targetFile:e.file,testType:"unit",operation:e.operation}))[0]||{success:!0,guidance:[],routing:null};if(e.json){let s=n.guidance||[],c=[n.routing?.recommendedAgent?`Recommended agent: ${n.routing.recommendedAgent} (${(n.routing.confidence*100).toFixed(0)}% confidence).`:"",...s.map(i=>i)].filter(Boolean).join(" ");m({hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:c||void 0},file:e.file,operation:e.operation,patterns:n.routing?.patterns?.length||0})}else console.log(_.bold(`
|
|
48
|
+
\u{1F4DD} Pre-Edit Analysis`)),console.log(_.dim(` File: ${e.file}`)),console.log(_.dim(` Operation: ${e.operation}`)),n.routing&&(console.log(_.bold(`
|
|
49
|
+
\u{1F3AF} Recommended Agent:`),_.cyan(n.routing.recommendedAgent)),console.log(_.dim(` Confidence: ${(n.routing.confidence*100).toFixed(1)}%`))),console.log(_.bold(`
|
|
50
|
+
\u{1F4A1} Guidance:`)),C(n.guidance||[]);return}catch(t){throw y(`pre-edit failed: ${t instanceof Error?t.message:"unknown"}`),t}}),r.command("post-edit").description("Record editing outcome for pattern learning").requiredOption("-f, --file <path>","File path that was edited").option("--success","Edit was successful").option("--failure","Edit failed").option("--pattern-id <id>","Pattern ID that was applied").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await g(),o=e.success||!e.failure,n=e.file||"",s=n.split("/").pop()||"unknown",c=/\.(test|spec)\.(ts|js|tsx|jsx)$/.test(s)?"test-generation":"code-intelligence",i=e.patternId||`edit:${c}:${s}`,u=(await t.emit(S.PostTestGeneration,{targetFile:e.file,success:o,patternId:i,generatedTests:null,testCount:0}))[0]||{success:!0,patternsLearned:0};try{let{reasoningBank:p}=await g();await p.recordOutcome({patternId:i,success:o,metrics:{executionTimeMs:0},feedback:`Edit ${o?"succeeded":"failed"}: ${n}`})}catch{}try{await P({task:`edit: ${n}`,agent:"cli-hook",domain:c,success:o,source:"cli-hook-post-edit"})}catch{}let k=!1;try{let p=E(),f=ae.join(p,".agentic-qe"),R=await T(f);await D(R)}catch{}e.json?m({success:!0,file:e.file,editSuccess:o,patternsLearned:u.patternsLearned||0,dreamTriggered:k}):(b(`Recorded edit outcome for ${e.file}`),u.patternsLearned&&console.log(_.green(` Patterns learned: ${u.patternsLearned}`)));return}catch(t){throw y(`post-edit failed: ${t instanceof Error?t.message:"unknown"}`),t}})}O();import{randomUUID as ce}from"crypto";import w from"chalk";import de from"node:path";function K(r){r.command("route").description("Route a task to the optimal QE agent").requiredOption("-t, --task <description>","Task description").option("-d, --domain <domain>","Target QE domain hint").option("-c, --capabilities <caps...>","Required capabilities").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await g(),o={task:e.task,domain:e.domain,capabilities:e.capabilities},n=await t.routeTask(o);if(!n.success)throw new Error(n.error.message);let s=n.value;e.json?m({recommendedAgent:s.recommendedAgent,confidence:s.confidence,alternatives:s.alternatives,domains:s.domains,patternCount:s.patterns.length,guidance:s.guidance,reasoning:s.reasoning}):(console.log(w.bold(`
|
|
51
|
+
\u{1F3AF} Task Routing Result`)),console.log(w.dim(` Task: "${e.task}"`)),console.log(w.bold(`
|
|
52
|
+
\u{1F464} Recommended Agent:`),w.cyan(s.recommendedAgent)),console.log(w.dim(` Confidence: ${(s.confidence*100).toFixed(1)}%`)),s.alternatives.length>0&&(console.log(w.bold(`
|
|
53
|
+
\u{1F504} Alternatives:`)),s.alternatives.forEach(a=>{console.log(w.dim(` - ${a.agent}: ${(a.score*100).toFixed(1)}%`))})),console.log(w.bold(`
|
|
54
|
+
\u{1F4C2} Detected Domains:`),s.domains.join(", ")),console.log(w.bold(`
|
|
55
|
+
\u{1F4A1} Guidance:`)),C(s.guidance),console.log(w.bold(`
|
|
56
|
+
\u{1F4D6} Reasoning:`),w.dim(s.reasoning)));try{let{getUnifiedMemory:a}=await import("./unified-memory-XYGENQUT.js"),c=a();c.isInitialized()||await c.initialize();let i=c.getDatabase(),h=`route-${Date.now()}-${ce().slice(0,8)}`;i.prepare(`
|
|
57
|
+
INSERT OR REPLACE INTO routing_outcomes (
|
|
58
|
+
id, task_json, decision_json, used_agent,
|
|
59
|
+
followed_recommendation, success, quality_score,
|
|
60
|
+
duration_ms, error
|
|
61
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
62
|
+
`).run(h,JSON.stringify({description:e.task,domain:e.domain}),JSON.stringify({recommended:s.recommendedAgent,confidence:s.confidence,alternatives:s.alternatives}),s.recommendedAgent,1,1,s.confidence,0,null);let u=E(),k=de.join(u,".agentic-qe"),p=await T(k);await D(p)}catch(a){console.error(w.dim(`[hooks] route persist: ${a instanceof Error?a.message:"unknown"}`))}return}catch(t){throw y(`route failed: ${t instanceof Error?t.message:"unknown"}`),t}})}import l from"chalk";oe();function X(r){r.command("stats").description("Display hooks system statistics").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await g(),o=await t.getStats();if(e.json)m(o);else{console.log(l.bold(`
|
|
63
|
+
\u{1F4CA} Hooks System Statistics
|
|
64
|
+
`)),console.log(l.bold("Patterns:")),console.log(` Total: ${l.cyan(o.totalPatterns)}`),console.log(` Short-term: ${o.patternStoreStats.byTier.shortTerm}`),console.log(` Long-term: ${o.patternStoreStats.byTier.longTerm}`),console.log(l.bold(`
|
|
65
|
+
By Domain:`));for(let[n,s]of Object.entries(o.byDomain))s>0&&console.log(` ${n}: ${s}`);console.log(l.bold(`
|
|
66
|
+
Routing:`)),console.log(` Requests: ${o.routingRequests}`),console.log(` Avg Confidence: ${(o.avgRoutingConfidence*100).toFixed(1)}%`),console.log(l.bold(`
|
|
67
|
+
Learning:`)),console.log(` Outcomes: ${o.learningOutcomes}`),console.log(` Success Rate: ${(o.patternSuccessRate*100).toFixed(1)}%`),console.log(l.bold(`
|
|
68
|
+
Search Performance:`)),console.log(` Operations: ${o.patternStoreStats.searchOperations}`),console.log(` Avg Latency: ${o.patternStoreStats.avgSearchLatencyMs.toFixed(2)}ms`),console.log(` HNSW Native: ${o.patternStoreStats.hnswStats.nativeAvailable?"\u2713":"\u2717"}`)}}catch(t){throw y(`stats failed: ${t instanceof Error?t.message:"unknown"}`),t}}),r.command("list").description("List all registered QE hook events").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await g(),o=t.getRegisteredEvents();if(e.json)m({events:o,totalEvents:Object.keys(S).length,registeredEvents:o.length});else{console.log(l.bold(`
|
|
69
|
+
\u{1F4CB} Registered QE Hook Events
|
|
70
|
+
`)),console.log(l.bold("All Available Events:"));for(let[n,s]of Object.entries(S)){let c=o.includes(s)?l.green("\u2713"):l.dim("\u25CB");console.log(` ${c} ${n}: ${l.dim(s)}`)}console.log(l.dim(`
|
|
71
|
+
Registered: ${o.length}/${Object.keys(S).length}`))}}catch(t){throw y(`list failed: ${t instanceof Error?t.message:"unknown"}`),t}}),r.command("emit").description("Emit a QE hook event").requiredOption("-e, --event <name>","Event name (e.g., qe:pattern-applied)").option("-d, --data <json>","Event data as JSON","{}").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await g(),o;try{o=M(e.data)}catch{throw new Error(`Invalid JSON data: ${e.data}`)}let n=await t.emit(e.event,o);e.json?m({event:e.event,results:n}):(console.log(l.bold(`
|
|
72
|
+
\u{1F4E1} Hook Event Emitted`)),console.log(l.dim(` Event: ${e.event}`)),console.log(l.dim(` Handlers: ${n.length}`)),n.forEach((s,a)=>{let c=s.success?l.green("\u2713"):l.red("\u2717");console.log(` ${c} Handler ${a+1}: ${s.success?"success":s.error}`),s.patternsLearned&&console.log(l.green(` Patterns learned: ${s.patternsLearned}`))}))}catch(t){throw y(`emit failed: ${t instanceof Error?t.message:"unknown"}`),t}}),r.command("learn").description("Store a new pattern in the reasoning bank").requiredOption("-n, --name <name>","Pattern name").requiredOption("-d, --description <desc>","Pattern description").option("-t, --type <type>","Pattern type","test-template").option("--domain <domain>","QE domain").option("--tags <tags...>","Pattern tags").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await g(),o=await t.storePattern({patternType:e.type,name:e.name,description:e.description,template:{type:"prompt",content:e.description,variables:[]},context:{tags:e.tags||[]}});if(!o.success)throw new Error(o.error.message);let n=o.value;e.json?m({success:!0,pattern:{id:n.id,name:n.name,type:n.patternType,domain:n.qeDomain}}):(b(`Pattern stored: ${n.name}`),console.log(l.dim(` ID: ${n.id}`)),console.log(l.dim(` Domain: ${n.qeDomain}`)),console.log(l.dim(` Tier: ${n.tier}`)))}catch(t){throw y(`learn failed: ${t instanceof Error?t.message:"unknown"}`),t}}),r.command("search").description("Search for patterns in the reasoning bank").requiredOption("-q, --query <query>","Search query").option("-l, --limit <n>","Maximum results","10").option("-d, --domain <domain>","Filter by domain").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await g(),o=await t.searchPatterns(e.query,{limit:parseInt(e.limit,10),domain:e.domain});if(!o.success)throw new Error(o.error.message);let n=o.value;e.json?m({query:e.query,total:n.length,patterns:n.map(s=>({id:s.pattern.id,name:s.pattern.name,score:s.score,domain:s.pattern.qeDomain,matchType:s.matchType}))}):(console.log(l.bold(`
|
|
73
|
+
\u{1F50D} Search Results for "${e.query}"
|
|
74
|
+
`)),n.length===0?console.log(l.dim(" No patterns found")):n.forEach((s,a)=>{console.log(`${l.cyan(`${a+1}.`)} ${s.pattern.name} ${l.dim(`(${(s.score*100).toFixed(1)}%)`)}`),console.log(l.dim(` Domain: ${s.pattern.qeDomain}`)),console.log(l.dim(` Match: ${s.matchType}`)),console.log(l.dim(` ID: ${s.pattern.id}`)),console.log()}),console.log(l.dim(`Found ${n.length} pattern(s)`)))}catch(t){throw y(`search failed: ${t instanceof Error?t.message:"unknown"}`),t}})}O();import q from"chalk";import me from"node:path";function Y(r){r.command("session-start").description("Initialize session state when Claude Code session starts").option("-s, --session-id <id>","Session ID").option("--json","Output as JSON").action(async e=>{try{let t=e.sessionId||`session-${Date.now()}`;d.sessionId=t;let{reasoningBank:o}=await g(),n=await o.getStats(),s=E(),a=me.join(s,".agentic-qe"),c=await T(a),i=await c.get(v),h=!i||!i.sessionStartTime;i?(i.sessionStartTime=new Date().toISOString(),i.totalDreamsThisSession=0):i={lastDreamTime:null,experienceCount:0,sessionStartTime:new Date().toISOString(),totalDreamsThisSession:0},await c.set(v,i);let u=[];u.push(`AQE Learning: ${n.totalPatterns} patterns loaded`);let k=Object.entries(n.byDomain).filter(([,f])=>f>0).sort(([,f],[,R])=>R-f).slice(0,5);k.length>0&&u.push(`Top domains: ${k.map(([f,R])=>`${f}(${R})`).join(", ")}`),n.patternSuccessRate>0&&u.push(`Pattern success rate: ${(n.patternSuccessRate*100).toFixed(0)}%`),n.routingRequests>0&&u.push(`Routing confidence: ${(n.avgRoutingConfidence*100).toFixed(0)}% across ${n.routingRequests} requests`);let p=u.join(". ")+".";e.json?m({hookSpecificOutput:{hookEventName:"SessionStart",additionalContext:p},sessionId:t,initialized:!0,patternsLoaded:n.totalPatterns,dreamScheduler:{enabled:!0,lastDreamTime:i.lastDreamTime,pendingExperiences:i.experienceCount}}):(b(`Session started: ${t}`),console.log(q.dim(` Patterns loaded: ${n.totalPatterns}`)),console.log(q.dim(` Dream scheduler: enabled (${i.experienceCount} pending experiences)`)));return}catch(t){e.json&&m({success:!1,error:t instanceof Error?t.message:"unknown"});return}}),r.command("session-end").description("Save session state when Claude Code session ends").option("--save-state","Save learning state to disk").option("--export-metrics","Export session metrics").option("--json","Output as JSON").action(async e=>{try{let t=d.sessionId||"unknown",o=null;if(d.initialized&&d.reasoningBank)try{o=await d.reasoningBank.getStats()}catch{}let n=0;try{n=await B()}catch{}if(e.json){let s=o?`Session complete: ${o.totalPatterns} patterns, ${o.routingRequests} routings, ${(o.patternSuccessRate*100).toFixed(0)}% success rate`:"Session complete";m({continue:!0,sessionId:t,stateSaved:e.saveState||!1,metricsExported:e.exportMetrics||!1,patternsConsolidated:n,finalStats:o?{patternsLearned:o.totalPatterns,routingRequests:o.routingRequests,successRate:o.patternSuccessRate}:null})}else b(`Session ended: ${t}`),o&&(console.log(q.dim(` Patterns: ${o.totalPatterns}`)),console.log(q.dim(` Routing requests: ${o.routingRequests}`))),n>0&&console.log(q.dim(` Patterns consolidated: ${n}`));return}catch(t){e.json&&m({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}import x from"chalk";import le from"node:path";O();function ee(r){r.command("pre-task").description("Get context and guidance before spawning a Task agent").option("--task-id <id>","Task identifier").option("-d, --description <desc>","Task description").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await g(),o=null;if(e.description){let n=await t.routeTask({task:e.description});n.success&&(o=n.value)}e.json?m({success:!0,taskId:e.taskId,description:e.description,recommendedAgent:o?.recommendedAgent,confidence:o?.confidence,guidance:o?.guidance||[]}):(console.log(x.bold(`
|
|
75
|
+
\u{1F680} Pre-Task Analysis`)),console.log(x.dim(` Task ID: ${e.taskId||"N/A"}`)),o&&(console.log(x.bold(`
|
|
76
|
+
\u{1F3AF} Recommended:`),x.cyan(o.recommendedAgent)),console.log(x.dim(` Confidence: ${(o.confidence*100).toFixed(1)}%`))));return}catch(t){e.json&&m({success:!1,error:t instanceof Error?t.message:"unknown"});return}}),r.command("post-task").description("Record task outcome for pattern learning").option("--task-id <id>","Task identifier").option("--success <bool>","Whether task succeeded","true").option("--agent <name>","Agent that executed the task").option("--duration <ms>","Task duration in milliseconds").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,o=0,n={triggered:!1};try{let{hookRegistry:s,reasoningBank:a}=await g();if(o=(await s.emit(S.QEAgentCompletion,{taskId:e.taskId,success:t,agent:e.agent,duration:e.duration?parseInt(e.duration,10):void 0,timestamp:Date.now()})).reduce((p,f)=>p+(f.patternsLearned||0),0),e.taskId){let p=e.agent||"unknown";await a.recordOutcome({patternId:`task:${p}:${e.taskId}`,success:t,metrics:{executionTimeMs:e.duration?parseInt(e.duration,10):0},feedback:`Agent: ${p}, Task: ${e.taskId}`})}let i=E(),h=le.join(i,".agentic-qe"),u=await T(h),k=await D(u);n=await N(u)}catch(s){console.error(x.dim(`[hooks] Learning init: ${s instanceof Error?s.message:"unknown"}`))}e.json?m({success:!0,taskId:e.taskId,taskSuccess:t,patternsLearned:o,dreamTriggered:n.triggered,dreamReason:n.reason,dreamInsights:n.insightsGenerated}):(b(`Task completed: ${e.taskId||"unknown"}`),console.log(x.dim(` Success: ${t}`)),o>0&&console.log(x.green(` Patterns learned: ${o}`)),n.triggered&&console.log(x.blue(` \u{1F319} Dream cycle triggered (${n.reason}): ${n.insightsGenerated} insights`)));return}catch(t){e.json&&m({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}import H from"chalk";import ue from"node:path";O();function te(r){r.command("guard").description("File guardian - block edits to protected files").requiredOption("-f, --file <path>","File path to check").option("--json","Output as JSON (required for hook API)").action(async e=>{try{let t=e.file||"",o=t.replace(/\\/g,"/"),s=[{pattern:/^\.env($|\.)/,reason:"Environment file contains secrets"},{pattern:/\.env\.[a-zA-Z]+$/,reason:"Environment file contains secrets"},{pattern:/\.lock$/,reason:"Lock files are auto-generated"},{pattern:/(^|\/)node_modules\//,reason:"node_modules is managed by package manager"},{pattern:/(^|\/)\.agentic-qe\/memory\.db/,reason:"AQE memory database must not be directly edited"},{pattern:/(^|\/)\.agentic-qe\/memory\.db-wal$/,reason:"AQE WAL file must not be directly edited"},{pattern:/(^|\/)\.agentic-qe\/memory\.db-shm$/,reason:"AQE shared memory file must not be directly edited"}].find(a=>a.pattern.test(o));s?e.json?m({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Protected file: ${s.reason} (${t})`}}):y(`Blocked: ${s.reason} (${t})`):e.json?m({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}}):b(`Allowed: ${t}`);return}catch{e.json&&m({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}});return}}),r.command("pre-command").description("Get context before executing a Bash command").option("-c, --command <cmd>","Command to be executed").option("--json","Output as JSON").action(async e=>{try{let t=e.command||"",o=[{pattern:/rm\s+(-[a-zA-Z]*f[a-zA-Z]*\s+)?-[a-zA-Z]*r[a-zA-Z]*\s+\/(?!\w)/,reason:"Recursive delete of root filesystem"},{pattern:/rm\s+(-[a-zA-Z]*r[a-zA-Z]*\s+)?-[a-zA-Z]*f[a-zA-Z]*\s+\/(?!\w)/,reason:"Recursive delete of root filesystem"},{pattern:/rm\s+-rf\s+~/,reason:"Recursive delete of home directory"},{pattern:/DROP\s+(TABLE|DATABASE|SCHEMA)/i,reason:"Destructive SQL operation"},{pattern:/git\s+push\s+.*--force(?!-)/,reason:"Force push can overwrite remote history"},{pattern:/git\s+reset\s+--hard/,reason:"Hard reset discards uncommitted changes"},{pattern:/>\s*\/dev\/sd[a-z]/,reason:"Direct write to block device"},{pattern:/dd\s+if=.*of=\/dev\/sd/,reason:"Direct disk write via dd"},{pattern:/chmod\s+777\s/,reason:"World-writable permissions are a security risk"},{pattern:/:\(\)\s*\{\s*:\|\s*:&\s*\}\s*;?\s*:/,reason:"Fork bomb detected"},{pattern:/mkfs\./,reason:"Filesystem format operation"},{pattern:/>\s*\/dev\/null\s*2>&1\s*&\s*disown/,reason:"Stealth background process"}],n=[{pattern:/\.agentic-qe.*rm/,reason:"Deleting AQE data files"},{pattern:/rm\s+-rf\s/,reason:"Recursive force delete"},{pattern:/git\s+clean\s+-[a-zA-Z]*f/,reason:"Force cleaning untracked files"}],s=o.find(c=>c.pattern.test(t)),a=n.filter(c=>c.pattern.test(t)).map(c=>c.reason);if(s)e.json?m({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Dangerous command blocked: ${s.reason}`}}):y(`Blocked: ${s.reason}`);else if(e.json){let c={hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}};a.length>0&&(c.hookSpecificOutput.additionalContext=`Warnings: ${a.join("; ")}`),m(c)}else a.length>0&&(console.log(H.yellow(`
|
|
77
|
+
\u26A0\uFE0F Command Warnings:`)),a.forEach(c=>console.log(H.yellow(` - ${c}`))));return}catch{e.json&&m({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}});return}}),r.command("post-command").description("Record Bash command outcome").option("-c, --command <cmd>","Command that was executed").option("--success <bool>","Whether command succeeded","true").option("--exit-code <code>","Command exit code").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,o=e.exitCode?parseInt(e.exitCode,10):t?0:1,n=(e.command||"").substring(0,200),s=/\b(test|vitest|jest|pytest|mocha)\b/i.test(n),a=/\b(build|compile|tsc)\b/i.test(n),c=/\b(lint|eslint|prettier)\b/i.test(n),i=0,h=!1;try{let{reasoningBank:u}=await g();if(s){let{hookRegistry:ne}=await g();await ne.emit(S.TestExecutionResult,{runId:`cmd-${Date.now()}`,patternId:`cmd:test:${n.split(/\s+/).slice(0,3).join("-")}`,passed:t?1:0,failed:t?0:1,duration:0,flaky:!1})}let k=n.replace(/[^a-zA-Z0-9]/g,"-").slice(0,80),p=s?"test-execution":a?"code-intelligence":c?"quality-assessment":"code-intelligence";await u.recordOutcome({patternId:`cmd:${k}`,success:t,metrics:{executionTimeMs:0},feedback:`Command: ${n}, exit: ${o}`}),i=1,await P({task:`bash: ${n}`,agent:"cli-hook",domain:p,success:t,source:"cli-hook-post-command"}),h=!0;let f=E(),R=ue.join(f,".agentic-qe"),$=await T(R);await D($)}catch(u){console.error(H.dim(`[hooks] post-command learning: ${u instanceof Error?u.message:"unknown"}`))}e.json&&m({success:!0,command:n.substring(0,100),commandSuccess:t,exitCode:o,patternsLearned:i,experienceRecorded:h});return}catch(t){e.json&&m({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}function ht(){let r=new ge("hooks").description("Self-learning QE hooks for pattern recognition and guidance").addHelpText("after",`
|
|
78
|
+
Examples:
|
|
79
|
+
# File editing hooks (learning from edits)
|
|
80
|
+
aqe hooks pre-edit --file src/utils.ts --operation create
|
|
81
|
+
aqe hooks post-edit --file src/utils.ts --success
|
|
82
|
+
|
|
83
|
+
# Task routing and guidance
|
|
84
|
+
aqe hooks route --task "Generate tests for UserService"
|
|
85
|
+
aqe hooks pre-task --description "Generate tests" --json
|
|
86
|
+
aqe hooks post-task --task-id "task-123" --success true
|
|
87
|
+
|
|
88
|
+
# Bash command hooks
|
|
89
|
+
aqe hooks pre-command --command "npm test" --json
|
|
90
|
+
aqe hooks post-command --command "npm test" --success true
|
|
91
|
+
|
|
92
|
+
# Session lifecycle (Stop hook)
|
|
93
|
+
aqe hooks session-start --session-id "session-123"
|
|
94
|
+
aqe hooks session-end --save-state --json
|
|
95
|
+
|
|
96
|
+
# Pattern management
|
|
97
|
+
aqe hooks learn --name "test-pattern" --description "A test pattern"
|
|
98
|
+
aqe hooks search --query "authentication"
|
|
99
|
+
aqe hooks stats
|
|
100
|
+
aqe hooks list
|
|
101
|
+
`);return Z(r),K(r),X(r),Y(r),ee(r),te(r),r}export{S as QE_HOOK_EVENTS,ht as createHooksCommand,g as getHooksSystem,d as hooksState};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e}from"./chunk-HY6PMO5W.js";import"./chunk-SUSEVMZT.js";import"./chunk-N2NS2PHA.js";import"./chunk-WGMPEW2T.js";import"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";export{a as DEFAULT_HYPERGRAPH_ENGINE_CONFIG,b as HypergraphEngine,c as createHypergraphEngine,d as createHypergraphEngineSync,e as default};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import"./chunk-4I2IOUS4.js";import e from"chalk";import{join as m,resolve as h}from"path";import{existsSync as y}from"fs";var c=class{name="hypergraph";description="Query the code knowledge hypergraph";cleanupAndExit;ensureInitialized;constructor(n,r){this.cleanupAndExit=n,this.ensureInitialized=r}register(n,r){let s=n.command("hypergraph").alias("hg").description(this.description);s.command("stats").description("Show hypergraph statistics (node/edge counts by type)").option("--db <path>","Database path").action(async t=>{await this.executeStats(t)}),s.command("untested").description("Find functions with no test coverage").option("--db <path>","Database path").option("--limit <number>","Max results","20").action(async t=>{await this.executeUntested(t)}),s.command("impacted <files...>").description("Find tests impacted by changed files").option("--db <path>","Database path").action(async(t,i)=>{await this.executeImpacted(t,i)}),s.command("gaps").description("Find functions with low coverage").option("--db <path>","Database path").option("--max-coverage <number>","Coverage threshold (%)","50").option("--limit <number>","Max results","20").action(async t=>{await this.executeGaps(t)})}async executeStats(n){if(!await this.ensureInitialized())return;let{engine:r,close:s}=await this.openEngine(n.db);try{let t=await r.getStats();if(console.log(e.blue(`
|
|
3
|
+
Hypergraph Statistics
|
|
4
|
+
`)),console.log(e.white(` Total nodes: ${t.totalNodes}`)),console.log(e.white(` Total edges: ${t.totalEdges}`)),t.totalNodes>0){console.log(e.gray(`
|
|
5
|
+
Nodes by type:`));for(let[i,o]of Object.entries(t.nodesByType))o>0&&console.log(e.gray(` ${i}: ${o}`));console.log(e.gray(`
|
|
6
|
+
Edges by type:`));for(let[i,o]of Object.entries(t.edgesByType))o>0&&console.log(e.gray(` ${i}: ${o}`));console.log(e.gray(`
|
|
7
|
+
Avg complexity: ${t.avgComplexity.toFixed(1)}`)),console.log(e.gray(` Avg coverage: ${t.avgCoverage.toFixed(1)}%`)),console.log(e.gray(` Nodes with embeddings: ${t.nodesWithEmbeddings}`))}else console.log(e.yellow(`
|
|
8
|
+
Hypergraph is empty. Run "aqe init --auto" to populate it.`));console.log("")}finally{s()}await this.cleanupAndExit(0)}async executeUntested(n){if(!await this.ensureInitialized())return;let{engine:r,close:s}=await this.openEngine(n.db);try{let t=parseInt(n.limit,10)||20,i=await r.findUntestedFunctions(),o=i.slice(0,t);if(console.log(e.blue(`
|
|
9
|
+
Untested Functions (${i.length} total)
|
|
10
|
+
`)),o.length===0)console.log(e.green(" All functions have test coverage!"));else{for(let a of o){let l=a.complexity?e.yellow(` complexity=${a.complexity}`):"";console.log(e.white(` ${a.name}`)+e.gray(` ${a.filePath||""}:${a.lineStart||"?"}`)+l)}i.length>t&&console.log(e.gray(`
|
|
11
|
+
... and ${i.length-t} more (use --limit to show more)`))}console.log("")}finally{s()}await this.cleanupAndExit(0)}async executeImpacted(n,r){if(!await this.ensureInitialized())return;let s=n.map(o=>h(o)),{engine:t,close:i}=await this.openEngine(r.db);try{let o=await t.findImpactedTests(s);if(console.log(e.blue(`
|
|
12
|
+
Impacted Tests for ${n.length} file(s)
|
|
13
|
+
`)),o.length===0)console.log(e.gray(" No impacted tests found. The hypergraph may need rebuilding."));else for(let a of o)console.log(e.white(` ${a.name}`)+e.gray(` ${a.filePath||""}`));console.log(e.gray(`
|
|
14
|
+
Total: ${o.length} test(s)
|
|
15
|
+
`))}finally{i()}await this.cleanupAndExit(0)}async executeGaps(n){if(!await this.ensureInitialized())return;let{engine:r,close:s}=await this.openEngine(n.db);try{let t=parseInt(n.maxCoverage,10)||50,i=parseInt(n.limit,10)||20,o=await r.findCoverageGaps(t),a=o.slice(0,i);if(console.log(e.blue(`
|
|
16
|
+
Coverage Gaps (<= ${t}%) \u2014 ${o.length} total
|
|
17
|
+
`)),a.length===0)console.log(e.green(" No coverage gaps found!"));else{for(let l of a){let d=l.coverage!==void 0?e.red(` ${l.coverage}%`):"",p=l.complexity?e.yellow(` complexity=${l.complexity}`):"";console.log(e.white(` ${l.name}`)+d+e.gray(` ${l.filePath||""}`)+p)}o.length>i&&console.log(e.gray(`
|
|
18
|
+
... and ${o.length-i} more (use --limit to show more)`))}console.log("")}finally{s()}await this.cleanupAndExit(0)}async openEngine(n){let{findProjectRoot:r}=await import("./unified-memory-XYGENQUT.js"),{openDatabase:s}=await import("./safe-db-G22E5ROA.js"),{createHypergraphEngine:t}=await import("./hypergraph-engine-A4Y2ZRAG.js"),i=r(),o=n||m(i,".agentic-qe","memory.db");if(!y(o))throw new Error(`Database not found: ${o}
|
|
19
|
+
Run "aqe init --auto" first.`);let a=s(o);try{return{engine:await t({db:a,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),close:()=>{try{a.close()}catch{}}}}catch(l){try{a.close()}catch{}throw l}}getHelp(){return`
|
|
20
|
+
Query the code knowledge hypergraph for untested functions,
|
|
21
|
+
impacted tests, and coverage gaps.
|
|
22
|
+
|
|
23
|
+
Usage:
|
|
24
|
+
aqe hypergraph stats Show node/edge counts by type
|
|
25
|
+
aqe hypergraph untested [--limit N] Find functions with no test coverage
|
|
26
|
+
aqe hypergraph impacted <files...> Find tests impacted by changed files
|
|
27
|
+
aqe hypergraph gaps [--max-coverage N] Find functions with low coverage
|
|
28
|
+
|
|
29
|
+
Options:
|
|
30
|
+
--db <path> Override database path (default: .agentic-qe/memory.db)
|
|
31
|
+
--limit <number> Max results (default: 20)
|
|
32
|
+
--max-coverage <n> Coverage threshold for gaps (default: 50)
|
|
33
|
+
|
|
34
|
+
Alias: aqe hg stats
|
|
35
|
+
`}};function w(g,n){return new c(g,n)}export{c as HypergraphHandler,w as createHypergraphHandler};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-LNQIY6BP.js";import"./chunk-YAGODYIG.js";import"./chunk-3ZOONQG6.js";import"./chunk-SUSEVMZT.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-WGMPEW2T.js";import"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";export{a as ImpactAnalyzerService};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{a as g}from"./chunk-3ZOONQG6.js";import{a as u,c as f}from"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";import e from"chalk";f();var m=class{name="init";description="Initialize the AQE v3 system";cleanupAndExit;constructor(o){this.cleanupAndExit=o}register(o,i){o.command("init").description(this.description).option("-d, --domains <domains>","Comma-separated list of domains to enable","all").option("-m, --max-agents <number>","Maximum concurrent agents","15").option("--memory <backend>","Memory backend (sqlite|agentdb|hybrid)","hybrid").option("--lazy","Enable lazy loading of domains").option("--wizard","Run interactive setup wizard").option("--auto","Auto-configure based on project analysis").option("-u, --upgrade","Upgrade existing installation (overwrite skills, agents, validation)").option("--minimal","Minimal configuration (skip optional features)").option("--skip-patterns","Skip loading pre-trained patterns").option("--with-n8n","Install n8n workflow testing agents and skills").option("--with-opencode","Include OpenCode agent/skill provisioning").option("--with-kiro","Include AWS Kiro IDE integration (agents, skills, hooks, steering)").option("--with-copilot","Include GitHub Copilot MCP config and instructions").option("--with-cursor","Include Cursor MCP config and rules").option("--with-cline","Include Cline MCP config and custom QE mode").option("--with-kilocode","Include Kilo Code MCP config and custom QE mode").option("--with-roocode","Include Roo Code MCP config and custom QE mode").option("--with-codex","Include OpenAI Codex CLI MCP config and AGENTS.md").option("--with-windsurf","Include Windsurf MCP config and rules").option("--with-continuedev","Include Continue.dev MCP config and rules").option("--no-mcp","Skip MCP server config (MCP is enabled by default)").option("--with-mcp","Enable MCP server config (default \u2014 kept for backward compatibility)").option("--with-all-platforms","Include all coding agent platform configurations").option("--auto-migrate","Automatically migrate from v2 if detected").option("--with-claude-flow","Force Claude Flow integration setup").option("--skip-claude-flow","Skip Claude Flow integration").option("--no-governance","Skip governance configuration (ADR-058)").option("--modular","Use new modular init system (default for --auto)").action(async l=>{await this.execute(l,i)})}async execute(o,i){try{if(o.withAllPlatforms&&(o.withCopilot=!0,o.withCursor=!0,o.withCline=!0,o.withKilocode=!0,o.withRoocode=!0,o.withCodex=!0,o.withWindsurf=!0,o.withContinuedev=!0),o.upgrade&&!o.auto&&!o.wizard&&(o.auto=!0),o.wizard||o.auto){if(console.log(e.blue(`
|
|
3
|
+
Agentic QE v3 Initialization
|
|
4
|
+
`)),o.auto||o.modular){await this.runModularInit(o,i);return}await this.runLegacyWizard(o,i);return}await this.runStandardInit(o,i)}catch(l){console.error(e.red(`
|
|
5
|
+
Failed to initialize:`),l),await this.cleanupAndExit(1)}}async runModularInit(o,i){let{createModularInitOrchestrator:l}=await import("./orchestrator-QHSBB2UC.js"),s=l({projectRoot:process.cwd(),autoMode:o.auto,upgrade:o.upgrade,minimal:o.minimal,skipPatterns:o.skipPatterns,withN8n:o.withN8n,withOpenCode:o.withOpencode,withKiro:o.withKiro,withCopilot:o.withCopilot,withCursor:o.withCursor,withCline:o.withCline,withKiloCode:o.withKilocode,withRooCode:o.withRoocode,withCodex:o.withCodex,withWindsurf:o.withWindsurf,withContinueDev:o.withContinuedev,noMcp:o.noMcp&&!o.withMcp,noGovernance:o.noGovernance});console.log(e.white(` Analyzing project...
|
|
6
|
+
`));let n=await s.initialize();for(let t of n.steps){let r=t.status==="success"?"*":t.status==="error"?"x":"!",c=t.status==="success"?e.green:t.status==="error"?e.red:e.yellow;console.log(c(` ${r} ${t.step} (${t.durationMs}ms)`))}console.log("");let a;if(!o.skipClaudeFlow&&(o.withClaudeFlow||n.success))try{let{setupClaudeFlowIntegration:t}=await import("./claude-flow-setup-245JLJCN.js");if(a=await t({projectRoot:process.cwd(),force:o.withClaudeFlow}),a.available)console.log(e.green(" * Claude Flow integration enabled")),a.features.trajectories&&console.log(e.gray(" - SONA trajectory tracking")),a.features.modelRouting&&console.log(e.gray(" - 3-tier model routing (haiku/sonnet/opus)")),a.features.pretrain&&console.log(e.gray(" - Codebase pretrain analysis")),console.log("");else{let{getClaudeFlowNotFoundMessage:r}=await import("./detect-L6ZZHUSX.js");console.log(e.gray(r())),console.log("")}}catch{let{getClaudeFlowNotFoundMessage:t}=await import("./detect-L6ZZHUSX.js");console.log(e.gray(t())),console.log("")}n.success?(console.log(e.green(` AQE v3 initialized successfully!
|
|
7
|
+
`)),console.log(e.blue(" Summary:")),console.log(e.gray(` - Patterns loaded: ${n.summary.patternsLoaded}`)),console.log(e.gray(` - Skills installed: ${n.summary.skillsInstalled}`)),console.log(e.gray(` - Agents installed: ${n.summary.agentsInstalled}`)),console.log(e.gray(` - Hooks configured: ${n.summary.hooksConfigured?"Yes":"No"}`)),console.log(e.gray(` - Workers started: ${n.summary.workersStarted}`)),console.log(e.gray(` - Claude Flow: ${a?.available?"Enabled":"Standalone mode"}`)),console.log(e.gray(` - Total time: ${n.totalDurationMs}ms
|
|
8
|
+
`)),console.log(e.white("Next steps:")),console.log(e.gray(" 1. Run tests: aqe test <path>")),console.log(e.gray(" 2. Check coverage: aqe coverage <path>")),console.log(e.gray(" 3. Check status: aqe status")),n.summary.mcpConfigured&&(console.log(e.gray(`
|
|
9
|
+
MCP server configured in .mcp.json`)),console.log(e.gray(` Use --no-mcp to skip MCP setup if using CLI only
|
|
10
|
+
`)))):(console.log(e.red(` Initialization failed. Check errors above.
|
|
11
|
+
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runLegacyWizard(o,i){let{InitOrchestrator:l}=await import("./init-wizard-JWZUGIPJ.js"),s={projectRoot:process.cwd(),autoMode:o.auto,minimal:o.minimal,skipPatterns:o.skipPatterns,withN8n:o.withN8n},n=new l(s);if(o.wizard){console.log(e.white(` Setup Wizard Steps:
|
|
12
|
+
`));let t=n.getWizardSteps();for(let r=0;r<t.length;r++)console.log(e.gray(` ${r+1}. ${t[r].title}`)),console.log(e.gray(` ${t[r].description}
|
|
13
|
+
`))}console.log(e.white(` Analyzing project...
|
|
14
|
+
`));let a=await n.initialize();for(let t of a.steps){let r=t.status==="success"?"*":t.status==="error"?"x":"!",c=t.status==="success"?e.green:t.status==="error"?e.red:e.yellow;console.log(c(` ${r} ${t.step} (${t.durationMs}ms)`))}console.log(""),a.success?(console.log(e.green(` AQE v3 initialized successfully!
|
|
15
|
+
`)),console.log(e.blue(" Summary:")),console.log(e.gray(` - Patterns loaded: ${a.summary.patternsLoaded}`)),console.log(e.gray(` - Hooks configured: ${a.summary.hooksConfigured?"Yes":"No"}`)),console.log(e.gray(` - Workers started: ${a.summary.workersStarted}`)),a.summary.n8nInstalled&&(console.log(e.gray(` - N8n agents: ${a.summary.n8nInstalled.agents}`)),console.log(e.gray(` - N8n skills: ${a.summary.n8nInstalled.skills}`))),console.log(e.gray(` - Total time: ${a.totalDurationMs}ms
|
|
16
|
+
`)),console.log(e.white("Next steps:")),console.log(e.gray(" 1. Run tests: aqe test <path>")),console.log(e.gray(" 2. Check coverage: aqe coverage <path>")),console.log(e.gray(" 3. Check status: aqe status")),a.summary.mcpConfigured&&(console.log(e.gray(`
|
|
17
|
+
MCP server configured in .mcp.json`)),console.log(e.gray(` Use --no-mcp to skip MCP setup if using CLI only
|
|
18
|
+
`)))):(console.log(e.red(` Initialization failed. Check errors above.
|
|
19
|
+
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runStandardInit(o,i){let{QEKernelImpl:l}=await import("./kernel-YNDTVKIW.js"),{CrossDomainEventRouter:s}=await import("./cross-domain-router-OWR5IJ5G.js"),{DefaultProtocolExecutor:n}=await import("./protocol-executor-SPUVRDWT.js"),{WorkflowOrchestrator:a}=await import("./workflow-orchestrator-7PZMX3JZ.js"),{createQueenCoordinator:t}=await import("./queen-coordinator-RW3NKO5A.js");console.log(e.blue(`
|
|
20
|
+
Initializing Agentic QE v3...
|
|
21
|
+
`));let r=o.domains==="all"?[...g]:o.domains.split(",").filter(d=>g.includes(d));console.log(e.gray(` Domains: ${r.length}`)),console.log(e.gray(` Max Agents: ${o.maxAgents}`)),console.log(e.gray(` Memory: ${o.memory}`)),console.log(e.gray(` Lazy Loading: ${o.lazy?"enabled":"disabled"}
|
|
22
|
+
`)),i.kernel=new l({maxConcurrentAgents:parseInt(o.maxAgents,10),memoryBackend:o.memory,hnswEnabled:!0,lazyLoading:o.lazy||!1,enabledDomains:r}),await i.kernel.initialize(),console.log(e.green(" * Kernel initialized")),i.router=new s(i.kernel.eventBus),await i.router.initialize(),console.log(e.green(" * Cross-domain router initialized"));let c=d=>i.kernel.getDomainAPI(d),p=new n(i.kernel.eventBus,i.kernel.memory,c);console.log(e.green(" * Protocol executor initialized")),i.workflowOrchestrator=new a(i.kernel.eventBus,i.kernel.memory,i.kernel.coordinator),await i.workflowOrchestrator.initialize(),this.registerDomainWorkflowActions(i.kernel,i.workflowOrchestrator),console.log(e.green(" * Workflow orchestrator initialized")),i.queen=t(i.kernel,i.router,p,void 0),await i.queen.initialize(),console.log(e.green(" * Queen Coordinator initialized")),i.initialized=!0,console.log(e.green(`
|
|
23
|
+
AQE v3 initialized successfully!
|
|
24
|
+
`)),console.log(e.blue(" Enabled Domains:"));for(let d of r)console.log(e.gray(` - ${d}`));console.log(""),await this.cleanupAndExit(0)}registerDomainWorkflowActions(o,i){let l=o.getDomainAPI("visual-accessibility");if(l?.registerWorkflowActions)try{l.registerWorkflowActions(i)}catch(n){console.error(e.yellow(` ! Could not register visual-accessibility workflow actions: ${u(n)}`))}let s=o.getDomainAPI("requirements-validation");if(s?.registerWorkflowActions)try{s.registerWorkflowActions(i)}catch(n){console.error(e.yellow(` ! Could not register requirements-validation workflow actions: ${u(n)}`))}}getHelp(){return`
|
|
25
|
+
Initialize the AQE v3 system with various configuration options.
|
|
26
|
+
|
|
27
|
+
Usage:
|
|
28
|
+
aqe init [options]
|
|
29
|
+
|
|
30
|
+
Options:
|
|
31
|
+
-d, --domains <domains> Comma-separated list of domains to enable (default: all)
|
|
32
|
+
-m, --max-agents <number> Maximum concurrent agents (default: 15)
|
|
33
|
+
--memory <backend> Memory backend: sqlite, agentdb, or hybrid (default: hybrid)
|
|
34
|
+
--lazy Enable lazy loading of domains
|
|
35
|
+
--wizard Run interactive setup wizard
|
|
36
|
+
--auto Auto-configure based on project analysis
|
|
37
|
+
-u, --upgrade Upgrade existing installation (overwrite skills, agents, validation)
|
|
38
|
+
--minimal Minimal configuration (skip optional features)
|
|
39
|
+
--skip-patterns Skip loading pre-trained patterns
|
|
40
|
+
--with-n8n Install n8n workflow testing agents and skills
|
|
41
|
+
--with-opencode Include OpenCode agent/skill provisioning
|
|
42
|
+
--auto-migrate Automatically migrate from v2 if detected
|
|
43
|
+
--with-claude-flow Force Claude Flow integration setup
|
|
44
|
+
--skip-claude-flow Skip Claude Flow integration
|
|
45
|
+
--no-mcp Skip MCP server config (MCP is enabled by default)
|
|
46
|
+
--no-governance Skip governance configuration (ADR-058)
|
|
47
|
+
--modular Use new modular init system
|
|
48
|
+
|
|
49
|
+
MCP Server:
|
|
50
|
+
MCP server configuration is ENABLED BY DEFAULT. It writes .mcp.json
|
|
51
|
+
at the project root so Claude Code auto-discovers the AQE MCP server.
|
|
52
|
+
Use --no-mcp to skip if you only want CLI commands.
|
|
53
|
+
|
|
54
|
+
Governance:
|
|
55
|
+
Governance is ENABLED BY DEFAULT. It installs .claude/guidance/ with:
|
|
56
|
+
- constitution.md: 7 unbreakable QE invariants
|
|
57
|
+
- shards/*.shard.md: 12 domain-specific governance rules
|
|
58
|
+
|
|
59
|
+
Use --no-governance to skip, or set GOVERNANCE_*=false env vars for
|
|
60
|
+
fine-grained control over individual gates (ContinueGate, MemoryWriteGate, etc.)
|
|
61
|
+
|
|
62
|
+
Examples:
|
|
63
|
+
aqe init --auto # Auto-configure based on project (keeps existing skills)
|
|
64
|
+
aqe init --auto --upgrade # Auto-configure AND update all skills/agents
|
|
65
|
+
aqe init --upgrade # Upgrade existing installation
|
|
66
|
+
aqe init --wizard # Run interactive wizard
|
|
67
|
+
aqe init --domains test-generation,coverage-analysis
|
|
68
|
+
`}};function v(w){return new m(w)}export{m as InitHandler,v as createInitHandler};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{a,b,c,d}from"./chunk-CWFB6BSA.js";import"./chunk-BR26T7ZS.js";import"./chunk-3ADGXLTM.js";import"./chunk-KP5NUODU.js";import"./chunk-WGMPEW2T.js";import"./chunk-JZSDOIXA.js";import"./chunk-263XS447.js";import"./chunk-MDUHYUHF.js";import"./chunk-4I2IOUS4.js";export{a as InitOrchestrator,b as createInitOrchestrator,d as formatInitResult,c as quickInit};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{v as a,w as b}from"./chunk-BPWXXEH2.js";import"./chunk-2BZFNEN2.js";import"./chunk-3IUNFTIF.js";import"./chunk-ZAPS3UGQ.js";import"./chunk-J3KWWR6Z.js";import"./chunk-IGJPMN4I.js";import"./chunk-IAV2JMIX.js";import"./chunk-EHDQJQ6Y.js";import"./chunk-QOVHWZEP.js";import"./chunk-ZDATDCYN.js";import"./chunk-AFLLQ5PP.js";import"./chunk-TLHP5EII.js";import"./chunk-MV6CMOJQ.js";import"./chunk-JRYGQO2W.js";import"./chunk-4YS3IJ45.js";import"./chunk-OF4D7MYI.js";import"./chunk-3IHG3WOY.js";import"./chunk-OI5NGQO2.js";import"./chunk-3THRQEZ2.js";import"./chunk-UQHYFOBX.js";import"./chunk-5SKGFSKD.js";import"./chunk-FEKY7T6Q.js";import"./chunk-LNQIY6BP.js";import"./chunk-YAGODYIG.js";import"./chunk-HY6PMO5W.js";import"./chunk-ESVQ6MEB.js";import"./chunk-FIA6X7UL.js";import"./chunk-X3KI6JOY.js";import"./chunk-24FKIJNC.js";import"./chunk-GRUUQAR6.js";import"./chunk-5T2ZQWKF.js";import"./chunk-XT2V2322.js";import"./chunk-WBQSXPBI.js";import"./chunk-3ZOONQG6.js";import"./chunk-SUSEVMZT.js";import"./chunk-AKE543X2.js";import"./chunk-JJO7Y4H3.js";import"./chunk-N2NS2PHA.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-WGMPEW2T.js";import"./chunk-JZSDOIXA.js";import"./chunk-263XS447.js";import"./chunk-MDUHYUHF.js";import"./chunk-GAOJV3OX.js";import"./chunk-62ADTHV7.js";import"./chunk-DRT3WKQW.js";import"./chunk-UFUVUO3J.js";import"./chunk-7VDBAVTY.js";import"./chunk-B36CDR4U.js";import"./chunk-2I7J3O6V.js";import"./chunk-4I2IOUS4.js";export{a as QEKernelImpl,b as createKernel};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{b as p}from"./chunk-4YOMLWEK.js";import{a as f,c as v}from"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";v();import{existsSync as n,mkdirSync as m,readFileSync as u,writeFileSync as a}from"fs";import{join as d,dirname as h}from"path";var l=class{projectRoot;overwrite;generator;constructor(r){this.projectRoot=r.projectRoot,this.overwrite=r.overwrite??!1,this.generator=p()}async install(){let r={success:!0,mcpConfigured:!1,modeInstalled:!1,errors:[],configPath:"",modePath:""};try{let t=this.generator.generateMcpConfig("kilocode"),e=d(this.projectRoot,t.path);if(r.configPath=e,!n(e)||this.overwrite){let s=h(e);if(n(s)||m(s,{recursive:!0}),n(e)&&this.overwrite){let c=this.mergeExistingConfig(e,t.content);a(e,c)}else a(e,t.content);r.mcpConfigured=!0}let i=this.generator.generateBehavioralRules("kilocode"),o=d(this.projectRoot,i.path);if(r.modePath=o,!n(o)||this.overwrite){let s=h(o);if(n(s)||m(s,{recursive:!0}),n(o)&&this.overwrite){let c=this.mergeExistingModes(o,i.content);a(o,c)}else a(o,i.content);r.modeInstalled=!0}}catch(t){r.success=!1,r.errors.push(`Kilo Code installation failed: ${f(t)}`)}return r}mergeExistingConfig(r,t){try{let e=JSON.parse(u(r,"utf-8")),i=JSON.parse(t);return e.mcpServers||(e.mcpServers={}),Object.assign(e.mcpServers,i.mcpServers),JSON.stringify(e,null,2)+`
|
|
3
|
+
`}catch{return t}}mergeExistingModes(r,t){try{let e=JSON.parse(u(r,"utf-8")),i=JSON.parse(t);if(!Array.isArray(e))return t;let o=e.filter(s=>s.slug!=="qe-engineer");return o.push(...i),JSON.stringify(o,null,2)+`
|
|
4
|
+
`}catch{return t}}};function x(g){return new l(g)}export{l as KiloCodeInstaller,x as createKiloCodeInstaller};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{a as k,c as M}from"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";M();import{existsSync as u,mkdirSync as y,readdirSync as S,readFileSync as q,writeFileSync as v}from"fs";import{join as c,dirname as $}from"path";import{fileURLToPath as E}from"url";var P=E(import.meta.url),b=$(P),A=class{projectRoot;options;openCodeDir;constructor(t){this.projectRoot=t.projectRoot,this.options={installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:!1,...t},this.openCodeDir=this.findOpenCodeDir()}findOpenCodeDir(){let t=[c(b,"../../.opencode"),c(b,"../../assets/opencode")];for(let s of t)if(u(s)&&(u(c(s,"agents"))||u(c(s,"skills"))))return s;let e=c(process.cwd(),".opencode");return u(e)&&(u(c(e,"agents"))||u(c(e,"skills")))?e:t[0]}async install(){let t=c(this.projectRoot,".kiro"),e={success:!0,agentsInstalled:[],skillsInstalled:[],hooksInstalled:[],steeringInstalled:[],mcpConfigured:!1,errors:[],targetDir:t};try{if(e.mcpConfigured=this.installMcpConfig(t),this.options.installAgents){let s=this.installAgents(t);e.agentsInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installSkills){let s=this.installSkills(t);e.skillsInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installHooks){let s=this.installHooks(t);e.hooksInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installSteering){let s=this.installSteering(t);e.steeringInstalled=s.installed,e.errors.push(...s.errors)}}catch(s){e.success=!1,e.errors.push(`Kiro installation failed: ${k(s)}`)}return e}installMcpConfig(t){let e=c(t,"settings"),s=c(e,"mcp.json");return u(s)&&!this.options.overwrite?!1:(y(e,{recursive:!0}),v(s,JSON.stringify({mcpServers:{"agentic-qe":{command:"npx",args:["-y","agentic-qe@latest","mcp"],env:{AQE_MEMORY_PATH:".agentic-qe/memory.db",AQE_V3_MODE:"true"},disabled:!1,autoApprove:["fleet_init","fleet_status","test_generate_enhanced","coverage_analyze_sublinear","quality_assess","memory_store","memory_query"]}}},null,2)+`
|
|
3
|
+
`),!0)}installAgents(t){let e=[],s=[],n=c(this.openCodeDir,"agents"),l=c(t,"agents");if(!u(n))return y(l,{recursive:!0}),this.writeDefaultQEAgent(l),e.push("qe-specialist"),{installed:e,errors:s};y(l,{recursive:!0});let i=S(n).filter(r=>r.endsWith(".yaml"));for(let r of i){let a=r.replace(".yaml",""),o=c(l,`${a}.json`);if(!(u(o)&&!this.options.overwrite))try{let p=q(c(n,r),"utf-8"),m=this.parseYamlAgent(p),d=this.convertToKiroAgent(m);v(o,JSON.stringify(d,null,2)+`
|
|
4
|
+
`),e.push(a)}catch(p){s.push(`Failed to convert agent ${r}: ${k(p)}`)}}let g=c(this.options.projectRoot,".claude","agents");if(u(g)){let r=["subagents","n8n","testing","analysis"];for(let a of r){let o=c(g,a);if(!u(o))continue;let p=S(o,{recursive:!1}).filter(m=>typeof m=="string"&&m.endsWith(".md")&&m!=="README.md");for(let m of p){let d=m.replace(".md",""),h=c(l,`${d}.json`);if(!(u(h)&&!this.options.overwrite))try{let f=q(c(o,m),"utf-8"),w=this.convertMdAgentToKiro(f,d);w&&(v(h,JSON.stringify(w,null,2)+`
|
|
5
|
+
`),e.push(d))}catch(f){s.push(`Failed to convert subagent ${m}: ${k(f)}`)}}}}return{installed:e,errors:s}}convertMdAgentToKiro(t,e){let s=t.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!s)return null;let n=s[1],l=s[2].trim(),i=d=>{let h=new RegExp(`^${d}:\\s*"?([^"
|
|
6
|
+
]*)"?`,"m");return n.match(h)?.[1]?.trim()??""},g=i("name")||e,r=i("description")||`QE subagent: ${e}`,a=l.replace(/mcp:agentic-qe:/g,"@agentic-qe/"),o=i("model"),p=i("priority"),m="claude-sonnet-4";return o?o.includes("opus")?m="claude-opus-4":o.includes("haiku")&&(m="claude-haiku-4"):p==="critical"&&(m="claude-sonnet-4"),{name:g,description:r,model:m,prompt:a,mcpServers:{"agentic-qe":{command:"npx",args:["-y","agentic-qe@latest","mcp"]}},tools:["read","write","shell","@agentic-qe"],includeMcpJson:!0}}parseYamlAgent(t){let e=a=>{let o=new RegExp(`^${a}:\\s*(?:"([^"]*)"|(.*))`,"m"),p=t.match(o);return p?(p[1]??p[2]??"").trim():""},s="",n=t.match(/^systemPrompt:\s*\|\s*\n([\s\S]*?)(?=\n\w|\n$)/m);n&&(s=n[1].split(`
|
|
7
|
+
`).map(a=>a.replace(/^ {2}/,"")).join(`
|
|
8
|
+
`).trim());let l=[],i=t.match(/^tools:\s*\n((?:\s+-\s+.*\n?)*)/m);if(i){let a=i[1].split(`
|
|
9
|
+
`);for(let o of a){let p=o.match(/^\s+-\s+"?([^"\n]+)"?/);p&&l.push(p[1].trim())}}let g={},r=t.match(/^permissions:\s*\n((?:\s+.*\n?)*)/m);if(r){let a=r[1].split(`
|
|
10
|
+
`);for(let o of a){let p=o.match(/^\s+"?([^":]+)"?\s*:\s*(\w+)/);p&&(g[p[1].trim()]=p[2].trim())}}return{name:e("name"),description:e("description"),model:e("model")||void 0,systemPrompt:s||void 0,tools:l,permissions:g}}convertToKiroAgent(t){let e={bash:"shell",edit:"write",grep:"shell",glob:"shell"},s=[...new Set(t.tools?.map(o=>o.startsWith("mcp:agentic-qe:")?`@agentic-qe/${o.replace("mcp:agentic-qe:","")}`:e[o]??o)??[])],n=new Set;if(t.permissions)for(let[o,p]of Object.entries(t.permissions))p==="allow"&&(o.startsWith("mcp:agentic-qe:")?n.add(`@agentic-qe/${o.replace("mcp:agentic-qe:","")}`):n.add(e[o]??o));let l=[...n],i="claude-sonnet-4";t.model&&(t.model.includes("opus")?i="claude-opus-4":t.model.includes("haiku")&&(i="claude-haiku-4"));let r=(t.systemPrompt??`You are ${t.name}, a specialized QE agent in the Agentic QE v3 platform.`).replace(/mcp:agentic-qe:/g,"@agentic-qe/"),a={name:t.name,description:t.description,model:i,prompt:r,mcpServers:{"agentic-qe":{command:"npx",args:["-y","agentic-qe@latest","mcp"]}},tools:s.length>0?s:["read","write","shell","@agentic-qe"],includeMcpJson:!0};return l.length>0&&(a.allowedTools=l),a}writeDefaultQEAgent(t){let e={name:"qe-specialist",description:"Quality Engineering specialist powered by Agentic QE",model:"claude-sonnet-4",prompt:"You are a QE specialist. Use AQE tools for test generation, coverage analysis, and quality assessment. Always call fleet_init before other AQE tools.",mcpServers:{"agentic-qe":{command:"npx",args:["-y","agentic-qe@latest","mcp"]}},tools:["read","write","shell","@agentic-qe"],allowedTools:["read","write","shell","@agentic-qe/*"],includeMcpJson:!0,welcomeMessage:"QE Agent ready. I can generate tests, analyze coverage, and assess quality."};v(c(t,"qe-specialist.json"),JSON.stringify(e,null,2)+`
|
|
11
|
+
`)}installSkills(t){let e=[],s=[],n=c(t,"skills"),l=c(this.options.projectRoot,".claude","skills"),i=c(this.openCodeDir,"skills");y(n,{recursive:!0});let g=new Set;if(u(i))for(let r of S(i).filter(a=>a.endsWith(".yaml")))g.add(r.replace(".yaml",""));for(let r of g){let a=c(n,r),o=c(a,"SKILL.md");if(!(u(o)&&!this.options.overwrite))try{let p=this.findClaudeSkillSource(l,r);if(p){let m=this.convertClaudeSkillToKiro(p,r);y(a,{recursive:!0}),v(o,m,{mode:420}),e.push(r)}else{let m=c(i,`${r}.yaml`);if(u(m)){let d=q(m,"utf-8"),h=this.parseYamlSkill(d),f=this.convertToSkillMd(h);y(a,{recursive:!0}),v(o,f,{mode:420}),e.push(r)}}}catch(p){s.push(`Failed to convert skill ${r}: ${k(p)}`)}}return{installed:e,errors:s}}findClaudeSkillSource(t,e){if(!u(t))return null;let s=c(t,e,"SKILL.md");if(u(s))return q(s,"utf-8");let n=e.replace(/^qe-/,""),l=c(t,n,"SKILL.md");if(u(l))return q(l,"utf-8");if(e.startsWith("qcsd-")){let i=c(t,e,"SKILL.md");if(u(i))return q(i,"utf-8")}return null}convertClaudeSkillToKiro(t,e){let s=t.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!s)return`---
|
|
12
|
+
inclusion: auto
|
|
13
|
+
name: ${e}
|
|
14
|
+
description: AQE skill
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
${t}`;let n=s[1],l=s[2],i=n.match(/^name:\s*(.+)/m),g=n.match(/^description:\s*"?([^"\n]*)"?/m),r=n.match(/^tags:\s*\[([^\]]*)\]/m),a=g?.[1]?.trim()??"",o=r?.[1]?.trim()??"",p=["---","inclusion: auto",`name: ${e}`,`description: "${a}"`,o?`tags: [${o}]`:"","---"].filter(Boolean).join(`
|
|
18
|
+
`);return l=l.replace(/mcp:agentic-qe:/g,"@agentic-qe/"),`${p}
|
|
19
|
+
${l}`}parseYamlSkill(t){let e=g=>{let r=new RegExp(`^${g}:\\s*(?:"([^"]*)"|(.*))`,"m"),a=t.match(r);return a?(a[1]??a[2]??"").trim():""},s=[],n=t.match(/^tags:\s*\[([^\]]*)\]/m);n&&s.push(...n[1].split(",").map(g=>g.trim().replace(/^"|"$/g,"")));let l=[],i=t.match(/^steps:\s*\n([\s\S]*)$/m);if(i){let g=i[1].split(/\n\s*-\s+name:\s*/);for(let r of g){if(!r.trim())continue;let a=r.match(/^([^\n]+)/);if(!a)continue;let p=a[1].trim().replace(/^-\s*name:\s*/,"").replace(/^["']|["']$/g,""),d=r.match(/description:\s*"([^"]*)"/)?.[1]?.trim()??"",h="",f=r.match(/prompt:\s*\|\s*\n([\s\S]*?)(?=\n\s+-\s+name:|\n\s*$|$)/);f&&(h=f[1].split(`
|
|
20
|
+
`).map(w=>w.replace(/^ {4,6}/,"")).join(`
|
|
21
|
+
`).trim()),l.push({name:p,description:d,prompt:h})}}return{name:e("name"),description:e("description"),minModelTier:e("minModelTier")||void 0,tags:s,steps:l}}convertToSkillMd(t){let e=[];if(e.push("---"),e.push("inclusion: auto"),e.push(`name: ${t.name}`),e.push(`description: ${t.description}`),e.push("---"),e.push(""),e.push(`# ${t.name}`),e.push(""),e.push(t.description),e.push(""),t.tags&&t.tags.length>0&&(e.push(`**Tags:** ${t.tags.join(", ")}`),e.push("")),e.push("## Prerequisites"),e.push(""),e.push("This skill requires the AQE MCP server. Ensure it is configured in `.kiro/settings/mcp.json`."),e.push(""),t.steps&&t.steps.length>0){e.push("## Steps"),e.push("");for(let s=0;s<t.steps.length;s++){let n=t.steps[s],l=n.name.replace(/^[-\d]+\s*/,"").replace(/-/g," ").replace(/\b\w/g,g=>g.toUpperCase());e.push(`### ${s+1}. ${l}`),e.push("");let i=n.description&&n.description.length>n.name.length?n.description:n.prompt&&n.prompt.length>n.name.length?n.prompt:n.description||n.prompt||"";i&&(e.push(i),e.push(""))}}return e.push("## MCP Tools"),e.push(""),e.push("Use AQE tools via the `@agentic-qe` MCP server:"),e.push(""),e.push("- `@agentic-qe/fleet_init` \u2014 Initialize the QE fleet"),e.push("- `@agentic-qe/test_generate_enhanced` \u2014 Generate tests"),e.push("- `@agentic-qe/coverage_analyze_sublinear` \u2014 Analyze coverage"),e.push("- `@agentic-qe/quality_assess` \u2014 Assess quality gates"),e.push("- `@agentic-qe/memory_store` \u2014 Store learned patterns"),e.push("- `@agentic-qe/memory_query` \u2014 Query past patterns"),e.push(""),e.join(`
|
|
22
|
+
`)}installHooks(t){let e=[],s=[],n=c(t,"hooks");y(n,{recursive:!0});let l=this.getKiroHooks();for(let i of l){let g=c(n,i.filename);if(!(u(g)&&!this.options.overwrite))try{v(g,JSON.stringify(i.config,null,2)+`
|
|
23
|
+
`),e.push(i.filename)}catch(r){s.push(`Failed to install hook ${i.filename}: ${k(r)}`)}}return{installed:e,errors:s}}getKiroHooks(){return[{filename:"aqe-test-updater.kiro.hook",config:{name:"AQE Test Updater",description:"Auto-generate or update tests when source files change",version:"1",when:{type:"fileEdited",patterns:["src/**/*.ts","src/**/*.js","!**/*.test.*","!**/*.spec.*","!**/node_modules/**"]},then:{type:"askAgent",prompt:"A source file was edited. Use @agentic-qe/test_generate_enhanced to check if corresponding tests need updating. Only update tests if the public API changed."}}},{filename:"aqe-coverage-check.kiro.hook",config:{name:"AQE Coverage Check",description:"Run coverage analysis after test files are created or edited",version:"1",when:{type:"fileEdited",patterns:["**/*.test.ts","**/*.spec.ts","**/*.test.js","**/*.spec.js"]},then:{type:"askAgent",prompt:"A test file was modified. Use @agentic-qe/coverage_analyze_sublinear to check if coverage targets are still met. Report any gaps."}}},{filename:"aqe-spec-quality-gate.kiro.hook",config:{name:"AQE Spec Quality Gate",description:"Run quality assessment after each spec task completes",version:"1",when:{type:"postSpecTask"},then:{type:"askAgent",prompt:"A spec task just completed. Use @agentic-qe/quality_assess on the files changed by this task. If coverage drops below 80% or quality gates fail, flag it before moving to the next task."}}},{filename:"aqe-security-scan.kiro.hook",config:{name:"AQE Security Scan",description:"Run security scan when security-sensitive files change",version:"1",when:{type:"fileEdited",patterns:["**/auth/**","**/security/**","**/middleware/**","**/*credential*","**/*secret*"]},then:{type:"askAgent",prompt:"A security-sensitive file was modified. Use @agentic-qe/security_scan_comprehensive to check for vulnerabilities. Flag any OWASP Top 10 issues."}}},{filename:"aqe-pre-commit-quality.kiro.hook",config:{name:"AQE Pre-Commit Quality",description:"Run quality assessment before agent stops to ensure standards are met",version:"1",when:{type:"agentStop"},then:{type:"askAgent",prompt:"Before finishing, use @agentic-qe/quality_assess to verify all modified files meet quality standards. Store the result with @agentic-qe/memory_store for learning."}}}]}installSteering(t){let e=[],s=[],n=c(t,"steering");y(n,{recursive:!0});let l=this.getSteeringFiles();for(let i of l){let g=c(n,i.filename);if(!(u(g)&&!this.options.overwrite))try{v(g,i.content),e.push(i.filename)}catch(r){s.push(`Failed to install steering file ${i.filename}: ${k(r)}`)}}return{installed:e,errors:s}}getSteeringFiles(){return[{filename:"qe-standards.md",content:`---
|
|
24
|
+
inclusion: auto
|
|
25
|
+
name: qe-standards
|
|
26
|
+
description: Quality engineering standards and practices. Triggered when discussing tests, coverage, quality gates, or code review.
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
# Quality Engineering Standards (AQE v3)
|
|
30
|
+
|
|
31
|
+
## Test Generation
|
|
32
|
+
- Use \`@agentic-qe/test_generate_enhanced\` for AI-powered test creation
|
|
33
|
+
- Follow the test pyramid: 70% unit, 20% integration, 10% e2e
|
|
34
|
+
- Use boundary value analysis and equivalence partitioning
|
|
35
|
+
- Always call \`@agentic-qe/fleet_init\` before using other AQE tools
|
|
36
|
+
|
|
37
|
+
## Coverage Analysis
|
|
38
|
+
- Use \`@agentic-qe/coverage_analyze_sublinear\` for O(log n) gap detection
|
|
39
|
+
- Target: 80% statement coverage minimum
|
|
40
|
+
- Focus on risk-weighted coverage, not just line counts
|
|
41
|
+
|
|
42
|
+
## Quality Gates
|
|
43
|
+
- Use \`@agentic-qe/quality_assess\` before marking tasks complete
|
|
44
|
+
- Gates: coverage threshold, complexity limits, security scan pass
|
|
45
|
+
- Store results with \`@agentic-qe/memory_store\` for pattern learning
|
|
46
|
+
|
|
47
|
+
## Learning
|
|
48
|
+
- Query past patterns with \`@agentic-qe/memory_query\` before starting work
|
|
49
|
+
- Store successful patterns after task completion
|
|
50
|
+
- Use namespace \`aqe/learning/patterns/\` for pattern storage
|
|
51
|
+
`},{filename:"testing-conventions.md",content:`---
|
|
52
|
+
inclusion: fileMatch
|
|
53
|
+
name: testing-conventions
|
|
54
|
+
description: Testing conventions for test files
|
|
55
|
+
fileMatchPattern: "**/*.test.{ts,js,tsx,jsx}"
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
# Testing Conventions
|
|
59
|
+
|
|
60
|
+
## Structure
|
|
61
|
+
- Use Arrange-Act-Assert (AAA) pattern
|
|
62
|
+
- One logical assertion per test
|
|
63
|
+
- Descriptive names: \`should_returnValue_when_condition\`
|
|
64
|
+
|
|
65
|
+
## Frameworks
|
|
66
|
+
- Unit tests: Vitest or Jest
|
|
67
|
+
- Integration tests: Vitest with real dependencies
|
|
68
|
+
- E2E tests: Playwright
|
|
69
|
+
|
|
70
|
+
## Mocking
|
|
71
|
+
- Mock external dependencies at system boundaries
|
|
72
|
+
- Prefer dependency injection over module mocking
|
|
73
|
+
- Never mock the system under test
|
|
74
|
+
`}]}};function j(_){return new A(_)}export{A as KiroInstaller,j as createKiroInstaller};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{g as a}from"./chunk-YAGODYIG.js";import"./chunk-3ZOONQG6.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-WGMPEW2T.js";import"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";export{a as KnowledgeGraphService};
|