agentic-qe 3.14.3 → 3.14.4
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/agents/v3/qe-coverage-specialist.md +1 -1
- package/.claude/agents/v3/qe-fleet-commander.md +1 -1
- package/.claude/agents/v3/qe-pentest-validator.md +1 -1
- package/.claude/agents/v3/qe-queen-coordinator.md +1 -1
- package/.claude/agents/v3/qe-risk-assessor.md +1 -1
- package/.claude/agents/v3/qe-root-cause-analyzer.md +1 -1
- package/.claude/agents/v3/qe-security-auditor.md +1 -1
- package/.claude/agents/v3/qe-test-architect.md +1 -1
- package/.claude/commands/aqe-costs.md +10 -10
- package/.claude/helpers/advisor-call.cjs +3 -3
- package/.claude/helpers/v3/advisor-call.cjs +3 -3
- package/.claude/skills/.validation/examples/chaos-engineering-output.example.json +1 -1
- package/.claude/skills/.validation/examples/performance-testing-output.example.json +1 -1
- package/.claude/skills/.validation/examples/security-testing-output.example.json +1 -1
- package/.claude/skills/.validation/examples/testability-scoring-output.example.json +1 -1
- package/.claude/skills/.validation/schemas/skill-eval.schema.json +4 -1
- package/.claude/skills/.validation/schemas/skill-frontmatter.schema.json +1 -1
- package/.claude/skills/.validation/schemas/skill-output.template.json +1 -1
- package/.claude/skills/.validation/templates/eval.template.yaml +1 -1
- package/.claude/skills/.validation/templates/security-testing-eval.template.yaml +1 -1
- package/.claude/skills/.validation/templates/skill-frontmatter.example.yaml +1 -1
- package/.claude/skills/.validation/test-data/sample-output.json +1 -1
- package/.claude/skills/a11y-ally/SKILL.md +1 -1
- package/.claude/skills/a11y-ally/evals/a11y-ally.yaml +1 -1
- package/.claude/skills/accessibility-testing/evals/accessibility-testing.yaml +1 -1
- package/.claude/skills/api-testing-patterns/evals/api-testing-patterns.yaml +1 -1
- package/.claude/skills/chaos-engineering-resilience/evals/chaos-engineering-resilience.yaml +1 -1
- package/.claude/skills/cicd-pipeline-qe-orchestrator/evals/cicd-pipeline-qe-orchestrator.yaml +1 -1
- package/.claude/skills/compatibility-testing/evals/compatibility-testing.yaml +1 -1
- package/.claude/skills/compliance-testing/evals/compliance-testing.yaml +1 -1
- package/.claude/skills/contract-testing/evals/contract-testing.yaml +1 -1
- package/.claude/skills/database-testing/evals/database-testing.yaml +1 -1
- package/.claude/skills/enterprise-integration-testing/evals/enterprise-integration-testing.yaml +1 -1
- package/.claude/skills/localization-testing/evals/localization-testing.yaml +1 -1
- package/.claude/skills/middleware-testing-patterns/evals/middleware-testing-patterns.yaml +1 -1
- package/.claude/skills/mobile-testing/evals/mobile-testing.yaml +1 -1
- package/.claude/skills/mutation-testing/evals/mutation-testing.yaml +1 -1
- package/.claude/skills/mutation-testing/test-data/sample-output.json +1 -1
- package/.claude/skills/n8n-expression-testing/evals/n8n-expression-testing.yaml +1 -1
- package/.claude/skills/n8n-integration-testing-patterns/evals/n8n-integration-testing-patterns.yaml +1 -1
- package/.claude/skills/n8n-security-testing/evals/n8n-security-testing.yaml +1 -1
- package/.claude/skills/n8n-trigger-testing-strategies/evals/n8n-trigger-testing-strategies.yaml +1 -1
- package/.claude/skills/n8n-workflow-testing-fundamentals/evals/n8n-workflow-testing-fundamentals.yaml +1 -1
- package/.claude/skills/observability-testing-patterns/evals/observability-testing-patterns.yaml +1 -1
- package/.claude/skills/pentest-validation/evals/pentest-validation.yaml +1 -1
- package/.claude/skills/performance-testing/evals/performance-testing.yaml +1 -1
- package/.claude/skills/qcsd-cicd-swarm/evals/qcsd-cicd-swarm.yaml +1 -1
- package/.claude/skills/qcsd-development-swarm/evals/qcsd-development-swarm.yaml +1 -1
- package/.claude/skills/qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +1 -1
- package/.claude/skills/qcsd-production-swarm/evals/qcsd-production-swarm.yaml +1 -1
- package/.claude/skills/qcsd-refinement-swarm/evals/qcsd-refinement-swarm.yaml +1 -1
- package/.claude/skills/qe-browser/evals/qe-browser.yaml +1 -1
- package/.claude/skills/qe-chaos-resilience/evals/qe-chaos-resilience.yaml +1 -1
- package/.claude/skills/qe-code-intelligence/evals/qe-code-intelligence.yaml +1 -1
- package/.claude/skills/qe-coverage-analysis/evals/qe-coverage-analysis.yaml +1 -1
- package/.claude/skills/qe-defect-intelligence/evals/qe-defect-intelligence.yaml +1 -1
- package/.claude/skills/qe-learning-optimization/evals/qe-learning-optimization.yaml +2 -2
- package/.claude/skills/qe-quality-assessment/evals/qe-quality-assessment.yaml +1 -1
- package/.claude/skills/qe-requirements-validation/evals/qe-requirements-validation.yaml +1 -1
- package/.claude/skills/qe-test-execution/evals/qe-test-execution.yaml +1 -1
- package/.claude/skills/qe-test-generation/evals/qe-test-generation.yaml +1 -1
- package/.claude/skills/qe-visual-accessibility/evals/qe-visual-accessibility.yaml +1 -1
- package/.claude/skills/quality-metrics/evals/quality-metrics.yaml +1 -1
- package/.claude/skills/regression-testing/evals/regression-testing.yaml +1 -1
- package/.claude/skills/risk-based-testing/evals/risk-based-testing.yaml +1 -1
- package/.claude/skills/security-testing/evals/security-testing.yaml +1 -1
- package/.claude/skills/security-visual-testing/evals/security-visual-testing.yaml +1 -1
- package/.claude/skills/shift-left-testing/evals/shift-left-testing.yaml +1 -1
- package/.claude/skills/shift-right-testing/evals/shift-right-testing.yaml +1 -1
- package/.claude/skills/skills-manifest.json +1 -1
- package/.claude/skills/test-automation-strategy/evals/test-automation-strategy.yaml +1 -1
- package/.claude/skills/test-data-management/evals/test-data-management.yaml +1 -1
- package/.claude/skills/test-design-techniques/evals/test-design-techniques.yaml +1 -1
- package/.claude/skills/test-reporting-analytics/evals/test-reporting-analytics.yaml +1 -1
- package/.claude/skills/testability-scoring/evals/testability-scoring.yaml +1 -1
- package/.claude/skills/validation-pipeline/evals/validation-pipeline.yaml +1 -1
- package/.claude/skills/verification-quality/evals/verification-quality.yaml +1 -1
- package/.claude/skills/visual-testing-advanced/evals/visual-testing-advanced.yaml +1 -1
- package/.claude/skills/wms-testing-patterns/evals/wms-testing-patterns.yaml +1 -1
- package/.opencode/agents/collective-intelligence-coordinator.yaml +1 -1
- package/.opencode/agents/ddd-domain-expert.yaml +1 -1
- package/.opencode/agents/memory-specialist.yaml +1 -1
- package/.opencode/agents/performance-engineer.yaml +1 -1
- package/.opencode/agents/qe-accessibility-auditor.yaml +1 -1
- package/.opencode/agents/qe-api-contract-validator.yaml +1 -1
- package/.opencode/agents/qe-bdd-generator.yaml +1 -1
- package/.opencode/agents/qe-chaos-engineer.yaml +1 -1
- package/.opencode/agents/qe-code-complexity.yaml +1 -1
- package/.opencode/agents/qe-code-intelligence.yaml +1 -1
- package/.opencode/agents/qe-coverage-analyzer.yaml +1 -1
- package/.opencode/agents/qe-defect-predictor.yaml +1 -1
- package/.opencode/agents/qe-dependency-mapper.yaml +1 -1
- package/.opencode/agents/qe-deployment-advisor.yaml +1 -1
- package/.opencode/agents/qe-devils-advocate.yaml +1 -1
- package/.opencode/agents/qe-flaky-hunter.yaml +1 -1
- package/.opencode/agents/qe-fleet-commander.yaml +1 -1
- package/.opencode/agents/qe-gap-detector.yaml +1 -1
- package/.opencode/agents/qe-graphql-tester.yaml +1 -1
- package/.opencode/agents/qe-impact-analyzer.yaml +1 -1
- package/.opencode/agents/qe-integration-architect.yaml +1 -1
- package/.opencode/agents/qe-integration-tester.yaml +1 -1
- package/.opencode/agents/qe-kg-builder.yaml +1 -1
- package/.opencode/agents/qe-learning-coordinator.yaml +1 -1
- package/.opencode/agents/qe-load-tester.yaml +1 -1
- package/.opencode/agents/qe-message-broker-tester.yaml +1 -1
- package/.opencode/agents/qe-metrics-optimizer.yaml +1 -1
- package/.opencode/agents/qe-middleware-validator.yaml +1 -1
- package/.opencode/agents/qe-mutation-tester.yaml +1 -1
- package/.opencode/agents/qe-odata-contract-tester.yaml +1 -1
- package/.opencode/agents/qe-parallel-executor.yaml +1 -1
- package/.opencode/agents/qe-pattern-learner.yaml +1 -1
- package/.opencode/agents/qe-pentest-validator.yaml +1 -1
- package/.opencode/agents/qe-performance-tester.yaml +1 -1
- package/.opencode/agents/qe-product-factors-assessor.yaml +1 -1
- package/.opencode/agents/qe-property-tester.yaml +1 -1
- package/.opencode/agents/qe-quality-criteria-recommender.yaml +1 -1
- package/.opencode/agents/qe-quality-gate.yaml +1 -1
- package/.opencode/agents/qe-queen-coordinator.yaml +1 -1
- package/.opencode/agents/qe-qx-partner.yaml +1 -1
- package/.opencode/agents/qe-regression-analyzer.yaml +1 -1
- package/.opencode/agents/qe-requirements-validator.yaml +1 -1
- package/.opencode/agents/qe-responsive-tester.yaml +1 -1
- package/.opencode/agents/qe-retry-handler.yaml +1 -1
- package/.opencode/agents/qe-risk-assessor.yaml +1 -1
- package/.opencode/agents/qe-root-cause-analyzer.yaml +1 -1
- package/.opencode/agents/qe-sap-idoc-tester.yaml +1 -1
- package/.opencode/agents/qe-sap-rfc-tester.yaml +1 -1
- package/.opencode/agents/qe-security-auditor.yaml +1 -1
- package/.opencode/agents/qe-security-scanner.yaml +1 -1
- package/.opencode/agents/qe-soap-tester.yaml +1 -1
- package/.opencode/agents/qe-sod-analyzer.yaml +1 -1
- package/.opencode/agents/qe-tdd-specialist.yaml +1 -1
- package/.opencode/agents/qe-test-generator.yaml +1 -1
- package/.opencode/agents/qe-test-idea-rewriter.yaml +1 -1
- package/.opencode/agents/qe-transfer-specialist.yaml +1 -1
- package/.opencode/agents/qe-visual-tester.yaml +1 -1
- package/.opencode/agents/security-architect.yaml +1 -1
- package/.opencode/agents/security-auditor.yaml +1 -1
- package/CHANGELOG.md +111 -0
- package/README.md +7 -2
- package/assets/agents/v3/helpers/advisor-call.cjs +3 -3
- package/assets/agents/v3/qe-coverage-specialist.md +1 -1
- package/assets/agents/v3/qe-fleet-commander.md +1 -1
- package/assets/agents/v3/qe-pentest-validator.md +1 -1
- package/assets/agents/v3/qe-queen-coordinator.md +1 -1
- package/assets/agents/v3/qe-risk-assessor.md +1 -1
- package/assets/agents/v3/qe-root-cause-analyzer.md +1 -1
- package/assets/agents/v3/qe-security-auditor.md +1 -1
- package/assets/agents/v3/qe-test-architect.md +1 -1
- package/assets/skills/.validation/examples/chaos-engineering-output.example.json +1 -1
- package/assets/skills/.validation/examples/performance-testing-output.example.json +1 -1
- package/assets/skills/.validation/examples/security-testing-output.example.json +1 -1
- package/assets/skills/.validation/examples/testability-scoring-output.example.json +1 -1
- package/assets/skills/.validation/schemas/skill-eval.schema.json +4 -1
- package/assets/skills/.validation/schemas/skill-frontmatter.schema.json +1 -1
- package/assets/skills/.validation/schemas/skill-output.template.json +1 -1
- package/assets/skills/.validation/templates/eval.template.yaml +1 -1
- package/assets/skills/.validation/templates/security-testing-eval.template.yaml +1 -1
- package/assets/skills/.validation/templates/skill-frontmatter.example.yaml +1 -1
- package/assets/skills/.validation/test-data/sample-output.json +1 -1
- package/assets/skills/a11y-ally/SKILL.md +1 -1
- package/assets/skills/a11y-ally/evals/a11y-ally.yaml +1 -1
- package/assets/skills/accessibility-testing/evals/accessibility-testing.yaml +1 -1
- package/assets/skills/api-testing-patterns/evals/api-testing-patterns.yaml +1 -1
- package/assets/skills/chaos-engineering-resilience/evals/chaos-engineering-resilience.yaml +1 -1
- package/assets/skills/cicd-pipeline-qe-orchestrator/evals/cicd-pipeline-qe-orchestrator.yaml +1 -1
- package/assets/skills/compatibility-testing/evals/compatibility-testing.yaml +1 -1
- package/assets/skills/compliance-testing/evals/compliance-testing.yaml +1 -1
- package/assets/skills/contract-testing/evals/contract-testing.yaml +1 -1
- package/assets/skills/database-testing/evals/database-testing.yaml +1 -1
- package/assets/skills/enterprise-integration-testing/evals/enterprise-integration-testing.yaml +1 -1
- package/assets/skills/localization-testing/evals/localization-testing.yaml +1 -1
- package/assets/skills/middleware-testing-patterns/evals/middleware-testing-patterns.yaml +1 -1
- package/assets/skills/mobile-testing/evals/mobile-testing.yaml +1 -1
- package/assets/skills/mutation-testing/evals/mutation-testing.yaml +1 -1
- package/assets/skills/mutation-testing/test-data/sample-output.json +1 -1
- package/assets/skills/n8n-expression-testing/evals/n8n-expression-testing.yaml +1 -1
- package/assets/skills/n8n-integration-testing-patterns/evals/n8n-integration-testing-patterns.yaml +1 -1
- package/assets/skills/n8n-security-testing/evals/n8n-security-testing.yaml +1 -1
- package/assets/skills/n8n-trigger-testing-strategies/evals/n8n-trigger-testing-strategies.yaml +1 -1
- package/assets/skills/n8n-workflow-testing-fundamentals/evals/n8n-workflow-testing-fundamentals.yaml +1 -1
- package/assets/skills/observability-testing-patterns/evals/observability-testing-patterns.yaml +1 -1
- package/assets/skills/pentest-validation/evals/pentest-validation.yaml +1 -1
- package/assets/skills/performance-testing/evals/performance-testing.yaml +1 -1
- package/assets/skills/qcsd-cicd-swarm/evals/qcsd-cicd-swarm.yaml +1 -1
- package/assets/skills/qcsd-development-swarm/evals/qcsd-development-swarm.yaml +1 -1
- package/assets/skills/qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +1 -1
- package/assets/skills/qcsd-production-swarm/evals/qcsd-production-swarm.yaml +1 -1
- package/assets/skills/qcsd-refinement-swarm/evals/qcsd-refinement-swarm.yaml +1 -1
- package/assets/skills/qe-browser/evals/qe-browser.yaml +1 -1
- package/assets/skills/qe-chaos-resilience/evals/qe-chaos-resilience.yaml +1 -1
- package/assets/skills/qe-code-intelligence/evals/qe-code-intelligence.yaml +1 -1
- package/assets/skills/qe-coverage-analysis/evals/qe-coverage-analysis.yaml +1 -1
- package/assets/skills/qe-defect-intelligence/evals/qe-defect-intelligence.yaml +1 -1
- package/assets/skills/qe-learning-optimization/evals/qe-learning-optimization.yaml +2 -2
- package/assets/skills/qe-quality-assessment/evals/qe-quality-assessment.yaml +1 -1
- package/assets/skills/qe-requirements-validation/evals/qe-requirements-validation.yaml +1 -1
- package/assets/skills/qe-test-execution/evals/qe-test-execution.yaml +1 -1
- package/assets/skills/qe-test-generation/evals/qe-test-generation.yaml +1 -1
- package/assets/skills/qe-visual-accessibility/evals/qe-visual-accessibility.yaml +1 -1
- package/assets/skills/quality-metrics/evals/quality-metrics.yaml +1 -1
- package/assets/skills/regression-testing/evals/regression-testing.yaml +1 -1
- package/assets/skills/risk-based-testing/evals/risk-based-testing.yaml +1 -1
- package/assets/skills/security-testing/evals/security-testing.yaml +1 -1
- package/assets/skills/security-visual-testing/evals/security-visual-testing.yaml +1 -1
- package/assets/skills/shift-left-testing/evals/shift-left-testing.yaml +1 -1
- package/assets/skills/shift-right-testing/evals/shift-right-testing.yaml +1 -1
- package/assets/skills/skills-manifest.json +1 -1
- package/assets/skills/test-automation-strategy/evals/test-automation-strategy.yaml +1 -1
- package/assets/skills/test-data-management/evals/test-data-management.yaml +1 -1
- package/assets/skills/test-design-techniques/evals/test-design-techniques.yaml +1 -1
- package/assets/skills/test-reporting-analytics/evals/test-reporting-analytics.yaml +1 -1
- package/assets/skills/testability-scoring/evals/testability-scoring.yaml +1 -1
- package/assets/skills/validation-pipeline/evals/validation-pipeline.yaml +1 -1
- package/assets/skills/verification-quality/evals/verification-quality.yaml +1 -1
- package/assets/skills/visual-testing-advanced/evals/visual-testing-advanced.yaml +1 -1
- package/assets/skills/wms-testing-patterns/evals/wms-testing-patterns.yaml +1 -1
- package/dist/cli/bundle.js +7 -7
- package/dist/cli/chunks/adapter-TNNNJRDG.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-TQOMLWWX.js → agent-booster-wasm-5PC7D2FW.js} +2 -2
- package/dist/cli/chunks/{agent-handler-Q3SEMMI2.js → agent-handler-RDNTK4CA.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-SJXAQSZI.js → agent-memory-branch-NAAMBWIR.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-5ZRMYJLB.js +2 -0
- package/dist/cli/chunks/{arena-7RC7TBGW.js → arena-HXTWJ5YY.js} +4 -4
- package/dist/cli/chunks/{arena-UPB7TKUY.js → arena-KXFHRWX4.js} +2 -2
- package/dist/cli/chunks/{audit-IXN5R4WB.js → audit-YSGA7UWT.js} +3 -3
- package/dist/cli/chunks/base-KWZHOPSH.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-RP4DEGK3.js → better-sqlite3-UICJZIDG.js} +2 -2
- package/dist/cli/chunks/brain-handler-ET6YAP4B.js +90 -0
- package/dist/cli/chunks/{branch-enumerator-VPRWDGFJ.js → branch-enumerator-SS7UNVIA.js} +2 -2
- package/dist/cli/chunks/{browser-B6E7JPPJ.js → browser-77GI6KBE.js} +2 -2
- package/dist/cli/chunks/browser-workflow-2FZTKDUL.js +2 -0
- package/dist/cli/chunks/{chunk-ZHXWGNYM.js → chunk-2JW3BCGG.js} +1 -1
- package/dist/cli/chunks/{chunk-TGLAWI62.js → chunk-33YYYWBQ.js} +1 -1
- package/dist/cli/chunks/{chunk-BN7DKW5D.js → chunk-34WO57CW.js} +1 -1
- package/dist/cli/chunks/{chunk-TTMHIOQ3.js → chunk-3QHGWY7T.js} +2 -2
- package/dist/cli/chunks/chunk-3TW5W5LX.js +2 -0
- package/dist/cli/chunks/{chunk-E3FBW6G2.js → chunk-3UPAMMCB.js} +1 -1
- package/dist/cli/chunks/{chunk-MDZ6RRLX.js → chunk-3VOQRIQM.js} +2 -2
- package/dist/cli/chunks/{chunk-G5C2XVZC.js → chunk-3X3DJZJJ.js} +1 -1
- package/dist/cli/chunks/{chunk-4C6UJIHB.js → chunk-4MHXCAG2.js} +1 -1
- package/dist/cli/chunks/{chunk-7BUERZYL.js → chunk-4OYFXLBK.js} +2 -2
- package/dist/cli/chunks/{chunk-TFHQE6NK.js → chunk-55RWDRJD.js} +3 -3
- package/dist/cli/chunks/chunk-5R3QL7WN.js +14 -0
- package/dist/cli/chunks/{chunk-ZUG5MOUB.js → chunk-5SJHQ2CO.js} +2 -2
- package/dist/cli/chunks/{chunk-VIDBBB6F.js → chunk-5YPYDPBJ.js} +2 -2
- package/dist/cli/chunks/chunk-5Z6XZV7K.js +65 -0
- package/dist/cli/chunks/{chunk-JV4FZUE7.js → chunk-64PFWE2F.js} +2 -2
- package/dist/cli/chunks/{chunk-TISSZFHO.js → chunk-6CQN24ZK.js} +1 -1
- package/dist/cli/chunks/{chunk-G6DCESPU.js → chunk-6J62K3SW.js} +2 -2
- package/dist/cli/chunks/{chunk-7SLAZAVU.js → chunk-6KJABXAR.js} +2 -2
- package/dist/cli/chunks/{chunk-KF63AYXD.js → chunk-6QYNWR7U.js} +2 -2
- package/dist/cli/chunks/{chunk-74PK3NEW.js → chunk-6TPKK7LD.js} +2 -2
- package/dist/cli/chunks/{chunk-JRYZKBY2.js → chunk-6UWGMOND.js} +2 -2
- package/dist/cli/chunks/{chunk-ZN3J6TZD.js → chunk-6VRA2QGL.js} +1 -1
- package/dist/cli/chunks/{chunk-YCBDE2N7.js → chunk-7D777LTF.js} +2 -2
- package/dist/cli/chunks/chunk-7ZIOFPL3.js +2 -0
- package/dist/cli/chunks/chunk-A4FYONNU.js +2 -0
- package/dist/cli/chunks/{chunk-5Y5TC6BY.js → chunk-AIHDEEJO.js} +2 -2
- package/dist/cli/chunks/{chunk-N4H2QOT5.js → chunk-AUXFKCQL.js} +2 -2
- package/dist/cli/chunks/{chunk-7G6UX2QN.js → chunk-AWWNB2T7.js} +2 -2
- package/dist/cli/chunks/{chunk-33VPWGCM.js → chunk-BDESSCVR.js} +3 -3
- package/dist/cli/chunks/{chunk-OVDKWCD7.js → chunk-BFP7KO7P.js} +2 -2
- package/dist/cli/chunks/{chunk-MXMFGSWR.js → chunk-BGE6FOLM.js} +2 -2
- package/dist/cli/chunks/{chunk-2GNRW3OD.js → chunk-BOARZKU3.js} +2 -2
- package/dist/cli/chunks/{chunk-4JBFJTHJ.js → chunk-BOZZYWCR.js} +1 -1
- package/dist/cli/chunks/{chunk-D4Z2N74A.js → chunk-C2WU3533.js} +1 -1
- package/dist/cli/chunks/{chunk-B7SWW5A6.js → chunk-CDHQFHRP.js} +2 -2
- package/dist/cli/chunks/chunk-CDKG6EI7.js +16 -0
- package/dist/cli/chunks/{chunk-IU4EBTA2.js → chunk-CIKSHTEQ.js} +3 -3
- package/dist/cli/chunks/{chunk-RTJ2M6V6.js → chunk-CIZ5JPDC.js} +2 -2
- package/dist/cli/chunks/{chunk-CR3QGHVN.js → chunk-CLTMDCSE.js} +2 -2
- package/dist/cli/chunks/{chunk-T35GZXTU.js → chunk-CNG6GQEZ.js} +2 -2
- package/dist/cli/chunks/{chunk-IQEJGZV6.js → chunk-CSU5NYOX.js} +3 -3
- package/dist/cli/chunks/chunk-CU46J64M.js +4 -0
- package/dist/cli/chunks/{chunk-LLVGTEHU.js → chunk-CXQPR5MY.js} +1 -1
- package/dist/cli/chunks/{chunk-5BLFXQEB.js → chunk-DA5K5754.js} +1 -1
- package/dist/cli/chunks/{chunk-5FOZO7KM.js → chunk-DAEFDCJ4.js} +45 -45
- package/dist/cli/chunks/{chunk-SJPZSCZP.js → chunk-DEYLEDJN.js} +2 -2
- package/dist/cli/chunks/{chunk-LHGNNZ76.js → chunk-DFZCKIGY.js} +3 -3
- package/dist/cli/chunks/{chunk-YAKS3CAB.js → chunk-DHJPWQBR.js} +2 -2
- package/dist/cli/chunks/{chunk-37BASGWC.js → chunk-DOTK76IJ.js} +2 -2
- package/dist/cli/chunks/{chunk-STRDSVH3.js → chunk-DPFRKBOG.js} +2 -2
- package/dist/cli/chunks/{chunk-H5ZRV5K5.js → chunk-EDJ3O7RH.js} +2 -2
- package/dist/cli/chunks/{chunk-DBA3N742.js → chunk-EKQ673SA.js} +1 -1
- package/dist/cli/chunks/chunk-F3SBRQC6.js +2 -0
- package/dist/cli/chunks/{chunk-HOQQCY2K.js → chunk-FGYMFUE2.js} +2 -2
- package/dist/cli/chunks/{chunk-FKG5OQFT.js → chunk-FLYOJOKN.js} +1 -1
- package/dist/cli/chunks/{chunk-MWWAMDHI.js → chunk-FRH6VAUS.js} +1 -1
- package/dist/cli/chunks/{chunk-UYJHYMEQ.js → chunk-FWGOHAAB.js} +2 -2
- package/dist/cli/chunks/{chunk-HRUU7E3D.js → chunk-G6T45OIC.js} +2 -2
- package/dist/cli/chunks/{chunk-4Q35TI6Z.js → chunk-GPLQ6DOK.js} +2 -2
- package/dist/cli/chunks/{chunk-PI74GOE4.js → chunk-HDSAM2RE.js} +2 -2
- package/dist/cli/chunks/chunk-HIVA55CJ.js +2 -0
- package/dist/cli/chunks/{chunk-B5XFDFBT.js → chunk-HIYXCDEP.js} +1 -1
- package/dist/cli/chunks/{chunk-ZK5JKHP4.js → chunk-HUWNIPZ5.js} +1 -1
- package/dist/cli/chunks/{chunk-H6XBM2LY.js → chunk-HV2J7KKQ.js} +2 -2
- package/dist/cli/chunks/{chunk-IFFZR6GY.js → chunk-IFCLB7FJ.js} +1 -1
- package/dist/cli/chunks/{chunk-3ABRGG3C.js → chunk-IPR4QP3H.js} +2 -2
- package/dist/cli/chunks/{chunk-7FYMDKQH.js → chunk-ISDMD6EU.js} +165 -167
- package/dist/cli/chunks/{chunk-B2ZONZPZ.js → chunk-J6GNQS62.js} +2 -2
- package/dist/cli/chunks/{chunk-G6ZHTF42.js → chunk-JBNEE5UH.js} +2 -2
- package/dist/cli/chunks/chunk-JZ3ORVZ3.js +54 -0
- package/dist/cli/chunks/{chunk-5IAB5NRZ.js → chunk-KCZR45PA.js} +2 -2
- package/dist/cli/chunks/chunk-KGT36Z42.js +14 -0
- package/dist/cli/chunks/{chunk-IP7NSFQQ.js → chunk-KHFNNVJA.js} +2 -2
- package/dist/cli/chunks/{chunk-2WT7AKKK.js → chunk-KPA7MZ6C.js} +2 -2
- package/dist/cli/chunks/{chunk-7JQHPANT.js → chunk-KSKEF7LZ.js} +3 -3
- package/dist/cli/chunks/{chunk-F67AV5P2.js → chunk-M2JBBZQB.js} +2 -2
- package/dist/cli/chunks/{chunk-SGXSB7YO.js → chunk-M4WJKGVK.js} +1 -1
- package/dist/cli/chunks/{chunk-4UDZLD42.js → chunk-M5QUBZY6.js} +2 -2
- package/dist/cli/chunks/{chunk-PZTVH2AS.js → chunk-MCUJEZT6.js} +2 -2
- package/dist/cli/chunks/{chunk-KPMGTVB4.js → chunk-MDWCE7YW.js} +1 -1
- package/dist/cli/chunks/{chunk-LS3EUMBP.js → chunk-MEGDYJPV.js} +5 -5
- package/dist/cli/chunks/chunk-MIQTXNBG.js +4 -0
- package/dist/cli/chunks/{chunk-VWNHKYK7.js → chunk-MNW6QGNJ.js} +2 -2
- package/dist/cli/chunks/{chunk-NN76NTOX.js → chunk-MOBNBMFW.js} +1 -1
- package/dist/cli/chunks/{chunk-SG47AXJG.js → chunk-MTZH7AHC.js} +1 -1
- package/dist/cli/chunks/chunk-MVNP7GIR.js +2 -0
- package/dist/cli/chunks/chunk-MVPCNSPY.js +2 -0
- package/dist/cli/chunks/chunk-NA7B2QYB.js +2 -0
- package/dist/cli/chunks/{chunk-26GM5CWD.js → chunk-NDPFGIMJ.js} +3 -3
- package/dist/cli/chunks/{chunk-ELU4IC3I.js → chunk-NJBGXDQ7.js} +1 -1
- package/dist/cli/chunks/chunk-OBAP2TXZ.js +2 -0
- package/dist/cli/chunks/{chunk-NTSXHZTC.js → chunk-OCWWP5PL.js} +4 -4
- package/dist/cli/chunks/{chunk-XA7CG3LH.js → chunk-ODKLFVYC.js} +2 -2
- package/dist/cli/chunks/{chunk-IKIITGU5.js → chunk-ONII3572.js} +4 -4
- package/dist/cli/chunks/{chunk-JBB7E26R.js → chunk-OSLYSG3B.js} +2 -2
- package/dist/cli/chunks/{chunk-CB5JPRIZ.js → chunk-OULHKEVH.js} +2 -2
- package/dist/cli/chunks/{chunk-YGB6R5DW.js → chunk-PAWXJ73E.js} +1 -1
- package/dist/cli/chunks/chunk-PEPFCPES.js +2 -0
- package/dist/cli/chunks/{chunk-FUE6LL72.js → chunk-PFR4G3DJ.js} +2 -2
- package/dist/cli/chunks/chunk-PO3IXGMQ.js +2 -0
- package/dist/cli/chunks/{chunk-OY7MLMEX.js → chunk-PZJOPURC.js} +5 -5
- package/dist/cli/chunks/{chunk-UHQY3GK7.js → chunk-Q5DO24IJ.js} +2 -2
- package/dist/cli/chunks/chunk-QGIU2WRL.js +2 -0
- package/dist/cli/chunks/{chunk-4RP5VUBI.js → chunk-R4VL6E65.js} +2 -2
- package/dist/cli/chunks/{chunk-RKJZWWB7.js → chunk-R5NE6B2M.js} +2 -2
- package/dist/cli/chunks/{chunk-5F6DWHQG.js → chunk-RJCYCLZV.js} +2 -2
- package/dist/cli/chunks/{chunk-GNTVFN7D.js → chunk-SGYJ4NFZ.js} +1 -1
- package/dist/cli/chunks/{chunk-OYMLHX2B.js → chunk-SRKETSFF.js} +1 -1
- package/dist/cli/chunks/{chunk-XX7HUSX2.js → chunk-STJCATGN.js} +2 -2
- package/dist/cli/chunks/{chunk-C46DMCWF.js → chunk-STM3UDNO.js} +1 -1
- package/dist/cli/chunks/{chunk-EY4OQHU3.js → chunk-T6BVLVI5.js} +1 -1
- package/dist/cli/chunks/{chunk-LKN7JQTW.js → chunk-TDZ53WO2.js} +2 -2
- package/dist/cli/chunks/{chunk-OV5EZO3U.js → chunk-TPGED2IF.js} +2 -2
- package/dist/cli/chunks/{chunk-DX3C5HPN.js → chunk-TSRSV3LD.js} +1 -1
- package/dist/cli/chunks/{chunk-Y2DVFVGI.js → chunk-TT23RRB7.js} +1 -1
- package/dist/cli/chunks/{chunk-XXCYQXK3.js → chunk-TWAWHOP7.js} +2 -2
- package/dist/cli/chunks/{chunk-2IGT5WNQ.js → chunk-U5K45TFH.js} +1 -1
- package/dist/cli/chunks/{chunk-SQ3PPISY.js → chunk-UDHKLT4C.js} +1 -1
- package/dist/cli/chunks/{chunk-YDNSLLBS.js → chunk-UEM7ZF5K.js} +2 -2
- package/dist/cli/chunks/{chunk-4XPPMADQ.js → chunk-UGVHCMUN.js} +6 -6
- package/dist/cli/chunks/{chunk-YL7T3VV7.js → chunk-V3QLFNA2.js} +2 -2
- package/dist/cli/chunks/{chunk-YEXPFHV6.js → chunk-VD6QRULW.js} +2 -2
- package/dist/cli/chunks/{chunk-OVPJQWHW.js → chunk-VIHTL3U2.js} +2 -2
- package/dist/cli/chunks/chunk-W7BWUTVV.js +2 -0
- package/dist/cli/chunks/{chunk-3P6NCFI2.js → chunk-WLG5AJ4N.js} +2 -2
- package/dist/cli/chunks/{chunk-V4AOVDCJ.js → chunk-XC7DYDSY.js} +8 -8
- package/dist/cli/chunks/{chunk-LTBCAFTZ.js → chunk-XJ7QNVI5.js} +3 -3
- package/dist/cli/chunks/chunk-XRT2WRMS.js +2 -0
- package/dist/cli/chunks/{chunk-UMENRGHK.js → chunk-XRYF6JV7.js} +2 -2
- package/dist/cli/chunks/{chunk-SHGKY3QB.js → chunk-XWMZ6D6N.js} +2 -2
- package/dist/cli/chunks/{chunk-72UJXEKQ.js → chunk-Y3MW3YBC.js} +2 -2
- package/dist/cli/chunks/chunk-YNXS6CGV.js +2 -0
- package/dist/cli/chunks/{chunk-LVLBIKJD.js → chunk-Z3RHREWF.js} +1 -1
- package/dist/cli/chunks/{chunk-HXE5NBJG.js → chunk-ZBAKA4YB.js} +1 -1
- package/dist/cli/chunks/chunk-ZBJ4XOOV.js +180 -0
- package/dist/cli/chunks/chunk-ZBQY5GLF.js +11 -0
- package/dist/cli/chunks/{chunk-NBWQBQO5.js → chunk-ZJ26AQA5.js} +1 -1
- package/dist/cli/chunks/{chunk-TJEIOE7F.js → chunk-ZNEMGX5O.js} +1 -1
- package/dist/cli/chunks/{chunk-AB4U6ZNI.js → chunk-ZNPKDCZR.js} +2 -2
- package/dist/cli/chunks/{chunk-WYMGK5DX.js → chunk-ZZDIMOOV.js} +2 -2
- package/dist/cli/chunks/ci-464KPQNP.js +81 -0
- package/dist/cli/chunks/{ci-output-LK3MBXLZ.js → ci-output-I7FX2RSO.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-7AIXACR7.js → circuit-breaker-3FW237WW.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-UA7EO6VN.js → claude-flow-setup-6JKMBPGU.js} +2 -2
- package/dist/cli/chunks/client-7E4LM2WW.js +2 -0
- package/dist/cli/chunks/{cline-installer-YDDCKKEV.js → cline-installer-UWFHT6VY.js} +2 -2
- package/dist/cli/chunks/{code-URB7UAKW.js → code-KQSUT3FS.js} +29 -29
- package/dist/cli/chunks/{code-index-extractor-BL6HWH4Q.js → code-index-extractor-PABBNUSC.js} +2 -2
- package/dist/cli/chunks/{codex-installer-2AVEO4EA.js → codex-installer-CQ24DTP5.js} +2 -2
- package/dist/cli/chunks/{completions-RCKBSSSS.js → completions-7RWHAUAR.js} +2 -2
- package/dist/cli/chunks/complexity-analyzer-XPOAF33E.js +2 -0
- package/dist/cli/chunks/{continuedev-installer-VOTCEBFH.js → continuedev-installer-V4F2FIZP.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-NVTGLZX3.js → copilot-installer-JMICURQB.js} +2 -2
- package/dist/cli/chunks/core-handlers-IFG3757P.js +2 -0
- package/dist/cli/chunks/cost-tracker-5OFHEYFJ.js +2 -0
- package/dist/cli/chunks/{coverage-ZTPJWXWE.js → coverage-QKN57JDS.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-EK7W4PGP.js +2 -0
- package/dist/cli/chunks/{cursor-installer-CMGJQMHX.js → cursor-installer-GBJ7YXSM.js} +2 -2
- package/dist/cli/chunks/{daemon-V456IWR3.js → daemon-GKP7CMEK.js} +3 -3
- package/dist/cli/chunks/{daemon-Y2I3YVIU.js → daemon-IAVSO6HK.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-ZCBBOD3D.js → dag-attention-scheduler-S225TCI7.js} +2 -2
- package/dist/cli/chunks/{detect-2GHEA4A3.js → detect-IUYH422U.js} +2 -2
- package/dist/cli/chunks/{dist-node-44AGYJCH.js → dist-node-2YRE6A7C.js} +2 -2
- package/dist/cli/chunks/{domain-handler-IDLIEP6X.js → domain-handler-PL2TZC6H.js} +2 -2
- package/dist/cli/chunks/domain-plugins-HCGLXKIT.js +2 -0
- package/dist/cli/chunks/{domain-transfer-KLEXGIRF.js → domain-transfer-KQJRUPXA.js} +2 -2
- package/dist/cli/chunks/dream-NFSCSLY7.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-DUW6K35A.js → embed-and-insert-pattern-ZPAG7235.js} +2 -2
- package/dist/cli/chunks/eval-WCK7KNFN.js +17 -0
- package/dist/cli/chunks/{experience-capture-middleware-CJJJN7CF.js → experience-capture-middleware-2MSQWSAR.js} +3 -3
- package/dist/cli/chunks/{fast-paths-LGLLKX6P.js → fast-paths-VYOSIBKF.js} +2 -2
- package/dist/cli/chunks/{feature-flags-33D3I4DD.js → feature-flags-UJRHFBRX.js} +2 -2
- package/dist/cli/chunks/{feature-flags-QL4NCEGW.js → feature-flags-WCFUKHNQ.js} +2 -2
- package/dist/cli/chunks/{file-discovery-GKCYJPFZ.js → file-discovery-JDGL4ZWS.js} +2 -2
- package/dist/cli/chunks/fleet-ROXVMZ2F.js +43 -0
- package/dist/cli/chunks/{gnn-wrapper-ELSGT67Z.js → gnn-wrapper-NIO4ZCO3.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-ZUI3DOOP.js → heartbeat-handler-PI42WD3C.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-ZATCDJDK.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-WXQABRCA.js +2 -0
- package/dist/cli/chunks/hnsw-index-TPSWLEA5.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-EZMM5JWL.js → hnsw-legacy-bridge-YLC7SPK2.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-G4CE3EOS.js → hnswlib-node-LG6OS3B7.js} +2 -2
- package/dist/cli/chunks/{hooks-LCVXXA55.js → hooks-WVALP5GX.js} +10 -10
- package/dist/cli/chunks/{hypergraph-engine-6Z7RQ3HI.js → hypergraph-engine-GJEMW3EG.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-PLI2GYPK.js → hypergraph-handler-BLF6LXEV.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-HNIU45P5.js +2 -0
- package/dist/cli/chunks/{init-handler-7VH3QJ5Y.js → init-handler-K25RWRYY.js} +6 -6
- package/dist/cli/chunks/init-wizard-JUIPBMHG.js +2 -0
- package/dist/cli/chunks/kernel-5BOZQ754.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-U3MW62DE.js → kilocode-installer-BXN6WZ7G.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-PPEAC44T.js → kiro-installer-PM362DLN.js} +12 -12
- package/dist/cli/chunks/knowledge-graph-EWDAENWM.js +2 -0
- package/dist/cli/chunks/learning-CPERDDRG.js +122 -0
- package/dist/cli/chunks/llm-router-GOAV5FPI.js +37 -0
- package/dist/cli/chunks/llm-router-service-3YT7JGBS.js +2 -0
- package/dist/cli/chunks/{load-VO7ABNHV.js → load-2BG6SHAK.js} +2 -2
- package/dist/cli/chunks/load-test-BP2CPLIV.js +2 -0
- package/dist/cli/chunks/{mcp-THXEINCL.js → mcp-5TTB37DC.js} +2 -2
- package/dist/cli/chunks/{memory-FZTT7ADM.js → memory-4NHBYT6S.js} +5 -5
- package/dist/cli/chunks/memory-backend-4PYQBPRM.js +2 -0
- package/dist/cli/chunks/memory-handlers-2B27NITS.js +2 -0
- package/dist/cli/chunks/multi-model-executor-KCWSGCDT.js +14 -0
- package/dist/cli/chunks/{opencode-installer-GQ7J5SBG.js → opencode-installer-ATZLLK74.js} +2 -2
- package/dist/cli/chunks/{orchestrator-66JK2OS5.js → orchestrator-RKB7XJRG.js} +19 -19
- package/dist/cli/chunks/pattern-null-store-OYOQOV2O.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-O6XHM2G5.js → pattern-usage-recorder-7VE4XDAI.js} +2 -2
- package/dist/cli/chunks/pipeline-LQZSNDD2.js +19 -0
- package/dist/cli/chunks/{platform-Q7UH7FZQ.js → platform-OD5H5U6G.js} +2 -2
- package/dist/cli/chunks/{plugin-7OFLNGOS.js → plugin-EJ6K2MGU.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-OSRDK2FW.js → prime-radiant-advanced-wasm-OIHTKJMN.js} +2 -2
- package/dist/cli/chunks/protocol-executor-3ATJTXWG.js +2 -0
- package/dist/cli/chunks/{protocol-handler-WLYTX6FS.js → protocol-handler-NRBROAU7.js} +2 -2
- package/dist/cli/chunks/{prove-QVNE4V3J.js → prove-EJOGEGD3.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-LLMYZT4X.js +2 -0
- package/dist/cli/chunks/{quality-DNE2RKE5.js → quality-E55UC73D.js} +2 -2
- package/dist/cli/chunks/{quality-gate-2K35GCSI.js → quality-gate-OIQATNT3.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-RN7L6KG5.js +2 -0
- package/dist/cli/chunks/{real-embeddings-SF42ML7G.js → real-embeddings-FPFFNOSZ.js} +2 -2
- package/dist/cli/chunks/ref-validation-OPO6J7OL.js +2 -0
- package/dist/cli/chunks/{roocode-installer-NCEZPF5L.js → roocode-installer-ODY5KRWU.js} +2 -2
- package/dist/cli/chunks/router-MDHITQ2V.js +2 -0
- package/dist/cli/chunks/routing-feedback-5XLNJ3Y3.js +2 -0
- package/dist/cli/chunks/{routing-handler-4MXXZRYP.js → routing-handler-KQM6VWLC.js} +4 -4
- package/dist/cli/chunks/{ruvector-commands-WDFMMCMK.js → ruvector-commands-U2GVV6PF.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-JBW4O3II.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-BPPQL4XJ.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-JT7ZCJY7.js → rvf-migration-coordinator-V2GHCJKN.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-S4562CG5.js +2 -0
- package/dist/cli/chunks/rvf-store-integrity-KMIHD3LP.js +2 -0
- package/dist/cli/chunks/safe-db-FIRHSXVF.js +2 -0
- package/dist/cli/chunks/schedule-RVXFB4HK.js +2 -0
- package/dist/cli/chunks/scheduler-IKKAMAOO.js +2 -0
- package/dist/cli/chunks/{security-CJJ3WJSB.js → security-P5NM353C.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-6RGCTLHD.js → shared-rvf-adapter-LVIUOO4S.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-KIA6Q6MT.js → shared-rvf-dual-writer-2CSG7C4W.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-SQ3HCUQ7.js +2 -0
- package/dist/cli/chunks/{status-handler-BADQV2KA.js → status-handler-6TU6O37R.js} +2 -2
- package/dist/cli/chunks/{structural-health-VMYEYRZG.js → structural-health-KBIJSTXJ.js} +2 -2
- package/dist/cli/chunks/{sync-PXLROLHB.js → sync-LNHI5SB7.js} +2 -2
- package/dist/cli/chunks/{sync-ULY7T5II.js → sync-UHOX6RJW.js} +2 -2
- package/dist/cli/chunks/task-handler-AVDHMLGI.js +49 -0
- package/dist/cli/chunks/task-handlers-KYK4VTRA.js +9 -0
- package/dist/cli/chunks/{test-WCLURQUT.js → test-DHAAI3DU.js} +4 -4
- package/dist/cli/chunks/test-scheduling-XDBZ3QC2.js +15 -0
- package/dist/cli/chunks/{token-bootstrap-GTI24JAL.js → token-bootstrap-GUTTLPZX.js} +2 -2
- package/dist/cli/chunks/{token-usage-DRVG6PKO.js → token-usage-Q2YG5YQN.js} +2 -2
- package/dist/cli/chunks/{transformers-IMDDAMYQ.js → transformers-F5UQTQCY.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-WBZIHVFA.js → tree-sitter-wasm-parser-DEGOHS6F.js} +2 -2
- package/dist/cli/chunks/types-JQ7EQO5Q.js +2 -0
- package/dist/cli/chunks/unified-memory-CXHLHB5I.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-I7WAE54M.js +2 -0
- package/dist/cli/chunks/unified-persistence-6CPF65WI.js +2 -0
- package/dist/cli/chunks/{upgrade-6ALSDWDD.js → upgrade-TJRVGHGD.js} +2 -2
- package/dist/cli/chunks/{validate-XF4ZG3LC.js → validate-BWPCVHBN.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-P5TAFRDA.js → validate-swarm-QVVKCQLP.js} +2 -2
- package/dist/cli/chunks/{vibium-2XDXKNKZ.js → vibium-ZFATIWHO.js} +2 -2
- package/dist/cli/chunks/visual-security-GNPHME5H.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-4JVRQPX5.js → web-tree-sitter-KPLY7ONR.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-WYJXVDO5.js → windsurf-installer-H7XM7ISA.js} +2 -2
- package/dist/cli/chunks/{witness-chain-RPZ2SE2V.js → witness-chain-RRN6NDCH.js} +2 -2
- package/dist/cli/chunks/witness-chain-VT4UHHBR.js +2 -0
- package/dist/cli/chunks/{witness-key-manager-LXG2VBQQ.js → witness-key-manager-DFRL42GE.js} +2 -2
- package/dist/cli/chunks/workflow-2ZQO6WYI.js +51 -0
- package/dist/cli/chunks/workflow-orchestrator-DB3HIECD.js +2 -0
- package/dist/cli/chunks/{wrappers-DIJNNFU6.js → wrappers-SUS6XEJD.js} +2 -2
- package/dist/cli/commands/ci.js +54 -28
- package/dist/cli/commands/code.js +6 -0
- package/dist/cli/commands/eval.js +3 -2
- package/dist/cli/commands/fleet.js +35 -16
- package/dist/cli/commands/learning-snapshot.d.ts +38 -0
- package/dist/cli/commands/learning-snapshot.js +171 -0
- package/dist/cli/commands/learning.js +16 -64
- package/dist/cli/commands/llm-router.js +13 -12
- package/dist/cli/commands/pipeline.js +9 -0
- package/dist/cli/commands/workflow.js +9 -1
- package/dist/cli/handlers/task-handler.js +19 -9
- package/dist/cli/helpers/domain-plugins.d.ts +5 -0
- package/dist/cli/helpers/domain-plugins.js +11 -0
- package/dist/cli/index.js +17 -8
- package/dist/cli/utils/ci-config.d.ts +3 -0
- package/dist/context/sources/git-source.d.ts +2 -0
- package/dist/context/sources/git-source.js +9 -2
- package/dist/coordination/cancelled-task-settlement.d.ts +11 -0
- package/dist/coordination/cancelled-task-settlement.js +15 -0
- package/dist/coordination/consensus/providers/claude-provider.d.ts +2 -2
- package/dist/coordination/consensus/providers/claude-provider.js +18 -25
- package/dist/coordination/consensus/providers/gemini-provider.d.ts +14 -4
- package/dist/coordination/consensus/providers/gemini-provider.js +39 -36
- package/dist/coordination/consensus/providers/ollama-provider.d.ts +8 -7
- package/dist/coordination/consensus/providers/ollama-provider.js +16 -18
- package/dist/coordination/consensus/providers/openai-provider.d.ts +14 -4
- package/dist/coordination/consensus/providers/openai-provider.js +36 -34
- package/dist/coordination/consensus/providers/openrouter-provider.d.ts +5 -5
- package/dist/coordination/consensus/providers/openrouter-provider.js +64 -37
- package/dist/coordination/handlers/test-execution-handlers.js +5 -3
- package/dist/coordination/interfaces.d.ts +2 -2
- package/dist/coordination/protocol-executor.js +68 -9
- package/dist/coordination/queen-coordinator.js +10 -4
- package/dist/coordination/queen-event-handlers.js +17 -0
- package/dist/coordination/queen-task-management.js +25 -0
- package/dist/coordination/queen-types.d.ts +2 -0
- package/dist/coordination/task-executor.js +4 -8
- package/dist/coordination/workflow-composition.d.ts +19 -0
- package/dist/coordination/workflow-composition.js +114 -0
- package/dist/coordination/workflow-orchestrator.d.ts +3 -2
- package/dist/coordination/workflow-orchestrator.js +219 -85
- package/dist/coordination/workflow-types.d.ts +30 -1
- package/dist/coordination/yaml-pipeline-loader.js +9 -5
- package/dist/domains/chaos-resilience/services/chaos-engineer.js +2 -7
- package/dist/domains/code-intelligence/services/knowledge-graph.js +2 -7
- package/dist/domains/code-intelligence/services/metric-collector/test-counter.js +9 -40
- package/dist/domains/constants.d.ts +1 -6
- package/dist/domains/constants.js +2 -6
- package/dist/domains/contract-testing/services/contract-validator.js +2 -7
- package/dist/domains/coverage-analysis/services/coverage-analyzer.js +2 -12
- package/dist/domains/coverage-analysis/services/gap-detector.js +2 -7
- package/dist/domains/defect-intelligence/services/defect-predictor.js +2 -12
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.js +2 -7
- package/dist/domains/learning-optimization/services/learning-coordinator.js +2 -7
- package/dist/domains/quality-assessment/services/deployment-advisor.js +2 -7
- package/dist/domains/quality-assessment/services/quality-analyzer.js +2 -7
- package/dist/domains/requirements-validation/services/requirements-validator.js +2 -7
- package/dist/domains/security-compliance/services/scanners/sast-scanner.js +3 -7
- package/dist/domains/test-execution/services/flaky-detector.js +33 -3
- package/dist/domains/test-execution/services/retry-handler.js +22 -14
- package/dist/domains/test-execution/services/test-executor.js +42 -21
- package/dist/domains/test-generation/services/test-generator.js +2 -7
- package/dist/domains/visual-accessibility/services/visual-tester.js +2 -7
- package/dist/init/init-wizard-steps.js +1 -1
- package/dist/init/kiro-installer.js +9 -8
- package/dist/init/opencode-installer.js +1 -1
- package/dist/init/phases/07-hooks.js +4 -2
- package/dist/init/phases/12-verification.js +1 -1
- package/dist/init/settings-merge.d.ts +10 -3
- package/dist/init/settings-merge.js +40 -9
- package/dist/integrations/agentic-flow/model-router/types.js +6 -8
- package/dist/integrations/ruvector/brain-exporter.js +9 -15
- package/dist/integrations/ruvector/brain-rvf-exporter.js +17 -30
- package/dist/integrations/ruvector/brain-shared.d.ts +5 -1
- package/dist/integrations/ruvector/brain-shared.js +70 -4
- package/dist/integrations/ruvector/rvf-dual-writer.js +36 -15
- package/dist/integrations/ruvector/rvf-store-integrity.d.ts +14 -9
- package/dist/integrations/ruvector/rvf-store-integrity.js +39 -9
- package/dist/integrations/ruvector/shared-rvf-adapter.js +20 -23
- package/dist/kernel/memory-factory.js +14 -4
- package/dist/kernel/project-root.js +10 -8
- package/dist/kernel/unified-memory.js +1 -1
- package/dist/learning/local-judge-client.d.ts +6 -5
- package/dist/learning/local-judge-client.js +7 -6
- package/dist/learning/pattern-store.js +29 -11
- package/dist/mcp/bundle.js +488 -488
- package/dist/mcp/handlers/index.d.ts +1 -1
- package/dist/mcp/handlers/index.js +1 -1
- package/dist/mcp/handlers/pipeline-handlers.d.ts +31 -1
- package/dist/mcp/handlers/pipeline-handlers.js +63 -0
- package/dist/mcp/handlers/task-handlers.d.ts +1 -0
- package/dist/mcp/handlers/task-handlers.js +12 -4
- package/dist/mcp/protocol-server.d.ts +2 -0
- package/dist/mcp/protocol-server.js +104 -49
- package/dist/mcp/security/sampling-server.js +2 -1
- package/dist/mcp/tool-annotations.js +1 -1
- package/dist/mcp/tools/test-execution/schedule.js +7 -0
- package/dist/mcp/types.d.ts +5 -1
- package/dist/optimization/session-cache.d.ts +5 -0
- package/dist/optimization/session-cache.js +23 -0
- package/dist/routing/advisor/multi-model-executor.d.ts +4 -1
- package/dist/routing/advisor/multi-model-executor.js +8 -1
- package/dist/routing/free-tier/ladder.d.ts +2 -1
- package/dist/routing/free-tier/ladder.js +3 -2
- package/dist/routing/security/cyber-pin.d.ts +35 -11
- package/dist/routing/security/cyber-pin.js +76 -14
- package/dist/routing/value-score.js +1 -1
- package/dist/shared/git/index.d.ts +1 -0
- package/dist/shared/git/index.js +1 -0
- package/dist/shared/git/ref-validation.d.ts +20 -0
- package/dist/shared/git/ref-validation.js +43 -0
- package/dist/shared/llm/anthropic-params.d.ts +40 -0
- package/dist/shared/llm/anthropic-params.js +51 -0
- package/dist/shared/llm/cost-tracker.d.ts +15 -2
- package/dist/shared/llm/cost-tracker.js +62 -10
- package/dist/shared/llm/index.d.ts +2 -2
- package/dist/shared/llm/index.js +2 -2
- package/dist/shared/llm/interfaces.d.ts +1 -1
- package/dist/shared/llm/metrics/cost-metrics.js +5 -4
- package/dist/shared/llm/model-mapping.js +131 -0
- package/dist/shared/llm/model-registry.d.ts +37 -11
- package/dist/shared/llm/model-registry.js +393 -18
- package/dist/shared/llm/openai-params.d.ts +35 -0
- package/dist/shared/llm/openai-params.js +54 -0
- package/dist/shared/llm/provider-manager.js +4 -3
- package/dist/shared/llm/providers/azure-openai.d.ts +11 -0
- package/dist/shared/llm/providers/azure-openai.js +26 -15
- package/dist/shared/llm/providers/bedrock.js +11 -19
- package/dist/shared/llm/providers/claude.js +6 -29
- package/dist/shared/llm/providers/codex.js +4 -3
- package/dist/shared/llm/providers/gemini.d.ts +3 -2
- package/dist/shared/llm/providers/gemini.js +19 -10
- package/dist/shared/llm/providers/ollama.d.ts +2 -0
- package/dist/shared/llm/providers/ollama.js +30 -20
- package/dist/shared/llm/providers/openai.js +10 -17
- package/dist/shared/llm/providers/openrouter.d.ts +1 -1
- package/dist/shared/llm/providers/openrouter.js +57 -21
- package/dist/shared/llm/router/agent-router-config.js +33 -32
- package/dist/shared/llm/router/hybrid-router.js +21 -9
- package/dist/shared/llm/router/routing-rules.js +9 -8
- package/dist/shared/llm/router/types.js +81 -13
- package/dist/shared/llm/translation/message-formatter.js +4 -23
- package/dist/shared/vitest-json-report.d.ts +7 -7
- package/dist/shared/vitest-json-report.js +23 -14
- package/dist/test-scheduling/executors/vitest-executor.d.ts +7 -2
- package/dist/test-scheduling/executors/vitest-executor.js +157 -47
- package/dist/test-scheduling/git-aware/test-selector.js +3 -0
- package/dist/test-scheduling/phase-scheduler.d.ts +1 -0
- package/dist/test-scheduling/phase-scheduler.js +23 -1
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-AKQYU6UH.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-MICRPL3N.js +0 -2
- package/dist/cli/chunks/base-DZK36ITB.js +0 -2
- package/dist/cli/chunks/brain-handler-H5OVZ22L.js +0 -90
- package/dist/cli/chunks/browser-workflow-ADK54DOE.js +0 -2
- package/dist/cli/chunks/chunk-42VSQ2MX.js +0 -4
- package/dist/cli/chunks/chunk-44WISFTU.js +0 -2
- package/dist/cli/chunks/chunk-4OUPCTBS.js +0 -16
- package/dist/cli/chunks/chunk-4TXAP3YH.js +0 -2
- package/dist/cli/chunks/chunk-4W7QVUNO.js +0 -2
- package/dist/cli/chunks/chunk-527HQAY7.js +0 -14
- package/dist/cli/chunks/chunk-5DFHE4H5.js +0 -180
- package/dist/cli/chunks/chunk-5P3G6ZW4.js +0 -2
- package/dist/cli/chunks/chunk-6F2RM6X2.js +0 -2
- package/dist/cli/chunks/chunk-7Y2CEXRS.js +0 -65
- package/dist/cli/chunks/chunk-AWNYEAGB.js +0 -2
- package/dist/cli/chunks/chunk-CBOPBYPU.js +0 -2
- package/dist/cli/chunks/chunk-FD2JFEQC.js +0 -2
- package/dist/cli/chunks/chunk-I4NDQGKP.js +0 -2
- package/dist/cli/chunks/chunk-L2GKMBDP.js +0 -2
- package/dist/cli/chunks/chunk-QLWNXBRU.js +0 -2
- package/dist/cli/chunks/chunk-R2AFVFRF.js +0 -2
- package/dist/cli/chunks/chunk-ROX7NLS4.js +0 -14
- package/dist/cli/chunks/chunk-T62DH4GG.js +0 -11
- package/dist/cli/chunks/chunk-UMNYF5EZ.js +0 -2
- package/dist/cli/chunks/chunk-UTVRQEZM.js +0 -54
- package/dist/cli/chunks/chunk-Y5SQBI2F.js +0 -2
- package/dist/cli/chunks/ci-YVKDQWIX.js +0 -81
- package/dist/cli/chunks/client-M72GXFVQ.js +0 -2
- package/dist/cli/chunks/complexity-analyzer-LEDG62YK.js +0 -2
- package/dist/cli/chunks/core-handlers-C32RAMVI.js +0 -2
- package/dist/cli/chunks/cost-tracker-GJIFB2BM.js +0 -2
- package/dist/cli/chunks/cross-domain-router-UGFUCPKC.js +0 -2
- package/dist/cli/chunks/dream-UFBBXY5W.js +0 -2
- package/dist/cli/chunks/eval-PR6YWDFM.js +0 -17
- package/dist/cli/chunks/fleet-QNT6X2YI.js +0 -43
- package/dist/cli/chunks/heartbeat-scheduler-VQWHSGTY.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-BS3NXWGU.js +0 -2
- package/dist/cli/chunks/hnsw-index-JP26B4HW.js +0 -2
- package/dist/cli/chunks/impact-analyzer-WRE4CWPJ.js +0 -2
- package/dist/cli/chunks/init-wizard-OFOEYB75.js +0 -2
- package/dist/cli/chunks/kernel-MXNFWNUD.js +0 -2
- package/dist/cli/chunks/knowledge-graph-7JE2TVKJ.js +0 -2
- package/dist/cli/chunks/learning-7B5NITDV.js +0 -122
- package/dist/cli/chunks/llm-router-BNEPT5OB.js +0 -37
- package/dist/cli/chunks/llm-router-service-GTDVDKSU.js +0 -2
- package/dist/cli/chunks/load-test-JZ4CLSBF.js +0 -2
- package/dist/cli/chunks/memory-backend-Q54CC5A5.js +0 -2
- package/dist/cli/chunks/memory-handlers-IIBJXKHZ.js +0 -2
- package/dist/cli/chunks/multi-model-executor-HEDVOZ6X.js +0 -14
- package/dist/cli/chunks/pattern-null-store-W33O7FYO.js +0 -2
- package/dist/cli/chunks/pipeline-UOG6UO6D.js +0 -19
- package/dist/cli/chunks/protocol-executor-VGN4M7XY.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-7VB5LJGS.js +0 -2
- package/dist/cli/chunks/queen-coordinator-HIDMJMMG.js +0 -2
- package/dist/cli/chunks/router-CTIJS4D7.js +0 -2
- package/dist/cli/chunks/routing-feedback-LFYYZS5J.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-MNPMIWVM.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-DXOKSSNW.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-PZKUKA7R.js +0 -2
- package/dist/cli/chunks/rvf-store-integrity-Q3FGYKFT.js +0 -2
- package/dist/cli/chunks/safe-db-73BLFV2C.js +0 -2
- package/dist/cli/chunks/schedule-YVTGTTI4.js +0 -2
- package/dist/cli/chunks/scheduler-5DSAFIRQ.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-LRG4IPCU.js +0 -2
- package/dist/cli/chunks/task-handler-L7E2I267.js +0 -49
- package/dist/cli/chunks/task-handlers-6DPKE4AK.js +0 -9
- package/dist/cli/chunks/test-scheduling-4CNJA6TW.js +0 -15
- package/dist/cli/chunks/types-TXMY5M2K.js +0 -2
- package/dist/cli/chunks/unified-memory-VBQ572X4.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-J3L74ZRY.js +0 -2
- package/dist/cli/chunks/unified-persistence-EM2VYRTQ.js +0 -2
- package/dist/cli/chunks/visual-security-GX4S7K6O.js +0 -2
- package/dist/cli/chunks/witness-chain-QGKMHCNW.js +0 -2
- package/dist/cli/chunks/workflow-2OYNO7UU.js +0 -51
- package/dist/cli/chunks/workflow-orchestrator-KWHIJMFV.js +0 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import{a as
|
|
3
|
-
`),!0}installAgents(t){let e=[],s=[],n=o(this.openCodeDir,"agents"),l=o(t,"agents");if(!
|
|
4
|
-
`),e.push(c)}catch(p){s.push(`Failed to convert agent ${r}: ${k(p)}`)}}let g=o(this.options.projectRoot,".claude","agents");if(
|
|
5
|
-
`),e.push(d))}catch(f){s.push(`Failed to convert subagent ${
|
|
6
|
-
]*)"?`,"m");return n.match(h)?.[1]?.trim()??""},g=i("name")||e,r=i("description")||`QE subagent: ${e}`,c=l.replace(/mcp:agentic-qe:/g,"@agentic-qe/"),a=i("model"),p=i("priority"),
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
|
|
2
|
+
import{a as $}from"./chunk-PAWXJ73E.js";import{i as w,j as S,k as _,n as Q}from"./chunk-3TW5W5LX.js";import{a as k,c as R}from"./chunk-G6T45OIC.js";import"./chunk-TT23RRB7.js";R();import{existsSync as m,mkdirSync as y,readdirSync as E,readFileSync as q,writeFileSync as v}from"fs";import{join as o,dirname as T}from"path";import{fileURLToPath as I}from"url";Q();var D=I(import.meta.url),P=T(D),M=class{projectRoot;options;openCodeDir;constructor(t){this.projectRoot=t.projectRoot,this.options={installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:!1,...t},this.openCodeDir=this.findOpenCodeDir()}findOpenCodeDir(){let t=[o(P,"../../.opencode"),o(P,"../../assets/opencode")],e=$(import.meta.url);e&&(t.push(o(e,".opencode")),t.push(o(e,"assets/opencode"))),t.push(o(process.cwd(),"node_modules/agentic-qe/assets/opencode"),o(process.cwd(),"node_modules/agentic-qe/.opencode"));for(let n of t)if(m(n)&&(m(o(n,"agents"))||m(o(n,"skills"))))return n;let s=o(process.cwd(),".opencode");return m(s)&&(m(o(s,"agents"))||m(o(s,"skills")))?s:t[0]}async install(){let t=o(this.projectRoot,".kiro"),e={success:!0,agentsInstalled:[],skillsInstalled:[],hooksInstalled:[],steeringInstalled:[],mcpConfigured:!1,errors:[],targetDir:t};try{if(e.mcpConfigured=this.installMcpConfig(t),this.options.installAgents){let s=this.installAgents(t);e.agentsInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installSkills){let s=this.installSkills(t);e.skillsInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installHooks){let s=this.installHooks(t);e.hooksInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installSteering){let s=this.installSteering(t);e.steeringInstalled=s.installed,e.errors.push(...s.errors)}}catch(s){e.success=!1,e.errors.push(`Kiro installation failed: ${k(s)}`)}return e}installMcpConfig(t){let e=o(t,"settings"),s=o(e,"mcp.json");if(m(s)&&!this.options.overwrite)return!1;y(e,{recursive:!0});let n={mcpServers:{"agentic-qe":{command:"npx",args:["-y","agentic-qe@latest","mcp"],env:this.options.memoryBackend==="memory"?{AQE_MEMORY_BACKEND:"memory",AQE_V3_MODE:"true"}:{AQE_MEMORY_PATH:".agentic-qe/memory.db",AQE_V3_MODE:"true"},disabled:!1,autoApprove:["fleet_init","fleet_status","test_generate_enhanced","coverage_analyze_sublinear","quality_assess","memory_store","memory_query"]}}};return v(s,JSON.stringify(n,null,2)+`
|
|
3
|
+
`),!0}installAgents(t){let e=[],s=[],n=o(this.openCodeDir,"agents"),l=o(t,"agents");if(!m(n))return y(l,{recursive:!0}),this.writeDefaultQEAgent(l),e.push("qe-specialist"),{installed:e,errors:s};y(l,{recursive:!0});let i=E(n).filter(r=>r.endsWith(".yaml"));for(let r of i){let c=r.replace(".yaml",""),a=o(l,`${c}.json`);if(!(m(a)&&!this.options.overwrite))try{let p=q(o(n,r),"utf-8"),u=this.parseYamlAgent(p),d=this.convertToKiroAgent(u);v(a,JSON.stringify(d,null,2)+`
|
|
4
|
+
`),e.push(c)}catch(p){s.push(`Failed to convert agent ${r}: ${k(p)}`)}}let g=o(this.options.projectRoot,".claude","agents");if(m(g)){let r=["subagents","n8n","testing","analysis"];for(let c of r){let a=o(g,c);if(!m(a))continue;let p=E(a,{recursive:!1}).filter(u=>typeof u=="string"&&u.endsWith(".md")&&u!=="README.md");for(let u of p){let d=u.replace(".md",""),h=o(l,`${d}.json`);if(!(m(h)&&!this.options.overwrite))try{let f=q(o(a,u),"utf-8"),A=this.convertMdAgentToKiro(f,d);A&&(v(h,JSON.stringify(A,null,2)+`
|
|
5
|
+
`),e.push(d))}catch(f){s.push(`Failed to convert subagent ${u}: ${k(f)}`)}}}}return{installed:e,errors:s}}convertMdAgentToKiro(t,e){let s=t.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!s)return null;let n=s[1],l=s[2].trim(),i=d=>{let h=new RegExp(`^${d}:\\s*"?([^"
|
|
6
|
+
]*)"?`,"m");return n.match(h)?.[1]?.trim()??""},g=i("name")||e,r=i("description")||`QE subagent: ${e}`,c=l.replace(/mcp:agentic-qe:/g,"@agentic-qe/"),a=i("model"),p=i("priority"),u=w;return a?a.includes("opus")?u=S:a.includes("haiku")&&(u=_):p==="critical"&&(u=w),{name:g,description:r,model:u,prompt:c,mcpServers:{"agentic-qe":{command:"npx",args:["-y","agentic-qe@latest","mcp"]}},tools:["read","write","shell","@agentic-qe"],includeMcpJson:!0}}parseYamlAgent(t){let e=c=>{let a=new RegExp(`^${c}:\\s*(?:"([^"]*)"|(.*))`,"m"),p=t.match(a);return p?(p[1]??p[2]??"").trim():""},s="",n=t.match(/^systemPrompt:\s*\|\s*\n([\s\S]*?)(?=\n\w|\n$)/m);n&&(s=n[1].split(`
|
|
7
7
|
`).map(c=>c.replace(/^ {2}/,"")).join(`
|
|
8
8
|
`).trim());let l=[],i=t.match(/^tools:\s*\n((?:\s+-\s+.*\n?)*)/m);if(i){let c=i[1].split(`
|
|
9
9
|
`);for(let a of c){let p=a.match(/^\s+-\s+"?([^"\n]+)"?/);p&&l.push(p[1].trim())}}let g={},r=t.match(/^permissions:\s*\n((?:\s+.*\n?)*)/m);if(r){let c=r[1].split(`
|
|
10
|
-
`);for(let a of c){let p=a.match(/^\s+"?([^":]+)"?\s*:\s*(\w+)/);p&&(g[p[1].trim()]=p[2].trim())}}return{name:e("name"),description:e("description"),model:e("model")||void 0,systemPrompt:s||void 0,tools:l,permissions:g}}convertToKiroAgent(t){let e={bash:"shell",edit:"write",grep:"shell",glob:"shell"},s=[...new Set(t.tools?.map(a=>a.startsWith("mcp:agentic-qe:")?`@agentic-qe/${a.replace("mcp:agentic-qe:","")}`:e[a]??a)??[])],n=new Set;if(t.permissions)for(let[a,p]of Object.entries(t.permissions))p==="allow"&&(a.startsWith("mcp:agentic-qe:")?n.add(`@agentic-qe/${a.replace("mcp:agentic-qe:","")}`):n.add(e[a]??a));let l=[...n],i=
|
|
11
|
-
`)}installSkills(t){let e=[],s=[],n=o(t,"skills"),l=o(this.options.projectRoot,".claude","skills"),i=o(this.openCodeDir,"skills");y(n,{recursive:!0});let g=new Set;if(
|
|
10
|
+
`);for(let a of c){let p=a.match(/^\s+"?([^":]+)"?\s*:\s*(\w+)/);p&&(g[p[1].trim()]=p[2].trim())}}return{name:e("name"),description:e("description"),model:e("model")||void 0,systemPrompt:s||void 0,tools:l,permissions:g}}convertToKiroAgent(t){let e={bash:"shell",edit:"write",grep:"shell",glob:"shell"},s=[...new Set(t.tools?.map(a=>a.startsWith("mcp:agentic-qe:")?`@agentic-qe/${a.replace("mcp:agentic-qe:","")}`:e[a]??a)??[])],n=new Set;if(t.permissions)for(let[a,p]of Object.entries(t.permissions))p==="allow"&&(a.startsWith("mcp:agentic-qe:")?n.add(`@agentic-qe/${a.replace("mcp:agentic-qe:","")}`):n.add(e[a]??a));let l=[...n],i=w;t.model&&(t.model.includes("opus")?i=S:t.model.includes("haiku")&&(i=_));let r=(t.systemPrompt??`You are ${t.name}, a specialized QE agent in the Agentic QE v3 platform.`).replace(/mcp:agentic-qe:/g,"@agentic-qe/"),c={name:t.name,description:t.description,model:i,prompt:r,mcpServers:{"agentic-qe":{command:"npx",args:["-y","agentic-qe@latest","mcp"]}},tools:s.length>0?s:["read","write","shell","@agentic-qe"],includeMcpJson:!0};return l.length>0&&(c.allowedTools=l),c}writeDefaultQEAgent(t){let e={name:"qe-specialist",description:"Quality Engineering specialist powered by Agentic QE",model:w,prompt:"You are a QE specialist. Use AQE tools for test generation, coverage analysis, and quality assessment. Always call fleet_init before other AQE tools.",mcpServers:{"agentic-qe":{command:"npx",args:["-y","agentic-qe@latest","mcp"]}},tools:["read","write","shell","@agentic-qe"],allowedTools:["read","write","shell","@agentic-qe/*"],includeMcpJson:!0,welcomeMessage:"QE Agent ready. I can generate tests, analyze coverage, and assess quality."};v(o(t,"qe-specialist.json"),JSON.stringify(e,null,2)+`
|
|
11
|
+
`)}installSkills(t){let e=[],s=[],n=o(t,"skills"),l=o(this.options.projectRoot,".claude","skills"),i=o(this.openCodeDir,"skills");y(n,{recursive:!0});let g=new Set;if(m(i))for(let r of E(i).filter(c=>c.endsWith(".yaml")))g.add(r.replace(".yaml",""));for(let r of g){let c=o(n,r),a=o(c,"SKILL.md");if(!(m(a)&&!this.options.overwrite))try{let p=this.findClaudeSkillSource(l,r);if(p){let u=this.convertClaudeSkillToKiro(p,r);y(c,{recursive:!0}),v(a,u,{mode:420}),e.push(r)}else{let u=o(i,`${r}.yaml`);if(m(u)){let d=q(u,"utf-8"),h=this.parseYamlSkill(d),f=this.convertToSkillMd(h);y(c,{recursive:!0}),v(a,f,{mode:420}),e.push(r)}}}catch(p){s.push(`Failed to convert skill ${r}: ${k(p)}`)}}return{installed:e,errors:s}}findClaudeSkillSource(t,e){if(!m(t))return null;let s=o(t,e,"SKILL.md");if(m(s))return q(s,"utf-8");let n=e.replace(/^qe-/,""),l=o(t,n,"SKILL.md");if(m(l))return q(l,"utf-8");if(e.startsWith("qcsd-")){let i=o(t,e,"SKILL.md");if(m(i))return q(i,"utf-8")}return null}convertClaudeSkillToKiro(t,e){let s=t.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!s)return`---
|
|
12
12
|
inclusion: auto
|
|
13
13
|
name: ${e}
|
|
14
14
|
description: AQE skill
|
|
@@ -17,10 +17,10 @@ description: AQE skill
|
|
|
17
17
|
${t}`;let n=s[1],l=s[2],i=n.match(/^name:\s*(.+)/m),g=n.match(/^description:\s*"?([^"\n]*)"?/m),r=n.match(/^tags:\s*\[([^\]]*)\]/m),c=g?.[1]?.trim()??"",a=r?.[1]?.trim()??"",p=["---","inclusion: auto",`name: ${e}`,`description: "${c}"`,a?`tags: [${a}]`:"","---"].filter(Boolean).join(`
|
|
18
18
|
`);return l=l.replace(/mcp:agentic-qe:/g,"@agentic-qe/"),`${p}
|
|
19
19
|
${l}`}parseYamlSkill(t){let e=g=>{let r=new RegExp(`^${g}:\\s*(?:"([^"]*)"|(.*))`,"m"),c=t.match(r);return c?(c[1]??c[2]??"").trim():""},s=[],n=t.match(/^tags:\s*\[([^\]]*)\]/m);n&&s.push(...n[1].split(",").map(g=>g.trim().replace(/^"|"$/g,"")));let l=[],i=t.match(/^steps:\s*\n([\s\S]*)$/m);if(i){let g=i[1].split(/\n\s*-\s+name:\s*/);for(let r of g){if(!r.trim())continue;let c=r.match(/^([^\n]+)/);if(!c)continue;let p=c[1].trim().replace(/^-\s*name:\s*/,"").replace(/^["']|["']$/g,""),d=r.match(/description:\s*"([^"]*)"/)?.[1]?.trim()??"",h="",f=r.match(/prompt:\s*\|\s*\n([\s\S]*?)(?=\n\s+-\s+name:|\n\s*$|$)/);f&&(h=f[1].split(`
|
|
20
|
-
`).map(
|
|
20
|
+
`).map(A=>A.replace(/^ {4,6}/,"")).join(`
|
|
21
21
|
`).trim()),l.push({name:p,description:d,prompt:h})}}return{name:e("name"),description:e("description"),minModelTier:e("minModelTier")||void 0,tags:s,steps:l}}convertToSkillMd(t){let e=[];if(e.push("---"),e.push("inclusion: auto"),e.push(`name: ${t.name}`),e.push(`description: ${t.description}`),e.push("---"),e.push(""),e.push(`# ${t.name}`),e.push(""),e.push(t.description),e.push(""),t.tags&&t.tags.length>0&&(e.push(`**Tags:** ${t.tags.join(", ")}`),e.push("")),e.push("## Prerequisites"),e.push(""),e.push("This skill requires the AQE MCP server. Ensure it is configured in `.kiro/settings/mcp.json`."),e.push(""),t.steps&&t.steps.length>0){e.push("## Steps"),e.push("");for(let s=0;s<t.steps.length;s++){let n=t.steps[s],l=n.name.replace(/^[-\d]+\s*/,"").replace(/-/g," ").replace(/\b\w/g,g=>g.toUpperCase());e.push(`### ${s+1}. ${l}`),e.push("");let i=n.description&&n.description.length>n.name.length?n.description:n.prompt&&n.prompt.length>n.name.length?n.prompt:n.description||n.prompt||"";i&&(e.push(i),e.push(""))}}return e.push("## MCP Tools"),e.push(""),e.push("Use AQE tools via the `@agentic-qe` MCP server:"),e.push(""),e.push("- `@agentic-qe/fleet_init` \u2014 Initialize the QE fleet"),e.push("- `@agentic-qe/test_generate_enhanced` \u2014 Generate tests"),e.push("- `@agentic-qe/coverage_analyze_sublinear` \u2014 Analyze coverage"),e.push("- `@agentic-qe/quality_assess` \u2014 Assess quality gates"),e.push("- `@agentic-qe/memory_store` \u2014 Store learned patterns"),e.push("- `@agentic-qe/memory_query` \u2014 Query past patterns"),e.push(""),e.join(`
|
|
22
|
-
`)}installHooks(t){let e=[],s=[],n=o(t,"hooks");y(n,{recursive:!0});let l=this.getKiroHooks();for(let i of l){let g=o(n,i.filename);if(!(
|
|
23
|
-
`),e.push(i.filename)}catch(r){s.push(`Failed to install hook ${i.filename}: ${k(r)}`)}}return{installed:e,errors:s}}getKiroHooks(){return[{filename:"aqe-test-updater.kiro.hook",config:{name:"AQE Test Updater",description:"Auto-generate or update tests when source files change",version:"1",when:{type:"fileEdited",patterns:["src/**/*.ts","src/**/*.js","!**/*.test.*","!**/*.spec.*","!**/node_modules/**"]},then:{type:"askAgent",prompt:"A source file was edited. Use @agentic-qe/test_generate_enhanced to check if corresponding tests need updating. Only update tests if the public API changed."}}},{filename:"aqe-coverage-check.kiro.hook",config:{name:"AQE Coverage Check",description:"Run coverage analysis after test files are created or edited",version:"1",when:{type:"fileEdited",patterns:["**/*.test.ts","**/*.spec.ts","**/*.test.js","**/*.spec.js"]},then:{type:"askAgent",prompt:"A test file was modified. Use @agentic-qe/coverage_analyze_sublinear to check if coverage targets are still met. Report any gaps."}}},{filename:"aqe-spec-quality-gate.kiro.hook",config:{name:"AQE Spec Quality Gate",description:"Run quality assessment after each spec task completes",version:"1",when:{type:"postSpecTask"},then:{type:"askAgent",prompt:"A spec task just completed. Use @agentic-qe/quality_assess on the files changed by this task. If coverage drops below 80% or quality gates fail, flag it before moving to the next task."}}},{filename:"aqe-security-scan.kiro.hook",config:{name:"AQE Security Scan",description:"Run security scan when security-sensitive files change",version:"1",when:{type:"fileEdited",patterns:["**/auth/**","**/security/**","**/middleware/**","**/*credential*","**/*secret*"]},then:{type:"askAgent",prompt:"A security-sensitive file was modified. Use @agentic-qe/security_scan_comprehensive to check for vulnerabilities. Flag any OWASP Top 10 issues."}}},{filename:"aqe-pre-commit-quality.kiro.hook",config:{name:"AQE Pre-Commit Quality",description:"Run quality assessment before agent stops to ensure standards are met",version:"1",when:{type:"agentStop"},then:{type:"askAgent",prompt:"Before finishing, use @agentic-qe/quality_assess to verify all modified files meet quality standards. Store the result with @agentic-qe/memory_store for learning."}}}]}installSteering(t){let e=[],s=[],n=o(t,"steering");y(n,{recursive:!0});let l=this.getSteeringFiles();for(let i of l){let g=o(n,i.filename);if(!(
|
|
22
|
+
`)}installHooks(t){let e=[],s=[],n=o(t,"hooks");y(n,{recursive:!0});let l=this.getKiroHooks();for(let i of l){let g=o(n,i.filename);if(!(m(g)&&!this.options.overwrite))try{v(g,JSON.stringify(i.config,null,2)+`
|
|
23
|
+
`),e.push(i.filename)}catch(r){s.push(`Failed to install hook ${i.filename}: ${k(r)}`)}}return{installed:e,errors:s}}getKiroHooks(){return[{filename:"aqe-test-updater.kiro.hook",config:{name:"AQE Test Updater",description:"Auto-generate or update tests when source files change",version:"1",when:{type:"fileEdited",patterns:["src/**/*.ts","src/**/*.js","!**/*.test.*","!**/*.spec.*","!**/node_modules/**"]},then:{type:"askAgent",prompt:"A source file was edited. Use @agentic-qe/test_generate_enhanced to check if corresponding tests need updating. Only update tests if the public API changed."}}},{filename:"aqe-coverage-check.kiro.hook",config:{name:"AQE Coverage Check",description:"Run coverage analysis after test files are created or edited",version:"1",when:{type:"fileEdited",patterns:["**/*.test.ts","**/*.spec.ts","**/*.test.js","**/*.spec.js"]},then:{type:"askAgent",prompt:"A test file was modified. Use @agentic-qe/coverage_analyze_sublinear to check if coverage targets are still met. Report any gaps."}}},{filename:"aqe-spec-quality-gate.kiro.hook",config:{name:"AQE Spec Quality Gate",description:"Run quality assessment after each spec task completes",version:"1",when:{type:"postSpecTask"},then:{type:"askAgent",prompt:"A spec task just completed. Use @agentic-qe/quality_assess on the files changed by this task. If coverage drops below 80% or quality gates fail, flag it before moving to the next task."}}},{filename:"aqe-security-scan.kiro.hook",config:{name:"AQE Security Scan",description:"Run security scan when security-sensitive files change",version:"1",when:{type:"fileEdited",patterns:["**/auth/**","**/security/**","**/middleware/**","**/*credential*","**/*secret*"]},then:{type:"askAgent",prompt:"A security-sensitive file was modified. Use @agentic-qe/security_scan_comprehensive to check for vulnerabilities. Flag any OWASP Top 10 issues."}}},{filename:"aqe-pre-commit-quality.kiro.hook",config:{name:"AQE Pre-Commit Quality",description:"Run quality assessment before agent stops to ensure standards are met",version:"1",when:{type:"agentStop"},then:{type:"askAgent",prompt:"Before finishing, use @agentic-qe/quality_assess to verify all modified files meet quality standards. Store the result with @agentic-qe/memory_store for learning."}}}]}installSteering(t){let e=[],s=[],n=o(t,"steering");y(n,{recursive:!0});let l=this.getSteeringFiles();for(let i of l){let g=o(n,i.filename);if(!(m(g)&&!this.options.overwrite))try{v(g,i.content),e.push(i.filename)}catch(r){s.push(`Failed to install steering file ${i.filename}: ${k(r)}`)}}return{installed:e,errors:s}}getSteeringFiles(){return[{filename:"qe-standards.md",content:`---
|
|
24
24
|
inclusion: auto
|
|
25
25
|
name: qe-standards
|
|
26
26
|
description: Quality engineering standards and practices. Triggered when discussing tests, coverage, quality gates, or code review.
|
|
@@ -71,4 +71,4 @@ fileMatchPattern: "**/*.test.{ts,js,tsx,jsx}"
|
|
|
71
71
|
- Mock external dependencies at system boundaries
|
|
72
72
|
- Prefer dependency injection over module mocking
|
|
73
73
|
- Never mock the system under test
|
|
74
|
-
`}]}};function
|
|
74
|
+
`}]}};function x(b){return new M(b)}export{M as KiroInstaller,x as createKiroInstaller};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
|
|
2
|
+
import{g as a}from"./chunk-ONII3572.js";import"./chunk-R5NE6B2M.js";import"./chunk-ZZDIMOOV.js";import"./chunk-3TW5W5LX.js";import"./chunk-NA7B2QYB.js";import"./chunk-Y3MW3YBC.js";import"./chunk-DHJPWQBR.js";import"./chunk-STM3UDNO.js";import"./chunk-G6T45OIC.js";import"./chunk-TT23RRB7.js";export{a as KnowledgeGraphService};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
|
|
3
|
+
import{a as de}from"./chunk-JBNEE5UH.js";import{b as le}from"./chunk-3VOQRIQM.js";import{a as re}from"./chunk-6TPKK7LD.js";import{h as ce}from"./chunk-CIKSHTEQ.js";import"./chunk-5Z6XZV7K.js";import"./chunk-IFCLB7FJ.js";import"./chunk-4OYFXLBK.js";import"./chunk-ZBAKA4YB.js";import{i as M}from"./chunk-T6BVLVI5.js";import"./chunk-ZJ26AQA5.js";import"./chunk-OBAP2TXZ.js";import"./chunk-IPR4QP3H.js";import"./chunk-DEYLEDJN.js";import"./chunk-TPGED2IF.js";import{d as ie}from"./chunk-MCUJEZT6.js";import{b as ae,n as se}from"./chunk-NDPFGIMJ.js";import{o as oe}from"./chunk-55RWDRJD.js";import"./chunk-R4VL6E65.js";import"./chunk-RJCYCLZV.js";import"./chunk-NA7B2QYB.js";import"./chunk-Y3MW3YBC.js";import{b as P}from"./chunk-PEPFCPES.js";import{b as B,d as Ce}from"./chunk-DHJPWQBR.js";import"./chunk-BOZZYWCR.js";import"./chunk-TDZ53WO2.js";import"./chunk-QGIU2WRL.js";import"./chunk-STM3UDNO.js";import"./chunk-G6T45OIC.js";import"./chunk-SRKETSFF.js";import{a as E,b as H}from"./chunk-BGE6FOLM.js";import"./chunk-5YPYDPBJ.js";import"./chunk-HDSAM2RE.js";import"./chunk-KCZR45PA.js";import"./chunk-BFP7KO7P.js";import"./chunk-ODKLFVYC.js";import"./chunk-VD6QRULW.js";import"./chunk-KHFNNVJA.js";import"./chunk-CNG6GQEZ.js";import"./chunk-TT23RRB7.js";oe();Ce();import{Command as je}from"commander";import o from"chalk";import v from"node:path";import{existsSync as x,writeFileSync as De,readFileSync as ne,copyFileSync as Fe,renameSync as ke}from"node:fs";import{stat as Le,unlink as I}from"node:fs/promises";H();H();import{existsSync as j,realpathSync as ye,statSync as X}from"node:fs";import{mkdir as $e,mkdtemp as ve,rename as _e,rm as Z,stat as ee}from"node:fs/promises";import{basename as Ie,dirname as L,join as _,resolve as be}from"node:path";import{randomUUID as Ne}from"node:crypto";oe();import k from"chalk";import U from"node:path";import{createReadStream as ge,createWriteStream as pe}from"node:fs";import{createGzip as Pe,createGunzip as Ae}from"node:zlib";import{pipeline as ue}from"node:stream/promises";H();var O={reasoningBank:null,initialized:!1};async function A(){if(O.initialized&&O.reasoningBank)return O.reasoningBank;let r=P(),t=U.join(r,".agentic-qe"),e=new re({sqlite:{path:U.join(t,"memory.db"),walMode:!0,poolSize:3,busyTimeout:5e3},enableFallback:!0,defaultNamespace:"qe-patterns"});await e.initialize(),O.reasoningBank=ce(e,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0}),await O.reasoningBank.initialize();try{let{getSharedRvfDualWriter:n}=await import("./shared-rvf-dual-writer-2CSG7C4W.js"),s=await n();s&&O.reasoningBank.setRvfDualWriter(s)}catch(n){process.env.DEBUG&&console.debug("[learning] RVF wiring skipped:",n instanceof Error?n.message:n)}return O.initialized=!0,O.reasoningBank}function w(r){console.log(JSON.stringify(r,null,2))}function C(r){console.log(k.green("\u2713"),r)}function S(r){console.error(k.red("\u2717"),r)}function T(r){console.log(k.blue("\u2139"),r)}function me(r){let{current:t,topDomains:e}=r,n={tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502",ml:"\u251C",mr:"\u2524"},s=55,g=n.h.repeat(s-2);console.log(""),console.log(`${n.tl}${g}${n.tr}`),console.log(`${n.v}${Oe("AQE LEARNING DASHBOARD",s-2)}${n.v}`),console.log(`${n.ml}${g}${n.mr}`);let c=t.patternsCreatedToday>0?k.green(` (+${t.patternsCreatedToday} today)`):"";console.log(`${n.v} Patterns: ${D(String(t.totalPatterns)+c,32)}${n.v}`);let l=t.experiencesToday>0?k.green(` (+${t.experiencesToday} today)`):"";console.log(`${n.v} Experiences: ${D(String(t.totalExperiences)+l,32)}${n.v}`),console.log(`${n.v} Q-Values: ${D(String(t.totalQValues),32)}${n.v}`);let u=t.avgReward.toFixed(2),p=t.avgRewardDelta>=0?k.green(`(\u2191 ${Math.abs(t.avgRewardDelta).toFixed(2)} from last week)`):k.red(`(\u2193 ${Math.abs(t.avgRewardDelta).toFixed(2)} from last week)`);console.log(`${n.v} Avg Reward: ${D(`${u} ${p}`,32)}${n.v}`);let a=(t.successRate*100).toFixed(1);if(console.log(`${n.v} Success Rate: ${D(`${a}%`,32)}${n.v}`),console.log(`${n.v} Short-term: ${D(String(t.shortTermPatterns),32)}${n.v}`),console.log(`${n.v} Long-term: ${D(String(t.longTermPatterns),32)}${n.v}`),console.log(`${n.v}${" ".repeat(s-2)}${n.v}`),console.log(`${n.v} ${k.bold("Domain Coverage:")}${" ".repeat(s-19)}${n.v}`),e.length===0)console.log(`${n.v} ${k.dim("No patterns yet")}${" ".repeat(s-19)}${n.v}`);else{let i=Math.max(...e.map(h=>h.count),1),m=14;for(let{domain:h,count:y}of e){let b=Math.round(y/i*m),$=m-b,R=k.green("\u2588".repeat(b))+k.dim("\u2591".repeat($)),q=D(h,20),G=Te(String(y),3);console.log(`${n.v} ${q} ${R} ${G} patterns ${n.v}`)}let d=new Set(e.map(h=>h.domain)),f=M.filter(h=>!d.has(h)).slice(0,3);for(let h of f){let y=k.dim("\u2591".repeat(m)),b=D(h,20);console.log(`${n.v} ${b} ${y} 0 patterns ${n.v}`)}}console.log(`${n.bl}${g}${n.br}`),console.log("")}function Oe(r,t){let e=J(r),n=Math.max(0,t-e.length),s=Math.floor(n/2),g=n-s;return" ".repeat(s)+r+" ".repeat(g)}function D(r,t){let e=J(r),n=Math.max(0,t-e.length);return r+" ".repeat(n)}function Te(r,t){let e=J(r),n=Math.max(0,t-e.length);return" ".repeat(n)+r}function J(r){return r.replace(/\x1b\[[0-9;]*m/g,"")}function N(){let r=P();return U.join(r,".agentic-qe","memory.db")}async function Q(r,t){let e=t||`${r}.gz`;return await ue(ge(r),Pe(),pe(e)),e}async function F(r,t){await ue(ge(r),Ae(),pe(t))}async function z(r){try{let t=E(r,{readonly:!0}),e=t.prepare("PRAGMA integrity_check").get();return t.close(),e.integrity_check==="ok"?{valid:!0,message:"Database integrity verified"}:{valid:!1,message:`Integrity check failed: ${e.integrity_check}`}}catch(t){return{valid:!1,message:`Failed to verify: ${t instanceof Error?t.message:"unknown error"}`}}}async function K(r){try{let t=E(r,{readonly:!0});if(!t.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='schema_version'").get())return t.close(),0;let n=t.prepare("SELECT version FROM schema_version WHERE id = 1").get();return t.close(),n?.version??0}catch{return 0}}var Y="3.1.0",fe={generate:"test-generation","test-generation":"test-generation",analyze:"coverage-analysis",coverage:"coverage-analysis","coverage-analysis":"coverage-analysis",run:"test-execution","test-execution":"test-execution",report:"quality-assessment",quality:"quality-assessment","quality-analysis":"quality-assessment",security:"security-compliance",sast:"security-compliance",owasp:"security-compliance",secrets:"security-compliance",audit:"security-compliance",recommend:"defect-intelligence",predict:"defect-intelligence","complexity-analysis":"code-intelligence","code-analysis":"code-intelligence",stabilize:"chaos-resilience",flaky:"chaos-resilience",quarantine:"chaos-resilience",retry:"chaos-resilience",stress:"chaos-resilience",load:"chaos-resilience",endurance:"chaos-resilience",baseline:"chaos-resilience"},he={generate:"test-template","test-generation":"test-template",analyze:"coverage-strategy",coverage:"coverage-strategy","coverage-analysis":"coverage-strategy",run:"test-template","test-execution":"test-template",report:"assertion-pattern",quality:"assertion-pattern","quality-analysis":"assertion-pattern",security:"assertion-pattern",sast:"assertion-pattern",owasp:"assertion-pattern",secrets:"assertion-pattern",audit:"assertion-pattern",recommend:"assertion-pattern",predict:"assertion-pattern","complexity-analysis":"assertion-pattern","code-analysis":"assertion-pattern",stabilize:"flaky-fix",flaky:"flaky-fix",quarantine:"flaky-fix",retry:"flaky-fix",stress:"perf-benchmark",load:"perf-benchmark",endurance:"perf-benchmark",baseline:"perf-benchmark",mock:"mock-pattern",dependency:"mock-pattern"};function Se(r){let t=E(r,{readonly:!0,fileMustExist:!0});try{let e=t.pragma("integrity_check");if(e.length!==1||e[0].integrity_check!=="ok")throw new Error("Database integrity verification failed");return{schemaVersion:(t.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_version'").get()?t.prepare("SELECT version FROM schema_version WHERE id = 1").get():void 0)?.version??0,pages:t.pragma("page_count",{simple:!0}),verification:{valid:!0,message:"Database integrity verified"}}}finally{t.close()}}function W(r){return j(r)?ye(r):_(ye(L(r)),Ie(r))}function we(r,t){if(W(r)===W(t))return!0;if(!j(r)||!j(t))return!1;let e=X(r),n=X(t);return e.dev===n.dev&&e.ino===n.ino}function te(r,t){let e=W(r),n=W(t);for(let s of["","-wal","-shm","-journal"])if(we(`${e}${s}`,t)||we(r,`${n}${s}`))throw new Error("Backup source and destination must not alias the same database or its sidecars")}function Ee(r){if(!X(r).isFile())throw new Error("Backup input must be a regular file")}async function V(r,t,e={}){let n=E(r,{readonly:!0,fileMustExist:!0});try{let s=await n.backup(t);if(s.totalPages<=0||s.remainingPages!==0||e.expectedPages!==void 0&&s.totalPages!==e.expectedPages)throw new Error("SQLite snapshot did not complete; the source may be empty or the destination busy");if(e.standalone){let c=E(t,{fileMustExist:!0,walMode:!1});try{if(c.pragma("journal_mode = DELETE",{simple:!0})!=="delete")throw new Error("Could not create a standalone SQLite image")}finally{c.close()}}let g=Se(t);if(g.pages!==s.totalPages)throw new Error("SQLite snapshot page count does not match the completed backup");return g}finally{n.close()}}async function xe(r,t,e={}){Ee(r);let n=be(e.compress?`${t}.gz`:t);await $e(L(n),{recursive:!0}),te(r,be(t)),te(r,n);let s=await ve(_(L(n),".aqe-backup-"));try{let g=_(s,"snapshot.db"),c=await V(r,g,{standalone:!0}),l=e.compress?await Q(g):g;if(e.compress&&e.verify){let a=_(s,"verified.db");await F(l,a),Se(a)}let u=Number(((await ee(r)).size/1024).toFixed(2)),p=Number(((await ee(l)).size/1024).toFixed(2));if(["-wal","-shm","-journal"].some(a=>j(`${n}${a}`)))throw new Error("Backup destination has SQLite sidecars; choose an unused output path");return await _e(l,n),{backupPath:n,sourceSizeKB:u,backupSizeKB:p,compressed:!!e.compress,schemaVersion:c.schemaVersion,verification:c.verification}}finally{await Z(s,{recursive:!0,force:!0})}}async function Re(r,t,e={}){if(Ee(r),await $e(L(t),{recursive:!0}),te(r,t),j(t)&&!e.force)throw new Error(`Database already exists at: ${t}. Use --force to overwrite`);let n=await ve(_(L(t),".aqe-restore-")),s;try{let g=r.endsWith(".gz"),c=_(n,"snapshot.db"),l=r;g&&(l=_(n,"decompressed.db"),await F(r,l));let u=await V(l,c,{standalone:!0}),p=Number(((await ee(c)).size/1024).toFixed(2));if(j(t)){let a=new Date().toISOString().replace(/[:.]/g,"-"),i=`${t}.pre-restore-${a}-${Ne()}.db`;try{await V(t,i,{standalone:!0}),s=i}catch(m){throw await Z(i,{force:!0}),new Error("Cannot create a verified safety backup of the existing database; restore refused. Stop project processes and preserve the database and its sidecars before restoring into an absent destination.",{cause:m})}}return await V(c,t,{expectedPages:u.pages}),{sizeKB:p,schemaVersion:u.schemaVersion,wasCompressed:g,safetyBackupPath:s}}catch(g){if(s){let c=g instanceof Error?g.message:"SQLite snapshot failed";throw new Error(`Restore failed: ${c}; previous database snapshot preserved at ${s}`,{cause:g})}throw g}finally{await Z(n,{recursive:!0,force:!0})}}function Qt(){let r=new je("learning").description("AQE self-learning system management (standalone, no claude-flow required)").addHelpText("after",`
|
|
4
|
+
Examples:
|
|
5
|
+
# Check learning system status
|
|
6
|
+
aqe learning stats
|
|
7
|
+
|
|
8
|
+
# Consolidate patterns (promote successful patterns to long-term memory)
|
|
9
|
+
aqe learning consolidate
|
|
10
|
+
|
|
11
|
+
# Export learned patterns for sharing
|
|
12
|
+
aqe learning export --output patterns.json
|
|
13
|
+
|
|
14
|
+
# Import patterns from another project
|
|
15
|
+
aqe learning import --input patterns.json
|
|
16
|
+
|
|
17
|
+
# Run background learning consolidation
|
|
18
|
+
aqe learning daemon --interval 3600
|
|
19
|
+
`);return Me(r),Qe(r),ze(r),Ve(r),We(r),Ge(r),He(r),Ue(r),Je(r),Ke(r),Ye(r),Xe(r),Ze(r),et(r),Be(r),qe(r),tt(r),ot(r),at(r),r}function qe(r){r.command("embedding-health").description("Display active and stored embedding-space provenance").option("--json","Output as JSON").action(async t=>{let e=v.join(P(),".agentic-qe","memory.db");if(!x(e))throw new Error('Database not found. Run "aqe init --auto" first.');let n=E(e,{readonly:!0});try{let s=n.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_pattern_embeddings'").get(),g=s?n.prepare("PRAGMA table_info('qe_pattern_embeddings')").all().some(u=>u.name==="space_id"):!1,c=s?n.prepare(`SELECT ${g?"space_id":"NULL"} AS spaceId FROM qe_pattern_embeddings`).all():[],l=ae(c,se()?.spaceId??null);if(t.json){w(l);return}console.log(o.bold(`
|
|
20
|
+
Embedding Space Health
|
|
21
|
+
`)),console.log(` Status: ${l.status}`),console.log(` Active space: ${l.activeSpaceId??"(runtime not initialized)"}`),console.log(` Stored spaces: ${l.storedSpaceIds.join(", ")||"(none)"}`),console.log(` Verified vectors: ${l.verifiedVectors}`),console.log(` Mismatched vectors: ${l.mismatchedVectors}`),console.log(` Unverified vectors: ${l.unverifiedVectors}
|
|
22
|
+
`)}finally{n.close()}})}function Be(r){r.command("backfill-embeddings").description("Generate embeddings for learned patterns that are missing vectors").option("-b, --batch-size <n>","Patterns per embedding batch","32").option("--dry-run","Report missing embeddings without writing").option("--json","Output as JSON").action(async t=>{let e=Number(t.batchSize);if(!Number.isInteger(e)||e<=0)throw new Error("batch size must be a positive integer");let n=ie();try{await n.initialize();let s=n.getGhostPatternCount();if(t.dryRun){t.json?w({dryRun:!0,batchSize:e,...s}):(console.log(o.bold(`
|
|
23
|
+
Pattern Embedding Backfill (dry run)
|
|
24
|
+
`)),console.log(` Patterns: ${s.total}`),console.log(` Missing embeddings: ${s.withoutEmbeddings}`),s.sampleGhostIds.length>0&&console.log(` Sample IDs: ${s.sampleGhostIds.join(", ")}`),console.log(""));return}let g=await n.backfillEmbeddings(e),c=n.getGhostPatternCount(),l={...g,batchSize:e,missingBefore:s.withoutEmbeddings,missingAfter:c.withoutEmbeddings};t.json?w(l):(C("Pattern embedding backfill complete."),console.log(` Processed: ${g.processed}`),console.log(` Skipped: ${g.skipped}`),console.log(` Errors: ${g.errors}`),console.log(` Remaining missing: ${c.withoutEmbeddings}`),console.log(` Method: ${g.method}`),console.log(""))}catch(s){throw S(`backfill-embeddings failed: ${s instanceof Error?s.message:"unknown"}`),s}finally{n.close()}})}function Me(r){r.command("stats").description("Display learning system statistics").option("--json","Output as JSON").option("--detailed","Show detailed breakdown").action(async t=>{try{let n=await(await A()).getStats();if(t.json)w(n);else{console.log(o.bold(`
|
|
25
|
+
\u{1F4CA} AQE Learning System Statistics
|
|
26
|
+
`)),console.log(o.bold("Patterns:")),console.log(` Total: ${o.cyan(n.totalPatterns)}`),console.log(` Short-term: ${n.patternStoreStats.byTier.shortTerm}`),console.log(` Long-term: ${n.patternStoreStats.byTier.longTerm}`),console.log(` Avg Confidence: ${(n.patternStoreStats.avgConfidence*100).toFixed(1)}%`),console.log(` Avg Quality: ${(n.patternStoreStats.avgQualityScore*100).toFixed(1)}%`),console.log(o.bold(`
|
|
27
|
+
By Domain:`));let s=Object.entries(n.byDomain).filter(([c,l])=>l>0).sort((c,l)=>l[1]-c[1]);if(s.length===0)console.log(o.dim(" No patterns yet"));else for(let[c,l]of s)console.log(` ${c}: ${l}`);console.log(o.bold(`
|
|
28
|
+
Learning:`)),console.log(` Routing Requests: ${n.routingRequests}`),console.log(` Avg Routing Confidence: ${(n.avgRoutingConfidence*100).toFixed(1)}%`),console.log(` Learning Outcomes: ${n.learningOutcomes}`),console.log(` Pattern Success Rate: ${(n.patternSuccessRate*100).toFixed(1)}%`),console.log(o.bold(`
|
|
29
|
+
Search Performance:`)),console.log(` Operations: ${n.patternStoreStats.searchOperations}`),console.log(` Avg Latency: ${n.patternStoreStats.avgSearchLatencyMs.toFixed(2)}ms`),console.log(` HNSW Native: ${n.patternStoreStats.hnswStats.nativeAvailable?o.green("\u2713"):o.dim("\u25CB")}`),console.log(` Vector Count: ${n.patternStoreStats.hnswStats.vectorCount}`);let g=n.asymmetricLearning;if(g&&(console.log(o.bold(`
|
|
30
|
+
Asymmetric Learning (ADR-061):`)),console.log(` Failure Penalty Ratio: ${g.failurePenaltyRatio||"10:1"}`),console.log(` Quarantined Patterns: ${g.quarantinedPatterns||0}`),console.log(` Rehabilitated: ${g.rehabilitatedPatterns||0}`),console.log(` Avg Confidence Delta: ${((g.avgConfidenceDelta||0)*100).toFixed(1)}%`)),t.detailed){console.log(o.bold(`
|
|
31
|
+
By Pattern Type:`));for(let[c,l]of Object.entries(n.patternStoreStats.byType))l>0&&console.log(` ${c}: ${l}`)}console.log("")}return}catch(e){throw S(`stats failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Qe(r){r.command("consolidate").description("Consolidate patterns - promote successful patterns to long-term memory").option("--dry-run","Show what would be promoted without making changes").option("--threshold <n>","Minimum successful uses for promotion","3").option("--success-rate <n>","Minimum success rate for promotion (0-1)","0.7").option("--json","Output as JSON").action(async t=>{try{let e=await A(),n=Number(t.threshold),s=Number(t.successRate),g=.6;if(!Number.isInteger(n)||n<1)throw new Error("threshold must be a positive integer");if(!Number.isFinite(s)||s<0||s>1)throw new Error("success rate must be between 0 and 1");let c=[],l=await e.searchPatterns("",{limit:1e3});if(!l.success)throw new Error(l.error.message);for(let a of l.value){let i=a.pattern;i.tier==="short-term"&&i.successfulUses>=n&&i.successRate>=s&&i.confidence>=g&&c.push({id:i.id,name:i.name,domain:i.qeDomain,successfulUses:i.successfulUses,successRate:i.successRate,currentTier:i.tier})}let u=0,p=[];if(!t.dryRun)for(let a of c){let i=await e.promotePattern(a.id);i.success?u++:p.push({id:a.id,error:i.error.message})}if(t.json)w({dryRun:t.dryRun||!1,eligibleCount:c.length,promotedCount:u,failedCount:p.length,threshold:n,successRateMin:s,confidenceMin:g,patterns:c,failures:p});else{if(console.log(o.bold(`
|
|
32
|
+
\u{1F504} Pattern Consolidation
|
|
33
|
+
`)),console.log(` Promotion threshold: ${n} successful uses`),console.log(` Minimum success rate: ${(s*100).toFixed(0)}%`),console.log(` Minimum confidence: ${(g*100).toFixed(0)}%`),console.log(` Eligible patterns: ${c.length}
|
|
34
|
+
`),c.length===0)console.log(o.dim(" No patterns eligible for promotion yet."));else{console.log(o.bold(" Patterns to promote:"));for(let a of c)console.log(` ${o.cyan(a.name)}`),console.log(o.dim(` Domain: ${a.domain}, Uses: ${a.successfulUses}, Rate: ${(a.successRate*100).toFixed(0)}%`));if(t.dryRun)console.log(o.yellow(`
|
|
35
|
+
Dry run - no changes made`));else if(console.log(o.green(`
|
|
36
|
+
Promoted: ${u}`)),p.length>0){console.log(o.red(` Failed: ${p.length}`));for(let a of p)console.log(o.dim(` ${a.id}: ${a.error}`))}}console.log("")}return}catch(e){throw S(`consolidate failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function ze(r){r.command("export").description("Export learned patterns for sharing").option("-o, --output <file>","Output file path","aqe-patterns.json").option("-d, --domain <domain>","Filter by domain").option("--long-term-only","Only export long-term patterns").option("--json","Output as JSON (to stdout)").action(async t=>{try{let n=await(await A()).searchPatterns("",{limit:1e4,domain:t.domain});if(!n.success)throw new Error(n.error.message);let s=n.value.map(c=>c.pattern).filter(c=>!t.longTermOnly||c.tier==="long-term"),g={version:"3.0.0",exportedAt:new Date().toISOString(),source:process.cwd(),patternCount:s.length,patterns:s.map(c=>({id:c.id,name:c.name,description:c.description,patternType:c.patternType,qeDomain:c.qeDomain,tier:c.tier,confidence:c.confidence,successRate:c.successRate,successfulUses:c.successfulUses,qualityScore:c.qualityScore,template:c.template,context:c.context}))};if(t.json)w(g);else{let c=v.resolve(t.output);De(c,JSON.stringify(g,null,2),"utf-8"),C(`Exported ${s.length} patterns to ${c}`)}return}catch(e){throw S(`export failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Ve(r){r.command("import").description("Import patterns from file").requiredOption("-i, --input <file>","Input file path").option("--dry-run","Show what would be imported without making changes").option("--json","Output as JSON").action(async t=>{try{let e=v.resolve(t.input);if(!x(e))throw new Error(`File not found: ${e}`);let n=ne(e,"utf-8"),s=B(n);if(!s.patterns||!Array.isArray(s.patterns))throw new Error("Invalid pattern file format");let g=await A(),c=0,l=0,u=[];if(!t.dryRun)for(let p of s.patterns)try{let a=await g.storePattern({patternType:p.patternType,name:p.name,description:p.description,template:p.template,context:p.context});a.success?c++:(l++,u.push(`${p.name}: ${a.error.message}`))}catch(a){l++,u.push(`${p.name}: ${a instanceof Error?a.message:"unknown"}`)}t.json?w({dryRun:t.dryRun||!1,totalPatterns:s.patterns.length,imported:c,skipped:l,errors:u}):(console.log(o.bold(`
|
|
37
|
+
\u{1F4E5} Pattern Import
|
|
38
|
+
`)),console.log(` Source: ${e}`),console.log(` Total patterns: ${s.patterns.length}`),t.dryRun?(console.log(o.yellow(`
|
|
39
|
+
Dry run - no changes made`)),console.log(` Would import: ${s.patterns.length} patterns`)):(console.log(o.green(`
|
|
40
|
+
Imported: ${c}`)),l>0&&console.log(o.yellow(` Skipped: ${l}`))),console.log(""));return}catch(e){throw S(`import failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function We(r){r.command("reset").description("Reset learning data (patterns and metrics)").option("--confirm","Confirm reset without prompting").option("--patterns-only","Only reset patterns, keep metrics").action(async t=>{try{if(!t.confirm){console.log(o.yellow(`
|
|
41
|
+
\u26A0\uFE0F This will reset your learning data.`)),console.log(o.gray(` Use --confirm to proceed
|
|
42
|
+
`));return}let e=P(),n=v.join(e,".agentic-qe"),s=[v.join(n,"data","patterns"),v.join(n,"data","hnsw")];t.patternsOnly||s.push(v.join(n,"data","learning-config.json")),console.log(o.bold(`
|
|
43
|
+
\u{1F5D1}\uFE0F Resetting Learning Data
|
|
44
|
+
`));for(let g of s)x(g)&&console.log(o.dim(` Removing: ${v.relative(e,g)}`));C(`Learning data reset. Run "aqe init --auto" to reinitialize.
|
|
45
|
+
`);return}catch(e){throw S(`reset failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Ge(r){r.command("extract").description("Extract QE patterns from existing learning experiences").option("--min-reward <n>","Minimum reward threshold for pattern extraction","0.7").option("--min-count <n>","Minimum occurrences to form a pattern","3").option("--dry-run","Show what would be extracted without saving").option("--json","Output as JSON").action(async t=>{try{let e=P(),n=v.join(e,".agentic-qe","memory.db");if(!x(n))throw new Error('No memory database found. Run "aqe init --auto" first.');let s=parseFloat(t.minReward),g=parseInt(t.minCount,10);console.log(o.bold(`
|
|
46
|
+
\u{1F52C} Pattern Extraction from Learning Experiences
|
|
47
|
+
`)),console.log(` Min reward threshold: ${s}`),console.log(` Min occurrences: ${g}
|
|
48
|
+
`);let c=E(n,{readonly:!0}),l=c.prepare(`
|
|
49
|
+
SELECT domain as task_type, COUNT(*) as count, AVG(quality) as avg_reward, MAX(quality) as max_reward,
|
|
50
|
+
MIN(quality) as min_reward, GROUP_CONCAT(DISTINCT agent) as actions
|
|
51
|
+
FROM captured_experiences WHERE quality >= ? AND agent != 'cli-hook' GROUP BY domain HAVING COUNT(*) >= ? ORDER BY avg_reward DESC
|
|
52
|
+
`).all(s,g),u=[];try{u=c.prepare(`
|
|
53
|
+
SELECT substr(key, 1, 40) as key_prefix, COUNT(*) as count
|
|
54
|
+
FROM memory_entries WHERE key LIKE 'phase2/learning/%'
|
|
55
|
+
GROUP BY substr(key, 1, 40) HAVING COUNT(*) >= ? ORDER BY COUNT(*) DESC LIMIT 20
|
|
56
|
+
`).all(g)}catch{}c.close();let p=[];for(let a of l){let i=fe[a.task_type]||"code-intelligence",m=he[a.task_type]||"test-template",d=a.actions?a.actions.split(",").slice(0,5):[];p.push({name:`${a.task_type}-success-pattern`,domain:i,patternType:m,confidence:Math.min(.95,a.avg_reward/2),sourceCount:a.count,avgReward:a.avg_reward,actions:d})}if(t.json)w({minReward:s,minCount:g,dryRun:t.dryRun||!1,experienceGroups:l.length,memoryPatterns:u.length,extractedPatterns:p});else{if(console.log(o.bold("Learning Experience Groups:")),l.length===0)console.log(o.dim(" No qualifying experience groups found"));else for(let a of l){let i=a.avg_reward>=1?o.green:a.avg_reward>=.5?o.yellow:o.red;console.log(` ${o.cyan(a.task_type)}`),console.log(` Count: ${a.count}, Avg Reward: ${i(a.avg_reward.toFixed(2))}`)}console.log(o.bold(`
|
|
57
|
+
Memory Pattern Sources:`));for(let a of u.slice(0,10))console.log(` ${a.key_prefix}... (${a.count})`);if(console.log(o.bold(`
|
|
58
|
+
Extracted Patterns:`)),p.length===0)console.log(o.dim(" No patterns extracted"));else for(let a of p)console.log(` ${o.green("+")} ${o.cyan(a.name)}`),console.log(o.dim(` Domain: ${a.domain}, Type: ${a.patternType}`)),console.log(o.dim(` Confidence: ${(a.confidence*100).toFixed(0)}%, Sources: ${a.sourceCount}`));if(!t.dryRun&&p.length>0){let a=await A(),i=0,m=[];for(let d of p)try{let f=d.actions.length>0?`// ${d.name}
|
|
59
|
+
// Steps: ${d.actions.join(" -> ")}
|
|
60
|
+
|
|
61
|
+
{{implementation}}`:`// ${d.name}
|
|
62
|
+
// Extracted pattern with ${d.sourceCount} successful uses
|
|
63
|
+
|
|
64
|
+
{{implementation}}`,h=await a.storePattern({patternType:d.patternType,name:d.name,description:`Extracted from ${d.sourceCount} learning experiences with avg reward ${d.avgReward.toFixed(2)}`,template:{type:"code",content:f,variables:[{name:"implementation",type:"code",required:!0,description:"Implementation code for this pattern"}]},context:{tags:[d.domain,d.patternType,`sources:${d.sourceCount}`,`reward:${d.avgReward.toFixed(2)}`]}});h.success?i++:m.push(`${d.name}: ${h.error.message}`)}catch(f){m.push(`${d.name}: ${f instanceof Error?f.message:"unknown"}`)}console.log(o.green(`
|
|
65
|
+
\u2713 Stored ${i} new patterns`)),m.length>0&&m.length<=5&&console.log(o.yellow(` Errors: ${m.slice(0,3).join(", ")}${m.length>3?"...":""}`))}else t.dryRun&&console.log(o.yellow(`
|
|
66
|
+
Dry run - no patterns stored`));console.log("")}return}catch(e){throw S(`extract failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function He(r){r.command("dashboard").description("Display learning system dashboard with metrics and trends").option("--json","Output as JSON").option("--save-snapshot","Save a daily metrics snapshot").action(async t=>{try{let e=P(),n=le(e);await n.initialize(),t.saveSnapshot&&(await n.saveSnapshot(),C("Daily snapshot saved"));let s=await n.getDashboardData();n.close(),t.json?w(s):me(s);return}catch(e){throw S(`dashboard failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Ue(r){r.command("info").description("Show learning system configuration and paths").action(async()=>{try{let t=P(),e=v.join(t,".agentic-qe");console.log(o.bold(`
|
|
67
|
+
\u{1F4CB} AQE Learning System Info
|
|
68
|
+
`)),console.log(o.bold("Paths:")),console.log(` Data directory: ${e}`),console.log(` Memory database: ${v.join(e,"memory.db")}`),console.log(` HNSW index: ${v.join(e,"data","hnsw")}`),console.log(` Patterns: ${v.join(e,"data","patterns")}`),console.log(o.bold(`
|
|
69
|
+
Configuration:`)),console.log(` Learning enabled: ${process.env.AQE_LEARNING_ENABLED!=="false"?o.green("yes"):o.red("no")}`),console.log(` V3 mode: ${process.env.AQE_V3_MODE==="true"?o.green("yes"):o.dim("no")}`),console.log(` Promotion threshold: ${process.env.AQE_V3_PATTERN_PROMOTION_THRESHOLD||"3"} uses`),console.log(` Success rate threshold: ${process.env.AQE_V3_SUCCESS_RATE_THRESHOLD||"0.7"}`),console.log(o.bold(`
|
|
70
|
+
Domains:`)),console.log(` ${M.join(", ")}`),console.log(o.bold(`
|
|
71
|
+
Hooks:`)),console.log(" Configure in .claude/settings.json"),console.log(` Events: pre-edit, post-edit, pre-task, post-task, route
|
|
72
|
+
`);return}catch(t){throw S(`info failed: ${t instanceof Error?t.message:"unknown"}`),t}})}function Je(r){r.command("backup").description("Backup learning database to a file").option("-o, --output <path>","Dedicated backup artifact path; never another live database").option("--compress","Compress backup with gzip").option("--verify","Verify backup integrity after creation").option("--json","Output as JSON").action(async t=>{try{let e=N();if(!x(e))throw new Error(`No learning database found at: ${e}`);let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),s=v.join(process.cwd(),"backups",`learning-${n}.db`),g=t.output?v.resolve(t.output):s,c=await xe(e,g,t),{backupPath:l,sourceSizeKB:u,backupSizeKB:p,schemaVersion:a}=c,i=t.verify?c.verification:void 0;if(t.json)w({success:!0,sourcePath:e,backupPath:l,sourceSizeKB:u,backupSizeKB:p,compressed:t.compress||!1,schemaVersion:a,verification:i,timestamp:new Date().toISOString()});else{if(console.log(o.bold(`
|
|
73
|
+
\u{1F4BE} Learning Database Backup
|
|
74
|
+
`)),console.log(` Source: ${e}`),console.log(` Source size: ${u} KB`),console.log(` Backup: ${l}`),console.log(` Backup size: ${p} KB`),console.log(` Schema version: ${a}`),t.compress){let m=((1-p/u)*100).toFixed(1);console.log(` Compression: ${m}% reduction`)}i&&console.log(i.valid?o.green(` Verification: ${i.message}`):o.red(` Verification: ${i.message}`)),C(`Backup saved to: ${l}
|
|
75
|
+
`)}return}catch(e){throw S(`backup failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Ke(r){r.command("restore").description("Restore a verified learning database backup (stop project writers first)").requiredOption("-i, --input <path>","Backup file path to restore from").option("--verify","Verify backup integrity before restore (always enforced)").option("--force","Overwrite existing database without confirmation").option("--json","Output as JSON").action(async t=>{try{let e=v.resolve(t.input),n=N();if(!x(e))throw new Error(`Backup file not found: ${e}`);let s=await Re(e,n,{force:t.force}),{sizeKB:g,schemaVersion:c,wasCompressed:l,safetyBackupPath:u}=s;t.json?w({success:!0,backupPath:e,restoredPath:n,sizeKB:g,schemaVersion:c,wasCompressed:l,safetyBackupPath:u,timestamp:new Date().toISOString()}):(console.log(o.bold(`
|
|
76
|
+
\u{1F504} Learning Database Restore
|
|
77
|
+
`)),console.log(` Backup: ${e}`),console.log(` Restored to: ${n}`),console.log(` Size: ${g.toFixed(2)} KB`),console.log(` Schema version: ${c}`),u&&console.log(` Previous database: ${u}`),C(`Database restored successfully
|
|
78
|
+
`));return}catch(e){throw S(`restore failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Ye(r){r.command("verify").description("Verify learning database integrity").option("-f, --file <path>","Database file to verify (defaults to current)").option("--json","Output as JSON").action(async t=>{try{let e=t.file?v.resolve(t.file):N();if(!x(e))throw new Error(`Database file not found: ${e}`);let n=await z(e),s=await K(e),g=await Le(e),c={};try{let l=E(e,{readonly:!0});for(let u of["qe_patterns","qe_trajectories","captured_experiences","kv_store","vectors"])try{let p=l.prepare(`SELECT COUNT(*) as count FROM ${u}`).get();c[u]=p.count}catch{}l.close()}catch{}if(t.json)w({valid:n.valid,message:n.message,path:e,sizeKB:parseFloat((g.size/1024).toFixed(2)),schemaVersion:s,tableCounts:c,timestamp:new Date().toISOString()});else{if(console.log(o.bold(`
|
|
79
|
+
\u{1F50D} Database Verification
|
|
80
|
+
`)),console.log(` Path: ${e}`),console.log(` Size: ${(g.size/1024).toFixed(2)} KB`),console.log(` Schema version: ${s}`),console.log(n.valid?o.green(` Status: ${n.message}`):o.red(` Status: ${n.message}`)),Object.keys(c).length>0){console.log(o.bold(`
|
|
81
|
+
Table Counts:`));for(let[l,u]of Object.entries(c))console.log(` ${l}: ${u}`)}console.log("")}if(!n.valid)throw new Error(`Database verification failed: ${n.message}`);return}catch(e){throw S(`verify failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Xe(r){r.command("export-full").description("Export all learning data including patterns, trajectories, and experiences").option("-o, --output <file>","Output file path","aqe-learning-export.json").option("--compress","Compress output with gzip").option("--include-trajectories","Include learning trajectories").option("--include-experiences","Include learning experiences").option("--json","Output as JSON (to stdout)").action(async t=>{try{let e=N();if(!x(e))throw new Error('No learning database found. Run "aqe init --auto" first.');let n=await A(),s=await K(e),g=await n.searchPatterns("",{limit:1e4});if(!g.success)throw new Error(g.error.message);let c=g.value.map(u=>({id:u.pattern.id,name:u.pattern.name,description:u.pattern.description,patternType:u.pattern.patternType,qeDomain:u.pattern.qeDomain,tier:u.pattern.tier,confidence:u.pattern.confidence,successRate:u.pattern.successRate,successfulUses:u.pattern.successfulUses,qualityScore:u.pattern.qualityScore,template:u.pattern.template,context:u.pattern.context,createdAt:u.pattern.createdAt instanceof Date?u.pattern.createdAt.toISOString():u.pattern.createdAt||void 0,lastUsedAt:u.pattern.lastUsedAt instanceof Date?u.pattern.lastUsedAt.toISOString():u.pattern.lastUsedAt||void 0})),l={version:Y,exportedAt:new Date().toISOString(),source:process.cwd(),schemaVersion:s,patternCount:c.length,patterns:c};if(t.includeTrajectories)try{let u=E(e,{readonly:!0}),p=u.prepare("SELECT id, task, agent, domain, success, steps_json FROM qe_trajectories ORDER BY started_at DESC LIMIT 1000").all();l.trajectories=p.map(a=>({id:a.id,task:a.task,agent:a.agent,domain:a.domain,success:a.success,stepsJson:a.steps_json})),u.close()}catch{}if(t.includeExperiences)try{let u=E(e,{readonly:!0}),p=u.prepare("SELECT domain as task_type, agent as action, AVG(quality) as avg_reward, COUNT(*) as count FROM captured_experiences WHERE agent != 'cli-hook' GROUP BY domain, agent ORDER BY count DESC LIMIT 500").all();l.experiences=p.map(i=>({taskType:i.task_type,action:i.action,reward:i.avg_reward,count:i.count}));let a=u.prepare("SELECT COUNT(*) as total, AVG(quality) as avg_reward FROM captured_experiences WHERE agent != 'cli-hook'").get();l.metadata={totalExperiences:a.total,avgReward:a.avg_reward},u.close()}catch{}if(t.json)w(l);else{let u=v.resolve(t.output);if(De(u,JSON.stringify(l,null,2),"utf-8"),t.compress){let p=await Q(u);await I(u),u=p}console.log(o.bold(`
|
|
82
|
+
\u{1F4E4} Learning Data Export
|
|
83
|
+
`)),console.log(` Patterns: ${c.length}`),l.trajectories&&console.log(` Trajectories: ${l.trajectories.length}`),l.experiences&&console.log(` Experience groups: ${l.experiences.length}`),console.log(` Schema version: ${s}`),console.log(` Export format: ${Y}`),C(`Exported to: ${u}
|
|
84
|
+
`)}return}catch(e){throw S(`export-full failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Ze(r){r.command("import-merge").description("Import and merge patterns from export file (preserves existing data)").requiredOption("-i, --input <file>","Input file path").option("--skip-duplicates","Skip patterns with matching names (default: update)").option("--dry-run","Show what would be imported without making changes").option("--json","Output as JSON").action(async t=>{try{let e=v.resolve(t.input);if(!x(e))throw new Error(`File not found: ${e}`);let n;if(e.endsWith(".gz")){let h=e.replace(".gz",".tmp.json");await F(e,h),n=ne(h,"utf-8"),await I(h)}else n=ne(e,"utf-8");let s=B(n);if(!s.patterns||!Array.isArray(s.patterns))throw new Error("Invalid import file format: missing patterns array");let g=await A(),c=await g.searchPatterns("",{limit:1e4}),l=new Set;if(c.success)for(let h of c.value)l.add(h.pattern.name);let u=0,p=0,a=0,i=[];if(!t.dryRun)for(let h of s.patterns){let y=l.has(h.name);if(y&&t.skipDuplicates){p++;continue}try{let b=await g.storePattern({patternType:h.patternType,name:h.name,description:h.description,template:h.template,context:h.context});b.success?y?a++:u++:(p++,i.push(`${h.name}: ${b.error.message}`))}catch(b){p++,i.push(`${h.name}: ${b instanceof Error?b.message:"unknown"}`)}}let m=0,d=0,f=0;if(t.dryRun)for(let h of s.patterns){let y=l.has(h.name);y&&t.skipDuplicates?d++:y?f++:m++}t.json?w({dryRun:t.dryRun||!1,importVersion:s.version,totalPatterns:s.patterns.length,imported:t.dryRun?m:u,updated:t.dryRun?f:a,skipped:t.dryRun?d:p,errors:i.slice(0,10)}):(console.log(o.bold(`
|
|
85
|
+
\u{1F4E5} Learning Data Import (Merge)
|
|
86
|
+
`)),console.log(` Source: ${e}`),console.log(` Export version: ${s.version||"unknown"}`),console.log(` Total patterns: ${s.patterns.length}`),console.log(` Existing patterns: ${l.size}`),t.dryRun?(console.log(o.yellow(`
|
|
87
|
+
Dry run - no changes made`)),console.log(` Would import: ${m}
|
|
88
|
+
Would update: ${f}
|
|
89
|
+
Would skip: ${d}`)):(console.log(o.green(`
|
|
90
|
+
Imported: ${u}`)),console.log(o.blue(` Updated: ${a}`)),p>0&&console.log(o.yellow(` Skipped: ${p}`)),i.length>0&&console.log(o.red(` Errors: ${i.length}`))),console.log(""));return}catch(e){throw S(`import-merge failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function et(r){r.command("dream").description("Run dream cycles for pattern discovery via spreading activation").option("--duration <ms>","Duration of dream cycle in milliseconds","30000").option("--quick","Run a quick 5-second dream cycle").option("--full","Run a full 30-second dream cycle").option("--status","Show dream system status").option("--history","Show past dream cycles").option("--insights","Show pending insights from previous cycles").option("--apply <id>","Apply a specific insight by ID").option("--limit <n>","Maximum results for history/insights","20").option("--min-patterns <n>","Minimum patterns required to dream","10").option("--json","Output as JSON").action(async t=>{try{let{createDreamEngine:e}=await import("./dream-NFSCSLY7.js");if(t.status){let a=e();await a.initialize();let i=a.isDreaming(),m=await a.getDreamHistory(100),d=await a.getPendingInsights(100),f=m.reduce((y,b)=>y+b.insightsGenerated,0),h=m[0];if(t.json)w({isDreaming:i,totalCycles:m.length,totalInsights:f,pendingInsights:d.length,lastDreamTime:h?.startTime.toISOString()||null});else{if(console.log(o.bold(`
|
|
91
|
+
\u{1F319} Dream System Status
|
|
92
|
+
`)),console.log(` Currently dreaming: ${i?o.green("Yes"):o.dim("No")}`),console.log(` Total dream cycles: ${m.length}`),console.log(` Total insights generated: ${f}`),console.log(` Pending insights: ${d.length}`),console.log(` Last dream: ${h?h.startTime.toISOString():o.dim("never")}`),m.length>0){console.log(o.bold(`
|
|
93
|
+
Recent cycles:`));for(let y of m.slice(0,3)){let b=y.status==="completed"?o.green(y.status):o.yellow(y.status);console.log(` ${y.id.slice(0,8)} | ${b} | ${y.durationMs||0}ms | ${y.insightsGenerated} insights`)}}console.log("")}await a.close();return}if(t.history){let a=parseInt(t.limit,10),i=e();await i.initialize();let m=await i.getDreamHistory(a);if(t.json)w(m.map(d=>({id:d.id,startTime:d.startTime.toISOString(),endTime:d.endTime?.toISOString(),durationMs:d.durationMs,status:d.status,conceptsProcessed:d.conceptsProcessed,associationsFound:d.associationsFound,insightsGenerated:d.insightsGenerated})));else{if(console.log(o.bold(`
|
|
94
|
+
\u{1F319} Dream Cycle History (${m.length} cycles)
|
|
95
|
+
`)),m.length===0)console.log(o.dim(" No dream cycles found. Run: aqe learning dream"));else for(let d of m){let f=d.status==="completed"?o.green("\u2713"):d.status==="failed"?o.red("\u2717"):o.yellow("\u22EF");console.log(` ${f} ${d.id.slice(0,8)} | ${d.startTime.toISOString()}`),console.log(o.dim(` Duration: ${d.durationMs||0}ms | Concepts: ${d.conceptsProcessed} | Associations: ${d.associationsFound} | Insights: ${d.insightsGenerated}`))}console.log("")}await i.close();return}if(t.insights){let a=parseInt(t.limit,10),i=e();await i.initialize();let m=await i.getPendingInsights(a);if(t.json)w(m.map(d=>({id:d.id,type:d.type,description:d.description,noveltyScore:d.noveltyScore,confidenceScore:d.confidenceScore,actionable:d.actionable,applied:d.applied||!1,suggestedAction:d.suggestedAction,createdAt:d.createdAt?.toISOString()})));else{if(console.log(o.bold(`
|
|
96
|
+
\u{1F4A1} Pending Dream Insights (${m.length})
|
|
97
|
+
`)),m.length===0)console.log(o.dim(" No pending insights. Run a dream cycle first: aqe learning dream"));else for(let d of m){let f=d.noveltyScore>=.7?o.green(`${(d.noveltyScore*100).toFixed(0)}%`):o.yellow(`${(d.noveltyScore*100).toFixed(0)}%`),h=d.confidenceScore>=.7?o.green(`${(d.confidenceScore*100).toFixed(0)}%`):o.yellow(`${(d.confidenceScore*100).toFixed(0)}%`);console.log(` ${o.cyan(d.id.slice(0,8))} [${d.type}] ${d.actionable?"\u26A1":" "}`),console.log(` ${d.description}`),console.log(o.dim(` Novelty: ${f} | Confidence: ${h}`)),d.suggestedAction&&console.log(o.dim(` Action: ${d.suggestedAction}`))}console.log("")}await i.close();return}if(t.apply){let a=t.apply,i=e();await i.initialize();let d=(await i.getPendingInsights(100)).find(b=>b.id===a||b.id.startsWith(a));if(!d)throw await i.close(),new Error(`Insight not found: ${a}`);if(!d.actionable)throw await i.close(),new Error(`Insight ${a} is not actionable`);let f=await i.applyInsight(d.id),y=await(await A()).storePattern({patternType:"test-template",name:`Dream Insight: ${d.type}`,description:`${d.description} (confidence: ${d.confidenceScore.toFixed(2)})`,template:{type:"workflow",content:d.suggestedAction||d.description,variables:[]},context:{tags:["dream-generated",d.type,...d.sourceConcepts.slice(0,3)],complexity:"medium"}});if(t.json?w({insightId:d.id,applied:f.success,patternId:y.success?y.value.id:null,error:f.error||(y.success?null:y.error?.message)}):f.success?(C(`Applied insight ${d.id.slice(0,8)}`),y.success&&C(`Created pattern ${y.value.id} in ReasoningBank`)):S(`Failed to apply insight: ${f.error}`),await i.close(),!f.success)throw new Error(`Failed to apply insight: ${f.error}`);return}let n=parseInt(t.duration,10);t.quick&&(n=5e3),t.full&&(n=3e4),n=Math.min(n,6e4);let s=parseInt(t.minPatterns,10);T(`Starting dream cycle (${n}ms, min ${s} patterns)...`);let g=e({maxDurationMs:n,minConceptsRequired:s});await g.initialize();let l=await(await A()).searchPatterns("",{limit:100,minConfidence:.3}),u=0;if(l.success&&l.value.length>0){let a=l.value.map(i=>({id:i.pattern.id,name:i.pattern.name,description:i.pattern.description||`${i.pattern.patternType} pattern`,domain:i.pattern.qeDomain||"learning-optimization",patternType:i.pattern.patternType,confidence:i.pattern.confidence,successRate:i.pattern.successRate||.5}));u=await g.loadPatternsAsConcepts(a),T(`Loaded ${u} patterns from ReasoningBank as concepts`)}else T("No patterns found in ReasoningBank \u2014 dreaming with existing concepts");let p=await g.dream(n);if(t.json)w({cycleId:p.cycle.id,status:p.cycle.status,durationMs:p.cycle.durationMs||0,conceptsProcessed:p.cycle.conceptsProcessed,associationsFound:p.cycle.associationsFound,insightsGenerated:p.cycle.insightsGenerated,activationStats:p.activationStats,patternsCreated:p.patternsCreated,insights:p.insights.map(a=>({id:a.id,type:a.type,description:a.description,noveltyScore:a.noveltyScore,confidenceScore:a.confidenceScore,actionable:a.actionable}))});else{if(console.log(o.bold(`
|
|
98
|
+
\u{1F319} Dream Cycle Complete
|
|
99
|
+
`)),console.log(` Cycle ID: ${p.cycle.id.slice(0,8)}`),console.log(` Status: ${p.cycle.status==="completed"?o.green("completed"):o.yellow(p.cycle.status)}`),console.log(` Duration: ${p.cycle.durationMs||0}ms`),console.log(` Concepts: ${p.cycle.conceptsProcessed}`),console.log(` Associations: ${p.cycle.associationsFound}`),console.log(` Insights: ${p.cycle.insightsGenerated}`),p.activationStats&&(console.log(o.bold(`
|
|
100
|
+
Activation Stats:`)),console.log(` Iterations: ${p.activationStats.totalIterations}`),console.log(` Peak level: ${p.activationStats.peakActivation.toFixed(3)}`),console.log(` Nodes active: ${p.activationStats.nodesActivated}`)),p.insights.length>0){console.log(o.bold(`
|
|
101
|
+
Generated Insights:`));for(let a of p.insights){let i=a.noveltyScore>=.7?o.green(`${(a.noveltyScore*100).toFixed(0)}%`):o.yellow(`${(a.noveltyScore*100).toFixed(0)}%`);console.log(` ${o.cyan(a.id.slice(0,8))} [${a.type}] ${a.actionable?"\u26A1 actionable":""}`),console.log(` ${a.description}`),console.log(o.dim(` Novelty: ${i} | Confidence: ${(a.confidenceScore*100).toFixed(0)}%`))}console.log(o.dim(`
|
|
102
|
+
Apply insights with: aqe learning dream --apply <insight-id>`))}else console.log(o.dim(`
|
|
103
|
+
No insights generated this cycle.`)),console.log(o.dim(" Try loading more patterns or running a longer cycle."));console.log("")}await g.close();return}catch(e){throw S(`dream failed: ${e instanceof Error?e.message:"unknown"}`),e instanceof Error&&e.stack&&console.error(o.dim(e.stack)),e}})}function tt(r){r.command("repair").description("Repair a corrupted learning database (dump + reimport to rebuild indexes)").option("-f, --file <path>","Database file to repair (defaults to current project)").option("--dry-run","Show what would be done without modifying files").option("--json","Output as JSON").action(async t=>{try{let e=t.file?v.resolve(t.file):N();if(!x(e))throw new Error(`Database file not found: ${e}`);let n=await z(e);if(n.valid){t.json?w({status:"healthy",message:"Database is already healthy, no repair needed",path:e}):C("Database integrity check passed \u2014 no repair needed.");return}T(`Corruption detected: ${n.message}`);let s={};try{let $=E(e,{readonly:!0}),R=$.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'").all();for(let q of R)try{let G=$.prepare(`SELECT COUNT(*) as count FROM "${q.name}"`).get();s[q.name]=G.count}catch{}$.close()}catch{}let g=Object.values(s).reduce(($,R)=>$+R,0);if(T(`Found ${Object.keys(s).length} tables, ~${g} total rows`),t.dryRun){t.json?w({status:"dry-run",corruptionDetected:!0,message:n.message,tables:s,totalRows:g}):(console.log(o.bold(`
|
|
104
|
+
Dry run \u2014 would perform these steps:`)),console.log(" 1. Backup corrupted DB"),console.log(" 2. Dump all data via .dump"),console.log(" 3. Reimport into fresh DB (rebuilds all indexes)"),console.log(" 4. Verify integrity of repaired DB"),console.log(" 5. Verify row counts match"),console.log(" 6. Swap repaired DB into place"),console.log(""));return}let c=`${e}.bak-${Date.now()}`;Fe(e,c),T(`Backup created: ${c}`);for(let $ of["-wal","-shm"]){let R=e+$;x(R)&&await I(R)}let{execFileSync:l}=await import("node:child_process"),{openSync:u,closeSync:p,readFileSync:a}=await import("node:fs"),i=`${e}.repaired`,m=`${e}.dump.sql`;try{let $=u(m,"w");try{l("sqlite3",[e,".dump"],{stdio:["ignore",$,"pipe"],timeout:12e4})}finally{p($)}l("sqlite3",[i],{input:a(m),stdio:["pipe","pipe","pipe"],timeout:12e4}),l("sqlite3",[i,"PRAGMA journal_mode=WAL;"],{stdio:"pipe"})}catch($){throw x(i)&&await I(i),x(m)&&await I(m),new Error(`sqlite3 dump/reimport failed: ${$ instanceof Error?$.message:"unknown"}. Is sqlite3 installed?`)}let d=await z(i);if(!d.valid)throw x(m)&&await I(m),new Error(`Repaired DB still has integrity issues: ${d.message}. Backup preserved at ${c}`);let f={},h=E(i,{readonly:!0}),y=h.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'").all();for(let $ of y)try{let R=h.prepare(`SELECT COUNT(*) as count FROM "${$.name}"`).get();f[$.name]=R.count}catch{}h.close();let b=Object.values(f).reduce(($,R)=>$+R,0);ke(e,`${e}.pre-repair`),ke(i,e),x(m)&&await I(m),t.json?w({status:"repaired",backupPath:c,rowsBefore:g,rowsAfter:b,tablesRepaired:Object.keys(f).length,rowCounts:f}):(C("Database repaired successfully!"),console.log(` Backup: ${c}`),console.log(` Rows before: ${g}`),console.log(` Rows after: ${b}`),b<g&&console.log(o.yellow(` Warning: ${g-b} rows may have been lost due to data page corruption`)),console.log(` Tables: ${Object.keys(f).length}`),console.log(` Integrity: ${o.green("OK")}`),console.log(""));return}catch(e){throw S(`repair failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function nt(r){switch(r){case"sublinear":return{arrow:"\u25B2",label:"Sublinear (learning)",color:o.green};case"linear":return{arrow:"\u2192",label:"Linear (stagnating)",color:o.yellow};case"superlinear":return{arrow:"\u25BC",label:"Superlinear (degrading)",color:o.red};default:return{arrow:"?",label:"Insufficient data",color:o.dim}}}function ot(r){r.command("health").description("Display per-domain learning health based on regret tracking").option("--json","Output as JSON").option("--domain <domain>","Filter to a specific domain").action(async t=>{try{let e=P(),n=v.join(e,".agentic-qe","memory.db");if(!x(n))throw new Error('Database not found. Run "aqe init --auto" first.');let s=de(),g=E(n,{readonly:!0});if(g.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='captured_experiences'").get()){let i=t.domain?"AND domain = ?":"",m=[];t.domain&&m.push(t.domain);let d=g.prepare(`
|
|
105
|
+
SELECT domain, quality, success, started_at
|
|
106
|
+
FROM captured_experiences
|
|
107
|
+
WHERE agent != 'cli-hook'
|
|
108
|
+
AND domain IS NOT NULL
|
|
109
|
+
AND domain != ''
|
|
110
|
+
${i}
|
|
111
|
+
ORDER BY started_at ASC
|
|
112
|
+
`).all(...m);for(let f of d){let h=f.quality??(f.success?1:0);s.recordDecision(f.domain,h,1)}}g.close();let l=s.getHealthSummary();if(t.json){w(l);return}if(console.log(""),console.log(o.bold("Learning Health Dashboard:")),l.length===0){console.log(o.dim(" No domain data available. Run some QE tasks to generate learning data.")),console.log("");return}let u=Math.max(...l.map(i=>i.domain.length),20);for(let i of l){let{arrow:m,label:d,color:f}=nt(i.growthRate),h=D(i.domain+":",u+1),y=f(`${m} ${D(d,26)}`),b=`regret: ${i.cumulativeRegret.toFixed(1)}`,$=`decisions: ${i.totalDecisions}`;console.log(` ${h} ${y} ${b} ${$}`)}let p=l.filter(i=>i.stagnating);p.length>0&&(console.log(""),console.log(o.yellow(` Warning: ${p.length} domain(s) showing stagnation: ${p.map(i=>i.domain).join(", ")}`)));let a=l.filter(i=>i.growthRate==="sublinear");a.length>0&&console.log(o.green(` ${a.length} domain(s) actively learning`)),console.log("");return}catch(e){throw S(`health check failed: ${e instanceof Error?e.message:"unknown"}`),e}})}var rt={bridge:3e4,learningWorker:2*36e5,dreamScheduler:2*36e5};function at(r){r.command("loop-health").description("Show pipeline component liveness for the self-learning loop").option("--json","Output as JSON").action(async t=>{try{let e=P(),n=v.join(e,".agentic-qe","memory.db");if(!x(n))throw new Error('Database not found. Run "aqe init --auto" first.');let s=E(n,{readonly:!0}),g;try{g=s.prepare("SELECT value FROM kv_store WHERE key = 'learning:loop-health' LIMIT 1").get()?.value}catch{}let c=null;try{if(s.prepare("PRAGMA table_info(routing_outcomes)").all().some(m=>m.name==="exploration")){let m=s.prepare(`SELECT
|
|
113
|
+
COUNT(*) AS total,
|
|
114
|
+
SUM(CASE WHEN exploration = 1 THEN 1 ELSE 0 END) AS explore,
|
|
115
|
+
AVG(criticality) AS avgCrit,
|
|
116
|
+
AVG(q_weight) AS avgQ
|
|
117
|
+
FROM routing_outcomes
|
|
118
|
+
WHERE created_at >= datetime('now', '-7 days')`).get(),d=m.total??0,f=m.explore??0,h=d-f,y=s.prepare(`SELECT AVG(quality_score) AS avgQ FROM routing_outcomes
|
|
119
|
+
WHERE exploration = 0 AND quality_score >= 0
|
|
120
|
+
AND created_at >= datetime('now', '-7 days')`).get(),b=s.prepare(`SELECT AVG(quality_score) AS avgQ FROM routing_outcomes
|
|
121
|
+
WHERE exploration = 1 AND quality_score >= 0
|
|
122
|
+
AND created_at >= datetime('now', '-7 days')`).get();c={totalDecisions:d,explorationCount:f,exploitCount:h,explorationRate:d>0?f/d:0,avgQualityExploit:y.avgQ,avgQualityExplore:b.avgQ,avgCriticality:m.avgCrit,avgQWeight:m.avgQ}}}catch{}s.close();let l=null;if(g)try{l=B(g)}catch{l=null}let u=Date.now(),p=(a,i)=>{let m=rt[a]??6e5;return!i||!i.lastSuccessAt?"never-ran":u-new Date(i.lastSuccessAt).getTime()>m?"stale":"live"};if(t.json){if(!l){w({overallLastSuccess:null,bootedAt:null,components:{},verdicts:{},routingDiversification:c,note:"No loop-health record yet. Workers must run at least once for this to populate."});return}let a={};for(let i of Object.keys(l.components))a[i]=p(i,l.components[i]);w({...l,verdicts:a,routingDiversification:c});return}if(console.log(""),console.log(o.bold("Self-Learning Loop Health")),console.log(""),!l)console.log(o.dim(" No loop-health record yet.")),console.log(o.dim(" Workers must run at least once to populate.")),console.log(o.dim(" Start the daemon: aqe daemon start"));else{console.log(` Booted at: ${o.dim(l.bootedAt)}`),console.log(` Last success (any): ${l.overallLastSuccess||o.dim("(none yet)")}`),console.log(""),console.log(o.bold(" Components:"));let a=[["bridge","CapturedExperienceBridge"],["learningWorker","LearningConsolidationWorker"],["dreamScheduler","DreamScheduler"]];for(let[m,d]of a){let f=l.components[m],h=p(m,f),y=h==="live"?o.green("\u25CF live"):h==="stale"?o.yellow("\u25CF stale"):o.dim("\u25CB never-ran"),b=f?.lastSuccessAt||o.dim("(never)"),$=f?`${f.successesSinceBoot}/${f.ticksSinceBoot} ticks ok`:o.dim("no ticks");console.log(` ${d.padEnd(32)} ${y.padEnd(20)} ${$}`),console.log(` ${o.dim("last success:")} ${b}`),f?.lastError&&console.log(` ${o.red("last error:")} ${f.lastError.message} ${o.dim("(at "+f.lastError.at+")")}`)}let i=a.filter(([m,d])=>p(m,l.components[m])==="stale");i.length>0&&(console.log(""),console.log(o.yellow(` Warning: ${i.length} component(s) stale \u2014 daemon may not be running or the loop is wedged.`)))}if(c&&c.totalDecisions>0){console.log(""),console.log(o.bold(" Routing diversification (last 7 days):"));let a=(c.explorationRate*100).toFixed(1);if(console.log(` Decisions: ${c.totalDecisions} (${c.exploitCount} exploit, ${c.explorationCount} explore = ${a}%)`),c.avgQualityExploit!==null&&c.avgQualityExplore!==null){let i=c.avgQualityExplore-c.avgQualityExploit,m=i>=0?o.green(`+${i.toFixed(3)}`):o.red(i.toFixed(3));console.log(` Avg quality: exploit=${c.avgQualityExploit.toFixed(3)}, explore=${c.avgQualityExplore.toFixed(3)} (\u0394 ${m})`)}c.avgCriticality!==null&&console.log(` Avg mincut multiplier: ${c.avgCriticality.toFixed(2)} (1.0=full rate, 0.2=critical-topology dampening)`),c.avgQWeight!==null&&c.avgQWeight>0&&console.log(` Avg Q-weight: ${c.avgQWeight.toFixed(3)} (0=cold start, ${.4} max)`)}console.log("");return}catch(e){throw S(`loop-health failed: ${e instanceof Error?e.message:"unknown"}`),e}})}export{Qt as createLearningCommand,A as initializeLearningSystem};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
|
|
2
|
+
import{d as R,e as $,f as I,i as S,j as k,l as M,m as _,n as N,p as D,q as j}from"./chunk-ZBQY5GLF.js";import{i as w,j as T,n as q}from"./chunk-3TW5W5LX.js";import"./chunk-55RWDRJD.js";import"./chunk-R4VL6E65.js";import"./chunk-RJCYCLZV.js";import"./chunk-NA7B2QYB.js";import"./chunk-Y3MW3YBC.js";import"./chunk-PEPFCPES.js";import"./chunk-DHJPWQBR.js";import"./chunk-G6T45OIC.js";import"./chunk-BGE6FOLM.js";import"./chunk-5YPYDPBJ.js";import"./chunk-HDSAM2RE.js";import{b as A,d as J}from"./chunk-KCZR45PA.js";import"./chunk-BFP7KO7P.js";import"./chunk-ODKLFVYC.js";import"./chunk-VD6QRULW.js";import"./chunk-KHFNNVJA.js";import"./chunk-CNG6GQEZ.js";import"./chunk-TT23RRB7.js";J();import{Command as F}from"commander";import t from"chalk";q();var p=null;function x(){return process.env.AQE_CONFIG_ROOT}function b(){return p===null&&(p=j({projectRoot:x()})),p}function U(){p=null}function K(){p!==null&&(D(p,x()),U())}function me(){let o=new F("llm").description("LLM Router management (ADR-043)").addHelpText("after",`
|
|
3
|
+
Examples:
|
|
4
|
+
$ aqe llm providers List available providers
|
|
5
|
+
$ aqe llm models --provider claude List Claude models
|
|
6
|
+
$ aqe llm route "security audit" Test routing for a task
|
|
7
|
+
$ aqe llm config --set mode=cost-optimized
|
|
8
|
+
$ aqe llm health Check provider health
|
|
9
|
+
$ aqe llm cost claude-sonnet-5 --tokens 10000
|
|
10
|
+
$ aqe llm advise --transcript t.json --json Consult advisor (ADR-092)
|
|
11
|
+
$ aqe llm verify --session <id> Check advisor quality gate
|
|
12
|
+
`);return o.command("providers").description("List all available providers and their status").option("--json","Output as JSON").option("-v, --verbose","Show detailed provider info").action(async e=>{await Y(e)}),o.command("models").description("List available models").option("-p, --provider <name>","Filter by provider").option("-t, --tier <tier>","Filter by tier (flagship|advanced|standard|efficient)").option("--json","Output as JSON").action(async e=>{await G(e)}),o.command("route").description("Test routing decision for a task").argument("<task>","Task description").option("-a, --agent <type>","Agent type (e.g., security-auditor)").option("-c, --complexity <level>","Complexity: trivial|low|medium|high|expert","medium").option("-m, --mode <mode>","Routing mode: manual|rule-based|cost-optimized|performance-optimized").option("--json","Output as JSON").action(async(e,n)=>{await H(e,n)}),o.command("config").description("Get/set router configuration").option("-s, --set <key=value>","Set configuration value").option("--json","Output as JSON").action(async e=>{await z(e)}),o.command("health").description("Check provider health status").option("--json","Output as JSON").option("-t, --timeout <ms>","Health check timeout","5000").action(async e=>{await B(e)}),o.command("cost").description("Estimate cost for a model").argument("<model>","Model name (canonical or provider-specific)").option("-t, --tokens <count>","Estimated token count","1000").option("--json","Output as JSON").action(async(e,n)=>{await W(e,n)}),o.command("verify").description("Check whether an advisor was consulted for a session (ADR-092 quality gate)").requiredOption("--session <id>","Session ID to check").option("--min-calls <n>","Minimum required advisor calls (default: 1)","1").option("--json","Output as JSON").action(async e=>{await se(e)}),o.command("advise").description("Consult an advisor model on a forwarded transcript (ADR-092)").option("--transcript <path>","Path to a transcript JSON file").option("--session <id>","Claude Code session ID (reads JSONL from disk)").option("--stdin","Read transcript JSON from stdin").option("--provider <name>","Advisor provider (default: openrouter)").option("--model <id>","Advisor model ID (default: anthropic/claude-opus-4)").option("--max-words <n>","Max advice length in words","100").option("--agent <name>","Agent invoking the advisor (for audit)").option("--trigger-reason <text>","Why the advisor is being called").option("--redact <mode>","Redaction mode: strict|balanced|off (default: strict)","strict").option("--advisor-prompt <text>","Domain-specific advisor system prompt (overrides default)").option("--json","Emit structured JSON to stdout (default)").option("--quiet","Suppress status messages").action(async e=>{await ne(e)}),o}async function Y(o){let e=b(),s=[...k,...I()].map(r=>{let i=e.providers?.[r];return{provider:r,enabled:i?.enabled??(r==="claude"||r==="openai"||r==="ollama"),defaultModel:i?.defaultModel??V(r),status:L(r),external:R(r)}});if(o.json){console.log(JSON.stringify(s,null,2));return}console.log(t.bold.cyan(`
|
|
13
|
+
LLM Providers
|
|
14
|
+
`)),console.log(t.bold(l("Provider",15)+l("Status",12)+l("Enabled",10)+l("Default Model",30))),console.log(t.gray("-".repeat(67)));for(let r of s){let i=r.status==="available"?t.green:r.status==="configured"?t.yellow:t.gray,c=r.enabled?t.green:t.gray;console.log(l(r.external?`${r.provider} *`:r.provider,15)+i(l(r.status,12))+c(l(r.enabled?"Yes":"No",10))+t.gray(l(r.defaultModel||"-",30)))}s.some(r=>r.external)&&console.log(t.gray(`
|
|
15
|
+
* external provider declared by this project, not shipped with AQE`)),o.verbose&&(console.log(t.bold(`
|
|
16
|
+
Routing Configuration:`)),console.log(t.gray(` Mode: ${e.mode}`)),console.log(t.gray(` Default Provider: ${e.defaultProvider}`)),console.log(t.gray(` Default Model: ${e.defaultModel}`)),console.log(t.gray(` Metrics Enabled: ${e.enableMetrics}`)),console.log(t.gray(` Decision Cache: ${e.cacheDecisions}`))),console.log("")}async function G(o){let e=[...M];if(o.provider&&(e=e.filter(n=>n.providerIds[o.provider]!==void 0)),o.tier&&(e=e.filter(n=>n.tier===o.tier)),o.json){console.log(JSON.stringify(e,null,2));return}if(console.log(t.bold.cyan(`
|
|
17
|
+
Available Models
|
|
18
|
+
`)),e.length===0){console.log(t.yellow("No models found matching criteria."));return}console.log(t.bold(l("Model",25)+l("Tier",12)+l("Family",10)+l("Input/1M",12)+l("Output/1M",12))),console.log(t.gray("-".repeat(71)));for(let n of e){let s=n.tier==="flagship"?t.magenta:n.tier==="advanced"?t.cyan:n.tier==="standard"?t.green:t.gray;console.log(l(n.canonicalId,25)+s(l(n.tier,12))+l(n.family,10)+t.yellow(l(E(n.inputCostPer1M),12))+t.yellow(l(E(n.outputCostPer1M),12)))}console.log("")}async function H(o,e){let n=e.mode||b().mode,s=e.complexity||"medium",r=e.agent,i=Z(o,{mode:n,complexity:s,agentType:r});if(e.json){console.log(JSON.stringify(i,null,2));return}console.log(t.bold.cyan(`
|
|
19
|
+
Routing Decision
|
|
20
|
+
`)),console.log(t.gray(`Task: "${o}"`)),console.log(t.gray(`Mode: ${n}`)),r&&console.log(t.gray(`Agent: ${r}`)),console.log(t.gray(`Complexity: ${s}`)),console.log(""),console.log(t.bold("Result:")),console.log(t.green(` Provider: ${i.provider}`)),console.log(t.green(` Model: ${i.model}`)),console.log(t.gray(` Reason: ${i.reason}`)),console.log(t.gray(` Confidence: ${(i.confidence*100).toFixed(0)}%`)),i.estimatedCost&&(console.log(t.bold(`
|
|
21
|
+
Cost Estimate:`)),console.log(t.yellow(` Input tokens: ${i.estimatedCost.inputTokens}`)),console.log(t.yellow(` Output tokens: ${i.estimatedCost.outputTokens}`)),console.log(t.yellow(` Total: $${i.estimatedCost.totalCostUsd.toFixed(6)}`))),console.log("")}async function z(o){if(o.set){let[n,s]=o.set.split("=");(!n||s===void 0)&&(console.error(t.red("Invalid format. Use: --set key=value")),process.exit(1)),X(n,s),console.log(t.green(`Set ${n} = ${s}`));return}let e=b();if(o.json){console.log(JSON.stringify(e,null,2));return}console.log(t.bold.cyan(`
|
|
22
|
+
Router Configuration
|
|
23
|
+
`)),console.log(t.bold("General:")),console.log(` mode: ${t.cyan(e.mode)}`),console.log(` defaultProvider: ${t.cyan(e.defaultProvider)}`),console.log(` defaultModel: ${t.cyan(e.defaultModel)}`),console.log(` enableMetrics: ${e.enableMetrics?t.green("true"):t.gray("false")}`),console.log(` cacheDecisions: ${e.cacheDecisions?t.green("true"):t.gray("false")}`),console.log(` decisionCacheTtlMs: ${t.gray(e.decisionCacheTtlMs)}`),console.log(t.bold(`
|
|
24
|
+
Fallback:`)),console.log(` maxRetries: ${e.fallbackChain.maxRetries}`),console.log(` retryDelayMs: ${e.fallbackChain.retryDelayMs}`),console.log(t.bold(`
|
|
25
|
+
Enabled Providers:`));for(let[n,s]of Object.entries(e.providers||{}))s?.enabled&&console.log(` ${t.green("*")} ${n}: ${s.defaultModel||"default"}`);console.log("")}async function B(o){let e=parseInt(o.timeout||"5000",10),n=await ee(e);if(o.json){console.log(JSON.stringify(n,null,2));return}console.log(t.bold.cyan(`
|
|
26
|
+
Provider Health Status
|
|
27
|
+
`)),console.log(t.bold(l("Provider",15)+l("Status",12)+l("Latency",12)+l("Message",30))),console.log(t.gray("-".repeat(69)));for(let r of n){let i=r.healthy?t.green:t.red,c=r.healthy?"healthy":"unhealthy";console.log(l(r.provider,15)+i(l(c,12))+t.gray(l(r.latencyMs?`${r.latencyMs}ms`:"-",12))+t.gray(l(Q(r.message||"-",28),30)))}let s=n.filter(r=>r.healthy).length;console.log(t.bold(`
|
|
28
|
+
${s}/${n.length} providers healthy
|
|
29
|
+
`))}async function W(o,e){let n=parseInt(e.tokens||"1000",10),s=oe(o);if(!s){console.error(t.red(`Model not found: ${o}`)),console.log(t.gray("Use `aqe llm models` to list available models.")),process.exit(1);return}let r=(s.inputCostPer1M||0)*(n/1e6),i=(s.outputCostPer1M||0)*(n/1e6),c=r+i,d={model:s.canonicalId,tokens:n,inputCostPer1M:s.inputCostPer1M,outputCostPer1M:s.outputCostPer1M,estimatedInputCost:r,estimatedOutputCost:i,estimatedTotalCost:c};if(e.json){console.log(JSON.stringify(d,null,2));return}console.log(t.bold.cyan(`
|
|
30
|
+
Cost Estimate
|
|
31
|
+
`)),console.log(t.gray(`Model: ${s.canonicalName} (${s.canonicalId})`)),console.log(t.gray(`Tokens: ${n.toLocaleString()}
|
|
32
|
+
`)),console.log(t.bold("Pricing (per 1M tokens):")),console.log(` Input: ${E(s.inputCostPer1M)}`),console.log(` Output: ${E(s.outputCostPer1M)}`),console.log(t.bold(`
|
|
33
|
+
Estimated Cost:`)),console.log(` Input: ${t.yellow("$"+r.toFixed(6))}`),console.log(` Output: ${t.yellow("$"+i.toFixed(6))}`),console.log(` Total: ${t.green("$"+c.toFixed(6))}`),console.log("")}function l(o,e){return o.padEnd(e)}function Q(o,e){return o.length<=e?o:o.slice(0,e-1)+"..."}function E(o){return o==null?"-":o===0?"$0 (free)":`$${o.toFixed(2)}`}function V(o){let e={claude:w,"claude-code":"sonnet",codex:"default",openai:"gpt-6-sol",ollama:"qwen3-coder:30b",openrouter:"anthropic/claude-sonnet-5",gemini:"gemini-2.5-flash","azure-openai":"gpt-4o",bedrock:"anthropic.claude-sonnet-4-6-v1:0",cognitum:"cognitum-auto",onnx:"phi-4"};if(S(o))return e[o];let n=$(o),s=n?.config;return s?.defaultModel??s?.models?.[0]??n?.models?.[0]??""}function L(o){let e=s=>!!process.env[s],n=$(o);if(n){let r=n.config?.command?.[0];return r&&_(r)?"available":"configured"}switch(o){case"claude":return e("ANTHROPIC_API_KEY")?"available":"configured";case"openai":return e("OPENAI_API_KEY")?"available":"configured";case"ollama":return"configured";case"openrouter":return e("OPENROUTER_API_KEY")?"available":"not configured";case"gemini":return e("GOOGLE_API_KEY")?"available":"not configured";case"azure-openai":return e("AZURE_OPENAI_API_KEY")?"available":"not configured";case"bedrock":return e("AWS_ACCESS_KEY_ID")?"available":"not configured";case"onnx":return"configured";default:return"not configured"}}function Z(o,e){let{mode:n,complexity:s,agentType:r}=e;if(r?.includes("security")||o.toLowerCase().includes("security"))return{provider:"claude",model:w,reason:"Security tasks require advanced reasoning (rule-match)",confidence:.95,estimatedCost:{inputTokens:2e3,outputTokens:1e3,totalCostUsd:.014}};if(n==="cost-optimized"||s==="trivial"||s==="low")return{provider:"openai",model:"gpt-4o-mini",reason:"Cost optimization selected efficient model",confidence:.85,estimatedCost:{inputTokens:2e3,outputTokens:1e3,totalCostUsd:9e-4}};if(n==="performance-optimized"||s==="expert")return{provider:"claude",model:T,reason:"Complex task requires flagship model",confidence:.92,estimatedCost:{inputTokens:2e3,outputTokens:1e3,totalCostUsd:.028}};let i=b();return{provider:i.defaultProvider,model:i.defaultModel,reason:"Default provider selected",confidence:.8,estimatedCost:{inputTokens:2e3,outputTokens:1e3,totalCostUsd:.021}}}function X(o,e){let n=o.toLowerCase();if(n==="apikey"||n.endsWith(".apikey")||n.includes("apikey="))throw new Error("API keys cannot be saved via 'aqe llm config --set'. They belong in environment variables: ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, GEMINI_API_KEY / GOOGLE_AI_API_KEY / GOOGLE_API_KEY, AZURE_OPENAI_API_KEY. The CLI will not write secrets to .agentic-qe/llm-config.json (which may be checked into source control).");let s=b();switch(o){case"mode":if(["manual","rule-based","cost-optimized","performance-optimized"].includes(e))s.mode=e;else throw new Error(`Invalid mode: ${e}`);break;case"defaultProvider":if(N().includes(e))s.defaultProvider=e;else throw new Error(`Invalid provider: ${e}`);break;case"enableMetrics":s.enableMetrics=e==="true";break;case"cacheDecisions":s.cacheDecisions=e==="true";break;default:throw new Error(`Unknown config key: ${o}`)}K()}async function ee(o){return k.map(e=>{let n=L(e);return{provider:e,healthy:n==="available"||e==="ollama"||e==="onnx",latencyMs:n!=="not configured"?A(50,250):void 0,message:n==="available"?"OK":n==="configured"?"API key not verified":"Not configured"}})}function oe(o){let e=M.find(n=>n.canonicalId===o);if(e)return e;for(let n of M)for(let s of Object.values(n.providerIds))if(s===o)return n}async function te(o){let{readFile:e}=await import("fs/promises");if(o.transcript){let n=await e(o.transcript,"utf-8"),s=JSON.parse(n);if(!s.messages||!Array.isArray(s.messages))throw new Error(`Transcript file must contain a 'messages' array: ${o.transcript}`);return{systemPrompt:s.systemPrompt,taskDescription:s.taskDescription,messages:s.messages}}if(o.stdin){let n=[];for await(let i of process.stdin)n.push(Buffer.from(i));let s=Buffer.concat(n).toString("utf-8"),r=JSON.parse(s);if(!r.messages||!Array.isArray(r.messages))throw new Error("Transcript from stdin must contain a `messages` array");return{systemPrompt:r.systemPrompt,taskDescription:r.taskDescription,messages:r.messages}}if(o.session){let{readFile:n,readdir:s}=await import("fs/promises"),{join:r}=await import("path"),i=await import("os"),c=r(i.homedir(),".claude","projects"),d=null;try{let y=await s(c);for(let f of y){let a=r(c,f),v=(await s(a).catch(()=>[])).find(u=>u.includes(o.session)&&u.endsWith(".jsonl"));if(v){d=r(a,v);break}}}catch{}if(!d)throw new Error(`Could not find session JSONL for session ID "${o.session}" in ~/.claude/projects/. Use --transcript <path> as fallback.`);let P=(await n(d,"utf-8")).trim().split(`
|
|
34
|
+
`).filter(Boolean),m=[];for(let y of P)try{let f=JSON.parse(y),a=f.type,O=f.message;if(!O)continue;let v=O.role,u=O.content;if(a==="user"&&v==="user"){let h=typeof u=="string"?u:Array.isArray(u)?u.map(C=>C.text??"").join(""):"";h.trim()&&m.push({role:"user",content:h})}else if(a==="assistant"&&v==="assistant"){let h=typeof u=="string"?u:Array.isArray(u)?u.filter(C=>C.type==="text").map(C=>C.text??"").join(""):"";h.trim()&&m.push({role:"assistant",content:h})}}catch{}if(m.length===0)throw new Error(`Session JSONL at ${d} contained no parseable messages.`);return{messages:m}}throw new Error("aqe llm advise requires one of: --transcript <path>, --stdin, --session <id>")}async function ne(o){let e=o.json!==!1,n=o.quiet??!1;try{let s=await te(o);!n&&!e&&console.log(t.gray("Consulting advisor..."));let{createLLMRouterService:r}=await import("./llm-router-service-3YT7JGBS.js"),{MultiModelExecutor:i,DEFAULT_ADVISOR_MODEL:c}=await import("./multi-model-executor-KCWSGCDT.js"),d=o.provider,g=await r({projectRoot:x(),allowProjectProviderEndpoints:!1,override:{mode:"manual",...d?{defaultProvider:d}:{},...o.model?{defaultModel:o.model}:{}}});if(!g)throw new Error(`No enabled LLM provider is available for advisor${d?` provider "${d}"`:""}.`);let P=d??g.resolvedConfig.defaultProvider,m=o.model??g.resolvedConfig.providers?.[P]?.defaultModel??g.resolvedConfig.defaultModel??c,y=new i(g.router),f=o.redact??"strict",a=await y.consult(s,{provider:P,model:m,maxWords:o.maxWords?parseInt(o.maxWords,10):void 0,agentName:o.agent,triggerReason:o.triggerReason??"cli",sessionId:o.session??"cli-"+Date.now(),redact:f,advisorSystemPrompt:o.advisorPrompt});e?console.log(JSON.stringify({advice:a.advice,model:a.model,provider:a.provider,tokens_in:a.tokensIn,tokens_out:a.tokensOut,latency_ms:a.latencyMs,cost_usd:a.costUsd,advice_hash:a.adviceHash,trigger_reason:a.triggerReason,cache_hit:a.cacheHit,redaction_applied:a.redactionsApplied.length>0,redactions:a.redactionsApplied,circuit_breaker_remaining:a.circuitBreakerRemaining},null,2)):(console.log(t.bold.cyan(`
|
|
35
|
+
Advisor Response
|
|
36
|
+
`)),console.log(a.advice),console.log(),console.log(t.gray(`(${a.provider}/${a.model}, ${a.tokensIn}\u2192${a.tokensOut} tokens, ${a.latencyMs}ms, $${a.costUsd.toFixed(4)})`))),process.exit(0)}catch(s){let r=s instanceof Error?s.message:String(s),i=s?.exitCode??1;console.error(e?JSON.stringify({error:r,exit_code:i},null,2):t.red(`Error: ${r}`)),process.exit(i)}}async function se(o){let e=o.json??!1,n=parseInt(o.minCalls??"1",10);try{let{AdvisorCircuitBreaker:s}=await import("./circuit-breaker-3FW237WW.js"),i=new s().getState(o.session),c=i.callCount>=n,d={session:o.session,advisor_calls:i.callCount,required:n,gate:c?"PASS":"FAIL"};if(e)console.log(JSON.stringify(d,null,2));else{let g=c?t.green("PASS"):t.red("FAIL");console.log(`
|
|
37
|
+
Advisor Quality Gate: ${g}`),console.log(` Session: ${o.session}`),console.log(` Advisor calls: ${i.callCount}`),console.log(` Required: \u2265${n}`)}process.exit(c?0:7)}catch(s){let r=s instanceof Error?s.message:String(s);console.error(e?JSON.stringify({error:r},null,2):t.red(`Error: ${r}`)),process.exit(1)}}export{me as createLLMRouterCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
|
|
2
|
+
import{a,b,c,d}from"./chunk-PO3IXGMQ.js";import"./chunk-YNXS6CGV.js";import"./chunk-JZ3ORVZ3.js";import"./chunk-FGYMFUE2.js";import"./chunk-DOTK76IJ.js";import"./chunk-ZBQY5GLF.js";import"./chunk-ZZDIMOOV.js";import"./chunk-F3SBRQC6.js";import"./chunk-3TW5W5LX.js";import"./chunk-55RWDRJD.js";import"./chunk-R4VL6E65.js";import"./chunk-RJCYCLZV.js";import"./chunk-NA7B2QYB.js";import"./chunk-Y3MW3YBC.js";import"./chunk-PEPFCPES.js";import"./chunk-DHJPWQBR.js";import"./chunk-G6T45OIC.js";import"./chunk-SRKETSFF.js";import"./chunk-BGE6FOLM.js";import"./chunk-5YPYDPBJ.js";import"./chunk-HDSAM2RE.js";import"./chunk-KCZR45PA.js";import"./chunk-BFP7KO7P.js";import"./chunk-ODKLFVYC.js";import"./chunk-VD6QRULW.js";import"./chunk-KHFNNVJA.js";import"./chunk-CNG6GQEZ.js";import"./chunk-TT23RRB7.js";export{a as createLLMRouterService,d as extractProviderConfigs,b as pickEnabledProviders,c as pickPrimaryAndFallbacks};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import"./chunk-UYJHYMEQ.js";import"./chunk-2IGT5WNQ.js";import{a as d}from"./chunk-ZN3J6TZD.js";import"./chunk-NBWQBQO5.js";import{a as v,c as P}from"./chunk-HRUU7E3D.js";import{i as C}from"./chunk-OYMLHX2B.js";import"./chunk-5IAB5NRZ.js";import"./chunk-XA7CG3LH.js";import"./chunk-Y2DVFVGI.js";var L={maxEvents:1e5,memorySampleInterval:1e3,enableTimeline:!0,timelineSampleInterval:1e3},u=class{config;activeAgents=new Map;peakAgentCount=0;totalAgentsSpawned=0;activeTasks=new Map;totalTasksStarted=0;totalTasksCompleted=0;coordinationLatencies;taskDurations;memorySnapshots;peakMemoryUsed=0;memorySum=0;memorySamples=0;agentTimeline=[];latencyTimeline=[];memoryTimeline=[];startTime=0;endTime=0;running=!1;memorySamplerTimer=null;timelineSamplerTimer=null;issues=[];constructor(t={}){this.config={...L,...t},this.coordinationLatencies=new d(this.config.maxEvents),this.taskDurations=new d(this.config.maxEvents),this.memorySnapshots=new d(1e4)}start(){this.running||(this.running=!0,this.startTime=Date.now(),this.memorySamplerTimer=setInterval(()=>{this.sampleMemory()},this.config.memorySampleInterval),this.config.enableTimeline&&(this.timelineSamplerTimer=setInterval(()=>{this.sampleTimeline()},this.config.timelineSampleInterval)))}stop(){this.running&&(this.running=!1,this.endTime=Date.now(),this.memorySamplerTimer&&(clearInterval(this.memorySamplerTimer),this.memorySamplerTimer=null),this.timelineSamplerTimer&&(clearInterval(this.timelineSamplerTimer),this.timelineSamplerTimer=null))}reset(){this.stop(),this.activeAgents.clear(),this.peakAgentCount=0,this.totalAgentsSpawned=0,this.activeTasks.clear(),this.totalTasksStarted=0,this.totalTasksCompleted=0,this.coordinationLatencies.clear(),this.taskDurations.clear(),this.memorySnapshots.clear(),this.peakMemoryUsed=0,this.memorySum=0,this.memorySamples=0,this.agentTimeline.length=0,this.latencyTimeline.length=0,this.memoryTimeline.length=0,this.startTime=0,this.endTime=0,this.issues.length=0}recordAgentSpawn(t,e=Date.now()){this.activeAgents.set(t,e),this.totalAgentsSpawned++;let r=this.activeAgents.size;r>this.peakAgentCount&&(this.peakAgentCount=r)}recordAgentTerminate(t,e=Date.now()){this.activeAgents.delete(t)}recordTaskStart(t,e,r=Date.now()){this.activeTasks.set(e,{agentId:t,startTime:r}),this.totalTasksStarted++}recordTaskComplete(t,e,r,n=Date.now()){let o=this.activeTasks.get(e);o&&o.agentId===t&&(this.activeTasks.delete(e),this.taskDurations.push(r),this.totalTasksCompleted++)}recordCoordination(t,e,r=Date.now()){this.coordinationLatencies.push(e),e>100&&this.issues.push(`High coordination latency for agent ${t}: ${e}ms`)}recordMemoryUsage(t,e){let r={timestamp:Date.now(),heapUsed:t,heapTotal:e,external:0,rss:0};this.memorySnapshots.push(r),this.memorySum+=t,this.memorySamples++,t>this.peakMemoryUsed&&(this.peakMemoryUsed=t);let n=4*1024*1024*1024;t>n&&this.issues.push(`Memory exceeded 4GB limit: ${(t/1024/1024/1024).toFixed(2)}GB`)}recordIssue(t){this.issues.push(t)}getAgentCount(){return this.activeAgents.size}getPeakAgentCount(){return this.peakAgentCount}getTotalAgentsSpawned(){return this.totalAgentsSpawned}getP95CoordinationLatency(){return this.calculatePercentile(this.coordinationLatencies.toArray(),.95)}getP99CoordinationLatency(){return this.calculatePercentile(this.coordinationLatencies.toArray(),.99)}getCoordinationLatencyPercentiles(){return this.calculatePercentiles(this.coordinationLatencies.toArray())}getTaskLatencyPercentiles(){return this.calculatePercentiles(this.taskDurations.toArray())}getMaxMemoryUsage(){return this.peakMemoryUsed}getAverageMemoryUsage(){return this.memorySamples>0?this.memorySum/this.memorySamples:0}getThroughput(){let e=this.getDuration()/1e3;return{tasks:this.totalTasksCompleted,tasksPerSecond:e>0?this.totalTasksCompleted/e:0,agents:this.totalAgentsSpawned,agentsPerSecond:e>0?this.totalAgentsSpawned/e:0}}getDuration(){return this.startTime===0?0:(this.endTime>0?this.endTime:Date.now())-this.startTime}hasAgentStarvation(){let t=this.activeAgents.size,e=this.activeTasks.size;return t>0&&e===0&&this.totalTasksCompleted>0}hasDeadlocks(){let t=Date.now(),e=6e4,r=Array.from(this.activeTasks.values());for(let n of r)if(t-n.startTime>e)return!0;return!1}exportReport(){let t=this.getDuration(),e=this.getCoordinationLatencyPercentiles(),r=this.getTaskLatencyPercentiles(),n=this.getThroughput(),o=100,a=4*1024*1024*1024,c={agentCount:this.peakAgentCount>=o,memoryLimit:this.peakMemoryUsed<a,coordinationLatency:e.p95<=100,noDeadlocks:!this.hasDeadlocks(),noStarvation:!this.hasAgentStarvation()},y=Object.values(c).every(Boolean),p=this.generateRecommendations(e,this.peakMemoryUsed,n);return{summary:{totalAgents:this.totalAgentsSpawned,peakAgents:this.peakAgentCount,totalTasks:this.totalTasksCompleted,duration:t,success:y,successCriteria:c},performance:{coordinationLatency:e,taskLatency:r,throughput:n},resources:{memoryPeak:this.peakMemoryUsed,memoryAverage:this.getAverageMemoryUsage(),cpuPeak:0,cpuAverage:0},timeline:{agentCounts:[...this.agentTimeline],latencies:[...this.latencyTimeline],memoryUsage:[...this.memoryTimeline]},issues:[...this.issues],recommendations:p}}sampleMemory(){let t=process.memoryUsage();this.recordMemoryUsage(t.heapUsed,t.heapTotal)}sampleTimeline(){let t=Date.now();this.agentTimeline.push({timestamp:t,count:this.activeAgents.size});let e=this.coordinationLatencies.toArray();e.length>0&&this.latencyTimeline.push({timestamp:t,p95:this.calculatePercentile(e,.95)});let r=process.memoryUsage();this.memoryTimeline.push({timestamp:t,heapUsed:r.heapUsed});let n=1e3;this.agentTimeline.length>n&&this.agentTimeline.shift(),this.latencyTimeline.length>n&&this.latencyTimeline.shift(),this.memoryTimeline.length>n&&this.memoryTimeline.shift()}calculatePercentile(t,e){if(t.length===0)return 0;let r=[...t].sort((o,a)=>o-a),n=Math.ceil(r.length*e)-1;return r[Math.max(0,n)]}calculatePercentiles(t){if(t.length===0)return{p50:0,p95:0,p99:0,max:0,min:0,avg:0,count:0};let e=[...t].sort((n,o)=>n-o),r=e.reduce((n,o)=>n+o,0);return{p50:this.calculatePercentile(e,.5),p95:this.calculatePercentile(e,.95),p99:this.calculatePercentile(e,.99),max:e[e.length-1],min:e[0],avg:r/e.length,count:e.length}}generateRecommendations(t,e,r){let n=[];t.p95>100&&n.push(`P95 coordination latency (${t.p95.toFixed(1)}ms) exceeds 100ms target. Consider optimizing gossip protocol or reducing agent count.`),t.p99>t.p95*2&&n.push("High P99/P95 ratio indicates latency outliers. Investigate specific agents or network conditions.");let o=e/1024/1024/1024;return o>3&&n.push(`Memory usage (${o.toFixed(2)}GB) approaching 4GB limit. Consider implementing agent pooling or reducing per-agent memory.`),r.tasksPerSecond<10&&n.push(`Task throughput (${r.tasksPerSecond.toFixed(1)}/s) is low. Consider parallelizing task execution or reducing task complexity.`),this.issues.length>10&&n.push(`${this.issues.length} issues recorded. Review issue log for patterns and prioritize fixes.`),n}};function k(s){return new u(s)}P();var h={memoryWarning:3*1024*1024*1024,memoryCritical:4*1024*1024*1024,latencyP95Warning:75,latencyP95Critical:100,latencyP99Warning:150,latencyP99Critical:200,agentStarvationTime:3e4,deadlockTimeout:6e4,minTasksPerSecond:5,minAgentUtilization:.5,gossipConvergenceTime:5e3,gossipMaxPartitions:0},b={thresholds:h,enableDetailedAnalysis:!0},l=class{config;constructor(t={}){this.config={...b,...t,thresholds:{...h,...t.thresholds}}}analyze(t){let e=[];e.push(this.checkMemoryPressure(t)),e.push(this.checkCoordinationLatencyP95(t)),e.push(this.checkCoordinationLatencyP99(t)),e.push(this.checkAgentStarvation(t)),e.push(this.checkDeadlocks(t)),e.push(this.checkThroughput(t));let r=e.filter(i=>i.detected),n={totalChecks:e.length,detected:r.length,critical:r.filter(i=>i.severity==="critical").length,high:r.filter(i=>i.severity==="high").length,medium:r.filter(i=>i.severity==="medium").length,low:r.filter(i=>i.severity==="low").length},o="low";n.critical>0?o="critical":n.high>0?o="high":n.medium>0&&(o="medium");let a=this.generatePrioritizedRecommendations(r);return{overallSeverity:o,hasCritical:n.critical>0,bottlenecks:e,summary:n,recommendations:a,timestamp:new Date}}analyzeReport(t){let e=[];e.push(this.checkMemoryFromReport(t)),e.push(this.checkLatencyP95FromReport(t)),e.push(this.checkLatencyP99FromReport(t)),e.push(this.checkThroughputFromReport(t)),e.push(this.checkSuccessCriteria(t));let r=e.filter(i=>i.detected),n={totalChecks:e.length,detected:r.length,critical:r.filter(i=>i.severity==="critical").length,high:r.filter(i=>i.severity==="high").length,medium:r.filter(i=>i.severity==="medium").length,low:r.filter(i=>i.severity==="low").length},o="low";n.critical>0?o="critical":n.high>0?o="high":n.medium>0&&(o="medium");let a=this.generatePrioritizedRecommendations(r);return{overallSeverity:o,hasCritical:n.critical>0,bottlenecks:e,summary:n,recommendations:a,timestamp:new Date}}checkMemoryPressure(t){let e=t?.getMaxMemoryUsage()??process.memoryUsage().heapUsed,{memoryWarning:r,memoryCritical:n}=this.config.thresholds,o=e>=r,a="low",i="Memory usage is within acceptable limits.";return e>=n?(a="critical",i="Memory usage exceeds 4GB limit. Implement agent pooling, reduce per-agent state, or decrease concurrent agent count."):e>=r&&(a="high",i="Memory usage approaching critical threshold. Consider optimizing agent memory footprint or implementing memory pressure relief mechanisms."),{detected:o,severity:a,metric:"memory_pressure",threshold:n,actual:e,recommendation:i,context:{usedGB:e/1024/1024/1024,warningThresholdGB:r/1024/1024/1024,criticalThresholdGB:n/1024/1024/1024}}}checkCoordinationLatency(){return this.checkCoordinationLatencyP95()}checkCoordinationLatencyP95(t){let e=t?.getP95CoordinationLatency()??0,{latencyP95Warning:r,latencyP95Critical:n}=this.config.thresholds,o=e>=r,a="low",i="P95 coordination latency is within acceptable limits.";return e>=n?(a="critical",i="P95 coordination latency exceeds 100ms target. Optimize gossip protocol, reduce message size, or implement batching."):e>=r&&(a="medium",i="P95 coordination latency approaching target. Monitor closely and consider proactive optimization."),{detected:o,severity:a,metric:"coordination_latency_p95",threshold:n,actual:e,recommendation:i}}checkCoordinationLatencyP99(t){let e=t?.getP99CoordinationLatency()??0,{latencyP99Warning:r,latencyP99Critical:n}=this.config.thresholds,o=e>=r,a="low",i="P99 coordination latency is within acceptable limits.";return e>=n?(a="high",i="P99 coordination latency indicates outliers. Investigate specific agents or network conditions causing delays."):e>=r&&(a="medium",i="P99 coordination latency elevated. Some agents may be experiencing delays."),{detected:o,severity:a,metric:"coordination_latency_p99",threshold:n,actual:e,recommendation:i}}checkAgentStarvation(t){let e=t?.hasAgentStarvation()??!1;return{detected:e,severity:e?"high":"low",metric:"agent_starvation",threshold:this.config.thresholds.agentStarvationTime,actual:e?1:0,recommendation:e?"Agent starvation detected. Agents are idle without tasks. Review task distribution algorithm and work stealing configuration.":"No agent starvation detected."}}checkDeadlocks(t){let e=t?.hasDeadlocks()??!1;return{detected:e,severity:e?"critical":"low",metric:"deadlock_detection",threshold:this.config.thresholds.deadlockTimeout,actual:e?1:0,recommendation:e?"Potential deadlock detected. Tasks running for extended period. Review lock ordering and add timeout mechanisms.":"No deadlocks detected."}}checkGossipStability(){return{detected:!1,severity:"low",metric:"gossip_stability",threshold:this.config.thresholds.gossipMaxPartitions,actual:0,recommendation:"Gossip protocol stability check requires integration with gossip metrics."}}checkThroughput(t){let r=t?.getThroughput()?.tasksPerSecond??0,n=this.config.thresholds.minTasksPerSecond,o=r<n&&r>0;return{detected:o,severity:o?"medium":"low",metric:"throughput",threshold:n,actual:r,recommendation:o?`Task throughput (${r.toFixed(1)}/s) below minimum (${n}/s). Consider parallelizing task execution or optimizing task handlers.`:"Task throughput is acceptable."}}checkMemoryFromReport(t){let e=t.resources.memoryPeak,{memoryCritical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"critical":"low",metric:"memory_pressure",threshold:r,actual:e,recommendation:e>=r?"Memory exceeded 4GB limit during test.":"Memory usage within limits."}}checkLatencyP95FromReport(t){let e=t.performance.coordinationLatency.p95,{latencyP95Critical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"critical":"low",metric:"coordination_latency_p95",threshold:r,actual:e,recommendation:e>=r?"P95 coordination latency exceeded 100ms target.":"P95 latency within target."}}checkLatencyP99FromReport(t){let e=t.performance.coordinationLatency.p99,{latencyP99Critical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"high":"low",metric:"coordination_latency_p99",threshold:r,actual:e,recommendation:e>=r?"P99 coordination latency indicates significant outliers.":"P99 latency acceptable."}}checkThroughputFromReport(t){let e=t.performance.throughput.tasksPerSecond,r=this.config.thresholds.minTasksPerSecond;return{detected:e<r&&e>0,severity:e<r?"medium":"low",metric:"throughput",threshold:r,actual:e,recommendation:e<r?"Throughput below minimum target.":"Throughput acceptable."}}checkSuccessCriteria(t){let e=t.summary.successCriteria,r=Object.entries(e).filter(([n,o])=>!o).map(([n])=>n);return{detected:r.length>0,severity:r.length>0?"high":"low",metric:"success_criteria",threshold:0,actual:r.length,recommendation:r.length>0?`Failed criteria: ${r.join(", ")}`:"All success criteria met.",context:{failedCriteria:r}}}generatePrioritizedRecommendations(t){let e={critical:0,high:1,medium:2,low:3},r=[...t].sort((a,i)=>e[a.severity]-e[i.severity]),n=new Set,o=[];for(let a of r)n.has(a.recommendation)||(n.add(a.recommendation),o.push(`[${a.severity.toUpperCase()}] ${a.metric}: ${a.recommendation}`));return o}};function T(s){return new l(s)}function f(s){return new l({thresholds:{...h,...s}})}var A={maxAgents:100,memoryLimit:4*1024*1024*1024,coordinationTimeout:100,workloadProfile:"medium",mockMode:!0},S={agentCount:100,memoryLimit:4*1024*1024*1024,coordinationLatency:100,noAgentStarvation:!0,noDeadlocks:!0,gossipStable:!0},g={light:{taskCount:5,taskDuration:50,memoryUsage:5*1024*1024,coordinationFrequency:2,durationVariance:.1},medium:{taskCount:10,taskDuration:100,memoryUsage:10*1024*1024,coordinationFrequency:5,durationVariance:.2},heavy:{taskCount:20,taskDuration:200,memoryUsage:20*1024*1024,coordinationFrequency:10,durationVariance:.3}},M={name:"ramp-up-100",description:"Gradually add agents until reaching 100",steps:[{agents:25,holdTime:3e4},{agents:50,holdTime:3e4},{agents:75,holdTime:3e4},{agents:100,holdTime:6e4}],workload:g.medium},R={name:"burst-100",description:"Instantly spawn 100 agents",steps:[{agents:100,holdTime:12e4}],workload:{taskCount:20,taskDuration:50,memoryUsage:10*1024*1024,coordinationFrequency:5}},x={name:"churn-100",description:"Maintain 100 agents with continuous spawn/terminate",steps:[{agents:100,holdTime:18e4,churnRate:.1}],workload:{taskCount:15,taskDuration:75,memoryUsage:10*1024*1024,coordinationFrequency:5}},D={name:"stress-150",description:"Push beyond 100 agents to find limits",steps:[{agents:100,holdTime:3e4},{agents:125,holdTime:3e4},{agents:150,holdTime:6e4}],workload:g.heavy,criteria:{agentCount:150}},m=class{config;metrics;analyzer;running=!1;stopRequested=!1;mockAgents=new Map;mockTaskTimers=new Map;mockCoordinationTimers=new Map;churnTimer=null;random;constructor(t={},e,r){this.config={...A,...t},this.metrics=k(e),this.analyzer=r?f(r):T(),this.random=this.config.seed!==void 0?this.seededRandom(this.config.seed):Math.random.bind(Math)}async runTest(t,e){let r={name:"custom",description:`Custom test with ${t} agents for ${e}ms`,steps:[{agents:t,holdTime:e}],workload:this.getWorkload()};return this.runScenario(r)}async runScenario(t){if(this.running)throw new Error("Load test already running");this.running=!0,this.stopRequested=!1;let e=Date.now();try{this.metrics.reset(),this.metrics.start();for(let i of t.steps){if(this.stopRequested)break;await this.executeStep(i,t.workload)}this.metrics.stop();let r=this.metrics.exportReport(),n=this.analyzer.analyzeReport(r),o={...S,...t.criteria};return{success:this.evaluateSuccess(r,o),report:r,bottlenecks:n,config:this.config,duration:Date.now()-e}}catch(r){return this.metrics.stop(),{success:!1,report:this.metrics.exportReport(),bottlenecks:this.analyzer.analyze(this.metrics),config:this.config,duration:Date.now()-e,error:v(r)}}finally{await this.cleanup(),this.running=!1}}async rampUp(t,e){let r=this.mockAgents.size,n=t-r;if(n<=0)return;let o=e/n,a=this.getWorkload();for(let i=0;i<n&&!this.stopRequested;i++)await this.spawnMockAgent(a),await this.delay(o)}async simulateAgent(t,e){let r=Date.now(),n=0,o=0;for(let a=0;a<e.taskCount&&!this.stopRequested;a++){let i=`${t}_task_${a}`,c=Date.now();this.metrics.recordTaskStart(t,i,c);let y=e.durationVariance??.2,p=e.taskDuration*(1+(this.random()-.5)*2*y);await this.delay(p),this.metrics.recordTaskComplete(t,i,Date.now()-c),n++;let w=this.simulateCoordinationLatency();this.metrics.recordCoordination(t,w),o++}return{agentId:t,tasksCompleted:n,totalDuration:Date.now()-r,coordinationEvents:o}}async stop(){this.stopRequested=!0,await this.delay(100),await this.cleanup()}getMetrics(){return this.metrics}getAgentCount(){return this.mockAgents.size}isRunning(){return this.running}async executeStep(t,e){let r=t.agents,n=this.mockAgents.size;r>n?await this.spawnAgents(r-n,e):r<n&&await this.terminateAgents(n-r),t.churnRate&&t.churnRate>0&&this.startChurn(t.churnRate,r,e),await this.hold(t.holdTime),this.stopChurn()}async spawnAgents(t,e){let r=[];for(let n=0;n<t&&!this.stopRequested;n++)r.push(this.spawnMockAgent(e)),r.length>=10&&(await Promise.all(r),r.length=0,await this.delay(10));r.length>0&&await Promise.all(r)}async terminateAgents(t){let e=Array.from(this.mockAgents.keys()).slice(0,t);for(let r of e)await this.terminateMockAgent(r)}async hold(t){let r=0;for(;r<t&&!this.stopRequested;)await this.delay(100),r+=100}startChurn(t,e,r){let o=6e4/Math.ceil(e*t);this.churnTimer=setInterval(async()=>{if(this.random()<.5){let a=Array.from(this.mockAgents.keys());if(a.length>0){let i=a[Math.floor(this.random()*a.length)];await this.terminateMockAgent(i)}}this.mockAgents.size<e&&await this.spawnMockAgent(r)},o)}stopChurn(){this.churnTimer&&(clearInterval(this.churnTimer),this.churnTimer=null)}async spawnMockAgent(t){let e=`agent_${C().slice(0,8)}`,r=Date.now(),n={id:e,domain:this.getRandomDomain(),spawnedAt:r,workload:t,activeTasks:0,totalTasks:0,terminated:!1};this.mockAgents.set(e,n),this.metrics.recordAgentSpawn(e,r),this.startAgentTasks(n),this.startAgentCoordination(n),this.simulateMemoryUsage()}async terminateMockAgent(t){let e=this.mockAgents.get(t);if(!e)return;e.terminated=!0;let r=this.mockTaskTimers.get(t);r&&(clearInterval(r),this.mockTaskTimers.delete(t));let n=this.mockCoordinationTimers.get(t);n&&(clearInterval(n),this.mockCoordinationTimers.delete(t)),this.mockAgents.delete(t),this.metrics.recordAgentTerminate(t,Date.now())}startAgentTasks(t){let e=t.workload.taskDuration*1.5,r=setInterval(()=>{if(t.terminated||t.totalTasks>=t.workload.taskCount){clearInterval(r),this.mockTaskTimers.delete(t.id);return}let n=`${t.id}_task_${t.totalTasks}`,o=Date.now();t.activeTasks++,t.totalTasks++,this.metrics.recordTaskStart(t.id,n,o);let a=t.workload.durationVariance??.2,i=t.workload.taskDuration*(1+(this.random()-.5)*2*a);setTimeout(()=>{t.terminated||(t.activeTasks--,this.metrics.recordTaskComplete(t.id,n,Date.now()-o))},i)},e);this.mockTaskTimers.set(t.id,r)}startAgentCoordination(t){let e=1e3/t.workload.coordinationFrequency,r=setInterval(()=>{if(t.terminated){clearInterval(r),this.mockCoordinationTimers.delete(t.id);return}let n=this.simulateCoordinationLatency();this.metrics.recordCoordination(t.id,n)},e);this.mockCoordinationTimers.set(t.id,r)}simulateCoordinationLatency(){let e=this.random()*30,r=this.random()<.05?this.random()*100:0,o=Math.min(this.mockAgents.size/100,2)*10;return 5+e+r+o}simulateMemoryUsage(){let t=this.mockAgents.size,e=this.getWorkload().memoryUsage,r=50*1024*1024,n=t*e,o=t*1024*100,a=r+n+o,i=a*1.5;this.metrics.recordMemoryUsage(a,i)}getRandomDomain(){let t=["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence","security-compliance"];return t[Math.floor(this.random()*t.length)]}getWorkload(){return this.config.customWorkload?this.config.customWorkload:g[this.config.workloadProfile]}evaluateSuccess(t,e){let{summary:r,performance:n}=t;return!(r.peakAgents<e.agentCount||t.resources.memoryPeak>=e.memoryLimit||n.coordinationLatency.p95>e.coordinationLatency||e.noAgentStarvation&&!r.successCriteria.noStarvation||e.noDeadlocks&&!r.successCriteria.noDeadlocks)}async cleanup(){this.stopChurn();let t=Array.from(this.mockAgents.keys());for(let e of t)await this.terminateMockAgent(e);this.mockTaskTimers.forEach(e=>{clearInterval(e)}),this.mockTaskTimers.clear(),this.mockCoordinationTimers.forEach(e=>{clearInterval(e)}),this.mockCoordinationTimers.clear()}delay(t){return new Promise(e=>setTimeout(e,t))}seededRandom(t){return function(){let e=t+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}};function B(s,t,e){return new m(s,t,e)}function _(s,t="medium"){return new m({maxAgents:s,workloadProfile:t,mockMode:!0})}export{m as AgentLoadTester,l as BottleneckAnalyzer,b as DEFAULT_ANALYZER_CONFIG,A as DEFAULT_LOAD_TEST_CONFIG,S as DEFAULT_SUCCESS_CRITERIA,h as DEFAULT_THRESHOLDS,u as MetricsCollector,R as SCENARIO_BURST_100,x as SCENARIO_CHURN_100,M as SCENARIO_RAMP_UP_100,D as SCENARIO_STRESS_150,g as WORKLOAD_PROFILES,B as createAgentLoadTester,T as createBottleneckAnalyzer,f as createBottleneckAnalyzerWithThresholds,_ as createLoadTesterForTarget,k as createMetricsCollector};
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
|
|
2
|
+
import"./chunk-FWGOHAAB.js";import"./chunk-U5K45TFH.js";import{a as d}from"./chunk-6VRA2QGL.js";import"./chunk-ZJ26AQA5.js";import{a as v,c as P}from"./chunk-G6T45OIC.js";import{i as C}from"./chunk-SRKETSFF.js";import"./chunk-KCZR45PA.js";import"./chunk-ODKLFVYC.js";import"./chunk-TT23RRB7.js";var L={maxEvents:1e5,memorySampleInterval:1e3,enableTimeline:!0,timelineSampleInterval:1e3},u=class{config;activeAgents=new Map;peakAgentCount=0;totalAgentsSpawned=0;activeTasks=new Map;totalTasksStarted=0;totalTasksCompleted=0;coordinationLatencies;taskDurations;memorySnapshots;peakMemoryUsed=0;memorySum=0;memorySamples=0;agentTimeline=[];latencyTimeline=[];memoryTimeline=[];startTime=0;endTime=0;running=!1;memorySamplerTimer=null;timelineSamplerTimer=null;issues=[];constructor(t={}){this.config={...L,...t},this.coordinationLatencies=new d(this.config.maxEvents),this.taskDurations=new d(this.config.maxEvents),this.memorySnapshots=new d(1e4)}start(){this.running||(this.running=!0,this.startTime=Date.now(),this.memorySamplerTimer=setInterval(()=>{this.sampleMemory()},this.config.memorySampleInterval),this.config.enableTimeline&&(this.timelineSamplerTimer=setInterval(()=>{this.sampleTimeline()},this.config.timelineSampleInterval)))}stop(){this.running&&(this.running=!1,this.endTime=Date.now(),this.memorySamplerTimer&&(clearInterval(this.memorySamplerTimer),this.memorySamplerTimer=null),this.timelineSamplerTimer&&(clearInterval(this.timelineSamplerTimer),this.timelineSamplerTimer=null))}reset(){this.stop(),this.activeAgents.clear(),this.peakAgentCount=0,this.totalAgentsSpawned=0,this.activeTasks.clear(),this.totalTasksStarted=0,this.totalTasksCompleted=0,this.coordinationLatencies.clear(),this.taskDurations.clear(),this.memorySnapshots.clear(),this.peakMemoryUsed=0,this.memorySum=0,this.memorySamples=0,this.agentTimeline.length=0,this.latencyTimeline.length=0,this.memoryTimeline.length=0,this.startTime=0,this.endTime=0,this.issues.length=0}recordAgentSpawn(t,e=Date.now()){this.activeAgents.set(t,e),this.totalAgentsSpawned++;let r=this.activeAgents.size;r>this.peakAgentCount&&(this.peakAgentCount=r)}recordAgentTerminate(t,e=Date.now()){this.activeAgents.delete(t)}recordTaskStart(t,e,r=Date.now()){this.activeTasks.set(e,{agentId:t,startTime:r}),this.totalTasksStarted++}recordTaskComplete(t,e,r,n=Date.now()){let o=this.activeTasks.get(e);o&&o.agentId===t&&(this.activeTasks.delete(e),this.taskDurations.push(r),this.totalTasksCompleted++)}recordCoordination(t,e,r=Date.now()){this.coordinationLatencies.push(e),e>100&&this.issues.push(`High coordination latency for agent ${t}: ${e}ms`)}recordMemoryUsage(t,e){let r={timestamp:Date.now(),heapUsed:t,heapTotal:e,external:0,rss:0};this.memorySnapshots.push(r),this.memorySum+=t,this.memorySamples++,t>this.peakMemoryUsed&&(this.peakMemoryUsed=t);let n=4*1024*1024*1024;t>n&&this.issues.push(`Memory exceeded 4GB limit: ${(t/1024/1024/1024).toFixed(2)}GB`)}recordIssue(t){this.issues.push(t)}getAgentCount(){return this.activeAgents.size}getPeakAgentCount(){return this.peakAgentCount}getTotalAgentsSpawned(){return this.totalAgentsSpawned}getP95CoordinationLatency(){return this.calculatePercentile(this.coordinationLatencies.toArray(),.95)}getP99CoordinationLatency(){return this.calculatePercentile(this.coordinationLatencies.toArray(),.99)}getCoordinationLatencyPercentiles(){return this.calculatePercentiles(this.coordinationLatencies.toArray())}getTaskLatencyPercentiles(){return this.calculatePercentiles(this.taskDurations.toArray())}getMaxMemoryUsage(){return this.peakMemoryUsed}getAverageMemoryUsage(){return this.memorySamples>0?this.memorySum/this.memorySamples:0}getThroughput(){let e=this.getDuration()/1e3;return{tasks:this.totalTasksCompleted,tasksPerSecond:e>0?this.totalTasksCompleted/e:0,agents:this.totalAgentsSpawned,agentsPerSecond:e>0?this.totalAgentsSpawned/e:0}}getDuration(){return this.startTime===0?0:(this.endTime>0?this.endTime:Date.now())-this.startTime}hasAgentStarvation(){let t=this.activeAgents.size,e=this.activeTasks.size;return t>0&&e===0&&this.totalTasksCompleted>0}hasDeadlocks(){let t=Date.now(),e=6e4,r=Array.from(this.activeTasks.values());for(let n of r)if(t-n.startTime>e)return!0;return!1}exportReport(){let t=this.getDuration(),e=this.getCoordinationLatencyPercentiles(),r=this.getTaskLatencyPercentiles(),n=this.getThroughput(),o=100,a=4*1024*1024*1024,c={agentCount:this.peakAgentCount>=o,memoryLimit:this.peakMemoryUsed<a,coordinationLatency:e.p95<=100,noDeadlocks:!this.hasDeadlocks(),noStarvation:!this.hasAgentStarvation()},y=Object.values(c).every(Boolean),p=this.generateRecommendations(e,this.peakMemoryUsed,n);return{summary:{totalAgents:this.totalAgentsSpawned,peakAgents:this.peakAgentCount,totalTasks:this.totalTasksCompleted,duration:t,success:y,successCriteria:c},performance:{coordinationLatency:e,taskLatency:r,throughput:n},resources:{memoryPeak:this.peakMemoryUsed,memoryAverage:this.getAverageMemoryUsage(),cpuPeak:0,cpuAverage:0},timeline:{agentCounts:[...this.agentTimeline],latencies:[...this.latencyTimeline],memoryUsage:[...this.memoryTimeline]},issues:[...this.issues],recommendations:p}}sampleMemory(){let t=process.memoryUsage();this.recordMemoryUsage(t.heapUsed,t.heapTotal)}sampleTimeline(){let t=Date.now();this.agentTimeline.push({timestamp:t,count:this.activeAgents.size});let e=this.coordinationLatencies.toArray();e.length>0&&this.latencyTimeline.push({timestamp:t,p95:this.calculatePercentile(e,.95)});let r=process.memoryUsage();this.memoryTimeline.push({timestamp:t,heapUsed:r.heapUsed});let n=1e3;this.agentTimeline.length>n&&this.agentTimeline.shift(),this.latencyTimeline.length>n&&this.latencyTimeline.shift(),this.memoryTimeline.length>n&&this.memoryTimeline.shift()}calculatePercentile(t,e){if(t.length===0)return 0;let r=[...t].sort((o,a)=>o-a),n=Math.ceil(r.length*e)-1;return r[Math.max(0,n)]}calculatePercentiles(t){if(t.length===0)return{p50:0,p95:0,p99:0,max:0,min:0,avg:0,count:0};let e=[...t].sort((n,o)=>n-o),r=e.reduce((n,o)=>n+o,0);return{p50:this.calculatePercentile(e,.5),p95:this.calculatePercentile(e,.95),p99:this.calculatePercentile(e,.99),max:e[e.length-1],min:e[0],avg:r/e.length,count:e.length}}generateRecommendations(t,e,r){let n=[];t.p95>100&&n.push(`P95 coordination latency (${t.p95.toFixed(1)}ms) exceeds 100ms target. Consider optimizing gossip protocol or reducing agent count.`),t.p99>t.p95*2&&n.push("High P99/P95 ratio indicates latency outliers. Investigate specific agents or network conditions.");let o=e/1024/1024/1024;return o>3&&n.push(`Memory usage (${o.toFixed(2)}GB) approaching 4GB limit. Consider implementing agent pooling or reducing per-agent memory.`),r.tasksPerSecond<10&&n.push(`Task throughput (${r.tasksPerSecond.toFixed(1)}/s) is low. Consider parallelizing task execution or reducing task complexity.`),this.issues.length>10&&n.push(`${this.issues.length} issues recorded. Review issue log for patterns and prioritize fixes.`),n}};function k(s){return new u(s)}P();var h={memoryWarning:3*1024*1024*1024,memoryCritical:4*1024*1024*1024,latencyP95Warning:75,latencyP95Critical:100,latencyP99Warning:150,latencyP99Critical:200,agentStarvationTime:3e4,deadlockTimeout:6e4,minTasksPerSecond:5,minAgentUtilization:.5,gossipConvergenceTime:5e3,gossipMaxPartitions:0},b={thresholds:h,enableDetailedAnalysis:!0},l=class{config;constructor(t={}){this.config={...b,...t,thresholds:{...h,...t.thresholds}}}analyze(t){let e=[];e.push(this.checkMemoryPressure(t)),e.push(this.checkCoordinationLatencyP95(t)),e.push(this.checkCoordinationLatencyP99(t)),e.push(this.checkAgentStarvation(t)),e.push(this.checkDeadlocks(t)),e.push(this.checkThroughput(t));let r=e.filter(i=>i.detected),n={totalChecks:e.length,detected:r.length,critical:r.filter(i=>i.severity==="critical").length,high:r.filter(i=>i.severity==="high").length,medium:r.filter(i=>i.severity==="medium").length,low:r.filter(i=>i.severity==="low").length},o="low";n.critical>0?o="critical":n.high>0?o="high":n.medium>0&&(o="medium");let a=this.generatePrioritizedRecommendations(r);return{overallSeverity:o,hasCritical:n.critical>0,bottlenecks:e,summary:n,recommendations:a,timestamp:new Date}}analyzeReport(t){let e=[];e.push(this.checkMemoryFromReport(t)),e.push(this.checkLatencyP95FromReport(t)),e.push(this.checkLatencyP99FromReport(t)),e.push(this.checkThroughputFromReport(t)),e.push(this.checkSuccessCriteria(t));let r=e.filter(i=>i.detected),n={totalChecks:e.length,detected:r.length,critical:r.filter(i=>i.severity==="critical").length,high:r.filter(i=>i.severity==="high").length,medium:r.filter(i=>i.severity==="medium").length,low:r.filter(i=>i.severity==="low").length},o="low";n.critical>0?o="critical":n.high>0?o="high":n.medium>0&&(o="medium");let a=this.generatePrioritizedRecommendations(r);return{overallSeverity:o,hasCritical:n.critical>0,bottlenecks:e,summary:n,recommendations:a,timestamp:new Date}}checkMemoryPressure(t){let e=t?.getMaxMemoryUsage()??process.memoryUsage().heapUsed,{memoryWarning:r,memoryCritical:n}=this.config.thresholds,o=e>=r,a="low",i="Memory usage is within acceptable limits.";return e>=n?(a="critical",i="Memory usage exceeds 4GB limit. Implement agent pooling, reduce per-agent state, or decrease concurrent agent count."):e>=r&&(a="high",i="Memory usage approaching critical threshold. Consider optimizing agent memory footprint or implementing memory pressure relief mechanisms."),{detected:o,severity:a,metric:"memory_pressure",threshold:n,actual:e,recommendation:i,context:{usedGB:e/1024/1024/1024,warningThresholdGB:r/1024/1024/1024,criticalThresholdGB:n/1024/1024/1024}}}checkCoordinationLatency(){return this.checkCoordinationLatencyP95()}checkCoordinationLatencyP95(t){let e=t?.getP95CoordinationLatency()??0,{latencyP95Warning:r,latencyP95Critical:n}=this.config.thresholds,o=e>=r,a="low",i="P95 coordination latency is within acceptable limits.";return e>=n?(a="critical",i="P95 coordination latency exceeds 100ms target. Optimize gossip protocol, reduce message size, or implement batching."):e>=r&&(a="medium",i="P95 coordination latency approaching target. Monitor closely and consider proactive optimization."),{detected:o,severity:a,metric:"coordination_latency_p95",threshold:n,actual:e,recommendation:i}}checkCoordinationLatencyP99(t){let e=t?.getP99CoordinationLatency()??0,{latencyP99Warning:r,latencyP99Critical:n}=this.config.thresholds,o=e>=r,a="low",i="P99 coordination latency is within acceptable limits.";return e>=n?(a="high",i="P99 coordination latency indicates outliers. Investigate specific agents or network conditions causing delays."):e>=r&&(a="medium",i="P99 coordination latency elevated. Some agents may be experiencing delays."),{detected:o,severity:a,metric:"coordination_latency_p99",threshold:n,actual:e,recommendation:i}}checkAgentStarvation(t){let e=t?.hasAgentStarvation()??!1;return{detected:e,severity:e?"high":"low",metric:"agent_starvation",threshold:this.config.thresholds.agentStarvationTime,actual:e?1:0,recommendation:e?"Agent starvation detected. Agents are idle without tasks. Review task distribution algorithm and work stealing configuration.":"No agent starvation detected."}}checkDeadlocks(t){let e=t?.hasDeadlocks()??!1;return{detected:e,severity:e?"critical":"low",metric:"deadlock_detection",threshold:this.config.thresholds.deadlockTimeout,actual:e?1:0,recommendation:e?"Potential deadlock detected. Tasks running for extended period. Review lock ordering and add timeout mechanisms.":"No deadlocks detected."}}checkGossipStability(){return{detected:!1,severity:"low",metric:"gossip_stability",threshold:this.config.thresholds.gossipMaxPartitions,actual:0,recommendation:"Gossip protocol stability check requires integration with gossip metrics."}}checkThroughput(t){let r=t?.getThroughput()?.tasksPerSecond??0,n=this.config.thresholds.minTasksPerSecond,o=r<n&&r>0;return{detected:o,severity:o?"medium":"low",metric:"throughput",threshold:n,actual:r,recommendation:o?`Task throughput (${r.toFixed(1)}/s) below minimum (${n}/s). Consider parallelizing task execution or optimizing task handlers.`:"Task throughput is acceptable."}}checkMemoryFromReport(t){let e=t.resources.memoryPeak,{memoryCritical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"critical":"low",metric:"memory_pressure",threshold:r,actual:e,recommendation:e>=r?"Memory exceeded 4GB limit during test.":"Memory usage within limits."}}checkLatencyP95FromReport(t){let e=t.performance.coordinationLatency.p95,{latencyP95Critical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"critical":"low",metric:"coordination_latency_p95",threshold:r,actual:e,recommendation:e>=r?"P95 coordination latency exceeded 100ms target.":"P95 latency within target."}}checkLatencyP99FromReport(t){let e=t.performance.coordinationLatency.p99,{latencyP99Critical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"high":"low",metric:"coordination_latency_p99",threshold:r,actual:e,recommendation:e>=r?"P99 coordination latency indicates significant outliers.":"P99 latency acceptable."}}checkThroughputFromReport(t){let e=t.performance.throughput.tasksPerSecond,r=this.config.thresholds.minTasksPerSecond;return{detected:e<r&&e>0,severity:e<r?"medium":"low",metric:"throughput",threshold:r,actual:e,recommendation:e<r?"Throughput below minimum target.":"Throughput acceptable."}}checkSuccessCriteria(t){let e=t.summary.successCriteria,r=Object.entries(e).filter(([n,o])=>!o).map(([n])=>n);return{detected:r.length>0,severity:r.length>0?"high":"low",metric:"success_criteria",threshold:0,actual:r.length,recommendation:r.length>0?`Failed criteria: ${r.join(", ")}`:"All success criteria met.",context:{failedCriteria:r}}}generatePrioritizedRecommendations(t){let e={critical:0,high:1,medium:2,low:3},r=[...t].sort((a,i)=>e[a.severity]-e[i.severity]),n=new Set,o=[];for(let a of r)n.has(a.recommendation)||(n.add(a.recommendation),o.push(`[${a.severity.toUpperCase()}] ${a.metric}: ${a.recommendation}`));return o}};function T(s){return new l(s)}function f(s){return new l({thresholds:{...h,...s}})}var A={maxAgents:100,memoryLimit:4*1024*1024*1024,coordinationTimeout:100,workloadProfile:"medium",mockMode:!0},S={agentCount:100,memoryLimit:4*1024*1024*1024,coordinationLatency:100,noAgentStarvation:!0,noDeadlocks:!0,gossipStable:!0},g={light:{taskCount:5,taskDuration:50,memoryUsage:5*1024*1024,coordinationFrequency:2,durationVariance:.1},medium:{taskCount:10,taskDuration:100,memoryUsage:10*1024*1024,coordinationFrequency:5,durationVariance:.2},heavy:{taskCount:20,taskDuration:200,memoryUsage:20*1024*1024,coordinationFrequency:10,durationVariance:.3}},M={name:"ramp-up-100",description:"Gradually add agents until reaching 100",steps:[{agents:25,holdTime:3e4},{agents:50,holdTime:3e4},{agents:75,holdTime:3e4},{agents:100,holdTime:6e4}],workload:g.medium},R={name:"burst-100",description:"Instantly spawn 100 agents",steps:[{agents:100,holdTime:12e4}],workload:{taskCount:20,taskDuration:50,memoryUsage:10*1024*1024,coordinationFrequency:5}},x={name:"churn-100",description:"Maintain 100 agents with continuous spawn/terminate",steps:[{agents:100,holdTime:18e4,churnRate:.1}],workload:{taskCount:15,taskDuration:75,memoryUsage:10*1024*1024,coordinationFrequency:5}},D={name:"stress-150",description:"Push beyond 100 agents to find limits",steps:[{agents:100,holdTime:3e4},{agents:125,holdTime:3e4},{agents:150,holdTime:6e4}],workload:g.heavy,criteria:{agentCount:150}},m=class{config;metrics;analyzer;running=!1;stopRequested=!1;mockAgents=new Map;mockTaskTimers=new Map;mockCoordinationTimers=new Map;churnTimer=null;random;constructor(t={},e,r){this.config={...A,...t},this.metrics=k(e),this.analyzer=r?f(r):T(),this.random=this.config.seed!==void 0?this.seededRandom(this.config.seed):Math.random.bind(Math)}async runTest(t,e){let r={name:"custom",description:`Custom test with ${t} agents for ${e}ms`,steps:[{agents:t,holdTime:e}],workload:this.getWorkload()};return this.runScenario(r)}async runScenario(t){if(this.running)throw new Error("Load test already running");this.running=!0,this.stopRequested=!1;let e=Date.now();try{this.metrics.reset(),this.metrics.start();for(let i of t.steps){if(this.stopRequested)break;await this.executeStep(i,t.workload)}this.metrics.stop();let r=this.metrics.exportReport(),n=this.analyzer.analyzeReport(r),o={...S,...t.criteria};return{success:this.evaluateSuccess(r,o),report:r,bottlenecks:n,config:this.config,duration:Date.now()-e}}catch(r){return this.metrics.stop(),{success:!1,report:this.metrics.exportReport(),bottlenecks:this.analyzer.analyze(this.metrics),config:this.config,duration:Date.now()-e,error:v(r)}}finally{await this.cleanup(),this.running=!1}}async rampUp(t,e){let r=this.mockAgents.size,n=t-r;if(n<=0)return;let o=e/n,a=this.getWorkload();for(let i=0;i<n&&!this.stopRequested;i++)await this.spawnMockAgent(a),await this.delay(o)}async simulateAgent(t,e){let r=Date.now(),n=0,o=0;for(let a=0;a<e.taskCount&&!this.stopRequested;a++){let i=`${t}_task_${a}`,c=Date.now();this.metrics.recordTaskStart(t,i,c);let y=e.durationVariance??.2,p=e.taskDuration*(1+(this.random()-.5)*2*y);await this.delay(p),this.metrics.recordTaskComplete(t,i,Date.now()-c),n++;let w=this.simulateCoordinationLatency();this.metrics.recordCoordination(t,w),o++}return{agentId:t,tasksCompleted:n,totalDuration:Date.now()-r,coordinationEvents:o}}async stop(){this.stopRequested=!0,await this.delay(100),await this.cleanup()}getMetrics(){return this.metrics}getAgentCount(){return this.mockAgents.size}isRunning(){return this.running}async executeStep(t,e){let r=t.agents,n=this.mockAgents.size;r>n?await this.spawnAgents(r-n,e):r<n&&await this.terminateAgents(n-r),t.churnRate&&t.churnRate>0&&this.startChurn(t.churnRate,r,e),await this.hold(t.holdTime),this.stopChurn()}async spawnAgents(t,e){let r=[];for(let n=0;n<t&&!this.stopRequested;n++)r.push(this.spawnMockAgent(e)),r.length>=10&&(await Promise.all(r),r.length=0,await this.delay(10));r.length>0&&await Promise.all(r)}async terminateAgents(t){let e=Array.from(this.mockAgents.keys()).slice(0,t);for(let r of e)await this.terminateMockAgent(r)}async hold(t){let r=0;for(;r<t&&!this.stopRequested;)await this.delay(100),r+=100}startChurn(t,e,r){let o=6e4/Math.ceil(e*t);this.churnTimer=setInterval(async()=>{if(this.random()<.5){let a=Array.from(this.mockAgents.keys());if(a.length>0){let i=a[Math.floor(this.random()*a.length)];await this.terminateMockAgent(i)}}this.mockAgents.size<e&&await this.spawnMockAgent(r)},o)}stopChurn(){this.churnTimer&&(clearInterval(this.churnTimer),this.churnTimer=null)}async spawnMockAgent(t){let e=`agent_${C().slice(0,8)}`,r=Date.now(),n={id:e,domain:this.getRandomDomain(),spawnedAt:r,workload:t,activeTasks:0,totalTasks:0,terminated:!1};this.mockAgents.set(e,n),this.metrics.recordAgentSpawn(e,r),this.startAgentTasks(n),this.startAgentCoordination(n),this.simulateMemoryUsage()}async terminateMockAgent(t){let e=this.mockAgents.get(t);if(!e)return;e.terminated=!0;let r=this.mockTaskTimers.get(t);r&&(clearInterval(r),this.mockTaskTimers.delete(t));let n=this.mockCoordinationTimers.get(t);n&&(clearInterval(n),this.mockCoordinationTimers.delete(t)),this.mockAgents.delete(t),this.metrics.recordAgentTerminate(t,Date.now())}startAgentTasks(t){let e=t.workload.taskDuration*1.5,r=setInterval(()=>{if(t.terminated||t.totalTasks>=t.workload.taskCount){clearInterval(r),this.mockTaskTimers.delete(t.id);return}let n=`${t.id}_task_${t.totalTasks}`,o=Date.now();t.activeTasks++,t.totalTasks++,this.metrics.recordTaskStart(t.id,n,o);let a=t.workload.durationVariance??.2,i=t.workload.taskDuration*(1+(this.random()-.5)*2*a);setTimeout(()=>{t.terminated||(t.activeTasks--,this.metrics.recordTaskComplete(t.id,n,Date.now()-o))},i)},e);this.mockTaskTimers.set(t.id,r)}startAgentCoordination(t){let e=1e3/t.workload.coordinationFrequency,r=setInterval(()=>{if(t.terminated){clearInterval(r),this.mockCoordinationTimers.delete(t.id);return}let n=this.simulateCoordinationLatency();this.metrics.recordCoordination(t.id,n)},e);this.mockCoordinationTimers.set(t.id,r)}simulateCoordinationLatency(){let e=this.random()*30,r=this.random()<.05?this.random()*100:0,o=Math.min(this.mockAgents.size/100,2)*10;return 5+e+r+o}simulateMemoryUsage(){let t=this.mockAgents.size,e=this.getWorkload().memoryUsage,r=50*1024*1024,n=t*e,o=t*1024*100,a=r+n+o,i=a*1.5;this.metrics.recordMemoryUsage(a,i)}getRandomDomain(){let t=["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence","security-compliance"];return t[Math.floor(this.random()*t.length)]}getWorkload(){return this.config.customWorkload?this.config.customWorkload:g[this.config.workloadProfile]}evaluateSuccess(t,e){let{summary:r,performance:n}=t;return!(r.peakAgents<e.agentCount||t.resources.memoryPeak>=e.memoryLimit||n.coordinationLatency.p95>e.coordinationLatency||e.noAgentStarvation&&!r.successCriteria.noStarvation||e.noDeadlocks&&!r.successCriteria.noDeadlocks)}async cleanup(){this.stopChurn();let t=Array.from(this.mockAgents.keys());for(let e of t)await this.terminateMockAgent(e);this.mockTaskTimers.forEach(e=>{clearInterval(e)}),this.mockTaskTimers.clear(),this.mockCoordinationTimers.forEach(e=>{clearInterval(e)}),this.mockCoordinationTimers.clear()}delay(t){return new Promise(e=>setTimeout(e,t))}seededRandom(t){return function(){let e=t+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}};function B(s,t,e){return new m(s,t,e)}function _(s,t="medium"){return new m({maxAgents:s,workloadProfile:t,mockMode:!0})}export{m as AgentLoadTester,l as BottleneckAnalyzer,b as DEFAULT_ANALYZER_CONFIG,A as DEFAULT_LOAD_TEST_CONFIG,S as DEFAULT_SUCCESS_CRITERIA,h as DEFAULT_THRESHOLDS,u as MetricsCollector,R as SCENARIO_BURST_100,x as SCENARIO_CHURN_100,M as SCENARIO_RAMP_UP_100,D as SCENARIO_STRESS_150,g as WORKLOAD_PROFILES,B as createAgentLoadTester,T as createBottleneckAnalyzer,f as createBottleneckAnalyzerWithThresholds,_ as createLoadTesterForTarget,k as createMetricsCollector};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-6QYNWR7U.js";import"./chunk-W7BWUTVV.js";import"./chunk-6TPKK7LD.js";import"./chunk-55RWDRJD.js";import"./chunk-R4VL6E65.js";import"./chunk-RJCYCLZV.js";import"./chunk-NA7B2QYB.js";import"./chunk-Y3MW3YBC.js";import"./chunk-PEPFCPES.js";import"./chunk-DHJPWQBR.js";import"./chunk-G6T45OIC.js";import"./chunk-SRKETSFF.js";import"./chunk-AIHDEEJO.js";import"./chunk-BGE6FOLM.js";import"./chunk-5YPYDPBJ.js";import"./chunk-HDSAM2RE.js";import"./chunk-KCZR45PA.js";import"./chunk-BFP7KO7P.js";import"./chunk-ODKLFVYC.js";import"./chunk-VD6QRULW.js";import"./chunk-KHFNNVJA.js";import"./chunk-CNG6GQEZ.js";import"./chunk-TT23RRB7.js";export{a as LoadTestTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
|
|
2
|
+
import{a as c}from"./chunk-PAWXJ73E.js";import"./chunk-TT23RRB7.js";import{Command as i}from"commander";import{join as e,dirname as p}from"path";import{existsSync as a}from"fs";import{fileURLToPath as m,pathToFileURL as d}from"url";function l(){return new i("mcp").description("Start the MCP protocol server for Claude Code integration").option("--http <port>","Also start HTTP server for AG-UI/A2A protocols","0").option("--verbose","Enable verbose logging").action(async r=>{process.env.AQE_HTTP_PORT=r.http||"0",r.verbose&&(process.env.AQE_VERBOSE="true");let n=u();n||(console.error("Error: Could not find MCP server entry point"),console.error("Make sure agentic-qe is properly installed"),process.exit(1));try{await import(d(n).href)}catch(o){console.error("Failed to start MCP server:",o.message),process.exit(1)}await new Promise(()=>{})})}function u(){let t=[],r=c(import.meta.url);r&&t.push(e(r,"dist","mcp","bundle.js"),e(r,"dist","mcp","entry.js"),e(r,"src","mcp","entry.ts"));let n=m(import.meta.url),o=p(n);t.push(e(o,"..","mcp","bundle.js"),e(o,"..","mcp","entry.js"),e(o,"..","mcp","entry.ts"),e(o,"..","..","mcp","bundle.js")),t.push(e(process.cwd(),"node_modules","agentic-qe","dist","mcp","bundle.js"),e(process.cwd(),"node_modules","agentic-qe","dist","mcp","entry.js"));for(let s of t)if(a(s))return s;return null}var P=l;export{l as createMcpCommand,P as default};
|