Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

πŸ”– Checkpoint: Edit /workspaces/claude-code-flow/src/cli/simple-commands/automation-executor.js

rUv221b28c47490
diff --git a/.claude/checkpoints/task-1754345020.json b/.claude/checkpoints/task-1754345020.json
new file mode 100644
index 0000000000..08830500ca
--- /dev/null
+++ b/.claude/checkpoints/task-1754345020.json
@@ -0,0 +1 @@
+{"checkpoint": "task-20250804-220339", "task": "{{user_prompt}} ", "timestamp": "2025-08-04T22:03:40Z", "commit": "9fe524af2f1159c94e540e5600d1ddfdbc17590d", "github_release": "true"}
diff --git a/src/cli/simple-commands/automation-executor.js b/src/cli/simple-commands/automation-executor.js
index f79dd78181..7b9073bb5e 100644
--- a/src/cli/simple-commands/automation-executor.js
+++ b/src/cli/simple-commands/automation-executor.js
@@ -139,53 +139,56 @@ export class WorkflowExecutor {
if (!agents || agents.length === 0) {
return;
}
-
- console.log(`πŸ€– Initializing ${agents.length} Claude CLI instances...`);
- // In non-interactive mode, agents are spawned per task instead
+ // Check if Claude CLI is available
+ if (!await this.isClaudeAvailable()) {
+ throw new Error('Claude CLI not found. Please install Claude Code: https://claude.ai/code');
+ }
+
if (this.options.nonInteractive) {
- console.log(`πŸ“Œ Note: In non-interactive mode, Claude instances are spawned per task`);
- console.log(`πŸ“‹ Each task will launch its own Claude process with the specific prompt`);
+ // Non-interactive mode: agents are spawned per task instead
+ console.log(`πŸ€– Non-interactive mode: Claude instances will be spawned per task`);
+ console.log(`πŸ“‹ Each task will launch its own Claude process with specific prompts`);
return;
- }
-
- for (const agent of agents) {
+ } else {
+ // Interactive mode: spawn single Claude instance with master coordination prompt
+ console.log(`πŸ€– Interactive mode: Initializing single Claude instance for workflow coordination...`);
+
try {
- // Check if Claude CLI is available
- if (!await this.isClaudeAvailable()) {
- throw new Error('Claude CLI not found. Please install Claude Code: https://claude.ai/code');
- }
-
- // Create agent-specific prompt
- const agentPrompt = this.createAgentPrompt(agent);
+ // Create master coordination prompt for all agents and workflow
+ const masterPrompt = this.createMasterCoordinationPrompt(agents);
- // Spawn Claude instance for this agent
- const claudeProcess = await this.spawnClaudeInstance(agent, agentPrompt);
+ // Spawn single Claude instance for workflow coordination
+ const claudeProcess = await this.spawnClaudeInstance({
+ id: 'master-coordinator',
+ name: 'Workflow Coordinator',
+ type: 'coordinator'
+ }, masterPrompt);
- this.claudeInstances.set(agent.id, {
+ // Store as master coordinator
+ this.claudeInstances.set('master-coordinator', {
process: claudeProcess,
- agent: agent,
+ agent: { id: 'master-coordinator', name: 'Workflow Coordinator', type: 'coordinator' },
status: 'active',
- startTime: Date.now()
+ startTime: Date.now(),
+ agents: agents // Store agent definitions for reference
});
- console.log(` βœ… ${agent.name} (${agent.type}) - PID: ${claudeProcess.pid}`);
+ console.log(` βœ… Master Workflow Coordinator (PID: ${claudeProcess.pid})`);
+ console.log(` 🎯 Coordinating ${agents.length} sub-agents via concurrent streams`);
+ console.log(` πŸ“‹ Agents: ${agents.map(a => a.name).join(', ')}`);
} catch (error) {
- console.error(` ❌ Failed to initialize ${agent.name}: ${error.message}`);
+ console.error(` ❌ Failed to initialize master coordinator: ${error.message}`);
this.errors.push({
- type: 'agent_initialization',
- agent: agent.id,
+ type: 'master_coordinator_initialization',
error: error.message,
timestamp: new Date()
});
}
+
+ console.log();
}
-
- if (this.claudeInstances.size > 0) {
- console.log(`βœ… ${this.claudeInstances.size} Claude instances active`);
- }
- console.log();
}
/**