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/stream-chain.js

rUv075fce503eb8
diff --git a/.claude/checkpoints/1755022457.json b/.claude/checkpoints/1755022457.json
new file mode 100644
index 0000000000..bb8e1e22b6
--- /dev/null
+++ b/.claude/checkpoints/1755022457.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250812-181417", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/stream-chain.js", "timestamp": "2025-08-12T18:14:17Z", "type": "pre-edit", "original_branch": "alpha-89"}
diff --git a/.claude/checkpoints/1755022458.json b/.claude/checkpoints/1755022458.json
new file mode 100644
index 0000000000..384aa95996
--- /dev/null
+++ b/.claude/checkpoints/1755022458.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250812-181418", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/stream-chain.js", "timestamp": "2025-08-12T18:14:18Z", "type": "post-edit", "branch": "alpha-89", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 12 ++++++++++++ .claude-flow/metrics/task-metrics.json | 6 +++--- .claude/checkpoints/1755022444.json | 1 + .claude/checkpoints/1755022446.json | 1 + claude-flow-wiki | 0 src/cli/simple-commands/stream-chain.js | 2 +- 7 files changed, 19 insertions(+), 5 deletions(-) "}
diff --git a/src/cli/simple-commands/stream-chain.js b/src/cli/simple-commands/stream-chain.js
index 4b31118b18..df2a2290b1 100644
--- a/src/cli/simple-commands/stream-chain.js
+++ b/src/cli/simple-commands/stream-chain.js
@@ -8,6 +8,78 @@ import { spawn, execSync } from 'child_process';
import fs from 'fs/promises';
import path from 'path';
+/**
+ * Check if claude CLI is available
+ */
+function checkClaudeAvailable() {
+ try {
+ execSync('which claude', { stdio: 'ignore' });
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+/**
+ * Mock stream step implementation when claude CLI isn't available
+ */
+function mockStreamStep(prompt, inputStream, isLast, flags, resolve, startTime) {
+ const duration = Date.now() - startTime;
+
+ // Simulate processing time
+ setTimeout(() => {
+ const mockOutput = generateMockOutput(prompt, inputStream);
+
+ if (flags.verbose) {
+ console.log('\nπŸ“ Mock output generated (claude CLI not available)');
+ console.log(' Install claude CLI for real stream chaining');
+ }
+
+ resolve({
+ success: true,
+ duration: duration + 500,
+ output: mockOutput.text,
+ stream: !isLast ? mockOutput.stream : null,
+ error: null
+ });
+ }, 500);
+}
+
+/**
+ * Generate mock output based on prompt
+ */
+function generateMockOutput(prompt, inputStream) {
+ const timestamp = new Date().toISOString();
+
+ // Create mock stream-json output
+ const streamJson = JSON.stringify({
+ type: 'message',
+ role: 'assistant',
+ content: [{
+ type: 'text',
+ text: `Mock processing: ${prompt.slice(0, 50)}...`
+ }],
+ timestamp
+ });
+
+ // Create mock text output
+ const text = `βœ… Mock Step Completed
+━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+Prompt: ${prompt.slice(0, 100)}...
+${inputStream ? 'Input: Received from previous step' : 'Input: None'}
+
+Note: This is a mock response. Install claude CLI for real execution:
+ npm install -g @anthropic-ai/claude-cli
+
+Or use with Claude Code:
+ claude -p --output-format stream-json "${prompt}"`;
+
+ return {
+ text,
+ stream: streamJson
+ };
+}
+
/**
* Stream Chain command handler
*/