claude-flow 2.0.0-alpha.60 → 2.0.0-alpha.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/sparc/analyzer.md +24 -77
- package/.claude/commands/sparc/architect.md +25 -76
- package/.claude/commands/sparc/batch-executor.md +28 -78
- package/.claude/commands/sparc/coder.md +28 -79
- package/.claude/commands/sparc/debugger.md +26 -76
- package/.claude/commands/sparc/designer.md +25 -75
- package/.claude/commands/sparc/documenter.md +26 -75
- package/.claude/commands/sparc/innovator.md +26 -76
- package/.claude/commands/sparc/memory-manager.md +28 -77
- package/.claude/commands/sparc/optimizer.md +26 -76
- package/.claude/commands/sparc/orchestrator.md +23 -74
- package/.claude/commands/sparc/researcher.md +26 -77
- package/.claude/commands/sparc/reviewer.md +26 -76
- package/.claude/commands/sparc/sparc-modes.md +38 -358
- package/.claude/commands/sparc/swarm-coordinator.md +28 -77
- package/.claude/commands/sparc/tdd.md +28 -78
- package/.claude/commands/sparc/tester.md +26 -76
- package/.claude/commands/sparc/workflow-manager.md +28 -77
- package/.claude/commands/swarm/analysis.md +14 -17
- package/.claude/commands/swarm/development.md +14 -16
- package/.claude/commands/swarm/examples.md +20 -53
- package/.claude/commands/swarm/maintenance.md +14 -17
- package/.claude/commands/swarm/optimization.md +15 -17
- package/.claude/commands/swarm/research.md +14 -17
- package/.claude/commands/swarm/testing.md +15 -17
- package/.claude/config.json +32 -11
- package/CHANGELOG.md +113 -0
- package/bin/claude-flow +1 -1
- package/dist/adapters/cliffy-node.d.ts.map +1 -1
- package/dist/adapters/cliffy-node.js +13 -7
- package/dist/adapters/cliffy-node.js.map +1 -1
- package/dist/agents/agent-manager.d.ts.map +1 -1
- package/dist/agents/agent-manager.js +77 -65
- package/dist/agents/agent-manager.js.map +1 -1
- package/dist/agents/agent-registry.d.ts.map +1 -1
- package/dist/agents/agent-registry.js +38 -30
- package/dist/agents/agent-registry.js.map +1 -1
- package/dist/api/claude-client.d.ts.map +1 -1
- package/dist/api/claude-client.js +22 -16
- package/dist/api/claude-client.js.map +1 -1
- package/dist/cli/agents/analyst.d.ts.map +1 -1
- package/dist/cli/agents/analyst.js +94 -114
- package/dist/cli/agents/analyst.js.map +1 -1
- package/dist/cli/agents/architect.d.ts.map +1 -1
- package/dist/cli/agents/architect.js +100 -114
- package/dist/cli/agents/architect.js.map +1 -1
- package/dist/cli/agents/base-agent.d.ts.map +1 -1
- package/dist/cli/agents/base-agent.js +27 -27
- package/dist/cli/agents/base-agent.js.map +1 -1
- package/dist/cli/agents/capabilities.d.ts.map +1 -1
- package/dist/cli/agents/capabilities.js +49 -51
- package/dist/cli/agents/capabilities.js.map +1 -1
- package/dist/cli/agents/coder.d.ts.map +1 -1
- package/dist/cli/agents/coder.js +92 -98
- package/dist/cli/agents/coder.js.map +1 -1
- package/dist/cli/agents/coordinator.d.ts.map +1 -1
- package/dist/cli/agents/coordinator.js +59 -64
- package/dist/cli/agents/coordinator.js.map +1 -1
- package/dist/cli/agents/hive-agents.d.ts.map +1 -1
- package/dist/cli/agents/hive-agents.js +22 -24
- package/dist/cli/agents/hive-agents.js.map +1 -1
- package/dist/cli/agents/index.d.ts.map +1 -1
- package/dist/cli/agents/index.js +17 -17
- package/dist/cli/agents/index.js.map +1 -1
- package/dist/cli/agents/researcher.d.ts.map +1 -1
- package/dist/cli/agents/researcher.js +41 -61
- package/dist/cli/agents/researcher.js.map +1 -1
- package/dist/cli/agents/tester.d.ts.map +1 -1
- package/dist/cli/agents/tester.js +78 -90
- package/dist/cli/agents/tester.js.map +1 -1
- package/dist/cli/cli-core.d.ts +4 -1
- package/dist/cli/cli-core.d.ts.map +1 -1
- package/dist/cli/cli-core.js +40 -39
- package/dist/cli/cli-core.js.map +1 -1
- package/dist/cli/command-registry.d.ts.map +1 -1
- package/dist/cli/command-registry.js +99 -74
- package/dist/cli/command-registry.js.map +1 -1
- package/dist/cli/commands/advanced-memory-commands.d.ts.map +1 -1
- package/dist/cli/commands/advanced-memory-commands.js +49 -40
- package/dist/cli/commands/advanced-memory-commands.js.map +1 -1
- package/dist/cli/commands/agent-simple.d.ts +3 -0
- package/dist/cli/commands/agent-simple.d.ts.map +1 -1
- package/dist/cli/commands/agent-simple.js +30 -27
- package/dist/cli/commands/agent-simple.js.map +1 -1
- package/dist/cli/commands/agent.d.ts.map +1 -1
- package/dist/cli/commands/agent.js +53 -40
- package/dist/cli/commands/agent.js.map +1 -1
- package/dist/cli/commands/claude-api.js +4 -4
- package/dist/cli/commands/claude-api.js.map +1 -1
- package/dist/cli/commands/claude.d.ts.map +1 -1
- package/dist/cli/commands/claude.js +2 -2
- package/dist/cli/commands/claude.js.map +1 -1
- package/dist/cli/commands/config-integration.d.ts +7 -1
- package/dist/cli/commands/config-integration.d.ts.map +1 -1
- package/dist/cli/commands/config-integration.js +18 -9
- package/dist/cli/commands/config-integration.js.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +2 -3
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/enterprise.d.ts.map +1 -1
- package/dist/cli/commands/enterprise.js +115 -95
- package/dist/cli/commands/enterprise.js.map +1 -1
- package/dist/cli/commands/help-new.d.ts +7 -0
- package/dist/cli/commands/help-new.d.ts.map +1 -0
- package/dist/cli/commands/help-new.js +236 -0
- package/dist/cli/commands/help-new.js.map +1 -0
- package/dist/cli/commands/help.d.ts +2 -1
- package/dist/cli/commands/help.d.ts.map +1 -1
- package/dist/cli/commands/help.js +283 -133
- package/dist/cli/commands/help.js.map +1 -1
- package/dist/cli/commands/hive-mind/index.d.ts +1 -1
- package/dist/cli/commands/hive-mind/index.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/index.js +1 -1
- package/dist/cli/commands/hive-mind/index.js.map +1 -1
- package/dist/cli/commands/hive-mind/init.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/init.js.map +1 -1
- package/dist/cli/commands/hive-mind/optimize-memory.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/optimize-memory.js +35 -26
- package/dist/cli/commands/hive-mind/optimize-memory.js.map +1 -1
- package/dist/cli/commands/hive-mind/pause.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/pause.js +8 -6
- package/dist/cli/commands/hive-mind/pause.js.map +1 -1
- package/dist/cli/commands/hive-mind/ps.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/ps.js +17 -12
- package/dist/cli/commands/hive-mind/ps.js.map +1 -1
- package/dist/cli/commands/hive-mind/resume.js +12 -10
- package/dist/cli/commands/hive-mind/resume.js.map +1 -1
- package/dist/cli/commands/hive-mind/spawn.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/spawn.js +20 -11
- package/dist/cli/commands/hive-mind/spawn.js.map +1 -1
- package/dist/cli/commands/hive-mind/status.js +17 -22
- package/dist/cli/commands/hive-mind/status.js.map +1 -1
- package/dist/cli/commands/hive-mind/stop.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/stop.js +23 -15
- package/dist/cli/commands/hive-mind/stop.js.map +1 -1
- package/dist/cli/commands/hive-mind/task.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/task.js +25 -19
- package/dist/cli/commands/hive-mind/task.js.map +1 -1
- package/dist/cli/commands/hive-mind/wizard.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/wizard.js +86 -68
- package/dist/cli/commands/hive-mind/wizard.js.map +1 -1
- package/dist/cli/commands/hive.js +73 -38
- package/dist/cli/commands/hive.js.map +1 -1
- package/dist/cli/commands/hook-validator.d.ts.map +1 -1
- package/dist/cli/commands/hook-validator.js +4 -2
- package/dist/cli/commands/hook-validator.js.map +1 -1
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +8 -8
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +850 -784
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/commands/mcp.js +8 -16
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/memory.d.ts.map +1 -1
- package/dist/cli/commands/memory.js +8 -8
- package/dist/cli/commands/memory.js.map +1 -1
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +3 -3
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands/monitor.d.ts.map +1 -1
- package/dist/cli/commands/monitor.js +50 -34
- package/dist/cli/commands/monitor.js.map +1 -1
- package/dist/cli/commands/ruv-swarm.d.ts +7 -1
- package/dist/cli/commands/ruv-swarm.d.ts.map +1 -1
- package/dist/cli/commands/ruv-swarm.js +6 -6
- package/dist/cli/commands/ruv-swarm.js.map +1 -1
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +22 -17
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/sparc.d.ts +1 -1
- package/dist/cli/commands/sparc.d.ts.map +1 -1
- package/dist/cli/commands/sparc.js +146 -126
- package/dist/cli/commands/sparc.js.map +1 -1
- package/dist/cli/commands/start/event-emitter.js +1 -1
- package/dist/cli/commands/start/event-emitter.js.map +1 -1
- package/dist/cli/commands/start/process-manager.d.ts.map +1 -1
- package/dist/cli/commands/start/process-manager.js +20 -18
- package/dist/cli/commands/start/process-manager.js.map +1 -1
- package/dist/cli/commands/start/process-ui-simple.d.ts +4 -0
- package/dist/cli/commands/start/process-ui-simple.d.ts.map +1 -1
- package/dist/cli/commands/start/process-ui-simple.js +2 -2
- package/dist/cli/commands/start/process-ui-simple.js.map +1 -1
- package/dist/cli/commands/start/start-command.d.ts.map +1 -1
- package/dist/cli/commands/start/start-command.js +27 -15
- package/dist/cli/commands/start/start-command.js.map +1 -1
- package/dist/cli/commands/start/system-monitor.d.ts +3 -0
- package/dist/cli/commands/start/system-monitor.d.ts.map +1 -1
- package/dist/cli/commands/start/system-monitor.js +16 -18
- package/dist/cli/commands/start/system-monitor.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +28 -33
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/swarm-spawn.d.ts.map +1 -1
- package/dist/cli/commands/swarm-spawn.js +1 -1
- package/dist/cli/commands/swarm-spawn.js.map +1 -1
- package/dist/cli/commands/swarm.d.ts +4 -1
- package/dist/cli/commands/swarm.d.ts.map +1 -1
- package/dist/cli/commands/swarm.js +23 -18
- package/dist/cli/commands/swarm.js.map +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/workflow.d.ts.map +1 -1
- package/dist/cli/commands/workflow.js +49 -45
- package/dist/cli/commands/workflow.js.map +1 -1
- package/dist/cli/completion.d.ts +3 -0
- package/dist/cli/completion.d.ts.map +1 -1
- package/dist/cli/completion.js +15 -5
- package/dist/cli/completion.js.map +1 -1
- package/dist/cli/formatter.d.ts +3 -0
- package/dist/cli/formatter.d.ts.map +1 -1
- package/dist/cli/formatter.js +3 -3
- package/dist/cli/formatter.js.map +1 -1
- package/dist/cli/help-formatter.d.ts +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 +4 -0
- package/dist/cli/index-remote.d.ts.map +1 -1
- package/dist/cli/index-remote.js +1 -1
- package/dist/cli/index-remote.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +32 -34
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/batch-tools.d.ts.map +1 -1
- package/dist/cli/init/batch-tools.js.map +1 -1
- package/dist/cli/init/claude-config.d.ts.map +1 -1
- package/dist/cli/init/claude-config.js +111 -106
- package/dist/cli/init/claude-config.js.map +1 -1
- package/dist/cli/init/directory-structure.d.ts.map +1 -1
- package/dist/cli/init/directory-structure.js +3 -3
- package/dist/cli/init/directory-structure.js.map +1 -1
- package/dist/cli/init/index.d.ts.map +1 -1
- package/dist/cli/init/index.js +1 -1
- package/dist/cli/init/index.js.map +1 -1
- package/dist/cli/init/sparc-environment.d.ts.map +1 -1
- package/dist/cli/init/sparc-environment.js +69 -69
- package/dist/cli/init/sparc-environment.js.map +1 -1
- package/dist/cli/init/swarm-commands.d.ts.map +1 -1
- package/dist/cli/init/swarm-commands.js +1 -1
- package/dist/cli/init/swarm-commands.js.map +1 -1
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +6 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/node-compat.d.ts.map +1 -1
- package/dist/cli/node-compat.js +24 -18
- package/dist/cli/node-compat.js.map +1 -1
- package/dist/cli/node-repl.d.ts +4 -0
- package/dist/cli/node-repl.d.ts.map +1 -1
- package/dist/cli/node-repl.js +24 -30
- package/dist/cli/node-repl.js.map +1 -1
- package/dist/cli/repl.d.ts.map +1 -1
- package/dist/cli/repl.js +81 -70
- package/dist/cli/repl.js.map +1 -1
- package/dist/cli/runtime-detector.d.ts.map +1 -1
- package/dist/cli/runtime-detector.js +11 -7
- package/dist/cli/runtime-detector.js.map +1 -1
- package/dist/cli/simple-cli.d.ts +4 -0
- package/dist/cli/simple-cli.d.ts.map +1 -1
- package/dist/cli/simple-cli.js +109 -95
- package/dist/cli/simple-cli.js.map +1 -1
- package/dist/cli/simple-commands/analysis.d.ts.map +1 -1
- package/dist/cli/simple-commands/analysis.js +18 -11
- package/dist/cli/simple-commands/analysis.js.map +1 -1
- package/dist/cli/simple-commands/automation.js +32 -17
- package/dist/cli/simple-commands/automation.js.map +1 -1
- package/dist/cli/simple-commands/batch-manager.js +44 -39
- package/dist/cli/simple-commands/batch-manager.js.map +1 -1
- package/dist/cli/simple-commands/config.d.ts.map +1 -1
- package/dist/cli/simple-commands/config.js +22 -21
- package/dist/cli/simple-commands/config.js.map +1 -1
- package/dist/cli/simple-commands/coordination.d.ts.map +1 -1
- package/dist/cli/simple-commands/coordination.js +12 -12
- package/dist/cli/simple-commands/coordination.js.map +1 -1
- package/dist/cli/simple-commands/fix-hook-variables.d.ts.map +1 -1
- package/dist/cli/simple-commands/fix-hook-variables.js +36 -30
- package/dist/cli/simple-commands/fix-hook-variables.js.map +1 -1
- package/dist/cli/simple-commands/github.d.ts.map +1 -1
- package/dist/cli/simple-commands/github.js +15 -15
- package/dist/cli/simple-commands/github.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js +12 -10
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/communication.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/communication.js +42 -45
- package/dist/cli/simple-commands/hive-mind/communication.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/core.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/core.js +97 -89
- package/dist/cli/simple-commands/hive-mind/core.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js +114 -59
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +182 -103
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/memory.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/memory.js +105 -75
- package/dist/cli/simple-commands/hive-mind/memory.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js +45 -43
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/queen.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/queen.js +101 -88
- package/dist/cli/simple-commands/hive-mind/queen.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/session-manager.js +75 -53
- package/dist/cli/simple-commands/hive-mind/session-manager.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind-optimize.js +18 -18
- package/dist/cli/simple-commands/hive-mind-optimize.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind.js +207 -144
- package/dist/cli/simple-commands/hive-mind.js.map +1 -1
- package/dist/cli/simple-commands/hook-safety.d.ts.map +1 -1
- package/dist/cli/simple-commands/hook-safety.js +19 -19
- package/dist/cli/simple-commands/hook-safety.js.map +1 -1
- package/dist/cli/simple-commands/hooks.d.ts.map +1 -1
- package/dist/cli/simple-commands/hooks.js +85 -71
- package/dist/cli/simple-commands/hooks.js.map +1 -1
- package/dist/cli/simple-commands/init/batch-init.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/batch-init.js +62 -55
- package/dist/cli/simple-commands/init/batch-init.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +2 -2
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +58 -50
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js +34 -28
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/executable-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/executable-wrapper.js +7 -4
- package/dist/cli/simple-commands/init/executable-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/init/gitignore-updater.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/gitignore-updater.js +10 -9
- package/dist/cli/simple-commands/init/gitignore-updater.js.map +1 -1
- package/dist/cli/simple-commands/init/help.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/help.js.map +1 -1
- package/dist/cli/simple-commands/init/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/index.js +159 -103
- package/dist/cli/simple-commands/init/index.js.map +1 -1
- package/dist/cli/simple-commands/init/performance-monitor.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/performance-monitor.js +17 -18
- package/dist/cli/simple-commands/init/performance-monitor.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/backup-manager.js +19 -25
- package/dist/cli/simple-commands/init/rollback/backup-manager.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/index.js +18 -15
- package/dist/cli/simple-commands/init/rollback/index.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js +49 -68
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js +16 -24
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/state-tracker.js +25 -25
- package/dist/cli/simple-commands/init/rollback/state-tracker.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js +57 -57
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc/workflows.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc/workflows.js +21 -21
- package/dist/cli/simple-commands/init/sparc/workflows.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.js +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.js.map +1 -1
- package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js +69 -78
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js.map +1 -1
- package/dist/cli/simple-commands/init/templates/sparc-modes.js +2 -2
- package/dist/cli/simple-commands/init/validation/config-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/config-validator.js +12 -16
- package/dist/cli/simple-commands/init/validation/config-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/health-checker.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/health-checker.js +39 -41
- package/dist/cli/simple-commands/init/validation/health-checker.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/index.js +8 -8
- package/dist/cli/simple-commands/init/validation/index.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/mode-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/mode-validator.js +12 -12
- package/dist/cli/simple-commands/init/validation/mode-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/post-init-validator.js +13 -13
- package/dist/cli/simple-commands/init/validation/post-init-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js +19 -24
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js.map +1 -1
- package/dist/cli/simple-commands/mcp.js +2 -2
- package/dist/cli/simple-commands/mcp.js.map +1 -1
- package/dist/cli/simple-commands/memory.js +4 -4
- package/dist/cli/simple-commands/memory.js.map +1 -1
- package/dist/cli/simple-commands/migrate-hooks.d.ts.map +1 -1
- package/dist/cli/simple-commands/migrate-hooks.js +3 -3
- package/dist/cli/simple-commands/migrate-hooks.js.map +1 -1
- package/dist/cli/simple-commands/monitor.d.ts.map +1 -1
- package/dist/cli/simple-commands/monitor.js +34 -26
- package/dist/cli/simple-commands/monitor.js.map +1 -1
- package/dist/cli/simple-commands/process-ui-enhanced.d.ts.map +1 -1
- package/dist/cli/simple-commands/process-ui-enhanced.js +53 -39
- package/dist/cli/simple-commands/process-ui-enhanced.js.map +1 -1
- package/dist/cli/simple-commands/sparc-modes/index.js +11 -11
- package/dist/cli/simple-commands/sparc-modes/index.js.map +1 -1
- package/dist/cli/simple-commands/sparc-modes/swarm.js +50 -50
- package/dist/cli/simple-commands/sparc.d.ts.map +1 -1
- package/dist/cli/simple-commands/sparc.js +21 -11
- package/dist/cli/simple-commands/sparc.js.map +1 -1
- package/dist/cli/simple-commands/start-ui.d.ts.map +1 -1
- package/dist/cli/simple-commands/start-ui.js +5 -3
- package/dist/cli/simple-commands/start-ui.js.map +1 -1
- package/dist/cli/simple-commands/start-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/start-wrapper.js +1 -1
- package/dist/cli/simple-commands/start-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/status.js +14 -14
- package/dist/cli/simple-commands/status.js.map +1 -1
- package/dist/cli/simple-commands/swarm-executor.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-executor.js +19 -19
- package/dist/cli/simple-commands/swarm-executor.js.map +1 -1
- package/dist/cli/simple-commands/swarm-metrics-integration.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-metrics-integration.js +30 -21
- package/dist/cli/simple-commands/swarm-metrics-integration.js.map +1 -1
- package/dist/cli/simple-commands/swarm-webui-integration.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-webui-integration.js +30 -18
- package/dist/cli/simple-commands/swarm-webui-integration.js.map +1 -1
- package/dist/cli/simple-commands/swarm.d.ts +1 -1
- package/dist/cli/simple-commands/swarm.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm.js +81 -76
- package/dist/cli/simple-commands/swarm.js.map +1 -1
- package/dist/cli/simple-commands/training.d.ts.map +1 -1
- package/dist/cli/simple-commands/training.js +7 -7
- package/dist/cli/simple-commands/training.js.map +1 -1
- package/dist/cli/simple-commands/web-server.d.ts.map +1 -1
- package/dist/cli/simple-commands/web-server.js +68 -66
- package/dist/cli/simple-commands/web-server.js.map +1 -1
- package/dist/cli/simple-mcp.d.ts.map +1 -1
- package/dist/cli/simple-mcp.js +2 -4
- package/dist/cli/simple-mcp.js.map +1 -1
- package/dist/cli/simple-orchestrator.d.ts +3 -0
- package/dist/cli/simple-orchestrator.d.ts.map +1 -1
- package/dist/cli/simple-orchestrator.js +36 -35
- package/dist/cli/simple-orchestrator.js.map +1 -1
- package/dist/cli/ui/compatible-ui.d.ts +4 -0
- package/dist/cli/ui/compatible-ui.d.ts.map +1 -1
- package/dist/cli/ui/compatible-ui.js +9 -8
- package/dist/cli/ui/compatible-ui.js.map +1 -1
- package/dist/cli/ui/fallback-handler.d.ts.map +1 -1
- package/dist/cli/ui/fallback-handler.js +4 -4
- package/dist/cli/ui/fallback-handler.js.map +1 -1
- package/dist/cli/ui/index.d.ts +2 -2
- package/dist/cli/ui/index.d.ts.map +1 -1
- package/dist/cli/ui/index.js +3 -3
- package/dist/cli/ui/index.js.map +1 -1
- package/dist/cli/utils/environment-detector.d.ts.map +1 -1
- package/dist/cli/utils/environment-detector.js +13 -11
- package/dist/cli/utils/environment-detector.js.map +1 -1
- package/dist/cli/utils/interactive-detector.d.ts.map +1 -1
- package/dist/cli/utils/interactive-detector.js +1 -1
- package/dist/cli/utils/interactive-detector.js.map +1 -1
- package/dist/cli/utils/prompt-defaults.d.ts.map +1 -1
- package/dist/cli/utils/prompt-defaults.js +6 -7
- package/dist/cli/utils/prompt-defaults.js.map +1 -1
- package/dist/cli/utils/safe-interactive.d.ts.map +1 -1
- package/dist/cli/utils/safe-interactive.js +7 -6
- package/dist/cli/utils/safe-interactive.js.map +1 -1
- package/dist/cli/utils.d.ts.map +1 -1
- package/dist/cli/utils.js +58 -50
- package/dist/cli/utils.js.map +1 -1
- package/dist/cli/validation-helper.d.ts +27 -0
- package/dist/cli/validation-helper.d.ts.map +1 -0
- package/dist/cli/validation-helper.js +72 -0
- package/dist/cli/validation-helper.js.map +1 -0
- package/dist/communication/message-bus.d.ts.map +1 -1
- package/dist/communication/message-bus.js +80 -74
- package/dist/communication/message-bus.js.map +1 -1
- package/dist/config/config-manager.d.ts +3 -0
- package/dist/config/config-manager.d.ts.map +1 -1
- package/dist/config/config-manager.js +23 -6
- package/dist/config/config-manager.js.map +1 -1
- package/dist/config/ruv-swarm-config.d.ts +6 -0
- package/dist/config/ruv-swarm-config.d.ts.map +1 -1
- package/dist/config/ruv-swarm-config.js +37 -22
- package/dist/config/ruv-swarm-config.js.map +1 -1
- package/dist/config/ruv-swarm-integration.d.ts.map +1 -1
- package/dist/config/ruv-swarm-integration.js +21 -21
- package/dist/config/ruv-swarm-integration.js.map +1 -1
- package/dist/constants/agent-types.d.ts +4 -4
- package/dist/constants/agent-types.d.ts.map +1 -1
- package/dist/constants/agent-types.js +4 -4
- package/dist/constants/agent-types.js.map +1 -1
- package/dist/coordination/advanced-scheduler.d.ts.map +1 -1
- package/dist/coordination/advanced-scheduler.js +6 -10
- package/dist/coordination/advanced-scheduler.js.map +1 -1
- package/dist/coordination/advanced-task-executor.d.ts.map +1 -1
- package/dist/coordination/advanced-task-executor.js +33 -33
- package/dist/coordination/advanced-task-executor.js.map +1 -1
- package/dist/coordination/background-executor.d.ts.map +1 -1
- package/dist/coordination/background-executor.js +17 -16
- package/dist/coordination/background-executor.js.map +1 -1
- package/dist/coordination/circuit-breaker.d.ts.map +1 -1
- package/dist/coordination/circuit-breaker.js +3 -0
- package/dist/coordination/circuit-breaker.js.map +1 -1
- package/dist/coordination/conflict-resolution.d.ts.map +1 -1
- package/dist/coordination/conflict-resolution.js +10 -8
- package/dist/coordination/conflict-resolution.js.map +1 -1
- package/dist/coordination/dependency-graph.d.ts.map +1 -1
- package/dist/coordination/dependency-graph.js +4 -3
- package/dist/coordination/dependency-graph.js.map +1 -1
- package/dist/coordination/hive-orchestrator.d.ts.map +1 -1
- package/dist/coordination/hive-orchestrator.js +29 -25
- package/dist/coordination/hive-orchestrator.js.map +1 -1
- package/dist/coordination/hive-protocol.d.ts.map +1 -1
- package/dist/coordination/hive-protocol.js +22 -23
- package/dist/coordination/hive-protocol.js.map +1 -1
- package/dist/coordination/index.d.ts +1 -1
- package/dist/coordination/index.d.ts.map +1 -1
- package/dist/coordination/index.js +1 -1
- package/dist/coordination/index.js.map +1 -1
- package/dist/coordination/load-balancer.d.ts.map +1 -1
- package/dist/coordination/load-balancer.js +55 -56
- package/dist/coordination/load-balancer.js.map +1 -1
- package/dist/coordination/manager.d.ts.map +1 -1
- package/dist/coordination/manager.js +2 -8
- package/dist/coordination/manager.js.map +1 -1
- package/dist/coordination/messaging.d.ts.map +1 -1
- package/dist/coordination/messaging.js +4 -4
- package/dist/coordination/messaging.js.map +1 -1
- package/dist/coordination/metrics.d.ts.map +1 -1
- package/dist/coordination/metrics.js +11 -9
- package/dist/coordination/metrics.js.map +1 -1
- package/dist/coordination/resources.d.ts.map +1 -1
- package/dist/coordination/resources.js +10 -6
- package/dist/coordination/resources.js.map +1 -1
- package/dist/coordination/scheduler.d.ts.map +1 -1
- package/dist/coordination/scheduler.js +4 -4
- package/dist/coordination/scheduler.js.map +1 -1
- package/dist/coordination/swarm-coordinator.d.ts.map +1 -1
- package/dist/coordination/swarm-coordinator.js +32 -34
- package/dist/coordination/swarm-coordinator.js.map +1 -1
- package/dist/coordination/swarm-monitor.d.ts.map +1 -1
- package/dist/coordination/swarm-monitor.js +17 -17
- package/dist/coordination/swarm-monitor.js.map +1 -1
- package/dist/coordination/work-stealing.d.ts.map +1 -1
- package/dist/coordination/work-stealing.js +3 -0
- package/dist/coordination/work-stealing.js.map +1 -1
- package/dist/core/config.d.ts +4 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +28 -31
- package/dist/core/config.js.map +1 -1
- package/dist/core/event-bus.d.ts +3 -0
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/json-persistence.d.ts +3 -0
- package/dist/core/json-persistence.d.ts.map +1 -1
- package/dist/core/json-persistence.js +19 -23
- package/dist/core/json-persistence.js.map +1 -1
- package/dist/core/logger.d.ts +3 -0
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +2 -6
- package/dist/core/logger.js.map +1 -1
- package/dist/core/orchestrator-fixed.d.ts.map +1 -1
- package/dist/core/orchestrator-fixed.js +4 -1
- package/dist/core/orchestrator-fixed.js.map +1 -1
- package/dist/core/orchestrator.d.ts.map +1 -1
- package/dist/core/orchestrator.js +66 -33
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/core/persistence.d.ts +3 -0
- package/dist/core/persistence.d.ts.map +1 -1
- package/dist/core/persistence.js +25 -19
- package/dist/core/persistence.js.map +1 -1
- package/dist/enterprise/analytics-manager.d.ts.map +1 -1
- package/dist/enterprise/analytics-manager.js +141 -134
- package/dist/enterprise/analytics-manager.js.map +1 -1
- package/dist/enterprise/audit-manager.d.ts.map +1 -1
- package/dist/enterprise/audit-manager.js +144 -122
- package/dist/enterprise/audit-manager.js.map +1 -1
- package/dist/enterprise/cloud-manager.d.ts.map +1 -1
- package/dist/enterprise/cloud-manager.js +104 -99
- package/dist/enterprise/cloud-manager.js.map +1 -1
- package/dist/enterprise/deployment-manager.d.ts.map +1 -1
- package/dist/enterprise/deployment-manager.js +104 -97
- package/dist/enterprise/deployment-manager.js.map +1 -1
- package/dist/enterprise/index.d.ts +6 -6
- package/dist/enterprise/index.d.ts.map +1 -1
- package/dist/enterprise/project-manager.d.ts.map +1 -1
- package/dist/enterprise/project-manager.js +74 -66
- package/dist/enterprise/project-manager.js.map +1 -1
- package/dist/enterprise/security-manager.d.ts.map +1 -1
- package/dist/enterprise/security-manager.js +137 -129
- package/dist/enterprise/security-manager.js.map +1 -1
- package/dist/hive-mind/core/Agent.d.ts.map +1 -1
- package/dist/hive-mind/core/Agent.js +36 -36
- package/dist/hive-mind/core/Agent.js.map +1 -1
- package/dist/hive-mind/core/Communication.d.ts.map +1 -1
- package/dist/hive-mind/core/Communication.js +17 -17
- package/dist/hive-mind/core/Communication.js.map +1 -1
- package/dist/hive-mind/core/DatabaseManager.d.ts.map +1 -1
- package/dist/hive-mind/core/DatabaseManager.js +104 -58
- package/dist/hive-mind/core/DatabaseManager.js.map +1 -1
- package/dist/hive-mind/core/HiveMind.d.ts.map +1 -1
- package/dist/hive-mind/core/HiveMind.js +35 -35
- package/dist/hive-mind/core/HiveMind.js.map +1 -1
- package/dist/hive-mind/core/Memory.d.ts.map +1 -1
- package/dist/hive-mind/core/Memory.js +78 -71
- package/dist/hive-mind/core/Memory.js.map +1 -1
- package/dist/hive-mind/core/MemoryMonitor.d.ts.map +1 -1
- package/dist/hive-mind/core/MemoryMonitor.js +38 -38
- package/dist/hive-mind/core/MemoryMonitor.js.map +1 -1
- package/dist/hive-mind/core/Queen.d.ts.map +1 -1
- package/dist/hive-mind/core/Queen.js +110 -47
- package/dist/hive-mind/core/Queen.js.map +1 -1
- package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +1 -1
- package/dist/hive-mind/integration/ConsensusEngine.js +25 -23
- package/dist/hive-mind/integration/ConsensusEngine.js.map +1 -1
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +1 -1
- package/dist/hive-mind/integration/MCPToolWrapper.js.map +1 -1
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +1 -1
- package/dist/hive-mind/integration/SwarmOrchestrator.js +60 -58
- package/dist/hive-mind/integration/SwarmOrchestrator.js.map +1 -1
- package/dist/hive-mind/types.d.ts.map +1 -1
- package/dist/integration/mock-components.d.ts.map +1 -1
- package/dist/integration/mock-components.js +21 -21
- package/dist/integration/mock-components.js.map +1 -1
- package/dist/integration/system-integration.d.ts.map +1 -1
- package/dist/integration/system-integration.js +29 -12
- package/dist/integration/system-integration.js.map +1 -1
- package/dist/mcp/auth.d.ts +1 -1
- package/dist/mcp/auth.d.ts.map +1 -1
- package/dist/mcp/auth.js +8 -1
- package/dist/mcp/auth.js.map +1 -1
- package/dist/mcp/claude-code-wrapper.d.ts.map +1 -1
- package/dist/mcp/claude-code-wrapper.js +169 -68
- package/dist/mcp/claude-code-wrapper.js.map +1 -1
- package/dist/mcp/claude-flow-tools.d.ts.map +1 -1
- package/dist/mcp/claude-flow-tools.js +42 -3
- package/dist/mcp/claude-flow-tools.js.map +1 -1
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/index.d.ts +6 -6
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +9 -9
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/integrate-wrapper.d.ts.map +1 -1
- package/dist/mcp/integrate-wrapper.js +5 -7
- package/dist/mcp/integrate-wrapper.js.map +1 -1
- package/dist/mcp/lifecycle-manager.d.ts.map +1 -1
- package/dist/mcp/lifecycle-manager.js +8 -7
- package/dist/mcp/lifecycle-manager.js.map +1 -1
- package/dist/mcp/load-balancer.d.ts.map +1 -1
- package/dist/mcp/load-balancer.js +5 -1
- package/dist/mcp/load-balancer.js.map +1 -1
- package/dist/mcp/orchestration-integration.d.ts.map +1 -1
- package/dist/mcp/orchestration-integration.js +22 -9
- package/dist/mcp/orchestration-integration.js.map +1 -1
- package/dist/mcp/performance-monitor.d.ts.map +1 -1
- package/dist/mcp/performance-monitor.js +22 -19
- package/dist/mcp/performance-monitor.js.map +1 -1
- package/dist/mcp/protocol-manager.d.ts.map +1 -1
- package/dist/mcp/protocol-manager.js +8 -19
- package/dist/mcp/protocol-manager.js.map +1 -1
- package/dist/mcp/recovery/connection-health-monitor.d.ts.map +1 -1
- package/dist/mcp/recovery/connection-health-monitor.js +5 -5
- package/dist/mcp/recovery/connection-health-monitor.js.map +1 -1
- package/dist/mcp/recovery/connection-state-manager.d.ts +4 -0
- package/dist/mcp/recovery/connection-state-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/connection-state-manager.js +13 -13
- package/dist/mcp/recovery/connection-state-manager.js.map +1 -1
- package/dist/mcp/recovery/fallback-coordinator.d.ts.map +1 -1
- package/dist/mcp/recovery/fallback-coordinator.js +5 -5
- package/dist/mcp/recovery/fallback-coordinator.js.map +1 -1
- package/dist/mcp/recovery/index.d.ts +4 -4
- package/dist/mcp/recovery/index.d.ts.map +1 -1
- package/dist/mcp/recovery/index.js +4 -4
- package/dist/mcp/recovery/index.js.map +1 -1
- package/dist/mcp/recovery/reconnection-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/reconnection-manager.js +1 -1
- package/dist/mcp/recovery/reconnection-manager.js.map +1 -1
- package/dist/mcp/recovery/recovery-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/recovery-manager.js +2 -4
- package/dist/mcp/recovery/recovery-manager.js.map +1 -1
- package/dist/mcp/router.d.ts.map +1 -1
- package/dist/mcp/router.js +3 -0
- package/dist/mcp/router.js.map +1 -1
- package/dist/mcp/ruv-swarm-tools.d.ts.map +1 -1
- package/dist/mcp/ruv-swarm-tools.js +132 -102
- package/dist/mcp/ruv-swarm-tools.js.map +1 -1
- package/dist/mcp/server-with-wrapper.d.ts +3 -0
- package/dist/mcp/server-with-wrapper.d.ts.map +1 -1
- package/dist/mcp/server-with-wrapper.js +2 -3
- package/dist/mcp/server-with-wrapper.js.map +1 -1
- package/dist/mcp/server-wrapper-mode.d.ts +5 -0
- package/dist/mcp/server-wrapper-mode.d.ts.map +1 -1
- package/dist/mcp/server-wrapper-mode.js +2 -3
- package/dist/mcp/server-wrapper-mode.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +12 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session-manager.d.ts.map +1 -1
- package/dist/mcp/session-manager.js +4 -3
- package/dist/mcp/session-manager.js.map +1 -1
- package/dist/mcp/sparc-modes.d.ts.map +1 -1
- package/dist/mcp/sparc-modes.js +15 -15
- package/dist/mcp/sparc-modes.js.map +1 -1
- package/dist/mcp/swarm-tools.d.ts.map +1 -1
- package/dist/mcp/swarm-tools.js +100 -80
- package/dist/mcp/swarm-tools.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +28 -12
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/transports/base.d.ts.map +1 -1
- package/dist/mcp/transports/base.js +3 -0
- package/dist/mcp/transports/base.js.map +1 -1
- package/dist/mcp/transports/http.d.ts +3 -0
- package/dist/mcp/transports/http.d.ts.map +1 -1
- package/dist/mcp/transports/http.js +3 -3
- package/dist/mcp/transports/http.js.map +1 -1
- package/dist/mcp/transports/stdio.d.ts +3 -0
- package/dist/mcp/transports/stdio.d.ts.map +1 -1
- package/dist/mcp/transports/stdio.js +3 -0
- package/dist/mcp/transports/stdio.js.map +1 -1
- package/dist/memory/advanced-memory-manager.d.ts.map +1 -1
- package/dist/memory/advanced-memory-manager.js +109 -100
- package/dist/memory/advanced-memory-manager.js.map +1 -1
- package/dist/memory/backends/base.d.ts.map +1 -1
- package/dist/memory/backends/base.js +3 -0
- package/dist/memory/backends/base.js.map +1 -1
- package/dist/memory/backends/markdown.d.ts +3 -0
- package/dist/memory/backends/markdown.d.ts.map +1 -1
- package/dist/memory/backends/markdown.js +8 -8
- package/dist/memory/backends/markdown.js.map +1 -1
- package/dist/memory/backends/sqlite.d.ts +3 -0
- package/dist/memory/backends/sqlite.d.ts.map +1 -1
- package/dist/memory/backends/sqlite.js +6 -2
- package/dist/memory/backends/sqlite.js.map +1 -1
- package/dist/memory/cache.d.ts.map +1 -1
- package/dist/memory/cache.js +5 -3
- package/dist/memory/cache.js.map +1 -1
- package/dist/memory/distributed-memory.d.ts.map +1 -1
- package/dist/memory/distributed-memory.js +27 -28
- package/dist/memory/distributed-memory.js.map +1 -1
- package/dist/memory/fallback-store.d.ts.map +1 -1
- package/dist/memory/fallback-store.js.map +1 -1
- package/dist/memory/in-memory-store.d.ts.map +1 -1
- package/dist/memory/in-memory-store.js +8 -8
- package/dist/memory/in-memory-store.js.map +1 -1
- package/dist/memory/indexer.d.ts.map +1 -1
- package/dist/memory/indexer.js +4 -1
- package/dist/memory/indexer.js.map +1 -1
- package/dist/memory/manager.d.ts.map +1 -1
- package/dist/memory/manager.js +17 -20
- package/dist/memory/manager.js.map +1 -1
- package/dist/memory/sqlite-store.js +12 -8
- package/dist/memory/sqlite-store.js.map +1 -1
- package/dist/memory/swarm-memory.d.ts.map +1 -1
- package/dist/memory/swarm-memory.js +37 -44
- package/dist/memory/swarm-memory.js.map +1 -1
- package/dist/migration/index.d.ts +4 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +8 -8
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/logger.d.ts.map +1 -1
- package/dist/migration/logger.js +5 -5
- package/dist/migration/logger.js.map +1 -1
- package/dist/migration/migration-analyzer.d.ts +3 -0
- package/dist/migration/migration-analyzer.d.ts.map +1 -1
- package/dist/migration/migration-analyzer.js +25 -20
- package/dist/migration/migration-analyzer.js.map +1 -1
- package/dist/migration/migration-runner.d.ts.map +1 -1
- package/dist/migration/migration-runner.js +35 -29
- package/dist/migration/migration-runner.js.map +1 -1
- package/dist/migration/migration-validator.d.ts +3 -0
- package/dist/migration/migration-validator.d.ts.map +1 -1
- package/dist/migration/migration-validator.js +22 -26
- package/dist/migration/migration-validator.js.map +1 -1
- package/dist/migration/progress-reporter.d.ts +3 -0
- package/dist/migration/progress-reporter.d.ts.map +1 -1
- package/dist/migration/progress-reporter.js +8 -8
- package/dist/migration/progress-reporter.js.map +1 -1
- package/dist/migration/rollback-manager.d.ts +3 -0
- package/dist/migration/rollback-manager.d.ts.map +1 -1
- package/dist/migration/rollback-manager.js +29 -26
- package/dist/migration/rollback-manager.js.map +1 -1
- package/dist/monitoring/diagnostics.d.ts.map +1 -1
- package/dist/monitoring/diagnostics.js +49 -37
- package/dist/monitoring/diagnostics.js.map +1 -1
- package/dist/monitoring/health-check.d.ts.map +1 -1
- package/dist/monitoring/health-check.js +24 -25
- package/dist/monitoring/health-check.js.map +1 -1
- package/dist/monitoring/real-time-monitor.d.ts.map +1 -1
- package/dist/monitoring/real-time-monitor.js +71 -58
- package/dist/monitoring/real-time-monitor.js.map +1 -1
- package/dist/resources/resource-manager.d.ts.map +1 -1
- package/dist/resources/resource-manager.js +96 -83
- package/dist/resources/resource-manager.js.map +1 -1
- package/dist/swarm/claude-flow-executor.d.ts.map +1 -1
- package/dist/swarm/claude-flow-executor.js +37 -31
- package/dist/swarm/claude-flow-executor.js.map +1 -1
- package/dist/swarm/coordinator.d.ts.map +1 -1
- package/dist/swarm/coordinator.js +330 -280
- package/dist/swarm/coordinator.js.map +1 -1
- package/dist/swarm/direct-executor.d.ts.map +1 -1
- package/dist/swarm/direct-executor.js +44 -37
- package/dist/swarm/direct-executor.js.map +1 -1
- package/dist/swarm/executor-v2.d.ts.map +1 -1
- package/dist/swarm/executor-v2.js +28 -27
- package/dist/swarm/executor-v2.js.map +1 -1
- package/dist/swarm/executor.d.ts +3 -0
- package/dist/swarm/executor.d.ts.map +1 -1
- package/dist/swarm/executor.js +58 -52
- package/dist/swarm/executor.js.map +1 -1
- package/dist/swarm/index.d.ts.map +1 -1
- package/dist/swarm/index.js +2 -2
- package/dist/swarm/index.js.map +1 -1
- package/dist/swarm/json-output-aggregator.d.ts.map +1 -1
- package/dist/swarm/json-output-aggregator.js +20 -19
- package/dist/swarm/json-output-aggregator.js.map +1 -1
- package/dist/swarm/memory.d.ts.map +1 -1
- package/dist/swarm/memory.js +67 -67
- package/dist/swarm/memory.js.map +1 -1
- package/dist/swarm/optimizations/async-file-manager.d.ts +4 -0
- package/dist/swarm/optimizations/async-file-manager.d.ts.map +1 -1
- package/dist/swarm/optimizations/async-file-manager.js +19 -23
- package/dist/swarm/optimizations/async-file-manager.js.map +1 -1
- package/dist/swarm/optimizations/circular-buffer.d.ts.map +1 -1
- package/dist/swarm/optimizations/circular-buffer.js +2 -4
- package/dist/swarm/optimizations/circular-buffer.js.map +1 -1
- package/dist/swarm/optimizations/connection-pool.d.ts.map +1 -1
- package/dist/swarm/optimizations/connection-pool.js +12 -13
- package/dist/swarm/optimizations/connection-pool.js.map +1 -1
- package/dist/swarm/optimizations/index.js +2 -2
- package/dist/swarm/optimizations/optimized-executor.d.ts.map +1 -1
- package/dist/swarm/optimizations/optimized-executor.js +23 -29
- package/dist/swarm/optimizations/optimized-executor.js.map +1 -1
- package/dist/swarm/optimizations/ttl-map.d.ts.map +1 -1
- package/dist/swarm/optimizations/ttl-map.js +4 -4
- package/dist/swarm/optimizations/ttl-map.js.map +1 -1
- package/dist/swarm/prompt-cli.d.ts.map +1 -1
- package/dist/swarm/prompt-cli.js +18 -13
- package/dist/swarm/prompt-cli.js.map +1 -1
- package/dist/swarm/prompt-copier-enhanced.d.ts.map +1 -1
- package/dist/swarm/prompt-copier-enhanced.js +12 -12
- package/dist/swarm/prompt-copier-enhanced.js.map +1 -1
- package/dist/swarm/prompt-copier.d.ts.map +1 -1
- package/dist/swarm/prompt-copier.js +15 -18
- package/dist/swarm/prompt-copier.js.map +1 -1
- package/dist/swarm/prompt-manager.d.ts.map +1 -1
- package/dist/swarm/prompt-manager.js +27 -21
- package/dist/swarm/prompt-manager.js.map +1 -1
- package/dist/swarm/prompt-utils.d.ts.map +1 -1
- package/dist/swarm/prompt-utils.js +34 -32
- package/dist/swarm/prompt-utils.js.map +1 -1
- package/dist/swarm/sparc-executor.d.ts.map +1 -1
- package/dist/swarm/sparc-executor.js +189 -123
- package/dist/swarm/sparc-executor.js.map +1 -1
- package/dist/swarm/strategies/auto.d.ts.map +1 -1
- package/dist/swarm/strategies/auto.js +105 -86
- package/dist/swarm/strategies/auto.js.map +1 -1
- package/dist/swarm/strategies/base.d.ts.map +1 -1
- package/dist/swarm/strategies/base.js +14 -11
- package/dist/swarm/strategies/base.js.map +1 -1
- package/dist/swarm/strategies/research.d.ts.map +1 -1
- package/dist/swarm/strategies/research.js +76 -71
- package/dist/swarm/strategies/research.js.map +1 -1
- package/dist/swarm/types.d.ts.map +1 -1
- package/dist/swarm/types.js +3 -0
- package/dist/swarm/types.js.map +1 -1
- package/dist/swarm/workers/copy-worker.js +4 -4
- package/dist/swarm/workers/copy-worker.js.map +1 -1
- package/dist/task/commands.d.ts.map +1 -1
- package/dist/task/commands.js +11 -7
- package/dist/task/commands.js.map +1 -1
- package/dist/task/coordination.d.ts.map +1 -1
- package/dist/task/coordination.js +75 -70
- package/dist/task/coordination.js.map +1 -1
- package/dist/task/engine.d.ts.map +1 -1
- package/dist/task/engine.js +34 -32
- package/dist/task/engine.js.map +1 -1
- package/dist/task/index.d.ts +3 -3
- package/dist/task/index.d.ts.map +1 -1
- package/dist/task/index.js +11 -11
- package/dist/task/index.js.map +1 -1
- package/dist/terminal/adapters/native.d.ts.map +1 -1
- package/dist/terminal/adapters/native.js +6 -6
- package/dist/terminal/adapters/native.js.map +1 -1
- package/dist/terminal/adapters/vscode.d.ts +3 -0
- package/dist/terminal/adapters/vscode.d.ts.map +1 -1
- package/dist/terminal/adapters/vscode.js +6 -4
- package/dist/terminal/adapters/vscode.js.map +1 -1
- package/dist/terminal/manager.d.ts.map +1 -1
- package/dist/terminal/manager.js +6 -8
- package/dist/terminal/manager.js.map +1 -1
- package/dist/terminal/pool.d.ts.map +1 -1
- package/dist/terminal/pool.js +3 -0
- package/dist/terminal/pool.js.map +1 -1
- package/dist/terminal/session.d.ts.map +1 -1
- package/dist/terminal/session.js +6 -2
- package/dist/terminal/session.js.map +1 -1
- package/dist/ui/hive-dashboard.d.ts.map +1 -1
- package/dist/ui/hive-dashboard.js +52 -33
- package/dist/ui/hive-dashboard.js.map +1 -1
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js +1 -1
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/helpers.d.ts +3 -0
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/helpers.js +5 -8
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/npx-isolated-cache.js +3 -3
- package/dist/utils/npx-isolated-cache.js.map +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +8 -4
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/type-guards.d.ts +1 -1
- package/dist/utils/type-guards.d.ts.map +1 -1
- package/dist/utils/type-guards.js +11 -10
- package/dist/utils/type-guards.js.map +1 -1
- package/package.json +7 -6
- package/src/adapters/cliffy-node.ts +27 -22
- package/src/agents/agent-manager.ts +145 -121
- package/src/agents/agent-registry.ts +77 -70
- package/src/api/claude-client.ts +59 -38
- package/src/api/routes/analysis.js +750 -735
- package/src/cli/__tests__/command-registry.test.js +42 -32
- package/src/cli/__tests__/simple-cli.test.js +42 -37
- package/src/cli/__tests__/utils.test.js +9 -9
- package/src/cli/agents/README.md +30 -4
- package/src/cli/agents/analyst.ts +161 -163
- package/src/cli/agents/architect.ts +126 -131
- package/src/cli/agents/base-agent.ts +48 -47
- package/src/cli/agents/capabilities.ts +87 -85
- package/src/cli/agents/coder.ts +127 -120
- package/src/cli/agents/coordinator.ts +72 -72
- package/src/cli/agents/hive-agents.ts +96 -70
- package/src/cli/agents/index.ts +70 -55
- package/src/cli/agents/researcher.ts +63 -74
- package/src/cli/agents/tester.ts +91 -98
- package/src/cli/cli-core.ts +56 -47
- package/src/cli/command-registry.js +125 -83
- package/src/cli/commands/advanced-memory-commands.ts +210 -142
- package/src/cli/commands/agent-simple.ts +146 -114
- package/src/cli/commands/agent.ts +119 -95
- package/src/cli/commands/claude-api.ts +19 -15
- package/src/cli/commands/claude.ts +96 -88
- package/src/cli/commands/config-integration.ts +120 -101
- package/src/cli/commands/config.ts +10 -8
- package/src/cli/commands/enterprise.ts +323 -187
- package/src/cli/commands/help-new.ts +246 -0
- package/src/cli/commands/help.ts +326 -183
- package/src/cli/commands/hive-mind/index.ts +3 -3
- package/src/cli/commands/hive-mind/init.ts +19 -12
- package/src/cli/commands/hive-mind/optimize-memory.ts +83 -53
- package/src/cli/commands/hive-mind/pause.ts +27 -25
- package/src/cli/commands/hive-mind/ps.ts +43 -37
- package/src/cli/commands/hive-mind/resume.ts +26 -26
- package/src/cli/commands/hive-mind/spawn.ts +37 -29
- package/src/cli/commands/hive-mind/status.ts +51 -51
- package/src/cli/commands/hive-mind/stop.ts +56 -51
- package/src/cli/commands/hive-mind/task.ts +65 -54
- package/src/cli/commands/hive-mind/wizard.ts +181 -167
- package/src/cli/commands/hive.ts +136 -96
- package/src/cli/commands/hook-types.ts +2 -2
- package/src/cli/commands/hook-validator.ts +8 -4
- package/src/cli/commands/hook.ts +44 -42
- package/src/cli/commands/index.ts +1162 -1031
- package/src/cli/commands/mcp.ts +105 -94
- package/src/cli/commands/memory.ts +24 -21
- package/src/cli/commands/migrate.ts +24 -24
- package/src/cli/commands/monitor.ts +123 -93
- package/src/cli/commands/ruv-swarm.ts +131 -122
- package/src/cli/commands/session.ts +60 -45
- package/src/cli/commands/sparc.ts +170 -139
- package/src/cli/commands/start/event-emitter.ts +2 -2
- package/src/cli/commands/start/index.ts +1 -1
- package/src/cli/commands/start/process-manager.ts +30 -47
- package/src/cli/commands/start/process-ui-simple.ts +60 -49
- package/src/cli/commands/start/process-ui.ts +1 -1
- package/src/cli/commands/start/start-command.ts +104 -75
- package/src/cli/commands/start/system-monitor.ts +35 -41
- package/src/cli/commands/start/types.ts +3 -3
- package/src/cli/commands/start.ts +1 -1
- package/src/cli/commands/status.ts +67 -67
- package/src/cli/commands/swarm-spawn.ts +21 -12
- package/src/cli/commands/swarm.ts +221 -150
- package/src/cli/commands/task.ts +55 -55
- package/src/cli/commands/workflow.ts +174 -157
- package/src/cli/completion.ts +34 -19
- package/src/cli/create-enhanced-task.js +49 -17
- package/src/cli/formatter.ts +38 -37
- package/src/cli/help-formatter.js +145 -0
- package/src/cli/help-formatter.ts +173 -0
- package/src/cli/help-text.js +273 -6
- package/src/cli/index-remote.ts +12 -9
- package/src/cli/index.ts +77 -67
- package/src/cli/init/batch-tools.ts +4 -5
- package/src/cli/init/claude-config.ts +125 -118
- package/src/cli/init/directory-structure.ts +10 -11
- package/src/cli/init/index.ts +13 -13
- package/src/cli/init/sparc-environment.ts +90 -74
- package/src/cli/init/swarm-commands.ts +5 -6
- package/src/cli/init/utils.ts +1 -1
- package/src/cli/main.ts +9 -10
- package/src/cli/node-compat.js +26 -19
- package/src/cli/node-repl.ts +104 -87
- package/src/cli/repl.ts +190 -158
- package/src/cli/runtime-detector.js +24 -19
- package/src/cli/simple-cli.js +479 -394
- package/src/cli/simple-cli.ts +426 -366
- package/src/cli/simple-commands/__tests__/agent.test.js +49 -55
- package/src/cli/simple-commands/__tests__/memory.test.js +4 -401
- package/src/cli/simple-commands/__tests__/swarm.test.js +49 -55
- package/src/cli/simple-commands/__tests__/task.test.js +4 -478
- package/src/cli/simple-commands/agent.js +27 -27
- package/src/cli/simple-commands/analysis.js +179 -161
- package/src/cli/simple-commands/automation.js +226 -205
- package/src/cli/simple-commands/batch-manager.js +98 -88
- package/src/cli/simple-commands/config.js +65 -60
- package/src/cli/simple-commands/coordination.js +197 -185
- package/src/cli/simple-commands/enhanced-ui-views.js +142 -115
- package/src/cli/simple-commands/enhanced-webui-complete.js +267 -167
- package/src/cli/simple-commands/fix-hook-variables.js +73 -67
- package/src/cli/simple-commands/github/gh-coordinator.js +63 -53
- package/src/cli/simple-commands/github/github-api.js +45 -47
- package/src/cli/simple-commands/github.js +33 -34
- package/src/cli/simple-commands/hive-mind/auto-save-middleware.js +44 -40
- package/src/cli/simple-commands/hive-mind/communication.js +198 -185
- package/src/cli/simple-commands/hive-mind/core.js +289 -304
- package/src/cli/simple-commands/hive-mind/db-optimizer.js +278 -168
- package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +352 -258
- package/src/cli/simple-commands/hive-mind/memory.js +356 -287
- package/src/cli/simple-commands/hive-mind/performance-optimizer.js +88 -79
- package/src/cli/simple-commands/hive-mind/performance-test.js +61 -49
- package/src/cli/simple-commands/hive-mind/queen.js +223 -213
- package/src/cli/simple-commands/hive-mind/session-manager.js +217 -157
- package/src/cli/simple-commands/hive-mind-optimize.js +69 -65
- package/src/cli/simple-commands/hive-mind-wizard.js +213 -211
- package/src/cli/simple-commands/hive-mind.js +602 -435
- package/src/cli/simple-commands/hive.js +12 -12
- package/src/cli/simple-commands/hook-safety.js +114 -111
- package/src/cli/simple-commands/hooks.js +1077 -1017
- package/src/cli/simple-commands/init/README.md +8 -1
- package/src/cli/simple-commands/init/VALIDATION_ROLLBACK.md +27 -1
- package/src/cli/simple-commands/init/batch-init.js +105 -100
- package/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +6 -6
- package/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +6 -6
- package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +20 -18
- package/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +85 -71
- package/src/cli/simple-commands/init/claude-commands/slash-commands.js +6 -7
- package/src/cli/simple-commands/init/claude-commands/sparc-commands.js +42 -33
- package/src/cli/simple-commands/init/executable-wrapper.js +13 -10
- package/src/cli/simple-commands/init/gitignore-updater.js +22 -22
- package/src/cli/simple-commands/init/help.js +4 -2
- package/src/cli/simple-commands/init/index.js +405 -303
- package/src/cli/simple-commands/init/performance-monitor.js +71 -64
- package/src/cli/simple-commands/init/rollback/backup-manager.js +44 -64
- package/src/cli/simple-commands/init/rollback/index.js +31 -39
- package/src/cli/simple-commands/init/rollback/recovery-manager.js +71 -101
- package/src/cli/simple-commands/init/rollback/rollback-executor.js +34 -53
- package/src/cli/simple-commands/init/rollback/state-tracker.js +38 -49
- package/src/cli/simple-commands/init/sparc/roo-readme.js +1 -1
- package/src/cli/simple-commands/init/sparc/roomodes-config.js +99 -77
- package/src/cli/simple-commands/init/sparc/workflows.js +37 -33
- package/src/cli/simple-commands/init/sparc-structure.js +9 -10
- package/src/cli/simple-commands/init/templates/CLAUDE.md +94 -26
- package/src/cli/simple-commands/init/templates/claude-flow-universal +9 -7
- package/src/cli/simple-commands/init/templates/claude-md.js +1 -1
- package/src/cli/simple-commands/init/templates/commands/analysis/bottleneck-detect.md +15 -3
- package/src/cli/simple-commands/init/templates/commands/automation/auto-agent.md +12 -2
- package/src/cli/simple-commands/init/templates/commands/coordination/swarm-init.md +10 -1
- package/src/cli/simple-commands/init/templates/commands/github/github-swarm.md +18 -5
- package/src/cli/simple-commands/init/templates/commands/hooks/notification.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +13 -6
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-task.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +13 -5
- package/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +12 -1
- package/src/cli/simple-commands/init/templates/coordination-md.js +1 -1
- package/src/cli/simple-commands/init/templates/enhanced-templates.js +116 -113
- package/src/cli/simple-commands/init/templates/memory-bank-md.js +1 -1
- package/src/cli/simple-commands/init/templates/readme-files.js +1 -1
- package/src/cli/simple-commands/init/templates/safe-hook-patterns.js +176 -127
- package/src/cli/simple-commands/init/templates/settings.json +2 -5
- package/src/cli/simple-commands/init/templates/sparc-modes.js +3 -3
- package/src/cli/simple-commands/init/validation/config-validator.js +17 -28
- package/src/cli/simple-commands/init/validation/health-checker.js +54 -62
- package/src/cli/simple-commands/init/validation/index.js +18 -23
- package/src/cli/simple-commands/init/validation/mode-validator.js +22 -32
- package/src/cli/simple-commands/init/validation/post-init-validator.js +25 -26
- package/src/cli/simple-commands/init/validation/pre-init-validator.js +32 -36
- package/src/cli/simple-commands/init/validation/test-runner.js +55 -63
- package/src/cli/simple-commands/init.js +1 -1
- package/src/cli/simple-commands/mcp-integration-layer.js +179 -110
- package/src/cli/simple-commands/mcp.js +55 -48
- package/src/cli/simple-commands/memory.js +62 -56
- package/src/cli/simple-commands/migrate-hooks.js +9 -10
- package/src/cli/simple-commands/monitor.js +87 -67
- package/src/cli/simple-commands/process-ui-enhanced.js +207 -155
- package/src/cli/simple-commands/process-ui.js +65 -56
- package/src/cli/simple-commands/realtime-update-system.js +136 -129
- package/src/cli/simple-commands/sparc/architecture.js +352 -251
- package/src/cli/simple-commands/sparc/commands.js +122 -94
- package/src/cli/simple-commands/sparc/completion.js +274 -199
- package/src/cli/simple-commands/sparc/coordinator.js +217 -169
- package/src/cli/simple-commands/sparc/index.js +40 -36
- package/src/cli/simple-commands/sparc/phase-base.js +72 -58
- package/src/cli/simple-commands/sparc/pseudocode.js +275 -159
- package/src/cli/simple-commands/sparc/refinement.js +306 -212
- package/src/cli/simple-commands/sparc/specification.js +164 -94
- package/src/cli/simple-commands/sparc-modes/architect.js +1 -1
- package/src/cli/simple-commands/sparc-modes/ask.js +1 -1
- package/src/cli/simple-commands/sparc-modes/code.js +1 -1
- package/src/cli/simple-commands/sparc-modes/debug.js +1 -1
- package/src/cli/simple-commands/sparc-modes/devops.js +1 -1
- package/src/cli/simple-commands/sparc-modes/docs-writer.js +1 -1
- package/src/cli/simple-commands/sparc-modes/generic.js +1 -1
- package/src/cli/simple-commands/sparc-modes/index.js +15 -15
- package/src/cli/simple-commands/sparc-modes/integration.js +1 -1
- package/src/cli/simple-commands/sparc-modes/mcp.js +1 -1
- package/src/cli/simple-commands/sparc-modes/monitoring.js +1 -1
- package/src/cli/simple-commands/sparc-modes/optimization.js +1 -1
- package/src/cli/simple-commands/sparc-modes/security-review.js +1 -1
- package/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +1 -1
- package/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +1 -1
- package/src/cli/simple-commands/sparc-modes/supabase-admin.js +1 -1
- package/src/cli/simple-commands/sparc-modes/swarm.js +52 -52
- package/src/cli/simple-commands/sparc-modes/tdd.js +1 -1
- package/src/cli/simple-commands/sparc-modes/tutorial.js +1 -1
- package/src/cli/simple-commands/sparc.js +87 -69
- package/src/cli/simple-commands/start-ui.js +21 -20
- package/src/cli/simple-commands/start-wrapper.js +29 -31
- package/src/cli/simple-commands/start.js +1 -1
- package/src/cli/simple-commands/status.js +53 -47
- package/src/cli/simple-commands/swarm-executor.js +47 -57
- package/src/cli/simple-commands/swarm-metrics-integration.js +119 -79
- package/src/cli/simple-commands/swarm-ui.js +120 -118
- package/src/cli/simple-commands/swarm-webui-integration.js +48 -27
- package/src/cli/simple-commands/swarm.js +216 -181
- package/src/cli/simple-commands/task.js +29 -29
- package/src/cli/simple-commands/timestamp-fix.js +28 -25
- package/src/cli/simple-commands/tool-execution-framework.js +115 -118
- package/src/cli/simple-commands/training.js +219 -194
- package/src/cli/simple-commands/web-server.js +118 -117
- package/src/cli/simple-commands/webui-validator.js +4 -3
- package/src/cli/simple-mcp.ts +14 -17
- package/src/cli/simple-orchestrator.ts +113 -101
- package/src/cli/swarm-standalone.js +20 -21
- package/src/cli/ui/compatible-ui.ts +55 -44
- package/src/cli/ui/fallback-handler.ts +19 -16
- package/src/cli/ui/index.ts +14 -15
- package/src/cli/utils/environment-detector.ts +75 -67
- package/src/cli/utils/interactive-detector.js +17 -11
- package/src/cli/utils/prompt-defaults.ts +32 -28
- package/src/cli/utils/safe-interactive.js +21 -20
- package/src/cli/utils.js +127 -110
- package/src/cli/validation-helper.js +113 -0
- package/src/cli/validation-helper.ts +128 -0
- package/src/communication/message-bus.ts +137 -124
- package/src/config/config-manager.ts +62 -30
- package/src/config/ruv-swarm-config.ts +105 -86
- package/src/config/ruv-swarm-integration.ts +38 -38
- package/src/constants/agent-types.ts +9 -8
- package/src/coordination/README.md +54 -31
- package/src/coordination/advanced-scheduler.ts +23 -26
- package/src/coordination/advanced-task-executor.ts +74 -68
- package/src/coordination/background-executor.ts +33 -30
- package/src/coordination/circuit-breaker.ts +26 -27
- package/src/coordination/conflict-resolution.ts +18 -27
- package/src/coordination/dependency-graph.ts +15 -18
- package/src/coordination/hive-orchestrator.ts +111 -81
- package/src/coordination/hive-protocol.ts +68 -77
- package/src/coordination/index.ts +3 -7
- package/src/coordination/load-balancer.ts +115 -105
- package/src/coordination/manager.ts +38 -51
- package/src/coordination/messaging.ts +19 -29
- package/src/coordination/metrics.ts +57 -60
- package/src/coordination/resources.ts +32 -37
- package/src/coordination/scheduler.ts +29 -30
- package/src/coordination/swarm-coordinator.ts +81 -70
- package/src/coordination/swarm-monitor.ts +90 -69
- package/src/coordination/work-stealing.ts +6 -13
- package/src/core/config.ts +148 -143
- package/src/core/event-bus.ts +5 -6
- package/src/core/json-persistence.ts +27 -34
- package/src/core/logger.ts +13 -16
- package/src/core/orchestrator-fixed.ts +33 -32
- package/src/core/orchestrator.ts +166 -159
- package/src/core/persistence.ts +47 -36
- package/src/enterprise/analytics-manager.ts +242 -233
- package/src/enterprise/audit-manager.ts +238 -184
- package/src/enterprise/cloud-manager.ts +167 -151
- package/src/enterprise/deployment-manager.ts +223 -180
- package/src/enterprise/index.ts +7 -7
- package/src/enterprise/project-manager.ts +151 -133
- package/src/enterprise/security-manager.ts +278 -223
- package/src/hive-mind/core/Agent.ts +112 -109
- package/src/hive-mind/core/Communication.ts +67 -69
- package/src/hive-mind/core/DatabaseManager.ts +299 -166
- package/src/hive-mind/core/HiveMind.ts +100 -96
- package/src/hive-mind/core/Memory.ts +304 -295
- package/src/hive-mind/core/MemoryMonitor.ts +46 -47
- package/src/hive-mind/core/Queen.ts +187 -114
- package/src/hive-mind/index.ts +2 -2
- package/src/hive-mind/integration/ConsensusEngine.ts +88 -92
- package/src/hive-mind/integration/MCPToolWrapper.ts +20 -72
- package/src/hive-mind/integration/SwarmOrchestrator.ts +173 -165
- package/src/hive-mind/types.ts +24 -12
- package/src/integration/mock-components.ts +42 -30
- package/src/integration/system-integration.ts +93 -69
- package/src/integration/types.ts +7 -7
- package/src/mcp/README.md +23 -4
- package/src/mcp/auth.ts +25 -18
- package/src/mcp/claude-code-wrapper.ts +257 -150
- package/src/mcp/claude-flow-tools.ts +52 -13
- package/src/mcp/client.ts +15 -13
- package/src/mcp/index.ts +22 -27
- package/src/mcp/integrate-wrapper.ts +18 -18
- package/src/mcp/lifecycle-manager.ts +30 -27
- package/src/mcp/load-balancer.ts +10 -11
- package/src/mcp/mcp-server.js +755 -370
- package/src/mcp/orchestration-integration.ts +32 -17
- package/src/mcp/performance-monitor.ts +65 -51
- package/src/mcp/protocol-manager.ts +36 -52
- package/src/mcp/recovery/connection-health-monitor.ts +40 -35
- package/src/mcp/recovery/connection-state-manager.ts +52 -50
- package/src/mcp/recovery/fallback-coordinator.ts +24 -24
- package/src/mcp/recovery/index.ts +23 -4
- package/src/mcp/recovery/reconnection-manager.ts +14 -15
- package/src/mcp/recovery/recovery-manager.ts +52 -68
- package/src/mcp/router.ts +1 -2
- package/src/mcp/ruv-swarm-tools.ts +167 -138
- package/src/mcp/ruv-swarm-wrapper.js +31 -23
- package/src/mcp/server-with-wrapper.ts +4 -5
- package/src/mcp/server-wrapper-mode.ts +5 -6
- package/src/mcp/server.ts +45 -40
- package/src/mcp/session-manager.ts +8 -11
- package/src/mcp/sparc-modes.ts +29 -28
- package/src/mcp/swarm-tools.ts +131 -114
- package/src/mcp/tests/mcp-integration.test.ts +49 -55
- package/src/mcp/tools.ts +53 -38
- package/src/mcp/transports/base.ts +4 -5
- package/src/mcp/transports/http.ts +45 -42
- package/src/mcp/transports/stdio.ts +9 -12
- package/src/memory/README.md +37 -27
- package/src/memory/advanced-memory-manager.ts +336 -279
- package/src/memory/backends/base.ts +4 -5
- package/src/memory/backends/markdown.ts +16 -22
- package/src/memory/backends/sqlite.ts +19 -15
- package/src/memory/cache.ts +18 -18
- package/src/memory/distributed-memory.ts +84 -92
- package/src/memory/enhanced-examples.js +68 -59
- package/src/memory/enhanced-memory.js +99 -80
- package/src/memory/fallback-store.js +16 -7
- package/src/memory/in-memory-store.js +31 -27
- package/src/memory/index.js +4 -4
- package/src/memory/indexer.ts +6 -10
- package/src/memory/manager.ts +45 -59
- package/src/memory/migration.js +107 -90
- package/src/memory/shared-memory.js +155 -157
- package/src/memory/sqlite-store.js +76 -59
- package/src/memory/swarm-memory.js +138 -131
- package/src/memory/swarm-memory.ts +74 -75
- package/src/memory/test-example.js +28 -30
- package/src/migration/README.md +25 -9
- package/src/migration/index.ts +13 -14
- package/src/migration/logger.ts +9 -7
- package/src/migration/migration-analyzer.ts +66 -52
- package/src/migration/migration-manifest.json +2 -6
- package/src/migration/migration-runner.ts +86 -63
- package/src/migration/migration-validator.ts +93 -68
- package/src/migration/package.json +1 -1
- package/src/migration/progress-reporter.ts +25 -21
- package/src/migration/rollback-manager.ts +79 -63
- package/src/migration/tests/migration-system.test.ts +4 -491
- package/src/migration/tsconfig.json +3 -10
- package/src/migration/types.ts +1 -1
- package/src/monitoring/diagnostics.ts +123 -97
- package/src/monitoring/health-check.ts +45 -51
- package/src/monitoring/real-time-monitor.ts +105 -92
- package/src/resources/resource-manager.ts +205 -159
- package/src/swarm/__tests__/integration.test.ts +59 -65
- package/src/swarm/__tests__/prompt-copier.test.ts +27 -27
- package/src/swarm/claude-flow-executor.ts +50 -49
- package/src/swarm/coordinator.ts +727 -635
- package/src/swarm/direct-executor.ts +80 -86
- package/src/swarm/executor-v2.ts +81 -66
- package/src/swarm/executor.ts +124 -124
- package/src/swarm/index.ts +7 -8
- package/src/swarm/json-output-aggregator.ts +56 -40
- package/src/swarm/memory.ts +152 -147
- package/src/swarm/optimizations/README.md +20 -12
- package/src/swarm/optimizations/__tests__/optimization.test.ts +84 -87
- package/src/swarm/optimizations/async-file-manager.ts +70 -80
- package/src/swarm/optimizations/circular-buffer.ts +37 -37
- package/src/swarm/optimizations/connection-pool.ts +64 -64
- package/src/swarm/optimizations/index.ts +4 -4
- package/src/swarm/optimizations/migration-guide.md +27 -16
- package/src/swarm/optimizations/optimized-executor.ts +104 -114
- package/src/swarm/optimizations/ttl-map.ts +66 -63
- package/src/swarm/prompt-cli.ts +48 -42
- package/src/swarm/prompt-copier-enhanced.ts +54 -55
- package/src/swarm/prompt-copier.ts +59 -65
- package/src/swarm/prompt-copying-README.md +49 -33
- package/src/swarm/prompt-manager.ts +69 -63
- package/src/swarm/prompt-utils.ts +71 -66
- package/src/swarm/sparc-executor.ts +298 -225
- package/src/swarm/strategies/auto.ts +367 -252
- package/src/swarm/strategies/base.ts +24 -20
- package/src/swarm/strategies/research.ts +144 -124
- package/src/swarm/types.ts +340 -309
- package/src/swarm/workers/copy-worker.ts +12 -13
- package/src/task/README.md +99 -70
- package/src/task/commands.ts +16 -8
- package/src/task/coordination.ts +209 -162
- package/src/task/engine.ts +81 -65
- package/src/task/index.ts +28 -31
- package/src/templates/claude-optimized/.claude/BATCHTOOLS_BEST_PRACTICES.md +479 -481
- package/src/templates/claude-optimized/.claude/BATCHTOOLS_GUIDE.md +210 -188
- package/src/templates/claude-optimized/.claude/MIGRATION_GUIDE.md +151 -105
- package/src/templates/claude-optimized/.claude/PERFORMANCE_BENCHMARKS.md +102 -87
- package/src/templates/claude-optimized/.claude/commands/claude-flow-help.md +18 -1
- package/src/templates/claude-optimized/.claude/commands/claude-flow-memory.md +17 -1
- package/src/templates/claude-optimized/.claude/commands/claude-flow-swarm.md +21 -1
- package/src/templates/claude-optimized/.claude/commands/sparc/architect.md +11 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/ask.md +16 -10
- package/src/templates/claude-optimized/.claude/commands/sparc/code.md +26 -7
- package/src/templates/claude-optimized/.claude/commands/sparc/debug.md +14 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/devops.md +23 -10
- package/src/templates/claude-optimized/.claude/commands/sparc/docs-writer.md +8 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/integration.md +43 -27
- package/src/templates/claude-optimized/.claude/commands/sparc/mcp.md +15 -1
- package/src/templates/claude-optimized/.claude/commands/sparc/post-deployment-monitoring-mode.md +45 -30
- package/src/templates/claude-optimized/.claude/commands/sparc/refinement-optimization-mode.md +23 -13
- package/src/templates/claude-optimized/.claude/commands/sparc/security-review.md +31 -17
- package/src/templates/claude-optimized/.claude/commands/sparc/sparc.md +54 -47
- package/src/templates/claude-optimized/.claude/commands/sparc/spec-pseudocode.md +27 -17
- package/src/templates/claude-optimized/.claude/commands/sparc/supabase-admin.md +18 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/tdd.md +23 -9
- package/src/templates/claude-optimized/.claude/commands/sparc/tutorial.md +22 -16
- package/src/templates/claude-optimized/.claude/commands/sparc.md +20 -1
- package/src/templates/claude-optimized/README.md +10 -1
- package/src/templates/claude-optimized/SUMMARY.md +23 -1
- package/src/templates/claude-optimized/deploy-to-project.js +22 -10
- package/src/templates/claude-optimized/install-template.js +14 -10
- package/src/templates/claude-optimized/manifest.json +1 -1
- package/src/templates/claude-optimized/package.json +1 -1
- package/src/templates/claude-optimized/template-manager.js +8 -8
- package/src/templates/claude-optimized/validate-template.js +33 -23
- package/src/terminal/adapters/base.ts +1 -1
- package/src/terminal/adapters/native.ts +47 -47
- package/src/terminal/adapters/vscode.ts +21 -28
- package/src/terminal/manager.ts +27 -22
- package/src/terminal/pool.ts +24 -27
- package/src/terminal/session.ts +18 -18
- package/src/terminal/vscode-bridge.ts +21 -21
- package/src/tests/validation-consistency.test.ts +4 -4
- package/src/types/cliffy.d.ts +11 -14
- package/src/types/global.d.ts +1 -2
- package/src/types/index.ts +2 -2
- package/src/types/mcp.d.ts +11 -17
- package/src/types/vscode.d.ts +18 -5
- package/src/ui/console/README-analysis-tools.md +52 -2
- package/src/ui/console/README.md +33 -1
- package/src/ui/console/WORKFLOW_DESIGNER_README.md +81 -22
- package/src/ui/console/analysis-tools.html +282 -261
- package/src/ui/console/analytics.html +329 -326
- package/src/ui/console/index.html +221 -209
- package/src/ui/console/js/analysis-tools.js +815 -754
- package/src/ui/console/js/command-handler.js +226 -196
- package/src/ui/console/js/console.js +117 -119
- package/src/ui/console/js/daa-tools.js +797 -787
- package/src/ui/console/js/memory-interface.js +676 -638
- package/src/ui/console/js/memory-test.js +49 -46
- package/src/ui/console/js/memory-tools.js +181 -159
- package/src/ui/console/js/settings.js +124 -103
- package/src/ui/console/js/terminal-emulator.js +147 -130
- package/src/ui/console/js/websocket-client.js +71 -71
- package/src/ui/console/js/workflow-designer.js +1126 -1110
- package/src/ui/console/neural-networks-demo.md +45 -16
- package/src/ui/console/styles/analysis-tools.css +571 -561
- package/src/ui/console/styles/console.css +16 -12
- package/src/ui/console/styles/daa-tools.css +322 -319
- package/src/ui/console/styles/responsive.css +71 -70
- package/src/ui/console/styles/settings.css +12 -12
- package/src/ui/console/styles/workflow-designer.css +628 -584
- package/src/ui/console/test-neural-networks.js +59 -54
- package/src/ui/console/test-neural.html +194 -196
- package/src/ui/console/workflow-designer-demo.html +433 -424
- package/src/ui/hive-dashboard.ts +74 -52
- package/src/ui/web-ui/EnhancedProcessUI.js +570 -424
- package/src/ui/web-ui/EnhancedWebUI.js +65 -65
- package/src/ui/web-ui/README.md +16 -16
- package/src/ui/web-ui/components/ComponentLibrary.js +173 -124
- package/src/ui/web-ui/core/EventBus.js +27 -25
- package/src/ui/web-ui/core/MCPIntegrationLayer.js +294 -108
- package/src/ui/web-ui/core/StateManager.js +43 -46
- package/src/ui/web-ui/core/UIManager.js +120 -70
- package/src/ui/web-ui/core/ViewManager.js +16 -19
- package/src/ui/web-ui/index.js +101 -48
- package/src/ui/web-ui/neural-panel-test.js +109 -108
- package/src/ui/web-ui/test-github-view.js +11 -12
- package/src/ui/web-ui/test-neural-panel.html +219 -205
- package/src/ui/web-ui/views/DAAView.js +88 -85
- package/src/ui/web-ui/views/GitHubIntegrationTest.js +42 -42
- package/src/ui/web-ui/views/GitHubIntegrationView.js +59 -53
- package/src/ui/web-ui/views/NeuralNetworkView.js +20 -21
- package/src/ui/web-ui/views/WorkflowAutomationView.js +31 -32
- package/src/utils/error-handler.js +1 -1
- package/src/utils/error-handler.ts +9 -5
- package/src/utils/errors.ts +20 -18
- package/src/utils/formatters.ts +6 -6
- package/src/utils/helpers.ts +53 -55
- package/src/utils/npx-isolated-cache.js +16 -16
- package/src/utils/paths.ts +9 -6
- package/src/utils/timezone-utils.js +16 -16
- package/src/utils/type-guards.ts +37 -26
- package/src/utils/types.ts +2 -2
|
@@ -2,7 +2,7 @@ import { EventEmitter } from 'events';
|
|
|
2
2
|
import { promises as fs } from 'node:fs';
|
|
3
3
|
import { Logger } from '../core/logger.js';
|
|
4
4
|
import { generateId } from '../utils/helpers.js';
|
|
5
|
-
import { SWARM_CONSTANTS } from './types.js';
|
|
5
|
+
import { SWARM_CONSTANTS, } from './types.js';
|
|
6
6
|
import { AutoStrategy } from './strategies/auto.js';
|
|
7
7
|
import { getClaudeFlowRoot, getClaudeFlowBin } from '../utils/paths.js';
|
|
8
8
|
import { SwarmJsonOutputAggregator } from './json-output-aggregator.js';
|
|
@@ -51,7 +51,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
51
51
|
this.logger.info('SwarmCoordinator initialized', {
|
|
52
52
|
swarmId: this.swarmId.id,
|
|
53
53
|
mode: this.config.mode,
|
|
54
|
-
strategy: this.config.strategy
|
|
54
|
+
strategy: this.config.strategy,
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
// ===== LIFECYCLE MANAGEMENT =====
|
|
@@ -65,7 +65,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
65
65
|
// Validate configuration
|
|
66
66
|
const validation = await this.validateConfiguration();
|
|
67
67
|
if (!validation.valid) {
|
|
68
|
-
throw new Error(`Configuration validation failed: ${validation.errors.map(e => e.message).join(', ')}`);
|
|
68
|
+
throw new Error(`Configuration validation failed: ${validation.errors.map((e) => e.message).join(', ')}`);
|
|
69
69
|
}
|
|
70
70
|
// Initialize subsystems
|
|
71
71
|
await this.initializeSubsystems();
|
|
@@ -81,7 +81,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
81
81
|
source: this.swarmId.id,
|
|
82
82
|
data: { swarmId: this.swarmId },
|
|
83
83
|
broadcast: true,
|
|
84
|
-
processed: false
|
|
84
|
+
processed: false,
|
|
85
85
|
});
|
|
86
86
|
this.logger.info('Swarm coordinator initialized successfully');
|
|
87
87
|
}
|
|
@@ -117,10 +117,10 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
117
117
|
data: {
|
|
118
118
|
swarmId: this.swarmId,
|
|
119
119
|
metrics: this.metrics,
|
|
120
|
-
duration: this.endTime.getTime() - (this.startTime?.getTime() || 0)
|
|
120
|
+
duration: this.endTime.getTime() - (this.startTime?.getTime() || 0),
|
|
121
121
|
},
|
|
122
122
|
broadcast: true,
|
|
123
|
-
processed: false
|
|
123
|
+
processed: false,
|
|
124
124
|
});
|
|
125
125
|
this.logger.info('Swarm coordinator shut down successfully');
|
|
126
126
|
}
|
|
@@ -148,7 +148,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
148
148
|
source: this.swarmId.id,
|
|
149
149
|
data: { swarmId: this.swarmId },
|
|
150
150
|
broadcast: true,
|
|
151
|
-
processed: false
|
|
151
|
+
processed: false,
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
async resume() {
|
|
@@ -170,7 +170,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
170
170
|
source: this.swarmId.id,
|
|
171
171
|
data: { swarmId: this.swarmId },
|
|
172
172
|
broadcast: true,
|
|
173
|
-
processed: false
|
|
173
|
+
processed: false,
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
// ===== OBJECTIVE MANAGEMENT =====
|
|
@@ -192,21 +192,21 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
192
192
|
reviewCoverage: 0.8,
|
|
193
193
|
testCoverage: 0.7,
|
|
194
194
|
reliabilityTarget: 0.95,
|
|
195
|
-
...requirements
|
|
195
|
+
...requirements,
|
|
196
196
|
},
|
|
197
197
|
constraints: {
|
|
198
198
|
minQuality: this.config.qualityThreshold,
|
|
199
199
|
requiredApprovals: [],
|
|
200
200
|
allowedFailures: Math.floor(this.config.maxAgents * 0.1),
|
|
201
201
|
recoveryTime: 5 * 60 * 1000, // 5 minutes
|
|
202
|
-
milestones: []
|
|
202
|
+
milestones: [],
|
|
203
203
|
},
|
|
204
204
|
tasks: [],
|
|
205
205
|
dependencies: [],
|
|
206
206
|
status: 'planning',
|
|
207
207
|
progress: this.initializeProgress(),
|
|
208
208
|
createdAt: new Date(),
|
|
209
|
-
metrics: this.initializeMetrics()
|
|
209
|
+
metrics: this.initializeMetrics(),
|
|
210
210
|
};
|
|
211
211
|
// Decompose objective into tasks using optimized AUTO strategy
|
|
212
212
|
if (objective.strategy === 'auto') {
|
|
@@ -223,7 +223,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
223
223
|
objectiveId,
|
|
224
224
|
name,
|
|
225
225
|
strategy,
|
|
226
|
-
taskCount: objective.tasks.length
|
|
226
|
+
taskCount: objective.tasks.length,
|
|
227
227
|
});
|
|
228
228
|
return objectiveId;
|
|
229
229
|
}
|
|
@@ -258,7 +258,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
258
258
|
id: generateId('agent'),
|
|
259
259
|
swarmId: this.swarmId.id,
|
|
260
260
|
type,
|
|
261
|
-
instance: this.getNextInstanceNumber(type)
|
|
261
|
+
instance: this.getNextInstanceNumber(type),
|
|
262
262
|
};
|
|
263
263
|
const agentState = {
|
|
264
264
|
id: agentId,
|
|
@@ -287,7 +287,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
287
287
|
reliability: 0.8,
|
|
288
288
|
speed: 1.0,
|
|
289
289
|
quality: 0.8,
|
|
290
|
-
...capabilities
|
|
290
|
+
...capabilities,
|
|
291
291
|
},
|
|
292
292
|
metrics: {
|
|
293
293
|
tasksCompleted: 0,
|
|
@@ -304,7 +304,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
304
304
|
userSatisfaction: 0,
|
|
305
305
|
totalUptime: 0,
|
|
306
306
|
lastActivity: new Date(),
|
|
307
|
-
responseTime: 0
|
|
307
|
+
responseTime: 0,
|
|
308
308
|
},
|
|
309
309
|
workload: 0,
|
|
310
310
|
health: 1.0,
|
|
@@ -320,7 +320,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
320
320
|
permissions: this.getDefaultPermissions(type),
|
|
321
321
|
trustedAgents: [],
|
|
322
322
|
expertise: {},
|
|
323
|
-
preferences: {}
|
|
323
|
+
preferences: {},
|
|
324
324
|
},
|
|
325
325
|
environment: {
|
|
326
326
|
runtime: 'deno',
|
|
@@ -331,14 +331,14 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
331
331
|
apiEndpoints: {},
|
|
332
332
|
credentials: {},
|
|
333
333
|
availableTools: [],
|
|
334
|
-
toolConfigs: {}
|
|
334
|
+
toolConfigs: {},
|
|
335
335
|
},
|
|
336
336
|
endpoints: [],
|
|
337
337
|
lastHeartbeat: new Date(),
|
|
338
338
|
taskHistory: [],
|
|
339
339
|
errorHistory: [],
|
|
340
340
|
childAgents: [],
|
|
341
|
-
collaborators: []
|
|
341
|
+
collaborators: [],
|
|
342
342
|
};
|
|
343
343
|
this.agents.set(agentId.id, agentState);
|
|
344
344
|
// Track agent in JSON output if enabled
|
|
@@ -351,7 +351,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
351
351
|
agentId: agentId.id,
|
|
352
352
|
name,
|
|
353
353
|
type,
|
|
354
|
-
capabilities: Object.keys(capabilities)
|
|
354
|
+
capabilities: Object.keys(capabilities),
|
|
355
355
|
});
|
|
356
356
|
this.emitSwarmEvent({
|
|
357
357
|
id: generateId('event'),
|
|
@@ -360,7 +360,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
360
360
|
source: agentId.id,
|
|
361
361
|
data: { agent: agentState },
|
|
362
362
|
broadcast: false,
|
|
363
|
-
processed: false
|
|
363
|
+
processed: false,
|
|
364
364
|
});
|
|
365
365
|
return agentId.id;
|
|
366
366
|
}
|
|
@@ -385,7 +385,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
385
385
|
source: agentId,
|
|
386
386
|
data: { agentId },
|
|
387
387
|
broadcast: false,
|
|
388
|
-
processed: false
|
|
388
|
+
processed: false,
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
391
|
async startAgent(agentId) {
|
|
@@ -411,7 +411,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
411
411
|
source: agentId,
|
|
412
412
|
data: { agent },
|
|
413
413
|
broadcast: false,
|
|
414
|
-
processed: false
|
|
414
|
+
processed: false,
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
catch (error) {
|
|
@@ -419,11 +419,11 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
419
419
|
agent.errorHistory.push({
|
|
420
420
|
timestamp: new Date(),
|
|
421
421
|
type: 'startup_error',
|
|
422
|
-
message:
|
|
422
|
+
message: error instanceof Error ? error.message : String(error),
|
|
423
423
|
stack: error.stack,
|
|
424
424
|
context: { agentId },
|
|
425
425
|
severity: 'high',
|
|
426
|
-
resolved: false
|
|
426
|
+
resolved: false,
|
|
427
427
|
});
|
|
428
428
|
this.logger.error('Failed to start agent', { agentId, error });
|
|
429
429
|
throw error;
|
|
@@ -477,7 +477,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
477
477
|
id: generateId('task'),
|
|
478
478
|
swarmId: this.swarmId.id,
|
|
479
479
|
sequence: this.tasks.size + 1,
|
|
480
|
-
priority: 1
|
|
480
|
+
priority: 1,
|
|
481
481
|
};
|
|
482
482
|
const task = {
|
|
483
483
|
id: taskId,
|
|
@@ -489,7 +489,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
489
489
|
capabilities: this.getRequiredCapabilities(type),
|
|
490
490
|
tools: this.getRequiredTools(type),
|
|
491
491
|
permissions: this.getRequiredPermissions(type),
|
|
492
|
-
...options.requirements
|
|
492
|
+
...options.requirements,
|
|
493
493
|
},
|
|
494
494
|
constraints: {
|
|
495
495
|
dependencies: [],
|
|
@@ -497,7 +497,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
497
497
|
conflicts: [],
|
|
498
498
|
maxRetries: SWARM_CONSTANTS.MAX_RETRIES,
|
|
499
499
|
timeoutAfter: SWARM_CONSTANTS.DEFAULT_TASK_TIMEOUT,
|
|
500
|
-
...options.constraints
|
|
500
|
+
...options.constraints,
|
|
501
501
|
},
|
|
502
502
|
priority: 'normal',
|
|
503
503
|
input: options.input || {},
|
|
@@ -507,14 +507,16 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
507
507
|
createdAt: new Date(),
|
|
508
508
|
updatedAt: new Date(),
|
|
509
509
|
attempts: [],
|
|
510
|
-
statusHistory: [
|
|
510
|
+
statusHistory: [
|
|
511
|
+
{
|
|
511
512
|
timestamp: new Date(),
|
|
512
513
|
from: 'created',
|
|
513
514
|
to: 'created',
|
|
514
515
|
reason: 'Task created',
|
|
515
|
-
triggeredBy: 'system'
|
|
516
|
-
}
|
|
517
|
-
|
|
516
|
+
triggeredBy: 'system',
|
|
517
|
+
},
|
|
518
|
+
],
|
|
519
|
+
...options,
|
|
518
520
|
};
|
|
519
521
|
this.tasks.set(taskId.id, task);
|
|
520
522
|
// Track task in JSON output if enabled
|
|
@@ -523,7 +525,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
523
525
|
taskId: taskId.id,
|
|
524
526
|
type,
|
|
525
527
|
name,
|
|
526
|
-
priority: task.priority
|
|
528
|
+
priority: task.priority,
|
|
527
529
|
});
|
|
528
530
|
this.emitSwarmEvent({
|
|
529
531
|
id: generateId('event'),
|
|
@@ -532,7 +534,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
532
534
|
source: this.swarmId.id,
|
|
533
535
|
data: { task },
|
|
534
536
|
broadcast: false,
|
|
535
|
-
processed: false
|
|
537
|
+
processed: false,
|
|
536
538
|
});
|
|
537
539
|
return taskId.id;
|
|
538
540
|
}
|
|
@@ -570,12 +572,12 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
570
572
|
from: task.statusHistory[task.statusHistory.length - 1].to,
|
|
571
573
|
to: 'assigned',
|
|
572
574
|
reason: `Assigned to agent ${agent.name}`,
|
|
573
|
-
triggeredBy: 'system'
|
|
575
|
+
triggeredBy: 'system',
|
|
574
576
|
});
|
|
575
577
|
this.logger.info('Assigned task', {
|
|
576
578
|
taskId,
|
|
577
579
|
agentId,
|
|
578
|
-
agentName: agent.name
|
|
580
|
+
agentName: agent.name,
|
|
579
581
|
});
|
|
580
582
|
this.emitSwarmEvent({
|
|
581
583
|
id: generateId('event'),
|
|
@@ -584,7 +586,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
584
586
|
source: agentId,
|
|
585
587
|
data: { task, agent },
|
|
586
588
|
broadcast: false,
|
|
587
|
-
processed: false
|
|
589
|
+
processed: false,
|
|
588
590
|
});
|
|
589
591
|
// Start task execution
|
|
590
592
|
await this.startTaskExecution(task);
|
|
@@ -599,7 +601,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
599
601
|
}
|
|
600
602
|
this.logger.info('Starting task execution', {
|
|
601
603
|
taskId: task.id.id,
|
|
602
|
-
agentId: agent.id.id
|
|
604
|
+
agentId: agent.id.id,
|
|
603
605
|
});
|
|
604
606
|
task.status = 'running';
|
|
605
607
|
task.startedAt = new Date();
|
|
@@ -609,7 +611,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
609
611
|
agent: agent.id,
|
|
610
612
|
startedAt: new Date(),
|
|
611
613
|
status: 'running',
|
|
612
|
-
resourcesUsed: {}
|
|
614
|
+
resourcesUsed: {},
|
|
613
615
|
};
|
|
614
616
|
task.attempts.push(attempt);
|
|
615
617
|
// Update status history
|
|
@@ -618,7 +620,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
618
620
|
from: 'assigned',
|
|
619
621
|
to: 'running',
|
|
620
622
|
reason: 'Task execution started',
|
|
621
|
-
triggeredBy: agent.id
|
|
623
|
+
triggeredBy: agent.id,
|
|
622
624
|
});
|
|
623
625
|
this.emitSwarmEvent({
|
|
624
626
|
id: generateId('event'),
|
|
@@ -627,7 +629,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
627
629
|
source: agent.id.id,
|
|
628
630
|
data: { task, agent, attempt },
|
|
629
631
|
broadcast: false,
|
|
630
|
-
processed: false
|
|
632
|
+
processed: false,
|
|
631
633
|
});
|
|
632
634
|
try {
|
|
633
635
|
// Execute task (this would spawn actual Claude process)
|
|
@@ -659,7 +661,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
659
661
|
accuracy: 1.0,
|
|
660
662
|
executionTime: task.completedAt.getTime() - (task.startedAt?.getTime() || 0),
|
|
661
663
|
resourcesUsed: {},
|
|
662
|
-
validated: false
|
|
664
|
+
validated: false,
|
|
663
665
|
};
|
|
664
666
|
// Update attempt
|
|
665
667
|
const currentAttempt = task.attempts[task.attempts.length - 1];
|
|
@@ -682,7 +684,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
682
684
|
from: 'running',
|
|
683
685
|
to: 'completed',
|
|
684
686
|
reason: 'Task completed successfully',
|
|
685
|
-
triggeredBy: agent.id
|
|
687
|
+
triggeredBy: agent.id,
|
|
686
688
|
});
|
|
687
689
|
this.emitSwarmEvent({
|
|
688
690
|
id: generateId('event'),
|
|
@@ -691,7 +693,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
691
693
|
source: agent.id.id,
|
|
692
694
|
data: { task, agent, result: task.result },
|
|
693
695
|
broadcast: false,
|
|
694
|
-
processed: false
|
|
696
|
+
processed: false,
|
|
695
697
|
});
|
|
696
698
|
// Check for dependent tasks
|
|
697
699
|
await this.processDependentTasks(task);
|
|
@@ -705,15 +707,19 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
705
707
|
if (!agent) {
|
|
706
708
|
throw new Error('Task not assigned to any agent');
|
|
707
709
|
}
|
|
708
|
-
this.logger.warn('Task failed', {
|
|
710
|
+
this.logger.warn('Task failed', {
|
|
711
|
+
taskId,
|
|
712
|
+
agentId: agent.id.id,
|
|
713
|
+
error: error instanceof Error ? error.message : String(error),
|
|
714
|
+
});
|
|
709
715
|
task.error = {
|
|
710
716
|
type: error.constructor.name,
|
|
711
|
-
message:
|
|
717
|
+
message: error instanceof Error ? error.message : String(error),
|
|
712
718
|
code: error.code,
|
|
713
719
|
stack: error.stack,
|
|
714
720
|
context: { taskId, agentId: agent.id.id },
|
|
715
721
|
recoverable: this.isRecoverableError(error),
|
|
716
|
-
retryable: this.isRetryableError(error)
|
|
722
|
+
retryable: this.isRetryableError(error),
|
|
717
723
|
};
|
|
718
724
|
// Update attempt
|
|
719
725
|
const currentAttempt = task.attempts[task.attempts.length - 1];
|
|
@@ -731,11 +737,11 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
731
737
|
agent.errorHistory.push({
|
|
732
738
|
timestamp: new Date(),
|
|
733
739
|
type: 'task_failure',
|
|
734
|
-
message:
|
|
740
|
+
message: error instanceof Error ? error.message : String(error),
|
|
735
741
|
stack: error.stack,
|
|
736
742
|
context: { taskId },
|
|
737
743
|
severity: 'medium',
|
|
738
|
-
resolved: false
|
|
744
|
+
resolved: false,
|
|
739
745
|
});
|
|
740
746
|
// Determine if we should retry
|
|
741
747
|
const shouldRetry = task.error.retryable &&
|
|
@@ -748,8 +754,8 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
748
754
|
timestamp: new Date(),
|
|
749
755
|
from: 'running',
|
|
750
756
|
to: 'retrying',
|
|
751
|
-
reason: `Task failed, will retry: ${
|
|
752
|
-
triggeredBy: agent.id
|
|
757
|
+
reason: `Task failed, will retry: ${error instanceof Error ? error.message : String(error)}`,
|
|
758
|
+
triggeredBy: agent.id,
|
|
753
759
|
});
|
|
754
760
|
this.emitSwarmEvent({
|
|
755
761
|
id: generateId('event'),
|
|
@@ -758,12 +764,12 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
758
764
|
source: agent.id.id,
|
|
759
765
|
data: { task, error: task.error, attempt: task.attempts.length },
|
|
760
766
|
broadcast: false,
|
|
761
|
-
processed: false
|
|
767
|
+
processed: false,
|
|
762
768
|
});
|
|
763
769
|
// Schedule retry with exponential backoff
|
|
764
770
|
const retryDelay = Math.pow(2, task.attempts.length) * 1000;
|
|
765
771
|
setTimeout(() => {
|
|
766
|
-
this.assignTask(taskId).catch(retryError => {
|
|
772
|
+
this.assignTask(taskId).catch((retryError) => {
|
|
767
773
|
this.logger.error('Failed to retry task', { taskId, retryError });
|
|
768
774
|
});
|
|
769
775
|
}, retryDelay);
|
|
@@ -776,8 +782,8 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
776
782
|
timestamp: new Date(),
|
|
777
783
|
from: 'running',
|
|
778
784
|
to: 'failed',
|
|
779
|
-
reason: `Task failed permanently: ${
|
|
780
|
-
triggeredBy: agent.id
|
|
785
|
+
reason: `Task failed permanently: ${error instanceof Error ? error.message : String(error)}`,
|
|
786
|
+
triggeredBy: agent.id,
|
|
781
787
|
});
|
|
782
788
|
this.emitSwarmEvent({
|
|
783
789
|
id: generateId('event'),
|
|
@@ -786,7 +792,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
786
792
|
source: agent.id.id,
|
|
787
793
|
data: { task, error: task.error },
|
|
788
794
|
broadcast: false,
|
|
789
|
-
processed: false
|
|
795
|
+
processed: false,
|
|
790
796
|
});
|
|
791
797
|
// Handle failure cascade
|
|
792
798
|
await this.handleTaskFailureCascade(task);
|
|
@@ -811,7 +817,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
811
817
|
from: task.statusHistory[task.statusHistory.length - 1].to,
|
|
812
818
|
to: 'cancelled',
|
|
813
819
|
reason: `Task cancelled: ${reason}`,
|
|
814
|
-
triggeredBy: 'system'
|
|
820
|
+
triggeredBy: 'system',
|
|
815
821
|
});
|
|
816
822
|
this.emitSwarmEvent({
|
|
817
823
|
id: generateId('event'),
|
|
@@ -820,21 +826,19 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
820
826
|
source: this.swarmId.id,
|
|
821
827
|
data: { task, reason },
|
|
822
828
|
broadcast: false,
|
|
823
|
-
processed: false
|
|
829
|
+
processed: false,
|
|
824
830
|
});
|
|
825
831
|
}
|
|
826
832
|
// ===== ADVANCED FEATURES =====
|
|
827
833
|
async selectAgentForTask(task) {
|
|
828
|
-
const availableAgents = Array.from(this.agents.values())
|
|
829
|
-
.filter(agent => agent.status === 'idle' &&
|
|
830
|
-
this.agentCanHandleTask(agent, task));
|
|
834
|
+
const availableAgents = Array.from(this.agents.values()).filter((agent) => agent.status === 'idle' && this.agentCanHandleTask(agent, task));
|
|
831
835
|
if (availableAgents.length === 0) {
|
|
832
836
|
return null;
|
|
833
837
|
}
|
|
834
838
|
// Score agents based on multiple criteria
|
|
835
|
-
const scoredAgents = availableAgents.map(agent => ({
|
|
839
|
+
const scoredAgents = availableAgents.map((agent) => ({
|
|
836
840
|
agent,
|
|
837
|
-
score: this.calculateAgentScore(agent, task)
|
|
841
|
+
score: this.calculateAgentScore(agent, task),
|
|
838
842
|
}));
|
|
839
843
|
// Sort by score (highest first)
|
|
840
844
|
scoredAgents.sort((a, b) => b.score - a.score);
|
|
@@ -869,22 +873,33 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
869
873
|
agentHasCapability(agent, capability) {
|
|
870
874
|
const caps = agent.capabilities;
|
|
871
875
|
switch (capability) {
|
|
872
|
-
case 'code-generation':
|
|
873
|
-
|
|
874
|
-
case '
|
|
875
|
-
|
|
876
|
-
case '
|
|
877
|
-
|
|
878
|
-
case '
|
|
879
|
-
|
|
880
|
-
case '
|
|
881
|
-
|
|
882
|
-
case '
|
|
876
|
+
case 'code-generation':
|
|
877
|
+
return caps.codeGeneration;
|
|
878
|
+
case 'code-review':
|
|
879
|
+
return caps.codeReview;
|
|
880
|
+
case 'testing':
|
|
881
|
+
return caps.testing;
|
|
882
|
+
case 'documentation':
|
|
883
|
+
return caps.documentation;
|
|
884
|
+
case 'research':
|
|
885
|
+
return caps.research;
|
|
886
|
+
case 'analysis':
|
|
887
|
+
return caps.analysis;
|
|
888
|
+
case 'web-search':
|
|
889
|
+
return caps.webSearch;
|
|
890
|
+
case 'api-integration':
|
|
891
|
+
return caps.apiIntegration;
|
|
892
|
+
case 'file-system':
|
|
893
|
+
return caps.fileSystem;
|
|
894
|
+
case 'terminal-access':
|
|
895
|
+
return caps.terminalAccess;
|
|
896
|
+
case 'validation':
|
|
897
|
+
return caps.testing; // Validation is part of testing capability
|
|
883
898
|
default:
|
|
884
|
-
return caps.domains.includes(capability) ||
|
|
899
|
+
return (caps.domains.includes(capability) ||
|
|
885
900
|
caps.languages.includes(capability) ||
|
|
886
901
|
caps.frameworks.includes(capability) ||
|
|
887
|
-
caps.tools.includes(capability);
|
|
902
|
+
caps.tools.includes(capability));
|
|
888
903
|
}
|
|
889
904
|
}
|
|
890
905
|
agentCanHandleTask(agent, task) {
|
|
@@ -914,7 +929,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
914
929
|
return {
|
|
915
930
|
id: generateId('swarm'),
|
|
916
931
|
timestamp: Date.now(),
|
|
917
|
-
namespace: 'default'
|
|
932
|
+
namespace: 'default',
|
|
918
933
|
};
|
|
919
934
|
}
|
|
920
935
|
mergeWithDefaults(config) {
|
|
@@ -931,7 +946,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
931
946
|
taskScheduling: 'priority',
|
|
932
947
|
loadBalancing: 'work-stealing',
|
|
933
948
|
faultTolerance: 'retry',
|
|
934
|
-
communication: 'event-driven'
|
|
949
|
+
communication: 'event-driven',
|
|
935
950
|
},
|
|
936
951
|
maxAgents: 10,
|
|
937
952
|
maxTasks: 100,
|
|
@@ -939,7 +954,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
939
954
|
resourceLimits: {
|
|
940
955
|
memory: SWARM_CONSTANTS.DEFAULT_MEMORY_LIMIT,
|
|
941
956
|
cpu: SWARM_CONSTANTS.DEFAULT_CPU_LIMIT,
|
|
942
|
-
disk: SWARM_CONSTANTS.DEFAULT_DISK_LIMIT
|
|
957
|
+
disk: SWARM_CONSTANTS.DEFAULT_DISK_LIMIT,
|
|
943
958
|
},
|
|
944
959
|
qualityThreshold: SWARM_CONSTANTS.DEFAULT_QUALITY_THRESHOLD,
|
|
945
960
|
reviewRequired: true,
|
|
@@ -959,11 +974,11 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
959
974
|
errorRate: 0.1,
|
|
960
975
|
responseTime: 5000,
|
|
961
976
|
memoryUsage: 0.8,
|
|
962
|
-
cpuUsage: 0.8
|
|
977
|
+
cpuUsage: 0.8,
|
|
963
978
|
},
|
|
964
979
|
exportEnabled: false,
|
|
965
980
|
exportFormat: 'json',
|
|
966
|
-
exportDestination: '/tmp/swarm-metrics'
|
|
981
|
+
exportDestination: '/tmp/swarm-metrics',
|
|
967
982
|
},
|
|
968
983
|
memory: {
|
|
969
984
|
namespace: 'default',
|
|
@@ -972,14 +987,14 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
972
987
|
read: 'swarm',
|
|
973
988
|
write: 'team',
|
|
974
989
|
delete: 'private',
|
|
975
|
-
share: 'team'
|
|
990
|
+
share: 'team',
|
|
976
991
|
},
|
|
977
992
|
persistent: true,
|
|
978
993
|
backupEnabled: true,
|
|
979
994
|
distributed: false,
|
|
980
995
|
consistency: 'eventual',
|
|
981
996
|
cacheEnabled: true,
|
|
982
|
-
compressionEnabled: false
|
|
997
|
+
compressionEnabled: false,
|
|
983
998
|
},
|
|
984
999
|
security: {
|
|
985
1000
|
authenticationRequired: false,
|
|
@@ -990,7 +1005,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
990
1005
|
auditEnabled: true,
|
|
991
1006
|
auditLevel: 'info',
|
|
992
1007
|
inputValidation: true,
|
|
993
|
-
outputSanitization: true
|
|
1008
|
+
outputSanitization: true,
|
|
994
1009
|
},
|
|
995
1010
|
performance: {
|
|
996
1011
|
maxConcurrency: 10,
|
|
@@ -1003,9 +1018,9 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
1003
1018
|
predictiveLoading: false,
|
|
1004
1019
|
resourcePooling: true,
|
|
1005
1020
|
connectionPooling: true,
|
|
1006
|
-
memoryPooling: false
|
|
1021
|
+
memoryPooling: false,
|
|
1007
1022
|
},
|
|
1008
|
-
...config
|
|
1023
|
+
...config,
|
|
1009
1024
|
};
|
|
1010
1025
|
}
|
|
1011
1026
|
initializeMetrics() {
|
|
@@ -1023,7 +1038,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
1023
1038
|
agentSatisfaction: 0,
|
|
1024
1039
|
collaborationEffectiveness: 0,
|
|
1025
1040
|
scheduleVariance: 0,
|
|
1026
|
-
deadlineAdherence: 0
|
|
1041
|
+
deadlineAdherence: 0,
|
|
1027
1042
|
};
|
|
1028
1043
|
}
|
|
1029
1044
|
initializeProgress() {
|
|
@@ -1042,7 +1057,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
1042
1057
|
costSpent: 0,
|
|
1043
1058
|
activeAgents: 0,
|
|
1044
1059
|
idleAgents: 0,
|
|
1045
|
-
busyAgents: 0
|
|
1060
|
+
busyAgents: 0,
|
|
1046
1061
|
};
|
|
1047
1062
|
}
|
|
1048
1063
|
// ===== EVENT HANDLING =====
|
|
@@ -1099,7 +1114,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
1099
1114
|
return this.events.filter(predicate);
|
|
1100
1115
|
}
|
|
1101
1116
|
correlateEvents(correlationId) {
|
|
1102
|
-
return this.events.filter(event => event.correlationId === correlationId);
|
|
1117
|
+
return this.events.filter((event) => event.correlationId === correlationId);
|
|
1103
1118
|
}
|
|
1104
1119
|
// ===== PUBLIC API METHODS =====
|
|
1105
1120
|
getSwarmId() {
|
|
@@ -1143,25 +1158,32 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
1143
1158
|
}
|
|
1144
1159
|
getSwarmStatus() {
|
|
1145
1160
|
const tasks = Array.from(this.tasks.values());
|
|
1146
|
-
const completedTasks = tasks.filter(t => t.status === 'completed').length;
|
|
1147
|
-
const failedTasks = tasks.filter(t => t.status === 'failed').length;
|
|
1161
|
+
const completedTasks = tasks.filter((t) => t.status === 'completed').length;
|
|
1162
|
+
const failedTasks = tasks.filter((t) => t.status === 'failed').length;
|
|
1148
1163
|
return {
|
|
1149
1164
|
status: this.status,
|
|
1150
1165
|
objectives: this.objectives.size,
|
|
1151
1166
|
tasks: {
|
|
1152
1167
|
completed: completedTasks,
|
|
1153
1168
|
failed: failedTasks,
|
|
1154
|
-
total: tasks.length
|
|
1169
|
+
total: tasks.length,
|
|
1155
1170
|
},
|
|
1156
1171
|
agents: {
|
|
1157
|
-
total: this.agents.size
|
|
1158
|
-
}
|
|
1172
|
+
total: this.agents.size,
|
|
1173
|
+
},
|
|
1159
1174
|
};
|
|
1160
1175
|
}
|
|
1161
1176
|
// ===== STUB METHODS (TO BE IMPLEMENTED) =====
|
|
1162
1177
|
async validateConfiguration() {
|
|
1163
1178
|
// Implementation needed
|
|
1164
|
-
return {
|
|
1179
|
+
return {
|
|
1180
|
+
valid: true,
|
|
1181
|
+
errors: [],
|
|
1182
|
+
warnings: [],
|
|
1183
|
+
validatedAt: new Date(),
|
|
1184
|
+
validator: 'SwarmCoordinator',
|
|
1185
|
+
context: {},
|
|
1186
|
+
};
|
|
1165
1187
|
}
|
|
1166
1188
|
async initializeSubsystems() {
|
|
1167
1189
|
// Implementation needed
|
|
@@ -1202,17 +1224,16 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
1202
1224
|
}
|
|
1203
1225
|
}
|
|
1204
1226
|
async stopAllAgents() {
|
|
1205
|
-
const stopPromises = Array.from(this.agents.keys()).map(agentId => this.stopAgent(agentId));
|
|
1227
|
+
const stopPromises = Array.from(this.agents.keys()).map((agentId) => this.stopAgent(agentId));
|
|
1206
1228
|
await Promise.allSettled(stopPromises);
|
|
1207
1229
|
}
|
|
1208
1230
|
async completeRunningTasks() {
|
|
1209
|
-
const runningTasks = Array.from(this.tasks.values())
|
|
1210
|
-
.filter(task => task.status === 'running');
|
|
1231
|
+
const runningTasks = Array.from(this.tasks.values()).filter((task) => task.status === 'running');
|
|
1211
1232
|
// Wait for tasks to complete or timeout
|
|
1212
1233
|
const timeout = 30000; // 30 seconds
|
|
1213
1234
|
const deadline = Date.now() + timeout;
|
|
1214
|
-
while (runningTasks.some(task => task.status === 'running') && Date.now() < deadline) {
|
|
1215
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
1235
|
+
while (runningTasks.some((task) => task.status === 'running') && Date.now() < deadline) {
|
|
1236
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
1216
1237
|
}
|
|
1217
1238
|
// Cancel any remaining running tasks
|
|
1218
1239
|
for (const task of runningTasks) {
|
|
@@ -1226,13 +1247,20 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
1226
1247
|
}
|
|
1227
1248
|
determineRequiredAgentTypes(strategy) {
|
|
1228
1249
|
switch (strategy) {
|
|
1229
|
-
case 'research':
|
|
1230
|
-
|
|
1231
|
-
case '
|
|
1232
|
-
|
|
1233
|
-
case '
|
|
1234
|
-
|
|
1235
|
-
|
|
1250
|
+
case 'research':
|
|
1251
|
+
return ['researcher', 'analyst'];
|
|
1252
|
+
case 'development':
|
|
1253
|
+
return ['coder', 'tester', 'reviewer'];
|
|
1254
|
+
case 'analysis':
|
|
1255
|
+
return ['analyst', 'researcher'];
|
|
1256
|
+
case 'testing':
|
|
1257
|
+
return ['tester', 'coder'];
|
|
1258
|
+
case 'optimization':
|
|
1259
|
+
return ['analyst', 'coder'];
|
|
1260
|
+
case 'maintenance':
|
|
1261
|
+
return ['coder', 'monitor'];
|
|
1262
|
+
default:
|
|
1263
|
+
return ['coordinator', 'coder', 'analyst'];
|
|
1236
1264
|
}
|
|
1237
1265
|
}
|
|
1238
1266
|
getAgentTypeInstructions(agentType) {
|
|
@@ -1279,13 +1307,17 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
1279
1307
|
// Decompose objective into tasks with clear instructions for Claude
|
|
1280
1308
|
this.logger.info('Decomposing objective', {
|
|
1281
1309
|
objectiveId: objective.id,
|
|
1282
|
-
description: objective.description
|
|
1310
|
+
description: objective.description,
|
|
1283
1311
|
});
|
|
1284
1312
|
const tasks = [];
|
|
1285
1313
|
// Extract target directory from objective
|
|
1286
1314
|
const targetDirMatch = objective.description.match(/(?:in|to|at)\s+([^\s]+\/[^\s]+)|([^\s]+\/[^\s]+)$/);
|
|
1287
1315
|
const targetDir = targetDirMatch ? targetDirMatch[1] || targetDirMatch[2] : null;
|
|
1288
|
-
const targetPath = targetDir
|
|
1316
|
+
const targetPath = targetDir
|
|
1317
|
+
? targetDir.startsWith('/')
|
|
1318
|
+
? targetDir
|
|
1319
|
+
: `${getClaudeFlowRoot()}/${targetDir}`
|
|
1320
|
+
: null;
|
|
1289
1321
|
// Check if objective requests "each agent" or "each agent type" for parallel execution
|
|
1290
1322
|
const eachAgentPattern = /\beach\s+agent(?:\s+type)?\b/i;
|
|
1291
1323
|
const requestsParallelAgents = eachAgentPattern.test(objective.description);
|
|
@@ -1295,7 +1327,7 @@ export class SwarmCoordinator extends EventEmitter {
|
|
|
1295
1327
|
const agentTypes = this.determineRequiredAgentTypes(objective.strategy);
|
|
1296
1328
|
this.logger.info('Creating parallel tasks for each agent type', {
|
|
1297
1329
|
agentTypes,
|
|
1298
|
-
mode: this.config.mode
|
|
1330
|
+
mode: this.config.mode,
|
|
1299
1331
|
});
|
|
1300
1332
|
for (const agentType of agentTypes) {
|
|
1301
1333
|
const taskId = this.createTaskForObjective(`${agentType}-task`, agentType, {
|
|
@@ -1313,7 +1345,7 @@ ${this.getAgentTypeInstructions(agentType)}
|
|
|
1313
1345
|
Work independently but be aware that other agents are working on this same objective from their perspectives.`,
|
|
1314
1346
|
priority: 'high',
|
|
1315
1347
|
estimatedDuration: 10 * 60 * 1000,
|
|
1316
|
-
requiredCapabilities: this.getAgentCapabilities(agentType)
|
|
1348
|
+
requiredCapabilities: this.getAgentCapabilities(agentType),
|
|
1317
1349
|
});
|
|
1318
1350
|
tasks.push(taskId);
|
|
1319
1351
|
}
|
|
@@ -1339,7 +1371,7 @@ Your analysis should include:
|
|
|
1339
1371
|
Please provide a clear, structured plan that the next tasks can follow.`,
|
|
1340
1372
|
priority: 'high',
|
|
1341
1373
|
estimatedDuration: 5 * 60 * 1000,
|
|
1342
|
-
requiredCapabilities: ['analysis', 'documentation']
|
|
1374
|
+
requiredCapabilities: ['analysis', 'documentation'],
|
|
1343
1375
|
});
|
|
1344
1376
|
tasks.push(task1);
|
|
1345
1377
|
// Task 2: Implementation
|
|
@@ -1363,7 +1395,7 @@ Focus on creating a working implementation that matches the user's request exact
|
|
|
1363
1395
|
priority: 'high',
|
|
1364
1396
|
estimatedDuration: 10 * 60 * 1000,
|
|
1365
1397
|
requiredCapabilities: ['code-generation', 'file-system'],
|
|
1366
|
-
dependencies: [task1.id.id]
|
|
1398
|
+
dependencies: [task1.id.id],
|
|
1367
1399
|
});
|
|
1368
1400
|
tasks.push(task2);
|
|
1369
1401
|
// Task 3: Testing
|
|
@@ -1383,7 +1415,7 @@ Create appropriate test files that:
|
|
|
1383
1415
|
priority: 'medium',
|
|
1384
1416
|
estimatedDuration: 5 * 60 * 1000,
|
|
1385
1417
|
requiredCapabilities: ['testing', 'code-generation'],
|
|
1386
|
-
dependencies: [task2.id.id]
|
|
1418
|
+
dependencies: [task2.id.id],
|
|
1387
1419
|
});
|
|
1388
1420
|
tasks.push(task3);
|
|
1389
1421
|
// Task 4: Documentation
|
|
@@ -1406,7 +1438,7 @@ Make sure the documentation is clear, complete, and helps users understand and u
|
|
|
1406
1438
|
priority: 'medium',
|
|
1407
1439
|
estimatedDuration: 5 * 60 * 1000,
|
|
1408
1440
|
requiredCapabilities: ['documentation'],
|
|
1409
|
-
dependencies: [task2.id.id]
|
|
1441
|
+
dependencies: [task2.id.id],
|
|
1410
1442
|
});
|
|
1411
1443
|
tasks.push(task4);
|
|
1412
1444
|
}
|
|
@@ -1431,12 +1463,12 @@ Please analyze what is being requested and implement it appropriately. This may
|
|
|
1431
1463
|
Ensure your implementation is complete, well-structured, and follows best practices.`,
|
|
1432
1464
|
priority: 'high',
|
|
1433
1465
|
estimatedDuration: 15 * 60 * 1000,
|
|
1434
|
-
requiredCapabilities: ['code-generation', 'file-system', 'documentation']
|
|
1466
|
+
requiredCapabilities: ['code-generation', 'file-system', 'documentation'],
|
|
1435
1467
|
}));
|
|
1436
1468
|
}
|
|
1437
1469
|
this.logger.info('Objective decomposed', {
|
|
1438
1470
|
objectiveId: objective.id,
|
|
1439
|
-
taskCount: tasks.length
|
|
1471
|
+
taskCount: tasks.length,
|
|
1440
1472
|
});
|
|
1441
1473
|
return tasks;
|
|
1442
1474
|
}
|
|
@@ -1445,7 +1477,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1445
1477
|
id: generateId('task'),
|
|
1446
1478
|
swarmId: this.swarmId.id,
|
|
1447
1479
|
sequence: this.tasks.size + 1,
|
|
1448
|
-
priority: 1
|
|
1480
|
+
priority: 1,
|
|
1449
1481
|
};
|
|
1450
1482
|
return {
|
|
1451
1483
|
id: taskId,
|
|
@@ -1456,36 +1488,38 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1456
1488
|
requirements: {
|
|
1457
1489
|
capabilities: params.requiredCapabilities || [],
|
|
1458
1490
|
tools: this.getRequiredTools(type),
|
|
1459
|
-
permissions: this.getRequiredPermissions(type)
|
|
1491
|
+
permissions: this.getRequiredPermissions(type),
|
|
1460
1492
|
},
|
|
1461
1493
|
constraints: {
|
|
1462
1494
|
dependencies: params.dependencies || [],
|
|
1463
1495
|
dependents: [],
|
|
1464
1496
|
conflicts: [],
|
|
1465
1497
|
maxRetries: SWARM_CONSTANTS.MAX_RETRIES,
|
|
1466
|
-
timeoutAfter: params.estimatedDuration || SWARM_CONSTANTS.DEFAULT_TASK_TIMEOUT
|
|
1498
|
+
timeoutAfter: params.estimatedDuration || SWARM_CONSTANTS.DEFAULT_TASK_TIMEOUT,
|
|
1467
1499
|
},
|
|
1468
1500
|
priority: params.priority || 'medium',
|
|
1469
1501
|
input: {
|
|
1470
1502
|
description: params.description,
|
|
1471
|
-
objective: params.description
|
|
1503
|
+
objective: params.description,
|
|
1472
1504
|
},
|
|
1473
1505
|
context: {
|
|
1474
1506
|
objectiveId: id,
|
|
1475
|
-
targetDir: params.targetDir
|
|
1507
|
+
targetDir: params.targetDir,
|
|
1476
1508
|
},
|
|
1477
1509
|
examples: [],
|
|
1478
1510
|
status: 'created',
|
|
1479
1511
|
createdAt: new Date(),
|
|
1480
1512
|
updatedAt: new Date(),
|
|
1481
1513
|
attempts: [],
|
|
1482
|
-
statusHistory: [
|
|
1514
|
+
statusHistory: [
|
|
1515
|
+
{
|
|
1483
1516
|
timestamp: new Date(),
|
|
1484
1517
|
from: 'created',
|
|
1485
1518
|
to: 'created',
|
|
1486
1519
|
reason: 'Task created',
|
|
1487
|
-
triggeredBy: 'system'
|
|
1488
|
-
}
|
|
1520
|
+
triggeredBy: 'system',
|
|
1521
|
+
},
|
|
1522
|
+
],
|
|
1489
1523
|
};
|
|
1490
1524
|
}
|
|
1491
1525
|
analyzeDependencies(tasks) {
|
|
@@ -1496,11 +1530,11 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1496
1530
|
// Convert decomposition dependencies to task dependencies format
|
|
1497
1531
|
const result = [];
|
|
1498
1532
|
dependencies.forEach((deps, taskId) => {
|
|
1499
|
-
deps.forEach(dependsOn => {
|
|
1533
|
+
deps.forEach((dependsOn) => {
|
|
1500
1534
|
result.push({
|
|
1501
1535
|
taskId,
|
|
1502
1536
|
dependsOn,
|
|
1503
|
-
type: 'sequential'
|
|
1537
|
+
type: 'sequential',
|
|
1504
1538
|
});
|
|
1505
1539
|
});
|
|
1506
1540
|
});
|
|
@@ -1512,14 +1546,14 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1512
1546
|
async scheduleInitialTasks(objective) {
|
|
1513
1547
|
this.logger.info('Scheduling initial tasks for objective', {
|
|
1514
1548
|
objectiveId: objective.id,
|
|
1515
|
-
taskCount: objective.tasks.length
|
|
1549
|
+
taskCount: objective.tasks.length,
|
|
1516
1550
|
});
|
|
1517
1551
|
// Extract target directory from objective description
|
|
1518
1552
|
const targetDirPatterns = [
|
|
1519
1553
|
/in\s+([^\s]+\/?)$/i,
|
|
1520
1554
|
/(?:in|to|at)\s+([^\s]+\/[^\s]+)/i,
|
|
1521
1555
|
/([^\s]+\/[^\s]+)$/,
|
|
1522
|
-
/examples\/[^\s]+/i
|
|
1556
|
+
/examples\/[^\s]+/i,
|
|
1523
1557
|
];
|
|
1524
1558
|
let objectiveTargetDir = null;
|
|
1525
1559
|
for (const pattern of targetDirPatterns) {
|
|
@@ -1541,10 +1575,10 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1541
1575
|
this.trackTaskInJsonOutput(task);
|
|
1542
1576
|
}
|
|
1543
1577
|
// Find tasks with no dependencies and queue them
|
|
1544
|
-
const initialTasks = objective.tasks.filter(task => !task.constraints.dependencies || task.constraints.dependencies.length === 0);
|
|
1578
|
+
const initialTasks = objective.tasks.filter((task) => !task.constraints.dependencies || task.constraints.dependencies.length === 0);
|
|
1545
1579
|
this.logger.info('Found initial tasks without dependencies', {
|
|
1546
1580
|
count: initialTasks.length,
|
|
1547
|
-
tasks: initialTasks.map(t => ({ id: t.id.id, name: t.name }))
|
|
1581
|
+
tasks: initialTasks.map((t) => ({ id: t.id.id, name: t.name })),
|
|
1548
1582
|
});
|
|
1549
1583
|
// Queue initial tasks for execution
|
|
1550
1584
|
for (const task of initialTasks) {
|
|
@@ -1556,7 +1590,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1556
1590
|
from: 'created',
|
|
1557
1591
|
to: 'queued',
|
|
1558
1592
|
reason: 'Task queued for execution',
|
|
1559
|
-
triggeredBy: 'system'
|
|
1593
|
+
triggeredBy: 'system',
|
|
1560
1594
|
});
|
|
1561
1595
|
// Emit task queued event
|
|
1562
1596
|
this.emitSwarmEvent({
|
|
@@ -1566,7 +1600,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1566
1600
|
source: this.swarmId.id,
|
|
1567
1601
|
data: { task },
|
|
1568
1602
|
broadcast: false,
|
|
1569
|
-
processed: false
|
|
1603
|
+
processed: false,
|
|
1570
1604
|
});
|
|
1571
1605
|
}
|
|
1572
1606
|
// Update objective progress
|
|
@@ -1577,7 +1611,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1577
1611
|
}
|
|
1578
1612
|
startTaskExecutionLoop(objective) {
|
|
1579
1613
|
this.logger.info('Starting task execution loop for objective', {
|
|
1580
|
-
objectiveId: objective.id
|
|
1614
|
+
objectiveId: objective.id,
|
|
1581
1615
|
});
|
|
1582
1616
|
// Create an interval to process queued tasks
|
|
1583
1617
|
const executionInterval = setInterval(async () => {
|
|
@@ -1588,16 +1622,13 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1588
1622
|
return;
|
|
1589
1623
|
}
|
|
1590
1624
|
// Find queued tasks
|
|
1591
|
-
const queuedTasks = Array.from(this.tasks.values())
|
|
1592
|
-
.filter(task => task.context?.objectiveId === objective.id &&
|
|
1593
|
-
task.status === 'queued');
|
|
1625
|
+
const queuedTasks = Array.from(this.tasks.values()).filter((task) => task.context?.objectiveId === objective.id && task.status === 'queued');
|
|
1594
1626
|
// Find idle agents
|
|
1595
|
-
const idleAgents = Array.from(this.agents.values())
|
|
1596
|
-
.filter(agent => agent.status === 'idle');
|
|
1627
|
+
const idleAgents = Array.from(this.agents.values()).filter((agent) => agent.status === 'idle');
|
|
1597
1628
|
if (queuedTasks.length > 0 && idleAgents.length > 0) {
|
|
1598
1629
|
this.logger.debug('Processing queued tasks', {
|
|
1599
1630
|
queuedTasks: queuedTasks.length,
|
|
1600
|
-
idleAgents: idleAgents.length
|
|
1631
|
+
idleAgents: idleAgents.length,
|
|
1601
1632
|
});
|
|
1602
1633
|
}
|
|
1603
1634
|
// Assign tasks to idle agents
|
|
@@ -1605,24 +1636,21 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1605
1636
|
if (idleAgents.length === 0)
|
|
1606
1637
|
break;
|
|
1607
1638
|
// Find suitable agent
|
|
1608
|
-
const suitableAgents = idleAgents.filter(agent => this.agentCanHandleTask(agent, task));
|
|
1639
|
+
const suitableAgents = idleAgents.filter((agent) => this.agentCanHandleTask(agent, task));
|
|
1609
1640
|
if (suitableAgents.length > 0) {
|
|
1610
1641
|
// Assign to first suitable agent
|
|
1611
1642
|
await this.assignTask(task.id.id, suitableAgents[0].id.id);
|
|
1612
1643
|
// Remove agent from idle list
|
|
1613
|
-
const agentIndex = idleAgents.findIndex(a => a.id.id === suitableAgents[0].id.id);
|
|
1644
|
+
const agentIndex = idleAgents.findIndex((a) => a.id.id === suitableAgents[0].id.id);
|
|
1614
1645
|
if (agentIndex >= 0) {
|
|
1615
1646
|
idleAgents.splice(agentIndex, 1);
|
|
1616
1647
|
}
|
|
1617
1648
|
}
|
|
1618
1649
|
}
|
|
1619
1650
|
// Check for completed tasks and process dependencies
|
|
1620
|
-
const completedTasks = Array.from(this.tasks.values())
|
|
1621
|
-
.filter(task => task.context?.objectiveId === objective.id &&
|
|
1622
|
-
task.status === 'completed');
|
|
1651
|
+
const completedTasks = Array.from(this.tasks.values()).filter((task) => task.context?.objectiveId === objective.id && task.status === 'completed');
|
|
1623
1652
|
// Find tasks that can now be queued (dependencies met)
|
|
1624
|
-
const pendingTasks = Array.from(this.tasks.values())
|
|
1625
|
-
.filter(task => task.context?.objectiveId === objective.id &&
|
|
1653
|
+
const pendingTasks = Array.from(this.tasks.values()).filter((task) => task.context?.objectiveId === objective.id &&
|
|
1626
1654
|
task.status === 'created' &&
|
|
1627
1655
|
this.taskDependenciesMet(task, completedTasks));
|
|
1628
1656
|
// Queue tasks with met dependencies
|
|
@@ -1634,7 +1662,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1634
1662
|
from: 'created',
|
|
1635
1663
|
to: 'queued',
|
|
1636
1664
|
reason: 'Dependencies met, task queued',
|
|
1637
|
-
triggeredBy: 'system'
|
|
1665
|
+
triggeredBy: 'system',
|
|
1638
1666
|
});
|
|
1639
1667
|
this.emitSwarmEvent({
|
|
1640
1668
|
id: generateId('event'),
|
|
@@ -1643,13 +1671,11 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1643
1671
|
source: this.swarmId.id,
|
|
1644
1672
|
data: { task },
|
|
1645
1673
|
broadcast: false,
|
|
1646
|
-
processed: false
|
|
1674
|
+
processed: false,
|
|
1647
1675
|
});
|
|
1648
1676
|
}
|
|
1649
1677
|
// Check for stuck/timed out tasks
|
|
1650
|
-
const runningTasks = Array.from(this.tasks.values())
|
|
1651
|
-
.filter(task => task.context?.objectiveId === objective.id &&
|
|
1652
|
-
task.status === 'running');
|
|
1678
|
+
const runningTasks = Array.from(this.tasks.values()).filter((task) => task.context?.objectiveId === objective.id && task.status === 'running');
|
|
1653
1679
|
const now = Date.now();
|
|
1654
1680
|
for (const task of runningTasks) {
|
|
1655
1681
|
if (task.startedAt) {
|
|
@@ -1659,7 +1685,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1659
1685
|
this.logger.warn('Task timed out', {
|
|
1660
1686
|
taskId: task.id.id,
|
|
1661
1687
|
runtime: Math.round(runtime / 1000),
|
|
1662
|
-
timeout: Math.round(timeout / 1000)
|
|
1688
|
+
timeout: Math.round(timeout / 1000),
|
|
1663
1689
|
});
|
|
1664
1690
|
// Mark task as failed due to timeout
|
|
1665
1691
|
task.status = 'failed';
|
|
@@ -1670,7 +1696,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1670
1696
|
code: 'TASK_TIMEOUT',
|
|
1671
1697
|
context: { taskId: task.id.id, runtime },
|
|
1672
1698
|
recoverable: true,
|
|
1673
|
-
retryable: true
|
|
1699
|
+
retryable: true,
|
|
1674
1700
|
};
|
|
1675
1701
|
// Update agent state if assigned
|
|
1676
1702
|
if (task.assignedTo) {
|
|
@@ -1689,23 +1715,24 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1689
1715
|
source: this.swarmId.id,
|
|
1690
1716
|
data: { task, reason: 'timeout' },
|
|
1691
1717
|
broadcast: false,
|
|
1692
|
-
processed: false
|
|
1718
|
+
processed: false,
|
|
1693
1719
|
});
|
|
1694
1720
|
}
|
|
1695
1721
|
}
|
|
1696
1722
|
}
|
|
1697
1723
|
// Update objective progress
|
|
1698
|
-
const allTasks = Array.from(this.tasks.values())
|
|
1699
|
-
.filter(task => task.context?.objectiveId === objective.id);
|
|
1724
|
+
const allTasks = Array.from(this.tasks.values()).filter((task) => task.context?.objectiveId === objective.id);
|
|
1700
1725
|
objective.progress.totalTasks = allTasks.length;
|
|
1701
|
-
objective.progress.completedTasks = allTasks.filter(t => t.status === 'completed').length;
|
|
1702
|
-
objective.progress.failedTasks = allTasks.filter(t => t.status === 'failed').length;
|
|
1703
|
-
objective.progress.runningTasks = allTasks.filter(t => t.status === 'running').length;
|
|
1704
|
-
objective.progress.percentComplete =
|
|
1705
|
-
|
|
1706
|
-
|
|
1726
|
+
objective.progress.completedTasks = allTasks.filter((t) => t.status === 'completed').length;
|
|
1727
|
+
objective.progress.failedTasks = allTasks.filter((t) => t.status === 'failed').length;
|
|
1728
|
+
objective.progress.runningTasks = allTasks.filter((t) => t.status === 'running').length;
|
|
1729
|
+
objective.progress.percentComplete =
|
|
1730
|
+
objective.progress.totalTasks > 0
|
|
1731
|
+
? (objective.progress.completedTasks / objective.progress.totalTasks) * 100
|
|
1732
|
+
: 0;
|
|
1707
1733
|
// Check if objective is complete
|
|
1708
|
-
if (objective.progress.completedTasks + objective.progress.failedTasks ===
|
|
1734
|
+
if (objective.progress.completedTasks + objective.progress.failedTasks ===
|
|
1735
|
+
objective.progress.totalTasks) {
|
|
1709
1736
|
objective.status = objective.progress.failedTasks === 0 ? 'completed' : 'failed';
|
|
1710
1737
|
objective.completedAt = new Date();
|
|
1711
1738
|
clearInterval(executionInterval);
|
|
@@ -1713,7 +1740,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1713
1740
|
objectiveId: objective.id,
|
|
1714
1741
|
status: objective.status,
|
|
1715
1742
|
completedTasks: objective.progress.completedTasks,
|
|
1716
|
-
failedTasks: objective.progress.failedTasks
|
|
1743
|
+
failedTasks: objective.progress.failedTasks,
|
|
1717
1744
|
});
|
|
1718
1745
|
this.emitSwarmEvent({
|
|
1719
1746
|
id: generateId('event'),
|
|
@@ -1722,7 +1749,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1722
1749
|
source: this.swarmId.id,
|
|
1723
1750
|
data: { objective },
|
|
1724
1751
|
broadcast: true,
|
|
1725
|
-
processed: false
|
|
1752
|
+
processed: false,
|
|
1726
1753
|
});
|
|
1727
1754
|
}
|
|
1728
1755
|
}
|
|
@@ -1740,25 +1767,29 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1740
1767
|
if (!task.constraints.dependencies || task.constraints.dependencies.length === 0) {
|
|
1741
1768
|
return true;
|
|
1742
1769
|
}
|
|
1743
|
-
const completedTaskIds = completedTasks.map(t => t.id.id);
|
|
1744
|
-
return task.constraints.dependencies.every(dep => {
|
|
1770
|
+
const completedTaskIds = completedTasks.map((t) => t.id.id);
|
|
1771
|
+
return task.constraints.dependencies.every((dep) => {
|
|
1745
1772
|
// Handle both string and TaskId object dependencies
|
|
1746
1773
|
const depId = typeof dep === 'string' ? dep : dep.id;
|
|
1747
1774
|
return completedTaskIds.includes(depId);
|
|
1748
1775
|
});
|
|
1749
1776
|
}
|
|
1750
1777
|
getNextInstanceNumber(type) {
|
|
1751
|
-
const agentsOfType = Array.from(this.agents.values())
|
|
1752
|
-
.filter(agent => agent.type === type);
|
|
1778
|
+
const agentsOfType = Array.from(this.agents.values()).filter((agent) => agent.type === type);
|
|
1753
1779
|
return agentsOfType.length + 1;
|
|
1754
1780
|
}
|
|
1755
1781
|
getDefaultPermissions(type) {
|
|
1756
1782
|
switch (type) {
|
|
1757
|
-
case 'coordinator':
|
|
1758
|
-
|
|
1759
|
-
case '
|
|
1760
|
-
|
|
1761
|
-
|
|
1783
|
+
case 'coordinator':
|
|
1784
|
+
return ['read', 'write', 'execute', 'admin'];
|
|
1785
|
+
case 'coder':
|
|
1786
|
+
return ['read', 'write', 'execute'];
|
|
1787
|
+
case 'tester':
|
|
1788
|
+
return ['read', 'execute'];
|
|
1789
|
+
case 'reviewer':
|
|
1790
|
+
return ['read', 'write'];
|
|
1791
|
+
default:
|
|
1792
|
+
return ['read'];
|
|
1762
1793
|
}
|
|
1763
1794
|
}
|
|
1764
1795
|
async initializeAgentCapabilities(agent) {
|
|
@@ -1814,30 +1845,46 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1814
1845
|
}
|
|
1815
1846
|
getRequiredCapabilities(type) {
|
|
1816
1847
|
switch (type) {
|
|
1817
|
-
case 'coding':
|
|
1818
|
-
|
|
1819
|
-
case '
|
|
1820
|
-
|
|
1821
|
-
case '
|
|
1822
|
-
|
|
1823
|
-
|
|
1848
|
+
case 'coding':
|
|
1849
|
+
return ['code-generation', 'file-system'];
|
|
1850
|
+
case 'testing':
|
|
1851
|
+
return ['testing', 'code-review'];
|
|
1852
|
+
case 'research':
|
|
1853
|
+
return ['research', 'web-search'];
|
|
1854
|
+
case 'analysis':
|
|
1855
|
+
return ['analysis', 'documentation'];
|
|
1856
|
+
case 'review':
|
|
1857
|
+
return ['code-review', 'documentation'];
|
|
1858
|
+
case 'documentation':
|
|
1859
|
+
return ['documentation'];
|
|
1860
|
+
default:
|
|
1861
|
+
return [];
|
|
1824
1862
|
}
|
|
1825
1863
|
}
|
|
1826
1864
|
getRequiredTools(type) {
|
|
1827
1865
|
switch (type) {
|
|
1828
|
-
case 'coding':
|
|
1829
|
-
|
|
1830
|
-
case '
|
|
1831
|
-
|
|
1832
|
-
|
|
1866
|
+
case 'coding':
|
|
1867
|
+
return ['editor', 'compiler', 'debugger'];
|
|
1868
|
+
case 'testing':
|
|
1869
|
+
return ['test-runner', 'coverage-tool'];
|
|
1870
|
+
case 'research':
|
|
1871
|
+
return ['web-browser', 'search-engine'];
|
|
1872
|
+
case 'analysis':
|
|
1873
|
+
return ['data-tools', 'visualization'];
|
|
1874
|
+
default:
|
|
1875
|
+
return [];
|
|
1833
1876
|
}
|
|
1834
1877
|
}
|
|
1835
1878
|
getRequiredPermissions(type) {
|
|
1836
1879
|
switch (type) {
|
|
1837
|
-
case 'coding':
|
|
1838
|
-
|
|
1839
|
-
case '
|
|
1840
|
-
|
|
1880
|
+
case 'coding':
|
|
1881
|
+
return ['read', 'write', 'execute'];
|
|
1882
|
+
case 'testing':
|
|
1883
|
+
return ['read', 'execute'];
|
|
1884
|
+
case 'research':
|
|
1885
|
+
return ['read', 'network'];
|
|
1886
|
+
default:
|
|
1887
|
+
return ['read'];
|
|
1841
1888
|
}
|
|
1842
1889
|
}
|
|
1843
1890
|
async executeTaskWithAgent(task, agent) {
|
|
@@ -1845,7 +1892,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1845
1892
|
taskId: task.id.id,
|
|
1846
1893
|
taskName: task.name,
|
|
1847
1894
|
agentId: agent.id.id,
|
|
1848
|
-
agentName: agent.name
|
|
1895
|
+
agentName: agent.name,
|
|
1849
1896
|
});
|
|
1850
1897
|
// Extract target directory from task
|
|
1851
1898
|
const targetDir = this.extractTargetDirectory(task);
|
|
@@ -1857,20 +1904,20 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1857
1904
|
claudeFlowPath: getClaudeFlowBin(),
|
|
1858
1905
|
enableSparc: true,
|
|
1859
1906
|
verbose: this.config.logging?.level === 'debug',
|
|
1860
|
-
timeoutMinutes: this.config.taskTimeoutMinutes
|
|
1907
|
+
timeoutMinutes: this.config.taskTimeoutMinutes,
|
|
1861
1908
|
});
|
|
1862
1909
|
const result = await executor.executeTask(task, agent, targetDir);
|
|
1863
1910
|
this.logger.info('Task execution completed', {
|
|
1864
1911
|
taskId: task.id.id,
|
|
1865
1912
|
success: true,
|
|
1866
|
-
outputLength: JSON.stringify(result).length
|
|
1913
|
+
outputLength: JSON.stringify(result).length,
|
|
1867
1914
|
});
|
|
1868
1915
|
return result;
|
|
1869
1916
|
}
|
|
1870
1917
|
catch (error) {
|
|
1871
1918
|
this.logger.error('Task execution failed', {
|
|
1872
1919
|
taskId: task.id.id,
|
|
1873
|
-
error:
|
|
1920
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1874
1921
|
});
|
|
1875
1922
|
throw error;
|
|
1876
1923
|
}
|
|
@@ -1908,7 +1955,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1908
1955
|
/in\s+([^\s]+\/?)$/i, // "in examples/dir" at end
|
|
1909
1956
|
/(?:in|to|at)\s+([^\s]+\/[^\s]+)/i, // "in examples/gradio" anywhere
|
|
1910
1957
|
/([^\s]+\/[^\s]+)$/, // "examples/gradio" at end
|
|
1911
|
-
/examples\/[^\s]+/i // specifically match examples/ paths
|
|
1958
|
+
/examples\/[^\s]+/i, // specifically match examples/ paths
|
|
1912
1959
|
];
|
|
1913
1960
|
let targetDir = null;
|
|
1914
1961
|
// First check task description and input
|
|
@@ -1953,11 +2000,11 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1953
2000
|
// Build Claude arguments for non-interactive execution
|
|
1954
2001
|
const claudeArgs = [prompt];
|
|
1955
2002
|
// Always skip permissions for swarm automation
|
|
1956
|
-
claudeArgs.push(
|
|
2003
|
+
claudeArgs.push('--dangerously-skip-permissions');
|
|
1957
2004
|
// Add non-interactive flags for automation
|
|
1958
|
-
claudeArgs.push(
|
|
1959
|
-
claudeArgs.push(
|
|
1960
|
-
claudeArgs.push(
|
|
2005
|
+
claudeArgs.push('-p'); // Print mode
|
|
2006
|
+
claudeArgs.push('--output-format', 'stream-json');
|
|
2007
|
+
claudeArgs.push('--verbose'); // Required when using stream-json with -p
|
|
1961
2008
|
// Set working directory if specified
|
|
1962
2009
|
if (targetDir) {
|
|
1963
2010
|
// Ensure directory exists
|
|
@@ -1978,29 +2025,29 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
1978
2025
|
throw new Error('Claude CLI not found. Please ensure claude is installed and in PATH.');
|
|
1979
2026
|
}
|
|
1980
2027
|
// Execute Claude with the prompt
|
|
1981
|
-
const command = new Deno.Command(
|
|
2028
|
+
const command = new Deno.Command('claude', {
|
|
1982
2029
|
args: claudeArgs,
|
|
1983
2030
|
cwd: targetDir || process.cwd(),
|
|
1984
2031
|
env: {
|
|
1985
2032
|
...Deno.env.toObject(),
|
|
1986
2033
|
CLAUDE_INSTANCE_ID: instanceId,
|
|
1987
|
-
CLAUDE_SWARM_MODE:
|
|
2034
|
+
CLAUDE_SWARM_MODE: 'true',
|
|
1988
2035
|
CLAUDE_SWARM_ID: this.swarmId.id,
|
|
1989
2036
|
CLAUDE_TASK_ID: task.id.id,
|
|
1990
2037
|
CLAUDE_AGENT_ID: agent.id.id,
|
|
1991
2038
|
CLAUDE_WORKING_DIRECTORY: targetDir || process.cwd(),
|
|
1992
|
-
CLAUDE_FLOW_MEMORY_ENABLED:
|
|
2039
|
+
CLAUDE_FLOW_MEMORY_ENABLED: 'true',
|
|
1993
2040
|
CLAUDE_FLOW_MEMORY_NAMESPACE: `swarm-${this.swarmId.id}`,
|
|
1994
2041
|
},
|
|
1995
|
-
stdin:
|
|
1996
|
-
stdout:
|
|
1997
|
-
stderr:
|
|
2042
|
+
stdin: 'null',
|
|
2043
|
+
stdout: 'piped',
|
|
2044
|
+
stderr: 'piped',
|
|
1998
2045
|
});
|
|
1999
2046
|
this.logger.info('Spawning Claude agent for task', {
|
|
2000
2047
|
taskId: task.id.id,
|
|
2001
2048
|
agentId: agent.id.id,
|
|
2002
2049
|
instanceId,
|
|
2003
|
-
targetDir
|
|
2050
|
+
targetDir,
|
|
2004
2051
|
});
|
|
2005
2052
|
const child = command.spawn();
|
|
2006
2053
|
const { code, stdout, stderr } = await child.output();
|
|
@@ -2008,20 +2055,20 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
2008
2055
|
const output = new TextDecoder().decode(stdout);
|
|
2009
2056
|
this.logger.info('Claude agent completed task successfully', {
|
|
2010
2057
|
taskId: task.id.id,
|
|
2011
|
-
outputLength: output.length
|
|
2058
|
+
outputLength: output.length,
|
|
2012
2059
|
});
|
|
2013
2060
|
return {
|
|
2014
2061
|
success: true,
|
|
2015
2062
|
output,
|
|
2016
2063
|
instanceId,
|
|
2017
|
-
targetDir
|
|
2064
|
+
targetDir,
|
|
2018
2065
|
};
|
|
2019
2066
|
}
|
|
2020
2067
|
else {
|
|
2021
2068
|
const errorOutput = new TextDecoder().decode(stderr);
|
|
2022
2069
|
this.logger.error(`Claude agent failed with code ${code}`, {
|
|
2023
2070
|
taskId: task.id.id,
|
|
2024
|
-
error: errorOutput
|
|
2071
|
+
error: errorOutput,
|
|
2025
2072
|
});
|
|
2026
2073
|
throw new Error(`Claude execution failed: ${errorOutput}`);
|
|
2027
2074
|
}
|
|
@@ -2029,7 +2076,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
2029
2076
|
catch (error) {
|
|
2030
2077
|
this.logger.error('Failed to execute Claude agent', {
|
|
2031
2078
|
taskId: task.id.id,
|
|
2032
|
-
error:
|
|
2079
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2033
2080
|
});
|
|
2034
2081
|
throw error;
|
|
2035
2082
|
}
|
|
@@ -2037,46 +2084,46 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
2037
2084
|
determineToolsForTask(task, agent) {
|
|
2038
2085
|
const tools = new Set();
|
|
2039
2086
|
// Basic tools for all tasks
|
|
2040
|
-
tools.add(
|
|
2041
|
-
tools.add(
|
|
2042
|
-
tools.add(
|
|
2087
|
+
tools.add('View');
|
|
2088
|
+
tools.add('Edit');
|
|
2089
|
+
tools.add('Bash');
|
|
2043
2090
|
// Add tools based on task type
|
|
2044
2091
|
switch (task.type) {
|
|
2045
2092
|
case 'coding':
|
|
2046
|
-
tools.add(
|
|
2047
|
-
tools.add(
|
|
2048
|
-
tools.add(
|
|
2049
|
-
tools.add(
|
|
2093
|
+
tools.add('Create');
|
|
2094
|
+
tools.add('Write');
|
|
2095
|
+
tools.add('MultiEdit');
|
|
2096
|
+
tools.add('Test');
|
|
2050
2097
|
break;
|
|
2051
2098
|
case 'testing':
|
|
2052
|
-
tools.add(
|
|
2053
|
-
tools.add(
|
|
2099
|
+
tools.add('Test');
|
|
2100
|
+
tools.add('View');
|
|
2054
2101
|
break;
|
|
2055
2102
|
case 'documentation':
|
|
2056
|
-
tools.add(
|
|
2057
|
-
tools.add(
|
|
2103
|
+
tools.add('Write');
|
|
2104
|
+
tools.add('Create');
|
|
2058
2105
|
break;
|
|
2059
2106
|
case 'analysis':
|
|
2060
|
-
tools.add(
|
|
2061
|
-
tools.add(
|
|
2107
|
+
tools.add('Analyze');
|
|
2108
|
+
tools.add('Search');
|
|
2062
2109
|
break;
|
|
2063
2110
|
case 'research':
|
|
2064
|
-
tools.add(
|
|
2065
|
-
tools.add(
|
|
2111
|
+
tools.add('WebSearch');
|
|
2112
|
+
tools.add('Search');
|
|
2066
2113
|
break;
|
|
2067
2114
|
}
|
|
2068
2115
|
// Add tools based on agent capabilities
|
|
2069
2116
|
if (agent.capabilities.fileSystem) {
|
|
2070
|
-
tools.add(
|
|
2117
|
+
tools.add('FileSystem');
|
|
2071
2118
|
}
|
|
2072
2119
|
if (agent.capabilities.terminalAccess) {
|
|
2073
|
-
tools.add(
|
|
2120
|
+
tools.add('Terminal');
|
|
2074
2121
|
}
|
|
2075
2122
|
if (agent.capabilities.webSearch) {
|
|
2076
|
-
tools.add(
|
|
2123
|
+
tools.add('WebSearch');
|
|
2077
2124
|
}
|
|
2078
2125
|
if (agent.capabilities.apiIntegration) {
|
|
2079
|
-
tools.add(
|
|
2126
|
+
tools.add('API');
|
|
2080
2127
|
}
|
|
2081
2128
|
return Array.from(tools);
|
|
2082
2129
|
}
|
|
@@ -2090,7 +2137,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
2090
2137
|
/in\s+([^\s]+\/?)$/i, // "in examples/dir" at end
|
|
2091
2138
|
/(?:in|to|at)\s+([^\s]+\/[^\s]+)/i, // "in examples/gradio" anywhere
|
|
2092
2139
|
/([^\s]+\/[^\s]+)$/, // "examples/gradio" at end
|
|
2093
|
-
/examples\/[^\s]+/i // specifically match examples/ paths
|
|
2140
|
+
/examples\/[^\s]+/i, // specifically match examples/ paths
|
|
2094
2141
|
];
|
|
2095
2142
|
let targetDir = null;
|
|
2096
2143
|
for (const pattern of patterns) {
|
|
@@ -2109,7 +2156,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
2109
2156
|
this.logger.debug('Extracted target directory', {
|
|
2110
2157
|
original: task.description,
|
|
2111
2158
|
targetDir,
|
|
2112
|
-
workDir
|
|
2159
|
+
workDir,
|
|
2113
2160
|
});
|
|
2114
2161
|
}
|
|
2115
2162
|
try {
|
|
@@ -2129,7 +2176,7 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
2129
2176
|
}
|
|
2130
2177
|
}
|
|
2131
2178
|
catch (error) {
|
|
2132
|
-
throw new Error(`Task execution failed: ${
|
|
2179
|
+
throw new Error(`Task execution failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
2133
2180
|
}
|
|
2134
2181
|
}
|
|
2135
2182
|
async executeCodeGenerationTask(task, workDir, agent) {
|
|
@@ -2137,7 +2184,10 @@ Ensure your implementation is complete, well-structured, and follows best practi
|
|
|
2137
2184
|
// Detect technology from description
|
|
2138
2185
|
const description = task.description.toLowerCase();
|
|
2139
2186
|
const isGradio = description.includes('gradio');
|
|
2140
|
-
const isPython = isGradio ||
|
|
2187
|
+
const isPython = isGradio ||
|
|
2188
|
+
description.includes('python') ||
|
|
2189
|
+
description.includes('fastapi') ||
|
|
2190
|
+
description.includes('django');
|
|
2141
2191
|
const isHelloWorld = description.includes('hello') && description.includes('world');
|
|
2142
2192
|
const isRestAPI = description.includes('rest api') || description.includes('api');
|
|
2143
2193
|
if (isGradio) {
|
|
@@ -2234,31 +2284,31 @@ module.exports = app;
|
|
|
2234
2284
|
// Create package.json
|
|
2235
2285
|
const packageJson = {
|
|
2236
2286
|
name: projectName,
|
|
2237
|
-
version:
|
|
2238
|
-
description:
|
|
2239
|
-
main:
|
|
2287
|
+
version: '1.0.0',
|
|
2288
|
+
description: 'REST API created by Claude Flow Swarm',
|
|
2289
|
+
main: 'server.js',
|
|
2240
2290
|
scripts: {
|
|
2241
|
-
start:
|
|
2242
|
-
dev:
|
|
2243
|
-
test:
|
|
2291
|
+
start: 'node server.js',
|
|
2292
|
+
dev: 'nodemon server.js',
|
|
2293
|
+
test: 'jest',
|
|
2244
2294
|
},
|
|
2245
|
-
keywords: [
|
|
2246
|
-
author:
|
|
2247
|
-
license:
|
|
2295
|
+
keywords: ['rest', 'api', 'swarm', 'claude-flow'],
|
|
2296
|
+
author: 'Claude Flow Swarm',
|
|
2297
|
+
license: 'MIT',
|
|
2248
2298
|
dependencies: {
|
|
2249
|
-
express:
|
|
2299
|
+
express: '^4.18.2',
|
|
2250
2300
|
},
|
|
2251
2301
|
devDependencies: {
|
|
2252
|
-
nodemon:
|
|
2253
|
-
jest:
|
|
2254
|
-
supertest:
|
|
2302
|
+
nodemon: '^3.0.1',
|
|
2303
|
+
jest: '^29.7.0',
|
|
2304
|
+
supertest: '^6.3.3',
|
|
2255
2305
|
},
|
|
2256
2306
|
swarmMetadata: {
|
|
2257
2307
|
swarmId: this.swarmId.id,
|
|
2258
2308
|
taskId: task.id.id,
|
|
2259
2309
|
agentId: agent.id.id,
|
|
2260
|
-
created: new Date().toISOString()
|
|
2261
|
-
}
|
|
2310
|
+
created: new Date().toISOString(),
|
|
2311
|
+
},
|
|
2262
2312
|
};
|
|
2263
2313
|
await fs.writeFile(`${projectDir}/package.json`, JSON.stringify(packageJson, null, 2));
|
|
2264
2314
|
// Create README
|
|
@@ -2319,13 +2369,13 @@ coverage/
|
|
|
2319
2369
|
output: {
|
|
2320
2370
|
message: 'REST API created successfully',
|
|
2321
2371
|
location: projectDir,
|
|
2322
|
-
files: ['server.js', 'package.json', 'README.md', '.gitignore']
|
|
2372
|
+
files: ['server.js', 'package.json', 'README.md', '.gitignore'],
|
|
2323
2373
|
},
|
|
2324
2374
|
artifacts: {
|
|
2325
2375
|
mainFile: `${projectDir}/server.js`,
|
|
2326
2376
|
packageFile: `${projectDir}/package.json`,
|
|
2327
|
-
readmeFile: `${projectDir}/README.md
|
|
2328
|
-
}
|
|
2377
|
+
readmeFile: `${projectDir}/README.md`,
|
|
2378
|
+
},
|
|
2329
2379
|
};
|
|
2330
2380
|
}
|
|
2331
2381
|
else if (isHelloWorld) {
|
|
@@ -2352,17 +2402,17 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
|
2352
2402
|
await fs.writeFile(`${projectDir}/index.js`, mainCode);
|
|
2353
2403
|
// Create package.json
|
|
2354
2404
|
const packageJson = {
|
|
2355
|
-
name:
|
|
2356
|
-
version:
|
|
2357
|
-
description:
|
|
2358
|
-
main:
|
|
2405
|
+
name: 'hello-world',
|
|
2406
|
+
version: '1.0.0',
|
|
2407
|
+
description: 'Hello World application created by Claude Flow Swarm',
|
|
2408
|
+
main: 'index.js',
|
|
2359
2409
|
scripts: {
|
|
2360
|
-
start:
|
|
2361
|
-
test:
|
|
2410
|
+
start: 'node index.js',
|
|
2411
|
+
test: 'node test.js',
|
|
2362
2412
|
},
|
|
2363
|
-
keywords: [
|
|
2364
|
-
author:
|
|
2365
|
-
license:
|
|
2413
|
+
keywords: ['hello-world', 'swarm', 'claude-flow'],
|
|
2414
|
+
author: 'Claude Flow Swarm',
|
|
2415
|
+
license: 'MIT',
|
|
2366
2416
|
};
|
|
2367
2417
|
await fs.writeFile(`${projectDir}/package.json`, JSON.stringify(packageJson, null, 2));
|
|
2368
2418
|
// Create README
|
|
@@ -2390,13 +2440,13 @@ ${task.description}
|
|
|
2390
2440
|
output: {
|
|
2391
2441
|
message: 'Hello World application created successfully',
|
|
2392
2442
|
location: projectDir,
|
|
2393
|
-
files: ['index.js', 'package.json', 'README.md']
|
|
2443
|
+
files: ['index.js', 'package.json', 'README.md'],
|
|
2394
2444
|
},
|
|
2395
2445
|
artifacts: {
|
|
2396
2446
|
mainFile: `${projectDir}/index.js`,
|
|
2397
2447
|
packageFile: `${projectDir}/package.json`,
|
|
2398
|
-
readmeFile: `${projectDir}/README.md
|
|
2399
|
-
}
|
|
2448
|
+
readmeFile: `${projectDir}/README.md`,
|
|
2449
|
+
},
|
|
2400
2450
|
};
|
|
2401
2451
|
}
|
|
2402
2452
|
// For other code generation tasks, create a basic structure
|
|
@@ -2418,8 +2468,8 @@ main();
|
|
|
2418
2468
|
output: {
|
|
2419
2469
|
message: 'Code generated successfully',
|
|
2420
2470
|
location: projectDir,
|
|
2421
|
-
files: ['main.js']
|
|
2422
|
-
}
|
|
2471
|
+
files: ['main.js'],
|
|
2472
|
+
},
|
|
2423
2473
|
};
|
|
2424
2474
|
}
|
|
2425
2475
|
async executeAnalysisTask(task, workDir, agent) {
|
|
@@ -2433,21 +2483,21 @@ main();
|
|
|
2433
2483
|
findings: [
|
|
2434
2484
|
'Analysis point 1: Task objectives are clear',
|
|
2435
2485
|
'Analysis point 2: Resources are allocated',
|
|
2436
|
-
'Analysis point 3: Implementation path is defined'
|
|
2486
|
+
'Analysis point 3: Implementation path is defined',
|
|
2437
2487
|
],
|
|
2438
2488
|
recommendations: [
|
|
2439
2489
|
'Proceed with implementation',
|
|
2440
2490
|
'Monitor progress regularly',
|
|
2441
|
-
'Adjust resources as needed'
|
|
2442
|
-
]
|
|
2491
|
+
'Adjust resources as needed',
|
|
2492
|
+
],
|
|
2443
2493
|
};
|
|
2444
2494
|
await fs.writeFile(`${analysisDir}/analysis-report.json`, JSON.stringify(analysis, null, 2));
|
|
2445
2495
|
return {
|
|
2446
2496
|
success: true,
|
|
2447
2497
|
output: analysis,
|
|
2448
2498
|
artifacts: {
|
|
2449
|
-
report: `${analysisDir}/analysis-report.json
|
|
2450
|
-
}
|
|
2499
|
+
report: `${analysisDir}/analysis-report.json`,
|
|
2500
|
+
},
|
|
2451
2501
|
};
|
|
2452
2502
|
}
|
|
2453
2503
|
async executeDocumentationTask(task, workDir, agent) {
|
|
@@ -2479,11 +2529,11 @@ ${task.instructions}
|
|
|
2479
2529
|
output: {
|
|
2480
2530
|
message: 'Documentation created successfully',
|
|
2481
2531
|
location: docsDir,
|
|
2482
|
-
files: ['documentation.md']
|
|
2532
|
+
files: ['documentation.md'],
|
|
2483
2533
|
},
|
|
2484
2534
|
artifacts: {
|
|
2485
|
-
documentation: `${docsDir}/documentation.md
|
|
2486
|
-
}
|
|
2535
|
+
documentation: `${docsDir}/documentation.md`,
|
|
2536
|
+
},
|
|
2487
2537
|
};
|
|
2488
2538
|
}
|
|
2489
2539
|
async executeTestingTask(task, workDir, agent) {
|
|
@@ -2516,11 +2566,11 @@ console.log('Tests completed for: ${task.name}');
|
|
|
2516
2566
|
location: testDir,
|
|
2517
2567
|
files: ['test.js'],
|
|
2518
2568
|
testsPassed: 2,
|
|
2519
|
-
testsFailed: 0
|
|
2569
|
+
testsFailed: 0,
|
|
2520
2570
|
},
|
|
2521
2571
|
artifacts: {
|
|
2522
|
-
testFile: `${testDir}/test.js
|
|
2523
|
-
}
|
|
2572
|
+
testFile: `${testDir}/test.js`,
|
|
2573
|
+
},
|
|
2524
2574
|
};
|
|
2525
2575
|
}
|
|
2526
2576
|
async executeGenericTask(task, workDir, agent) {
|
|
@@ -2533,15 +2583,15 @@ console.log('Tests completed for: ${task.name}');
|
|
|
2533
2583
|
description: task.description,
|
|
2534
2584
|
status: 'completed',
|
|
2535
2585
|
timestamp: new Date().toISOString(),
|
|
2536
|
-
result: 'Task executed successfully'
|
|
2586
|
+
result: 'Task executed successfully',
|
|
2537
2587
|
};
|
|
2538
2588
|
await fs.writeFile(`${outputDir}/result.json`, JSON.stringify(output, null, 2));
|
|
2539
2589
|
return {
|
|
2540
2590
|
success: true,
|
|
2541
2591
|
output,
|
|
2542
2592
|
artifacts: {
|
|
2543
|
-
result: `${outputDir}/result.json
|
|
2544
|
-
}
|
|
2593
|
+
result: `${outputDir}/result.json`,
|
|
2594
|
+
},
|
|
2545
2595
|
};
|
|
2546
2596
|
}
|
|
2547
2597
|
assessTaskQuality(task, result) {
|
|
@@ -2585,7 +2635,7 @@ console.log('Tests completed for: ${task.name}');
|
|
|
2585
2635
|
if (timeSinceHeartbeat > timeout) {
|
|
2586
2636
|
this.logger.warn('Agent heartbeat timeout', {
|
|
2587
2637
|
agentId: agent.id.id,
|
|
2588
|
-
timeSinceHeartbeat
|
|
2638
|
+
timeSinceHeartbeat,
|
|
2589
2639
|
});
|
|
2590
2640
|
agent.status = 'error';
|
|
2591
2641
|
agent.health = 0;
|