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,15 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{a as B,b as L}from"./chunk-CS2KS7LP.js";import{b as y,d as $}from"./chunk-WGMPEW2T.js";import"./chunk-4I2IOUS4.js";var k=[{id:"unit",name:"Unit Tests",testTypes:["unit"],testPatterns:["**/*.test.ts","**/*.spec.ts","!**/*.integration.*","!**/*.e2e.*"],thresholds:{minPassRate:.99,maxFlakyRatio:.01,minCoverage:.8},parallelism:8,timeoutMs:6e4,failFast:!0},{id:"integration",name:"Integration Tests",testTypes:["integration","contract"],testPatterns:["**/*.integration.test.ts","**/*.integration.spec.ts"],thresholds:{minPassRate:.95,maxFlakyRatio:.05,minCoverage:.7},parallelism:4,timeoutMs:3e5,failFast:!1},{id:"e2e",name:"E2E Tests",testTypes:["e2e","visual"],testPatterns:["**/*.e2e.test.ts","**/*.e2e.spec.ts"],thresholds:{minPassRate:.9,maxFlakyRatio:.1,minCoverage:.5},parallelism:2,timeoutMs:6e5,failFast:!1}];var b=class{constructor(e,t={phases:k,failFast:!0,retryFailedPhases:!1,maxRetries:1}){this.executor=e;this.config=t}state="idle";currentPhaseIndex=0;results=[];startTime;endTime;abortController;async run(){if(this.state==="running")throw new Error("Scheduler is already running");this.state="running",this.currentPhaseIndex=0,this.results=[],this.startTime=new Date,this.abortController=new AbortController;try{for(let e of this.config.phases){if(this.state==="paused"&&await this.waitForResume(),this.abortController.signal.aborted)break;let t=await this.executePhaseWithRetry(e);if(this.results.push(t),this.currentPhaseIndex++,this.config.onPhaseComplete?.(t),!t.success&&this.config.failFast){this.state="failed";break}}return this.endTime=new Date,this.state=this.results.every(e=>e.success)?"completed":"failed",this.config.onAllComplete?.(this.results),this.results}catch(e){throw this.state="failed",this.endTime=new Date,e}}async runPhase(e){let t=this.config.phases.find(s=>s.id===e);if(!t)throw new Error(`Phase not found: ${e}`);return this.executePhaseWithRetry(t)}pause(){this.state==="running"&&(this.state="paused")}resume(){this.state==="paused"&&(this.state="running")}async abort(){this.abortController?.abort(),await this.executor.abort(),this.state="idle"}getStats(){let e=this.startTime&&this.endTime?this.endTime.getTime()-this.startTime.getTime():this.startTime?Date.now()-this.startTime.getTime():void 0;return{state:this.state,currentPhaseIndex:this.currentPhaseIndex,totalPhases:this.config.phases.length,completedPhases:this.results.filter(t=>t.success).length,failedPhases:this.results.filter(t=>!t.success).length,results:[...this.results],startTime:this.startTime,endTime:this.endTime,durationMs:e}}async isReady(){return this.executor.isReady()}async executePhaseWithRetry(e){let t,s=this.config.retryFailedPhases?this.config.maxRetries:1;for(let r=1;r<=s;r++)try{if(t=await this.executor.execute(e),t.success||!this.config.retryFailedPhases)return t}catch(a){if(this.config.onError?.(a,e),r===s)return this.createErrorResult(e,a)}return t}createErrorResult(e,t){return{phaseId:e.id,phaseName:e.name,success:!1,passRate:0,flakyRatio:0,coverage:0,durationMs:0,totalTests:0,passed:0,failed:0,skipped:0,testResults:[],flakyTests:[],error:t.message}}waitForResume(){return new Promise(e=>{let t=()=>{this.state!=="paused"?e():setTimeout(t,100)};t()})}};function _(n,e){return new b(n,{phases:k,failFast:!0,retryFailedPhases:!1,maxRetries:1,...e})}function V(n,e){return n.passRate>=e.minPassRate&&n.flakyRatio<=e.maxFlakyRatio&&n.coverage>=e.minCoverage}$();import{spawn as j}from"child_process";var f=class{constructor(e={}){this.config=e}currentProcess=null;isAborted=!1;async execute(e,t){this.isAborted=!1;let s=Date.now();try{let r=this.buildArgs(e,t),a=await this.runVitest(r,e.timeoutMs),i=Date.now();return this.parseResult(e,a,i-s)}catch(r){let a=Date.now();return this.createErrorResult(e,r,a-s)}}async isReady(){try{return(await this.runCommand("npx",["vitest","--version"],5e3)).exitCode===0}catch{return!1}}getName(){return"vitest-executor"}async abort(){this.isAborted=!0,this.currentProcess&&(this.currentProcess.kill("SIGTERM"),this.currentProcess=null)}buildArgs(e,t){let s=["vitest","run","--reporter=json"];if(t&&t.length>0)s.push(...t);else for(let r of e.testPatterns)r.startsWith("!")?s.push("--exclude",r.slice(1)):s.push(r);return e.parallelism>0&&(s.push("--pool","threads"),s.push("--poolOptions.threads.maxThreads",String(e.parallelism))),e.failFast&&s.push("--bail","1"),s.push("--coverage"),s.push("--coverage.reporter",this.config.coverageReporter||"json"),this.config.coverageDir&&s.push("--coverage.reportsDirectory",this.config.coverageDir),this.config.extraArgs&&s.push(...this.config.extraArgs),s}async runVitest(e,t){let{stdout:s,exitCode:r}=await this.runCommand(this.config.vitestPath||"npx",e,t);try{let a=s.indexOf("{"),i=s.lastIndexOf("}");if(a===-1||i===-1)throw new Error("No JSON output from Vitest");let o=s.slice(a,i+1);return y(o)}catch{return{numTotalTestSuites:0,numPassedTestSuites:0,numFailedTestSuites:0,numTotalTests:0,numPassedTests:0,numFailedTests:0,numPendingTests:0,success:r===0,startTime:Date.now(),testResults:[]}}}runCommand(e,t,s){return new Promise((r,a)=>{let i="",o="",l=process.platform==="win32"&&e==="npx"?"npx.cmd":e;this.currentProcess=j(l,t,{cwd:this.config.cwd||process.cwd(),env:{...process.env,...this.config.env},shell:!1});let c=setTimeout(()=>{this.currentProcess?.kill("SIGTERM"),a(new Error(`Test execution timed out after ${s}ms`))},s);this.currentProcess.stdout?.on("data",u=>{i+=u.toString()}),this.currentProcess.stderr?.on("data",u=>{o+=u.toString()}),this.currentProcess.on("close",u=>{clearTimeout(c),this.currentProcess=null,this.isAborted?a(new Error("Test execution aborted")):r({stdout:i,stderr:o,exitCode:u??1})}),this.currentProcess.on("error",u=>{clearTimeout(c),this.currentProcess=null,a(u)})})}async parseResult(e,t,s){let r=[];for(let p of t.testResults)for(let h of p.assertionResults){let T={file:p.name,name:h.title,suite:h.ancestorTitles.join(" > "),passed:h.status==="passed",durationMs:h.duration||0,retries:0,error:h.failureMessages.join(`
|
|
3
|
+
`)||void 0};r.push(T)}let a=this.config.flakyTracker;a&&a.recordResults(r);let i=t.numTotalTests,o=t.numPassedTests,l=t.numFailedTests,c=t.numPendingTests,u=i>0?o/i:0,m=[],g=0;if(a){m=a.analyze().flakyTests.map(d=>d.testId);let h=new Set(r.map(d=>`${d.file}:${d.suite}:${d.name}`)),T=m.filter(d=>h.has(d));g=i>0?T.length/i:0}let R=await this.getCoverageFromReport(),w=u>=e.thresholds.minPassRate&&g<=e.thresholds.maxFlakyRatio&&R>=e.thresholds.minCoverage;return{phaseId:e.id,phaseName:e.name,success:w,passRate:u,flakyRatio:g,coverage:R,durationMs:s,totalTests:i,passed:o,failed:l,skipped:c,testResults:r,flakyTests:m}}async getCoverageFromReport(){try{let e=await import("fs/promises"),t=await import("path"),s=this.config.coverageDir||"coverage",r=t.join(this.config.cwd||process.cwd(),s,"coverage-summary.json"),a=await e.readFile(r,"utf-8");return(y(a).total?.lines?.pct??0)/100}catch{return 0}}createErrorResult(e,t,s){return{phaseId:e.id,phaseName:e.name,success:!1,passRate:0,flakyRatio:0,coverage:0,durationMs:s,totalTests:0,passed:0,failed:0,skipped:0,testResults:[],flakyTests:[],error:t.message}}};function z(n){return new f(n)}import{spawn as Q}from"child_process";import{resolve as W,dirname as J,basename as M}from"path";var Y=[{sourcePattern:/^src\/(.+)\.ts$/,toTestPaths:(n,e)=>{let t=n[1];return[`tests/unit/${t}.test.ts`,`tests/unit/${t}.spec.ts`,`tests/${t}.test.ts`,`tests/${t}.spec.ts`,`src/${t}.test.ts`,`src/${t}.spec.ts`]}},{sourcePattern:/^src\/(.+)\/index\.ts$/,toTestPaths:(n,e)=>{let t=n[1];return[`tests/unit/${t}.test.ts`,`tests/unit/${t}/index.test.ts`,`tests/unit/${t}.spec.ts`]}},{sourcePattern:/\.(test|spec)\.(ts|tsx|js|jsx)$/,toTestPaths:(n,e)=>[e]},{sourcePattern:/^(vitest\.config|jest\.config|tsconfig|package\.json)/,toTestPaths:()=>["**/*.test.ts","**/*.spec.ts"]}],v=class{constructor(e){this.config=e;if(!e.impactAnalyzer)throw new Error("GitAwareTestSelector requires impactAnalyzer. Use ImpactAnalyzerService from code-intelligence domain. NO FALLBACK TO PATTERN MATCHING - use real dependency analysis.");this.cwd=e.cwd||process.cwd(),this.baseRef=e.baseRef||"HEAD~1",this.mappingRules=e.mappingRules||Y,this.impactAnalyzer=e.impactAnalyzer}cwd;baseRef;mappingRules;impactAnalyzer;async selectAffectedTests(){try{let e=await this.getChangedFiles();if(e.length===0)return{changedFiles:[],selectedTests:[],mappings:[],runAllTests:!1};let{selectedTests:t,mappings:s,runAllTests:r,runAllReason:a}=await this.mapChangesToTests(e);return{changedFiles:e,selectedTests:[...new Set(t)],mappings:s,runAllTests:r,runAllReason:a}}catch(e){return{changedFiles:[],selectedTests:[],mappings:[],runAllTests:!0,runAllReason:`Git error: ${e.message}`}}}async selectTestsForFiles(e){let t=e.map(o=>({path:o,changeType:"modified"})),{selectedTests:s,mappings:r,runAllTests:a,runAllReason:i}=await this.mapChangesToTests(t);return{changedFiles:t,selectedTests:[...new Set(s)],mappings:r,runAllTests:a,runAllReason:i}}async getChangedFiles(){let t=(await this.git(["diff","--name-status",this.baseRef,"HEAD"])).trim().split(`
|
|
4
|
+
`).filter(Boolean),s=[];for(let r of t){let[a,...i]=r.split(" "),o=i.join(" "),l,c;switch(a[0]){case"A":l="added";break;case"M":l="modified";break;case"D":l="deleted";break;case"R":l="renamed",c=o;break;default:l="modified"}s.push({path:l==="renamed"&&i[1]||o,changeType:l,previousPath:c})}return s}async getMergeBase(e="main"){try{return(await this.git(["merge-base","HEAD",e])).trim()}catch{return(await this.git(["merge-base","HEAD","master"])).trim()}}async mapChangesToTests(e){let t=[],s=[],r=!1,a;for(let l of e)if(this.isConfigFile(l.path))return{selectedTests:[],mappings:[],runAllTests:!0,runAllReason:`Config file changed: ${l.path}`};let i=e.filter(l=>l.changeType!=="deleted"||this.config.includeDeletedFileTests).map(l=>l.path);if(i.length===0)return{selectedTests:[],mappings:[],runAllTests:!1};let o=await this.impactAnalyzer.getImpactedTests(i);if(!o.success){let l=o,c=l.error instanceof Error?l.error.message:String(l.error);return{selectedTests:[],mappings:[],runAllTests:!0,runAllReason:`Impact analysis failed: ${c}`}}if(o.value.length===0)return{selectedTests:[],mappings:[],runAllTests:!1};t.push(...o.value);for(let l of e){if(l.changeType==="deleted"&&!this.config.includeDeletedFileTests)continue;let c=o.value.filter(u=>u.includes(M(l.path,".ts").replace(/\.(tsx?|jsx?)$/,"")));c.length>0&&s.push({sourceFile:l.path,testFiles:c,confidence:.95})}return{selectedTests:t,mappings:s,runAllTests:r,runAllReason:a}}isConfigFile(e){return/^(vitest\.config|jest\.config|tsconfig|package\.json)/.test(e)}async findTestsHeuristically(e){let t=M(e,".ts").replace(/\.(tsx?|jsx?)$/,""),s=J(e),r=[`${s}/${t}.test.ts`,`${s}/${t}.spec.ts`,`${s}/__tests__/${t}.test.ts`,`tests/${s}/${t}.test.ts`,`tests/unit/${s.replace("src/","")}/${t}.test.ts`];return this.filterExistingFiles(r)}async filterExistingFiles(e){let t=await import("fs/promises"),s=[];for(let r of e)try{let a=W(this.cwd,r);await t.access(a),s.push(r)}catch(a){console.debug("[TestSelector] File access check failed:",a instanceof Error?a.message:a)}return s}git(e){return new Promise((t,s)=>{let r="",a="",i=Q("git",e,{cwd:this.cwd});i.stdout.on("data",o=>{r+=o.toString()}),i.stderr.on("data",o=>{a+=o.toString()}),i.on("close",o=>{o===0?t(r):s(new Error(`git ${e.join(" ")} failed: ${a}`))}),i.on("error",s)})}};function F(n){return new v(n)}async function q(n,e,t){let r=await F({impactAnalyzer:n,baseRef:e,cwd:t}).selectAffectedTests();return r.runAllTests?[]:r.selectedTests}$();var K={minRunsForFlakiness:5,flakinessThreshold:.1,maxRecentErrors:5,historyRetentionDays:30},A=class{records=new Map;config;constructor(e){this.config={...K,...e}}recordResult(e){let t=this.getTestId(e),s=this.getOrCreateRecord(t,e);s.totalRuns++,s.lastRun=new Date,e.passed?s.passCount++:(s.failCount++,e.error&&(s.recentErrors=[e.error,...s.recentErrors.slice(0,this.config.maxRecentErrors-1)])),e.retries>0&&e.passed&&(s.flakyCount++,s.lastFlaky=new Date),s.flakinessScore=this.calculateFlakiness(s)}recordResults(e){for(let t of e)this.recordResult(t)}getRecord(e){return this.records.get(e)}getFlakyTests(){return Array.from(this.records.values()).filter(e=>e.totalRuns>=this.config.minRunsForFlakiness&&e.flakinessScore>=this.config.flakinessThreshold)}isFlaky(e){let t=this.records.get(e);return t?t.totalRuns>=this.config.minRunsForFlakiness&&t.flakinessScore>=this.config.flakinessThreshold:!1}analyze(){let e=Array.from(this.records.values()),t=e.filter(l=>l.totalRuns>=this.config.minRunsForFlakiness&&l.flakinessScore>=this.config.flakinessThreshold),s=e.filter(l=>l.totalRuns>=this.config.minRunsForFlakiness&&l.flakyCount>0&&l.flakinessScore<this.config.flakinessThreshold),r=e.filter(l=>l.totalRuns<this.config.minRunsForFlakiness),a=e.filter(l=>l.totalRuns>=this.config.minRunsForFlakiness),i=a.length>0?t.length/a.length:0,o=this.calculateTrend(t);return{totalTests:e.length,flakyTests:t.sort((l,c)=>c.flakinessScore-l.flakinessScore),stabilizedTests:s,insufficientData:r,overallFlakiness:i,trend:o}}getQuarantineList(e=.3){return Array.from(this.records.values()).filter(t=>t.flakinessScore>=e).map(t=>t.testId)}pruneHistory(){let e=new Date;e.setDate(e.getDate()-this.config.historyRetentionDays);let t=0;for(let[s,r]of this.records)r.lastRun<e&&(this.records.delete(s),t++);return t}exportHistory(){return Array.from(this.records.values())}importHistory(e){for(let t of e){let s={...t,lastRun:new Date(t.lastRun),lastFlaky:t.lastFlaky?new Date(t.lastFlaky):void 0};this.records.set(t.testId,s)}}reset(){this.records.clear()}getTestId(e){return`${e.file}:${e.suite}:${e.name}`}getOrCreateRecord(e,t){let s=this.records.get(e);return s||(s={testId:e,file:t.file,name:t.name,totalRuns:0,passCount:0,failCount:0,flakyCount:0,flakinessScore:0,lastRun:new Date,recentErrors:[]},this.records.set(e,s)),s}calculateFlakiness(e){if(e.totalRuns<this.config.minRunsForFlakiness)return 0;let t=e.flakyCount/e.totalRuns,s=e.passCount/e.totalRuns,r=s>0&&s<1?Math.min(s,1-s)*2:0;return Math.min(1,t*3+r)}calculateTrend(e){if(e.length===0)return"stable";let s=Date.now()-10080*60*1e3,r=0,a=0;for(let i of e)i.lastFlaky&&(i.lastFlaky.getTime()>s?r++:a++);return r>a*1.5?"degrading":a>r*1.5?"improving":"stable"}};function C(n){return new A(n)}async function G(n,e){let t=C({...e,historyPath:n});try{let r=await(await import("fs/promises")).readFile(n,"utf-8"),a=y(r);t.importHistory(a)}catch(s){console.debug("[FlakyTracker] History load failed, starting fresh:",s instanceof Error?s.message:s)}return t}async function D(n,e){let t=await import("fs/promises"),s=n.exportHistory();await t.writeFile(e,JSON.stringify(s,null,2))}var X={enableAnnotations:!0,enableSummary:!0,enableOutputs:!0,maxAnnotations:10,includeFlakyWarnings:!0,includeCoverage:!0};function H(){let n=process.env;return n.GITHUB_ACTIONS==="true"?{isCI:!0,provider:"github-actions",branch:n.GITHUB_HEAD_REF||n.GITHUB_REF_NAME,commitSha:n.GITHUB_SHA,prNumber:n.GITHUB_EVENT_NAME==="pull_request"&&parseInt(n.GITHUB_REF?.split("/")[2]||"",10)||void 0,baseBranch:n.GITHUB_BASE_REF,buildUrl:`${n.GITHUB_SERVER_URL}/${n.GITHUB_REPOSITORY}/actions/runs/${n.GITHUB_RUN_ID}`}:n.GITLAB_CI==="true"?{isCI:!0,provider:"gitlab-ci",branch:n.CI_COMMIT_REF_NAME,commitSha:n.CI_COMMIT_SHA,prNumber:n.CI_MERGE_REQUEST_IID?parseInt(n.CI_MERGE_REQUEST_IID,10):void 0,baseBranch:n.CI_MERGE_REQUEST_TARGET_BRANCH_NAME,buildUrl:n.CI_JOB_URL}:n.JENKINS_URL?{isCI:!0,provider:"jenkins",branch:n.GIT_BRANCH||n.BRANCH_NAME,commitSha:n.GIT_COMMIT,prNumber:n.CHANGE_ID?parseInt(n.CHANGE_ID,10):void 0,baseBranch:n.CHANGE_TARGET,buildUrl:n.BUILD_URL}:n.CIRCLECI==="true"?{isCI:!0,provider:"circleci",branch:n.CIRCLE_BRANCH,commitSha:n.CIRCLE_SHA1,prNumber:n.CIRCLE_PULL_REQUEST?parseInt(n.CIRCLE_PULL_REQUEST.split("/").pop()||"",10):void 0,buildUrl:n.CIRCLE_BUILD_URL}:n.CI==="true"||n.CI==="1"?{isCI:!0,provider:"unknown"}:{isCI:!1}}var S=class{config;constructor(e){this.config={...X,...e}}generateOutput(e){let t=this.config.enableAnnotations?this.generateAnnotations(e):[],s=this.config.enableSummary?this.generateSummary(e):"",r=this.config.enableOutputs?this.generateOutputs(e):{};return{summary:s,annotations:t,outputs:r}}async writeOutput(e){let t=this.generateOutput(e),s=await import("fs/promises");for(let r of t.annotations)this.writeAnnotation(r);if(t.summary&&process.env.GITHUB_STEP_SUMMARY&&await s.appendFile(process.env.GITHUB_STEP_SUMMARY,t.summary),process.env.GITHUB_OUTPUT){let r=Object.entries(t.outputs).map(([a,i])=>`${a}=${i}`).join(`
|
|
5
|
+
`);await s.appendFile(process.env.GITHUB_OUTPUT,r+`
|
|
6
|
+
`)}}generateAnnotations(e){let t=[];for(let s of e){for(let r of s.testResults)!r.passed&&t.length<this.config.maxAnnotations&&t.push({file:r.file,line:this.extractLineNumber(r.stack)||1,level:"error",title:`Test Failed: ${r.name}`,message:r.error||"Test failed without error message"});if(this.config.includeFlakyWarnings)for(let r of s.flakyTests)t.length<this.config.maxAnnotations&&t.push({file:r,line:1,level:"warning",title:"Flaky Test Detected",message:"This test is flaky and may cause intermittent failures"})}return t}generateSummary(e){let t=[`## \u{1F9EA} Test Results
|
|
7
|
+
`],s=e.every(i=>i.success);t.push(s?`\u2705 **All phases passed**
|
|
8
|
+
`:`\u274C **Some phases failed**
|
|
9
|
+
`),t.push("| Phase | Status | Pass Rate | Duration | Tests |"),t.push("|-------|--------|-----------|----------|-------|");for(let i of e){let o=i.success?"\u2705":"\u274C",l=`${(i.passRate*100).toFixed(1)}%`,c=this.formatDuration(i.durationMs),u=`${i.passed}/${i.totalTests}`;t.push(`| ${i.phaseName} | ${o} | ${l} | ${c} | ${u} |`)}if(t.push(""),this.config.includeCoverage){t.push(`### \u{1F4CA} Coverage
|
|
10
|
+
`);for(let i of e){let o=`${(i.coverage*100).toFixed(1)}%`,l=this.generateCoverageBar(i.coverage);t.push(`- **${i.phaseName}**: ${l} ${o}`)}t.push("")}let r=e.flatMap(i=>i.testResults.filter(o=>!o.passed));if(r.length>0){t.push(`### \u274C Failed Tests
|
|
11
|
+
`),t.push("<details>"),t.push(`<summary>Click to expand</summary>
|
|
12
|
+
`);for(let i of r.slice(0,20))t.push(`#### ${i.suite} > ${i.name}`),t.push(`- **File**: \`${i.file}\``),i.error&&(t.push("```"),t.push(i.error.slice(0,500)),t.push("```")),t.push("");r.length>20&&t.push(`_... and ${r.length-20} more failures_`),t.push(`</details>
|
|
13
|
+
`)}let a=e.flatMap(i=>i.flakyTests);if(a.length>0&&this.config.includeFlakyWarnings){t.push(`### \u26A0\uFE0F Flaky Tests
|
|
14
|
+
`);for(let i of a.slice(0,10))t.push(`- \`${i}\``);t.push("")}return t.join(`
|
|
15
|
+
`)}generateOutputs(e){let t=e.reduce((o,l)=>o+l.totalTests,0),s=e.reduce((o,l)=>o+l.passed,0),r=e.reduce((o,l)=>o+l.failed,0),a=e.every(o=>o.success),i=e.length>0?e.reduce((o,l)=>o+l.coverage,0)/e.length:0;return{test_result:a?"success":"failure",total_tests:String(t),passed_tests:String(s),failed_tests:String(r),coverage_percent:String((i*100).toFixed(1)),phases_completed:String(e.length),phases_passed:String(e.filter(o=>o.success).length),has_flaky_tests:String(e.some(o=>o.flakyTests.length>0))}}writeAnnotation(e){let t=[`file=${e.file}`,`line=${e.line}`,`title=${e.title}`].join(",");console.log(`::${e.level} ${t}::${e.message}`)}extractLineNumber(e){if(!e)return;let t=e.match(/:(\d+):\d+/);return t?parseInt(t[1],10):void 0}formatDuration(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}generateCoverageBar(e){let t=Math.round(e*10),s=10-t;return"\u2588".repeat(t)+"\u2591".repeat(s)}};function x(n){return new S(n)}async function Z(n,e){await x(e).writeOutput(n)}var E=class n{constructor(e,t,s,r,a,i){this.config=e;this.selector=t,this.executor=s,this.scheduler=r,this.flakyTracker=a,this.reporter=i,this.ciEnvironment=H()}selector;executor;scheduler;flakyTracker;reporter;ciEnvironment;static async create(e){let t=e.flakyHistoryPath?await G(e.flakyHistoryPath,e.flakyTracker):C(e.flakyTracker),s=new f({...e.vitest,cwd:e.cwd,flakyTracker:t}),{ImpactAnalyzerService:r}=await import("./impact-analyzer-UEIGXSZ4.js"),a=new r(e.memory),i=F({cwd:e.cwd,baseRef:e.baseRef,impactAnalyzer:a}),o=_(s,{...e.scheduler,phases:e.phases}),l=x(e.reporter);return new n(e,i,s,o,t,l)}async run(){let e=Date.now(),t=[],s=this.config.runAllTests??!1,r=performance.now();if(!s){let p=await this.selector.selectAffectedTests();p.runAllTests?(s=!0,console.log(`[TestSchedulingPipeline] Running all tests: ${p.runAllReason}`)):p.selectedTests.length===0?(console.log("[TestSchedulingPipeline] No affected tests found, running all"),s=!0):(t=p.selectedTests,console.log(`[TestSchedulingPipeline] Selected ${t.length} affected tests`))}let a=performance.now()-r;if(this.config.useDAGAttention&&t.length>0)try{let{isDAGAttentionEnabled:p}=await import("./feature-flags-IVQ3AL4Q.js");if(p()){let{createDAGAttentionScheduler:h}=await import("./dag-attention-scheduler-JWO6XI6A.js"),T=h(),d=t.map(P=>({id:P,name:P,estimatedDuration:1e3,dependencies:[],priority:1,tags:[]})),N=T.schedule(d),I=[];for(let P of N.phases)I.push(...P.tests.map(O=>O.id));I.length>0&&(t=I)}}catch(p){process.env.DEBUG&&console.debug("[Pipeline] DAG attention scheduling skipped:",p instanceof Error?p.message:p)}let i=performance.now(),o;s?o=await this.scheduler.run():o=await this.runWithSelectedTests(t);let l=performance.now()-i,c=performance.now(),u=this.flakyTracker.analyze();this.config.flakyHistoryPath&&await D(this.flakyTracker,this.config.flakyHistoryPath);let m=performance.now()-c,g=performance.now();this.ciEnvironment.isCI&&await this.reporter.writeOutput(o);let R=performance.now()-g,w=Date.now()-e;return{phaseResults:o,selectedTests:t,ranAllTests:s,flakyAnalysis:u,ciEnvironment:this.ciEnvironment,totalDurationMs:w,stepLatencies:{selectionMs:a,executionMs:l,analysisMs:m,reportingMs:R}}}async runPhase(e){return this.scheduler.runPhase(e)}getFlakyTracker(){return this.flakyTracker}getSelector(){return this.selector}getStats(){return this.scheduler.getStats()}async abort(){await this.scheduler.abort()}async runWithSelectedTests(e){let t=[],s=this.config.phases??[];for(let r of s){let a=e.filter(i=>r.testPatterns.some(o=>o.startsWith("!")?!1:this.patternToRegex(o).test(i)));if(a.length>0){let i=await this.executor.execute(r,a);t.push(i)}}return t}patternToRegex(e){let t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(t)}};async function U(n){return E.create(n)}async function ee(n){return(await U(n)).run()}export{B as DAGAttentionScheduler,k as DEFAULT_TEST_PHASES,A as FlakyTestTracker,v as GitAwareTestSelector,S as GitHubActionsReporter,b as PhaseScheduler,E as TestSchedulingPipeline,f as VitestPhaseExecutor,V as checkQualityThresholds,L as createDAGAttentionScheduler,C as createFlakyTracker,x as createGitHubActionsReporter,_ as createPhaseScheduler,U as createTestPipeline,F as createTestSelector,z as createVitestExecutor,H as detectCIEnvironment,q as getAffectedTests,G as loadFlakyTracker,Z as reportToGitHubActions,ee as runTestPipeline,D as saveFlakyTracker};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{b as r,e as l,f}from"./chunk-FGA7VIFR.js";import"./chunk-X5IJGWYG.js";import{b as k}from"./chunk-6EOS7KX2.js";import"./chunk-MV6CMOJQ.js";import"./chunk-JRYGQO2W.js";import"./chunk-4YS3IJ45.js";import"./chunk-24FKIJNC.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";import*as s from"path";import*as a from"fs";var u={enableOptimization:!0,enablePersistence:!0,storagePath:process.env.AQE_STORAGE_PATH??".agentic-qe",autoSaveIntervalMs:6e4,verbose:process.env.AQE_VERBOSE==="true"},i=!1,n=null,p=!1;async function B(t){if(i)return;let e={...u,...t};if(e.verbose&&console.log("[TokenBootstrap] Initializing token tracking..."),e.enablePersistence){let o=s.resolve(e.storagePath);a.existsSync(o)||a.mkdirSync(o,{recursive:!0})}if(e.enableOptimization)try{n=(await k(!0)).backend,await f(n,{enabled:!0,verbose:e.verbose}),e.verbose&&(console.log("[TokenBootstrap] TokenOptimizerService initialized"),console.log(`[TokenBootstrap] isEnabled() = ${l.isEnabled()}`))}catch(o){console.error("[TokenBootstrap] Failed to initialize TokenOptimizerService:",o)}if(e.enablePersistence){let o=s.join(e.storagePath,"token-metrics.json");r.configurePersistence({filePath:o,autoSaveIntervalMs:e.autoSaveIntervalMs});try{let c=await r.load();e.verbose&&console.log(`[TokenBootstrap] Loaded existing metrics: ${c}`)}catch{e.verbose&&console.log("[TokenBootstrap] No existing metrics to load")}r.startAutoSave(),e.verbose&&console.log(`[TokenBootstrap] Persistence configured: ${o}`)}p||(g(e.verbose),p=!0),i=!0,e.verbose&&console.log("[TokenBootstrap] Token tracking initialized successfully")}async function d(t=!1){if(i){if(t&&console.log("[TokenBootstrap] Shutting down token tracking..."),r.stopAutoSave(),r.hasUnsavedChanges())try{await r.save(),t&&console.log("[TokenBootstrap] Metrics saved successfully")}catch(e){console.error("[TokenBootstrap] Failed to save metrics:",e)}if(n){try{await n.dispose()}catch(e){console.debug("[TokenBootstrap] Memory backend disposal error:",e instanceof Error?e.message:e)}n=null}i=!1}}function h(){return i}function y(){return n}function g(t){let e=async o=>{t&&console.log(`[TokenBootstrap] Received ${o}, saving metrics...`),await d(t)};process.on("beforeExit",()=>e("beforeExit"))}export{B as bootstrapTokenTracking,y as getTokenMemoryBackend,h as isTokenTrackingInitialized,d as shutdownTokenTracking};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{a as k,b as u,d as S,e as f}from"./chunk-FGA7VIFR.js";import"./chunk-X5IJGWYG.js";import"./chunk-MV6CMOJQ.js";import"./chunk-JRYGQO2W.js";import"./chunk-4YS3IJ45.js";import"./chunk-3ZOONQG6.js";import"./chunk-SUSEVMZT.js";import"./chunk-JJO7Y4H3.js";import"./chunk-N2NS2PHA.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-WGMPEW2T.js";import{a as y,c as h}from"./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 v}from"commander";import e from"chalk";h();import*as p from"fs";function L(){return new v("token-usage").description("View and analyze token consumption metrics (ADR-042)").option("-p, --period <period>","Time period: 1h, 24h, 7d, 30d","24h").option("-a, --by-agent","Group usage by agent").option("-d, --by-domain","Group usage by domain").option("-r, --recommendations","Show optimization recommendations").option("-e, --export <file>","Export to CSV file").option("--dashboard","Show compact token budget dashboard summary").option("--cache-stats","Show session operation cache statistics (Imp-15)").option("--json","Output as JSON").option("-v, --verbose","Show detailed output").action(async n=>{await w(n)})}async function w(o){let n=R(o.period);try{o.cacheStats?await x(o):o.dashboard?console.log(k()):o.byAgent?await U(n,o):o.byDomain?await A(n,o):o.recommendations?await C(n,o):o.export?await E(n,o.export,o):await O(n,o)}catch(s){console.error(e.red(`Error: ${y(s)}`)),process.exit(1)}}async function O(o,n){let s=u.getSessionSummary(o);if(n.json){console.log(JSON.stringify($(s),null,2));return}console.log(e.bold.cyan(`
|
|
3
|
+
\u{1F4CA} Token Usage Summary
|
|
4
|
+
`)),console.log(e.gray(`Period: ${o}`)),console.log(e.gray(`Session: ${s.sessionId}
|
|
5
|
+
`)),console.log(e.bold("Total Usage:")),console.log(` Input tokens: ${l(s.totalUsage.inputTokens)}`),console.log(` Output tokens: ${l(s.totalUsage.outputTokens)}`),console.log(` Total tokens: ${l(s.totalUsage.totalTokens)}`),s.totalUsage.estimatedCostUsd!==void 0&&console.log(` Estimated cost: ${T(s.totalUsage.estimatedCostUsd)}`),console.log(e.bold(`
|
|
6
|
+
Optimization Stats:`));let{optimizationStats:i}=s;if(console.log(` Patterns reused: ${i.patternsReused}`),console.log(` Cache hits: ${i.cacheHits}`),console.log(` Early exits: ${i.earlyExits}`),console.log(` Tokens saved: ${l(i.tokensSaved)}`),console.log(` Savings percentage: ${e.green(`${i.savingsPercentage.toFixed(1)}%`)}`),n.verbose){console.log(e.bold(`
|
|
7
|
+
Agents:`));for(let[d,c]of s.byAgent)console.log(` ${d}: ${l(c.totalTokens)} tokens (${c.tasksExecuted} tasks)`);console.log(e.bold(`
|
|
8
|
+
Domains:`));for(let[d,c]of s.byDomain)console.log(` ${d}: ${l(c.totalTokens)} tokens`)}let g=f.getReuseStats();g&&g.totalAttempts>0&&(console.log(e.bold(`
|
|
9
|
+
Early Exit Optimizer:`)),console.log(` Total attempts: ${g.totalAttempts}`),console.log(` Successful reuses: ${g.totalReuses}`),console.log(` Exit rate: ${(g.exitRate*100).toFixed(1)}%`),console.log(` Avg search latency: ${g.avgSearchLatencyMs.toFixed(1)}ms`)),console.log("")}async function x(o){let n=S().getStats();if(o.json){console.log(JSON.stringify(n,null,2));return}console.log(e.bold.cyan(`
|
|
10
|
+
Session Operation Cache (Imp-15)
|
|
11
|
+
`)),console.log(` Cache size: ${n.size} entries`),console.log(` Cache hits: ${n.hits}`),console.log(` Cache misses: ${n.misses}`),console.log(` Hit rate: ${e.green(`${(n.hitRate*100).toFixed(1)}%`)}`),console.log(` Tokens saved: ${e.green(l(n.estimatedTokensSaved))}`),console.log(e.gray(`
|
|
12
|
+
O(1) fingerprint lookups run before O(log n) HNSW search`)),console.log("")}async function U(o,n){let s=u.getAgentMetrics(void 0,o),i=Array.isArray(s)?s:[s];if(n.json){console.log(JSON.stringify(i,null,2));return}if(console.log(e.bold.cyan(`
|
|
13
|
+
\u{1F4CA} Token Usage by Agent
|
|
14
|
+
`)),console.log(e.gray(`Period: ${o}
|
|
15
|
+
`)),i.length===0){console.log(e.yellow("No agent metrics available."));return}let g=i.sort((r,m)=>m.totalTokens-r.totalTokens);console.log(e.bold(t("Agent",25)+t("Input",12)+t("Output",12)+t("Total",12)+t("Tasks",8)+t("Saved",12))),console.log(e.gray("\u2500".repeat(81)));for(let r of g)console.log(t(b(r.agentId,24),25)+t(l(r.totalInputTokens),12)+t(l(r.totalOutputTokens),12)+t(l(r.totalTokens),12)+t(String(r.tasksExecuted),8)+e.green(t(l(r.estimatedTokensSaved),12)));let d=g.reduce((r,m)=>r+m.totalTokens,0),c=g.reduce((r,m)=>r+m.tasksExecuted,0),a=g.reduce((r,m)=>r+m.estimatedTokensSaved,0);console.log(e.gray("\u2500".repeat(81))),console.log(e.bold(t("TOTAL",25)+t("",12)+t("",12)+t(l(d),12)+t(String(c),8)+e.green(t(l(a),12)))),console.log("")}async function A(o,n){let s=u.getDomainMetrics(void 0,o);if(!(s instanceof Map)){console.log(e.yellow("Single domain metrics not supported for --by-domain"));return}if(n.json){let c=Object.fromEntries(s);console.log(JSON.stringify(c,null,2));return}if(console.log(e.bold.cyan(`
|
|
16
|
+
\u{1F4CA} Token Usage by Domain
|
|
17
|
+
`)),console.log(e.gray(`Period: ${o}
|
|
18
|
+
`)),s.size===0){console.log(e.yellow("No domain metrics available."));return}let i=Array.from(s.entries()).sort((c,a)=>a[1].totalTokens-c[1].totalTokens);console.log(e.bold(t("Domain",25)+t("Input",15)+t("Output",15)+t("Total",15)+t("Cost",12))),console.log(e.gray("\u2500".repeat(82)));for(let[c,a]of i)console.log(t(b(c,24),25)+t(l(a.inputTokens),15)+t(l(a.outputTokens),15)+t(l(a.totalTokens),15)+t(T(a.estimatedCostUsd||0),12));let g=i.reduce((c,[a,r])=>c+r.totalTokens,0),d=i.reduce((c,[a,r])=>c+(r.estimatedCostUsd||0),0);console.log(e.gray("\u2500".repeat(82))),console.log(e.bold(t("TOTAL",25)+t("",15)+t("",15)+t(l(g),15)+t(T(d),12))),console.log("")}async function C(o,n){let s=u.getTokenEfficiency(o);if(n.json){console.log(JSON.stringify(s,null,2));return}if(console.log(e.bold.cyan(`
|
|
19
|
+
\u{1F4A1} Token Optimization Recommendations
|
|
20
|
+
`)),console.log(e.gray(`Period: ${o}
|
|
21
|
+
`)),console.log(e.bold("Current Efficiency:")),console.log(` Total tokens used: ${l(s.totalTokensUsed)}`),console.log(` Total tokens saved: ${e.green(l(s.totalTokensSaved))}`),console.log(` Savings percentage: ${e.green(`${s.savingsPercentage.toFixed(1)}%`)}`),console.log(` Pattern reuse rate: ${(s.patternReuseRate*100).toFixed(1)}%`),console.log(` Avg tokens per task: ${l(s.averageTokensPerTask)}`),console.log(e.bold(`
|
|
22
|
+
Recommendations:`)),s.recommendations.length===0)console.log(e.green(" \u2713 Token usage is optimized!"));else for(let g of s.recommendations)console.log(` ${e.yellow("\u2022")} ${g}`);let i=f.getReuseStats();i&&(console.log(e.bold(`
|
|
23
|
+
Pattern Reuse Analysis:`)),i.exitRate<.1&&i.totalAttempts>10&&console.log(` ${e.yellow("\u2022")} Low early exit rate (${(i.exitRate*100).toFixed(1)}%). Consider lowering similarity threshold.`),i.reasonBreakdown.confidence_too_low>i.totalAttempts*.3&&console.log(` ${e.yellow("\u2022")} Many patterns rejected for low confidence. Review pattern training.`),i.reasonBreakdown.pattern_too_old>i.totalAttempts*.2&&console.log(` ${e.yellow("\u2022")} Patterns expiring frequently. Consider increasing max pattern age.`)),console.log("")}async function E(o,n,s){let i=u.getTaskMetrics(o),g=["Task ID","Agent ID","Domain","Operation","Input Tokens","Output Tokens","Total Tokens","Cost (USD)","Pattern Reused","Tokens Saved","Timestamp"],d=i.map(a=>[a.taskId,a.agentId,a.domain,a.operation,a.usage.inputTokens,a.usage.outputTokens,a.usage.totalTokens,a.usage.estimatedCostUsd?.toFixed(6)||"0",a.patternReused?"Yes":"No",a.tokensSaved||0,new Date(a.timestamp).toISOString()]),c=[g.join(","),...d.map(a=>a.map(P).join(","))].join(`
|
|
24
|
+
`);if(p.writeFileSync(n,c),console.log(e.green(`\u2713 Exported ${i.length} records to ${n}`)),s.verbose){let a=u.getSessionSummary(o),r=n.replace(".csv","-summary.json");p.writeFileSync(r,JSON.stringify($(a),null,2)),console.log(e.green(`\u2713 Exported summary to ${r}`))}}function R(o){return o&&["1h","24h","7d","30d"].includes(o)?o:"24h"}function l(o){return o>=1e6?(o/1e6).toFixed(1)+"M":o>=1e3?(o/1e3).toFixed(1)+"K":String(o)}function T(o){return o<.01?`$${o.toFixed(4)}`:`$${o.toFixed(2)}`}function t(o,n){return o.padEnd(n)}function b(o,n){return o.length<=n?o:o.slice(0,n-1)+"\u2026"}function P(o){let n=String(o);return n.includes(",")||n.includes('"')||n.includes(`
|
|
25
|
+
`)?`"${n.replace(/"/g,'""')}"`:n}function $(o){return{sessionId:o.sessionId,startTime:o.startTime,endTime:o.endTime,totalUsage:o.totalUsage,optimizationStats:o.optimizationStats,byAgent:Object.fromEntries(o.byAgent),byDomain:Object.fromEntries(o.byDomain)}}export{L as createTokenUsageCommand};
|
|
@@ -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,f,g,h,i,j,k,l,m,n,o}from"./chunk-CL6POIX4.js";import"./chunk-4I2IOUS4.js";export{i as DotProductAttention,h as FlashAttention,k as HyperbolicAttention,l as LinearAttention,m as MoEAttention,j as MultiHeadAttention,b as RuvectorLayer,n as SonaEngine,c as TensorCompress,a as default,d as differentiableSearch,f as getCompressionLevel,e as hierarchicalForward,g as init,o as pipeline};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{d as L,e as $}from"./chunk-4VUPRTVX.js";import"./chunk-4I2IOUS4.js";$();import*as U from"node:fs";import G from"node:module";import*as F from"node:path";import{fileURLToPath as V}from"node:url";var b=L("TreeSitterWASM"),R={python:{wasmFile:"tree-sitter-python.wasm",nodeTypes:{functionDecl:["function_definition"],classDecl:["class_definition"],importDecl:["import_statement","import_from_statement"]}},java:{wasmFile:"tree-sitter-java.wasm",nodeTypes:{functionDecl:["method_declaration","constructor_declaration"],classDecl:["class_declaration","interface_declaration"],importDecl:["import_declaration"]}},csharp:{wasmFile:"tree-sitter-c_sharp.wasm",nodeTypes:{functionDecl:["method_declaration","constructor_declaration"],classDecl:["class_declaration","interface_declaration"],importDecl:["using_directive"]}},rust:{wasmFile:"tree-sitter-rust.wasm",nodeTypes:{functionDecl:["function_item"],classDecl:[],importDecl:["use_declaration"],implBlock:"impl_item",structDecl:"struct_item"}},swift:{wasmFile:"tree-sitter-swift.wasm",nodeTypes:{functionDecl:["function_declaration"],classDecl:["class_declaration"],importDecl:["import_declaration"],structDecl:"struct_declaration",protocolDecl:"protocol_declaration"}}},g=null,N=null,x=0,P=3,w=new Map;function A(s){let e=V(new URL(".",import.meta.url)),t=[F.resolve(e,"..","..","..","assets","grammars",s),F.resolve(e,"..","..","assets","grammars",s),F.resolve(process.cwd(),"assets","grammars",s),F.resolve(e,"..","assets","grammars",s)];for(let n of t)if(U.existsSync(n))return n;throw new Error(`Grammar file ${s} not found. Searched: ${t.join(", ")}`)}async function B(){if(x>=P)throw new Error(`web-tree-sitter failed to initialize after ${P} attempts`);if(!g)return N||(N=(async()=>{try{let s=await import("./web-tree-sitter-7C4NXEOF.js"),e=s.default||s;await e.init(),g=e,x=0,b.info("web-tree-sitter WASM runtime initialized")}catch(s){x++,N=null;let e=s instanceof Error?s.message:String(s);throw b.warn(`web-tree-sitter WASM init failed (attempt ${x}/${P}): ${e}. `+(x<P?"Will retry on next parse.":"Falling back to regex permanently.")),s}})()),N}async function J(s){let e=w.get(s);if(e)return e;await B();let t=R[s];if(!t)throw new Error(`No WASM grammar config for ${s}`);try{let n=A(t.wasmFile),i=await g.Language.load(n);return w.set(s,i),b.info(`Loaded tree-sitter WASM grammar for ${s}`),i}catch(n){let i=n instanceof Error?n.message:String(n);throw b.warn(`Failed to load WASM grammar for ${s}: ${i}. Falling back to regex parser.`),n}}function u(s,e){let t=[];for(let n=0;n<s.childCount;n++){let i=s.child(n);e.includes(i.type)&&t.push(i)}return t}function y(s,e,t=10){let n=[];function i(r,o){if(!(o>t))for(let a=0;a<r.childCount;a++){let c=r.child(a);e.includes(c.type)&&n.push(c),i(c,o+1)}}return i(s,0),n}function h(s){let e=[];for(let t=0;t<s.childCount;t++){let n=s.child(t);(n.type==="modifiers"||n.type==="modifier"||n.type==="visibility_modifier")&&e.push(n.text.trim())}return e}function I(s,e){return h(s).some(t=>t.includes(e))}var X=new Set(["if_statement","if_expression","if_let_statement","while_statement","while_expression","for_statement","for_in_statement","for_expression","enhanced_for_statement","match_expression","switch_statement","switch_expression","case_clause","match_arm","switch_entry","catch_clause","except_clause","catch_block","binary_expression","conditional_expression","ternary_expression"]),Y=new Set(["&&","||","and","or"]);function _(s){if(!s)return 1;let e=1;function t(n){if(X.has(n.type))if(n.type==="binary_expression"){let i=n.childForFieldName("operator");i&&Y.has(i.text)&&e++}else e++;for(let i=0;i<n.childCount;i++)t(n.child(i))}return t(s),e}function S(s,e){if(!s)return[];let t=[];for(let n=0;n<s.childCount;n++){let i=s.child(n);switch(e){case"java":if(i.type==="field_declaration"){let r=h(i),o=i.childForFieldName("type")?.text?.trim(),a=i.childForFieldName("declarator"),c=a?.childForFieldName("name")?.text??a?.text?.split(/[=;]/)[0]?.trim()??"";c&&t.push({name:c,type:o||void 0,isPublic:r.some(l=>l.includes("public")),isReadonly:r.some(l=>l.includes("final"))})}break;case"csharp":if(i.type==="field_declaration"||i.type==="property_declaration"){let r=h(i),o=i.childForFieldName("type")?.text?.trim(),a=i.childForFieldName("name")?.text??"";a&&t.push({name:a,type:o||void 0,isPublic:r.some(c=>c.includes("public")),isReadonly:r.some(c=>c.includes("readonly"))})}break;case"rust":if(i.type==="field_declaration"){let r=i.childForFieldName("name")?.text??"",o=i.childForFieldName("type")?.text?.trim(),a=I(i,"pub");r&&t.push({name:r,type:o||void 0,isPublic:a,isReadonly:!1})}break;case"swift":if(i.type==="property_declaration"){let r=T(i),o=i.childForFieldName("name")?.text??"",a=i.childForFieldName("type")?.text?.trim(),c=r.includes("public")||r.includes("open"),l=i.text.includes("let ");o&&t.push({name:o,type:a||void 0,isPublic:c,isReadonly:l})}break;case"python":if(i.type==="expression_statement"){let r=i.child(0);if(r?.type==="assignment"){let o=r.childForFieldName("left");if(o?.type==="attribute"||o?.type==="identifier"){let a=o.text.replace("self.","");t.push({name:a,type:void 0,isPublic:!a.startsWith("_"),isReadonly:!1})}}}break}}return t}function O(s){return s.map(e=>{let t=e.childForFieldName("name")?.text??"",n=e.childForFieldName("parameters"),i=e.childForFieldName("return_type"),r=e.childForFieldName("body"),o=e.text.trimStart().startsWith("async"),a=E(e);return{name:t,parameters:q(n),returnType:i?.text?.trim()||void 0,isAsync:o,isPublic:!t.startsWith("_"),complexity:_(r),decorators:a,genericParams:[],startLine:e.startPosition.row+1,endLine:e.endPosition.row+1}})}function q(s){if(!s)return[];let e=[];for(let t=0;t<s.childCount;t++){let n=s.child(t);if(n.type==="identifier"){let i=n.text;if(i==="self"||i==="cls")continue;e.push({name:i,type:void 0,isOptional:!1,defaultValue:void 0})}else if(n.type==="typed_parameter"){let i=n.child(0)?.text??"";if(i==="self"||i==="cls")continue;let r=n.childForFieldName("type")?.text?.trim();e.push({name:i,type:r||void 0,isOptional:!1,defaultValue:void 0})}else if(n.type==="default_parameter"||n.type==="typed_default_parameter"){let i=n.childForFieldName("name")?.text??n.child(0)?.text??"";if(i==="self"||i==="cls")continue;let r=n.childForFieldName("type")?.text?.trim(),o=n.childForFieldName("value")?.text?.trim();e.push({name:i,type:r||void 0,isOptional:!0,defaultValue:o||void 0})}else if(n.type==="list_splat_pattern"||n.type==="dictionary_splat_pattern"){let i=n.text;e.push({name:i,type:void 0,isOptional:!0,defaultValue:void 0})}}return e}function E(s){let e=[],t=s.parent;if(!t)return e;if(t.type==="decorated_definition")for(let n=0;n<t.childCount;n++){let i=t.child(n);i.type==="decorator"&&e.push(i.text.trim())}return e}function z(s){return s.map(e=>{let t=e.childForFieldName("name")?.text??"",n=e.childForFieldName("body"),i=e.childForFieldName("superclasses"),r=[];if(i)for(let l=0;l<i.childCount;l++){let d=i.child(l);d.isNamed&&r.push(d.text)}let o=n?y(n,["function_definition"],2):[],a=O(o),c=E(e);return{name:t,methods:a,properties:S(n,"python"),isPublic:!t.startsWith("_"),implements:[],extends:r[0]||void 0,decorators:c,startLine:e.startPosition.row+1,endLine:e.endPosition.row+1}})}function Q(s){return s.map(e=>{if(e.type==="import_from_statement"){let n=e.childForFieldName("module_name")?.text??"",i=[];for(let r=0;r<e.childCount;r++){let o=e.child(r);e.fieldNameForChild(r)==="name"&&o.isNamed&&i.push(o.text)}return{module:n,namedImports:i,isTypeOnly:!1}}return{module:e.childForFieldName("name")?.text??"",namedImports:[],isTypeOnly:!1}})}function C(s){return s.map(e=>{let t=e.childForFieldName("name")?.text??"",n=e.childForFieldName("type"),i=e.childForFieldName("parameters"),r=e.childForFieldName("body"),a=h(e).some(d=>d.includes("public")),c=n?.text?.includes("CompletableFuture")??!1,l=k(e);return{name:t,parameters:H(i),returnType:n?.text==="void"?void 0:n?.text?.trim(),isAsync:c,isPublic:a,complexity:_(r),decorators:l,genericParams:[],startLine:e.startPosition.row+1,endLine:e.endPosition.row+1}})}function H(s){if(!s)return[];let e=[];for(let t=0;t<s.childCount;t++){let n=s.child(t);if(n.type==="formal_parameter"||n.type==="spread_parameter"){let i=n.childForFieldName("name")?.text??"",r=n.childForFieldName("type")?.text?.trim();e.push({name:i,type:r||void 0,isOptional:!1,defaultValue:void 0})}}return e}function k(s){let e=[];for(let t=0;t<s.childCount;t++){let n=s.child(t);if(n.type==="modifiers")for(let i=0;i<n.childCount;i++){let r=n.child(i);(r.type==="marker_annotation"||r.type==="annotation")&&e.push(r.text.trim())}}return e}function K(s){return s.map(e=>{let t=e.childForFieldName("name")?.text??"",n=e.childForFieldName("body"),r=h(e).some(p=>p.includes("public")),o=e.childForFieldName("superclass")?.text,a=e.childForFieldName("interfaces"),c=[];if(a)for(let p=0;p<a.childCount;p++){let f=a.child(p);f.isNamed&&c.push(f.text)}let l=n?u(n,["method_declaration","constructor_declaration"]):[],d=C(l),m=k(e);return{name:t,methods:d,properties:S(n,"java"),isPublic:r,implements:c,extends:o||void 0,decorators:m,startLine:e.startPosition.row+1,endLine:e.endPosition.row+1}})}function Z(s){return s.map(e=>{let t=e.text.replace(/^\s*import\s+(static\s+)?/,"").replace(/;\s*$/,"").trim(),n=t.split("."),i=n[n.length-1];return{module:t,namedImports:i==="*"?[]:[i],isTypeOnly:!1}})}function ee(s){return y(s,["method_declaration","constructor_declaration"]).map(t=>{let n=t.childForFieldName("name")?.text??"",i=t.childForFieldName("type"),r=t.childForFieldName("parameters"),o=h(t),a=o.some(d=>d.includes("public")),c=o.some(d=>d.includes("async"))||i?.text?.includes("Task")||!1,l=W(t);return{name:n,parameters:te(r),returnType:i?.text==="void"?void 0:i?.text?.trim(),isAsync:c,isPublic:a,complexity:_(t.childForFieldName("body")),decorators:l,genericParams:[],startLine:t.startPosition.row+1,endLine:t.endPosition.row+1}})}function te(s){if(!s)return[];let e=[];for(let t=0;t<s.childCount;t++){let n=s.child(t);if(n.type==="parameter"){let i=n.childForFieldName("name")?.text??"",r=n.childForFieldName("type")?.text?.trim();e.push({name:i,type:r||void 0,isOptional:r?.endsWith("?")||!1,defaultValue:void 0})}}return e}function W(s){let e=[];for(let t=0;t<s.childCount;t++){let n=s.child(t);n.type==="attribute_list"&&e.push(n.text.trim())}return e}function ne(s){return y(s,["class_declaration","interface_declaration"]).map(t=>{let n=t.childForFieldName("name")?.text??"",i=t.childForFieldName("body"),o=h(t).some(p=>p.includes("public")),a=t.childForFieldName("bases"),c=[];if(a)for(let p=0;p<a.childCount;p++){let f=a.child(p);f.isNamed&&c.push(f.text)}let l=i?u(i,["method_declaration","constructor_declaration"]):[],d=C(l),m=W(t);return{name:n,methods:d,properties:S(i,"csharp"),isPublic:o,implements:c.slice(1),extends:c[0]||void 0,decorators:m,startLine:t.startPosition.row+1,endLine:t.endPosition.row+1}})}function ie(s){return y(s,["using_directive"]).map(t=>({module:t.text.replace(/^\s*using\s+(static\s+)?/,"").replace(/;\s*$/,"").trim(),namedImports:[],isTypeOnly:!1}))}function se(s,e){let t=[],n=u(s,e.nodeTypes.functionDecl);if(t.push(...n.map(D)),e.nodeTypes.implBlock){let i=u(s,[e.nodeTypes.implBlock]);for(let r of i){let o=r.childForFieldName("body");if(o){let a=u(o,e.nodeTypes.functionDecl);t.push(...a.map(D))}}}return t}function D(s){let e=s.childForFieldName("name")?.text??"",t=s.childForFieldName("parameters"),n=s.childForFieldName("return_type"),i=s.childForFieldName("body"),r=I(s,"pub"),o=s.text.trimStart().startsWith("pub async")||s.text.trimStart().startsWith("async"),a=M(s);return{name:e,parameters:re(t),returnType:n?.text?.trim()||void 0,isAsync:o,isPublic:r,complexity:_(i),decorators:a,genericParams:[],startLine:s.startPosition.row+1,endLine:s.endPosition.row+1}}function re(s){if(!s)return[];let e=[];for(let t=0;t<s.childCount;t++){let n=s.child(t);if(n.type==="parameter"){let i=n.childForFieldName("pattern"),r=n.childForFieldName("type"),o=i?.text??"",a=r?.text?.trim();e.push({name:o,type:a||void 0,isOptional:!1,defaultValue:void 0})}else if(n.type==="self_parameter")continue}return e}function M(s){let e=[],t=s.previousNamedSibling;for(;t&&t.type==="attribute_item";)e.unshift(t.text.trim()),t=t.previousNamedSibling;return e}function oe(s){let e=[],t=u(s,["struct_item","enum_item","trait_item"]);for(let n of t){let i=n.childForFieldName("name")?.text??"",r=I(n,"pub"),o=M(n),a=n.childForFieldName("body");e.push({name:i,methods:[],properties:S(a,"rust"),isPublic:r,implements:[],extends:void 0,decorators:o,startLine:n.startPosition.row+1,endLine:n.endPosition.row+1})}return e}function ae(s){return u(s,["use_declaration"]).map(t=>({module:t.childForFieldName("argument")?.text??t.text.replace(/^\s*use\s+/,"").replace(/;\s*$/,"").trim(),namedImports:[],isTypeOnly:!1}))}function j(s){return s.map(e=>{let t="",n=[],i,r=T(e),o=r.includes("public")||r.includes("open"),a=!1;for(let l=0;l<e.childCount;l++){let d=e.child(l);e.fieldNameForChild(l)==="name"&&(d.type==="simple_identifier"?t=d.text:t||(i=d.text)),d.type==="parameter"&&n.push(d),(d.type==="async"||d.text==="async")&&(a=!0)}if(!t){for(let l=0;l<e.childCount;l++)if(e.child(l).type==="simple_identifier"){t=e.child(l).text;break}}let c=null;for(let l=0;l<e.childCount;l++)if(e.child(l).type==="function_body"){c=e.child(l);break}return{name:t,parameters:ce(n),returnType:i,isAsync:a,isPublic:o,complexity:_(c),decorators:[],genericParams:[],startLine:e.startPosition.row+1,endLine:e.endPosition.row+1}})}function T(s){let e=[];for(let t=0;t<s.childCount;t++){let n=s.child(t);if(n.type==="modifiers")for(let i=0;i<n.childCount;i++)e.push(n.child(i).text.trim())}return e}function ce(s){return s.map(e=>{let n=e.text.split(":"),i=n[0]?.trim().split(/\s+/)??[],r=i[i.length-1]||"",o=n.slice(1).join(":").trim()||void 0;return{name:r,type:o,isOptional:o?.endsWith("?")||!1,defaultValue:void 0}})}function le(s){return u(s,["class_declaration","struct_declaration","protocol_declaration"]).map(n=>{let i=n.childForFieldName("name"),r=i?.text??"",o=T(n),a=o.includes("public")||o.includes("open"),c=[];for(let p=0;p<n.childCount;p++){let f=n.child(p);f.type==="type_identifier"&&f!==i&&c.push(f.text),(f.type==="inheritance_specifier"||f.type==="user_type")&&c.push(f.text)}let l=n.childForFieldName("body"),d=l?y(l,["function_declaration"],2):[],m=j(d);return{name:r,methods:m,properties:S(l,"swift"),isPublic:a,implements:c.slice(1),extends:c[0]||void 0,decorators:[],startLine:n.startPosition.row+1,endLine:n.endPosition.row+1}})}function de(s){return u(s,["import_declaration"]).map(t=>{let n="";for(let i=0;i<t.childCount;i++){let r=t.child(i);(r.type==="identifier"||r.type==="simple_identifier")&&(n=r.text)}return{module:n,namedImports:[],isTypeOnly:!1}})}var v=class{language;supportedExtensions;constructor(e,t){this.language=e,this.supportedExtensions=t}async parseFile(e,t){let n=await J(this.language),i=new g;i.setLanguage(n);let r=i.parse(e),o=r.rootNode;try{return{...this.extractFromAST(o),language:this.language,filePath:t}}finally{r.delete(),i.delete()}}extractFromAST(e){let t=R[this.language];switch(this.language){case"python":{let n=u(e,t.nodeTypes.functionDecl),i=u(e,["decorated_definition"]).map(d=>{for(let m=0;m<d.childCount;m++)if(t.nodeTypes.functionDecl.includes(d.child(m).type))return d.child(m);return null}).filter(Boolean),r=[...n,...i],o=u(e,t.nodeTypes.classDecl),a=u(e,["decorated_definition"]).map(d=>{for(let m=0;m<d.childCount;m++)if(t.nodeTypes.classDecl.includes(d.child(m).type))return d.child(m);return null}).filter(Boolean),c=[...o,...a],l=u(e,t.nodeTypes.importDecl);return{functions:O(r),classes:z(c),imports:Q(l)}}case"java":{let n=y(e,t.nodeTypes.classDecl),i=u(e,t.nodeTypes.importDecl),o=[...u(e,t.nodeTypes.functionDecl)];for(let a of n){let c=a.childForFieldName("body");c&&o.push(...u(c,t.nodeTypes.functionDecl))}return{functions:C(o),classes:K(n),imports:Z(i)}}case"csharp":return{functions:ee(e),classes:ne(e),imports:ie(e)};case"rust":return{functions:se(e,t),classes:oe(e),imports:ae(e)};case"swift":{let n=y(e,t.nodeTypes.functionDecl);return{functions:j(n),classes:le(e),imports:de(e)}}default:return{functions:[],classes:[],imports:[]}}}},ue={python:[".py"],java:[".java"],csharp:[".cs"],rust:[".rs"],swift:[".swift"]};function ye(){let s=new Map;for(let[e,t]of Object.entries(ue))s.set(e,new v(e,t));return s}function he(){if(process.env.AQE_PARSER_REGEX_ONLY==="1"||process.env.AQE_PARSER_REGEX_ONLY==="true")return!1;try{let{createRequire:s}=G;return s(import.meta.url).resolve("web-tree-sitter"),A("tree-sitter-python.wasm"),!0}catch{return!1}}function xe(){g=null,N=null,x=0,w.clear()}export{v as TreeSitterWASMParser,xe as _resetWasmState,ye as createWasmParsers,he as isWasmAvailable};
|
|
@@ -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,f,g}from"./chunk-HRO6OZQD.js";import"./chunk-4I2IOUS4.js";export{e as BudgetExceededError,f as ComplexityAnalysisError,b as DEFAULT_BUDGET_CONFIG,c as DEFAULT_ROUTER_CONFIG,d as ModelRouterError,g as RoutingTimeoutError,a as TIER_METADATA};
|
|
@@ -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,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,o}from"./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{a as c,b as d,c as e}from"./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";o();export{a as ALLOWED_TABLE_NAMES,c as BinaryHeap,i as DEFAULT_UNIFIED_MEMORY_CONFIG,d as InMemoryHNSWIndex,e as RuvectorFlatIndex,k as UnifiedMemoryManager,f as clearProjectRootCache,g as findProjectRoot,h as getDefaultDbPath,j as getResolvedDefaultConfig,l as getUnifiedMemory,m as initializeUnifiedMemory,n as resetUnifiedMemory,b as validateTableName};
|
|
@@ -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,f}from"./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";f();export{a as BinaryHeap,b as InMemoryHNSWIndex,c as RuvectorFlatIndex,d as UnifiedHnswIndex,e as createHnswIndex};
|
|
@@ -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-GRUUQAR6.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 DEFAULT_UNIFIED_CONFIG,b as UnifiedPersistenceManager,c as getUnifiedPersistence,d as initializeUnifiedPersistence,e as resetUnifiedPersistence};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{e as P}from"./chunk-BDIEMZ22.js";import"./chunk-Y7BHKZFJ.js";import{a as V}from"./chunk-TWUWL5EJ.js";import"./chunk-KP5NUODU.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import{b as v,d as F}from"./chunk-WGMPEW2T.js";import"./chunk-JZSDOIXA.js";import"./chunk-DRT3WKQW.js";import"./chunk-4I2IOUS4.js";F();import{Command as M}from"commander";import{readFileSync as A,writeFileSync as S,existsSync as C,readdirSync as O,statSync as B}from"fs";import{join as b,resolve as j,basename as I}from"path";import e from"chalk";function R(i){let n=j(i);if(!C(n))throw new Error(`Input path not found: ${n}`);if(B(n).isDirectory()){let r=[],t=O(n).filter(o=>o.endsWith(".json")).map(o=>b(n,o));for(let o of t)try{let u=v(A(o,"utf-8"));if($(u))r.push(u);else if(Array.isArray(u))for(let d of u)$(d)&&r.push(d)}catch{console.warn(e.yellow(`Warning: Could not parse ${I(o)}`))}return r}else{let r=v(A(n,"utf-8"));if($(r))return[r];if(Array.isArray(r))return r.filter($);throw new Error("Invalid input format. Expected ParallelValidationRunResult or array of results.")}}function $(i){return typeof i=="object"&&i!==null&&"runId"in i&&"model"in i&&"outcomes"in i&&Array.isArray(i.outcomes)}function D(){return V({storeQEPattern:async()=>{},searchQEPatterns:async()=>({success:!0,value:[]}),addFact:async()=>({success:!0,value:void 0}),query:async()=>({success:!0,value:{results:[],confidence:0}}),getStats:()=>({totalPatterns:0,totalFacts:0,indexHealth:1,lastCompaction:new Date})})}function T(){let i=process.cwd(),n=[b(i,".claude/skills/trust-tier-manifest.json"),b(i,".claude/skills/skills-manifest.json")];for(let g of n)if(C(g))return g;return b(i,".claude/skills/trust-tier-manifest.json")}function L(i,n,g){let r=g.format||"markdown";if(r==="markdown"||r==="both"){let t=n.generateMarkdownReport(i);if(g.output){let o=r==="both"?g.output.replace(/\.\w+$/,".md"):g.output;S(o,t),console.log(e.green(`Markdown report written to: ${o}`))}else console.log(`
|
|
3
|
+
`+t)}if(r==="json"||r==="both"){let t=n.generateJsonReport(i);if(g.output){let o=r==="both"?g.output.replace(/\.\w+$/,".json"):g.output;S(o,t),console.log(e.green(`JSON report written to: ${o}`))}else console.log(`
|
|
4
|
+
`+t)}}function G(i,n,g){let r=new M("skill").description("Skill validation and reporting (ADR-056)");return r.command("report").description("Generate aggregated report from validation results").requiredOption("-i, --input <path>","Input file or directory containing validation results").option("-o, --output <path>","Output file path (default: stdout)").option("-f, --format <format>","Output format: markdown, json, or both","markdown").option("-b, --baseline <path>","Baseline directory for regression detection").option("--detect-regressions","Enable regression detection against historical data").option("--update-manifest","Update trust tier manifest with new pass rates").option("-t, --threshold <number>","Regression threshold (0-1)",parseFloat).option("-v, --verbose","Verbose output").action(async t=>{try{t.verbose&&(console.log(e.blue(`
|
|
5
|
+
Validation Result Aggregator`)),console.log(e.gray(`ADR-056 Phase 5
|
|
6
|
+
`))),console.log(e.gray(`Loading results from: ${t.input}`));let o=R(t.input);if(o.length===0){console.log(e.yellow("No validation results found")),await n(0);return}console.log(e.gray(`Loaded ${o.length} validation run(s)`));let u=T(),d=D(),f=P(d,u,{regressionThreshold:t.threshold??.1,autoUpdateManifest:t.updateManifest??!1});console.log(e.gray("Aggregating results..."));let a=await f.aggregateResults(o);if(console.log(`
|
|
7
|
+
`+e.bold("Summary:")),console.log(` Total Skills: ${e.white(a.summary.totalSkills)}`),console.log(` Passed: ${e.green(a.summary.passedSkills)}`),console.log(` Failed: ${e.red(a.summary.failedSkills)}`),console.log(` Avg Pass Rate: ${e.cyan((a.summary.avgPassRate*100).toFixed(1)+"%")}`),console.log(` Total Tests: ${e.white(a.summary.totalTests)}`),console.log(` Duration: ${e.gray((a.summary.totalDurationMs/1e3).toFixed(1)+"s")}`),a.regressions.length>0){console.log(`
|
|
8
|
+
`+e.bold.red("Regressions Detected:"));for(let c of a.regressions.slice(0,5)){let m=c.regressionAmount>.2?e.red(" !"):e.yellow(" !");console.log(`${m} ${c.skill} (${c.model}): ${(c.previousPassRate*100).toFixed(1)}% -> ${(c.currentPassRate*100).toFixed(1)}%`)}a.regressions.length>5&&console.log(e.gray(` ... and ${a.regressions.length-5} more`))}if(a.recommendations.length>0&&t.verbose){console.log(`
|
|
9
|
+
`+e.bold("Recommendations:"));for(let c of a.recommendations)console.log(e.cyan(` - ${c}`))}L(a,f,t),t.updateManifest&&(console.log(e.gray(`
|
|
10
|
+
Updating manifest: ${u}`)),await f.updateManifest(a),console.log(e.green("Manifest updated successfully"))),console.log(""),await n(0)}catch(o){console.error(e.red(`
|
|
11
|
+
Error:`),o instanceof Error?o.message:o),t.verbose&&o instanceof Error&&console.error(e.gray(o.stack)),await n(1)}}),r.command("summary").description("Show quick summary of validation results").requiredOption("-i, --input <path>","Input file or directory").action(async t=>{try{let o=R(t.input);if(o.length===0){console.log(e.yellow("No validation results found")),await n(0);return}let u=0,d=0,f=0,a=new Set,c=new Set;for(let m of o){a.add(m.model);for(let h of m.outcomes)c.add(h.skillName),d+=h.testCaseResults.length,f+=h.testCaseResults.filter(y=>y.passed).length}u=c.size,console.log(`
|
|
12
|
+
`+e.bold("Quick Summary")),console.log(e.gray("-".repeat(30))),console.log(` Validation Runs: ${e.white(o.length)}`),console.log(` Models: ${e.cyan(Array.from(a).join(", "))}`),console.log(` Unique Skills: ${e.white(u)}`),console.log(` Total Tests: ${e.white(d)}`),console.log(` Passed: ${e.green(f)} (${(f/d*100).toFixed(1)}%)`),console.log(` Failed: ${e.red(d-f)}`),console.log(""),await n(0)}catch(o){console.error(e.red(`
|
|
13
|
+
Error:`),o instanceof Error?o.message:o),await n(1)}}),r.command("compare").description("Compare two validation runs").requiredOption("-a, --run-a <path>","First validation run").requiredOption("-b, --run-b <path>","Second validation run").option("-o, --output <path>","Output comparison report").action(async t=>{try{let o=R(t.runA),u=R(t.runB);if(o.length===0||u.length===0){console.log(e.yellow("Both runs must contain validation results")),await n(1);return}let d=new Map,f=new Map;for(let s of o)for(let l of s.outcomes){let w=l.testCaseResults.filter(p=>p.passed).length/(l.testCaseResults.length||1);d.set(l.skillName,w)}for(let s of u)for(let l of s.outcomes){let w=l.testCaseResults.filter(p=>p.passed).length/(l.testCaseResults.length||1);f.set(l.skillName,w)}let a=new Set([...d.keys(),...f.keys()]),c=[],m=[],h=[],y=[],k=[];for(let s of a){let l=d.get(s),w=f.get(s);if(l===void 0)y.push(s);else if(w===void 0)k.push(s);else{let p=w-l;p>.05?c.push({skill:s,delta:p}):p<-.05?m.push({skill:s,delta:Math.abs(p)}):h.push(s)}}if(c.sort((s,l)=>l.delta-s.delta),m.sort((s,l)=>l.delta-s.delta),console.log(`
|
|
14
|
+
`+e.bold("Validation Run Comparison")),console.log(e.gray("-".repeat(40))),c.length>0){console.log(`
|
|
15
|
+
`+e.green("Improved:"));for(let{skill:s,delta:l}of c.slice(0,10))console.log(` + ${s}: +${(l*100).toFixed(1)}%`)}if(m.length>0){console.log(`
|
|
16
|
+
`+e.red("Regressed:"));for(let{skill:s,delta:l}of m.slice(0,10))console.log(` - ${s}: -${(l*100).toFixed(1)}%`)}if(y.length>0){console.log(`
|
|
17
|
+
`+e.blue("New Skills:"));for(let s of y.slice(0,5))console.log(` * ${s}`)}if(k.length>0){console.log(`
|
|
18
|
+
`+e.yellow("Removed Skills:"));for(let s of k.slice(0,5))console.log(` * ${s}`)}if(console.log(`
|
|
19
|
+
`+e.gray(`Unchanged: ${h.length} skills`)),t.output){let s={timestamp:new Date().toISOString(),runA:t.runA,runB:t.runB,improved:c,regressed:m,unchanged:h,newSkills:y,removedSkills:k};S(t.output,JSON.stringify(s,null,2)),console.log(e.green(`
|
|
20
|
+
Comparison written to: ${t.output}`))}console.log(""),await n(m.length>0?1:0)}catch(o){console.error(e.red(`
|
|
21
|
+
Error:`),o instanceof Error?o.message:o),await n(1)}}),r}export{G as createValidateCommand};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{a as i,b as v,c as d,d as p}from"./chunk-BDIEMZ22.js";import{a as h}from"./chunk-IFNIIK34.js";import"./chunk-YPFOCNOE.js";import"./chunk-VSVXUTJN.js";import"./chunk-Y7BHKZFJ.js";import{a as k}from"./chunk-TWUWL5EJ.js";import"./chunk-3NZLZHJI.js";import"./chunk-KP5NUODU.js";import"./chunk-AFLLQ5PP.js";import"./chunk-TLHP5EII.js";import"./chunk-4YS3IJ45.js";import"./chunk-YW2THB5Q.js";import"./chunk-5T2ZQWKF.js";import"./chunk-3ZOONQG6.js";import"./chunk-SUSEVMZT.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";import{Command as x}from"commander";import o from"chalk";function _(e,t,a){let c=new x("validate").description("Validation commands for skills and agents");return c.command("swarm").description("Validate skills in parallel using Claude Flow swarms (ADR-056)").option("-s, --skills <skills>",'Comma-separated list of skills to validate, or "all" for P0 skills',"all").option("-m, --models <models>","Comma-separated list of models to validate against",p.join(",")).option("-t, --topology <topology>","Swarm topology: hierarchical or mesh","hierarchical").option("--max-concurrent <number>","Maximum concurrent skill validations",String(i.maxConcurrentSkills)).option("--max-models <number>","Maximum concurrent models per skill",String(i.maxConcurrentModels)).option("--timeout <ms>","Timeout per validation in milliseconds",String(i.timeout)).option("--no-retry","Disable retries on failure").option("-v, --verbose","Show detailed output").option("--json","Output results as JSON").action(async l=>{if(await a())try{console.log(o.blue(`
|
|
3
|
+
Swarm Skill Validation
|
|
4
|
+
`));let r=l.skills==="all"?[...d]:l.skills.split(",").map(y=>y.trim()),u=l.models.split(",").map(y=>y.trim()),g=P(l.topology),n={topology:g,maxConcurrentSkills:parseInt(l.maxConcurrent,10)||i.maxConcurrentSkills,maxConcurrentModels:parseInt(l.maxModels,10)||i.maxConcurrentModels,timeout:parseInt(l.timeout,10)||i.timeout,continueOnFailure:!0,retry:l.retry!==!1?i.retry:void 0};l.verbose&&(console.log(o.gray("Configuration:")),console.log(o.gray(` Topology: ${n.topology}`)),console.log(o.gray(` Skills: ${r.length}`)),console.log(o.gray(` Models: ${u.length}`)),console.log(o.gray(` Max Concurrent Skills: ${n.maxConcurrentSkills}`)),console.log(o.gray(` Max Concurrent Models: ${n.maxConcurrentModels}`)),console.log(o.gray(` Timeout: ${n.timeout}ms`)),console.log(o.gray(` Retry: ${n.retry?"enabled":"disabled"}`)),console.log("")),console.log(o.cyan(` Skills: ${r.join(", ")}`)),console.log(o.cyan(` Models: ${u.join(", ")}`)),console.log(o.cyan(` Topology: ${g}`)),console.log("");let m=await R(e),f=k(m),C=v(n,f),w=Date.now();console.log(o.yellow(` Starting parallel validation...
|
|
5
|
+
`));let $=await C.validateSkillsParallel(r,u),s=C.getSummary($),b=Date.now()-w;l.json?T(s):V(s,l.verbose),console.log(o.blue(`
|
|
6
|
+
Summary
|
|
7
|
+
`)),console.log(` Total validations: ${o.white(s.results.length)}`),console.log(` Passed: ${o.green(s.successCount)}`),console.log(` Failed: ${o.red(s.failureCount)}`),console.log(` Pass rate: ${D(s.overallPassRate)}`),console.log(` Total time: ${o.gray(S(b))}`),console.log(` Avg time per validation: ${o.gray(S(s.avgDurationMs))}`),console.log("");let M=s.failureCount>0?1:0;await t(M)}catch(r){console.error(o.red(`
|
|
8
|
+
Validation failed:`),r),await t(1)}}),c.command("list").description("List available P0 skills for validation").action(async()=>{console.log(o.blue(`
|
|
9
|
+
P0 Skills (Trust Tier 3)
|
|
10
|
+
`));for(let l of d)console.log(` ${o.green("*")} ${o.white(l)}`);console.log(o.gray(`
|
|
11
|
+
Total: ${d.length} skills
|
|
12
|
+
`)),console.log(o.cyan(` Default Models:
|
|
13
|
+
`));for(let l of p)console.log(` ${o.blue("*")} ${o.white(l)}`);console.log(""),await t(0)}),c}function P(e){let t=e.toLowerCase().trim();return t==="hierarchical"||t==="mesh"?t:(console.log(o.yellow(` Warning: Invalid topology "${e}", using hierarchical`)),"hierarchical")}async function R(e){return h({sqlite:{dbPath:".agentic-qe/validation.db",walMode:!0},embeddings:{quantized:!0,enableCache:!0,maxCacheSize:5e3},enableLearning:!0,enableRouting:!0,enableGuidance:!1,hnsw:{M:16,efConstruction:200,efSearch:100},routingWeights:{similarity:.4,performance:.35,capabilities:.25}})}function T(e){let t={summary:{totalSkills:e.totalSkills,totalModels:e.totalModels,successCount:e.successCount,failureCount:e.failureCount,overallPassRate:e.overallPassRate,totalDurationMs:e.totalDurationMs,avgDurationMs:e.avgDurationMs,topology:e.topology},results:e.results.map(a=>({skill:a.skill,model:a.model,schemaValid:a.schemaValid,validatorPassed:a.validatorPassed,evalPassRate:a.evalPassRate,durationMs:a.durationMs,errors:a.errors,trustTier:a.trustTier,validationLevel:a.validationLevel,retryCount:a.retryCount,timestamp:a.timestamp.toISOString()}))};console.log(JSON.stringify(t,null,2))}function V(e,t){console.log(o.cyan(` Results by Skill:
|
|
14
|
+
`));for(let[a,c]of e.bySkill){let l=c.filter(n=>n.errors.length===0&&n.evalPassRate>=.9).length,r=c.length,u=r>0?l/r:0,g=u>=.9?o.green("*"):u>=.7?o.yellow("!"):o.red("x");if(console.log(` ${g} ${o.white(a)}`),console.log(o.gray(` Pass rate: ${(u*100).toFixed(1)}% (${l}/${r})`)),t)for(let n of c){let m=n.errors.length===0?o.green("+"):o.red("-");if(console.log(` ${m} ${n.model}: ${(n.evalPassRate*100).toFixed(1)}% (${S(n.durationMs)})`),n.errors.length>0)for(let f of n.errors)console.log(o.red(` Error: ${f}`))}console.log("")}}function D(e){let t=`${(e*100).toFixed(1)}%`;return e>=.9?o.green(t):e>=.7?o.yellow(t):o.red(t)}function S(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;let t=Math.floor(e/6e4),a=(e%6e4/1e3).toFixed(0);return`${t}m ${a}s`}export{_ as createValidateSwarmCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{c as t}from"./chunk-4I2IOUS4.js";import{createRequire as o}from"module";var i,e,a,c,l,p,s,m,u,d,A,f,h,_,b,v,L,n=t(()=>{i=o(import.meta.url),e=i("vibium"),a=e,{RuvectorLayer:c,TensorCompress:l,differentiableSearch:p,hierarchicalForward:s,getCompressionLevel:m,init:u,FlashAttention:d,DotProductAttention:A,MultiHeadAttention:f,HyperbolicAttention:h,LinearAttention:_,MoEAttention:b,SonaEngine:v,pipeline:L}=e||{}});n();export{A as DotProductAttention,d as FlashAttention,h as HyperbolicAttention,_ as LinearAttention,b as MoEAttention,f as MultiHeadAttention,c as RuvectorLayer,v as SonaEngine,l as TensorCompress,a as default,p as differentiableSearch,m as getCompressionLevel,s as hierarchicalForward,u as init,L as pipeline};
|
|
@@ -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-U5RN7YQW.js";import"./chunk-NZ2VCPN4.js";import"./chunk-24FKIJNC.js";import"./chunk-SUSEVMZT.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 VisualSecurityTool};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import"./chunk-4I2IOUS4.js";import{createRequire as t}from"module";var o=t(import.meta.url),e=o("web-tree-sitter"),i=e,{RuvectorLayer:n,TensorCompress:a,differentiableSearch:c,hierarchicalForward:s,getCompressionLevel:l,init:p,FlashAttention:m,DotProductAttention:u,MultiHeadAttention:d,HyperbolicAttention:A,LinearAttention:f,MoEAttention:h,SonaEngine:_,pipeline:b}=e||{};export{u as DotProductAttention,m as FlashAttention,A as HyperbolicAttention,f as LinearAttention,h as MoEAttention,d as MultiHeadAttention,n as RuvectorLayer,_ as SonaEngine,a as TensorCompress,i as default,c as differentiableSearch,l as getCompressionLevel,s as hierarchicalForward,p as init,b as pipeline};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import{b as u}from"./chunk-4YOMLWEK.js";import{a as f,c as h}from"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";h();import{existsSync as i,mkdirSync as d,readFileSync as g,writeFileSync as a}from"fs";import{join as p,dirname as v}from"path";var c=class{projectRoot;overwrite;generator;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.generator=u()}async install(){let e={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let t=this.generator.generateMcpConfig("windsurf"),r=p(this.projectRoot,t.path);if(e.configPath=r,!i(r)||this.overwrite){let o=v(r);if(i(o)||d(o,{recursive:!0}),i(r)&&this.overwrite){let m=this.mergeExistingConfig(r,t.content);a(r,m)}else a(r,t.content);e.mcpConfigured=!0}let n=this.generator.generateBehavioralRules("windsurf"),s=p(this.projectRoot,n.path);if(e.rulesPath=s,!i(s)||this.overwrite){if(i(s)&&this.overwrite){let o=this.mergeExistingRules(s,n.content);a(s,o)}else a(s,n.content);e.rulesInstalled=!0}}catch(t){e.success=!1,e.errors.push(`Windsurf installation failed: ${f(t)}`)}return e}mergeExistingConfig(e,t){try{let r=JSON.parse(g(e,"utf-8")),n=JSON.parse(t);return r.mcpServers||(r.mcpServers={}),Object.assign(r.mcpServers,n.mcpServers),JSON.stringify(r,null,2)+`
|
|
3
|
+
`}catch{return t}}mergeExistingRules(e,t){try{let r=g(e,"utf-8");return r.includes("Agentic QE")||r.includes("fleet_init")?r:r.trimEnd()+`
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
`+t}catch{return t}}};function w(l){return new c(l)}export{c as WindsurfInstaller,w as createWindsurfInstaller};
|
|
@@ -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,f,g}from"./chunk-5T2ZQWKF.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-2I7J3O6V.js";import"./chunk-4I2IOUS4.js";export{c as PersistentWitnessChain,a as SPRTAccumulator,b as WitnessChain,f as createPersistentWitnessChain,e as createWitnessChain,d as createWitnessChainSQLitePersistence,g as isWitnessChainFeatureEnabled};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
|
|
2
|
+
import"./chunk-N5UXCLFI.js";import{b as $}from"./chunk-YANUP2RO.js";import{d as R}from"./chunk-OLHKGP35.js";import{b as k,c as C,d as b}from"./chunk-RU5WAHB7.js";import"./chunk-3ZOONQG6.js";import{c as W}from"./chunk-WGMPEW2T.js";import"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";import{Command as O}from"commander";import o from"chalk";function P(d,a){let m=d.indexOf("=");return m>0&&(a[d.substring(0,m)]=d.substring(m+1)),a}function x(d,a,m){let y=new O("workflow").description("Manage QE workflows and pipelines (ADR-041)");return y.command("run <file>").description("Execute a QE pipeline from YAML file").option("-w, --watch","Watch execution progress").option("-v, --verbose","Show detailed output").option("--params <json>","Additional parameters as JSON","{}").action(async(t,l)=>{if(!await m())return;let e=await import("fs"),c=(await import("path")).resolve(t);try{console.log(o.blue(`
|
|
3
|
+
Running workflow from: ${t}
|
|
4
|
+
`));let s=k(c);if(!s.success||!s.workflow){console.log(o.red("Failed to parse pipeline:"));for(let w of s.errors)console.log(o.red(` ${w}`));await a(1)}let r={...W(l.params,"params")};if(s.pipeline){for(let w of s.pipeline.stages)if(w.params)for(let[S,h]of Object.entries(w.params))r[S]=h}if(!d.workflowOrchestrator.getWorkflow(s.workflow.id)){let w=d.workflowOrchestrator.registerWorkflow(s.workflow);w.success||(console.log(o.red(`Failed to register workflow: ${w.error.message}`)),await a(1))}let n=await d.workflowOrchestrator.executeWorkflow(s.workflow.id,r);if(!n.success){console.log(o.red(`Failed to start workflow: ${n.error.message}`)),await a(1);return}let p=n.value;if(console.log(o.cyan(` Execution ID: ${p}`)),console.log(o.gray(` Workflow: ${s.workflow.name}`)),console.log(o.gray(` Stages: ${s.workflow.steps.length}`)),console.log(""),l.watch){console.log(o.blue(`Workflow Progress:
|
|
5
|
+
`));let w,S=Date.now();for(;;){let g=d.workflowOrchestrator.getWorkflowStatus(p);if(!g)break;if(!w||w.progress!==g.progress||w.status!==g.status||JSON.stringify(w.currentSteps)!==JSON.stringify(g.currentSteps)){process.stdout.write("\r\x1B[K");let v="\u2588".repeat(Math.floor(g.progress/5))+"\u2591".repeat(20-Math.floor(g.progress/5)),D=g.status==="completed"?o.green:g.status==="failed"?o.red:g.status==="running"?o.yellow:o.gray;console.log(` [${v}] ${g.progress}% - ${D(g.status)}`),g.currentSteps.length>0&&l.verbose&&console.log(o.gray(` Running: ${g.currentSteps.join(", ")}`)),w=g}if(g.status==="completed"||g.status==="failed"||g.status==="cancelled")break;await new Promise(v=>setTimeout(v,500))}let h=d.workflowOrchestrator.getWorkflowStatus(p);if(h){console.log("");let g=h.duration||Date.now()-S;h.status==="completed"?(console.log(o.green("Workflow completed successfully")),console.log(o.gray(` Duration: ${$(g)}`)),console.log(o.gray(` Completed: ${h.completedSteps.length} stages`)),h.skippedSteps.length>0&&console.log(o.yellow(` Skipped: ${h.skippedSteps.length} stages`))):h.status==="failed"?(console.log(o.red("Workflow failed")),console.log(o.red(` Error: ${h.error}`)),console.log(o.gray(` Failed stages: ${h.failedSteps.join(", ")}`))):console.log(o.yellow(`Workflow ${h.status}`))}}else console.log(o.green("Workflow execution started")),console.log(o.gray(` Use 'aqe workflow status ${p}' to check progress`));console.log(""),await a(0)}catch(s){console.error(o.red(`
|
|
6
|
+
Failed to run workflow:`),s),await a(1)}}),y.command("schedule <file>").description("Schedule a QE pipeline for recurring execution").option("-c, --cron <expression>","Override cron schedule from file").option("-e, --enable","Enable immediately",!0).action(async(t,l)=>{if(!await m())return;let u=(await import("path")).resolve(t);try{console.log(o.blue(`
|
|
7
|
+
Scheduling workflow from: ${t}
|
|
8
|
+
`));let c=k(u);if(!c.success||!c.pipeline||!c.workflow){console.log(o.red("Failed to parse pipeline:"));for(let n of c.errors)console.log(o.red(` ${n}`));await a(1)}let s=l.cron||c.pipeline.schedule;if(s||(console.log(o.red("No schedule specified")),console.log(o.gray(' Add "schedule" field to YAML or use --cron option')),await a(1)),!d.workflowOrchestrator.getWorkflow(c.workflow.id)){let n=d.workflowOrchestrator.registerWorkflow(c.workflow);n.success||(console.log(o.red(`Failed to register workflow: ${n.error.message}`)),await a(1))}let r=R({workflowId:c.workflow.id,pipelinePath:u,schedule:s,scheduleDescription:b(s),enabled:l.enable!==!1});await d.persistentScheduler.saveSchedule(r);let i={id:r.id,workflowId:r.workflowId,pipelinePath:r.pipelinePath,schedule:r.schedule,scheduleDescription:r.scheduleDescription,nextRun:new Date(r.nextRun),enabled:r.enabled,createdAt:new Date(r.createdAt)};d.scheduledWorkflows.set(i.id,i),console.log(o.green("Workflow scheduled successfully (persisted to disk)")),console.log(o.cyan(` Schedule ID: ${r.id}`)),console.log(o.gray(` Workflow: ${c.workflow.name}`)),console.log(o.gray(` Schedule: ${s}`)),console.log(o.gray(` Description: ${r.scheduleDescription}`)),console.log(o.gray(` Next run: ${r.nextRun}`)),console.log(o.gray(` Status: ${r.enabled?o.green("enabled"):o.yellow("disabled")}`)),console.log(o.yellow(`
|
|
9
|
+
Note: Scheduled workflows require daemon mode to run automatically`)),console.log(o.gray(" Start daemon with: npx aqe daemon start")),console.log(o.gray(" Schedules are persisted to: ~/.aqe/schedules.json")),console.log(""),await a(0)}catch(c){console.error(o.red(`
|
|
10
|
+
Failed to schedule workflow:`),c),await a(1)}}),y.command("list").description("List workflows").option("-s, --scheduled","Show only scheduled workflows").option("-a, --active","Show only active executions").option("--all","Show all workflows (registered + scheduled + active)").action(async t=>{if(await m())try{if(console.log(o.blue(`
|
|
11
|
+
Workflows
|
|
12
|
+
`)),t.scheduled||t.all){console.log(o.cyan("Scheduled Workflows:"));let l=await d.persistentScheduler.getSchedules();if(l.length===0)console.log(o.gray(` No scheduled workflows
|
|
13
|
+
`));else for(let e of l){let u=e.enabled?o.green("*"):o.gray("o");console.log(` ${u} ${o.white(e.workflowId)}`),console.log(o.gray(` ID: ${e.id}`)),console.log(o.gray(` Schedule: ${e.schedule} (${e.scheduleDescription})`)),console.log(o.gray(` File: ${e.pipelinePath}`)),console.log(o.gray(` Next run: ${e.nextRun}`)),e.lastRun&&console.log(o.gray(` Last run: ${e.lastRun}`)),console.log(o.gray(` Status: ${e.enabled?o.green("enabled"):o.yellow("disabled")}`)),console.log("")}}if(t.active||t.all){console.log(o.cyan("Active Executions:"));let l=d.workflowOrchestrator.getActiveExecutions();if(l.length===0)console.log(o.gray(` No active executions
|
|
14
|
+
`));else for(let e of l){let u=e.status==="running"?o.yellow:o.gray;console.log(` ${u("*")} ${o.white(e.workflowName)}`),console.log(o.gray(` Execution: ${e.executionId}`)),console.log(o.gray(` Status: ${e.status}`)),console.log(o.gray(` Progress: ${e.progress}%`)),e.currentSteps.length>0&&console.log(o.gray(` Current: ${e.currentSteps.join(", ")}`)),console.log("")}}if(!t.scheduled&&!t.active||t.all){console.log(o.cyan("Registered Workflows:"));let l=d.workflowOrchestrator.listWorkflows();if(l.length===0)console.log(o.gray(` No registered workflows
|
|
15
|
+
`));else for(let e of l)console.log(` ${o.white(e.name)} (${o.cyan(e.id)})`),console.log(o.gray(` Version: ${e.version}`)),console.log(o.gray(` Steps: ${e.stepCount}`)),e.description&&console.log(o.gray(` ${e.description}`)),e.tags&&e.tags.length>0&&console.log(o.gray(` Tags: ${e.tags.join(", ")}`)),e.triggers&&e.triggers.length>0&&console.log(o.gray(` Triggers: ${e.triggers.join(", ")}`)),console.log("")}await a(0)}catch(l){console.error(o.red(`
|
|
16
|
+
Failed to list workflows:`),l),await a(1)}}),y.command("validate <file>").description("Validate a pipeline YAML file").option("-v, --verbose","Show detailed validation results").action(async(t,l)=>{let e=await import("fs"),c=(await import("path")).resolve(t);try{console.log(o.blue(`
|
|
17
|
+
Validating pipeline: ${t}
|
|
18
|
+
`)),e.existsSync(c)||(console.log(o.red(`File not found: ${c}`)),await a(1));let s=k(c);if(!s.success){console.log(o.red("Parse errors:"));for(let r of s.errors)console.log(o.red(` * ${r}`));await a(1)}let f=C(s.pipeline);if(f.valid)console.log(o.green(`Pipeline is valid
|
|
19
|
+
`));else{console.log(o.red(`Pipeline has errors:
|
|
20
|
+
`));for(let r of f.errors)console.log(o.red(` x [${r.path}] ${r.message}`));console.log("")}if(f.warnings.length>0){console.log(o.yellow("Warnings:"));for(let r of f.warnings)console.log(o.yellow(` * [${r.path}] ${r.message}`));console.log("")}if(l.verbose&&s.pipeline){let r=s.pipeline;console.log(o.cyan(`Pipeline Details:
|
|
21
|
+
`)),console.log(o.gray(` Name: ${r.name}`)),console.log(o.gray(` Version: ${r.version||"1.0.0"}`)),r.description&&console.log(o.gray(` Description: ${r.description}`)),r.schedule&&console.log(o.gray(` Schedule: ${r.schedule} (${b(r.schedule)})`)),r.tags&&r.tags.length>0&&console.log(o.gray(` Tags: ${r.tags.join(", ")}`)),console.log(o.cyan(`
|
|
22
|
+
Stages:`));for(let i=0;i<r.stages.length;i++){let n=r.stages[i];console.log(` ${i+1}. ${o.white(n.name)}`),console.log(o.gray(` Command: ${n.command}`)),n.params&&console.log(o.gray(` Params: ${JSON.stringify(n.params)}`)),n.depends_on&&n.depends_on.length>0&&console.log(o.gray(` Depends on: ${n.depends_on.join(", ")}`)),n.timeout&&console.log(o.gray(` Timeout: ${n.timeout}s`))}if(r.triggers&&r.triggers.length>0){console.log(o.cyan(`
|
|
23
|
+
Triggers:`));for(let i of r.triggers)console.log(o.gray(` * ${i.event}`)),i.branches&&console.log(o.gray(` Branches: ${i.branches.join(", ")}`))}}if(l.verbose&&s.workflow){console.log(o.cyan(`
|
|
24
|
+
Converted Workflow ID: `)+o.white(s.workflow.id)),console.log(o.gray(` Steps: ${s.workflow.steps.length}`));for(let r of s.workflow.steps)console.log(o.gray(` * ${r.id}: ${r.domain}.${r.action}`))}console.log(""),await a(f.valid?0:1)}catch(s){console.error(o.red(`
|
|
25
|
+
Validation failed:`),s),await a(1)}}),y.command("status <executionId>").description("Get workflow execution status").option("-v, --verbose","Show detailed step results").action(async(t,l)=>{if(await m())try{let e=d.workflowOrchestrator.getWorkflowStatus(t);if(!e){console.log(o.red(`
|
|
26
|
+
Execution not found: ${t}
|
|
27
|
+
`)),await a(1);return}console.log(o.blue(`
|
|
28
|
+
Workflow Execution Status
|
|
29
|
+
`));let u=e.status==="completed"?o.green:e.status==="failed"?o.red:e.status==="running"?o.yellow:o.gray;if(console.log(` Execution ID: ${o.cyan(e.executionId)}`),console.log(` Workflow: ${o.white(e.workflowName)} (${e.workflowId})`),console.log(` Status: ${u(e.status)}`),console.log(` Progress: ${e.progress}%`),console.log(` Started: ${e.startedAt.toISOString()}`),e.completedAt&&console.log(` Completed: ${e.completedAt.toISOString()}`),e.duration&&console.log(` Duration: ${$(e.duration)}`),console.log(o.cyan(`
|
|
30
|
+
Step Summary:`)),console.log(o.gray(` Completed: ${e.completedSteps.length}`)),console.log(o.gray(` Skipped: ${e.skippedSteps.length}`)),console.log(o.gray(` Failed: ${e.failedSteps.length}`)),e.currentSteps.length>0&&console.log(o.yellow(` Running: ${e.currentSteps.join(", ")}`)),e.error&&console.log(o.red(`
|
|
31
|
+
Error: ${e.error}`)),l.verbose&&e.stepResults.size>0){console.log(o.cyan(`
|
|
32
|
+
Step Results:`));for(let[c,s]of e.stepResults){let f=s.status==="completed"?o.green:s.status==="failed"?o.red:s.status==="skipped"?o.yellow:o.gray;console.log(` ${f("*")} ${o.white(c)}: ${f(s.status)}`),s.duration&&console.log(o.gray(` Duration: ${$(s.duration)}`)),s.error&&console.log(o.red(` Error: ${s.error}`)),s.retryCount&&s.retryCount>0&&console.log(o.yellow(` Retries: ${s.retryCount}`))}}console.log(""),await a(0)}catch(e){console.error(o.red(`
|
|
33
|
+
Failed to get workflow status:`),e),await a(1)}}),y.command("cancel <executionId>").description("Cancel a running workflow").action(async t=>{if(await m())try{let l=await d.workflowOrchestrator.cancelWorkflow(t);l.success?console.log(o.green(`
|
|
34
|
+
Workflow cancelled: ${t}
|
|
35
|
+
`)):console.log(o.red(`
|
|
36
|
+
Failed to cancel workflow: ${l.error.message}
|
|
37
|
+
`)),await a(l.success?0:1)}catch(l){console.error(o.red(`
|
|
38
|
+
Failed to cancel workflow:`),l),await a(1)}}),y.command("browser-list").description("List available browser workflow templates").action(async()=>{try{let{BrowserWorkflowTool:t}=await import("./browser-workflow-42F7GK5T.js"),e=await new t().invoke({});if(e.success&&e.data){console.log(o.blue(`
|
|
39
|
+
Browser Workflow Templates:
|
|
40
|
+
`));for(let u of e.data.availableTemplates)console.log(` ${o.cyan(u)}`);console.log("")}else console.log(o.red(`Failed: ${e.error||"Unknown error"}`));await a(0)}catch(t){console.error(o.red(`
|
|
41
|
+
Failed:`),t),await a(1)}}),y.command("browser-load [template]").description("Load and validate a browser workflow template or inline YAML").option("--yaml <yaml>","Inline YAML workflow definition").option("-v, --var <key=value>","Variable override (repeatable)",P,{}).option("-F, --format <format>","Output format (text|json)","text").option("-o, --output <path>","Write output to file").action(async(t,l)=>{try{let{BrowserWorkflowTool:e}=await import("./browser-workflow-42F7GK5T.js"),{writeOutput:u,toJSON:c}=await import("./ci-output-7JN7F6CI.js"),s=new e,f={variables:l.var||{}};if(l.yaml)f.workflowYaml=l.yaml;else if(t)if(t.endsWith(".yaml")||t.endsWith(".yml")){let i=await import("fs"),p=(await import("path")).resolve(t);i.existsSync(p)||(console.log(o.red(`
|
|
42
|
+
File not found: ${p}
|
|
43
|
+
`)),await a(1)),f.workflowYaml=i.readFileSync(p,"utf-8")}else f.templateName=t;else console.log(o.red(`
|
|
44
|
+
Provide a template name or --yaml. Use "workflow browser-list" to see templates.
|
|
45
|
+
`)),await a(1);console.log(o.blue(`
|
|
46
|
+
Loading browser workflow${t?": "+t:""}...
|
|
47
|
+
`));let r=await s.invoke(f);if(r.success&&r.data){let i=r.data;if(l.format==="json")u(c(i),l.output);else{if(console.log(o.green(` Workflow: ${i.workflowName}`)),i.description&&console.log(o.gray(` ${i.description}`)),console.log(` Source: ${o.cyan(i.source)}`),console.log(` Steps: ${o.white(i.steps.length)}`),i.steps.length>0){console.log(o.cyan(`
|
|
48
|
+
Steps:`));for(let n of i.steps){let p=n.optional?o.gray(" (optional)"):"",w=n.assertionCount>0?o.gray(` [${n.assertionCount} assertions]`):"";console.log(` ${o.white(n.name)} \u2014 ${n.action}${p}${w}`)}}if(i.variables.defined.length>0){console.log(o.cyan(`
|
|
49
|
+
Variables:`));for(let n of i.variables.defined){let p=n.required?o.red("*"):"",w=n.hasDefault?o.gray(" (has default)"):"";console.log(` ${p}${o.white(n.name)}: ${n.type}${w}`)}}if(!i.validation.valid){console.log(o.red(`
|
|
50
|
+
Validation errors:`));for(let n of i.validation.errors)console.log(o.red(` - ${n}`))}console.log("")}await a(i.validation.valid?0:1)}else console.log(o.red(`Failed: ${r.error||"Unknown error"}`)),await a(1)}catch(e){console.error(o.red(`
|
|
51
|
+
Failed:`),e),await a(1)}}),y}export{x as createWorkflowCommand};
|
|
@@ -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-UQHYFOBX.js";import"./chunk-5SKGFSKD.js";import"./chunk-3ZOONQG6.js";import"./chunk-SUSEVMZT.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{b as DEFAULT_WORKFLOW_CONFIG,a as WorkflowEvents,c as WorkflowOrchestrator,d as createWorkflowOrchestrator};
|
|
@@ -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,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v as L,w as M,x as N}from"./chunk-XT2V2322.js";import{a as v,b as w,c as x,d as y,e as z,f as A,g as B,h as C,i as D,j as E,k as F,l as G,m as H,n as I,o as J,p as K}from"./chunk-WBQSXPBI.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{z as GNNLayerFactory,i as QEFlashAttention,x as QEGNNEmbeddingIndex,y as QEGNNIndexFactory,a as QESONA,e as QE_FLASH_ATTENTION_CONFIG,g as QE_PERFORMANCE_TARGETS,f as QE_SONA_CONFIG,A as TensorCompressionFactory,u as batchComputeAttention,K as batchDifferentiableSearch,M as checkRuvectorPackagesAvailable,c as createDomainQESONA,j as createQEFlashAttention,b as createQESONA,D as getDifferentiableSearch,F as getGetCompressionLevel,E as getHierarchicalForward,G as getInit,h as getOptimalBlockConfig,k as getQEFlashAttentionConfig,n as getRuvectorDotProductAttention,m as getRuvectorFlashAttention,p as getRuvectorHyperbolicAttention,B as getRuvectorLayer,q as getRuvectorLinearAttention,r as getRuvectorMoEAttention,o as getRuvectorMultiHeadAttention,L as getRuvectorPackageVersions,C as getTensorCompress,l as getWorkloadTypes,N as initAllRuvectorPackages,w as initGNN,d as isAttentionAvailable,v as isGNNAvailable,s as toFloat32Array,H as toFloat32ArrayGNN,J as toIEmbedding,t as toNumberArrayAttn,I as toNumberArrayGNN};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Daemon CLI Commands (IMP-10)
|
|
3
|
+
*
|
|
4
|
+
* Commands for managing the QE Quality Daemon:
|
|
5
|
+
* aqe daemon start [--detached]
|
|
6
|
+
* aqe daemon stop
|
|
7
|
+
* aqe daemon status
|
|
8
|
+
* aqe daemon notifications [--unread] [--limit N] [--type TYPE]
|
|
9
|
+
* aqe daemon clear-notifications
|
|
10
|
+
*/
|
|
11
|
+
import { Command } from 'commander';
|
|
12
|
+
export declare function createDaemonCommand(): Command;
|
|
13
|
+
//# sourceMappingURL=daemon.d.ts.map
|