agentic-qe 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/analysis/code-analyzer.md +209 -0
- package/.claude/agents/analysis/code-review/analyze-code-quality.md +180 -0
- package/.claude/agents/architecture/system-design/arch-system-design.md +156 -0
- package/.claude/agents/base-template-generator.md +42 -0
- package/.claude/agents/consensus/byzantine-coordinator.md +63 -0
- package/.claude/agents/consensus/crdt-synchronizer.md +997 -0
- package/.claude/agents/consensus/gossip-coordinator.md +63 -0
- package/.claude/agents/consensus/performance-benchmarker.md +851 -0
- package/.claude/agents/consensus/quorum-manager.md +823 -0
- package/.claude/agents/consensus/raft-manager.md +63 -0
- package/.claude/agents/consensus/security-manager.md +622 -0
- package/.claude/agents/core/coder.md +266 -0
- package/.claude/agents/core/planner.md +168 -0
- package/.claude/agents/core/researcher.md +190 -0
- package/.claude/agents/core/reviewer.md +326 -0
- package/.claude/agents/core/tester.md +319 -0
- package/.claude/agents/data/ml/data-ml-model.md +193 -0
- package/.claude/agents/development/backend/dev-backend-api.md +142 -0
- package/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
- package/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
- package/.claude/agents/flow-nexus/app-store.md +88 -0
- package/.claude/agents/flow-nexus/authentication.md +69 -0
- package/.claude/agents/flow-nexus/challenges.md +81 -0
- package/.claude/agents/flow-nexus/neural-network.md +88 -0
- package/.claude/agents/flow-nexus/payments.md +83 -0
- package/.claude/agents/flow-nexus/sandbox.md +76 -0
- package/.claude/agents/flow-nexus/swarm.md +76 -0
- package/.claude/agents/flow-nexus/user-tools.md +96 -0
- package/.claude/agents/flow-nexus/workflow.md +84 -0
- package/.claude/agents/github/code-review-swarm.md +538 -0
- package/.claude/agents/github/github-modes.md +173 -0
- package/.claude/agents/github/issue-tracker.md +319 -0
- package/.claude/agents/github/multi-repo-swarm.md +553 -0
- package/.claude/agents/github/pr-manager.md +191 -0
- package/.claude/agents/github/project-board-sync.md +509 -0
- package/.claude/agents/github/release-manager.md +367 -0
- package/.claude/agents/github/release-swarm.md +583 -0
- package/.claude/agents/github/repo-architect.md +398 -0
- package/.claude/agents/github/swarm-issue.md +573 -0
- package/.claude/agents/github/swarm-pr.md +428 -0
- package/.claude/agents/github/sync-coordinator.md +452 -0
- package/.claude/agents/github/workflow-automation.md +635 -0
- package/.claude/agents/goal/code-goal-planner.md +446 -0
- package/.claude/agents/goal/goal-planner.md +168 -0
- package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +130 -0
- package/.claude/agents/hive-mind/queen-coordinator.md +203 -0
- package/.claude/agents/hive-mind/scout-explorer.md +242 -0
- package/.claude/agents/hive-mind/swarm-memory-manager.md +193 -0
- package/.claude/agents/hive-mind/worker-specialist.md +217 -0
- package/.claude/agents/neural/safla-neural.md +74 -0
- package/.claude/agents/optimization/benchmark-suite.md +665 -0
- package/.claude/agents/optimization/load-balancer.md +431 -0
- package/.claude/agents/optimization/performance-monitor.md +672 -0
- package/.claude/agents/optimization/resource-allocator.md +674 -0
- package/.claude/agents/optimization/topology-optimizer.md +808 -0
- package/.claude/agents/qe-api-contract-validator.md +1088 -0
- package/.claude/agents/qe-chaos-engineer.md +736 -0
- package/.claude/agents/qe-coverage-analyzer.md +282 -0
- package/.claude/agents/qe-deployment-readiness.md +1109 -0
- package/.claude/agents/qe-flaky-test-hunter.md +1121 -0
- package/.claude/agents/qe-fleet-commander.md +641 -0
- package/.claude/agents/qe-performance-tester.md +354 -0
- package/.claude/agents/qe-production-intelligence.md +1162 -0
- package/.claude/agents/qe-quality-gate.md +294 -0
- package/.claude/agents/qe-regression-risk-analyzer.md +947 -0
- package/.claude/agents/qe-requirements-validator.md +691 -0
- package/.claude/agents/qe-security-scanner.md +430 -0
- package/.claude/agents/qe-test-data-architect.md +1007 -0
- package/.claude/agents/qe-test-executor.md +365 -0
- package/.claude/agents/qe-test-generator.md +332 -0
- package/.claude/agents/qe-visual-tester.md +754 -0
- package/.claude/agents/sparc/architecture.md +472 -0
- package/.claude/agents/sparc/pseudocode.md +318 -0
- package/.claude/agents/sparc/refinement.md +525 -0
- package/.claude/agents/sparc/specification.md +276 -0
- package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +226 -0
- package/.claude/agents/swarm/adaptive-coordinator.md +396 -0
- package/.claude/agents/swarm/hierarchical-coordinator.md +327 -0
- package/.claude/agents/swarm/mesh-coordinator.md +392 -0
- package/.claude/agents/templates/automation-smart-agent.md +205 -0
- package/.claude/agents/templates/coordinator-swarm-init.md +105 -0
- package/.claude/agents/templates/github-pr-manager.md +177 -0
- package/.claude/agents/templates/implementer-sparc-coder.md +259 -0
- package/.claude/agents/templates/memory-coordinator.md +187 -0
- package/.claude/agents/templates/migration-plan.md +746 -0
- package/.claude/agents/templates/orchestrator-task.md +139 -0
- package/.claude/agents/templates/performance-analyzer.md +199 -0
- package/.claude/agents/templates/sparc-coordinator.md +183 -0
- package/.claude/agents/testing/unit/tdd-london-swarm.md +244 -0
- package/.claude/agents/testing/validation/production-validator.md +395 -0
- package/.claude/aqe-fleet.json +47 -0
- package/.claude/commands/README.md +106 -0
- package/.claude/commands/agents/README.md +10 -0
- package/.claude/commands/agents/agent-capabilities.md +21 -0
- package/.claude/commands/agents/agent-coordination.md +28 -0
- package/.claude/commands/agents/agent-spawning.md +28 -0
- package/.claude/commands/agents/agent-types.md +26 -0
- package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +54 -0
- package/.claude/commands/analysis/README.md +9 -0
- package/.claude/commands/analysis/bottleneck-detect.md +162 -0
- package/.claude/commands/analysis/performance-bottlenecks.md +59 -0
- package/.claude/commands/analysis/performance-report.md +25 -0
- package/.claude/commands/analysis/token-efficiency.md +45 -0
- package/.claude/commands/analysis/token-usage.md +25 -0
- package/.claude/commands/aqe-analyze.md +344 -0
- package/.claude/commands/aqe-benchmark.md +466 -0
- package/.claude/commands/aqe-chaos.md +443 -0
- package/.claude/commands/aqe-execute.md +322 -0
- package/.claude/commands/aqe-fleet-status.md +431 -0
- package/.claude/commands/aqe-generate.md +301 -0
- package/.claude/commands/aqe-optimize.md +361 -0
- package/.claude/commands/aqe-report.md +411 -0
- package/.claude/commands/automation/README.md +9 -0
- package/.claude/commands/automation/auto-agent.md +122 -0
- package/.claude/commands/automation/self-healing.md +106 -0
- package/.claude/commands/automation/session-memory.md +90 -0
- package/.claude/commands/automation/smart-agents.md +73 -0
- package/.claude/commands/automation/smart-spawn.md +25 -0
- package/.claude/commands/automation/workflow-select.md +25 -0
- package/.claude/commands/coordination/README.md +9 -0
- package/.claude/commands/coordination/agent-spawn.md +25 -0
- package/.claude/commands/coordination/init.md +44 -0
- package/.claude/commands/coordination/orchestrate.md +43 -0
- package/.claude/commands/coordination/spawn.md +45 -0
- package/.claude/commands/coordination/swarm-init.md +85 -0
- package/.claude/commands/coordination/task-orchestrate.md +25 -0
- package/.claude/commands/flow-nexus/app-store.md +124 -0
- package/.claude/commands/flow-nexus/challenges.md +120 -0
- package/.claude/commands/flow-nexus/login-registration.md +65 -0
- package/.claude/commands/flow-nexus/neural-network.md +134 -0
- package/.claude/commands/flow-nexus/payments.md +116 -0
- package/.claude/commands/flow-nexus/sandbox.md +83 -0
- package/.claude/commands/flow-nexus/swarm.md +87 -0
- package/.claude/commands/flow-nexus/user-tools.md +152 -0
- package/.claude/commands/flow-nexus/workflow.md +115 -0
- package/.claude/commands/github/README.md +11 -0
- package/.claude/commands/github/code-review-swarm.md +514 -0
- package/.claude/commands/github/code-review.md +25 -0
- package/.claude/commands/github/github-modes.md +147 -0
- package/.claude/commands/github/github-swarm.md +121 -0
- package/.claude/commands/github/issue-tracker.md +292 -0
- package/.claude/commands/github/issue-triage.md +25 -0
- package/.claude/commands/github/multi-repo-swarm.md +519 -0
- package/.claude/commands/github/pr-enhance.md +26 -0
- package/.claude/commands/github/pr-manager.md +170 -0
- package/.claude/commands/github/project-board-sync.md +471 -0
- package/.claude/commands/github/release-manager.md +338 -0
- package/.claude/commands/github/release-swarm.md +544 -0
- package/.claude/commands/github/repo-analyze.md +25 -0
- package/.claude/commands/github/repo-architect.md +367 -0
- package/.claude/commands/github/swarm-issue.md +482 -0
- package/.claude/commands/github/swarm-pr.md +285 -0
- package/.claude/commands/github/sync-coordinator.md +301 -0
- package/.claude/commands/github/workflow-automation.md +442 -0
- package/.claude/commands/hive-mind/README.md +17 -0
- package/.claude/commands/hive-mind/hive-mind-consensus.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-init.md +18 -0
- package/.claude/commands/hive-mind/hive-mind-memory.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-metrics.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-resume.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-sessions.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-spawn.md +21 -0
- package/.claude/commands/hive-mind/hive-mind-status.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-stop.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-wizard.md +8 -0
- package/.claude/commands/hive-mind/hive-mind.md +27 -0
- package/.claude/commands/hooks/README.md +11 -0
- package/.claude/commands/hooks/overview.md +132 -0
- package/.claude/commands/hooks/post-edit.md +117 -0
- package/.claude/commands/hooks/post-task.md +112 -0
- package/.claude/commands/hooks/pre-edit.md +113 -0
- package/.claude/commands/hooks/pre-task.md +111 -0
- package/.claude/commands/hooks/session-end.md +118 -0
- package/.claude/commands/hooks/setup.md +103 -0
- package/.claude/commands/memory/README.md +9 -0
- package/.claude/commands/memory/memory-persist.md +25 -0
- package/.claude/commands/memory/memory-search.md +25 -0
- package/.claude/commands/memory/memory-usage.md +25 -0
- package/.claude/commands/memory/neural.md +47 -0
- package/.claude/commands/memory/usage.md +46 -0
- package/.claude/commands/monitoring/README.md +9 -0
- package/.claude/commands/monitoring/agent-metrics.md +25 -0
- package/.claude/commands/monitoring/agents.md +44 -0
- package/.claude/commands/monitoring/real-time-view.md +25 -0
- package/.claude/commands/monitoring/status.md +46 -0
- package/.claude/commands/monitoring/swarm-monitor.md +25 -0
- package/.claude/commands/optimization/README.md +9 -0
- package/.claude/commands/optimization/auto-topology.md +62 -0
- package/.claude/commands/optimization/cache-manage.md +25 -0
- package/.claude/commands/optimization/parallel-execute.md +25 -0
- package/.claude/commands/optimization/parallel-execution.md +50 -0
- package/.claude/commands/optimization/topology-optimize.md +25 -0
- package/.claude/commands/pair/commands.md +546 -0
- package/.claude/commands/pair/config.md +510 -0
- package/.claude/commands/pair/examples.md +512 -0
- package/.claude/commands/pair/modes.md +348 -0
- package/.claude/commands/pair/session.md +407 -0
- package/.claude/commands/pair/start.md +209 -0
- package/.claude/commands/sparc/analyzer.md +52 -0
- package/.claude/commands/sparc/architect.md +53 -0
- package/.claude/commands/sparc/batch-executor.md +54 -0
- package/.claude/commands/sparc/coder.md +54 -0
- package/.claude/commands/sparc/debugger.md +54 -0
- package/.claude/commands/sparc/designer.md +53 -0
- package/.claude/commands/sparc/documenter.md +54 -0
- package/.claude/commands/sparc/innovator.md +54 -0
- package/.claude/commands/sparc/memory-manager.md +54 -0
- package/.claude/commands/sparc/optimizer.md +54 -0
- package/.claude/commands/sparc/orchestrator.md +132 -0
- package/.claude/commands/sparc/researcher.md +54 -0
- package/.claude/commands/sparc/reviewer.md +54 -0
- package/.claude/commands/sparc/sparc-modes.md +174 -0
- package/.claude/commands/sparc/swarm-coordinator.md +54 -0
- package/.claude/commands/sparc/tdd.md +54 -0
- package/.claude/commands/sparc/tester.md +54 -0
- package/.claude/commands/sparc/workflow-manager.md +54 -0
- package/.claude/commands/stream-chain/pipeline.md +121 -0
- package/.claude/commands/stream-chain/run.md +70 -0
- package/.claude/commands/swarm/README.md +15 -0
- package/.claude/commands/swarm/analysis.md +95 -0
- package/.claude/commands/swarm/development.md +96 -0
- package/.claude/commands/swarm/examples.md +168 -0
- package/.claude/commands/swarm/maintenance.md +102 -0
- package/.claude/commands/swarm/optimization.md +117 -0
- package/.claude/commands/swarm/research.md +136 -0
- package/.claude/commands/swarm/swarm-analysis.md +8 -0
- package/.claude/commands/swarm/swarm-background.md +8 -0
- package/.claude/commands/swarm/swarm-init.md +19 -0
- package/.claude/commands/swarm/swarm-modes.md +8 -0
- package/.claude/commands/swarm/swarm-monitor.md +8 -0
- package/.claude/commands/swarm/swarm-spawn.md +19 -0
- package/.claude/commands/swarm/swarm-status.md +8 -0
- package/.claude/commands/swarm/swarm-strategies.md +8 -0
- package/.claude/commands/swarm/swarm.md +27 -0
- package/.claude/commands/swarm/testing.md +131 -0
- package/.claude/commands/training/README.md +9 -0
- package/.claude/commands/training/model-update.md +25 -0
- package/.claude/commands/training/neural-patterns.md +74 -0
- package/.claude/commands/training/neural-train.md +25 -0
- package/.claude/commands/training/pattern-learn.md +25 -0
- package/.claude/commands/training/specialization.md +63 -0
- package/.claude/commands/truth/start.md +143 -0
- package/.claude/commands/verify/check.md +50 -0
- package/.claude/commands/verify/start.md +128 -0
- package/.claude/commands/workflows/README.md +9 -0
- package/.claude/commands/workflows/development.md +78 -0
- package/.claude/commands/workflows/research.md +63 -0
- package/.claude/commands/workflows/workflow-create.md +25 -0
- package/.claude/commands/workflows/workflow-execute.md +25 -0
- package/.claude/commands/workflows/workflow-export.md +25 -0
- package/.claude/helpers/checkpoint-manager.sh +251 -0
- package/.claude/helpers/github-safe.js +106 -0
- package/.claude/helpers/github-setup.sh +28 -0
- package/.claude/helpers/quick-start.sh +19 -0
- package/.claude/helpers/setup-mcp.sh +18 -0
- package/.claude/helpers/standard-checkpoint-hooks.sh +179 -0
- package/.claude/settings.json +114 -0
- package/.claude/settings.local.json +10 -0
- package/CONTRIBUTING.md +897 -0
- package/LICENSE +21 -0
- package/README.md +632 -0
- package/bin/aqe +959 -0
- package/config/fleet.yaml +50 -0
- package/dist/agents/ApiContractValidatorAgent.d.ts +222 -0
- package/dist/agents/ApiContractValidatorAgent.d.ts.map +1 -0
- package/dist/agents/ApiContractValidatorAgent.js +787 -0
- package/dist/agents/ApiContractValidatorAgent.js.map +1 -0
- package/dist/agents/BaseAgent.d.ts +147 -0
- package/dist/agents/BaseAgent.d.ts.map +1 -0
- package/dist/agents/BaseAgent.js +374 -0
- package/dist/agents/BaseAgent.js.map +1 -0
- package/dist/agents/CoverageAnalyzerAgent.d.ts +103 -0
- package/dist/agents/CoverageAnalyzerAgent.d.ts.map +1 -0
- package/dist/agents/CoverageAnalyzerAgent.js +466 -0
- package/dist/agents/CoverageAnalyzerAgent.js.map +1 -0
- package/dist/agents/DeploymentReadinessAgent.d.ts +244 -0
- package/dist/agents/DeploymentReadinessAgent.d.ts.map +1 -0
- package/dist/agents/DeploymentReadinessAgent.js +974 -0
- package/dist/agents/DeploymentReadinessAgent.js.map +1 -0
- package/dist/agents/FlakyTestHunterAgent.d.ts +172 -0
- package/dist/agents/FlakyTestHunterAgent.d.ts.map +1 -0
- package/dist/agents/FlakyTestHunterAgent.js +867 -0
- package/dist/agents/FlakyTestHunterAgent.js.map +1 -0
- package/dist/agents/FleetCommanderAgent.d.ts +154 -0
- package/dist/agents/FleetCommanderAgent.d.ts.map +1 -0
- package/dist/agents/FleetCommanderAgent.js +924 -0
- package/dist/agents/FleetCommanderAgent.js.map +1 -0
- package/dist/agents/PerformanceTesterAgent.d.ts +194 -0
- package/dist/agents/PerformanceTesterAgent.d.ts.map +1 -0
- package/dist/agents/PerformanceTesterAgent.js +972 -0
- package/dist/agents/PerformanceTesterAgent.js.map +1 -0
- package/dist/agents/ProductionIntelligenceAgent.d.ts +224 -0
- package/dist/agents/ProductionIntelligenceAgent.d.ts.map +1 -0
- package/dist/agents/ProductionIntelligenceAgent.js +856 -0
- package/dist/agents/ProductionIntelligenceAgent.js.map +1 -0
- package/dist/agents/QualityAnalyzerAgent.d.ts +67 -0
- package/dist/agents/QualityAnalyzerAgent.d.ts.map +1 -0
- package/dist/agents/QualityAnalyzerAgent.js +453 -0
- package/dist/agents/QualityAnalyzerAgent.js.map +1 -0
- package/dist/agents/QualityGateAgent.d.ts +104 -0
- package/dist/agents/QualityGateAgent.d.ts.map +1 -0
- package/dist/agents/QualityGateAgent.js +522 -0
- package/dist/agents/QualityGateAgent.js.map +1 -0
- package/dist/agents/RegressionRiskAnalyzerAgent.d.ts +274 -0
- package/dist/agents/RegressionRiskAnalyzerAgent.d.ts.map +1 -0
- package/dist/agents/RegressionRiskAnalyzerAgent.js +1076 -0
- package/dist/agents/RegressionRiskAnalyzerAgent.js.map +1 -0
- package/dist/agents/RequirementsValidatorAgent.d.ts +195 -0
- package/dist/agents/RequirementsValidatorAgent.d.ts.map +1 -0
- package/dist/agents/RequirementsValidatorAgent.js +992 -0
- package/dist/agents/RequirementsValidatorAgent.js.map +1 -0
- package/dist/agents/SecurityScannerAgent.d.ts +126 -0
- package/dist/agents/SecurityScannerAgent.d.ts.map +1 -0
- package/dist/agents/SecurityScannerAgent.js +695 -0
- package/dist/agents/SecurityScannerAgent.js.map +1 -0
- package/dist/agents/TestDataArchitectAgent.d.ts +452 -0
- package/dist/agents/TestDataArchitectAgent.d.ts.map +1 -0
- package/dist/agents/TestDataArchitectAgent.js +1346 -0
- package/dist/agents/TestDataArchitectAgent.js.map +1 -0
- package/dist/agents/TestExecutorAgent.d.ts +101 -0
- package/dist/agents/TestExecutorAgent.d.ts.map +1 -0
- package/dist/agents/TestExecutorAgent.js +730 -0
- package/dist/agents/TestExecutorAgent.js.map +1 -0
- package/dist/agents/TestGeneratorAgent.d.ts +109 -0
- package/dist/agents/TestGeneratorAgent.d.ts.map +1 -0
- package/dist/agents/TestGeneratorAgent.js +450 -0
- package/dist/agents/TestGeneratorAgent.js.map +1 -0
- package/dist/agents/index.d.ts +51 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +738 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/cli/commands/analyze.d.ts +32 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +764 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/fleet.d.ts +36 -0
- package/dist/cli/commands/fleet.d.ts.map +1 -0
- package/dist/cli/commands/fleet.js +745 -0
- package/dist/cli/commands/fleet.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +24 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +424 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/init.d.ts +17 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +570 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/run.d.ts +25 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +558 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/index-spec.d.ts +3 -0
- package/dist/cli/index-spec.d.ts.map +1 -0
- package/dist/cli/index-spec.js +154 -0
- package/dist/cli/index-spec.js.map +1 -0
- package/dist/cli/index-working.d.ts +7 -0
- package/dist/cli/index-working.d.ts.map +1 -0
- package/dist/cli/index-working.js +470 -0
- package/dist/cli/index-working.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 +174 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/Agent.d.ts +189 -0
- package/dist/core/Agent.d.ts.map +1 -0
- package/dist/core/Agent.js +288 -0
- package/dist/core/Agent.js.map +1 -0
- package/dist/core/EventBus.d.ts +40 -0
- package/dist/core/EventBus.d.ts.map +1 -0
- package/dist/core/EventBus.js +114 -0
- package/dist/core/EventBus.js.map +1 -0
- package/dist/core/FleetManager.d.ts +219 -0
- package/dist/core/FleetManager.d.ts.map +1 -0
- package/dist/core/FleetManager.js +354 -0
- package/dist/core/FleetManager.js.map +1 -0
- package/dist/core/MemoryManager.d.ts +119 -0
- package/dist/core/MemoryManager.d.ts.map +1 -0
- package/dist/core/MemoryManager.js +460 -0
- package/dist/core/MemoryManager.js.map +1 -0
- package/dist/core/Task.d.ts +264 -0
- package/dist/core/Task.d.ts.map +1 -0
- package/dist/core/Task.js +397 -0
- package/dist/core/Task.js.map +1 -0
- package/dist/core/coverage-analyzer.d.ts +50 -0
- package/dist/core/coverage-analyzer.d.ts.map +1 -0
- package/dist/core/coverage-analyzer.js +146 -0
- package/dist/core/coverage-analyzer.js.map +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +20 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/quality-gate.d.ts +81 -0
- package/dist/core/quality-gate.d.ts.map +1 -0
- package/dist/core/quality-gate.js +254 -0
- package/dist/core/quality-gate.js.map +1 -0
- package/dist/coverage/coverage-collector.d.ts +62 -0
- package/dist/coverage/coverage-collector.d.ts.map +1 -0
- package/dist/coverage/coverage-collector.js +61 -0
- package/dist/coverage/coverage-collector.js.map +1 -0
- package/dist/coverage/coverage-reporter.d.ts +42 -0
- package/dist/coverage/coverage-reporter.d.ts.map +1 -0
- package/dist/coverage/coverage-reporter.js +53 -0
- package/dist/coverage/coverage-reporter.js.map +1 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +142 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/handlers/agent-spawn.d.ts +72 -0
- package/dist/mcp/handlers/agent-spawn.d.ts.map +1 -0
- package/dist/mcp/handlers/agent-spawn.js +255 -0
- package/dist/mcp/handlers/agent-spawn.js.map +1 -0
- package/dist/mcp/handlers/base-handler.d.ts +53 -0
- package/dist/mcp/handlers/base-handler.d.ts.map +1 -0
- package/dist/mcp/handlers/base-handler.js +77 -0
- package/dist/mcp/handlers/base-handler.js.map +1 -0
- package/dist/mcp/handlers/fleet-init.d.ts +55 -0
- package/dist/mcp/handlers/fleet-init.d.ts.map +1 -0
- package/dist/mcp/handlers/fleet-init.js +149 -0
- package/dist/mcp/handlers/fleet-init.js.map +1 -0
- package/dist/mcp/handlers/fleet-status.d.ts +103 -0
- package/dist/mcp/handlers/fleet-status.d.ts.map +1 -0
- package/dist/mcp/handlers/fleet-status.js +244 -0
- package/dist/mcp/handlers/fleet-status.js.map +1 -0
- package/dist/mcp/handlers/optimize-tests.d.ts +219 -0
- package/dist/mcp/handlers/optimize-tests.d.ts.map +1 -0
- package/dist/mcp/handlers/optimize-tests.js +532 -0
- package/dist/mcp/handlers/optimize-tests.js.map +1 -0
- package/dist/mcp/handlers/predict-defects.d.ts +194 -0
- package/dist/mcp/handlers/predict-defects.d.ts.map +1 -0
- package/dist/mcp/handlers/predict-defects.js +721 -0
- package/dist/mcp/handlers/predict-defects.js.map +1 -0
- package/dist/mcp/handlers/quality-analyze.d.ts +273 -0
- package/dist/mcp/handlers/quality-analyze.d.ts.map +1 -0
- package/dist/mcp/handlers/quality-analyze.js +702 -0
- package/dist/mcp/handlers/quality-analyze.js.map +1 -0
- package/dist/mcp/handlers/task-orchestrate.d.ts +152 -0
- package/dist/mcp/handlers/task-orchestrate.d.ts.map +1 -0
- package/dist/mcp/handlers/task-orchestrate.js +629 -0
- package/dist/mcp/handlers/task-orchestrate.js.map +1 -0
- package/dist/mcp/handlers/test-execute.d.ts +132 -0
- package/dist/mcp/handlers/test-execute.d.ts.map +1 -0
- package/dist/mcp/handlers/test-execute.js +436 -0
- package/dist/mcp/handlers/test-execute.js.map +1 -0
- package/dist/mcp/handlers/test-generate.d.ts +107 -0
- package/dist/mcp/handlers/test-generate.d.ts.map +1 -0
- package/dist/mcp/handlers/test-generate.js +437 -0
- package/dist/mcp/handlers/test-generate.js.map +1 -0
- package/dist/mcp/server.d.ts +99 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +214 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/services/AgentRegistry.d.ts +191 -0
- package/dist/mcp/services/AgentRegistry.d.ts.map +1 -0
- package/dist/mcp/services/AgentRegistry.js +403 -0
- package/dist/mcp/services/AgentRegistry.js.map +1 -0
- package/dist/mcp/services/HookExecutor.d.ts +165 -0
- package/dist/mcp/services/HookExecutor.d.ts.map +1 -0
- package/dist/mcp/services/HookExecutor.js +327 -0
- package/dist/mcp/services/HookExecutor.js.map +1 -0
- package/dist/mcp/start.d.ts +7 -0
- package/dist/mcp/start.d.ts.map +1 -0
- package/dist/mcp/start.js +35 -0
- package/dist/mcp/start.js.map +1 -0
- package/dist/mcp/tools.d.ts +81 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +471 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/optimization/sublinear-solver.d.ts +72 -0
- package/dist/optimization/sublinear-solver.d.ts.map +1 -0
- package/dist/optimization/sublinear-solver.js +263 -0
- package/dist/optimization/sublinear-solver.js.map +1 -0
- package/dist/scripts/verifyComplexity.d.ts +8 -0
- package/dist/scripts/verifyComplexity.d.ts.map +1 -0
- package/dist/scripts/verifyComplexity.js +56 -0
- package/dist/scripts/verifyComplexity.js.map +1 -0
- package/dist/types/api-contract.types.d.ts +273 -0
- package/dist/types/api-contract.types.d.ts.map +1 -0
- package/dist/types/api-contract.types.js +18 -0
- package/dist/types/api-contract.types.js.map +1 -0
- package/dist/types/errors.d.ts +104 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +226 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/events.d.ts +101 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +6 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +570 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +131 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/Config.d.ts +128 -0
- package/dist/utils/Config.d.ts.map +1 -0
- package/dist/utils/Config.js +232 -0
- package/dist/utils/Config.js.map +1 -0
- package/dist/utils/Database.d.ts +112 -0
- package/dist/utils/Database.d.ts.map +1 -0
- package/dist/utils/Database.js +352 -0
- package/dist/utils/Database.js.map +1 -0
- package/dist/utils/Logger.d.ts +58 -0
- package/dist/utils/Logger.d.ts.map +1 -0
- package/dist/utils/Logger.js +125 -0
- package/dist/utils/Logger.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +14 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/sublinear/coverageOptimizer.d.ts +84 -0
- package/dist/utils/sublinear/coverageOptimizer.d.ts.map +1 -0
- package/dist/utils/sublinear/coverageOptimizer.js +415 -0
- package/dist/utils/sublinear/coverageOptimizer.js.map +1 -0
- package/dist/utils/sublinear/index.d.ts +50 -0
- package/dist/utils/sublinear/index.d.ts.map +1 -0
- package/dist/utils/sublinear/index.js +390 -0
- package/dist/utils/sublinear/index.js.map +1 -0
- package/dist/utils/sublinear/matrixSolver.d.ts +132 -0
- package/dist/utils/sublinear/matrixSolver.d.ts.map +1 -0
- package/dist/utils/sublinear/matrixSolver.js +642 -0
- package/dist/utils/sublinear/matrixSolver.js.map +1 -0
- package/dist/utils/sublinear/temporalPredictor.d.ts +195 -0
- package/dist/utils/sublinear/temporalPredictor.d.ts.map +1 -0
- package/dist/utils/sublinear/temporalPredictor.js +474 -0
- package/dist/utils/sublinear/temporalPredictor.js.map +1 -0
- package/dist/utils/sublinear/testSelector.d.ts +81 -0
- package/dist/utils/sublinear/testSelector.d.ts.map +1 -0
- package/dist/utils/sublinear/testSelector.js +303 -0
- package/dist/utils/sublinear/testSelector.js.map +1 -0
- package/package.json +131 -0
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SecurityScannerAgent - Vulnerability detection and compliance validation
|
|
4
|
+
*
|
|
5
|
+
* Responsibilities:
|
|
6
|
+
* - SAST scanning (static code analysis: SonarQube, Checkmarx, Semgrep)
|
|
7
|
+
* - DAST scanning (dynamic application security: OWASP ZAP, Burp Suite)
|
|
8
|
+
* - Dependency scanning (vulnerable packages: npm audit, Snyk, Dependabot)
|
|
9
|
+
* - Container scanning (Docker image vulnerabilities: Trivy, Clair)
|
|
10
|
+
* - Compliance checking (OWASP Top 10, CWE, GDPR, SOC2)
|
|
11
|
+
* - Security gate enforcement (block deployments on critical vulnerabilities)
|
|
12
|
+
* - CVE monitoring (track known vulnerabilities)
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SecurityScannerAgent = void 0;
|
|
16
|
+
const BaseAgent_1 = require("./BaseAgent");
|
|
17
|
+
const types_1 = require("../types");
|
|
18
|
+
class SecurityScannerAgent extends BaseAgent_1.BaseAgent {
|
|
19
|
+
constructor(config) {
|
|
20
|
+
super({
|
|
21
|
+
id: config.id || `security-scanner-${Date.now()}`,
|
|
22
|
+
type: types_1.QEAgentType.SECURITY_SCANNER,
|
|
23
|
+
capabilities: [
|
|
24
|
+
{
|
|
25
|
+
name: 'sast-scanning',
|
|
26
|
+
version: '2.0.0',
|
|
27
|
+
description: 'Static application security testing (SonarQube, Checkmarx, Semgrep)'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'dast-scanning',
|
|
31
|
+
version: '2.0.0',
|
|
32
|
+
description: 'Dynamic application security testing (OWASP ZAP, Burp Suite)'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'dependency-scanning',
|
|
36
|
+
version: '2.0.0',
|
|
37
|
+
description: 'Vulnerable package detection (npm audit, Snyk, Dependabot)'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'container-scanning',
|
|
41
|
+
version: '2.0.0',
|
|
42
|
+
description: 'Docker image vulnerability scanning (Trivy, Clair)'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'compliance-checking',
|
|
46
|
+
version: '2.0.0',
|
|
47
|
+
description: 'Regulatory compliance validation (OWASP, GDPR, SOC2)'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'security-gate-enforcement',
|
|
51
|
+
version: '2.0.0',
|
|
52
|
+
description: 'Block deployments on critical vulnerabilities'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'cve-monitoring',
|
|
56
|
+
version: '2.0.0',
|
|
57
|
+
description: 'Real-time CVE database monitoring'
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
context: config.context,
|
|
61
|
+
memoryStore: config.memoryStore,
|
|
62
|
+
eventBus: config.eventBus
|
|
63
|
+
});
|
|
64
|
+
this.cveDatabase = new Map();
|
|
65
|
+
this.scanHistory = [];
|
|
66
|
+
this.baselineFindings = new Map();
|
|
67
|
+
this.config = {
|
|
68
|
+
tools: {
|
|
69
|
+
sast: 'semgrep',
|
|
70
|
+
dast: 'owasp-zap',
|
|
71
|
+
dependencies: 'npm-audit',
|
|
72
|
+
containers: 'trivy',
|
|
73
|
+
...config.tools
|
|
74
|
+
},
|
|
75
|
+
thresholds: {
|
|
76
|
+
maxCriticalVulnerabilities: 0,
|
|
77
|
+
maxHighVulnerabilities: 5,
|
|
78
|
+
maxMediumVulnerabilities: 20,
|
|
79
|
+
minSecurityScore: 80,
|
|
80
|
+
...config.thresholds
|
|
81
|
+
},
|
|
82
|
+
compliance: {
|
|
83
|
+
standards: ['OWASP-Top-10', 'CWE-25'],
|
|
84
|
+
enforceCompliance: true,
|
|
85
|
+
...config.compliance
|
|
86
|
+
},
|
|
87
|
+
scanScope: {
|
|
88
|
+
includeCode: true,
|
|
89
|
+
includeDependencies: true,
|
|
90
|
+
includeContainers: false,
|
|
91
|
+
includeDynamic: false,
|
|
92
|
+
...config.scanScope
|
|
93
|
+
},
|
|
94
|
+
...config
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
// ============================================================================
|
|
98
|
+
// BaseAgent Abstract Methods Implementation
|
|
99
|
+
// ============================================================================
|
|
100
|
+
async initializeComponents() {
|
|
101
|
+
console.log(`[SecurityScanner] Initializing security scanning tools`);
|
|
102
|
+
// Register event handlers for security coordination
|
|
103
|
+
this.registerEventHandler({
|
|
104
|
+
eventType: 'test.generated',
|
|
105
|
+
handler: async (event) => {
|
|
106
|
+
// Automatically scan newly generated tests for security issues
|
|
107
|
+
await this.handleTestGenerated(event.data);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
this.registerEventHandler({
|
|
111
|
+
eventType: 'deployment.requested',
|
|
112
|
+
handler: async (event) => {
|
|
113
|
+
// Enforce security gate before deployment
|
|
114
|
+
await this.handleDeploymentRequest(event.data);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
this.registerEventHandler({
|
|
118
|
+
eventType: 'cve.published',
|
|
119
|
+
handler: async (event) => {
|
|
120
|
+
// Monitor new CVE publications
|
|
121
|
+
await this.handleNewCVE(event.data);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
// Load CVE database
|
|
125
|
+
await this.loadCVEDatabase();
|
|
126
|
+
// Initialize scanning tools (mock initialization for now)
|
|
127
|
+
await this.initializeScanningTools();
|
|
128
|
+
// Store initialization status
|
|
129
|
+
await this.storeSharedMemory('status', {
|
|
130
|
+
initialized: true,
|
|
131
|
+
tools: this.config.tools,
|
|
132
|
+
thresholds: this.config.thresholds
|
|
133
|
+
});
|
|
134
|
+
console.log('[SecurityScanner] Initialization complete');
|
|
135
|
+
}
|
|
136
|
+
async performTask(task) {
|
|
137
|
+
console.log(`[SecurityScanner] Performing task: ${task.type}`);
|
|
138
|
+
switch (task.type) {
|
|
139
|
+
case 'run-security-scan':
|
|
140
|
+
return await this.runSecurityScan(task.payload);
|
|
141
|
+
case 'scan-dependencies':
|
|
142
|
+
return await this.scanDependencies(task.payload);
|
|
143
|
+
case 'scan-containers':
|
|
144
|
+
return await this.scanContainers(task.payload);
|
|
145
|
+
case 'check-compliance':
|
|
146
|
+
return await this.checkCompliance(task.payload);
|
|
147
|
+
case 'enforce-security-gate':
|
|
148
|
+
return await this.enforceSecurityGate(task.payload);
|
|
149
|
+
case 'generate-security-report':
|
|
150
|
+
return await this.generateSecurityReport(task.payload);
|
|
151
|
+
case 'update-baseline':
|
|
152
|
+
return await this.updateSecurityBaseline(task.payload);
|
|
153
|
+
default:
|
|
154
|
+
throw new Error(`Unknown task type: ${task.type}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
async loadKnowledge() {
|
|
158
|
+
console.log('[SecurityScanner] Loading security knowledge from memory');
|
|
159
|
+
try {
|
|
160
|
+
// Restore baseline findings
|
|
161
|
+
const savedBaseline = await this.memoryStore.retrieve('aqe/security/baselines');
|
|
162
|
+
if (savedBaseline && savedBaseline.findings) {
|
|
163
|
+
this.baselineFindings = new Map(Object.entries(savedBaseline.findings));
|
|
164
|
+
}
|
|
165
|
+
// Restore scan history
|
|
166
|
+
const savedHistory = await this.memoryStore.retrieve('aqe/security/scan-history');
|
|
167
|
+
if (savedHistory && Array.isArray(savedHistory)) {
|
|
168
|
+
this.scanHistory = savedHistory;
|
|
169
|
+
}
|
|
170
|
+
// Restore CVE database
|
|
171
|
+
const savedCVE = await this.memoryStore.retrieve('aqe/security/cve-database');
|
|
172
|
+
if (savedCVE) {
|
|
173
|
+
this.cveDatabase = new Map(Object.entries(savedCVE));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
console.warn('[SecurityScanner] Could not restore full state, using defaults:', error);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
async cleanup() {
|
|
181
|
+
console.log('[SecurityScanner] Cleaning up security scanner resources');
|
|
182
|
+
// Save baseline findings
|
|
183
|
+
await this.memoryStore.store('aqe/security/baselines', {
|
|
184
|
+
findings: Object.fromEntries(this.baselineFindings),
|
|
185
|
+
timestamp: new Date()
|
|
186
|
+
});
|
|
187
|
+
// Save scan history (keep last 50 scans)
|
|
188
|
+
await this.memoryStore.store('aqe/security/scan-history', this.scanHistory.slice(-50));
|
|
189
|
+
// Save CVE database
|
|
190
|
+
await this.memoryStore.store('aqe/security/cve-database', Object.fromEntries(this.cveDatabase));
|
|
191
|
+
// Clear in-memory data
|
|
192
|
+
this.cveDatabase.clear();
|
|
193
|
+
this.scanHistory = [];
|
|
194
|
+
this.baselineFindings.clear();
|
|
195
|
+
}
|
|
196
|
+
// ============================================================================
|
|
197
|
+
// Core Security Scanning Methods
|
|
198
|
+
// ============================================================================
|
|
199
|
+
async runSecurityScan(metadata) {
|
|
200
|
+
const startTime = Date.now();
|
|
201
|
+
const scanId = `scan-${Date.now()}`;
|
|
202
|
+
console.log(`[SecurityScanner] Running comprehensive security scan: ${scanId}`);
|
|
203
|
+
const allFindings = [];
|
|
204
|
+
// Run SAST scan
|
|
205
|
+
if (this.config.scanScope?.includeCode) {
|
|
206
|
+
const sastResults = await this.runSASTScan(metadata);
|
|
207
|
+
allFindings.push(...sastResults.findings);
|
|
208
|
+
}
|
|
209
|
+
// Run DAST scan
|
|
210
|
+
if (this.config.scanScope?.includeDynamic) {
|
|
211
|
+
const dastResults = await this.runDASTScan(metadata);
|
|
212
|
+
allFindings.push(...dastResults.findings);
|
|
213
|
+
}
|
|
214
|
+
// Run dependency scan
|
|
215
|
+
if (this.config.scanScope?.includeDependencies) {
|
|
216
|
+
const depResults = await this.scanDependencies(metadata);
|
|
217
|
+
allFindings.push(...depResults.findings);
|
|
218
|
+
}
|
|
219
|
+
// Run container scan
|
|
220
|
+
if (this.config.scanScope?.includeContainers) {
|
|
221
|
+
const containerResults = await this.scanContainers(metadata);
|
|
222
|
+
allFindings.push(...containerResults.findings);
|
|
223
|
+
}
|
|
224
|
+
// Calculate summary
|
|
225
|
+
const summary = this.calculateSummary(allFindings);
|
|
226
|
+
const securityScore = this.calculateSecurityScore(summary);
|
|
227
|
+
const passed = this.evaluateSecurityGate(summary, securityScore);
|
|
228
|
+
const result = {
|
|
229
|
+
scanId,
|
|
230
|
+
timestamp: new Date(),
|
|
231
|
+
scanType: 'comprehensive',
|
|
232
|
+
findings: allFindings,
|
|
233
|
+
summary,
|
|
234
|
+
securityScore,
|
|
235
|
+
passed,
|
|
236
|
+
duration: Date.now() - startTime
|
|
237
|
+
};
|
|
238
|
+
// Store scan result
|
|
239
|
+
this.scanHistory.push(result);
|
|
240
|
+
await this.memoryStore.store(`aqe/security/scans/${scanId}`, result);
|
|
241
|
+
// Emit events based on findings
|
|
242
|
+
if (!passed) {
|
|
243
|
+
this.emitEvent('security.scan.failed', { scanId, summary, securityScore }, 'critical');
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
this.emitEvent('security.scan.completed', { scanId, summary, securityScore }, 'medium');
|
|
247
|
+
}
|
|
248
|
+
// Alert on critical vulnerabilities
|
|
249
|
+
const criticalFindings = allFindings.filter(f => f.severity === 'critical');
|
|
250
|
+
if (criticalFindings.length > 0) {
|
|
251
|
+
this.emitEvent('security.critical.found', {
|
|
252
|
+
scanId,
|
|
253
|
+
count: criticalFindings.length,
|
|
254
|
+
findings: criticalFindings
|
|
255
|
+
}, 'critical');
|
|
256
|
+
}
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
async runSASTScan(metadata) {
|
|
260
|
+
console.log(`[SecurityScanner] Running SAST scan with ${this.config.tools?.sast}`);
|
|
261
|
+
// Mock SAST scan implementation
|
|
262
|
+
// In production, this would integrate with actual SAST tools
|
|
263
|
+
const findings = [];
|
|
264
|
+
// Simulate scanning for common vulnerabilities
|
|
265
|
+
const commonVulnerabilities = [
|
|
266
|
+
{ type: 'SQL Injection', severity: 'high', cwe: 'CWE-89' },
|
|
267
|
+
{ type: 'XSS', severity: 'high', cwe: 'CWE-79' },
|
|
268
|
+
{ type: 'Path Traversal', severity: 'medium', cwe: 'CWE-22' },
|
|
269
|
+
{ type: 'Hardcoded Secrets', severity: 'critical', cwe: 'CWE-798' }
|
|
270
|
+
];
|
|
271
|
+
// Mock: Find random vulnerabilities for testing
|
|
272
|
+
if (metadata.includeFindings !== false) {
|
|
273
|
+
const randomCount = Math.floor(Math.random() * 3);
|
|
274
|
+
for (let i = 0; i < randomCount; i++) {
|
|
275
|
+
const vuln = commonVulnerabilities[Math.floor(Math.random() * commonVulnerabilities.length)];
|
|
276
|
+
findings.push({
|
|
277
|
+
id: `sast-${Date.now()}-${i}`,
|
|
278
|
+
type: 'sast',
|
|
279
|
+
severity: vuln.severity,
|
|
280
|
+
title: vuln.type,
|
|
281
|
+
description: `Potential ${vuln.type} vulnerability detected`,
|
|
282
|
+
location: metadata.path || 'src/unknown.ts',
|
|
283
|
+
cwe: vuln.cwe,
|
|
284
|
+
remediation: `Review and sanitize input for ${vuln.type}`
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const summary = this.calculateSummary(findings);
|
|
289
|
+
return {
|
|
290
|
+
scanId: `sast-${Date.now()}`,
|
|
291
|
+
timestamp: new Date(),
|
|
292
|
+
scanType: 'sast',
|
|
293
|
+
findings,
|
|
294
|
+
summary,
|
|
295
|
+
securityScore: this.calculateSecurityScore(summary),
|
|
296
|
+
passed: summary.critical === 0,
|
|
297
|
+
duration: 1000
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
async runDASTScan(metadata) {
|
|
301
|
+
console.log(`[SecurityScanner] Running DAST scan with ${this.config.tools?.dast}`);
|
|
302
|
+
// Mock DAST scan implementation
|
|
303
|
+
const findings = [];
|
|
304
|
+
// Simulate runtime vulnerability detection
|
|
305
|
+
if (metadata.target && metadata.includeFindings !== false) {
|
|
306
|
+
// Mock: Simulate finding vulnerabilities at runtime
|
|
307
|
+
findings.push({
|
|
308
|
+
id: `dast-${Date.now()}-1`,
|
|
309
|
+
type: 'dast',
|
|
310
|
+
severity: 'medium',
|
|
311
|
+
title: 'Insecure HTTP Header',
|
|
312
|
+
description: 'Missing security headers detected',
|
|
313
|
+
location: `${metadata.target}/api/endpoint`,
|
|
314
|
+
remediation: 'Add security headers: X-Frame-Options, X-Content-Type-Options'
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
const summary = this.calculateSummary(findings);
|
|
318
|
+
return {
|
|
319
|
+
scanId: `dast-${Date.now()}`,
|
|
320
|
+
timestamp: new Date(),
|
|
321
|
+
scanType: 'dast',
|
|
322
|
+
findings,
|
|
323
|
+
summary,
|
|
324
|
+
securityScore: this.calculateSecurityScore(summary),
|
|
325
|
+
passed: summary.critical === 0,
|
|
326
|
+
duration: 2000
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
async scanDependencies(metadata) {
|
|
330
|
+
console.log(`[SecurityScanner] Scanning dependencies with ${this.config.tools?.dependencies}`);
|
|
331
|
+
const findings = [];
|
|
332
|
+
// Mock dependency scan
|
|
333
|
+
// In production, integrate with npm audit, Snyk, etc.
|
|
334
|
+
if (metadata.includeFindings !== false) {
|
|
335
|
+
findings.push({
|
|
336
|
+
id: `dep-${Date.now()}-1`,
|
|
337
|
+
type: 'dependency',
|
|
338
|
+
severity: 'high',
|
|
339
|
+
title: 'Vulnerable Package: lodash',
|
|
340
|
+
description: 'Prototype pollution vulnerability in lodash < 4.17.21',
|
|
341
|
+
location: 'package.json',
|
|
342
|
+
cve: 'CVE-2020-8203',
|
|
343
|
+
cvss: 7.4,
|
|
344
|
+
remediation: 'Update lodash to version 4.17.21 or higher',
|
|
345
|
+
references: ['https://nvd.nist.gov/vuln/detail/CVE-2020-8203']
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
const summary = this.calculateSummary(findings);
|
|
349
|
+
// Store dependency scan results
|
|
350
|
+
await this.memoryStore.store('aqe/security/dependencies', {
|
|
351
|
+
findings,
|
|
352
|
+
timestamp: new Date(),
|
|
353
|
+
summary
|
|
354
|
+
});
|
|
355
|
+
return {
|
|
356
|
+
scanId: `dep-${Date.now()}`,
|
|
357
|
+
timestamp: new Date(),
|
|
358
|
+
scanType: 'dependency',
|
|
359
|
+
findings,
|
|
360
|
+
summary,
|
|
361
|
+
securityScore: this.calculateSecurityScore(summary),
|
|
362
|
+
passed: summary.critical === 0 && summary.high <= this.config.thresholds.maxHighVulnerabilities,
|
|
363
|
+
duration: 500
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
async scanContainers(metadata) {
|
|
367
|
+
console.log(`[SecurityScanner] Scanning containers with ${this.config.tools?.containers}`);
|
|
368
|
+
const findings = [];
|
|
369
|
+
// Mock container scan
|
|
370
|
+
if (metadata.image && metadata.includeFindings !== false) {
|
|
371
|
+
findings.push({
|
|
372
|
+
id: `container-${Date.now()}-1`,
|
|
373
|
+
type: 'container',
|
|
374
|
+
severity: 'medium',
|
|
375
|
+
title: 'Outdated Base Image',
|
|
376
|
+
description: 'Base image contains known vulnerabilities',
|
|
377
|
+
location: `${metadata.image}:latest`,
|
|
378
|
+
remediation: 'Update to latest base image version'
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
const summary = this.calculateSummary(findings);
|
|
382
|
+
return {
|
|
383
|
+
scanId: `container-${Date.now()}`,
|
|
384
|
+
timestamp: new Date(),
|
|
385
|
+
scanType: 'container',
|
|
386
|
+
findings,
|
|
387
|
+
summary,
|
|
388
|
+
securityScore: this.calculateSecurityScore(summary),
|
|
389
|
+
passed: summary.critical === 0,
|
|
390
|
+
duration: 1500
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
// ============================================================================
|
|
394
|
+
// Compliance Checking
|
|
395
|
+
// ============================================================================
|
|
396
|
+
async checkCompliance(metadata) {
|
|
397
|
+
console.log(`[SecurityScanner] Checking compliance for standards:`, this.config.compliance?.standards);
|
|
398
|
+
const reports = [];
|
|
399
|
+
for (const standard of this.config.compliance?.standards || []) {
|
|
400
|
+
const report = await this.checkStandardCompliance(standard, metadata);
|
|
401
|
+
reports.push(report);
|
|
402
|
+
// Store compliance report
|
|
403
|
+
await this.memoryStore.store(`aqe/security/compliance/${standard}`, report);
|
|
404
|
+
// Emit events
|
|
405
|
+
if (!report.passed && this.config.compliance?.enforceCompliance) {
|
|
406
|
+
this.emitEvent('security.compliance.failed', {
|
|
407
|
+
standard,
|
|
408
|
+
compliance: report.overallCompliance,
|
|
409
|
+
violations: report.requirements.filter(r => r.status === 'non-compliant').length
|
|
410
|
+
}, 'high');
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return reports;
|
|
414
|
+
}
|
|
415
|
+
async checkStandardCompliance(standard, metadata) {
|
|
416
|
+
console.log(`[SecurityScanner] Checking ${standard} compliance`);
|
|
417
|
+
const requirements = this.getStandardRequirements(standard);
|
|
418
|
+
const report = {
|
|
419
|
+
standard,
|
|
420
|
+
requirements: [],
|
|
421
|
+
overallCompliance: 0,
|
|
422
|
+
passed: false
|
|
423
|
+
};
|
|
424
|
+
// Check each requirement
|
|
425
|
+
for (const req of requirements) {
|
|
426
|
+
const status = await this.checkRequirement(req, metadata);
|
|
427
|
+
report.requirements.push({
|
|
428
|
+
id: req.id,
|
|
429
|
+
description: req.description,
|
|
430
|
+
status
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
// Calculate overall compliance
|
|
434
|
+
const compliantCount = report.requirements.filter(r => r.status === 'compliant').length;
|
|
435
|
+
report.overallCompliance = (compliantCount / report.requirements.length) * 100;
|
|
436
|
+
report.passed = report.overallCompliance >= 95; // 95% compliance threshold
|
|
437
|
+
return report;
|
|
438
|
+
}
|
|
439
|
+
getStandardRequirements(standard) {
|
|
440
|
+
// Mock compliance requirements
|
|
441
|
+
const requirementsMap = {
|
|
442
|
+
'OWASP-Top-10': [
|
|
443
|
+
{ id: 'A01', description: 'Broken Access Control' },
|
|
444
|
+
{ id: 'A02', description: 'Cryptographic Failures' },
|
|
445
|
+
{ id: 'A03', description: 'Injection' },
|
|
446
|
+
{ id: 'A04', description: 'Insecure Design' },
|
|
447
|
+
{ id: 'A05', description: 'Security Misconfiguration' }
|
|
448
|
+
],
|
|
449
|
+
'CWE-25': [
|
|
450
|
+
{ id: 'CWE-79', description: 'Cross-site Scripting (XSS)' },
|
|
451
|
+
{ id: 'CWE-89', description: 'SQL Injection' },
|
|
452
|
+
{ id: 'CWE-22', description: 'Path Traversal' }
|
|
453
|
+
],
|
|
454
|
+
'GDPR': [
|
|
455
|
+
{ id: 'Art-25', description: 'Data Protection by Design' },
|
|
456
|
+
{ id: 'Art-32', description: 'Security of Processing' }
|
|
457
|
+
],
|
|
458
|
+
'SOC2': [
|
|
459
|
+
{ id: 'CC6.1', description: 'Logical and Physical Access Controls' },
|
|
460
|
+
{ id: 'CC7.1', description: 'System Operations' }
|
|
461
|
+
]
|
|
462
|
+
};
|
|
463
|
+
return requirementsMap[standard] || [];
|
|
464
|
+
}
|
|
465
|
+
async checkRequirement(req, metadata) {
|
|
466
|
+
// Mock requirement checking
|
|
467
|
+
// In production, this would perform actual compliance checks
|
|
468
|
+
return Math.random() > 0.1 ? 'compliant' : 'non-compliant';
|
|
469
|
+
}
|
|
470
|
+
// ============================================================================
|
|
471
|
+
// Security Gate Enforcement
|
|
472
|
+
// ============================================================================
|
|
473
|
+
async enforceSecurityGate(metadata) {
|
|
474
|
+
console.log(`[SecurityScanner] Enforcing security gate`);
|
|
475
|
+
// Run security scan
|
|
476
|
+
const scanResult = await this.runSecurityScan(metadata);
|
|
477
|
+
// Check thresholds
|
|
478
|
+
const blockers = [];
|
|
479
|
+
if (scanResult.summary.critical > this.config.thresholds.maxCriticalVulnerabilities) {
|
|
480
|
+
blockers.push(...scanResult.findings.filter(f => f.severity === 'critical'));
|
|
481
|
+
}
|
|
482
|
+
if (scanResult.summary.high > this.config.thresholds.maxHighVulnerabilities) {
|
|
483
|
+
const highBlockers = scanResult.findings
|
|
484
|
+
.filter(f => f.severity === 'high')
|
|
485
|
+
.slice(0, scanResult.summary.high - this.config.thresholds.maxHighVulnerabilities);
|
|
486
|
+
blockers.push(...highBlockers);
|
|
487
|
+
}
|
|
488
|
+
if (scanResult.securityScore < this.config.thresholds.minSecurityScore) {
|
|
489
|
+
// Security score too low
|
|
490
|
+
}
|
|
491
|
+
const passed = blockers.length === 0 && scanResult.securityScore >= this.config.thresholds.minSecurityScore;
|
|
492
|
+
if (!passed) {
|
|
493
|
+
this.emitEvent('security.gate.failed', {
|
|
494
|
+
scanId: scanResult.scanId,
|
|
495
|
+
blockers: blockers.length,
|
|
496
|
+
securityScore: scanResult.securityScore
|
|
497
|
+
}, 'critical');
|
|
498
|
+
}
|
|
499
|
+
return {
|
|
500
|
+
passed,
|
|
501
|
+
reason: passed ? undefined : `${blockers.length} blocker(s) found, security score: ${scanResult.securityScore}`,
|
|
502
|
+
blockers
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
// ============================================================================
|
|
506
|
+
// Reporting & Analysis
|
|
507
|
+
// ============================================================================
|
|
508
|
+
async generateSecurityReport(metadata) {
|
|
509
|
+
console.log(`[SecurityScanner] Generating security report`);
|
|
510
|
+
const recentScans = this.scanHistory.slice(-10);
|
|
511
|
+
const latestScan = recentScans[recentScans.length - 1];
|
|
512
|
+
// Calculate trends
|
|
513
|
+
const avgSecurityScore = recentScans.reduce((sum, scan) => sum + scan.securityScore, 0) / recentScans.length;
|
|
514
|
+
const totalFindings = recentScans.reduce((sum, scan) => sum + scan.summary.total, 0);
|
|
515
|
+
const report = {
|
|
516
|
+
generatedAt: new Date(),
|
|
517
|
+
period: {
|
|
518
|
+
from: recentScans[0]?.timestamp,
|
|
519
|
+
to: latestScan?.timestamp
|
|
520
|
+
},
|
|
521
|
+
summary: {
|
|
522
|
+
totalScans: recentScans.length,
|
|
523
|
+
averageSecurityScore: avgSecurityScore,
|
|
524
|
+
totalFindings,
|
|
525
|
+
criticalFindings: recentScans.reduce((sum, scan) => sum + scan.summary.critical, 0)
|
|
526
|
+
},
|
|
527
|
+
latestScan: latestScan ? {
|
|
528
|
+
scanId: latestScan.scanId,
|
|
529
|
+
timestamp: latestScan.timestamp,
|
|
530
|
+
securityScore: latestScan.securityScore,
|
|
531
|
+
findings: latestScan.summary
|
|
532
|
+
} : null,
|
|
533
|
+
trends: {
|
|
534
|
+
securityScoreImprovement: recentScans.length > 1 ?
|
|
535
|
+
latestScan.securityScore - recentScans[0].securityScore : 0
|
|
536
|
+
},
|
|
537
|
+
recommendations: this.generateRecommendations(latestScan)
|
|
538
|
+
};
|
|
539
|
+
// Store report
|
|
540
|
+
await this.memoryStore.store('aqe/security/reports/latest', report);
|
|
541
|
+
return report;
|
|
542
|
+
}
|
|
543
|
+
async updateSecurityBaseline(metadata) {
|
|
544
|
+
console.log(`[SecurityScanner] Updating security baseline`);
|
|
545
|
+
const latestScan = this.scanHistory[this.scanHistory.length - 1];
|
|
546
|
+
if (!latestScan) {
|
|
547
|
+
throw new Error('No scan results available to set as baseline');
|
|
548
|
+
}
|
|
549
|
+
// Store findings as baseline
|
|
550
|
+
this.baselineFindings.clear();
|
|
551
|
+
for (const finding of latestScan.findings) {
|
|
552
|
+
this.baselineFindings.set(finding.id, finding);
|
|
553
|
+
}
|
|
554
|
+
// Store baseline in memory
|
|
555
|
+
await this.memoryStore.store('aqe/security/baselines', {
|
|
556
|
+
scanId: latestScan.scanId,
|
|
557
|
+
timestamp: new Date(),
|
|
558
|
+
findings: Object.fromEntries(this.baselineFindings),
|
|
559
|
+
summary: latestScan.summary,
|
|
560
|
+
securityScore: latestScan.securityScore
|
|
561
|
+
});
|
|
562
|
+
this.emitEvent('security.baseline.updated', {
|
|
563
|
+
scanId: latestScan.scanId,
|
|
564
|
+
findingsCount: this.baselineFindings.size,
|
|
565
|
+
securityScore: latestScan.securityScore
|
|
566
|
+
}, 'medium');
|
|
567
|
+
}
|
|
568
|
+
// ============================================================================
|
|
569
|
+
// Helper Methods
|
|
570
|
+
// ============================================================================
|
|
571
|
+
calculateSummary(findings) {
|
|
572
|
+
return {
|
|
573
|
+
critical: findings.filter(f => f.severity === 'critical').length,
|
|
574
|
+
high: findings.filter(f => f.severity === 'high').length,
|
|
575
|
+
medium: findings.filter(f => f.severity === 'medium').length,
|
|
576
|
+
low: findings.filter(f => f.severity === 'low').length,
|
|
577
|
+
info: findings.filter(f => f.severity === 'info').length,
|
|
578
|
+
total: findings.length
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
calculateSecurityScore(summary) {
|
|
582
|
+
// Calculate security score (0-100)
|
|
583
|
+
// Weighted scoring: critical=-50, high=-10, medium=-3, low=-1
|
|
584
|
+
const score = 100 -
|
|
585
|
+
(summary.critical * 50) -
|
|
586
|
+
(summary.high * 10) -
|
|
587
|
+
(summary.medium * 3) -
|
|
588
|
+
(summary.low * 1);
|
|
589
|
+
return Math.max(0, Math.min(100, score));
|
|
590
|
+
}
|
|
591
|
+
evaluateSecurityGate(summary, securityScore) {
|
|
592
|
+
return (summary.critical <= this.config.thresholds.maxCriticalVulnerabilities &&
|
|
593
|
+
summary.high <= this.config.thresholds.maxHighVulnerabilities &&
|
|
594
|
+
summary.medium <= this.config.thresholds.maxMediumVulnerabilities &&
|
|
595
|
+
securityScore >= this.config.thresholds.minSecurityScore);
|
|
596
|
+
}
|
|
597
|
+
generateRecommendations(scanResult) {
|
|
598
|
+
const recommendations = [];
|
|
599
|
+
if (!scanResult) {
|
|
600
|
+
recommendations.push('Run initial security scan to establish baseline');
|
|
601
|
+
return recommendations;
|
|
602
|
+
}
|
|
603
|
+
if (scanResult.summary.critical > 0) {
|
|
604
|
+
recommendations.push(`Address ${scanResult.summary.critical} critical vulnerabilities immediately`);
|
|
605
|
+
}
|
|
606
|
+
if (scanResult.summary.high > 5) {
|
|
607
|
+
recommendations.push(`Prioritize fixing high severity vulnerabilities (${scanResult.summary.high} found)`);
|
|
608
|
+
}
|
|
609
|
+
if (scanResult.securityScore < 80) {
|
|
610
|
+
recommendations.push(`Improve security score to above 80 (current: ${scanResult.securityScore})`);
|
|
611
|
+
}
|
|
612
|
+
if (this.config.scanScope?.includeDependencies && scanResult.findings.some(f => f.type === 'dependency')) {
|
|
613
|
+
recommendations.push('Update vulnerable dependencies to latest secure versions');
|
|
614
|
+
}
|
|
615
|
+
if (recommendations.length === 0) {
|
|
616
|
+
recommendations.push('Maintain current security posture with regular scans');
|
|
617
|
+
}
|
|
618
|
+
return recommendations;
|
|
619
|
+
}
|
|
620
|
+
async loadCVEDatabase() {
|
|
621
|
+
// Mock CVE database loading
|
|
622
|
+
// In production, this would fetch from NVD or similar
|
|
623
|
+
console.log('[SecurityScanner] Loading CVE database');
|
|
624
|
+
const mockCVEs = [
|
|
625
|
+
{
|
|
626
|
+
id: 'cve-2020-8203',
|
|
627
|
+
cve: 'CVE-2020-8203',
|
|
628
|
+
severity: 'high',
|
|
629
|
+
description: 'Prototype pollution in lodash',
|
|
630
|
+
affectedPackages: ['lodash'],
|
|
631
|
+
publishedDate: new Date('2020-07-15'),
|
|
632
|
+
lastModifiedDate: new Date('2021-07-21')
|
|
633
|
+
}
|
|
634
|
+
];
|
|
635
|
+
for (const cve of mockCVEs) {
|
|
636
|
+
this.cveDatabase.set(cve.id, cve);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
async initializeScanningTools() {
|
|
640
|
+
// Mock tool initialization
|
|
641
|
+
console.log('[SecurityScanner] Initializing scanning tools:', this.config.tools);
|
|
642
|
+
// In production, this would set up connections to actual scanning tools
|
|
643
|
+
}
|
|
644
|
+
async handleTestGenerated(data) {
|
|
645
|
+
console.log('[SecurityScanner] Auto-scanning newly generated tests');
|
|
646
|
+
// Automatically scan new test code for security issues
|
|
647
|
+
}
|
|
648
|
+
async handleDeploymentRequest(data) {
|
|
649
|
+
console.log('[SecurityScanner] Enforcing security gate for deployment');
|
|
650
|
+
const gateResult = await this.enforceSecurityGate(data);
|
|
651
|
+
if (!gateResult.passed) {
|
|
652
|
+
this.emitEvent('deployment.blocked', {
|
|
653
|
+
reason: 'security-gate-failed',
|
|
654
|
+
blockers: gateResult.blockers.length
|
|
655
|
+
}, 'critical');
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
async handleNewCVE(data) {
|
|
659
|
+
console.log('[SecurityScanner] Processing new CVE:', data.cve);
|
|
660
|
+
if (data.cve) {
|
|
661
|
+
this.cveDatabase.set(data.cve.id, data.cve);
|
|
662
|
+
// Check if any dependencies are affected
|
|
663
|
+
const affectedDeps = await this.checkAffectedDependencies(data.cve);
|
|
664
|
+
if (affectedDeps.length > 0) {
|
|
665
|
+
this.emitEvent('security.cve.affected', {
|
|
666
|
+
cve: data.cve.cve,
|
|
667
|
+
affectedPackages: affectedDeps
|
|
668
|
+
}, 'high');
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
async checkAffectedDependencies(cve) {
|
|
673
|
+
// Mock: Check if project dependencies are affected by CVE
|
|
674
|
+
return [];
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Get detailed security scanner status
|
|
678
|
+
*/
|
|
679
|
+
async getDetailedStatus() {
|
|
680
|
+
return {
|
|
681
|
+
...this.getStatus(),
|
|
682
|
+
scanHistory: this.scanHistory.slice(-10),
|
|
683
|
+
baselineFindings: this.baselineFindings.size,
|
|
684
|
+
cveDatabase: this.cveDatabase.size,
|
|
685
|
+
config: {
|
|
686
|
+
tools: this.config.tools,
|
|
687
|
+
thresholds: this.config.thresholds,
|
|
688
|
+
compliance: this.config.compliance,
|
|
689
|
+
scanScope: this.config.scanScope
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
exports.SecurityScannerAgent = SecurityScannerAgent;
|
|
695
|
+
//# sourceMappingURL=SecurityScannerAgent.js.map
|