claude-flow 2.0.0-alpha.78 → 2.0.0-alpha.79
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/CHANGELOG.md +74 -0
- package/bin/claude-flow +1 -1
- package/bin/claude-flow.js +0 -0
- package/dist/agents/agent-loader.d.ts +90 -0
- package/dist/agents/agent-loader.d.ts.map +1 -0
- package/dist/agents/agent-loader.js +195 -0
- package/dist/agents/agent-loader.js.map +1 -0
- package/dist/agents/agent-manager.d.ts +191 -0
- package/dist/agents/agent-manager.d.ts.map +1 -0
- package/dist/agents/agent-manager.js +1405 -0
- package/dist/agents/agent-manager.js.map +1 -0
- package/dist/api/claude-api-errors.d.ts +115 -0
- package/dist/api/claude-api-errors.d.ts.map +1 -0
- package/dist/api/claude-api-errors.js +198 -0
- package/dist/api/claude-api-errors.js.map +1 -0
- package/dist/api/claude-client.d.ts +197 -0
- package/dist/api/claude-client.d.ts.map +1 -0
- package/dist/api/claude-client.js +525 -0
- package/dist/api/claude-client.js.map +1 -0
- package/dist/cli/cli-core.d.ts +52 -0
- package/dist/cli/cli-core.d.ts.map +1 -0
- package/dist/cli/cli-core.js +264 -0
- package/dist/cli/cli-core.js.map +1 -0
- package/dist/cli/command-registry.d.ts +10 -0
- package/dist/cli/command-registry.d.ts.map +1 -0
- package/dist/cli/command-registry.js +758 -0
- package/dist/cli/command-registry.js.map +1 -0
- package/dist/cli/commands/agent.d.ts +7 -0
- package/dist/cli/commands/agent.d.ts.map +1 -0
- package/dist/cli/commands/agent.js +382 -0
- package/dist/cli/commands/agent.js.map +1 -0
- package/dist/cli/commands/config.d.ts +5 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +88 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/enterprise.d.ts +3 -0
- package/dist/cli/commands/enterprise.d.ts.map +1 -0
- package/dist/cli/commands/enterprise.js +1506 -0
- package/dist/cli/commands/enterprise.js.map +1 -0
- package/dist/cli/commands/help.d.ts +7 -0
- package/dist/cli/commands/help.d.ts.map +1 -0
- package/dist/cli/commands/help.js +936 -0
- package/dist/cli/commands/help.js.map +1 -0
- package/dist/cli/commands/hive-mind/index.d.ts +19 -0
- package/dist/cli/commands/hive-mind/index.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/index.js +30 -0
- package/dist/cli/commands/hive-mind/index.js.map +1 -0
- package/dist/cli/commands/hive-mind/init.d.ts +10 -0
- package/dist/cli/commands/hive-mind/init.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/init.js +68 -0
- package/dist/cli/commands/hive-mind/init.js.map +1 -0
- package/dist/cli/commands/hive-mind/pause.d.ts +9 -0
- package/dist/cli/commands/hive-mind/pause.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/pause.js +81 -0
- package/dist/cli/commands/hive-mind/pause.js.map +1 -0
- package/dist/cli/commands/hive-mind/ps.d.ts +9 -0
- package/dist/cli/commands/hive-mind/ps.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/ps.js +120 -0
- package/dist/cli/commands/hive-mind/ps.js.map +1 -0
- package/dist/cli/commands/hive-mind/resume.d.ts +9 -0
- package/dist/cli/commands/hive-mind/resume.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/resume.js +62 -0
- package/dist/cli/commands/hive-mind/resume.js.map +1 -0
- package/dist/cli/commands/hive-mind/spawn.d.ts +10 -0
- package/dist/cli/commands/hive-mind/spawn.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/spawn.js +174 -0
- package/dist/cli/commands/hive-mind/spawn.js.map +1 -0
- package/dist/cli/commands/hive-mind/status.d.ts +10 -0
- package/dist/cli/commands/hive-mind/status.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/status.js +204 -0
- package/dist/cli/commands/hive-mind/status.js.map +1 -0
- package/dist/cli/commands/hive-mind/stop.d.ts +9 -0
- package/dist/cli/commands/hive-mind/stop.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/stop.js +125 -0
- package/dist/cli/commands/hive-mind/stop.js.map +1 -0
- package/dist/cli/commands/hive-mind/task.d.ts +10 -0
- package/dist/cli/commands/hive-mind/task.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/task.js +294 -0
- package/dist/cli/commands/hive-mind/task.js.map +1 -0
- package/dist/cli/commands/hive-mind/wizard.d.ts +10 -0
- package/dist/cli/commands/hive-mind/wizard.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/wizard.js +531 -0
- package/dist/cli/commands/hive-mind/wizard.js.map +1 -0
- package/dist/cli/commands/hive.d.ts +6 -0
- package/dist/cli/commands/hive.d.ts.map +1 -0
- package/dist/cli/commands/hive.js +409 -0
- package/dist/cli/commands/hive.js.map +1 -0
- package/dist/cli/commands/index.d.ts +3 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +2532 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +5 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +169 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/memory.d.ts +30 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +225 -0
- package/dist/cli/commands/memory.js.map +1 -0
- package/dist/cli/commands/migrate.d.ts +6 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -0
- package/dist/cli/commands/migrate.js +139 -0
- package/dist/cli/commands/migrate.js.map +1 -0
- package/dist/cli/commands/monitor.d.ts +6 -0
- package/dist/cli/commands/monitor.d.ts.map +1 -0
- package/dist/cli/commands/monitor.js +493 -0
- package/dist/cli/commands/monitor.js.map +1 -0
- package/dist/cli/commands/session.d.ts +6 -0
- package/dist/cli/commands/session.d.ts.map +1 -0
- package/dist/cli/commands/session.js +548 -0
- package/dist/cli/commands/session.js.map +1 -0
- package/dist/cli/commands/sparc.d.ts +3 -0
- package/dist/cli/commands/sparc.d.ts.map +1 -0
- package/dist/cli/commands/sparc.js +472 -0
- package/dist/cli/commands/sparc.js.map +1 -0
- package/dist/cli/commands/start/event-emitter.d.ts +13 -0
- package/dist/cli/commands/start/event-emitter.d.ts.map +1 -0
- package/dist/cli/commands/start/event-emitter.js +35 -0
- package/dist/cli/commands/start/event-emitter.js.map +1 -0
- package/dist/cli/commands/start/index.d.ts +10 -0
- package/dist/cli/commands/start/index.d.ts.map +1 -0
- package/dist/cli/commands/start/index.js +9 -0
- package/dist/cli/commands/start/index.js.map +1 -0
- package/dist/cli/commands/start/process-manager.d.ts +31 -0
- package/dist/cli/commands/start/process-manager.d.ts.map +1 -0
- package/dist/cli/commands/start/process-manager.js +283 -0
- package/dist/cli/commands/start/process-manager.js.map +1 -0
- package/dist/cli/commands/start/process-ui-simple.d.ts +29 -0
- package/dist/cli/commands/start/process-ui-simple.d.ts.map +1 -0
- package/dist/cli/commands/start/process-ui-simple.js +334 -0
- package/dist/cli/commands/start/process-ui-simple.js.map +1 -0
- package/dist/cli/commands/start/process-ui.d.ts +5 -0
- package/dist/cli/commands/start/process-ui.d.ts.map +1 -0
- package/dist/cli/commands/start/process-ui.js +5 -0
- package/dist/cli/commands/start/process-ui.js.map +1 -0
- package/dist/cli/commands/start/start-command.d.ts +2 -0
- package/dist/cli/commands/start/start-command.d.ts.map +1 -0
- package/dist/cli/commands/start/start-command.js +462 -0
- package/dist/cli/commands/start/start-command.js.map +1 -0
- package/dist/cli/commands/start/system-monitor.d.ts +25 -0
- package/dist/cli/commands/start/system-monitor.d.ts.map +1 -0
- package/dist/cli/commands/start/system-monitor.js +265 -0
- package/dist/cli/commands/start/system-monitor.js.map +1 -0
- package/dist/cli/commands/start/types.d.ts +64 -0
- package/dist/cli/commands/start/types.d.ts.map +1 -0
- package/dist/cli/commands/start/types.js +22 -0
- package/dist/cli/commands/start/types.js.map +1 -0
- package/dist/cli/commands/start.d.ts +6 -0
- package/dist/cli/commands/start.d.ts.map +1 -0
- package/dist/cli/commands/start.js +6 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/status.d.ts +6 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +307 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/swarm.d.ts +6 -0
- package/dist/cli/commands/swarm.d.ts.map +1 -0
- package/dist/cli/commands/swarm.js +465 -0
- package/dist/cli/commands/swarm.js.map +1 -0
- package/dist/cli/commands/task.d.ts +6 -0
- package/dist/cli/commands/task.d.ts.map +1 -0
- package/dist/cli/commands/task.js +75 -0
- package/dist/cli/commands/task.js.map +1 -0
- package/dist/cli/commands/workflow.d.ts +6 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +624 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/completion.d.ts +19 -0
- package/dist/cli/completion.d.ts.map +1 -0
- package/dist/cli/completion.js +545 -0
- package/dist/cli/completion.js.map +1 -0
- package/dist/cli/formatter.d.ts +69 -0
- package/dist/cli/formatter.d.ts.map +1 -0
- package/dist/cli/formatter.js +277 -0
- package/dist/cli/formatter.js.map +1 -0
- package/dist/cli/help-formatter.d.ts +49 -0
- package/dist/cli/help-formatter.d.ts.map +1 -0
- package/dist/cli/help-formatter.js +108 -0
- package/dist/cli/help-formatter.js.map +1 -0
- package/dist/cli/index-remote.d.ts +7 -0
- package/dist/cli/index-remote.d.ts.map +1 -0
- package/dist/cli/index-remote.js +126 -0
- package/dist/cli/index-remote.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +191 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/node-compat.d.ts +81 -0
- package/dist/cli/node-compat.d.ts.map +1 -0
- package/dist/cli/node-compat.js +229 -0
- package/dist/cli/node-compat.js.map +1 -0
- package/dist/cli/repl.d.ts +5 -0
- package/dist/cli/repl.d.ts.map +1 -0
- package/dist/cli/repl.js +949 -0
- package/dist/cli/repl.js.map +1 -0
- package/dist/cli/runtime-detector.d.ts +128 -0
- package/dist/cli/runtime-detector.d.ts.map +1 -0
- package/dist/cli/runtime-detector.js +267 -0
- package/dist/cli/runtime-detector.js.map +1 -0
- package/dist/cli/simple-cli.d.ts +7 -0
- package/dist/cli/simple-cli.d.ts.map +1 -0
- package/dist/cli/simple-cli.js +3074 -0
- package/dist/cli/simple-cli.js.map +1 -0
- package/dist/cli/simple-commands/agent.d.ts +2 -0
- package/dist/cli/simple-commands/agent.d.ts.map +1 -0
- package/dist/cli/simple-commands/agent.js +175 -0
- package/dist/cli/simple-commands/agent.js.map +1 -0
- package/dist/cli/simple-commands/analysis.d.ts +2 -0
- package/dist/cli/simple-commands/analysis.d.ts.map +1 -0
- package/dist/cli/simple-commands/analysis.js +207 -0
- package/dist/cli/simple-commands/analysis.js.map +1 -0
- package/dist/cli/simple-commands/automation.d.ts +2 -0
- package/dist/cli/simple-commands/automation.d.ts.map +1 -0
- package/dist/cli/simple-commands/automation.js +246 -0
- package/dist/cli/simple-commands/automation.js.map +1 -0
- package/dist/cli/simple-commands/batch-manager.d.ts +2 -0
- package/dist/cli/simple-commands/batch-manager.d.ts.map +1 -0
- package/dist/cli/simple-commands/batch-manager.js +290 -0
- package/dist/cli/simple-commands/batch-manager.js.map +1 -0
- package/dist/cli/simple-commands/config.d.ts +2 -0
- package/dist/cli/simple-commands/config.d.ts.map +1 -0
- package/dist/cli/simple-commands/config.js +278 -0
- package/dist/cli/simple-commands/config.js.map +1 -0
- package/dist/cli/simple-commands/coordination.d.ts +2 -0
- package/dist/cli/simple-commands/coordination.d.ts.map +1 -0
- package/dist/cli/simple-commands/coordination.js +249 -0
- package/dist/cli/simple-commands/coordination.js.map +1 -0
- package/dist/cli/simple-commands/fix-hook-variables.d.ts +16 -0
- package/dist/cli/simple-commands/fix-hook-variables.d.ts.map +1 -0
- package/dist/cli/simple-commands/fix-hook-variables.js +320 -0
- package/dist/cli/simple-commands/fix-hook-variables.js.map +1 -0
- package/dist/cli/simple-commands/github.d.ts +3 -0
- package/dist/cli/simple-commands/github.d.ts.map +1 -0
- package/dist/cli/simple-commands/github.js +343 -0
- package/dist/cli/simple-commands/github.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts +68 -0
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js +264 -0
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/communication.d.ts +176 -0
- package/dist/cli/simple-commands/hive-mind/communication.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/communication.js +611 -0
- package/dist/cli/simple-commands/hive-mind/communication.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/core.d.ts +306 -0
- package/dist/cli/simple-commands/hive-mind/core.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/core.js +840 -0
- package/dist/cli/simple-commands/hive-mind/core.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts +32 -0
- package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js +702 -0
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts +270 -0
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +1211 -0
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/memory.d.ts +334 -0
- package/dist/cli/simple-commands/hive-mind/memory.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/memory.js +1068 -0
- package/dist/cli/simple-commands/hive-mind/memory.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts +256 -0
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js +520 -0
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/queen.d.ts +235 -0
- package/dist/cli/simple-commands/hive-mind/queen.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/queen.js +697 -0
- package/dist/cli/simple-commands/hive-mind/queen.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/session-manager.d.ts +139 -0
- package/dist/cli/simple-commands/hive-mind/session-manager.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/session-manager.js +835 -0
- package/dist/cli/simple-commands/hive-mind/session-manager.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind-optimize.d.ts +6 -0
- package/dist/cli/simple-commands/hive-mind-optimize.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind-optimize.js +317 -0
- package/dist/cli/simple-commands/hive-mind-optimize.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind.d.ts +18 -0
- package/dist/cli/simple-commands/hive-mind.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind.js +2430 -0
- package/dist/cli/simple-commands/hive-mind.js.map +1 -0
- package/dist/cli/simple-commands/hook-safety.d.ts +177 -0
- package/dist/cli/simple-commands/hook-safety.d.ts.map +1 -0
- package/dist/cli/simple-commands/hook-safety.js +590 -0
- package/dist/cli/simple-commands/hook-safety.js.map +1 -0
- package/dist/cli/simple-commands/hooks.d.ts +3 -0
- package/dist/cli/simple-commands/hooks.d.ts.map +1 -0
- package/dist/cli/simple-commands/hooks.js +1026 -0
- package/dist/cli/simple-commands/hooks.js.map +1 -0
- package/dist/cli/simple-commands/init/agent-copier.d.ts +43 -0
- package/dist/cli/simple-commands/init/agent-copier.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/agent-copier.js +200 -0
- package/dist/cli/simple-commands/init/agent-copier.js.map +1 -0
- package/dist/cli/simple-commands/init/batch-init.d.ts +137 -0
- package/dist/cli/simple-commands/init/batch-init.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/batch-init.js +558 -0
- package/dist/cli/simple-commands/init/batch-init.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.d.ts +2 -0
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.js +433 -0
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.d.ts +2 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +871 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts +2 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +332 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts +3 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +488 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts +2 -0
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.js +51 -0
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts +3 -0
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js +288 -0
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/copy-revised-templates.d.ts +29 -0
- package/dist/cli/simple-commands/init/copy-revised-templates.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/copy-revised-templates.js +159 -0
- package/dist/cli/simple-commands/init/copy-revised-templates.js.map +1 -0
- package/dist/cli/simple-commands/init/executable-wrapper.d.ts +2 -0
- package/dist/cli/simple-commands/init/executable-wrapper.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/executable-wrapper.js +116 -0
- package/dist/cli/simple-commands/init/executable-wrapper.js.map +1 -0
- package/dist/cli/simple-commands/init/gitignore-updater.d.ts +23 -0
- package/dist/cli/simple-commands/init/gitignore-updater.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/gitignore-updater.js +126 -0
- package/dist/cli/simple-commands/init/gitignore-updater.js.map +1 -0
- package/dist/cli/simple-commands/init/help.d.ts +2 -0
- package/dist/cli/simple-commands/init/help.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/help.js +95 -0
- package/dist/cli/simple-commands/init/help.js.map +1 -0
- package/dist/cli/simple-commands/init/index.d.ts +2 -0
- package/dist/cli/simple-commands/init/index.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/index.js +1178 -0
- package/dist/cli/simple-commands/init/index.js.map +1 -0
- package/dist/cli/simple-commands/init/performance-monitor.d.ts +73 -0
- package/dist/cli/simple-commands/init/performance-monitor.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/performance-monitor.js +277 -0
- package/dist/cli/simple-commands/init/performance-monitor.js.map +1 -0
- package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts +95 -0
- package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/rollback/backup-manager.js +486 -0
- package/dist/cli/simple-commands/init/rollback/backup-manager.js.map +1 -0
- package/dist/cli/simple-commands/init/rollback/index.d.ts +114 -0
- package/dist/cli/simple-commands/init/rollback/index.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/rollback/index.js +353 -0
- package/dist/cli/simple-commands/init/rollback/index.js.map +1 -0
- package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts +161 -0
- package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js +686 -0
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js.map +1 -0
- package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts +112 -0
- package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js +480 -0
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js.map +1 -0
- package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts +121 -0
- package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/rollback/state-tracker.js +432 -0
- package/dist/cli/simple-commands/init/rollback/state-tracker.js.map +1 -0
- package/dist/cli/simple-commands/init/sparc/roo-readme.d.ts +2 -0
- package/dist/cli/simple-commands/init/sparc/roo-readme.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/sparc/roo-readme.js +61 -0
- package/dist/cli/simple-commands/init/sparc/roo-readme.js.map +1 -0
- package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts +2 -0
- package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js +80 -0
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js.map +1 -0
- package/dist/cli/simple-commands/init/sparc/workflows.d.ts +2 -0
- package/dist/cli/simple-commands/init/sparc/workflows.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/sparc/workflows.js +36 -0
- package/dist/cli/simple-commands/init/sparc/workflows.js.map +1 -0
- package/dist/cli/simple-commands/init/sparc-structure.d.ts +2 -0
- package/dist/cli/simple-commands/init/sparc-structure.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/sparc-structure.js +63 -0
- package/dist/cli/simple-commands/init/sparc-structure.js.map +1 -0
- package/dist/cli/simple-commands/init/template-copier.d.ts +27 -0
- package/dist/cli/simple-commands/init/template-copier.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/template-copier.js +510 -0
- package/dist/cli/simple-commands/init/template-copier.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/claude-md.d.ts +5 -0
- package/dist/cli/simple-commands/init/templates/claude-md.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/claude-md.js +646 -0
- package/dist/cli/simple-commands/init/templates/claude-md.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/coordination-md.d.ts +4 -0
- package/dist/cli/simple-commands/init/templates/coordination-md.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/coordination-md.js +338 -0
- package/dist/cli/simple-commands/init/templates/coordination-md.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts +18 -0
- package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js +1407 -0
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/memory-bank-md.d.ts +4 -0
- package/dist/cli/simple-commands/init/templates/memory-bank-md.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/memory-bank-md.js +257 -0
- package/dist/cli/simple-commands/init/templates/memory-bank-md.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/readme-files.d.ts +3 -0
- package/dist/cli/simple-commands/init/templates/readme-files.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/readme-files.js +71 -0
- package/dist/cli/simple-commands/init/templates/readme-files.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/sparc-modes.d.ts +30 -0
- package/dist/cli/simple-commands/init/templates/sparc-modes.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/sparc-modes.js +1375 -0
- package/dist/cli/simple-commands/init/templates/sparc-modes.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/config-validator.d.ts +63 -0
- package/dist/cli/simple-commands/init/validation/config-validator.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/config-validator.js +308 -0
- package/dist/cli/simple-commands/init/validation/config-validator.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/health-checker.d.ts +117 -0
- package/dist/cli/simple-commands/init/validation/health-checker.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/health-checker.js +539 -0
- package/dist/cli/simple-commands/init/validation/health-checker.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/index.d.ts +55 -0
- package/dist/cli/simple-commands/init/validation/index.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/index.js +347 -0
- package/dist/cli/simple-commands/init/validation/index.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/mode-validator.d.ts +76 -0
- package/dist/cli/simple-commands/init/validation/mode-validator.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/mode-validator.js +343 -0
- package/dist/cli/simple-commands/init/validation/mode-validator.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts +62 -0
- package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/post-init-validator.js +349 -0
- package/dist/cli/simple-commands/init/validation/post-init-validator.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts +86 -0
- package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js +260 -0
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js.map +1 -0
- package/dist/cli/simple-commands/mcp.d.ts +2 -0
- package/dist/cli/simple-commands/mcp.d.ts.map +1 -0
- package/dist/cli/simple-commands/mcp.js +366 -0
- package/dist/cli/simple-commands/mcp.js.map +1 -0
- package/dist/cli/simple-commands/memory.d.ts +2 -0
- package/dist/cli/simple-commands/memory.d.ts.map +1 -0
- package/dist/cli/simple-commands/memory.js +278 -0
- package/dist/cli/simple-commands/memory.js.map +1 -0
- package/dist/cli/simple-commands/migrate-hooks.d.ts +10 -0
- package/dist/cli/simple-commands/migrate-hooks.d.ts.map +1 -0
- package/dist/cli/simple-commands/migrate-hooks.js +57 -0
- package/dist/cli/simple-commands/migrate-hooks.js.map +1 -0
- package/dist/cli/simple-commands/monitor.d.ts +3 -0
- package/dist/cli/simple-commands/monitor.d.ts.map +1 -0
- package/dist/cli/simple-commands/monitor.js +366 -0
- package/dist/cli/simple-commands/monitor.js.map +1 -0
- package/dist/cli/simple-commands/process-ui-enhanced.d.ts +55 -0
- package/dist/cli/simple-commands/process-ui-enhanced.d.ts.map +1 -0
- package/dist/cli/simple-commands/process-ui-enhanced.js +680 -0
- package/dist/cli/simple-commands/process-ui-enhanced.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/architect.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/architect.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/architect.js +126 -0
- package/dist/cli/simple-commands/sparc-modes/architect.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/ask.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/ask.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/ask.js +127 -0
- package/dist/cli/simple-commands/sparc-modes/ask.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/code.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/code.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/code.js +149 -0
- package/dist/cli/simple-commands/sparc-modes/code.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/debug.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/debug.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/debug.js +113 -0
- package/dist/cli/simple-commands/sparc-modes/debug.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/devops.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/devops.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/devops.js +138 -0
- package/dist/cli/simple-commands/sparc-modes/devops.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/docs-writer.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/docs-writer.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/docs-writer.js +39 -0
- package/dist/cli/simple-commands/sparc-modes/docs-writer.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/generic.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/generic.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/generic.js +35 -0
- package/dist/cli/simple-commands/sparc-modes/generic.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/index.d.ts +17 -0
- package/dist/cli/simple-commands/sparc-modes/index.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/index.js +196 -0
- package/dist/cli/simple-commands/sparc-modes/index.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/integration.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/integration.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/integration.js +56 -0
- package/dist/cli/simple-commands/sparc-modes/integration.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/mcp.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/mcp.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/mcp.js +39 -0
- package/dist/cli/simple-commands/sparc-modes/mcp.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/monitoring.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/monitoring.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/monitoring.js +39 -0
- package/dist/cli/simple-commands/sparc-modes/monitoring.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/optimization.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/optimization.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/optimization.js +39 -0
- package/dist/cli/simple-commands/sparc-modes/optimization.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/security-review.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/security-review.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/security-review.js +131 -0
- package/dist/cli/simple-commands/sparc-modes/security-review.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.js +168 -0
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.js +39 -0
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.js +150 -0
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/swarm.d.ts +81 -0
- package/dist/cli/simple-commands/sparc-modes/swarm.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/swarm.js +428 -0
- package/dist/cli/simple-commands/sparc-modes/swarm.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/tdd.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/tdd.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/tdd.js +113 -0
- package/dist/cli/simple-commands/sparc-modes/tdd.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/tutorial.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/tutorial.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/tutorial.js +278 -0
- package/dist/cli/simple-commands/sparc-modes/tutorial.js.map +1 -0
- package/dist/cli/simple-commands/sparc.d.ts +2 -0
- package/dist/cli/simple-commands/sparc.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc.js +480 -0
- package/dist/cli/simple-commands/sparc.js.map +1 -0
- package/dist/cli/simple-commands/start-ui.d.ts +2 -0
- package/dist/cli/simple-commands/start-ui.d.ts.map +1 -0
- package/dist/cli/simple-commands/start-ui.js +135 -0
- package/dist/cli/simple-commands/start-ui.js.map +1 -0
- package/dist/cli/simple-commands/start-wrapper.d.ts +2 -0
- package/dist/cli/simple-commands/start-wrapper.d.ts.map +1 -0
- package/dist/cli/simple-commands/start-wrapper.js +264 -0
- package/dist/cli/simple-commands/start-wrapper.js.map +1 -0
- package/dist/cli/simple-commands/start.d.ts +2 -0
- package/dist/cli/simple-commands/start.d.ts.map +1 -0
- package/dist/cli/simple-commands/start.js +3 -0
- package/dist/cli/simple-commands/start.js.map +1 -0
- package/dist/cli/simple-commands/status.d.ts +2 -0
- package/dist/cli/simple-commands/status.d.ts.map +1 -0
- package/dist/cli/simple-commands/status.js +274 -0
- package/dist/cli/simple-commands/status.js.map +1 -0
- package/dist/cli/simple-commands/swarm-executor.d.ts +68 -0
- package/dist/cli/simple-commands/swarm-executor.d.ts.map +1 -0
- package/dist/cli/simple-commands/swarm-executor.js +218 -0
- package/dist/cli/simple-commands/swarm-executor.js.map +1 -0
- package/dist/cli/simple-commands/swarm-metrics-integration.d.ts +69 -0
- package/dist/cli/simple-commands/swarm-metrics-integration.d.ts.map +1 -0
- package/dist/cli/simple-commands/swarm-metrics-integration.js +294 -0
- package/dist/cli/simple-commands/swarm-metrics-integration.js.map +1 -0
- package/dist/cli/simple-commands/swarm-webui-integration.d.ts +68 -0
- package/dist/cli/simple-commands/swarm-webui-integration.d.ts.map +1 -0
- package/dist/cli/simple-commands/swarm-webui-integration.js +265 -0
- package/dist/cli/simple-commands/swarm-webui-integration.js.map +1 -0
- package/dist/cli/simple-commands/swarm.d.ts +2 -0
- package/dist/cli/simple-commands/swarm.d.ts.map +1 -0
- package/dist/cli/simple-commands/swarm.js +1964 -0
- package/dist/cli/simple-commands/swarm.js.map +1 -0
- package/dist/cli/simple-commands/task.d.ts +2 -0
- package/dist/cli/simple-commands/task.d.ts.map +1 -0
- package/dist/cli/simple-commands/task.js +190 -0
- package/dist/cli/simple-commands/task.js.map +1 -0
- package/dist/cli/simple-commands/training.d.ts +2 -0
- package/dist/cli/simple-commands/training.d.ts.map +1 -0
- package/dist/cli/simple-commands/training.js +240 -0
- package/dist/cli/simple-commands/training.js.map +1 -0
- package/dist/cli/simple-commands/web-server.d.ts +152 -0
- package/dist/cli/simple-commands/web-server.d.ts.map +1 -0
- package/dist/cli/simple-commands/web-server.js +816 -0
- package/dist/cli/simple-commands/web-server.js.map +1 -0
- package/dist/cli/utils/interactive-detector.d.ts +25 -0
- package/dist/cli/utils/interactive-detector.d.ts.map +1 -0
- package/dist/cli/utils/interactive-detector.js +129 -0
- package/dist/cli/utils/interactive-detector.js.map +1 -0
- package/dist/cli/utils/safe-interactive.d.ts +30 -0
- package/dist/cli/utils/safe-interactive.d.ts.map +1 -0
- package/dist/cli/utils/safe-interactive.js +134 -0
- package/dist/cli/utils/safe-interactive.js.map +1 -0
- package/dist/cli/utils.d.ts +75 -0
- package/dist/cli/utils.d.ts.map +1 -0
- package/dist/cli/utils.js +567 -0
- package/dist/cli/utils.js.map +1 -0
- package/dist/config/config-manager.d.ts +212 -0
- package/dist/config/config-manager.d.ts.map +1 -0
- package/dist/config/config-manager.js +550 -0
- package/dist/config/config-manager.js.map +1 -0
- package/dist/constants/agent-types.d.ts +55 -0
- package/dist/constants/agent-types.d.ts.map +1 -0
- package/dist/constants/agent-types.js +66 -0
- package/dist/constants/agent-types.js.map +1 -0
- package/dist/coordination/advanced-scheduler.d.ts +121 -0
- package/dist/coordination/advanced-scheduler.d.ts.map +1 -0
- package/dist/coordination/advanced-scheduler.js +382 -0
- package/dist/coordination/advanced-scheduler.js.map +1 -0
- package/dist/coordination/background-executor.d.ts +69 -0
- package/dist/coordination/background-executor.d.ts.map +1 -0
- package/dist/coordination/background-executor.js +363 -0
- package/dist/coordination/background-executor.js.map +1 -0
- package/dist/coordination/circuit-breaker.d.ts +124 -0
- package/dist/coordination/circuit-breaker.d.ts.map +1 -0
- package/dist/coordination/circuit-breaker.js +301 -0
- package/dist/coordination/circuit-breaker.js.map +1 -0
- package/dist/coordination/conflict-resolution.d.ts +133 -0
- package/dist/coordination/conflict-resolution.d.ts.map +1 -0
- package/dist/coordination/conflict-resolution.js +360 -0
- package/dist/coordination/conflict-resolution.js.map +1 -0
- package/dist/coordination/dependency-graph.d.ts +78 -0
- package/dist/coordination/dependency-graph.d.ts.map +1 -0
- package/dist/coordination/dependency-graph.js +387 -0
- package/dist/coordination/dependency-graph.js.map +1 -0
- package/dist/coordination/manager.d.ts +66 -0
- package/dist/coordination/manager.d.ts.map +1 -0
- package/dist/coordination/manager.js +354 -0
- package/dist/coordination/manager.js.map +1 -0
- package/dist/coordination/messaging.d.ts +37 -0
- package/dist/coordination/messaging.d.ts.map +1 -0
- package/dist/coordination/messaging.js +219 -0
- package/dist/coordination/messaging.js.map +1 -0
- package/dist/coordination/metrics.d.ts +153 -0
- package/dist/coordination/metrics.d.ts.map +1 -0
- package/dist/coordination/metrics.js +436 -0
- package/dist/coordination/metrics.js.map +1 -0
- package/dist/coordination/resources.d.ts +36 -0
- package/dist/coordination/resources.d.ts.map +1 -0
- package/dist/coordination/resources.js +254 -0
- package/dist/coordination/resources.js.map +1 -0
- package/dist/coordination/scheduler.d.ts +48 -0
- package/dist/coordination/scheduler.d.ts.map +1 -0
- package/dist/coordination/scheduler.js +308 -0
- package/dist/coordination/scheduler.js.map +1 -0
- package/dist/coordination/swarm-coordinator.d.ts +116 -0
- package/dist/coordination/swarm-coordinator.d.ts.map +1 -0
- package/dist/coordination/swarm-coordinator.js +563 -0
- package/dist/coordination/swarm-coordinator.js.map +1 -0
- package/dist/coordination/swarm-monitor.d.ts +101 -0
- package/dist/coordination/swarm-monitor.d.ts.map +1 -0
- package/dist/coordination/swarm-monitor.js +340 -0
- package/dist/coordination/swarm-monitor.js.map +1 -0
- package/dist/coordination/work-stealing.d.ts +44 -0
- package/dist/coordination/work-stealing.d.ts.map +1 -0
- package/dist/coordination/work-stealing.js +158 -0
- package/dist/coordination/work-stealing.js.map +1 -0
- package/dist/core/config.d.ts +243 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +1125 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/event-bus.d.ts +63 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +153 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/json-persistence.d.ts +55 -0
- package/dist/core/json-persistence.d.ts.map +1 -0
- package/dist/core/json-persistence.js +111 -0
- package/dist/core/json-persistence.js.map +1 -0
- package/dist/core/logger.d.ts +62 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +252 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/orchestrator-fixed.d.ts +81 -0
- package/dist/core/orchestrator-fixed.d.ts.map +1 -0
- package/dist/core/orchestrator-fixed.js +213 -0
- package/dist/core/orchestrator-fixed.js.map +1 -0
- package/dist/core/orchestrator.d.ts +123 -0
- package/dist/core/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestrator.js +1058 -0
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/enterprise/analytics-manager.d.ts +489 -0
- package/dist/enterprise/analytics-manager.d.ts.map +1 -0
- package/dist/enterprise/analytics-manager.js +956 -0
- package/dist/enterprise/analytics-manager.js.map +1 -0
- package/dist/enterprise/audit-manager.d.ts +459 -0
- package/dist/enterprise/audit-manager.d.ts.map +1 -0
- package/dist/enterprise/audit-manager.js +1014 -0
- package/dist/enterprise/audit-manager.js.map +1 -0
- package/dist/enterprise/cloud-manager.d.ts +435 -0
- package/dist/enterprise/cloud-manager.d.ts.map +1 -0
- package/dist/enterprise/cloud-manager.js +789 -0
- package/dist/enterprise/cloud-manager.js.map +1 -0
- package/dist/enterprise/deployment-manager.d.ts +328 -0
- package/dist/enterprise/deployment-manager.d.ts.map +1 -0
- package/dist/enterprise/deployment-manager.js +830 -0
- package/dist/enterprise/deployment-manager.js.map +1 -0
- package/dist/enterprise/project-manager.d.ts +228 -0
- package/dist/enterprise/project-manager.d.ts.map +1 -0
- package/dist/enterprise/project-manager.js +537 -0
- package/dist/enterprise/project-manager.js.map +1 -0
- package/dist/enterprise/security-manager.d.ts +422 -0
- package/dist/enterprise/security-manager.d.ts.map +1 -0
- package/dist/enterprise/security-manager.js +910 -0
- package/dist/enterprise/security-manager.js.map +1 -0
- package/dist/hive-mind/core/Agent.d.ts +137 -0
- package/dist/hive-mind/core/Agent.d.ts.map +1 -0
- package/dist/hive-mind/core/Agent.js +567 -0
- package/dist/hive-mind/core/Agent.js.map +1 -0
- package/dist/hive-mind/core/Communication.d.ts +116 -0
- package/dist/hive-mind/core/Communication.d.ts.map +1 -0
- package/dist/hive-mind/core/Communication.js +407 -0
- package/dist/hive-mind/core/Communication.js.map +1 -0
- package/dist/hive-mind/core/DatabaseManager.d.ts +99 -0
- package/dist/hive-mind/core/DatabaseManager.d.ts.map +1 -0
- package/dist/hive-mind/core/DatabaseManager.js +648 -0
- package/dist/hive-mind/core/DatabaseManager.js.map +1 -0
- package/dist/hive-mind/core/HiveMind.d.ts +90 -0
- package/dist/hive-mind/core/HiveMind.d.ts.map +1 -0
- package/dist/hive-mind/core/HiveMind.js +455 -0
- package/dist/hive-mind/core/HiveMind.js.map +1 -0
- package/dist/hive-mind/core/Memory.d.ts +235 -0
- package/dist/hive-mind/core/Memory.d.ts.map +1 -0
- package/dist/hive-mind/core/Memory.js +1192 -0
- package/dist/hive-mind/core/Memory.js.map +1 -0
- package/dist/hive-mind/core/Queen.d.ts +115 -0
- package/dist/hive-mind/core/Queen.d.ts.map +1 -0
- package/dist/hive-mind/core/Queen.js +649 -0
- package/dist/hive-mind/core/Queen.js.map +1 -0
- package/dist/hive-mind/integration/ConsensusEngine.d.ts +117 -0
- package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +1 -0
- package/dist/hive-mind/integration/ConsensusEngine.js +478 -0
- package/dist/hive-mind/integration/ConsensusEngine.js.map +1 -0
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts +172 -0
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +1 -0
- package/dist/hive-mind/integration/MCPToolWrapper.js +217 -0
- package/dist/hive-mind/integration/MCPToolWrapper.js.map +1 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts +172 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +1 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.js +748 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.js.map +1 -0
- package/dist/hive-mind/types.d.ts +314 -0
- package/dist/hive-mind/types.d.ts.map +1 -0
- package/dist/hive-mind/types.js +7 -0
- package/dist/hive-mind/types.js.map +1 -0
- package/dist/mcp/auth.d.ts +80 -0
- package/dist/mcp/auth.d.ts.map +1 -0
- package/dist/mcp/auth.js +350 -0
- package/dist/mcp/auth.js.map +1 -0
- package/dist/mcp/claude-flow-tools.d.ts +13 -0
- package/dist/mcp/claude-flow-tools.d.ts.map +1 -0
- package/dist/mcp/claude-flow-tools.js +1176 -0
- package/dist/mcp/claude-flow-tools.js.map +1 -0
- package/dist/mcp/load-balancer.d.ts +88 -0
- package/dist/mcp/load-balancer.d.ts.map +1 -0
- package/dist/mcp/load-balancer.js +393 -0
- package/dist/mcp/load-balancer.js.map +1 -0
- package/dist/mcp/router.d.ts +54 -0
- package/dist/mcp/router.d.ts.map +1 -0
- package/dist/mcp/router.js +204 -0
- package/dist/mcp/router.js.map +1 -0
- package/dist/mcp/ruv-swarm-tools.d.ts +58 -0
- package/dist/mcp/ruv-swarm-tools.d.ts.map +1 -0
- package/dist/mcp/ruv-swarm-tools.js +548 -0
- package/dist/mcp/ruv-swarm-tools.js.map +1 -0
- package/dist/mcp/server.d.ts +75 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +538 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/session-manager.d.ts +60 -0
- package/dist/mcp/session-manager.d.ts.map +1 -0
- package/dist/mcp/session-manager.js +323 -0
- package/dist/mcp/session-manager.js.map +1 -0
- package/dist/mcp/swarm-tools.d.ts +87 -0
- package/dist/mcp/swarm-tools.d.ts.map +1 -0
- package/dist/mcp/swarm-tools.js +731 -0
- package/dist/mcp/swarm-tools.js.map +1 -0
- package/dist/mcp/tools.d.ts +145 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +434 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/transports/base.d.ts +22 -0
- package/dist/mcp/transports/base.d.ts.map +1 -0
- package/dist/mcp/transports/base.js +5 -0
- package/dist/mcp/transports/base.js.map +1 -0
- package/dist/mcp/transports/http.d.ts +48 -0
- package/dist/mcp/transports/http.d.ts.map +1 -0
- package/dist/mcp/transports/http.js +400 -0
- package/dist/mcp/transports/http.js.map +1 -0
- package/dist/mcp/transports/stdio.d.ts +37 -0
- package/dist/mcp/transports/stdio.d.ts.map +1 -0
- package/dist/mcp/transports/stdio.js +206 -0
- package/dist/mcp/transports/stdio.js.map +1 -0
- package/dist/memory/advanced-serializer.d.ts +159 -0
- package/dist/memory/advanced-serializer.d.ts.map +1 -0
- package/dist/memory/advanced-serializer.js +564 -0
- package/dist/memory/advanced-serializer.js.map +1 -0
- package/dist/memory/backends/base.d.ts +21 -0
- package/dist/memory/backends/base.d.ts.map +1 -0
- package/dist/memory/backends/base.js +5 -0
- package/dist/memory/backends/base.js.map +1 -0
- package/dist/memory/backends/markdown.d.ts +35 -0
- package/dist/memory/backends/markdown.d.ts.map +1 -0
- package/dist/memory/backends/markdown.js +223 -0
- package/dist/memory/backends/markdown.js.map +1 -0
- package/dist/memory/backends/sqlite.d.ts +33 -0
- package/dist/memory/backends/sqlite.d.ts.map +1 -0
- package/dist/memory/backends/sqlite.js +291 -0
- package/dist/memory/backends/sqlite.js.map +1 -0
- package/dist/memory/cache.d.ts +65 -0
- package/dist/memory/cache.d.ts.map +1 -0
- package/dist/memory/cache.js +188 -0
- package/dist/memory/cache.js.map +1 -0
- package/dist/memory/distributed-memory.d.ts +188 -0
- package/dist/memory/distributed-memory.d.ts.map +1 -0
- package/dist/memory/distributed-memory.js +710 -0
- package/dist/memory/distributed-memory.js.map +1 -0
- package/dist/memory/enhanced-session-serializer.d.ts +115 -0
- package/dist/memory/enhanced-session-serializer.d.ts.map +1 -0
- package/dist/memory/enhanced-session-serializer.js +478 -0
- package/dist/memory/enhanced-session-serializer.js.map +1 -0
- package/dist/memory/fallback-store.d.ts +28 -0
- package/dist/memory/fallback-store.d.ts.map +1 -0
- package/dist/memory/fallback-store.js +101 -0
- package/dist/memory/fallback-store.js.map +1 -0
- package/dist/memory/in-memory-store.d.ts +37 -0
- package/dist/memory/in-memory-store.d.ts.map +1 -0
- package/dist/memory/in-memory-store.js +174 -0
- package/dist/memory/in-memory-store.js.map +1 -0
- package/dist/memory/indexer.d.ts +52 -0
- package/dist/memory/indexer.d.ts.map +1 -0
- package/dist/memory/indexer.js +191 -0
- package/dist/memory/indexer.js.map +1 -0
- package/dist/memory/manager.d.ts +58 -0
- package/dist/memory/manager.d.ts.map +1 -0
- package/dist/memory/manager.js +423 -0
- package/dist/memory/manager.js.map +1 -0
- 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 +267 -0
- package/dist/memory/sqlite-store.js.map +1 -0
- 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 +152 -0
- package/dist/memory/sqlite-wrapper.js.map +1 -0
- package/dist/memory/swarm-memory.d.ts +91 -0
- package/dist/memory/swarm-memory.d.ts.map +1 -0
- package/dist/memory/swarm-memory.js +454 -0
- package/dist/memory/swarm-memory.js.map +1 -0
- package/dist/migration/logger.d.ts +26 -0
- package/dist/migration/logger.d.ts.map +1 -0
- package/dist/migration/logger.js +145 -0
- package/dist/migration/logger.js.map +1 -0
- package/dist/migration/migration-analyzer.d.ts +18 -0
- package/dist/migration/migration-analyzer.d.ts.map +1 -0
- package/dist/migration/migration-analyzer.js +284 -0
- package/dist/migration/migration-analyzer.js.map +1 -0
- package/dist/migration/migration-runner.d.ts +26 -0
- package/dist/migration/migration-runner.d.ts.map +1 -0
- package/dist/migration/migration-runner.js +505 -0
- package/dist/migration/migration-runner.js.map +1 -0
- package/dist/migration/migration-validator.d.ts +17 -0
- package/dist/migration/migration-validator.d.ts.map +1 -0
- package/dist/migration/migration-validator.js +309 -0
- package/dist/migration/migration-validator.js.map +1 -0
- package/dist/migration/progress-reporter.d.ts +28 -0
- package/dist/migration/progress-reporter.d.ts.map +1 -0
- package/dist/migration/progress-reporter.js +163 -0
- package/dist/migration/progress-reporter.js.map +1 -0
- package/dist/migration/rollback-manager.d.ts +24 -0
- package/dist/migration/rollback-manager.d.ts.map +1 -0
- package/dist/migration/rollback-manager.js +351 -0
- package/dist/migration/rollback-manager.js.map +1 -0
- package/dist/migration/types.d.ts +103 -0
- package/dist/migration/types.d.ts.map +1 -0
- package/dist/migration/types.js +6 -0
- package/dist/migration/types.js.map +1 -0
- package/dist/swarm/types.d.ts +578 -0
- package/dist/swarm/types.d.ts.map +1 -0
- package/dist/swarm/types.js +54 -0
- package/dist/swarm/types.js.map +1 -0
- package/dist/terminal/adapters/base.d.ts +40 -0
- package/dist/terminal/adapters/base.d.ts.map +1 -0
- package/dist/terminal/adapters/base.js +5 -0
- package/dist/terminal/adapters/base.js.map +1 -0
- package/dist/terminal/adapters/native.d.ts +19 -0
- package/dist/terminal/adapters/native.d.ts.map +1 -0
- package/dist/terminal/adapters/native.js +414 -0
- package/dist/terminal/adapters/native.js.map +1 -0
- package/dist/terminal/adapters/vscode.d.ts +23 -0
- package/dist/terminal/adapters/vscode.d.ts.map +1 -0
- package/dist/terminal/adapters/vscode.js +267 -0
- package/dist/terminal/adapters/vscode.js.map +1 -0
- package/dist/terminal/manager.d.ts +59 -0
- package/dist/terminal/manager.d.ts.map +1 -0
- package/dist/terminal/manager.js +235 -0
- package/dist/terminal/manager.js.map +1 -0
- package/dist/terminal/pool.d.ts +32 -0
- package/dist/terminal/pool.d.ts.map +1 -0
- package/dist/terminal/pool.js +208 -0
- package/dist/terminal/pool.js.map +1 -0
- package/dist/terminal/session.d.ts +41 -0
- package/dist/terminal/session.d.ts.map +1 -0
- package/dist/terminal/session.js +210 -0
- package/dist/terminal/session.js.map +1 -0
- package/dist/utils/error-handler.d.ts +14 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +29 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/errors.d.ts +121 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +194 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/formatters.d.ts +15 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/formatters.js +75 -0
- package/dist/utils/formatters.js.map +1 -0
- package/dist/utils/helpers.d.ts +134 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +444 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/npx-isolated-cache.d.ts +17 -0
- package/dist/utils/npx-isolated-cache.d.ts.map +1 -0
- package/dist/utils/npx-isolated-cache.js +140 -0
- package/dist/utils/npx-isolated-cache.js.map +1 -0
- package/dist/utils/type-guards.d.ts +117 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +166 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/dist/utils/types.d.ts +568 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +37 -0
- package/dist/utils/types.js.map +1 -0
- package/package.json +12 -5
- package/src/agents/agent-manager.ts +432 -0
- package/src/cli/agents/index.ts +15 -1
- package/src/cli/command-registry.js +24 -0
- package/src/cli/commands/hive-mind/spawn.ts +18 -0
- package/src/cli/commands/maestro.ts +317 -0
- package/src/cli/commands/status.ts +1 -1
- package/src/cli/help-text.js +3 -3
- package/src/cli/index-remote.ts +1 -1
- package/src/cli/index.ts +1 -1
- package/src/cli/maestro-cli-bridge.ts +556 -0
- package/src/cli/node-compat.js +4 -23
- package/src/cli/runtime-detector.js +2 -2
- package/src/cli/simple-cli.js +1 -1
- package/src/cli/simple-cli.ts +1 -1
- package/src/cli/simple-commands/batch-manager.js +6 -5
- package/src/cli/simple-commands/github/github-api.js +159 -0
- package/src/cli/simple-commands/hive-mind/session-manager.js +38 -40
- package/src/cli/simple-commands/init/batch-init.js +13 -12
- package/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +4 -3
- package/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +4 -3
- package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +4 -4
- package/src/cli/simple-commands/init/index.js +72 -49
- package/src/cli/simple-commands/init/rollback/backup-manager.js +5 -4
- package/src/cli/simple-commands/init/rollback/rollback-executor.js +23 -22
- package/src/cli/simple-commands/init/rollback/state-tracker.js +3 -2
- package/src/cli/simple-commands/init/sparc-structure.js +9 -7
- package/src/cli/simple-commands/init/template-copier.js +1 -1
- package/src/cli/simple-commands/init/templates/CLAUDE.md +3 -3
- package/src/cli/simple-commands/init/templates/github-safe-enhanced.js +333 -0
- package/src/cli/simple-commands/init/validation/config-validator.js +8 -7
- package/src/cli/simple-commands/init/validation/health-checker.js +6 -5
- package/src/cli/simple-commands/init/validation/mode-validator.js +4 -3
- package/src/cli/simple-commands/init/validation/post-init-validator.js +15 -14
- package/src/cli/simple-commands/init/validation/test-runner.js +10 -10
- package/src/cli/simple-commands/memory.js +8 -7
- package/src/cli/simple-commands/process-ui-enhanced.js +2 -2
- package/src/cli/simple-commands/process-ui.js +2 -2
- package/src/cli/simple-commands/sparc-modes/index.js +1 -1
- package/src/cli/simple-commands/sparc.js +28 -26
- package/src/cli/simple-commands/start-wrapper.js +6 -5
- package/src/cli/simple-commands/status.js +4 -3
- package/src/cli/simple-commands/swarm-executor.js +8 -3
- package/src/cli/simple-commands/swarm.js +270 -24
- package/src/cli/simple-commands/webui-validator.js +4 -3
- package/src/cli/swarm-standalone.js +5 -5
- package/src/cli/utils.js +54 -66
- package/src/hive-mind/core/HiveMind.ts +16 -0
- package/src/hive-mind/types.ts +38 -5
- package/src/hooks/index.ts +192 -0
- package/src/maestro/maestro-swarm-coordinator.ts +602 -0
- package/src/maestro/maestro-types.ts +386 -0
- package/src/maestro/tests/native-hive-mind-integration.test.ts +480 -0
- package/src/memory/advanced-serializer.js +611 -0
- package/src/memory/enhanced-session-serializer.js +523 -0
- package/src/memory/in-memory-store.js +6 -4
- package/src/memory/sqlite-store.js +5 -4
- package/src/swarm/types.ts +10 -3
- package/src/utils/__tests__/github-cli-safety-wrapper.test.js +408 -0
- package/src/utils/github-cli-safe.js +37 -119
- package/src/utils/github-cli-safety-wrapper.js +587 -0
- package/src/utils/types.ts +60 -2
|
@@ -0,0 +1,910 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
import { writeFile, readFile, mkdir, readdir } from 'fs/promises';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
import { spawn } from 'child_process';
|
|
5
|
+
import { Logger } from '../core/logger.js';
|
|
6
|
+
import { ConfigManager } from '../core/config.js';
|
|
7
|
+
export class SecurityManager extends EventEmitter {
|
|
8
|
+
scans = new Map();
|
|
9
|
+
policies = new Map();
|
|
10
|
+
incidents = new Map();
|
|
11
|
+
vulnerabilityDatabases = new Map();
|
|
12
|
+
securityPath;
|
|
13
|
+
logger;
|
|
14
|
+
config;
|
|
15
|
+
constructor(securityPath = './security', logger, config) {
|
|
16
|
+
super();
|
|
17
|
+
this.securityPath = securityPath;
|
|
18
|
+
this.logger = logger || new Logger({ level: 'info', format: 'text', destination: 'console' });
|
|
19
|
+
this.config = config || ConfigManager.getInstance();
|
|
20
|
+
}
|
|
21
|
+
async initialize() {
|
|
22
|
+
try {
|
|
23
|
+
await mkdir(this.securityPath, { recursive: true });
|
|
24
|
+
await mkdir(join(this.securityPath, 'scans'), { recursive: true });
|
|
25
|
+
await mkdir(join(this.securityPath, 'policies'), { recursive: true });
|
|
26
|
+
await mkdir(join(this.securityPath, 'incidents'), { recursive: true });
|
|
27
|
+
await mkdir(join(this.securityPath, 'reports'), { recursive: true });
|
|
28
|
+
await mkdir(join(this.securityPath, 'databases'), { recursive: true });
|
|
29
|
+
await this.loadConfigurations();
|
|
30
|
+
await this.initializeDefaultPolicies();
|
|
31
|
+
await this.initializeVulnerabilityDatabases();
|
|
32
|
+
this.logger.info('Security Manager initialized successfully');
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
this.logger.error('Failed to initialize Security Manager', { error });
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async createSecurityScan(scanData) {
|
|
40
|
+
const scan = {
|
|
41
|
+
id: `scan-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
42
|
+
name: scanData.name,
|
|
43
|
+
type: scanData.type,
|
|
44
|
+
status: 'pending',
|
|
45
|
+
projectId: scanData.projectId,
|
|
46
|
+
target: scanData.target,
|
|
47
|
+
configuration: {
|
|
48
|
+
scanner: this.getDefaultScanner(scanData.type),
|
|
49
|
+
rules: [],
|
|
50
|
+
excludes: [],
|
|
51
|
+
severity: ['critical', 'high', 'medium', 'low'],
|
|
52
|
+
formats: ['json', 'html'],
|
|
53
|
+
outputPath: join(this.securityPath, 'reports'),
|
|
54
|
+
...scanData.configuration,
|
|
55
|
+
},
|
|
56
|
+
results: [],
|
|
57
|
+
metrics: {
|
|
58
|
+
totalFindings: 0,
|
|
59
|
+
criticalFindings: 0,
|
|
60
|
+
highFindings: 0,
|
|
61
|
+
mediumFindings: 0,
|
|
62
|
+
lowFindings: 0,
|
|
63
|
+
falsePositives: 0,
|
|
64
|
+
suppressed: 0,
|
|
65
|
+
scanDuration: 0,
|
|
66
|
+
filesScanned: 0,
|
|
67
|
+
linesScanned: 0,
|
|
68
|
+
},
|
|
69
|
+
compliance: {
|
|
70
|
+
frameworks: [],
|
|
71
|
+
requirements: [],
|
|
72
|
+
overallScore: 0,
|
|
73
|
+
passedChecks: 0,
|
|
74
|
+
failedChecks: 0,
|
|
75
|
+
},
|
|
76
|
+
remediation: {
|
|
77
|
+
autoFixAvailable: [],
|
|
78
|
+
manualReview: [],
|
|
79
|
+
recommendations: [],
|
|
80
|
+
},
|
|
81
|
+
schedule: scanData.schedule,
|
|
82
|
+
notifications: {
|
|
83
|
+
channels: [],
|
|
84
|
+
thresholds: {
|
|
85
|
+
critical: 1,
|
|
86
|
+
high: 5,
|
|
87
|
+
medium: 10,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
createdAt: new Date(),
|
|
91
|
+
updatedAt: new Date(),
|
|
92
|
+
createdBy: 'system',
|
|
93
|
+
auditLog: [],
|
|
94
|
+
};
|
|
95
|
+
this.addAuditEntry(scan, 'system', 'scan_created', 'scan', {
|
|
96
|
+
scanId: scan.id,
|
|
97
|
+
scanName: scan.name,
|
|
98
|
+
scanType: scan.type,
|
|
99
|
+
});
|
|
100
|
+
this.scans.set(scan.id, scan);
|
|
101
|
+
await this.saveScan(scan);
|
|
102
|
+
this.emit('scan:created', scan);
|
|
103
|
+
this.logger.info(`Security scan created: ${scan.name} (${scan.id})`);
|
|
104
|
+
return scan;
|
|
105
|
+
}
|
|
106
|
+
async executeScan(scanId) {
|
|
107
|
+
const scan = this.scans.get(scanId);
|
|
108
|
+
if (!scan) {
|
|
109
|
+
throw new Error(`Scan not found: ${scanId}`);
|
|
110
|
+
}
|
|
111
|
+
if (scan.status !== 'pending') {
|
|
112
|
+
throw new Error(`Scan ${scanId} is not in pending status`);
|
|
113
|
+
}
|
|
114
|
+
scan.status = 'running';
|
|
115
|
+
scan.updatedAt = new Date();
|
|
116
|
+
this.addAuditEntry(scan, 'system', 'scan_started', 'scan', {
|
|
117
|
+
scanId,
|
|
118
|
+
target: scan.target,
|
|
119
|
+
});
|
|
120
|
+
await this.saveScan(scan);
|
|
121
|
+
this.emit('scan:started', scan);
|
|
122
|
+
try {
|
|
123
|
+
const startTime = Date.now();
|
|
124
|
+
// Execute the appropriate scanner
|
|
125
|
+
const findings = await this.executeScanEngine(scan);
|
|
126
|
+
const endTime = Date.now();
|
|
127
|
+
scan.metrics.scanDuration = endTime - startTime;
|
|
128
|
+
scan.results = findings;
|
|
129
|
+
scan.status = 'completed';
|
|
130
|
+
// Calculate metrics
|
|
131
|
+
this.calculateScanMetrics(scan);
|
|
132
|
+
// Run compliance checks
|
|
133
|
+
await this.runComplianceChecks(scan);
|
|
134
|
+
// Generate remediation recommendations
|
|
135
|
+
await this.generateRemediationRecommendations(scan);
|
|
136
|
+
// Check notification thresholds
|
|
137
|
+
await this.checkNotificationThresholds(scan);
|
|
138
|
+
scan.updatedAt = new Date();
|
|
139
|
+
this.addAuditEntry(scan, 'system', 'scan_completed', 'scan', {
|
|
140
|
+
scanId,
|
|
141
|
+
duration: scan.metrics.scanDuration,
|
|
142
|
+
findingsCount: scan.results.length,
|
|
143
|
+
});
|
|
144
|
+
await this.saveScan(scan);
|
|
145
|
+
this.emit('scan:completed', scan);
|
|
146
|
+
this.logger.info(`Security scan completed: ${scan.name} (${scan.id}) - ${scan.results.length} findings`);
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
scan.status = 'failed';
|
|
150
|
+
scan.updatedAt = new Date();
|
|
151
|
+
this.addAuditEntry(scan, 'system', 'scan_failed', 'scan', {
|
|
152
|
+
scanId,
|
|
153
|
+
error: error instanceof Error ? error.message : String(error),
|
|
154
|
+
});
|
|
155
|
+
await this.saveScan(scan);
|
|
156
|
+
this.emit('scan:failed', { scan, error });
|
|
157
|
+
this.logger.error(`Security scan failed: ${scan.name} (${scanId})`, { error });
|
|
158
|
+
throw error;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
async createSecurityIncident(incidentData) {
|
|
162
|
+
const incident = {
|
|
163
|
+
id: `incident-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
164
|
+
title: incidentData.title,
|
|
165
|
+
description: incidentData.description,
|
|
166
|
+
severity: incidentData.severity,
|
|
167
|
+
status: 'open',
|
|
168
|
+
type: incidentData.type,
|
|
169
|
+
source: incidentData.source,
|
|
170
|
+
affected: {
|
|
171
|
+
systems: [],
|
|
172
|
+
data: [],
|
|
173
|
+
users: [],
|
|
174
|
+
...incidentData.affected,
|
|
175
|
+
},
|
|
176
|
+
timeline: {
|
|
177
|
+
detected: new Date(),
|
|
178
|
+
reported: new Date(),
|
|
179
|
+
acknowledged: new Date(),
|
|
180
|
+
},
|
|
181
|
+
response: {
|
|
182
|
+
assignedTo: [],
|
|
183
|
+
actions: [],
|
|
184
|
+
communications: [],
|
|
185
|
+
lessons: [],
|
|
186
|
+
},
|
|
187
|
+
evidence: {
|
|
188
|
+
logs: [],
|
|
189
|
+
files: [],
|
|
190
|
+
screenshots: [],
|
|
191
|
+
forensics: [],
|
|
192
|
+
},
|
|
193
|
+
impact: {
|
|
194
|
+
confidentiality: 'none',
|
|
195
|
+
integrity: 'none',
|
|
196
|
+
availability: 'none',
|
|
197
|
+
},
|
|
198
|
+
rootCause: {
|
|
199
|
+
primary: '',
|
|
200
|
+
contributing: [],
|
|
201
|
+
analysis: '',
|
|
202
|
+
},
|
|
203
|
+
remediation: {
|
|
204
|
+
immediate: [],
|
|
205
|
+
shortTerm: [],
|
|
206
|
+
longTerm: [],
|
|
207
|
+
preventive: [],
|
|
208
|
+
},
|
|
209
|
+
createdAt: new Date(),
|
|
210
|
+
updatedAt: new Date(),
|
|
211
|
+
createdBy: 'system',
|
|
212
|
+
auditLog: [],
|
|
213
|
+
};
|
|
214
|
+
this.addAuditEntry(incident, 'system', 'incident_created', 'incident', {
|
|
215
|
+
incidentId: incident.id,
|
|
216
|
+
severity: incident.severity,
|
|
217
|
+
type: incident.type,
|
|
218
|
+
});
|
|
219
|
+
this.incidents.set(incident.id, incident);
|
|
220
|
+
await this.saveIncident(incident);
|
|
221
|
+
// Auto-assign based on severity and type
|
|
222
|
+
await this.autoAssignIncident(incident);
|
|
223
|
+
// Send immediate notifications for high/critical incidents
|
|
224
|
+
if (incident.severity === 'critical' || incident.severity === 'high') {
|
|
225
|
+
await this.sendIncidentNotification(incident);
|
|
226
|
+
}
|
|
227
|
+
this.emit('incident:created', incident);
|
|
228
|
+
this.logger.info(`Security incident created: ${incident.title} (${incident.id})`);
|
|
229
|
+
return incident;
|
|
230
|
+
}
|
|
231
|
+
async updateIncident(incidentId, updates, userId = 'system') {
|
|
232
|
+
const incident = this.incidents.get(incidentId);
|
|
233
|
+
if (!incident) {
|
|
234
|
+
throw new Error(`Incident not found: ${incidentId}`);
|
|
235
|
+
}
|
|
236
|
+
const oldStatus = incident.status;
|
|
237
|
+
Object.assign(incident, updates);
|
|
238
|
+
incident.updatedAt = new Date();
|
|
239
|
+
// Update timeline based on status changes
|
|
240
|
+
if (updates.status && updates.status !== oldStatus) {
|
|
241
|
+
this.updateIncidentTimeline(incident, updates.status);
|
|
242
|
+
}
|
|
243
|
+
this.addAuditEntry(incident, userId, 'incident_updated', 'incident', {
|
|
244
|
+
incidentId,
|
|
245
|
+
changes: Object.keys(updates),
|
|
246
|
+
oldStatus,
|
|
247
|
+
newStatus: incident.status,
|
|
248
|
+
});
|
|
249
|
+
await this.saveIncident(incident);
|
|
250
|
+
this.emit('incident:updated', { incident, updates });
|
|
251
|
+
this.logger.info(`Security incident updated: ${incident.title} (${incidentId})`);
|
|
252
|
+
return incident;
|
|
253
|
+
}
|
|
254
|
+
async runComplianceAssessment(frameworks, scope) {
|
|
255
|
+
const checks = [];
|
|
256
|
+
for (const framework of frameworks) {
|
|
257
|
+
const frameworkChecks = await this.runFrameworkChecks(framework, scope);
|
|
258
|
+
checks.push(...frameworkChecks);
|
|
259
|
+
}
|
|
260
|
+
this.logger.info(`Compliance assessment completed: ${checks.length} checks across ${frameworks.length} frameworks`);
|
|
261
|
+
this.emit('compliance:assessed', { frameworks, checks, scope });
|
|
262
|
+
return checks;
|
|
263
|
+
}
|
|
264
|
+
async createSecurityPolicy(policyData) {
|
|
265
|
+
const policy = {
|
|
266
|
+
id: `policy-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
267
|
+
name: policyData.name,
|
|
268
|
+
description: policyData.description,
|
|
269
|
+
type: policyData.type,
|
|
270
|
+
version: '1.0.0',
|
|
271
|
+
status: 'draft',
|
|
272
|
+
rules: policyData.rules.map((rule) => ({
|
|
273
|
+
id: `rule-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
274
|
+
...rule,
|
|
275
|
+
})),
|
|
276
|
+
enforcement: {
|
|
277
|
+
level: 'warning',
|
|
278
|
+
exceptions: [],
|
|
279
|
+
approvers: [],
|
|
280
|
+
...policyData.enforcement,
|
|
281
|
+
},
|
|
282
|
+
applicability: {
|
|
283
|
+
projects: [],
|
|
284
|
+
environments: [],
|
|
285
|
+
resources: [],
|
|
286
|
+
...policyData.applicability,
|
|
287
|
+
},
|
|
288
|
+
schedule: {
|
|
289
|
+
reviewFrequency: 'annually',
|
|
290
|
+
nextReview: new Date(Date.now() + 365 * 24 * 60 * 60 * 1000), // 1 year
|
|
291
|
+
reviewer: 'security-team',
|
|
292
|
+
},
|
|
293
|
+
metrics: {
|
|
294
|
+
violations: 0,
|
|
295
|
+
compliance: 100,
|
|
296
|
+
exceptions: 0,
|
|
297
|
+
},
|
|
298
|
+
createdAt: new Date(),
|
|
299
|
+
updatedAt: new Date(),
|
|
300
|
+
createdBy: 'system',
|
|
301
|
+
};
|
|
302
|
+
this.policies.set(policy.id, policy);
|
|
303
|
+
await this.savePolicy(policy);
|
|
304
|
+
this.emit('policy:created', policy);
|
|
305
|
+
this.logger.info(`Security policy created: ${policy.name} (${policy.id})`);
|
|
306
|
+
return policy;
|
|
307
|
+
}
|
|
308
|
+
async getSecurityMetrics(filters) {
|
|
309
|
+
let scans = Array.from(this.scans.values());
|
|
310
|
+
let incidents = Array.from(this.incidents.values());
|
|
311
|
+
// Apply filters
|
|
312
|
+
if (filters) {
|
|
313
|
+
if (filters.timeRange) {
|
|
314
|
+
scans = scans.filter((s) => s.createdAt >= filters.timeRange.start && s.createdAt <= filters.timeRange.end);
|
|
315
|
+
incidents = incidents.filter((i) => i.createdAt >= filters.timeRange.start && i.createdAt <= filters.timeRange.end);
|
|
316
|
+
}
|
|
317
|
+
if (filters.projectId) {
|
|
318
|
+
scans = scans.filter((s) => s.projectId === filters.projectId);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
// Calculate scan metrics
|
|
322
|
+
const scanMetrics = {
|
|
323
|
+
total: scans.length,
|
|
324
|
+
completed: scans.filter((s) => s.status === 'completed').length,
|
|
325
|
+
failed: scans.filter((s) => s.status === 'failed').length,
|
|
326
|
+
inProgress: scans.filter((s) => s.status === 'running').length,
|
|
327
|
+
byType: this.groupBy(scans, 'type'),
|
|
328
|
+
averageDuration: scans.length > 0
|
|
329
|
+
? scans.reduce((sum, s) => sum + s.metrics.scanDuration, 0) / scans.length
|
|
330
|
+
: 0,
|
|
331
|
+
};
|
|
332
|
+
// Calculate finding metrics
|
|
333
|
+
const allFindings = scans.flatMap((s) => s.results);
|
|
334
|
+
const findingMetrics = {
|
|
335
|
+
total: allFindings.length,
|
|
336
|
+
open: allFindings.filter((f) => f.status === 'open').length,
|
|
337
|
+
resolved: allFindings.filter((f) => f.status === 'resolved').length,
|
|
338
|
+
suppressed: allFindings.filter((f) => f.status === 'suppressed').length,
|
|
339
|
+
bySeverity: this.groupBy(allFindings, 'severity'),
|
|
340
|
+
byCategory: this.groupBy(allFindings, 'category'),
|
|
341
|
+
meanTimeToResolution: this.calculateMTTR(allFindings),
|
|
342
|
+
};
|
|
343
|
+
// Calculate compliance metrics
|
|
344
|
+
const allComplianceChecks = scans.flatMap((s) => s.compliance.requirements);
|
|
345
|
+
const complianceFrameworks = {};
|
|
346
|
+
for (const check of allComplianceChecks) {
|
|
347
|
+
if (!complianceFrameworks[check.framework]) {
|
|
348
|
+
complianceFrameworks[check.framework] = {
|
|
349
|
+
total: 0,
|
|
350
|
+
passed: 0,
|
|
351
|
+
failed: 0,
|
|
352
|
+
score: 0,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
complianceFrameworks[check.framework].total++;
|
|
356
|
+
if (check.status === 'passed') {
|
|
357
|
+
complianceFrameworks[check.framework].passed++;
|
|
358
|
+
}
|
|
359
|
+
else if (check.status === 'failed') {
|
|
360
|
+
complianceFrameworks[check.framework].failed++;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// Calculate scores
|
|
364
|
+
for (const framework in complianceFrameworks) {
|
|
365
|
+
const fw = complianceFrameworks[framework];
|
|
366
|
+
fw.score = fw.total > 0 ? (fw.passed / fw.total) * 100 : 0;
|
|
367
|
+
}
|
|
368
|
+
const overallComplianceScore = Object.values(complianceFrameworks).length > 0
|
|
369
|
+
? Object.values(complianceFrameworks).reduce((sum, fw) => sum + fw.score, 0) /
|
|
370
|
+
Object.values(complianceFrameworks).length
|
|
371
|
+
: 0;
|
|
372
|
+
// Calculate incident metrics
|
|
373
|
+
const incidentMetrics = {
|
|
374
|
+
total: incidents.length,
|
|
375
|
+
open: incidents.filter((i) => i.status === 'open' || i.status === 'investigating').length,
|
|
376
|
+
resolved: incidents.filter((i) => i.status === 'resolved' || i.status === 'closed').length,
|
|
377
|
+
bySeverity: this.groupBy(incidents, 'severity'),
|
|
378
|
+
meanTimeToDetection: this.calculateMTTD(incidents),
|
|
379
|
+
meanTimeToResponse: this.calculateMTTResponse(incidents),
|
|
380
|
+
meanTimeToResolution: this.calculateIncidentMTTR(incidents),
|
|
381
|
+
};
|
|
382
|
+
// Policy metrics
|
|
383
|
+
const policies = Array.from(this.policies.values());
|
|
384
|
+
const policyMetrics = {
|
|
385
|
+
total: policies.length,
|
|
386
|
+
active: policies.filter((p) => p.status === 'active').length,
|
|
387
|
+
violations: policies.reduce((sum, p) => sum + p.metrics.violations, 0),
|
|
388
|
+
compliance: policies.length > 0
|
|
389
|
+
? policies.reduce((sum, p) => sum + p.metrics.compliance, 0) / policies.length
|
|
390
|
+
: 0,
|
|
391
|
+
};
|
|
392
|
+
return {
|
|
393
|
+
scans: scanMetrics,
|
|
394
|
+
findings: findingMetrics,
|
|
395
|
+
compliance: {
|
|
396
|
+
frameworks: complianceFrameworks,
|
|
397
|
+
overallScore: overallComplianceScore,
|
|
398
|
+
trending: 'stable', // Would be calculated from historical data
|
|
399
|
+
},
|
|
400
|
+
incidents: incidentMetrics,
|
|
401
|
+
policies: policyMetrics,
|
|
402
|
+
trends: {
|
|
403
|
+
findingsTrend: [], // Would be calculated from historical data
|
|
404
|
+
complianceTrend: [], // Would be calculated from historical data
|
|
405
|
+
incidentsTrend: [], // Would be calculated from historical data
|
|
406
|
+
},
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
// Private helper methods
|
|
410
|
+
async loadConfigurations() {
|
|
411
|
+
try {
|
|
412
|
+
// Load scans
|
|
413
|
+
const scanFiles = await readdir(join(this.securityPath, 'scans'));
|
|
414
|
+
for (const file of scanFiles.filter((f) => f.endsWith('.json'))) {
|
|
415
|
+
const content = await readFile(join(this.securityPath, 'scans', file), 'utf-8');
|
|
416
|
+
const scan = JSON.parse(content);
|
|
417
|
+
this.scans.set(scan.id, scan);
|
|
418
|
+
}
|
|
419
|
+
// Load policies
|
|
420
|
+
const policyFiles = await readdir(join(this.securityPath, 'policies'));
|
|
421
|
+
for (const file of policyFiles.filter((f) => f.endsWith('.json'))) {
|
|
422
|
+
const content = await readFile(join(this.securityPath, 'policies', file), 'utf-8');
|
|
423
|
+
const policy = JSON.parse(content);
|
|
424
|
+
this.policies.set(policy.id, policy);
|
|
425
|
+
}
|
|
426
|
+
// Load incidents
|
|
427
|
+
const incidentFiles = await readdir(join(this.securityPath, 'incidents'));
|
|
428
|
+
for (const file of incidentFiles.filter((f) => f.endsWith('.json'))) {
|
|
429
|
+
const content = await readFile(join(this.securityPath, 'incidents', file), 'utf-8');
|
|
430
|
+
const incident = JSON.parse(content);
|
|
431
|
+
this.incidents.set(incident.id, incident);
|
|
432
|
+
}
|
|
433
|
+
this.logger.info(`Loaded ${this.scans.size} scans, ${this.policies.size} policies, ${this.incidents.size} incidents`);
|
|
434
|
+
}
|
|
435
|
+
catch (error) {
|
|
436
|
+
this.logger.warn('Failed to load some security configurations', { error });
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
async initializeDefaultPolicies() {
|
|
440
|
+
const defaultPolicies = [
|
|
441
|
+
{
|
|
442
|
+
name: 'Critical Vulnerability Policy',
|
|
443
|
+
description: 'Immediate action required for critical vulnerabilities',
|
|
444
|
+
type: 'scanning',
|
|
445
|
+
rules: [
|
|
446
|
+
{
|
|
447
|
+
name: 'Critical CVSS Score',
|
|
448
|
+
description: 'Alert on vulnerabilities with CVSS score >= 9.0',
|
|
449
|
+
condition: 'cvss.score >= 9.0',
|
|
450
|
+
action: 'alert',
|
|
451
|
+
severity: 'critical',
|
|
452
|
+
parameters: { threshold: 9.0 },
|
|
453
|
+
enabled: true,
|
|
454
|
+
},
|
|
455
|
+
],
|
|
456
|
+
enforcement: {
|
|
457
|
+
level: 'blocking',
|
|
458
|
+
exceptions: [],
|
|
459
|
+
approvers: ['security-lead'],
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
name: 'Secret Detection Policy',
|
|
464
|
+
description: 'Detect exposed secrets and credentials',
|
|
465
|
+
type: 'scanning',
|
|
466
|
+
rules: [
|
|
467
|
+
{
|
|
468
|
+
name: 'API Key Detection',
|
|
469
|
+
description: 'Detect exposed API keys',
|
|
470
|
+
condition: 'category == "secret" && type == "api-key"',
|
|
471
|
+
action: 'deny',
|
|
472
|
+
severity: 'high',
|
|
473
|
+
parameters: {},
|
|
474
|
+
enabled: true,
|
|
475
|
+
},
|
|
476
|
+
],
|
|
477
|
+
},
|
|
478
|
+
];
|
|
479
|
+
for (const policyData of defaultPolicies) {
|
|
480
|
+
if (!Array.from(this.policies.values()).some((p) => p.name === policyData.name)) {
|
|
481
|
+
await this.createSecurityPolicy(policyData);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
async initializeVulnerabilityDatabases() {
|
|
486
|
+
const databases = [
|
|
487
|
+
{
|
|
488
|
+
id: 'nvd',
|
|
489
|
+
name: 'National Vulnerability Database',
|
|
490
|
+
type: 'nvd',
|
|
491
|
+
url: 'https://nvd.nist.gov/feeds/json/cve/1.1/',
|
|
492
|
+
updateFrequency: 'daily',
|
|
493
|
+
lastUpdate: new Date(),
|
|
494
|
+
status: 'active',
|
|
495
|
+
configuration: {},
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
id: 'github-advisories',
|
|
499
|
+
name: 'GitHub Security Advisories',
|
|
500
|
+
type: 'github',
|
|
501
|
+
url: 'https://api.github.com/advisories',
|
|
502
|
+
updateFrequency: 'daily',
|
|
503
|
+
lastUpdate: new Date(),
|
|
504
|
+
status: 'active',
|
|
505
|
+
configuration: {},
|
|
506
|
+
},
|
|
507
|
+
];
|
|
508
|
+
for (const db of databases) {
|
|
509
|
+
this.vulnerabilityDatabases.set(db.id, db);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
getDefaultScanner(type) {
|
|
513
|
+
const scanners = {
|
|
514
|
+
vulnerability: 'trivy',
|
|
515
|
+
dependency: 'npm-audit',
|
|
516
|
+
'code-quality': 'sonarqube',
|
|
517
|
+
secrets: 'gitleaks',
|
|
518
|
+
compliance: 'inspec',
|
|
519
|
+
infrastructure: 'checkov',
|
|
520
|
+
container: 'clair',
|
|
521
|
+
};
|
|
522
|
+
return scanners[type] || 'generic';
|
|
523
|
+
}
|
|
524
|
+
async executeScanEngine(scan) {
|
|
525
|
+
const findings = [];
|
|
526
|
+
switch (scan.configuration.scanner) {
|
|
527
|
+
case 'trivy':
|
|
528
|
+
return this.executeTrivyScan(scan);
|
|
529
|
+
case 'npm-audit':
|
|
530
|
+
return this.executeNpmAuditScan(scan);
|
|
531
|
+
case 'gitleaks':
|
|
532
|
+
return this.executeGitleaksScan(scan);
|
|
533
|
+
case 'checkov':
|
|
534
|
+
return this.executeCheckovScan(scan);
|
|
535
|
+
default:
|
|
536
|
+
return this.executeGenericScan(scan);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
async executeTrivyScan(scan) {
|
|
540
|
+
return new Promise((resolve, reject) => {
|
|
541
|
+
const findings = [];
|
|
542
|
+
// Mock Trivy execution
|
|
543
|
+
const mockFindings = [
|
|
544
|
+
{
|
|
545
|
+
id: `finding-${Date.now()}-1`,
|
|
546
|
+
title: 'CVE-2023-12345: Remote Code Execution in libxml2',
|
|
547
|
+
description: 'A buffer overflow vulnerability in libxml2 allows remote code execution',
|
|
548
|
+
severity: 'critical',
|
|
549
|
+
category: 'vulnerability',
|
|
550
|
+
cve: 'CVE-2023-12345',
|
|
551
|
+
cvss: {
|
|
552
|
+
score: 9.8,
|
|
553
|
+
vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H',
|
|
554
|
+
version: '3.1',
|
|
555
|
+
},
|
|
556
|
+
location: {
|
|
557
|
+
file: 'package-lock.json',
|
|
558
|
+
line: 125,
|
|
559
|
+
component: 'libxml2@2.9.10',
|
|
560
|
+
},
|
|
561
|
+
evidence: {
|
|
562
|
+
snippet: '"libxml2": "2.9.10"',
|
|
563
|
+
context: 'Dependency declaration',
|
|
564
|
+
references: ['https://nvd.nist.gov/vuln/detail/CVE-2023-12345'],
|
|
565
|
+
},
|
|
566
|
+
impact: 'Remote attackers could execute arbitrary code',
|
|
567
|
+
remediation: {
|
|
568
|
+
description: 'Update libxml2 to version 2.9.14 or later',
|
|
569
|
+
effort: 'low',
|
|
570
|
+
priority: 'critical',
|
|
571
|
+
autoFixable: true,
|
|
572
|
+
steps: ['npm update libxml2'],
|
|
573
|
+
references: ['https://github.com/GNOME/libxml2/releases'],
|
|
574
|
+
},
|
|
575
|
+
status: 'open',
|
|
576
|
+
tags: ['cve', 'rce', 'dependency'],
|
|
577
|
+
metadata: {},
|
|
578
|
+
firstSeen: new Date(),
|
|
579
|
+
lastSeen: new Date(),
|
|
580
|
+
occurrences: 1,
|
|
581
|
+
},
|
|
582
|
+
];
|
|
583
|
+
// Simulate scan delay
|
|
584
|
+
setTimeout(() => {
|
|
585
|
+
resolve(mockFindings);
|
|
586
|
+
}, 2000);
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
async executeNpmAuditScan(scan) {
|
|
590
|
+
return new Promise((resolve, reject) => {
|
|
591
|
+
const command = 'npm';
|
|
592
|
+
const args = ['audit', '--json'];
|
|
593
|
+
const child = spawn(command, args, {
|
|
594
|
+
cwd: scan.target.path,
|
|
595
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
596
|
+
});
|
|
597
|
+
let stdout = '';
|
|
598
|
+
let stderr = '';
|
|
599
|
+
child.stdout?.on('data', (data) => {
|
|
600
|
+
stdout += data.toString();
|
|
601
|
+
});
|
|
602
|
+
child.stderr?.on('data', (data) => {
|
|
603
|
+
stderr += data.toString();
|
|
604
|
+
});
|
|
605
|
+
child.on('close', (code) => {
|
|
606
|
+
try {
|
|
607
|
+
const auditResult = JSON.parse(stdout);
|
|
608
|
+
const findings = this.parseNpmAuditResults(auditResult);
|
|
609
|
+
resolve(findings);
|
|
610
|
+
}
|
|
611
|
+
catch (error) {
|
|
612
|
+
reject(new Error(`Failed to parse npm audit results: ${error instanceof Error ? error.message : String(error)}`));
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
child.on('error', (error) => {
|
|
616
|
+
reject(error);
|
|
617
|
+
});
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
async executeGitleaksScan(scan) {
|
|
621
|
+
// Mock Gitleaks scan for secrets detection
|
|
622
|
+
return [
|
|
623
|
+
{
|
|
624
|
+
id: `finding-${Date.now()}-2`,
|
|
625
|
+
title: 'Exposed AWS Access Key',
|
|
626
|
+
description: 'AWS access key found in source code',
|
|
627
|
+
severity: 'high',
|
|
628
|
+
category: 'secret',
|
|
629
|
+
location: {
|
|
630
|
+
file: 'config/aws.js',
|
|
631
|
+
line: 12,
|
|
632
|
+
column: 20,
|
|
633
|
+
},
|
|
634
|
+
evidence: {
|
|
635
|
+
snippet: 'const accessKey = "AKIA123456789..."',
|
|
636
|
+
context: 'Hardcoded AWS credentials',
|
|
637
|
+
},
|
|
638
|
+
impact: 'Unauthorized access to AWS resources',
|
|
639
|
+
remediation: {
|
|
640
|
+
description: 'Remove hardcoded credentials and use environment variables or IAM roles',
|
|
641
|
+
effort: 'medium',
|
|
642
|
+
priority: 'high',
|
|
643
|
+
autoFixable: false,
|
|
644
|
+
steps: [
|
|
645
|
+
'Remove hardcoded credentials',
|
|
646
|
+
'Use environment variables',
|
|
647
|
+
'Rotate compromised keys',
|
|
648
|
+
],
|
|
649
|
+
references: ['https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html'],
|
|
650
|
+
},
|
|
651
|
+
status: 'open',
|
|
652
|
+
tags: ['secret', 'aws', 'credentials'],
|
|
653
|
+
metadata: {},
|
|
654
|
+
firstSeen: new Date(),
|
|
655
|
+
lastSeen: new Date(),
|
|
656
|
+
occurrences: 1,
|
|
657
|
+
},
|
|
658
|
+
];
|
|
659
|
+
}
|
|
660
|
+
async executeCheckovScan(scan) {
|
|
661
|
+
// Mock Checkov scan for infrastructure as code
|
|
662
|
+
return [];
|
|
663
|
+
}
|
|
664
|
+
async executeGenericScan(scan) {
|
|
665
|
+
// Generic scan implementation
|
|
666
|
+
return [];
|
|
667
|
+
}
|
|
668
|
+
parseNpmAuditResults(auditResult) {
|
|
669
|
+
const findings = [];
|
|
670
|
+
if (auditResult.vulnerabilities) {
|
|
671
|
+
for (const [packageName, vulnData] of Object.entries(auditResult.vulnerabilities)) {
|
|
672
|
+
const vuln = vulnData;
|
|
673
|
+
findings.push({
|
|
674
|
+
id: `finding-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
675
|
+
title: `${vuln.severity} vulnerability in ${packageName}`,
|
|
676
|
+
description: vuln.title || 'Vulnerability detected',
|
|
677
|
+
severity: vuln.severity,
|
|
678
|
+
category: 'vulnerability',
|
|
679
|
+
cve: vuln.cve,
|
|
680
|
+
location: {
|
|
681
|
+
file: 'package.json',
|
|
682
|
+
component: packageName,
|
|
683
|
+
},
|
|
684
|
+
evidence: {
|
|
685
|
+
snippet: `"${packageName}": "${vuln.range}"`,
|
|
686
|
+
references: vuln.url ? [vuln.url] : [],
|
|
687
|
+
},
|
|
688
|
+
impact: vuln.overview || 'Security vulnerability',
|
|
689
|
+
remediation: {
|
|
690
|
+
description: vuln.recommendation || 'Update to a secure version',
|
|
691
|
+
effort: 'low',
|
|
692
|
+
priority: vuln.severity === 'info'
|
|
693
|
+
? 'low'
|
|
694
|
+
: vuln.severity,
|
|
695
|
+
autoFixable: true,
|
|
696
|
+
steps: [`npm update ${packageName}`],
|
|
697
|
+
references: vuln.url ? [vuln.url] : [],
|
|
698
|
+
},
|
|
699
|
+
status: 'open',
|
|
700
|
+
tags: ['npm', 'dependency'],
|
|
701
|
+
metadata: { packageName, range: vuln.range },
|
|
702
|
+
firstSeen: new Date(),
|
|
703
|
+
lastSeen: new Date(),
|
|
704
|
+
occurrences: 1,
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
return findings;
|
|
709
|
+
}
|
|
710
|
+
calculateScanMetrics(scan) {
|
|
711
|
+
const findings = scan.results;
|
|
712
|
+
scan.metrics.totalFindings = findings.length;
|
|
713
|
+
scan.metrics.criticalFindings = findings.filter((f) => f.severity === 'critical').length;
|
|
714
|
+
scan.metrics.highFindings = findings.filter((f) => f.severity === 'high').length;
|
|
715
|
+
scan.metrics.mediumFindings = findings.filter((f) => f.severity === 'medium').length;
|
|
716
|
+
scan.metrics.lowFindings = findings.filter((f) => f.severity === 'low').length;
|
|
717
|
+
scan.metrics.falsePositives = findings.filter((f) => f.status === 'false-positive').length;
|
|
718
|
+
scan.metrics.suppressed = findings.filter((f) => f.status === 'suppressed').length;
|
|
719
|
+
}
|
|
720
|
+
async runComplianceChecks(scan) {
|
|
721
|
+
// Mock compliance checks
|
|
722
|
+
const frameworks = ['SOC2', 'GDPR', 'PCI-DSS'];
|
|
723
|
+
for (const framework of frameworks) {
|
|
724
|
+
const checks = await this.runFrameworkChecks(framework, { projectId: scan.projectId });
|
|
725
|
+
scan.compliance.requirements.push(...checks);
|
|
726
|
+
}
|
|
727
|
+
scan.compliance.frameworks = frameworks;
|
|
728
|
+
scan.compliance.passedChecks = scan.compliance.requirements.filter((r) => r.status === 'passed').length;
|
|
729
|
+
scan.compliance.failedChecks = scan.compliance.requirements.filter((r) => r.status === 'failed').length;
|
|
730
|
+
scan.compliance.overallScore =
|
|
731
|
+
scan.compliance.requirements.length > 0
|
|
732
|
+
? (scan.compliance.passedChecks / scan.compliance.requirements.length) * 100
|
|
733
|
+
: 0;
|
|
734
|
+
}
|
|
735
|
+
async runFrameworkChecks(framework, scope) {
|
|
736
|
+
// Mock compliance checks for different frameworks
|
|
737
|
+
const mockChecks = [
|
|
738
|
+
{
|
|
739
|
+
id: `check-${Date.now()}-1`,
|
|
740
|
+
framework,
|
|
741
|
+
control: 'CC6.1',
|
|
742
|
+
description: 'Encryption in transit',
|
|
743
|
+
status: 'passed',
|
|
744
|
+
severity: 'high',
|
|
745
|
+
evidence: 'TLS 1.2+ configured',
|
|
746
|
+
lastChecked: new Date(),
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
id: `check-${Date.now()}-2`,
|
|
750
|
+
framework,
|
|
751
|
+
control: 'CC6.7',
|
|
752
|
+
description: 'Encryption at rest',
|
|
753
|
+
status: 'failed',
|
|
754
|
+
severity: 'medium',
|
|
755
|
+
remediation: 'Enable database encryption',
|
|
756
|
+
lastChecked: new Date(),
|
|
757
|
+
},
|
|
758
|
+
];
|
|
759
|
+
return mockChecks;
|
|
760
|
+
}
|
|
761
|
+
async generateRemediationRecommendations(scan) {
|
|
762
|
+
const autoFixable = scan.results.filter((f) => f.remediation.autoFixable);
|
|
763
|
+
const manualReview = scan.results.filter((f) => !f.remediation.autoFixable);
|
|
764
|
+
scan.remediation.autoFixAvailable = autoFixable;
|
|
765
|
+
scan.remediation.manualReview = manualReview;
|
|
766
|
+
// Generate general recommendations
|
|
767
|
+
scan.remediation.recommendations = [
|
|
768
|
+
{
|
|
769
|
+
id: `rec-${Date.now()}-1`,
|
|
770
|
+
title: 'Implement Automated Dependency Updates',
|
|
771
|
+
description: 'Set up automated dependency updates to reduce vulnerability exposure',
|
|
772
|
+
category: 'vulnerability-management',
|
|
773
|
+
priority: 'high',
|
|
774
|
+
effort: 'medium',
|
|
775
|
+
impact: 'Reduces time to patch vulnerabilities',
|
|
776
|
+
implementation: {
|
|
777
|
+
steps: [
|
|
778
|
+
'Configure Dependabot or Renovate',
|
|
779
|
+
'Set up automated testing pipeline',
|
|
780
|
+
'Enable auto-merge for low-risk updates',
|
|
781
|
+
],
|
|
782
|
+
tools: ['Dependabot', 'Renovate', 'GitHub Actions'],
|
|
783
|
+
timeEstimate: '2-4 hours',
|
|
784
|
+
cost: 'Free',
|
|
785
|
+
},
|
|
786
|
+
references: [
|
|
787
|
+
'https://docs.github.com/en/code-security/dependabot',
|
|
788
|
+
'https://renovatebot.com/',
|
|
789
|
+
],
|
|
790
|
+
applicableFrameworks: ['SOC2', 'ISO27001'],
|
|
791
|
+
},
|
|
792
|
+
];
|
|
793
|
+
}
|
|
794
|
+
async checkNotificationThresholds(scan) {
|
|
795
|
+
const thresholds = scan.notifications.thresholds;
|
|
796
|
+
if (scan.metrics.criticalFindings >= thresholds.critical ||
|
|
797
|
+
scan.metrics.highFindings >= thresholds.high ||
|
|
798
|
+
scan.metrics.mediumFindings >= thresholds.medium) {
|
|
799
|
+
await this.sendScanNotification(scan);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
async sendScanNotification(scan) {
|
|
803
|
+
const message = `Security scan '${scan.name}' completed with ${scan.metrics.totalFindings} findings (${scan.metrics.criticalFindings} critical, ${scan.metrics.highFindings} high)`;
|
|
804
|
+
this.emit('notification:scan', {
|
|
805
|
+
scan,
|
|
806
|
+
message,
|
|
807
|
+
severity: scan.metrics.criticalFindings > 0
|
|
808
|
+
? 'critical'
|
|
809
|
+
: scan.metrics.highFindings > 0
|
|
810
|
+
? 'high'
|
|
811
|
+
: 'medium',
|
|
812
|
+
});
|
|
813
|
+
this.logger.warn(message);
|
|
814
|
+
}
|
|
815
|
+
async autoAssignIncident(incident) {
|
|
816
|
+
// Auto-assign based on severity and type
|
|
817
|
+
const assignmentRules = {
|
|
818
|
+
critical: ['security-lead', 'ciso'],
|
|
819
|
+
high: ['security-team'],
|
|
820
|
+
medium: ['security-analyst'],
|
|
821
|
+
low: ['security-analyst'],
|
|
822
|
+
};
|
|
823
|
+
incident.response.assignedTo = assignmentRules[incident.severity] || ['security-team'];
|
|
824
|
+
}
|
|
825
|
+
async sendIncidentNotification(incident) {
|
|
826
|
+
const message = `SECURITY INCIDENT: ${incident.title} (${incident.severity.toUpperCase()})`;
|
|
827
|
+
this.emit('notification:incident', {
|
|
828
|
+
incident,
|
|
829
|
+
message,
|
|
830
|
+
urgency: incident.severity === 'critical' ? 'immediate' : 'high',
|
|
831
|
+
});
|
|
832
|
+
this.logger.error(message);
|
|
833
|
+
}
|
|
834
|
+
updateIncidentTimeline(incident, newStatus) {
|
|
835
|
+
const now = new Date();
|
|
836
|
+
switch (newStatus) {
|
|
837
|
+
case 'investigating':
|
|
838
|
+
incident.timeline.acknowledged = now;
|
|
839
|
+
break;
|
|
840
|
+
case 'contained':
|
|
841
|
+
incident.timeline.contained = now;
|
|
842
|
+
break;
|
|
843
|
+
case 'resolved':
|
|
844
|
+
incident.timeline.resolved = now;
|
|
845
|
+
break;
|
|
846
|
+
case 'closed':
|
|
847
|
+
incident.timeline.closed = now;
|
|
848
|
+
break;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
async saveScan(scan) {
|
|
852
|
+
const filePath = join(this.securityPath, 'scans', `${scan.id}.json`);
|
|
853
|
+
await writeFile(filePath, JSON.stringify(scan, null, 2));
|
|
854
|
+
}
|
|
855
|
+
async savePolicy(policy) {
|
|
856
|
+
const filePath = join(this.securityPath, 'policies', `${policy.id}.json`);
|
|
857
|
+
await writeFile(filePath, JSON.stringify(policy, null, 2));
|
|
858
|
+
}
|
|
859
|
+
async saveIncident(incident) {
|
|
860
|
+
const filePath = join(this.securityPath, 'incidents', `${incident.id}.json`);
|
|
861
|
+
await writeFile(filePath, JSON.stringify(incident, null, 2));
|
|
862
|
+
}
|
|
863
|
+
addAuditEntry(target, userId, action, targetType, details) {
|
|
864
|
+
const entry = {
|
|
865
|
+
id: `audit-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
866
|
+
timestamp: new Date(),
|
|
867
|
+
userId,
|
|
868
|
+
action,
|
|
869
|
+
target: targetType,
|
|
870
|
+
details,
|
|
871
|
+
};
|
|
872
|
+
target.auditLog.push(entry);
|
|
873
|
+
}
|
|
874
|
+
groupBy(array, key) {
|
|
875
|
+
return array.reduce((groups, item) => {
|
|
876
|
+
const value = String(item[key]);
|
|
877
|
+
groups[value] = (groups[value] || 0) + 1;
|
|
878
|
+
return groups;
|
|
879
|
+
}, {});
|
|
880
|
+
}
|
|
881
|
+
calculateMTTR(findings) {
|
|
882
|
+
const resolvedFindings = findings.filter((f) => f.status === 'resolved' && f.firstSeen && f.lastSeen);
|
|
883
|
+
if (resolvedFindings.length === 0)
|
|
884
|
+
return 0;
|
|
885
|
+
const totalTime = resolvedFindings.reduce((sum, f) => sum + (f.lastSeen.getTime() - f.firstSeen.getTime()), 0);
|
|
886
|
+
return totalTime / resolvedFindings.length;
|
|
887
|
+
}
|
|
888
|
+
calculateMTTD(incidents) {
|
|
889
|
+
const detectedIncidents = incidents.filter((i) => i.timeline.detected && i.timeline.reported);
|
|
890
|
+
if (detectedIncidents.length === 0)
|
|
891
|
+
return 0;
|
|
892
|
+
const totalTime = detectedIncidents.reduce((sum, i) => sum + (i.timeline.reported.getTime() - i.timeline.detected.getTime()), 0);
|
|
893
|
+
return totalTime / detectedIncidents.length;
|
|
894
|
+
}
|
|
895
|
+
calculateMTTResponse(incidents) {
|
|
896
|
+
const respondedIncidents = incidents.filter((i) => i.timeline.reported && i.timeline.acknowledged);
|
|
897
|
+
if (respondedIncidents.length === 0)
|
|
898
|
+
return 0;
|
|
899
|
+
const totalTime = respondedIncidents.reduce((sum, i) => sum + (i.timeline.acknowledged.getTime() - i.timeline.reported.getTime()), 0);
|
|
900
|
+
return totalTime / respondedIncidents.length;
|
|
901
|
+
}
|
|
902
|
+
calculateIncidentMTTR(incidents) {
|
|
903
|
+
const resolvedIncidents = incidents.filter((i) => i.timeline.reported && i.timeline.resolved);
|
|
904
|
+
if (resolvedIncidents.length === 0)
|
|
905
|
+
return 0;
|
|
906
|
+
const totalTime = resolvedIncidents.reduce((sum, i) => sum + (i.timeline.resolved.getTime() - i.timeline.reported.getTime()), 0);
|
|
907
|
+
return totalTime / resolvedIncidents.length;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
//# sourceMappingURL=security-manager.js.map
|