claude-flow 2.0.0-alpha.61 → 2.0.0-alpha.63
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/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +54 -0
- package/.claude/commands/analysis/token-efficiency.md +2 -1
- package/.claude/commands/automation/self-healing.md +47 -2
- package/.claude/commands/automation/session-memory.md +39 -10
- package/.claude/commands/automation/smart-agents.md +36 -8
- package/.claude/commands/github/code-review-swarm.md +80 -15
- package/.claude/commands/github/github-modes.md +14 -14
- package/.claude/commands/github/issue-tracker.md +19 -16
- package/.claude/commands/github/multi-repo-swarm.md +114 -16
- package/.claude/commands/github/pr-manager.md +5 -4
- package/.claude/commands/github/project-board-sync.md +38 -5
- package/.claude/commands/github/release-manager.md +19 -19
- package/.claude/commands/github/release-swarm.md +102 -13
- package/.claude/commands/github/repo-architect.md +6 -6
- package/.claude/commands/github/swarm-issue.md +139 -17
- package/.claude/commands/github/swarm-pr.md +49 -15
- package/.claude/commands/github/sync-coordinator.md +33 -33
- package/.claude/commands/github/workflow-automation.md +37 -10
- package/.claude/commands/hooks/overview.md +2 -2
- package/.claude/commands/hooks/setup.md +7 -7
- package/.claude/commands/memory/neural.md +10 -5
- package/.claude/commands/memory/usage.md +9 -5
- package/.claude/commands/monitoring/agents.md +7 -5
- package/.claude/commands/monitoring/status.md +8 -5
- package/.claude/commands/optimization/auto-topology.md +13 -1
- package/.claude/commands/optimization/parallel-execution.md +7 -1
- package/.claude/commands/sparc/analyzer.md +28 -2
- package/.claude/commands/sparc/architect.md +27 -1
- package/.claude/commands/sparc/batch-executor.md +27 -1
- package/.claude/commands/sparc/coder.md +27 -1
- package/.claude/commands/sparc/debugger.md +27 -1
- package/.claude/commands/sparc/designer.md +27 -1
- package/.claude/commands/sparc/documenter.md +27 -1
- package/.claude/commands/sparc/innovator.md +27 -1
- package/.claude/commands/sparc/memory-manager.md +27 -1
- package/.claude/commands/sparc/optimizer.md +27 -1
- package/.claude/commands/sparc/orchestrator.md +106 -2
- package/.claude/commands/sparc/researcher.md +27 -1
- package/.claude/commands/sparc/reviewer.md +27 -1
- package/.claude/commands/sparc/sparc-modes.md +137 -5
- package/.claude/commands/sparc/swarm-coordinator.md +27 -1
- package/.claude/commands/sparc/tdd.md +27 -1
- package/.claude/commands/sparc/tester.md +27 -1
- package/.claude/commands/sparc/workflow-manager.md +27 -1
- package/.claude/commands/swarm/analysis.md +82 -5
- package/.claude/commands/swarm/development.md +83 -6
- package/.claude/commands/swarm/examples.md +141 -3
- package/.claude/commands/swarm/maintenance.md +92 -8
- package/.claude/commands/swarm/optimization.md +107 -9
- package/.claude/commands/swarm/research.md +126 -8
- package/.claude/commands/swarm/testing.md +121 -9
- package/.claude/commands/training/neural-patterns.md +27 -2
- package/.claude/commands/training/specialization.md +13 -3
- package/.claude/commands/workflows/development.md +43 -4
- package/.claude/commands/workflows/research.md +26 -2
- package/CHANGELOG.md +59 -1
- package/README.md +8 -0
- package/bin/claude-flow +1 -1
- package/dist/adapters/cliffy-node.d.ts.map +1 -1
- package/dist/adapters/cliffy-node.js +13 -7
- package/dist/adapters/cliffy-node.js.map +1 -1
- package/dist/agents/agent-manager.d.ts.map +1 -1
- package/dist/agents/agent-manager.js +77 -65
- package/dist/agents/agent-manager.js.map +1 -1
- package/dist/agents/agent-registry.d.ts.map +1 -1
- package/dist/agents/agent-registry.js +38 -30
- package/dist/agents/agent-registry.js.map +1 -1
- package/dist/api/claude-client.d.ts.map +1 -1
- package/dist/api/claude-client.js +22 -16
- package/dist/api/claude-client.js.map +1 -1
- package/dist/cli/agents/analyst.d.ts.map +1 -1
- package/dist/cli/agents/analyst.js +94 -114
- package/dist/cli/agents/analyst.js.map +1 -1
- package/dist/cli/agents/architect.d.ts.map +1 -1
- package/dist/cli/agents/architect.js +100 -114
- package/dist/cli/agents/architect.js.map +1 -1
- package/dist/cli/agents/base-agent.d.ts.map +1 -1
- package/dist/cli/agents/base-agent.js +27 -27
- package/dist/cli/agents/base-agent.js.map +1 -1
- package/dist/cli/agents/capabilities.d.ts.map +1 -1
- package/dist/cli/agents/capabilities.js +49 -51
- package/dist/cli/agents/capabilities.js.map +1 -1
- package/dist/cli/agents/coder.d.ts.map +1 -1
- package/dist/cli/agents/coder.js +92 -98
- package/dist/cli/agents/coder.js.map +1 -1
- package/dist/cli/agents/coordinator.d.ts.map +1 -1
- package/dist/cli/agents/coordinator.js +59 -64
- package/dist/cli/agents/coordinator.js.map +1 -1
- package/dist/cli/agents/hive-agents.d.ts.map +1 -1
- package/dist/cli/agents/hive-agents.js +22 -24
- package/dist/cli/agents/hive-agents.js.map +1 -1
- package/dist/cli/agents/index.d.ts.map +1 -1
- package/dist/cli/agents/index.js +17 -17
- package/dist/cli/agents/index.js.map +1 -1
- package/dist/cli/agents/researcher.d.ts.map +1 -1
- package/dist/cli/agents/researcher.js +41 -61
- package/dist/cli/agents/researcher.js.map +1 -1
- package/dist/cli/agents/tester.d.ts.map +1 -1
- package/dist/cli/agents/tester.js +78 -90
- package/dist/cli/agents/tester.js.map +1 -1
- package/dist/cli/cli-core.d.ts +4 -1
- package/dist/cli/cli-core.d.ts.map +1 -1
- package/dist/cli/cli-core.js +40 -39
- package/dist/cli/cli-core.js.map +1 -1
- package/dist/cli/command-registry.d.ts.map +1 -1
- package/dist/cli/command-registry.js +55 -64
- package/dist/cli/command-registry.js.map +1 -1
- package/dist/cli/commands/advanced-memory-commands.d.ts.map +1 -1
- package/dist/cli/commands/advanced-memory-commands.js +49 -40
- package/dist/cli/commands/advanced-memory-commands.js.map +1 -1
- package/dist/cli/commands/agent-simple.d.ts +3 -0
- package/dist/cli/commands/agent-simple.d.ts.map +1 -1
- package/dist/cli/commands/agent-simple.js +30 -27
- package/dist/cli/commands/agent-simple.js.map +1 -1
- package/dist/cli/commands/agent.d.ts.map +1 -1
- package/dist/cli/commands/agent.js +53 -40
- package/dist/cli/commands/agent.js.map +1 -1
- package/dist/cli/commands/claude-api.js +4 -4
- package/dist/cli/commands/claude-api.js.map +1 -1
- package/dist/cli/commands/claude.d.ts.map +1 -1
- package/dist/cli/commands/claude.js +2 -2
- package/dist/cli/commands/claude.js.map +1 -1
- package/dist/cli/commands/config-integration.d.ts +7 -1
- package/dist/cli/commands/config-integration.d.ts.map +1 -1
- package/dist/cli/commands/config-integration.js +18 -9
- package/dist/cli/commands/config-integration.js.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +2 -3
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/enterprise.d.ts.map +1 -1
- package/dist/cli/commands/enterprise.js +115 -95
- package/dist/cli/commands/enterprise.js.map +1 -1
- package/dist/cli/commands/help-new.js +49 -49
- package/dist/cli/commands/help-new.js.map +1 -1
- package/dist/cli/commands/help.d.ts.map +1 -1
- package/dist/cli/commands/help.js +122 -125
- package/dist/cli/commands/help.js.map +1 -1
- package/dist/cli/commands/hive-mind/index.d.ts +1 -1
- package/dist/cli/commands/hive-mind/index.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/index.js +1 -1
- package/dist/cli/commands/hive-mind/index.js.map +1 -1
- package/dist/cli/commands/hive-mind/init.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/init.js.map +1 -1
- package/dist/cli/commands/hive-mind/optimize-memory.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/optimize-memory.js +35 -26
- package/dist/cli/commands/hive-mind/optimize-memory.js.map +1 -1
- package/dist/cli/commands/hive-mind/pause.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/pause.js +8 -6
- package/dist/cli/commands/hive-mind/pause.js.map +1 -1
- package/dist/cli/commands/hive-mind/ps.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/ps.js +17 -12
- package/dist/cli/commands/hive-mind/ps.js.map +1 -1
- package/dist/cli/commands/hive-mind/resume.js +12 -10
- package/dist/cli/commands/hive-mind/resume.js.map +1 -1
- package/dist/cli/commands/hive-mind/spawn.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/spawn.js +20 -11
- package/dist/cli/commands/hive-mind/spawn.js.map +1 -1
- package/dist/cli/commands/hive-mind/status.js +17 -22
- package/dist/cli/commands/hive-mind/status.js.map +1 -1
- package/dist/cli/commands/hive-mind/stop.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/stop.js +23 -15
- package/dist/cli/commands/hive-mind/stop.js.map +1 -1
- package/dist/cli/commands/hive-mind/task.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/task.js +25 -19
- package/dist/cli/commands/hive-mind/task.js.map +1 -1
- package/dist/cli/commands/hive-mind/wizard.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/wizard.js +86 -68
- package/dist/cli/commands/hive-mind/wizard.js.map +1 -1
- package/dist/cli/commands/hive.js +73 -38
- package/dist/cli/commands/hive.js.map +1 -1
- package/dist/cli/commands/hook-validator.d.ts.map +1 -1
- package/dist/cli/commands/hook-validator.js +4 -2
- package/dist/cli/commands/hook-validator.js.map +1 -1
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +8 -8
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +850 -784
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/commands/mcp.js +8 -16
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/memory.d.ts.map +1 -1
- package/dist/cli/commands/memory.js +8 -8
- package/dist/cli/commands/memory.js.map +1 -1
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +3 -3
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands/monitor.d.ts.map +1 -1
- package/dist/cli/commands/monitor.js +50 -34
- package/dist/cli/commands/monitor.js.map +1 -1
- package/dist/cli/commands/ruv-swarm.d.ts +7 -1
- package/dist/cli/commands/ruv-swarm.d.ts.map +1 -1
- package/dist/cli/commands/ruv-swarm.js +6 -6
- package/dist/cli/commands/ruv-swarm.js.map +1 -1
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +22 -17
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/sparc.d.ts +1 -1
- package/dist/cli/commands/sparc.d.ts.map +1 -1
- package/dist/cli/commands/sparc.js +146 -126
- package/dist/cli/commands/sparc.js.map +1 -1
- package/dist/cli/commands/start/event-emitter.js +1 -1
- package/dist/cli/commands/start/event-emitter.js.map +1 -1
- package/dist/cli/commands/start/process-manager.d.ts.map +1 -1
- package/dist/cli/commands/start/process-manager.js +20 -18
- package/dist/cli/commands/start/process-manager.js.map +1 -1
- package/dist/cli/commands/start/process-ui-simple.d.ts +4 -0
- package/dist/cli/commands/start/process-ui-simple.d.ts.map +1 -1
- package/dist/cli/commands/start/process-ui-simple.js +2 -2
- package/dist/cli/commands/start/process-ui-simple.js.map +1 -1
- package/dist/cli/commands/start/start-command.d.ts.map +1 -1
- package/dist/cli/commands/start/start-command.js +27 -15
- package/dist/cli/commands/start/start-command.js.map +1 -1
- package/dist/cli/commands/start/system-monitor.d.ts +3 -0
- package/dist/cli/commands/start/system-monitor.d.ts.map +1 -1
- package/dist/cli/commands/start/system-monitor.js +16 -18
- package/dist/cli/commands/start/system-monitor.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +28 -33
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/swarm-spawn.d.ts.map +1 -1
- package/dist/cli/commands/swarm-spawn.js +1 -1
- package/dist/cli/commands/swarm-spawn.js.map +1 -1
- package/dist/cli/commands/swarm.d.ts +4 -1
- package/dist/cli/commands/swarm.d.ts.map +1 -1
- package/dist/cli/commands/swarm.js +23 -18
- package/dist/cli/commands/swarm.js.map +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/workflow.d.ts.map +1 -1
- package/dist/cli/commands/workflow.js +49 -45
- package/dist/cli/commands/workflow.js.map +1 -1
- package/dist/cli/completion.d.ts +3 -0
- package/dist/cli/completion.d.ts.map +1 -1
- package/dist/cli/completion.js +15 -5
- package/dist/cli/completion.js.map +1 -1
- package/dist/cli/formatter.d.ts +3 -0
- package/dist/cli/formatter.d.ts.map +1 -1
- package/dist/cli/formatter.js +3 -3
- package/dist/cli/formatter.js.map +1 -1
- package/dist/cli/help-formatter.d.ts.map +1 -1
- package/dist/cli/help-formatter.js +8 -14
- package/dist/cli/help-formatter.js.map +1 -1
- package/dist/cli/index-remote.d.ts +4 -0
- package/dist/cli/index-remote.d.ts.map +1 -1
- package/dist/cli/index-remote.js +1 -1
- package/dist/cli/index-remote.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +32 -34
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/batch-tools.d.ts.map +1 -1
- package/dist/cli/init/batch-tools.js.map +1 -1
- package/dist/cli/init/claude-config.d.ts.map +1 -1
- package/dist/cli/init/claude-config.js +111 -106
- package/dist/cli/init/claude-config.js.map +1 -1
- package/dist/cli/init/directory-structure.d.ts.map +1 -1
- package/dist/cli/init/directory-structure.js +3 -3
- package/dist/cli/init/directory-structure.js.map +1 -1
- package/dist/cli/init/index.d.ts.map +1 -1
- package/dist/cli/init/index.js +1 -1
- package/dist/cli/init/index.js.map +1 -1
- package/dist/cli/init/sparc-environment.d.ts.map +1 -1
- package/dist/cli/init/sparc-environment.js +69 -69
- package/dist/cli/init/sparc-environment.js.map +1 -1
- package/dist/cli/init/swarm-commands.d.ts.map +1 -1
- package/dist/cli/init/swarm-commands.js +1 -1
- package/dist/cli/init/swarm-commands.js.map +1 -1
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +6 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/node-compat.d.ts.map +1 -1
- package/dist/cli/node-compat.js +24 -18
- package/dist/cli/node-compat.js.map +1 -1
- package/dist/cli/node-repl.d.ts +4 -0
- package/dist/cli/node-repl.d.ts.map +1 -1
- package/dist/cli/node-repl.js +24 -30
- package/dist/cli/node-repl.js.map +1 -1
- package/dist/cli/repl.d.ts.map +1 -1
- package/dist/cli/repl.js +81 -70
- package/dist/cli/repl.js.map +1 -1
- package/dist/cli/runtime-detector.d.ts.map +1 -1
- package/dist/cli/runtime-detector.js +11 -7
- package/dist/cli/runtime-detector.js.map +1 -1
- package/dist/cli/simple-cli.d.ts +4 -0
- package/dist/cli/simple-cli.d.ts.map +1 -1
- package/dist/cli/simple-cli.js +109 -95
- package/dist/cli/simple-cli.js.map +1 -1
- package/dist/cli/simple-commands/analysis.d.ts.map +1 -1
- package/dist/cli/simple-commands/analysis.js +18 -11
- package/dist/cli/simple-commands/analysis.js.map +1 -1
- package/dist/cli/simple-commands/automation.js +32 -17
- package/dist/cli/simple-commands/automation.js.map +1 -1
- package/dist/cli/simple-commands/batch-manager.js +44 -39
- package/dist/cli/simple-commands/batch-manager.js.map +1 -1
- package/dist/cli/simple-commands/config.d.ts.map +1 -1
- package/dist/cli/simple-commands/config.js +22 -21
- package/dist/cli/simple-commands/config.js.map +1 -1
- package/dist/cli/simple-commands/coordination.d.ts.map +1 -1
- package/dist/cli/simple-commands/coordination.js +12 -12
- package/dist/cli/simple-commands/coordination.js.map +1 -1
- package/dist/cli/simple-commands/fix-hook-variables.d.ts.map +1 -1
- package/dist/cli/simple-commands/fix-hook-variables.js +36 -30
- package/dist/cli/simple-commands/fix-hook-variables.js.map +1 -1
- package/dist/cli/simple-commands/github.d.ts.map +1 -1
- package/dist/cli/simple-commands/github.js +15 -15
- package/dist/cli/simple-commands/github.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js +12 -10
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/communication.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/communication.js +42 -45
- package/dist/cli/simple-commands/hive-mind/communication.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/core.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/core.js +97 -89
- package/dist/cli/simple-commands/hive-mind/core.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js +114 -59
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts +66 -0
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +402 -105
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/memory.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/memory.js +105 -75
- package/dist/cli/simple-commands/hive-mind/memory.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js +45 -43
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/queen.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/queen.js +101 -88
- package/dist/cli/simple-commands/hive-mind/queen.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/session-manager.js +75 -53
- package/dist/cli/simple-commands/hive-mind/session-manager.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind-optimize.js +18 -18
- package/dist/cli/simple-commands/hive-mind-optimize.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind.js +278 -140
- package/dist/cli/simple-commands/hive-mind.js.map +1 -1
- package/dist/cli/simple-commands/hook-safety.d.ts.map +1 -1
- package/dist/cli/simple-commands/hook-safety.js +19 -19
- package/dist/cli/simple-commands/hook-safety.js.map +1 -1
- package/dist/cli/simple-commands/hooks.d.ts.map +1 -1
- package/dist/cli/simple-commands/hooks.js +85 -71
- package/dist/cli/simple-commands/hooks.js.map +1 -1
- package/dist/cli/simple-commands/init/batch-init.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/batch-init.js +62 -55
- package/dist/cli/simple-commands/init/batch-init.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +2 -2
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +58 -50
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js +34 -28
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/executable-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/executable-wrapper.js +7 -4
- package/dist/cli/simple-commands/init/executable-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/init/gitignore-updater.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/gitignore-updater.js +10 -9
- package/dist/cli/simple-commands/init/gitignore-updater.js.map +1 -1
- package/dist/cli/simple-commands/init/help.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/help.js.map +1 -1
- package/dist/cli/simple-commands/init/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/index.js +159 -103
- package/dist/cli/simple-commands/init/index.js.map +1 -1
- package/dist/cli/simple-commands/init/performance-monitor.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/performance-monitor.js +17 -18
- package/dist/cli/simple-commands/init/performance-monitor.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/backup-manager.js +19 -25
- package/dist/cli/simple-commands/init/rollback/backup-manager.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/index.js +18 -15
- package/dist/cli/simple-commands/init/rollback/index.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js +49 -68
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js +16 -24
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/state-tracker.js +25 -25
- package/dist/cli/simple-commands/init/rollback/state-tracker.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js +57 -57
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc/workflows.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc/workflows.js +21 -21
- package/dist/cli/simple-commands/init/sparc/workflows.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.js +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.js.map +1 -1
- package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js +69 -78
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js.map +1 -1
- package/dist/cli/simple-commands/init/templates/sparc-modes.js +2 -2
- package/dist/cli/simple-commands/init/validation/config-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/config-validator.js +12 -16
- package/dist/cli/simple-commands/init/validation/config-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/health-checker.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/health-checker.js +39 -41
- package/dist/cli/simple-commands/init/validation/health-checker.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/index.js +8 -8
- package/dist/cli/simple-commands/init/validation/index.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/mode-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/mode-validator.js +12 -12
- package/dist/cli/simple-commands/init/validation/mode-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/post-init-validator.js +13 -13
- package/dist/cli/simple-commands/init/validation/post-init-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js +19 -24
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js.map +1 -1
- package/dist/cli/simple-commands/mcp.js +2 -2
- package/dist/cli/simple-commands/mcp.js.map +1 -1
- package/dist/cli/simple-commands/memory.js +4 -4
- package/dist/cli/simple-commands/memory.js.map +1 -1
- package/dist/cli/simple-commands/migrate-hooks.d.ts.map +1 -1
- package/dist/cli/simple-commands/migrate-hooks.js +3 -3
- package/dist/cli/simple-commands/migrate-hooks.js.map +1 -1
- package/dist/cli/simple-commands/monitor.d.ts.map +1 -1
- package/dist/cli/simple-commands/monitor.js +34 -26
- package/dist/cli/simple-commands/monitor.js.map +1 -1
- package/dist/cli/simple-commands/process-ui-enhanced.d.ts.map +1 -1
- package/dist/cli/simple-commands/process-ui-enhanced.js +53 -39
- package/dist/cli/simple-commands/process-ui-enhanced.js.map +1 -1
- package/dist/cli/simple-commands/sparc-modes/index.js +11 -11
- package/dist/cli/simple-commands/sparc-modes/index.js.map +1 -1
- package/dist/cli/simple-commands/sparc-modes/swarm.js +50 -50
- package/dist/cli/simple-commands/sparc.d.ts.map +1 -1
- package/dist/cli/simple-commands/sparc.js +21 -11
- package/dist/cli/simple-commands/sparc.js.map +1 -1
- package/dist/cli/simple-commands/start-ui.d.ts.map +1 -1
- package/dist/cli/simple-commands/start-ui.js +5 -3
- package/dist/cli/simple-commands/start-ui.js.map +1 -1
- package/dist/cli/simple-commands/start-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/start-wrapper.js +1 -1
- package/dist/cli/simple-commands/start-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/status.js +14 -14
- package/dist/cli/simple-commands/status.js.map +1 -1
- package/dist/cli/simple-commands/swarm-executor.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-executor.js +19 -19
- package/dist/cli/simple-commands/swarm-executor.js.map +1 -1
- package/dist/cli/simple-commands/swarm-metrics-integration.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-metrics-integration.js +30 -21
- package/dist/cli/simple-commands/swarm-metrics-integration.js.map +1 -1
- package/dist/cli/simple-commands/swarm-webui-integration.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-webui-integration.js +30 -18
- package/dist/cli/simple-commands/swarm-webui-integration.js.map +1 -1
- package/dist/cli/simple-commands/swarm.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm.js +78 -67
- package/dist/cli/simple-commands/swarm.js.map +1 -1
- package/dist/cli/simple-commands/training.d.ts.map +1 -1
- package/dist/cli/simple-commands/training.js +7 -7
- package/dist/cli/simple-commands/training.js.map +1 -1
- package/dist/cli/simple-commands/web-server.d.ts.map +1 -1
- package/dist/cli/simple-commands/web-server.js +68 -66
- package/dist/cli/simple-commands/web-server.js.map +1 -1
- package/dist/cli/simple-mcp.d.ts.map +1 -1
- package/dist/cli/simple-mcp.js +2 -4
- package/dist/cli/simple-mcp.js.map +1 -1
- package/dist/cli/simple-orchestrator.d.ts +3 -0
- package/dist/cli/simple-orchestrator.d.ts.map +1 -1
- package/dist/cli/simple-orchestrator.js +36 -35
- package/dist/cli/simple-orchestrator.js.map +1 -1
- package/dist/cli/ui/compatible-ui.d.ts +4 -0
- package/dist/cli/ui/compatible-ui.d.ts.map +1 -1
- package/dist/cli/ui/compatible-ui.js +9 -8
- package/dist/cli/ui/compatible-ui.js.map +1 -1
- package/dist/cli/ui/fallback-handler.d.ts.map +1 -1
- package/dist/cli/ui/fallback-handler.js +4 -4
- package/dist/cli/ui/fallback-handler.js.map +1 -1
- package/dist/cli/ui/index.d.ts +2 -2
- package/dist/cli/ui/index.d.ts.map +1 -1
- package/dist/cli/ui/index.js +3 -3
- package/dist/cli/ui/index.js.map +1 -1
- package/dist/cli/utils/environment-detector.d.ts.map +1 -1
- package/dist/cli/utils/environment-detector.js +13 -11
- package/dist/cli/utils/environment-detector.js.map +1 -1
- package/dist/cli/utils/interactive-detector.d.ts.map +1 -1
- package/dist/cli/utils/interactive-detector.js +1 -1
- package/dist/cli/utils/interactive-detector.js.map +1 -1
- package/dist/cli/utils/prompt-defaults.d.ts.map +1 -1
- package/dist/cli/utils/prompt-defaults.js +6 -7
- package/dist/cli/utils/prompt-defaults.js.map +1 -1
- package/dist/cli/utils/safe-interactive.d.ts.map +1 -1
- package/dist/cli/utils/safe-interactive.js +7 -6
- package/dist/cli/utils/safe-interactive.js.map +1 -1
- package/dist/cli/utils.d.ts.map +1 -1
- package/dist/cli/utils.js +58 -50
- package/dist/cli/utils.js.map +1 -1
- package/dist/cli/validation-helper.d.ts.map +1 -1
- package/dist/cli/validation-helper.js.map +1 -1
- package/dist/communication/message-bus.d.ts.map +1 -1
- package/dist/communication/message-bus.js +80 -74
- package/dist/communication/message-bus.js.map +1 -1
- package/dist/config/config-manager.d.ts +3 -0
- package/dist/config/config-manager.d.ts.map +1 -1
- package/dist/config/config-manager.js +23 -6
- package/dist/config/config-manager.js.map +1 -1
- package/dist/config/ruv-swarm-config.d.ts +6 -0
- package/dist/config/ruv-swarm-config.d.ts.map +1 -1
- package/dist/config/ruv-swarm-config.js +37 -22
- package/dist/config/ruv-swarm-config.js.map +1 -1
- package/dist/config/ruv-swarm-integration.d.ts.map +1 -1
- package/dist/config/ruv-swarm-integration.js +21 -21
- package/dist/config/ruv-swarm-integration.js.map +1 -1
- package/dist/constants/agent-types.d.ts +4 -4
- package/dist/constants/agent-types.d.ts.map +1 -1
- package/dist/constants/agent-types.js +4 -4
- package/dist/constants/agent-types.js.map +1 -1
- package/dist/coordination/advanced-scheduler.d.ts.map +1 -1
- package/dist/coordination/advanced-scheduler.js +6 -10
- package/dist/coordination/advanced-scheduler.js.map +1 -1
- package/dist/coordination/advanced-task-executor.d.ts.map +1 -1
- package/dist/coordination/advanced-task-executor.js +33 -33
- package/dist/coordination/advanced-task-executor.js.map +1 -1
- package/dist/coordination/background-executor.d.ts.map +1 -1
- package/dist/coordination/background-executor.js +17 -16
- package/dist/coordination/background-executor.js.map +1 -1
- package/dist/coordination/circuit-breaker.d.ts.map +1 -1
- package/dist/coordination/circuit-breaker.js +3 -0
- package/dist/coordination/circuit-breaker.js.map +1 -1
- package/dist/coordination/conflict-resolution.d.ts.map +1 -1
- package/dist/coordination/conflict-resolution.js +10 -8
- package/dist/coordination/conflict-resolution.js.map +1 -1
- package/dist/coordination/dependency-graph.d.ts.map +1 -1
- package/dist/coordination/dependency-graph.js +4 -3
- package/dist/coordination/dependency-graph.js.map +1 -1
- package/dist/coordination/hive-orchestrator.d.ts.map +1 -1
- package/dist/coordination/hive-orchestrator.js +29 -25
- package/dist/coordination/hive-orchestrator.js.map +1 -1
- package/dist/coordination/hive-protocol.d.ts.map +1 -1
- package/dist/coordination/hive-protocol.js +22 -23
- package/dist/coordination/hive-protocol.js.map +1 -1
- package/dist/coordination/index.d.ts +1 -1
- package/dist/coordination/index.d.ts.map +1 -1
- package/dist/coordination/index.js +1 -1
- package/dist/coordination/index.js.map +1 -1
- package/dist/coordination/load-balancer.d.ts.map +1 -1
- package/dist/coordination/load-balancer.js +55 -56
- package/dist/coordination/load-balancer.js.map +1 -1
- package/dist/coordination/manager.d.ts.map +1 -1
- package/dist/coordination/manager.js +2 -8
- package/dist/coordination/manager.js.map +1 -1
- package/dist/coordination/messaging.d.ts.map +1 -1
- package/dist/coordination/messaging.js +4 -4
- package/dist/coordination/messaging.js.map +1 -1
- package/dist/coordination/metrics.d.ts.map +1 -1
- package/dist/coordination/metrics.js +11 -9
- package/dist/coordination/metrics.js.map +1 -1
- package/dist/coordination/resources.d.ts.map +1 -1
- package/dist/coordination/resources.js +10 -6
- package/dist/coordination/resources.js.map +1 -1
- package/dist/coordination/scheduler.d.ts.map +1 -1
- package/dist/coordination/scheduler.js +4 -4
- package/dist/coordination/scheduler.js.map +1 -1
- package/dist/coordination/swarm-coordinator.d.ts.map +1 -1
- package/dist/coordination/swarm-coordinator.js +32 -34
- package/dist/coordination/swarm-coordinator.js.map +1 -1
- package/dist/coordination/swarm-monitor.d.ts.map +1 -1
- package/dist/coordination/swarm-monitor.js +17 -17
- package/dist/coordination/swarm-monitor.js.map +1 -1
- package/dist/coordination/work-stealing.d.ts.map +1 -1
- package/dist/coordination/work-stealing.js +3 -0
- package/dist/coordination/work-stealing.js.map +1 -1
- package/dist/core/config.d.ts +4 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +28 -31
- package/dist/core/config.js.map +1 -1
- package/dist/core/event-bus.d.ts +3 -0
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/json-persistence.d.ts +3 -0
- package/dist/core/json-persistence.d.ts.map +1 -1
- package/dist/core/json-persistence.js +19 -23
- package/dist/core/json-persistence.js.map +1 -1
- package/dist/core/logger.d.ts +3 -0
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +2 -6
- package/dist/core/logger.js.map +1 -1
- package/dist/core/orchestrator-fixed.d.ts.map +1 -1
- package/dist/core/orchestrator-fixed.js +4 -1
- package/dist/core/orchestrator-fixed.js.map +1 -1
- package/dist/core/orchestrator.d.ts.map +1 -1
- package/dist/core/orchestrator.js +66 -33
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/core/persistence.d.ts +3 -0
- package/dist/core/persistence.d.ts.map +1 -1
- package/dist/core/persistence.js +25 -19
- package/dist/core/persistence.js.map +1 -1
- package/dist/enterprise/analytics-manager.d.ts.map +1 -1
- package/dist/enterprise/analytics-manager.js +141 -134
- package/dist/enterprise/analytics-manager.js.map +1 -1
- package/dist/enterprise/audit-manager.d.ts.map +1 -1
- package/dist/enterprise/audit-manager.js +144 -122
- package/dist/enterprise/audit-manager.js.map +1 -1
- package/dist/enterprise/cloud-manager.d.ts.map +1 -1
- package/dist/enterprise/cloud-manager.js +104 -99
- package/dist/enterprise/cloud-manager.js.map +1 -1
- package/dist/enterprise/deployment-manager.d.ts.map +1 -1
- package/dist/enterprise/deployment-manager.js +104 -97
- package/dist/enterprise/deployment-manager.js.map +1 -1
- package/dist/enterprise/index.d.ts +6 -6
- package/dist/enterprise/index.d.ts.map +1 -1
- package/dist/enterprise/project-manager.d.ts.map +1 -1
- package/dist/enterprise/project-manager.js +74 -66
- package/dist/enterprise/project-manager.js.map +1 -1
- package/dist/enterprise/security-manager.d.ts.map +1 -1
- package/dist/enterprise/security-manager.js +137 -129
- package/dist/enterprise/security-manager.js.map +1 -1
- package/dist/hive-mind/core/Agent.d.ts.map +1 -1
- package/dist/hive-mind/core/Agent.js +36 -36
- package/dist/hive-mind/core/Agent.js.map +1 -1
- package/dist/hive-mind/core/Communication.d.ts.map +1 -1
- package/dist/hive-mind/core/Communication.js +17 -17
- package/dist/hive-mind/core/Communication.js.map +1 -1
- package/dist/hive-mind/core/DatabaseManager.d.ts.map +1 -1
- package/dist/hive-mind/core/DatabaseManager.js +104 -58
- package/dist/hive-mind/core/DatabaseManager.js.map +1 -1
- package/dist/hive-mind/core/HiveMind.d.ts.map +1 -1
- package/dist/hive-mind/core/HiveMind.js +35 -35
- package/dist/hive-mind/core/HiveMind.js.map +1 -1
- package/dist/hive-mind/core/Memory.d.ts.map +1 -1
- package/dist/hive-mind/core/Memory.js +78 -71
- package/dist/hive-mind/core/Memory.js.map +1 -1
- package/dist/hive-mind/core/MemoryMonitor.d.ts.map +1 -1
- package/dist/hive-mind/core/MemoryMonitor.js +38 -38
- package/dist/hive-mind/core/MemoryMonitor.js.map +1 -1
- package/dist/hive-mind/core/Queen.d.ts.map +1 -1
- package/dist/hive-mind/core/Queen.js +110 -47
- package/dist/hive-mind/core/Queen.js.map +1 -1
- package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +1 -1
- package/dist/hive-mind/integration/ConsensusEngine.js +25 -23
- package/dist/hive-mind/integration/ConsensusEngine.js.map +1 -1
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +1 -1
- package/dist/hive-mind/integration/MCPToolWrapper.js.map +1 -1
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +1 -1
- package/dist/hive-mind/integration/SwarmOrchestrator.js +60 -58
- package/dist/hive-mind/integration/SwarmOrchestrator.js.map +1 -1
- package/dist/hive-mind/types.d.ts.map +1 -1
- package/dist/integration/mock-components.d.ts.map +1 -1
- package/dist/integration/mock-components.js +21 -21
- package/dist/integration/mock-components.js.map +1 -1
- package/dist/integration/system-integration.d.ts.map +1 -1
- package/dist/integration/system-integration.js +13 -11
- package/dist/integration/system-integration.js.map +1 -1
- package/dist/mcp/auth.d.ts +1 -1
- package/dist/mcp/auth.d.ts.map +1 -1
- package/dist/mcp/auth.js +8 -1
- package/dist/mcp/auth.js.map +1 -1
- package/dist/mcp/claude-code-wrapper.d.ts.map +1 -1
- package/dist/mcp/claude-code-wrapper.js +169 -68
- package/dist/mcp/claude-code-wrapper.js.map +1 -1
- package/dist/mcp/claude-flow-tools.d.ts.map +1 -1
- package/dist/mcp/claude-flow-tools.js +42 -3
- package/dist/mcp/claude-flow-tools.js.map +1 -1
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/index.d.ts +6 -6
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +9 -9
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/integrate-wrapper.d.ts.map +1 -1
- package/dist/mcp/integrate-wrapper.js +5 -7
- package/dist/mcp/integrate-wrapper.js.map +1 -1
- package/dist/mcp/lifecycle-manager.d.ts.map +1 -1
- package/dist/mcp/lifecycle-manager.js +8 -7
- package/dist/mcp/lifecycle-manager.js.map +1 -1
- package/dist/mcp/load-balancer.d.ts.map +1 -1
- package/dist/mcp/load-balancer.js +5 -1
- package/dist/mcp/load-balancer.js.map +1 -1
- package/dist/mcp/orchestration-integration.d.ts.map +1 -1
- package/dist/mcp/orchestration-integration.js +22 -9
- package/dist/mcp/orchestration-integration.js.map +1 -1
- package/dist/mcp/performance-monitor.d.ts.map +1 -1
- package/dist/mcp/performance-monitor.js +22 -19
- package/dist/mcp/performance-monitor.js.map +1 -1
- package/dist/mcp/protocol-manager.d.ts.map +1 -1
- package/dist/mcp/protocol-manager.js +8 -19
- package/dist/mcp/protocol-manager.js.map +1 -1
- package/dist/mcp/recovery/connection-health-monitor.d.ts.map +1 -1
- package/dist/mcp/recovery/connection-health-monitor.js +5 -5
- package/dist/mcp/recovery/connection-health-monitor.js.map +1 -1
- package/dist/mcp/recovery/connection-state-manager.d.ts +4 -0
- package/dist/mcp/recovery/connection-state-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/connection-state-manager.js +13 -13
- package/dist/mcp/recovery/connection-state-manager.js.map +1 -1
- package/dist/mcp/recovery/fallback-coordinator.d.ts.map +1 -1
- package/dist/mcp/recovery/fallback-coordinator.js +5 -5
- package/dist/mcp/recovery/fallback-coordinator.js.map +1 -1
- package/dist/mcp/recovery/index.d.ts +4 -4
- package/dist/mcp/recovery/index.d.ts.map +1 -1
- package/dist/mcp/recovery/index.js +4 -4
- package/dist/mcp/recovery/index.js.map +1 -1
- package/dist/mcp/recovery/reconnection-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/reconnection-manager.js +1 -1
- package/dist/mcp/recovery/reconnection-manager.js.map +1 -1
- package/dist/mcp/recovery/recovery-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/recovery-manager.js +2 -4
- package/dist/mcp/recovery/recovery-manager.js.map +1 -1
- package/dist/mcp/router.d.ts.map +1 -1
- package/dist/mcp/router.js +3 -0
- package/dist/mcp/router.js.map +1 -1
- package/dist/mcp/ruv-swarm-tools.d.ts.map +1 -1
- package/dist/mcp/ruv-swarm-tools.js +132 -102
- package/dist/mcp/ruv-swarm-tools.js.map +1 -1
- package/dist/mcp/server-with-wrapper.d.ts +3 -0
- package/dist/mcp/server-with-wrapper.d.ts.map +1 -1
- package/dist/mcp/server-with-wrapper.js +2 -3
- package/dist/mcp/server-with-wrapper.js.map +1 -1
- package/dist/mcp/server-wrapper-mode.d.ts +5 -0
- package/dist/mcp/server-wrapper-mode.d.ts.map +1 -1
- package/dist/mcp/server-wrapper-mode.js +2 -3
- package/dist/mcp/server-wrapper-mode.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +12 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session-manager.d.ts.map +1 -1
- package/dist/mcp/session-manager.js +4 -3
- package/dist/mcp/session-manager.js.map +1 -1
- package/dist/mcp/sparc-modes.d.ts.map +1 -1
- package/dist/mcp/sparc-modes.js +15 -15
- package/dist/mcp/sparc-modes.js.map +1 -1
- package/dist/mcp/swarm-tools.d.ts.map +1 -1
- package/dist/mcp/swarm-tools.js +100 -80
- package/dist/mcp/swarm-tools.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +28 -12
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/transports/base.d.ts.map +1 -1
- package/dist/mcp/transports/base.js +3 -0
- package/dist/mcp/transports/base.js.map +1 -1
- package/dist/mcp/transports/http.d.ts +3 -0
- package/dist/mcp/transports/http.d.ts.map +1 -1
- package/dist/mcp/transports/http.js +3 -3
- package/dist/mcp/transports/http.js.map +1 -1
- package/dist/mcp/transports/stdio.d.ts +3 -0
- package/dist/mcp/transports/stdio.d.ts.map +1 -1
- package/dist/mcp/transports/stdio.js +3 -0
- package/dist/mcp/transports/stdio.js.map +1 -1
- package/dist/memory/advanced-memory-manager.d.ts.map +1 -1
- package/dist/memory/advanced-memory-manager.js +109 -100
- package/dist/memory/advanced-memory-manager.js.map +1 -1
- package/dist/memory/backends/base.d.ts.map +1 -1
- package/dist/memory/backends/base.js +3 -0
- package/dist/memory/backends/base.js.map +1 -1
- package/dist/memory/backends/markdown.d.ts +3 -0
- package/dist/memory/backends/markdown.d.ts.map +1 -1
- package/dist/memory/backends/markdown.js +8 -8
- package/dist/memory/backends/markdown.js.map +1 -1
- package/dist/memory/backends/sqlite.d.ts +3 -0
- package/dist/memory/backends/sqlite.d.ts.map +1 -1
- package/dist/memory/backends/sqlite.js +6 -2
- package/dist/memory/backends/sqlite.js.map +1 -1
- package/dist/memory/cache.d.ts.map +1 -1
- package/dist/memory/cache.js +5 -3
- package/dist/memory/cache.js.map +1 -1
- package/dist/memory/distributed-memory.d.ts.map +1 -1
- package/dist/memory/distributed-memory.js +27 -28
- package/dist/memory/distributed-memory.js.map +1 -1
- package/dist/memory/fallback-store.d.ts +1 -0
- package/dist/memory/fallback-store.d.ts.map +1 -1
- package/dist/memory/fallback-store.js +25 -3
- package/dist/memory/fallback-store.js.map +1 -1
- package/dist/memory/in-memory-store.d.ts.map +1 -1
- package/dist/memory/in-memory-store.js +8 -8
- package/dist/memory/in-memory-store.js.map +1 -1
- package/dist/memory/indexer.d.ts.map +1 -1
- package/dist/memory/indexer.js +4 -1
- package/dist/memory/indexer.js.map +1 -1
- package/dist/memory/manager.d.ts.map +1 -1
- package/dist/memory/manager.js +17 -20
- package/dist/memory/manager.js.map +1 -1
- package/dist/memory/sqlite-store.d.ts +34 -0
- package/dist/memory/sqlite-store.d.ts.map +1 -0
- package/dist/memory/sqlite-store.js +14 -11
- package/dist/memory/sqlite-store.js.map +1 -1
- package/dist/memory/sqlite-wrapper.d.ts +38 -0
- package/dist/memory/sqlite-wrapper.d.ts.map +1 -0
- package/dist/memory/sqlite-wrapper.js +157 -0
- package/dist/memory/sqlite-wrapper.js.map +1 -0
- package/dist/memory/swarm-memory.d.ts.map +1 -1
- package/dist/memory/swarm-memory.js +37 -44
- package/dist/memory/swarm-memory.js.map +1 -1
- package/dist/migration/index.d.ts +4 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +8 -8
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/logger.d.ts.map +1 -1
- package/dist/migration/logger.js +5 -5
- package/dist/migration/logger.js.map +1 -1
- package/dist/migration/migration-analyzer.d.ts +3 -0
- package/dist/migration/migration-analyzer.d.ts.map +1 -1
- package/dist/migration/migration-analyzer.js +25 -20
- package/dist/migration/migration-analyzer.js.map +1 -1
- package/dist/migration/migration-runner.d.ts.map +1 -1
- package/dist/migration/migration-runner.js +35 -29
- package/dist/migration/migration-runner.js.map +1 -1
- package/dist/migration/migration-validator.d.ts +3 -0
- package/dist/migration/migration-validator.d.ts.map +1 -1
- package/dist/migration/migration-validator.js +22 -26
- package/dist/migration/migration-validator.js.map +1 -1
- package/dist/migration/progress-reporter.d.ts +3 -0
- package/dist/migration/progress-reporter.d.ts.map +1 -1
- package/dist/migration/progress-reporter.js +8 -8
- package/dist/migration/progress-reporter.js.map +1 -1
- package/dist/migration/rollback-manager.d.ts +3 -0
- package/dist/migration/rollback-manager.d.ts.map +1 -1
- package/dist/migration/rollback-manager.js +29 -26
- package/dist/migration/rollback-manager.js.map +1 -1
- package/dist/monitoring/diagnostics.d.ts.map +1 -1
- package/dist/monitoring/diagnostics.js +49 -37
- package/dist/monitoring/diagnostics.js.map +1 -1
- package/dist/monitoring/health-check.d.ts.map +1 -1
- package/dist/monitoring/health-check.js +24 -25
- package/dist/monitoring/health-check.js.map +1 -1
- package/dist/monitoring/real-time-monitor.d.ts.map +1 -1
- package/dist/monitoring/real-time-monitor.js +71 -58
- package/dist/monitoring/real-time-monitor.js.map +1 -1
- package/dist/resources/resource-manager.d.ts.map +1 -1
- package/dist/resources/resource-manager.js +96 -83
- package/dist/resources/resource-manager.js.map +1 -1
- package/dist/swarm/claude-flow-executor.d.ts.map +1 -1
- package/dist/swarm/claude-flow-executor.js +37 -31
- package/dist/swarm/claude-flow-executor.js.map +1 -1
- package/dist/swarm/coordinator.d.ts.map +1 -1
- package/dist/swarm/coordinator.js +330 -280
- package/dist/swarm/coordinator.js.map +1 -1
- package/dist/swarm/direct-executor.d.ts.map +1 -1
- package/dist/swarm/direct-executor.js +44 -37
- package/dist/swarm/direct-executor.js.map +1 -1
- package/dist/swarm/executor-v2.d.ts.map +1 -1
- package/dist/swarm/executor-v2.js +28 -27
- package/dist/swarm/executor-v2.js.map +1 -1
- package/dist/swarm/executor.d.ts +3 -0
- package/dist/swarm/executor.d.ts.map +1 -1
- package/dist/swarm/executor.js +58 -52
- package/dist/swarm/executor.js.map +1 -1
- package/dist/swarm/index.d.ts.map +1 -1
- package/dist/swarm/index.js +2 -2
- package/dist/swarm/index.js.map +1 -1
- package/dist/swarm/json-output-aggregator.d.ts.map +1 -1
- package/dist/swarm/json-output-aggregator.js +20 -19
- package/dist/swarm/json-output-aggregator.js.map +1 -1
- package/dist/swarm/memory.d.ts.map +1 -1
- package/dist/swarm/memory.js +67 -67
- package/dist/swarm/memory.js.map +1 -1
- package/dist/swarm/optimizations/async-file-manager.d.ts +4 -0
- package/dist/swarm/optimizations/async-file-manager.d.ts.map +1 -1
- package/dist/swarm/optimizations/async-file-manager.js +19 -23
- package/dist/swarm/optimizations/async-file-manager.js.map +1 -1
- package/dist/swarm/optimizations/circular-buffer.d.ts.map +1 -1
- package/dist/swarm/optimizations/circular-buffer.js +2 -4
- package/dist/swarm/optimizations/circular-buffer.js.map +1 -1
- package/dist/swarm/optimizations/connection-pool.d.ts.map +1 -1
- package/dist/swarm/optimizations/connection-pool.js +12 -13
- package/dist/swarm/optimizations/connection-pool.js.map +1 -1
- package/dist/swarm/optimizations/index.js +2 -2
- package/dist/swarm/optimizations/optimized-executor.d.ts.map +1 -1
- package/dist/swarm/optimizations/optimized-executor.js +23 -29
- package/dist/swarm/optimizations/optimized-executor.js.map +1 -1
- package/dist/swarm/optimizations/ttl-map.d.ts.map +1 -1
- package/dist/swarm/optimizations/ttl-map.js +4 -4
- package/dist/swarm/optimizations/ttl-map.js.map +1 -1
- package/dist/swarm/prompt-cli.d.ts.map +1 -1
- package/dist/swarm/prompt-cli.js +18 -13
- package/dist/swarm/prompt-cli.js.map +1 -1
- package/dist/swarm/prompt-copier-enhanced.d.ts.map +1 -1
- package/dist/swarm/prompt-copier-enhanced.js +12 -12
- package/dist/swarm/prompt-copier-enhanced.js.map +1 -1
- package/dist/swarm/prompt-copier.d.ts.map +1 -1
- package/dist/swarm/prompt-copier.js +15 -18
- package/dist/swarm/prompt-copier.js.map +1 -1
- package/dist/swarm/prompt-manager.d.ts.map +1 -1
- package/dist/swarm/prompt-manager.js +27 -21
- package/dist/swarm/prompt-manager.js.map +1 -1
- package/dist/swarm/prompt-utils.d.ts.map +1 -1
- package/dist/swarm/prompt-utils.js +34 -32
- package/dist/swarm/prompt-utils.js.map +1 -1
- package/dist/swarm/sparc-executor.d.ts.map +1 -1
- package/dist/swarm/sparc-executor.js +189 -123
- package/dist/swarm/sparc-executor.js.map +1 -1
- package/dist/swarm/strategies/auto.d.ts.map +1 -1
- package/dist/swarm/strategies/auto.js +105 -86
- package/dist/swarm/strategies/auto.js.map +1 -1
- package/dist/swarm/strategies/base.d.ts.map +1 -1
- package/dist/swarm/strategies/base.js +14 -11
- package/dist/swarm/strategies/base.js.map +1 -1
- package/dist/swarm/strategies/research.d.ts.map +1 -1
- package/dist/swarm/strategies/research.js +76 -71
- package/dist/swarm/strategies/research.js.map +1 -1
- package/dist/swarm/types.d.ts.map +1 -1
- package/dist/swarm/types.js +3 -0
- package/dist/swarm/types.js.map +1 -1
- package/dist/swarm/workers/copy-worker.js +4 -4
- package/dist/swarm/workers/copy-worker.js.map +1 -1
- package/dist/task/commands.d.ts.map +1 -1
- package/dist/task/commands.js +11 -7
- package/dist/task/commands.js.map +1 -1
- package/dist/task/coordination.d.ts.map +1 -1
- package/dist/task/coordination.js +75 -70
- package/dist/task/coordination.js.map +1 -1
- package/dist/task/engine.d.ts.map +1 -1
- package/dist/task/engine.js +34 -32
- package/dist/task/engine.js.map +1 -1
- package/dist/task/index.d.ts +3 -3
- package/dist/task/index.d.ts.map +1 -1
- package/dist/task/index.js +11 -11
- package/dist/task/index.js.map +1 -1
- package/dist/terminal/adapters/native.d.ts.map +1 -1
- package/dist/terminal/adapters/native.js +6 -6
- package/dist/terminal/adapters/native.js.map +1 -1
- package/dist/terminal/adapters/vscode.d.ts +3 -0
- package/dist/terminal/adapters/vscode.d.ts.map +1 -1
- package/dist/terminal/adapters/vscode.js +6 -4
- package/dist/terminal/adapters/vscode.js.map +1 -1
- package/dist/terminal/manager.d.ts.map +1 -1
- package/dist/terminal/manager.js +6 -8
- package/dist/terminal/manager.js.map +1 -1
- package/dist/terminal/pool.d.ts.map +1 -1
- package/dist/terminal/pool.js +3 -0
- package/dist/terminal/pool.js.map +1 -1
- package/dist/terminal/session.d.ts.map +1 -1
- package/dist/terminal/session.js +6 -2
- package/dist/terminal/session.js.map +1 -1
- package/dist/ui/hive-dashboard.d.ts.map +1 -1
- package/dist/ui/hive-dashboard.js +52 -33
- package/dist/ui/hive-dashboard.js.map +1 -1
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js +1 -1
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/helpers.d.ts +3 -0
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/helpers.js +5 -8
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/npx-isolated-cache.js +3 -3
- package/dist/utils/npx-isolated-cache.js.map +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +8 -4
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/type-guards.d.ts +1 -1
- package/dist/utils/type-guards.d.ts.map +1 -1
- package/dist/utils/type-guards.js +11 -10
- package/dist/utils/type-guards.js.map +1 -1
- package/package.json +7 -6
- package/src/adapters/cliffy-node.ts +27 -22
- package/src/agents/agent-manager.ts +145 -121
- package/src/agents/agent-registry.ts +77 -70
- package/src/api/claude-api-errors.ts +248 -0
- package/src/api/claude-client-enhanced.ts +616 -0
- package/src/api/claude-client.ts +338 -49
- package/src/api/routes/analysis.js +750 -735
- package/src/cli/__tests__/command-registry.test.js +42 -32
- package/src/cli/__tests__/simple-cli.test.js +42 -37
- package/src/cli/__tests__/utils.test.js +9 -9
- package/src/cli/agents/README.md +30 -4
- package/src/cli/agents/analyst.ts +161 -163
- package/src/cli/agents/architect.ts +126 -131
- package/src/cli/agents/base-agent.ts +48 -47
- package/src/cli/agents/capabilities.ts +87 -85
- package/src/cli/agents/coder.ts +127 -120
- package/src/cli/agents/coordinator.ts +72 -72
- package/src/cli/agents/hive-agents.ts +96 -70
- package/src/cli/agents/index.ts +70 -55
- package/src/cli/agents/researcher.ts +63 -74
- package/src/cli/agents/tester.ts +91 -98
- package/src/cli/cli-core.ts +56 -47
- package/src/cli/command-registry.js +82 -83
- package/src/cli/commands/advanced-memory-commands.ts +210 -142
- package/src/cli/commands/agent-simple.ts +146 -114
- package/src/cli/commands/agent.ts +119 -95
- package/src/cli/commands/claude-api.ts +19 -15
- package/src/cli/commands/claude.ts +96 -88
- package/src/cli/commands/config-integration.ts +120 -101
- package/src/cli/commands/config.ts +10 -8
- package/src/cli/commands/enterprise.ts +323 -187
- package/src/cli/commands/help-new.ts +57 -55
- package/src/cli/commands/help.ts +162 -159
- package/src/cli/commands/hive-mind/index.ts +3 -3
- package/src/cli/commands/hive-mind/init.ts +19 -12
- package/src/cli/commands/hive-mind/optimize-memory.ts +83 -53
- package/src/cli/commands/hive-mind/pause.ts +27 -25
- package/src/cli/commands/hive-mind/ps.ts +43 -37
- package/src/cli/commands/hive-mind/resume.ts +26 -26
- package/src/cli/commands/hive-mind/spawn.ts +37 -29
- package/src/cli/commands/hive-mind/status.ts +51 -51
- package/src/cli/commands/hive-mind/stop.ts +56 -51
- package/src/cli/commands/hive-mind/task.ts +65 -54
- package/src/cli/commands/hive-mind/wizard.ts +181 -167
- package/src/cli/commands/hive.ts +136 -96
- package/src/cli/commands/hook-types.ts +2 -2
- package/src/cli/commands/hook-validator.ts +8 -4
- package/src/cli/commands/hook.ts +44 -42
- package/src/cli/commands/index.ts +1162 -1031
- package/src/cli/commands/mcp.ts +105 -94
- package/src/cli/commands/memory.ts +24 -21
- package/src/cli/commands/migrate.ts +24 -24
- package/src/cli/commands/monitor.ts +123 -93
- package/src/cli/commands/ruv-swarm.ts +131 -122
- package/src/cli/commands/session.ts +60 -45
- package/src/cli/commands/sparc.ts +170 -139
- package/src/cli/commands/start/event-emitter.ts +2 -2
- package/src/cli/commands/start/index.ts +1 -1
- package/src/cli/commands/start/process-manager.ts +30 -47
- package/src/cli/commands/start/process-ui-simple.ts +60 -49
- package/src/cli/commands/start/process-ui.ts +1 -1
- package/src/cli/commands/start/start-command.ts +104 -75
- package/src/cli/commands/start/system-monitor.ts +35 -41
- package/src/cli/commands/start/types.ts +3 -3
- package/src/cli/commands/start.ts +1 -1
- package/src/cli/commands/status.ts +67 -67
- package/src/cli/commands/swarm-spawn.ts +21 -12
- package/src/cli/commands/swarm.ts +221 -150
- package/src/cli/commands/task.ts +55 -55
- package/src/cli/commands/workflow.ts +174 -157
- package/src/cli/completion.ts +34 -19
- package/src/cli/create-enhanced-task.js +49 -17
- package/src/cli/formatter.ts +38 -37
- package/src/cli/help-formatter.js +23 -33
- package/src/cli/help-formatter.ts +24 -34
- package/src/cli/help-text.js +71 -61
- package/src/cli/index-remote.ts +12 -9
- package/src/cli/index.ts +77 -67
- package/src/cli/init/batch-tools.ts +4 -5
- package/src/cli/init/claude-config.ts +125 -118
- package/src/cli/init/directory-structure.ts +10 -11
- package/src/cli/init/index.ts +13 -13
- package/src/cli/init/sparc-environment.ts +90 -74
- package/src/cli/init/swarm-commands.ts +5 -6
- package/src/cli/init/utils.ts +1 -1
- package/src/cli/main.ts +9 -10
- package/src/cli/node-compat.js +26 -19
- package/src/cli/node-repl.ts +104 -87
- package/src/cli/repl.ts +190 -158
- package/src/cli/runtime-detector.js +24 -19
- package/src/cli/simple-cli.js +460 -385
- package/src/cli/simple-cli.ts +426 -366
- package/src/cli/simple-commands/__tests__/agent.test.js +49 -55
- package/src/cli/simple-commands/__tests__/memory.test.js +4 -401
- package/src/cli/simple-commands/__tests__/swarm.test.js +49 -55
- package/src/cli/simple-commands/__tests__/task.test.js +4 -478
- package/src/cli/simple-commands/agent.js +27 -27
- package/src/cli/simple-commands/analysis.js +179 -161
- package/src/cli/simple-commands/automation.js +226 -205
- package/src/cli/simple-commands/batch-manager.js +98 -88
- package/src/cli/simple-commands/config.js +65 -60
- package/src/cli/simple-commands/coordination.js +220 -184
- package/src/cli/simple-commands/enhanced-ui-views.js +142 -115
- package/src/cli/simple-commands/enhanced-webui-complete.js +267 -167
- package/src/cli/simple-commands/fix-hook-variables.js +73 -67
- package/src/cli/simple-commands/github/gh-coordinator.js +63 -53
- package/src/cli/simple-commands/github/github-api.js +45 -47
- package/src/cli/simple-commands/github.js +33 -34
- package/src/cli/simple-commands/hive-mind/auto-save-middleware.js +50 -46
- package/src/cli/simple-commands/hive-mind/communication.js +198 -185
- package/src/cli/simple-commands/hive-mind/core.js +289 -304
- package/src/cli/simple-commands/hive-mind/db-optimizer.js +278 -168
- package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +676 -263
- package/src/cli/simple-commands/hive-mind/memory.js +356 -287
- package/src/cli/simple-commands/hive-mind/performance-optimizer.js +88 -79
- package/src/cli/simple-commands/hive-mind/performance-test.js +61 -49
- package/src/cli/simple-commands/hive-mind/queen.js +223 -213
- package/src/cli/simple-commands/hive-mind/session-manager.js +522 -240
- package/src/cli/simple-commands/hive-mind-optimize.js +69 -65
- package/src/cli/simple-commands/hive-mind-wizard.js +213 -211
- package/src/cli/simple-commands/hive-mind.js +790 -443
- package/src/cli/simple-commands/hive.js +12 -12
- package/src/cli/simple-commands/hook-safety.js +114 -111
- package/src/cli/simple-commands/hooks.js +1077 -1017
- package/src/cli/simple-commands/init/README.md +8 -1
- package/src/cli/simple-commands/init/VALIDATION_ROLLBACK.md +27 -1
- package/src/cli/simple-commands/init/batch-init.js +105 -100
- package/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +6 -6
- package/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +6 -6
- package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +64 -37
- package/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +85 -71
- package/src/cli/simple-commands/init/claude-commands/slash-commands.js +40 -19
- package/src/cli/simple-commands/init/claude-commands/sparc-commands.js +149 -63
- package/src/cli/simple-commands/init/copy-revised-templates.js +175 -0
- package/src/cli/simple-commands/init/executable-wrapper.js +13 -10
- package/src/cli/simple-commands/init/gitignore-updater.js +22 -22
- package/src/cli/simple-commands/init/help.js +4 -2
- package/src/cli/simple-commands/init/index.js +451 -428
- package/src/cli/simple-commands/init/performance-monitor.js +71 -64
- package/src/cli/simple-commands/init/rollback/backup-manager.js +44 -64
- package/src/cli/simple-commands/init/rollback/index.js +31 -39
- package/src/cli/simple-commands/init/rollback/recovery-manager.js +71 -101
- package/src/cli/simple-commands/init/rollback/rollback-executor.js +34 -53
- package/src/cli/simple-commands/init/rollback/state-tracker.js +38 -49
- package/src/cli/simple-commands/init/sparc/roo-readme.js +1 -1
- package/src/cli/simple-commands/init/sparc/roomodes-config.js +99 -77
- package/src/cli/simple-commands/init/sparc/workflows.js +37 -33
- package/src/cli/simple-commands/init/sparc-structure.js +9 -10
- package/src/cli/simple-commands/init/template-copier.js +583 -0
- package/src/cli/simple-commands/init/templates/CLAUDE.md +94 -26
- package/src/cli/simple-commands/init/templates/claude-flow-universal +9 -7
- package/src/cli/simple-commands/init/templates/claude-md.js +1 -1
- package/src/cli/simple-commands/init/templates/commands/analysis/bottleneck-detect.md +15 -3
- package/src/cli/simple-commands/init/templates/commands/automation/auto-agent.md +12 -2
- package/src/cli/simple-commands/init/templates/commands/coordination/swarm-init.md +10 -1
- package/src/cli/simple-commands/init/templates/commands/github/github-swarm.md +18 -5
- package/src/cli/simple-commands/init/templates/commands/hooks/notification.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +13 -6
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-task.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +13 -5
- package/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +12 -1
- package/src/cli/simple-commands/init/templates/coordination-md.js +1 -1
- package/src/cli/simple-commands/init/templates/coordination.md +16 -0
- package/src/cli/simple-commands/init/templates/enhanced-templates.js +116 -113
- package/src/cli/simple-commands/init/templates/memory-bank-md.js +1 -1
- package/src/cli/simple-commands/init/templates/memory-bank.md +16 -0
- package/src/cli/simple-commands/init/templates/readme-files.js +1 -1
- package/src/cli/simple-commands/init/templates/safe-hook-patterns.js +176 -127
- package/src/cli/simple-commands/init/templates/settings.json +2 -5
- package/src/cli/simple-commands/init/templates/settings.json.enhanced +35 -0
- package/src/cli/simple-commands/init/templates/sparc-modes.js +637 -26
- package/src/cli/simple-commands/init/validation/config-validator.js +17 -28
- package/src/cli/simple-commands/init/validation/health-checker.js +54 -62
- package/src/cli/simple-commands/init/validation/index.js +18 -23
- package/src/cli/simple-commands/init/validation/mode-validator.js +22 -32
- package/src/cli/simple-commands/init/validation/post-init-validator.js +25 -26
- package/src/cli/simple-commands/init/validation/pre-init-validator.js +32 -36
- package/src/cli/simple-commands/init/validation/test-runner.js +55 -63
- package/src/cli/simple-commands/init.js +1 -1
- package/src/cli/simple-commands/mcp-integration-layer.js +179 -110
- package/src/cli/simple-commands/mcp.js +55 -48
- package/src/cli/simple-commands/memory.js +62 -56
- package/src/cli/simple-commands/migrate-hooks.js +9 -10
- package/src/cli/simple-commands/monitor.js +87 -67
- package/src/cli/simple-commands/process-ui-enhanced.js +207 -155
- package/src/cli/simple-commands/process-ui.js +65 -56
- package/src/cli/simple-commands/realtime-update-system.js +136 -129
- package/src/cli/simple-commands/sparc/architecture.js +352 -251
- package/src/cli/simple-commands/sparc/commands.js +122 -94
- package/src/cli/simple-commands/sparc/completion.js +274 -199
- package/src/cli/simple-commands/sparc/coordinator.js +217 -169
- package/src/cli/simple-commands/sparc/index.js +40 -36
- package/src/cli/simple-commands/sparc/phase-base.js +72 -58
- package/src/cli/simple-commands/sparc/pseudocode.js +275 -159
- package/src/cli/simple-commands/sparc/refinement.js +306 -212
- package/src/cli/simple-commands/sparc/specification.js +164 -94
- package/src/cli/simple-commands/sparc-modes/architect.js +1 -1
- package/src/cli/simple-commands/sparc-modes/ask.js +1 -1
- package/src/cli/simple-commands/sparc-modes/code.js +1 -1
- package/src/cli/simple-commands/sparc-modes/debug.js +1 -1
- package/src/cli/simple-commands/sparc-modes/devops.js +1 -1
- package/src/cli/simple-commands/sparc-modes/docs-writer.js +1 -1
- package/src/cli/simple-commands/sparc-modes/generic.js +1 -1
- package/src/cli/simple-commands/sparc-modes/index.js +15 -15
- package/src/cli/simple-commands/sparc-modes/integration.js +1 -1
- package/src/cli/simple-commands/sparc-modes/mcp.js +1 -1
- package/src/cli/simple-commands/sparc-modes/monitoring.js +1 -1
- package/src/cli/simple-commands/sparc-modes/optimization.js +1 -1
- package/src/cli/simple-commands/sparc-modes/security-review.js +1 -1
- package/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +1 -1
- package/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +1 -1
- package/src/cli/simple-commands/sparc-modes/supabase-admin.js +1 -1
- package/src/cli/simple-commands/sparc-modes/swarm.js +52 -52
- package/src/cli/simple-commands/sparc-modes/tdd.js +1 -1
- package/src/cli/simple-commands/sparc-modes/tutorial.js +1 -1
- package/src/cli/simple-commands/sparc.js +87 -69
- package/src/cli/simple-commands/start-ui.js +21 -20
- package/src/cli/simple-commands/start-wrapper.js +29 -31
- package/src/cli/simple-commands/start.js +1 -1
- package/src/cli/simple-commands/status.js +53 -47
- package/src/cli/simple-commands/swarm-executor.js +47 -57
- package/src/cli/simple-commands/swarm-metrics-integration.js +119 -79
- package/src/cli/simple-commands/swarm-ui.js +120 -118
- package/src/cli/simple-commands/swarm-webui-integration.js +48 -27
- package/src/cli/simple-commands/swarm.js +216 -181
- package/src/cli/simple-commands/task.js +29 -29
- package/src/cli/simple-commands/timestamp-fix.js +28 -25
- package/src/cli/simple-commands/tool-execution-framework.js +115 -118
- package/src/cli/simple-commands/training.js +219 -194
- package/src/cli/simple-commands/web-server.js +118 -117
- package/src/cli/simple-commands/webui-validator.js +4 -3
- package/src/cli/simple-mcp.ts +14 -17
- package/src/cli/simple-orchestrator.ts +113 -101
- package/src/cli/swarm-standalone.js +20 -21
- package/src/cli/ui/compatible-ui.ts +55 -44
- package/src/cli/ui/fallback-handler.ts +19 -16
- package/src/cli/ui/index.ts +14 -15
- package/src/cli/utils/environment-detector.ts +75 -67
- package/src/cli/utils/interactive-detector.js +17 -11
- package/src/cli/utils/prompt-defaults.ts +32 -28
- package/src/cli/utils/safe-interactive.js +21 -20
- package/src/cli/utils.js +127 -110
- package/src/cli/validation-helper.js +16 -21
- package/src/cli/validation-helper.ts +21 -34
- package/src/communication/message-bus.ts +137 -124
- package/src/config/config-manager.ts +62 -30
- package/src/config/ruv-swarm-config.ts +105 -86
- package/src/config/ruv-swarm-integration.ts +38 -38
- package/src/constants/agent-types.ts +9 -8
- package/src/coordination/README.md +54 -31
- package/src/coordination/advanced-scheduler.ts +23 -26
- package/src/coordination/advanced-task-executor.ts +74 -68
- package/src/coordination/background-executor.ts +33 -30
- package/src/coordination/circuit-breaker.ts +26 -27
- package/src/coordination/conflict-resolution.ts +18 -27
- package/src/coordination/dependency-graph.ts +15 -18
- package/src/coordination/hive-orchestrator.ts +111 -81
- package/src/coordination/hive-protocol.ts +68 -77
- package/src/coordination/index.ts +3 -7
- package/src/coordination/load-balancer.ts +115 -105
- package/src/coordination/manager.ts +38 -51
- package/src/coordination/messaging.ts +19 -29
- package/src/coordination/metrics.ts +57 -60
- package/src/coordination/resources.ts +32 -37
- package/src/coordination/scheduler.ts +29 -30
- package/src/coordination/swarm-coordinator.ts +81 -70
- package/src/coordination/swarm-monitor.ts +90 -69
- package/src/coordination/work-stealing.ts +6 -13
- package/src/core/config.ts +148 -143
- package/src/core/event-bus.ts +5 -6
- package/src/core/json-persistence.ts +27 -34
- package/src/core/logger.ts +13 -16
- package/src/core/orchestrator-fixed.ts +33 -32
- package/src/core/orchestrator.ts +166 -159
- package/src/core/persistence.ts +47 -36
- package/src/enterprise/analytics-manager.ts +242 -233
- package/src/enterprise/audit-manager.ts +238 -184
- package/src/enterprise/cloud-manager.ts +167 -151
- package/src/enterprise/deployment-manager.ts +223 -180
- package/src/enterprise/index.ts +7 -7
- package/src/enterprise/project-manager.ts +151 -133
- package/src/enterprise/security-manager.ts +278 -223
- package/src/hive-mind/core/Agent.ts +112 -109
- package/src/hive-mind/core/Communication.ts +67 -69
- package/src/hive-mind/core/DatabaseManager.ts +371 -179
- package/src/hive-mind/core/HiveMind.ts +100 -96
- package/src/hive-mind/core/Memory.ts +304 -295
- package/src/hive-mind/core/MemoryMonitor.ts +46 -47
- package/src/hive-mind/core/Queen.ts +187 -114
- package/src/hive-mind/index.ts +2 -2
- package/src/hive-mind/integration/ConsensusEngine.ts +88 -92
- package/src/hive-mind/integration/MCPToolWrapper.ts +20 -72
- package/src/hive-mind/integration/SwarmOrchestrator.ts +173 -165
- package/src/hive-mind/types.ts +24 -12
- package/src/integration/mock-components.ts +42 -30
- package/src/integration/system-integration.ts +79 -78
- package/src/integration/types.ts +7 -7
- package/src/mcp/README.md +23 -4
- package/src/mcp/auth.ts +25 -18
- package/src/mcp/claude-code-wrapper.ts +257 -150
- package/src/mcp/claude-flow-tools.ts +52 -13
- package/src/mcp/client.ts +15 -13
- package/src/mcp/index.ts +22 -27
- package/src/mcp/integrate-wrapper.ts +18 -18
- package/src/mcp/lifecycle-manager.ts +30 -27
- package/src/mcp/load-balancer.ts +10 -11
- package/src/mcp/mcp-server.js +662 -351
- package/src/mcp/orchestration-integration.ts +32 -17
- package/src/mcp/performance-monitor.ts +65 -51
- package/src/mcp/protocol-manager.ts +36 -52
- package/src/mcp/recovery/connection-health-monitor.ts +40 -35
- package/src/mcp/recovery/connection-state-manager.ts +52 -50
- package/src/mcp/recovery/fallback-coordinator.ts +24 -24
- package/src/mcp/recovery/index.ts +23 -4
- package/src/mcp/recovery/reconnection-manager.ts +14 -15
- package/src/mcp/recovery/recovery-manager.ts +52 -68
- package/src/mcp/router.ts +1 -2
- package/src/mcp/ruv-swarm-tools.ts +167 -138
- package/src/mcp/ruv-swarm-wrapper.js +31 -23
- package/src/mcp/server-with-wrapper.ts +4 -5
- package/src/mcp/server-wrapper-mode.ts +5 -6
- package/src/mcp/server.ts +45 -40
- package/src/mcp/session-manager.ts +8 -11
- package/src/mcp/sparc-modes.ts +29 -28
- package/src/mcp/swarm-tools.ts +131 -114
- package/src/mcp/tests/mcp-integration.test.ts +49 -55
- package/src/mcp/tools.ts +53 -38
- package/src/mcp/transports/base.ts +4 -5
- package/src/mcp/transports/http.ts +45 -42
- package/src/mcp/transports/stdio.ts +9 -12
- package/src/memory/README.md +37 -27
- package/src/memory/advanced-memory-manager.ts +336 -279
- package/src/memory/backends/base.ts +4 -5
- package/src/memory/backends/markdown.ts +16 -22
- package/src/memory/backends/sqlite.ts +40 -18
- package/src/memory/cache.ts +18 -18
- package/src/memory/distributed-memory.ts +84 -92
- package/src/memory/enhanced-examples.js +68 -59
- package/src/memory/enhanced-memory.js +99 -80
- package/src/memory/fallback-store.js +49 -8
- package/src/memory/in-memory-store.js +31 -27
- package/src/memory/index.js +4 -4
- package/src/memory/indexer.ts +6 -10
- package/src/memory/manager.ts +45 -59
- package/src/memory/migration.js +107 -90
- package/src/memory/shared-memory.js +155 -157
- package/src/memory/sqlite-store.js +78 -62
- package/src/memory/sqlite-wrapper.js +173 -0
- package/src/memory/swarm-memory.js +138 -131
- package/src/memory/swarm-memory.ts +74 -75
- package/src/memory/test-example.js +28 -30
- package/src/migration/README.md +25 -9
- package/src/migration/index.ts +13 -14
- package/src/migration/logger.ts +9 -7
- package/src/migration/migration-analyzer.ts +66 -52
- package/src/migration/migration-manifest.json +2 -6
- package/src/migration/migration-runner.ts +86 -63
- package/src/migration/migration-validator.ts +93 -68
- package/src/migration/package.json +1 -1
- package/src/migration/progress-reporter.ts +25 -21
- package/src/migration/rollback-manager.ts +79 -63
- package/src/migration/tests/migration-system.test.ts +4 -491
- package/src/migration/tsconfig.json +3 -10
- package/src/migration/types.ts +1 -1
- package/src/monitoring/diagnostics.ts +123 -97
- package/src/monitoring/health-check.ts +45 -51
- package/src/monitoring/real-time-monitor.ts +105 -92
- package/src/resources/resource-manager.ts +205 -159
- package/src/swarm/__tests__/integration.test.ts +59 -65
- package/src/swarm/__tests__/prompt-copier.test.ts +27 -27
- package/src/swarm/claude-flow-executor.ts +50 -49
- package/src/swarm/coordinator.ts +727 -635
- package/src/swarm/direct-executor.ts +80 -86
- package/src/swarm/executor-v2.ts +81 -66
- package/src/swarm/executor.ts +124 -124
- package/src/swarm/index.ts +7 -8
- package/src/swarm/json-output-aggregator.ts +56 -40
- package/src/swarm/memory.ts +152 -147
- package/src/swarm/optimizations/README.md +20 -12
- package/src/swarm/optimizations/__tests__/optimization.test.ts +84 -87
- package/src/swarm/optimizations/async-file-manager.ts +70 -80
- package/src/swarm/optimizations/circular-buffer.ts +37 -37
- package/src/swarm/optimizations/connection-pool.ts +64 -64
- package/src/swarm/optimizations/index.ts +4 -4
- package/src/swarm/optimizations/migration-guide.md +27 -16
- package/src/swarm/optimizations/optimized-executor.ts +104 -114
- package/src/swarm/optimizations/ttl-map.ts +66 -63
- package/src/swarm/prompt-cli.ts +48 -42
- package/src/swarm/prompt-copier-enhanced.ts +54 -55
- package/src/swarm/prompt-copier.ts +59 -65
- package/src/swarm/prompt-copying-README.md +49 -33
- package/src/swarm/prompt-manager.ts +69 -63
- package/src/swarm/prompt-utils.ts +71 -66
- package/src/swarm/sparc-executor.ts +298 -225
- package/src/swarm/strategies/auto.ts +367 -252
- package/src/swarm/strategies/base.ts +24 -20
- package/src/swarm/strategies/research.ts +144 -124
- package/src/swarm/types.ts +340 -309
- package/src/swarm/workers/copy-worker.ts +12 -13
- package/src/task/README.md +99 -70
- package/src/task/commands.ts +16 -8
- package/src/task/coordination.ts +209 -162
- package/src/task/engine.ts +81 -65
- package/src/task/index.ts +28 -31
- package/src/templates/claude-optimized/.claude/BATCHTOOLS_BEST_PRACTICES.md +479 -481
- package/src/templates/claude-optimized/.claude/BATCHTOOLS_GUIDE.md +210 -188
- package/src/templates/claude-optimized/.claude/MIGRATION_GUIDE.md +151 -105
- package/src/templates/claude-optimized/.claude/PERFORMANCE_BENCHMARKS.md +102 -87
- package/src/templates/claude-optimized/.claude/commands/claude-flow-help.md +18 -1
- package/src/templates/claude-optimized/.claude/commands/claude-flow-memory.md +17 -1
- package/src/templates/claude-optimized/.claude/commands/claude-flow-swarm.md +21 -1
- package/src/templates/claude-optimized/.claude/commands/sparc/architect.md +11 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/ask.md +16 -10
- package/src/templates/claude-optimized/.claude/commands/sparc/code.md +26 -7
- package/src/templates/claude-optimized/.claude/commands/sparc/debug.md +14 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/devops.md +23 -10
- package/src/templates/claude-optimized/.claude/commands/sparc/docs-writer.md +8 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/integration.md +43 -27
- package/src/templates/claude-optimized/.claude/commands/sparc/mcp.md +15 -1
- package/src/templates/claude-optimized/.claude/commands/sparc/post-deployment-monitoring-mode.md +45 -30
- package/src/templates/claude-optimized/.claude/commands/sparc/refinement-optimization-mode.md +23 -13
- package/src/templates/claude-optimized/.claude/commands/sparc/security-review.md +31 -17
- package/src/templates/claude-optimized/.claude/commands/sparc/sparc.md +54 -47
- package/src/templates/claude-optimized/.claude/commands/sparc/spec-pseudocode.md +27 -17
- package/src/templates/claude-optimized/.claude/commands/sparc/supabase-admin.md +18 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/tdd.md +23 -9
- package/src/templates/claude-optimized/.claude/commands/sparc/tutorial.md +22 -16
- package/src/templates/claude-optimized/.claude/commands/sparc.md +20 -1
- package/src/templates/claude-optimized/README.md +10 -1
- package/src/templates/claude-optimized/SUMMARY.md +23 -1
- package/src/templates/claude-optimized/deploy-to-project.js +22 -10
- package/src/templates/claude-optimized/install-template.js +14 -10
- package/src/templates/claude-optimized/manifest.json +1 -1
- package/src/templates/claude-optimized/package.json +1 -1
- package/src/templates/claude-optimized/template-manager.js +8 -8
- package/src/templates/claude-optimized/validate-template.js +33 -23
- package/src/terminal/adapters/base.ts +1 -1
- package/src/terminal/adapters/native.ts +47 -47
- package/src/terminal/adapters/vscode.ts +21 -28
- package/src/terminal/manager.ts +27 -22
- package/src/terminal/pool.ts +24 -27
- package/src/terminal/session.ts +18 -18
- package/src/terminal/vscode-bridge.ts +21 -21
- package/src/tests/validation-consistency.test.ts +4 -4
- package/src/types/cliffy.d.ts +11 -14
- package/src/types/global.d.ts +1 -2
- package/src/types/index.ts +2 -2
- package/src/types/mcp.d.ts +11 -17
- package/src/types/vscode.d.ts +18 -5
- package/src/ui/console/README-analysis-tools.md +52 -2
- package/src/ui/console/README.md +33 -1
- package/src/ui/console/WORKFLOW_DESIGNER_README.md +81 -22
- package/src/ui/console/analysis-tools.html +282 -261
- package/src/ui/console/analytics.html +329 -326
- package/src/ui/console/index.html +221 -209
- package/src/ui/console/js/analysis-tools.js +815 -754
- package/src/ui/console/js/command-handler.js +226 -196
- package/src/ui/console/js/console.js +117 -119
- package/src/ui/console/js/daa-tools.js +797 -787
- package/src/ui/console/js/memory-interface.js +676 -638
- package/src/ui/console/js/memory-test.js +49 -46
- package/src/ui/console/js/memory-tools.js +181 -159
- package/src/ui/console/js/settings.js +124 -103
- package/src/ui/console/js/terminal-emulator.js +147 -130
- package/src/ui/console/js/websocket-client.js +71 -71
- package/src/ui/console/js/workflow-designer.js +1126 -1110
- package/src/ui/console/neural-networks-demo.md +45 -16
- package/src/ui/console/styles/analysis-tools.css +571 -561
- package/src/ui/console/styles/console.css +16 -12
- package/src/ui/console/styles/daa-tools.css +322 -319
- package/src/ui/console/styles/responsive.css +71 -70
- package/src/ui/console/styles/settings.css +12 -12
- package/src/ui/console/styles/workflow-designer.css +628 -584
- package/src/ui/console/test-neural-networks.js +59 -54
- package/src/ui/console/test-neural.html +194 -196
- package/src/ui/console/workflow-designer-demo.html +433 -424
- package/src/ui/hive-dashboard.ts +74 -52
- package/src/ui/web-ui/EnhancedProcessUI.js +570 -424
- package/src/ui/web-ui/EnhancedWebUI.js +65 -65
- package/src/ui/web-ui/README.md +16 -16
- package/src/ui/web-ui/components/ComponentLibrary.js +173 -124
- package/src/ui/web-ui/core/EventBus.js +27 -25
- package/src/ui/web-ui/core/MCPIntegrationLayer.js +294 -108
- package/src/ui/web-ui/core/StateManager.js +43 -46
- package/src/ui/web-ui/core/UIManager.js +120 -70
- package/src/ui/web-ui/core/ViewManager.js +16 -19
- package/src/ui/web-ui/index.js +101 -48
- package/src/ui/web-ui/neural-panel-test.js +109 -108
- package/src/ui/web-ui/test-github-view.js +11 -12
- package/src/ui/web-ui/test-neural-panel.html +219 -205
- package/src/ui/web-ui/views/DAAView.js +88 -85
- package/src/ui/web-ui/views/GitHubIntegrationTest.js +42 -42
- package/src/ui/web-ui/views/GitHubIntegrationView.js +59 -53
- package/src/ui/web-ui/views/NeuralNetworkView.js +20 -21
- package/src/ui/web-ui/views/WorkflowAutomationView.js +31 -32
- package/src/utils/error-handler.js +1 -1
- package/src/utils/error-handler.ts +9 -5
- package/src/utils/errors.ts +20 -18
- package/src/utils/formatters.ts +6 -6
- package/src/utils/helpers.ts +53 -55
- package/src/utils/npx-isolated-cache.js +16 -16
- package/src/utils/paths.ts +9 -6
- package/src/utils/timezone-utils.js +16 -16
- package/src/utils/type-guards.ts +37 -26
- package/src/utils/types.ts +2 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getErrorMessage } from '../utils/error-handler.js';
|
|
2
1
|
import { EventEmitter } from 'events';
|
|
3
2
|
import { writeFile, readFile, mkdir, readdir } from 'fs/promises';
|
|
4
3
|
import { join } from 'path';
|
|
@@ -9,7 +8,14 @@ import { ConfigManager } from '../core/config.js';
|
|
|
9
8
|
export interface SecurityScan {
|
|
10
9
|
id: string;
|
|
11
10
|
name: string;
|
|
12
|
-
type:
|
|
11
|
+
type:
|
|
12
|
+
| 'vulnerability'
|
|
13
|
+
| 'dependency'
|
|
14
|
+
| 'code-quality'
|
|
15
|
+
| 'secrets'
|
|
16
|
+
| 'compliance'
|
|
17
|
+
| 'infrastructure'
|
|
18
|
+
| 'container';
|
|
13
19
|
status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
14
20
|
projectId?: string;
|
|
15
21
|
target: {
|
|
@@ -79,7 +85,13 @@ export interface SecurityFinding {
|
|
|
79
85
|
title: string;
|
|
80
86
|
description: string;
|
|
81
87
|
severity: SecuritySeverity;
|
|
82
|
-
category:
|
|
88
|
+
category:
|
|
89
|
+
| 'vulnerability'
|
|
90
|
+
| 'secret'
|
|
91
|
+
| 'misconfiguration'
|
|
92
|
+
| 'compliance'
|
|
93
|
+
| 'code-quality'
|
|
94
|
+
| 'license';
|
|
83
95
|
cwe?: string; // Common Weakness Enumeration
|
|
84
96
|
cve?: string; // Common Vulnerabilities and Exposures
|
|
85
97
|
cvss?: {
|
|
@@ -134,7 +146,12 @@ export interface SecurityRecommendation {
|
|
|
134
146
|
id: string;
|
|
135
147
|
title: string;
|
|
136
148
|
description: string;
|
|
137
|
-
category:
|
|
149
|
+
category:
|
|
150
|
+
| 'security-hardening'
|
|
151
|
+
| 'vulnerability-management'
|
|
152
|
+
| 'access-control'
|
|
153
|
+
| 'monitoring'
|
|
154
|
+
| 'compliance';
|
|
138
155
|
priority: 'low' | 'medium' | 'high' | 'critical';
|
|
139
156
|
effort: 'low' | 'medium' | 'high';
|
|
140
157
|
impact: string;
|
|
@@ -199,7 +216,12 @@ export interface SecurityIncident {
|
|
|
199
216
|
description: string;
|
|
200
217
|
severity: SecuritySeverity;
|
|
201
218
|
status: 'open' | 'investigating' | 'contained' | 'resolved' | 'closed';
|
|
202
|
-
type:
|
|
219
|
+
type:
|
|
220
|
+
| 'security-breach'
|
|
221
|
+
| 'vulnerability-exploit'
|
|
222
|
+
| 'policy-violation'
|
|
223
|
+
| 'suspicious-activity'
|
|
224
|
+
| 'compliance-violation';
|
|
203
225
|
source: {
|
|
204
226
|
type: 'scan' | 'alert' | 'user-report' | 'automated-detection';
|
|
205
227
|
details: Record<string, any>;
|
|
@@ -256,7 +278,13 @@ export interface SecurityIncident {
|
|
|
256
278
|
|
|
257
279
|
export interface SecurityAction {
|
|
258
280
|
id: string;
|
|
259
|
-
type:
|
|
281
|
+
type:
|
|
282
|
+
| 'investigation'
|
|
283
|
+
| 'containment'
|
|
284
|
+
| 'eradication'
|
|
285
|
+
| 'recovery'
|
|
286
|
+
| 'notification'
|
|
287
|
+
| 'documentation';
|
|
260
288
|
description: string;
|
|
261
289
|
assignedTo: string;
|
|
262
290
|
status: 'pending' | 'in-progress' | 'completed' | 'cancelled';
|
|
@@ -317,12 +345,15 @@ export interface SecurityMetrics {
|
|
|
317
345
|
meanTimeToResolution: number;
|
|
318
346
|
};
|
|
319
347
|
compliance: {
|
|
320
|
-
frameworks: Record<
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
348
|
+
frameworks: Record<
|
|
349
|
+
string,
|
|
350
|
+
{
|
|
351
|
+
total: number;
|
|
352
|
+
passed: number;
|
|
353
|
+
failed: number;
|
|
354
|
+
score: number;
|
|
355
|
+
}
|
|
356
|
+
>;
|
|
326
357
|
overallScore: number;
|
|
327
358
|
trending: 'improving' | 'stable' | 'declining';
|
|
328
359
|
};
|
|
@@ -357,11 +388,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
357
388
|
private logger: Logger;
|
|
358
389
|
private config: ConfigManager;
|
|
359
390
|
|
|
360
|
-
constructor(
|
|
361
|
-
securityPath: string = './security',
|
|
362
|
-
logger?: Logger,
|
|
363
|
-
config?: ConfigManager
|
|
364
|
-
) {
|
|
391
|
+
constructor(securityPath: string = './security', logger?: Logger, config?: ConfigManager) {
|
|
365
392
|
super();
|
|
366
393
|
this.securityPath = securityPath;
|
|
367
394
|
this.logger = logger || new Logger({ level: 'info', format: 'text', destination: 'console' });
|
|
@@ -376,11 +403,11 @@ export class SecurityManager extends EventEmitter {
|
|
|
376
403
|
await mkdir(join(this.securityPath, 'incidents'), { recursive: true });
|
|
377
404
|
await mkdir(join(this.securityPath, 'reports'), { recursive: true });
|
|
378
405
|
await mkdir(join(this.securityPath, 'databases'), { recursive: true });
|
|
379
|
-
|
|
406
|
+
|
|
380
407
|
await this.loadConfigurations();
|
|
381
408
|
await this.initializeDefaultPolicies();
|
|
382
409
|
await this.initializeVulnerabilityDatabases();
|
|
383
|
-
|
|
410
|
+
|
|
384
411
|
this.logger.info('Security Manager initialized successfully');
|
|
385
412
|
} catch (error) {
|
|
386
413
|
this.logger.error('Failed to initialize Security Manager', { error });
|
|
@@ -410,7 +437,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
410
437
|
severity: ['critical', 'high', 'medium', 'low'],
|
|
411
438
|
formats: ['json', 'html'],
|
|
412
439
|
outputPath: join(this.securityPath, 'reports'),
|
|
413
|
-
...scanData.configuration
|
|
440
|
+
...scanData.configuration,
|
|
414
441
|
},
|
|
415
442
|
results: [],
|
|
416
443
|
metrics: {
|
|
@@ -423,19 +450,19 @@ export class SecurityManager extends EventEmitter {
|
|
|
423
450
|
suppressed: 0,
|
|
424
451
|
scanDuration: 0,
|
|
425
452
|
filesScanned: 0,
|
|
426
|
-
linesScanned: 0
|
|
453
|
+
linesScanned: 0,
|
|
427
454
|
},
|
|
428
455
|
compliance: {
|
|
429
456
|
frameworks: [],
|
|
430
457
|
requirements: [],
|
|
431
458
|
overallScore: 0,
|
|
432
459
|
passedChecks: 0,
|
|
433
|
-
failedChecks: 0
|
|
460
|
+
failedChecks: 0,
|
|
434
461
|
},
|
|
435
462
|
remediation: {
|
|
436
463
|
autoFixAvailable: [],
|
|
437
464
|
manualReview: [],
|
|
438
|
-
recommendations: []
|
|
465
|
+
recommendations: [],
|
|
439
466
|
},
|
|
440
467
|
schedule: scanData.schedule,
|
|
441
468
|
notifications: {
|
|
@@ -443,19 +470,19 @@ export class SecurityManager extends EventEmitter {
|
|
|
443
470
|
thresholds: {
|
|
444
471
|
critical: 1,
|
|
445
472
|
high: 5,
|
|
446
|
-
medium: 10
|
|
447
|
-
}
|
|
473
|
+
medium: 10,
|
|
474
|
+
},
|
|
448
475
|
},
|
|
449
476
|
createdAt: new Date(),
|
|
450
477
|
updatedAt: new Date(),
|
|
451
478
|
createdBy: 'system',
|
|
452
|
-
auditLog: []
|
|
479
|
+
auditLog: [],
|
|
453
480
|
};
|
|
454
481
|
|
|
455
482
|
this.addAuditEntry(scan, 'system', 'scan_created', 'scan', {
|
|
456
483
|
scanId: scan.id,
|
|
457
484
|
scanName: scan.name,
|
|
458
|
-
scanType: scan.type
|
|
485
|
+
scanType: scan.type,
|
|
459
486
|
});
|
|
460
487
|
|
|
461
488
|
this.scans.set(scan.id, scan);
|
|
@@ -482,7 +509,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
482
509
|
|
|
483
510
|
this.addAuditEntry(scan, 'system', 'scan_started', 'scan', {
|
|
484
511
|
scanId,
|
|
485
|
-
target: scan.target
|
|
512
|
+
target: scan.target,
|
|
486
513
|
});
|
|
487
514
|
|
|
488
515
|
await this.saveScan(scan);
|
|
@@ -490,10 +517,10 @@ export class SecurityManager extends EventEmitter {
|
|
|
490
517
|
|
|
491
518
|
try {
|
|
492
519
|
const startTime = Date.now();
|
|
493
|
-
|
|
520
|
+
|
|
494
521
|
// Execute the appropriate scanner
|
|
495
522
|
const findings = await this.executeScanEngine(scan);
|
|
496
|
-
|
|
523
|
+
|
|
497
524
|
const endTime = Date.now();
|
|
498
525
|
scan.metrics.scanDuration = endTime - startTime;
|
|
499
526
|
scan.results = findings;
|
|
@@ -516,21 +543,22 @@ export class SecurityManager extends EventEmitter {
|
|
|
516
543
|
this.addAuditEntry(scan, 'system', 'scan_completed', 'scan', {
|
|
517
544
|
scanId,
|
|
518
545
|
duration: scan.metrics.scanDuration,
|
|
519
|
-
findingsCount: scan.results.length
|
|
546
|
+
findingsCount: scan.results.length,
|
|
520
547
|
});
|
|
521
548
|
|
|
522
549
|
await this.saveScan(scan);
|
|
523
550
|
this.emit('scan:completed', scan);
|
|
524
551
|
|
|
525
|
-
this.logger.info(
|
|
526
|
-
|
|
552
|
+
this.logger.info(
|
|
553
|
+
`Security scan completed: ${scan.name} (${scan.id}) - ${scan.results.length} findings`,
|
|
554
|
+
);
|
|
527
555
|
} catch (error) {
|
|
528
556
|
scan.status = 'failed';
|
|
529
557
|
scan.updatedAt = new Date();
|
|
530
558
|
|
|
531
559
|
this.addAuditEntry(scan, 'system', 'scan_failed', 'scan', {
|
|
532
560
|
scanId,
|
|
533
|
-
error:
|
|
561
|
+
error: error instanceof Error ? error.message : String(error),
|
|
534
562
|
});
|
|
535
563
|
|
|
536
564
|
await this.saveScan(scan);
|
|
@@ -561,51 +589,51 @@ export class SecurityManager extends EventEmitter {
|
|
|
561
589
|
systems: [],
|
|
562
590
|
data: [],
|
|
563
591
|
users: [],
|
|
564
|
-
...incidentData.affected
|
|
592
|
+
...incidentData.affected,
|
|
565
593
|
},
|
|
566
594
|
timeline: {
|
|
567
595
|
detected: new Date(),
|
|
568
596
|
reported: new Date(),
|
|
569
|
-
acknowledged: new Date()
|
|
597
|
+
acknowledged: new Date(),
|
|
570
598
|
},
|
|
571
599
|
response: {
|
|
572
600
|
assignedTo: [],
|
|
573
601
|
actions: [],
|
|
574
602
|
communications: [],
|
|
575
|
-
lessons: []
|
|
603
|
+
lessons: [],
|
|
576
604
|
},
|
|
577
605
|
evidence: {
|
|
578
606
|
logs: [],
|
|
579
607
|
files: [],
|
|
580
608
|
screenshots: [],
|
|
581
|
-
forensics: []
|
|
609
|
+
forensics: [],
|
|
582
610
|
},
|
|
583
611
|
impact: {
|
|
584
612
|
confidentiality: 'none',
|
|
585
613
|
integrity: 'none',
|
|
586
|
-
availability: 'none'
|
|
614
|
+
availability: 'none',
|
|
587
615
|
},
|
|
588
616
|
rootCause: {
|
|
589
617
|
primary: '',
|
|
590
618
|
contributing: [],
|
|
591
|
-
analysis: ''
|
|
619
|
+
analysis: '',
|
|
592
620
|
},
|
|
593
621
|
remediation: {
|
|
594
622
|
immediate: [],
|
|
595
623
|
shortTerm: [],
|
|
596
624
|
longTerm: [],
|
|
597
|
-
preventive: []
|
|
625
|
+
preventive: [],
|
|
598
626
|
},
|
|
599
627
|
createdAt: new Date(),
|
|
600
628
|
updatedAt: new Date(),
|
|
601
629
|
createdBy: 'system',
|
|
602
|
-
auditLog: []
|
|
630
|
+
auditLog: [],
|
|
603
631
|
};
|
|
604
632
|
|
|
605
633
|
this.addAuditEntry(incident, 'system', 'incident_created', 'incident', {
|
|
606
634
|
incidentId: incident.id,
|
|
607
635
|
severity: incident.severity,
|
|
608
|
-
type: incident.type
|
|
636
|
+
type: incident.type,
|
|
609
637
|
});
|
|
610
638
|
|
|
611
639
|
this.incidents.set(incident.id, incident);
|
|
@@ -628,7 +656,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
628
656
|
async updateIncident(
|
|
629
657
|
incidentId: string,
|
|
630
658
|
updates: Partial<SecurityIncident>,
|
|
631
|
-
userId: string = 'system'
|
|
659
|
+
userId: string = 'system',
|
|
632
660
|
): Promise<SecurityIncident> {
|
|
633
661
|
const incident = this.incidents.get(incidentId);
|
|
634
662
|
if (!incident) {
|
|
@@ -648,7 +676,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
648
676
|
incidentId,
|
|
649
677
|
changes: Object.keys(updates),
|
|
650
678
|
oldStatus,
|
|
651
|
-
newStatus: incident.status
|
|
679
|
+
newStatus: incident.status,
|
|
652
680
|
});
|
|
653
681
|
|
|
654
682
|
await this.saveIncident(incident);
|
|
@@ -665,7 +693,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
665
693
|
projectId?: string;
|
|
666
694
|
environment?: string;
|
|
667
695
|
resources?: string[];
|
|
668
|
-
}
|
|
696
|
+
},
|
|
669
697
|
): Promise<ComplianceCheck[]> {
|
|
670
698
|
const checks: ComplianceCheck[] = [];
|
|
671
699
|
|
|
@@ -674,7 +702,9 @@ export class SecurityManager extends EventEmitter {
|
|
|
674
702
|
checks.push(...frameworkChecks);
|
|
675
703
|
}
|
|
676
704
|
|
|
677
|
-
this.logger.info(
|
|
705
|
+
this.logger.info(
|
|
706
|
+
`Compliance assessment completed: ${checks.length} checks across ${frameworks.length} frameworks`,
|
|
707
|
+
);
|
|
678
708
|
this.emit('compliance:assessed', { frameworks, checks, scope });
|
|
679
709
|
|
|
680
710
|
return checks;
|
|
@@ -695,35 +725,35 @@ export class SecurityManager extends EventEmitter {
|
|
|
695
725
|
type: policyData.type,
|
|
696
726
|
version: '1.0.0',
|
|
697
727
|
status: 'draft',
|
|
698
|
-
rules: policyData.rules.map(rule => ({
|
|
728
|
+
rules: policyData.rules.map((rule) => ({
|
|
699
729
|
id: `rule-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
700
|
-
...rule
|
|
730
|
+
...rule,
|
|
701
731
|
})),
|
|
702
732
|
enforcement: {
|
|
703
733
|
level: 'warning',
|
|
704
734
|
exceptions: [],
|
|
705
735
|
approvers: [],
|
|
706
|
-
...policyData.enforcement
|
|
736
|
+
...policyData.enforcement,
|
|
707
737
|
},
|
|
708
738
|
applicability: {
|
|
709
739
|
projects: [],
|
|
710
740
|
environments: [],
|
|
711
741
|
resources: [],
|
|
712
|
-
...policyData.applicability
|
|
742
|
+
...policyData.applicability,
|
|
713
743
|
},
|
|
714
744
|
schedule: {
|
|
715
745
|
reviewFrequency: 'annually',
|
|
716
746
|
nextReview: new Date(Date.now() + 365 * 24 * 60 * 60 * 1000), // 1 year
|
|
717
|
-
reviewer: 'security-team'
|
|
747
|
+
reviewer: 'security-team',
|
|
718
748
|
},
|
|
719
749
|
metrics: {
|
|
720
750
|
violations: 0,
|
|
721
751
|
compliance: 100,
|
|
722
|
-
exceptions: 0
|
|
752
|
+
exceptions: 0,
|
|
723
753
|
},
|
|
724
754
|
createdAt: new Date(),
|
|
725
755
|
updatedAt: new Date(),
|
|
726
|
-
createdBy: 'system'
|
|
756
|
+
createdBy: 'system',
|
|
727
757
|
};
|
|
728
758
|
|
|
729
759
|
this.policies.set(policy.id, policy);
|
|
@@ -735,71 +765,69 @@ export class SecurityManager extends EventEmitter {
|
|
|
735
765
|
return policy;
|
|
736
766
|
}
|
|
737
767
|
|
|
738
|
-
async getSecurityMetrics(
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
}
|
|
745
|
-
): Promise<SecurityMetrics> {
|
|
768
|
+
async getSecurityMetrics(filters?: {
|
|
769
|
+
timeRange?: { start: Date; end: Date };
|
|
770
|
+
projectId?: string;
|
|
771
|
+
environment?: string;
|
|
772
|
+
severity?: SecuritySeverity[];
|
|
773
|
+
}): Promise<SecurityMetrics> {
|
|
746
774
|
let scans = Array.from(this.scans.values());
|
|
747
775
|
let incidents = Array.from(this.incidents.values());
|
|
748
776
|
|
|
749
777
|
// Apply filters
|
|
750
778
|
if (filters) {
|
|
751
779
|
if (filters.timeRange) {
|
|
752
|
-
scans = scans.filter(
|
|
753
|
-
s.createdAt >= filters.timeRange!.start &&
|
|
754
|
-
s.createdAt <= filters.timeRange!.end
|
|
780
|
+
scans = scans.filter(
|
|
781
|
+
(s) => s.createdAt >= filters.timeRange!.start && s.createdAt <= filters.timeRange!.end,
|
|
755
782
|
);
|
|
756
|
-
incidents = incidents.filter(
|
|
757
|
-
i.createdAt >= filters.timeRange!.start &&
|
|
758
|
-
i.createdAt <= filters.timeRange!.end
|
|
783
|
+
incidents = incidents.filter(
|
|
784
|
+
(i) => i.createdAt >= filters.timeRange!.start && i.createdAt <= filters.timeRange!.end,
|
|
759
785
|
);
|
|
760
786
|
}
|
|
761
787
|
if (filters.projectId) {
|
|
762
|
-
scans = scans.filter(s => s.projectId === filters.projectId);
|
|
788
|
+
scans = scans.filter((s) => s.projectId === filters.projectId);
|
|
763
789
|
}
|
|
764
790
|
}
|
|
765
791
|
|
|
766
792
|
// Calculate scan metrics
|
|
767
793
|
const scanMetrics = {
|
|
768
794
|
total: scans.length,
|
|
769
|
-
completed: scans.filter(s => s.status === 'completed').length,
|
|
770
|
-
failed: scans.filter(s => s.status === 'failed').length,
|
|
771
|
-
inProgress: scans.filter(s => s.status === 'running').length,
|
|
795
|
+
completed: scans.filter((s) => s.status === 'completed').length,
|
|
796
|
+
failed: scans.filter((s) => s.status === 'failed').length,
|
|
797
|
+
inProgress: scans.filter((s) => s.status === 'running').length,
|
|
772
798
|
byType: this.groupBy(scans, 'type'),
|
|
773
|
-
averageDuration:
|
|
774
|
-
scans.
|
|
799
|
+
averageDuration:
|
|
800
|
+
scans.length > 0
|
|
801
|
+
? scans.reduce((sum, s) => sum + s.metrics.scanDuration, 0) / scans.length
|
|
802
|
+
: 0,
|
|
775
803
|
};
|
|
776
804
|
|
|
777
805
|
// Calculate finding metrics
|
|
778
|
-
const allFindings = scans.flatMap(s => s.results);
|
|
806
|
+
const allFindings = scans.flatMap((s) => s.results);
|
|
779
807
|
const findingMetrics = {
|
|
780
808
|
total: allFindings.length,
|
|
781
|
-
open: allFindings.filter(f => f.status === 'open').length,
|
|
782
|
-
resolved: allFindings.filter(f => f.status === 'resolved').length,
|
|
783
|
-
suppressed: allFindings.filter(f => f.status === 'suppressed').length,
|
|
809
|
+
open: allFindings.filter((f) => f.status === 'open').length,
|
|
810
|
+
resolved: allFindings.filter((f) => f.status === 'resolved').length,
|
|
811
|
+
suppressed: allFindings.filter((f) => f.status === 'suppressed').length,
|
|
784
812
|
bySeverity: this.groupBy(allFindings, 'severity') as Record<SecuritySeverity, number>,
|
|
785
813
|
byCategory: this.groupBy(allFindings, 'category'),
|
|
786
|
-
meanTimeToResolution: this.calculateMTTR(allFindings)
|
|
814
|
+
meanTimeToResolution: this.calculateMTTR(allFindings),
|
|
787
815
|
};
|
|
788
816
|
|
|
789
817
|
// Calculate compliance metrics
|
|
790
|
-
const allComplianceChecks = scans.flatMap(s => s.compliance.requirements);
|
|
818
|
+
const allComplianceChecks = scans.flatMap((s) => s.compliance.requirements);
|
|
791
819
|
const complianceFrameworks: Record<string, any> = {};
|
|
792
|
-
|
|
820
|
+
|
|
793
821
|
for (const check of allComplianceChecks) {
|
|
794
822
|
if (!complianceFrameworks[check.framework]) {
|
|
795
823
|
complianceFrameworks[check.framework] = {
|
|
796
824
|
total: 0,
|
|
797
825
|
passed: 0,
|
|
798
826
|
failed: 0,
|
|
799
|
-
score: 0
|
|
827
|
+
score: 0,
|
|
800
828
|
};
|
|
801
829
|
}
|
|
802
|
-
|
|
830
|
+
|
|
803
831
|
complianceFrameworks[check.framework].total++;
|
|
804
832
|
if (check.status === 'passed') {
|
|
805
833
|
complianceFrameworks[check.framework].passed++;
|
|
@@ -814,29 +842,33 @@ export class SecurityManager extends EventEmitter {
|
|
|
814
842
|
fw.score = fw.total > 0 ? (fw.passed / fw.total) * 100 : 0;
|
|
815
843
|
}
|
|
816
844
|
|
|
817
|
-
const overallComplianceScore =
|
|
818
|
-
Object.values(complianceFrameworks).
|
|
819
|
-
|
|
845
|
+
const overallComplianceScore =
|
|
846
|
+
Object.values(complianceFrameworks).length > 0
|
|
847
|
+
? Object.values(complianceFrameworks).reduce((sum: number, fw: any) => sum + fw.score, 0) /
|
|
848
|
+
Object.values(complianceFrameworks).length
|
|
849
|
+
: 0;
|
|
820
850
|
|
|
821
851
|
// Calculate incident metrics
|
|
822
852
|
const incidentMetrics = {
|
|
823
853
|
total: incidents.length,
|
|
824
|
-
open: incidents.filter(i => i.status === 'open' || i.status === 'investigating').length,
|
|
825
|
-
resolved: incidents.filter(i => i.status === 'resolved' || i.status === 'closed').length,
|
|
854
|
+
open: incidents.filter((i) => i.status === 'open' || i.status === 'investigating').length,
|
|
855
|
+
resolved: incidents.filter((i) => i.status === 'resolved' || i.status === 'closed').length,
|
|
826
856
|
bySeverity: this.groupBy(incidents, 'severity') as Record<SecuritySeverity, number>,
|
|
827
857
|
meanTimeToDetection: this.calculateMTTD(incidents),
|
|
828
858
|
meanTimeToResponse: this.calculateMTTResponse(incidents),
|
|
829
|
-
meanTimeToResolution: this.calculateIncidentMTTR(incidents)
|
|
859
|
+
meanTimeToResolution: this.calculateIncidentMTTR(incidents),
|
|
830
860
|
};
|
|
831
861
|
|
|
832
862
|
// Policy metrics
|
|
833
863
|
const policies = Array.from(this.policies.values());
|
|
834
864
|
const policyMetrics = {
|
|
835
865
|
total: policies.length,
|
|
836
|
-
active: policies.filter(p => p.status === 'active').length,
|
|
866
|
+
active: policies.filter((p) => p.status === 'active').length,
|
|
837
867
|
violations: policies.reduce((sum, p) => sum + p.metrics.violations, 0),
|
|
838
|
-
compliance:
|
|
839
|
-
policies.
|
|
868
|
+
compliance:
|
|
869
|
+
policies.length > 0
|
|
870
|
+
? policies.reduce((sum, p) => sum + p.metrics.compliance, 0) / policies.length
|
|
871
|
+
: 0,
|
|
840
872
|
};
|
|
841
873
|
|
|
842
874
|
return {
|
|
@@ -845,15 +877,15 @@ export class SecurityManager extends EventEmitter {
|
|
|
845
877
|
compliance: {
|
|
846
878
|
frameworks: complianceFrameworks,
|
|
847
879
|
overallScore: overallComplianceScore,
|
|
848
|
-
trending: 'stable' // Would be calculated from historical data
|
|
880
|
+
trending: 'stable', // Would be calculated from historical data
|
|
849
881
|
},
|
|
850
882
|
incidents: incidentMetrics,
|
|
851
883
|
policies: policyMetrics,
|
|
852
884
|
trends: {
|
|
853
885
|
findingsTrend: [], // Would be calculated from historical data
|
|
854
886
|
complianceTrend: [], // Would be calculated from historical data
|
|
855
|
-
incidentsTrend: [] // Would be calculated from historical data
|
|
856
|
-
}
|
|
887
|
+
incidentsTrend: [], // Would be calculated from historical data
|
|
888
|
+
},
|
|
857
889
|
};
|
|
858
890
|
}
|
|
859
891
|
|
|
@@ -862,7 +894,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
862
894
|
try {
|
|
863
895
|
// Load scans
|
|
864
896
|
const scanFiles = await readdir(join(this.securityPath, 'scans'));
|
|
865
|
-
for (const file of scanFiles.filter(f => f.endsWith('.json'))) {
|
|
897
|
+
for (const file of scanFiles.filter((f) => f.endsWith('.json'))) {
|
|
866
898
|
const content = await readFile(join(this.securityPath, 'scans', file), 'utf-8');
|
|
867
899
|
const scan: SecurityScan = JSON.parse(content);
|
|
868
900
|
this.scans.set(scan.id, scan);
|
|
@@ -870,7 +902,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
870
902
|
|
|
871
903
|
// Load policies
|
|
872
904
|
const policyFiles = await readdir(join(this.securityPath, 'policies'));
|
|
873
|
-
for (const file of policyFiles.filter(f => f.endsWith('.json'))) {
|
|
905
|
+
for (const file of policyFiles.filter((f) => f.endsWith('.json'))) {
|
|
874
906
|
const content = await readFile(join(this.securityPath, 'policies', file), 'utf-8');
|
|
875
907
|
const policy: SecurityPolicy = JSON.parse(content);
|
|
876
908
|
this.policies.set(policy.id, policy);
|
|
@@ -878,13 +910,15 @@ export class SecurityManager extends EventEmitter {
|
|
|
878
910
|
|
|
879
911
|
// Load incidents
|
|
880
912
|
const incidentFiles = await readdir(join(this.securityPath, 'incidents'));
|
|
881
|
-
for (const file of incidentFiles.filter(f => f.endsWith('.json'))) {
|
|
913
|
+
for (const file of incidentFiles.filter((f) => f.endsWith('.json'))) {
|
|
882
914
|
const content = await readFile(join(this.securityPath, 'incidents', file), 'utf-8');
|
|
883
915
|
const incident: SecurityIncident = JSON.parse(content);
|
|
884
916
|
this.incidents.set(incident.id, incident);
|
|
885
917
|
}
|
|
886
918
|
|
|
887
|
-
this.logger.info(
|
|
919
|
+
this.logger.info(
|
|
920
|
+
`Loaded ${this.scans.size} scans, ${this.policies.size} policies, ${this.incidents.size} incidents`,
|
|
921
|
+
);
|
|
888
922
|
} catch (error) {
|
|
889
923
|
this.logger.warn('Failed to load some security configurations', { error });
|
|
890
924
|
}
|
|
@@ -904,14 +938,14 @@ export class SecurityManager extends EventEmitter {
|
|
|
904
938
|
action: 'alert' as const,
|
|
905
939
|
severity: 'critical' as const,
|
|
906
940
|
parameters: { threshold: 9.0 },
|
|
907
|
-
enabled: true
|
|
908
|
-
}
|
|
941
|
+
enabled: true,
|
|
942
|
+
},
|
|
909
943
|
],
|
|
910
944
|
enforcement: {
|
|
911
945
|
level: 'blocking' as const,
|
|
912
946
|
exceptions: [],
|
|
913
|
-
approvers: ['security-lead']
|
|
914
|
-
}
|
|
947
|
+
approvers: ['security-lead'],
|
|
948
|
+
},
|
|
915
949
|
},
|
|
916
950
|
{
|
|
917
951
|
name: 'Secret Detection Policy',
|
|
@@ -925,14 +959,14 @@ export class SecurityManager extends EventEmitter {
|
|
|
925
959
|
action: 'deny' as const,
|
|
926
960
|
severity: 'high' as const,
|
|
927
961
|
parameters: {},
|
|
928
|
-
enabled: true
|
|
929
|
-
}
|
|
930
|
-
]
|
|
931
|
-
}
|
|
962
|
+
enabled: true,
|
|
963
|
+
},
|
|
964
|
+
],
|
|
965
|
+
},
|
|
932
966
|
];
|
|
933
967
|
|
|
934
968
|
for (const policyData of defaultPolicies) {
|
|
935
|
-
if (!Array.from(this.policies.values()).some(p => p.name === policyData.name)) {
|
|
969
|
+
if (!Array.from(this.policies.values()).some((p) => p.name === policyData.name)) {
|
|
936
970
|
await this.createSecurityPolicy(policyData);
|
|
937
971
|
}
|
|
938
972
|
}
|
|
@@ -948,7 +982,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
948
982
|
updateFrequency: 'daily',
|
|
949
983
|
lastUpdate: new Date(),
|
|
950
984
|
status: 'active',
|
|
951
|
-
configuration: {}
|
|
985
|
+
configuration: {},
|
|
952
986
|
},
|
|
953
987
|
{
|
|
954
988
|
id: 'github-advisories',
|
|
@@ -958,8 +992,8 @@ export class SecurityManager extends EventEmitter {
|
|
|
958
992
|
updateFrequency: 'daily',
|
|
959
993
|
lastUpdate: new Date(),
|
|
960
994
|
status: 'active',
|
|
961
|
-
configuration: {}
|
|
962
|
-
}
|
|
995
|
+
configuration: {},
|
|
996
|
+
},
|
|
963
997
|
];
|
|
964
998
|
|
|
965
999
|
for (const db of databases) {
|
|
@@ -969,13 +1003,13 @@ export class SecurityManager extends EventEmitter {
|
|
|
969
1003
|
|
|
970
1004
|
private getDefaultScanner(type: SecurityScan['type']): string {
|
|
971
1005
|
const scanners: Record<SecurityScan['type'], string> = {
|
|
972
|
-
|
|
973
|
-
|
|
1006
|
+
vulnerability: 'trivy',
|
|
1007
|
+
dependency: 'npm-audit',
|
|
974
1008
|
'code-quality': 'sonarqube',
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1009
|
+
secrets: 'gitleaks',
|
|
1010
|
+
compliance: 'inspec',
|
|
1011
|
+
infrastructure: 'checkov',
|
|
1012
|
+
container: 'clair',
|
|
979
1013
|
};
|
|
980
1014
|
|
|
981
1015
|
return scanners[type] || 'generic';
|
|
@@ -1001,7 +1035,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
1001
1035
|
private async executeTrivyScan(scan: SecurityScan): Promise<SecurityFinding[]> {
|
|
1002
1036
|
return new Promise((resolve, reject) => {
|
|
1003
1037
|
const findings: SecurityFinding[] = [];
|
|
1004
|
-
|
|
1038
|
+
|
|
1005
1039
|
// Mock Trivy execution
|
|
1006
1040
|
const mockFindings = [
|
|
1007
1041
|
{
|
|
@@ -1014,17 +1048,17 @@ export class SecurityManager extends EventEmitter {
|
|
|
1014
1048
|
cvss: {
|
|
1015
1049
|
score: 9.8,
|
|
1016
1050
|
vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H',
|
|
1017
|
-
version: '3.1'
|
|
1051
|
+
version: '3.1',
|
|
1018
1052
|
},
|
|
1019
1053
|
location: {
|
|
1020
1054
|
file: 'package-lock.json',
|
|
1021
1055
|
line: 125,
|
|
1022
|
-
component: 'libxml2@2.9.10'
|
|
1056
|
+
component: 'libxml2@2.9.10',
|
|
1023
1057
|
},
|
|
1024
1058
|
evidence: {
|
|
1025
1059
|
snippet: '"libxml2": "2.9.10"',
|
|
1026
1060
|
context: 'Dependency declaration',
|
|
1027
|
-
references: ['https://nvd.nist.gov/vuln/detail/CVE-2023-12345']
|
|
1061
|
+
references: ['https://nvd.nist.gov/vuln/detail/CVE-2023-12345'],
|
|
1028
1062
|
},
|
|
1029
1063
|
impact: 'Remote attackers could execute arbitrary code',
|
|
1030
1064
|
remediation: {
|
|
@@ -1033,15 +1067,15 @@ export class SecurityManager extends EventEmitter {
|
|
|
1033
1067
|
priority: 'critical' as const,
|
|
1034
1068
|
autoFixable: true,
|
|
1035
1069
|
steps: ['npm update libxml2'],
|
|
1036
|
-
references: ['https://github.com/GNOME/libxml2/releases']
|
|
1070
|
+
references: ['https://github.com/GNOME/libxml2/releases'],
|
|
1037
1071
|
},
|
|
1038
1072
|
status: 'open' as const,
|
|
1039
1073
|
tags: ['cve', 'rce', 'dependency'],
|
|
1040
1074
|
metadata: {},
|
|
1041
1075
|
firstSeen: new Date(),
|
|
1042
1076
|
lastSeen: new Date(),
|
|
1043
|
-
occurrences: 1
|
|
1044
|
-
}
|
|
1077
|
+
occurrences: 1,
|
|
1078
|
+
},
|
|
1045
1079
|
];
|
|
1046
1080
|
|
|
1047
1081
|
// Simulate scan delay
|
|
@@ -1055,10 +1089,10 @@ export class SecurityManager extends EventEmitter {
|
|
|
1055
1089
|
return new Promise((resolve, reject) => {
|
|
1056
1090
|
const command = 'npm';
|
|
1057
1091
|
const args = ['audit', '--json'];
|
|
1058
|
-
|
|
1092
|
+
|
|
1059
1093
|
const child = spawn(command, args, {
|
|
1060
1094
|
cwd: scan.target.path,
|
|
1061
|
-
stdio: ['pipe', 'pipe', 'pipe']
|
|
1095
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
1062
1096
|
});
|
|
1063
1097
|
|
|
1064
1098
|
let stdout = '';
|
|
@@ -1078,7 +1112,11 @@ export class SecurityManager extends EventEmitter {
|
|
|
1078
1112
|
const findings = this.parseNpmAuditResults(auditResult);
|
|
1079
1113
|
resolve(findings);
|
|
1080
1114
|
} catch (error) {
|
|
1081
|
-
reject(
|
|
1115
|
+
reject(
|
|
1116
|
+
new Error(
|
|
1117
|
+
`Failed to parse npm audit results: ${error instanceof Error ? error.message : String(error)}`,
|
|
1118
|
+
),
|
|
1119
|
+
);
|
|
1082
1120
|
}
|
|
1083
1121
|
});
|
|
1084
1122
|
|
|
@@ -1100,11 +1138,11 @@ export class SecurityManager extends EventEmitter {
|
|
|
1100
1138
|
location: {
|
|
1101
1139
|
file: 'config/aws.js',
|
|
1102
1140
|
line: 12,
|
|
1103
|
-
column: 20
|
|
1141
|
+
column: 20,
|
|
1104
1142
|
},
|
|
1105
1143
|
evidence: {
|
|
1106
1144
|
snippet: 'const accessKey = "AKIA123456789..."',
|
|
1107
|
-
context: 'Hardcoded AWS credentials'
|
|
1145
|
+
context: 'Hardcoded AWS credentials',
|
|
1108
1146
|
},
|
|
1109
1147
|
impact: 'Unauthorized access to AWS resources',
|
|
1110
1148
|
remediation: {
|
|
@@ -1115,17 +1153,17 @@ export class SecurityManager extends EventEmitter {
|
|
|
1115
1153
|
steps: [
|
|
1116
1154
|
'Remove hardcoded credentials',
|
|
1117
1155
|
'Use environment variables',
|
|
1118
|
-
'Rotate compromised keys'
|
|
1156
|
+
'Rotate compromised keys',
|
|
1119
1157
|
],
|
|
1120
|
-
references: ['https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html']
|
|
1158
|
+
references: ['https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html'],
|
|
1121
1159
|
},
|
|
1122
1160
|
status: 'open' as const,
|
|
1123
1161
|
tags: ['secret', 'aws', 'credentials'],
|
|
1124
1162
|
metadata: {},
|
|
1125
1163
|
firstSeen: new Date(),
|
|
1126
1164
|
lastSeen: new Date(),
|
|
1127
|
-
occurrences: 1
|
|
1128
|
-
}
|
|
1165
|
+
occurrences: 1,
|
|
1166
|
+
},
|
|
1129
1167
|
];
|
|
1130
1168
|
}
|
|
1131
1169
|
|
|
@@ -1141,11 +1179,11 @@ export class SecurityManager extends EventEmitter {
|
|
|
1141
1179
|
|
|
1142
1180
|
private parseNpmAuditResults(auditResult: any): SecurityFinding[] {
|
|
1143
1181
|
const findings: SecurityFinding[] = [];
|
|
1144
|
-
|
|
1182
|
+
|
|
1145
1183
|
if (auditResult.vulnerabilities) {
|
|
1146
1184
|
for (const [packageName, vulnData] of Object.entries(auditResult.vulnerabilities)) {
|
|
1147
1185
|
const vuln = vulnData as any;
|
|
1148
|
-
|
|
1186
|
+
|
|
1149
1187
|
findings.push({
|
|
1150
1188
|
id: `finding-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
1151
1189
|
title: `${vuln.severity} vulnerability in ${packageName}`,
|
|
@@ -1155,60 +1193,69 @@ export class SecurityManager extends EventEmitter {
|
|
|
1155
1193
|
cve: vuln.cve,
|
|
1156
1194
|
location: {
|
|
1157
1195
|
file: 'package.json',
|
|
1158
|
-
component: packageName
|
|
1196
|
+
component: packageName,
|
|
1159
1197
|
},
|
|
1160
1198
|
evidence: {
|
|
1161
1199
|
snippet: `"${packageName}": "${vuln.range}"`,
|
|
1162
|
-
references: vuln.url ? [vuln.url] : []
|
|
1200
|
+
references: vuln.url ? [vuln.url] : [],
|
|
1163
1201
|
},
|
|
1164
1202
|
impact: vuln.overview || 'Security vulnerability',
|
|
1165
1203
|
remediation: {
|
|
1166
1204
|
description: vuln.recommendation || 'Update to a secure version',
|
|
1167
1205
|
effort: 'low' as const,
|
|
1168
|
-
priority:
|
|
1206
|
+
priority:
|
|
1207
|
+
vuln.severity === 'info'
|
|
1208
|
+
? 'low'
|
|
1209
|
+
: (vuln.severity as 'low' | 'medium' | 'high' | 'critical'),
|
|
1169
1210
|
autoFixable: true,
|
|
1170
1211
|
steps: [`npm update ${packageName}`],
|
|
1171
|
-
references: vuln.url ? [vuln.url] : []
|
|
1212
|
+
references: vuln.url ? [vuln.url] : [],
|
|
1172
1213
|
},
|
|
1173
1214
|
status: 'open',
|
|
1174
1215
|
tags: ['npm', 'dependency'],
|
|
1175
1216
|
metadata: { packageName, range: vuln.range },
|
|
1176
1217
|
firstSeen: new Date(),
|
|
1177
1218
|
lastSeen: new Date(),
|
|
1178
|
-
occurrences: 1
|
|
1219
|
+
occurrences: 1,
|
|
1179
1220
|
});
|
|
1180
1221
|
}
|
|
1181
1222
|
}
|
|
1182
|
-
|
|
1223
|
+
|
|
1183
1224
|
return findings;
|
|
1184
1225
|
}
|
|
1185
1226
|
|
|
1186
1227
|
private calculateScanMetrics(scan: SecurityScan): void {
|
|
1187
1228
|
const findings = scan.results;
|
|
1188
|
-
|
|
1229
|
+
|
|
1189
1230
|
scan.metrics.totalFindings = findings.length;
|
|
1190
|
-
scan.metrics.criticalFindings = findings.filter(f => f.severity === 'critical').length;
|
|
1191
|
-
scan.metrics.highFindings = findings.filter(f => f.severity === 'high').length;
|
|
1192
|
-
scan.metrics.mediumFindings = findings.filter(f => f.severity === 'medium').length;
|
|
1193
|
-
scan.metrics.lowFindings = findings.filter(f => f.severity === 'low').length;
|
|
1194
|
-
scan.metrics.falsePositives = findings.filter(f => f.status === 'false-positive').length;
|
|
1195
|
-
scan.metrics.suppressed = findings.filter(f => f.status === 'suppressed').length;
|
|
1231
|
+
scan.metrics.criticalFindings = findings.filter((f) => f.severity === 'critical').length;
|
|
1232
|
+
scan.metrics.highFindings = findings.filter((f) => f.severity === 'high').length;
|
|
1233
|
+
scan.metrics.mediumFindings = findings.filter((f) => f.severity === 'medium').length;
|
|
1234
|
+
scan.metrics.lowFindings = findings.filter((f) => f.severity === 'low').length;
|
|
1235
|
+
scan.metrics.falsePositives = findings.filter((f) => f.status === 'false-positive').length;
|
|
1236
|
+
scan.metrics.suppressed = findings.filter((f) => f.status === 'suppressed').length;
|
|
1196
1237
|
}
|
|
1197
1238
|
|
|
1198
1239
|
private async runComplianceChecks(scan: SecurityScan): Promise<void> {
|
|
1199
1240
|
// Mock compliance checks
|
|
1200
1241
|
const frameworks = ['SOC2', 'GDPR', 'PCI-DSS'];
|
|
1201
|
-
|
|
1242
|
+
|
|
1202
1243
|
for (const framework of frameworks) {
|
|
1203
1244
|
const checks = await this.runFrameworkChecks(framework, { projectId: scan.projectId });
|
|
1204
1245
|
scan.compliance.requirements.push(...checks);
|
|
1205
1246
|
}
|
|
1206
|
-
|
|
1247
|
+
|
|
1207
1248
|
scan.compliance.frameworks = frameworks;
|
|
1208
|
-
scan.compliance.passedChecks = scan.compliance.requirements.filter(
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1249
|
+
scan.compliance.passedChecks = scan.compliance.requirements.filter(
|
|
1250
|
+
(r) => r.status === 'passed',
|
|
1251
|
+
).length;
|
|
1252
|
+
scan.compliance.failedChecks = scan.compliance.requirements.filter(
|
|
1253
|
+
(r) => r.status === 'failed',
|
|
1254
|
+
).length;
|
|
1255
|
+
scan.compliance.overallScore =
|
|
1256
|
+
scan.compliance.requirements.length > 0
|
|
1257
|
+
? (scan.compliance.passedChecks / scan.compliance.requirements.length) * 100
|
|
1258
|
+
: 0;
|
|
1212
1259
|
}
|
|
1213
1260
|
|
|
1214
1261
|
private async runFrameworkChecks(framework: string, scope?: any): Promise<ComplianceCheck[]> {
|
|
@@ -1222,7 +1269,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
1222
1269
|
status: 'passed',
|
|
1223
1270
|
severity: 'high',
|
|
1224
1271
|
evidence: 'TLS 1.2+ configured',
|
|
1225
|
-
lastChecked: new Date()
|
|
1272
|
+
lastChecked: new Date(),
|
|
1226
1273
|
},
|
|
1227
1274
|
{
|
|
1228
1275
|
id: `check-${Date.now()}-2`,
|
|
@@ -1232,20 +1279,20 @@ export class SecurityManager extends EventEmitter {
|
|
|
1232
1279
|
status: 'failed',
|
|
1233
1280
|
severity: 'medium',
|
|
1234
1281
|
remediation: 'Enable database encryption',
|
|
1235
|
-
lastChecked: new Date()
|
|
1236
|
-
}
|
|
1282
|
+
lastChecked: new Date(),
|
|
1283
|
+
},
|
|
1237
1284
|
];
|
|
1238
|
-
|
|
1285
|
+
|
|
1239
1286
|
return mockChecks;
|
|
1240
1287
|
}
|
|
1241
1288
|
|
|
1242
1289
|
private async generateRemediationRecommendations(scan: SecurityScan): Promise<void> {
|
|
1243
|
-
const autoFixable = scan.results.filter(f => f.remediation.autoFixable);
|
|
1244
|
-
const manualReview = scan.results.filter(f => !f.remediation.autoFixable);
|
|
1245
|
-
|
|
1290
|
+
const autoFixable = scan.results.filter((f) => f.remediation.autoFixable);
|
|
1291
|
+
const manualReview = scan.results.filter((f) => !f.remediation.autoFixable);
|
|
1292
|
+
|
|
1246
1293
|
scan.remediation.autoFixAvailable = autoFixable;
|
|
1247
1294
|
scan.remediation.manualReview = manualReview;
|
|
1248
|
-
|
|
1295
|
+
|
|
1249
1296
|
// Generate general recommendations
|
|
1250
1297
|
scan.remediation.recommendations = [
|
|
1251
1298
|
{
|
|
@@ -1260,72 +1307,77 @@ export class SecurityManager extends EventEmitter {
|
|
|
1260
1307
|
steps: [
|
|
1261
1308
|
'Configure Dependabot or Renovate',
|
|
1262
1309
|
'Set up automated testing pipeline',
|
|
1263
|
-
'Enable auto-merge for low-risk updates'
|
|
1310
|
+
'Enable auto-merge for low-risk updates',
|
|
1264
1311
|
],
|
|
1265
1312
|
tools: ['Dependabot', 'Renovate', 'GitHub Actions'],
|
|
1266
1313
|
timeEstimate: '2-4 hours',
|
|
1267
|
-
cost: 'Free'
|
|
1314
|
+
cost: 'Free',
|
|
1268
1315
|
},
|
|
1269
1316
|
references: [
|
|
1270
1317
|
'https://docs.github.com/en/code-security/dependabot',
|
|
1271
|
-
'https://renovatebot.com/'
|
|
1318
|
+
'https://renovatebot.com/',
|
|
1272
1319
|
],
|
|
1273
|
-
applicableFrameworks: ['SOC2', 'ISO27001']
|
|
1274
|
-
}
|
|
1320
|
+
applicableFrameworks: ['SOC2', 'ISO27001'],
|
|
1321
|
+
},
|
|
1275
1322
|
];
|
|
1276
1323
|
}
|
|
1277
1324
|
|
|
1278
1325
|
private async checkNotificationThresholds(scan: SecurityScan): Promise<void> {
|
|
1279
1326
|
const thresholds = scan.notifications.thresholds;
|
|
1280
|
-
|
|
1281
|
-
if (
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1327
|
+
|
|
1328
|
+
if (
|
|
1329
|
+
scan.metrics.criticalFindings >= thresholds.critical ||
|
|
1330
|
+
scan.metrics.highFindings >= thresholds.high ||
|
|
1331
|
+
scan.metrics.mediumFindings >= thresholds.medium
|
|
1332
|
+
) {
|
|
1285
1333
|
await this.sendScanNotification(scan);
|
|
1286
1334
|
}
|
|
1287
1335
|
}
|
|
1288
1336
|
|
|
1289
1337
|
private async sendScanNotification(scan: SecurityScan): Promise<void> {
|
|
1290
1338
|
const message = `Security scan '${scan.name}' completed with ${scan.metrics.totalFindings} findings (${scan.metrics.criticalFindings} critical, ${scan.metrics.highFindings} high)`;
|
|
1291
|
-
|
|
1339
|
+
|
|
1292
1340
|
this.emit('notification:scan', {
|
|
1293
1341
|
scan,
|
|
1294
1342
|
message,
|
|
1295
|
-
severity:
|
|
1296
|
-
|
|
1343
|
+
severity:
|
|
1344
|
+
scan.metrics.criticalFindings > 0
|
|
1345
|
+
? 'critical'
|
|
1346
|
+
: scan.metrics.highFindings > 0
|
|
1347
|
+
? 'high'
|
|
1348
|
+
: 'medium',
|
|
1297
1349
|
});
|
|
1298
|
-
|
|
1350
|
+
|
|
1299
1351
|
this.logger.warn(message);
|
|
1300
1352
|
}
|
|
1301
1353
|
|
|
1302
1354
|
private async autoAssignIncident(incident: SecurityIncident): Promise<void> {
|
|
1303
1355
|
// Auto-assign based on severity and type
|
|
1304
1356
|
const assignmentRules: Record<string, string[]> = {
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1357
|
+
critical: ['security-lead', 'ciso'],
|
|
1358
|
+
high: ['security-team'],
|
|
1359
|
+
medium: ['security-analyst'],
|
|
1360
|
+
low: ['security-analyst'],
|
|
1309
1361
|
};
|
|
1310
|
-
|
|
1362
|
+
|
|
1311
1363
|
incident.response.assignedTo = assignmentRules[incident.severity] || ['security-team'];
|
|
1312
1364
|
}
|
|
1313
1365
|
|
|
1314
1366
|
private async sendIncidentNotification(incident: SecurityIncident): Promise<void> {
|
|
1315
1367
|
const message = `SECURITY INCIDENT: ${incident.title} (${incident.severity.toUpperCase()})`;
|
|
1316
|
-
|
|
1368
|
+
|
|
1317
1369
|
this.emit('notification:incident', {
|
|
1318
1370
|
incident,
|
|
1319
1371
|
message,
|
|
1320
|
-
urgency: incident.severity === 'critical' ? 'immediate' : 'high'
|
|
1372
|
+
urgency: incident.severity === 'critical' ? 'immediate' : 'high',
|
|
1321
1373
|
});
|
|
1322
|
-
|
|
1374
|
+
|
|
1323
1375
|
this.logger.error(message);
|
|
1324
1376
|
}
|
|
1325
1377
|
|
|
1326
1378
|
private updateIncidentTimeline(incident: SecurityIncident, newStatus: string): void {
|
|
1327
1379
|
const now = new Date();
|
|
1328
|
-
|
|
1380
|
+
|
|
1329
1381
|
switch (newStatus) {
|
|
1330
1382
|
case 'investigating':
|
|
1331
1383
|
incident.timeline.acknowledged = now;
|
|
@@ -1362,7 +1414,7 @@ export class SecurityManager extends EventEmitter {
|
|
|
1362
1414
|
userId: string,
|
|
1363
1415
|
action: string,
|
|
1364
1416
|
targetType: string,
|
|
1365
|
-
details: Record<string, any
|
|
1417
|
+
details: Record<string, any>,
|
|
1366
1418
|
): void {
|
|
1367
1419
|
const entry: SecurityAuditEntry = {
|
|
1368
1420
|
id: `audit-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
@@ -1370,73 +1422,76 @@ export class SecurityManager extends EventEmitter {
|
|
|
1370
1422
|
userId,
|
|
1371
1423
|
action,
|
|
1372
1424
|
target: targetType,
|
|
1373
|
-
details
|
|
1425
|
+
details,
|
|
1374
1426
|
};
|
|
1375
1427
|
|
|
1376
1428
|
target.auditLog.push(entry);
|
|
1377
1429
|
}
|
|
1378
1430
|
|
|
1379
1431
|
private groupBy<T>(array: T[], key: keyof T): Record<string, number> {
|
|
1380
|
-
return array.reduce(
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1432
|
+
return array.reduce(
|
|
1433
|
+
(groups, item) => {
|
|
1434
|
+
const value = String(item[key]);
|
|
1435
|
+
groups[value] = (groups[value] || 0) + 1;
|
|
1436
|
+
return groups;
|
|
1437
|
+
},
|
|
1438
|
+
{} as Record<string, number>,
|
|
1439
|
+
);
|
|
1385
1440
|
}
|
|
1386
1441
|
|
|
1387
1442
|
private calculateMTTR(findings: SecurityFinding[]): number {
|
|
1388
|
-
const resolvedFindings = findings.filter(
|
|
1389
|
-
f.status === 'resolved' && f.firstSeen && f.lastSeen
|
|
1443
|
+
const resolvedFindings = findings.filter(
|
|
1444
|
+
(f) => f.status === 'resolved' && f.firstSeen && f.lastSeen,
|
|
1390
1445
|
);
|
|
1391
|
-
|
|
1446
|
+
|
|
1392
1447
|
if (resolvedFindings.length === 0) return 0;
|
|
1393
|
-
|
|
1394
|
-
const totalTime = resolvedFindings.reduce(
|
|
1395
|
-
sum + (f.lastSeen.getTime() - f.firstSeen.getTime()),
|
|
1448
|
+
|
|
1449
|
+
const totalTime = resolvedFindings.reduce(
|
|
1450
|
+
(sum, f) => sum + (f.lastSeen.getTime() - f.firstSeen.getTime()),
|
|
1451
|
+
0,
|
|
1396
1452
|
);
|
|
1397
|
-
|
|
1453
|
+
|
|
1398
1454
|
return totalTime / resolvedFindings.length;
|
|
1399
1455
|
}
|
|
1400
1456
|
|
|
1401
1457
|
private calculateMTTD(incidents: SecurityIncident[]): number {
|
|
1402
|
-
const detectedIncidents = incidents.filter(i =>
|
|
1403
|
-
|
|
1404
|
-
);
|
|
1405
|
-
|
|
1458
|
+
const detectedIncidents = incidents.filter((i) => i.timeline.detected && i.timeline.reported);
|
|
1459
|
+
|
|
1406
1460
|
if (detectedIncidents.length === 0) return 0;
|
|
1407
|
-
|
|
1408
|
-
const totalTime = detectedIncidents.reduce(
|
|
1409
|
-
sum + (i.timeline.reported.getTime() - i.timeline.detected.getTime()),
|
|
1461
|
+
|
|
1462
|
+
const totalTime = detectedIncidents.reduce(
|
|
1463
|
+
(sum, i) => sum + (i.timeline.reported.getTime() - i.timeline.detected.getTime()),
|
|
1464
|
+
0,
|
|
1410
1465
|
);
|
|
1411
|
-
|
|
1466
|
+
|
|
1412
1467
|
return totalTime / detectedIncidents.length;
|
|
1413
1468
|
}
|
|
1414
1469
|
|
|
1415
1470
|
private calculateMTTResponse(incidents: SecurityIncident[]): number {
|
|
1416
|
-
const respondedIncidents = incidents.filter(
|
|
1417
|
-
i.timeline.reported && i.timeline.acknowledged
|
|
1471
|
+
const respondedIncidents = incidents.filter(
|
|
1472
|
+
(i) => i.timeline.reported && i.timeline.acknowledged,
|
|
1418
1473
|
);
|
|
1419
|
-
|
|
1474
|
+
|
|
1420
1475
|
if (respondedIncidents.length === 0) return 0;
|
|
1421
|
-
|
|
1422
|
-
const totalTime = respondedIncidents.reduce(
|
|
1423
|
-
sum + (i.timeline.acknowledged.getTime() - i.timeline.reported.getTime()),
|
|
1476
|
+
|
|
1477
|
+
const totalTime = respondedIncidents.reduce(
|
|
1478
|
+
(sum, i) => sum + (i.timeline.acknowledged.getTime() - i.timeline.reported.getTime()),
|
|
1479
|
+
0,
|
|
1424
1480
|
);
|
|
1425
|
-
|
|
1481
|
+
|
|
1426
1482
|
return totalTime / respondedIncidents.length;
|
|
1427
1483
|
}
|
|
1428
1484
|
|
|
1429
1485
|
private calculateIncidentMTTR(incidents: SecurityIncident[]): number {
|
|
1430
|
-
const resolvedIncidents = incidents.filter(i =>
|
|
1431
|
-
|
|
1432
|
-
);
|
|
1433
|
-
|
|
1486
|
+
const resolvedIncidents = incidents.filter((i) => i.timeline.reported && i.timeline.resolved);
|
|
1487
|
+
|
|
1434
1488
|
if (resolvedIncidents.length === 0) return 0;
|
|
1435
|
-
|
|
1436
|
-
const totalTime = resolvedIncidents.reduce(
|
|
1437
|
-
sum + (i.timeline.resolved!.getTime() - i.timeline.reported.getTime()),
|
|
1489
|
+
|
|
1490
|
+
const totalTime = resolvedIncidents.reduce(
|
|
1491
|
+
(sum, i) => sum + (i.timeline.resolved!.getTime() - i.timeline.reported.getTime()),
|
|
1492
|
+
0,
|
|
1438
1493
|
);
|
|
1439
|
-
|
|
1494
|
+
|
|
1440
1495
|
return totalTime / resolvedIncidents.length;
|
|
1441
1496
|
}
|
|
1442
|
-
}
|
|
1497
|
+
}
|