agentic-qe 3.8.14 → 3.9.1
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 +60 -0
- package/dist/adapters/a2ui/integration/agui-sync.js +2 -1
- package/dist/audit/witness-chain.d.ts +1 -1
- 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-NTM4ZH3P.js +2 -0
- package/dist/cli/chunks/agent-booster-wasm-UH2J6BNA.js +2 -0
- package/dist/cli/chunks/agent-handler-ZCBWQE3X.js +33 -0
- package/dist/cli/chunks/agent-memory-branch-2BAVI7UW.js +2 -0
- package/dist/cli/chunks/aqe-learning-engine-RVX6MPYK.js +2 -0
- package/dist/cli/chunks/audit-G5UIJBSQ.js +3 -0
- package/dist/cli/chunks/base-7HKNQ6UP.js +2 -0
- package/dist/cli/chunks/better-sqlite3-YHIAPPVT.js +2 -0
- package/dist/cli/chunks/brain-handler-5EE3J5PR.js +68 -0
- package/dist/cli/chunks/branch-enumerator-OV54PID5.js +7 -0
- package/dist/cli/chunks/browser-7RZGKOEO.js +4 -0
- package/dist/cli/chunks/browser-workflow-UOFSQK7X.js +2 -0
- package/dist/cli/chunks/chunk-24E47G3D.js +604 -0
- package/dist/cli/chunks/chunk-35H73OPP.js +2 -0
- package/dist/cli/chunks/chunk-36X2O3BL.js +3 -0
- package/dist/cli/chunks/chunk-3JESHZQM.js +2 -0
- package/dist/cli/chunks/chunk-3VAKR43Z.js +2 -0
- package/dist/cli/chunks/chunk-3WQNW6CH.js +2 -0
- package/dist/cli/chunks/chunk-43M6Y6VF.js +15 -0
- package/dist/cli/chunks/chunk-4BHOAQJH.js +2 -0
- package/dist/cli/chunks/chunk-4LWXZCSD.js +146 -0
- package/dist/cli/chunks/chunk-4TNXEANY.js +2 -0
- package/dist/cli/chunks/chunk-4XBY5JDT.js +4 -0
- package/dist/cli/chunks/chunk-4XREPCBZ.js +2 -0
- package/dist/cli/chunks/chunk-5GPTM2RV.js +2 -0
- package/dist/cli/chunks/chunk-5KBQQP3X.js +7 -0
- package/dist/cli/chunks/chunk-5LDBKZ6P.js +2 -0
- package/dist/cli/chunks/chunk-6BSJNG2S.js +2 -0
- package/dist/cli/chunks/chunk-6YC24TPL.js +27 -0
- package/dist/cli/chunks/chunk-7ATLJCSG.js +2 -0
- package/dist/cli/chunks/chunk-7JQTHPCD.js +2 -0
- package/dist/cli/chunks/chunk-7YUOUVN7.js +2 -0
- package/dist/cli/chunks/chunk-7ZNINH6J.js +59 -0
- package/dist/cli/chunks/chunk-A57BEPL7.js +3 -0
- package/dist/cli/chunks/chunk-AFPMCMVX.js +45 -0
- package/dist/cli/chunks/chunk-AREIP4FX.js +3 -0
- package/dist/cli/chunks/chunk-B2I7BJLL.js +3 -0
- package/dist/cli/chunks/chunk-BEHP3DEF.js +66 -0
- package/dist/cli/chunks/chunk-C24ZDUCM.js +30 -0
- package/dist/cli/chunks/chunk-D4PSFWND.js +2 -0
- package/dist/cli/chunks/chunk-D55PSO5D.js +81 -0
- package/dist/cli/chunks/chunk-DC3HPOOJ.js +2 -0
- package/dist/cli/chunks/chunk-DMGLX76J.js +180 -0
- package/dist/cli/chunks/chunk-E33KQBMW.js +2 -0
- package/dist/cli/chunks/chunk-EQFZQPFN.js +2 -0
- package/dist/cli/chunks/chunk-FPRL6UDF.js +2 -0
- package/dist/cli/chunks/chunk-FRNB4CH2.js +2 -0
- package/dist/cli/chunks/chunk-FWDKVTK4.js +2 -0
- package/dist/cli/chunks/chunk-GFNUESMU.js +2 -0
- package/dist/cli/chunks/chunk-GJW6V35N.js +2 -0
- package/dist/cli/chunks/chunk-GLIFZWV2.js +2 -0
- package/dist/cli/chunks/chunk-GNUUBTSX.js +14 -0
- package/dist/cli/chunks/chunk-HAUXLXKZ.js +2 -0
- package/dist/cli/chunks/chunk-HTXSUTWL.js +9 -0
- package/dist/cli/chunks/chunk-I5WZ2NM2.js +95 -0
- package/dist/cli/chunks/chunk-I7TA453K.js +2 -0
- package/dist/cli/chunks/chunk-IF6GW6IY.js +27 -0
- package/dist/cli/chunks/chunk-IHWSNYL2.js +5 -0
- package/dist/cli/chunks/chunk-IJKYJGJL.js +2 -0
- package/dist/cli/chunks/chunk-IQPXANCE.js +14 -0
- package/dist/cli/chunks/chunk-JCEY7RLP.js +2 -0
- package/dist/cli/chunks/chunk-JSOBRKMA.js +2 -0
- package/dist/cli/chunks/chunk-KIGRLIU4.js +2 -0
- package/dist/cli/chunks/chunk-L4H54Z27.js +21 -0
- package/dist/cli/chunks/chunk-LCOEBFAB.js +2 -0
- package/dist/cli/chunks/chunk-MZ54VM6A.js +2 -0
- package/dist/cli/chunks/chunk-NB47YT6A.js +167 -0
- package/dist/cli/chunks/chunk-NG3BKE7V.js +2 -0
- package/dist/cli/chunks/chunk-NG4TE3OW.js +2 -0
- package/dist/cli/chunks/chunk-O636JKJR.js +18 -0
- package/dist/cli/chunks/chunk-O6QQ4HLS.js +2 -0
- package/dist/cli/chunks/chunk-OFNIQCGX.js +2 -0
- package/dist/cli/chunks/chunk-OTSJU5LH.js +2 -0
- package/dist/cli/chunks/chunk-POLFT2PQ.js +15 -0
- package/dist/cli/chunks/chunk-QAYTL6KC.js +2 -0
- package/dist/cli/chunks/chunk-QMFP5OKH.js +2 -0
- package/dist/cli/chunks/chunk-RAJO7VML.js +2 -0
- package/dist/cli/chunks/chunk-RKIGOARX.js +2 -0
- package/dist/cli/chunks/chunk-RU6Q5HOC.js +3 -0
- package/dist/cli/chunks/chunk-RV6SGDET.js +2 -0
- package/dist/cli/chunks/chunk-RWXI7XAR.js +2 -0
- package/dist/cli/chunks/chunk-RXVYOXDB.js +2 -0
- package/dist/cli/chunks/chunk-SGRN6JFB.js +2 -0
- package/dist/cli/chunks/chunk-SVNX4UWR.js +3029 -0
- package/dist/cli/chunks/chunk-TL7ABIMP.js +2 -0
- package/dist/cli/chunks/chunk-TOLYWONQ.js +2 -0
- package/dist/cli/chunks/chunk-TPXYS3WG.js +3 -0
- package/dist/cli/chunks/chunk-U5JQGRHZ.js +2 -0
- package/dist/cli/chunks/chunk-UB7RGVKO.js +2 -0
- package/dist/cli/chunks/chunk-UBKK7KCR.js +70 -0
- package/dist/cli/chunks/chunk-UMGWGX7C.js +2 -0
- package/dist/cli/chunks/chunk-UN4PA4M2.js +2 -0
- package/dist/cli/chunks/chunk-US7INRP2.js +314 -0
- package/dist/cli/chunks/chunk-UWDBFPHQ.js +750 -0
- package/dist/cli/chunks/chunk-UZZCWWIG.js +2 -0
- package/dist/cli/chunks/chunk-V4HM4QAO.js +24 -0
- package/dist/cli/chunks/chunk-V4U3CTS2.js +180 -0
- package/dist/cli/chunks/chunk-VCCMCFDU.js +2 -0
- package/dist/cli/chunks/chunk-VEWIT6VN.js +4 -0
- package/dist/cli/chunks/chunk-VNYGVG4Y.js +2 -0
- package/dist/cli/chunks/chunk-VO3OVD5D.js +4 -0
- package/dist/cli/chunks/chunk-VY74OMGQ.js +6 -0
- package/dist/cli/chunks/chunk-WDJBGXC2.js +2 -0
- package/dist/cli/chunks/chunk-WDV6TN7E.js +65 -0
- package/dist/cli/chunks/chunk-WLXEDOG4.js +2 -0
- package/dist/cli/chunks/chunk-WXXAAXNS.js +12 -0
- package/dist/cli/chunks/chunk-X4MZYBOU.js +256 -0
- package/dist/cli/chunks/chunk-XE2YAYU5.js +12 -0
- package/dist/cli/chunks/chunk-XP6XKBNW.js +2 -0
- package/dist/cli/chunks/chunk-XPB6ZVQY.js +2 -0
- package/dist/cli/chunks/chunk-XRVUSKQV.js +1 -0
- package/dist/cli/chunks/chunk-XSITQBYB.js +20 -0
- package/dist/cli/chunks/chunk-XTLA4F5Z.js +91 -0
- package/dist/cli/chunks/chunk-XU6L2VJY.js +2 -0
- package/dist/cli/chunks/chunk-XUFHYPZK.js +2 -0
- package/dist/cli/chunks/chunk-Y2ZEDXTV.js +16 -0
- package/dist/cli/chunks/chunk-YQWB4QUP.js +316 -0
- package/dist/cli/chunks/chunk-YUQIXT3G.js +79 -0
- package/dist/cli/chunks/chunk-YYYB2JN5.js +2 -0
- package/dist/cli/chunks/chunk-ZEUVPLGX.js +2 -0
- package/dist/cli/chunks/chunk-ZSRQHJEW.js +3 -0
- package/dist/cli/chunks/ci-N4NTYAAI.js +81 -0
- package/dist/cli/chunks/ci-output-XYR2PSYH.js +2 -0
- package/dist/cli/chunks/claude-flow-setup-FX7PRBJV.js +2 -0
- package/dist/cli/chunks/client-CRRENRK4.js +2 -0
- package/dist/cli/chunks/cline-installer-GTHQOK7U.js +4 -0
- package/dist/cli/chunks/code-4G6ZHVNI.js +38 -0
- package/dist/cli/chunks/code-index-extractor-MKJTP5AK.js +3 -0
- package/dist/cli/chunks/codex-installer-UGS773DT.js +8 -0
- package/dist/cli/chunks/completions-B3BXNXAU.js +1364 -0
- package/dist/cli/chunks/complexity-analyzer-PMN77CUP.js +2 -0
- package/dist/cli/chunks/continuedev-installer-3DYKSIP3.js +14 -0
- package/dist/cli/chunks/copilot-installer-IUC5HDHD.js +3 -0
- package/dist/cli/chunks/cost-tracker-GSGQ7O5T.js +2 -0
- package/dist/cli/chunks/coverage-PO72QC3P.js +27 -0
- package/dist/cli/chunks/cross-domain-router-FSCGJG3B.js +2 -0
- package/dist/cli/chunks/cursor-installer-FK53S3ZL.js +3 -0
- package/dist/cli/chunks/daemon-4UIQTQ73.js +19 -0
- package/dist/cli/chunks/dag-attention-scheduler-ZGIMLECE.js +2 -0
- package/dist/cli/chunks/detect-XXHLTLL7.js +2 -0
- package/dist/cli/chunks/domain-handler-PPGFP7P4.js +25 -0
- package/dist/cli/chunks/domain-transfer-Q5UAE65W.js +2 -0
- package/dist/cli/chunks/dream-PONKQULG.js +2 -0
- package/dist/cli/chunks/esm-node-XLWDJRBX.js +2 -0
- package/dist/cli/chunks/eval-JVJKHSTQ.js +15 -0
- package/dist/cli/chunks/fast-paths-3KX4ZV66.js +2 -0
- package/dist/cli/chunks/feature-flags-2NOVE7DL.js +2 -0
- package/dist/cli/chunks/feature-flags-GKHHG2I2.js +2 -0
- package/dist/cli/chunks/file-discovery-XFSGQNM3.js +2 -0
- package/dist/cli/chunks/fleet-FOIDAXLR.js +43 -0
- package/dist/cli/chunks/gnn-wrapper-HPCQREKP.js +2 -0
- package/dist/cli/chunks/heartbeat-handler-HTR3EFFV.js +48 -0
- package/dist/cli/chunks/heartbeat-scheduler-NZQWN7CH.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-BNA5WUAB.js +2 -0
- package/dist/cli/chunks/hnsw-index-RQIIAE7S.js +2 -0
- package/dist/cli/chunks/hnsw-legacy-bridge-H6OA3AA3.js +2 -0
- package/dist/cli/chunks/hnswlib-node-FF27BDMD.js +2 -0
- package/dist/cli/chunks/hooks-63NZQ7NH.js +101 -0
- package/dist/cli/chunks/hypergraph-engine-XMSLA4XH.js +2 -0
- package/dist/cli/chunks/hypergraph-handler-ID6J6GS2.js +35 -0
- package/dist/cli/chunks/impact-analyzer-FS2UNVP4.js +2 -0
- package/dist/cli/chunks/init-handler-CIKZGGAY.js +68 -0
- package/dist/cli/chunks/init-wizard-TUU5PPY6.js +2 -0
- package/dist/cli/chunks/kernel-XFG42WAG.js +2 -0
- package/dist/cli/chunks/kilocode-installer-N7NLISYY.js +4 -0
- package/dist/cli/chunks/kiro-installer-U6XIPAT3.js +74 -0
- package/dist/cli/chunks/knowledge-graph-XV7FPU2T.js +2 -0
- package/dist/cli/chunks/learning-NKOF7KDJ.js +107 -0
- package/dist/cli/chunks/llm-router-34WHT3PH.js +30 -0
- package/dist/cli/chunks/load-ZW4Z3YLT.js +2 -0
- package/dist/cli/chunks/load-test-F4L7RTXJ.js +2 -0
- package/dist/cli/chunks/mcp-6R7SVGKO.js +2 -0
- package/dist/cli/chunks/memory-OUYCBU4M.js +32 -0
- package/dist/cli/chunks/memory-backend-DTJD2DWF.js +2 -0
- package/dist/cli/chunks/memory-handlers-WNXKZRNM.js +2 -0
- package/dist/cli/chunks/opencode-installer-FR75GHFU.js +3 -0
- package/dist/cli/chunks/orchestrator-AK7ZMVNH.js +371 -0
- package/dist/cli/chunks/pipeline-CFOPG7EM.js +19 -0
- package/dist/cli/chunks/platform-NY3ULBR7.js +2 -0
- package/dist/cli/chunks/plugin-LRANQYUR.js +27 -0
- package/dist/cli/chunks/prime-radiant-advanced-wasm-6KEIU55P.js +2 -0
- package/dist/cli/chunks/protocol-executor-6W4PS2D4.js +2 -0
- package/dist/cli/chunks/protocol-handler-ESSZGJ7R.js +20 -0
- package/dist/cli/chunks/prove-EF2PPY65.js +3 -0
- package/dist/cli/chunks/qe-reasoning-bank-7G3TZLEA.js +2 -0
- package/dist/cli/chunks/quality-AYBXB635.js +7 -0
- package/dist/cli/chunks/queen-coordinator-NFPKGMQN.js +2 -0
- package/dist/cli/chunks/real-embeddings-QPBXE7MA.js +2 -0
- package/dist/cli/chunks/roocode-installer-UF6MMBH6.js +4 -0
- package/dist/cli/chunks/router-F4B7Q66G.js +2 -0
- package/dist/cli/chunks/routing-feedback-5CIDDW7P.js +2 -0
- package/dist/cli/chunks/routing-handler-5TVKFU7V.js +20 -0
- package/dist/cli/chunks/ruvector-commands-E33VXFIA.js +8 -0
- package/dist/cli/chunks/rvf-dual-writer-O3AZKD24.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-IKEUZ2HX.js +2 -0
- package/dist/cli/chunks/rvf-migration-coordinator-M4H7W4RN.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-UX3WAPIP.js +2 -0
- package/dist/cli/chunks/safe-db-QBBNXEVK.js +2 -0
- package/dist/cli/chunks/schedule-GFT4NN6Z.js +2 -0
- package/dist/cli/chunks/scheduler-CQ56T7DB.js +2 -0
- package/dist/cli/chunks/security-ZLWT7IU3.js +14 -0
- package/dist/cli/chunks/shared-rvf-adapter-EXACQ2PT.js +2 -0
- package/dist/cli/chunks/shared-rvf-dual-writer-G43LQDIV.js +2 -0
- package/dist/cli/chunks/sqlite-persistence-JHSUZPAW.js +2 -0
- package/dist/cli/chunks/status-handler-7P23CXUI.js +45 -0
- package/dist/cli/chunks/structural-health-SCNBNL7K.js +2 -0
- package/dist/cli/chunks/sync-BYZBBH65.js +23 -0
- package/dist/cli/chunks/task-handler-DWJQXZ2K.js +49 -0
- package/dist/cli/chunks/task-handlers-35JIXVRW.js +2 -0
- package/dist/cli/chunks/test-2JSS4XW7.js +33 -0
- package/dist/cli/chunks/test-scheduling-TWJ5I7N3.js +15 -0
- package/dist/cli/chunks/token-bootstrap-LLLNJT5V.js +2 -0
- package/dist/cli/chunks/token-usage-EQ4HM4EZ.js +25 -0
- package/dist/cli/chunks/transformers-PBIR5U5S.js +2 -0
- package/dist/cli/chunks/tree-sitter-wasm-parser-X3L2GXUX.js +2 -0
- package/dist/cli/chunks/types-OD43K2NP.js +2 -0
- package/dist/cli/chunks/unified-memory-YPHONR2T.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-HJS4OXWM.js +2 -0
- package/dist/cli/chunks/unified-persistence-EFZRO6AW.js +2 -0
- package/dist/cli/chunks/validate-POMLT2KU.js +21 -0
- package/dist/cli/chunks/validate-swarm-UOC4JGZT.js +14 -0
- package/dist/cli/chunks/vibium-5JF6LAXI.js +2 -0
- package/dist/cli/chunks/visual-security-7KWFLYNB.js +2 -0
- package/dist/cli/chunks/web-tree-sitter-R7WR7J7B.js +2 -0
- package/dist/cli/chunks/windsurf-installer-ZSPEUBKR.js +7 -0
- package/dist/cli/chunks/witness-chain-CFSPCXHG.js +2 -0
- package/dist/cli/chunks/witness-chain-RWU6WT37.js +2 -0
- package/dist/cli/chunks/workflow-YNQT3OW2.js +51 -0
- package/dist/cli/chunks/workflow-orchestrator-Z6TAVMQP.js +2 -0
- package/dist/cli/chunks/wrappers-BP4FODVH.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/ruvector-commands.js +14 -2
- 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/agent-memory-branch.d.ts +117 -0
- package/dist/coordination/agent-memory-branch.js +213 -0
- package/dist/coordination/agent-teams/mailbox.d.ts +43 -0
- package/dist/coordination/agent-teams/mailbox.js +130 -4
- package/dist/coordination/consensus/providers/claude-provider.d.ts +1 -0
- package/dist/coordination/consensus/providers/claude-provider.js +23 -3
- package/dist/coordination/handlers/handler-utils.d.ts +1 -0
- package/dist/coordination/handlers/handler-utils.js +9 -2
- package/dist/coordination/handlers/quality-handlers.js +7 -1
- package/dist/domains/contract-testing/coordinator.js +11 -0
- package/dist/domains/quality-assessment/coherence/gate-controller.d.ts +20 -1
- package/dist/domains/quality-assessment/coherence/gate-controller.js +64 -0
- package/dist/domains/quality-assessment/coherence/index.d.ts +3 -3
- package/dist/domains/quality-assessment/coherence/index.js +2 -2
- package/dist/domains/quality-assessment/coherence/types.d.ts +39 -0
- package/dist/domains/quality-assessment/coherence/types.js +11 -0
- package/dist/domains/quality-assessment/coordinator.d.ts +14 -0
- package/dist/domains/quality-assessment/coordinator.js +92 -0
- package/dist/domains/test-execution/coordinator.d.ts +19 -0
- package/dist/domains/test-execution/coordinator.js +102 -5
- package/dist/domains/test-generation/coordinator.js +11 -0
- package/dist/domains/test-generation/interfaces.d.ts +2 -0
- package/dist/domains/test-generation/services/test-generator.d.ts +9 -0
- package/dist/domains/test-generation/services/test-generator.js +37 -0
- 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/init/agents-installer.d.ts +5 -3
- package/dist/init/agents-installer.js +17 -43
- package/dist/init/find-package-root.d.ts +22 -0
- package/dist/init/find-package-root.js +46 -0
- package/dist/init/n8n-installer.d.ts +4 -2
- package/dist/init/n8n-installer.js +23 -23
- package/dist/init/opencode-installer.d.ts +0 -5
- package/dist/init/opencode-installer.js +12 -39
- package/dist/init/skills-installer.d.ts +5 -2
- package/dist/init/skills-installer.js +15 -37
- package/dist/integrations/embeddings/index/HNSWIndex.d.ts +9 -2
- package/dist/integrations/embeddings/index/HNSWIndex.js +110 -35
- package/dist/integrations/ruvector/cognitive-routing.d.ts +67 -0
- package/dist/integrations/ruvector/cognitive-routing.js +208 -0
- package/dist/integrations/ruvector/feature-flags.d.ts +84 -0
- package/dist/integrations/ruvector/feature-flags.js +59 -0
- package/dist/integrations/ruvector/hdc-fingerprint.d.ts +76 -0
- package/dist/integrations/ruvector/hdc-fingerprint.js +217 -0
- package/dist/integrations/ruvector/hyperbolic-hnsw.d.ts +59 -0
- package/dist/integrations/ruvector/hyperbolic-hnsw.js +194 -0
- package/dist/integrations/ruvector/index.d.ts +5 -2
- package/dist/integrations/ruvector/index.js +13 -2
- package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +24 -0
- package/dist/integrations/ruvector/shared-rvf-adapter.js +55 -0
- package/dist/integrations/ruvector/shared-rvf-dual-writer.d.ts +6 -0
- package/dist/integrations/ruvector/shared-rvf-dual-writer.js +38 -0
- package/dist/integrations/ruvector/sona-persistence.d.ts +8 -0
- package/dist/integrations/ruvector/sona-persistence.js +10 -0
- package/dist/integrations/ruvector/vector-delta-tracker.d.ts +96 -0
- package/dist/integrations/ruvector/vector-delta-tracker.js +226 -0
- package/dist/kernel/agent-coordinator.d.ts +75 -1
- package/dist/kernel/agent-coordinator.js +250 -1
- package/dist/kernel/hnsw-legacy-bridge.d.ts +38 -0
- package/dist/kernel/hnsw-legacy-bridge.js +88 -0
- package/dist/kernel/hnsw-shadow-validator.d.ts +91 -0
- package/dist/kernel/hnsw-shadow-validator.js +139 -0
- package/dist/kernel/index.d.ts +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/kernel/interfaces.d.ts +39 -0
- package/dist/kernel/kernel.d.ts +23 -0
- package/dist/kernel/kernel.js +141 -1
- package/dist/kernel/memory-backend.js +3 -1
- package/dist/kernel/unified-memory.d.ts +1 -1
- package/dist/kernel/unified-memory.js +7 -3
- package/dist/learning/aqe-learning-engine.d.ts +65 -0
- package/dist/learning/aqe-learning-engine.js +134 -0
- package/dist/learning/dream/dream-engine.d.ts +6 -1
- package/dist/learning/dream/dream-engine.js +37 -2
- package/dist/learning/dream/dream-scheduler.d.ts +25 -0
- package/dist/learning/dream/dream-scheduler.js +120 -0
- package/dist/learning/dream/rvcow-branch-manager.d.ts +6 -3
- package/dist/learning/dream/rvcow-branch-manager.js +60 -5
- package/dist/learning/experience-capture.d.ts +3 -3
- package/dist/learning/hyperbolic-pattern-index.d.ts +82 -0
- package/dist/learning/hyperbolic-pattern-index.js +142 -0
- package/dist/learning/index.d.ts +3 -3
- package/dist/learning/index.js +1 -1
- package/dist/learning/metrics-tracker.d.ts +44 -0
- package/dist/learning/metrics-tracker.js +37 -0
- package/dist/learning/pattern-promotion.d.ts +3 -3
- package/dist/learning/pattern-store.d.ts +45 -2
- package/dist/learning/pattern-store.js +217 -4
- package/dist/learning/qe-patterns.d.ts +1 -1
- package/dist/learning/qe-reasoning-bank.js +1 -1
- package/dist/learning/rvf-pattern-migration.d.ts +50 -0
- package/dist/learning/rvf-pattern-migration.js +106 -0
- package/dist/learning/rvf-pattern-store.d.ts +66 -0
- package/dist/learning/rvf-pattern-store.js +447 -0
- package/dist/mcp/bundle.js +1937 -1793
- package/dist/mcp/entry.js +132 -77
- package/dist/mcp/handlers/index.d.ts +1 -0
- package/dist/mcp/handlers/index.js +2 -0
- package/dist/mcp/handlers/migration-handlers.d.ts +52 -0
- package/dist/mcp/handlers/migration-handlers.js +85 -0
- 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 +12 -0
- package/dist/mcp/protocol-server.js +192 -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 +2 -1
- package/dist/optimization/early-exit-token-optimizer.d.ts +7 -7
- package/dist/optimization/early-exit-token-optimizer.js +3 -3
- package/dist/persistence/rvf-consistency-validator.d.ts +85 -0
- package/dist/persistence/rvf-consistency-validator.js +182 -0
- package/dist/persistence/rvf-migration-adapter.d.ts +125 -0
- package/dist/persistence/rvf-migration-adapter.js +303 -0
- package/dist/persistence/rvf-migration-coordinator.d.ts +115 -0
- package/dist/persistence/rvf-migration-coordinator.js +224 -0
- package/dist/persistence/rvf-stage-gate.d.ts +70 -0
- package/dist/persistence/rvf-stage-gate.js +163 -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 +10 -10
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{b as y}from"./chunk-GJW6V35N.js";import{c as u,d as p,f as k,j as h}from"./chunk-D55PSO5D.js";import"./chunk-UZZCWWIG.js";import{Command as F}from"commander";import e from"chalk";function U($,d,T){return new F("test").description("Test generation, execution, scheduling, and load testing").argument("<action>","Action (generate|execute|schedule|load)").argument("[target]","Target file or directory").option("-f, --framework <framework>","Test framework","vitest").option("-t, --type <type>","Test type (unit|integration|e2e)","unit").option("-F, --format <format>","Output format (text|json|junit|markdown)","text").option("-o, --output <path>","Write output to file").option("--git-ref <ref>","Git ref for schedule action (e.g., main, HEAD~3)").option("--no-git-aware","Disable git-aware test selection (schedule action)").option("--no-flaky","Disable flaky test tracking (schedule action)").option("--agents <count>","Target agent count for load action","10").option("--profile <profile>","Workload profile for load action (light|medium|heavy)","medium").option("--duration <ms>","Duration in ms for load action","30000").option("--real","Use real agents instead of mock (load action, requires fleet_init)").action(async(m,f,s)=>{if(await T())try{if(m==="generate"){console.log(e.blue(`
|
|
3
|
+
Generating tests for ${f||"current directory"}...
|
|
4
|
+
`));let l=await $.kernel.getDomainAPIAsync("test-generation");if(!l){console.log(e.red("Test generation domain not available"));return}let i=await import("path"),g=i.resolve(f||"."),a=y(g,{includeTests:!1});if(a.length===0){console.log(e.yellow("No source files found"));return}console.log(e.gray(` Found ${a.length} source files
|
|
5
|
+
`));let n=await l.generateTests({sourceFiles:a,testType:s.type,framework:s.framework,coverageTarget:80});if(n.success&&n.value){let t=n.value,c=s.format;if(c==="json")u(p(t),s.output);else if(c==="markdown"){let r=`# Test Generation Report
|
|
6
|
+
|
|
7
|
+
- **Tests Generated**: ${t.tests.length}
|
|
8
|
+
- **Coverage Estimate**: ${t.coverageEstimate}%
|
|
9
|
+
- **Patterns Used**: ${t.patternsUsed.join(", ")||"none"}
|
|
10
|
+
|
|
11
|
+
## Tests
|
|
12
|
+
|
|
13
|
+
`+t.tests.map(o=>`- **${o.name}** (${o.assertions} assertions) \u2014 \`${o.sourceFile}\``).join(`
|
|
14
|
+
`)+`
|
|
15
|
+
`;u(r,s.output)}else{console.log(e.green(`Generated ${t.tests.length} tests
|
|
16
|
+
`)),console.log(e.cyan(" Tests:"));for(let r of t.tests.slice(0,10))if(console.log(` ${e.white(r.name)}`),console.log(e.gray(` Source: ${i.basename(r.sourceFile)}`)),console.log(e.gray(` Assertions: ${r.assertions}`)),r.testCode){console.log(e.gray(` Test File: ${r.testFile}`));let o=await import("fs"),w=i.dirname(r.testFile);o.mkdirSync(w,{recursive:!0}),o.writeFileSync(r.testFile,r.testCode,"utf-8"),console.log(e.green(` Written to: ${r.testFile}`))}t.tests.length>10&&console.log(e.gray(` ... and ${t.tests.length-10} more`)),console.log(`
|
|
17
|
+
Coverage Estimate: ${e.yellow(t.coverageEstimate+"%")}`),t.patternsUsed.length>0&&console.log(` Patterns Used: ${e.cyan(t.patternsUsed.join(", "))}`)}}else console.log(e.red(`Failed: ${n.error?.message||"Unknown error"}`))}else if(m==="execute"){console.log(e.blue(`
|
|
18
|
+
Executing tests in ${f||"current directory"}...
|
|
19
|
+
`));let l=await $.kernel.getDomainAPIAsync("test-execution");if(!l){console.log(e.red("Test execution domain not available"));return}let g=(await import("path")).resolve(f||"."),a=y(g,{testsOnly:!0});if(a.length===0){console.log(e.yellow("No test files found"));return}console.log(e.gray(` Found ${a.length} test files
|
|
20
|
+
`));let n=await l.runTests({testFiles:a,parallel:!0,retryCount:2});if(n.success&&n.value){let t=n.value,c=s.format;if(c==="json")u(p(t),s.output);else if(c==="junit")u(k(t),s.output);else if(c==="markdown")u(h(t),s.output);else{let o=t.passed+t.failed+t.skipped;console.log(e.green("Test run complete")),console.log(`
|
|
21
|
+
Results:`),console.log(` Total: ${e.white(o)}`),console.log(` Passed: ${e.green(t.passed)}`),console.log(` Failed: ${e.red(t.failed)}`),console.log(` Skipped: ${e.yellow(t.skipped)}`),console.log(` Duration: ${e.cyan(t.duration+"ms")}`)}t.failed>0&&await d(1);let r=t.passed+t.failed+t.skipped;r>0&&t.skipped/r>.2&&await d(2)}else console.log(e.red(`Failed: ${n.error?.message||"Unknown error"}`))}else if(m==="schedule"){let l=s.format;l==="text"&&console.log(e.blue(`
|
|
22
|
+
Running test schedule pipeline...
|
|
23
|
+
`));let{TestScheduleTool:i}=await import("./schedule-GFT4NN6Z.js"),a=await new i().invoke({cwd:f||process.cwd(),gitRef:s.gitRef,useGitAware:s.gitAware!==!1,trackFlaky:s.flaky!==!1});if(a.success&&a.data){let n=a.data;if(l==="json")u(p(n),s.output);else{console.log(e.green(` Schedule complete
|
|
24
|
+
`)),console.log(` Phases: ${e.white(n.phases.length)}`);for(let t of n.phases){let c=t.failed===0?e.green:e.red;console.log(` ${e.cyan(t.phaseName)}: ${c(`${t.passed}/${t.totalTests} passed`)} (${t.durationMs}ms)`)}console.log(`
|
|
25
|
+
Git-aware: ${n.gitAware.enabled?e.green(`yes (${n.gitAware.selectedTests} selected)`):e.gray("disabled")}`),console.log(` Duration: ${e.cyan(n.totalDuration+"ms")}`),console.log(`
|
|
26
|
+
${n.summary}`)}}else console.log(e.red(`Failed: ${a.error||"Unknown error"}`))}else if(m==="load"){let l=s.format,i=parseInt(s.agents,10)||10,g=parseInt(s.duration,10)||3e4,a=s.profile,n=!s.real;l==="text"&&console.log(e.blue(`
|
|
27
|
+
Running load test: ${i} agents, ${a} profile, ${g}ms${n?" (mock)":" (real)"}...
|
|
28
|
+
`));let{LoadTestTool:t}=await import("./load-test-F4L7RTXJ.js"),r=await new t().invoke({targetAgents:i,profile:a,durationMs:g,mockMode:n});if(r.success&&r.data){let o=r.data;if(l==="json")u(p(o),s.output);else{let w=o.passed?e.green:e.red;console.log(w(` Load test ${o.passed?"PASSED":"FAILED"}
|
|
29
|
+
`)),console.log(` Profile: ${e.cyan(o.profile)} (${o.mockMode?"mock":"real"})`),console.log(` Agents: ${e.white(o.targetAgents)}`),console.log(` Duration: ${e.cyan(o.duration+"ms")}`),console.log(` Bottlenecks: ${o.bottleneckCount>0?e.red(o.bottleneckCount):e.green("none")}`),o.report.hasCritical&&console.log(e.red(" CRITICAL bottlenecks detected!")),console.log(`
|
|
30
|
+
${o.summary}`)}o.passed||await d(1)}else console.log(e.red(`Failed: ${r.error||"Unknown error"}`))}else console.log(e.red(`
|
|
31
|
+
Unknown action: ${m}. Use: generate, execute, schedule, or load
|
|
32
|
+
`)),await d(1);console.log(""),await d(0)}catch(l){console.error(e.red(`
|
|
33
|
+
Failed:`),l),await d(1)}})}export{U as createTestCommand};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{a as B,b as L}from"./chunk-LCOEBFAB.js";import{b as y,d as $}from"./chunk-JSOBRKMA.js";import"./chunk-UZZCWWIG.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-FS2UNVP4.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-2NOVE7DL.js");if(p()){let{createDAGAttentionScheduler:h}=await import("./dag-attention-scheduler-ZGIMLECE.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{b as r,e as l,f}from"./chunk-5KBQQP3X.js";import{b as k}from"./chunk-TOLYWONQ.js";import"./chunk-WDV6TN7E.js";import"./chunk-XPB6ZVQY.js";import"./chunk-DC3HPOOJ.js";import"./chunk-43M6Y6VF.js";import"./chunk-RV6SGDET.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-5LDBKZ6P.js";import"./chunk-UN4PA4M2.js";import"./chunk-UB7RGVKO.js";import"./chunk-QMFP5OKH.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{a as k,b as u,d as S,e as f}from"./chunk-5KBQQP3X.js";import"./chunk-WDV6TN7E.js";import"./chunk-XPB6ZVQY.js";import"./chunk-DC3HPOOJ.js";import"./chunk-RV6SGDET.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-5LDBKZ6P.js";import{a as y,c as h}from"./chunk-UN4PA4M2.js";import"./chunk-UB7RGVKO.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-D4PSFWND.js";import"./chunk-UZZCWWIG.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{d as L,e as $}from"./chunk-A57BEPL7.js";import"./chunk-UZZCWWIG.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-R7WR7J7B.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g}from"./chunk-WDJBGXC2.js";import"./chunk-UZZCWWIG.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");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-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-UN4PA4M2.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import{a as c,d,e}from"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.js";o();export{a as ALLOWED_TABLE_NAMES,c as BinaryHeap,i as DEFAULT_UNIFIED_MEMORY_CONFIG,d as UnifiedHnswIndex,k as UnifiedMemoryManager,f as clearProjectRootCache,e as createHnswIndex,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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.js";f();export{a as BinaryHeap,b as InMemoryHNSWIndex,c as RuvectorFlatIndex,d as UnifiedHnswIndex,e as createHnswIndex};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e}from"./chunk-FRNB4CH2.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-UN4PA4M2.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.js";export{a as DEFAULT_UNIFIED_CONFIG,b as UnifiedPersistenceManager,c as getUnifiedPersistence,d as initializeUnifiedPersistence,e as resetUnifiedPersistence};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{e as P}from"./chunk-XTLA4F5Z.js";import"./chunk-O636JKJR.js";import{a as V}from"./chunk-FPRL6UDF.js";import"./chunk-ZSRQHJEW.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import{b as v,d as F}from"./chunk-JSOBRKMA.js";import"./chunk-UN4PA4M2.js";import"./chunk-XUFHYPZK.js";import"./chunk-UZZCWWIG.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{a as i,b as v,c as d,d as p}from"./chunk-XTLA4F5Z.js";import{a as h}from"./chunk-L4H54Z27.js";import"./chunk-O636JKJR.js";import{a as k}from"./chunk-FPRL6UDF.js";import"./chunk-RXVYOXDB.js";import"./chunk-ZSRQHJEW.js";import"./chunk-POLFT2PQ.js";import"./chunk-5GPTM2RV.js";import"./chunk-C24ZDUCM.js";import"./chunk-DC3HPOOJ.js";import"./chunk-X4MZYBOU.js";import"./chunk-WLXEDOG4.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-IF6GW6IY.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-5LDBKZ6P.js";import"./chunk-UN4PA4M2.js";import"./chunk-UB7RGVKO.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{c as t}from"./chunk-UZZCWWIG.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-7JQTHPCD.js";import"./chunk-E33KQBMW.js";import"./chunk-43M6Y6VF.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-UN4PA4M2.js";import"./chunk-UB7RGVKO.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.js";export{a as VisualSecurityTool};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import"./chunk-UZZCWWIG.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{b as u}from"./chunk-UBKK7KCR.js";import{a as f,c as h}from"./chunk-UN4PA4M2.js";import"./chunk-UZZCWWIG.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g}from"./chunk-IF6GW6IY.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.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,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h}from"./chunk-6YC24TPL.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-UN4PA4M2.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.js";export{a as GENESIS_PREV_HASH,f as WitnessChain,h as createWitnessChain,g as getWitnessChain,d as hashWith,e as serializeEntry,b as sha256,c as shake256};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{b as $}from"./chunk-EQFZQPFN.js";import"./chunk-XP6XKBNW.js";import{d as R}from"./chunk-RAJO7VML.js";import{b as k,c as C,d as b}from"./chunk-AREIP4FX.js";import{c as W}from"./chunk-JSOBRKMA.js";import"./chunk-5LDBKZ6P.js";import"./chunk-UN4PA4M2.js";import"./chunk-UZZCWWIG.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-UOFSQK7X.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-UOFSQK7X.js"),{writeOutput:u,toJSON:c}=await import("./ci-output-XYR2PSYH.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
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");process.exit(0)}
|
|
2
|
+
import{a,b,c,d}from"./chunk-Y2ZEDXTV.js";import"./chunk-RKIGOARX.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.js";import"./chunk-JSOBRKMA.js";import"./chunk-5LDBKZ6P.js";import"./chunk-UN4PA4M2.js";import"./chunk-UB7RGVKO.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.js";export{b as DEFAULT_WORKFLOW_CONFIG,a as WorkflowEvents,c as WorkflowOrchestrator,d as createWorkflowOrchestrator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.1");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-VCCMCFDU.js";import"./chunk-24E47G3D.js";import"./chunk-AFPMCMVX.js";import"./chunk-U5JQGRHZ.js";import"./chunk-A57BEPL7.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-FWDKVTK4.js";import"./chunk-JSOBRKMA.js";import"./chunk-UN4PA4M2.js";import"./chunk-GFNUESMU.js";import"./chunk-OFNIQCGX.js";import"./chunk-ZEUVPLGX.js";import"./chunk-XUFHYPZK.js";import"./chunk-SGRN6JFB.js";import"./chunk-NG3BKE7V.js";import"./chunk-4XREPCBZ.js";import"./chunk-35H73OPP.js";import"./chunk-MZ54VM6A.js";import"./chunk-UZZCWWIG.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
|