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

rUv27ff6bd8361e
diff --git a/.claude/checkpoints/1754338973.json b/.claude/checkpoints/1754338973.json
new file mode 100644
index 0000000000..8f9868e184
--- /dev/null
+++ b/.claude/checkpoints/1754338973.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250804-202253", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/automation-executor.js", "timestamp": "2025-08-04T20:22:53Z", "type": "pre-edit", "original_branch": "alpha-85"}
diff --git a/.claude/checkpoints/1754338975.json b/.claude/checkpoints/1754338975.json
new file mode 100644
index 0000000000..b7f836eef2
--- /dev/null
+++ b/.claude/checkpoints/1754338975.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250804-202255", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/automation-executor.js", "timestamp": "2025-08-04T20:22:55Z", "type": "post-edit", "branch": "alpha-85", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 24 ++++++++++++++++++++++++ .claude-flow/metrics/task-metrics.json | 6 +++--- .claude/checkpoints/1754338960.json | 1 + .claude/checkpoints/1754338962.json | 1 + claude-flow-wiki | 0 src/cli/simple-commands/automation-executor.js | 3 +-- 7 files changed, 31 insertions(+), 6 deletions(-) "}
diff --git a/src/cli/simple-commands/automation-executor.js b/src/cli/simple-commands/automation-executor.js
index 77968802b5..b2317c5565 100644
--- a/src/cli/simple-commands/automation-executor.js
+++ b/src/cli/simple-commands/automation-executor.js
@@ -234,62 +234,38 @@ export class WorkflowExecutor {
shell: false,
});
- // No need to manually handle stdout in non-interactive mode with inherit
- if (false && this.options.nonInteractive && claudeProcess.stdout) {
- let buffer = '';
-
- claudeProcess.stdout.on('data', (data) => {
- const dataStr = data.toString();
- buffer += dataStr;
-
- // Also log raw data for debugging
- if (this.options.logLevel === 'debug') {
- console.log(`[DEBUG] Raw stdout from ${agent.name}:`, dataStr);
- }
-
- // Process complete JSON objects from the stream
- const lines = buffer.split('\n');
- buffer = lines.pop() || ''; // Keep incomplete line in buffer
-
- for (const line of lines) {
- if (line.trim()) {
- try {
- const event = JSON.parse(line);
- this.handleClaudeStreamEvent(agent, event);
- } catch (error) {
- // Not JSON, might be regular output
- if (this.options.outputFormat === 'stream-json') {
- console.log(JSON.stringify({
- type: 'agent_output',
- agent: agent.id,
- name: agent.name,
- message: line,
- timestamp: new Date().toISOString()
- }));
- } else {
- console.log(` [${agent.name}] ${line}`);
- }
- }
- }
+ // Handle stdout with stream processor for better formatting
+ if (this.options.nonInteractive && this.options.outputFormat === 'stream-json' && claudeProcess.stdout) {
+ // Import and use stream processor
+ const { createStreamProcessor } = await import('./stream-processor.js');
+ const streamProcessor = createStreamProcessor(
+ agent.name,
+ this.getAgentIcon(agent.id),
+ {
+ verbose: this.options.logLevel === 'debug',
+ taskId: agent.taskId
}
- });
+ );
+
+ // Pipe stdout through processor
+ claudeProcess.stdout.pipe(streamProcessor);
+ // Handle stderr
claudeProcess.stderr.on('data', (data) => {
const message = data.toString().trim();
if (message) {
- if (this.options.outputFormat === 'stream-json') {
- console.log(JSON.stringify({
- type: 'agent_error',
- agent: agent.id,
- name: agent.name,
- error: message,
- timestamp: new Date().toISOString()
- }));
- } else {
- console.error(` ❌ [${agent.name}] Error: ${message}`);
- }
+ console.error(` ❌ [${agent.name}] Error: ${message}`);
}
});
+ } else if (this.options.outputFormat !== 'stream-json') {
+ // For non-stream-json output, show stdout directly
+ claudeProcess.stdout.on('data', (data) => {
+ console.log(data.toString().trimEnd());
+ });
+
+ claudeProcess.stderr.on('data', (data) => {
+ console.error(data.toString().trimEnd());
+ });
}
// Handle process events