@agentic-qe/v3 3.0.0-alpha.3
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/README.md +429 -0
- package/dist/benchmarks/performance-benchmarks.d.ts +92 -0
- package/dist/benchmarks/performance-benchmarks.d.ts.map +1 -0
- package/dist/benchmarks/performance-benchmarks.js +477 -0
- package/dist/benchmarks/performance-benchmarks.js.map +1 -0
- package/dist/benchmarks/run-benchmarks.d.ts +12 -0
- package/dist/benchmarks/run-benchmarks.d.ts.map +1 -0
- package/dist/benchmarks/run-benchmarks.js +260 -0
- package/dist/benchmarks/run-benchmarks.js.map +1 -0
- package/dist/causal-discovery/causal-graph.d.ts +104 -0
- package/dist/causal-discovery/causal-graph.d.ts.map +1 -0
- package/dist/causal-discovery/causal-graph.js +384 -0
- package/dist/causal-discovery/causal-graph.js.map +1 -0
- package/dist/causal-discovery/discovery-engine.d.ts +120 -0
- package/dist/causal-discovery/discovery-engine.d.ts.map +1 -0
- package/dist/causal-discovery/discovery-engine.js +332 -0
- package/dist/causal-discovery/discovery-engine.js.map +1 -0
- package/dist/causal-discovery/index.d.ts +50 -0
- package/dist/causal-discovery/index.d.ts.map +1 -0
- package/dist/causal-discovery/index.js +69 -0
- package/dist/causal-discovery/index.js.map +1 -0
- package/dist/causal-discovery/types.d.ts +257 -0
- package/dist/causal-discovery/types.d.ts.map +1 -0
- package/dist/causal-discovery/types.js +72 -0
- package/dist/causal-discovery/types.js.map +1 -0
- package/dist/causal-discovery/weight-matrix.d.ts +130 -0
- package/dist/causal-discovery/weight-matrix.d.ts.map +1 -0
- package/dist/causal-discovery/weight-matrix.js +380 -0
- package/dist/causal-discovery/weight-matrix.js.map +1 -0
- package/dist/cli/commands/qe-tools.d.ts +27 -0
- package/dist/cli/commands/qe-tools.d.ts.map +1 -0
- package/dist/cli/commands/qe-tools.js +524 -0
- package/dist/cli/commands/qe-tools.js.map +1 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +1725 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/compatibility/agent-mapper.d.ts +45 -0
- package/dist/compatibility/agent-mapper.d.ts.map +1 -0
- package/dist/compatibility/agent-mapper.js +256 -0
- package/dist/compatibility/agent-mapper.js.map +1 -0
- package/dist/compatibility/cli-adapter.d.ts +53 -0
- package/dist/compatibility/cli-adapter.d.ts.map +1 -0
- package/dist/compatibility/cli-adapter.js +247 -0
- package/dist/compatibility/cli-adapter.js.map +1 -0
- package/dist/compatibility/config-migrator.d.ts +42 -0
- package/dist/compatibility/config-migrator.d.ts.map +1 -0
- package/dist/compatibility/config-migrator.js +280 -0
- package/dist/compatibility/config-migrator.js.map +1 -0
- package/dist/compatibility/index.d.ts +58 -0
- package/dist/compatibility/index.d.ts.map +1 -0
- package/dist/compatibility/index.js +90 -0
- package/dist/compatibility/index.js.map +1 -0
- package/dist/compatibility/mcp-adapter.d.ts +38 -0
- package/dist/compatibility/mcp-adapter.d.ts.map +1 -0
- package/dist/compatibility/mcp-adapter.js +202 -0
- package/dist/compatibility/mcp-adapter.js.map +1 -0
- package/dist/compatibility/types.d.ts +161 -0
- package/dist/compatibility/types.d.ts.map +1 -0
- package/dist/compatibility/types.js +5 -0
- package/dist/compatibility/types.js.map +1 -0
- package/dist/coordination/claims/claim-repository.d.ts +64 -0
- package/dist/coordination/claims/claim-repository.d.ts.map +1 -0
- package/dist/coordination/claims/claim-repository.js +524 -0
- package/dist/coordination/claims/claim-repository.js.map +1 -0
- package/dist/coordination/claims/claim-service.d.ts +45 -0
- package/dist/coordination/claims/claim-service.d.ts.map +1 -0
- package/dist/coordination/claims/claim-service.js +523 -0
- package/dist/coordination/claims/claim-service.js.map +1 -0
- package/dist/coordination/claims/handoff-manager.d.ts +95 -0
- package/dist/coordination/claims/handoff-manager.d.ts.map +1 -0
- package/dist/coordination/claims/handoff-manager.js +380 -0
- package/dist/coordination/claims/handoff-manager.js.map +1 -0
- package/dist/coordination/claims/index.d.ts +121 -0
- package/dist/coordination/claims/index.d.ts.map +1 -0
- package/dist/coordination/claims/index.js +129 -0
- package/dist/coordination/claims/index.js.map +1 -0
- package/dist/coordination/claims/interfaces.d.ts +471 -0
- package/dist/coordination/claims/interfaces.d.ts.map +1 -0
- package/dist/coordination/claims/interfaces.js +14 -0
- package/dist/coordination/claims/interfaces.js.map +1 -0
- package/dist/coordination/claims/work-stealing.d.ts +88 -0
- package/dist/coordination/claims/work-stealing.d.ts.map +1 -0
- package/dist/coordination/claims/work-stealing.js +335 -0
- package/dist/coordination/claims/work-stealing.js.map +1 -0
- package/dist/coordination/cross-domain-router.d.ts +104 -0
- package/dist/coordination/cross-domain-router.d.ts.map +1 -0
- package/dist/coordination/cross-domain-router.js +365 -0
- package/dist/coordination/cross-domain-router.js.map +1 -0
- package/dist/coordination/index.d.ts +14 -0
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +29 -0
- package/dist/coordination/index.js.map +1 -0
- package/dist/coordination/interfaces.d.ts +482 -0
- package/dist/coordination/interfaces.d.ts.map +1 -0
- package/dist/coordination/interfaces.js +6 -0
- package/dist/coordination/interfaces.js.map +1 -0
- package/dist/coordination/protocol-executor.d.ts +119 -0
- package/dist/coordination/protocol-executor.d.ts.map +1 -0
- package/dist/coordination/protocol-executor.js +528 -0
- package/dist/coordination/protocol-executor.js.map +1 -0
- package/dist/coordination/protocols/code-intelligence-index.d.ts +204 -0
- package/dist/coordination/protocols/code-intelligence-index.d.ts.map +1 -0
- package/dist/coordination/protocols/code-intelligence-index.js +568 -0
- package/dist/coordination/protocols/code-intelligence-index.js.map +1 -0
- package/dist/coordination/protocols/defect-investigation.d.ts +202 -0
- package/dist/coordination/protocols/defect-investigation.d.ts.map +1 -0
- package/dist/coordination/protocols/defect-investigation.js +734 -0
- package/dist/coordination/protocols/defect-investigation.js.map +1 -0
- package/dist/coordination/protocols/index.d.ts +11 -0
- package/dist/coordination/protocols/index.d.ts.map +1 -0
- package/dist/coordination/protocols/index.js +11 -0
- package/dist/coordination/protocols/index.js.map +1 -0
- package/dist/coordination/protocols/learning-consolidation.d.ts +249 -0
- package/dist/coordination/protocols/learning-consolidation.d.ts.map +1 -0
- package/dist/coordination/protocols/learning-consolidation.js +811 -0
- package/dist/coordination/protocols/learning-consolidation.js.map +1 -0
- package/dist/coordination/protocols/morning-sync.d.ts +255 -0
- package/dist/coordination/protocols/morning-sync.d.ts.map +1 -0
- package/dist/coordination/protocols/morning-sync.js +730 -0
- package/dist/coordination/protocols/morning-sync.js.map +1 -0
- package/dist/coordination/protocols/quality-gate.d.ts +303 -0
- package/dist/coordination/protocols/quality-gate.d.ts.map +1 -0
- package/dist/coordination/protocols/quality-gate.js +924 -0
- package/dist/coordination/protocols/quality-gate.js.map +1 -0
- package/dist/coordination/protocols/security-audit.d.ts +263 -0
- package/dist/coordination/protocols/security-audit.d.ts.map +1 -0
- package/dist/coordination/protocols/security-audit.js +1159 -0
- package/dist/coordination/protocols/security-audit.js.map +1 -0
- package/dist/coordination/queen-coordinator.d.ts +214 -0
- package/dist/coordination/queen-coordinator.d.ts.map +1 -0
- package/dist/coordination/queen-coordinator.js +808 -0
- package/dist/coordination/queen-coordinator.js.map +1 -0
- package/dist/coordination/result-saver.d.ts +82 -0
- package/dist/coordination/result-saver.d.ts.map +1 -0
- package/dist/coordination/result-saver.js +536 -0
- package/dist/coordination/result-saver.js.map +1 -0
- package/dist/coordination/task-executor.d.ts +50 -0
- package/dist/coordination/task-executor.d.ts.map +1 -0
- package/dist/coordination/task-executor.js +965 -0
- package/dist/coordination/task-executor.js.map +1 -0
- package/dist/coordination/workflow-orchestrator.d.ts +362 -0
- package/dist/coordination/workflow-orchestrator.d.ts.map +1 -0
- package/dist/coordination/workflow-orchestrator.js +1298 -0
- package/dist/coordination/workflow-orchestrator.js.map +1 -0
- package/dist/domains/chaos-resilience/coordinator.d.ts +108 -0
- package/dist/domains/chaos-resilience/coordinator.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/coordinator.js +775 -0
- package/dist/domains/chaos-resilience/coordinator.js.map +1 -0
- package/dist/domains/chaos-resilience/index.d.ts +13 -0
- package/dist/domains/chaos-resilience/index.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/index.js +21 -0
- package/dist/domains/chaos-resilience/index.js.map +1 -0
- package/dist/domains/chaos-resilience/interfaces.d.ts +528 -0
- package/dist/domains/chaos-resilience/interfaces.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/interfaces.js +8 -0
- package/dist/domains/chaos-resilience/interfaces.js.map +1 -0
- package/dist/domains/chaos-resilience/plugin.d.ts +97 -0
- package/dist/domains/chaos-resilience/plugin.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/plugin.js +466 -0
- package/dist/domains/chaos-resilience/plugin.js.map +1 -0
- package/dist/domains/chaos-resilience/services/chaos-engineer.d.ts +97 -0
- package/dist/domains/chaos-resilience/services/chaos-engineer.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/services/chaos-engineer.js +875 -0
- package/dist/domains/chaos-resilience/services/chaos-engineer.js.map +1 -0
- package/dist/domains/chaos-resilience/services/index.d.ts +8 -0
- package/dist/domains/chaos-resilience/services/index.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/services/index.js +8 -0
- package/dist/domains/chaos-resilience/services/index.js.map +1 -0
- package/dist/domains/chaos-resilience/services/load-tester.d.ts +71 -0
- package/dist/domains/chaos-resilience/services/load-tester.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/services/load-tester.js +588 -0
- package/dist/domains/chaos-resilience/services/load-tester.js.map +1 -0
- package/dist/domains/chaos-resilience/services/performance-profiler.d.ts +70 -0
- package/dist/domains/chaos-resilience/services/performance-profiler.d.ts.map +1 -0
- package/dist/domains/chaos-resilience/services/performance-profiler.js +642 -0
- package/dist/domains/chaos-resilience/services/performance-profiler.js.map +1 -0
- package/dist/domains/code-intelligence/coordinator.d.ts +104 -0
- package/dist/domains/code-intelligence/coordinator.d.ts.map +1 -0
- package/dist/domains/code-intelligence/coordinator.js +436 -0
- package/dist/domains/code-intelligence/coordinator.js.map +1 -0
- package/dist/domains/code-intelligence/index.d.ts +13 -0
- package/dist/domains/code-intelligence/index.d.ts.map +1 -0
- package/dist/domains/code-intelligence/index.js +21 -0
- package/dist/domains/code-intelligence/index.js.map +1 -0
- package/dist/domains/code-intelligence/interfaces.d.ts +130 -0
- package/dist/domains/code-intelligence/interfaces.d.ts.map +1 -0
- package/dist/domains/code-intelligence/interfaces.js +6 -0
- package/dist/domains/code-intelligence/interfaces.js.map +1 -0
- package/dist/domains/code-intelligence/plugin.d.ts +75 -0
- package/dist/domains/code-intelligence/plugin.d.ts.map +1 -0
- package/dist/domains/code-intelligence/plugin.js +279 -0
- package/dist/domains/code-intelligence/plugin.js.map +1 -0
- package/dist/domains/code-intelligence/services/impact-analyzer.d.ts +80 -0
- package/dist/domains/code-intelligence/services/impact-analyzer.d.ts.map +1 -0
- package/dist/domains/code-intelligence/services/impact-analyzer.js +391 -0
- package/dist/domains/code-intelligence/services/impact-analyzer.js.map +1 -0
- package/dist/domains/code-intelligence/services/index.d.ts +8 -0
- package/dist/domains/code-intelligence/services/index.d.ts.map +1 -0
- package/dist/domains/code-intelligence/services/index.js +8 -0
- package/dist/domains/code-intelligence/services/index.js.map +1 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.d.ts +101 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.d.ts.map +1 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.js +822 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.js.map +1 -0
- package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +141 -0
- package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts.map +1 -0
- package/dist/domains/code-intelligence/services/semantic-analyzer.js +661 -0
- package/dist/domains/code-intelligence/services/semantic-analyzer.js.map +1 -0
- package/dist/domains/contract-testing/coordinator.d.ts +114 -0
- package/dist/domains/contract-testing/coordinator.d.ts.map +1 -0
- package/dist/domains/contract-testing/coordinator.js +805 -0
- package/dist/domains/contract-testing/coordinator.js.map +1 -0
- package/dist/domains/contract-testing/index.d.ts +13 -0
- package/dist/domains/contract-testing/index.d.ts.map +1 -0
- package/dist/domains/contract-testing/index.js +21 -0
- package/dist/domains/contract-testing/index.js.map +1 -0
- package/dist/domains/contract-testing/interfaces.d.ts +344 -0
- package/dist/domains/contract-testing/interfaces.d.ts.map +1 -0
- package/dist/domains/contract-testing/interfaces.js +8 -0
- package/dist/domains/contract-testing/interfaces.js.map +1 -0
- package/dist/domains/contract-testing/plugin.d.ts +112 -0
- package/dist/domains/contract-testing/plugin.d.ts.map +1 -0
- package/dist/domains/contract-testing/plugin.js +491 -0
- package/dist/domains/contract-testing/plugin.js.map +1 -0
- package/dist/domains/contract-testing/services/api-compatibility.d.ts +53 -0
- package/dist/domains/contract-testing/services/api-compatibility.d.ts.map +1 -0
- package/dist/domains/contract-testing/services/api-compatibility.js +535 -0
- package/dist/domains/contract-testing/services/api-compatibility.js.map +1 -0
- package/dist/domains/contract-testing/services/contract-validator.d.ts +100 -0
- package/dist/domains/contract-testing/services/contract-validator.d.ts.map +1 -0
- package/dist/domains/contract-testing/services/contract-validator.js +1398 -0
- package/dist/domains/contract-testing/services/contract-validator.js.map +1 -0
- package/dist/domains/contract-testing/services/index.d.ts +8 -0
- package/dist/domains/contract-testing/services/index.d.ts.map +1 -0
- package/dist/domains/contract-testing/services/index.js +8 -0
- package/dist/domains/contract-testing/services/index.js.map +1 -0
- package/dist/domains/contract-testing/services/schema-validator.d.ts +65 -0
- package/dist/domains/contract-testing/services/schema-validator.d.ts.map +1 -0
- package/dist/domains/contract-testing/services/schema-validator.js +860 -0
- package/dist/domains/contract-testing/services/schema-validator.js.map +1 -0
- package/dist/domains/coverage-analysis/coordinator.d.ts +66 -0
- package/dist/domains/coverage-analysis/coordinator.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/coordinator.js +353 -0
- package/dist/domains/coverage-analysis/coordinator.js.map +1 -0
- package/dist/domains/coverage-analysis/index.d.ts +33 -0
- package/dist/domains/coverage-analysis/index.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/index.js +39 -0
- package/dist/domains/coverage-analysis/index.js.map +1 -0
- package/dist/domains/coverage-analysis/interfaces.d.ts +134 -0
- package/dist/domains/coverage-analysis/interfaces.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/interfaces.js +6 -0
- package/dist/domains/coverage-analysis/interfaces.js.map +1 -0
- package/dist/domains/coverage-analysis/plugin.d.ts +37 -0
- package/dist/domains/coverage-analysis/plugin.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/plugin.js +133 -0
- package/dist/domains/coverage-analysis/plugin.js.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-analyzer.d.ts +49 -0
- package/dist/domains/coverage-analysis/services/coverage-analyzer.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-analyzer.js +342 -0
- package/dist/domains/coverage-analysis/services/coverage-analyzer.js.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-embedder.d.ts +165 -0
- package/dist/domains/coverage-analysis/services/coverage-embedder.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-embedder.js +550 -0
- package/dist/domains/coverage-analysis/services/coverage-embedder.js.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-parser.d.ts +203 -0
- package/dist/domains/coverage-analysis/services/coverage-parser.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/coverage-parser.js +506 -0
- package/dist/domains/coverage-analysis/services/coverage-parser.js.map +1 -0
- package/dist/domains/coverage-analysis/services/gap-detector.d.ts +61 -0
- package/dist/domains/coverage-analysis/services/gap-detector.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/gap-detector.js +474 -0
- package/dist/domains/coverage-analysis/services/gap-detector.js.map +1 -0
- package/dist/domains/coverage-analysis/services/hnsw-index.d.ts +260 -0
- package/dist/domains/coverage-analysis/services/hnsw-index.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/hnsw-index.js +482 -0
- package/dist/domains/coverage-analysis/services/hnsw-index.js.map +1 -0
- package/dist/domains/coverage-analysis/services/index.d.ts +13 -0
- package/dist/domains/coverage-analysis/services/index.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/index.js +16 -0
- package/dist/domains/coverage-analysis/services/index.js.map +1 -0
- package/dist/domains/coverage-analysis/services/risk-scorer.d.ts +62 -0
- package/dist/domains/coverage-analysis/services/risk-scorer.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/risk-scorer.js +412 -0
- package/dist/domains/coverage-analysis/services/risk-scorer.js.map +1 -0
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.d.ts +237 -0
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.d.ts.map +1 -0
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.js +499 -0
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.js.map +1 -0
- package/dist/domains/defect-intelligence/coordinator.d.ts +104 -0
- package/dist/domains/defect-intelligence/coordinator.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/coordinator.js +423 -0
- package/dist/domains/defect-intelligence/coordinator.js.map +1 -0
- package/dist/domains/defect-intelligence/index.d.ts +13 -0
- package/dist/domains/defect-intelligence/index.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/index.js +21 -0
- package/dist/domains/defect-intelligence/index.js.map +1 -0
- package/dist/domains/defect-intelligence/interfaces.d.ts +127 -0
- package/dist/domains/defect-intelligence/interfaces.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/interfaces.js +6 -0
- package/dist/domains/defect-intelligence/interfaces.js.map +1 -0
- package/dist/domains/defect-intelligence/plugin.d.ts +76 -0
- package/dist/domains/defect-intelligence/plugin.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/plugin.js +287 -0
- package/dist/domains/defect-intelligence/plugin.js.map +1 -0
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.d.ts +188 -0
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js +298 -0
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js.map +1 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +129 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.js +674 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.js.map +1 -0
- package/dist/domains/defect-intelligence/services/index.d.ts +9 -0
- package/dist/domains/defect-intelligence/services/index.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/services/index.js +10 -0
- package/dist/domains/defect-intelligence/services/index.js.map +1 -0
- package/dist/domains/defect-intelligence/services/pattern-learner.d.ts +96 -0
- package/dist/domains/defect-intelligence/services/pattern-learner.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/services/pattern-learner.js +548 -0
- package/dist/domains/defect-intelligence/services/pattern-learner.js.map +1 -0
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.d.ts +60 -0
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.d.ts.map +1 -0
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.js +465 -0
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.js.map +1 -0
- package/dist/domains/domain-interface.d.ts +32 -0
- package/dist/domains/domain-interface.d.ts.map +1 -0
- package/dist/domains/domain-interface.js +61 -0
- package/dist/domains/domain-interface.js.map +1 -0
- package/dist/domains/index.d.ts +20 -0
- package/dist/domains/index.d.ts.map +1 -0
- package/dist/domains/index.js +22 -0
- package/dist/domains/index.js.map +1 -0
- package/dist/domains/learning-optimization/coordinator.d.ts +107 -0
- package/dist/domains/learning-optimization/coordinator.d.ts.map +1 -0
- package/dist/domains/learning-optimization/coordinator.js +849 -0
- package/dist/domains/learning-optimization/coordinator.js.map +1 -0
- package/dist/domains/learning-optimization/index.d.ts +14 -0
- package/dist/domains/learning-optimization/index.d.ts.map +1 -0
- package/dist/domains/learning-optimization/index.js +22 -0
- package/dist/domains/learning-optimization/index.js.map +1 -0
- package/dist/domains/learning-optimization/interfaces.d.ts +453 -0
- package/dist/domains/learning-optimization/interfaces.d.ts.map +1 -0
- package/dist/domains/learning-optimization/interfaces.js +8 -0
- package/dist/domains/learning-optimization/interfaces.js.map +1 -0
- package/dist/domains/learning-optimization/plugin.d.ts +116 -0
- package/dist/domains/learning-optimization/plugin.d.ts.map +1 -0
- package/dist/domains/learning-optimization/plugin.js +523 -0
- package/dist/domains/learning-optimization/plugin.js.map +1 -0
- package/dist/domains/learning-optimization/services/index.d.ts +9 -0
- package/dist/domains/learning-optimization/services/index.d.ts.map +1 -0
- package/dist/domains/learning-optimization/services/index.js +9 -0
- package/dist/domains/learning-optimization/services/index.js.map +1 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.d.ts +98 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.d.ts.map +1 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.js +730 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.js.map +1 -0
- package/dist/domains/learning-optimization/services/metrics-optimizer.d.ts +89 -0
- package/dist/domains/learning-optimization/services/metrics-optimizer.d.ts.map +1 -0
- package/dist/domains/learning-optimization/services/metrics-optimizer.js +598 -0
- package/dist/domains/learning-optimization/services/metrics-optimizer.js.map +1 -0
- package/dist/domains/learning-optimization/services/production-intel.d.ts +137 -0
- package/dist/domains/learning-optimization/services/production-intel.d.ts.map +1 -0
- package/dist/domains/learning-optimization/services/production-intel.js +649 -0
- package/dist/domains/learning-optimization/services/production-intel.js.map +1 -0
- package/dist/domains/learning-optimization/services/transfer-specialist.d.ts +86 -0
- package/dist/domains/learning-optimization/services/transfer-specialist.d.ts.map +1 -0
- package/dist/domains/learning-optimization/services/transfer-specialist.js +495 -0
- package/dist/domains/learning-optimization/services/transfer-specialist.js.map +1 -0
- package/dist/domains/quality-assessment/coherence/gate-controller.d.ts +117 -0
- package/dist/domains/quality-assessment/coherence/gate-controller.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coherence/gate-controller.js +414 -0
- package/dist/domains/quality-assessment/coherence/gate-controller.js.map +1 -0
- package/dist/domains/quality-assessment/coherence/index.d.ts +102 -0
- package/dist/domains/quality-assessment/coherence/index.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coherence/index.js +122 -0
- package/dist/domains/quality-assessment/coherence/index.js.map +1 -0
- package/dist/domains/quality-assessment/coherence/lambda-calculator.d.ts +93 -0
- package/dist/domains/quality-assessment/coherence/lambda-calculator.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coherence/lambda-calculator.js +293 -0
- package/dist/domains/quality-assessment/coherence/lambda-calculator.js.map +1 -0
- package/dist/domains/quality-assessment/coherence/partition-detector.d.ts +109 -0
- package/dist/domains/quality-assessment/coherence/partition-detector.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coherence/partition-detector.js +338 -0
- package/dist/domains/quality-assessment/coherence/partition-detector.js.map +1 -0
- package/dist/domains/quality-assessment/coherence/types.d.ts +239 -0
- package/dist/domains/quality-assessment/coherence/types.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coherence/types.js +62 -0
- package/dist/domains/quality-assessment/coherence/types.js.map +1 -0
- package/dist/domains/quality-assessment/coordinator.d.ts +98 -0
- package/dist/domains/quality-assessment/coordinator.d.ts.map +1 -0
- package/dist/domains/quality-assessment/coordinator.js +391 -0
- package/dist/domains/quality-assessment/coordinator.js.map +1 -0
- package/dist/domains/quality-assessment/index.d.ts +15 -0
- package/dist/domains/quality-assessment/index.d.ts.map +1 -0
- package/dist/domains/quality-assessment/index.js +27 -0
- package/dist/domains/quality-assessment/index.js.map +1 -0
- package/dist/domains/quality-assessment/interfaces.d.ts +140 -0
- package/dist/domains/quality-assessment/interfaces.d.ts.map +1 -0
- package/dist/domains/quality-assessment/interfaces.js +6 -0
- package/dist/domains/quality-assessment/interfaces.js.map +1 -0
- package/dist/domains/quality-assessment/plugin.d.ts +75 -0
- package/dist/domains/quality-assessment/plugin.d.ts.map +1 -0
- package/dist/domains/quality-assessment/plugin.js +294 -0
- package/dist/domains/quality-assessment/plugin.js.map +1 -0
- package/dist/domains/quality-assessment/services/coherence-gate.d.ts +109 -0
- package/dist/domains/quality-assessment/services/coherence-gate.d.ts.map +1 -0
- package/dist/domains/quality-assessment/services/coherence-gate.js +234 -0
- package/dist/domains/quality-assessment/services/coherence-gate.js.map +1 -0
- package/dist/domains/quality-assessment/services/deployment-advisor.d.ts +83 -0
- package/dist/domains/quality-assessment/services/deployment-advisor.d.ts.map +1 -0
- package/dist/domains/quality-assessment/services/deployment-advisor.js +384 -0
- package/dist/domains/quality-assessment/services/deployment-advisor.js.map +1 -0
- package/dist/domains/quality-assessment/services/index.d.ts +9 -0
- package/dist/domains/quality-assessment/services/index.d.ts.map +1 -0
- package/dist/domains/quality-assessment/services/index.js +12 -0
- package/dist/domains/quality-assessment/services/index.js.map +1 -0
- package/dist/domains/quality-assessment/services/quality-analyzer.d.ts +74 -0
- package/dist/domains/quality-assessment/services/quality-analyzer.d.ts.map +1 -0
- package/dist/domains/quality-assessment/services/quality-analyzer.js +518 -0
- package/dist/domains/quality-assessment/services/quality-analyzer.js.map +1 -0
- package/dist/domains/quality-assessment/services/quality-gate.d.ts +57 -0
- package/dist/domains/quality-assessment/services/quality-gate.d.ts.map +1 -0
- package/dist/domains/quality-assessment/services/quality-gate.js +244 -0
- package/dist/domains/quality-assessment/services/quality-gate.js.map +1 -0
- package/dist/domains/requirements-validation/coordinator.d.ts +89 -0
- package/dist/domains/requirements-validation/coordinator.d.ts.map +1 -0
- package/dist/domains/requirements-validation/coordinator.js +574 -0
- package/dist/domains/requirements-validation/coordinator.js.map +1 -0
- package/dist/domains/requirements-validation/index.d.ts +13 -0
- package/dist/domains/requirements-validation/index.d.ts.map +1 -0
- package/dist/domains/requirements-validation/index.js +21 -0
- package/dist/domains/requirements-validation/index.js.map +1 -0
- package/dist/domains/requirements-validation/interfaces.d.ts +236 -0
- package/dist/domains/requirements-validation/interfaces.d.ts.map +1 -0
- package/dist/domains/requirements-validation/interfaces.js +8 -0
- package/dist/domains/requirements-validation/interfaces.js.map +1 -0
- package/dist/domains/requirements-validation/plugin.d.ts +103 -0
- package/dist/domains/requirements-validation/plugin.d.ts.map +1 -0
- package/dist/domains/requirements-validation/plugin.js +351 -0
- package/dist/domains/requirements-validation/plugin.js.map +1 -0
- package/dist/domains/requirements-validation/services/bdd-scenario-writer.d.ts +58 -0
- package/dist/domains/requirements-validation/services/bdd-scenario-writer.d.ts.map +1 -0
- package/dist/domains/requirements-validation/services/bdd-scenario-writer.js +521 -0
- package/dist/domains/requirements-validation/services/bdd-scenario-writer.js.map +1 -0
- package/dist/domains/requirements-validation/services/index.d.ts +8 -0
- package/dist/domains/requirements-validation/services/index.d.ts.map +1 -0
- package/dist/domains/requirements-validation/services/index.js +8 -0
- package/dist/domains/requirements-validation/services/index.js.map +1 -0
- package/dist/domains/requirements-validation/services/requirements-validator.d.ts +51 -0
- package/dist/domains/requirements-validation/services/requirements-validator.d.ts.map +1 -0
- package/dist/domains/requirements-validation/services/requirements-validator.js +423 -0
- package/dist/domains/requirements-validation/services/requirements-validator.js.map +1 -0
- package/dist/domains/requirements-validation/services/testability-scorer.d.ts +79 -0
- package/dist/domains/requirements-validation/services/testability-scorer.d.ts.map +1 -0
- package/dist/domains/requirements-validation/services/testability-scorer.js +502 -0
- package/dist/domains/requirements-validation/services/testability-scorer.js.map +1 -0
- package/dist/domains/security-compliance/coordinator.d.ts +91 -0
- package/dist/domains/security-compliance/coordinator.d.ts.map +1 -0
- package/dist/domains/security-compliance/coordinator.js +497 -0
- package/dist/domains/security-compliance/coordinator.js.map +1 -0
- package/dist/domains/security-compliance/index.d.ts +13 -0
- package/dist/domains/security-compliance/index.d.ts.map +1 -0
- package/dist/domains/security-compliance/index.js +21 -0
- package/dist/domains/security-compliance/index.js.map +1 -0
- package/dist/domains/security-compliance/interfaces.d.ts +342 -0
- package/dist/domains/security-compliance/interfaces.d.ts.map +1 -0
- package/dist/domains/security-compliance/interfaces.js +8 -0
- package/dist/domains/security-compliance/interfaces.js.map +1 -0
- package/dist/domains/security-compliance/plugin.d.ts +81 -0
- package/dist/domains/security-compliance/plugin.d.ts.map +1 -0
- package/dist/domains/security-compliance/plugin.js +302 -0
- package/dist/domains/security-compliance/plugin.js.map +1 -0
- package/dist/domains/security-compliance/services/compliance-validator.d.ts +102 -0
- package/dist/domains/security-compliance/services/compliance-validator.d.ts.map +1 -0
- package/dist/domains/security-compliance/services/compliance-validator.js +925 -0
- package/dist/domains/security-compliance/services/compliance-validator.js.map +1 -0
- package/dist/domains/security-compliance/services/index.d.ts +8 -0
- package/dist/domains/security-compliance/services/index.d.ts.map +1 -0
- package/dist/domains/security-compliance/services/index.js +8 -0
- package/dist/domains/security-compliance/services/index.js.map +1 -0
- package/dist/domains/security-compliance/services/security-auditor.d.ts +174 -0
- package/dist/domains/security-compliance/services/security-auditor.d.ts.map +1 -0
- package/dist/domains/security-compliance/services/security-auditor.js +1763 -0
- package/dist/domains/security-compliance/services/security-auditor.js.map +1 -0
- package/dist/domains/security-compliance/services/security-scanner.d.ts +185 -0
- package/dist/domains/security-compliance/services/security-scanner.d.ts.map +1 -0
- package/dist/domains/security-compliance/services/security-scanner.js +1911 -0
- package/dist/domains/security-compliance/services/security-scanner.js.map +1 -0
- package/dist/domains/security-compliance/services/semgrep-integration.d.ts +95 -0
- package/dist/domains/security-compliance/services/semgrep-integration.d.ts.map +1 -0
- package/dist/domains/security-compliance/services/semgrep-integration.js +209 -0
- package/dist/domains/security-compliance/services/semgrep-integration.js.map +1 -0
- package/dist/domains/test-execution/coordinator.d.ts +91 -0
- package/dist/domains/test-execution/coordinator.d.ts.map +1 -0
- package/dist/domains/test-execution/coordinator.js +280 -0
- package/dist/domains/test-execution/coordinator.js.map +1 -0
- package/dist/domains/test-execution/index.d.ts +11 -0
- package/dist/domains/test-execution/index.d.ts.map +1 -0
- package/dist/domains/test-execution/index.js +19 -0
- package/dist/domains/test-execution/index.js.map +1 -0
- package/dist/domains/test-execution/interfaces.d.ts +95 -0
- package/dist/domains/test-execution/interfaces.d.ts.map +1 -0
- package/dist/domains/test-execution/interfaces.js +6 -0
- package/dist/domains/test-execution/interfaces.js.map +1 -0
- package/dist/domains/test-execution/plugin.d.ts +27 -0
- package/dist/domains/test-execution/plugin.d.ts.map +1 -0
- package/dist/domains/test-execution/plugin.js +137 -0
- package/dist/domains/test-execution/plugin.js.map +1 -0
- package/dist/domains/test-execution/services/flaky-detector.d.ts +189 -0
- package/dist/domains/test-execution/services/flaky-detector.d.ts.map +1 -0
- package/dist/domains/test-execution/services/flaky-detector.js +834 -0
- package/dist/domains/test-execution/services/flaky-detector.js.map +1 -0
- package/dist/domains/test-execution/services/index.d.ts +8 -0
- package/dist/domains/test-execution/services/index.d.ts.map +1 -0
- package/dist/domains/test-execution/services/index.js +8 -0
- package/dist/domains/test-execution/services/index.js.map +1 -0
- package/dist/domains/test-execution/services/retry-handler.d.ts +169 -0
- package/dist/domains/test-execution/services/retry-handler.d.ts.map +1 -0
- package/dist/domains/test-execution/services/retry-handler.js +536 -0
- package/dist/domains/test-execution/services/retry-handler.js.map +1 -0
- package/dist/domains/test-execution/services/test-executor.d.ts +112 -0
- package/dist/domains/test-execution/services/test-executor.d.ts.map +1 -0
- package/dist/domains/test-execution/services/test-executor.js +657 -0
- package/dist/domains/test-execution/services/test-executor.js.map +1 -0
- package/dist/domains/test-generation/coordinator.d.ts +104 -0
- package/dist/domains/test-generation/coordinator.d.ts.map +1 -0
- package/dist/domains/test-generation/coordinator.js +446 -0
- package/dist/domains/test-generation/coordinator.js.map +1 -0
- package/dist/domains/test-generation/index.d.ts +12 -0
- package/dist/domains/test-generation/index.d.ts.map +1 -0
- package/dist/domains/test-generation/index.js +20 -0
- package/dist/domains/test-generation/index.js.map +1 -0
- package/dist/domains/test-generation/interfaces.d.ts +92 -0
- package/dist/domains/test-generation/interfaces.d.ts.map +1 -0
- package/dist/domains/test-generation/interfaces.js +6 -0
- package/dist/domains/test-generation/interfaces.js.map +1 -0
- package/dist/domains/test-generation/plugin.d.ts +70 -0
- package/dist/domains/test-generation/plugin.d.ts.map +1 -0
- package/dist/domains/test-generation/plugin.js +240 -0
- package/dist/domains/test-generation/plugin.js.map +1 -0
- package/dist/domains/test-generation/services/index.d.ts +7 -0
- package/dist/domains/test-generation/services/index.d.ts.map +1 -0
- package/dist/domains/test-generation/services/index.js +7 -0
- package/dist/domains/test-generation/services/index.js.map +1 -0
- package/dist/domains/test-generation/services/pattern-matcher.d.ts +276 -0
- package/dist/domains/test-generation/services/pattern-matcher.d.ts.map +1 -0
- package/dist/domains/test-generation/services/pattern-matcher.js +1271 -0
- package/dist/domains/test-generation/services/pattern-matcher.js.map +1 -0
- package/dist/domains/test-generation/services/test-generator.d.ts +226 -0
- package/dist/domains/test-generation/services/test-generator.d.ts.map +1 -0
- package/dist/domains/test-generation/services/test-generator.js +2230 -0
- package/dist/domains/test-generation/services/test-generator.js.map +1 -0
- package/dist/domains/visual-accessibility/coordinator.d.ts +118 -0
- package/dist/domains/visual-accessibility/coordinator.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/coordinator.js +623 -0
- package/dist/domains/visual-accessibility/coordinator.js.map +1 -0
- package/dist/domains/visual-accessibility/index.d.ts +13 -0
- package/dist/domains/visual-accessibility/index.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/index.js +21 -0
- package/dist/domains/visual-accessibility/index.js.map +1 -0
- package/dist/domains/visual-accessibility/interfaces.d.ts +360 -0
- package/dist/domains/visual-accessibility/interfaces.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/interfaces.js +8 -0
- package/dist/domains/visual-accessibility/interfaces.js.map +1 -0
- package/dist/domains/visual-accessibility/plugin.d.ts +92 -0
- package/dist/domains/visual-accessibility/plugin.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/plugin.js +343 -0
- package/dist/domains/visual-accessibility/plugin.js.map +1 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +115 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.js +794 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.js.map +1 -0
- package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts +219 -0
- package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/services/axe-core-audit.js +427 -0
- package/dist/domains/visual-accessibility/services/axe-core-audit.js.map +1 -0
- package/dist/domains/visual-accessibility/services/index.d.ts +8 -0
- package/dist/domains/visual-accessibility/services/index.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/services/index.js +8 -0
- package/dist/domains/visual-accessibility/services/index.js.map +1 -0
- package/dist/domains/visual-accessibility/services/responsive-tester.d.ts +149 -0
- package/dist/domains/visual-accessibility/services/responsive-tester.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/services/responsive-tester.js +667 -0
- package/dist/domains/visual-accessibility/services/responsive-tester.js.map +1 -0
- package/dist/domains/visual-accessibility/services/visual-tester.d.ts +78 -0
- package/dist/domains/visual-accessibility/services/visual-tester.d.ts.map +1 -0
- package/dist/domains/visual-accessibility/services/visual-tester.js +335 -0
- package/dist/domains/visual-accessibility/services/visual-tester.js.map +1 -0
- package/dist/early-exit/early-exit-controller.d.ts +158 -0
- package/dist/early-exit/early-exit-controller.d.ts.map +1 -0
- package/dist/early-exit/early-exit-controller.js +354 -0
- package/dist/early-exit/early-exit-controller.js.map +1 -0
- package/dist/early-exit/early-exit-decision.d.ts +110 -0
- package/dist/early-exit/early-exit-decision.d.ts.map +1 -0
- package/dist/early-exit/early-exit-decision.js +241 -0
- package/dist/early-exit/early-exit-decision.js.map +1 -0
- package/dist/early-exit/index.d.ts +38 -0
- package/dist/early-exit/index.d.ts.map +1 -0
- package/dist/early-exit/index.js +53 -0
- package/dist/early-exit/index.js.map +1 -0
- package/dist/early-exit/quality-signal.d.ts +61 -0
- package/dist/early-exit/quality-signal.d.ts.map +1 -0
- package/dist/early-exit/quality-signal.js +306 -0
- package/dist/early-exit/quality-signal.js.map +1 -0
- package/dist/early-exit/speculative-executor.d.ts +131 -0
- package/dist/early-exit/speculative-executor.d.ts.map +1 -0
- package/dist/early-exit/speculative-executor.js +385 -0
- package/dist/early-exit/speculative-executor.js.map +1 -0
- package/dist/early-exit/types.d.ts +271 -0
- package/dist/early-exit/types.d.ts.map +1 -0
- package/dist/early-exit/types.js +69 -0
- package/dist/early-exit/types.js.map +1 -0
- package/dist/feedback/coverage-learner.d.ts +117 -0
- package/dist/feedback/coverage-learner.d.ts.map +1 -0
- package/dist/feedback/coverage-learner.js +367 -0
- package/dist/feedback/coverage-learner.js.map +1 -0
- package/dist/feedback/feedback-loop.d.ts +170 -0
- package/dist/feedback/feedback-loop.d.ts.map +1 -0
- package/dist/feedback/feedback-loop.js +281 -0
- package/dist/feedback/feedback-loop.js.map +1 -0
- package/dist/feedback/index.d.ts +17 -0
- package/dist/feedback/index.d.ts.map +1 -0
- package/dist/feedback/index.js +20 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/feedback/pattern-promotion.d.ts +126 -0
- package/dist/feedback/pattern-promotion.d.ts.map +1 -0
- package/dist/feedback/pattern-promotion.js +282 -0
- package/dist/feedback/pattern-promotion.js.map +1 -0
- package/dist/feedback/quality-score-calculator.d.ts +93 -0
- package/dist/feedback/quality-score-calculator.d.ts.map +1 -0
- package/dist/feedback/quality-score-calculator.js +285 -0
- package/dist/feedback/quality-score-calculator.js.map +1 -0
- package/dist/feedback/test-outcome-tracker.d.ts +103 -0
- package/dist/feedback/test-outcome-tracker.d.ts.map +1 -0
- package/dist/feedback/test-outcome-tracker.js +347 -0
- package/dist/feedback/test-outcome-tracker.js.map +1 -0
- package/dist/feedback/types.d.ts +322 -0
- package/dist/feedback/types.d.ts.map +1 -0
- package/dist/feedback/types.js +60 -0
- package/dist/feedback/types.js.map +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/init/agents-installer.d.ts +88 -0
- package/dist/init/agents-installer.d.ts.map +1 -0
- package/dist/init/agents-installer.js +441 -0
- package/dist/init/agents-installer.js.map +1 -0
- package/dist/init/index.d.ts +18 -0
- package/dist/init/index.d.ts.map +1 -0
- package/dist/init/index.js +14 -0
- package/dist/init/index.js.map +1 -0
- package/dist/init/init-wizard.d.ts +107 -0
- package/dist/init/init-wizard.d.ts.map +1 -0
- package/dist/init/init-wizard.js +906 -0
- package/dist/init/init-wizard.js.map +1 -0
- package/dist/init/project-analyzer.d.ts +95 -0
- package/dist/init/project-analyzer.d.ts.map +1 -0
- package/dist/init/project-analyzer.js +608 -0
- package/dist/init/project-analyzer.js.map +1 -0
- package/dist/init/self-configurator.d.ts +74 -0
- package/dist/init/self-configurator.d.ts.map +1 -0
- package/dist/init/self-configurator.js +384 -0
- package/dist/init/self-configurator.js.map +1 -0
- package/dist/init/skills-installer.d.ts +88 -0
- package/dist/init/skills-installer.d.ts.map +1 -0
- package/dist/init/skills-installer.js +386 -0
- package/dist/init/skills-installer.js.map +1 -0
- package/dist/init/types.d.ts +280 -0
- package/dist/init/types.d.ts.map +1 -0
- package/dist/init/types.js +110 -0
- package/dist/init/types.js.map +1 -0
- package/dist/integrations/ruvector/ast-complexity.d.ts +134 -0
- package/dist/integrations/ruvector/ast-complexity.d.ts.map +1 -0
- package/dist/integrations/ruvector/ast-complexity.js +383 -0
- package/dist/integrations/ruvector/ast-complexity.js.map +1 -0
- package/dist/integrations/ruvector/coverage-router.d.ts +128 -0
- package/dist/integrations/ruvector/coverage-router.d.ts.map +1 -0
- package/dist/integrations/ruvector/coverage-router.js +463 -0
- package/dist/integrations/ruvector/coverage-router.js.map +1 -0
- package/dist/integrations/ruvector/diff-risk-classifier.d.ts +129 -0
- package/dist/integrations/ruvector/diff-risk-classifier.d.ts.map +1 -0
- package/dist/integrations/ruvector/diff-risk-classifier.js +569 -0
- package/dist/integrations/ruvector/diff-risk-classifier.js.map +1 -0
- package/dist/integrations/ruvector/fallback.d.ts +138 -0
- package/dist/integrations/ruvector/fallback.d.ts.map +1 -0
- package/dist/integrations/ruvector/fallback.js +737 -0
- package/dist/integrations/ruvector/fallback.js.map +1 -0
- package/dist/integrations/ruvector/graph-boundaries.d.ts +151 -0
- package/dist/integrations/ruvector/graph-boundaries.d.ts.map +1 -0
- package/dist/integrations/ruvector/graph-boundaries.js +627 -0
- package/dist/integrations/ruvector/graph-boundaries.js.map +1 -0
- package/dist/integrations/ruvector/index.d.ts +82 -0
- package/dist/integrations/ruvector/index.d.ts.map +1 -0
- package/dist/integrations/ruvector/index.js +254 -0
- package/dist/integrations/ruvector/index.js.map +1 -0
- package/dist/integrations/ruvector/interfaces.d.ts +488 -0
- package/dist/integrations/ruvector/interfaces.d.ts.map +1 -0
- package/dist/integrations/ruvector/interfaces.js +64 -0
- package/dist/integrations/ruvector/interfaces.js.map +1 -0
- package/dist/integrations/ruvector/q-learning-router.d.ts +128 -0
- package/dist/integrations/ruvector/q-learning-router.d.ts.map +1 -0
- package/dist/integrations/ruvector/q-learning-router.js +427 -0
- package/dist/integrations/ruvector/q-learning-router.js.map +1 -0
- package/dist/kernel/agent-coordinator.d.ts +22 -0
- package/dist/kernel/agent-coordinator.d.ts.map +1 -0
- package/dist/kernel/agent-coordinator.js +113 -0
- package/dist/kernel/agent-coordinator.js.map +1 -0
- package/dist/kernel/agentdb-backend.d.ts +131 -0
- package/dist/kernel/agentdb-backend.d.ts.map +1 -0
- package/dist/kernel/agentdb-backend.js +359 -0
- package/dist/kernel/agentdb-backend.js.map +1 -0
- package/dist/kernel/event-bus.d.ts +18 -0
- package/dist/kernel/event-bus.d.ts.map +1 -0
- package/dist/kernel/event-bus.js +99 -0
- package/dist/kernel/event-bus.js.map +1 -0
- package/dist/kernel/hybrid-backend.d.ts +124 -0
- package/dist/kernel/hybrid-backend.d.ts.map +1 -0
- package/dist/kernel/hybrid-backend.js +395 -0
- package/dist/kernel/hybrid-backend.js.map +1 -0
- package/dist/kernel/index.d.ts +16 -0
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +17 -0
- package/dist/kernel/index.js.map +1 -0
- package/dist/kernel/interfaces.d.ts +174 -0
- package/dist/kernel/interfaces.d.ts.map +1 -0
- package/dist/kernel/interfaces.js +6 -0
- package/dist/kernel/interfaces.js.map +1 -0
- package/dist/kernel/kernel.d.ts +50 -0
- package/dist/kernel/kernel.d.ts.map +1 -0
- package/dist/kernel/kernel.js +228 -0
- package/dist/kernel/kernel.js.map +1 -0
- package/dist/kernel/memory-backend.d.ts +28 -0
- package/dist/kernel/memory-backend.d.ts.map +1 -0
- package/dist/kernel/memory-backend.js +126 -0
- package/dist/kernel/memory-backend.js.map +1 -0
- package/dist/kernel/memory-factory.d.ts +100 -0
- package/dist/kernel/memory-factory.d.ts.map +1 -0
- package/dist/kernel/memory-factory.js +209 -0
- package/dist/kernel/memory-factory.js.map +1 -0
- package/dist/kernel/plugin-loader.d.ts +36 -0
- package/dist/kernel/plugin-loader.d.ts.map +1 -0
- package/dist/kernel/plugin-loader.js +145 -0
- package/dist/kernel/plugin-loader.js.map +1 -0
- package/dist/learning/index.d.ts +58 -0
- package/dist/learning/index.d.ts.map +1 -0
- package/dist/learning/index.js +90 -0
- package/dist/learning/index.js.map +1 -0
- package/dist/learning/pattern-store.d.ts +242 -0
- package/dist/learning/pattern-store.d.ts.map +1 -0
- package/dist/learning/pattern-store.js +657 -0
- package/dist/learning/pattern-store.js.map +1 -0
- package/dist/learning/qe-guidance.d.ts +125 -0
- package/dist/learning/qe-guidance.d.ts.map +1 -0
- package/dist/learning/qe-guidance.js +712 -0
- package/dist/learning/qe-guidance.js.map +1 -0
- package/dist/learning/qe-hooks.d.ts +111 -0
- package/dist/learning/qe-hooks.d.ts.map +1 -0
- package/dist/learning/qe-hooks.js +475 -0
- package/dist/learning/qe-hooks.js.map +1 -0
- package/dist/learning/qe-patterns.d.ts +203 -0
- package/dist/learning/qe-patterns.d.ts.map +1 -0
- package/dist/learning/qe-patterns.js +181 -0
- package/dist/learning/qe-patterns.js.map +1 -0
- package/dist/learning/qe-reasoning-bank.d.ts +263 -0
- package/dist/learning/qe-reasoning-bank.d.ts.map +1 -0
- package/dist/learning/qe-reasoning-bank.js +617 -0
- package/dist/learning/qe-reasoning-bank.js.map +1 -0
- package/dist/learning/real-embeddings.d.ts +61 -0
- package/dist/learning/real-embeddings.d.ts.map +1 -0
- package/dist/learning/real-embeddings.js +219 -0
- package/dist/learning/real-embeddings.js.map +1 -0
- package/dist/learning/real-qe-reasoning-bank.d.ts +182 -0
- package/dist/learning/real-qe-reasoning-bank.d.ts.map +1 -0
- package/dist/learning/real-qe-reasoning-bank.js +597 -0
- package/dist/learning/real-qe-reasoning-bank.js.map +1 -0
- package/dist/learning/sqlite-persistence.d.ts +121 -0
- package/dist/learning/sqlite-persistence.d.ts.map +1 -0
- package/dist/learning/sqlite-persistence.js +438 -0
- package/dist/learning/sqlite-persistence.js.map +1 -0
- package/dist/mcp/entry.d.ts +13 -0
- package/dist/mcp/entry.d.ts.map +1 -0
- package/dist/mcp/entry.js +53 -0
- package/dist/mcp/entry.js.map +1 -0
- package/dist/mcp/handlers/agent-handlers.d.ts +62 -0
- package/dist/mcp/handlers/agent-handlers.d.ts.map +1 -0
- package/dist/mcp/handlers/agent-handlers.js +173 -0
- package/dist/mcp/handlers/agent-handlers.js.map +1 -0
- package/dist/mcp/handlers/core-handlers.d.ts +30 -0
- package/dist/mcp/handlers/core-handlers.d.ts.map +1 -0
- package/dist/mcp/handlers/core-handlers.js +250 -0
- package/dist/mcp/handlers/core-handlers.js.map +1 -0
- package/dist/mcp/handlers/domain-handlers.d.ts +135 -0
- package/dist/mcp/handlers/domain-handlers.d.ts.map +1 -0
- package/dist/mcp/handlers/domain-handlers.js +990 -0
- package/dist/mcp/handlers/domain-handlers.js.map +1 -0
- package/dist/mcp/handlers/index.d.ts +10 -0
- package/dist/mcp/handlers/index.d.ts.map +1 -0
- package/dist/mcp/handlers/index.js +15 -0
- package/dist/mcp/handlers/index.js.map +1 -0
- package/dist/mcp/handlers/memory-handlers.d.ts +53 -0
- package/dist/mcp/handlers/memory-handlers.d.ts.map +1 -0
- package/dist/mcp/handlers/memory-handlers.js +228 -0
- package/dist/mcp/handlers/memory-handlers.js.map +1 -0
- package/dist/mcp/handlers/task-handlers.d.ts +26 -0
- package/dist/mcp/handlers/task-handlers.d.ts.map +1 -0
- package/dist/mcp/handlers/task-handlers.js +293 -0
- package/dist/mcp/handlers/task-handlers.js.map +1 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +18 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/metrics/index.d.ts +6 -0
- package/dist/mcp/metrics/index.d.ts.map +1 -0
- package/dist/mcp/metrics/index.js +6 -0
- package/dist/mcp/metrics/index.js.map +1 -0
- package/dist/mcp/metrics/metrics-collector.d.ts +154 -0
- package/dist/mcp/metrics/metrics-collector.d.ts.map +1 -0
- package/dist/mcp/metrics/metrics-collector.js +377 -0
- package/dist/mcp/metrics/metrics-collector.js.map +1 -0
- package/dist/mcp/protocol-server.d.ts +66 -0
- package/dist/mcp/protocol-server.d.ts.map +1 -0
- package/dist/mcp/protocol-server.js +600 -0
- package/dist/mcp/protocol-server.js.map +1 -0
- package/dist/mcp/security/cve-prevention.d.ts +150 -0
- package/dist/mcp/security/cve-prevention.d.ts.map +1 -0
- package/dist/mcp/security/cve-prevention.js +570 -0
- package/dist/mcp/security/cve-prevention.js.map +1 -0
- package/dist/mcp/security/index.d.ts +116 -0
- package/dist/mcp/security/index.d.ts.map +1 -0
- package/dist/mcp/security/index.js +184 -0
- package/dist/mcp/security/index.js.map +1 -0
- package/dist/mcp/security/oauth21-provider.d.ts +229 -0
- package/dist/mcp/security/oauth21-provider.d.ts.map +1 -0
- package/dist/mcp/security/oauth21-provider.js +558 -0
- package/dist/mcp/security/oauth21-provider.js.map +1 -0
- package/dist/mcp/security/rate-limiter.d.ts +191 -0
- package/dist/mcp/security/rate-limiter.d.ts.map +1 -0
- package/dist/mcp/security/rate-limiter.js +437 -0
- package/dist/mcp/security/rate-limiter.js.map +1 -0
- package/dist/mcp/security/sampling-server.d.ts +289 -0
- package/dist/mcp/security/sampling-server.d.ts.map +1 -0
- package/dist/mcp/security/sampling-server.js +450 -0
- package/dist/mcp/security/sampling-server.js.map +1 -0
- package/dist/mcp/security/schema-validator.d.ts +197 -0
- package/dist/mcp/security/schema-validator.d.ts.map +1 -0
- package/dist/mcp/security/schema-validator.js +633 -0
- package/dist/mcp/security/schema-validator.js.map +1 -0
- package/dist/mcp/server.d.ts +46 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +576 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-registry.d.ts +98 -0
- package/dist/mcp/tool-registry.d.ts.map +1 -0
- package/dist/mcp/tool-registry.js +321 -0
- package/dist/mcp/tool-registry.js.map +1 -0
- package/dist/mcp/tools/base.d.ts +186 -0
- package/dist/mcp/tools/base.d.ts.map +1 -0
- package/dist/mcp/tools/base.js +249 -0
- package/dist/mcp/tools/base.js.map +1 -0
- package/dist/mcp/tools/chaos-resilience/inject.d.ts +61 -0
- package/dist/mcp/tools/chaos-resilience/inject.d.ts.map +1 -0
- package/dist/mcp/tools/chaos-resilience/inject.js +520 -0
- package/dist/mcp/tools/chaos-resilience/inject.js.map +1 -0
- package/dist/mcp/tools/code-intelligence/analyze.d.ts +140 -0
- package/dist/mcp/tools/code-intelligence/analyze.d.ts.map +1 -0
- package/dist/mcp/tools/code-intelligence/analyze.js +570 -0
- package/dist/mcp/tools/code-intelligence/analyze.js.map +1 -0
- package/dist/mcp/tools/contract-testing/validate.d.ts +90 -0
- package/dist/mcp/tools/contract-testing/validate.d.ts.map +1 -0
- package/dist/mcp/tools/contract-testing/validate.js +515 -0
- package/dist/mcp/tools/contract-testing/validate.js.map +1 -0
- package/dist/mcp/tools/coverage-analysis/index.d.ts +111 -0
- package/dist/mcp/tools/coverage-analysis/index.d.ts.map +1 -0
- package/dist/mcp/tools/coverage-analysis/index.js +577 -0
- package/dist/mcp/tools/coverage-analysis/index.js.map +1 -0
- package/dist/mcp/tools/defect-intelligence/predict.d.ts +67 -0
- package/dist/mcp/tools/defect-intelligence/predict.d.ts.map +1 -0
- package/dist/mcp/tools/defect-intelligence/predict.js +359 -0
- package/dist/mcp/tools/defect-intelligence/predict.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +40 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +82 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/learning-optimization/optimize.d.ts +123 -0
- package/dist/mcp/tools/learning-optimization/optimize.d.ts.map +1 -0
- package/dist/mcp/tools/learning-optimization/optimize.js +563 -0
- package/dist/mcp/tools/learning-optimization/optimize.js.map +1 -0
- package/dist/mcp/tools/quality-assessment/evaluate.d.ts +83 -0
- package/dist/mcp/tools/quality-assessment/evaluate.d.ts.map +1 -0
- package/dist/mcp/tools/quality-assessment/evaluate.js +277 -0
- package/dist/mcp/tools/quality-assessment/evaluate.js.map +1 -0
- package/dist/mcp/tools/registry.d.ts +79 -0
- package/dist/mcp/tools/registry.d.ts.map +1 -0
- package/dist/mcp/tools/registry.js +181 -0
- package/dist/mcp/tools/registry.js.map +1 -0
- package/dist/mcp/tools/requirements-validation/validate.d.ts +81 -0
- package/dist/mcp/tools/requirements-validation/validate.d.ts.map +1 -0
- package/dist/mcp/tools/requirements-validation/validate.js +270 -0
- package/dist/mcp/tools/requirements-validation/validate.js.map +1 -0
- package/dist/mcp/tools/security-compliance/scan.d.ts +75 -0
- package/dist/mcp/tools/security-compliance/scan.d.ts.map +1 -0
- package/dist/mcp/tools/security-compliance/scan.js +258 -0
- package/dist/mcp/tools/security-compliance/scan.js.map +1 -0
- package/dist/mcp/tools/test-execution/execute.d.ts +65 -0
- package/dist/mcp/tools/test-execution/execute.d.ts.map +1 -0
- package/dist/mcp/tools/test-execution/execute.js +196 -0
- package/dist/mcp/tools/test-execution/execute.js.map +1 -0
- package/dist/mcp/tools/test-generation/generate.d.ts +53 -0
- package/dist/mcp/tools/test-generation/generate.d.ts.map +1 -0
- package/dist/mcp/tools/test-generation/generate.js +437 -0
- package/dist/mcp/tools/test-generation/generate.js.map +1 -0
- package/dist/mcp/tools/visual-accessibility/index.d.ts +144 -0
- package/dist/mcp/tools/visual-accessibility/index.d.ts.map +1 -0
- package/dist/mcp/tools/visual-accessibility/index.js +562 -0
- package/dist/mcp/tools/visual-accessibility/index.js.map +1 -0
- package/dist/mcp/transport/index.d.ts +12 -0
- package/dist/mcp/transport/index.d.ts.map +1 -0
- package/dist/mcp/transport/index.js +21 -0
- package/dist/mcp/transport/index.js.map +1 -0
- package/dist/mcp/transport/stdio.d.ts +95 -0
- package/dist/mcp/transport/stdio.d.ts.map +1 -0
- package/dist/mcp/transport/stdio.js +226 -0
- package/dist/mcp/transport/stdio.js.map +1 -0
- package/dist/mcp/types.d.ts +455 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +6 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/neural-optimizer/index.d.ts +55 -0
- package/dist/neural-optimizer/index.d.ts.map +1 -0
- package/dist/neural-optimizer/index.js +57 -0
- package/dist/neural-optimizer/index.js.map +1 -0
- package/dist/neural-optimizer/replay-buffer.d.ts +126 -0
- package/dist/neural-optimizer/replay-buffer.d.ts.map +1 -0
- package/dist/neural-optimizer/replay-buffer.js +355 -0
- package/dist/neural-optimizer/replay-buffer.js.map +1 -0
- package/dist/neural-optimizer/swarm-topology.d.ts +157 -0
- package/dist/neural-optimizer/swarm-topology.d.ts.map +1 -0
- package/dist/neural-optimizer/swarm-topology.js +384 -0
- package/dist/neural-optimizer/swarm-topology.js.map +1 -0
- package/dist/neural-optimizer/topology-optimizer.d.ts +137 -0
- package/dist/neural-optimizer/topology-optimizer.d.ts.map +1 -0
- package/dist/neural-optimizer/topology-optimizer.js +656 -0
- package/dist/neural-optimizer/topology-optimizer.js.map +1 -0
- package/dist/neural-optimizer/types.d.ts +333 -0
- package/dist/neural-optimizer/types.d.ts.map +1 -0
- package/dist/neural-optimizer/types.js +57 -0
- package/dist/neural-optimizer/types.js.map +1 -0
- package/dist/neural-optimizer/value-network.d.ts +129 -0
- package/dist/neural-optimizer/value-network.d.ts.map +1 -0
- package/dist/neural-optimizer/value-network.js +278 -0
- package/dist/neural-optimizer/value-network.js.map +1 -0
- package/dist/optimization/auto-tuner.d.ts +207 -0
- package/dist/optimization/auto-tuner.d.ts.map +1 -0
- package/dist/optimization/auto-tuner.js +641 -0
- package/dist/optimization/auto-tuner.js.map +1 -0
- package/dist/optimization/index.d.ts +16 -0
- package/dist/optimization/index.d.ts.map +1 -0
- package/dist/optimization/index.js +14 -0
- package/dist/optimization/index.js.map +1 -0
- package/dist/optimization/metric-collectors.d.ts +145 -0
- package/dist/optimization/metric-collectors.d.ts.map +1 -0
- package/dist/optimization/metric-collectors.js +401 -0
- package/dist/optimization/metric-collectors.js.map +1 -0
- package/dist/optimization/qe-workers.d.ts +143 -0
- package/dist/optimization/qe-workers.d.ts.map +1 -0
- package/dist/optimization/qe-workers.js +510 -0
- package/dist/optimization/qe-workers.js.map +1 -0
- package/dist/optimization/tuning-algorithm.d.ts +93 -0
- package/dist/optimization/tuning-algorithm.d.ts.map +1 -0
- package/dist/optimization/tuning-algorithm.js +278 -0
- package/dist/optimization/tuning-algorithm.js.map +1 -0
- package/dist/optimization/types.d.ts +211 -0
- package/dist/optimization/types.d.ts.map +1 -0
- package/dist/optimization/types.js +81 -0
- package/dist/optimization/types.js.map +1 -0
- package/dist/routing/index.d.ts +15 -0
- package/dist/routing/index.d.ts.map +1 -0
- package/dist/routing/index.js +17 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/routing/qe-agent-registry.d.ts +58 -0
- package/dist/routing/qe-agent-registry.d.ts.map +1 -0
- package/dist/routing/qe-agent-registry.js +909 -0
- package/dist/routing/qe-agent-registry.js.map +1 -0
- package/dist/routing/qe-task-router.d.ts +82 -0
- package/dist/routing/qe-task-router.d.ts.map +1 -0
- package/dist/routing/qe-task-router.js +453 -0
- package/dist/routing/qe-task-router.js.map +1 -0
- package/dist/routing/routing-feedback.d.ts +82 -0
- package/dist/routing/routing-feedback.d.ts.map +1 -0
- package/dist/routing/routing-feedback.js +272 -0
- package/dist/routing/routing-feedback.js.map +1 -0
- package/dist/routing/types.d.ts +225 -0
- package/dist/routing/types.d.ts.map +1 -0
- package/dist/routing/types.js +27 -0
- package/dist/routing/types.js.map +1 -0
- package/dist/shared/embeddings/embedding-cache.d.ts +62 -0
- package/dist/shared/embeddings/embedding-cache.d.ts.map +1 -0
- package/dist/shared/embeddings/embedding-cache.js +136 -0
- package/dist/shared/embeddings/embedding-cache.js.map +1 -0
- package/dist/shared/embeddings/index.d.ts +35 -0
- package/dist/shared/embeddings/index.d.ts.map +1 -0
- package/dist/shared/embeddings/index.js +33 -0
- package/dist/shared/embeddings/index.js.map +1 -0
- package/dist/shared/embeddings/nomic-embedder.d.ts +128 -0
- package/dist/shared/embeddings/nomic-embedder.d.ts.map +1 -0
- package/dist/shared/embeddings/nomic-embedder.js +322 -0
- package/dist/shared/embeddings/nomic-embedder.js.map +1 -0
- package/dist/shared/embeddings/ollama-client.d.ts +40 -0
- package/dist/shared/embeddings/ollama-client.d.ts.map +1 -0
- package/dist/shared/embeddings/ollama-client.js +140 -0
- package/dist/shared/embeddings/ollama-client.js.map +1 -0
- package/dist/shared/embeddings/types.d.ts +136 -0
- package/dist/shared/embeddings/types.d.ts.map +1 -0
- package/dist/shared/embeddings/types.js +26 -0
- package/dist/shared/embeddings/types.js.map +1 -0
- package/dist/shared/entities/agent.d.ts +40 -0
- package/dist/shared/entities/agent.d.ts.map +1 -0
- package/dist/shared/entities/agent.js +107 -0
- package/dist/shared/entities/agent.js.map +1 -0
- package/dist/shared/entities/base-entity.d.ts +37 -0
- package/dist/shared/entities/base-entity.d.ts.map +1 -0
- package/dist/shared/entities/base-entity.js +56 -0
- package/dist/shared/entities/base-entity.js.map +1 -0
- package/dist/shared/entities/index.d.ts +6 -0
- package/dist/shared/entities/index.d.ts.map +1 -0
- package/dist/shared/entities/index.js +6 -0
- package/dist/shared/entities/index.js.map +1 -0
- package/dist/shared/events/domain-events.d.ts +194 -0
- package/dist/shared/events/domain-events.d.ts.map +1 -0
- package/dist/shared/events/domain-events.js +74 -0
- package/dist/shared/events/domain-events.js.map +1 -0
- package/dist/shared/events/index.d.ts +5 -0
- package/dist/shared/events/index.d.ts.map +1 -0
- package/dist/shared/events/index.js +5 -0
- package/dist/shared/events/index.js.map +1 -0
- package/dist/shared/git/git-analyzer.d.ts +135 -0
- package/dist/shared/git/git-analyzer.d.ts.map +1 -0
- package/dist/shared/git/git-analyzer.js +562 -0
- package/dist/shared/git/git-analyzer.js.map +1 -0
- package/dist/shared/git/index.d.ts +6 -0
- package/dist/shared/git/index.d.ts.map +1 -0
- package/dist/shared/git/index.js +5 -0
- package/dist/shared/git/index.js.map +1 -0
- package/dist/shared/http/http-client.d.ts +92 -0
- package/dist/shared/http/http-client.d.ts.map +1 -0
- package/dist/shared/http/http-client.js +295 -0
- package/dist/shared/http/http-client.js.map +1 -0
- package/dist/shared/http/index.d.ts +5 -0
- package/dist/shared/http/index.d.ts.map +1 -0
- package/dist/shared/http/index.js +5 -0
- package/dist/shared/http/index.js.map +1 -0
- package/dist/shared/index.d.ts +18 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +17 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/io/file-reader.d.ts +107 -0
- package/dist/shared/io/file-reader.d.ts.map +1 -0
- package/dist/shared/io/file-reader.js +408 -0
- package/dist/shared/io/file-reader.js.map +1 -0
- package/dist/shared/io/index.d.ts +6 -0
- package/dist/shared/io/index.d.ts.map +1 -0
- package/dist/shared/io/index.js +12 -0
- package/dist/shared/io/index.js.map +1 -0
- package/dist/shared/llm/cache.d.ts +163 -0
- package/dist/shared/llm/cache.d.ts.map +1 -0
- package/dist/shared/llm/cache.js +368 -0
- package/dist/shared/llm/cache.js.map +1 -0
- package/dist/shared/llm/circuit-breaker.d.ts +117 -0
- package/dist/shared/llm/circuit-breaker.d.ts.map +1 -0
- package/dist/shared/llm/circuit-breaker.js +294 -0
- package/dist/shared/llm/circuit-breaker.js.map +1 -0
- package/dist/shared/llm/cost-tracker.d.ts +133 -0
- package/dist/shared/llm/cost-tracker.d.ts.map +1 -0
- package/dist/shared/llm/cost-tracker.js +342 -0
- package/dist/shared/llm/cost-tracker.js.map +1 -0
- package/dist/shared/llm/index.d.ts +50 -0
- package/dist/shared/llm/index.d.ts.map +1 -0
- package/dist/shared/llm/index.js +56 -0
- package/dist/shared/llm/index.js.map +1 -0
- package/dist/shared/llm/interfaces.d.ts +503 -0
- package/dist/shared/llm/interfaces.d.ts.map +1 -0
- package/dist/shared/llm/interfaces.js +33 -0
- package/dist/shared/llm/interfaces.js.map +1 -0
- package/dist/shared/llm/provider-manager.d.ts +158 -0
- package/dist/shared/llm/provider-manager.d.ts.map +1 -0
- package/dist/shared/llm/provider-manager.js +527 -0
- package/dist/shared/llm/provider-manager.js.map +1 -0
- package/dist/shared/llm/providers/claude.d.ts +99 -0
- package/dist/shared/llm/providers/claude.d.ts.map +1 -0
- package/dist/shared/llm/providers/claude.js +394 -0
- package/dist/shared/llm/providers/claude.js.map +1 -0
- package/dist/shared/llm/providers/index.d.ts +8 -0
- package/dist/shared/llm/providers/index.d.ts.map +1 -0
- package/dist/shared/llm/providers/index.js +8 -0
- package/dist/shared/llm/providers/index.js.map +1 -0
- package/dist/shared/llm/providers/ollama.d.ts +91 -0
- package/dist/shared/llm/providers/ollama.d.ts.map +1 -0
- package/dist/shared/llm/providers/ollama.js +391 -0
- package/dist/shared/llm/providers/ollama.js.map +1 -0
- package/dist/shared/llm/providers/openai.d.ts +98 -0
- package/dist/shared/llm/providers/openai.d.ts.map +1 -0
- package/dist/shared/llm/providers/openai.js +440 -0
- package/dist/shared/llm/providers/openai.js.map +1 -0
- package/dist/shared/metrics/code-metrics.d.ts +75 -0
- package/dist/shared/metrics/code-metrics.d.ts.map +1 -0
- package/dist/shared/metrics/code-metrics.js +395 -0
- package/dist/shared/metrics/code-metrics.js.map +1 -0
- package/dist/shared/metrics/index.d.ts +9 -0
- package/dist/shared/metrics/index.d.ts.map +1 -0
- package/dist/shared/metrics/index.js +7 -0
- package/dist/shared/metrics/index.js.map +1 -0
- package/dist/shared/metrics/system-metrics.d.ts +109 -0
- package/dist/shared/metrics/system-metrics.d.ts.map +1 -0
- package/dist/shared/metrics/system-metrics.js +267 -0
- package/dist/shared/metrics/system-metrics.js.map +1 -0
- package/dist/shared/parsers/index.d.ts +6 -0
- package/dist/shared/parsers/index.d.ts.map +1 -0
- package/dist/shared/parsers/index.js +6 -0
- package/dist/shared/parsers/index.js.map +1 -0
- package/dist/shared/parsers/typescript-parser.d.ts +211 -0
- package/dist/shared/parsers/typescript-parser.d.ts.map +1 -0
- package/dist/shared/parsers/typescript-parser.js +561 -0
- package/dist/shared/parsers/typescript-parser.js.map +1 -0
- package/dist/shared/security/compliance-patterns.d.ts +78 -0
- package/dist/shared/security/compliance-patterns.d.ts.map +1 -0
- package/dist/shared/security/compliance-patterns.js +543 -0
- package/dist/shared/security/compliance-patterns.js.map +1 -0
- package/dist/shared/security/index.d.ts +8 -0
- package/dist/shared/security/index.d.ts.map +1 -0
- package/dist/shared/security/index.js +6 -0
- package/dist/shared/security/index.js.map +1 -0
- package/dist/shared/security/osv-client.d.ts +191 -0
- package/dist/shared/security/osv-client.d.ts.map +1 -0
- package/dist/shared/security/osv-client.js +256 -0
- package/dist/shared/security/osv-client.js.map +1 -0
- package/dist/shared/types/index.d.ts +66 -0
- package/dist/shared/types/index.d.ts.map +1 -0
- package/dist/shared/types/index.js +25 -0
- package/dist/shared/types/index.js.map +1 -0
- package/dist/shared/value-objects/index.d.ts +73 -0
- package/dist/shared/value-objects/index.d.ts.map +1 -0
- package/dist/shared/value-objects/index.js +229 -0
- package/dist/shared/value-objects/index.js.map +1 -0
- package/dist/strange-loop/healing-controller.d.ts +125 -0
- package/dist/strange-loop/healing-controller.d.ts.map +1 -0
- package/dist/strange-loop/healing-controller.js +648 -0
- package/dist/strange-loop/healing-controller.js.map +1 -0
- package/dist/strange-loop/index.d.ts +26 -0
- package/dist/strange-loop/index.d.ts.map +1 -0
- package/dist/strange-loop/index.js +30 -0
- package/dist/strange-loop/index.js.map +1 -0
- package/dist/strange-loop/self-model.d.ts +84 -0
- package/dist/strange-loop/self-model.d.ts.map +1 -0
- package/dist/strange-loop/self-model.js +378 -0
- package/dist/strange-loop/self-model.js.map +1 -0
- package/dist/strange-loop/strange-loop.d.ts +112 -0
- package/dist/strange-loop/strange-loop.d.ts.map +1 -0
- package/dist/strange-loop/strange-loop.js +354 -0
- package/dist/strange-loop/strange-loop.js.map +1 -0
- package/dist/strange-loop/swarm-observer.d.ts +89 -0
- package/dist/strange-loop/swarm-observer.d.ts.map +1 -0
- package/dist/strange-loop/swarm-observer.js +341 -0
- package/dist/strange-loop/swarm-observer.js.map +1 -0
- package/dist/strange-loop/topology-analyzer.d.ts +87 -0
- package/dist/strange-loop/topology-analyzer.d.ts.map +1 -0
- package/dist/strange-loop/topology-analyzer.js +441 -0
- package/dist/strange-loop/topology-analyzer.js.map +1 -0
- package/dist/strange-loop/types.d.ts +425 -0
- package/dist/strange-loop/types.d.ts.map +1 -0
- package/dist/strange-loop/types.js +22 -0
- package/dist/strange-loop/types.js.map +1 -0
- package/dist/time-crystal/default-phases.d.ts +95 -0
- package/dist/time-crystal/default-phases.d.ts.map +1 -0
- package/dist/time-crystal/default-phases.js +456 -0
- package/dist/time-crystal/default-phases.js.map +1 -0
- package/dist/time-crystal/index.d.ts +28 -0
- package/dist/time-crystal/index.d.ts.map +1 -0
- package/dist/time-crystal/index.js +55 -0
- package/dist/time-crystal/index.js.map +1 -0
- package/dist/time-crystal/oscillator.d.ts +195 -0
- package/dist/time-crystal/oscillator.d.ts.map +1 -0
- package/dist/time-crystal/oscillator.js +358 -0
- package/dist/time-crystal/oscillator.js.map +1 -0
- package/dist/time-crystal/phase-executor.d.ts +212 -0
- package/dist/time-crystal/phase-executor.d.ts.map +1 -0
- package/dist/time-crystal/phase-executor.js +327 -0
- package/dist/time-crystal/phase-executor.js.map +1 -0
- package/dist/time-crystal/scheduler.d.ts +239 -0
- package/dist/time-crystal/scheduler.d.ts.map +1 -0
- package/dist/time-crystal/scheduler.js +860 -0
- package/dist/time-crystal/scheduler.js.map +1 -0
- package/dist/time-crystal/test-runner.d.ts +141 -0
- package/dist/time-crystal/test-runner.d.ts.map +1 -0
- package/dist/time-crystal/test-runner.js +529 -0
- package/dist/time-crystal/test-runner.js.map +1 -0
- package/dist/time-crystal/types.d.ts +269 -0
- package/dist/time-crystal/types.d.ts.map +1 -0
- package/dist/time-crystal/types.js +51 -0
- package/dist/time-crystal/types.js.map +1 -0
- package/dist/workers/base-worker.d.ts +83 -0
- package/dist/workers/base-worker.d.ts.map +1 -0
- package/dist/workers/base-worker.js +235 -0
- package/dist/workers/base-worker.js.map +1 -0
- package/dist/workers/daemon.d.ts +73 -0
- package/dist/workers/daemon.d.ts.map +1 -0
- package/dist/workers/daemon.js +193 -0
- package/dist/workers/daemon.js.map +1 -0
- package/dist/workers/index.d.ts +91 -0
- package/dist/workers/index.d.ts.map +1 -0
- package/dist/workers/index.js +95 -0
- package/dist/workers/index.js.map +1 -0
- package/dist/workers/interfaces.d.ts +270 -0
- package/dist/workers/interfaces.d.ts.map +1 -0
- package/dist/workers/interfaces.js +9 -0
- package/dist/workers/interfaces.js.map +1 -0
- package/dist/workers/worker-manager.d.ts +87 -0
- package/dist/workers/worker-manager.d.ts.map +1 -0
- package/dist/workers/worker-manager.js +345 -0
- package/dist/workers/worker-manager.js.map +1 -0
- package/dist/workers/workers/compliance-checker.d.ts +28 -0
- package/dist/workers/workers/compliance-checker.d.ts.map +1 -0
- package/dist/workers/workers/compliance-checker.js +334 -0
- package/dist/workers/workers/compliance-checker.js.map +1 -0
- package/dist/workers/workers/coverage-tracker.d.ts +24 -0
- package/dist/workers/workers/coverage-tracker.d.ts.map +1 -0
- package/dist/workers/workers/coverage-tracker.js +265 -0
- package/dist/workers/workers/coverage-tracker.js.map +1 -0
- package/dist/workers/workers/defect-predictor.d.ts +22 -0
- package/dist/workers/workers/defect-predictor.d.ts.map +1 -0
- package/dist/workers/workers/defect-predictor.js +292 -0
- package/dist/workers/workers/defect-predictor.js.map +1 -0
- package/dist/workers/workers/flaky-detector.d.ts +25 -0
- package/dist/workers/workers/flaky-detector.d.ts.map +1 -0
- package/dist/workers/workers/flaky-detector.js +288 -0
- package/dist/workers/workers/flaky-detector.js.map +1 -0
- package/dist/workers/workers/index.d.ts +17 -0
- package/dist/workers/workers/index.d.ts.map +1 -0
- package/dist/workers/workers/index.js +17 -0
- package/dist/workers/workers/index.js.map +1 -0
- package/dist/workers/workers/learning-consolidation.d.ts +25 -0
- package/dist/workers/workers/learning-consolidation.d.ts.map +1 -0
- package/dist/workers/workers/learning-consolidation.js +324 -0
- package/dist/workers/workers/learning-consolidation.js.map +1 -0
- package/dist/workers/workers/performance-baseline.d.ts +25 -0
- package/dist/workers/workers/performance-baseline.d.ts.map +1 -0
- package/dist/workers/workers/performance-baseline.js +315 -0
- package/dist/workers/workers/performance-baseline.js.map +1 -0
- package/dist/workers/workers/quality-gate.d.ts +23 -0
- package/dist/workers/workers/quality-gate.d.ts.map +1 -0
- package/dist/workers/workers/quality-gate.js +348 -0
- package/dist/workers/workers/quality-gate.js.map +1 -0
- package/dist/workers/workers/regression-monitor.d.ts +24 -0
- package/dist/workers/workers/regression-monitor.d.ts.map +1 -0
- package/dist/workers/workers/regression-monitor.js +280 -0
- package/dist/workers/workers/regression-monitor.js.map +1 -0
- package/dist/workers/workers/security-scan.d.ts +22 -0
- package/dist/workers/workers/security-scan.d.ts.map +1 -0
- package/dist/workers/workers/security-scan.js +264 -0
- package/dist/workers/workers/security-scan.js.map +1 -0
- package/dist/workers/workers/test-health.d.ts +26 -0
- package/dist/workers/workers/test-health.d.ts.map +1 -0
- package/dist/workers/workers/test-health.js +258 -0
- package/dist/workers/workers/test-health.js.map +1 -0
- package/docs/analysis/V3-INIT-REQUIREMENTS-ANALYSIS.md +352 -0
- package/implementation/README.md +90 -0
- package/implementation/adrs/ADR-030-coherence-gated-quality-gates.md +312 -0
- package/implementation/adrs/ADR-031-strange-loop-self-awareness.md +484 -0
- package/implementation/adrs/ADR-032-time-crystal-scheduling.md +530 -0
- package/implementation/adrs/ADR-033-early-exit-testing.md +634 -0
- package/implementation/adrs/ADR-034-neural-topology-optimizer.md +589 -0
- package/implementation/adrs/ADR-035-causal-discovery.md +610 -0
- package/implementation/adrs/ADR-036-result-persistence.md +326 -0
- package/implementation/adrs/ADR-037-v3-qe-agent-naming.md +105 -0
- package/implementation/adrs/ADR-038-v3-qe-memory-unification.md +154 -0
- package/implementation/adrs/ADR-039-v3-qe-mcp-optimization.md +179 -0
- package/implementation/adrs/ADR-040-v3-qe-agentic-flow-integration.md +240 -0
- package/implementation/adrs/ADR-041-v3-qe-cli-enhancement.md +296 -0
- package/implementation/adrs/ADR-042-v3-qe-token-tracking-integration.md +517 -0
- package/implementation/adrs/v3-adrs.md +2783 -0
- package/implementation/planning/AQE-V3-MASTER-PLAN.md +815 -0
- package/package.json +88 -0
- package/security-scan-report-2026-01-11.md +410 -0
- package/security-verification-report-2026-01-11.md +278 -0
- package/src/benchmarks/performance-benchmarks.ts +646 -0
- package/src/benchmarks/run-benchmarks.ts +324 -0
- package/src/causal-discovery/causal-graph.ts +450 -0
- package/src/causal-discovery/discovery-engine.ts +438 -0
- package/src/causal-discovery/index.ts +117 -0
- package/src/causal-discovery/types.ts +456 -0
- package/src/causal-discovery/weight-matrix.ts +453 -0
- package/src/cli/commands/qe-tools.ts +634 -0
- package/src/cli/index.ts +1976 -0
- package/src/compatibility/agent-mapper.ts +291 -0
- package/src/compatibility/cli-adapter.ts +277 -0
- package/src/compatibility/config-migrator.ts +334 -0
- package/src/compatibility/index.ts +112 -0
- package/src/compatibility/mcp-adapter.ts +248 -0
- package/src/compatibility/types.ts +156 -0
- package/src/coordination/claims/claim-repository.ts +636 -0
- package/src/coordination/claims/claim-service.ts +675 -0
- package/src/coordination/claims/handoff-manager.ts +535 -0
- package/src/coordination/claims/index.ts +276 -0
- package/src/coordination/claims/interfaces.ts +687 -0
- package/src/coordination/claims/work-stealing.ts +436 -0
- package/src/coordination/cross-domain-router.ts +492 -0
- package/src/coordination/index.ts +127 -0
- package/src/coordination/interfaces.ts +691 -0
- package/src/coordination/protocol-executor.ts +760 -0
- package/src/coordination/protocols/code-intelligence-index.ts +855 -0
- package/src/coordination/protocols/defect-investigation.ts +1184 -0
- package/src/coordination/protocols/index.ts +11 -0
- package/src/coordination/protocols/learning-consolidation.ts +1181 -0
- package/src/coordination/protocols/morning-sync.ts +1055 -0
- package/src/coordination/protocols/quality-gate.ts +1566 -0
- package/src/coordination/protocols/security-audit.ts +1587 -0
- package/src/coordination/queen-coordinator.ts +1176 -0
- package/src/coordination/result-saver.ts +780 -0
- package/src/coordination/task-executor.ts +1146 -0
- package/src/coordination/workflow-orchestrator.ts +1917 -0
- package/src/domains/chaos-resilience/coordinator.ts +1032 -0
- package/src/domains/chaos-resilience/index.ts +143 -0
- package/src/domains/chaos-resilience/interfaces.ts +659 -0
- package/src/domains/chaos-resilience/plugin.ts +691 -0
- package/src/domains/chaos-resilience/services/chaos-engineer.ts +1097 -0
- package/src/domains/chaos-resilience/services/index.ts +19 -0
- package/src/domains/chaos-resilience/services/load-tester.ts +799 -0
- package/src/domains/chaos-resilience/services/performance-profiler.ts +792 -0
- package/src/domains/code-intelligence/coordinator.ts +631 -0
- package/src/domains/code-intelligence/index.ts +86 -0
- package/src/domains/code-intelligence/interfaces.ts +162 -0
- package/src/domains/code-intelligence/plugin.ts +451 -0
- package/src/domains/code-intelligence/services/impact-analyzer.ts +567 -0
- package/src/domains/code-intelligence/services/index.ts +26 -0
- package/src/domains/code-intelligence/services/knowledge-graph.ts +1067 -0
- package/src/domains/code-intelligence/services/semantic-analyzer.ts +901 -0
- package/src/domains/contract-testing/coordinator.ts +1038 -0
- package/src/domains/contract-testing/index.ts +122 -0
- package/src/domains/contract-testing/interfaces.ts +458 -0
- package/src/domains/contract-testing/plugin.ts +746 -0
- package/src/domains/contract-testing/services/api-compatibility.ts +748 -0
- package/src/domains/contract-testing/services/contract-validator.ts +1700 -0
- package/src/domains/contract-testing/services/index.ts +19 -0
- package/src/domains/contract-testing/services/schema-validator.ts +1102 -0
- package/src/domains/coverage-analysis/coordinator.ts +485 -0
- package/src/domains/coverage-analysis/index.ts +114 -0
- package/src/domains/coverage-analysis/interfaces.ts +142 -0
- package/src/domains/coverage-analysis/plugin.ts +172 -0
- package/src/domains/coverage-analysis/services/coverage-analyzer.ts +449 -0
- package/src/domains/coverage-analysis/services/coverage-embedder.ts +733 -0
- package/src/domains/coverage-analysis/services/coverage-parser.ts +753 -0
- package/src/domains/coverage-analysis/services/gap-detector.ts +592 -0
- package/src/domains/coverage-analysis/services/hnsw-index.ts +728 -0
- package/src/domains/coverage-analysis/services/index.ts +61 -0
- package/src/domains/coverage-analysis/services/risk-scorer.ts +540 -0
- package/src/domains/coverage-analysis/services/sublinear-analyzer.ts +747 -0
- package/src/domains/defect-intelligence/coordinator.ts +635 -0
- package/src/domains/defect-intelligence/index.ts +83 -0
- package/src/domains/defect-intelligence/interfaces.ts +152 -0
- package/src/domains/defect-intelligence/plugin.ts +483 -0
- package/src/domains/defect-intelligence/services/causal-root-cause-analyzer.ts +494 -0
- package/src/domains/defect-intelligence/services/defect-predictor.ts +852 -0
- package/src/domains/defect-intelligence/services/index.ts +37 -0
- package/src/domains/defect-intelligence/services/pattern-learner.ts +738 -0
- package/src/domains/defect-intelligence/services/root-cause-analyzer.ts +637 -0
- package/src/domains/domain-interface.ts +77 -0
- package/src/domains/index.ts +23 -0
- package/src/domains/learning-optimization/coordinator.ts +1215 -0
- package/src/domains/learning-optimization/index.ts +127 -0
- package/src/domains/learning-optimization/interfaces.ts +570 -0
- package/src/domains/learning-optimization/plugin.ts +851 -0
- package/src/domains/learning-optimization/services/index.ts +29 -0
- package/src/domains/learning-optimization/services/learning-coordinator.ts +972 -0
- package/src/domains/learning-optimization/services/metrics-optimizer.ts +915 -0
- package/src/domains/learning-optimization/services/production-intel.ts +971 -0
- package/src/domains/learning-optimization/services/transfer-specialist.ts +723 -0
- package/src/domains/quality-assessment/coherence/gate-controller.ts +549 -0
- package/src/domains/quality-assessment/coherence/index.ts +211 -0
- package/src/domains/quality-assessment/coherence/lambda-calculator.ts +384 -0
- package/src/domains/quality-assessment/coherence/partition-detector.ts +469 -0
- package/src/domains/quality-assessment/coherence/types.ts +384 -0
- package/src/domains/quality-assessment/coordinator.ts +605 -0
- package/src/domains/quality-assessment/index.ts +97 -0
- package/src/domains/quality-assessment/interfaces.ts +152 -0
- package/src/domains/quality-assessment/plugin.ts +496 -0
- package/src/domains/quality-assessment/services/coherence-gate.ts +358 -0
- package/src/domains/quality-assessment/services/deployment-advisor.ts +571 -0
- package/src/domains/quality-assessment/services/index.ts +34 -0
- package/src/domains/quality-assessment/services/quality-analyzer.ts +670 -0
- package/src/domains/quality-assessment/services/quality-gate.ts +384 -0
- package/src/domains/requirements-validation/coordinator.ts +812 -0
- package/src/domains/requirements-validation/index.ts +92 -0
- package/src/domains/requirements-validation/interfaces.ts +303 -0
- package/src/domains/requirements-validation/plugin.ts +576 -0
- package/src/domains/requirements-validation/services/bdd-scenario-writer.ts +676 -0
- package/src/domains/requirements-validation/services/index.ts +20 -0
- package/src/domains/requirements-validation/services/requirements-validator.ts +559 -0
- package/src/domains/requirements-validation/services/testability-scorer.ts +639 -0
- package/src/domains/security-compliance/coordinator.ts +757 -0
- package/src/domains/security-compliance/index.ts +120 -0
- package/src/domains/security-compliance/interfaces.ts +434 -0
- package/src/domains/security-compliance/plugin.ts +509 -0
- package/src/domains/security-compliance/services/compliance-validator.ts +1226 -0
- package/src/domains/security-compliance/services/index.ts +31 -0
- package/src/domains/security-compliance/services/security-auditor.ts +2227 -0
- package/src/domains/security-compliance/services/security-scanner.ts +2354 -0
- package/src/domains/security-compliance/services/semgrep-integration.ts +289 -0
- package/src/domains/test-execution/coordinator.ts +426 -0
- package/src/domains/test-execution/index.ts +76 -0
- package/src/domains/test-execution/interfaces.ts +119 -0
- package/src/domains/test-execution/plugin.ts +208 -0
- package/src/domains/test-execution/services/flaky-detector.ts +1240 -0
- package/src/domains/test-execution/services/index.ts +8 -0
- package/src/domains/test-execution/services/retry-handler.ts +820 -0
- package/src/domains/test-execution/services/test-executor.ts +885 -0
- package/src/domains/test-generation/coordinator.ts +656 -0
- package/src/domains/test-generation/index.ts +77 -0
- package/src/domains/test-generation/interfaces.ts +118 -0
- package/src/domains/test-generation/plugin.ts +397 -0
- package/src/domains/test-generation/services/index.ts +23 -0
- package/src/domains/test-generation/services/pattern-matcher.ts +1725 -0
- package/src/domains/test-generation/services/test-generator.ts +2750 -0
- package/src/domains/visual-accessibility/coordinator.ts +860 -0
- package/src/domains/visual-accessibility/index.ts +116 -0
- package/src/domains/visual-accessibility/interfaces.ts +435 -0
- package/src/domains/visual-accessibility/plugin.ts +568 -0
- package/src/domains/visual-accessibility/services/accessibility-tester.ts +982 -0
- package/src/domains/visual-accessibility/services/axe-core-audit.ts +630 -0
- package/src/domains/visual-accessibility/services/index.ts +28 -0
- package/src/domains/visual-accessibility/services/responsive-tester.ts +934 -0
- package/src/domains/visual-accessibility/services/visual-tester.ts +458 -0
- package/src/early-exit/early-exit-controller.ts +490 -0
- package/src/early-exit/early-exit-decision.ts +391 -0
- package/src/early-exit/index.ts +115 -0
- package/src/early-exit/quality-signal.ts +389 -0
- package/src/early-exit/speculative-executor.ts +505 -0
- package/src/early-exit/types.ts +407 -0
- package/src/feedback/coverage-learner.ts +456 -0
- package/src/feedback/feedback-loop.ts +426 -0
- package/src/feedback/index.ts +72 -0
- package/src/feedback/pattern-promotion.ts +373 -0
- package/src/feedback/quality-score-calculator.ts +334 -0
- package/src/feedback/test-outcome-tracker.ts +450 -0
- package/src/feedback/types.ts +497 -0
- package/src/index.ts +224 -0
- package/src/init/agents-installer.ts +536 -0
- package/src/init/index.ts +80 -0
- package/src/init/init-wizard.ts +1061 -0
- package/src/init/project-analyzer.ts +696 -0
- package/src/init/self-configurator.ts +488 -0
- package/src/init/skills-installer.ts +467 -0
- package/src/init/types.ts +432 -0
- package/src/integrations/ruvector/ast-complexity.ts +470 -0
- package/src/integrations/ruvector/coverage-router.ts +594 -0
- package/src/integrations/ruvector/diff-risk-classifier.ts +759 -0
- package/src/integrations/ruvector/fallback.ts +942 -0
- package/src/integrations/ruvector/graph-boundaries.ts +809 -0
- package/src/integrations/ruvector/index.ts +363 -0
- package/src/integrations/ruvector/interfaces.ts +609 -0
- package/src/integrations/ruvector/q-learning-router.ts +550 -0
- package/src/kernel/agent-coordinator.ts +165 -0
- package/src/kernel/agentdb-backend.ts +504 -0
- package/src/kernel/event-bus.ts +129 -0
- package/src/kernel/hybrid-backend.ts +538 -0
- package/src/kernel/index.ts +28 -0
- package/src/kernel/interfaces.ts +257 -0
- package/src/kernel/kernel.ts +285 -0
- package/src/kernel/memory-backend.ts +169 -0
- package/src/kernel/memory-factory.ts +293 -0
- package/src/kernel/plugin-loader.ts +179 -0
- package/src/learning/index.ts +219 -0
- package/src/learning/pattern-store.ts +990 -0
- package/src/learning/qe-guidance.ts +832 -0
- package/src/learning/qe-hooks.ts +644 -0
- package/src/learning/qe-patterns.ts +449 -0
- package/src/learning/qe-reasoning-bank.ts +951 -0
- package/src/learning/real-embeddings.ts +277 -0
- package/src/learning/real-qe-reasoning-bank.ts +833 -0
- package/src/learning/sqlite-persistence.ts +554 -0
- package/src/mcp/entry.ts +59 -0
- package/src/mcp/handlers/agent-handlers.ts +285 -0
- package/src/mcp/handlers/core-handlers.ts +317 -0
- package/src/mcp/handlers/domain-handlers.ts +1444 -0
- package/src/mcp/handlers/index.ts +57 -0
- package/src/mcp/handlers/memory-handlers.ts +338 -0
- package/src/mcp/handlers/task-handlers.ts +363 -0
- package/src/mcp/index.ts +30 -0
- package/src/mcp/metrics/index.ts +14 -0
- package/src/mcp/metrics/metrics-collector.ts +503 -0
- package/src/mcp/protocol-server.ts +752 -0
- package/src/mcp/security/cve-prevention.ts +742 -0
- package/src/mcp/security/index.ts +356 -0
- package/src/mcp/security/oauth21-provider.ts +821 -0
- package/src/mcp/security/rate-limiter.ts +615 -0
- package/src/mcp/security/sampling-server.ts +662 -0
- package/src/mcp/security/schema-validator.ts +855 -0
- package/src/mcp/server.ts +657 -0
- package/src/mcp/tool-registry.ts +391 -0
- package/src/mcp/tools/base.ts +399 -0
- package/src/mcp/tools/chaos-resilience/inject.ts +699 -0
- package/src/mcp/tools/code-intelligence/analyze.ts +745 -0
- package/src/mcp/tools/contract-testing/validate.ts +708 -0
- package/src/mcp/tools/coverage-analysis/index.ts +770 -0
- package/src/mcp/tools/defect-intelligence/predict.ts +466 -0
- package/src/mcp/tools/index.ts +214 -0
- package/src/mcp/tools/learning-optimization/optimize.ts +772 -0
- package/src/mcp/tools/quality-assessment/evaluate.ts +385 -0
- package/src/mcp/tools/registry.ts +248 -0
- package/src/mcp/tools/requirements-validation/validate.ts +394 -0
- package/src/mcp/tools/security-compliance/scan.ts +365 -0
- package/src/mcp/tools/test-execution/execute.ts +291 -0
- package/src/mcp/tools/test-generation/generate.ts +544 -0
- package/src/mcp/tools/visual-accessibility/index.ts +791 -0
- package/src/mcp/transport/index.ts +31 -0
- package/src/mcp/transport/stdio.ts +318 -0
- package/src/mcp/types.ts +543 -0
- package/src/neural-optimizer/index.ts +111 -0
- package/src/neural-optimizer/replay-buffer.ts +455 -0
- package/src/neural-optimizer/swarm-topology.ts +508 -0
- package/src/neural-optimizer/topology-optimizer.ts +828 -0
- package/src/neural-optimizer/types.ts +481 -0
- package/src/neural-optimizer/value-network.ts +351 -0
- package/src/optimization/auto-tuner.ts +817 -0
- package/src/optimization/index.ts +77 -0
- package/src/optimization/metric-collectors.ts +474 -0
- package/src/optimization/qe-workers.ts +704 -0
- package/src/optimization/tuning-algorithm.ts +401 -0
- package/src/optimization/types.ts +314 -0
- package/src/routing/index.ts +51 -0
- package/src/routing/qe-agent-registry.ts +963 -0
- package/src/routing/qe-task-router.ts +564 -0
- package/src/routing/routing-feedback.ts +365 -0
- package/src/routing/types.ts +406 -0
- package/src/shared/embeddings/embedding-cache.ts +157 -0
- package/src/shared/embeddings/index.ts +50 -0
- package/src/shared/embeddings/nomic-embedder.ts +404 -0
- package/src/shared/embeddings/ollama-client.ts +195 -0
- package/src/shared/embeddings/types.ts +147 -0
- package/src/shared/entities/agent.ts +141 -0
- package/src/shared/entities/base-entity.ts +79 -0
- package/src/shared/entities/index.ts +6 -0
- package/src/shared/events/domain-events.ts +259 -0
- package/src/shared/events/index.ts +5 -0
- package/src/shared/git/git-analyzer.ts +656 -0
- package/src/shared/git/index.ts +11 -0
- package/src/shared/http/http-client.ts +420 -0
- package/src/shared/http/index.ts +13 -0
- package/src/shared/index.ts +41 -0
- package/src/shared/io/file-reader.ts +525 -0
- package/src/shared/io/index.ts +25 -0
- package/src/shared/llm/cache.ts +473 -0
- package/src/shared/llm/circuit-breaker.ts +369 -0
- package/src/shared/llm/cost-tracker.ts +460 -0
- package/src/shared/llm/index.ts +140 -0
- package/src/shared/llm/interfaces.ts +629 -0
- package/src/shared/llm/provider-manager.ts +685 -0
- package/src/shared/llm/providers/claude.ts +524 -0
- package/src/shared/llm/providers/index.ts +8 -0
- package/src/shared/llm/providers/ollama.ts +575 -0
- package/src/shared/llm/providers/openai.ts +609 -0
- package/src/shared/metrics/code-metrics.ts +520 -0
- package/src/shared/metrics/index.ts +23 -0
- package/src/shared/metrics/system-metrics.ts +353 -0
- package/src/shared/parsers/index.ts +6 -0
- package/src/shared/parsers/typescript-parser.ts +841 -0
- package/src/shared/security/compliance-patterns.ts +666 -0
- package/src/shared/security/index.ts +30 -0
- package/src/shared/security/osv-client.ts +468 -0
- package/src/shared/types/index.ts +150 -0
- package/src/shared/value-objects/index.ts +273 -0
- package/src/strange-loop/healing-controller.ts +833 -0
- package/src/strange-loop/index.ts +104 -0
- package/src/strange-loop/self-model.ts +494 -0
- package/src/strange-loop/strange-loop.ts +446 -0
- package/src/strange-loop/swarm-observer.ts +448 -0
- package/src/strange-loop/topology-analyzer.ts +565 -0
- package/src/strange-loop/types.ts +640 -0
- package/src/time-crystal/default-phases.ts +520 -0
- package/src/time-crystal/index.ts +164 -0
- package/src/time-crystal/oscillator.ts +425 -0
- package/src/time-crystal/phase-executor.ts +521 -0
- package/src/time-crystal/scheduler.ts +1025 -0
- package/src/time-crystal/test-runner.ts +787 -0
- package/src/time-crystal/types.ts +421 -0
- package/src/workers/base-worker.ts +304 -0
- package/src/workers/daemon.ts +264 -0
- package/src/workers/index.ts +119 -0
- package/src/workers/interfaces.ts +393 -0
- package/src/workers/worker-manager.ts +424 -0
- package/src/workers/workers/compliance-checker.ts +445 -0
- package/src/workers/workers/coverage-tracker.ts +344 -0
- package/src/workers/workers/defect-predictor.ts +375 -0
- package/src/workers/workers/flaky-detector.ts +390 -0
- package/src/workers/workers/index.ts +17 -0
- package/src/workers/workers/learning-consolidation.ts +442 -0
- package/src/workers/workers/performance-baseline.ts +434 -0
- package/src/workers/workers/quality-gate.ts +419 -0
- package/src/workers/workers/regression-monitor.ts +357 -0
- package/src/workers/workers/security-scan.ts +349 -0
- package/src/workers/workers/test-health.ts +359 -0
- package/tests/integration/code-intelligence/knowledge-graph-real.test.ts +540 -0
- package/tests/integration/coordination/cross-domain-router.test.ts +403 -0
- package/tests/integration/coordination/protocol-executor.test.ts +454 -0
- package/tests/integration/coordination/workflow-orchestrator.test.ts +418 -0
- package/tests/integration/feedback/feedback-loop-integration.test.ts +560 -0
- package/tests/integration/migration/v2-to-v3-migration.test.ts +471 -0
- package/tests/integration/parsers/typescript-parser.test.ts +463 -0
- package/tests/integration/security/vulnerability-detection.test.ts +628 -0
- package/tests/integration/test-execution/coordinator.test.ts +410 -0
- package/tests/integration/test-generation/coordinator.test.ts +361 -0
- package/tests/mocks/index.ts +228 -0
- package/tests/time-crystal/default-phases.test.ts +476 -0
- package/tests/time-crystal/oscillator.test.ts +541 -0
- package/tests/time-crystal/phase-executor.test.ts +653 -0
- package/tests/time-crystal/scheduler.test.ts +626 -0
- package/tests/time-crystal/test-runner.test.ts +594 -0
- package/tests/unit/causal-discovery/causal-graph.test.ts +504 -0
- package/tests/unit/causal-discovery/causal-root-cause-analyzer.test.ts +347 -0
- package/tests/unit/causal-discovery/discovery-engine.test.ts +435 -0
- package/tests/unit/causal-discovery/weight-matrix.test.ts +328 -0
- package/tests/unit/cli/cli.test.ts +341 -0
- package/tests/unit/cli/commands.test.ts +414 -0
- package/tests/unit/cli/init-command.test.ts +274 -0
- package/tests/unit/cli/migrate-command.test.ts +396 -0
- package/tests/unit/coordination/claims/claim-service.test.ts +949 -0
- package/tests/unit/coordination/claims/handoff-manager.test.ts +773 -0
- package/tests/unit/coordination/claims/work-stealing.test.ts +492 -0
- package/tests/unit/coordination/queen-coordinator.test.ts +966 -0
- package/tests/unit/coordination/result-saver.test.ts +653 -0
- package/tests/unit/coordination/task-executor.test.ts +810 -0
- package/tests/unit/domains/chaos-resilience/chaos-engineer.test.ts +484 -0
- package/tests/unit/domains/chaos-resilience/load-tester.test.ts +559 -0
- package/tests/unit/domains/chaos-resilience/performance-profiler.test.ts +490 -0
- package/tests/unit/domains/code-intelligence/impact-analyzer.test.ts +560 -0
- package/tests/unit/domains/code-intelligence/knowledge-graph.test.ts +460 -0
- package/tests/unit/domains/code-intelligence/semantic-analyzer.test.ts +584 -0
- package/tests/unit/domains/contract-testing/api-compatibility.test.ts +483 -0
- package/tests/unit/domains/contract-testing/contract-validator.test.ts +370 -0
- package/tests/unit/domains/contract-testing/schema-validator.test.ts +610 -0
- package/tests/unit/domains/coverage-analysis/coverage-embedder.test.ts +298 -0
- package/tests/unit/domains/coverage-analysis/hnsw-index.test.ts +292 -0
- package/tests/unit/domains/coverage-analysis/sublinear-analyzer.test.ts +506 -0
- package/tests/unit/domains/defect-intelligence/defect-predictor.test.ts +370 -0
- package/tests/unit/domains/defect-intelligence/pattern-learner.test.ts +546 -0
- package/tests/unit/domains/defect-intelligence/root-cause-analyzer.test.ts +534 -0
- package/tests/unit/domains/learning-optimization/learning-coordinator.test.ts +541 -0
- package/tests/unit/domains/learning-optimization/metrics-optimizer.test.ts +552 -0
- package/tests/unit/domains/learning-optimization/production-intel.test.ts +589 -0
- package/tests/unit/domains/learning-optimization/transfer-specialist.test.ts +453 -0
- package/tests/unit/domains/quality-assessment/coherence-gate.test.ts +1006 -0
- package/tests/unit/domains/quality-assessment/deployment-advisor.test.ts +515 -0
- package/tests/unit/domains/quality-assessment/quality-analyzer.test.ts +401 -0
- package/tests/unit/domains/quality-assessment/quality-gate.test.ts +324 -0
- package/tests/unit/domains/requirements-validation/bdd-scenario-writer.test.ts +479 -0
- package/tests/unit/domains/requirements-validation/requirements-validator.test.ts +452 -0
- package/tests/unit/domains/requirements-validation/testability-scorer.test.ts +505 -0
- package/tests/unit/domains/security-compliance/compliance-validator.test.ts +500 -0
- package/tests/unit/domains/security-compliance/security-auditor.test.ts +498 -0
- package/tests/unit/domains/security-compliance/security-scanner.test.ts +412 -0
- package/tests/unit/domains/visual-accessibility/accessibility-tester.test.ts +432 -0
- package/tests/unit/domains/visual-accessibility/responsive-tester.test.ts +506 -0
- package/tests/unit/domains/visual-accessibility/visual-tester.test.ts +412 -0
- package/tests/unit/early-exit/early-exit-controller.test.ts +548 -0
- package/tests/unit/early-exit/early-exit-decision.test.ts +617 -0
- package/tests/unit/early-exit/index.test.ts +254 -0
- package/tests/unit/early-exit/quality-signal.test.ts +589 -0
- package/tests/unit/early-exit/speculative-executor.test.ts +453 -0
- package/tests/unit/feedback/coverage-learner.test.ts +288 -0
- package/tests/unit/feedback/feedback-loop.test.ts +458 -0
- package/tests/unit/feedback/pattern-promotion.test.ts +390 -0
- package/tests/unit/feedback/quality-score-calculator.test.ts +364 -0
- package/tests/unit/feedback/test-outcome-tracker.test.ts +243 -0
- package/tests/unit/init/init-wizard.test.ts +881 -0
- package/tests/unit/init/project-analyzer.test.ts +807 -0
- package/tests/unit/init/self-configurator.test.ts +493 -0
- package/tests/unit/integrations/ruvector/ast-complexity.test.ts +240 -0
- package/tests/unit/integrations/ruvector/coverage-router.test.ts +366 -0
- package/tests/unit/integrations/ruvector/diff-risk-classifier.test.ts +340 -0
- package/tests/unit/integrations/ruvector/graph-boundaries.test.ts +355 -0
- package/tests/unit/integrations/ruvector/q-learning-router.test.ts +314 -0
- package/tests/unit/kernel/agent-coordinator.test.ts +220 -0
- package/tests/unit/kernel/event-bus.test.ts +197 -0
- package/tests/unit/learning/qe-reasoning-bank.test.ts +666 -0
- package/tests/unit/learning/real-qe-reasoning-bank.benchmark.test.ts +415 -0
- package/tests/unit/mcp/mcp-server.test.ts +544 -0
- package/tests/unit/mcp/metrics/metrics-collector.test.ts +340 -0
- package/tests/unit/mcp/security/cve-prevention.test.ts +512 -0
- package/tests/unit/mcp/security/oauth21-provider.test.ts +624 -0
- package/tests/unit/mcp/security/rate-limiter.test.ts +410 -0
- package/tests/unit/mcp/security/sampling-server.test.ts +420 -0
- package/tests/unit/mcp/security/schema-validator.test.ts +494 -0
- package/tests/unit/mcp/tools/base.test.ts +336 -0
- package/tests/unit/mcp/tools/domain-tools.test.ts +759 -0
- package/tests/unit/mcp/tools/registry.test.ts +240 -0
- package/tests/unit/neural-optimizer/replay-buffer.test.ts +403 -0
- package/tests/unit/neural-optimizer/swarm-topology.test.ts +473 -0
- package/tests/unit/neural-optimizer/topology-optimizer.test.ts +595 -0
- package/tests/unit/neural-optimizer/value-network.test.ts +343 -0
- package/tests/unit/optimization/auto-tuner.test.ts +506 -0
- package/tests/unit/optimization/metric-collectors.test.ts +352 -0
- package/tests/unit/optimization/qe-workers.test.ts +407 -0
- package/tests/unit/optimization/tuning-algorithm.test.ts +467 -0
- package/tests/unit/routing/qe-agent-registry.test.ts +229 -0
- package/tests/unit/routing/qe-task-router.test.ts +390 -0
- package/tests/unit/routing/routing-feedback.test.ts +339 -0
- package/tests/unit/shared/embeddings/nomic-embedder.test.ts +419 -0
- package/tests/unit/shared/http/http-client.test.ts +719 -0
- package/tests/unit/shared/io/file-reader.test.ts +511 -0
- package/tests/unit/shared/llm/cache.test.ts +391 -0
- package/tests/unit/shared/llm/circuit-breaker.test.ts +293 -0
- package/tests/unit/shared/llm/cost-tracker.test.ts +431 -0
- package/tests/unit/shared/llm/provider-manager.test.ts +550 -0
- package/tests/unit/shared/llm/providers.test.ts +532 -0
- package/tests/unit/shared/parsers/typescript-parser.test.ts +693 -0
- package/tests/unit/shared/value-objects.test.ts +184 -0
- package/tests/unit/strange-loop/strange-loop.test.ts +1170 -0
- package/tests/unit/workers/base-worker.test.ts +341 -0
- package/tests/unit/workers/daemon.test.ts +291 -0
- package/tests/unit/workers/worker-manager.test.ts +284 -0
- package/tsconfig.json +32 -0
- package/vitest.config.ts +27 -0
|
@@ -0,0 +1,1763 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Security Auditor Service
|
|
3
|
+
* Provides comprehensive security audit functionality
|
|
4
|
+
*/
|
|
5
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
6
|
+
import * as fs from 'fs/promises';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import { ok, err } from '../../../shared/types/index.js';
|
|
9
|
+
async function httpPost(url, body) {
|
|
10
|
+
const response = await fetch(url, {
|
|
11
|
+
method: 'POST',
|
|
12
|
+
headers: {
|
|
13
|
+
'Content-Type': 'application/json',
|
|
14
|
+
},
|
|
15
|
+
body: JSON.stringify(body),
|
|
16
|
+
});
|
|
17
|
+
const data = await response.json();
|
|
18
|
+
return {
|
|
19
|
+
ok: response.ok,
|
|
20
|
+
status: response.status,
|
|
21
|
+
data,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
async function httpGet(url) {
|
|
25
|
+
const response = await fetch(url, {
|
|
26
|
+
method: 'GET',
|
|
27
|
+
headers: {
|
|
28
|
+
'Accept': 'application/json',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const data = await response.json();
|
|
32
|
+
return {
|
|
33
|
+
ok: response.ok,
|
|
34
|
+
status: response.status,
|
|
35
|
+
data,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const DEFAULT_CONFIG = {
|
|
39
|
+
secretPatterns: [
|
|
40
|
+
/(?:api[_-]?key|apikey)['":\s]*['"=]?\s*['"]?([a-zA-Z0-9_\-]{20,})['"]?/gi,
|
|
41
|
+
/(?:password|passwd|pwd)['":\s]*['"=]?\s*['"]?([^\s'"]{8,})['"]?/gi,
|
|
42
|
+
/(?:secret|token)['":\s]*['"=]?\s*['"]?([a-zA-Z0-9_\-]{16,})['"]?/gi,
|
|
43
|
+
/(?:aws[_-]?access[_-]?key|aws[_-]?secret)['":\s]*['"=]?\s*['"]?([A-Z0-9]{20,})['"]?/gi,
|
|
44
|
+
/-----BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY-----/gi,
|
|
45
|
+
/ghp_[a-zA-Z0-9]{36}/g, // GitHub personal access token
|
|
46
|
+
/gho_[a-zA-Z0-9]{36}/g, // GitHub OAuth access token
|
|
47
|
+
/sk-[a-zA-Z0-9]{48}/g, // OpenAI API key
|
|
48
|
+
],
|
|
49
|
+
excludePatterns: ['node_modules', 'dist', 'build', '.git', '*.test.*', '*.spec.*'],
|
|
50
|
+
maxFileSizeKb: 1024,
|
|
51
|
+
enableHistoricalAnalysis: true,
|
|
52
|
+
riskThreshold: 0.7,
|
|
53
|
+
};
|
|
54
|
+
// ============================================================================
|
|
55
|
+
// Security Auditor Service Implementation
|
|
56
|
+
// ============================================================================
|
|
57
|
+
export class SecurityAuditorService {
|
|
58
|
+
memory;
|
|
59
|
+
config;
|
|
60
|
+
constructor(memory, config = {}) {
|
|
61
|
+
this.memory = memory;
|
|
62
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
63
|
+
}
|
|
64
|
+
// ==========================================================================
|
|
65
|
+
// IDependencySecurityService Implementation
|
|
66
|
+
// ==========================================================================
|
|
67
|
+
/**
|
|
68
|
+
* Scan dependencies for vulnerabilities
|
|
69
|
+
*/
|
|
70
|
+
async scanDependencies(manifestPath) {
|
|
71
|
+
try {
|
|
72
|
+
const manifest = manifestPath.value;
|
|
73
|
+
const ecosystem = this.detectEcosystem(manifest);
|
|
74
|
+
if (!ecosystem) {
|
|
75
|
+
return err(new Error(`Unknown manifest format: ${manifest}`));
|
|
76
|
+
}
|
|
77
|
+
const vulnerabilities = [];
|
|
78
|
+
const outdatedPackages = [];
|
|
79
|
+
// Parse dependencies from manifest file
|
|
80
|
+
const dependencies = await this.parseDependencies(manifest, ecosystem);
|
|
81
|
+
for (const dep of dependencies) {
|
|
82
|
+
// Check for known vulnerabilities
|
|
83
|
+
const vulns = await this.checkDependencyVulnerabilities(dep, ecosystem);
|
|
84
|
+
vulnerabilities.push(...vulns);
|
|
85
|
+
// Check for outdated packages
|
|
86
|
+
const outdated = await this.checkOutdated(dep);
|
|
87
|
+
if (outdated) {
|
|
88
|
+
outdatedPackages.push(outdated);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const summary = this.createDependencySummary(vulnerabilities, dependencies.length);
|
|
92
|
+
// Store results
|
|
93
|
+
await this.memory.set(`security:deps:${manifestPath.filename}`, { vulnerabilities, outdatedPackages, summary }, { namespace: 'security-compliance', ttl: 86400 } // 24 hours
|
|
94
|
+
);
|
|
95
|
+
return ok({
|
|
96
|
+
vulnerabilities,
|
|
97
|
+
outdatedPackages,
|
|
98
|
+
summary,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Check specific package for security issues
|
|
107
|
+
*/
|
|
108
|
+
async checkPackage(name, version, ecosystem) {
|
|
109
|
+
try {
|
|
110
|
+
// Query OSV vulnerability database
|
|
111
|
+
const vulnerabilities = await this.queryVulnerabilityDatabase(name, version, ecosystem);
|
|
112
|
+
const latestVersion = await this.getLatestVersion(name, ecosystem);
|
|
113
|
+
const isDeprecated = await this.checkDeprecation(name, ecosystem);
|
|
114
|
+
return ok({
|
|
115
|
+
name,
|
|
116
|
+
version,
|
|
117
|
+
vulnerabilities,
|
|
118
|
+
latestVersion,
|
|
119
|
+
isDeprecated,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Get upgrade recommendations for vulnerabilities
|
|
128
|
+
*/
|
|
129
|
+
async getUpgradeRecommendations(vulnerabilities) {
|
|
130
|
+
try {
|
|
131
|
+
const recommendations = [];
|
|
132
|
+
// Group vulnerabilities by package
|
|
133
|
+
const byPackage = new Map();
|
|
134
|
+
for (const vuln of vulnerabilities) {
|
|
135
|
+
const dep = vuln.location.dependency;
|
|
136
|
+
if (dep) {
|
|
137
|
+
const key = `${dep.ecosystem}:${dep.name}`;
|
|
138
|
+
const existing = byPackage.get(key) || [];
|
|
139
|
+
existing.push(vuln);
|
|
140
|
+
byPackage.set(key, existing);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Generate recommendations for each package
|
|
144
|
+
for (const [key, vulns] of byPackage) {
|
|
145
|
+
const [ecosystem, name] = key.split(':');
|
|
146
|
+
const currentVersion = vulns[0].location.dependency?.version || 'unknown';
|
|
147
|
+
const latestVersion = await this.getLatestVersion(name, ecosystem);
|
|
148
|
+
const fixedVersions = vulns
|
|
149
|
+
.filter((v) => v.id)
|
|
150
|
+
.map((v) => v.id);
|
|
151
|
+
recommendations.push({
|
|
152
|
+
package: name,
|
|
153
|
+
fromVersion: currentVersion,
|
|
154
|
+
toVersion: latestVersion,
|
|
155
|
+
fixesVulnerabilities: fixedVersions,
|
|
156
|
+
breakingChanges: this.hasBreakingChanges(currentVersion, latestVersion),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
// Sort by number of vulnerabilities fixed
|
|
160
|
+
recommendations.sort((a, b) => b.fixesVulnerabilities.length - a.fixesVulnerabilities.length);
|
|
161
|
+
return ok(recommendations);
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// ==========================================================================
|
|
168
|
+
// Audit Functionality
|
|
169
|
+
// ==========================================================================
|
|
170
|
+
/**
|
|
171
|
+
* Run comprehensive security audit
|
|
172
|
+
*/
|
|
173
|
+
async runAudit(options) {
|
|
174
|
+
const auditId = uuidv4();
|
|
175
|
+
const timestamp = new Date();
|
|
176
|
+
try {
|
|
177
|
+
let sastResults;
|
|
178
|
+
let dastResults;
|
|
179
|
+
let dependencyResults;
|
|
180
|
+
let secretScanResults;
|
|
181
|
+
// Note: Actual SAST/DAST scanning would be delegated to SecurityScannerService
|
|
182
|
+
// This is orchestration-level code that combines results
|
|
183
|
+
if (options.includeSAST) {
|
|
184
|
+
// SAST scanning delegated to SecurityScannerService
|
|
185
|
+
sastResults = await this.performSASTScan();
|
|
186
|
+
}
|
|
187
|
+
if (options.includeDAST && options.targetUrl) {
|
|
188
|
+
// DAST scanning delegated to SecurityScannerService
|
|
189
|
+
dastResults = await this.performDASTScan(options.targetUrl);
|
|
190
|
+
}
|
|
191
|
+
if (options.includeDependencies) {
|
|
192
|
+
// Scan package manifests for vulnerabilities
|
|
193
|
+
dependencyResults = await this.performDependencyScan();
|
|
194
|
+
}
|
|
195
|
+
if (options.includeSecrets) {
|
|
196
|
+
// Scan source files for secrets
|
|
197
|
+
secretScanResults = await this.performSecretScan();
|
|
198
|
+
}
|
|
199
|
+
// Calculate overall risk score
|
|
200
|
+
const overallRiskScore = this.calculateOverallRisk(sastResults, dastResults, dependencyResults, secretScanResults);
|
|
201
|
+
// Generate recommendations
|
|
202
|
+
const recommendations = this.generateRecommendations(sastResults, dastResults, dependencyResults, secretScanResults);
|
|
203
|
+
const report = {
|
|
204
|
+
auditId,
|
|
205
|
+
timestamp,
|
|
206
|
+
sastResults,
|
|
207
|
+
dastResults,
|
|
208
|
+
dependencyResults,
|
|
209
|
+
secretScanResults,
|
|
210
|
+
overallRiskScore,
|
|
211
|
+
recommendations,
|
|
212
|
+
};
|
|
213
|
+
// Store audit report
|
|
214
|
+
await this.memory.set(`security:audit:${auditId}`, report, { namespace: 'security-compliance', persist: true });
|
|
215
|
+
return ok(report);
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Scan for secrets in code
|
|
223
|
+
*/
|
|
224
|
+
async scanSecrets(files) {
|
|
225
|
+
try {
|
|
226
|
+
const secretsFound = [];
|
|
227
|
+
let filesScanned = 0;
|
|
228
|
+
for (const file of files) {
|
|
229
|
+
// Skip excluded patterns
|
|
230
|
+
if (this.shouldExclude(file.value)) {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
filesScanned++;
|
|
234
|
+
// Read and scan file for secrets using regex patterns
|
|
235
|
+
const secrets = await this.scanFileForSecrets(file);
|
|
236
|
+
secretsFound.push(...secrets);
|
|
237
|
+
}
|
|
238
|
+
return ok({
|
|
239
|
+
secretsFound,
|
|
240
|
+
filesScanned,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Get security posture summary
|
|
249
|
+
*/
|
|
250
|
+
async getSecurityPosture() {
|
|
251
|
+
try {
|
|
252
|
+
// Get historical audit data
|
|
253
|
+
const audits = await this.getRecentAudits();
|
|
254
|
+
// Calculate metrics
|
|
255
|
+
const latestAudit = audits[0];
|
|
256
|
+
const previousAudit = audits[1];
|
|
257
|
+
const criticalIssues = this.countBySeverity(latestAudit, 'critical');
|
|
258
|
+
const highIssues = this.countBySeverity(latestAudit, 'high');
|
|
259
|
+
const openVulnerabilities = this.countOpenVulnerabilities(latestAudit);
|
|
260
|
+
// Calculate trend
|
|
261
|
+
const trend = this.calculateTrend(latestAudit, previousAudit);
|
|
262
|
+
// Calculate overall score (0-100)
|
|
263
|
+
const overallScore = this.calculatePostureScore(criticalIssues, highIssues, openVulnerabilities);
|
|
264
|
+
// Generate recommendations
|
|
265
|
+
const recommendations = this.generatePostureRecommendations(criticalIssues, highIssues, overallScore);
|
|
266
|
+
return ok({
|
|
267
|
+
overallScore,
|
|
268
|
+
trend,
|
|
269
|
+
criticalIssues,
|
|
270
|
+
highIssues,
|
|
271
|
+
openVulnerabilities,
|
|
272
|
+
resolvedLastWeek: await this.countResolvedLastWeek(),
|
|
273
|
+
averageResolutionTime: await this.calculateAverageResolutionTime(),
|
|
274
|
+
lastAuditDate: latestAudit?.timestamp ?? new Date(),
|
|
275
|
+
recommendations,
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Triage vulnerabilities by priority
|
|
284
|
+
*/
|
|
285
|
+
async triageVulnerabilities(vulnerabilities) {
|
|
286
|
+
try {
|
|
287
|
+
const triaged = {
|
|
288
|
+
immediate: [],
|
|
289
|
+
shortTerm: [],
|
|
290
|
+
mediumTerm: [],
|
|
291
|
+
longTerm: [],
|
|
292
|
+
accepted: [],
|
|
293
|
+
};
|
|
294
|
+
for (const vuln of vulnerabilities) {
|
|
295
|
+
const bucket = this.determinePriorityBucket(vuln);
|
|
296
|
+
triaged[bucket].push(vuln);
|
|
297
|
+
}
|
|
298
|
+
// Sort each bucket by severity
|
|
299
|
+
const severityOrder = ['critical', 'high', 'medium', 'low', 'informational'];
|
|
300
|
+
for (const bucket of Object.values(triaged)) {
|
|
301
|
+
bucket.sort((a, b) => severityOrder.indexOf(a.severity) - severityOrder.indexOf(b.severity));
|
|
302
|
+
}
|
|
303
|
+
return ok(triaged);
|
|
304
|
+
}
|
|
305
|
+
catch (error) {
|
|
306
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
// ==========================================================================
|
|
310
|
+
// Private Helper Methods
|
|
311
|
+
// ==========================================================================
|
|
312
|
+
detectEcosystem(manifest) {
|
|
313
|
+
if (manifest.includes('package.json'))
|
|
314
|
+
return 'npm';
|
|
315
|
+
if (manifest.includes('requirements.txt') || manifest.includes('Pipfile'))
|
|
316
|
+
return 'pip';
|
|
317
|
+
if (manifest.includes('pom.xml') || manifest.includes('build.gradle'))
|
|
318
|
+
return 'maven';
|
|
319
|
+
if (manifest.includes('Cargo.toml'))
|
|
320
|
+
return 'cargo';
|
|
321
|
+
if (manifest.includes('.csproj') || manifest.includes('packages.config'))
|
|
322
|
+
return 'nuget';
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
async parseDependencies(manifest, ecosystem) {
|
|
326
|
+
const dependencies = [];
|
|
327
|
+
try {
|
|
328
|
+
if (ecosystem === 'npm') {
|
|
329
|
+
// Read and parse package.json
|
|
330
|
+
const content = await fs.readFile(manifest, 'utf-8');
|
|
331
|
+
const packageJson = JSON.parse(content);
|
|
332
|
+
// Collect all dependency types
|
|
333
|
+
const allDeps = {
|
|
334
|
+
...packageJson.dependencies,
|
|
335
|
+
...packageJson.devDependencies,
|
|
336
|
+
...packageJson.peerDependencies,
|
|
337
|
+
...packageJson.optionalDependencies,
|
|
338
|
+
};
|
|
339
|
+
// Convert to DependencyInfo array
|
|
340
|
+
for (const [name, versionSpec] of Object.entries(allDeps)) {
|
|
341
|
+
// Clean version specifiers (^, ~, >=, etc.)
|
|
342
|
+
const version = this.cleanVersionSpec(versionSpec);
|
|
343
|
+
dependencies.push({ name, version, ecosystem: 'npm' });
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
else if (ecosystem === 'pip') {
|
|
347
|
+
// Parse requirements.txt or Pipfile
|
|
348
|
+
const content = await fs.readFile(manifest, 'utf-8');
|
|
349
|
+
const lines = content.split('\n');
|
|
350
|
+
for (const line of lines) {
|
|
351
|
+
const trimmed = line.trim();
|
|
352
|
+
// Skip comments and empty lines
|
|
353
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
354
|
+
continue;
|
|
355
|
+
// Parse package==version or package>=version patterns
|
|
356
|
+
const match = trimmed.match(/^([a-zA-Z0-9_-]+)(?:[=<>~!]+(.+))?$/);
|
|
357
|
+
if (match) {
|
|
358
|
+
dependencies.push({
|
|
359
|
+
name: match[1],
|
|
360
|
+
version: match[2] || 'latest',
|
|
361
|
+
ecosystem: 'pip',
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
// Additional ecosystems (maven, cargo, nuget) would be implemented similarly
|
|
367
|
+
}
|
|
368
|
+
catch (error) {
|
|
369
|
+
// If file reading fails, return empty array rather than throwing
|
|
370
|
+
console.error(`Failed to parse dependencies from ${manifest}:`, error);
|
|
371
|
+
}
|
|
372
|
+
return dependencies;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Clean version specifier to extract actual version
|
|
376
|
+
*/
|
|
377
|
+
cleanVersionSpec(versionSpec) {
|
|
378
|
+
// Remove leading specifiers like ^, ~, >=, <=, >, <, =
|
|
379
|
+
return versionSpec.replace(/^[\^~>=<]+/, '').trim();
|
|
380
|
+
}
|
|
381
|
+
async checkDependencyVulnerabilities(dep, ecosystem) {
|
|
382
|
+
const vulnerabilities = [];
|
|
383
|
+
try {
|
|
384
|
+
// Map ecosystem to OSV ecosystem name
|
|
385
|
+
const osvEcosystem = this.mapToOSVEcosystem(ecosystem);
|
|
386
|
+
// Query OSV API for vulnerabilities
|
|
387
|
+
const osvQuery = {
|
|
388
|
+
package: {
|
|
389
|
+
name: dep.name,
|
|
390
|
+
ecosystem: osvEcosystem,
|
|
391
|
+
},
|
|
392
|
+
version: dep.version,
|
|
393
|
+
};
|
|
394
|
+
const response = await httpPost('https://api.osv.dev/v1/query', osvQuery);
|
|
395
|
+
if (response.ok && response.data.vulns && response.data.vulns.length > 0) {
|
|
396
|
+
for (const osvVuln of response.data.vulns) {
|
|
397
|
+
const vulnerability = this.mapOSVVulnerability(osvVuln, dep);
|
|
398
|
+
vulnerabilities.push(vulnerability);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
catch (error) {
|
|
403
|
+
// Log error but don't fail the entire scan
|
|
404
|
+
console.error(`Failed to check vulnerabilities for ${dep.name}@${dep.version}:`, error);
|
|
405
|
+
}
|
|
406
|
+
return vulnerabilities;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Map internal ecosystem to OSV ecosystem name
|
|
410
|
+
*/
|
|
411
|
+
mapToOSVEcosystem(ecosystem) {
|
|
412
|
+
const ecosystemMap = {
|
|
413
|
+
npm: 'npm',
|
|
414
|
+
pip: 'PyPI',
|
|
415
|
+
maven: 'Maven',
|
|
416
|
+
nuget: 'NuGet',
|
|
417
|
+
cargo: 'crates.io',
|
|
418
|
+
};
|
|
419
|
+
return ecosystemMap[ecosystem];
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Map OSV vulnerability to our Vulnerability type
|
|
423
|
+
*/
|
|
424
|
+
mapOSVVulnerability(osvVuln, dep) {
|
|
425
|
+
// Extract CVE ID from aliases
|
|
426
|
+
const cveId = osvVuln.aliases?.find((alias) => alias.startsWith('CVE-'));
|
|
427
|
+
// Determine severity from OSV severity scores
|
|
428
|
+
const severity = this.mapOSVSeverity(osvVuln.severity);
|
|
429
|
+
// Extract fixed version from affected ranges
|
|
430
|
+
const fixedVersion = this.extractFixedVersion(osvVuln);
|
|
431
|
+
// Build references list
|
|
432
|
+
const references = osvVuln.references?.map((ref) => ref.url) || [];
|
|
433
|
+
const location = {
|
|
434
|
+
file: 'package.json',
|
|
435
|
+
dependency: dep,
|
|
436
|
+
};
|
|
437
|
+
const remediation = {
|
|
438
|
+
description: fixedVersion
|
|
439
|
+
? `Upgrade ${dep.name} to version ${fixedVersion} or higher`
|
|
440
|
+
: `Review and address vulnerability in ${dep.name}`,
|
|
441
|
+
fixExample: fixedVersion ? `"${dep.name}": "^${fixedVersion}"` : undefined,
|
|
442
|
+
estimatedEffort: fixedVersion ? 'trivial' : 'moderate',
|
|
443
|
+
automatable: !!fixedVersion,
|
|
444
|
+
};
|
|
445
|
+
return {
|
|
446
|
+
id: uuidv4(),
|
|
447
|
+
cveId,
|
|
448
|
+
title: osvVuln.summary || `Vulnerability in ${dep.name}`,
|
|
449
|
+
description: osvVuln.details || osvVuln.summary || 'No description available',
|
|
450
|
+
severity,
|
|
451
|
+
category: this.categorizeVulnerability(osvVuln),
|
|
452
|
+
location,
|
|
453
|
+
remediation,
|
|
454
|
+
references,
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Map OSV severity to our severity levels
|
|
459
|
+
*/
|
|
460
|
+
mapOSVSeverity(severityScores) {
|
|
461
|
+
if (!severityScores || severityScores.length === 0) {
|
|
462
|
+
return 'medium'; // Default to medium if no severity info
|
|
463
|
+
}
|
|
464
|
+
// Find CVSS score
|
|
465
|
+
const cvssScore = severityScores.find((s) => s.type === 'CVSS_V3' || s.type === 'CVSS_V2');
|
|
466
|
+
if (cvssScore) {
|
|
467
|
+
const score = parseFloat(cvssScore.score);
|
|
468
|
+
if (score >= 9.0)
|
|
469
|
+
return 'critical';
|
|
470
|
+
if (score >= 7.0)
|
|
471
|
+
return 'high';
|
|
472
|
+
if (score >= 4.0)
|
|
473
|
+
return 'medium';
|
|
474
|
+
if (score > 0)
|
|
475
|
+
return 'low';
|
|
476
|
+
}
|
|
477
|
+
return 'medium';
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Extract fixed version from OSV vulnerability data
|
|
481
|
+
*/
|
|
482
|
+
extractFixedVersion(osvVuln) {
|
|
483
|
+
if (!osvVuln.affected)
|
|
484
|
+
return undefined;
|
|
485
|
+
for (const affected of osvVuln.affected) {
|
|
486
|
+
if (affected.ranges) {
|
|
487
|
+
for (const range of affected.ranges) {
|
|
488
|
+
if (range.events) {
|
|
489
|
+
const fixedEvent = range.events.find((event) => event.fixed);
|
|
490
|
+
if (fixedEvent?.fixed) {
|
|
491
|
+
return fixedEvent.fixed;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
return undefined;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Categorize vulnerability based on OSV data
|
|
501
|
+
*/
|
|
502
|
+
categorizeVulnerability(osvVuln) {
|
|
503
|
+
const summary = (osvVuln.summary || '').toLowerCase();
|
|
504
|
+
const details = (osvVuln.details || '').toLowerCase();
|
|
505
|
+
const combined = `${summary} ${details}`;
|
|
506
|
+
// Check for common vulnerability patterns
|
|
507
|
+
if (combined.includes('injection') || combined.includes('sql')) {
|
|
508
|
+
return 'injection';
|
|
509
|
+
}
|
|
510
|
+
if (combined.includes('xss') || combined.includes('cross-site scripting')) {
|
|
511
|
+
return 'xss';
|
|
512
|
+
}
|
|
513
|
+
if (combined.includes('authentication') || combined.includes('auth bypass')) {
|
|
514
|
+
return 'broken-auth';
|
|
515
|
+
}
|
|
516
|
+
if (combined.includes('sensitive data') || combined.includes('exposure')) {
|
|
517
|
+
return 'sensitive-data';
|
|
518
|
+
}
|
|
519
|
+
if (combined.includes('xxe') || combined.includes('xml external')) {
|
|
520
|
+
return 'xxe';
|
|
521
|
+
}
|
|
522
|
+
if (combined.includes('access control') || combined.includes('authorization')) {
|
|
523
|
+
return 'access-control';
|
|
524
|
+
}
|
|
525
|
+
if (combined.includes('deseriali')) {
|
|
526
|
+
return 'insecure-deserialization';
|
|
527
|
+
}
|
|
528
|
+
if (combined.includes('prototype pollution') || combined.includes('dependency')) {
|
|
529
|
+
return 'vulnerable-components';
|
|
530
|
+
}
|
|
531
|
+
// Default to vulnerable-components for dependency vulnerabilities
|
|
532
|
+
return 'vulnerable-components';
|
|
533
|
+
}
|
|
534
|
+
async checkOutdated(dep) {
|
|
535
|
+
// Check if package is outdated by comparing with latest version from registry
|
|
536
|
+
const latestVersion = await this.getLatestVersion(dep.name, dep.ecosystem);
|
|
537
|
+
if (latestVersion !== dep.version) {
|
|
538
|
+
return {
|
|
539
|
+
name: dep.name,
|
|
540
|
+
currentVersion: dep.version,
|
|
541
|
+
latestVersion,
|
|
542
|
+
updateType: this.determineUpdateType(dep.version, latestVersion),
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
return null;
|
|
546
|
+
}
|
|
547
|
+
async queryVulnerabilityDatabase(name, version, ecosystem) {
|
|
548
|
+
// Query OSV API for vulnerabilities
|
|
549
|
+
const dep = { name, version, ecosystem };
|
|
550
|
+
return this.checkDependencyVulnerabilities(dep, ecosystem);
|
|
551
|
+
}
|
|
552
|
+
async getLatestVersion(name, ecosystem) {
|
|
553
|
+
try {
|
|
554
|
+
if (ecosystem === 'npm') {
|
|
555
|
+
// Query npm registry for latest version
|
|
556
|
+
const response = await httpGet(`https://registry.npmjs.org/${encodeURIComponent(name)}/latest`);
|
|
557
|
+
if (response.ok && response.data.version) {
|
|
558
|
+
return response.data.version;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
else if (ecosystem === 'pip') {
|
|
562
|
+
// Query PyPI for latest version
|
|
563
|
+
const response = await httpGet(`https://pypi.org/pypi/${encodeURIComponent(name)}/json`);
|
|
564
|
+
if (response.ok && response.data.info?.version) {
|
|
565
|
+
return response.data.info.version;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
// Additional registries (Maven, NuGet, Cargo) would be implemented similarly
|
|
569
|
+
}
|
|
570
|
+
catch (error) {
|
|
571
|
+
console.error(`Failed to get latest version for ${name}:`, error);
|
|
572
|
+
}
|
|
573
|
+
return 'unknown';
|
|
574
|
+
}
|
|
575
|
+
async checkDeprecation(name, ecosystem) {
|
|
576
|
+
try {
|
|
577
|
+
if (ecosystem === 'npm') {
|
|
578
|
+
// Query npm registry for deprecation notice
|
|
579
|
+
const response = await httpGet(`https://registry.npmjs.org/${encodeURIComponent(name)}/latest`);
|
|
580
|
+
if (response.ok && response.data.deprecated) {
|
|
581
|
+
return true;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
// Additional registries would be implemented similarly
|
|
585
|
+
}
|
|
586
|
+
catch (error) {
|
|
587
|
+
console.error(`Failed to check deprecation for ${name}:`, error);
|
|
588
|
+
}
|
|
589
|
+
return false;
|
|
590
|
+
}
|
|
591
|
+
determineUpdateType(current, latest) {
|
|
592
|
+
const currentParts = current.split('.').map(Number);
|
|
593
|
+
const latestParts = latest.split('.').map(Number);
|
|
594
|
+
if (latestParts[0] > currentParts[0])
|
|
595
|
+
return 'major';
|
|
596
|
+
if (latestParts[1] > currentParts[1])
|
|
597
|
+
return 'minor';
|
|
598
|
+
return 'patch';
|
|
599
|
+
}
|
|
600
|
+
hasBreakingChanges(current, latest) {
|
|
601
|
+
const currentMajor = parseInt(current.split('.')[0]);
|
|
602
|
+
const latestMajor = parseInt(latest.split('.')[0]);
|
|
603
|
+
return latestMajor > currentMajor;
|
|
604
|
+
}
|
|
605
|
+
createDependencySummary(vulnerabilities, totalDeps) {
|
|
606
|
+
// Count vulnerabilities by severity
|
|
607
|
+
let critical = 0;
|
|
608
|
+
let high = 0;
|
|
609
|
+
let medium = 0;
|
|
610
|
+
let low = 0;
|
|
611
|
+
let informational = 0;
|
|
612
|
+
for (const vuln of vulnerabilities) {
|
|
613
|
+
switch (vuln.severity) {
|
|
614
|
+
case 'critical':
|
|
615
|
+
critical++;
|
|
616
|
+
break;
|
|
617
|
+
case 'high':
|
|
618
|
+
high++;
|
|
619
|
+
break;
|
|
620
|
+
case 'medium':
|
|
621
|
+
medium++;
|
|
622
|
+
break;
|
|
623
|
+
case 'low':
|
|
624
|
+
low++;
|
|
625
|
+
break;
|
|
626
|
+
case 'informational':
|
|
627
|
+
informational++;
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
return {
|
|
632
|
+
critical,
|
|
633
|
+
high,
|
|
634
|
+
medium,
|
|
635
|
+
low,
|
|
636
|
+
informational,
|
|
637
|
+
totalFiles: totalDeps,
|
|
638
|
+
scanDurationMs: 0,
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
shouldExclude(filePath) {
|
|
642
|
+
return this.config.excludePatterns.some((pattern) => {
|
|
643
|
+
if (pattern.startsWith('*')) {
|
|
644
|
+
return filePath.endsWith(pattern.slice(1));
|
|
645
|
+
}
|
|
646
|
+
return filePath.includes(pattern);
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
async scanFileForSecrets(file) {
|
|
650
|
+
const secrets = [];
|
|
651
|
+
try {
|
|
652
|
+
// Read the file content
|
|
653
|
+
const content = await fs.readFile(file.value, 'utf-8');
|
|
654
|
+
const lines = content.split('\n');
|
|
655
|
+
// Comprehensive secret detection patterns
|
|
656
|
+
const secretPatterns = [
|
|
657
|
+
// AWS Keys
|
|
658
|
+
{
|
|
659
|
+
name: 'AWS Access Key ID',
|
|
660
|
+
type: 'api-key',
|
|
661
|
+
regex: /AKIA[0-9A-Z]{16}/g,
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
name: 'AWS Secret Access Key',
|
|
665
|
+
type: 'api-key',
|
|
666
|
+
regex: /(?:aws[_-]?secret[_-]?access[_-]?key|AWS_SECRET_ACCESS_KEY)['"]?\s*[:=]\s*['"]?([A-Za-z0-9/+=]{40})['"]?/gi,
|
|
667
|
+
entropyThreshold: 4.0,
|
|
668
|
+
},
|
|
669
|
+
// GitHub Tokens
|
|
670
|
+
{
|
|
671
|
+
name: 'GitHub Personal Access Token',
|
|
672
|
+
type: 'token',
|
|
673
|
+
regex: /ghp_[A-Za-z0-9]{36}/g,
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
name: 'GitHub OAuth Access Token',
|
|
677
|
+
type: 'token',
|
|
678
|
+
regex: /gho_[A-Za-z0-9]{36}/g,
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
name: 'GitHub App Token',
|
|
682
|
+
type: 'token',
|
|
683
|
+
regex: /(?:ghu|ghs)_[A-Za-z0-9]{36}/g,
|
|
684
|
+
},
|
|
685
|
+
// Generic API Keys
|
|
686
|
+
{
|
|
687
|
+
name: 'Generic API Key',
|
|
688
|
+
type: 'api-key',
|
|
689
|
+
regex: /(?:api[_-]?key|apikey|api_secret)['"]?\s*[:=]\s*['"]([A-Za-z0-9_\-]{20,})['"]?/gi,
|
|
690
|
+
entropyThreshold: 3.5,
|
|
691
|
+
},
|
|
692
|
+
// OpenAI API Key
|
|
693
|
+
{
|
|
694
|
+
name: 'OpenAI API Key',
|
|
695
|
+
type: 'api-key',
|
|
696
|
+
regex: /sk-[A-Za-z0-9]{48}/g,
|
|
697
|
+
},
|
|
698
|
+
// Stripe Keys
|
|
699
|
+
{
|
|
700
|
+
name: 'Stripe Secret Key',
|
|
701
|
+
type: 'api-key',
|
|
702
|
+
regex: /sk_live_[A-Za-z0-9]{24,}/g,
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
name: 'Stripe Publishable Key',
|
|
706
|
+
type: 'api-key',
|
|
707
|
+
regex: /pk_live_[A-Za-z0-9]{24,}/g,
|
|
708
|
+
},
|
|
709
|
+
// Private Keys
|
|
710
|
+
{
|
|
711
|
+
name: 'RSA Private Key',
|
|
712
|
+
type: 'private-key',
|
|
713
|
+
regex: /-----BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY-----/gi,
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
name: 'PGP Private Key',
|
|
717
|
+
type: 'private-key',
|
|
718
|
+
regex: /-----BEGIN\s+PGP\s+PRIVATE\s+KEY\s+BLOCK-----/gi,
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
name: 'SSH Private Key',
|
|
722
|
+
type: 'private-key',
|
|
723
|
+
regex: /-----BEGIN\s+(?:OPENSSH|DSA|EC)?\s*PRIVATE\s+KEY-----/gi,
|
|
724
|
+
},
|
|
725
|
+
// Passwords
|
|
726
|
+
{
|
|
727
|
+
name: 'Password Assignment',
|
|
728
|
+
type: 'password',
|
|
729
|
+
regex: /(?:password|passwd|pwd|secret)['"]?\s*[:=]\s*['"]([^'"\s]{8,})['"]?/gi,
|
|
730
|
+
entropyThreshold: 3.0,
|
|
731
|
+
},
|
|
732
|
+
// Database Connection Strings
|
|
733
|
+
{
|
|
734
|
+
name: 'Database Connection String',
|
|
735
|
+
type: 'password',
|
|
736
|
+
regex: /(?:mongodb|postgres|mysql|redis):\/\/[^:]+:[^@]+@[^\s'"]+/gi,
|
|
737
|
+
},
|
|
738
|
+
// JWT Tokens
|
|
739
|
+
{
|
|
740
|
+
name: 'JWT Token',
|
|
741
|
+
type: 'token',
|
|
742
|
+
regex: /eyJ[A-Za-z0-9_-]*\.eyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]*/g,
|
|
743
|
+
entropyThreshold: 4.0,
|
|
744
|
+
},
|
|
745
|
+
// Slack Tokens
|
|
746
|
+
{
|
|
747
|
+
name: 'Slack Token',
|
|
748
|
+
type: 'token',
|
|
749
|
+
regex: /xox[baprs]-[A-Za-z0-9-]{10,}/g,
|
|
750
|
+
},
|
|
751
|
+
// Google API Key
|
|
752
|
+
{
|
|
753
|
+
name: 'Google API Key',
|
|
754
|
+
type: 'api-key',
|
|
755
|
+
regex: /AIza[A-Za-z0-9_-]{35}/g,
|
|
756
|
+
},
|
|
757
|
+
// Twilio
|
|
758
|
+
{
|
|
759
|
+
name: 'Twilio API Key',
|
|
760
|
+
type: 'api-key',
|
|
761
|
+
regex: /SK[A-Za-z0-9]{32}/g,
|
|
762
|
+
},
|
|
763
|
+
// SendGrid
|
|
764
|
+
{
|
|
765
|
+
name: 'SendGrid API Key',
|
|
766
|
+
type: 'api-key',
|
|
767
|
+
regex: /SG\.[A-Za-z0-9_-]{22}\.[A-Za-z0-9_-]{43}/g,
|
|
768
|
+
},
|
|
769
|
+
// Certificates
|
|
770
|
+
{
|
|
771
|
+
name: 'X.509 Certificate',
|
|
772
|
+
type: 'certificate',
|
|
773
|
+
regex: /-----BEGIN\s+CERTIFICATE-----/gi,
|
|
774
|
+
},
|
|
775
|
+
];
|
|
776
|
+
// Scan each line for secrets
|
|
777
|
+
for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
|
778
|
+
const line = lines[lineIndex];
|
|
779
|
+
const lineNumber = lineIndex + 1;
|
|
780
|
+
for (const pattern of secretPatterns) {
|
|
781
|
+
// Reset regex lastIndex for global patterns
|
|
782
|
+
pattern.regex.lastIndex = 0;
|
|
783
|
+
let match;
|
|
784
|
+
while ((match = pattern.regex.exec(line)) !== null) {
|
|
785
|
+
const matchedValue = match[1] || match[0];
|
|
786
|
+
// Calculate entropy if threshold is specified
|
|
787
|
+
const entropy = this.calculateEntropy(matchedValue);
|
|
788
|
+
// Skip low-entropy matches if threshold is specified
|
|
789
|
+
if (pattern.entropyThreshold && entropy < pattern.entropyThreshold) {
|
|
790
|
+
continue;
|
|
791
|
+
}
|
|
792
|
+
// Create masked snippet (show context but mask the actual secret)
|
|
793
|
+
const snippet = this.createMaskedSnippet(line, match.index, matchedValue.length);
|
|
794
|
+
const location = {
|
|
795
|
+
file: file.value,
|
|
796
|
+
line: lineNumber,
|
|
797
|
+
column: match.index + 1,
|
|
798
|
+
snippet,
|
|
799
|
+
};
|
|
800
|
+
secrets.push({
|
|
801
|
+
type: pattern.type,
|
|
802
|
+
location,
|
|
803
|
+
entropy,
|
|
804
|
+
isValid: this.validateSecret(pattern.type, matchedValue),
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
catch (error) {
|
|
811
|
+
// File reading error - skip this file
|
|
812
|
+
console.error(`Failed to scan file for secrets: ${file.value}`, error);
|
|
813
|
+
}
|
|
814
|
+
return secrets;
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Calculate Shannon entropy of a string
|
|
818
|
+
*/
|
|
819
|
+
calculateEntropy(str) {
|
|
820
|
+
if (!str || str.length === 0)
|
|
821
|
+
return 0;
|
|
822
|
+
const charFrequency = {};
|
|
823
|
+
for (const char of str) {
|
|
824
|
+
charFrequency[char] = (charFrequency[char] || 0) + 1;
|
|
825
|
+
}
|
|
826
|
+
let entropy = 0;
|
|
827
|
+
const len = str.length;
|
|
828
|
+
for (const char in charFrequency) {
|
|
829
|
+
const probability = charFrequency[char] / len;
|
|
830
|
+
entropy -= probability * Math.log2(probability);
|
|
831
|
+
}
|
|
832
|
+
return entropy;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Create a masked snippet for display
|
|
836
|
+
*/
|
|
837
|
+
createMaskedSnippet(line, matchIndex, matchLength) {
|
|
838
|
+
const contextBefore = 20;
|
|
839
|
+
const contextAfter = 10;
|
|
840
|
+
const start = Math.max(0, matchIndex - contextBefore);
|
|
841
|
+
const end = Math.min(line.length, matchIndex + matchLength + contextAfter);
|
|
842
|
+
let snippet = line.substring(start, end);
|
|
843
|
+
// Mask the secret value (show first 4 and last 4 characters)
|
|
844
|
+
const secretStart = matchIndex - start;
|
|
845
|
+
const secretInSnippet = snippet.substring(secretStart, secretStart + matchLength);
|
|
846
|
+
if (secretInSnippet.length > 8) {
|
|
847
|
+
const masked = secretInSnippet.substring(0, 4) + '...' + secretInSnippet.substring(secretInSnippet.length - 4);
|
|
848
|
+
snippet = snippet.substring(0, secretStart) + masked + snippet.substring(secretStart + matchLength);
|
|
849
|
+
}
|
|
850
|
+
if (start > 0)
|
|
851
|
+
snippet = '...' + snippet;
|
|
852
|
+
if (end < line.length)
|
|
853
|
+
snippet = snippet + '...';
|
|
854
|
+
return snippet;
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Validate if a detected secret is likely valid (basic validation)
|
|
858
|
+
*/
|
|
859
|
+
validateSecret(type, value) {
|
|
860
|
+
// Basic validation - in production, could do more sophisticated checks
|
|
861
|
+
switch (type) {
|
|
862
|
+
case 'api-key':
|
|
863
|
+
// Check minimum length and character variety
|
|
864
|
+
return value.length >= 20 && /[a-z]/.test(value) && /[A-Z0-9]/.test(value);
|
|
865
|
+
case 'token':
|
|
866
|
+
return value.length >= 20;
|
|
867
|
+
case 'password':
|
|
868
|
+
// Likely not a placeholder password
|
|
869
|
+
return !['password', 'secret', 'changeme', '12345678', 'qwerty'].includes(value.toLowerCase());
|
|
870
|
+
case 'private-key':
|
|
871
|
+
return true; // Private key headers are already specific
|
|
872
|
+
case 'certificate':
|
|
873
|
+
return true;
|
|
874
|
+
default:
|
|
875
|
+
return true;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* Perform SAST scan using AST-based analysis for JavaScript/TypeScript
|
|
880
|
+
* Scans for common vulnerability patterns: XSS, SQL injection, command injection, path traversal
|
|
881
|
+
*/
|
|
882
|
+
async performSASTScan() {
|
|
883
|
+
const scanId = uuidv4();
|
|
884
|
+
const startTime = Date.now();
|
|
885
|
+
const vulnerabilities = [];
|
|
886
|
+
let filesScanned = 0;
|
|
887
|
+
let linesScanned = 0;
|
|
888
|
+
try {
|
|
889
|
+
// Find source files to scan
|
|
890
|
+
const sourceFiles = await this.findSourceFiles(process.cwd());
|
|
891
|
+
// Define vulnerability patterns for AST-like analysis
|
|
892
|
+
const vulnerabilityPatterns = [
|
|
893
|
+
// SQL Injection patterns
|
|
894
|
+
{
|
|
895
|
+
id: 'sqli-concat',
|
|
896
|
+
pattern: /(?:query|execute|exec|run)\s*\(\s*(?:['"`].*?\s*\+|`[^`]*\$\{)/gi,
|
|
897
|
+
title: 'SQL Injection via String Concatenation',
|
|
898
|
+
description: 'SQL query constructed using string concatenation with potentially untrusted input',
|
|
899
|
+
severity: 'critical',
|
|
900
|
+
category: 'injection',
|
|
901
|
+
remediation: 'Use parameterized queries or prepared statements',
|
|
902
|
+
fixExample: 'db.query("SELECT * FROM users WHERE id = $1", [userId])',
|
|
903
|
+
cweId: 'CWE-89',
|
|
904
|
+
},
|
|
905
|
+
// XSS patterns
|
|
906
|
+
{
|
|
907
|
+
id: 'xss-innerhtml',
|
|
908
|
+
pattern: /\.innerHTML\s*=\s*(?!['"`])/g,
|
|
909
|
+
title: 'XSS via innerHTML Assignment',
|
|
910
|
+
description: 'Direct innerHTML assignment with potentially unsanitized content',
|
|
911
|
+
severity: 'high',
|
|
912
|
+
category: 'xss',
|
|
913
|
+
remediation: 'Use textContent for text, or sanitize HTML with DOMPurify',
|
|
914
|
+
fixExample: 'element.textContent = userInput;',
|
|
915
|
+
cweId: 'CWE-79',
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
id: 'xss-document-write',
|
|
919
|
+
pattern: /document\.write\s*\([^)]+\)/g,
|
|
920
|
+
title: 'XSS via document.write',
|
|
921
|
+
description: 'document.write() can execute scripts from untrusted data',
|
|
922
|
+
severity: 'high',
|
|
923
|
+
category: 'xss',
|
|
924
|
+
remediation: 'Avoid document.write(); use DOM manipulation methods',
|
|
925
|
+
cweId: 'CWE-79',
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
id: 'xss-eval',
|
|
929
|
+
pattern: /(?<!\.)\beval\s*\([^)]+\)/g,
|
|
930
|
+
title: 'Code Injection via eval()',
|
|
931
|
+
description: 'eval() executes arbitrary code and is a major security risk',
|
|
932
|
+
severity: 'critical',
|
|
933
|
+
category: 'xss',
|
|
934
|
+
remediation: 'Never use eval(); use JSON.parse() for JSON data',
|
|
935
|
+
fixExample: 'JSON.parse(jsonString)',
|
|
936
|
+
cweId: 'CWE-95',
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
id: 'xss-dangerous-react',
|
|
940
|
+
pattern: /dangerouslySetInnerHTML\s*=\s*\{/g,
|
|
941
|
+
title: 'React dangerouslySetInnerHTML Usage',
|
|
942
|
+
description: 'dangerouslySetInnerHTML bypasses React XSS protections',
|
|
943
|
+
severity: 'medium',
|
|
944
|
+
category: 'xss',
|
|
945
|
+
remediation: 'Sanitize HTML content with DOMPurify before use',
|
|
946
|
+
fixExample: 'dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(content) }}',
|
|
947
|
+
cweId: 'CWE-79',
|
|
948
|
+
},
|
|
949
|
+
// Command Injection patterns
|
|
950
|
+
{
|
|
951
|
+
id: 'cmd-injection-exec',
|
|
952
|
+
pattern: /(?:child_process\.)?exec\s*\(\s*(?:[^,)]*\s*\+|`[^`]*\$\{)/g,
|
|
953
|
+
title: 'Command Injection via exec()',
|
|
954
|
+
description: 'Shell command execution with unsanitized input',
|
|
955
|
+
severity: 'critical',
|
|
956
|
+
category: 'injection',
|
|
957
|
+
remediation: 'Use execFile() with argument array instead of exec()',
|
|
958
|
+
fixExample: 'execFile("command", [arg1, arg2], callback)',
|
|
959
|
+
cweId: 'CWE-78',
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
id: 'cmd-injection-spawn-shell',
|
|
963
|
+
pattern: /spawn\s*\([^)]+,\s*\{[^}]*shell\s*:\s*true/g,
|
|
964
|
+
title: 'Dangerous Shell Option in spawn()',
|
|
965
|
+
description: 'spawn() with shell: true can enable command injection',
|
|
966
|
+
severity: 'high',
|
|
967
|
+
category: 'injection',
|
|
968
|
+
remediation: 'Avoid shell: true option; use direct command execution',
|
|
969
|
+
cweId: 'CWE-78',
|
|
970
|
+
},
|
|
971
|
+
// Path Traversal patterns
|
|
972
|
+
{
|
|
973
|
+
id: 'path-traversal-readfile',
|
|
974
|
+
pattern: /(?:readFile|readFileSync)\s*\([^)]*\+/g,
|
|
975
|
+
title: 'Path Traversal via File Read',
|
|
976
|
+
description: 'File read operation with concatenated path may allow directory traversal',
|
|
977
|
+
severity: 'high',
|
|
978
|
+
category: 'access-control',
|
|
979
|
+
remediation: 'Validate and sanitize file paths; use path.resolve() and check against base directory',
|
|
980
|
+
fixExample: 'const safePath = path.resolve(baseDir, path.basename(userInput))',
|
|
981
|
+
cweId: 'CWE-22',
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
id: 'path-traversal-writefile',
|
|
985
|
+
pattern: /(?:writeFile|writeFileSync)\s*\([^)]*\+/g,
|
|
986
|
+
title: 'Path Traversal via File Write',
|
|
987
|
+
description: 'File write operation with concatenated path may allow directory traversal',
|
|
988
|
+
severity: 'high',
|
|
989
|
+
category: 'access-control',
|
|
990
|
+
remediation: 'Validate file paths before writing; ensure path is within allowed directory',
|
|
991
|
+
cweId: 'CWE-22',
|
|
992
|
+
},
|
|
993
|
+
// Hardcoded secrets
|
|
994
|
+
{
|
|
995
|
+
id: 'secret-private-key',
|
|
996
|
+
pattern: /-----BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY-----/g,
|
|
997
|
+
title: 'Private Key Detected in Source',
|
|
998
|
+
description: 'Private key found in source code',
|
|
999
|
+
severity: 'critical',
|
|
1000
|
+
category: 'sensitive-data',
|
|
1001
|
+
remediation: 'Store private keys in secure key management systems, not in code',
|
|
1002
|
+
cweId: 'CWE-798',
|
|
1003
|
+
},
|
|
1004
|
+
// Insecure configurations
|
|
1005
|
+
{
|
|
1006
|
+
id: 'config-tls-disabled',
|
|
1007
|
+
pattern: /rejectUnauthorized\s*:\s*false/g,
|
|
1008
|
+
title: 'TLS Certificate Validation Disabled',
|
|
1009
|
+
description: 'Disabling TLS certificate validation exposes to MITM attacks',
|
|
1010
|
+
severity: 'high',
|
|
1011
|
+
category: 'security-misconfiguration',
|
|
1012
|
+
remediation: 'Always enable TLS certificate validation in production',
|
|
1013
|
+
cweId: 'CWE-295',
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
id: 'config-cors-wildcard',
|
|
1017
|
+
pattern: /cors\s*\(\s*\{[^}]*origin\s*:\s*['"]\*['"]/gi,
|
|
1018
|
+
title: 'Permissive CORS Configuration',
|
|
1019
|
+
description: 'CORS allows all origins (*) which may expose sensitive data',
|
|
1020
|
+
severity: 'medium',
|
|
1021
|
+
category: 'security-misconfiguration',
|
|
1022
|
+
remediation: 'Restrict CORS to specific trusted origins',
|
|
1023
|
+
fixExample: 'cors({ origin: ["https://trusted-domain.com"] })',
|
|
1024
|
+
cweId: 'CWE-942',
|
|
1025
|
+
},
|
|
1026
|
+
];
|
|
1027
|
+
for (const filePath of sourceFiles) {
|
|
1028
|
+
if (this.shouldExclude(filePath)) {
|
|
1029
|
+
continue;
|
|
1030
|
+
}
|
|
1031
|
+
// Only scan JS/TS files
|
|
1032
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
1033
|
+
if (!['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'].includes(ext)) {
|
|
1034
|
+
continue;
|
|
1035
|
+
}
|
|
1036
|
+
try {
|
|
1037
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
1038
|
+
const lines = content.split('\n');
|
|
1039
|
+
filesScanned++;
|
|
1040
|
+
linesScanned += lines.length;
|
|
1041
|
+
// Check each vulnerability pattern
|
|
1042
|
+
for (const vulnPattern of vulnerabilityPatterns) {
|
|
1043
|
+
// Reset regex state
|
|
1044
|
+
vulnPattern.pattern.lastIndex = 0;
|
|
1045
|
+
let match;
|
|
1046
|
+
while ((match = vulnPattern.pattern.exec(content)) !== null) {
|
|
1047
|
+
// Calculate line and column
|
|
1048
|
+
const beforeMatch = content.substring(0, match.index);
|
|
1049
|
+
const linesBefore = beforeMatch.split('\n');
|
|
1050
|
+
const lineNumber = linesBefore.length;
|
|
1051
|
+
const column = linesBefore[linesBefore.length - 1].length + 1;
|
|
1052
|
+
// Check if in comment
|
|
1053
|
+
const currentLine = lines[lineNumber - 1] || '';
|
|
1054
|
+
if (currentLine.trimStart().startsWith('//') || currentLine.trimStart().startsWith('*')) {
|
|
1055
|
+
continue;
|
|
1056
|
+
}
|
|
1057
|
+
// Check for nosec annotation
|
|
1058
|
+
if (currentLine.includes('// nosec') || currentLine.includes('// security-ignore')) {
|
|
1059
|
+
continue;
|
|
1060
|
+
}
|
|
1061
|
+
// Extract snippet with context
|
|
1062
|
+
const startLine = Math.max(0, lineNumber - 2);
|
|
1063
|
+
const endLine = Math.min(lines.length, lineNumber + 1);
|
|
1064
|
+
const snippet = lines.slice(startLine, endLine).join('\n');
|
|
1065
|
+
const location = {
|
|
1066
|
+
file: filePath,
|
|
1067
|
+
line: lineNumber,
|
|
1068
|
+
column,
|
|
1069
|
+
snippet,
|
|
1070
|
+
};
|
|
1071
|
+
const remediation = {
|
|
1072
|
+
description: vulnPattern.remediation,
|
|
1073
|
+
fixExample: vulnPattern.fixExample,
|
|
1074
|
+
estimatedEffort: vulnPattern.severity === 'critical' ? 'moderate' : 'minor',
|
|
1075
|
+
automatable: vulnPattern.severity === 'low' || vulnPattern.severity === 'medium',
|
|
1076
|
+
};
|
|
1077
|
+
vulnerabilities.push({
|
|
1078
|
+
id: uuidv4(),
|
|
1079
|
+
cveId: undefined,
|
|
1080
|
+
title: vulnPattern.title,
|
|
1081
|
+
description: `${vulnPattern.description} [${vulnPattern.cweId}]`,
|
|
1082
|
+
severity: vulnPattern.severity,
|
|
1083
|
+
category: vulnPattern.category,
|
|
1084
|
+
location,
|
|
1085
|
+
remediation,
|
|
1086
|
+
references: [
|
|
1087
|
+
`https://cwe.mitre.org/data/definitions/${vulnPattern.cweId.replace('CWE-', '')}.html`,
|
|
1088
|
+
],
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
catch {
|
|
1094
|
+
// Skip files that can't be read
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
catch (error) {
|
|
1099
|
+
console.error('SAST scan failed:', error);
|
|
1100
|
+
}
|
|
1101
|
+
const scanDurationMs = Date.now() - startTime;
|
|
1102
|
+
// Calculate summary
|
|
1103
|
+
let critical = 0, high = 0, medium = 0, low = 0, informational = 0;
|
|
1104
|
+
for (const vuln of vulnerabilities) {
|
|
1105
|
+
switch (vuln.severity) {
|
|
1106
|
+
case 'critical':
|
|
1107
|
+
critical++;
|
|
1108
|
+
break;
|
|
1109
|
+
case 'high':
|
|
1110
|
+
high++;
|
|
1111
|
+
break;
|
|
1112
|
+
case 'medium':
|
|
1113
|
+
medium++;
|
|
1114
|
+
break;
|
|
1115
|
+
case 'low':
|
|
1116
|
+
low++;
|
|
1117
|
+
break;
|
|
1118
|
+
case 'informational':
|
|
1119
|
+
informational++;
|
|
1120
|
+
break;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
return {
|
|
1124
|
+
scanId,
|
|
1125
|
+
vulnerabilities,
|
|
1126
|
+
summary: {
|
|
1127
|
+
critical,
|
|
1128
|
+
high,
|
|
1129
|
+
medium,
|
|
1130
|
+
low,
|
|
1131
|
+
informational,
|
|
1132
|
+
totalFiles: filesScanned,
|
|
1133
|
+
scanDurationMs,
|
|
1134
|
+
},
|
|
1135
|
+
coverage: {
|
|
1136
|
+
filesScanned,
|
|
1137
|
+
linesScanned,
|
|
1138
|
+
rulesApplied: 12, // Number of vulnerability patterns
|
|
1139
|
+
},
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Perform DAST scan using HTTP requests to test for vulnerabilities
|
|
1144
|
+
* Tests for common web vulnerabilities: XSS, SQL injection, security headers, etc.
|
|
1145
|
+
*/
|
|
1146
|
+
async performDASTScan(targetUrl) {
|
|
1147
|
+
const scanId = uuidv4();
|
|
1148
|
+
const startTime = Date.now();
|
|
1149
|
+
const vulnerabilities = [];
|
|
1150
|
+
let crawledUrls = 0;
|
|
1151
|
+
try {
|
|
1152
|
+
// Validate URL
|
|
1153
|
+
let parsedUrl;
|
|
1154
|
+
try {
|
|
1155
|
+
parsedUrl = new URL(targetUrl);
|
|
1156
|
+
}
|
|
1157
|
+
catch {
|
|
1158
|
+
return {
|
|
1159
|
+
scanId,
|
|
1160
|
+
targetUrl,
|
|
1161
|
+
vulnerabilities: [{
|
|
1162
|
+
id: uuidv4(),
|
|
1163
|
+
title: 'Invalid Target URL',
|
|
1164
|
+
description: 'The provided target URL is not valid',
|
|
1165
|
+
severity: 'informational',
|
|
1166
|
+
category: 'security-misconfiguration',
|
|
1167
|
+
location: { file: targetUrl },
|
|
1168
|
+
remediation: { description: 'Provide a valid URL', estimatedEffort: 'trivial', automatable: false },
|
|
1169
|
+
references: [],
|
|
1170
|
+
}],
|
|
1171
|
+
summary: { critical: 0, high: 0, medium: 0, low: 0, informational: 1, totalFiles: 0, scanDurationMs: Date.now() - startTime },
|
|
1172
|
+
crawledUrls: 0,
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
// Perform HTTP request to check security headers and response characteristics
|
|
1176
|
+
const controller = new AbortController();
|
|
1177
|
+
const timeoutId = setTimeout(() => controller.abort(), 30000); // 30s timeout
|
|
1178
|
+
try {
|
|
1179
|
+
const response = await fetch(targetUrl, {
|
|
1180
|
+
method: 'GET',
|
|
1181
|
+
headers: {
|
|
1182
|
+
'User-Agent': 'AgenticQE-SecurityScanner/3.0',
|
|
1183
|
+
'Accept': 'text/html,application/json,*/*',
|
|
1184
|
+
},
|
|
1185
|
+
signal: controller.signal,
|
|
1186
|
+
redirect: 'follow',
|
|
1187
|
+
});
|
|
1188
|
+
clearTimeout(timeoutId);
|
|
1189
|
+
crawledUrls = 1;
|
|
1190
|
+
// Check security headers
|
|
1191
|
+
const headers = response.headers;
|
|
1192
|
+
// Check for missing security headers
|
|
1193
|
+
const securityHeaderChecks = [
|
|
1194
|
+
{
|
|
1195
|
+
header: 'strict-transport-security',
|
|
1196
|
+
title: 'Missing HTTP Strict Transport Security (HSTS)',
|
|
1197
|
+
description: 'HSTS header is missing, allowing downgrade attacks',
|
|
1198
|
+
severity: 'medium',
|
|
1199
|
+
remediation: 'Add Strict-Transport-Security header with appropriate max-age',
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
header: 'x-content-type-options',
|
|
1203
|
+
title: 'Missing X-Content-Type-Options Header',
|
|
1204
|
+
description: 'X-Content-Type-Options header is missing, allowing MIME sniffing attacks',
|
|
1205
|
+
severity: 'low',
|
|
1206
|
+
remediation: 'Add X-Content-Type-Options: nosniff header',
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
header: 'x-frame-options',
|
|
1210
|
+
title: 'Missing X-Frame-Options Header',
|
|
1211
|
+
description: 'X-Frame-Options header is missing, allowing clickjacking attacks',
|
|
1212
|
+
severity: 'medium',
|
|
1213
|
+
remediation: 'Add X-Frame-Options: DENY or SAMEORIGIN header',
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
header: 'content-security-policy',
|
|
1217
|
+
title: 'Missing Content Security Policy',
|
|
1218
|
+
description: 'CSP header is missing, increasing XSS attack surface',
|
|
1219
|
+
severity: 'medium',
|
|
1220
|
+
remediation: 'Implement a Content-Security-Policy header',
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
header: 'x-xss-protection',
|
|
1224
|
+
title: 'Missing X-XSS-Protection Header',
|
|
1225
|
+
description: 'X-XSS-Protection header is missing (legacy XSS filter)',
|
|
1226
|
+
severity: 'low',
|
|
1227
|
+
remediation: 'Add X-XSS-Protection: 1; mode=block header',
|
|
1228
|
+
},
|
|
1229
|
+
];
|
|
1230
|
+
for (const check of securityHeaderChecks) {
|
|
1231
|
+
if (!headers.get(check.header)) {
|
|
1232
|
+
vulnerabilities.push({
|
|
1233
|
+
id: uuidv4(),
|
|
1234
|
+
title: check.title,
|
|
1235
|
+
description: check.description,
|
|
1236
|
+
severity: check.severity,
|
|
1237
|
+
category: 'security-misconfiguration',
|
|
1238
|
+
location: {
|
|
1239
|
+
file: targetUrl,
|
|
1240
|
+
snippet: `Response Headers: ${check.header} not present`,
|
|
1241
|
+
},
|
|
1242
|
+
remediation: {
|
|
1243
|
+
description: check.remediation,
|
|
1244
|
+
estimatedEffort: 'minor',
|
|
1245
|
+
automatable: true,
|
|
1246
|
+
},
|
|
1247
|
+
references: [
|
|
1248
|
+
'https://owasp.org/www-project-secure-headers/',
|
|
1249
|
+
],
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
// Check for insecure cookies
|
|
1254
|
+
const cookies = headers.get('set-cookie');
|
|
1255
|
+
if (cookies) {
|
|
1256
|
+
if (!cookies.toLowerCase().includes('secure')) {
|
|
1257
|
+
vulnerabilities.push({
|
|
1258
|
+
id: uuidv4(),
|
|
1259
|
+
title: 'Cookie Without Secure Flag',
|
|
1260
|
+
description: 'Session cookie is set without the Secure flag',
|
|
1261
|
+
severity: 'medium',
|
|
1262
|
+
category: 'sensitive-data',
|
|
1263
|
+
location: { file: targetUrl, snippet: `Set-Cookie: ${cookies.substring(0, 50)}...` },
|
|
1264
|
+
remediation: { description: 'Add Secure flag to cookies', estimatedEffort: 'trivial', automatable: true },
|
|
1265
|
+
references: ['https://owasp.org/www-community/controls/SecureCookieAttribute'],
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
if (!cookies.toLowerCase().includes('httponly')) {
|
|
1269
|
+
vulnerabilities.push({
|
|
1270
|
+
id: uuidv4(),
|
|
1271
|
+
title: 'Cookie Without HttpOnly Flag',
|
|
1272
|
+
description: 'Session cookie is set without the HttpOnly flag, making it accessible to JavaScript',
|
|
1273
|
+
severity: 'medium',
|
|
1274
|
+
category: 'sensitive-data',
|
|
1275
|
+
location: { file: targetUrl, snippet: `Set-Cookie: ${cookies.substring(0, 50)}...` },
|
|
1276
|
+
remediation: { description: 'Add HttpOnly flag to session cookies', estimatedEffort: 'trivial', automatable: true },
|
|
1277
|
+
references: ['https://owasp.org/www-community/HttpOnly'],
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
if (!cookies.toLowerCase().includes('samesite')) {
|
|
1281
|
+
vulnerabilities.push({
|
|
1282
|
+
id: uuidv4(),
|
|
1283
|
+
title: 'Cookie Without SameSite Attribute',
|
|
1284
|
+
description: 'Cookie is set without the SameSite attribute, potentially vulnerable to CSRF',
|
|
1285
|
+
severity: 'low',
|
|
1286
|
+
category: 'broken-auth',
|
|
1287
|
+
location: { file: targetUrl, snippet: `Set-Cookie: ${cookies.substring(0, 50)}...` },
|
|
1288
|
+
remediation: { description: 'Add SameSite=Strict or SameSite=Lax to cookies', estimatedEffort: 'trivial', automatable: true },
|
|
1289
|
+
references: ['https://owasp.org/www-community/SameSite'],
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
// Check for server information disclosure
|
|
1294
|
+
const server = headers.get('server');
|
|
1295
|
+
if (server && /[0-9]+\.[0-9]+/.test(server)) {
|
|
1296
|
+
vulnerabilities.push({
|
|
1297
|
+
id: uuidv4(),
|
|
1298
|
+
title: 'Server Version Disclosure',
|
|
1299
|
+
description: `Server header reveals version information: ${server}`,
|
|
1300
|
+
severity: 'low',
|
|
1301
|
+
category: 'security-misconfiguration',
|
|
1302
|
+
location: { file: targetUrl, snippet: `Server: ${server}` },
|
|
1303
|
+
remediation: { description: 'Remove or obfuscate server version information', estimatedEffort: 'trivial', automatable: true },
|
|
1304
|
+
references: ['https://owasp.org/www-project-web-security-testing-guide/'],
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
// Check for HTTPS
|
|
1308
|
+
if (parsedUrl.protocol === 'http:') {
|
|
1309
|
+
vulnerabilities.push({
|
|
1310
|
+
id: uuidv4(),
|
|
1311
|
+
title: 'Insecure HTTP Protocol',
|
|
1312
|
+
description: 'Target is using HTTP instead of HTTPS, exposing data in transit',
|
|
1313
|
+
severity: 'high',
|
|
1314
|
+
category: 'sensitive-data',
|
|
1315
|
+
location: { file: targetUrl },
|
|
1316
|
+
remediation: { description: 'Use HTTPS with valid TLS certificate', estimatedEffort: 'moderate', automatable: false },
|
|
1317
|
+
references: ['https://owasp.org/www-project-web-security-testing-guide/'],
|
|
1318
|
+
});
|
|
1319
|
+
}
|
|
1320
|
+
// Try common test endpoints for additional checks
|
|
1321
|
+
const testEndpoints = [
|
|
1322
|
+
{ path: '/.git/config', vuln: 'Git Repository Exposed', severity: 'high' },
|
|
1323
|
+
{ path: '/.env', vuln: 'Environment File Exposed', severity: 'critical' },
|
|
1324
|
+
{ path: '/phpinfo.php', vuln: 'PHP Info Exposed', severity: 'medium' },
|
|
1325
|
+
{ path: '/wp-config.php.bak', vuln: 'WordPress Config Backup Exposed', severity: 'critical' },
|
|
1326
|
+
];
|
|
1327
|
+
for (const endpoint of testEndpoints) {
|
|
1328
|
+
try {
|
|
1329
|
+
const testUrl = new URL(endpoint.path, parsedUrl.origin).toString();
|
|
1330
|
+
const testResponse = await fetch(testUrl, {
|
|
1331
|
+
method: 'GET',
|
|
1332
|
+
signal: AbortSignal.timeout(5000),
|
|
1333
|
+
});
|
|
1334
|
+
if (testResponse.ok && testResponse.status === 200) {
|
|
1335
|
+
const text = await testResponse.text();
|
|
1336
|
+
// Verify it's actually the sensitive content, not a custom 404
|
|
1337
|
+
if (text.length > 10 && !text.toLowerCase().includes('not found')) {
|
|
1338
|
+
crawledUrls++;
|
|
1339
|
+
vulnerabilities.push({
|
|
1340
|
+
id: uuidv4(),
|
|
1341
|
+
title: endpoint.vuln,
|
|
1342
|
+
description: `Sensitive file found at ${endpoint.path}`,
|
|
1343
|
+
severity: endpoint.severity,
|
|
1344
|
+
category: 'sensitive-data',
|
|
1345
|
+
location: { file: testUrl },
|
|
1346
|
+
remediation: { description: 'Remove or restrict access to sensitive files', estimatedEffort: 'trivial', automatable: true },
|
|
1347
|
+
references: ['https://owasp.org/www-project-web-security-testing-guide/'],
|
|
1348
|
+
});
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
catch {
|
|
1353
|
+
// Endpoint not accessible, which is expected/good
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
catch (fetchError) {
|
|
1358
|
+
clearTimeout(timeoutId);
|
|
1359
|
+
const errorMessage = fetchError instanceof Error ? fetchError.message : String(fetchError);
|
|
1360
|
+
// Network errors might indicate issues
|
|
1361
|
+
if (errorMessage.includes('certificate') || errorMessage.includes('SSL') || errorMessage.includes('TLS')) {
|
|
1362
|
+
vulnerabilities.push({
|
|
1363
|
+
id: uuidv4(),
|
|
1364
|
+
title: 'TLS/SSL Certificate Issue',
|
|
1365
|
+
description: `Certificate error: ${errorMessage}`,
|
|
1366
|
+
severity: 'high',
|
|
1367
|
+
category: 'security-misconfiguration',
|
|
1368
|
+
location: { file: targetUrl },
|
|
1369
|
+
remediation: { description: 'Fix TLS certificate configuration', estimatedEffort: 'moderate', automatable: false },
|
|
1370
|
+
references: ['https://owasp.org/www-project-web-security-testing-guide/'],
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
catch (error) {
|
|
1376
|
+
console.error('DAST scan failed:', error);
|
|
1377
|
+
}
|
|
1378
|
+
const scanDurationMs = Date.now() - startTime;
|
|
1379
|
+
// Calculate summary
|
|
1380
|
+
let critical = 0, high = 0, medium = 0, low = 0, informational = 0;
|
|
1381
|
+
for (const vuln of vulnerabilities) {
|
|
1382
|
+
switch (vuln.severity) {
|
|
1383
|
+
case 'critical':
|
|
1384
|
+
critical++;
|
|
1385
|
+
break;
|
|
1386
|
+
case 'high':
|
|
1387
|
+
high++;
|
|
1388
|
+
break;
|
|
1389
|
+
case 'medium':
|
|
1390
|
+
medium++;
|
|
1391
|
+
break;
|
|
1392
|
+
case 'low':
|
|
1393
|
+
low++;
|
|
1394
|
+
break;
|
|
1395
|
+
case 'informational':
|
|
1396
|
+
informational++;
|
|
1397
|
+
break;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
return {
|
|
1401
|
+
scanId,
|
|
1402
|
+
targetUrl,
|
|
1403
|
+
vulnerabilities,
|
|
1404
|
+
summary: {
|
|
1405
|
+
critical,
|
|
1406
|
+
high,
|
|
1407
|
+
medium,
|
|
1408
|
+
low,
|
|
1409
|
+
informational,
|
|
1410
|
+
totalFiles: 1,
|
|
1411
|
+
scanDurationMs,
|
|
1412
|
+
},
|
|
1413
|
+
crawledUrls,
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* Perform dependency scan using OSV API
|
|
1418
|
+
*/
|
|
1419
|
+
async performDependencyScan() {
|
|
1420
|
+
const startTime = Date.now();
|
|
1421
|
+
const vulnerabilities = [];
|
|
1422
|
+
const outdatedPackages = [];
|
|
1423
|
+
try {
|
|
1424
|
+
// Look for package.json in current working directory
|
|
1425
|
+
const manifestPath = path.join(process.cwd(), 'package.json');
|
|
1426
|
+
const dependencies = await this.parseDependencies(manifestPath, 'npm');
|
|
1427
|
+
for (const dep of dependencies) {
|
|
1428
|
+
// Check for vulnerabilities via OSV API
|
|
1429
|
+
const vulns = await this.checkDependencyVulnerabilities(dep, dep.ecosystem);
|
|
1430
|
+
vulnerabilities.push(...vulns);
|
|
1431
|
+
// Check for outdated packages
|
|
1432
|
+
const outdated = await this.checkOutdated(dep);
|
|
1433
|
+
if (outdated) {
|
|
1434
|
+
outdatedPackages.push(outdated);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
const scanDurationMs = Date.now() - startTime;
|
|
1438
|
+
const baseSummary = this.createDependencySummary(vulnerabilities, dependencies.length);
|
|
1439
|
+
return {
|
|
1440
|
+
vulnerabilities,
|
|
1441
|
+
outdatedPackages,
|
|
1442
|
+
summary: {
|
|
1443
|
+
...baseSummary,
|
|
1444
|
+
scanDurationMs,
|
|
1445
|
+
},
|
|
1446
|
+
};
|
|
1447
|
+
}
|
|
1448
|
+
catch (error) {
|
|
1449
|
+
console.error('Dependency scan failed:', error);
|
|
1450
|
+
return {
|
|
1451
|
+
vulnerabilities: [],
|
|
1452
|
+
outdatedPackages: [],
|
|
1453
|
+
summary: {
|
|
1454
|
+
critical: 0,
|
|
1455
|
+
high: 0,
|
|
1456
|
+
medium: 0,
|
|
1457
|
+
low: 0,
|
|
1458
|
+
informational: 0,
|
|
1459
|
+
totalFiles: 0,
|
|
1460
|
+
scanDurationMs: Date.now() - startTime,
|
|
1461
|
+
},
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
/**
|
|
1466
|
+
* Perform secret scan on source files
|
|
1467
|
+
*/
|
|
1468
|
+
async performSecretScan() {
|
|
1469
|
+
const secretsFound = [];
|
|
1470
|
+
let filesScanned = 0;
|
|
1471
|
+
try {
|
|
1472
|
+
// Get list of source files to scan
|
|
1473
|
+
const sourceFiles = await this.findSourceFiles(process.cwd());
|
|
1474
|
+
for (const filePath of sourceFiles) {
|
|
1475
|
+
if (this.shouldExclude(filePath)) {
|
|
1476
|
+
continue;
|
|
1477
|
+
}
|
|
1478
|
+
filesScanned++;
|
|
1479
|
+
const filePathObj = { value: filePath };
|
|
1480
|
+
const secrets = await this.scanFileForSecrets(filePathObj);
|
|
1481
|
+
secretsFound.push(...secrets);
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
catch (error) {
|
|
1485
|
+
console.error('Secret scan failed:', error);
|
|
1486
|
+
}
|
|
1487
|
+
return {
|
|
1488
|
+
secretsFound,
|
|
1489
|
+
filesScanned,
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
/**
|
|
1493
|
+
* Find source files in a directory (recursively)
|
|
1494
|
+
*/
|
|
1495
|
+
async findSourceFiles(dir, files = []) {
|
|
1496
|
+
const sourceExtensions = ['.ts', '.js', '.tsx', '.jsx', '.json', '.env', '.yaml', '.yml', '.config'];
|
|
1497
|
+
try {
|
|
1498
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
1499
|
+
for (const entry of entries) {
|
|
1500
|
+
const fullPath = path.join(dir, entry.name);
|
|
1501
|
+
// Skip excluded directories
|
|
1502
|
+
if (this.shouldExclude(fullPath)) {
|
|
1503
|
+
continue;
|
|
1504
|
+
}
|
|
1505
|
+
if (entry.isDirectory()) {
|
|
1506
|
+
await this.findSourceFiles(fullPath, files);
|
|
1507
|
+
}
|
|
1508
|
+
else if (entry.isFile()) {
|
|
1509
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
1510
|
+
if (sourceExtensions.includes(ext) || entry.name.startsWith('.env')) {
|
|
1511
|
+
files.push(fullPath);
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
catch (error) {
|
|
1517
|
+
// Silently skip directories we can't read
|
|
1518
|
+
}
|
|
1519
|
+
return files;
|
|
1520
|
+
}
|
|
1521
|
+
calculateOverallRisk(sast, dast, deps, secrets) {
|
|
1522
|
+
let riskValue = 0;
|
|
1523
|
+
let weights = 0;
|
|
1524
|
+
if (sast) {
|
|
1525
|
+
riskValue +=
|
|
1526
|
+
this.calculateScanRisk(sast.summary) * 0.35;
|
|
1527
|
+
weights += 0.35;
|
|
1528
|
+
}
|
|
1529
|
+
if (dast) {
|
|
1530
|
+
riskValue +=
|
|
1531
|
+
this.calculateScanRisk(dast.summary) * 0.25;
|
|
1532
|
+
weights += 0.25;
|
|
1533
|
+
}
|
|
1534
|
+
if (deps) {
|
|
1535
|
+
riskValue +=
|
|
1536
|
+
this.calculateScanRisk(deps.summary) * 0.25;
|
|
1537
|
+
weights += 0.25;
|
|
1538
|
+
}
|
|
1539
|
+
if (secrets) {
|
|
1540
|
+
const secretRisk = secrets.secretsFound.length > 0 ? 0.9 : 0.1;
|
|
1541
|
+
riskValue += secretRisk * 0.15;
|
|
1542
|
+
weights += 0.15;
|
|
1543
|
+
}
|
|
1544
|
+
const normalizedRisk = weights > 0 ? riskValue / weights : 0;
|
|
1545
|
+
// Return RiskScore-compatible object
|
|
1546
|
+
return {
|
|
1547
|
+
value: Math.min(1, normalizedRisk),
|
|
1548
|
+
percentage: normalizedRisk * 100,
|
|
1549
|
+
level: normalizedRisk >= 0.8 ? 'critical' :
|
|
1550
|
+
normalizedRisk >= 0.6 ? 'high' :
|
|
1551
|
+
normalizedRisk >= 0.3 ? 'medium' : 'low',
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1554
|
+
calculateScanRisk(summary) {
|
|
1555
|
+
const weights = {
|
|
1556
|
+
critical: 1.0,
|
|
1557
|
+
high: 0.7,
|
|
1558
|
+
medium: 0.4,
|
|
1559
|
+
low: 0.1,
|
|
1560
|
+
informational: 0.02,
|
|
1561
|
+
};
|
|
1562
|
+
const totalIssues = summary.critical +
|
|
1563
|
+
summary.high +
|
|
1564
|
+
summary.medium +
|
|
1565
|
+
summary.low +
|
|
1566
|
+
summary.informational;
|
|
1567
|
+
if (totalIssues === 0)
|
|
1568
|
+
return 0;
|
|
1569
|
+
const weightedSum = summary.critical * weights.critical +
|
|
1570
|
+
summary.high * weights.high +
|
|
1571
|
+
summary.medium * weights.medium +
|
|
1572
|
+
summary.low * weights.low +
|
|
1573
|
+
summary.informational * weights.informational;
|
|
1574
|
+
return Math.min(1, weightedSum / 10);
|
|
1575
|
+
}
|
|
1576
|
+
generateRecommendations(sast, dast, deps, secrets) {
|
|
1577
|
+
const recommendations = [];
|
|
1578
|
+
if (sast && sast.summary.critical > 0) {
|
|
1579
|
+
recommendations.push(`Address ${sast.summary.critical} critical vulnerabilities found in static analysis`);
|
|
1580
|
+
}
|
|
1581
|
+
if (dast && dast.summary.high > 0) {
|
|
1582
|
+
recommendations.push(`Fix ${dast.summary.high} high-severity issues found in dynamic testing`);
|
|
1583
|
+
}
|
|
1584
|
+
if (deps && deps.outdatedPackages.length > 5) {
|
|
1585
|
+
recommendations.push(`Update ${deps.outdatedPackages.length} outdated dependencies`);
|
|
1586
|
+
}
|
|
1587
|
+
if (secrets && secrets.secretsFound.length > 0) {
|
|
1588
|
+
recommendations.push(`Remove ${secrets.secretsFound.length} exposed secrets and rotate credentials`);
|
|
1589
|
+
}
|
|
1590
|
+
if (recommendations.length === 0) {
|
|
1591
|
+
recommendations.push('Security posture is good. Continue regular scanning.');
|
|
1592
|
+
}
|
|
1593
|
+
return recommendations;
|
|
1594
|
+
}
|
|
1595
|
+
async getRecentAudits() {
|
|
1596
|
+
// Query recent audits from memory storage
|
|
1597
|
+
const keys = await this.memory.search('security:audit:*', 10);
|
|
1598
|
+
const audits = [];
|
|
1599
|
+
for (const key of keys) {
|
|
1600
|
+
const audit = await this.memory.get(key);
|
|
1601
|
+
if (audit) {
|
|
1602
|
+
audits.push(audit);
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
return audits.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
|
|
1606
|
+
}
|
|
1607
|
+
countBySeverity(audit, severity) {
|
|
1608
|
+
if (!audit)
|
|
1609
|
+
return 0;
|
|
1610
|
+
let count = 0;
|
|
1611
|
+
if (audit.sastResults)
|
|
1612
|
+
count += audit.sastResults.summary[severity];
|
|
1613
|
+
if (audit.dastResults)
|
|
1614
|
+
count += audit.dastResults.summary[severity];
|
|
1615
|
+
if (audit.dependencyResults)
|
|
1616
|
+
count += audit.dependencyResults.summary[severity];
|
|
1617
|
+
return count;
|
|
1618
|
+
}
|
|
1619
|
+
countOpenVulnerabilities(audit) {
|
|
1620
|
+
if (!audit)
|
|
1621
|
+
return 0;
|
|
1622
|
+
let count = 0;
|
|
1623
|
+
if (audit.sastResults)
|
|
1624
|
+
count += audit.sastResults.vulnerabilities.length;
|
|
1625
|
+
if (audit.dastResults)
|
|
1626
|
+
count += audit.dastResults.vulnerabilities.length;
|
|
1627
|
+
if (audit.dependencyResults)
|
|
1628
|
+
count += audit.dependencyResults.vulnerabilities.length;
|
|
1629
|
+
return count;
|
|
1630
|
+
}
|
|
1631
|
+
calculateTrend(latest, previous) {
|
|
1632
|
+
if (!latest || !previous)
|
|
1633
|
+
return 'stable';
|
|
1634
|
+
const latestScore = this.countOpenVulnerabilities(latest);
|
|
1635
|
+
const previousScore = this.countOpenVulnerabilities(previous);
|
|
1636
|
+
if (latestScore < previousScore * 0.9)
|
|
1637
|
+
return 'improving';
|
|
1638
|
+
if (latestScore > previousScore * 1.1)
|
|
1639
|
+
return 'declining';
|
|
1640
|
+
return 'stable';
|
|
1641
|
+
}
|
|
1642
|
+
calculatePostureScore(critical, high, open) {
|
|
1643
|
+
// Start at 100, deduct points for issues
|
|
1644
|
+
let score = 100;
|
|
1645
|
+
score -= critical * 20;
|
|
1646
|
+
score -= high * 10;
|
|
1647
|
+
score -= open * 2;
|
|
1648
|
+
return Math.max(0, Math.min(100, score));
|
|
1649
|
+
}
|
|
1650
|
+
generatePostureRecommendations(critical, high, score) {
|
|
1651
|
+
const recommendations = [];
|
|
1652
|
+
if (critical > 0) {
|
|
1653
|
+
recommendations.push('Immediately address all critical vulnerabilities');
|
|
1654
|
+
}
|
|
1655
|
+
if (high > 3) {
|
|
1656
|
+
recommendations.push('Prioritize fixing high-severity issues');
|
|
1657
|
+
}
|
|
1658
|
+
if (score < 50) {
|
|
1659
|
+
recommendations.push('Consider a comprehensive security review');
|
|
1660
|
+
recommendations.push('Implement automated security scanning in CI/CD');
|
|
1661
|
+
}
|
|
1662
|
+
if (score >= 80) {
|
|
1663
|
+
recommendations.push('Maintain current security practices');
|
|
1664
|
+
recommendations.push('Consider penetration testing for deeper analysis');
|
|
1665
|
+
}
|
|
1666
|
+
return recommendations;
|
|
1667
|
+
}
|
|
1668
|
+
/**
|
|
1669
|
+
* Count vulnerabilities resolved in the last week
|
|
1670
|
+
* Calculates by comparing consecutive audit reports
|
|
1671
|
+
*/
|
|
1672
|
+
async countResolvedLastWeek() {
|
|
1673
|
+
try {
|
|
1674
|
+
const audits = await this.getRecentAudits();
|
|
1675
|
+
if (audits.length < 2)
|
|
1676
|
+
return 0;
|
|
1677
|
+
const oneWeekAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
|
|
1678
|
+
// Find audits from this week
|
|
1679
|
+
const recentAudits = audits.filter((audit) => new Date(audit.timestamp) >= oneWeekAgo);
|
|
1680
|
+
if (recentAudits.length < 2)
|
|
1681
|
+
return 0;
|
|
1682
|
+
// Compare vulnerability counts between first and last audit of the week
|
|
1683
|
+
const oldest = recentAudits[recentAudits.length - 1];
|
|
1684
|
+
const newest = recentAudits[0];
|
|
1685
|
+
const oldCount = this.countOpenVulnerabilities(oldest);
|
|
1686
|
+
const newCount = this.countOpenVulnerabilities(newest);
|
|
1687
|
+
// Resolved = old count - new count (if positive)
|
|
1688
|
+
return Math.max(0, oldCount - newCount);
|
|
1689
|
+
}
|
|
1690
|
+
catch (error) {
|
|
1691
|
+
console.error('Failed to count resolved vulnerabilities:', error);
|
|
1692
|
+
return 0;
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
/**
|
|
1696
|
+
* Calculate average resolution time from historical audit data
|
|
1697
|
+
*/
|
|
1698
|
+
async calculateAverageResolutionTime() {
|
|
1699
|
+
try {
|
|
1700
|
+
const audits = await this.getRecentAudits();
|
|
1701
|
+
if (audits.length < 2)
|
|
1702
|
+
return 72; // Default to 72 hours
|
|
1703
|
+
// Track vulnerabilities across audits to calculate resolution time
|
|
1704
|
+
const vulnFirstSeen = new Map();
|
|
1705
|
+
const resolutionTimes = [];
|
|
1706
|
+
// Process audits from oldest to newest
|
|
1707
|
+
const sortedAudits = [...audits].reverse();
|
|
1708
|
+
for (const audit of sortedAudits) {
|
|
1709
|
+
const currentVulnIds = new Set();
|
|
1710
|
+
// Collect all vulnerability IDs in this audit
|
|
1711
|
+
if (audit.sastResults) {
|
|
1712
|
+
audit.sastResults.vulnerabilities.forEach((v) => currentVulnIds.add(v.id));
|
|
1713
|
+
}
|
|
1714
|
+
if (audit.dastResults) {
|
|
1715
|
+
audit.dastResults.vulnerabilities.forEach((v) => currentVulnIds.add(v.id));
|
|
1716
|
+
}
|
|
1717
|
+
if (audit.dependencyResults) {
|
|
1718
|
+
audit.dependencyResults.vulnerabilities.forEach((v) => currentVulnIds.add(v.id));
|
|
1719
|
+
}
|
|
1720
|
+
// Track new vulnerabilities
|
|
1721
|
+
for (const vulnId of currentVulnIds) {
|
|
1722
|
+
if (!vulnFirstSeen.has(vulnId)) {
|
|
1723
|
+
vulnFirstSeen.set(vulnId, audit.timestamp);
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
// Check for resolved vulnerabilities
|
|
1727
|
+
for (const [vulnId, firstSeen] of vulnFirstSeen) {
|
|
1728
|
+
if (!currentVulnIds.has(vulnId)) {
|
|
1729
|
+
const resolutionTime = (audit.timestamp.getTime() - firstSeen.getTime()) / (1000 * 60 * 60);
|
|
1730
|
+
resolutionTimes.push(resolutionTime);
|
|
1731
|
+
vulnFirstSeen.delete(vulnId);
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
if (resolutionTimes.length === 0)
|
|
1736
|
+
return 72; // Default
|
|
1737
|
+
// Calculate average
|
|
1738
|
+
const sum = resolutionTimes.reduce((acc, time) => acc + time, 0);
|
|
1739
|
+
return Math.round(sum / resolutionTimes.length);
|
|
1740
|
+
}
|
|
1741
|
+
catch (error) {
|
|
1742
|
+
console.error('Failed to calculate average resolution time:', error);
|
|
1743
|
+
return 72; // Default to 72 hours
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
determinePriorityBucket(vuln) {
|
|
1747
|
+
const effort = vuln.remediation.estimatedEffort;
|
|
1748
|
+
if (vuln.severity === 'critical') {
|
|
1749
|
+
return 'immediate';
|
|
1750
|
+
}
|
|
1751
|
+
if (vuln.severity === 'high') {
|
|
1752
|
+
return effort === 'trivial' || effort === 'minor' ? 'immediate' : 'shortTerm';
|
|
1753
|
+
}
|
|
1754
|
+
if (vuln.severity === 'medium') {
|
|
1755
|
+
return effort === 'major' ? 'longTerm' : 'mediumTerm';
|
|
1756
|
+
}
|
|
1757
|
+
if (vuln.severity === 'low' || vuln.severity === 'informational') {
|
|
1758
|
+
return 'longTerm';
|
|
1759
|
+
}
|
|
1760
|
+
return 'accepted';
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
//# sourceMappingURL=security-auditor.js.map
|